--- /srv/rebuilderd/tmp/rebuilderd1vzbGG/inputs/libdune-functions-doc_2.11.0+dfsg-2_all.deb +++ /srv/rebuilderd/tmp/rebuilderd1vzbGG/out/libdune-functions-doc_2.11.0+dfsg-2_all.deb ├── file list │ @@ -1,3 +1,3 @@ │ -rw-r--r-- 0 0 0 4 2026-02-06 16:11:35.000000 debian-binary │ --rw-r--r-- 0 0 0 22996 2026-02-06 16:11:35.000000 control.tar.xz │ --rw-r--r-- 0 0 0 5474204 2026-02-06 16:11:35.000000 data.tar.xz │ +-rw-r--r-- 0 0 0 22952 2026-02-06 16:11:35.000000 control.tar.xz │ +-rw-r--r-- 0 0 0 5473068 2026-02-06 16:11:35.000000 data.tar.xz ├── control.tar.xz │ ├── control.tar │ │ ├── ./md5sums │ │ │ ├── ./md5sums │ │ │ │┄ Files differ │ │ │ ├── line order │ │ │ │ @@ -1,19 +1,20 @@ │ │ │ │ usr/share/doc/libdune-functions-doc/changelog.Debian.gz │ │ │ │ usr/share/doc/libdune-functions-doc/changelog.gz │ │ │ │ usr/share/doc/libdune-functions-doc/copyright │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00041.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00041.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00041_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00044.html │ │ │ │ -usr/share/doc/libdune-functions-doc/doxygen/a00044.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00044_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00047.html │ │ │ │ +usr/share/doc/libdune-functions-doc/doxygen/a00047.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00047_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00050.html │ │ │ │ +usr/share/doc/libdune-functions-doc/doxygen/a00050.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00050_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00053.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00053.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00053_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00056.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00056_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00059.html │ │ │ │ @@ -23,41 +24,36 @@ │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00062_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00065.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00065.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00065_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00068.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00068_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00071.html │ │ │ │ -usr/share/doc/libdune-functions-doc/doxygen/a00071.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00071_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00074.html │ │ │ │ -usr/share/doc/libdune-functions-doc/doxygen/a00074.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00074_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00077.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00077_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00080.html │ │ │ │ -usr/share/doc/libdune-functions-doc/doxygen/a00080.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00080_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00083.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00083.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00083_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00086.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00086.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00086_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00089.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00089.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00089_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00092.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00092.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00092_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00095.html │ │ │ │ -usr/share/doc/libdune-functions-doc/doxygen/a00095.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00095_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00098.html │ │ │ │ -usr/share/doc/libdune-functions-doc/doxygen/a00098.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00098_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00101.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00101.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00101_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00104.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00104.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00104_source.html │ │ │ │ @@ -72,63 +68,59 @@ │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00113_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00116.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00116.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00116_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00119.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00119.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00119_source.html │ │ │ │ -usr/share/doc/libdune-functions-doc/doxygen/a00122.html │ │ │ │ -usr/share/doc/libdune-functions-doc/doxygen/a00122.js │ │ │ │ -usr/share/doc/libdune-functions-doc/doxygen/a00122_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00125.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00125.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00125_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00128.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00128.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00128_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00131.html │ │ │ │ -usr/share/doc/libdune-functions-doc/doxygen/a00131.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00131_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00134.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00134.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00134_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00137.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00137.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00137_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00140.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00140.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00140_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00143.html │ │ │ │ -usr/share/doc/libdune-functions-doc/doxygen/a00143.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00143_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00146.html │ │ │ │ +usr/share/doc/libdune-functions-doc/doxygen/a00146.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00146_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00149.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00149_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00152.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00152.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00152_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00155.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00155.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00155_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00158.html │ │ │ │ -usr/share/doc/libdune-functions-doc/doxygen/a00158.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00158_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00161.html │ │ │ │ -usr/share/doc/libdune-functions-doc/doxygen/a00161.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00161_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00164.html │ │ │ │ -usr/share/doc/libdune-functions-doc/doxygen/a00164.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00164_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00167.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00167.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00167_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00170.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00170.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00170_source.html │ │ │ │ +usr/share/doc/libdune-functions-doc/doxygen/a00173.html │ │ │ │ +usr/share/doc/libdune-functions-doc/doxygen/a00173.js │ │ │ │ +usr/share/doc/libdune-functions-doc/doxygen/a00173_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00176.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00176.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00176_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00179.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00179.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00179_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00182.html │ │ │ │ @@ -143,71 +135,79 @@ │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00191.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00191.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00191_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00194.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00194.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00194_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00197.html │ │ │ │ +usr/share/doc/libdune-functions-doc/doxygen/a00197.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00197_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00200.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00200.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00200_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00203.html │ │ │ │ -usr/share/doc/libdune-functions-doc/doxygen/a00203.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00203_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00206.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00206.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00206_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00209.html │ │ │ │ +usr/share/doc/libdune-functions-doc/doxygen/a00209.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00209_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00212.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00212.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00212_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00215.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00215.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00215_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00218.html │ │ │ │ +usr/share/doc/libdune-functions-doc/doxygen/a00218.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00218_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00221.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00221.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00221_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00224.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00224.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00224_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00227.html │ │ │ │ +usr/share/doc/libdune-functions-doc/doxygen/a00227.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00227_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00230.html │ │ │ │ +usr/share/doc/libdune-functions-doc/doxygen/a00230.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00230_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00233.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00233.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00233_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00236.html │ │ │ │ +usr/share/doc/libdune-functions-doc/doxygen/a00236.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00236_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00239.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00239.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00239_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00242.html │ │ │ │ +usr/share/doc/libdune-functions-doc/doxygen/a00242.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00242_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00245.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00245.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00245_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00248.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00248.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00248_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00251.html │ │ │ │ +usr/share/doc/libdune-functions-doc/doxygen/a00251.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00251_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00254.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00254.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00254_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00257.html │ │ │ │ +usr/share/doc/libdune-functions-doc/doxygen/a00257.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00257_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00260.html │ │ │ │ +usr/share/doc/libdune-functions-doc/doxygen/a00260.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00260_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00263.html │ │ │ │ -usr/share/doc/libdune-functions-doc/doxygen/a00263.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00263_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00266.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00266.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00266_source.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00269.html │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00269.js │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00269_source.html ├── data.tar.xz │ ├── data.tar │ │ ├── file list │ │ │ @@ -3,233 +3,233 @@ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-02-06 16:11:35.000000 ./usr/share/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-02-06 16:11:35.000000 ./usr/share/doc/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/ │ │ │ -rw-r--r-- 0 root (0) root (0) 1270 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/changelog.Debian.gz │ │ │ -rw-r--r-- 0 root (0) root (0) 7305 2026-01-28 07:53:54.000000 ./usr/share/doc/libdune-functions-doc/changelog.gz │ │ │ -rw-r--r-- 0 root (0) root (0) 3420 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/copyright │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/ │ │ │ --rw-r--r-- 0 root (0) root (0) 7350 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00041.html │ │ │ --rw-r--r-- 0 root (0) root (0) 298 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00041.js │ │ │ --rw-r--r-- 0 root (0) root (0) 14613 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00041_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 9334 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00044.html │ │ │ --rw-r--r-- 0 root (0) root (0) 349 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00044.js │ │ │ --rw-r--r-- 0 root (0) root (0) 18796 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00044_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 6117 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00047.html │ │ │ --rw-r--r-- 0 root (0) root (0) 23978 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00047_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 5678 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00050.html │ │ │ --rw-r--r-- 0 root (0) root (0) 15530 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00050_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 7664 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00053.html │ │ │ --rw-r--r-- 0 root (0) root (0) 138 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00053.js │ │ │ --rw-r--r-- 0 root (0) root (0) 32568 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00053_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 7006 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00056.html │ │ │ --rw-r--r-- 0 root (0) root (0) 58596 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00056_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 6696 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00059.html │ │ │ --rw-r--r-- 0 root (0) root (0) 36929 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00059_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 12021 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00062.html │ │ │ --rw-r--r-- 0 root (0) root (0) 738 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00062.js │ │ │ --rw-r--r-- 0 root (0) root (0) 140764 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00062_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 8279 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00065.html │ │ │ --rw-r--r-- 0 root (0) root (0) 229 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00065.js │ │ │ --rw-r--r-- 0 root (0) root (0) 40776 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00065_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 6948 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00068.html │ │ │ --rw-r--r-- 0 root (0) root (0) 46487 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00068_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 8905 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00071.html │ │ │ --rw-r--r-- 0 root (0) root (0) 237 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00071.js │ │ │ --rw-r--r-- 0 root (0) root (0) 52097 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00071_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 12771 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00074.html │ │ │ --rw-r--r-- 0 root (0) root (0) 737 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00074.js │ │ │ --rw-r--r-- 0 root (0) root (0) 67782 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00074_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 5534 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00077.html │ │ │ --rw-r--r-- 0 root (0) root (0) 19797 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00077_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 9358 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00080.html │ │ │ --rw-r--r-- 0 root (0) root (0) 398 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00080.js │ │ │ --rw-r--r-- 0 root (0) root (0) 73483 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00080_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 6382 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00083.html │ │ │ --rw-r--r-- 0 root (0) root (0) 104 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00083.js │ │ │ --rw-r--r-- 0 root (0) root (0) 36705 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00083_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 9331 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00086.html │ │ │ --rw-r--r-- 0 root (0) root (0) 487 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00086.js │ │ │ --rw-r--r-- 0 root (0) root (0) 41518 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00086_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 8725 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00089.html │ │ │ --rw-r--r-- 0 root (0) root (0) 310 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00089.js │ │ │ --rw-r--r-- 0 root (0) root (0) 28737 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00089_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 8745 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00092.html │ │ │ --rw-r--r-- 0 root (0) root (0) 251 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00092.js │ │ │ --rw-r--r-- 0 root (0) root (0) 52279 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00092_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 9484 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00095.html │ │ │ --rw-r--r-- 0 root (0) root (0) 326 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00095.js │ │ │ --rw-r--r-- 0 root (0) root (0) 41581 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00095_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 10103 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00098.html │ │ │ --rw-r--r-- 0 root (0) root (0) 406 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00098.js │ │ │ --rw-r--r-- 0 root (0) root (0) 81847 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00098_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 9294 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00101.html │ │ │ --rw-r--r-- 0 root (0) root (0) 317 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00101.js │ │ │ --rw-r--r-- 0 root (0) root (0) 51286 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00101_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 9555 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00104.html │ │ │ --rw-r--r-- 0 root (0) root (0) 312 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00104.js │ │ │ --rw-r--r-- 0 root (0) root (0) 39397 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00104_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 8338 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00107.html │ │ │ --rw-r--r-- 0 root (0) root (0) 235 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00107.js │ │ │ --rw-r--r-- 0 root (0) root (0) 36914 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00107_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 9685 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00110.html │ │ │ --rw-r--r-- 0 root (0) root (0) 789 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00110.js │ │ │ --rw-r--r-- 0 root (0) root (0) 99734 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00110_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 9529 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00113.html │ │ │ --rw-r--r-- 0 root (0) root (0) 416 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00113.js │ │ │ --rw-r--r-- 0 root (0) root (0) 63596 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00113_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 11448 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00116.html │ │ │ --rw-r--r-- 0 root (0) root (0) 295 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00116.js │ │ │ --rw-r--r-- 0 root (0) root (0) 100329 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00116_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 8102 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00119.html │ │ │ --rw-r--r-- 0 root (0) root (0) 209 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00119.js │ │ │ --rw-r--r-- 0 root (0) root (0) 30565 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00119_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 6322 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00122.html │ │ │ --rw-r--r-- 0 root (0) root (0) 104 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00122.js │ │ │ --rw-r--r-- 0 root (0) root (0) 18777 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00122_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 7325 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00125.html │ │ │ --rw-r--r-- 0 root (0) root (0) 202 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00125.js │ │ │ --rw-r--r-- 0 root (0) root (0) 31454 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00125_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 10199 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00128.html │ │ │ --rw-r--r-- 0 root (0) root (0) 432 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00128.js │ │ │ --rw-r--r-- 0 root (0) root (0) 47613 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00128_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 9983 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00131.html │ │ │ --rw-r--r-- 0 root (0) root (0) 412 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00131.js │ │ │ --rw-r--r-- 0 root (0) root (0) 119410 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00131_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 8837 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00134.html │ │ │ --rw-r--r-- 0 root (0) root (0) 301 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00134.js │ │ │ --rw-r--r-- 0 root (0) root (0) 48404 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00134_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 6452 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00137.html │ │ │ --rw-r--r-- 0 root (0) root (0) 94 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00137.js │ │ │ --rw-r--r-- 0 root (0) root (0) 14502 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00137_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 11086 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00140.html │ │ │ --rw-r--r-- 0 root (0) root (0) 739 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00140.js │ │ │ --rw-r--r-- 0 root (0) root (0) 28727 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00140_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 9222 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00143.html │ │ │ --rw-r--r-- 0 root (0) root (0) 445 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00143.js │ │ │ --rw-r--r-- 0 root (0) root (0) 24786 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00143_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 6046 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00146.html │ │ │ --rw-r--r-- 0 root (0) root (0) 54369 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00146_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 5438 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00149.html │ │ │ --rw-r--r-- 0 root (0) root (0) 14410 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00149_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 7800 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00152.html │ │ │ --rw-r--r-- 0 root (0) root (0) 310 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00152.js │ │ │ --rw-r--r-- 0 root (0) root (0) 32298 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00152_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 6381 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00155.html │ │ │ --rw-r--r-- 0 root (0) root (0) 115 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00155.js │ │ │ --rw-r--r-- 0 root (0) root (0) 9603 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00155_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 9317 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00158.html │ │ │ --rw-r--r-- 0 root (0) root (0) 316 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00158.js │ │ │ --rw-r--r-- 0 root (0) root (0) 99764 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00158_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 6694 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00161.html │ │ │ --rw-r--r-- 0 root (0) root (0) 98 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00161.js │ │ │ --rw-r--r-- 0 root (0) root (0) 45881 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00161_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 9150 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00164.html │ │ │ --rw-r--r-- 0 root (0) root (0) 411 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00164.js │ │ │ --rw-r--r-- 0 root (0) root (0) 48829 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00164_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 11111 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00167.html │ │ │ --rw-r--r-- 0 root (0) root (0) 318 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00167.js │ │ │ --rw-r--r-- 0 root (0) root (0) 125443 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00167_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 17530 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00170.html │ │ │ --rw-r--r-- 0 root (0) root (0) 1428 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00170.js │ │ │ --rw-r--r-- 0 root (0) root (0) 73624 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00170_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 9938 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00176.html │ │ │ --rw-r--r-- 0 root (0) root (0) 232 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00176.js │ │ │ --rw-r--r-- 0 root (0) root (0) 89656 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00176_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 11960 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00179.html │ │ │ --rw-r--r-- 0 root (0) root (0) 296 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00179.js │ │ │ --rw-r--r-- 0 root (0) root (0) 224405 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00179_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 9935 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00182.html │ │ │ --rw-r--r-- 0 root (0) root (0) 430 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00182.js │ │ │ --rw-r--r-- 0 root (0) root (0) 65713 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00182_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 8129 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00185.html │ │ │ --rw-r--r-- 0 root (0) root (0) 325 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00185.js │ │ │ --rw-r--r-- 0 root (0) root (0) 19137 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00185_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 13481 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00188.html │ │ │ --rw-r--r-- 0 root (0) root (0) 921 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00188.js │ │ │ --rw-r--r-- 0 root (0) root (0) 24053 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00188_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 10161 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00191.html │ │ │ --rw-r--r-- 0 root (0) root (0) 193 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00191.js │ │ │ --rw-r--r-- 0 root (0) root (0) 143927 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00191_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 15502 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00194.html │ │ │ --rw-r--r-- 0 root (0) root (0) 1126 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00194.js │ │ │ --rw-r--r-- 0 root (0) root (0) 51887 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00194_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 6599 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00197.html │ │ │ --rw-r--r-- 0 root (0) root (0) 29167 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00197_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 9175 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00200.html │ │ │ --rw-r--r-- 0 root (0) root (0) 316 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00200.js │ │ │ --rw-r--r-- 0 root (0) root (0) 14376 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00200_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 15105 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00203.html │ │ │ --rw-r--r-- 0 root (0) root (0) 1060 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00203.js │ │ │ --rw-r--r-- 0 root (0) root (0) 151455 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00203_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 6493 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00206.html │ │ │ --rw-r--r-- 0 root (0) root (0) 118 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00206.js │ │ │ --rw-r--r-- 0 root (0) root (0) 13777 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00206_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 5415 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00209.html │ │ │ --rw-r--r-- 0 root (0) root (0) 13734 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00209_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 8759 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00212.html │ │ │ --rw-r--r-- 0 root (0) root (0) 231 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00212.js │ │ │ --rw-r--r-- 0 root (0) root (0) 29855 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00212_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 7942 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00215.html │ │ │ --rw-r--r-- 0 root (0) root (0) 92 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00215.js │ │ │ --rw-r--r-- 0 root (0) root (0) 50086 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00215_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 6317 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00218.html │ │ │ --rw-r--r-- 0 root (0) root (0) 32570 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00218_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 6345 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00221.html │ │ │ --rw-r--r-- 0 root (0) root (0) 104 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00221.js │ │ │ --rw-r--r-- 0 root (0) root (0) 52853 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00221_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 8100 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00224.html │ │ │ --rw-r--r-- 0 root (0) root (0) 407 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00224.js │ │ │ --rw-r--r-- 0 root (0) root (0) 21546 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00224_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 5594 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00227.html │ │ │ --rw-r--r-- 0 root (0) root (0) 28498 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00227_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 5558 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00230.html │ │ │ --rw-r--r-- 0 root (0) root (0) 15538 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00230_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 7449 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00233.html │ │ │ --rw-r--r-- 0 root (0) root (0) 142 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00233.js │ │ │ --rw-r--r-- 0 root (0) root (0) 31503 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00233_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 6079 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00236.html │ │ │ --rw-r--r-- 0 root (0) root (0) 12137 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00236_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 10503 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00239.html │ │ │ --rw-r--r-- 0 root (0) root (0) 653 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00239.js │ │ │ --rw-r--r-- 0 root (0) root (0) 53954 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00239_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 6174 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00242.html │ │ │ --rw-r--r-- 0 root (0) root (0) 32004 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00242_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 24323 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00245.html │ │ │ --rw-r--r-- 0 root (0) root (0) 1473 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00245.js │ │ │ --rw-r--r-- 0 root (0) root (0) 72574 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00245_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 8998 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00248.html │ │ │ --rw-r--r-- 0 root (0) root (0) 140 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00248.js │ │ │ --rw-r--r-- 0 root (0) root (0) 32212 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00248_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 5574 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00251.html │ │ │ --rw-r--r-- 0 root (0) root (0) 19897 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00251_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 7552 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00254.html │ │ │ --rw-r--r-- 0 root (0) root (0) 137 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00254.js │ │ │ --rw-r--r-- 0 root (0) root (0) 26451 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00254_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 5414 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00257.html │ │ │ --rw-r--r-- 0 root (0) root (0) 17485 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00257_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 9467 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00260.html │ │ │ --rw-r--r-- 0 root (0) root (0) 17577 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00260_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 7039 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00263.html │ │ │ --rw-r--r-- 0 root (0) root (0) 114 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00263.js │ │ │ --rw-r--r-- 0 root (0) root (0) 27335 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00263_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 8757 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00266.html │ │ │ --rw-r--r-- 0 root (0) root (0) 416 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00266.js │ │ │ --rw-r--r-- 0 root (0) root (0) 55147 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00266_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 7828 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00269.html │ │ │ --rw-r--r-- 0 root (0) root (0) 210 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00269.js │ │ │ --rw-r--r-- 0 root (0) root (0) 26170 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00269_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 10034 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00272.html │ │ │ --rw-r--r-- 0 root (0) root (0) 588 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00272.js │ │ │ --rw-r--r-- 0 root (0) root (0) 44458 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00272_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 7329 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00275.html │ │ │ --rw-r--r-- 0 root (0) root (0) 111 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00275.js │ │ │ --rw-r--r-- 0 root (0) root (0) 12350 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00275_source.html │ │ │ --rw-r--r-- 0 root (0) root (0) 8032 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00278.html │ │ │ --rw-r--r-- 0 root (0) root (0) 271 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00278.js │ │ │ --rw-r--r-- 0 root (0) root (0) 76467 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00278_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 7449 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00041.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 142 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00041.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 31503 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00041_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 6317 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00044.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 32570 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00044_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 15502 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00047.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 1126 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00047.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 51887 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00047_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 24323 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00050.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 1473 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00050.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 72574 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00050_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 6345 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00053.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 104 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00053.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 52853 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00053_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 5558 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00056.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 15538 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00056_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 5574 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00059.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 19897 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00059_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 9175 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00062.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 316 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00062.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 14376 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00062_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 7552 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00065.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 137 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00065.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 26451 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00065_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 5415 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00068.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 13734 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00068_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 6599 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00071.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 29167 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00071_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 6174 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00074.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 32004 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00074_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 5414 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00077.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 17485 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00077_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 6079 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00080.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 12137 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00080_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 10503 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00083.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 653 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00083.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 53954 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00083_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 8998 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00086.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 140 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00086.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 32212 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00086_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 6493 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00089.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 118 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00089.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 13777 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00089_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 8759 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00092.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 231 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00092.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 29855 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00092_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 9467 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00095.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 17577 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00095_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 5594 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00098.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 28498 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00098_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 15105 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00101.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 1060 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00101.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 151455 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00101_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 7942 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00104.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 92 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00104.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 50086 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00104_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 8100 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00107.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 407 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00107.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 21546 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00107_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 10034 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00110.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 588 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00110.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 44458 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00110_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 8032 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00113.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 271 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00113.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 76467 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00113_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 7329 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00116.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 111 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00116.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 12350 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00116_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 8757 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00119.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 416 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00119.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 55147 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00119_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 7828 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00125.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 210 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00125.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 26170 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00125_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 7039 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00128.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 114 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00128.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 27335 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00128_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 6948 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00131.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 46487 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00131_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 9334 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00134.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 349 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00134.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 18796 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00134_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 8279 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00137.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 229 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00137.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 40776 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00137_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 7350 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00140.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 298 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00140.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 14613 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00140_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 6696 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00143.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 36929 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00143_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 12021 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00146.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 738 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00146.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 140764 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00146_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 7006 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00149.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 58596 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00149_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 8905 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00152.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 237 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00152.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 52097 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00152_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 7664 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00155.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 138 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00155.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 32568 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00155_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 5678 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00158.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 15530 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00158_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 6117 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00161.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 23978 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00161_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 6046 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00164.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 54369 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00164_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 11960 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00167.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 296 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00167.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 224405 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00167_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 9938 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00170.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 232 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00170.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 89656 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00170_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 7800 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00173.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 310 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00173.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 32298 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00173_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 8338 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00176.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 235 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00176.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 36914 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00176_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 9685 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00179.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 789 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00179.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 99734 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00179_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 9358 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00182.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 398 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00182.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 73483 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00182_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 9555 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00185.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 312 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00185.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 39397 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00185_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 9529 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00188.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 416 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00188.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 63596 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00188_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 8837 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00191.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 301 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00191.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 48404 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00191_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 8102 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00194.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 209 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00194.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 30565 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00194_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 9983 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00197.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 412 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00197.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 119410 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00197_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 6452 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00200.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 94 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00200.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 14502 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00200_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 5534 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00203.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 19797 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00203_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 8745 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00206.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 251 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00206.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 52279 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00206_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 6694 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00209.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 98 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00209.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 45881 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00209_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 11111 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00212.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 318 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00212.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 125443 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00212_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 8725 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00215.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 310 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00215.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 28737 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00215_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 12771 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00218.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 737 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00218.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 67782 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00218_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 9294 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00221.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 317 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00221.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 51286 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00221_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 9150 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00224.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 411 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00224.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 48829 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00224_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 10103 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00227.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 406 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00227.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 81847 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00227_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 13481 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00230.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 921 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00230.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 24053 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00230_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 7325 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00233.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 202 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00233.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 31454 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00233_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 8129 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00236.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 325 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00236.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 19137 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00236_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 6382 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00239.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 104 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00239.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 36705 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00239_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 9222 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00242.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 445 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00242.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 24786 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00242_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 17530 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00245.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 1428 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00245.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 73624 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00245_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 11448 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00248.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 295 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00248.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 100329 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00248_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 10161 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00251.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 193 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00251.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 143927 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00251_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 9317 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00254.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 316 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00254.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 99764 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00254_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 11086 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00257.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 739 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00257.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 28727 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00257_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 9331 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00260.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 487 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00260.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 41518 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00260_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 5438 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00263.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 14410 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00263_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 10199 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00266.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 432 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00266.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 47613 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00266_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 6322 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00269.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 104 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00269.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 18777 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00269_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 6381 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00272.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 115 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00272.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 9603 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00272_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 9935 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00275.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 430 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00275.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 65713 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00275_source.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 9484 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00278.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 326 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00278.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 41581 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00278_source.html │ │ │ -rw-r--r-- 0 root (0) root (0) 4281 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00281.html │ │ │ -rw-r--r-- 0 root (0) root (0) 4278 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00284.html │ │ │ -rw-r--r-- 0 root (0) root (0) 4281 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00287.html │ │ │ -rw-r--r-- 0 root (0) root (0) 4302 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00290.html │ │ │ -rw-r--r-- 0 root (0) root (0) 4302 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00293.html │ │ │ -rw-r--r-- 0 root (0) root (0) 4299 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00296.html │ │ │ -rw-r--r-- 0 root (0) root (0) 5142 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00299.html │ │ │ @@ -919,15 +919,15 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 5140 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/dir_e7ee3dcc0fa103fe39ed0589ecb683f5.html │ │ │ -rw-r--r-- 0 root (0) root (0) 3241 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/dir_e7ee3dcc0fa103fe39ed0589ecb683f5_dep.png │ │ │ -rw-r--r-- 0 root (0) root (0) 3415 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/doxygen-awesome-sidebar-only.css │ │ │ -rw-r--r-- 0 root (0) root (0) 67677 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/doxygen-awesome.css │ │ │ -rw-r--r-- 0 root (0) root (0) 37056 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/doxygen.css │ │ │ -rw-r--r-- 0 root (0) root (0) 116667 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/doxygen_crawl.html │ │ │ -rw-r--r-- 0 root (0) root (0) 15536 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/dune-functions.png │ │ │ --rw-r--r-- 0 root (0) root (0) 68587 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/dune-functions.tag.gz │ │ │ +-rw-r--r-- 0 root (0) root (0) 68596 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/dune-functions.tag.gz │ │ │ -rw-r--r-- 0 root (0) root (0) 7677 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/dynsections.js │ │ │ -rw-r--r-- 0 root (0) root (0) 34904 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/files.html │ │ │ -rw-r--r-- 0 root (0) root (0) 220 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/files_dup.js │ │ │ -rw-r--r-- 0 root (0) root (0) 540 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/form_0.png │ │ │ -rw-r--r-- 0 root (0) root (0) 487 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/form_1.png │ │ │ -rw-r--r-- 0 root (0) root (0) 1105 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/form_10.png │ │ │ -rw-r--r-- 0 root (0) root (0) 2905 2026-02-06 16:11:35.000000 ./usr/share/doc/libdune-functions-doc/doxygen/form_11.png │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00041.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: localderivativetraits.hh File Reference │ │ │ +Dune-Functions: localfunction.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,27 +88,32 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
localderivativetraits.hh File Reference
│ │ │ +
localfunction.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <dune/functions/common/defaultderivativetraits.hh>
│ │ │ +
#include <type_traits>
│ │ │ +#include <dune/common/typeutilities.hh>
│ │ │ +#include <dune/functions/common/defaultderivativetraits.hh>
│ │ │ +#include <dune/functions/common/differentiablefunction.hh>
│ │ │ +#include <dune/functions/common/localfunction_imp.hh>
│ │ │ +#include <dune/functions/common/typeerasure.hh>
│ │ │ +#include <dune/functions/common/functionconcepts.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

struct  Dune::Functions::LocalDerivativeTraits< EntitySet, DerivativeTraits >
 Derivative traits for local functions. More...
struct  Dune::Functions::LocalDerivativeTraits< EntitySet, DerivativeTraits >::Traits< Signature >
struct  Dune::Functions::LocalDerivativeTraits< EntitySet, DerivativeTraits >::Traits< R(LocalDomain)>
class  Dune::Functions::LocalFunction< Signature, LocalContext, DerivativeTraits, bufferSize >
class  Dune::Functions::LocalFunction< Range(Domain), LocalContext, DerivativeTraits, bufferSize >
 Class storing local functions using type erasure. More...
│ │ │ │ │ │ │ │ │ │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
│ │ │
│ │ │ @@ -120,13 +125,13 @@ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,22 +1,27 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -localderivativetraits.hh File Reference │ │ │ │ +localfunction.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ #include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_l_o_c_a_l_f_u_n_c_t_i_o_n___i_m_p_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e_e_r_a_s_u_r_e_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_<_ _E_n_t_i_t_y_S_e_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _> │ │ │ │ -  Derivative traits for local functions. _M_o_r_e_._._. │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_<_ _E_n_t_i_t_y_S_e_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ - _>_:_:_T_r_a_i_t_s_<_ _S_i_g_n_a_t_u_r_e_ _> │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_<_ _E_n_t_i_t_y_S_e_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ - _>_:_:_T_r_a_i_t_s_<_ _R_(_L_o_c_a_l_D_o_m_a_i_n_)_> │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_<_ _S_i_g_n_a_t_u_r_e_,_ _L_o_c_a_l_C_o_n_t_e_x_t_, │ │ │ │ + _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_ _> │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _L_o_c_a_l_C_o_n_t_e_x_t_, │ │ │ │ + _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_ _> │ │ │ │ +  Class storing local functions using type erasure. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ - * _l_o_c_a_l_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _l_o_c_a_l_f_u_n_c_t_i_o_n_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00041.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,4 +1,3 @@ │ │ │ │ var a00041 = [ │ │ │ │ - ["Dune::Functions::LocalDerivativeTraits< EntitySet, DerivativeTraits >::Traits< Signature >", "a02294.html", "a02294"], │ │ │ │ - ["Dune::Functions::LocalDerivativeTraits< EntitySet, DerivativeTraits >::Traits< R(LocalDomain)>", "a02298.html", "a02298"] │ │ │ │ + ["Dune::Functions::LocalFunction< Signature, LocalContext, DerivativeTraits, bufferSize >", "a01382.html", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00041_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: localderivativetraits.hh Source File │ │ │ +Dune-Functions: localfunction.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,79 +88,184 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
localderivativetraits.hh
│ │ │ +
localfunction.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH
│ │ │ -
8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH
│ │ │ +
8#define DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH
│ │ │
9
│ │ │ -
10
│ │ │ - │ │ │ -
12
│ │ │ +
10#include <type_traits>
│ │ │ +
11
│ │ │ +
12#include <dune/common/typeutilities.hh>
│ │ │
13
│ │ │ -
14namespace Dune {
│ │ │ -
15namespace Functions {
│ │ │ -
16
│ │ │ -
17
│ │ │ -
30template<class EntitySet, template<class> class DerivativeTraits=DefaultDerivativeTraits>
│ │ │ -
│ │ │ - │ │ │ -
32{
│ │ │ -
33 using LocalDomain = typename EntitySet::LocalCoordinate;
│ │ │ -
34 using Domain = typename EntitySet::GlobalCoordinate;
│ │ │ -
35
│ │ │ -
36 template<class Signature>
│ │ │ -
│ │ │ -
37 struct Traits
│ │ │ -
38 {
│ │ │ - │ │ │ -
40 };
│ │ │ -
│ │ │ -
41
│ │ │ -
42 template<class R>
│ │ │ -
│ │ │ - │ │ │ -
44 {
│ │ │ -
45 using Range = typename DerivativeTraits<R(Domain)>::Range;
│ │ │ -
46 };
│ │ │ -
│ │ │ -
47};
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
19
│ │ │ +
20
│ │ │ +
21
│ │ │ +
22namespace Dune {
│ │ │ +
23namespace Functions {
│ │ │ +
24
│ │ │ +
25
│ │ │ +
26
│ │ │ +
27/*
│ │ │ +
28 * Default implementation is empty
│ │ │ +
29 * The actual implementation is only given if Signature is an type
│ │ │ +
30 * describing a function signature as Range(Domain).
│ │ │ +
31 */
│ │ │ +
32template<class Signature, class LocalContext, template<class> class DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>
│ │ │ +
│ │ │ + │ │ │ +
34{};
│ │ │
│ │ │ +
35
│ │ │ +
36
│ │ │ +
37
│ │ │ +
38namespace Imp
│ │ │ +
39{
│ │ │ +
40
│ │ │ +
42 template<class S, class L, template<class> class DerivativeTraits, size_t bufferSize>
│ │ │ +
43 struct LocalFunctionTraits :
│ │ │ +
44 DifferentiableFunctionTraits<S, DerivativeTraits, bufferSize>
│ │ │ +
45 {
│ │ │ +
46 protected:
│ │ │ +
47 using Base=DifferentiableFunctionTraits<S, DerivativeTraits, bufferSize>;
│ │ │
48
│ │ │ -
49
│ │ │ -
50}} // namespace Dune::Functions
│ │ │ -
51
│ │ │ -
52#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH
│ │ │ - │ │ │ +
49 public:
│ │ │ +
51 using LocalContext = L;
│ │ │ +
52
│ │ │ +
54 using DerivativeSignature = typename Base::DerivativeSignature;
│ │ │ +
55
│ │ │ + │ │ │ +
58
│ │ │ +
60 using Concept = LocalFunctionWrapperInterface<S, DerivativeInterface, L>;
│ │ │ +
61
│ │ │ +
63 template<class B>
│ │ │ +
64 using Model = LocalFunctionWrapperImplementation<S, DerivativeInterface, L, B>;
│ │ │ +
65 };
│ │ │ +
66}
│ │ │ +
67
│ │ │ +
68
│ │ │ +
69
│ │ │ +
90template<class Range, class Domain, class LocalContext, template<class> class DerivativeTraits, size_t bufferSize>
│ │ │ +
│ │ │ +
91class LocalFunction< Range(Domain), LocalContext, DerivativeTraits, bufferSize> :
│ │ │ +
92 public TypeErasureBase<
│ │ │ +
93 typename Imp::LocalFunctionTraits<Range(Domain), LocalContext, DerivativeTraits, bufferSize>::Concept,
│ │ │ +
94 Imp::LocalFunctionTraits<Range(Domain), LocalContext, DerivativeTraits, bufferSize>::template Model>
│ │ │ +
95{
│ │ │ +
96 using Traits = Imp::LocalFunctionTraits<Range(Domain), LocalContext, DerivativeTraits, bufferSize>;
│ │ │ +
97
│ │ │ + │ │ │ +
99
│ │ │ +
100 using DerivativeInterface = typename Traits::DerivativeInterface;
│ │ │ +
101
│ │ │ +
102public:
│ │ │ +
103
│ │ │ +
115 template<class F, disableCopyMove<LocalFunction, F> = 0 >
│ │ │ +
│ │ │ + │ │ │ +
117 Base(std::forward<F>(f))
│ │ │ +
118 {
│ │ │ +
119 static_assert(Dune::Functions::Concept::isLocalFunction<F, Range(Domain), LocalContext>(), "Trying to construct a LocalFunction from type that does not model the LocalFunction concept");
│ │ │ +
120 }
│ │ │ +
│ │ │ +
121
│ │ │ +
122 LocalFunction() = default;
│ │ │ +
123
│ │ │ +
│ │ │ +
127 Range operator() (const Domain& x) const
│ │ │ +
128 {
│ │ │ +
129 return this->asInterface().operator()(x);
│ │ │ +
130 }
│ │ │ +
│ │ │ +
131
│ │ │ +
│ │ │ +
139 friend DerivativeInterface derivative(const LocalFunction& t)
│ │ │ +
140 {
│ │ │ +
141 return t.asInterface().derivative();
│ │ │ +
142 }
│ │ │ +
│ │ │ +
143
│ │ │ +
│ │ │ +
150 void bind(const LocalContext& context)
│ │ │ +
151 {
│ │ │ +
152 this->asInterface().bind(context);
│ │ │ +
153 }
│ │ │ +
│ │ │ +
154
│ │ │ +
│ │ │ +
158 void unbind()
│ │ │ +
159 {
│ │ │ +
160 this->asInterface().unbind();
│ │ │ +
161 }
│ │ │ +
│ │ │ +
162
│ │ │ +
│ │ │ +
165 bool bound() const
│ │ │ +
166 {
│ │ │ +
167 return this->asInterface().bound();
│ │ │ +
168 }
│ │ │ +
│ │ │ +
169
│ │ │ +
│ │ │ +
173 const LocalContext& localContext() const
│ │ │ +
174 {
│ │ │ +
175 return this->asInterface().localContext();
│ │ │ +
176 }
│ │ │ +
│ │ │ +
177};
│ │ │ +
│ │ │ +
178
│ │ │ +
179
│ │ │ +
180
│ │ │ +
181}} // namespace Dune::Functions
│ │ │ +
182
│ │ │ +
183
│ │ │ +
184
│ │ │ +
185#endif // DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
static constexpr bool isLocalFunction()
Check if F models the LocalFunction concept with given signature and local context.
Definition functionconcepts.hh:170
│ │ │ +
friend DerivativeInterface derivative(const LocalFunction &t)
Get derivative of wrapped function.
Definition localfunction.hh:139
│ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
Dummy range class to be used if no proper type is available.
Definition defaultderivativetraits.hh:27
│ │ │ +
Definition backends/concepts.hh:17
│ │ │
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:41
│ │ │ -
Derivative traits for local functions.
Definition localderivativetraits.hh:32
│ │ │ -
typename EntitySet::GlobalCoordinate Domain
Definition localderivativetraits.hh:34
│ │ │ -
typename EntitySet::LocalCoordinate LocalDomain
Definition localderivativetraits.hh:33
│ │ │ -
Definition localderivativetraits.hh:38
│ │ │ -
InvalidRange Range
Definition localderivativetraits.hh:39
│ │ │ -
typename DerivativeTraits< R(Domain)>::Range Range
Definition localderivativetraits.hh:45
│ │ │ +
Definition localfunction.hh:34
│ │ │ +
const LocalContext & localContext() const
Obtain local context this LocalFunction is bound to.
Definition localfunction.hh:173
│ │ │ +
LocalFunction(F &&f)
Construct from function.
Definition localfunction.hh:116
│ │ │ +
void unbind()
Unbind from local context.
Definition localfunction.hh:158
│ │ │ +
bool bound() const
Return if the local function is bound to a grid element.
Definition localfunction.hh:165
│ │ │ +
void bind(const LocalContext &context)
Bind function to a local context.
Definition localfunction.hh:150
│ │ │ + │ │ │ + │ │ │ + │ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,82 +1,216 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -localderivativetraits.hh │ │ │ │ +localfunction.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH │ │ │ │ -8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH │ │ │ │ +8#define DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH │ │ │ │ 9 │ │ │ │ -10 │ │ │ │ -11#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ -12 │ │ │ │ +10#include │ │ │ │ +11 │ │ │ │ +12#include │ │ │ │ 13 │ │ │ │ -14namespace _D_u_n_e { │ │ │ │ -15namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -16 │ │ │ │ -17 │ │ │ │ -30template class │ │ │ │ -DerivativeTraits=_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s> │ │ │ │ -_3_1struct _L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ -32{ │ │ │ │ -_3_3 using _L_o_c_a_l_D_o_m_a_i_n = typename EntitySet::LocalCoordinate; │ │ │ │ -_3_4 using _D_o_m_a_i_n = typename EntitySet::GlobalCoordinate; │ │ │ │ +14#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ +15#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_l_o_c_a_l_f_u_n_c_t_i_o_n___i_m_p_._h_h> │ │ │ │ +17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e_e_r_a_s_u_r_e_._h_h> │ │ │ │ +18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +19 │ │ │ │ +20 │ │ │ │ +21 │ │ │ │ +22namespace _D_u_n_e { │ │ │ │ +23namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +24 │ │ │ │ +25 │ │ │ │ +26 │ │ │ │ +27/* │ │ │ │ +28 * Default implementation is empty │ │ │ │ +29 * The actual implementation is only given if Signature is an type │ │ │ │ +30 * describing a function signature as Range(Domain). │ │ │ │ +31 */ │ │ │ │ +32template class │ │ │ │ +DerivativeTraits=_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s, size_t bufferSize=56> │ │ │ │ +_3_3class _L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +34{}; │ │ │ │ 35 │ │ │ │ -36 template │ │ │ │ -_3_7 struct _T_r_a_i_t_s │ │ │ │ -38 { │ │ │ │ -_3_9 typedef _I_n_v_a_l_i_d_R_a_n_g_e _R_a_n_g_e; │ │ │ │ -40 }; │ │ │ │ -41 │ │ │ │ -42 template │ │ │ │ -_4_3 struct _T_r_a_i_t_s │ │ │ │ -44 { │ │ │ │ -_4_5 using _R_a_n_g_e = typename DerivativeTraits_:_:_R_a_n_g_e; │ │ │ │ -46 }; │ │ │ │ -47}; │ │ │ │ +36 │ │ │ │ +37 │ │ │ │ +38namespace Imp │ │ │ │ +39{ │ │ │ │ +40 │ │ │ │ +42 template class DerivativeTraits, size_t │ │ │ │ +bufferSize> │ │ │ │ +43 struct LocalFunctionTraits : │ │ │ │ +44 DifferentiableFunctionTraits │ │ │ │ +45 { │ │ │ │ +46 protected: │ │ │ │ +47 using Base=DifferentiableFunctionTraits; │ │ │ │ 48 │ │ │ │ -49 │ │ │ │ -50}} // namespace Dune::Functions │ │ │ │ -51 │ │ │ │ -52#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH │ │ │ │ +49 public: │ │ │ │ +51 using LocalContext = L; │ │ │ │ +52 │ │ │ │ +54 using DerivativeSignature = typename Base::DerivativeSignature; │ │ │ │ +55 │ │ │ │ +57 using DerivativeInterface = _L_o_c_a_l_F_u_n_c_t_i_o_n_<_D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e_,_ _L_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_>; │ │ │ │ +58 │ │ │ │ +60 using _C_o_n_c_e_p_t = LocalFunctionWrapperInterface; │ │ │ │ +61 │ │ │ │ +63 template │ │ │ │ +64 using Model = LocalFunctionWrapperImplementation; │ │ │ │ +65 }; │ │ │ │ +66} │ │ │ │ +67 │ │ │ │ +68 │ │ │ │ +69 │ │ │ │ +90template class │ │ │ │ +DerivativeTraits, size_t bufferSize> │ │ │ │ +_9_1class _L_o_c_a_l_F_u_n_c_t_i_o_n< Range(Domain), LocalContext, DerivativeTraits, │ │ │ │ +bufferSize> : │ │ │ │ +92 public _T_y_p_e_E_r_a_s_u_r_e_B_a_s_e< │ │ │ │ +93 typename Imp::LocalFunctionTraits::Concept, │ │ │ │ +94 Imp::LocalFunctionTraits::template Model> │ │ │ │ +95{ │ │ │ │ +96 using Traits = Imp::LocalFunctionTraits; │ │ │ │ +97 │ │ │ │ +98 using Base = _T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_<_t_y_p_e_n_a_m_e_ _T_r_a_i_t_s_:_:_C_o_n_c_e_p_t_,_ _T_r_a_i_t_s_:_:_t_e_m_p_l_a_t_e │ │ │ │ +_M_o_d_e_l_>; │ │ │ │ +99 │ │ │ │ +100 using DerivativeInterface = typename Traits::DerivativeInterface; │ │ │ │ +101 │ │ │ │ +102public: │ │ │ │ +103 │ │ │ │ +115 template = 0 > │ │ │ │ +_1_1_6 _L_o_c_a_l_F_u_n_c_t_i_o_n(F&& f) : │ │ │ │ +117 Base(std::forward(f)) │ │ │ │ +118 { │ │ │ │ +119 static_assert(_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_L_o_c_a_l_F_u_n_c_t_i_o_n_<_F_,_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ +_L_o_c_a_l_C_o_n_t_e_x_t_>(), "Trying to construct a LocalFunction from type that does not │ │ │ │ +model the LocalFunction concept"); │ │ │ │ +120 } │ │ │ │ +121 │ │ │ │ +_1_2_2 _L_o_c_a_l_F_u_n_c_t_i_o_n() = default; │ │ │ │ +123 │ │ │ │ +_1_2_7 Range operator() (const Domain& x) const │ │ │ │ +128 { │ │ │ │ +129 return this->_a_s_I_n_t_e_r_f_a_c_e().operator()(x); │ │ │ │ +130 } │ │ │ │ +131 │ │ │ │ +_1_3_9 friend DerivativeInterface _d_e_r_i_v_a_t_i_v_e(const _L_o_c_a_l_F_u_n_c_t_i_o_n& t) │ │ │ │ +140 { │ │ │ │ +141 return t.asInterface().derivative(); │ │ │ │ +142 } │ │ │ │ +143 │ │ │ │ +_1_5_0 void _b_i_n_d(const LocalContext& context) │ │ │ │ +151 { │ │ │ │ +152 this->_a_s_I_n_t_e_r_f_a_c_e().bind(context); │ │ │ │ +153 } │ │ │ │ +154 │ │ │ │ +_1_5_8 void _u_n_b_i_n_d() │ │ │ │ +159 { │ │ │ │ +160 this->_a_s_I_n_t_e_r_f_a_c_e().unbind(); │ │ │ │ +161 } │ │ │ │ +162 │ │ │ │ +_1_6_5 bool _b_o_u_n_d() const │ │ │ │ +166 { │ │ │ │ +167 return this->_a_s_I_n_t_e_r_f_a_c_e().bound(); │ │ │ │ +168 } │ │ │ │ +169 │ │ │ │ +_1_7_3 const LocalContext& _l_o_c_a_l_C_o_n_t_e_x_t() const │ │ │ │ +174 { │ │ │ │ +175 return this->_a_s_I_n_t_e_r_f_a_c_e().localContext(); │ │ │ │ +176 } │ │ │ │ +177}; │ │ │ │ +178 │ │ │ │ +179 │ │ │ │ +180 │ │ │ │ +181}} // namespace Dune::Functions │ │ │ │ +182 │ │ │ │ +183 │ │ │ │ +184 │ │ │ │ +185#endif // DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH │ │ │ │ +_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h │ │ │ │ +_l_o_c_a_l_f_u_n_c_t_i_o_n___i_m_p_._h_h │ │ │ │ +_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h │ │ │ │ +_t_y_p_e_e_r_a_s_u_r_e_._h_h │ │ │ │ _d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +static constexpr bool isLocalFunction() │ │ │ │ +Check if F models the LocalFunction concept with given signature and local │ │ │ │ +context. │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:170 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _L_o_c_a_l_C_o_n_t_e_x_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_, │ │ │ │ +_b_u_f_f_e_r_S_i_z_e_ _>_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ +friend DerivativeInterface derivative(const LocalFunction &t) │ │ │ │ +Get derivative of wrapped function. │ │ │ │ +DDeeffiinniittiioonn localfunction.hh:139 │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_n_v_a_l_i_d_R_a_n_g_e │ │ │ │ -Dummy range class to be used if no proper type is available. │ │ │ │ -DDeeffiinniittiioonn defaultderivativetraits.hh:27 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t │ │ │ │ +DDeeffiinniittiioonn backends/concepts.hh:17 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ Default implementation for derivative traits. │ │ │ │ DDeeffiinniittiioonn defaultderivativetraits.hh:41 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ -Derivative traits for local functions. │ │ │ │ -DDeeffiinniittiioonn localderivativetraits.hh:32 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_:_:_D_o_m_a_i_n │ │ │ │ -typename EntitySet::GlobalCoordinate Domain │ │ │ │ -DDeeffiinniittiioonn localderivativetraits.hh:34 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_:_:_L_o_c_a_l_D_o_m_a_i_n │ │ │ │ -typename EntitySet::LocalCoordinate LocalDomain │ │ │ │ -DDeeffiinniittiioonn localderivativetraits.hh:33 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_:_:_T_r_a_i_t_s │ │ │ │ -DDeeffiinniittiioonn localderivativetraits.hh:38 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_:_:_T_r_a_i_t_s_:_:_R_a_n_g_e │ │ │ │ -InvalidRange Range │ │ │ │ -DDeeffiinniittiioonn localderivativetraits.hh:39 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_:_:_T_r_a_i_t_s_<_ _R_(_L_o_c_a_l_D_o_m_a_i_n_)_>_:_:_R_a_n_g_e │ │ │ │ -typename DerivativeTraits< R(Domain)>::Range Range │ │ │ │ -DDeeffiinniittiioonn localderivativetraits.hh:45 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +DDeeffiinniittiioonn localfunction.hh:34 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _L_o_c_a_l_C_o_n_t_e_x_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_, │ │ │ │ +_b_u_f_f_e_r_S_i_z_e_ _>_:_:_l_o_c_a_l_C_o_n_t_e_x_t │ │ │ │ +const LocalContext & localContext() const │ │ │ │ +Obtain local context this LocalFunction is bound to. │ │ │ │ +DDeeffiinniittiioonn localfunction.hh:173 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _L_o_c_a_l_C_o_n_t_e_x_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_, │ │ │ │ +_b_u_f_f_e_r_S_i_z_e_ _>_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +LocalFunction(F &&f) │ │ │ │ +Construct from function. │ │ │ │ +DDeeffiinniittiioonn localfunction.hh:116 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _L_o_c_a_l_C_o_n_t_e_x_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_, │ │ │ │ +_b_u_f_f_e_r_S_i_z_e_ _>_:_:_u_n_b_i_n_d │ │ │ │ +void unbind() │ │ │ │ +Unbind from local context. │ │ │ │ +DDeeffiinniittiioonn localfunction.hh:158 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _L_o_c_a_l_C_o_n_t_e_x_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_, │ │ │ │ +_b_u_f_f_e_r_S_i_z_e_ _>_:_:_b_o_u_n_d │ │ │ │ +bool bound() const │ │ │ │ +Return if the local function is bound to a grid element. │ │ │ │ +DDeeffiinniittiioonn localfunction.hh:165 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _L_o_c_a_l_C_o_n_t_e_x_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_, │ │ │ │ +_b_u_f_f_e_r_S_i_z_e_ _>_:_:_b_i_n_d │ │ │ │ +void bind(const LocalContext &context) │ │ │ │ +Bind function to a local context. │ │ │ │ +DDeeffiinniittiioonn localfunction.hh:150 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _L_o_c_a_l_C_o_n_t_e_x_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_, │ │ │ │ +_b_u_f_f_e_r_S_i_z_e_ _>_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +LocalFunction()=default │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_<_ _I_m_p_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_T_r_a_i_t_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ +_L_o_c_a_l_C_o_n_t_e_x_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_ _>_:_:_C_o_n_c_e_p_t_,_ _I_m_p_:_: │ │ │ │ +_L_o_c_a_l_F_u_n_c_t_i_o_n_T_r_a_i_t_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _L_o_c_a_l_C_o_n_t_e_x_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e │ │ │ │ +_>_:_:_t_e_m_p_l_a_t_e_ _M_o_d_e_l_ _>_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e │ │ │ │ +TypeErasureBase(T &&t) │ │ │ │ +DDeeffiinniittiioonn typeerasure.hh:174 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_<_ _I_m_p_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_T_r_a_i_t_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ +_L_o_c_a_l_C_o_n_t_e_x_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_ _>_:_:_C_o_n_c_e_p_t_,_ _I_m_p_:_: │ │ │ │ +_L_o_c_a_l_F_u_n_c_t_i_o_n_T_r_a_i_t_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _L_o_c_a_l_C_o_n_t_e_x_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e │ │ │ │ +_>_:_:_t_e_m_p_l_a_t_e_ _M_o_d_e_l_ _>_:_:_a_s_I_n_t_e_r_f_a_c_e │ │ │ │ +Imp::LocalFunctionTraits< Range(Domain), LocalContext, DerivativeTraits, │ │ │ │ +bufferSize >::Concept & asInterface() │ │ │ │ +DDeeffiinniittiioonn typeerasure.hh:182 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ - * _l_o_c_a_l_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _l_o_c_a_l_f_u_n_c_t_i_o_n_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00044.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: gridviewfunction.hh File Reference │ │ │ +Dune-Functions: polymorphicsmallobject.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,57 +88,46 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
gridviewfunction.hh File Reference
│ │ │ +
polymorphicsmallobject.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <memory>
│ │ │ -#include <dune/common/concept.hh>
│ │ │ -#include <dune/functions/gridfunctions/gridfunction.hh>
│ │ │ -#include <dune/functions/gridfunctions/gridviewentityset.hh>
│ │ │ -#include <dune/functions/gridfunctions/analyticgridviewfunction.hh>
│ │ │ +
#include <cstddef>
│ │ │ +#include <utility>
│ │ │ +#include <type_traits>
│ │ │ +#include <algorithm>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::GridViewFunction< Signature, GridView, DerivativeTraits, bufferSize >
class  Dune::Functions::GridViewFunction< Range(Domain), GV, DerivativeTraits, bufferSize >
 Wrapper class for functions defined on a GridView. More...
class  Dune::Functions::PolymorphicSmallObject< Base, bufferSize >
 A wrapper providing small object optimization with polymorphic types. More...
│ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │

│ │ │ -Functions

template<class F, class GridView, std::enable_if_t< models< Imp::HasFreeLocalFunction, F >(), int > = 0>
std::decay_t< F > Dune::Functions::makeGridViewFunction (F &&f, const GridView &gridView)
 Construct a function modeling GridViewFunction from function and grid view.
template<class F, class GridView, std::enable_if_t< not(models< Imp::HasFreeLocalFunction, F >()), int > = 0>
auto Dune::Functions::makeGridViewFunction (F &&f, const GridView &gridView) -> decltype(makeAnalyticGridViewFunction(std::forward< F >(f), gridView))
 Construct a function modeling GridViewFunction from function and grid view.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,39 +1,22 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -gridviewfunction.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_a_n_a_l_y_t_i_c_g_r_i_d_v_i_e_w_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +polymorphicsmallobject.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _S_i_g_n_a_t_u_r_e_,_ _G_r_i_d_V_i_e_w_, │ │ │ │ - _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_ _> │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_, │ │ │ │ - _b_u_f_f_e_r_S_i_z_e_ _> │ │ │ │ -  Wrapper class for functions defined on a _G_r_i_d_V_i_e_w. _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t_<_ _B_a_s_e_,_ _b_u_f_f_e_r_S_i_z_e_ _> │ │ │ │ +  A wrapper providing small object optimization with polymorphic types. │ │ │ │ + _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -FFuunnccttiioonnss │ │ │ │ -template(), int > = 0> │ │ │ │ -std::decay_t< F >  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n (F &&f, const GridView │ │ │ │ - &gridView) │ │ │ │ -  Construct a function modeling _G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n from function │ │ │ │ - and grid view. │ │ │ │ -template()), int > = 0> │ │ │ │ - auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n (F &&f, const GridView │ │ │ │ - &gridView) -> decltype(_m_a_k_e_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n(std:: │ │ │ │ - forward< F >(f), gridView)) │ │ │ │ -  Construct a function modeling _G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n from function │ │ │ │ - and grid view. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_v_i_e_w_f_u_n_c_t_i_o_n_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _p_o_l_y_m_o_r_p_h_i_c_s_m_a_l_l_o_b_j_e_c_t_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00044_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: gridviewfunction.hh Source File │ │ │ +Dune-Functions: polymorphicsmallobject.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,110 +88,208 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
gridviewfunction.hh
│ │ │ +
polymorphicsmallobject.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH
│ │ │ -
8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH
│ │ │ +
8#define DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH
│ │ │
9
│ │ │ -
10#include <memory>
│ │ │ -
11
│ │ │ -
12#include <dune/common/concept.hh>
│ │ │ -
13
│ │ │ - │ │ │ - │ │ │ - │ │ │ +
10#include <cstddef>
│ │ │ +
11#include <utility>
│ │ │ +
12#include <type_traits>
│ │ │ +
13#include <algorithm>
│ │ │ +
14
│ │ │ +
15namespace Dune {
│ │ │ +
16namespace Functions {
│ │ │
17
│ │ │ -
18
│ │ │ -
19namespace Dune {
│ │ │ -
20namespace Functions {
│ │ │ -
21
│ │ │ -
22
│ │ │ -
23
│ │ │ -
24template<class Signature, class GridView, template<class> class DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>
│ │ │ -
│ │ │ - │ │ │ -
26{};
│ │ │ -
│ │ │ -
27
│ │ │ -
28
│ │ │ -
29
│ │ │ -
44template<class Range, class Domain, class GV, template<class> class DerivativeTraits, size_t bufferSize>
│ │ │ -
│ │ │ -
45class GridViewFunction<Range(Domain), GV, DerivativeTraits, bufferSize> :
│ │ │ -
46 public GridFunction<Range(Domain), GridViewEntitySet<GV, 0>, DerivativeTraits, bufferSize>
│ │ │ -
47{
│ │ │ -
48 using Base = GridFunction<Range(Domain), GridViewEntitySet<GV, 0>, DerivativeTraits, bufferSize>;
│ │ │ -
49public:
│ │ │ -
50 using GridView = GV;
│ │ │ -
51
│ │ │ -
52 using Base::Base;
│ │ │ -
53};
│ │ │ -
│ │ │ +
18
│ │ │ +
49template<class Base, size_t bufferSize>
│ │ │ +
│ │ │ + │ │ │ +
51{
│ │ │ +
52 // Actual buffer size must be > 0
│ │ │ +
53 static constexpr std::size_t actualBufferSize = std::max(sizeof(std::byte), bufferSize);
│ │ │
54
│ │ │ -
55
│ │ │ -
56
│ │ │ -
68template<class F, class GridView,
│ │ │ -
69 std::enable_if_t<
│ │ │ -
70 models< Imp::HasFreeLocalFunction, F>() , int> = 0>
│ │ │ -
71std::decay_t<F>
│ │ │ -
│ │ │ -
72 makeGridViewFunction(F&& f, const GridView& gridView)
│ │ │ -
73{
│ │ │ -
74 return std::forward<F>(f);
│ │ │ -
75}
│ │ │ -
│ │ │ -
76
│ │ │ -
77
│ │ │ -
78
│ │ │ -
94template<class F, class GridView,
│ │ │ -
95 std::enable_if_t<
│ │ │ -
96 not(models< Imp::HasFreeLocalFunction, F>()) , int> = 0>
│ │ │ -
│ │ │ -
97auto makeGridViewFunction(F&& f, const GridView& gridView)
│ │ │ -
98 -> decltype(makeAnalyticGridViewFunction(std::forward<F>(f), gridView))
│ │ │ -
99{
│ │ │ -
100 return makeAnalyticGridViewFunction(std::forward<F>(f), gridView);
│ │ │ -
101}
│ │ │ -
│ │ │ -
102
│ │ │ -
103
│ │ │ -
104
│ │ │ -
105} // end of namespace Dune::Functions
│ │ │ -
106} // end of namespace Dune
│ │ │ -
107
│ │ │ -
108#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
auto makeAnalyticGridViewFunction(F &&f, const GridView &gridView)
Create an AnalyticGridViewFunction from a function and a grid view.
Definition analyticgridviewfunction.hh:238
│ │ │ +
55 // Alignment requirement for the buffer. The `Derived` type must have
│ │ │ +
56 // an alignment requirement that is a divisor of `bufferAlignment`
│ │ │ +
57 static constexpr std::size_t bufferAlignment = alignof(std::max_align_t);
│ │ │ +
58
│ │ │ +
59public:
│ │ │ +
60
│ │ │ +
│ │ │ + │ │ │ +
63 p_(nullptr)
│ │ │ +
64 {}
│ │ │ +
│ │ │ +
65
│ │ │ +
72 template<class Derived,
│ │ │ +
73 std::enable_if_t<std::is_base_of_v<Base, std::remove_cv_t<
│ │ │ +
74 std::remove_reference_t<Derived>>>, int> = 0>
│ │ │ +
│ │ │ +
75 PolymorphicSmallObject(Derived&& derived)
│ │ │ +
76 {
│ │ │ +
77 constexpr bool useBuffer = (sizeof(Derived) <= bufferSize)
│ │ │ +
78 && (bufferAlignment % alignof(Derived) == 0);
│ │ │ +
79
│ │ │ +
80 if constexpr (useBuffer) {
│ │ │ +
81 p_ = new (&buffer_) Derived(std::forward<Derived>(derived));
│ │ │ +
82 } else {
│ │ │ +
83 p_ = new Derived(std::forward<Derived>(derived));
│ │ │ +
84 }
│ │ │ +
85 }
│ │ │ +
│ │ │ +
86
│ │ │ +
│ │ │ + │ │ │ +
89 {
│ │ │ +
90 moveToWrappedObject(std::move(other));
│ │ │ +
91 }
│ │ │ +
│ │ │ +
92
│ │ │ +
│ │ │ + │ │ │ +
95 {
│ │ │ +
96 copyToWrappedObject(other);
│ │ │ +
97 }
│ │ │ +
│ │ │ +
98
│ │ │ +
│ │ │ + │ │ │ +
101 {
│ │ │ +
102 destroyWrappedObject();
│ │ │ +
103 }
│ │ │ +
│ │ │ +
104
│ │ │ +
│ │ │ + │ │ │ +
107 {
│ │ │ +
108 if (&other!=this)
│ │ │ +
109 {
│ │ │ +
110 destroyWrappedObject();
│ │ │ +
111 copyToWrappedObject(other);
│ │ │ +
112 }
│ │ │ +
113 return *this;
│ │ │ +
114 }
│ │ │ +
│ │ │ +
115
│ │ │ +
│ │ │ + │ │ │ +
118 {
│ │ │ +
119 destroyWrappedObject();
│ │ │ +
120 moveToWrappedObject(std::move(other));
│ │ │ +
121 return *this;
│ │ │ +
122 }
│ │ │ +
│ │ │ +
123
│ │ │ +
│ │ │ +
125 explicit operator bool() const
│ │ │ +
126 {
│ │ │ +
127 return p_;
│ │ │ +
128 }
│ │ │ +
│ │ │ +
129
│ │ │ +
│ │ │ +
131 bool bufferUsed() const
│ │ │ +
132 {
│ │ │ +
133 return ((void*) (p_) == (void*)(&buffer_));
│ │ │ +
134 }
│ │ │ +
│ │ │ +
135
│ │ │ +
│ │ │ +
137 const Base& get() const
│ │ │ +
138 {
│ │ │ +
139 return *p_;
│ │ │ +
140 }
│ │ │ +
│ │ │ +
141
│ │ │ +
│ │ │ +
143 Base& get()
│ │ │ +
144 {
│ │ │ +
145 return *p_;
│ │ │ +
146 }
│ │ │ +
│ │ │ +
147
│ │ │ +
148private:
│ │ │ +
149
│ │ │ +
150 void destroyWrappedObject() noexcept
│ │ │ +
151 {
│ │ │ +
152 if (operator bool())
│ │ │ +
153 {
│ │ │ +
154 if (bufferUsed())
│ │ │ +
155 p_->~Base();
│ │ │ +
156 else
│ │ │ +
157 delete p_;
│ │ │ +
158 }
│ │ │ +
159 }
│ │ │ +
160
│ │ │ +
161 void moveToWrappedObject(PolymorphicSmallObject&& other) noexcept
│ │ │ +
162 {
│ │ │ +
163 if (other.bufferUsed())
│ │ │ +
164 p_ = other.p_->move(&buffer_);
│ │ │ +
165 else
│ │ │ +
166 {
│ │ │ +
167 // We don't need to check for &other_!=this, because you can't
│ │ │ +
168 // have an rvalue to *this and call it's assignment/constructor
│ │ │ +
169 // at the same time. (Despite trying to shoot yourself in the foot
│ │ │ +
170 // with std::move explicitly.)
│ │ │ +
171
│ │ │ +
172 // Take ownership of allocated object
│ │ │ +
173 p_ = other.p_;
│ │ │ +
174
│ │ │ +
175 // Leave pointer in a clean state to avoid double freeing it.
│ │ │ +
176 other.p_ = 0;
│ │ │ +
177 }
│ │ │ +
178 }
│ │ │ +
179
│ │ │ +
180 void copyToWrappedObject(const PolymorphicSmallObject& other)
│ │ │ +
181 {
│ │ │ +
182 if (other.bufferUsed())
│ │ │ +
183 p_ = other.p_->clone(&buffer_);
│ │ │ +
184 else
│ │ │ +
185 p_ = other.p_->clone();
│ │ │ +
186 }
│ │ │ +
187
│ │ │ +
188 alignas(bufferAlignment) std::byte buffer_[actualBufferSize];
│ │ │ +
189 Base* p_;
│ │ │ +
190};
│ │ │ +
│ │ │ +
191
│ │ │ +
192
│ │ │ +
193} // namespace Functions
│ │ │ +
194} // namespace Dune
│ │ │ +
195
│ │ │ +
196#endif // DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH
│ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
std::decay_t< F > makeGridViewFunction(F &&f, const GridView &gridView)
Construct a function modeling GridViewFunction from function and grid view.
Definition gridviewfunction.hh:72
│ │ │ -
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:41
│ │ │ -
Definition gridfunction.hh:36
│ │ │ -
An entity set for all entities of given codim in a grid view.
Definition gridviewentityset.hh:27
│ │ │ -
Definition gridviewfunction.hh:26
│ │ │ - │ │ │ +
const Base & get() const
Obtain reference to stored object.
Definition polymorphicsmallobject.hh:137
│ │ │ +
bool bufferUsed() const
Check if object is stored in internal stack buffer.
Definition polymorphicsmallobject.hh:131
│ │ │ +
PolymorphicSmallObject(Derived &&derived)
Construct from object.
Definition polymorphicsmallobject.hh:75
│ │ │ +
PolymorphicSmallObject(PolymorphicSmallObject &&other) noexcept
Move constructor from other PolymorphicSmallObject.
Definition polymorphicsmallobject.hh:88
│ │ │ +
PolymorphicSmallObject & operator=(const PolymorphicSmallObject &other)
Copy assignment from other PolymorphicSmallObject.
Definition polymorphicsmallobject.hh:106
│ │ │ +
PolymorphicSmallObject & operator=(PolymorphicSmallObject &&other) noexcept
Move assignment from other PolymorphicSmallObject.
Definition polymorphicsmallobject.hh:117
│ │ │ +
PolymorphicSmallObject(const PolymorphicSmallObject &other)
Copy constructor from other PolymorphicSmallObject.
Definition polymorphicsmallobject.hh:94
│ │ │ +
~PolymorphicSmallObject()
Destructor.
Definition polymorphicsmallobject.hh:100
│ │ │ +
PolymorphicSmallObject()
Default constructor.
Definition polymorphicsmallobject.hh:62
│ │ │ +
Base & get()
Obtain mutable reference to stored object.
Definition polymorphicsmallobject.hh:143
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,114 +1,208 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -gridviewfunction.hh │ │ │ │ +polymorphicsmallobject.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH │ │ │ │ -8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH │ │ │ │ +8#define DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11 │ │ │ │ -12#include │ │ │ │ -13 │ │ │ │ -14#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ -15#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h> │ │ │ │ -16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_a_n_a_l_y_t_i_c_g_r_i_d_v_i_e_w_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ +12#include │ │ │ │ +13#include │ │ │ │ +14 │ │ │ │ +15namespace _D_u_n_e { │ │ │ │ +16namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ 17 │ │ │ │ 18 │ │ │ │ -19namespace _D_u_n_e { │ │ │ │ -20namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -21 │ │ │ │ -22 │ │ │ │ -23 │ │ │ │ -24template class │ │ │ │ -DerivativeTraits=_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s, size_t bufferSize=56> │ │ │ │ -_2_5class _G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ -26{}; │ │ │ │ -27 │ │ │ │ -28 │ │ │ │ -29 │ │ │ │ -44template class │ │ │ │ -DerivativeTraits, size_t bufferSize> │ │ │ │ -_4_5class _G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n : │ │ │ │ -46 public _G_r_i_d_F_u_n_c_t_i_o_n, │ │ │ │ -DerivativeTraits, bufferSize> │ │ │ │ -47{ │ │ │ │ -48 using Base = _G_r_i_d_F_u_n_c_t_i_o_n, │ │ │ │ -DerivativeTraits, bufferSize>; │ │ │ │ -49public: │ │ │ │ -_5_0 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ -51 │ │ │ │ -52 using Base::Base; │ │ │ │ -53}; │ │ │ │ +49template │ │ │ │ +_5_0class _P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t │ │ │ │ +51{ │ │ │ │ +52 // Actual buffer size must be > 0 │ │ │ │ +53 static constexpr std::size_t actualBufferSize = std::max(sizeof(std::byte), │ │ │ │ +bufferSize); │ │ │ │ 54 │ │ │ │ -55 │ │ │ │ -56 │ │ │ │ -68template() , int> = 0> │ │ │ │ -71std::decay_t │ │ │ │ -_7_2 _m_a_k_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n(F&& f, const GridView& gridView) │ │ │ │ -73{ │ │ │ │ -74 return std::forward(f); │ │ │ │ -75} │ │ │ │ -76 │ │ │ │ -77 │ │ │ │ -78 │ │ │ │ -94template()) , int> = 0> │ │ │ │ -_9_7auto _m_a_k_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n(F&& f, const GridView& gridView) │ │ │ │ -98 -> decltype(_m_a_k_e_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n(std::forward(f), gridView)) │ │ │ │ -99{ │ │ │ │ -100 return _m_a_k_e_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n(std::forward(f), gridView); │ │ │ │ -101} │ │ │ │ -102 │ │ │ │ -103 │ │ │ │ +55 // Alignment requirement for the buffer. The `Derived` type must have │ │ │ │ +56 // an alignment requirement that is a divisor of `bufferAlignment` │ │ │ │ +57 static constexpr std::size_t bufferAlignment = alignof(std::max_align_t); │ │ │ │ +58 │ │ │ │ +59public: │ │ │ │ +60 │ │ │ │ +_6_2 _P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t() : │ │ │ │ +63 p_(nullptr) │ │ │ │ +64 {} │ │ │ │ +65 │ │ │ │ +72 template>>, int> = 0> │ │ │ │ +_7_5 _P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t(Derived&& derived) │ │ │ │ +76 { │ │ │ │ +77 constexpr bool useBuffer = (sizeof(Derived) <= bufferSize) │ │ │ │ +78 && (bufferAlignment % alignof(Derived) == 0); │ │ │ │ +79 │ │ │ │ +80 if constexpr (useBuffer) { │ │ │ │ +81 p_ = new (&buffer_) Derived(std::forward(derived)); │ │ │ │ +82 } else { │ │ │ │ +83 p_ = new Derived(std::forward(derived)); │ │ │ │ +84 } │ │ │ │ +85 } │ │ │ │ +86 │ │ │ │ +_8_8 _P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t(_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t&& other) noexcept │ │ │ │ +89 { │ │ │ │ +90 moveToWrappedObject(std::move(other)); │ │ │ │ +91 } │ │ │ │ +92 │ │ │ │ +_9_4 _P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t(const _P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t& other) │ │ │ │ +95 { │ │ │ │ +96 copyToWrappedObject(other); │ │ │ │ +97 } │ │ │ │ +98 │ │ │ │ +_1_0_0 _~_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t() │ │ │ │ +101 { │ │ │ │ +102 destroyWrappedObject(); │ │ │ │ +103 } │ │ │ │ 104 │ │ │ │ -105} // end of namespace Dune::Functions │ │ │ │ -106} // end of namespace Dune │ │ │ │ -107 │ │ │ │ -108#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH │ │ │ │ -_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h │ │ │ │ -_g_r_i_d_f_u_n_c_t_i_o_n_._h_h │ │ │ │ -_a_n_a_l_y_t_i_c_g_r_i_d_v_i_e_w_f_u_n_c_t_i_o_n_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ -auto makeAnalyticGridViewFunction(F &&f, const GridView &gridView) │ │ │ │ -Create an AnalyticGridViewFunction from a function and a grid view. │ │ │ │ -DDeeffiinniittiioonn analyticgridviewfunction.hh:238 │ │ │ │ +_1_0_6 _P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t& _o_p_e_r_a_t_o_r_=(const _P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t& other) │ │ │ │ +107 { │ │ │ │ +108 if (&other!=this) │ │ │ │ +109 { │ │ │ │ +110 destroyWrappedObject(); │ │ │ │ +111 copyToWrappedObject(other); │ │ │ │ +112 } │ │ │ │ +113 return *this; │ │ │ │ +114 } │ │ │ │ +115 │ │ │ │ +_1_1_7 _P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t& _o_p_e_r_a_t_o_r_=(_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t&& other) noexcept │ │ │ │ +118 { │ │ │ │ +119 destroyWrappedObject(); │ │ │ │ +120 moveToWrappedObject(std::move(other)); │ │ │ │ +121 return *this; │ │ │ │ +122 } │ │ │ │ +123 │ │ │ │ +_1_2_5 explicit operator bool() const │ │ │ │ +126 { │ │ │ │ +127 return p_; │ │ │ │ +128 } │ │ │ │ +129 │ │ │ │ +_1_3_1 bool _b_u_f_f_e_r_U_s_e_d() const │ │ │ │ +132 { │ │ │ │ +133 return ((void*) (p_) == (void*)(&buffer_)); │ │ │ │ +134 } │ │ │ │ +135 │ │ │ │ +_1_3_7 const Base& _g_e_t() const │ │ │ │ +138 { │ │ │ │ +139 return *p_; │ │ │ │ +140 } │ │ │ │ +141 │ │ │ │ +_1_4_3 Base& _g_e_t() │ │ │ │ +144 { │ │ │ │ +145 return *p_; │ │ │ │ +146 } │ │ │ │ +147 │ │ │ │ +148private: │ │ │ │ +149 │ │ │ │ +150 void destroyWrappedObject() noexcept │ │ │ │ +151 { │ │ │ │ +152 if (operator bool()) │ │ │ │ +153 { │ │ │ │ +154 if (_b_u_f_f_e_r_U_s_e_d()) │ │ │ │ +155 p_->~Base(); │ │ │ │ +156 else │ │ │ │ +157 delete p_; │ │ │ │ +158 } │ │ │ │ +159 } │ │ │ │ +160 │ │ │ │ +161 void moveToWrappedObject(_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t&& other) noexcept │ │ │ │ +162 { │ │ │ │ +163 if (other.bufferUsed()) │ │ │ │ +164 p_ = other.p_->move(&buffer_); │ │ │ │ +165 else │ │ │ │ +166 { │ │ │ │ +167 // We don't need to check for &other_!=this, because you can't │ │ │ │ +168 // have an rvalue to *this and call it's assignment/constructor │ │ │ │ +169 // at the same time. (Despite trying to shoot yourself in the foot │ │ │ │ +170 // with std::move explicitly.) │ │ │ │ +171 │ │ │ │ +172 // Take ownership of allocated object │ │ │ │ +173 p_ = other.p_; │ │ │ │ +174 │ │ │ │ +175 // Leave pointer in a clean state to avoid double freeing it. │ │ │ │ +176 other.p_ = 0; │ │ │ │ +177 } │ │ │ │ +178 } │ │ │ │ +179 │ │ │ │ +180 void copyToWrappedObject(const _P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t& other) │ │ │ │ +181 { │ │ │ │ +182 if (other.bufferUsed()) │ │ │ │ +183 p_ = other.p_->clone(&buffer_); │ │ │ │ +184 else │ │ │ │ +185 p_ = other.p_->clone(); │ │ │ │ +186 } │ │ │ │ +187 │ │ │ │ +188 alignas(bufferAlignment) std::byte buffer_[actualBufferSize]; │ │ │ │ +189 Base* p_; │ │ │ │ +190}; │ │ │ │ +191 │ │ │ │ +192 │ │ │ │ +193} // namespace Functions │ │ │ │ +194} // namespace Dune │ │ │ │ +195 │ │ │ │ +196#endif // DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ -std::decay_t< F > makeGridViewFunction(F &&f, const GridView &gridView) │ │ │ │ -Construct a function modeling GridViewFunction from function and grid view. │ │ │ │ -DDeeffiinniittiioonn gridviewfunction.hh:72 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ -Default implementation for derivative traits. │ │ │ │ -DDeeffiinniittiioonn defaultderivativetraits.hh:41 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ -DDeeffiinniittiioonn gridfunction.hh:36 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t │ │ │ │ -An entity set for all entities of given codim in a grid view. │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:27 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ -DDeeffiinniittiioonn gridviewfunction.hh:26 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_, │ │ │ │ -_b_u_f_f_e_r_S_i_z_e_ _>_:_:_G_r_i_d_V_i_e_w │ │ │ │ -GV GridView │ │ │ │ -DDeeffiinniittiioonn gridviewfunction.hh:50 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t_:_:_g_e_t │ │ │ │ +const Base & get() const │ │ │ │ +Obtain reference to stored object. │ │ │ │ +DDeeffiinniittiioonn polymorphicsmallobject.hh:137 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t_:_:_b_u_f_f_e_r_U_s_e_d │ │ │ │ +bool bufferUsed() const │ │ │ │ +Check if object is stored in internal stack buffer. │ │ │ │ +DDeeffiinniittiioonn polymorphicsmallobject.hh:131 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t │ │ │ │ +PolymorphicSmallObject(Derived &&derived) │ │ │ │ +Construct from object. │ │ │ │ +DDeeffiinniittiioonn polymorphicsmallobject.hh:75 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t │ │ │ │ +PolymorphicSmallObject(PolymorphicSmallObject &&other) noexcept │ │ │ │ +Move constructor from other PolymorphicSmallObject. │ │ │ │ +DDeeffiinniittiioonn polymorphicsmallobject.hh:88 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t_:_:_o_p_e_r_a_t_o_r_= │ │ │ │ +PolymorphicSmallObject & operator=(const PolymorphicSmallObject &other) │ │ │ │ +Copy assignment from other PolymorphicSmallObject. │ │ │ │ +DDeeffiinniittiioonn polymorphicsmallobject.hh:106 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t_:_:_o_p_e_r_a_t_o_r_= │ │ │ │ +PolymorphicSmallObject & operator=(PolymorphicSmallObject &&other) noexcept │ │ │ │ +Move assignment from other PolymorphicSmallObject. │ │ │ │ +DDeeffiinniittiioonn polymorphicsmallobject.hh:117 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t │ │ │ │ +PolymorphicSmallObject(const PolymorphicSmallObject &other) │ │ │ │ +Copy constructor from other PolymorphicSmallObject. │ │ │ │ +DDeeffiinniittiioonn polymorphicsmallobject.hh:94 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t_:_:_~_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t │ │ │ │ +~PolymorphicSmallObject() │ │ │ │ +Destructor. │ │ │ │ +DDeeffiinniittiioonn polymorphicsmallobject.hh:100 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t │ │ │ │ +PolymorphicSmallObject() │ │ │ │ +Default constructor. │ │ │ │ +DDeeffiinniittiioonn polymorphicsmallobject.hh:62 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t_:_:_g_e_t │ │ │ │ +Base & get() │ │ │ │ +Obtain mutable reference to stored object. │ │ │ │ +DDeeffiinniittiioonn polymorphicsmallobject.hh:143 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_v_i_e_w_f_u_n_c_t_i_o_n_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _p_o_l_y_m_o_r_p_h_i_c_s_m_a_l_l_o_b_j_e_c_t_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00047.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: gridviewentityset.hh File Reference │ │ │ +Dune-Functions: utility.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,43 +88,86 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
gridviewentityset.hh File Reference
│ │ │ +
utility.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <memory>
│ │ │ +
#include <utility>
│ │ │ +#include <type_traits>
│ │ │ +#include <dune/common/overloadset.hh>
│ │ │ +#include <dune/common/indices.hh>
│ │ │ +#include <dune/functions/common/functionconcepts.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::GridViewEntitySet< GV, cd >
 An entity set for all entities of given codim in a grid view. More...
struct  Dune::Functions::LastType< T >
 Get last entry of type list. More...
struct  Dune::Functions::RotateTuple< T >
 Rotate type list by one, such that last entry is moved to first position. More...
│ │ │ │ │ │ │ │ │ │ │ │ +

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +

│ │ │ +Typedefs

template<template< class... > class T, class ArgTuple>
using Dune::Functions::ExpandTuple = typename Imp::ExpandTupleHelper<T, ArgTuple>::Type
 Expand tuple arguments as template arguments.
template<template< class... > class F, class... Tuples>
using Dune::Functions::TransformTuple = typename Imp::TransformTupleHelper<F, Tuples...>::Type
 Transform tuple types argument using type-functor.
template<class IntegerSequence>
using Dune::Functions::IntegerSequenceTuple = typename Imp::IntegerSequenceTupleHelper<IntegerSequence>::Type
 Transform integer_sequence<I,k...> to tuple<integral_constant<I,k>...>.
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ +Functions

template<class F, class size_type, size_type firstValue, class... Args>
auto Dune::Functions::forwardAsStaticInteger (std::integer_sequence< size_type, firstValue > values, const size_type &i, F &&f, Args &&... args) -> decltype(f(std::integral_constant< size_type, firstValue >(), std::forward< Args >(args)...))
template<class F, class size_type, size_type firstValue, size_type secondValue, size_type... otherValues, class... Args>
auto Dune::Functions::forwardAsStaticInteger (std::integer_sequence< size_type, firstValue, secondValue, otherValues... > values, const size_type i, F &&f, Args &&... args) -> decltype(f(std::integral_constant< size_type, firstValue >(), std::forward< Args >(args)...))
template<std::size_t end, class F, class size_type, class... Args>
auto Dune::Functions::forwardAsStaticIndex (const size_type &i, F &&f, Args &&... args) -> decltype(f(Dune::Indices::_0, std::forward< Args >(args)...))
 Transform dynamic index to static index_constant.
template<class F, class... T>
auto Dune::Functions::transformTuple (F &&f, const std::tuple< T... > &tuple) -> decltype(Imp::transformTupleHelper(std::forward< F >(f), tuple, std::index_sequence_for< T... >{}))
 Transform tuple value using a functor.
template<class F, class... T1, class... T2>
auto Dune::Functions::transformTuple (F &&f, const std::tuple< T1... > &tuple1, const std::tuple< T2... > &tuple2) -> decltype(Imp::transformTupleHelper(std::forward< F >(f), tuple1, tuple2, std::index_sequence_for< T1... >{}))
 Transform tuple value using a binary functor.
template<class Expression>
auto Dune::Functions::callableCheck (Expression f)
 Create a predicate for checking validity of expressions.
template<class Check>
auto Dune::Functions::negatePredicate (Check check)
 Negate given predicate.
template<class T>
auto Dune::Functions::forwardCapture (T &&t)
 Create a capture object for perfect forwarding.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,18 +1,76 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -gridviewentityset.hh File Reference │ │ │ │ -#include │ │ │ │ +utility.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_V_,_ _c_d_ _> │ │ │ │ -  An entity set for all entities of given codim in a grid view. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_s_t_T_y_p_e_<_ _T_ _> │ │ │ │ +  Get last entry of type list. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_o_t_a_t_e_T_u_p_l_e_<_ _T_ _> │ │ │ │ +  Rotate type list by one, such that last entry is moved to first │ │ │ │ + position. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ +TTyyppeeddeeffss │ │ │ │ +template class T, class ArgTuple> │ │ │ │ +using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_a_n_d_T_u_p_l_e = typename Imp::ExpandTupleHelper::Type │ │ │ │ +  Expand tuple arguments as template arguments. │ │ │ │ +template class F, class... Tuples> │ │ │ │ +using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_a_n_s_f_o_r_m_T_u_p_l_e = typename Imp::TransformTupleHelper::Type │ │ │ │ +  Transform tuple types argument using type-functor. │ │ │ │ +template │ │ │ │ +using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_n_t_e_g_e_r_S_e_q_u_e_n_c_e_T_u_p_l_e = typename Imp:: │ │ │ │ + IntegerSequenceTupleHelper::Type │ │ │ │ +  Transform integer_sequence to tuple...>. │ │ │ │ +FFuunnccttiioonnss │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_o_r_w_a_r_d_A_s_S_t_a_t_i_c_I_n_t_e_g_e_r (std::integer_sequence< │ │ │ │ + size_type, firstValue > values, const size_type &i, F &&f, Args &&... │ │ │ │ + args) -> decltype(f(std::integral_constant< size_type, firstValue >(), │ │ │ │ + std::forward< Args >(args)...)) │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_o_r_w_a_r_d_A_s_S_t_a_t_i_c_I_n_t_e_g_e_r (std::integer_sequence< │ │ │ │ + size_type, firstValue, secondValue, otherValues... > values, const │ │ │ │ + size_type i, F &&f, Args &&... args) -> decltype(f(std:: │ │ │ │ + integral_constant< size_type, firstValue >(), std::forward< Args > │ │ │ │ + (args)...)) │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_o_r_w_a_r_d_A_s_S_t_a_t_i_c_I_n_d_e_x (const size_type &i, F &&f, Args │ │ │ │ + &&... args) -> decltype(f(Dune::Indices::_0, std::forward< Args > │ │ │ │ + (args)...)) │ │ │ │ +  Transform dynamic index to static index_constant. │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_t_r_a_n_s_f_o_r_m_T_u_p_l_e (F &&f, const std::tuple< T... > &tuple) │ │ │ │ + -> decltype(Imp::transformTupleHelper(std::forward< F >(f), tuple, std:: │ │ │ │ + index_sequence_for< T... >{})) │ │ │ │ +  Transform tuple value using a functor. │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_t_r_a_n_s_f_o_r_m_T_u_p_l_e (F &&f, const std::tuple< T1... > │ │ │ │ + &tuple1, const std::tuple< T2... > &tuple2) -> decltype(Imp:: │ │ │ │ + transformTupleHelper(std::forward< F >(f), tuple1, tuple2, std:: │ │ │ │ + index_sequence_for< T1... >{})) │ │ │ │ +  Transform tuple value using a binary functor. │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_a_l_l_a_b_l_e_C_h_e_c_k (Expression f) │ │ │ │ +  Create a predicate for checking validity of expressions. │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_n_e_g_a_t_e_P_r_e_d_i_c_a_t_e (Check check) │ │ │ │ +  Negate given predicate. │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_o_r_w_a_r_d_C_a_p_t_u_r_e (T &&t) │ │ │ │ +  Create a capture object for perfect forwarding. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _u_t_i_l_i_t_y_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00047_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: gridviewentityset.hh Source File │ │ │ +Dune-Functions: utility.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,128 +88,316 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
gridviewentityset.hh
│ │ │ +
utility.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH
│ │ │ -
8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_COMMON_UTILITY_HH
│ │ │ +
8#define DUNE_FUNCTIONS_COMMON_UTILITY_HH
│ │ │
9
│ │ │ -
10#include <memory>
│ │ │ -
11
│ │ │ -
12
│ │ │ -
13namespace Dune {
│ │ │ -
14
│ │ │ -
15namespace Functions {
│ │ │ +
10
│ │ │ +
11#include <utility>
│ │ │ +
12#include <type_traits>
│ │ │ +
13
│ │ │ +
14#include <dune/common/overloadset.hh>
│ │ │ +
15#include <dune/common/indices.hh>
│ │ │
16
│ │ │ -
17
│ │ │ -
25template<class GV, int cd>
│ │ │ -
│ │ │ - │ │ │ + │ │ │ +
18
│ │ │ +
19namespace Dune {
│ │ │ +
20namespace Functions {
│ │ │ +
21
│ │ │ +
22
│ │ │ +
23template<class F, class size_type, size_type firstValue, class... Args>
│ │ │ +
24[[deprecated("This function will be removed after Dune 2.11")]]
│ │ │ +
│ │ │ +
25auto forwardAsStaticInteger(std::integer_sequence<size_type, firstValue> values, const size_type& i, F&& f, Args&&... args)
│ │ │ +
26 ->decltype(f(std::integral_constant<size_type, firstValue>(), std::forward<Args>(args)...))
│ │ │
27{
│ │ │ -
28public:
│ │ │ -
29
│ │ │ -
30 typedef GV GridView;
│ │ │ -
31 enum {
│ │ │ -
32 codim = cd
│ │ │ -
33 };
│ │ │ -
34
│ │ │ -
36 typedef typename GridView::template Codim<codim>::Entity Element;
│ │ │ -
37
│ │ │ -
39 typedef typename Element::Geometry::LocalCoordinate LocalCoordinate;
│ │ │ -
40 typedef typename Element::Geometry::GlobalCoordinate GlobalCoordinate;
│ │ │ -
41
│ │ │ - │ │ │ -
43
│ │ │ -
45 typedef typename GridView::template Codim<codim>::Iterator const_iterator;
│ │ │ -
46
│ │ │ - │ │ │ -
49
│ │ │ -
│ │ │ - │ │ │ -
52 gv_(gv)
│ │ │ -
53 {}
│ │ │ -
│ │ │ -
54
│ │ │ -
│ │ │ -
56 bool contains(const Element& e) const
│ │ │ -
57 {
│ │ │ -
58 return gv_.contains(e);
│ │ │ -
59 }
│ │ │ -
│ │ │ -
60
│ │ │ -
│ │ │ -
62 size_t size() const
│ │ │ -
63 {
│ │ │ -
64 return gv_.size(codim);
│ │ │ -
65 }
│ │ │ +
28 return f(std::integral_constant<size_type, firstValue>(), std::forward<Args>(args)...);
│ │ │ +
29}
│ │ │ +
│ │ │ +
30
│ │ │ +
31template<class F, class size_type, size_type firstValue, size_type secondValue, size_type... otherValues, class... Args>
│ │ │ +
32[[deprecated("This function will be removed after Dune 2.11")]]
│ │ │ +
│ │ │ +
33auto forwardAsStaticInteger(std::integer_sequence<size_type, firstValue, secondValue, otherValues...> values, const size_type i, F&& f, Args&&... args)
│ │ │ +
34 ->decltype(f(std::integral_constant<size_type, firstValue>(), std::forward<Args>(args)...))
│ │ │ +
35{
│ │ │ +
36 if (i==firstValue)
│ │ │ +
37 return f(std::integral_constant<size_type, firstValue>(), std::forward<Args>(args)...);
│ │ │ +
38 return forwardAsStaticInteger(std::integer_sequence<size_type, secondValue, otherValues...>(), i, std::forward<F>(f), std::forward<Args>(args)...);
│ │ │ +
39}
│ │ │
│ │ │ -
66
│ │ │ +
40
│ │ │ +
41
│ │ │ +
42
│ │ │ +
66template<std::size_t end, class F, class size_type, class... Args>
│ │ │ +
67[[deprecated("This function will be removed after Dune 2.11, use Dune::Hybrid::switchCases.")]]
│ │ │
│ │ │ - │ │ │ -
69 {
│ │ │ -
70 return gv_.template begin<codim>();
│ │ │ -
71 }
│ │ │ -
│ │ │ -
72
│ │ │ -
│ │ │ - │ │ │ -
75 {
│ │ │ -
76 return gv_.template end<codim>();
│ │ │ -
77 }
│ │ │ -
│ │ │ -
78
│ │ │ -
│ │ │ -
80 const GridView& gridView() const
│ │ │ -
81 {
│ │ │ -
82 return gv_;
│ │ │ -
83 }
│ │ │ -
│ │ │ -
84
│ │ │ -
85private:
│ │ │ -
86 GridView gv_;
│ │ │ -
87};
│ │ │ -
│ │ │ -
88
│ │ │ -
89
│ │ │ -
90} // end of namespace Dune::Functions
│ │ │ -
91} // end of namespace Dune
│ │ │ -
92
│ │ │ -
93#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH
│ │ │ +
68auto forwardAsStaticIndex(const size_type& i, F&& f, Args&&... args)
│ │ │ +
69 ->decltype(f(Dune::Indices::_0, std::forward<Args>(args)...))
│ │ │ +
70{
│ │ │ +
71 return forwardAsStaticInteger(std::make_index_sequence<end>{}, i, std::forward<F>(f), std::forward<Args>(args)...);
│ │ │ +
72}
│ │ │ +
│ │ │ +
73
│ │ │ +
74
│ │ │ +
75
│ │ │ +
76namespace Imp {
│ │ │ +
77
│ │ │ +
78 template<template<class...> class T, class List>
│ │ │ +
79 struct ExpandTupleHelper
│ │ │ +
80 {};
│ │ │ +
81
│ │ │ +
82 template<template<class...> class T, template<class...> class ListType, class... Args>
│ │ │ +
83 struct ExpandTupleHelper<T, ListType<Args...>>
│ │ │ +
84 {
│ │ │ +
85 using Type = T<Args...>;
│ │ │ +
86 };
│ │ │ +
87
│ │ │ +
88} // end namespace Imp
│ │ │ +
89
│ │ │ +
101template<template<class...> class T, class ArgTuple>
│ │ │ +
102using ExpandTuple = typename Imp::ExpandTupleHelper<T, ArgTuple>::Type;
│ │ │ +
103
│ │ │ +
104
│ │ │ +
105
│ │ │ +
106namespace Imp {
│ │ │ +
107
│ │ │ +
108 template<template<class...> class T, class... Tuple>
│ │ │ +
109 struct TransformTupleHelper
│ │ │ +
110 {};
│ │ │ +
111
│ │ │ +
112 template<template<class...> class T, class... Args1>
│ │ │ +
113 struct TransformTupleHelper<T, typename std::tuple<Args1...>>
│ │ │ +
114 {
│ │ │ +
115 using Type = std::tuple<T<Args1>...>;
│ │ │ +
116 };
│ │ │ +
117
│ │ │ +
118 template<template<class...> class T, class... Args1, class... Args2>
│ │ │ +
119 struct TransformTupleHelper<T, typename std::tuple<Args1...>, typename std::tuple<Args2...>>
│ │ │ +
120 {
│ │ │ +
121 using Type = std::tuple<T<Args1, Args2>...>;
│ │ │ +
122 };
│ │ │ +
123
│ │ │ +
124} // end namespace Imp
│ │ │ +
125
│ │ │ +
138template<template<class...> class F, class... Tuples>
│ │ │ +
139using TransformTuple = typename Imp::TransformTupleHelper<F, Tuples...>::Type;
│ │ │ +
140
│ │ │ +
141
│ │ │ +
142
│ │ │ +
143namespace Imp {
│ │ │ +
144
│ │ │ +
145 template<class F, class... T, std::size_t... k>
│ │ │ +
146 auto transformTupleHelper(F&& f, const std::tuple<T...>& tuple, std::index_sequence<k...>)
│ │ │ +
147 -> decltype(std::make_tuple(f(std::get<k>(tuple))...))
│ │ │ +
148 {
│ │ │ +
149 return std::make_tuple(f(std::get<k>(tuple))...);
│ │ │ +
150 }
│ │ │ +
151
│ │ │ +
152 template<class F, class... T1, class...T2, std::size_t... k>
│ │ │ +
153 auto transformTupleHelper(F&& f, const std::tuple<T1...>& tuple1, const std::tuple<T2...>& tuple2, std::index_sequence<k...>)
│ │ │ +
154 -> decltype(std::make_tuple(f(std::get<k>(tuple1), std::get<k>(tuple2))...))
│ │ │ +
155 {
│ │ │ +
156 return std::make_tuple(f(std::get<k>(tuple1), std::get<k>(tuple2))...);
│ │ │ +
157 }
│ │ │ +
158
│ │ │ +
159} // end namespace Imp
│ │ │ +
160
│ │ │ +
172template<class F, class... T>
│ │ │ +
│ │ │ +
173auto transformTuple(F&& f, const std::tuple<T...>& tuple)
│ │ │ +
174 -> decltype(Imp::transformTupleHelper(std::forward<F>(f), tuple, std::index_sequence_for<T...>{}))
│ │ │ +
175{
│ │ │ +
176 return Imp::transformTupleHelper(std::forward<F>(f), tuple, std::index_sequence_for<T...>{});
│ │ │ +
177}
│ │ │ +
│ │ │ +
178
│ │ │ +
192template<class F, class... T1, class... T2>
│ │ │ +
│ │ │ +
193auto transformTuple(F&& f, const std::tuple<T1...>& tuple1, const std::tuple<T2...>& tuple2)
│ │ │ +
194 -> decltype(Imp::transformTupleHelper(std::forward<F>(f), tuple1, tuple2, std::index_sequence_for<T1...>{}))
│ │ │ +
195{
│ │ │ +
196 return Imp::transformTupleHelper(std::forward<F>(f), tuple1, tuple2, std::index_sequence_for<T1...>{});
│ │ │ +
197}
│ │ │ +
│ │ │ +
198
│ │ │ +
199
│ │ │ +
200
│ │ │ +
201namespace Imp {
│ │ │ +
202
│ │ │ +
203 template<class IntegerSequence>
│ │ │ +
204 struct IntegerSequenceTupleHelper
│ │ │ +
205 {};
│ │ │ +
206
│ │ │ +
207 template<class I, I... k>
│ │ │ +
208 struct IntegerSequenceTupleHelper<std::integer_sequence<I, k...>>
│ │ │ +
209 {
│ │ │ +
210 using Type = std::tuple<std::integral_constant<I, k>...>;
│ │ │ +
211 };
│ │ │ +
212
│ │ │ +
213} // end namespace Imp
│ │ │ +
214
│ │ │ +
218template<class IntegerSequence>
│ │ │ +
219using IntegerSequenceTuple= typename Imp::IntegerSequenceTupleHelper<IntegerSequence>::Type;
│ │ │ +
220
│ │ │ +
221
│ │ │ +
222
│ │ │ +
228template<class... T>
│ │ │ +
│ │ │ + │ │ │ +
230{
│ │ │ +
231 using type = std::tuple_element_t<sizeof...(T)-1, std::tuple<T...>>;
│ │ │ +
232};
│ │ │ +
│ │ │ +
233
│ │ │ +
234
│ │ │ +
235
│ │ │ +
236namespace Imp {
│ │ │ +
237
│ │ │ +
238template<class T, class I>
│ │ │ +
239struct RotateHelper;
│ │ │ +
240
│ │ │ +
241template<class... T, std::size_t... I>
│ │ │ +
242struct RotateHelper<std::tuple<T...>, std::index_sequence<I...> >
│ │ │ +
243{
│ │ │ +
244 using type = typename std::tuple<typename LastType<T...>::type, std::tuple_element_t<I,std::tuple<T...>>...>;
│ │ │ +
245};
│ │ │ +
246
│ │ │ +
247} // end namespace Imp
│ │ │ +
248
│ │ │ +
249
│ │ │ +
257template<class... T>
│ │ │ +
│ │ │ + │ │ │ +
259{
│ │ │ +
260 using type = typename Imp::RotateHelper<std::tuple<T...>, std::make_index_sequence<sizeof...(T)-1>>::type;
│ │ │ +
261};
│ │ │ +
│ │ │ +
262
│ │ │ +
263
│ │ │ +
264
│ │ │ +
286template<class Expression>
│ │ │ +
│ │ │ +
287auto callableCheck(Expression f)
│ │ │ +
288{
│ │ │ +
289 return [f](auto&&... args){
│ │ │ +
290 return Functions::Concept::isCallable(f, std::forward<decltype(args)>(args)...);
│ │ │ +
291 };
│ │ │ +
292}
│ │ │ +
│ │ │ +
293
│ │ │ +
294
│ │ │ +
295
│ │ │ +
311template<class Check>
│ │ │ +
│ │ │ +
312auto negatePredicate(Check check)
│ │ │ +
313{
│ │ │ +
314 return [check](auto&&... args){
│ │ │ +
315 auto negate = overload(
│ │ │ +
316 [](std::true_type) { return std::false_type{};},
│ │ │ +
317 [](std::false_type) { return std::true_type{};},
│ │ │ +
318 [](bool v) { return not v;});
│ │ │ +
319 return negate(check(std::forward<decltype(args)>(args)...));
│ │ │ +
320 };
│ │ │ +
321}
│ │ │ +
│ │ │ +
322
│ │ │ +
323
│ │ │ +
324namespace Impl {
│ │ │ +
325
│ │ │ +
326 // Wrapper to capture values in a lambda for perfect forwarding.
│ │ │ +
327 // This captures value types by value and reference types by reference.
│ │ │ +
328 template <typename T>
│ │ │ +
329 struct ForwardCaptureWrapper;
│ │ │ +
330
│ │ │ +
331 template <typename T>
│ │ │ +
332 struct ForwardCaptureWrapper
│ │ │ +
333 {
│ │ │ +
334 template <typename TT>
│ │ │ +
335 ForwardCaptureWrapper(TT&& t) : t_{std::forward<TT>(t)} {}
│ │ │ +
336
│ │ │ +
337 auto forward() const { return std::move(t_); }
│ │ │ +
338
│ │ │ +
339 T t_;
│ │ │ +
340 };
│ │ │ +
341
│ │ │ +
342 template <typename T>
│ │ │ +
343 struct ForwardCaptureWrapper<T&>
│ │ │ +
344 {
│ │ │ +
345 ForwardCaptureWrapper(T& t) : t_{t} {}
│ │ │ +
346
│ │ │ +
347 T& forward() const { return t_; };
│ │ │ +
348
│ │ │ +
349 T& t_;
│ │ │ +
350 };
│ │ │ +
351
│ │ │ +
352 template <typename T>
│ │ │ +
353 struct ForwardCaptureWrapper<const T&>
│ │ │ +
354 {
│ │ │ +
355 ForwardCaptureWrapper(const T& t) : t_{t} {}
│ │ │ +
356
│ │ │ +
357 const T& forward() const { return t_; };
│ │ │ +
358
│ │ │ +
359 const T& t_;
│ │ │ +
360 };
│ │ │ +
361
│ │ │ +
362} // end namespace Dune::Functions::Impl
│ │ │ +
363
│ │ │ +
364
│ │ │ +
365
│ │ │ +
379template <class T>
│ │ │ +
│ │ │ +
380auto forwardCapture(T&& t)
│ │ │ +
381{
│ │ │ +
382 return Impl::ForwardCaptureWrapper<T>(std::forward<T>(t));
│ │ │ +
383}
│ │ │ +
│ │ │ +
384
│ │ │ +
385
│ │ │ +
386
│ │ │ +
387} // namespace Dune::Functions
│ │ │ +
388} // namespace Dune
│ │ │ +
389
│ │ │ +
390
│ │ │ +
391#endif // DUNE_FUNCTIONS_COMMON_UTILITY_HH
│ │ │ + │ │ │ +
static constexpr auto isCallable()
Check if f is callable with given argument list.
Definition functionconcepts.hh:51
│ │ │ +
auto transformTuple(F &&f, const std::tuple< T... > &tuple) -> decltype(Imp::transformTupleHelper(std::forward< F >(f), tuple, std::index_sequence_for< T... >{}))
Transform tuple value using a functor.
Definition utility.hh:173
│ │ │ +
auto callableCheck(Expression f)
Create a predicate for checking validity of expressions.
Definition utility.hh:287
│ │ │ +
auto forwardAsStaticIndex(const size_type &i, F &&f, Args &&... args) -> decltype(f(Dune::Indices::_0, std::forward< Args >(args)...))
Transform dynamic index to static index_constant.
Definition utility.hh:68
│ │ │ +
typename Imp::TransformTupleHelper< F, Tuples... >::Type TransformTuple
Transform tuple types argument using type-functor.
Definition utility.hh:139
│ │ │ +
auto negatePredicate(Check check)
Negate given predicate.
Definition utility.hh:312
│ │ │ +
typename Imp::ExpandTupleHelper< T, ArgTuple >::Type ExpandTuple
Expand tuple arguments as template arguments.
Definition utility.hh:102
│ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
GridViewEntitySet(const GridView &gv)
Construct GridViewEntitySet for a GridView.
Definition gridviewentityset.hh:51
│ │ │ -
GridView GridView
Definition gridviewentityset.hh:30
│ │ │ -
GridView::template Codim< codim >::Entity Element
Definition gridviewentityset.hh:36
│ │ │ -
const_iterator end() const
Create an end iterator.
Definition gridviewentityset.hh:74
│ │ │ -
const GridView & gridView() const
Return the associated GridView.
Definition gridviewentityset.hh:80
│ │ │ -
Element value_type
Definition gridviewentityset.hh:42
│ │ │ -
const_iterator begin() const
Create a begin iterator.
Definition gridviewentityset.hh:68
│ │ │ -
GridView::template Codim< codim >::Iterator const_iterator
Definition gridviewentityset.hh:45
│ │ │ -
Element::Geometry::LocalCoordinate LocalCoordinate
Definition gridviewentityset.hh:39
│ │ │ -
size_t size() const
Return number of Elements visited by an iterator.
Definition gridviewentityset.hh:62
│ │ │ -
@ codim
Definition gridviewentityset.hh:32
│ │ │ -
Element::Geometry::GlobalCoordinate GlobalCoordinate
Definition gridviewentityset.hh:40
│ │ │ -
bool contains(const Element &e) const
Return true if e is contained in the EntitySet.
Definition gridviewentityset.hh:56
│ │ │ -
const_iterator iterator
Definition gridviewentityset.hh:48
│ │ │ +
auto forwardCapture(T &&t)
Create a capture object for perfect forwarding.
Definition utility.hh:380
│ │ │ +
auto forwardAsStaticInteger(std::integer_sequence< size_type, firstValue > values, const size_type &i, F &&f, Args &&... args) -> decltype(f(std::integral_constant< size_type, firstValue >(), std::forward< Args >(args)...))
Definition utility.hh:25
│ │ │ +
typename Imp::IntegerSequenceTupleHelper< IntegerSequence >::Type IntegerSequenceTuple
Transform integer_sequence<I,k...> to tuple<integral_constant<I,k>...>.
Definition utility.hh:219
│ │ │ +
Get last entry of type list.
Definition utility.hh:230
│ │ │ +
std::tuple_element_t< sizeof...(T) -1, std::tuple< T... > > type
Definition utility.hh:231
│ │ │ +
Rotate type list by one, such that last entry is moved to first position.
Definition utility.hh:259
│ │ │ +
typename Imp::RotateHelper< std::tuple< T... >, std::make_index_sequence< sizeof...(T) -1 > >::type type
Definition utility.hh:260
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,141 +1,358 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -gridviewentityset.hh │ │ │ │ +utility.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH │ │ │ │ -8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_COMMON_UTILITY_HH │ │ │ │ +8#define DUNE_FUNCTIONS_COMMON_UTILITY_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11 │ │ │ │ -12 │ │ │ │ -13namespace _D_u_n_e { │ │ │ │ -14 │ │ │ │ -15namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +10 │ │ │ │ +11#include │ │ │ │ +12#include │ │ │ │ +13 │ │ │ │ +14#include │ │ │ │ +15#include │ │ │ │ 16 │ │ │ │ -17 │ │ │ │ -25template │ │ │ │ -_2_6class _G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t │ │ │ │ +17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +18 │ │ │ │ +19namespace _D_u_n_e { │ │ │ │ +20namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +21 │ │ │ │ +22 │ │ │ │ +23template │ │ │ │ +24[[deprecated("This function will be removed after Dune 2.11")]] │ │ │ │ +_2_5auto _f_o_r_w_a_r_d_A_s_S_t_a_t_i_c_I_n_t_e_g_e_r(std::integer_sequence │ │ │ │ +values, const size_type& i, F&& f, Args&&... args) │ │ │ │ +26 ->decltype(f(std::integral_constant(), std:: │ │ │ │ +forward(args)...)) │ │ │ │ 27{ │ │ │ │ -28public: │ │ │ │ -29 │ │ │ │ -_3_0 typedef GV _G_r_i_d_V_i_e_w; │ │ │ │ -31 enum { │ │ │ │ -_3_2 _c_o_d_i_m = cd │ │ │ │ -33 }; │ │ │ │ -34 │ │ │ │ -_3_6 typedef typename GridView::template Codim::Entity _E_l_e_m_e_n_t; │ │ │ │ -37 │ │ │ │ -_3_9 typedef typename Element::Geometry::LocalCoordinate _L_o_c_a_l_C_o_o_r_d_i_n_a_t_e; │ │ │ │ -_4_0 typedef typename Element::Geometry::GlobalCoordinate _G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e; │ │ │ │ +28 return f(std::integral_constant(), std::forward │ │ │ │ +(args)...); │ │ │ │ +29} │ │ │ │ +30 │ │ │ │ +31template │ │ │ │ +32[[deprecated("This function will be removed after Dune 2.11")]] │ │ │ │ +_3_3auto _f_o_r_w_a_r_d_A_s_S_t_a_t_i_c_I_n_t_e_g_e_r(std::integer_sequence values, const size_type i, F&& f, Args&&... args) │ │ │ │ +34 ->decltype(f(std::integral_constant(), std:: │ │ │ │ +forward(args)...)) │ │ │ │ +35{ │ │ │ │ +36 if (i==firstValue) │ │ │ │ +37 return f(std::integral_constant(), std::forward │ │ │ │ +(args)...); │ │ │ │ +38 return _f_o_r_w_a_r_d_A_s_S_t_a_t_i_c_I_n_t_e_g_e_r(std::integer_sequence(), i, std::forward(f), std::forward(args)...); │ │ │ │ +39} │ │ │ │ +40 │ │ │ │ 41 │ │ │ │ -_4_2 typedef _E_l_e_m_e_n_t _v_a_l_u_e___t_y_p_e; │ │ │ │ -43 │ │ │ │ -_4_5 typedef typename GridView::template Codim::Iterator _c_o_n_s_t___i_t_e_r_a_t_o_r; │ │ │ │ -46 │ │ │ │ -_4_8 typedef _c_o_n_s_t___i_t_e_r_a_t_o_r _i_t_e_r_a_t_o_r; │ │ │ │ -49 │ │ │ │ -_5_1 _G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t(const _G_r_i_d_V_i_e_w& gv) : │ │ │ │ -52 gv_(gv) │ │ │ │ -53 {} │ │ │ │ -54 │ │ │ │ -_5_6 bool _c_o_n_t_a_i_n_s(const _E_l_e_m_e_n_t& e) const │ │ │ │ -57 { │ │ │ │ -58 return gv_.contains(e); │ │ │ │ -59 } │ │ │ │ -60 │ │ │ │ -_6_2 size_t _s_i_z_e() const │ │ │ │ -63 { │ │ │ │ -64 return gv_.size(_c_o_d_i_m); │ │ │ │ -65 } │ │ │ │ -66 │ │ │ │ -_6_8 _c_o_n_s_t___i_t_e_r_a_t_o_r _b_e_g_i_n() const │ │ │ │ -69 { │ │ │ │ -70 return gv_.template _b_e_g_i_n_<_c_o_d_i_m_>(); │ │ │ │ -71 } │ │ │ │ -72 │ │ │ │ -_7_4 _c_o_n_s_t___i_t_e_r_a_t_o_r _e_n_d() const │ │ │ │ -75 { │ │ │ │ -76 return gv_.template _e_n_d_<_c_o_d_i_m_>(); │ │ │ │ -77 } │ │ │ │ -78 │ │ │ │ -_8_0 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ -81 { │ │ │ │ -82 return gv_; │ │ │ │ -83 } │ │ │ │ -84 │ │ │ │ -85private: │ │ │ │ -86 _G_r_i_d_V_i_e_w gv_; │ │ │ │ -87}; │ │ │ │ -88 │ │ │ │ +42 │ │ │ │ +66template │ │ │ │ +67[[deprecated("This function will be removed after Dune 2.11, use Dune:: │ │ │ │ +Hybrid::switchCases.")]] │ │ │ │ +_6_8auto _f_o_r_w_a_r_d_A_s_S_t_a_t_i_c_I_n_d_e_x(const size_type& i, F&& f, Args&&... args) │ │ │ │ +69 ->decltype(f(Dune::Indices::_0, std::forward(args)...)) │ │ │ │ +70{ │ │ │ │ +71 return _f_o_r_w_a_r_d_A_s_S_t_a_t_i_c_I_n_t_e_g_e_r(std::make_index_sequence{}, i, std:: │ │ │ │ +forward(f), std::forward(args)...); │ │ │ │ +72} │ │ │ │ +73 │ │ │ │ +74 │ │ │ │ +75 │ │ │ │ +76namespace Imp { │ │ │ │ +77 │ │ │ │ +78 template class T, class List> │ │ │ │ +79 struct ExpandTupleHelper │ │ │ │ +80 {}; │ │ │ │ +81 │ │ │ │ +82 template class T, template class ListType, │ │ │ │ +class... Args> │ │ │ │ +83 struct ExpandTupleHelper> │ │ │ │ +84 { │ │ │ │ +85 using Type = T; │ │ │ │ +86 }; │ │ │ │ +87 │ │ │ │ +88} // end namespace Imp │ │ │ │ 89 │ │ │ │ -90} // end of namespace Dune::Functions │ │ │ │ -91} // end of namespace Dune │ │ │ │ -92 │ │ │ │ -93#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH │ │ │ │ +101template class T, class ArgTuple> │ │ │ │ +_1_0_2using _E_x_p_a_n_d_T_u_p_l_e = typename Imp::ExpandTupleHelper::Type; │ │ │ │ +103 │ │ │ │ +104 │ │ │ │ +105 │ │ │ │ +106namespace Imp { │ │ │ │ +107 │ │ │ │ +108 template class T, class... Tuple> │ │ │ │ +109 struct TransformTupleHelper │ │ │ │ +110 {}; │ │ │ │ +111 │ │ │ │ +112 template class T, class... Args1> │ │ │ │ +113 struct TransformTupleHelper> │ │ │ │ +114 { │ │ │ │ +115 using Type = std::tuple...>; │ │ │ │ +116 }; │ │ │ │ +117 │ │ │ │ +118 template class T, class... Args1, class... Args2> │ │ │ │ +119 struct TransformTupleHelper, typename │ │ │ │ +std::tuple> │ │ │ │ +120 { │ │ │ │ +121 using Type = std::tuple...>; │ │ │ │ +122 }; │ │ │ │ +123 │ │ │ │ +124} // end namespace Imp │ │ │ │ +125 │ │ │ │ +138template class F, class... Tuples> │ │ │ │ +_1_3_9using _T_r_a_n_s_f_o_r_m_T_u_p_l_e = typename Imp::TransformTupleHelper:: │ │ │ │ +Type; │ │ │ │ +140 │ │ │ │ +141 │ │ │ │ +142 │ │ │ │ +143namespace Imp { │ │ │ │ +144 │ │ │ │ +145 template │ │ │ │ +146 auto transformTupleHelper(F&& f, const std::tuple& tuple, std:: │ │ │ │ +index_sequence) │ │ │ │ +147 -> decltype(std::make_tuple(f(std::get(tuple))...)) │ │ │ │ +148 { │ │ │ │ +149 return std::make_tuple(f(std::get(tuple))...); │ │ │ │ +150 } │ │ │ │ +151 │ │ │ │ +152 template │ │ │ │ +153 auto transformTupleHelper(F&& f, const std::tuple& tuple1, const │ │ │ │ +std::tuple& tuple2, std::index_sequence) │ │ │ │ +154 -> decltype(std::make_tuple(f(std::get(tuple1), std::get │ │ │ │ +(tuple2))...)) │ │ │ │ +155 { │ │ │ │ +156 return std::make_tuple(f(std::get(tuple1), std::get(tuple2))...); │ │ │ │ +157 } │ │ │ │ +158 │ │ │ │ +159} // end namespace Imp │ │ │ │ +160 │ │ │ │ +172template │ │ │ │ +_1_7_3auto _t_r_a_n_s_f_o_r_m_T_u_p_l_e(F&& f, const std::tuple& tuple) │ │ │ │ +174 -> decltype(Imp::transformTupleHelper(std::forward(f), tuple, std:: │ │ │ │ +index_sequence_for{})) │ │ │ │ +175{ │ │ │ │ +176 return Imp::transformTupleHelper(std::forward(f), tuple, std:: │ │ │ │ +index_sequence_for{}); │ │ │ │ +177} │ │ │ │ +178 │ │ │ │ +192template │ │ │ │ +_1_9_3auto _t_r_a_n_s_f_o_r_m_T_u_p_l_e(F&& f, const std::tuple& tuple1, const std:: │ │ │ │ +tuple& tuple2) │ │ │ │ +194 -> decltype(Imp::transformTupleHelper(std::forward(f), tuple1, tuple2, │ │ │ │ +std::index_sequence_for{})) │ │ │ │ +195{ │ │ │ │ +196 return Imp::transformTupleHelper(std::forward(f), tuple1, tuple2, std:: │ │ │ │ +index_sequence_for{}); │ │ │ │ +197} │ │ │ │ +198 │ │ │ │ +199 │ │ │ │ +200 │ │ │ │ +201namespace Imp { │ │ │ │ +202 │ │ │ │ +203 template │ │ │ │ +204 struct IntegerSequenceTupleHelper │ │ │ │ +205 {}; │ │ │ │ +206 │ │ │ │ +207 template │ │ │ │ +208 struct IntegerSequenceTupleHelper> │ │ │ │ +209 { │ │ │ │ +210 using Type = std::tuple...>; │ │ │ │ +211 }; │ │ │ │ +212 │ │ │ │ +213} // end namespace Imp │ │ │ │ +214 │ │ │ │ +218template │ │ │ │ +_2_1_9using _I_n_t_e_g_e_r_S_e_q_u_e_n_c_e_T_u_p_l_e= typename Imp:: │ │ │ │ +IntegerSequenceTupleHelper::Type; │ │ │ │ +220 │ │ │ │ +221 │ │ │ │ +222 │ │ │ │ +228template │ │ │ │ +_2_2_9struct _L_a_s_t_T_y_p_e │ │ │ │ +230{ │ │ │ │ +_2_3_1 using _t_y_p_e = std::tuple_element_t>; │ │ │ │ +232}; │ │ │ │ +233 │ │ │ │ +234 │ │ │ │ +235 │ │ │ │ +236namespace Imp { │ │ │ │ +237 │ │ │ │ +238template │ │ │ │ +239struct RotateHelper; │ │ │ │ +240 │ │ │ │ +241template │ │ │ │ +242struct RotateHelper, std::index_sequence > │ │ │ │ +243{ │ │ │ │ +244 using type = typename std::tuple::type, std:: │ │ │ │ +tuple_element_t>...>; │ │ │ │ +245}; │ │ │ │ +246 │ │ │ │ +247} // end namespace Imp │ │ │ │ +248 │ │ │ │ +249 │ │ │ │ +257template │ │ │ │ +_2_5_8struct _R_o_t_a_t_e_T_u_p_l_e │ │ │ │ +259{ │ │ │ │ +_2_6_0 using _t_y_p_e = typename Imp::RotateHelper, std:: │ │ │ │ +make_index_sequence>_:_:_t_y_p_e; │ │ │ │ +261}; │ │ │ │ +262 │ │ │ │ +263 │ │ │ │ +264 │ │ │ │ +286template │ │ │ │ +_2_8_7auto _c_a_l_l_a_b_l_e_C_h_e_c_k(Expression f) │ │ │ │ +288{ │ │ │ │ +289 return [f](auto&&... args){ │ │ │ │ +290 return _F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_C_a_l_l_a_b_l_e(f, std::forward │ │ │ │ +(args)...); │ │ │ │ +291 }; │ │ │ │ +292} │ │ │ │ +293 │ │ │ │ +294 │ │ │ │ +295 │ │ │ │ +311template │ │ │ │ +_3_1_2auto _n_e_g_a_t_e_P_r_e_d_i_c_a_t_e(Check check) │ │ │ │ +313{ │ │ │ │ +314 return [check](auto&&... args){ │ │ │ │ +315 auto negate = overload( │ │ │ │ +316 [](std::true_type) { return std::false_type{};}, │ │ │ │ +317 [](std::false_type) { return std::true_type{};}, │ │ │ │ +318 [](bool v) { return not v;}); │ │ │ │ +319 return negate(check(std::forward(args)...)); │ │ │ │ +320 }; │ │ │ │ +321} │ │ │ │ +322 │ │ │ │ +323 │ │ │ │ +324namespace Impl { │ │ │ │ +325 │ │ │ │ +326 // Wrapper to capture values in a lambda for perfect forwarding. │ │ │ │ +327 // This captures value types by value and reference types by reference. │ │ │ │ +328 template │ │ │ │ +329 struct ForwardCaptureWrapper; │ │ │ │ +330 │ │ │ │ +331 template │ │ │ │ +332 struct ForwardCaptureWrapper │ │ │ │ +333 { │ │ │ │ +334 template │ │ │ │ +335 ForwardCaptureWrapper(TT&& t) : t_{std::forward(t)} {} │ │ │ │ +336 │ │ │ │ +337 auto forward() const { return std::move(t_); } │ │ │ │ +338 │ │ │ │ +339 T t_; │ │ │ │ +340 }; │ │ │ │ +341 │ │ │ │ +342 template │ │ │ │ +343 struct ForwardCaptureWrapper │ │ │ │ +344 { │ │ │ │ +345 ForwardCaptureWrapper(T& t) : t_{t} {} │ │ │ │ +346 │ │ │ │ +347 T& forward() const { return t_; }; │ │ │ │ +348 │ │ │ │ +349 T& t_; │ │ │ │ +350 }; │ │ │ │ +351 │ │ │ │ +352 template │ │ │ │ +353 struct ForwardCaptureWrapper │ │ │ │ +354 { │ │ │ │ +355 ForwardCaptureWrapper(const T& t) : t_{t} {} │ │ │ │ +356 │ │ │ │ +357 const T& forward() const { return t_; }; │ │ │ │ +358 │ │ │ │ +359 const T& t_; │ │ │ │ +360 }; │ │ │ │ +361 │ │ │ │ +362} // end namespace Dune::Functions::Impl │ │ │ │ +363 │ │ │ │ +364 │ │ │ │ +365 │ │ │ │ +379template │ │ │ │ +_3_8_0auto _f_o_r_w_a_r_d_C_a_p_t_u_r_e(T&& t) │ │ │ │ +381{ │ │ │ │ +382 return Impl::ForwardCaptureWrapper(std::forward(t)); │ │ │ │ +383} │ │ │ │ +384 │ │ │ │ +385 │ │ │ │ +386 │ │ │ │ +387} // namespace Dune::Functions │ │ │ │ +388} // namespace Dune │ │ │ │ +389 │ │ │ │ +390 │ │ │ │ +391#endif // DUNE_FUNCTIONS_COMMON_UTILITY_HH │ │ │ │ +_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_C_a_l_l_a_b_l_e │ │ │ │ +static constexpr auto isCallable() │ │ │ │ +Check if f is callable with given argument list. │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:51 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_t_r_a_n_s_f_o_r_m_T_u_p_l_e │ │ │ │ +auto transformTuple(F &&f, const std::tuple< T... > &tuple) -> decltype(Imp:: │ │ │ │ +transformTupleHelper(std::forward< F >(f), tuple, std::index_sequence_for< T... │ │ │ │ +>{})) │ │ │ │ +Transform tuple value using a functor. │ │ │ │ +DDeeffiinniittiioonn utility.hh:173 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_a_l_l_a_b_l_e_C_h_e_c_k │ │ │ │ +auto callableCheck(Expression f) │ │ │ │ +Create a predicate for checking validity of expressions. │ │ │ │ +DDeeffiinniittiioonn utility.hh:287 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_o_r_w_a_r_d_A_s_S_t_a_t_i_c_I_n_d_e_x │ │ │ │ +auto forwardAsStaticIndex(const size_type &i, F &&f, Args &&... args) - │ │ │ │ +> decltype(f(Dune::Indices::_0, std::forward< Args >(args)...)) │ │ │ │ +Transform dynamic index to static index_constant. │ │ │ │ +DDeeffiinniittiioonn utility.hh:68 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_a_n_s_f_o_r_m_T_u_p_l_e │ │ │ │ +typename Imp::TransformTupleHelper< F, Tuples... >::Type TransformTuple │ │ │ │ +Transform tuple types argument using type-functor. │ │ │ │ +DDeeffiinniittiioonn utility.hh:139 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_n_e_g_a_t_e_P_r_e_d_i_c_a_t_e │ │ │ │ +auto negatePredicate(Check check) │ │ │ │ +Negate given predicate. │ │ │ │ +DDeeffiinniittiioonn utility.hh:312 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_a_n_d_T_u_p_l_e │ │ │ │ +typename Imp::ExpandTupleHelper< T, ArgTuple >::Type ExpandTuple │ │ │ │ +Expand tuple arguments as template arguments. │ │ │ │ +DDeeffiinniittiioonn utility.hh:102 │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t │ │ │ │ -GridViewEntitySet(const GridView &gv) │ │ │ │ -Construct GridViewEntitySet for a GridView. │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:51 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_G_r_i_d_V_i_e_w │ │ │ │ -GridView GridView │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:30 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_E_l_e_m_e_n_t │ │ │ │ -GridView::template Codim< codim >::Entity Element │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:36 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_:_:_e_n_d │ │ │ │ -const_iterator end() const │ │ │ │ -Create an end iterator. │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:74 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_:_:_g_r_i_d_V_i_e_w │ │ │ │ -const GridView & gridView() const │ │ │ │ -Return the associated GridView. │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:80 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_v_a_l_u_e___t_y_p_e │ │ │ │ -Element value_type │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:42 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_:_:_b_e_g_i_n │ │ │ │ -const_iterator begin() const │ │ │ │ -Create a begin iterator. │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:68 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_c_o_n_s_t___i_t_e_r_a_t_o_r │ │ │ │ -GridView::template Codim< codim >::Iterator const_iterator │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:45 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ -Element::Geometry::LocalCoordinate LocalCoordinate │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:39 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_:_:_s_i_z_e │ │ │ │ -size_t size() const │ │ │ │ -Return number of Elements visited by an iterator. │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:62 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_c_o_d_i_m │ │ │ │ -@ codim │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:32 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ -Element::Geometry::GlobalCoordinate GlobalCoordinate │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:40 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_:_:_c_o_n_t_a_i_n_s │ │ │ │ -bool contains(const Element &e) const │ │ │ │ -Return true if e is contained in the EntitySet. │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:56 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_i_t_e_r_a_t_o_r │ │ │ │ -const_iterator iterator │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:48 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_o_r_w_a_r_d_C_a_p_t_u_r_e │ │ │ │ +auto forwardCapture(T &&t) │ │ │ │ +Create a capture object for perfect forwarding. │ │ │ │ +DDeeffiinniittiioonn utility.hh:380 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_o_r_w_a_r_d_A_s_S_t_a_t_i_c_I_n_t_e_g_e_r │ │ │ │ +auto forwardAsStaticInteger(std::integer_sequence< size_type, firstValue > │ │ │ │ +values, const size_type &i, F &&f, Args &&... args) -> decltype(f(std:: │ │ │ │ +integral_constant< size_type, firstValue >(), std::forward< Args >(args)...)) │ │ │ │ +DDeeffiinniittiioonn utility.hh:25 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_n_t_e_g_e_r_S_e_q_u_e_n_c_e_T_u_p_l_e │ │ │ │ +typename Imp::IntegerSequenceTupleHelper< IntegerSequence >::Type │ │ │ │ +IntegerSequenceTuple │ │ │ │ +Transform integer_sequence to tuple...>. │ │ │ │ +DDeeffiinniittiioonn utility.hh:219 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_s_t_T_y_p_e │ │ │ │ +Get last entry of type list. │ │ │ │ +DDeeffiinniittiioonn utility.hh:230 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_s_t_T_y_p_e_:_:_t_y_p_e │ │ │ │ +std::tuple_element_t< sizeof...(T) -1, std::tuple< T... > > type │ │ │ │ +DDeeffiinniittiioonn utility.hh:231 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_o_t_a_t_e_T_u_p_l_e │ │ │ │ +Rotate type list by one, such that last entry is moved to first position. │ │ │ │ +DDeeffiinniittiioonn utility.hh:259 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_o_t_a_t_e_T_u_p_l_e_:_:_t_y_p_e │ │ │ │ +typename Imp::RotateHelper< std::tuple< T... >, std::make_index_sequence< │ │ │ │ +sizeof...(T) -1 > >::type type │ │ │ │ +DDeeffiinniittiioonn utility.hh:260 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _u_t_i_l_i_t_y_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00050.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: gridfunction_imp.hh File Reference │ │ │ +Dune-Functions: functionconcepts.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,40 +88,108 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
gridfunction_imp.hh File Reference
│ │ │ +
functionconcepts.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <dune/functions/common/type_traits.hh>
│ │ │ -#include <dune/functions/common/interfaces.hh>
│ │ │ -#include <dune/functions/common/differentiablefunction_imp.hh>
│ │ │ +
#include <dune/common/typelist.hh>
│ │ │ +#include <dune/common/concept.hh>
│ │ │ +#include <dune/functions/common/signature.hh>
│ │ │ +#include <dune/functions/gridfunctions/localderivativetraits.hh>
│ │ │ +#include <dune/functions/gridfunctions/gridviewentityset.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +

│ │ │ +Classes

struct  Dune::Functions::Concept::Callable< Args >
 Concept objects that can be called with given argument list. More...
struct  Dune::Functions::Concept::Function< Range(Domain)>
 Concept for a function mapping Domain to Range. More...
struct  Dune::Functions::Concept::DifferentiableFunction< Range(Domain), DerivativeTraits >
 Concept for a differentiable function mapping Domain to Range. More...
struct  Dune::Functions::Concept::LocalFunction< Range(Domain), LocalContext >
 Concept for a local function mapping Domain to Range. More...
struct  Dune::Functions::Concept::DifferentiableLocalFunction< Range(Domain), LocalContext, DerivativeTraits >
 Concept for a differentiable local function mapping Domain to Range. More...
struct  Dune::Functions::Concept::EntitySet
 Concept for an entity set for a Concept::GridFunction<Range(Domain), EntitySet, DerivativeTraits>. More...
struct  Dune::Functions::Concept::GridFunction< Range(Domain), EntitySet >
 Concept for a grid function mapping Domain to Range. More...
struct  Dune::Functions::Concept::DifferentiableGridFunction< Range(Domain), EntitySet, DerivativeTraits >
 Concept for a differentiable grid function mapping Domain to Range. More...
struct  Dune::Functions::Concept::GridViewFunction< Range(Domain), GridView >
 Concept for a grid view function mapping Domain to Range. More...
struct  Dune::Functions::Concept::DifferentiableGridViewFunction< Range(Domain), GridView, DerivativeTraits >
 Concept for a differentiable grid view function mapping Domain to Range. More...
│ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ +

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::Concept
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ +Functions

template<class F, class... Args>
static constexpr auto Dune::Functions::Concept::isCallable ()
 Check if f is callable with given argument list.
template<class F, class... Args>
static constexpr auto Dune::Functions::Concept::isCallable (F &&, Args &&...)
 Check if f is callable with given argument list.
template<class F, class Signature>
static constexpr bool Dune::Functions::Concept::isFunction ()
 Check if F models the Function concept with given signature.
template<class F, class Signature, template< class > class DerivativeTraits>
static constexpr bool Dune::Functions::Concept::isFunction (F &&f, SignatureTag< Signature, DerivativeTraits >)
 Check if f models the Function concept with given signature.
template<class F, class Signature, template< class > class DerivativeTraits = DefaultDerivativeTraits>
static constexpr bool Dune::Functions::Concept::isDifferentiableFunction ()
 Check if F models the DifferentiableFunction concept with given signature.
template<class F, class Signature, template< class > class DerivativeTraits>
static constexpr bool Dune::Functions::Concept::isDifferentiableFunction (F &&f, SignatureTag< Signature, DerivativeTraits >)
 Check if f models the DifferentiableFunction concept with given signature.
template<class F, class Signature, class LocalContext>
static constexpr bool Dune::Functions::Concept::isLocalFunction ()
 Check if F models the LocalFunction concept with given signature and local context.
template<class F, class Signature, class LocalContext, template< class > class DerivativeTraits = DefaultDerivativeTraits>
static constexpr bool Dune::Functions::Concept::isDifferentiableLocalFunction ()
 Check if F models the DifferentiableLocalFunction concept with given signature and local context.
template<class E>
static constexpr bool Dune::Functions::Concept::isEntitySet ()
 Check if F models the GridFunction concept with given signature and entity set.
template<class F, class Signature, class EntitySet>
static constexpr bool Dune::Functions::Concept::isGridFunction ()
 Check if F models the GridFunction concept with given signature and entity set.
template<class F, class Signature, class EntitySet, template< class > class DerivativeTraits = DefaultDerivativeTraits>
static constexpr bool Dune::Functions::Concept::isDifferentiableGridFunction ()
 Check if F models the DifferentiableGridFunction concept with given signature and entity set.
template<class F, class Signature, class GridView>
static constexpr bool Dune::Functions::Concept::isGridViewFunction ()
 Check if F models the GridViewFunction concept with given signature.
template<class F, class Signature, class GridView, template< class > class DerivativeTraits = DefaultDerivativeTraits>
static constexpr bool Dune::Functions::Concept::isDifferentiableGridViewFunction ()
 Check if F models the DifferentiableGridViewFunction concept with given signature.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,17 +1,109 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -gridfunction_imp.hh File Reference │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_i_n_t_e_r_f_a_c_e_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n___i_m_p_._h_h> │ │ │ │ +functionconcepts.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_s_i_g_n_a_t_u_r_e_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_l_o_c_a_l_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ +CCllaasssseess │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_C_a_l_l_a_b_l_e_<_ _A_r_g_s_ _> │ │ │ │ +  _C_o_n_c_e_p_t objects that can be called with given argument list. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_> │ │ │ │ +  _C_o_n_c_e_p_t for a function mapping Domain to Range. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ + _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _> │ │ │ │ +  _C_o_n_c_e_p_t for a differentiable function mapping Domain to Range. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _L_o_c_a_l_C_o_n_t_e_x_t_ _> │ │ │ │ +  _C_o_n_c_e_p_t for a local function mapping Domain to Range. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_L_o_c_a_l_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ + _L_o_c_a_l_C_o_n_t_e_x_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _> │ │ │ │ +  _C_o_n_c_e_p_t for a differentiable local function mapping Domain to Range. │ │ │ │ + _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_E_n_t_i_t_y_S_e_t │ │ │ │ +  _C_o_n_c_e_p_t for an entity set for a _C_o_n_c_e_p_t_:_:_G_r_i_d_F_u_n_c_t_i_o_n_<_R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ + _E_n_t_i_t_y_S_e_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_>. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_n_t_i_t_y_S_e_t_ _> │ │ │ │ +  _C_o_n_c_e_p_t for a grid function mapping Domain to Range. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ + _E_n_t_i_t_y_S_e_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _> │ │ │ │ +  _C_o_n_c_e_p_t for a differentiable grid function mapping Domain to Range. │ │ │ │ + _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_r_i_d_V_i_e_w_ _> │ │ │ │ +  _C_o_n_c_e_p_t for a grid view function mapping Domain to Range. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e │ │ │ │ + _(_D_o_m_a_i_n_)_,_ _G_r_i_d_V_i_e_w_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _> │ │ │ │ +  _C_o_n_c_e_p_t for a differentiable grid view function mapping Domain to │ │ │ │ + Range. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ +namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t │ │ │ │ +FFuunnccttiioonnss │ │ │ │ +template │ │ │ │ +static constexpr auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_C_a_l_l_a_b_l_e () │ │ │ │ +  Check if f is callable with given argument list. │ │ │ │ +template │ │ │ │ +static constexpr auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_C_a_l_l_a_b_l_e (F &&, Args &&...) │ │ │ │ +  Check if f is callable with given argument list. │ │ │ │ +template │ │ │ │ +static constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_F_u_n_c_t_i_o_n () │ │ │ │ +  Check if F models the _F_u_n_c_t_i_o_n concept with given │ │ │ │ + signature. │ │ │ │ +template class DerivativeTraits> │ │ │ │ +static constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_F_u_n_c_t_i_o_n (F &&f, │ │ │ │ + _S_i_g_n_a_t_u_r_e_T_a_g< Signature, DerivativeTraits >) │ │ │ │ +  Check if f models the _F_u_n_c_t_i_o_n concept with given │ │ │ │ + signature. │ │ │ │ +template class DerivativeTraits = │ │ │ │ +DefaultDerivativeTraits> │ │ │ │ +static constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n () │ │ │ │ +  Check if F models the _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n concept │ │ │ │ + with given signature. │ │ │ │ +template class DerivativeTraits> │ │ │ │ +static constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n (F │ │ │ │ + &&f, _S_i_g_n_a_t_u_r_e_T_a_g< Signature, DerivativeTraits >) │ │ │ │ +  Check if f models the _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n concept │ │ │ │ + with given signature. │ │ │ │ +template │ │ │ │ +static constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_L_o_c_a_l_F_u_n_c_t_i_o_n () │ │ │ │ +  Check if F models the _L_o_c_a_l_F_u_n_c_t_i_o_n concept with given │ │ │ │ + signature and local context. │ │ │ │ +template class │ │ │ │ +DerivativeTraits = DefaultDerivativeTraits> │ │ │ │ +static constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_D_i_f_f_e_r_e_n_t_i_a_b_l_e_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ + () │ │ │ │ +  Check if F models the _D_i_f_f_e_r_e_n_t_i_a_b_l_e_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ + concept with given signature and local context. │ │ │ │ +template │ │ │ │ +static constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_E_n_t_i_t_y_S_e_t () │ │ │ │ +  Check if F models the _G_r_i_d_F_u_n_c_t_i_o_n concept with given │ │ │ │ + signature and entity set. │ │ │ │ +template │ │ │ │ +static constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_G_r_i_d_F_u_n_c_t_i_o_n () │ │ │ │ +  Check if F models the _G_r_i_d_F_u_n_c_t_i_o_n concept with given │ │ │ │ + signature and entity set. │ │ │ │ +template class │ │ │ │ +DerivativeTraits = DefaultDerivativeTraits> │ │ │ │ +static constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ + () │ │ │ │ +  Check if F models the _D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_F_u_n_c_t_i_o_n concept │ │ │ │ + with given signature and entity set. │ │ │ │ +template │ │ │ │ +static constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n () │ │ │ │ +  Check if F models the _G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n concept with │ │ │ │ + given signature. │ │ │ │ +template class │ │ │ │ +DerivativeTraits = DefaultDerivativeTraits> │ │ │ │ +static constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_: │ │ │ │ + _i_s_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n () │ │ │ │ +  Check if F models the _D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ + concept with given signature. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_f_u_n_c_t_i_o_n___i_m_p_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00050_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: gridfunction_imp.hh Source File │ │ │ +Dune-Functions: functionconcepts.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,98 +88,377 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
gridfunction_imp.hh
│ │ │ +
functionconcepts.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH
│ │ │ -
8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH
│ │ │ +
8#define DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH
│ │ │
9
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
13
│ │ │ -
14
│ │ │ -
15
│ │ │ -
16namespace Dune {
│ │ │ -
17namespace Functions {
│ │ │ -
18namespace Imp {
│ │ │ -
19
│ │ │ -
23struct HasFreeLocalFunction
│ │ │ -
24{
│ │ │ -
25 template<class F>
│ │ │ -
26 auto require(F&& f) -> decltype(
│ │ │ -
27 localFunction(f)
│ │ │ -
28 );
│ │ │ -
29};
│ │ │ -
30
│ │ │ -
31
│ │ │ -
32
│ │ │ -
33// Interface of type erasure wrapper
│ │ │ -
34//
│ │ │ -
35// Notice that the basic interface of polymorphic classes (destructor, clone, ...)
│ │ │ -
36// will be added by the type erasure foundation classes.
│ │ │ -
37template<class Signature, class DerivativeInterface, class LocalFunctionInterface, class EntitySet>
│ │ │ -
38class GridFunctionWrapperInterface :
│ │ │ -
39 public DifferentiableFunctionWrapperInterface<Signature, DerivativeInterface>
│ │ │ -
40{
│ │ │ -
41public:
│ │ │ -
42 virtual LocalFunctionInterface wrappedLocalFunction() const = 0;
│ │ │ -
43
│ │ │ -
44 virtual const EntitySet& wrappedEntitySet() const = 0;
│ │ │ -
45};
│ │ │ -
46
│ │ │ -
47
│ │ │ -
48// Implementation of type erasure wrapper
│ │ │ -
49template<class Signature, class DerivativeInterface, class LocalFunctionInterface, class EntitySet, class B>
│ │ │ -
50class GridFunctionWrapperImplementation :
│ │ │ -
51 public DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>
│ │ │ -
52{
│ │ │ -
53 using Base = DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>;
│ │ │ -
54public:
│ │ │ -
55 using Base::Base;
│ │ │ -
56
│ │ │ -
57 virtual LocalFunctionInterface wrappedLocalFunction() const
│ │ │ -
58 {
│ │ │ -
59 return localFunction(this->get());
│ │ │ -
60 }
│ │ │ -
61
│ │ │ -
62 virtual const EntitySet& wrappedEntitySet() const
│ │ │ -
63 {
│ │ │ -
64 return this->get().entitySet();
│ │ │ -
65 }
│ │ │ -
66};
│ │ │ +
10#include <dune/common/typelist.hh>
│ │ │ +
11#include <dune/common/concept.hh>
│ │ │ +
12
│ │ │ + │ │ │ + │ │ │ + │ │ │ +
16
│ │ │ +
17namespace Dune {
│ │ │ +
18namespace Functions {
│ │ │ +
19namespace Concept {
│ │ │ +
20
│ │ │ +
21using namespace Dune::Concept;
│ │ │ +
22
│ │ │ +
23
│ │ │ +
24
│ │ │ +
25// Callable concept ############################################################
│ │ │ +
26
│ │ │ +
27
│ │ │ +
35template<class... Args>
│ │ │ +
│ │ │ + │ │ │ +
37{
│ │ │ +
38 template<class F>
│ │ │ +
39 auto require(F&& f) -> decltype(
│ │ │ +
40 f(std::declval<Args>()...)
│ │ │ +
41 );
│ │ │ +
42};
│ │ │ +
│ │ │ +
43
│ │ │ +
50template<class F, class... Args>
│ │ │ +
│ │ │ +
51static constexpr auto isCallable()
│ │ │ +
52{ return models<Concept::Callable<Args...>, F>(); }
│ │ │ +
│ │ │ +
53
│ │ │ +
60template<class F, class... Args>
│ │ │ +
│ │ │ +
61static constexpr auto isCallable(F&&, Args&&...)
│ │ │ +
62{
│ │ │ +
63 return models<Concept::Callable<Args&&...>, F>();
│ │ │ +
64}
│ │ │ +
│ │ │ +
65
│ │ │ +
66
│ │ │
67
│ │ │ -
68
│ │ │ -
69
│ │ │ -
70}}} // namespace Dune::Functions::Imp
│ │ │ -
71
│ │ │ -
72
│ │ │ -
73
│ │ │ -
74#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH
│ │ │ - │ │ │ - │ │ │ - │ │ │ +
68// Function concept ############################################################
│ │ │ +
69template<class Signature>
│ │ │ +
70struct Function;
│ │ │ +
71
│ │ │ +
80template<class Range, class Domain>
│ │ │ +
│ │ │ +
81struct Function<Range(Domain)> : Refines<Callable<Domain> >
│ │ │ +
82{
│ │ │ +
83 template<class F>
│ │ │ +
84 auto require(F&& f) -> decltype(
│ │ │ +
85 // F models Function<Range(Domain)> if the result of F(Domain) is implicitly convertible to Range
│ │ │ +
86 requireConvertible<Range>(f(std::declval<Domain>()))
│ │ │ +
87 );
│ │ │ +
88};
│ │ │ +
│ │ │ +
89
│ │ │ +
91template<class F, class Signature>
│ │ │ +
│ │ │ +
92static constexpr bool isFunction()
│ │ │ +
93{ return models<Concept::Function<Signature>, F>(); }
│ │ │ +
│ │ │ +
94
│ │ │ +
96template<class F, class Signature, template<class> class DerivativeTraits>
│ │ │ +
│ │ │ + │ │ │ +
98{ return models<Concept::Function<Signature>, F>(); }
│ │ │ +
│ │ │ +
99
│ │ │ +
100
│ │ │ +
101
│ │ │ +
102// DifferentiableFunction concept ##############################################
│ │ │ +
103template<class Signature, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ + │ │ │ +
105
│ │ │ +
117template<class Range, class Domain, template<class> class DerivativeTraits>
│ │ │ +
│ │ │ +
118struct DifferentiableFunction<Range(Domain), DerivativeTraits> : Refines<Dune::Functions::Concept::Function<Range(Domain)> >
│ │ │ +
119{
│ │ │ + │ │ │ +
121
│ │ │ +
122 template<class F>
│ │ │ +
123 auto require(F&& f) -> decltype(
│ │ │ +
124 derivative(f),
│ │ │ +
125 requireConcept<Function<DerivativeSignature>>(derivative(f))
│ │ │ +
126 );
│ │ │ +
127};
│ │ │ +
│ │ │ +
128
│ │ │ +
130template<class F, class Signature, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ +
│ │ │ +
131static constexpr bool isDifferentiableFunction()
│ │ │ +
132{ return models<Concept::DifferentiableFunction<Signature, DerivativeTraits>, F>(); }
│ │ │ +
│ │ │ +
133
│ │ │ +
135template<class F, class Signature, template<class> class DerivativeTraits>
│ │ │ +
│ │ │ + │ │ │ +
137{ return models<Concept::DifferentiableFunction<Signature, DerivativeTraits>, F>(); }
│ │ │ +
│ │ │ +
138
│ │ │ +
139
│ │ │ +
140
│ │ │ +
141// LocalFunction concept ##############################################
│ │ │ +
142template<class Signature, class LocalContext>
│ │ │ + │ │ │ +
144
│ │ │ +
154template<class Range, class Domain, class LocalContext>
│ │ │ +
│ │ │ +
155struct LocalFunction<Range(Domain), LocalContext> :
│ │ │ +
156 Refines<Dune::Functions::Concept::Function<Range(Domain)> >
│ │ │ +
157{
│ │ │ +
158 template<class F>
│ │ │ +
159 auto require(F&& f) -> decltype(
│ │ │ +
160 f.bind(std::declval<LocalContext>()),
│ │ │ +
161 f.unbind(),
│ │ │ +
162 requireConvertible<bool>(f.bound()),
│ │ │ +
163 f.localContext(),
│ │ │ +
164 requireConvertible<LocalContext>(f.localContext())
│ │ │ +
165 );
│ │ │ +
166};
│ │ │ +
│ │ │ +
167
│ │ │ +
169template<class F, class Signature, class LocalContext>
│ │ │ +
│ │ │ +
170static constexpr bool isLocalFunction()
│ │ │ +
171{ return models<Concept::LocalFunction<Signature, LocalContext>, F>(); }
│ │ │ +
│ │ │ +
172
│ │ │ +
173
│ │ │ +
174// DifferentiableLocalFunction concept ##############################################
│ │ │ +
175template<class Signature, class LocalContext, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ + │ │ │ +
177
│ │ │ +
190template<class Range, class Domain, class LocalContext, template<class> class DerivativeTraits>
│ │ │ +
│ │ │ +
191struct DifferentiableLocalFunction<Range(Domain), LocalContext, DerivativeTraits> :
│ │ │ +
192 Refines<
│ │ │ +
193 Dune::Functions::Concept::DifferentiableFunction<Range(Domain), DerivativeTraits>,
│ │ │ +
194 Dune::Functions::Concept::LocalFunction<Range(Domain),LocalContext>
│ │ │ +
195 >
│ │ │ +
196{
│ │ │ +
197 template<class F>
│ │ │ +
198 auto require(F&& f) -> decltype(
│ │ │ +
199 f.bind(std::declval<LocalContext>()),
│ │ │ +
200 f.unbind(),
│ │ │ +
201 f.localContext(),
│ │ │ +
202 requireConvertible<LocalContext>(f.localContext())
│ │ │ +
203 );
│ │ │ +
204};
│ │ │ +
│ │ │ +
205
│ │ │ +
207template<class F, class Signature, class LocalContext, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ +
│ │ │ +
208static constexpr bool isDifferentiableLocalFunction()
│ │ │ +
209{ return models<Concept::DifferentiableLocalFunction<Signature, LocalContext, DerivativeTraits>, F>(); }
│ │ │ +
│ │ │ +
210
│ │ │ +
211
│ │ │ +
212// EntitySet concept ##############################################
│ │ │ +
213
│ │ │ +
│ │ │ + │ │ │ +
224{
│ │ │ +
225 template<class E>
│ │ │ +
226 auto require(E&& f) -> decltype(
│ │ │ +
227 requireType<typename E::Element>(),
│ │ │ +
228 requireType<typename E::LocalCoordinate>(),
│ │ │ +
229 requireType<typename E::GlobalCoordinate>()
│ │ │ +
230 );
│ │ │ +
231};
│ │ │ +
│ │ │ +
232
│ │ │ +
234template<class E>
│ │ │ +
│ │ │ +
235static constexpr bool isEntitySet()
│ │ │ +
236{ return models<Concept::EntitySet, E>(); }
│ │ │ +
│ │ │ +
237
│ │ │ +
238
│ │ │ +
239
│ │ │ +
240// GridFunction concept ##############################################
│ │ │ +
241template<class Signature, class EntitySet>
│ │ │ + │ │ │ +
243
│ │ │ +
253template<class Range, class Domain, class EntitySet>
│ │ │ +
│ │ │ +
254struct GridFunction<Range(Domain), EntitySet> :
│ │ │ +
255 Refines<Dune::Functions::Concept::Function<Range(Domain)> >
│ │ │ +
256{
│ │ │ +
257 using LocalSignature = Range(typename EntitySet::LocalCoordinate);
│ │ │ +
258 using LocalContext = typename EntitySet::Element;
│ │ │ +
259
│ │ │ +
260 template<class F>
│ │ │ +
261 auto require(F&& f) -> decltype(
│ │ │ +
262 localFunction(f),
│ │ │ +
263 f.entitySet(),
│ │ │ +
264 requireConcept<LocalFunction<LocalSignature, LocalContext>>(localFunction(f)),
│ │ │ +
265 requireConcept<Concept::EntitySet, EntitySet>(),
│ │ │ +
266 requireConvertible<EntitySet>(f.entitySet()),
│ │ │ +
267 requireConvertible<typename EntitySet::GlobalCoordinate, Domain>()
│ │ │ +
268 );
│ │ │ +
269};
│ │ │ +
│ │ │ +
270
│ │ │ +
272template<class F, class Signature, class EntitySet>
│ │ │ +
│ │ │ +
273static constexpr bool isGridFunction()
│ │ │ +
274{ return models<Concept::GridFunction<Signature, EntitySet>, F>(); }
│ │ │ +
│ │ │ +
275
│ │ │ +
276
│ │ │ +
277// DifferentiableGridFunction concept ##############################################
│ │ │ +
278template<class Signature, class EntitySet, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ + │ │ │ +
280
│ │ │ +
293template<class Range, class Domain, class EntitySet, template<class> class DerivativeTraits>
│ │ │ +
│ │ │ +
294struct DifferentiableGridFunction<Range(Domain), EntitySet, DerivativeTraits> :
│ │ │ +
295 Refines<
│ │ │ +
296 Dune::Functions::Concept::DifferentiableFunction<Range(Domain), DerivativeTraits>,
│ │ │ +
297 Dune::Functions::Concept::GridFunction<Range(Domain),EntitySet>
│ │ │ +
298 >
│ │ │ +
299{
│ │ │ +
300 using LocalSignature = Range(typename EntitySet::LocalCoordinate);
│ │ │ +
301 using LocalContext = typename EntitySet::Element;
│ │ │ +
302
│ │ │ +
303 template<class R>
│ │ │ + │ │ │ +
305
│ │ │ +
306 template<class F>
│ │ │ +
307 auto require(F&& f) -> decltype(
│ │ │ +
308 requireConcept<DifferentiableLocalFunction<LocalSignature, LocalContext, LocalDerivativeTraits>>(localFunction(f))
│ │ │ +
309 );
│ │ │ +
310};
│ │ │ +
│ │ │ +
311
│ │ │ +
313template<class F, class Signature, class EntitySet, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ +
│ │ │ +
314static constexpr bool isDifferentiableGridFunction()
│ │ │ +
315{ return models<Concept::DifferentiableGridFunction<Signature, EntitySet, DerivativeTraits>, F>(); }
│ │ │ +
│ │ │ +
316
│ │ │ +
317
│ │ │ +
318
│ │ │ +
319// GridViewFunction concept ##############################################
│ │ │ +
320template<class Signature, class GridView>
│ │ │ + │ │ │ +
322
│ │ │ +
335template<class Range, class Domain, class GridView>
│ │ │ +
│ │ │ +
336struct GridViewFunction<Range(Domain), GridView> :
│ │ │ +
337 Refines<Dune::Functions::Concept::GridFunction<Range(Domain), GridViewEntitySet<GridView,0>>>
│ │ │ +
338{
│ │ │ +
339 template<class F>
│ │ │ +
340 auto require(F&& f) -> decltype(
│ │ │ +
341 0 // We don't need to check any further expressions, because a GridViewFunction is just a GridFunction with a special EntitySet
│ │ │ +
342 );
│ │ │ +
343};
│ │ │ +
│ │ │ +
344
│ │ │ +
346template<class F, class Signature, class GridView>
│ │ │ +
│ │ │ +
347static constexpr bool isGridViewFunction()
│ │ │ +
348{ return models<Concept::GridViewFunction<Signature, GridView>, F>(); }
│ │ │ +
│ │ │ +
349
│ │ │ +
350
│ │ │ +
351// DifferentiableGridViewFunction concept ##############################################
│ │ │ +
352template<class Signature, class GridView, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ + │ │ │ +
354
│ │ │ +
368template<class Range, class Domain, class GridView, template<class> class DerivativeTraits>
│ │ │ +
│ │ │ +
369struct DifferentiableGridViewFunction<Range(Domain), GridView, DerivativeTraits> :
│ │ │ +
370 Refines<Dune::Functions::Concept::DifferentiableGridFunction<Range(Domain), GridViewEntitySet<GridView,0>, DerivativeTraits>>
│ │ │ +
371{
│ │ │ +
372 template<class F>
│ │ │ +
373 auto require(F&& f) -> decltype(
│ │ │ +
374 0 // We don't need to check any further expressions, because a GridViewFunction is just a GridFunction with a special EntitySet
│ │ │ +
375 );
│ │ │ +
376};
│ │ │ +
│ │ │ +
377
│ │ │ +
379template<class F, class Signature, class GridView, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ +
│ │ │ +
380static constexpr bool isDifferentiableGridViewFunction()
│ │ │ +
381{ return models<Concept::DifferentiableGridViewFunction<Signature, GridView, DerivativeTraits>, F>(); }
│ │ │ +
│ │ │ +
382
│ │ │ +
383
│ │ │ +
384
│ │ │ +
385}}} // namespace Dune::Functions::Concept
│ │ │ +
386
│ │ │ +
387#endif // DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH
│ │ │ + │ │ │ + │ │ │ + │ │ │ +
static constexpr bool isGridFunction()
Check if F models the GridFunction concept with given signature and entity set.
Definition functionconcepts.hh:273
│ │ │ +
static constexpr bool isDifferentiableLocalFunction()
Check if F models the DifferentiableLocalFunction concept with given signature and local context.
Definition functionconcepts.hh:208
│ │ │ +
static constexpr bool isFunction()
Check if F models the Function concept with given signature.
Definition functionconcepts.hh:92
│ │ │ +
static constexpr bool isDifferentiableGridViewFunction()
Check if F models the DifferentiableGridViewFunction concept with given signature.
Definition functionconcepts.hh:380
│ │ │ +
static constexpr bool isDifferentiableFunction()
Check if F models the DifferentiableFunction concept with given signature.
Definition functionconcepts.hh:131
│ │ │ +
static constexpr bool isGridViewFunction()
Check if F models the GridViewFunction concept with given signature.
Definition functionconcepts.hh:347
│ │ │ +
static constexpr bool isEntitySet()
Check if F models the GridFunction concept with given signature and entity set.
Definition functionconcepts.hh:235
│ │ │ +
static constexpr bool isDifferentiableGridFunction()
Check if F models the DifferentiableGridFunction concept with given signature and entity set.
Definition functionconcepts.hh:314
│ │ │ +
static constexpr bool isLocalFunction()
Check if F models the LocalFunction concept with given signature and local context.
Definition functionconcepts.hh:170
│ │ │ +
TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
Obtain derivative of TrigonometricFunction function.
Definition trigonometricfunction.hh:43
│ │ │ +
static constexpr auto isCallable()
Check if f is callable with given argument list.
Definition functionconcepts.hh:51
│ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ +
Definition backends/concepts.hh:17
│ │ │ +
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:41
│ │ │ +
Concept objects that can be called with given argument list.
Definition functionconcepts.hh:37
│ │ │ +
auto require(F &&f) -> decltype(f(std::declval< Args >()...))
│ │ │ +
Definition functionconcepts.hh:70
│ │ │ +
auto require(F &&f) -> decltype(requireConvertible< Range >(f(std::declval< Domain >())))
│ │ │ +
Definition functionconcepts.hh:104
│ │ │ +
typename SignatureTraits< Range(Domain)>::template DerivativeSignature< DerivativeTraits > DerivativeSignature
Definition functionconcepts.hh:120
│ │ │ +
auto require(F &&f) -> decltype(derivative(f), requireConcept< Function< DerivativeSignature > >(derivative(f)))
│ │ │ +
Definition functionconcepts.hh:143
│ │ │ +
auto require(F &&f) -> decltype(f.bind(std::declval< LocalContext >()), f.unbind(), requireConvertible< bool >(f.bound()), f.localContext(), requireConvertible< LocalContext >(f.localContext()))
│ │ │ + │ │ │ +
auto require(F &&f) -> decltype(f.bind(std::declval< LocalContext >()), f.unbind(), f.localContext(), requireConvertible< LocalContext >(f.localContext()))
│ │ │ +
Concept for an entity set for a Concept::GridFunction<Range(Domain), EntitySet, DerivativeTraits>.
Definition functionconcepts.hh:224
│ │ │ +
auto require(E &&f) -> decltype(requireType< typename E::Element >(), requireType< typename E::LocalCoordinate >(), requireType< typename E::GlobalCoordinate >())
│ │ │ +
Definition functionconcepts.hh:242
│ │ │ +
typename EntitySet::Element LocalContext
Definition functionconcepts.hh:258
│ │ │ +
Range(typename EntitySet::LocalCoordinate) LocalSignature
Definition functionconcepts.hh:257
│ │ │ +
auto require(F &&f) -> decltype(localFunction(f), f.entitySet(), requireConcept< LocalFunction< LocalSignature, LocalContext > >(localFunction(f)), requireConcept< Concept::EntitySet, EntitySet >(), requireConvertible< EntitySet >(f.entitySet()), requireConvertible< typename EntitySet::GlobalCoordinate, Domain >())
│ │ │ + │ │ │ +
typename Dune::Functions::LocalDerivativeTraits< EntitySet, DerivativeTraits >::template Traits< R > LocalDerivativeTraits
Definition functionconcepts.hh:304
│ │ │ +
auto require(F &&f) -> decltype(requireConcept< DifferentiableLocalFunction< LocalSignature, LocalContext, LocalDerivativeTraits > >(localFunction(f)))
│ │ │ +
Range(typename EntitySet::LocalCoordinate) LocalSignature
Definition functionconcepts.hh:300
│ │ │ + │ │ │ +
Definition functionconcepts.hh:321
│ │ │ + │ │ │ + │ │ │ + │ │ │ +
Helper class to deduce the signature of a callable.
Definition signature.hh:60
│ │ │ +
Definition signature.hh:106
│ │ │ +
Derivative traits for local functions.
Definition localderivativetraits.hh:32
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,97 +1,469 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -gridfunction_imp.hh │ │ │ │ +functionconcepts.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH │ │ │ │ -8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH │ │ │ │ +8#define DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH │ │ │ │ 9 │ │ │ │ -10#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ -11#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_i_n_t_e_r_f_a_c_e_s_._h_h> │ │ │ │ -12#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n___i_m_p_._h_h> │ │ │ │ -13 │ │ │ │ -14 │ │ │ │ -15 │ │ │ │ -16namespace _D_u_n_e { │ │ │ │ -17namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -18namespace Imp { │ │ │ │ -19 │ │ │ │ -23struct HasFreeLocalFunction │ │ │ │ -24{ │ │ │ │ -25 template │ │ │ │ -26 auto require(F&& f) -> decltype( │ │ │ │ -27 localFunction(f) │ │ │ │ -28 ); │ │ │ │ -29}; │ │ │ │ -30 │ │ │ │ -31 │ │ │ │ -32 │ │ │ │ -33// Interface of type erasure wrapper │ │ │ │ -34// │ │ │ │ -35// Notice that the basic interface of polymorphic classes (destructor, clone, │ │ │ │ -...) │ │ │ │ -36// will be added by the type erasure foundation classes. │ │ │ │ -37template │ │ │ │ -38class GridFunctionWrapperInterface : │ │ │ │ -39 public DifferentiableFunctionWrapperInterface │ │ │ │ -40{ │ │ │ │ -41public: │ │ │ │ -42 virtual LocalFunctionInterface wrappedLocalFunction() const = 0; │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ +12 │ │ │ │ +13#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_s_i_g_n_a_t_u_r_e_._h_h> │ │ │ │ +14#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_l_o_c_a_l_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ +15#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h> │ │ │ │ +16 │ │ │ │ +17namespace _D_u_n_e { │ │ │ │ +18namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +19namespace _C_o_n_c_e_p_t { │ │ │ │ +20 │ │ │ │ +21using namespace Dune::Concept; │ │ │ │ +22 │ │ │ │ +23 │ │ │ │ +24 │ │ │ │ +25// Callable concept │ │ │ │ +############################################################ │ │ │ │ +26 │ │ │ │ +27 │ │ │ │ +35template │ │ │ │ +_3_6struct _C_a_l_l_a_b_l_e │ │ │ │ +37{ │ │ │ │ +38 template │ │ │ │ +_3_9 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ +40 f(std::declval()...) │ │ │ │ +41 ); │ │ │ │ +42}; │ │ │ │ 43 │ │ │ │ -44 virtual const EntitySet& wrappedEntitySet() const = 0; │ │ │ │ -45}; │ │ │ │ -46 │ │ │ │ -47 │ │ │ │ -48// Implementation of type erasure wrapper │ │ │ │ -49template │ │ │ │ -50class GridFunctionWrapperImplementation : │ │ │ │ -51 public DifferentiableFunctionWrapperImplementation │ │ │ │ -52{ │ │ │ │ -53 using Base = DifferentiableFunctionWrapperImplementation; │ │ │ │ -54public: │ │ │ │ -55 using Base::Base; │ │ │ │ -56 │ │ │ │ -57 virtual LocalFunctionInterface wrappedLocalFunction() const │ │ │ │ -58 { │ │ │ │ -59 return localFunction(this->get()); │ │ │ │ -60 } │ │ │ │ -61 │ │ │ │ -62 virtual const EntitySet& wrappedEntitySet() const │ │ │ │ -63 { │ │ │ │ -64 return this->get().entitySet(); │ │ │ │ -65 } │ │ │ │ -66}; │ │ │ │ +50template │ │ │ │ +_5_1static constexpr auto _i_s_C_a_l_l_a_b_l_e() │ │ │ │ +52{ return models<_C_o_n_c_e_p_t_:_:_C_a_l_l_a_b_l_e, F>(); } │ │ │ │ +53 │ │ │ │ +60template │ │ │ │ +_6_1static constexpr auto _i_s_C_a_l_l_a_b_l_e(F&&, Args&&...) │ │ │ │ +62{ │ │ │ │ +63 return models<_C_o_n_c_e_p_t_:_:_C_a_l_l_a_b_l_e, F>(); │ │ │ │ +64} │ │ │ │ +65 │ │ │ │ +66 │ │ │ │ 67 │ │ │ │ -68 │ │ │ │ -69 │ │ │ │ -70}}} // namespace Dune::Functions::Imp │ │ │ │ +68// Function concept │ │ │ │ +############################################################ │ │ │ │ +69template │ │ │ │ +_7_0struct _F_u_n_c_t_i_o_n; │ │ │ │ 71 │ │ │ │ -72 │ │ │ │ -73 │ │ │ │ -74#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH │ │ │ │ -_t_y_p_e___t_r_a_i_t_s_._h_h │ │ │ │ -_i_n_t_e_r_f_a_c_e_s_._h_h │ │ │ │ -_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n___i_m_p_._h_h │ │ │ │ +80template │ │ │ │ +_8_1struct _F_u_n_c_t_i_o_n : Refines > │ │ │ │ +82{ │ │ │ │ +83 template │ │ │ │ +_8_4 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ +85 // F models Function if the result of F(Domain) is implicitly │ │ │ │ +convertible to Range │ │ │ │ +86 requireConvertible(f(std::declval())) │ │ │ │ +87 ); │ │ │ │ +88}; │ │ │ │ +89 │ │ │ │ +91template │ │ │ │ +_9_2static constexpr bool _i_s_F_u_n_c_t_i_o_n() │ │ │ │ +93{ return models, F>(); } │ │ │ │ +94 │ │ │ │ +96template class DerivativeTraits> │ │ │ │ +_9_7static constexpr bool _i_s_F_u_n_c_t_i_o_n(F&& f, _S_i_g_n_a_t_u_r_e_T_a_g_<_S_i_g_n_a_t_u_r_e_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_>) │ │ │ │ +98{ return models, F>(); } │ │ │ │ +99 │ │ │ │ +100 │ │ │ │ +101 │ │ │ │ +102// DifferentiableFunction concept │ │ │ │ +############################################## │ │ │ │ +103template class DerivativeTraits = │ │ │ │ +_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s> │ │ │ │ +_1_0_4struct _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n; │ │ │ │ +105 │ │ │ │ +117template class DerivativeTraits> │ │ │ │ +_1_1_8struct _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n : │ │ │ │ +Refines > │ │ │ │ +119{ │ │ │ │ +_1_2_0 using _D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e = typename _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s:: │ │ │ │ +template _D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e_<_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_>; │ │ │ │ +121 │ │ │ │ +122 template │ │ │ │ +_1_2_3 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ +124 _d_e_r_i_v_a_t_i_v_e(f), │ │ │ │ +125 requireConcept>(_d_e_r_i_v_a_t_i_v_e(f)) │ │ │ │ +126 ); │ │ │ │ +127}; │ │ │ │ +128 │ │ │ │ +130template class DerivativeTraits = │ │ │ │ +_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s> │ │ │ │ +_1_3_1static constexpr bool _i_s_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n() │ │ │ │ +132{ return models, F>(); } │ │ │ │ +133 │ │ │ │ +135template class DerivativeTraits> │ │ │ │ +_1_3_6static constexpr bool _i_s_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n(F&& f, │ │ │ │ +_S_i_g_n_a_t_u_r_e_T_a_g_<_S_i_g_n_a_t_u_r_e_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_>) │ │ │ │ +137{ return models, F>(); } │ │ │ │ +138 │ │ │ │ +139 │ │ │ │ +140 │ │ │ │ +141// LocalFunction concept ############################################## │ │ │ │ +142template │ │ │ │ +_1_4_3struct _L_o_c_a_l_F_u_n_c_t_i_o_n; │ │ │ │ +144 │ │ │ │ +154template │ │ │ │ +_1_5_5struct _L_o_c_a_l_F_u_n_c_t_i_o_n : │ │ │ │ +156 Refines > │ │ │ │ +157{ │ │ │ │ +158 template │ │ │ │ +_1_5_9 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ +160 f.bind(std::declval()), │ │ │ │ +161 f.unbind(), │ │ │ │ +162 requireConvertible(f.bound()), │ │ │ │ +163 f.localContext(), │ │ │ │ +164 requireConvertible(f.localContext()) │ │ │ │ +165 ); │ │ │ │ +166}; │ │ │ │ +167 │ │ │ │ +169template │ │ │ │ +_1_7_0static constexpr bool _i_s_L_o_c_a_l_F_u_n_c_t_i_o_n() │ │ │ │ +171{ return models, F>(); } │ │ │ │ +172 │ │ │ │ +173 │ │ │ │ +174// DifferentiableLocalFunction concept │ │ │ │ +############################################## │ │ │ │ +175template class │ │ │ │ +DerivativeTraits = _D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s> │ │ │ │ +_1_7_6struct _D_i_f_f_e_r_e_n_t_i_a_b_l_e_L_o_c_a_l_F_u_n_c_t_i_o_n; │ │ │ │ +177 │ │ │ │ +190template │ │ │ │ +class DerivativeTraits> │ │ │ │ +_1_9_1struct _D_i_f_f_e_r_e_n_t_i_a_b_l_e_L_o_c_a_l_F_u_n_c_t_i_o_n : │ │ │ │ +192 Refines< │ │ │ │ +193 Dune::Functions::Concept::DifferentiableFunction, │ │ │ │ +194 Dune::Functions::Concept::LocalFunction │ │ │ │ +195 > │ │ │ │ +196{ │ │ │ │ +197 template │ │ │ │ +_1_9_8 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ +199 f.bind(std::declval()), │ │ │ │ +200 f.unbind(), │ │ │ │ +201 f.localContext(), │ │ │ │ +202 requireConvertible(f.localContext()) │ │ │ │ +203 ); │ │ │ │ +204}; │ │ │ │ +205 │ │ │ │ +207template class │ │ │ │ +DerivativeTraits = _D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s> │ │ │ │ +_2_0_8static constexpr bool _i_s_D_i_f_f_e_r_e_n_t_i_a_b_l_e_L_o_c_a_l_F_u_n_c_t_i_o_n() │ │ │ │ +209{ return models, F>(); } │ │ │ │ +210 │ │ │ │ +211 │ │ │ │ +212// EntitySet concept ############################################## │ │ │ │ +213 │ │ │ │ +_2_2_3struct _E_n_t_i_t_y_S_e_t │ │ │ │ +224{ │ │ │ │ +225 template │ │ │ │ +_2_2_6 auto _r_e_q_u_i_r_e(E&& f) -> decltype( │ │ │ │ +227 requireType(), │ │ │ │ +228 requireType(), │ │ │ │ +229 requireType() │ │ │ │ +230 ); │ │ │ │ +231}; │ │ │ │ +232 │ │ │ │ +234template │ │ │ │ +_2_3_5static constexpr bool _i_s_E_n_t_i_t_y_S_e_t() │ │ │ │ +236{ return models(); } │ │ │ │ +237 │ │ │ │ +238 │ │ │ │ +239 │ │ │ │ +240// GridFunction concept ############################################## │ │ │ │ +241template │ │ │ │ +_2_4_2struct _G_r_i_d_F_u_n_c_t_i_o_n; │ │ │ │ +243 │ │ │ │ +253template │ │ │ │ +_2_5_4struct _G_r_i_d_F_u_n_c_t_i_o_n : │ │ │ │ +255 Refines > │ │ │ │ +256{ │ │ │ │ +_2_5_7 using _L_o_c_a_l_S_i_g_n_a_t_u_r_e = Range(typename EntitySet::LocalCoordinate); │ │ │ │ +_2_5_8 using _L_o_c_a_l_C_o_n_t_e_x_t = typename EntitySet::Element; │ │ │ │ +259 │ │ │ │ +260 template │ │ │ │ +_2_6_1 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ +262 localFunction(f), │ │ │ │ +263 f.entitySet(), │ │ │ │ +264 requireConcept>(localFunction │ │ │ │ +(f)), │ │ │ │ +265 requireConcept(), │ │ │ │ +266 requireConvertible(f.entitySet()), │ │ │ │ +267 requireConvertible() │ │ │ │ +268 ); │ │ │ │ +269}; │ │ │ │ +270 │ │ │ │ +272template │ │ │ │ +_2_7_3static constexpr bool _i_s_G_r_i_d_F_u_n_c_t_i_o_n() │ │ │ │ +274{ return models, F>(); } │ │ │ │ +275 │ │ │ │ +276 │ │ │ │ +277// DifferentiableGridFunction concept │ │ │ │ +############################################## │ │ │ │ +278template class │ │ │ │ +DerivativeTraits = _D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s> │ │ │ │ +_2_7_9struct _D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_F_u_n_c_t_i_o_n; │ │ │ │ +280 │ │ │ │ +293template class │ │ │ │ +DerivativeTraits> │ │ │ │ +_2_9_4struct _D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_F_u_n_c_t_i_o_n : │ │ │ │ +295 Refines< │ │ │ │ +296 Dune::Functions::Concept::DifferentiableFunction, │ │ │ │ +297 Dune::Functions::Concept::GridFunction │ │ │ │ +298 > │ │ │ │ +299{ │ │ │ │ +_3_0_0 using _L_o_c_a_l_S_i_g_n_a_t_u_r_e = Range(typename EntitySet::LocalCoordinate); │ │ │ │ +_3_0_1 using _L_o_c_a_l_C_o_n_t_e_x_t = typename EntitySet::Element; │ │ │ │ +302 │ │ │ │ +303 template │ │ │ │ +_3_0_4 using _L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s = typename _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_: │ │ │ │ +_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_<_E_n_t_i_t_y_S_e_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_>_:_:_t_e_m_p_l_a_t_e Traits; │ │ │ │ +305 │ │ │ │ +306 template │ │ │ │ +_3_0_7 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ +308 requireConcept>(localFunction(f)) │ │ │ │ +309 ); │ │ │ │ +310}; │ │ │ │ +311 │ │ │ │ +313template class │ │ │ │ +DerivativeTraits = _D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s> │ │ │ │ +_3_1_4static constexpr bool _i_s_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_F_u_n_c_t_i_o_n() │ │ │ │ +315{ return models, F>(); } │ │ │ │ +316 │ │ │ │ +317 │ │ │ │ +318 │ │ │ │ +319// GridViewFunction concept ############################################## │ │ │ │ +320template │ │ │ │ +_3_2_1struct _G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n; │ │ │ │ +322 │ │ │ │ +335template │ │ │ │ +_3_3_6struct _G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n : │ │ │ │ +337 Refines>> │ │ │ │ +338{ │ │ │ │ +339 template │ │ │ │ +_3_4_0 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ +341 0 // We don't need to check any further expressions, because a │ │ │ │ +GridViewFunction is just a GridFunction with a special EntitySet │ │ │ │ +342 ); │ │ │ │ +343}; │ │ │ │ +344 │ │ │ │ +346template │ │ │ │ +_3_4_7static constexpr bool _i_s_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n() │ │ │ │ +348{ return models, F>(); } │ │ │ │ +349 │ │ │ │ +350 │ │ │ │ +351// DifferentiableGridViewFunction concept │ │ │ │ +############################################## │ │ │ │ +352template class │ │ │ │ +DerivativeTraits = _D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s> │ │ │ │ +_3_5_3struct _D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n; │ │ │ │ +354 │ │ │ │ +368template class │ │ │ │ +DerivativeTraits> │ │ │ │ +_3_6_9struct _D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n : │ │ │ │ +370 Refines, DerivativeTraits>> │ │ │ │ +371{ │ │ │ │ +372 template │ │ │ │ +_3_7_3 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ +374 0 // We don't need to check any further expressions, because a │ │ │ │ +GridViewFunction is just a GridFunction with a special EntitySet │ │ │ │ +375 ); │ │ │ │ +376}; │ │ │ │ +377 │ │ │ │ +379template class │ │ │ │ +DerivativeTraits = _D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s> │ │ │ │ +_3_8_0static constexpr bool _i_s_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n() │ │ │ │ +381{ return models, F>(); } │ │ │ │ +382 │ │ │ │ +383 │ │ │ │ +384 │ │ │ │ +385}}} // namespace Dune::Functions::Concept │ │ │ │ +386 │ │ │ │ +387#endif // DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH │ │ │ │ +_s_i_g_n_a_t_u_r_e_._h_h │ │ │ │ +_l_o_c_a_l_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h │ │ │ │ +_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ +static constexpr bool isGridFunction() │ │ │ │ +Check if F models the GridFunction concept with given signature and entity set. │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:273 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_D_i_f_f_e_r_e_n_t_i_a_b_l_e_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +static constexpr bool isDifferentiableLocalFunction() │ │ │ │ +Check if F models the DifferentiableLocalFunction concept with given signature │ │ │ │ +and local context. │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:208 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_F_u_n_c_t_i_o_n │ │ │ │ +static constexpr bool isFunction() │ │ │ │ +Check if F models the Function concept with given signature. │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:92 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ +static constexpr bool isDifferentiableGridViewFunction() │ │ │ │ +Check if F models the DifferentiableGridViewFunction concept with given │ │ │ │ +signature. │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:380 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n │ │ │ │ +static constexpr bool isDifferentiableFunction() │ │ │ │ +Check if F models the DifferentiableFunction concept with given signature. │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:131 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ +static constexpr bool isGridViewFunction() │ │ │ │ +Check if F models the GridViewFunction concept with given signature. │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:347 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_E_n_t_i_t_y_S_e_t │ │ │ │ +static constexpr bool isEntitySet() │ │ │ │ +Check if F models the GridFunction concept with given signature and entity set. │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:235 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ +static constexpr bool isDifferentiableGridFunction() │ │ │ │ +Check if F models the DifferentiableGridFunction concept with given signature │ │ │ │ +and entity set. │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:314 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +static constexpr bool isLocalFunction() │ │ │ │ +Check if F models the LocalFunction concept with given signature and local │ │ │ │ +context. │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:170 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ +TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const │ │ │ │ +TrigonometricFunction< K, sinFactor, cosFactor > &f) │ │ │ │ +Obtain derivative of TrigonometricFunction function. │ │ │ │ +DDeeffiinniittiioonn trigonometricfunction.hh:43 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_C_a_l_l_a_b_l_e │ │ │ │ +static constexpr auto isCallable() │ │ │ │ +Check if f is callable with given argument list. │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:51 │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t │ │ │ │ +DDeeffiinniittiioonn backends/concepts.hh:17 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ +Default implementation for derivative traits. │ │ │ │ +DDeeffiinniittiioonn defaultderivativetraits.hh:41 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_C_a_l_l_a_b_l_e │ │ │ │ +Concept objects that can be called with given argument list. │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:37 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_C_a_l_l_a_b_l_e_:_:_r_e_q_u_i_r_e │ │ │ │ +auto require(F &&f) -> decltype(f(std::declval< Args >()...)) │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_F_u_n_c_t_i_o_n │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:70 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_>_:_:_r_e_q_u_i_r_e │ │ │ │ +auto require(F &&f) -> decltype(requireConvertible< Range >(f(std::declval< │ │ │ │ +Domain >()))) │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:104 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e │ │ │ │ +typename SignatureTraits< Range(Domain)>::template DerivativeSignature< │ │ │ │ +DerivativeTraits > DerivativeSignature │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:120 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_r_e_q_u_i_r_e │ │ │ │ +auto require(F &&f) -> decltype(derivative(f), requireConcept< Function< │ │ │ │ +DerivativeSignature > >(derivative(f))) │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:143 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _L_o_c_a_l_C_o_n_t_e_x_t_ _>_:_:_r_e_q_u_i_r_e │ │ │ │ +auto require(F &&f) -> decltype(f.bind(std::declval< LocalContext >()), │ │ │ │ +f.unbind(), requireConvertible< bool >(f.bound()), f.localContext(), │ │ │ │ +requireConvertible< LocalContext >(f.localContext())) │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:176 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_L_o_c_a_l_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ +_L_o_c_a_l_C_o_n_t_e_x_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_r_e_q_u_i_r_e │ │ │ │ +auto require(F &&f) -> decltype(f.bind(std::declval< LocalContext >()), │ │ │ │ +f.unbind(), f.localContext(), requireConvertible< LocalContext >(f.localContext │ │ │ │ +())) │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_E_n_t_i_t_y_S_e_t │ │ │ │ +Concept for an entity set for a Concept::GridFunction. │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:224 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_E_n_t_i_t_y_S_e_t_:_:_r_e_q_u_i_r_e │ │ │ │ +auto require(E &&f) -> decltype(requireType< typename E::Element >(), │ │ │ │ +requireType< typename E::LocalCoordinate >(), requireType< typename E:: │ │ │ │ +GlobalCoordinate >()) │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:242 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_n_t_i_t_y_S_e_t_ _>_:_: │ │ │ │ +_L_o_c_a_l_C_o_n_t_e_x_t │ │ │ │ +typename EntitySet::Element LocalContext │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:258 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_n_t_i_t_y_S_e_t_ _>_:_: │ │ │ │ +_L_o_c_a_l_S_i_g_n_a_t_u_r_e │ │ │ │ +Range(typename EntitySet::LocalCoordinate) LocalSignature │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:257 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_n_t_i_t_y_S_e_t_ _>_:_:_r_e_q_u_i_r_e │ │ │ │ +auto require(F &&f) -> decltype(localFunction(f), f.entitySet(), │ │ │ │ +requireConcept< LocalFunction< LocalSignature, LocalContext > >(localFunction │ │ │ │ +(f)), requireConcept< Concept::EntitySet, EntitySet >(), requireConvertible< │ │ │ │ +EntitySet >(f.entitySet()), requireConvertible< typename EntitySet:: │ │ │ │ +GlobalCoordinate, Domain >()) │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:279 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_n_t_i_t_y_S_e_t_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ +typename Dune::Functions::LocalDerivativeTraits< EntitySet, DerivativeTraits │ │ │ │ +>::template Traits< R > LocalDerivativeTraits │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:304 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_n_t_i_t_y_S_e_t_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_r_e_q_u_i_r_e │ │ │ │ +auto require(F &&f) -> decltype(requireConcept< DifferentiableLocalFunction< │ │ │ │ +LocalSignature, LocalContext, LocalDerivativeTraits > >(localFunction(f))) │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_n_t_i_t_y_S_e_t_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_L_o_c_a_l_S_i_g_n_a_t_u_r_e │ │ │ │ +Range(typename EntitySet::LocalCoordinate) LocalSignature │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:300 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_n_t_i_t_y_S_e_t_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_L_o_c_a_l_C_o_n_t_e_x_t │ │ │ │ +typename EntitySet::Element LocalContext │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:301 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:321 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_r_i_d_V_i_e_w_ _>_:_:_r_e_q_u_i_r_e │ │ │ │ +auto require(F &&f) -> decltype(0) │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:353 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ +_G_r_i_d_V_i_e_w_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_r_e_q_u_i_r_e │ │ │ │ +auto require(F &&f) -> decltype(0) │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_g_n_a_t_u_r_e_T_r_a_i_t_s │ │ │ │ +Helper class to deduce the signature of a callable. │ │ │ │ +DDeeffiinniittiioonn signature.hh:60 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_g_n_a_t_u_r_e_T_a_g │ │ │ │ +DDeeffiinniittiioonn signature.hh:106 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ +Derivative traits for local functions. │ │ │ │ +DDeeffiinniittiioonn localderivativetraits.hh:32 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_f_u_n_c_t_i_o_n___i_m_p_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00053.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: gridfunction.hh File Reference │ │ │ +Dune-Functions: overflowarray.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,34 +88,30 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
gridfunction.hh File Reference
│ │ │ +
overflowarray.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <type_traits>
│ │ │ -#include <dune/common/typeutilities.hh>
│ │ │ -#include <dune/functions/common/typeerasure.hh>
│ │ │ -#include <dune/functions/common/defaultderivativetraits.hh>
│ │ │ -#include <dune/functions/common/differentiablefunction.hh>
│ │ │ -#include <dune/functions/common/localfunction.hh>
│ │ │ -#include <dune/functions/common/functionconcepts.hh>
│ │ │ -#include <dune/functions/gridfunctions/localderivativetraits.hh>
│ │ │ -#include <dune/functions/gridfunctions/gridfunction_imp.hh>
│ │ │ +
#include <algorithm>
│ │ │ +#include <iostream>
│ │ │ +#include <cstddef>
│ │ │ +#include <array>
│ │ │ +#include <initializer_list>
│ │ │ +#include <dune/common/genericiterator.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::GridFunction< Signature, EntitySet, DerivativeTraits, bufferSize >
class  Dune::Functions::GridFunction< Range(Domain), ES, DerivativeTraits, bufferSize >
 Wrapper class for functions defined on a Grid. More...
class  Dune::Functions::OverflowArray< BA, maxSize >
 A dynamically sized array-like class with overflow. More...
│ │ │ │ │ │ │ │ │ │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
│ │ │
│ │ │ @@ -127,13 +123,13 @@ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,29 +1,23 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -gridfunction.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e_e_r_a_s_u_r_e_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_l_o_c_a_l_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_l_o_c_a_l_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n___i_m_p_._h_h> │ │ │ │ +overflowarray.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_F_u_n_c_t_i_o_n_<_ _S_i_g_n_a_t_u_r_e_,_ _E_n_t_i_t_y_S_e_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_, │ │ │ │ - _b_u_f_f_e_r_S_i_z_e_ _> │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_S_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_, │ │ │ │ - _b_u_f_f_e_r_S_i_z_e_ _> │ │ │ │ -  Wrapper class for functions defined on a Grid. _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_<_ _B_A_,_ _m_a_x_S_i_z_e_ _> │ │ │ │ +  A dynamically sized array-like class with overflow. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_f_u_n_c_t_i_o_n_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _o_v_e_r_f_l_o_w_a_r_r_a_y_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00053.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,3 +1,3 @@ │ │ │ │ var a00053 = [ │ │ │ │ - ["Dune::Functions::GridFunction< Signature, EntitySet, DerivativeTraits, bufferSize >", "a02254.html", null] │ │ │ │ + ["Dune::Functions::OverflowArray< BA, maxSize >", "a01418.html", "a01418"] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00053_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: gridfunction.hh Source File │ │ │ +Dune-Functions: overflowarray.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,189 +88,286 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
gridfunction.hh
│ │ │ +
overflowarray.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH
│ │ │ -
8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH
│ │ │ +
8#define DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH
│ │ │
9
│ │ │ -
10#include <type_traits>
│ │ │ -
11
│ │ │ -
12#include <dune/common/typeutilities.hh>
│ │ │ -
13
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ +
10#include <algorithm>
│ │ │ +
11#include <iostream>
│ │ │ +
12#include <cstddef>
│ │ │ +
13#include <array>
│ │ │ +
14#include <initializer_list>
│ │ │ +
15
│ │ │ +
16#include <dune/common/genericiterator.hh>
│ │ │ +
17
│ │ │ +
18
│ │ │ +
19
│ │ │ +
20namespace Dune::Functions {
│ │ │
21
│ │ │ -
22
│ │ │ -
23
│ │ │ -
24namespace Dune {
│ │ │ -
25namespace Functions {
│ │ │ -
26
│ │ │ -
27
│ │ │ -
28
│ │ │ -
29/*
│ │ │ -
30 * Default implementation is empty
│ │ │ -
31 * The actual implementation is only given if Signature is an type
│ │ │ -
32 * describing a function signature as Range(Domain).
│ │ │ -
33 */
│ │ │ -
34template<class Signature, class EntitySet, template<class> class DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>
│ │ │ -
│ │ │ - │ │ │ -
36{};
│ │ │ -
│ │ │ -
37
│ │ │ -
38
│ │ │ -
39
│ │ │ -
40namespace Imp
│ │ │ -
41{
│ │ │ -
42
│ │ │ -
44 template<class S, class ES, template<class> class DerivativeTraits, size_t bufferSize>
│ │ │ -
45 struct GridFunctionTraits :
│ │ │ -
46 DifferentiableFunctionTraits<S, DerivativeTraits, bufferSize>
│ │ │ -
47 {
│ │ │ -
48 protected:
│ │ │ -
49 using Base=DifferentiableFunctionTraits<S, DerivativeTraits, bufferSize>;
│ │ │ -
50
│ │ │ -
51 public:
│ │ │ -
53 using EntitySet = ES;
│ │ │ -
54
│ │ │ -
56 using Element = typename EntitySet::Element;
│ │ │ -
57
│ │ │ -
59 using DerivativeSignature = typename Base::DerivativeSignature;
│ │ │ -
60
│ │ │ - │ │ │ -
63
│ │ │ -
65 using LocalSignature = typename Base::Range(typename EntitySet::LocalCoordinate);
│ │ │ -
66
│ │ │ -
68 template<class R>
│ │ │ - │ │ │ -
70
│ │ │ -
72 using LocalFunctionTraits = typename Dune::Functions::Imp::LocalFunctionTraits<LocalSignature, Element, LocalDerivativeTraits, bufferSize>;
│ │ │ -
73
│ │ │ - │ │ │ -
76
│ │ │ -
78 using Concept = GridFunctionWrapperInterface<S, DerivativeInterface, LocalFunctionInterface, ES>;
│ │ │ -
79
│ │ │ -
81 template<class B>
│ │ │ -
82 using Model = GridFunctionWrapperImplementation<S, DerivativeInterface, LocalFunctionInterface, ES, B>;
│ │ │ -
83 };
│ │ │ -
84}
│ │ │ -
85
│ │ │ -
86
│ │ │ -
87
│ │ │ -
99template<class Range, class Domain, class ES, template<class> class DerivativeTraits, size_t bufferSize>
│ │ │ -
│ │ │ -
100class GridFunction<Range(Domain), ES, DerivativeTraits, bufferSize> :
│ │ │ -
101 public TypeErasureBase<
│ │ │ -
102 typename Imp::GridFunctionTraits<Range(Domain), ES, DerivativeTraits, bufferSize>::Concept,
│ │ │ -
103 Imp::GridFunctionTraits<Range(Domain), ES, DerivativeTraits, bufferSize>::template Model>
│ │ │ -
104{
│ │ │ -
105 using Traits = Imp::GridFunctionTraits<Range(Domain), ES, DerivativeTraits, bufferSize>;
│ │ │ -
106
│ │ │ - │ │ │ -
108
│ │ │ -
109 using DerivativeInterface = typename Traits::DerivativeInterface;
│ │ │ -
110
│ │ │ -
111 using LocalFunctionInterface = typename Traits::LocalFunctionInterface;
│ │ │ -
112
│ │ │ -
113 using EntitySet = typename Traits::EntitySet;
│ │ │ -
114
│ │ │ -
115public:
│ │ │ -
116
│ │ │ -
128 template<class F, disableCopyMove<GridFunction, F> = 0 >
│ │ │ -
│ │ │ - │ │ │ -
130 Base(std::forward<F>(f))
│ │ │ -
131 {
│ │ │ -
132 static_assert(Dune::Functions::Concept::isGridFunction<F, Range(Domain), EntitySet>(), "Trying to construct a GridFunction from type that does not model the GridFunction concept");
│ │ │ -
133 }
│ │ │ -
│ │ │ -
134
│ │ │ -
135 GridFunction() = default;
│ │ │ -
136
│ │ │ -
│ │ │ -
142 Range operator() (const Domain& x) const
│ │ │ -
143 {
│ │ │ -
144 return this->asInterface().operator()(x);
│ │ │ -
145 }
│ │ │ -
│ │ │ -
146
│ │ │ -
│ │ │ -
155 friend DerivativeInterface derivative(const GridFunction& t)
│ │ │ -
156 {
│ │ │ -
157 return t.asInterface().derivative();
│ │ │ -
158 }
│ │ │ -
│ │ │ -
159
│ │ │ -
│ │ │ -
169 friend LocalFunctionInterface localFunction(const GridFunction& t)
│ │ │ -
170 {
│ │ │ -
171 return t.asInterface().wrappedLocalFunction();
│ │ │ -
172 }
│ │ │ -
│ │ │ -
173
│ │ │ -
│ │ │ -
180 const EntitySet& entitySet() const
│ │ │ -
181 {
│ │ │ -
182 return this->asInterface().wrappedEntitySet();
│ │ │ -
183 }
│ │ │ -
│ │ │ -
184};
│ │ │ -
│ │ │ -
185
│ │ │ -
186
│ │ │ -
187
│ │ │ -
188}} // namespace Dune::Functions
│ │ │ -
189
│ │ │ -
190
│ │ │ -
191
│ │ │ -
192#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
static constexpr bool isGridFunction()
Check if F models the GridFunction concept with given signature and entity set.
Definition functionconcepts.hh:273
│ │ │ -
Definition monomialset.hh:19
│ │ │ +
22
│ │ │ +
46template<class BA, std::size_t maxSize = std::tuple_size_v<BA>>
│ │ │ +
│ │ │ + │ │ │ +
48 public BA
│ │ │ +
49{
│ │ │ +
50 static constexpr std::size_t baseSize = std::tuple_size_v<BA>;
│ │ │ +
51
│ │ │ +
52public:
│ │ │ +
53 using BaseArray = BA;
│ │ │ +
54
│ │ │ +
55 using value_type = typename BaseArray::value_type;
│ │ │ + │ │ │ + │ │ │ + │ │ │ +
59 using difference_type = std::ptrdiff_t;
│ │ │ +
60 using size_type = std::size_t;
│ │ │ +
61 using iterator = Dune::GenericIterator<OverflowArray, value_type>;
│ │ │ +
62 using const_iterator = Dune::GenericIterator<const OverflowArray, const value_type>;
│ │ │ +
63
│ │ │ +
64private:
│ │ │ +
65 using OverflowBuffer = std::array<value_type, maxSize-baseSize>;
│ │ │ +
66
│ │ │ +
67public:
│ │ │ +
68
│ │ │ +
69 OverflowArray() = default;
│ │ │ +
70
│ │ │ +
│ │ │ +
71 OverflowArray(const std::initializer_list<value_type>& l) {
│ │ │ +
72 assert(l.size() <= capacity());
│ │ │ +
73 size_ = l.size();
│ │ │ +
74 std::copy_n(l.begin(), size_, begin());
│ │ │ +
75 }
│ │ │ +
│ │ │ +
76
│ │ │ +
│ │ │ +
77 bool operator == (const OverflowArray& other) const {
│ │ │ +
78 if (size() != other.size())
│ │ │ +
79 return false;
│ │ │ +
80 for (size_type i=0; i<size(); ++i)
│ │ │ +
81 if ((*this)[i] != other[i])
│ │ │ +
82 return false;
│ │ │ +
83 return true;
│ │ │ +
84 }
│ │ │ +
│ │ │ +
85
│ │ │ +
│ │ │ +
87 void clear() {
│ │ │ +
88 size_ = 0;
│ │ │ +
89 }
│ │ │ +
│ │ │ +
90
│ │ │ +
│ │ │ +
97 void resize(size_type n) {
│ │ │ +
98 assert(n <= capacity());
│ │ │ +
99 size_ = n;
│ │ │ +
100 }
│ │ │ +
│ │ │ +
101
│ │ │ +
│ │ │ +
108 void push_back(const value_type& t) {
│ │ │ +
109 assert(size() < capacity());
│ │ │ +
110 (*this)[size_++] = t;
│ │ │ +
111 }
│ │ │ +
│ │ │ +
112
│ │ │ +
│ │ │ +
114 void pop_back() {
│ │ │ +
115 assert(size() > 0);
│ │ │ +
116 if (! empty())
│ │ │ +
117 size_--;
│ │ │ +
118 }
│ │ │ +
│ │ │ +
119
│ │ │ +
│ │ │ +
126 void push_front(const value_type& t) {
│ │ │ +
127 assert(size() < capacity());
│ │ │ +
128 for (size_type i=0; i<size(); i++)
│ │ │ +
129 (*this)[i+1] = (*this)[i];
│ │ │ +
130 (*this)[0] = t;
│ │ │ +
131 }
│ │ │ +
│ │ │ +
132
│ │ │ +
│ │ │ + │ │ │ +
135 return iterator(*this, 0);
│ │ │ +
136 }
│ │ │ +
│ │ │ +
137
│ │ │ +
│ │ │ + │ │ │ +
140 return const_iterator(*this, 0);
│ │ │ +
141 }
│ │ │ +
│ │ │ +
142
│ │ │ +
│ │ │ + │ │ │ +
145 return iterator(*this, size());
│ │ │ +
146 }
│ │ │ +
│ │ │ +
147
│ │ │ +
│ │ │ + │ │ │ +
150 return const_iterator(*this, size());
│ │ │ +
151 }
│ │ │ +
│ │ │ +
152
│ │ │ +
│ │ │ + │ │ │ +
155 assert(i < size());
│ │ │ +
156 // If there's no padding between the base class and the overflow_ member,
│ │ │ +
157 // the compiler should be able to optimize this to
│ │ │ +
158 // return *(&BaseArray::operator[](0) + i);
│ │ │ +
159 if (i<baseSize)
│ │ │ +
160 return BaseArray::operator[](i);
│ │ │ +
161 return overflow_[i-baseSize];
│ │ │ +
162 }
│ │ │ +
│ │ │ +
163
│ │ │ +
│ │ │ + │ │ │ +
166 assert(i < size());
│ │ │ +
167 // If there's no padding between the base class and the overflow_ member,
│ │ │ +
168 // the compiler should be able to optimize this to
│ │ │ +
169 // return *(&BaseArray::operator[](0) + i);
│ │ │ +
170 if (i<baseSize)
│ │ │ +
171 return BaseArray::operator[](i);
│ │ │ +
172 return overflow_[i-baseSize];
│ │ │ +
173 }
│ │ │ +
│ │ │ +
174
│ │ │ +
│ │ │ + │ │ │ +
177 assert(size() > 0);
│ │ │ +
178 return (*this)[0];
│ │ │ +
179 }
│ │ │ +
│ │ │ +
180
│ │ │ +
│ │ │ + │ │ │ +
183 assert(size() > 0);
│ │ │ +
184 return (*this)[0];
│ │ │ +
185 }
│ │ │ +
│ │ │ +
186
│ │ │ +
│ │ │ + │ │ │ +
189 assert(size() > 0);
│ │ │ +
190 return (*this)[size()-1];
│ │ │ +
191 }
│ │ │ +
│ │ │ +
192
│ │ │ +
│ │ │ + │ │ │ +
195 assert(size() > 0);
│ │ │ +
196 return (*this)[size()-1];
│ │ │ +
197 }
│ │ │ +
│ │ │ +
198
│ │ │ +
│ │ │ +
200 size_type size () const {
│ │ │ +
201 return size_;
│ │ │ +
202 }
│ │ │ +
│ │ │ +
203
│ │ │ +
│ │ │ +
205 bool empty() const {
│ │ │ +
206 return size() == 0;
│ │ │ +
207 }
│ │ │ +
│ │ │ +
208
│ │ │ +
│ │ │ +
210 static constexpr size_type capacity() {
│ │ │ +
211 return maxSize;
│ │ │ +
212 }
│ │ │ +
│ │ │ +
213
│ │ │ +
│ │ │ +
215 static constexpr size_type max_size() {
│ │ │ +
216 return maxSize;
│ │ │ +
217 }
│ │ │ +
│ │ │ +
218
│ │ │ +
│ │ │ +
220 inline friend std::size_t hash_value(const OverflowArray& v) noexcept {
│ │ │ +
221 return hash_range(v.begin(), v.end());
│ │ │ +
222 }
│ │ │ +
│ │ │ +
223
│ │ │ +
│ │ │ +
225 friend std::ostream& operator<< (std::ostream& s, const OverflowArray& c) {
│ │ │ +
226 for (const auto& ci : c)
│ │ │ +
227 s << ci << " ";
│ │ │ +
228 return s;
│ │ │ +
229 }
│ │ │ +
│ │ │ +
230
│ │ │ +
231private:
│ │ │ +
232 OverflowBuffer overflow_;
│ │ │ +
233 size_type size_ = 0;
│ │ │ +
234};
│ │ │ +
│ │ │ +
235
│ │ │ +
236
│ │ │ +
237
│ │ │ +
238} // namespace Dune::Functions
│ │ │ +
239
│ │ │ +
240
│ │ │ +
241
│ │ │ +
242#endif // DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH
│ │ │
Definition monomialset.hh:19
│ │ │ -
Definition backends/concepts.hh:17
│ │ │ -
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:41
│ │ │ -
Definition localfunction.hh:34
│ │ │ - │ │ │ - │ │ │ -
Definition gridfunction.hh:36
│ │ │ -
friend DerivativeInterface derivative(const GridFunction &t)
Get derivative of wrapped function.
Definition gridfunction.hh:155
│ │ │ - │ │ │ -
const EntitySet & entitySet() const
Get associated EntitySet.
Definition gridfunction.hh:180
│ │ │ -
GridFunction(F &&f)
Construct from function.
Definition gridfunction.hh:129
│ │ │ -
friend LocalFunctionInterface localFunction(const GridFunction &t)
Get local function of wrapped function.
Definition gridfunction.hh:169
│ │ │ -
Derivative traits for local functions.
Definition localderivativetraits.hh:32
│ │ │ +
const value_type & const_reference
Definition overflowarray.hh:57
│ │ │ +
value_type & reference
Definition overflowarray.hh:56
│ │ │ +
const_iterator end() const
Returns a const_iterator pointing to the end of the OverflowArray.
Definition overflowarray.hh:149
│ │ │ +
bool operator==(const OverflowArray &other) const
Definition overflowarray.hh:77
│ │ │ +
friend std::size_t hash_value(const OverflowArray &v) noexcept
Compute hash value.
Definition overflowarray.hh:220
│ │ │ +
void push_back(const value_type &t)
Appends an element to the end of the OverflowArray,.
Definition overflowarray.hh:108
│ │ │ +
friend std::ostream & operator<<(std::ostream &s, const OverflowArray &c)
Write container to an output stream.
Definition overflowarray.hh:225
│ │ │ +
iterator begin()
Returns a iterator pointing to the beginning of the OverflowArray.
Definition overflowarray.hh:134
│ │ │ +
bool empty() const
Returns true if OverflowArray has no elements.
Definition overflowarray.hh:205
│ │ │ +
size_type size() const
Returns number of elements in the OverflowArray.
Definition overflowarray.hh:200
│ │ │ +
typename BaseArray::value_type value_type
Definition overflowarray.hh:55
│ │ │ +
void pop_back()
Erases the last element of the OverflowArray, O(1) time.
Definition overflowarray.hh:114
│ │ │ +
Dune::GenericIterator< OverflowArray, value_type > iterator
Definition overflowarray.hh:61
│ │ │ +
const_iterator begin() const
Returns a const_iterator pointing to the beginning of the OverflowArray.
Definition overflowarray.hh:139
│ │ │ +
std::ptrdiff_t difference_type
Definition overflowarray.hh:59
│ │ │ + │ │ │ +
BA BaseArray
Definition overflowarray.hh:53
│ │ │ +
static constexpr size_type capacity()
Returns the capacity of the OverflowArray.
Definition overflowarray.hh:210
│ │ │ +
static constexpr size_type max_size()
Returns the maximum length of the OverflowArray.
Definition overflowarray.hh:215
│ │ │ +
const_reference front() const
Returns const reference to first element of OverflowArray.
Definition overflowarray.hh:182
│ │ │ +
void clear()
Erases all elements.
Definition overflowarray.hh:87
│ │ │ +
iterator end()
Returns an iterator pointing to the end of the OverflowArray.
Definition overflowarray.hh:144
│ │ │ +
std::size_t size_type
Definition overflowarray.hh:60
│ │ │ +
void resize(size_type n)
Specifies a new size for the OverflowArray.
Definition overflowarray.hh:97
│ │ │ +
value_type * pointer
Definition overflowarray.hh:58
│ │ │ +
Dune::GenericIterator< const OverflowArray, const value_type > const_iterator
Definition overflowarray.hh:62
│ │ │ +
const_reference back() const
Returns const reference to last element of OverflowArray.
Definition overflowarray.hh:194
│ │ │ +
OverflowArray(const std::initializer_list< value_type > &l)
Definition overflowarray.hh:71
│ │ │ +
reference back()
Returns reference to last element of OverflowArray.
Definition overflowarray.hh:188
│ │ │ +
void push_front(const value_type &t)
Inserts an element to the begin of the OverflowArray,.
Definition overflowarray.hh:126
│ │ │ +
reference front()
Returns reference to first element of OverflowArray.
Definition overflowarray.hh:176
│ │ │ +
reference operator[](size_type i)
Returns reference to the i'th element.
Definition overflowarray.hh:154
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,222 +1,314 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -gridfunction.hh │ │ │ │ +overflowarray.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH │ │ │ │ -8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH │ │ │ │ +8#define DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11 │ │ │ │ -12#include │ │ │ │ -13 │ │ │ │ -14#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e_e_r_a_s_u_r_e_._h_h> │ │ │ │ -15#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ -16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ -17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_l_o_c_a_l_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ -18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ -19#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_l_o_c_a_l_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ -20#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n___i_m_p_._h_h> │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ +12#include │ │ │ │ +13#include │ │ │ │ +14#include │ │ │ │ +15 │ │ │ │ +16#include │ │ │ │ +17 │ │ │ │ +18 │ │ │ │ +19 │ │ │ │ +20namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ 21 │ │ │ │ 22 │ │ │ │ -23 │ │ │ │ -24namespace _D_u_n_e { │ │ │ │ -25namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -26 │ │ │ │ -27 │ │ │ │ -28 │ │ │ │ -29/* │ │ │ │ -30 * Default implementation is empty │ │ │ │ -31 * The actual implementation is only given if Signature is an type │ │ │ │ -32 * describing a function signature as Range(Domain). │ │ │ │ -33 */ │ │ │ │ -34template class │ │ │ │ -DerivativeTraits=_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s, size_t bufferSize=56> │ │ │ │ -_3_5class _G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ -36{}; │ │ │ │ -37 │ │ │ │ -38 │ │ │ │ -39 │ │ │ │ -40namespace Imp │ │ │ │ -41{ │ │ │ │ -42 │ │ │ │ -44 template class DerivativeTraits, size_t │ │ │ │ -bufferSize> │ │ │ │ -45 struct GridFunctionTraits : │ │ │ │ -46 DifferentiableFunctionTraits │ │ │ │ -47 { │ │ │ │ -48 protected: │ │ │ │ -49 using Base=DifferentiableFunctionTraits; │ │ │ │ -50 │ │ │ │ -51 public: │ │ │ │ -53 using EntitySet = ES; │ │ │ │ +46template> │ │ │ │ +_4_7class _O_v_e_r_f_l_o_w_A_r_r_a_y : │ │ │ │ +48 public BA │ │ │ │ +49{ │ │ │ │ +50 static constexpr std::size_t baseSize = std::tuple_size_v; │ │ │ │ +51 │ │ │ │ +52public: │ │ │ │ +_5_3 using _B_a_s_e_A_r_r_a_y = BA; │ │ │ │ 54 │ │ │ │ -56 using Element = typename EntitySet::Element; │ │ │ │ -57 │ │ │ │ -59 using DerivativeSignature = typename Base::DerivativeSignature; │ │ │ │ -60 │ │ │ │ -62 using DerivativeInterface = _G_r_i_d_F_u_n_c_t_i_o_n_<_D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e_,_ _E_S_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_>; │ │ │ │ +_5_5 using _v_a_l_u_e___t_y_p_e = typename BaseArray::value_type; │ │ │ │ +_5_6 using _r_e_f_e_r_e_n_c_e = _v_a_l_u_e___t_y_p_e&; │ │ │ │ +_5_7 using _c_o_n_s_t___r_e_f_e_r_e_n_c_e = const _v_a_l_u_e___t_y_p_e&; │ │ │ │ +_5_8 using _p_o_i_n_t_e_r = _v_a_l_u_e___t_y_p_e*; │ │ │ │ +_5_9 using _d_i_f_f_e_r_e_n_c_e___t_y_p_e = std::ptrdiff_t; │ │ │ │ +_6_0 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ +_6_1 using _i_t_e_r_a_t_o_r = Dune::GenericIterator; │ │ │ │ +_6_2 using _c_o_n_s_t___i_t_e_r_a_t_o_r = Dune::GenericIterator; │ │ │ │ 63 │ │ │ │ -65 using LocalSignature = typename Base::Range(typename EntitySet:: │ │ │ │ -LocalCoordinate); │ │ │ │ +64private: │ │ │ │ +65 using OverflowBuffer = std::array<_v_a_l_u_e___t_y_p_e, maxSize-baseSize>; │ │ │ │ 66 │ │ │ │ -68 template │ │ │ │ -69 using _L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s = typename _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_: │ │ │ │ -_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_<_E_n_t_i_t_y_S_e_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_>_:_:_t_e_m_p_l_a_t_e Traits; │ │ │ │ +67public: │ │ │ │ +68 │ │ │ │ +_6_9 _O_v_e_r_f_l_o_w_A_r_r_a_y() = default; │ │ │ │ 70 │ │ │ │ -72 using LocalFunctionTraits = typename Dune::Functions::Imp:: │ │ │ │ -LocalFunctionTraits; │ │ │ │ -73 │ │ │ │ -75 using LocalFunctionInterface = _L_o_c_a_l_F_u_n_c_t_i_o_n_<_L_o_c_a_l_S_i_g_n_a_t_u_r_e_,_ _E_l_e_m_e_n_t_, │ │ │ │ -_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_>; │ │ │ │ +_7_1 _O_v_e_r_f_l_o_w_A_r_r_a_y(const std::initializer_list& l) { │ │ │ │ +72 assert(l.size() <= _c_a_p_a_c_i_t_y()); │ │ │ │ +73 size_ = l.size(); │ │ │ │ +74 std::copy_n(l.begin(), size_, _b_e_g_i_n()); │ │ │ │ +75 } │ │ │ │ 76 │ │ │ │ -78 using _C_o_n_c_e_p_t = GridFunctionWrapperInterface; │ │ │ │ -79 │ │ │ │ -81 template │ │ │ │ -82 using Model = GridFunctionWrapperImplementation; │ │ │ │ -83 }; │ │ │ │ -84} │ │ │ │ +_7_7 bool _o_p_e_r_a_t_o_r_ _=_=_ (const _O_v_e_r_f_l_o_w_A_r_r_a_y& other) const { │ │ │ │ +78 if (_s_i_z_e() != other._s_i_z_e()) │ │ │ │ +79 return false; │ │ │ │ +80 for (_s_i_z_e___t_y_p_e i=0; i<_s_i_z_e(); ++i) │ │ │ │ +81 if ((*this)[i] != other[i]) │ │ │ │ +82 return false; │ │ │ │ +83 return true; │ │ │ │ +84 } │ │ │ │ 85 │ │ │ │ -86 │ │ │ │ -87 │ │ │ │ -99template class │ │ │ │ -DerivativeTraits, size_t bufferSize> │ │ │ │ -_1_0_0class _G_r_i_d_F_u_n_c_t_i_o_n : │ │ │ │ -101 public _T_y_p_e_E_r_a_s_u_r_e_B_a_s_e< │ │ │ │ -102 typename Imp::GridFunctionTraits::Concept, │ │ │ │ -103 Imp::GridFunctionTraits:: │ │ │ │ -template Model> │ │ │ │ -104{ │ │ │ │ -105 using Traits = Imp::GridFunctionTraits; │ │ │ │ -106 │ │ │ │ -107 using Base = _T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_<_t_y_p_e_n_a_m_e_ _T_r_a_i_t_s_:_:_C_o_n_c_e_p_t_,_ _T_r_a_i_t_s_:_:_t_e_m_p_l_a_t_e │ │ │ │ -_M_o_d_e_l_>; │ │ │ │ -108 │ │ │ │ -109 using DerivativeInterface = typename Traits::DerivativeInterface; │ │ │ │ -110 │ │ │ │ -111 using LocalFunctionInterface = typename Traits::LocalFunctionInterface; │ │ │ │ +_8_7 void _c_l_e_a_r() { │ │ │ │ +88 size_ = 0; │ │ │ │ +89 } │ │ │ │ +90 │ │ │ │ +_9_7 void _r_e_s_i_z_e(_s_i_z_e___t_y_p_e n) { │ │ │ │ +98 assert(n <= _c_a_p_a_c_i_t_y()); │ │ │ │ +99 size_ = n; │ │ │ │ +100 } │ │ │ │ +101 │ │ │ │ +_1_0_8 void _p_u_s_h___b_a_c_k(const _v_a_l_u_e___t_y_p_e& t) { │ │ │ │ +109 assert(_s_i_z_e() < _c_a_p_a_c_i_t_y()); │ │ │ │ +110 (*this)[size_++] = t; │ │ │ │ +111 } │ │ │ │ 112 │ │ │ │ -113 using EntitySet = typename Traits::EntitySet; │ │ │ │ -114 │ │ │ │ -115public: │ │ │ │ -116 │ │ │ │ -128 template = 0 > │ │ │ │ -_1_2_9 _G_r_i_d_F_u_n_c_t_i_o_n(F&& f) : │ │ │ │ -130 Base(std::forward(f)) │ │ │ │ -131 { │ │ │ │ -132 static_assert(_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_G_r_i_d_F_u_n_c_t_i_o_n_<_F_,_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ -_E_n_t_i_t_y_S_e_t_>(), "Trying to construct a GridFunction from type that does not model │ │ │ │ -the GridFunction concept"); │ │ │ │ -133 } │ │ │ │ -134 │ │ │ │ -_1_3_5 _G_r_i_d_F_u_n_c_t_i_o_n() = default; │ │ │ │ -136 │ │ │ │ -_1_4_2 Range operator() (const Domain& x) const │ │ │ │ -143 { │ │ │ │ -144 return this->_a_s_I_n_t_e_r_f_a_c_e().operator()(x); │ │ │ │ -145 } │ │ │ │ -146 │ │ │ │ -_1_5_5 friend DerivativeInterface _d_e_r_i_v_a_t_i_v_e(const _G_r_i_d_F_u_n_c_t_i_o_n& t) │ │ │ │ -156 { │ │ │ │ -157 return t.asInterface().derivative(); │ │ │ │ -158 } │ │ │ │ -159 │ │ │ │ -_1_6_9 friend LocalFunctionInterface _l_o_c_a_l_F_u_n_c_t_i_o_n(const _G_r_i_d_F_u_n_c_t_i_o_n& t) │ │ │ │ -170 { │ │ │ │ -171 return t.asInterface().wrappedLocalFunction(); │ │ │ │ -172 } │ │ │ │ -173 │ │ │ │ -_1_8_0 const EntitySet& _e_n_t_i_t_y_S_e_t() const │ │ │ │ -181 { │ │ │ │ -182 return this->_a_s_I_n_t_e_r_f_a_c_e().wrappedEntitySet(); │ │ │ │ -183 } │ │ │ │ -184}; │ │ │ │ -185 │ │ │ │ +_1_1_4 void _p_o_p___b_a_c_k() { │ │ │ │ +115 assert(_s_i_z_e() > 0); │ │ │ │ +116 if (! _e_m_p_t_y()) │ │ │ │ +117 size_--; │ │ │ │ +118 } │ │ │ │ +119 │ │ │ │ +_1_2_6 void _p_u_s_h___f_r_o_n_t(const _v_a_l_u_e___t_y_p_e& t) { │ │ │ │ +127 assert(_s_i_z_e() < _c_a_p_a_c_i_t_y()); │ │ │ │ +128 for (_s_i_z_e___t_y_p_e i=0; i<_s_i_z_e(); i++) │ │ │ │ +129 (*this)[i+1] = (*this)[i]; │ │ │ │ +130 (*this)[0] = t; │ │ │ │ +131 } │ │ │ │ +132 │ │ │ │ +_1_3_4 _i_t_e_r_a_t_o_r _b_e_g_i_n() { │ │ │ │ +135 return _i_t_e_r_a_t_o_r(*this, 0); │ │ │ │ +136 } │ │ │ │ +137 │ │ │ │ +_1_3_9 _c_o_n_s_t___i_t_e_r_a_t_o_r _b_e_g_i_n() const { │ │ │ │ +140 return _c_o_n_s_t___i_t_e_r_a_t_o_r(*this, 0); │ │ │ │ +141 } │ │ │ │ +142 │ │ │ │ +_1_4_4 _i_t_e_r_a_t_o_r _e_n_d() { │ │ │ │ +145 return _i_t_e_r_a_t_o_r(*this, _s_i_z_e()); │ │ │ │ +146 } │ │ │ │ +147 │ │ │ │ +_1_4_9 _c_o_n_s_t___i_t_e_r_a_t_o_r _e_n_d() const { │ │ │ │ +150 return _c_o_n_s_t___i_t_e_r_a_t_o_r(*this, _s_i_z_e()); │ │ │ │ +151 } │ │ │ │ +152 │ │ │ │ +_1_5_4 _r_e_f_e_r_e_n_c_e _o_p_e_r_a_t_o_r_[_]_ (_s_i_z_e___t_y_p_e i) { │ │ │ │ +155 assert(i < _s_i_z_e()); │ │ │ │ +156 // If there's no padding between the base class and the overflow_ member, │ │ │ │ +157 // the compiler should be able to optimize this to │ │ │ │ +158 // return *(&BaseArray::operator[](0) + i); │ │ │ │ +159 if (i 0); │ │ │ │ +178 return (*this)[0]; │ │ │ │ +179 } │ │ │ │ +180 │ │ │ │ +_1_8_2 _c_o_n_s_t___r_e_f_e_r_e_n_c_e _f_r_o_n_t() const { │ │ │ │ +183 assert(_s_i_z_e() > 0); │ │ │ │ +184 return (*this)[0]; │ │ │ │ +185 } │ │ │ │ 186 │ │ │ │ -187 │ │ │ │ -188}} // namespace Dune::Functions │ │ │ │ -189 │ │ │ │ -190 │ │ │ │ -191 │ │ │ │ -192#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH │ │ │ │ -_l_o_c_a_l_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h │ │ │ │ -_g_r_i_d_f_u_n_c_t_i_o_n___i_m_p_._h_h │ │ │ │ -_t_y_p_e_e_r_a_s_u_r_e_._h_h │ │ │ │ -_l_o_c_a_l_f_u_n_c_t_i_o_n_._h_h │ │ │ │ -_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h │ │ │ │ -_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h │ │ │ │ -_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ -static constexpr bool isGridFunction() │ │ │ │ -Check if F models the GridFunction concept with given signature and entity set. │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:273 │ │ │ │ -_D_u_n_e │ │ │ │ -DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ +_1_8_8 _r_e_f_e_r_e_n_c_e _b_a_c_k() { │ │ │ │ +189 assert(_s_i_z_e() > 0); │ │ │ │ +190 return (*this)[_s_i_z_e()-1]; │ │ │ │ +191 } │ │ │ │ +192 │ │ │ │ +_1_9_4 _c_o_n_s_t___r_e_f_e_r_e_n_c_e _b_a_c_k() const { │ │ │ │ +195 assert(_s_i_z_e() > 0); │ │ │ │ +196 return (*this)[_s_i_z_e()-1]; │ │ │ │ +197 } │ │ │ │ +198 │ │ │ │ +_2_0_0 _s_i_z_e___t_y_p_e _s_i_z_e () const { │ │ │ │ +201 return size_; │ │ │ │ +202 } │ │ │ │ +203 │ │ │ │ +_2_0_5 bool _e_m_p_t_y() const { │ │ │ │ +206 return _s_i_z_e() == 0; │ │ │ │ +207 } │ │ │ │ +208 │ │ │ │ +_2_1_0 static constexpr _s_i_z_e___t_y_p_e _c_a_p_a_c_i_t_y() { │ │ │ │ +211 return maxSize; │ │ │ │ +212 } │ │ │ │ +213 │ │ │ │ +_2_1_5 static constexpr _s_i_z_e___t_y_p_e _m_a_x___s_i_z_e() { │ │ │ │ +216 return maxSize; │ │ │ │ +217 } │ │ │ │ +218 │ │ │ │ +_2_2_0 inline friend std::size_t _h_a_s_h___v_a_l_u_e(const _O_v_e_r_f_l_o_w_A_r_r_a_y& v) noexcept { │ │ │ │ +221 return hash_range(v.begin(), v.end()); │ │ │ │ +222 } │ │ │ │ +223 │ │ │ │ +_2_2_5 friend std::ostream& _o_p_e_r_a_t_o_r_<_<_ (std::ostream& s, const _O_v_e_r_f_l_o_w_A_r_r_a_y& c) { │ │ │ │ +226 for (const auto& ci : c) │ │ │ │ +227 s << ci << " "; │ │ │ │ +228 return s; │ │ │ │ +229 } │ │ │ │ +230 │ │ │ │ +231private: │ │ │ │ +232 OverflowBuffer overflow_; │ │ │ │ +233 _s_i_z_e___t_y_p_e size_ = 0; │ │ │ │ +234}; │ │ │ │ +235 │ │ │ │ +236 │ │ │ │ +237 │ │ │ │ +238} // namespace Dune::Functions │ │ │ │ +239 │ │ │ │ +240 │ │ │ │ +241 │ │ │ │ +242#endif // DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t │ │ │ │ -DDeeffiinniittiioonn backends/concepts.hh:17 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ -Default implementation for derivative traits. │ │ │ │ -DDeeffiinniittiioonn defaultderivativetraits.hh:41 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -DDeeffiinniittiioonn localfunction.hh:34 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_<_ _I_m_p_:_:_G_r_i_d_F_u_n_c_t_i_o_n_T_r_a_i_t_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_S_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_ _>_:_:_C_o_n_c_e_p_t_,_ _I_m_p_:_:_G_r_i_d_F_u_n_c_t_i_o_n_T_r_a_i_t_s_<_ _R_a_n_g_e │ │ │ │ -_(_D_o_m_a_i_n_)_,_ _E_S_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_ _>_:_:_t_e_m_p_l_a_t_e_ _M_o_d_e_l_ _>_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e │ │ │ │ -TypeErasureBase(T &&t) │ │ │ │ -DDeeffiinniittiioonn typeerasure.hh:174 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_<_ _I_m_p_:_:_G_r_i_d_F_u_n_c_t_i_o_n_T_r_a_i_t_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_S_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_ _>_:_:_C_o_n_c_e_p_t_,_ _I_m_p_:_:_G_r_i_d_F_u_n_c_t_i_o_n_T_r_a_i_t_s_<_ _R_a_n_g_e │ │ │ │ -_(_D_o_m_a_i_n_)_,_ _E_S_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_ _>_:_:_t_e_m_p_l_a_t_e_ _M_o_d_e_l_ _>_:_:_a_s_I_n_t_e_r_f_a_c_e │ │ │ │ -Imp::GridFunctionTraits< Range(Domain), ES, DerivativeTraits, bufferSize >:: │ │ │ │ -Concept & asInterface() │ │ │ │ -DDeeffiinniittiioonn typeerasure.hh:182 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ -DDeeffiinniittiioonn gridfunction.hh:36 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_S_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e │ │ │ │ -_>_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ -friend DerivativeInterface derivative(const GridFunction &t) │ │ │ │ -Get derivative of wrapped function. │ │ │ │ -DDeeffiinniittiioonn gridfunction.hh:155 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_S_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e │ │ │ │ -_>_:_:_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ -GridFunction()=default │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_S_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e │ │ │ │ -_>_:_:_e_n_t_i_t_y_S_e_t │ │ │ │ -const EntitySet & entitySet() const │ │ │ │ -Get associated EntitySet. │ │ │ │ -DDeeffiinniittiioonn gridfunction.hh:180 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_S_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e │ │ │ │ -_>_:_:_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ -GridFunction(F &&f) │ │ │ │ -Construct from function. │ │ │ │ -DDeeffiinniittiioonn gridfunction.hh:129 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_S_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e │ │ │ │ -_>_:_:_l_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -friend LocalFunctionInterface localFunction(const GridFunction &t) │ │ │ │ -Get local function of wrapped function. │ │ │ │ -DDeeffiinniittiioonn gridfunction.hh:169 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ -Derivative traits for local functions. │ │ │ │ -DDeeffiinniittiioonn localderivativetraits.hh:32 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_c_o_n_s_t___r_e_f_e_r_e_n_c_e │ │ │ │ +const value_type & const_reference │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:57 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_r_e_f_e_r_e_n_c_e │ │ │ │ +value_type & reference │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:56 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_e_n_d │ │ │ │ +const_iterator end() const │ │ │ │ +Returns a const_iterator pointing to the end of the OverflowArray. │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:149 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_o_p_e_r_a_t_o_r_=_= │ │ │ │ +bool operator==(const OverflowArray &other) const │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:77 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_h_a_s_h___v_a_l_u_e │ │ │ │ +friend std::size_t hash_value(const OverflowArray &v) noexcept │ │ │ │ +Compute hash value. │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:220 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_p_u_s_h___b_a_c_k │ │ │ │ +void push_back(const value_type &t) │ │ │ │ +Appends an element to the end of the OverflowArray,. │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:108 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_o_p_e_r_a_t_o_r_<_< │ │ │ │ +friend std::ostream & operator<<(std::ostream &s, const OverflowArray &c) │ │ │ │ +Write container to an output stream. │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:225 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_b_e_g_i_n │ │ │ │ +iterator begin() │ │ │ │ +Returns a iterator pointing to the beginning of the OverflowArray. │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:134 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_e_m_p_t_y │ │ │ │ +bool empty() const │ │ │ │ +Returns true if OverflowArray has no elements. │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:205 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_s_i_z_e │ │ │ │ +size_type size() const │ │ │ │ +Returns number of elements in the OverflowArray. │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:200 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_v_a_l_u_e___t_y_p_e │ │ │ │ +typename BaseArray::value_type value_type │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:55 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_p_o_p___b_a_c_k │ │ │ │ +void pop_back() │ │ │ │ +Erases the last element of the OverflowArray, O(1) time. │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:114 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_i_t_e_r_a_t_o_r │ │ │ │ +Dune::GenericIterator< OverflowArray, value_type > iterator │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:61 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_b_e_g_i_n │ │ │ │ +const_iterator begin() const │ │ │ │ +Returns a const_iterator pointing to the beginning of the OverflowArray. │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:139 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_d_i_f_f_e_r_e_n_c_e___t_y_p_e │ │ │ │ +std::ptrdiff_t difference_type │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:59 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y │ │ │ │ +OverflowArray()=default │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_B_a_s_e_A_r_r_a_y │ │ │ │ +BA BaseArray │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:53 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_c_a_p_a_c_i_t_y │ │ │ │ +static constexpr size_type capacity() │ │ │ │ +Returns the capacity of the OverflowArray. │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:210 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_m_a_x___s_i_z_e │ │ │ │ +static constexpr size_type max_size() │ │ │ │ +Returns the maximum length of the OverflowArray. │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:215 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_f_r_o_n_t │ │ │ │ +const_reference front() const │ │ │ │ +Returns const reference to first element of OverflowArray. │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:182 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_c_l_e_a_r │ │ │ │ +void clear() │ │ │ │ +Erases all elements. │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:87 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_e_n_d │ │ │ │ +iterator end() │ │ │ │ +Returns an iterator pointing to the end of the OverflowArray. │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:144 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_s_i_z_e___t_y_p_e │ │ │ │ +std::size_t size_type │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:60 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_r_e_s_i_z_e │ │ │ │ +void resize(size_type n) │ │ │ │ +Specifies a new size for the OverflowArray. │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:97 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_p_o_i_n_t_e_r │ │ │ │ +value_type * pointer │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:58 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_c_o_n_s_t___i_t_e_r_a_t_o_r │ │ │ │ +Dune::GenericIterator< const OverflowArray, const value_type > const_iterator │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:62 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_b_a_c_k │ │ │ │ +const_reference back() const │ │ │ │ +Returns const reference to last element of OverflowArray. │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:194 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y │ │ │ │ +OverflowArray(const std::initializer_list< value_type > &l) │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:71 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_b_a_c_k │ │ │ │ +reference back() │ │ │ │ +Returns reference to last element of OverflowArray. │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:188 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_p_u_s_h___f_r_o_n_t │ │ │ │ +void push_front(const value_type &t) │ │ │ │ +Inserts an element to the begin of the OverflowArray,. │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:126 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_f_r_o_n_t │ │ │ │ +reference front() │ │ │ │ +Returns reference to first element of OverflowArray. │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:176 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_o_p_e_r_a_t_o_r_[_] │ │ │ │ +reference operator[](size_type i) │ │ │ │ +Returns reference to the i'th element. │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:154 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_f_u_n_c_t_i_o_n_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _o_v_e_r_f_l_o_w_a_r_r_a_y_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00056.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: finefunctiononcoarsegridview.hh File Reference │ │ │ +Dune-Functions: localfunction_imp.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,36 +88,22 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
finefunctiononcoarsegridview.hh File Reference
│ │ │ +
localfunction_imp.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <optional>
│ │ │ -#include <type_traits>
│ │ │ -#include <utility>
│ │ │ -#include <limits>
│ │ │ -#include <algorithm>
│ │ │ -#include <cmath>
│ │ │ -#include <dune/common/referencehelper.hh>
│ │ │ -#include <dune/geometry/type.hh>
│ │ │ -#include <dune/functions/common/defaultderivativetraits.hh>
│ │ │ -#include <dune/functions/gridfunctions/gridfunction.hh>
│ │ │ -#include <dune/functions/gridfunctions/gridviewentityset.hh>
│ │ │ + │ │ │

Go to the source code of this file.

│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ -

│ │ │ -Classes

class  Dune::Functions::FineFunctionOnCoarseGridView< GridFunction, GV, DerivativeTraits >
 A wrapper representing a fine grid function on a gridview. More...
│ │ │ │ │ │ │ │ │ │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
│ │ │
│ │ │
│ │ │ @@ -128,13 +114,13 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,29 +1,16 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -finefunctiononcoarsegridview.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h> │ │ │ │ +localfunction_imp.hh File Reference │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n___i_m_p_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ -CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_<_ _G_r_i_d_F_u_n_c_t_i_o_n_,_ _G_V_, │ │ │ │ - _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _> │ │ │ │ -  A wrapper representing a fine grid function on a gridview. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_i_n_e_f_u_n_c_t_i_o_n_o_n_c_o_a_r_s_e_g_r_i_d_v_i_e_w_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _l_o_c_a_l_f_u_n_c_t_i_o_n___i_m_p_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00056_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: finefunctiononcoarsegridview.hh Source File │ │ │ +Dune-Functions: localfunction_imp.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,327 +88,98 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
finefunctiononcoarsegridview.hh
│ │ │ +
localfunction_imp.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_FINEFUNCTIONONCOARSEGRIDVIEW_HH
│ │ │ -
8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_FINEFUNCTIONONCOARSEGRIDVIEW_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_COMMON_LOCALFUNCTION_FUNCTION_IMP_HH
│ │ │ +
8#define DUNE_FUNCTIONS_COMMON_LOCALFUNCTION_FUNCTION_IMP_HH
│ │ │
9
│ │ │ -
10#include <optional>
│ │ │ -
11#include <type_traits>
│ │ │ -
12#include <utility>
│ │ │ -
13#include <limits>
│ │ │ -
14#include <algorithm>
│ │ │ -
15#include <cmath>
│ │ │ -
16
│ │ │ -
17#include <dune/common/referencehelper.hh>
│ │ │ + │ │ │ + │ │ │ +
12
│ │ │ +
13
│ │ │ +
14
│ │ │ +
15namespace Dune {
│ │ │ +
16namespace Functions {
│ │ │ +
17namespace Imp {
│ │ │
18
│ │ │ -
19#include <dune/geometry/type.hh>
│ │ │ -
20
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
24
│ │ │ -
25namespace Dune::Functions {
│ │ │ -
26
│ │ │ -
27namespace Impl {
│ │ │ -
28
│ │ │ -
29namespace ReferenceElementUtilities {
│ │ │ -
30
│ │ │ -
31// Compute the l1-distance of x to the reference element identified
│ │ │ -
32// by the topology id and dimension.
│ │ │ -
33template<class X, class FT = std::decay_t<decltype(std::declval<X>()[0])> >
│ │ │ -
34FT distance(unsigned int topologyId, int dim, X x, FT scaleFactor = FT(1))
│ │ │ -
35{
│ │ │ -
36 using std::abs;
│ │ │ -
37 using std::max;
│ │ │ -
38 using std::min;
│ │ │ -
39 auto dist_x_last = max(max(x[dim-1]-scaleFactor, -x[dim-1]), FT(0));
│ │ │ -
40 if (dim > 1)
│ │ │ -
41 {
│ │ │ -
42 if (Dune::Impl::isPyramid(topologyId, dim))
│ │ │ -
43 scaleFactor -= max(min(x[dim-1], scaleFactor), FT(0));
│ │ │ -
44 return distance(Dune::Impl::baseTopologyId(topologyId, dim), dim-1, x, scaleFactor) + dist_x_last;
│ │ │ -
45 }
│ │ │ -
46 if (dim == 1)
│ │ │ -
47 return dist_x_last;
│ │ │ -
48 return FT(0);
│ │ │ -
49}
│ │ │ -
50
│ │ │ -
51// Check if the l1-distance of x to the reference element identified
│ │ │ -
52// by the topology id and dimension is less than a tolerance. This
│ │ │ -
53// implementation is significantly faster than checking if
│ │ │ -
54// distance(...) <= tolerance. It is almost as fast as checkInside(...)
│ │ │ -
55// of the refenece element, but the latter does not reflect the
│ │ │ -
56// distance wrt any norm while we use the l1-norm here.
│ │ │ -
57template<class X, class FT = std::decay_t<decltype(std::declval<X>()[0])> >
│ │ │ -
58bool checkInside(unsigned int topologyId, int dim, X x, FT tolerance, FT scaleFactor = FT(1))
│ │ │ -
59{
│ │ │ -
60 using std::abs;
│ │ │ -
61 using std::max;
│ │ │ -
62 using std::min;
│ │ │ -
63 if (dim > 0)
│ │ │ -
64 {
│ │ │ -
65 auto dist_x_last = max(x[dim-1]-scaleFactor, -x[dim-1]);
│ │ │ -
66 if (dist_x_last <= tolerance)
│ │ │ -
67 {
│ │ │ -
68 if (Dune::Impl::isPyramid(topologyId, dim))
│ │ │ -
69 scaleFactor -= max(min(x[dim-1], scaleFactor), FT(0));
│ │ │ -
70 return checkInside(Dune::Impl::baseTopologyId(topologyId, dim), dim-1, x, tolerance - max(dist_x_last, FT(0)), scaleFactor);
│ │ │ -
71 }
│ │ │ -
72 return false;
│ │ │ -
73 }
│ │ │ -
74 return true;
│ │ │ -
75}
│ │ │ -
76
│ │ │ -
77} // namespace ReferenceElementUtilities
│ │ │ -
78
│ │ │ -
79} // namespace Impl
│ │ │ -
80
│ │ │ -
81
│ │ │ -
82
│ │ │ -
83
│ │ │ -
84
│ │ │ -
85
│ │ │ -
86
│ │ │ -
101template<class GridFunction, class GV, template<class> class DerivativeTraits=Dune::Functions::DefaultDerivativeTraits>
│ │ │ -
│ │ │ - │ │ │ -
103{
│ │ │ -
104 using RawGridFunction = Dune::ResolveRef_t<GridFunction>;
│ │ │ -
105
│ │ │ -
106 auto&& rawFunction() const
│ │ │ -
107 {
│ │ │ -
108 return Dune::resolveRef(function_);
│ │ │ -
109 }
│ │ │ -
110
│ │ │ -
111 static constexpr auto dim = GV::Grid::dimension;
│ │ │ -
112
│ │ │ -
113public:
│ │ │ -
114
│ │ │ -
115 using GridView = GV;
│ │ │ - │ │ │ -
117 using Element = typename EntitySet::Element;
│ │ │ - │ │ │ - │ │ │ -
120 using Range = std::decay_t<decltype(std::declval<RawGridFunction>()(std::declval<Domain>()))>;
│ │ │ -
121
│ │ │ -
122private:
│ │ │ -
123
│ │ │ -
124 using FineEntitySet = std::decay_t<decltype(std::declval<RawGridFunction>().entitySet())>;
│ │ │ -
125 using Traits = Dune::Functions::Imp::GridFunctionTraits<Range(Domain), EntitySet, DerivativeTraits, 56>;
│ │ │ -
126
│ │ │ -
127 class FineLocalFunctionOnCoarseGridView
│ │ │ -
128 {
│ │ │ -
129 using Traits = typename FineFunctionOnCoarseGridView::Traits::LocalFunctionTraits;
│ │ │ -
130
│ │ │ -
131 public:
│ │ │ -
132
│ │ │ -
133 using Derivative = decltype(localFunction(derivative(std::declval<FineFunctionOnCoarseGridView>())));
│ │ │ -
134 using RawLocalFunction = std::decay_t<decltype(localFunction(std::declval<const RawGridFunction&>()))>;
│ │ │ -
135
│ │ │ -
141 FineLocalFunctionOnCoarseGridView(RawLocalFunction&& localFunction, const FineEntitySet& fineEntitySet)
│ │ │ -
142 : element_()
│ │ │ -
143 , localFunction_(localFunction)
│ │ │ -
144 , fineEntitySet_(fineEntitySet)
│ │ │ -
145 , forwardToFineFunction_(false)
│ │ │ -
146 {}
│ │ │ -
147
│ │ │ -
153 FineLocalFunctionOnCoarseGridView(
│ │ │ -
154 RawLocalFunction&& localFunction,
│ │ │ -
155 const FineEntitySet& fineEntitySet,
│ │ │ -
156 bool forwardToFineFunction,
│ │ │ -
157 const std::optional<Element>& element
│ │ │ -
158 )
│ │ │ -
159 : element_(element)
│ │ │ -
160 , localFunction_(localFunction)
│ │ │ -
161 , fineEntitySet_(fineEntitySet)
│ │ │ -
162 , forwardToFineFunction_(forwardToFineFunction)
│ │ │ -
163 {}
│ │ │ -
164
│ │ │ -
166 void bind(const Element& element)
│ │ │ -
167 {
│ │ │ -
168 element_ = element;
│ │ │ -
169 forwardToFineFunction_ = fineEntitySet_.contains(*element_);
│ │ │ -
170 if (forwardToFineFunction_)
│ │ │ -
171 localFunction_.bind(element);
│ │ │ -
172 }
│ │ │ -
173
│ │ │ -
175 void unbind()
│ │ │ -
176 {
│ │ │ -
177 element_.reset();
│ │ │ -
178 }
│ │ │ -
179
│ │ │ -
181 bool bound() const
│ │ │ -
182 {
│ │ │ -
183 return static_cast<bool>(element_);
│ │ │ -
184 }
│ │ │ -
185
│ │ │ -
187 const Element& localContext() const
│ │ │ -
188 {
│ │ │ -
189 return *element_;
│ │ │ -
190 }
│ │ │ -
191
│ │ │ -
193 friend auto derivative(const FineLocalFunctionOnCoarseGridView& f)
│ │ │ -
194 {
│ │ │ -
195 if constexpr(requires{ derivative(f.localFunction_); })
│ │ │ -
196 return Derivative(derivative(f.localFunction_), f.fineEntitySet_, f.forwardToFineFunction_, f.element_);
│ │ │ -
197 else
│ │ │ -
198 return typename Traits::DerivativeInterface{};
│ │ │ -
199 }
│ │ │ -
200
│ │ │ - │ │ │ -
203 {
│ │ │ -
204 if (forwardToFineFunction_)
│ │ │ -
205 return localFunction_(x);
│ │ │ -
206 return evaluateInDescendent(*element_, x);
│ │ │ -
207 }
│ │ │ -
208
│ │ │ -
209 private:
│ │ │ -
210
│ │ │ -
211 // Find a child containing the point and evaluate there recursively
│ │ │ -
212 Range evaluateInDescendent(const Element& element, LocalDomain x) const
│ │ │ -
213 {
│ │ │ -
214 Element closestChild;
│ │ │ -
215 LocalDomain xInClosestChild;
│ │ │ -
216 double distanceToClosestChild = std::numeric_limits<double>::max();
│ │ │ -
217 for(const auto& child : descendantElements(element, element.level()+1))
│ │ │ -
218 {
│ │ │ -
219 auto&& geometry = child.geometryInFather();
│ │ │ -
220 auto xInChild = geometry.local(x);
│ │ │ -
221 auto dist = Impl::ReferenceElementUtilities::distance(child.type().id(), dim, xInChild);
│ │ │ -
222 if (dist < distanceToClosestChild)
│ │ │ -
223 {
│ │ │ -
224 closestChild = child;
│ │ │ -
225 distanceToClosestChild = dist;
│ │ │ -
226 xInClosestChild = xInChild;
│ │ │ -
227 if (distanceToClosestChild==0)
│ │ │ -
228 break;
│ │ │ -
229 }
│ │ │ -
230 }
│ │ │ -
231 if (fineEntitySet_.contains(closestChild))
│ │ │ -
232 {
│ │ │ -
233 localFunction_.bind(closestChild);
│ │ │ -
234 return localFunction_(xInClosestChild);
│ │ │ -
235 }
│ │ │ -
236 else
│ │ │ -
237 return evaluateInDescendent(closestChild, xInClosestChild);
│ │ │ -
238 }
│ │ │ -
239
│ │ │ -
240 std::optional<Element> element_;
│ │ │ -
241 mutable RawLocalFunction localFunction_;
│ │ │ -
242 const FineEntitySet& fineEntitySet_;
│ │ │ -
243 bool forwardToFineFunction_ = false;
│ │ │ -
244 };
│ │ │ -
245
│ │ │ -
246public:
│ │ │ -
247
│ │ │ -
248 using LocalFunction = FineLocalFunctionOnCoarseGridView;
│ │ │ -
249
│ │ │ -
│ │ │ -
256 FineFunctionOnCoarseGridView(const GridFunction& function, const GridView& gridView)
│ │ │ -
257 : function_(function)
│ │ │ -
258 , entitySet_(gridView)
│ │ │ -
259 {}
│ │ │ -
│ │ │ -
260
│ │ │ -
│ │ │ - │ │ │ -
268 : function_(std::move(function))
│ │ │ -
269 , entitySet_(gridView)
│ │ │ -
270 {}
│ │ │ -
│ │ │ -
271
│ │ │ -
│ │ │ -
273 Range operator()(const Domain& x) const
│ │ │ -
274 {
│ │ │ -
275 return function_(x);
│ │ │ -
276 }
│ │ │ -
│ │ │ -
277
│ │ │ -
│ │ │ - │ │ │ -
280 {
│ │ │ -
281 if constexpr(requires{ derivative(f.rawFunction()); })
│ │ │ -
282 {
│ │ │ -
283 using RawDerivative = std::decay_t<decltype(derivative(f.rawFunction()))>;
│ │ │ - │ │ │ -
285 }
│ │ │ -
286 else
│ │ │ -
287 return typename Traits::DerivativeInterface{};
│ │ │ -
288 }
│ │ │ -
│ │ │ -
289
│ │ │ -
│ │ │ - │ │ │ -
292 {
│ │ │ -
293 return LocalFunction(localFunction(f.rawFunction()), f.rawFunction().entitySet());
│ │ │ -
294 }
│ │ │ -
│ │ │ -
295
│ │ │ -
│ │ │ -
297 const EntitySet& entitySet() const
│ │ │ -
298 {
│ │ │ -
299 return entitySet_;
│ │ │ -
300 }
│ │ │ -
│ │ │ -
301
│ │ │ -
302protected:
│ │ │ -
303
│ │ │ - │ │ │ - │ │ │ -
306};
│ │ │ -
│ │ │ -
307
│ │ │ -
308
│ │ │ -
309
│ │ │ -
310} // namespace Dune::Functions
│ │ │ -
311
│ │ │ -
312#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_FINEFUNCTIONONCOARSEGRIDVIEW_HH
│ │ │ - │ │ │ - │ │ │ - │ │ │ +
19// Interface of type erasure wrapper
│ │ │ +
20//
│ │ │ +
21// Notice that the basic interface of polymorphic classes (destructor, clone, ...)
│ │ │ +
22// will be added by the type erasure foundation classes.
│ │ │ +
23template<class Signature, class DerivativeInterface, class LocalContext>
│ │ │ +
24class LocalFunctionWrapperInterface :
│ │ │ +
25 public DifferentiableFunctionWrapperInterface<Signature, DerivativeInterface>
│ │ │ +
26{
│ │ │ +
27public:
│ │ │ +
28 virtual void bind(const LocalContext&) = 0;
│ │ │ +
29
│ │ │ +
30 virtual void unbind() = 0;
│ │ │ +
31
│ │ │ +
32 virtual bool bound() const = 0;
│ │ │ +
33
│ │ │ +
34 virtual const LocalContext& localContext() const = 0;
│ │ │ +
35};
│ │ │ +
36
│ │ │ +
37
│ │ │ +
38// Implementation of type erasure wrapper
│ │ │ +
39template<class Signature, class DerivativeInterface, class LocalContext, class B>
│ │ │ +
40class LocalFunctionWrapperImplementation :
│ │ │ +
41 public DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>
│ │ │ +
42{
│ │ │ +
43 using Base = DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>;
│ │ │ +
44public:
│ │ │ +
45 using Base::Base;
│ │ │ +
46
│ │ │ +
47 virtual void bind(const LocalContext& context)
│ │ │ +
48 {
│ │ │ +
49 this->get().bind(context);
│ │ │ +
50 }
│ │ │ +
51
│ │ │ +
52 virtual void unbind()
│ │ │ +
53 {
│ │ │ +
54 this->get().unbind();
│ │ │ +
55 }
│ │ │ +
56
│ │ │ +
57 virtual bool bound() const
│ │ │ +
58 {
│ │ │ +
59 return this->get().bound();
│ │ │ +
60 }
│ │ │ +
61
│ │ │ +
62 virtual const LocalContext& localContext() const
│ │ │ +
63 {
│ │ │ +
64 return this->get().localContext();
│ │ │ +
65 }
│ │ │ +
66};
│ │ │ +
67
│ │ │ +
68}}} // namespace Dune::Functions::Imp
│ │ │ +
69
│ │ │ +
70
│ │ │ +
71
│ │ │ +
72#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH
│ │ │ + │ │ │ + │ │ │ +
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
GridFunction function_
Definition finefunctiononcoarsegridview.hh:304
│ │ │ -
Dune::Functions::GridViewEntitySet< GridView, 0 > EntitySet
Definition finefunctiononcoarsegridview.hh:116
│ │ │ -
Range operator()(const Domain &x) const
Evaluate function in global coordinates.
Definition finefunctiononcoarsegridview.hh:273
│ │ │ -
FineLocalFunctionOnCoarseGridView LocalFunction
Definition finefunctiononcoarsegridview.hh:248
│ │ │ -
FineFunctionOnCoarseGridView(const GridFunction &function, const GridView &gridView)
Create FineFunctionOnCoarseGridView from GridFunction and GridView.
Definition finefunctiononcoarsegridview.hh:256
│ │ │ -
friend auto derivative(const FineFunctionOnCoarseGridView &f)
Obtain global derivative of this function.
Definition finefunctiononcoarsegridview.hh:279
│ │ │ -
typename EntitySet::GlobalCoordinate Domain
Definition finefunctiononcoarsegridview.hh:118
│ │ │ -
FineFunctionOnCoarseGridView(GridFunction &&function, const GridView &gridView)
Create FineFunctionOnCoarseGridView from GridFunction and GridView.
Definition finefunctiononcoarsegridview.hh:267
│ │ │ -
EntitySet entitySet_
Definition finefunctiononcoarsegridview.hh:305
│ │ │ -
std::decay_t< decltype(std::declval< RawGridFunction >()(std::declval< Domain >()))> Range
Definition finefunctiononcoarsegridview.hh:120
│ │ │ -
typename EntitySet::LocalCoordinate LocalDomain
Definition finefunctiononcoarsegridview.hh:119
│ │ │ -
friend LocalFunction localFunction(const FineFunctionOnCoarseGridView &f)
Create a LocalFunction for evaluation in local coordinates.
Definition finefunctiononcoarsegridview.hh:291
│ │ │ -
GV GridView
Definition finefunctiononcoarsegridview.hh:115
│ │ │ -
typename EntitySet::Element Element
Definition finefunctiononcoarsegridview.hh:117
│ │ │ -
const EntitySet & entitySet() const
Return the EntitySet associated to this GridViewFunction.
Definition finefunctiononcoarsegridview.hh:297
│ │ │ -
Definition gridfunction.hh:36
│ │ │ -
An entity set for all entities of given codim in a grid view.
Definition gridviewentityset.hh:27
│ │ │ -
GridView::template Codim< codim >::Entity Element
Definition gridviewentityset.hh:36
│ │ │ -
const GridView & gridView() const
Return the associated GridView.
Definition gridviewentityset.hh:80
│ │ │ -
Element::Geometry::LocalCoordinate LocalCoordinate
Definition gridviewentityset.hh:39
│ │ │ -
Element::Geometry::GlobalCoordinate GlobalCoordinate
Definition gridviewentityset.hh:40
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,372 +1,96 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -finefunctiononcoarsegridview.hh │ │ │ │ +localfunction_imp.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_FINEFUNCTIONONCOARSEGRIDVIEW_HH │ │ │ │ -8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_FINEFUNCTIONONCOARSEGRIDVIEW_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_COMMON_LOCALFUNCTION_FUNCTION_IMP_HH │ │ │ │ +8#define DUNE_FUNCTIONS_COMMON_LOCALFUNCTION_FUNCTION_IMP_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ -12#include │ │ │ │ -13#include │ │ │ │ -14#include │ │ │ │ -15#include │ │ │ │ -16 │ │ │ │ -17#include │ │ │ │ +10#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ +11#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n___i_m_p_._h_h> │ │ │ │ +12 │ │ │ │ +13 │ │ │ │ +14 │ │ │ │ +15namespace _D_u_n_e { │ │ │ │ +16namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +17namespace Imp { │ │ │ │ 18 │ │ │ │ -19#include │ │ │ │ -20 │ │ │ │ -21#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ -22#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ -23#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h> │ │ │ │ -24 │ │ │ │ -25namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ -26 │ │ │ │ -27namespace Impl { │ │ │ │ -28 │ │ │ │ -29namespace ReferenceElementUtilities { │ │ │ │ -30 │ │ │ │ -31// Compute the l1-distance of x to the reference element identified │ │ │ │ -32// by the topology id and dimension. │ │ │ │ -33template()[0])> > │ │ │ │ -34FT distance(unsigned int topologyId, int dim, X x, FT scaleFactor = FT(1)) │ │ │ │ -35{ │ │ │ │ -36 using std::abs; │ │ │ │ -37 using std::max; │ │ │ │ -38 using std::min; │ │ │ │ -39 auto dist_x_last = max(max(x[dim-1]-scaleFactor, -x[dim-1]), FT(0)); │ │ │ │ -40 if (dim > 1) │ │ │ │ -41 { │ │ │ │ -42 if (Dune::Impl::isPyramid(topologyId, dim)) │ │ │ │ -43 scaleFactor -= max(min(x[dim-1], scaleFactor), FT(0)); │ │ │ │ -44 return distance(Dune::Impl::baseTopologyId(topologyId, dim), dim-1, x, │ │ │ │ -scaleFactor) + dist_x_last; │ │ │ │ -45 } │ │ │ │ -46 if (dim == 1) │ │ │ │ -47 return dist_x_last; │ │ │ │ -48 return FT(0); │ │ │ │ -49} │ │ │ │ -50 │ │ │ │ -51// Check if the l1-distance of x to the reference element identified │ │ │ │ -52// by the topology id and dimension is less than a tolerance. This │ │ │ │ -53// implementation is significantly faster than checking if │ │ │ │ -54// distance(...) <= tolerance. It is almost as fast as checkInside(...) │ │ │ │ -55// of the refenece element, but the latter does not reflect the │ │ │ │ -56// distance wrt any norm while we use the l1-norm here. │ │ │ │ -57template()[0])> > │ │ │ │ -58bool checkInside(unsigned int topologyId, int dim, X x, FT tolerance, FT │ │ │ │ -scaleFactor = FT(1)) │ │ │ │ -59{ │ │ │ │ -60 using std::abs; │ │ │ │ -61 using std::max; │ │ │ │ -62 using std::min; │ │ │ │ -63 if (dim > 0) │ │ │ │ -64 { │ │ │ │ -65 auto dist_x_last = max(x[dim-1]-scaleFactor, -x[dim-1]); │ │ │ │ -66 if (dist_x_last <= tolerance) │ │ │ │ -67 { │ │ │ │ -68 if (Dune::Impl::isPyramid(topologyId, dim)) │ │ │ │ -69 scaleFactor -= max(min(x[dim-1], scaleFactor), FT(0)); │ │ │ │ -70 return checkInside(Dune::Impl::baseTopologyId(topologyId, dim), dim-1, x, │ │ │ │ -tolerance - max(dist_x_last, FT(0)), scaleFactor); │ │ │ │ -71 } │ │ │ │ -72 return false; │ │ │ │ -73 } │ │ │ │ -74 return true; │ │ │ │ -75} │ │ │ │ -76 │ │ │ │ -77} // namespace ReferenceElementUtilities │ │ │ │ -78 │ │ │ │ -79} // namespace Impl │ │ │ │ -80 │ │ │ │ -81 │ │ │ │ -82 │ │ │ │ -83 │ │ │ │ -84 │ │ │ │ -85 │ │ │ │ -86 │ │ │ │ -101template class │ │ │ │ -DerivativeTraits=Dune::Functions::DefaultDerivativeTraits> │ │ │ │ -_1_0_2class _F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w │ │ │ │ -103{ │ │ │ │ -104 using RawGridFunction = Dune::ResolveRef_t; │ │ │ │ -105 │ │ │ │ -106 auto&& rawFunction() const │ │ │ │ -107 { │ │ │ │ -108 return Dune::resolveRef(_f_u_n_c_t_i_o_n__); │ │ │ │ -109 } │ │ │ │ -110 │ │ │ │ -111 static constexpr auto dim = GV::Grid::dimension; │ │ │ │ -112 │ │ │ │ -113public: │ │ │ │ -114 │ │ │ │ -_1_1_5 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ -_1_1_6 using _E_n_t_i_t_y_S_e_t = _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_G_r_i_d_V_i_e_w_,_ _0_>; │ │ │ │ -_1_1_7 using _E_l_e_m_e_n_t = typename _E_n_t_i_t_y_S_e_t_:_:_E_l_e_m_e_n_t; │ │ │ │ -_1_1_8 using _D_o_m_a_i_n = typename _E_n_t_i_t_y_S_e_t_:_:_G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e; │ │ │ │ -_1_1_9 using _L_o_c_a_l_D_o_m_a_i_n = typename _E_n_t_i_t_y_S_e_t_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e; │ │ │ │ -_1_2_0 using _R_a_n_g_e = std::decay_t()(std:: │ │ │ │ -declval()))>; │ │ │ │ -121 │ │ │ │ -122private: │ │ │ │ -123 │ │ │ │ -124 using FineEntitySet = std::decay_t │ │ │ │ -().entitySet())>; │ │ │ │ -125 using Traits = Dune::Functions::Imp::GridFunctionTraits<_R_a_n_g_e(_D_o_m_a_i_n), │ │ │ │ -_E_n_t_i_t_y_S_e_t, DerivativeTraits, 56>; │ │ │ │ -126 │ │ │ │ -127 class FineLocalFunctionOnCoarseGridView │ │ │ │ -128 { │ │ │ │ -129 using Traits = typename FineFunctionOnCoarseGridView::Traits:: │ │ │ │ -LocalFunctionTraits; │ │ │ │ -130 │ │ │ │ -131 public: │ │ │ │ -132 │ │ │ │ -133 using Derivative = decltype(_l_o_c_a_l_F_u_n_c_t_i_o_n(_d_e_r_i_v_a_t_i_v_e(std:: │ │ │ │ -declval()))); │ │ │ │ -134 using RawLocalFunction = std::decay_t()))>; │ │ │ │ -135 │ │ │ │ -141 FineLocalFunctionOnCoarseGridView(RawLocalFunction&& _l_o_c_a_l_F_u_n_c_t_i_o_n, const │ │ │ │ -FineEntitySet& fineEntitySet) │ │ │ │ -142 : element_() │ │ │ │ -143 , localFunction_(_l_o_c_a_l_F_u_n_c_t_i_o_n) │ │ │ │ -144 , fineEntitySet_(fineEntitySet) │ │ │ │ -145 , forwardToFineFunction_(false) │ │ │ │ -146 {} │ │ │ │ -147 │ │ │ │ -153 FineLocalFunctionOnCoarseGridView( │ │ │ │ -154 RawLocalFunction&& _l_o_c_a_l_F_u_n_c_t_i_o_n, │ │ │ │ -155 const FineEntitySet& fineEntitySet, │ │ │ │ -156 bool forwardToFineFunction, │ │ │ │ -157 const std::optional& element │ │ │ │ -158 ) │ │ │ │ -159 : element_(element) │ │ │ │ -160 , localFunction_(_l_o_c_a_l_F_u_n_c_t_i_o_n) │ │ │ │ -161 , fineEntitySet_(fineEntitySet) │ │ │ │ -162 , forwardToFineFunction_(forwardToFineFunction) │ │ │ │ -163 {} │ │ │ │ -164 │ │ │ │ -166 void bind(const _E_l_e_m_e_n_t& element) │ │ │ │ -167 { │ │ │ │ -168 element_ = element; │ │ │ │ -169 forwardToFineFunction_ = fineEntitySet_.contains(*element_); │ │ │ │ -170 if (forwardToFineFunction_) │ │ │ │ -171 localFunction_.bind(element); │ │ │ │ -172 } │ │ │ │ -173 │ │ │ │ -175 void unbind() │ │ │ │ -176 { │ │ │ │ -177 element_.reset(); │ │ │ │ -178 } │ │ │ │ -179 │ │ │ │ -181 bool bound() const │ │ │ │ -182 { │ │ │ │ -183 return static_cast(element_); │ │ │ │ -184 } │ │ │ │ -185 │ │ │ │ -187 const _E_l_e_m_e_n_t& localContext() const │ │ │ │ -188 { │ │ │ │ -189 return *element_; │ │ │ │ -190 } │ │ │ │ -191 │ │ │ │ -193 friend auto _d_e_r_i_v_a_t_i_v_e(const FineLocalFunctionOnCoarseGridView& f) │ │ │ │ -194 { │ │ │ │ -195 if constexpr(requires{ _d_e_r_i_v_a_t_i_v_e(f.localFunction_); }) │ │ │ │ -196 return Derivative(_d_e_r_i_v_a_t_i_v_e(f.localFunction_), f.fineEntitySet_, │ │ │ │ -f.forwardToFineFunction_, f.element_); │ │ │ │ -197 else │ │ │ │ -198 return typename Traits::DerivativeInterface{}; │ │ │ │ -199 } │ │ │ │ -200 │ │ │ │ -202 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(_L_o_c_a_l_D_o_m_a_i_n x) const │ │ │ │ -203 { │ │ │ │ -204 if (forwardToFineFunction_) │ │ │ │ -205 return localFunction_(x); │ │ │ │ -206 return evaluateInDescendent(*element_, x); │ │ │ │ -207 } │ │ │ │ -208 │ │ │ │ -209 private: │ │ │ │ -210 │ │ │ │ -211 // Find a child containing the point and evaluate there recursively │ │ │ │ -212 _R_a_n_g_e evaluateInDescendent(const _E_l_e_m_e_n_t& element, _L_o_c_a_l_D_o_m_a_i_n x) const │ │ │ │ -213 { │ │ │ │ -214 _E_l_e_m_e_n_t closestChild; │ │ │ │ -215 _L_o_c_a_l_D_o_m_a_i_n xInClosestChild; │ │ │ │ -216 double distanceToClosestChild = std::numeric_limits::max(); │ │ │ │ -217 for(const auto& child : descendantElements(element, element.level()+1)) │ │ │ │ -218 { │ │ │ │ -219 auto&& geometry = child.geometryInFather(); │ │ │ │ -220 auto xInChild = geometry.local(x); │ │ │ │ -221 auto dist = Impl::ReferenceElementUtilities::distance(child.type().id(), │ │ │ │ -dim, xInChild); │ │ │ │ -222 if (dist < distanceToClosestChild) │ │ │ │ -223 { │ │ │ │ -224 closestChild = child; │ │ │ │ -225 distanceToClosestChild = dist; │ │ │ │ -226 xInClosestChild = xInChild; │ │ │ │ -227 if (distanceToClosestChild==0) │ │ │ │ -228 break; │ │ │ │ -229 } │ │ │ │ -230 } │ │ │ │ -231 if (fineEntitySet_.contains(closestChild)) │ │ │ │ -232 { │ │ │ │ -233 localFunction_.bind(closestChild); │ │ │ │ -234 return localFunction_(xInClosestChild); │ │ │ │ -235 } │ │ │ │ -236 else │ │ │ │ -237 return evaluateInDescendent(closestChild, xInClosestChild); │ │ │ │ -238 } │ │ │ │ -239 │ │ │ │ -240 std::optional element_; │ │ │ │ -241 mutable RawLocalFunction localFunction_; │ │ │ │ -242 const FineEntitySet& fineEntitySet_; │ │ │ │ -243 bool forwardToFineFunction_ = false; │ │ │ │ -244 }; │ │ │ │ -245 │ │ │ │ -246public: │ │ │ │ -247 │ │ │ │ -_2_4_8 using _L_o_c_a_l_F_u_n_c_t_i_o_n = FineLocalFunctionOnCoarseGridView; │ │ │ │ -249 │ │ │ │ -_2_5_6 _F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w(const _G_r_i_d_F_u_n_c_t_i_o_n& function, const _G_r_i_d_V_i_e_w& │ │ │ │ -gridView) │ │ │ │ -257 : _f_u_n_c_t_i_o_n__(function) │ │ │ │ -258 , _e_n_t_i_t_y_S_e_t__(gridView) │ │ │ │ -259 {} │ │ │ │ -260 │ │ │ │ -_2_6_7 _F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w(_G_r_i_d_F_u_n_c_t_i_o_n&& function, const _G_r_i_d_V_i_e_w& │ │ │ │ -gridView) │ │ │ │ -268 : _f_u_n_c_t_i_o_n__(std::move(function)) │ │ │ │ -269 , _e_n_t_i_t_y_S_e_t__(gridView) │ │ │ │ -270 {} │ │ │ │ -271 │ │ │ │ -_2_7_3 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(const _D_o_m_a_i_n& x) const │ │ │ │ -274 { │ │ │ │ -275 return _f_u_n_c_t_i_o_n__(x); │ │ │ │ -276 } │ │ │ │ -277 │ │ │ │ -_2_7_9 friend auto _d_e_r_i_v_a_t_i_v_e(const _F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w& f) │ │ │ │ -280 { │ │ │ │ -281 if constexpr(requires{ _d_e_r_i_v_a_t_i_v_e(f.rawFunction()); }) │ │ │ │ -282 { │ │ │ │ -283 using RawDerivative = std::decay_t; │ │ │ │ -284 return _F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_<_R_a_w_D_e_r_i_v_a_t_i_v_e_,_ _G_r_i_d_V_i_e_w_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_>(_d_e_r_i_v_a_t_i_v_e(f.rawFunction()), f._e_n_t_i_t_y_S_e_t__._g_r_i_d_V_i_e_w()); │ │ │ │ -285 } │ │ │ │ -286 else │ │ │ │ -287 return typename Traits::DerivativeInterface{}; │ │ │ │ -288 } │ │ │ │ -289 │ │ │ │ -_2_9_1 friend _L_o_c_a_l_F_u_n_c_t_i_o_n _l_o_c_a_l_F_u_n_c_t_i_o_n(const _F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w& f) │ │ │ │ -292 { │ │ │ │ -293 return _L_o_c_a_l_F_u_n_c_t_i_o_n(_l_o_c_a_l_F_u_n_c_t_i_o_n(f.rawFunction()), f.rawFunction │ │ │ │ -().entitySet()); │ │ │ │ -294 } │ │ │ │ -295 │ │ │ │ -_2_9_7 const _E_n_t_i_t_y_S_e_t& _e_n_t_i_t_y_S_e_t() const │ │ │ │ -298 { │ │ │ │ -299 return _e_n_t_i_t_y_S_e_t__; │ │ │ │ -300 } │ │ │ │ -301 │ │ │ │ -302protected: │ │ │ │ -303 │ │ │ │ -_3_0_4 _G_r_i_d_F_u_n_c_t_i_o_n _f_u_n_c_t_i_o_n__; │ │ │ │ -_3_0_5 _E_n_t_i_t_y_S_e_t _e_n_t_i_t_y_S_e_t__; │ │ │ │ -306}; │ │ │ │ -307 │ │ │ │ -308 │ │ │ │ -309 │ │ │ │ -310} // namespace Dune::Functions │ │ │ │ -311 │ │ │ │ -312#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_FINEFUNCTIONONCOARSEGRIDVIEW_HH │ │ │ │ -_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h │ │ │ │ -_g_r_i_d_f_u_n_c_t_i_o_n_._h_h │ │ │ │ -_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h │ │ │ │ +19// Interface of type erasure wrapper │ │ │ │ +20// │ │ │ │ +21// Notice that the basic interface of polymorphic classes (destructor, clone, │ │ │ │ +...) │ │ │ │ +22// will be added by the type erasure foundation classes. │ │ │ │ +23template │ │ │ │ +24class LocalFunctionWrapperInterface : │ │ │ │ +25 public DifferentiableFunctionWrapperInterface │ │ │ │ +26{ │ │ │ │ +27public: │ │ │ │ +28 virtual void bind(const LocalContext&) = 0; │ │ │ │ +29 │ │ │ │ +30 virtual void unbind() = 0; │ │ │ │ +31 │ │ │ │ +32 virtual bool bound() const = 0; │ │ │ │ +33 │ │ │ │ +34 virtual const LocalContext& localContext() const = 0; │ │ │ │ +35}; │ │ │ │ +36 │ │ │ │ +37 │ │ │ │ +38// Implementation of type erasure wrapper │ │ │ │ +39template │ │ │ │ +40class LocalFunctionWrapperImplementation : │ │ │ │ +41 public DifferentiableFunctionWrapperImplementation │ │ │ │ +42{ │ │ │ │ +43 using Base = DifferentiableFunctionWrapperImplementation; │ │ │ │ +44public: │ │ │ │ +45 using Base::Base; │ │ │ │ +46 │ │ │ │ +47 virtual void bind(const LocalContext& context) │ │ │ │ +48 { │ │ │ │ +49 this->get().bind(context); │ │ │ │ +50 } │ │ │ │ +51 │ │ │ │ +52 virtual void unbind() │ │ │ │ +53 { │ │ │ │ +54 this->get().unbind(); │ │ │ │ +55 } │ │ │ │ +56 │ │ │ │ +57 virtual bool bound() const │ │ │ │ +58 { │ │ │ │ +59 return this->get().bound(); │ │ │ │ +60 } │ │ │ │ +61 │ │ │ │ +62 virtual const LocalContext& localContext() const │ │ │ │ +63 { │ │ │ │ +64 return this->get().localContext(); │ │ │ │ +65 } │ │ │ │ +66}; │ │ │ │ +67 │ │ │ │ +68}}} // namespace Dune::Functions::Imp │ │ │ │ +69 │ │ │ │ +70 │ │ │ │ +71 │ │ │ │ +72#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH │ │ │ │ +_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n___i_m_p_._h_h │ │ │ │ +_t_y_p_e___t_r_a_i_t_s_._h_h │ │ │ │ +_D_u_n_e │ │ │ │ +DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_f_u_n_c_t_i_o_n__ │ │ │ │ -GridFunction function_ │ │ │ │ -DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:304 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_E_n_t_i_t_y_S_e_t │ │ │ │ -Dune::Functions::GridViewEntitySet< GridView, 0 > EntitySet │ │ │ │ -DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:116 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ -Range operator()(const Domain &x) const │ │ │ │ -Evaluate function in global coordinates. │ │ │ │ -DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:273 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -FineLocalFunctionOnCoarseGridView LocalFunction │ │ │ │ -DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:248 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w │ │ │ │ -FineFunctionOnCoarseGridView(const GridFunction &function, const GridView │ │ │ │ -&gridView) │ │ │ │ -Create FineFunctionOnCoarseGridView from GridFunction and GridView. │ │ │ │ -DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:256 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ -friend auto derivative(const FineFunctionOnCoarseGridView &f) │ │ │ │ -Obtain global derivative of this function. │ │ │ │ -DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:279 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_D_o_m_a_i_n │ │ │ │ -typename EntitySet::GlobalCoordinate Domain │ │ │ │ -DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:118 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w │ │ │ │ -FineFunctionOnCoarseGridView(GridFunction &&function, const GridView &gridView) │ │ │ │ -Create FineFunctionOnCoarseGridView from GridFunction and GridView. │ │ │ │ -DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:267 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_e_n_t_i_t_y_S_e_t__ │ │ │ │ -EntitySet entitySet_ │ │ │ │ -DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:305 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_R_a_n_g_e │ │ │ │ -std::decay_t< decltype(std::declval< RawGridFunction >()(std::declval< Domain > │ │ │ │ -()))> Range │ │ │ │ -DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:120 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_L_o_c_a_l_D_o_m_a_i_n │ │ │ │ -typename EntitySet::LocalCoordinate LocalDomain │ │ │ │ -DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:119 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_l_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -friend LocalFunction localFunction(const FineFunctionOnCoarseGridView &f) │ │ │ │ -Create a LocalFunction for evaluation in local coordinates. │ │ │ │ -DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:291 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_G_r_i_d_V_i_e_w │ │ │ │ -GV GridView │ │ │ │ -DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:115 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_E_l_e_m_e_n_t │ │ │ │ -typename EntitySet::Element Element │ │ │ │ -DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:117 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_e_n_t_i_t_y_S_e_t │ │ │ │ -const EntitySet & entitySet() const │ │ │ │ -Return the EntitySet associated to this GridViewFunction. │ │ │ │ -DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:297 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ -DDeeffiinniittiioonn gridfunction.hh:36 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t │ │ │ │ -An entity set for all entities of given codim in a grid view. │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:27 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_E_l_e_m_e_n_t │ │ │ │ -GridView::template Codim< codim >::Entity Element │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:36 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_:_:_g_r_i_d_V_i_e_w │ │ │ │ -const GridView & gridView() const │ │ │ │ -Return the associated GridView. │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:80 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ -Element::Geometry::LocalCoordinate LocalCoordinate │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:39 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ -Element::Geometry::GlobalCoordinate GlobalCoordinate │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:40 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_i_n_e_f_u_n_c_t_i_o_n_o_n_c_o_a_r_s_e_g_r_i_d_v_i_e_w_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _l_o_c_a_l_f_u_n_c_t_i_o_n___i_m_p_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00059.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: facenormalgridfunction.hh File Reference │ │ │ +Dune-Functions: differentiablefunction_imp.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,33 +88,23 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
facenormalgridfunction.hh File Reference
│ │ │ +
differentiablefunction_imp.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <type_traits>
│ │ │ -#include <optional>
│ │ │ -#include <dune/common/exceptions.hh>
│ │ │ -#include <dune/common/typeutilities.hh>
│ │ │ -#include <dune/common/rangeutilities.hh>
│ │ │ -#include <dune/geometry/referenceelements.hh>
│ │ │ -#include <dune/functions/gridfunctions/gridfunction.hh>
│ │ │ -#include <dune/functions/gridfunctions/gridviewentityset.hh>
│ │ │ +
#include <dune/common/exceptions.hh>
│ │ │ +#include <dune/common/concept.hh>
│ │ │ +#include <dune/functions/common/type_traits.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ -

│ │ │ -Classes

class  Dune::Functions::FaceNormalGridFunction< GV >
 Grid function implementing the piecewise element face normal. More...
│ │ │ │ │ │ │ │ │ │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
│ │ │
│ │ │
│ │ │ @@ -125,13 +115,13 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,25 +1,17 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -facenormalgridfunction.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ +differentiablefunction_imp.hh File Reference │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h> │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ -CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n_<_ _G_V_ _> │ │ │ │ -  Grid function implementing the piecewise element face normal. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_a_c_e_n_o_r_m_a_l_g_r_i_d_f_u_n_c_t_i_o_n_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n___i_m_p_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00059_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: facenormalgridfunction.hh Source File │ │ │ +Dune-Functions: differentiablefunction_imp.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,210 +88,126 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
facenormalgridfunction.hh
│ │ │ +
differentiablefunction_imp.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH
│ │ │ -
8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH
│ │ │ +
8#define DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH
│ │ │
9
│ │ │ -
10#include <type_traits>
│ │ │ -
11#include <optional>
│ │ │ +
10#include <dune/common/exceptions.hh>
│ │ │ +
11#include <dune/common/concept.hh>
│ │ │
12
│ │ │ -
13#include <dune/common/exceptions.hh>
│ │ │ -
14#include <dune/common/typeutilities.hh>
│ │ │ -
15#include <dune/common/rangeutilities.hh>
│ │ │ -
16#include <dune/geometry/referenceelements.hh>
│ │ │ -
17
│ │ │ - │ │ │ - │ │ │ -
20
│ │ │ -
21
│ │ │ -
22namespace Dune::Functions {
│ │ │ -
23
│ │ │ -
24namespace Impl {
│ │ │ -
25
│ │ │ -
26// Compute closest face to point
│ │ │ -
27template<class ReferenceElement, class Coordinate>
│ │ │ -
28auto closestFaceIndex(const ReferenceElement& re, const Coordinate& x)
│ │ │ -
29{
│ │ │ -
30 auto closestFaceIndex = decltype(re.subEntity(0,1,0,1)){};
│ │ │ -
31 double closestFaceDistance = std::numeric_limits<double>::max();
│ │ │ -
32 for(auto&& faceIndex : Dune::range(re.size(1)))
│ │ │ -
33 {
│ │ │ -
34 // For a face unit outer normal consider the orthogonal projection
│ │ │ -
35 // Px = x + <c-x,n>*n into the face. Then the distance to the face
│ │ │ -
36 // is given by |x-Px| = |<c-x,n>||n| = <c-x,n>.
│ │ │ -
37 auto normal = re.integrationOuterNormal(faceIndex);
│ │ │ -
38 normal /= normal.two_norm();
│ │ │ -
39 auto c = re.position(faceIndex,1);
│ │ │ -
40 c -= x;
│ │ │ -
41 auto faceDistance = (c*normal);
│ │ │ -
42 if (faceDistance<closestFaceDistance)
│ │ │ -
43 {
│ │ │ -
44 closestFaceDistance = faceDistance;
│ │ │ -
45 closestFaceIndex = faceIndex;
│ │ │ -
46 }
│ │ │ -
47 }
│ │ │ -
48 return closestFaceIndex;
│ │ │ + │ │ │ +
14
│ │ │ +
15
│ │ │ +
16namespace Dune {
│ │ │ +
17namespace Functions {
│ │ │ +
18namespace Imp {
│ │ │ +
19
│ │ │ +
23struct HasFreeDerivative
│ │ │ +
24{
│ │ │ +
25 template<class F>
│ │ │ +
26 auto require(F&& f) -> decltype(
│ │ │ +
27 derivative(f)
│ │ │ +
28 );
│ │ │ +
29};
│ │ │ +
30
│ │ │ +
31
│ │ │ +
32
│ │ │ +
33template<class Dummy, class F,
│ │ │ +
34 std::enable_if_t<
│ │ │ +
35 models< HasFreeDerivative, F>() , int> = 0>
│ │ │ +
36auto derivativeIfImplemented(const F& f) -> decltype(derivative(f))
│ │ │ +
37{
│ │ │ +
38 return derivative(f);
│ │ │ +
39}
│ │ │ +
40
│ │ │ +
41
│ │ │ +
42
│ │ │ +
43template<class Dummy, class F,
│ │ │ +
44 std::enable_if_t<
│ │ │ +
45 not(models< HasFreeDerivative, F>()) , int> = 0>
│ │ │ +
46Dummy derivativeIfImplemented(const F& f)
│ │ │ +
47{
│ │ │ +
48 DUNE_THROW(Dune::NotImplemented, "Derivative not implemented");
│ │ │
49}
│ │ │
50
│ │ │ -
51} // end namespace Impl
│ │ │ +
51
│ │ │
52
│ │ │ -
53
│ │ │ -
54
│ │ │ -
55
│ │ │ -
68template<class GV>
│ │ │ -
│ │ │ - │ │ │ -
70{
│ │ │ -
71public:
│ │ │ -
72 using GridView = GV;
│ │ │ - │ │ │ -
74 using Element = typename EntitySet::Element;
│ │ │ +
53template<class Signature, class DerivativeInterface>
│ │ │ +
54class DifferentiableFunctionWrapperInterface
│ │ │ +
55{};
│ │ │ +
56
│ │ │ +
57// Interface of type erasure wrapper
│ │ │ +
58//
│ │ │ +
59// Notice that the basic interface of polymorphic classes (destructor, clone, ...)
│ │ │ +
60// will be added by the type erasure foundation classes.
│ │ │ +
61template<class Range, class Domain, class DerivativeInterface>
│ │ │ +
62class DifferentiableFunctionWrapperInterface<Range(Domain), DerivativeInterface>
│ │ │ +
63{
│ │ │ +
64public:
│ │ │ +
65 virtual Range operator() (const Domain& x) const = 0;
│ │ │ +
66
│ │ │ +
67 virtual DerivativeInterface derivative() const = 0;
│ │ │ +
68};
│ │ │ +
69
│ │ │ +
70
│ │ │ +
71
│ │ │ +
72template<class Signature, class DerivativeInterface, class B>
│ │ │ +
73class DifferentiableFunctionWrapperImplementation
│ │ │ +
74{};
│ │ │
75
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
79
│ │ │ -
80private:
│ │ │ -
81
│ │ │ -
82 using Traits = Imp::GridFunctionTraits<Range(Domain), EntitySet, DefaultDerivativeTraits, 16>;
│ │ │ -
83
│ │ │ -
84 class LocalFunction
│ │ │ -
85 {
│ │ │ -
86 using Geometry = typename Element::Geometry;
│ │ │ -
87 static const int dimension = GV::dimension;
│ │ │ -
88 public:
│ │ │ -
89
│ │ │ -
101 void bind(const Element& element)
│ │ │ -
102 {
│ │ │ -
103 element_ = element;
│ │ │ -
104 geometry_.emplace(element_.geometry());
│ │ │ -
105 }
│ │ │ -
106
│ │ │ -
107 void unbind()
│ │ │ -
108 {
│ │ │ -
109 geometry_.reset();
│ │ │ -
110 }
│ │ │ -
111
│ │ │ -
114 bool bound() const
│ │ │ -
115 {
│ │ │ -
116 return static_cast<bool>(geometry_);
│ │ │ -
117 }
│ │ │ -
118
│ │ │ -
128 Range operator()(const LocalDomain& x) const
│ │ │ -
129 {
│ │ │ -
130 auto&& re = Dune::referenceElement(*geometry_);
│ │ │ -
131 // Compute reference normal of closest face to given point
│ │ │ -
132 auto face = Impl::closestFaceIndex(re, x);
│ │ │ -
133 auto localNormal = re.integrationOuterNormal(face);
│ │ │ -
134
│ │ │ -
135 // Transform reference normal into global unit outer normal using
│ │ │ -
136 // covariant Piola transformation
│ │ │ -
137 auto normal = Range{};
│ │ │ -
138 geometry_->jacobianInverseTransposed(x).mv(localNormal, normal);
│ │ │ -
139 normal /= normal.two_norm();
│ │ │ -
140 return normal;
│ │ │ -
141 }
│ │ │ -
142
│ │ │ -
144 const Element& localContext() const
│ │ │ -
145 {
│ │ │ -
146 return element_;
│ │ │ -
147 }
│ │ │ -
148
│ │ │ -
150 friend typename Traits::LocalFunctionTraits::DerivativeInterface derivative(const LocalFunction& t)
│ │ │ -
151 {
│ │ │ -
152 DUNE_THROW(NotImplemented,"not implemented");
│ │ │ -
153 }
│ │ │ -
154
│ │ │ -
155 private:
│ │ │ -
156 std::optional<Geometry> geometry_;
│ │ │ -
157 Element element_;
│ │ │ -
158 };
│ │ │ -
159
│ │ │ -
160public:
│ │ │ -
│ │ │ - │ │ │ -
163 entitySet_(gridView)
│ │ │ -
164 {}
│ │ │ -
│ │ │ -
165
│ │ │ -
│ │ │ -
167 Range operator()(const Domain& x) const
│ │ │ -
168 {
│ │ │ -
169 DUNE_THROW(NotImplemented,"not implemented");
│ │ │ -
170 }
│ │ │ -
│ │ │ -
171
│ │ │ -
│ │ │ -
173 friend typename Traits::DerivativeInterface derivative(const FaceNormalGridFunction& t)
│ │ │ -
174 {
│ │ │ -
175 DUNE_THROW(NotImplemented,"not implemented");
│ │ │ -
176 }
│ │ │ -
│ │ │ -
177
│ │ │ -
│ │ │ -
179 friend LocalFunction localFunction(const FaceNormalGridFunction& t)
│ │ │ -
180 {
│ │ │ -
181 return LocalFunction{};
│ │ │ -
182 }
│ │ │ -
│ │ │ -
183
│ │ │ -
│ │ │ -
185 const EntitySet& entitySet() const
│ │ │ -
186 {
│ │ │ -
187 return entitySet_;
│ │ │ -
188 }
│ │ │ -
│ │ │ -
189
│ │ │ -
190private:
│ │ │ -
191 EntitySet entitySet_;
│ │ │ -
192};
│ │ │ -
│ │ │ -
193
│ │ │ -
194
│ │ │ -
195
│ │ │ -
196} // namespace Dune::Functions
│ │ │ -
197
│ │ │ -
198#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH
│ │ │ - │ │ │ - │ │ │ +
76// Implementation of type erasure wrapper
│ │ │ +
77template<class Range, class Domain, class DerivativeInterface, class B>
│ │ │ +
78class DifferentiableFunctionWrapperImplementation< Range(Domain), DerivativeInterface, B> :
│ │ │ +
79 public B
│ │ │ +
80{
│ │ │ +
81public:
│ │ │ +
82
│ │ │ +
83 using B::B;
│ │ │ +
84 using Wrapped = typename B::Wrapped;
│ │ │ +
85
│ │ │ +
86 virtual Range operator() (const Domain& x) const
│ │ │ +
87 {
│ │ │ +
88 return this->get()(x);
│ │ │ +
89 }
│ │ │ +
90
│ │ │ +
91 virtual DerivativeInterface derivative() const
│ │ │ +
92 {
│ │ │ +
93 return derivativeIfImplemented<DerivativeInterface, Wrapped>(this->get());
│ │ │ +
94 }
│ │ │ +
95};
│ │ │ +
96
│ │ │ +
97
│ │ │ +
98
│ │ │ +
99}}} // namespace Dune::Functions::Imp
│ │ │ +
100
│ │ │ +
101
│ │ │ +
102
│ │ │ +
103#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH
│ │ │ + │ │ │ +
TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
Obtain derivative of TrigonometricFunction function.
Definition trigonometricfunction.hh:43
│ │ │ +
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:41
│ │ │ -
GridViewEntitySet< GridView, 0 > EntitySet
Definition facenormalgridfunction.hh:73
│ │ │ -
typename EntitySet::LocalCoordinate LocalDomain
Definition facenormalgridfunction.hh:76
│ │ │ -
typename EntitySet::GlobalCoordinate Domain
Definition facenormalgridfunction.hh:77
│ │ │ -
typename EntitySet::GlobalCoordinate Range
Definition facenormalgridfunction.hh:78
│ │ │ -
const EntitySet & entitySet() const
Return the stored GridViewEntitySet.
Definition facenormalgridfunction.hh:185
│ │ │ -
friend Traits::DerivativeInterface derivative(const FaceNormalGridFunction &t)
Not implemented.
Definition facenormalgridfunction.hh:173
│ │ │ -
GV GridView
Definition facenormalgridfunction.hh:72
│ │ │ -
friend LocalFunction localFunction(const FaceNormalGridFunction &t)
Return a local-function associated to FaceNormalGridFunction.
Definition facenormalgridfunction.hh:179
│ │ │ -
FaceNormalGridFunction(const GridView &gridView)
Construct the FaceNormalGridFunction.
Definition facenormalgridfunction.hh:162
│ │ │ -
typename EntitySet::Element Element
Definition facenormalgridfunction.hh:74
│ │ │ -
Range operator()(const Domain &x) const
Not implemented.
Definition facenormalgridfunction.hh:167
│ │ │ -
An entity set for all entities of given codim in a grid view.
Definition gridviewentityset.hh:27
│ │ │ -
GridView::template Codim< codim >::Entity Element
Definition gridviewentityset.hh:36
│ │ │ -
Element::Geometry::LocalCoordinate LocalCoordinate
Definition gridviewentityset.hh:39
│ │ │ -
Element::Geometry::GlobalCoordinate GlobalCoordinate
Definition gridviewentityset.hh:40
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,230 +1,126 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -facenormalgridfunction.hh │ │ │ │ +differentiablefunction_imp.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH │ │ │ │ -8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH │ │ │ │ +8#define DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ 12 │ │ │ │ -13#include │ │ │ │ -14#include │ │ │ │ -15#include │ │ │ │ -16#include │ │ │ │ -17 │ │ │ │ -18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ -19#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h> │ │ │ │ -20 │ │ │ │ -21 │ │ │ │ -22namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ -23 │ │ │ │ -24namespace Impl { │ │ │ │ -25 │ │ │ │ -26// Compute closest face to point │ │ │ │ -27template │ │ │ │ -28auto closestFaceIndex(const ReferenceElement& re, const Coordinate& x) │ │ │ │ -29{ │ │ │ │ -30 auto closestFaceIndex = decltype(re.subEntity(0,1,0,1)){}; │ │ │ │ -31 double closestFaceDistance = std::numeric_limits::max(); │ │ │ │ -32 for(auto&& faceIndex : Dune::range(re.size(1))) │ │ │ │ -33 { │ │ │ │ -34 // For a face unit outer normal consider the orthogonal projection │ │ │ │ -35 // Px = x + *n into the face. Then the distance to the face │ │ │ │ -36 // is given by |x-Px| = |||n| = . │ │ │ │ -37 auto normal = re.integrationOuterNormal(faceIndex); │ │ │ │ -38 normal /= normal.two_norm(); │ │ │ │ -39 auto c = re.position(faceIndex,1); │ │ │ │ -40 c -= x; │ │ │ │ -41 auto faceDistance = (c*normal); │ │ │ │ -42 if (faceDistance │ │ │ │ +14 │ │ │ │ +15 │ │ │ │ +16namespace _D_u_n_e { │ │ │ │ +17namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +18namespace Imp { │ │ │ │ +19 │ │ │ │ +23struct HasFreeDerivative │ │ │ │ +24{ │ │ │ │ +25 template │ │ │ │ +26 auto require(F&& f) -> decltype( │ │ │ │ +27 _d_e_r_i_v_a_t_i_v_e(f) │ │ │ │ +28 ); │ │ │ │ +29}; │ │ │ │ +30 │ │ │ │ +31 │ │ │ │ +32 │ │ │ │ +33template() , int> = 0> │ │ │ │ +36auto derivativeIfImplemented(const F& f) -> decltype(_d_e_r_i_v_a_t_i_v_e(f)) │ │ │ │ +37{ │ │ │ │ +38 return _d_e_r_i_v_a_t_i_v_e(f); │ │ │ │ +39} │ │ │ │ +40 │ │ │ │ +41 │ │ │ │ +42 │ │ │ │ +43template()) , int> = 0> │ │ │ │ +46Dummy derivativeIfImplemented(const F& f) │ │ │ │ +47{ │ │ │ │ +48 DUNE_THROW(Dune::NotImplemented, "Derivative not implemented"); │ │ │ │ 49} │ │ │ │ 50 │ │ │ │ -51} // end namespace Impl │ │ │ │ +51 │ │ │ │ 52 │ │ │ │ -53 │ │ │ │ -54 │ │ │ │ -55 │ │ │ │ -68template │ │ │ │ -_6_9class _F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ -70{ │ │ │ │ -71public: │ │ │ │ -_7_2 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ -_7_3 using _E_n_t_i_t_y_S_e_t = _G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_G_r_i_d_V_i_e_w_,_ _0_>; │ │ │ │ -_7_4 using _E_l_e_m_e_n_t = typename _E_n_t_i_t_y_S_e_t_:_:_E_l_e_m_e_n_t; │ │ │ │ +53template │ │ │ │ +54class DifferentiableFunctionWrapperInterface │ │ │ │ +55{}; │ │ │ │ +56 │ │ │ │ +57// Interface of type erasure wrapper │ │ │ │ +58// │ │ │ │ +59// Notice that the basic interface of polymorphic classes (destructor, clone, │ │ │ │ +...) │ │ │ │ +60// will be added by the type erasure foundation classes. │ │ │ │ +61template │ │ │ │ +62class DifferentiableFunctionWrapperInterface │ │ │ │ +63{ │ │ │ │ +64public: │ │ │ │ +65 virtual Range operator() (const Domain& x) const = 0; │ │ │ │ +66 │ │ │ │ +67 virtual DerivativeInterface _d_e_r_i_v_a_t_i_v_e() const = 0; │ │ │ │ +68}; │ │ │ │ +69 │ │ │ │ +70 │ │ │ │ +71 │ │ │ │ +72template │ │ │ │ +73class DifferentiableFunctionWrapperImplementation │ │ │ │ +74{}; │ │ │ │ 75 │ │ │ │ -_7_6 using _L_o_c_a_l_D_o_m_a_i_n = typename _E_n_t_i_t_y_S_e_t_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e; │ │ │ │ -_7_7 using _D_o_m_a_i_n = typename _E_n_t_i_t_y_S_e_t_:_:_G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e; │ │ │ │ -_7_8 using _R_a_n_g_e = typename _E_n_t_i_t_y_S_e_t_:_:_G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e; │ │ │ │ -79 │ │ │ │ -80private: │ │ │ │ -81 │ │ │ │ -82 using Traits = Imp::GridFunctionTraits<_R_a_n_g_e(_D_o_m_a_i_n), _E_n_t_i_t_y_S_e_t, │ │ │ │ -_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s, 16>; │ │ │ │ -83 │ │ │ │ -84 class LocalFunction │ │ │ │ -85 { │ │ │ │ -86 using Geometry = typename Element::Geometry; │ │ │ │ -87 static const int dimension = GV::dimension; │ │ │ │ -88 public: │ │ │ │ -89 │ │ │ │ -101 void bind(const _E_l_e_m_e_n_t& element) │ │ │ │ -102 { │ │ │ │ -103 element_ = element; │ │ │ │ -104 geometry_.emplace(element_.geometry()); │ │ │ │ -105 } │ │ │ │ -106 │ │ │ │ -107 void unbind() │ │ │ │ -108 { │ │ │ │ -109 geometry_.reset(); │ │ │ │ -110 } │ │ │ │ -111 │ │ │ │ -114 bool bound() const │ │ │ │ -115 { │ │ │ │ -116 return static_cast(geometry_); │ │ │ │ -117 } │ │ │ │ -118 │ │ │ │ -128 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(const _L_o_c_a_l_D_o_m_a_i_n& x) const │ │ │ │ -129 { │ │ │ │ -130 auto&& re = Dune::referenceElement(*geometry_); │ │ │ │ -131 // Compute reference normal of closest face to given point │ │ │ │ -132 auto face = Impl::closestFaceIndex(re, x); │ │ │ │ -133 auto localNormal = re.integrationOuterNormal(face); │ │ │ │ -134 │ │ │ │ -135 // Transform reference normal into global unit outer normal using │ │ │ │ -136 // covariant Piola transformation │ │ │ │ -137 auto normal = _R_a_n_g_e{}; │ │ │ │ -138 geometry_->jacobianInverseTransposed(x).mv(localNormal, normal); │ │ │ │ -139 normal /= normal.two_norm(); │ │ │ │ -140 return normal; │ │ │ │ -141 } │ │ │ │ -142 │ │ │ │ -144 const _E_l_e_m_e_n_t& localContext() const │ │ │ │ -145 { │ │ │ │ -146 return element_; │ │ │ │ -147 } │ │ │ │ -148 │ │ │ │ -150 friend typename Traits::LocalFunctionTraits::DerivativeInterface _d_e_r_i_v_a_t_i_v_e │ │ │ │ -(const LocalFunction& t) │ │ │ │ -151 { │ │ │ │ -152 DUNE_THROW(NotImplemented,"not implemented"); │ │ │ │ -153 } │ │ │ │ -154 │ │ │ │ -155 private: │ │ │ │ -156 std::optional geometry_; │ │ │ │ -157 _E_l_e_m_e_n_t element_; │ │ │ │ -158 }; │ │ │ │ -159 │ │ │ │ -160public: │ │ │ │ -_1_6_2 _F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n(const _G_r_i_d_V_i_e_w& gridView) : │ │ │ │ -163 entitySet_(gridView) │ │ │ │ -164 {} │ │ │ │ -165 │ │ │ │ -_1_6_7 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(const _D_o_m_a_i_n& x) const │ │ │ │ -168 { │ │ │ │ -169 DUNE_THROW(NotImplemented,"not implemented"); │ │ │ │ -170 } │ │ │ │ -171 │ │ │ │ -_1_7_3 friend typename Traits::DerivativeInterface _d_e_r_i_v_a_t_i_v_e(const │ │ │ │ -_F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n& t) │ │ │ │ -174 { │ │ │ │ -175 DUNE_THROW(NotImplemented,"not implemented"); │ │ │ │ -176 } │ │ │ │ -177 │ │ │ │ -_1_7_9 friend LocalFunction _l_o_c_a_l_F_u_n_c_t_i_o_n(const _F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n& t) │ │ │ │ -180 { │ │ │ │ -181 return LocalFunction{}; │ │ │ │ -182 } │ │ │ │ -183 │ │ │ │ -_1_8_5 const _E_n_t_i_t_y_S_e_t& _e_n_t_i_t_y_S_e_t() const │ │ │ │ -186 { │ │ │ │ -187 return entitySet_; │ │ │ │ -188 } │ │ │ │ -189 │ │ │ │ -190private: │ │ │ │ -191 _E_n_t_i_t_y_S_e_t entitySet_; │ │ │ │ -192}; │ │ │ │ -193 │ │ │ │ -194 │ │ │ │ -195 │ │ │ │ -196} // namespace Dune::Functions │ │ │ │ -197 │ │ │ │ -198#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH │ │ │ │ -_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h │ │ │ │ -_g_r_i_d_f_u_n_c_t_i_o_n_._h_h │ │ │ │ +76// Implementation of type erasure wrapper │ │ │ │ +77template │ │ │ │ +78class DifferentiableFunctionWrapperImplementation< Range(Domain), │ │ │ │ +DerivativeInterface, B> : │ │ │ │ +79 public B │ │ │ │ +80{ │ │ │ │ +81public: │ │ │ │ +82 │ │ │ │ +83 using B::B; │ │ │ │ +84 using Wrapped = typename B::Wrapped; │ │ │ │ +85 │ │ │ │ +86 virtual Range operator() (const Domain& x) const │ │ │ │ +87 { │ │ │ │ +88 return this->get()(x); │ │ │ │ +89 } │ │ │ │ +90 │ │ │ │ +91 virtual DerivativeInterface _d_e_r_i_v_a_t_i_v_e() const │ │ │ │ +92 { │ │ │ │ +93 return derivativeIfImplemented(this->get()); │ │ │ │ +94 } │ │ │ │ +95}; │ │ │ │ +96 │ │ │ │ +97 │ │ │ │ +98 │ │ │ │ +99}}} // namespace Dune::Functions::Imp │ │ │ │ +100 │ │ │ │ +101 │ │ │ │ +102 │ │ │ │ +103#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH │ │ │ │ +_t_y_p_e___t_r_a_i_t_s_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ +TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const │ │ │ │ +TrigonometricFunction< K, sinFactor, cosFactor > &f) │ │ │ │ +Obtain derivative of TrigonometricFunction function. │ │ │ │ +DDeeffiinniittiioonn trigonometricfunction.hh:43 │ │ │ │ +_D_u_n_e │ │ │ │ +DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ -Default implementation for derivative traits. │ │ │ │ -DDeeffiinniittiioonn defaultderivativetraits.hh:41 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n_:_:_E_n_t_i_t_y_S_e_t │ │ │ │ -GridViewEntitySet< GridView, 0 > EntitySet │ │ │ │ -DDeeffiinniittiioonn facenormalgridfunction.hh:73 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n_:_:_L_o_c_a_l_D_o_m_a_i_n │ │ │ │ -typename EntitySet::LocalCoordinate LocalDomain │ │ │ │ -DDeeffiinniittiioonn facenormalgridfunction.hh:76 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n_:_:_D_o_m_a_i_n │ │ │ │ -typename EntitySet::GlobalCoordinate Domain │ │ │ │ -DDeeffiinniittiioonn facenormalgridfunction.hh:77 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n_:_:_R_a_n_g_e │ │ │ │ -typename EntitySet::GlobalCoordinate Range │ │ │ │ -DDeeffiinniittiioonn facenormalgridfunction.hh:78 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n_:_:_e_n_t_i_t_y_S_e_t │ │ │ │ -const EntitySet & entitySet() const │ │ │ │ -Return the stored GridViewEntitySet. │ │ │ │ -DDeeffiinniittiioonn facenormalgridfunction.hh:185 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ -friend Traits::DerivativeInterface derivative(const FaceNormalGridFunction &t) │ │ │ │ -Not implemented. │ │ │ │ -DDeeffiinniittiioonn facenormalgridfunction.hh:173 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n_:_:_G_r_i_d_V_i_e_w │ │ │ │ -GV GridView │ │ │ │ -DDeeffiinniittiioonn facenormalgridfunction.hh:72 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n_:_:_l_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -friend LocalFunction localFunction(const FaceNormalGridFunction &t) │ │ │ │ -Return a local-function associated to FaceNormalGridFunction. │ │ │ │ -DDeeffiinniittiioonn facenormalgridfunction.hh:179 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n_:_:_F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ -FaceNormalGridFunction(const GridView &gridView) │ │ │ │ -Construct the FaceNormalGridFunction. │ │ │ │ -DDeeffiinniittiioonn facenormalgridfunction.hh:162 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n_:_:_E_l_e_m_e_n_t │ │ │ │ -typename EntitySet::Element Element │ │ │ │ -DDeeffiinniittiioonn facenormalgridfunction.hh:74 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ -Range operator()(const Domain &x) const │ │ │ │ -Not implemented. │ │ │ │ -DDeeffiinniittiioonn facenormalgridfunction.hh:167 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t │ │ │ │ -An entity set for all entities of given codim in a grid view. │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:27 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_E_l_e_m_e_n_t │ │ │ │ -GridView::template Codim< codim >::Entity Element │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:36 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ -Element::Geometry::LocalCoordinate LocalCoordinate │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:39 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ -Element::Geometry::GlobalCoordinate GlobalCoordinate │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:40 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_a_c_e_n_o_r_m_a_l_g_r_i_d_f_u_n_c_t_i_o_n_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n___i_m_p_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00062.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: discreteglobalbasisfunction.hh File Reference │ │ │ +Dune-Functions: type_traits.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,70 +88,62 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
discreteglobalbasisfunction.hh File Reference
│ │ │ +
type_traits.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <memory>
│ │ │ -#include <optional>
│ │ │ -#include <dune/common/typetraits.hh>
│ │ │ -#include <dune/common/shared_ptr.hh>
│ │ │ -#include <dune/grid/utility/hierarchicsearch.hh>
│ │ │ -#include <dune/common/typetree/traversal.hh>
│ │ │ -#include <dune/common/typetree/treecontainer.hh>
│ │ │ -#include <dune/functions/functionspacebases/hierarchicnodetorangemap.hh>
│ │ │ -#include <dune/functions/functionspacebases/flatvectorview.hh>
│ │ │ -#include <dune/functions/gridfunctions/gridviewentityset.hh>
│ │ │ -#include <dune/functions/gridfunctions/gridfunction.hh>
│ │ │ -#include <dune/functions/backends/concepts.hh>
│ │ │ -#include <dune/functions/backends/istlvectorbackend.hh>
│ │ │ +
#include <type_traits>
│ │ │ +#include <dune/common/hybridutilities.hh>
│ │ │ +#include <dune/common/typeutilities.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >
struct  Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >::Data
class  Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >::LocalFunctionBase
class  Dune::Functions::DiscreteGlobalBasisFunction< B, V, NTRE, R >
 A grid function induced by a global basis and a coefficient vector. More...
class  Dune::Functions::DiscreteGlobalBasisFunction< B, V, NTRE, R >::LocalFunction
class  Dune::Functions::DiscreteGlobalBasisFunctionDerivative< DGBF >
 Derivative of a DiscreteGlobalBasisFunction. More...
class  Dune::Functions::DiscreteGlobalBasisFunctionDerivative< DGBF >::LocalFunction
 local function evaluating the derivative in reference coordinates More...
struct  Dune::Functions::HasStaticSize< T >
 Check if type is a statically sized container. More...
struct  Dune::Functions::StaticSizeOrZero< T >
 Obtain size of statically sized container, or 0 if dynamic size. More...
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::ImplDoc
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +

│ │ │ -Functions

template<typename R, typename B, typename V>
auto Dune::Functions::makeDiscreteGlobalBasisFunction (B &&basis, V &&vector)
 Generate a DiscreteGlobalBasisFunction.

│ │ │ +Typedefs

template<class T, class... Args>
using Dune::Functions::enableIfConstructible
 Helper to constrain forwarding constructors.
template<class T>
using Dune::Functions::StaticSize
 Obtain size of statically sized container as integral_constant, or fail.
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ +Variables

template<class T>
constexpr bool Dune::Functions::HasStaticSize_v = HasStaticSize<T>::value
 A variable template representing the value of HasStaticSize.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,50 +1,34 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -discreteglobalbasisfunction.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_h_i_e_r_a_r_c_h_i_c_n_o_d_e_t_o_r_a_n_g_e_m_a_p_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_f_l_a_t_v_e_c_t_o_r_v_i_e_w_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_b_a_c_k_e_n_d_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_b_a_c_k_e_n_d_s_/_i_s_t_l_v_e_c_t_o_r_b_a_c_k_e_n_d_._h_h> │ │ │ │ +type_traits.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ - class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_<_ _B_,_ _V_,_ _N_T_R_E │ │ │ │ - _> │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_<_ _B_,_ _V_,_ _N_T_R_E │ │ │ │ - _>_:_:_D_a_t_a │ │ │ │ - class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_<_ _B_,_ _V_,_ _N_T_R_E │ │ │ │ - _>_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e │ │ │ │ - class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_<_ _B_,_ _V_,_ _N_T_R_E_,_ _R_ _> │ │ │ │ -  A grid function induced by a global basis and a coefficient vector. │ │ │ │ - _M_o_r_e_._._. │ │ │ │ - class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_<_ _B_,_ _V_,_ _N_T_R_E_,_ _R_ _>_:_: │ │ │ │ - _L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ - class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_<_ _D_G_B_F_ _> │ │ │ │ -  Derivative of a _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n. _M_o_r_e_._._. │ │ │ │ - class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_<_ _D_G_B_F_ _>_:_: │ │ │ │ - _L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -  local function evaluating the derivative in reference coordinates │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_a_s_S_t_a_t_i_c_S_i_z_e_<_ _T_ _> │ │ │ │ +  Check if type is a statically sized container. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_S_i_z_e_O_r_Z_e_r_o_<_ _T_ _> │ │ │ │ +  Obtain size of statically sized container, or 0 if dynamic size. │ │ │ │ _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c │ │ │ │ -FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n (B &&basis, V &&vector) │ │ │ │ -  Generate a _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n. │ │ │ │ +TTyyppeeddeeffss │ │ │ │ +template │ │ │ │ +using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_e_n_a_b_l_e_I_f_C_o_n_s_t_r_u_c_t_i_b_l_e │ │ │ │ +  Helper to constrain forwarding constructors. │ │ │ │ +template │ │ │ │ +using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_S_i_z_e │ │ │ │ +  Obtain size of statically sized container as integral_constant, or fail. │ │ │ │ +VVaarriiaabblleess │ │ │ │ +template │ │ │ │ +constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_a_s_S_t_a_t_i_c_S_i_z_e___v = _H_a_s_S_t_a_t_i_c_S_i_z_e::value │ │ │ │ +  A variable template representing the value of _H_a_s_S_t_a_t_i_c_S_i_z_e. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ - * _d_i_s_c_r_e_t_e_g_l_o_b_a_l_b_a_s_i_s_f_u_n_c_t_i_o_n_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _t_y_p_e___t_r_a_i_t_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00062.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,8 +1,5 @@ │ │ │ │ var a00062 = [ │ │ │ │ - ["Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >", "a02210.html", "a02210"], │ │ │ │ - ["Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >::Data", "a02214.html", "a02214"], │ │ │ │ - ["Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >::LocalFunctionBase", "a02218.html", "a02218"], │ │ │ │ - ["Dune::Functions::DiscreteGlobalBasisFunction< B, V, NTRE, R >::LocalFunction", "a02230.html", "a02230"], │ │ │ │ - ["Dune::Functions::DiscreteGlobalBasisFunctionDerivative< DGBF >::LocalFunction", "a02234.html", "a02234"], │ │ │ │ - ["Dune::Functions::makeDiscreteGlobalBasisFunction", "a00308.html#ga9f1a8d6ac1558adad6150feb9b4e3168", null] │ │ │ │ + ["Dune::Functions::enableIfConstructible", "a00314.html#gae56cc95e9c26568861b3fddae9983080", null], │ │ │ │ + ["Dune::Functions::StaticSize", "a00314.html#ga3e9a8b5a2dac8ad92d9000f0e7187ba4", null], │ │ │ │ + ["Dune::Functions::HasStaticSize_v", "a00318.html#a2af05857c767d4f5ef189624a63d5861", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00062_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: discreteglobalbasisfunction.hh Source File │ │ │ +Dune-Functions: type_traits.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,704 +88,81 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
discreteglobalbasisfunction.hh
│ │ │ +
type_traits.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH
│ │ │ -
8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH
│ │ │ +
8#define DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH
│ │ │
9
│ │ │ -
10#include <memory>
│ │ │ -
11#include <optional>
│ │ │ -
12
│ │ │ -
13#include <dune/common/typetraits.hh>
│ │ │ -
14#include <dune/common/shared_ptr.hh>
│ │ │ -
15
│ │ │ -
16#include <dune/grid/utility/hierarchicsearch.hh>
│ │ │ +
10#include <type_traits>
│ │ │ +
11
│ │ │ +
12#include <dune/common/hybridutilities.hh>
│ │ │ +
13#include <dune/common/typeutilities.hh>
│ │ │ +
14
│ │ │ +
15namespace Dune {
│ │ │ +
16namespace Functions {
│ │ │
17
│ │ │ -
18#include <dune/common/typetree/traversal.hh>
│ │ │ -
19#include <dune/common/typetree/treecontainer.hh>
│ │ │ -
20
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
27
│ │ │ -
28namespace Dune {
│ │ │ -
29namespace Functions {
│ │ │ -
30
│ │ │ -
31
│ │ │ -
│ │ │ -
32namespace ImplDoc {
│ │ │ +
18
│ │ │ +
29template<class T, class... Args>
│ │ │ +
30using enableIfConstructible = std::enable_if_t<
│ │ │ +
31 std::is_constructible_v<T, Args...>, int>;
│ │ │ +
32
│ │ │
33
│ │ │ -
34template<typename B, typename V, typename NTRE>
│ │ │ -
│ │ │ - │ │ │ -
36{
│ │ │ -
37public:
│ │ │ -
38 using Basis = B;
│ │ │ -
39 using Vector = V;
│ │ │ -
40
│ │ │ -
41 // In order to make the cache work for proxy-references
│ │ │ -
42 // we have to use AutonomousValue<T> instead of std::decay_t<T>
│ │ │ -
43 using Coefficient = Dune::AutonomousValue<decltype(std::declval<Vector>()[std::declval<typename Basis::MultiIndex>()])>;
│ │ │ -
44
│ │ │ -
45 using GridView = typename Basis::GridView;
│ │ │ - │ │ │ -
47 using Tree = typename Basis::LocalView::Tree;
│ │ │ -
48 using NodeToRangeEntry = NTRE;
│ │ │ -
49
│ │ │ - │ │ │ -
51
│ │ │ - │ │ │ -
53 using Element = typename EntitySet::Element;
│ │ │ -
54
│ │ │ -
55protected:
│ │ │ -
56
│ │ │ -
57 // This collects all data that is shared by all related
│ │ │ -
58 // global and local functions. This way we don't need to
│ │ │ -
59 // keep track of it individually.
│ │ │ +
34
│ │ │ +
42template<class T>
│ │ │ +
│ │ │ + │ │ │ +
44 public IsIntegralConstant<decltype(Dune::Hybrid::size(std::declval<T>()))>
│ │ │ +
45{};
│ │ │ +
│ │ │ +
46
│ │ │ +
48template<class T>
│ │ │ + │ │ │ +
50
│ │ │ +
51
│ │ │ +
59template<class T>
│ │ │
│ │ │ -
60 struct Data
│ │ │ -
61 {
│ │ │ - │ │ │ -
63 std::shared_ptr<const Basis> basis;
│ │ │ -
64 std::shared_ptr<const Vector> coefficients;
│ │ │ -
65 std::shared_ptr<const NodeToRangeEntry> nodeToRangeEntry;
│ │ │ -
66 };
│ │ │ -
│ │ │ -
67
│ │ │ -
68public:
│ │ │ -
│ │ │ - │ │ │ -
70 {
│ │ │ -
71 using LocalView = typename Basis::LocalView;
│ │ │ -
72 using size_type = typename Tree::size_type;
│ │ │ + │ │ │ +
61 public std::conditional_t<HasStaticSize_v<T>,
│ │ │ +
62 decltype(Dune::Hybrid::size(std::declval<T>())),
│ │ │ +
63 std::integral_constant<std::size_t,0>>
│ │ │ +
64{};
│ │ │ +
│ │ │ +
65
│ │ │ +
70template<class T>
│ │ │ +
71using StaticSize = std::enable_if_t<HasStaticSize_v<T>,
│ │ │ +
72 decltype(Dune::Hybrid::size(std::declval<T>()))>;
│ │ │
73
│ │ │ -
74 public:
│ │ │ - │ │ │ -
76 using Element = typename EntitySet::Element;
│ │ │ -
77
│ │ │ -
78 protected:
│ │ │ -
│ │ │ -
79 LocalFunctionBase(const std::shared_ptr<const Data>& data)
│ │ │ -
80 : data_(data)
│ │ │ -
81 , localView_(data_->basis->localView())
│ │ │ -
82 {
│ │ │ -
83 localDoFs_.reserve(localView_.maxSize());
│ │ │ -
84 }
│ │ │ -
│ │ │ -
85
│ │ │ -
│ │ │ - │ │ │ -
93 : data_(other.data_)
│ │ │ -
94 , localView_(other.localView_)
│ │ │ -
95 {
│ │ │ -
96 localDoFs_.reserve(localView_.maxSize());
│ │ │ -
97 if (bound())
│ │ │ -
98 localDoFs_ = other.localDoFs_;
│ │ │ -
99 }
│ │ │ -
│ │ │ -
100
│ │ │ -
│ │ │ - │ │ │ -
109 {
│ │ │ -
110 data_ = other.data_;
│ │ │ -
111 localView_ = other.localView_;
│ │ │ -
112 if (bound())
│ │ │ -
113 localDoFs_ = other.localDoFs_;
│ │ │ -
114 return *this;
│ │ │ -
115 }
│ │ │ -
│ │ │ -
116
│ │ │ -
117 public:
│ │ │ -
│ │ │ -
124 void bind(const Element& element)
│ │ │ -
125 {
│ │ │ -
126 localView_.bind(element);
│ │ │ -
127 // Use cache of full local view size. For a subspace basis,
│ │ │ -
128 // this may be larger than the number of local DOFs in the
│ │ │ -
129 // tree. In this case only cache entries associated to local
│ │ │ -
130 // DOFs in the subspace are filled. Cache entries associated
│ │ │ -
131 // to local DOFs which are not contained in the subspace will
│ │ │ -
132 // not be touched.
│ │ │ -
133 //
│ │ │ -
134 // Alternatively one could use a cache that exactly fits
│ │ │ -
135 // the size of the tree. However, this would require to
│ │ │ -
136 // subtract an offset from localIndex(i) on each cache
│ │ │ -
137 // access in operator().
│ │ │ -
138 localDoFs_.resize(localView_.size());
│ │ │ -
139 const auto& dofs = *data_->coefficients;
│ │ │ -
140 for (size_type i = 0; i < localView_.tree().size(); ++i)
│ │ │ -
141 {
│ │ │ -
142 // For a subspace basis the index-within-tree i
│ │ │ -
143 // is not the same as the localIndex within the
│ │ │ -
144 // full local view.
│ │ │ -
145 size_t localIndex = localView_.tree().localIndex(i);
│ │ │ -
146 localDoFs_[localIndex] = dofs[localView_.index(localIndex)];
│ │ │ -
147 }
│ │ │ -
148 }
│ │ │ -
│ │ │ -
149
│ │ │ -
│ │ │ -
151 void unbind()
│ │ │ -
152 {
│ │ │ -
153 localView_.unbind();
│ │ │ -
154 }
│ │ │ -
│ │ │ -
155
│ │ │ -
│ │ │ -
157 bool bound() const
│ │ │ -
158 {
│ │ │ -
159 return localView_.bound();
│ │ │ -
160 }
│ │ │ -
│ │ │ -
161
│ │ │ -
│ │ │ -
163 const Element& localContext() const
│ │ │ -
164 {
│ │ │ -
165 return localView_.element();
│ │ │ -
166 }
│ │ │ -
│ │ │ -
167
│ │ │ -
168 protected:
│ │ │ -
169
│ │ │ -
170 template<class To, class From>
│ │ │ -
│ │ │ -
171 void assignWith(To& to, const From& from) const
│ │ │ -
172 {
│ │ │ -
173 auto from_flat = flatVectorView(from);
│ │ │ -
174 auto to_flat = flatVectorView(to);
│ │ │ -
175 assert(from_flat.size() == to_flat.size());
│ │ │ -
176 for (size_type i = 0; i < to_flat.size(); ++i)
│ │ │ -
177 to_flat[i] = from_flat[i];
│ │ │ -
178 }
│ │ │ -
│ │ │ -
179
│ │ │ -
180 template<class Node, class TreePath, class Range>
│ │ │ -
│ │ │ -
181 decltype(auto) nodeToRangeEntry(const Node& node, const TreePath& treePath, Range& y) const
│ │ │ -
182 {
│ │ │ -
183 return (*data_->nodeToRangeEntry)(node, treePath, y);
│ │ │ -
184 }
│ │ │ -
│ │ │ -
185
│ │ │ -
186 std::shared_ptr<const Data> data_;
│ │ │ -
187 LocalView localView_;
│ │ │ -
188 std::vector<Coefficient> localDoFs_;
│ │ │ -
189 };
│ │ │ -
│ │ │ -
190
│ │ │ -
191protected:
│ │ │ -
│ │ │ -
192 DiscreteGlobalBasisFunctionBase(const std::shared_ptr<const Data>& data)
│ │ │ -
193 : data_(data)
│ │ │ -
194 {
│ │ │ -
195 /* Nothing. */
│ │ │ -
196 }
│ │ │ -
│ │ │ -
197
│ │ │ -
198public:
│ │ │ -
199
│ │ │ -
│ │ │ -
201 const Basis& basis() const
│ │ │ -
202 {
│ │ │ -
203 return *data_->basis;
│ │ │ -
204 }
│ │ │ -
│ │ │ -
205
│ │ │ -
│ │ │ -
207 const Vector& dofs() const
│ │ │ -
208 {
│ │ │ -
209 return *data_->coefficients;
│ │ │ -
210 }
│ │ │ -
│ │ │ -
211
│ │ │ -
│ │ │ - │ │ │ -
214 {
│ │ │ -
215 return *data_->nodeToRangeEntry;
│ │ │ -
216 }
│ │ │ -
│ │ │ -
217
│ │ │ -
│ │ │ -
219 const EntitySet& entitySet() const
│ │ │ -
220 {
│ │ │ -
221 return data_->entitySet;
│ │ │ -
222 }
│ │ │ -
│ │ │ -
223
│ │ │ -
224protected:
│ │ │ -
225 std::shared_ptr<const Data> data_;
│ │ │ -
226};
│ │ │ -
│ │ │ -
227
│ │ │ -
228} // namespace ImplDoc
│ │ │ -
│ │ │ -
229
│ │ │ -
230
│ │ │ -
231
│ │ │ -
232template<typename DGBF>
│ │ │ - │ │ │ -
234
│ │ │ -
278template<typename B, typename V,
│ │ │ -
279 typename NTRE = HierarchicNodeToRangeMap,
│ │ │ -
280 typename R = typename V::value_type>
│ │ │ -
│ │ │ - │ │ │ - │ │ │ -
283{
│ │ │ - │ │ │ -
285 using Data = typename Base::Data;
│ │ │ -
286
│ │ │ -
287public:
│ │ │ -
288 using Basis = typename Base::Basis;
│ │ │ -
289 using Vector = typename Base::Vector;
│ │ │ -
290
│ │ │ -
291 using Domain = typename Base::Domain;
│ │ │ -
292 using Range = R;
│ │ │ -
293
│ │ │ -
294 using Traits = Imp::GridFunctionTraits<Range(Domain), typename Base::EntitySet, DefaultDerivativeTraits, 16>;
│ │ │ -
295
│ │ │ -
296private:
│ │ │ -
297
│ │ │ -
298 template<class Node>
│ │ │ -
299 using LocalBasisRange = typename Node::FiniteElement::Traits::LocalBasisType::Traits::RangeType;
│ │ │ -
300 template<class Node>
│ │ │ -
301 using NodeData = typename std::vector<LocalBasisRange<Node>>;
│ │ │ -
302 using PerNodeEvaluationBuffer = typename TypeTree::TreeContainer<NodeData, typename Base::Tree>;
│ │ │ -
303
│ │ │ -
304public:
│ │ │ -
│ │ │ - │ │ │ - │ │ │ -
307 {
│ │ │ -
308 using LocalBase = typename Base::LocalFunctionBase;
│ │ │ -
309 using size_type = typename Base::Tree::size_type;
│ │ │ -
310 using LocalBase::nodeToRangeEntry;
│ │ │ -
311
│ │ │ -
312 public:
│ │ │ -
313
│ │ │ - │ │ │ -
315 using Domain = typename LocalBase::Domain;
│ │ │ - │ │ │ -
317 using Element = typename LocalBase::Element;
│ │ │ -
318
│ │ │ -
│ │ │ - │ │ │ -
321 : LocalBase(globalFunction.data_)
│ │ │ -
322 , evaluationBuffer_(this->localView_.tree())
│ │ │ -
323 {
│ │ │ -
324 /* Nothing. */
│ │ │ -
325 }
│ │ │ -
│ │ │ -
326
│ │ │ -
│ │ │ -
336 Range operator()(const Domain& x) const
│ │ │ -
337 {
│ │ │ -
338 Range y;
│ │ │ -
339 istlVectorBackend(y) = 0;
│ │ │ -
340
│ │ │ -
341 TypeTree::forEachLeafNode(this->localView_.tree(), [&](auto&& node, auto&& treePath) {
│ │ │ -
342 if (node.empty())
│ │ │ -
343 return;
│ │ │ -
344 const auto& fe = node.finiteElement();
│ │ │ -
345 const auto& localBasis = fe.localBasis();
│ │ │ -
346 auto& shapeFunctionValues = evaluationBuffer_[treePath];
│ │ │ -
347
│ │ │ -
348 localBasis.evaluateFunction(x, shapeFunctionValues);
│ │ │ -
349
│ │ │ -
350 // Compute linear combinations of basis function jacobian.
│ │ │ -
351 // Non-scalar coefficients of dimension coeffDim are handled by
│ │ │ -
352 // processing the coeffDim linear combinations independently
│ │ │ -
353 // and storing them as entries of an array.
│ │ │ -
354 using Value = LocalBasisRange< std::decay_t<decltype(node)> >;
│ │ │ -
355 static constexpr auto coeffDim = decltype(flatVectorView(this->localDoFs_[node.localIndex(0)]).size())::value;
│ │ │ -
356 auto values = std::array<Value, coeffDim>{};
│ │ │ -
357 istlVectorBackend(values) = 0;
│ │ │ -
358 for (size_type i = 0; i < localBasis.size(); ++i)
│ │ │ -
359 {
│ │ │ -
360 auto c = flatVectorView(this->localDoFs_[node.localIndex(i)]);
│ │ │ -
361 for (std::size_t j = 0; j < coeffDim; ++j)
│ │ │ -
362 values[j].axpy(c[j], shapeFunctionValues[i]);
│ │ │ -
363 }
│ │ │ -
364
│ │ │ -
365 // Assign computed values to node entry of range.
│ │ │ -
366 // Types are matched using the lexicographic ordering provided by flatVectorView.
│ │ │ -
367 LocalBase::assignWith(nodeToRangeEntry(node, treePath, y), values);
│ │ │ -
368 });
│ │ │ -
369
│ │ │ -
370 return y;
│ │ │ -
371 }
│ │ │ -
│ │ │ -
372
│ │ │ -
│ │ │ - │ │ │ -
375 {
│ │ │ - │ │ │ -
377 if (lf.bound())
│ │ │ -
378 dlf.bind(lf.localContext());
│ │ │ -
379 return dlf;
│ │ │ -
380 }
│ │ │ -
│ │ │ -
381
│ │ │ -
382 private:
│ │ │ -
383 mutable PerNodeEvaluationBuffer evaluationBuffer_;
│ │ │ -
384 };
│ │ │ -
│ │ │ -
385
│ │ │ -
387 template<class B_T, class V_T, class NTRE_T>
│ │ │ -
│ │ │ -
388 DiscreteGlobalBasisFunction(B_T && basis, V_T && coefficients, NTRE_T&& nodeToRangeEntry)
│ │ │ -
389 : Base(std::make_shared<Data>(Data{{basis.gridView()}, wrap_or_move(std::forward<B_T>(basis)), wrap_or_move(std::forward<V_T>(coefficients)), wrap_or_move(std::forward<NTRE_T>(nodeToRangeEntry))}))
│ │ │ -
390 {}
│ │ │ -
│ │ │ -
391
│ │ │ -
│ │ │ -
393 DiscreteGlobalBasisFunction(std::shared_ptr<const Basis> basis, std::shared_ptr<const V> coefficients, std::shared_ptr<const typename Base::NodeToRangeEntry> nodeToRangeEntry)
│ │ │ -
394 : Base(std::make_shared<Data>(Data{{basis->gridView()}, basis, coefficients, nodeToRangeEntry}))
│ │ │ -
395 {}
│ │ │ -
│ │ │ -
396
│ │ │ -
│ │ │ -
402 Range operator() (const Domain& x) const
│ │ │ -
403 {
│ │ │ -
404 HierarchicSearch search(this->data_->basis->gridView().grid(), this->data_->basis->gridView().indexSet());
│ │ │ -
405
│ │ │ -
406 const auto e = search.findEntity(x);
│ │ │ -
407 auto localThis = localFunction(*this);
│ │ │ -
408 localThis.bind(e);
│ │ │ -
409 return localThis(e.geometry().local(x));
│ │ │ -
410 }
│ │ │ -
│ │ │ -
411
│ │ │ -
│ │ │ - │ │ │ -
414 {
│ │ │ - │ │ │ -
416 }
│ │ │ -
│ │ │ -
417
│ │ │ -
│ │ │ - │ │ │ -
427 {
│ │ │ -
428 return LocalFunction(t);
│ │ │ -
429 }
│ │ │ -
│ │ │ -
430};
│ │ │ -
│ │ │ -
431
│ │ │ -
432
│ │ │ -
457template<typename R, typename B, typename V>
│ │ │ -
│ │ │ - │ │ │ -
459{
│ │ │ -
460 using Basis = std::decay_t<B>;
│ │ │ -
461 using NTREM = HierarchicNodeToRangeMap;
│ │ │ -
462
│ │ │ -
463 // Small helper functions to wrap vectors using istlVectorBackend
│ │ │ -
464 // if they do not already satisfy the VectorBackend interface.
│ │ │ -
465 auto toConstVectorBackend = [&](auto&& v) -> decltype(auto) {
│ │ │ -
466 if constexpr (models<Concept::ConstVectorBackend<Basis>, decltype(v)>()) {
│ │ │ -
467 return std::forward<decltype(v)>(v);
│ │ │ -
468 } else {
│ │ │ -
469 return istlVectorBackend(v);
│ │ │ -
470 }
│ │ │ -
471 };
│ │ │ -
472
│ │ │ -
473 using Vector = std::decay_t<decltype(toConstVectorBackend(std::forward<V>(vector)))>;
│ │ │ - │ │ │ -
475 std::forward<B>(basis),
│ │ │ -
476 toConstVectorBackend(std::forward<V>(vector)),
│ │ │ - │ │ │ -
478}
│ │ │ -
│ │ │ -
479
│ │ │ -
480
│ │ │ -
495template<typename DGBF>
│ │ │ -
│ │ │ - │ │ │ -
497 : public ImplDoc::DiscreteGlobalBasisFunctionBase<typename DGBF::Basis, typename DGBF::Vector, typename DGBF::NodeToRangeEntry>
│ │ │ -
498{
│ │ │ - │ │ │ -
500 using Data = typename Base::Data;
│ │ │ -
501
│ │ │ -
502public:
│ │ │ - │ │ │ -
504
│ │ │ -
505 using Basis = typename Base::Basis;
│ │ │ -
506 using Vector = typename Base::Vector;
│ │ │ -
507
│ │ │ -
508 using Domain = typename Base::Domain;
│ │ │ - │ │ │ -
510
│ │ │ -
511 using Traits = Imp::GridFunctionTraits<Range(Domain), typename Base::EntitySet, DefaultDerivativeTraits, 16>;
│ │ │ -
512
│ │ │ -
513private:
│ │ │ -
514
│ │ │ -
515 template<class Node>
│ │ │ -
516 using LocalBasisRange = typename Node::FiniteElement::Traits::LocalBasisType::Traits::JacobianType;
│ │ │ -
517 template<class Node>
│ │ │ -
518 using NodeData = typename std::vector< LocalBasisRange<Node> >;
│ │ │ -
519 using PerNodeEvaluationBuffer = typename TypeTree::TreeContainer<NodeData, typename Base::Tree>;
│ │ │ -
520
│ │ │ -
521public:
│ │ │ -
522
│ │ │ -
│ │ │ - │ │ │ -
531 : public Base::LocalFunctionBase
│ │ │ -
532 {
│ │ │ -
533 using LocalBase = typename Base::LocalFunctionBase;
│ │ │ -
534 using size_type = typename Base::Tree::size_type;
│ │ │ -
535 using LocalBase::nodeToRangeEntry;
│ │ │ -
536
│ │ │ -
537 public:
│ │ │ - │ │ │ -
539 using Domain = typename LocalBase::Domain;
│ │ │ - │ │ │ -
541 using Element = typename LocalBase::Element;
│ │ │ -
542
│ │ │ -
│ │ │ -
544 LocalFunction(const GlobalFunction& globalFunction)
│ │ │ -
545 : LocalBase(globalFunction.data_)
│ │ │ -
546 , evaluationBuffer_(this->localView_.tree())
│ │ │ -
547 {
│ │ │ -
548 /* Nothing. */
│ │ │ -
549 }
│ │ │ -
│ │ │ -
550
│ │ │ -
│ │ │ -
557 void bind(const Element& element)
│ │ │ -
558 {
│ │ │ -
559 LocalBase::bind(element);
│ │ │ -
560 geometry_.emplace(element.geometry());
│ │ │ -
561 }
│ │ │ -
│ │ │ -
562
│ │ │ -
│ │ │ -
564 void unbind()
│ │ │ -
565 {
│ │ │ -
566 geometry_.reset();
│ │ │ -
567 LocalBase::unbind();
│ │ │ -
568 }
│ │ │ -
│ │ │ -
569
│ │ │ -
│ │ │ -
583 Range operator()(const Domain& x) const
│ │ │ -
584 {
│ │ │ -
585 Range y;
│ │ │ -
586 istlVectorBackend(y) = 0;
│ │ │ -
587
│ │ │ -
588 const auto& jacobianInverse = geometry_->jacobianInverse(x);
│ │ │ -
589
│ │ │ -
590 TypeTree::forEachLeafNode(this->localView_.tree(), [&](auto&& node, auto&& treePath) {
│ │ │ -
591 if (node.empty())
│ │ │ -
592 return;
│ │ │ -
593 const auto& fe = node.finiteElement();
│ │ │ -
594 const auto& localBasis = fe.localBasis();
│ │ │ -
595 auto& shapeFunctionJacobians = evaluationBuffer_[treePath];
│ │ │ -
596
│ │ │ -
597 localBasis.evaluateJacobian(x, shapeFunctionJacobians);
│ │ │ -
598
│ │ │ -
599 // Compute linear combinations of basis function jacobian.
│ │ │ -
600 // Non-scalar coefficients of dimension coeffDim are handled by
│ │ │ -
601 // processing the coeffDim linear combinations independently
│ │ │ -
602 // and storing them as entries of an array.
│ │ │ -
603 using RefJacobian = LocalBasisRange< std::decay_t<decltype(node)> >;
│ │ │ -
604 static constexpr auto coeffDim = decltype(flatVectorView(this->localDoFs_[node.localIndex(0)]).size())::value;
│ │ │ -
605 auto refJacobians = std::array<RefJacobian, coeffDim>{};
│ │ │ -
606 istlVectorBackend(refJacobians) = 0;
│ │ │ -
607 for (size_type i = 0; i < localBasis.size(); ++i)
│ │ │ -
608 {
│ │ │ -
609 auto c = flatVectorView(this->localDoFs_[node.localIndex(i)]);
│ │ │ -
610 for (std::size_t j = 0; j < coeffDim; ++j)
│ │ │ -
611 refJacobians[j].axpy(c[j], shapeFunctionJacobians[i]);
│ │ │ -
612 }
│ │ │ -
613
│ │ │ -
614 // Transform Jacobians form local to global coordinates.
│ │ │ -
615 using Jacobian = decltype(refJacobians[0] * jacobianInverse);
│ │ │ -
616 auto jacobians = std::array<Jacobian, coeffDim>{};
│ │ │ -
617 std::transform(
│ │ │ -
618 refJacobians.begin(), refJacobians.end(), jacobians.begin(),
│ │ │ -
619 [&](const auto& refJacobian) { return refJacobian * jacobianInverse; });
│ │ │ -
620
│ │ │ -
621 // Assign computed Jacobians to node entry of range.
│ │ │ -
622 // Types are matched using the lexicographic ordering provided by flatVectorView.
│ │ │ -
623 LocalBase::assignWith(nodeToRangeEntry(node, treePath, y), jacobians);
│ │ │ -
624 });
│ │ │ -
625
│ │ │ -
626 return y;
│ │ │ -
627 }
│ │ │ -
│ │ │ -
628
│ │ │ -
│ │ │ -
630 friend typename Traits::LocalFunctionTraits::DerivativeInterface derivative(const LocalFunction&)
│ │ │ -
631 {
│ │ │ -
632 DUNE_THROW(NotImplemented, "derivative of derivative is not implemented");
│ │ │ -
633 }
│ │ │ -
│ │ │ -
634
│ │ │ -
635 private:
│ │ │ -
636 mutable PerNodeEvaluationBuffer evaluationBuffer_;
│ │ │ -
637 std::optional<typename Element::Geometry> geometry_;
│ │ │ -
638 };
│ │ │ -
│ │ │ -
639
│ │ │ -
│ │ │ -
646 DiscreteGlobalBasisFunctionDerivative(const std::shared_ptr<const Data>& data)
│ │ │ -
647 : Base(data)
│ │ │ -
648 {
│ │ │ -
649 /* Nothing. */
│ │ │ -
650 }
│ │ │ -
│ │ │ -
651
│ │ │ -
│ │ │ -
657 Range operator()(const Domain& x) const
│ │ │ -
658 {
│ │ │ -
659 HierarchicSearch search(this->data_->basis->gridView().grid(), this->data_->basis->gridView().indexSet());
│ │ │ -
660
│ │ │ -
661 const auto e = search.findEntity(x);
│ │ │ -
662 auto localThis = localFunction(*this);
│ │ │ -
663 localThis.bind(e);
│ │ │ -
664 return localThis(e.geometry().local(x));
│ │ │ -
665 }
│ │ │ -
│ │ │ -
666
│ │ │ -
│ │ │ -
667 friend typename Traits::DerivativeInterface derivative(const DiscreteGlobalBasisFunctionDerivative& f)
│ │ │ -
668 {
│ │ │ -
669 DUNE_THROW(NotImplemented, "derivative of derivative is not implemented");
│ │ │ -
670 }
│ │ │ -
│ │ │ -
671
│ │ │ -
│ │ │ - │ │ │ -
674 {
│ │ │ -
675 return LocalFunction(f);
│ │ │ -
676 }
│ │ │ -
│ │ │ -
677};
│ │ │ -
│ │ │ -
678
│ │ │ -
679
│ │ │ -
680} // namespace Functions
│ │ │ -
681} // namespace Dune
│ │ │ -
682
│ │ │ -
683#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
auto makeDiscreteGlobalBasisFunction(B &&basis, V &&vector)
Generate a DiscreteGlobalBasisFunction.
Definition discreteglobalbasisfunction.hh:458
│ │ │ -
auto istlVectorBackend(Vector &v)
Return a vector backend wrapping non-const ISTL like containers.
Definition istlvectorbackend.hh:350
│ │ │ +
74
│ │ │ +
75}} // namespace Dune::Functions
│ │ │ +
76
│ │ │ +
77#endif // DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH
│ │ │ +
std::enable_if_t< HasStaticSize_v< T >, decltype(Dune::Hybrid::size(std::declval< T >()))> StaticSize
Obtain size of statically sized container as integral_constant, or fail.
Definition type_traits.hh:71
│ │ │ +
std::enable_if_t< std::is_constructible_v< T, Args... >, int > enableIfConstructible
Helper to constrain forwarding constructors.
Definition type_traits.hh:30
│ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
auto flatVectorView(T &t)
Create flat vector view of passed mutable container.
Definition flatvectorview.hh:183
│ │ │ -
Definition discreteglobalbasisfunction.hh:32
│ │ │ -
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:41
│ │ │ -
Helper class to deduce the signature of a callable.
Definition signature.hh:60
│ │ │ -
A simple node to range map using the nested tree indices.
Definition hierarchicnodetorangemap.hh:34
│ │ │ -
Definition discreteglobalbasisfunction.hh:36
│ │ │ - │ │ │ -
const Vector & dofs() const
Return the coefficients of this discrete function by reference.
Definition discreteglobalbasisfunction.hh:207
│ │ │ -
B Basis
Definition discreteglobalbasisfunction.hh:38
│ │ │ -
typename Basis::LocalView::Tree Tree
Definition discreteglobalbasisfunction.hh:47
│ │ │ -
V Vector
Definition discreteglobalbasisfunction.hh:39
│ │ │ -
typename EntitySet::Element Element
Definition discreteglobalbasisfunction.hh:53
│ │ │ -
typename EntitySet::LocalCoordinate LocalDomain
Definition discreteglobalbasisfunction.hh:52
│ │ │ -
const NodeToRangeEntry & nodeToRangeEntry() const
Return the stored node-to-range map.
Definition discreteglobalbasisfunction.hh:213
│ │ │ -
NTRE NodeToRangeEntry
Definition discreteglobalbasisfunction.hh:48
│ │ │ -
DiscreteGlobalBasisFunctionBase(const std::shared_ptr< const Data > &data)
Definition discreteglobalbasisfunction.hh:192
│ │ │ -
typename Basis::GridView GridView
Definition discreteglobalbasisfunction.hh:45
│ │ │ -
const Basis & basis() const
Return a const reference to the stored basis.
Definition discreteglobalbasisfunction.hh:201
│ │ │ -
GridViewEntitySet< GridView, 0 > EntitySet
Definition discreteglobalbasisfunction.hh:46
│ │ │ -
const EntitySet & entitySet() const
Get associated set of entities the local-function can be bound to.
Definition discreteglobalbasisfunction.hh:219
│ │ │ -
typename EntitySet::GlobalCoordinate Domain
Definition discreteglobalbasisfunction.hh:50
│ │ │ -
Dune::AutonomousValue< decltype(std::declval< Vector >()[std::declval< typename Basis::MultiIndex >()])> Coefficient
Definition discreteglobalbasisfunction.hh:43
│ │ │ -
Definition discreteglobalbasisfunction.hh:61
│ │ │ -
EntitySet entitySet
Definition discreteglobalbasisfunction.hh:62
│ │ │ -
std::shared_ptr< const NodeToRangeEntry > nodeToRangeEntry
Definition discreteglobalbasisfunction.hh:65
│ │ │ -
std::shared_ptr< const Basis > basis
Definition discreteglobalbasisfunction.hh:63
│ │ │ -
std::shared_ptr< const Vector > coefficients
Definition discreteglobalbasisfunction.hh:64
│ │ │ - │ │ │ -
LocalFunctionBase & operator=(const LocalFunctionBase &other)
Copy-assignment of the local-function.
Definition discreteglobalbasisfunction.hh:108
│ │ │ -
bool bound() const
Check if LocalFunction is already bound to an element.
Definition discreteglobalbasisfunction.hh:157
│ │ │ -
void bind(const Element &element)
Bind LocalFunction to grid element.
Definition discreteglobalbasisfunction.hh:124
│ │ │ -
typename EntitySet::Element Element
Definition discreteglobalbasisfunction.hh:76
│ │ │ -
const Element & localContext() const
Return the element the local-function is bound to.
Definition discreteglobalbasisfunction.hh:163
│ │ │ -
LocalFunctionBase(const LocalFunctionBase &other)
Copy-construct the local-function.
Definition discreteglobalbasisfunction.hh:92
│ │ │ -
std::vector< Coefficient > localDoFs_
Definition discreteglobalbasisfunction.hh:188
│ │ │ -
void assignWith(To &to, const From &from) const
Definition discreteglobalbasisfunction.hh:171
│ │ │ -
std::shared_ptr< const Data > data_
Definition discreteglobalbasisfunction.hh:186
│ │ │ -
decltype(auto) nodeToRangeEntry(const Node &node, const TreePath &treePath, Range &y) const
Definition discreteglobalbasisfunction.hh:181
│ │ │ -
LocalView localView_
Definition discreteglobalbasisfunction.hh:187
│ │ │ -
void unbind()
Unbind the local-function.
Definition discreteglobalbasisfunction.hh:151
│ │ │ -
LocalDomain Domain
Definition discreteglobalbasisfunction.hh:75
│ │ │ -
LocalFunctionBase(const std::shared_ptr< const Data > &data)
Definition discreteglobalbasisfunction.hh:79
│ │ │ -
Derivative of a DiscreteGlobalBasisFunction.
Definition discreteglobalbasisfunction.hh:498
│ │ │ -
typename Base::Basis Basis
Definition discreteglobalbasisfunction.hh:505
│ │ │ -
friend Traits::DerivativeInterface derivative(const DiscreteGlobalBasisFunctionDerivative &f)
Definition discreteglobalbasisfunction.hh:667
│ │ │ -
Range operator()(const Domain &x) const
Evaluate the discrete grid-function derivative in global coordinates.
Definition discreteglobalbasisfunction.hh:657
│ │ │ -
typename SignatureTraits< typename DiscreteGlobalBasisFunction::Traits::DerivativeInterface >::Range Range
Definition discreteglobalbasisfunction.hh:509
│ │ │ -
friend LocalFunction localFunction(const DiscreteGlobalBasisFunctionDerivative &f)
Construct local function from a DiscreteGlobalBasisFunctionDerivative.
Definition discreteglobalbasisfunction.hh:673
│ │ │ -
DiscreteGlobalBasisFunctionDerivative(const std::shared_ptr< const Data > &data)
create object from DiscreateGlobalBasisFunction data
Definition discreteglobalbasisfunction.hh:646
│ │ │ -
DGBF DiscreteGlobalBasisFunction
Definition discreteglobalbasisfunction.hh:503
│ │ │ -
typename Base::Vector Vector
Definition discreteglobalbasisfunction.hh:506
│ │ │ -
Imp::GridFunctionTraits< Range(Domain), typename Base::EntitySet, DefaultDerivativeTraits, 16 > Traits
Definition discreteglobalbasisfunction.hh:511
│ │ │ -
typename Base::Domain Domain
Definition discreteglobalbasisfunction.hh:508
│ │ │ -
friend DiscreteGlobalBasisFunctionDerivative< DiscreteGlobalBasisFunction > derivative(const DiscreteGlobalBasisFunction &f)
Derivative of the DiscreteGlobalBasisFunction.
Definition discreteglobalbasisfunction.hh:413
│ │ │ -
DiscreteGlobalBasisFunction(B_T &&basis, V_T &&coefficients, NTRE_T &&nodeToRangeEntry)
Create a grid-function, by wrapping the arguments in std::shared_ptr.
Definition discreteglobalbasisfunction.hh:388
│ │ │ -
DiscreteGlobalBasisFunction(std::shared_ptr< const Basis > basis, std::shared_ptr< const V > coefficients, std::shared_ptr< const typename Base::NodeToRangeEntry > nodeToRangeEntry)
Create a grid-function, by moving the arguments in std::shared_ptr.
Definition discreteglobalbasisfunction.hh:393
│ │ │ -
friend LocalFunction localFunction(const DiscreteGlobalBasisFunction &t)
Construct local function from a DiscreteGlobalBasisFunction.
Definition discreteglobalbasisfunction.hh:426
│ │ │ -
typename Base::Basis Basis
Definition discreteglobalbasisfunction.hh:288
│ │ │ -
Imp::GridFunctionTraits< Range(Domain), typename Base::EntitySet, DefaultDerivativeTraits, 16 > Traits
Definition discreteglobalbasisfunction.hh:294
│ │ │ -
R Range
Definition discreteglobalbasisfunction.hh:292
│ │ │ -
typename Base::Vector Vector
Definition discreteglobalbasisfunction.hh:289
│ │ │ -
typename Base::Domain Domain
Definition discreteglobalbasisfunction.hh:291
│ │ │ -
Definition discreteglobalbasisfunction.hh:307
│ │ │ -
GlobalFunction::Range Range
Definition discreteglobalbasisfunction.hh:316
│ │ │ -
typename LocalBase::Domain Domain
Definition discreteglobalbasisfunction.hh:315
│ │ │ -
LocalFunction(const DiscreteGlobalBasisFunction &globalFunction)
Create a local-function from the associated grid-function.
Definition discreteglobalbasisfunction.hh:320
│ │ │ -
friend DiscreteGlobalBasisFunctionDerivative< DiscreteGlobalBasisFunction >::LocalFunction derivative(const LocalFunction &lf)
Local function of the derivative.
Definition discreteglobalbasisfunction.hh:374
│ │ │ -
DiscreteGlobalBasisFunction GlobalFunction
Definition discreteglobalbasisfunction.hh:314
│ │ │ -
Range operator()(const Domain &x) const
Evaluate this local-function in coordinates x in the bound element.
Definition discreteglobalbasisfunction.hh:336
│ │ │ -
typename LocalBase::Element Element
Definition discreteglobalbasisfunction.hh:317
│ │ │ -
local function evaluating the derivative in reference coordinates
Definition discreteglobalbasisfunction.hh:532
│ │ │ -
Range operator()(const Domain &x) const
Evaluate this local-function in coordinates x in the bound element.
Definition discreteglobalbasisfunction.hh:583
│ │ │ -
typename LocalBase::Domain Domain
Definition discreteglobalbasisfunction.hh:539
│ │ │ -
typename LocalBase::Element Element
Definition discreteglobalbasisfunction.hh:541
│ │ │ -
friend Traits::LocalFunctionTraits::DerivativeInterface derivative(const LocalFunction &)
Not implemented.
Definition discreteglobalbasisfunction.hh:630
│ │ │ -
DiscreteGlobalBasisFunctionDerivative GlobalFunction
Definition discreteglobalbasisfunction.hh:538
│ │ │ -
GlobalFunction::Range Range
Definition discreteglobalbasisfunction.hh:540
│ │ │ -
void unbind()
Unbind the local-function.
Definition discreteglobalbasisfunction.hh:564
│ │ │ -
LocalFunction(const GlobalFunction &globalFunction)
Create a local function from the associated grid function.
Definition discreteglobalbasisfunction.hh:544
│ │ │ -
void bind(const Element &element)
Bind LocalFunction to grid element.
Definition discreteglobalbasisfunction.hh:557
│ │ │ -
An entity set for all entities of given codim in a grid view.
Definition gridviewentityset.hh:27
│ │ │ -
GridView::template Codim< codim >::Entity Element
Definition gridviewentityset.hh:36
│ │ │ -
Element::Geometry::LocalCoordinate LocalCoordinate
Definition gridviewentityset.hh:39
│ │ │ -
Element::Geometry::GlobalCoordinate GlobalCoordinate
Definition gridviewentityset.hh:40
│ │ │ - │ │ │ +
constexpr bool HasStaticSize_v
A variable template representing the value of HasStaticSize.
Definition type_traits.hh:49
│ │ │ +
Check if type is a statically sized container.
Definition type_traits.hh:45
│ │ │ +
Obtain size of statically sized container, or 0 if dynamic size.
Definition type_traits.hh:64
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,884 +1,85 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -discreteglobalbasisfunction.hh │ │ │ │ +type_traits.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH │ │ │ │ -8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH │ │ │ │ +8#define DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ -12 │ │ │ │ -13#include │ │ │ │ -14#include │ │ │ │ -15 │ │ │ │ -16#include │ │ │ │ +10#include │ │ │ │ +11 │ │ │ │ +12#include │ │ │ │ +13#include │ │ │ │ +14 │ │ │ │ +15namespace _D_u_n_e { │ │ │ │ +16namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ 17 │ │ │ │ -18#include │ │ │ │ -19#include │ │ │ │ -20 │ │ │ │ -21#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_h_i_e_r_a_r_c_h_i_c_n_o_d_e_t_o_r_a_n_g_e_m_a_p_._h_h> │ │ │ │ -22#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_f_l_a_t_v_e_c_t_o_r_v_i_e_w_._h_h> │ │ │ │ -23#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h> │ │ │ │ -24#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ -25#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_b_a_c_k_e_n_d_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ -26#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_b_a_c_k_e_n_d_s_/_i_s_t_l_v_e_c_t_o_r_b_a_c_k_e_n_d_._h_h> │ │ │ │ -27 │ │ │ │ -28namespace _D_u_n_e { │ │ │ │ -29namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -30 │ │ │ │ -31 │ │ │ │ -_3_2namespace _I_m_p_l_D_o_c { │ │ │ │ +18 │ │ │ │ +29template │ │ │ │ +_3_0using _e_n_a_b_l_e_I_f_C_o_n_s_t_r_u_c_t_i_b_l_e = std::enable_if_t< │ │ │ │ +31 std::is_constructible_v, int>; │ │ │ │ +32 │ │ │ │ 33 │ │ │ │ -34template │ │ │ │ -_3_5class _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e │ │ │ │ -36{ │ │ │ │ -37public: │ │ │ │ -_3_8 using _B_a_s_i_s = B; │ │ │ │ -_3_9 using _V_e_c_t_o_r = V; │ │ │ │ -40 │ │ │ │ -41 // In order to make the cache work for proxy-references │ │ │ │ -42 // we have to use AutonomousValue instead of std::decay_t │ │ │ │ -_4_3 using _C_o_e_f_f_i_c_i_e_n_t = Dune::AutonomousValue() │ │ │ │ -[std::declval()])>; │ │ │ │ -44 │ │ │ │ -_4_5 using _G_r_i_d_V_i_e_w = typename Basis::GridView; │ │ │ │ -_4_6 using _E_n_t_i_t_y_S_e_t = _G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_G_r_i_d_V_i_e_w_,_ _0_>; │ │ │ │ -_4_7 using _T_r_e_e = typename Basis::LocalView::Tree; │ │ │ │ -_4_8 using _N_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y = NTRE; │ │ │ │ -49 │ │ │ │ -_5_0 using _D_o_m_a_i_n = typename _E_n_t_i_t_y_S_e_t_:_:_G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e; │ │ │ │ +34 │ │ │ │ +42template │ │ │ │ +_4_3struct _H_a_s_S_t_a_t_i_c_S_i_z_e : │ │ │ │ +44 public IsIntegralConstant()))> │ │ │ │ +45{}; │ │ │ │ +46 │ │ │ │ +48template │ │ │ │ +_4_9inline constexpr bool _H_a_s_S_t_a_t_i_c_S_i_z_e___v = _H_a_s_S_t_a_t_i_c_S_i_z_e_<_T_>_:_:_v_a_l_u_e; │ │ │ │ +50 │ │ │ │ 51 │ │ │ │ -_5_2 using _L_o_c_a_l_D_o_m_a_i_n = typename _E_n_t_i_t_y_S_e_t_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e; │ │ │ │ -_5_3 using _E_l_e_m_e_n_t = typename _E_n_t_i_t_y_S_e_t_:_:_E_l_e_m_e_n_t; │ │ │ │ -54 │ │ │ │ -55protected: │ │ │ │ -56 │ │ │ │ -57 // This collects all data that is shared by all related │ │ │ │ -58 // global and local functions. This way we don't need to │ │ │ │ -59 // keep track of it individually. │ │ │ │ -_6_0 struct _D_a_t_a │ │ │ │ -61 { │ │ │ │ -_6_2 _E_n_t_i_t_y_S_e_t _e_n_t_i_t_y_S_e_t; │ │ │ │ -_6_3 std::shared_ptr _b_a_s_i_s; │ │ │ │ -_6_4 std::shared_ptr _c_o_e_f_f_i_c_i_e_n_t_s; │ │ │ │ -_6_5 std::shared_ptr _n_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y; │ │ │ │ -66 }; │ │ │ │ -67 │ │ │ │ -68public: │ │ │ │ -_6_9 class _L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e │ │ │ │ -70 { │ │ │ │ -71 using LocalView = typename Basis::LocalView; │ │ │ │ -72 using size_type = typename Tree::size_type; │ │ │ │ +59template │ │ │ │ +_6_0struct _S_t_a_t_i_c_S_i_z_e_O_r_Z_e_r_o : │ │ │ │ +61 public std::conditional_t, │ │ │ │ +62 decltype(Dune::Hybrid::size(std::declval())), │ │ │ │ +63 std::integral_constant> │ │ │ │ +64{}; │ │ │ │ +65 │ │ │ │ +70template │ │ │ │ +_7_1using _S_t_a_t_i_c_S_i_z_e = std::enable_if_t, │ │ │ │ +72 decltype(Dune::Hybrid::size(std::declval()))>; │ │ │ │ 73 │ │ │ │ -74 public: │ │ │ │ -_7_5 using _D_o_m_a_i_n = _L_o_c_a_l_D_o_m_a_i_n; │ │ │ │ -_7_6 using _E_l_e_m_e_n_t = typename _E_n_t_i_t_y_S_e_t_:_:_E_l_e_m_e_n_t; │ │ │ │ -77 │ │ │ │ -78 protected: │ │ │ │ -_7_9 _L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e(const std::shared_ptr& data) │ │ │ │ -80 : _d_a_t_a__(data) │ │ │ │ -81 , _l_o_c_a_l_V_i_e_w__(_d_a_t_a__->_b_a_s_i_s->localView()) │ │ │ │ -82 { │ │ │ │ -83 _l_o_c_a_l_D_o_F_s__.reserve(_l_o_c_a_l_V_i_e_w__.maxSize()); │ │ │ │ -84 } │ │ │ │ -85 │ │ │ │ -_9_2 _L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e(const _L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e& other) │ │ │ │ -93 : _d_a_t_a__(other._d_a_t_a__) │ │ │ │ -94 , _l_o_c_a_l_V_i_e_w__(other._l_o_c_a_l_V_i_e_w__) │ │ │ │ -95 { │ │ │ │ -96 _l_o_c_a_l_D_o_F_s__.reserve(_l_o_c_a_l_V_i_e_w__.maxSize()); │ │ │ │ -97 if (_b_o_u_n_d()) │ │ │ │ -98 _l_o_c_a_l_D_o_F_s__ = other._l_o_c_a_l_D_o_F_s__; │ │ │ │ -99 } │ │ │ │ -100 │ │ │ │ -_1_0_8 _L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e& _o_p_e_r_a_t_o_r_=(const _L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e& other) │ │ │ │ -109 { │ │ │ │ -110 _d_a_t_a__ = other._d_a_t_a__; │ │ │ │ -111 _l_o_c_a_l_V_i_e_w__ = other._l_o_c_a_l_V_i_e_w__; │ │ │ │ -112 if (_b_o_u_n_d()) │ │ │ │ -113 _l_o_c_a_l_D_o_F_s__ = other._l_o_c_a_l_D_o_F_s__; │ │ │ │ -114 return *this; │ │ │ │ -115 } │ │ │ │ -116 │ │ │ │ -117 public: │ │ │ │ -_1_2_4 void _b_i_n_d(const _E_l_e_m_e_n_t& element) │ │ │ │ -125 { │ │ │ │ -126 _l_o_c_a_l_V_i_e_w__.bind(element); │ │ │ │ -127 // Use cache of full local view size. For a subspace basis, │ │ │ │ -128 // this may be larger than the number of local DOFs in the │ │ │ │ -129 // tree. In this case only cache entries associated to local │ │ │ │ -130 // DOFs in the subspace are filled. Cache entries associated │ │ │ │ -131 // to local DOFs which are not contained in the subspace will │ │ │ │ -132 // not be touched. │ │ │ │ -133 // │ │ │ │ -134 // Alternatively one could use a cache that exactly fits │ │ │ │ -135 // the size of the tree. However, this would require to │ │ │ │ -136 // subtract an offset from localIndex(i) on each cache │ │ │ │ -137 // access in operator(). │ │ │ │ -138 _l_o_c_a_l_D_o_F_s__.resize(_l_o_c_a_l_V_i_e_w__.size()); │ │ │ │ -139 const auto& _d_o_f_s = *_d_a_t_a__->coefficients; │ │ │ │ -140 for (size_type i = 0; i < _l_o_c_a_l_V_i_e_w__.tree().size(); ++i) │ │ │ │ -141 { │ │ │ │ -142 // For a subspace basis the index-within-tree i │ │ │ │ -143 // is not the same as the localIndex within the │ │ │ │ -144 // full local view. │ │ │ │ -145 size_t localIndex = _l_o_c_a_l_V_i_e_w__.tree().localIndex(i); │ │ │ │ -146 _l_o_c_a_l_D_o_F_s__[localIndex] = _d_o_f_s[_l_o_c_a_l_V_i_e_w__.index(localIndex)]; │ │ │ │ -147 } │ │ │ │ -148 } │ │ │ │ -149 │ │ │ │ -_1_5_1 void _u_n_b_i_n_d() │ │ │ │ -152 { │ │ │ │ -153 _l_o_c_a_l_V_i_e_w__.unbind(); │ │ │ │ -154 } │ │ │ │ -155 │ │ │ │ -_1_5_7 bool _b_o_u_n_d() const │ │ │ │ -158 { │ │ │ │ -159 return _l_o_c_a_l_V_i_e_w__.bound(); │ │ │ │ -160 } │ │ │ │ -161 │ │ │ │ -_1_6_3 const _E_l_e_m_e_n_t& _l_o_c_a_l_C_o_n_t_e_x_t() const │ │ │ │ -164 { │ │ │ │ -165 return _l_o_c_a_l_V_i_e_w__.element(); │ │ │ │ -166 } │ │ │ │ -167 │ │ │ │ -168 protected: │ │ │ │ -169 │ │ │ │ -170 template │ │ │ │ -_1_7_1 void _a_s_s_i_g_n_W_i_t_h(To& to, const From& from) const │ │ │ │ -172 { │ │ │ │ -173 auto from_flat = _f_l_a_t_V_e_c_t_o_r_V_i_e_w(from); │ │ │ │ -174 auto to_flat = _f_l_a_t_V_e_c_t_o_r_V_i_e_w(to); │ │ │ │ -175 assert(from_flat.size() == to_flat.size()); │ │ │ │ -176 for (size_type i = 0; i < to_flat.size(); ++i) │ │ │ │ -177 to_flat[i] = from_flat[i]; │ │ │ │ -178 } │ │ │ │ -179 │ │ │ │ -180 template │ │ │ │ -_1_8_1 decltype(auto) _n_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y(const Node& node, const TreePath& treePath, │ │ │ │ -Range& y) const │ │ │ │ -182 { │ │ │ │ -183 return (*_d_a_t_a__->nodeToRangeEntry)(node, treePath, y); │ │ │ │ -184 } │ │ │ │ -185 │ │ │ │ -_1_8_6 std::shared_ptr _d_a_t_a__; │ │ │ │ -_1_8_7 LocalView _l_o_c_a_l_V_i_e_w__; │ │ │ │ -_1_8_8 std::vector _l_o_c_a_l_D_o_F_s__; │ │ │ │ -189 }; │ │ │ │ -190 │ │ │ │ -191protected: │ │ │ │ -_1_9_2 _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e(const std::shared_ptr& data) │ │ │ │ -193 : _d_a_t_a__(data) │ │ │ │ -194 { │ │ │ │ -195 /* Nothing. */ │ │ │ │ -196 } │ │ │ │ -197 │ │ │ │ -198public: │ │ │ │ -199 │ │ │ │ -_2_0_1 const _B_a_s_i_s& _b_a_s_i_s() const │ │ │ │ -202 { │ │ │ │ -203 return *_d_a_t_a__->basis; │ │ │ │ -204 } │ │ │ │ -205 │ │ │ │ -_2_0_7 const _V_e_c_t_o_r& _d_o_f_s() const │ │ │ │ -208 { │ │ │ │ -209 return *_d_a_t_a__->coefficients; │ │ │ │ -210 } │ │ │ │ -211 │ │ │ │ -_2_1_3 const _N_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y& _n_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y() const │ │ │ │ -214 { │ │ │ │ -215 return *_d_a_t_a__->nodeToRangeEntry; │ │ │ │ -216 } │ │ │ │ -217 │ │ │ │ -_2_1_9 const _E_n_t_i_t_y_S_e_t& _e_n_t_i_t_y_S_e_t() const │ │ │ │ -220 { │ │ │ │ -221 return _d_a_t_a__->entitySet; │ │ │ │ -222 } │ │ │ │ -223 │ │ │ │ -224protected: │ │ │ │ -_2_2_5 std::shared_ptr _d_a_t_a__; │ │ │ │ -226}; │ │ │ │ -227 │ │ │ │ -228} // namespace ImplDoc │ │ │ │ -229 │ │ │ │ -230 │ │ │ │ -231 │ │ │ │ -232template │ │ │ │ -233class _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e; │ │ │ │ -234 │ │ │ │ -278template │ │ │ │ -_2_8_1class _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n │ │ │ │ -282 : public _I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e │ │ │ │ -283{ │ │ │ │ -284 using Base = _I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_<_B_,_ _V_,_ _N_T_R_E_>; │ │ │ │ -285 using Data = typename _B_a_s_e_:_:_D_a_t_a; │ │ │ │ -286 │ │ │ │ -287public: │ │ │ │ -_2_8_8 using _B_a_s_i_s = typename _B_a_s_e_:_:_B_a_s_i_s; │ │ │ │ -_2_8_9 using _V_e_c_t_o_r = typename _B_a_s_e_:_:_V_e_c_t_o_r; │ │ │ │ -290 │ │ │ │ -_2_9_1 using _D_o_m_a_i_n = typename _B_a_s_e_:_:_D_o_m_a_i_n; │ │ │ │ -_2_9_2 using _R_a_n_g_e = R; │ │ │ │ -293 │ │ │ │ -_2_9_4 using _T_r_a_i_t_s = Imp::GridFunctionTraits<_R_a_n_g_e(_D_o_m_a_i_n), typename _B_a_s_e_:_: │ │ │ │ -_E_n_t_i_t_y_S_e_t, _D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s, 16>; │ │ │ │ -295 │ │ │ │ -296private: │ │ │ │ -297 │ │ │ │ -298 template │ │ │ │ -299 using LocalBasisRange = typename Node::FiniteElement::Traits:: │ │ │ │ -LocalBasisType::Traits::RangeType; │ │ │ │ -300 template │ │ │ │ -301 using NodeData = typename std::vector>; │ │ │ │ -302 using PerNodeEvaluationBuffer = typename TypeTree::TreeContainer; │ │ │ │ -303 │ │ │ │ -304public: │ │ │ │ -_3_0_5 class _L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -306 : public _B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e │ │ │ │ -307 { │ │ │ │ -308 using LocalBase = typename _B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e; │ │ │ │ -309 using size_type = typename Base::Tree::size_type; │ │ │ │ -310 using LocalBase::nodeToRangeEntry; │ │ │ │ -311 │ │ │ │ -312 public: │ │ │ │ -313 │ │ │ │ -_3_1_4 using _G_l_o_b_a_l_F_u_n_c_t_i_o_n = _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n; │ │ │ │ -_3_1_5 using _D_o_m_a_i_n = typename LocalBase::Domain; │ │ │ │ -_3_1_6 using _R_a_n_g_e = _G_l_o_b_a_l_F_u_n_c_t_i_o_n_:_:_R_a_n_g_e; │ │ │ │ -_3_1_7 using _E_l_e_m_e_n_t = typename LocalBase::Element; │ │ │ │ -318 │ │ │ │ -_3_2_0 _L_o_c_a_l_F_u_n_c_t_i_o_n(const _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n& globalFunction) │ │ │ │ -321 : LocalBase(globalFunction._d_a_t_a__) │ │ │ │ -322 , evaluationBuffer_(this->_l_o_c_a_l_V_i_e_w__.tree()) │ │ │ │ -323 { │ │ │ │ -324 /* Nothing. */ │ │ │ │ -325 } │ │ │ │ -326 │ │ │ │ -_3_3_6 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(const _D_o_m_a_i_n& x) const │ │ │ │ -337 { │ │ │ │ -338 _R_a_n_g_e y; │ │ │ │ -339 _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(y) = 0; │ │ │ │ -340 │ │ │ │ -341 TypeTree::forEachLeafNode(this->_l_o_c_a_l_V_i_e_w__.tree(), [&](auto&& node, auto&& │ │ │ │ -treePath) { │ │ │ │ -342 if (node.empty()) │ │ │ │ -343 return; │ │ │ │ -344 const auto& fe = node.finiteElement(); │ │ │ │ -345 const auto& localBasis = fe.localBasis(); │ │ │ │ -346 auto& shapeFunctionValues = evaluationBuffer_[treePath]; │ │ │ │ -347 │ │ │ │ -348 localBasis.evaluateFunction(x, shapeFunctionValues); │ │ │ │ -349 │ │ │ │ -350 // Compute linear combinations of basis function jacobian. │ │ │ │ -351 // Non-scalar coefficients of dimension coeffDim are handled by │ │ │ │ -352 // processing the coeffDim linear combinations independently │ │ │ │ -353 // and storing them as entries of an array. │ │ │ │ -354 using Value = LocalBasisRange< std::decay_t >; │ │ │ │ -355 static constexpr auto coeffDim = decltype(flatVectorView(this->localDoFs_ │ │ │ │ -[node.localIndex(0)]).size())::value; │ │ │ │ -356 auto values = std::array{}; │ │ │ │ -357 _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(values) = 0; │ │ │ │ -358 for (size_type i = 0; i < localBasis.size(); ++i) │ │ │ │ -359 { │ │ │ │ -360 auto c = _f_l_a_t_V_e_c_t_o_r_V_i_e_w(this->_l_o_c_a_l_D_o_F_s__[node.localIndex(i)]); │ │ │ │ -361 for (std::size_t j = 0; j < coeffDim; ++j) │ │ │ │ -362 values[j].axpy(c[j], shapeFunctionValues[i]); │ │ │ │ -363 } │ │ │ │ -364 │ │ │ │ -365 // Assign computed values to node entry of range. │ │ │ │ -366 // Types are matched using the lexicographic ordering provided by │ │ │ │ -flatVectorView. │ │ │ │ -367 LocalBase::assignWith(_n_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y(node, treePath, y), values); │ │ │ │ -368 }); │ │ │ │ -369 │ │ │ │ -370 return y; │ │ │ │ -371 } │ │ │ │ -372 │ │ │ │ -_3_7_4 friend typename │ │ │ │ -_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_<_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_>_:_: │ │ │ │ -_L_o_c_a_l_F_u_n_c_t_i_o_n _d_e_r_i_v_a_t_i_v_e(const _L_o_c_a_l_F_u_n_c_t_i_o_n& lf) │ │ │ │ -375 { │ │ │ │ -376 auto dlf = _l_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -(_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_<_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_>(lf._d_a_t_a__)); │ │ │ │ -377 if (lf._b_o_u_n_d()) │ │ │ │ -378 dlf.bind(lf._l_o_c_a_l_C_o_n_t_e_x_t()); │ │ │ │ -379 return dlf; │ │ │ │ -380 } │ │ │ │ -381 │ │ │ │ -382 private: │ │ │ │ -383 mutable PerNodeEvaluationBuffer evaluationBuffer_; │ │ │ │ -384 }; │ │ │ │ -385 │ │ │ │ -387 template │ │ │ │ -_3_8_8 _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n(B_T && _b_a_s_i_s, V_T && coefficients, NTRE_T&& │ │ │ │ -_n_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y) │ │ │ │ -389 : Base(std::make_shared(Data{{_b_a_s_i_s.gridView()}, wrap_or_move(std:: │ │ │ │ -forward(basis)), wrap_or_move(std::forward(coefficients)), │ │ │ │ -wrap_or_move(std::forward(nodeToRangeEntry))})) │ │ │ │ -390 {} │ │ │ │ -391 │ │ │ │ -_3_9_3 _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n(std::shared_ptr _b_a_s_i_s, std:: │ │ │ │ -shared_ptr coefficients, std::shared_ptr _n_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y) │ │ │ │ -394 : Base(std::make_shared(Data{{_b_a_s_i_s->gridView()}, basis, │ │ │ │ -coefficients, nodeToRangeEntry})) │ │ │ │ -395 {} │ │ │ │ -396 │ │ │ │ -_4_0_2 _R_a_n_g_e operator() (const _D_o_m_a_i_n& x) const │ │ │ │ -403 { │ │ │ │ -404 HierarchicSearch search(this->_d_a_t_a__->basis->gridView().grid(), this->data_- │ │ │ │ ->basis->gridView().indexSet()); │ │ │ │ -405 │ │ │ │ -406 const auto e = search.findEntity(x); │ │ │ │ -407 auto localThis = _l_o_c_a_l_F_u_n_c_t_i_o_n(*this); │ │ │ │ -408 localThis.bind(e); │ │ │ │ -409 return localThis(e.geometry().local(x)); │ │ │ │ -410 } │ │ │ │ -411 │ │ │ │ -_4_1_3 friend _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_<_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_> │ │ │ │ -_d_e_r_i_v_a_t_i_v_e(const _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n& f) │ │ │ │ -414 { │ │ │ │ -415 return _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_<_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_> │ │ │ │ -(f._d_a_t_a__); │ │ │ │ -416 } │ │ │ │ -417 │ │ │ │ -_4_2_6 friend _L_o_c_a_l_F_u_n_c_t_i_o_n _l_o_c_a_l_F_u_n_c_t_i_o_n(const _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n& t) │ │ │ │ -427 { │ │ │ │ -428 return _L_o_c_a_l_F_u_n_c_t_i_o_n(t); │ │ │ │ -429 } │ │ │ │ -430}; │ │ │ │ -431 │ │ │ │ -432 │ │ │ │ -457template │ │ │ │ -_4_5_8auto _m_a_k_e_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n(B&& _b_a_s_i_s, V&& vector) │ │ │ │ -459{ │ │ │ │ -460 using _B_a_s_i_s = std::decay_t; │ │ │ │ -461 using NTREM = _H_i_e_r_a_r_c_h_i_c_N_o_d_e_T_o_R_a_n_g_e_M_a_p; │ │ │ │ -462 │ │ │ │ -463 // Small helper functions to wrap vectors using istlVectorBackend │ │ │ │ -464 // if they do not already satisfy the VectorBackend interface. │ │ │ │ -465 auto toConstVectorBackend = [&](auto&& v) -> decltype(auto) { │ │ │ │ -466 if constexpr (models, decltype(v)>()) { │ │ │ │ -467 return std::forward(v); │ │ │ │ -468 } else { │ │ │ │ -469 return _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(v); │ │ │ │ -470 } │ │ │ │ -471 }; │ │ │ │ -472 │ │ │ │ -473 using _V_e_c_t_o_r = std::decay_t │ │ │ │ -(vector)))>; │ │ │ │ -474 return _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_<_B_a_s_i_s_,_ _V_e_c_t_o_r_,_ _N_T_R_E_M_,_ _R_>( │ │ │ │ -475 std::forward(_b_a_s_i_s), │ │ │ │ -476 toConstVectorBackend(std::forward(vector)), │ │ │ │ -477 _H_i_e_r_a_r_c_h_i_c_N_o_d_e_T_o_R_a_n_g_e_M_a_p()); │ │ │ │ -478} │ │ │ │ -479 │ │ │ │ -480 │ │ │ │ -495template │ │ │ │ -_4_9_6class _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e │ │ │ │ -497 : public _I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e │ │ │ │ -498{ │ │ │ │ -499 using Base = _I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_<_t_y_p_e_n_a_m_e_ _D_G_B_F_:_:_B_a_s_i_s_, │ │ │ │ -_t_y_p_e_n_a_m_e_ _D_G_B_F_:_:_V_e_c_t_o_r_,_ _t_y_p_e_n_a_m_e_ _D_G_B_F_:_:_N_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y_>; │ │ │ │ -500 using Data = typename Base::Data; │ │ │ │ -501 │ │ │ │ -502public: │ │ │ │ -_5_0_3 using _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n = DGBF; │ │ │ │ -504 │ │ │ │ -_5_0_5 using _B_a_s_i_s = typename _B_a_s_e_:_:_B_a_s_i_s; │ │ │ │ -_5_0_6 using _V_e_c_t_o_r = typename _B_a_s_e_:_:_V_e_c_t_o_r; │ │ │ │ -507 │ │ │ │ -_5_0_8 using _D_o_m_a_i_n = typename _B_a_s_e_:_:_D_o_m_a_i_n; │ │ │ │ -_5_0_9 using _R_a_n_g_e = typename _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s_<_t_y_p_e_n_a_m_e │ │ │ │ -_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_T_r_a_i_t_s_:_:_D_e_r_i_v_a_t_i_v_e_I_n_t_e_r_f_a_c_e_>_:_:_R_a_n_g_e; │ │ │ │ -510 │ │ │ │ -_5_1_1 using _T_r_a_i_t_s = Imp::GridFunctionTraits<_R_a_n_g_e(_D_o_m_a_i_n), typename _B_a_s_e_:_: │ │ │ │ -_E_n_t_i_t_y_S_e_t, _D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s, 16>; │ │ │ │ -512 │ │ │ │ -513private: │ │ │ │ -514 │ │ │ │ -515 template │ │ │ │ -516 using LocalBasisRange = typename Node::FiniteElement::Traits:: │ │ │ │ -LocalBasisType::Traits::JacobianType; │ │ │ │ -517 template │ │ │ │ -518 using NodeData = typename std::vector< LocalBasisRange >; │ │ │ │ -519 using PerNodeEvaluationBuffer = typename TypeTree::TreeContainer; │ │ │ │ -520 │ │ │ │ -521public: │ │ │ │ -522 │ │ │ │ -_5_3_0 class _L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -531 : public Base::LocalFunctionBase │ │ │ │ -532 { │ │ │ │ -533 using LocalBase = typename Base::LocalFunctionBase; │ │ │ │ -534 using size_type = typename Base::Tree::size_type; │ │ │ │ -535 using LocalBase::nodeToRangeEntry; │ │ │ │ -536 │ │ │ │ -537 public: │ │ │ │ -_5_3_8 using _G_l_o_b_a_l_F_u_n_c_t_i_o_n = _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e; │ │ │ │ -_5_3_9 using _D_o_m_a_i_n = typename LocalBase::Domain; │ │ │ │ -_5_4_0 using _R_a_n_g_e = _G_l_o_b_a_l_F_u_n_c_t_i_o_n_:_:_R_a_n_g_e; │ │ │ │ -_5_4_1 using _E_l_e_m_e_n_t = typename LocalBase::Element; │ │ │ │ -542 │ │ │ │ -_5_4_4 _L_o_c_a_l_F_u_n_c_t_i_o_n(const _G_l_o_b_a_l_F_u_n_c_t_i_o_n& globalFunction) │ │ │ │ -545 : LocalBase(globalFunction._d_a_t_a__) │ │ │ │ -546 , evaluationBuffer_(this->_l_o_c_a_l_V_i_e_w__.tree()) │ │ │ │ -547 { │ │ │ │ -548 /* Nothing. */ │ │ │ │ -549 } │ │ │ │ -550 │ │ │ │ -_5_5_7 void _b_i_n_d(const _E_l_e_m_e_n_t& element) │ │ │ │ -558 { │ │ │ │ -559 LocalBase::bind(element); │ │ │ │ -560 geometry_.emplace(element.geometry()); │ │ │ │ -561 } │ │ │ │ -562 │ │ │ │ -_5_6_4 void _u_n_b_i_n_d() │ │ │ │ -565 { │ │ │ │ -566 geometry_.reset(); │ │ │ │ -567 LocalBase::unbind(); │ │ │ │ -568 } │ │ │ │ -569 │ │ │ │ -_5_8_3 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(const _D_o_m_a_i_n& x) const │ │ │ │ -584 { │ │ │ │ -585 _R_a_n_g_e y; │ │ │ │ -586 _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(y) = 0; │ │ │ │ -587 │ │ │ │ -588 const auto& jacobianInverse = geometry_->jacobianInverse(x); │ │ │ │ -589 │ │ │ │ -590 TypeTree::forEachLeafNode(this->_l_o_c_a_l_V_i_e_w__.tree(), [&](auto&& node, auto&& │ │ │ │ -treePath) { │ │ │ │ -591 if (node.empty()) │ │ │ │ -592 return; │ │ │ │ -593 const auto& fe = node.finiteElement(); │ │ │ │ -594 const auto& localBasis = fe.localBasis(); │ │ │ │ -595 auto& shapeFunctionJacobians = evaluationBuffer_[treePath]; │ │ │ │ -596 │ │ │ │ -597 localBasis.evaluateJacobian(x, shapeFunctionJacobians); │ │ │ │ -598 │ │ │ │ -599 // Compute linear combinations of basis function jacobian. │ │ │ │ -600 // Non-scalar coefficients of dimension coeffDim are handled by │ │ │ │ -601 // processing the coeffDim linear combinations independently │ │ │ │ -602 // and storing them as entries of an array. │ │ │ │ -603 using RefJacobian = LocalBasisRange< std::decay_t >; │ │ │ │ -604 static constexpr auto coeffDim = decltype(flatVectorView(this->localDoFs_ │ │ │ │ -[node.localIndex(0)]).size())::value; │ │ │ │ -605 auto refJacobians = std::array{}; │ │ │ │ -606 _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(refJacobians) = 0; │ │ │ │ -607 for (size_type i = 0; i < localBasis.size(); ++i) │ │ │ │ -608 { │ │ │ │ -609 auto c = _f_l_a_t_V_e_c_t_o_r_V_i_e_w(this->_l_o_c_a_l_D_o_F_s__[node.localIndex(i)]); │ │ │ │ -610 for (std::size_t j = 0; j < coeffDim; ++j) │ │ │ │ -611 refJacobians[j].axpy(c[j], shapeFunctionJacobians[i]); │ │ │ │ -612 } │ │ │ │ -613 │ │ │ │ -614 // Transform Jacobians form local to global coordinates. │ │ │ │ -615 using Jacobian = decltype(refJacobians[0] * jacobianInverse); │ │ │ │ -616 auto jacobians = std::array{}; │ │ │ │ -617 std::transform( │ │ │ │ -618 refJacobians.begin(), refJacobians.end(), jacobians.begin(), │ │ │ │ -619 [&](const auto& refJacobian) { return refJacobian * jacobianInverse; }); │ │ │ │ -620 │ │ │ │ -621 // Assign computed Jacobians to node entry of range. │ │ │ │ -622 // Types are matched using the lexicographic ordering provided by │ │ │ │ -flatVectorView. │ │ │ │ -623 LocalBase::assignWith(_n_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y(node, treePath, y), jacobians); │ │ │ │ -624 }); │ │ │ │ -625 │ │ │ │ -626 return y; │ │ │ │ -627 } │ │ │ │ -628 │ │ │ │ -_6_3_0 friend typename Traits::LocalFunctionTraits::DerivativeInterface _d_e_r_i_v_a_t_i_v_e │ │ │ │ -(const _L_o_c_a_l_F_u_n_c_t_i_o_n&) │ │ │ │ -631 { │ │ │ │ -632 DUNE_THROW(NotImplemented, "derivative of derivative is not implemented"); │ │ │ │ -633 } │ │ │ │ -634 │ │ │ │ -635 private: │ │ │ │ -636 mutable PerNodeEvaluationBuffer evaluationBuffer_; │ │ │ │ -637 std::optional geometry_; │ │ │ │ -638 }; │ │ │ │ -639 │ │ │ │ -_6_4_6 _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e(const std::shared_ptr& │ │ │ │ -data) │ │ │ │ -647 : Base(data) │ │ │ │ -648 { │ │ │ │ -649 /* Nothing. */ │ │ │ │ -650 } │ │ │ │ -651 │ │ │ │ -_6_5_7 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(const _D_o_m_a_i_n& x) const │ │ │ │ -658 { │ │ │ │ -659 HierarchicSearch search(this->_d_a_t_a__->basis->gridView().grid(), this->data_- │ │ │ │ ->basis->gridView().indexSet()); │ │ │ │ -660 │ │ │ │ -661 const auto e = search.findEntity(x); │ │ │ │ -662 auto localThis = _l_o_c_a_l_F_u_n_c_t_i_o_n(*this); │ │ │ │ -663 localThis.bind(e); │ │ │ │ -664 return localThis(e.geometry().local(x)); │ │ │ │ -665 } │ │ │ │ -666 │ │ │ │ -_6_6_7 friend typename Traits::DerivativeInterface _d_e_r_i_v_a_t_i_v_e(const │ │ │ │ -_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e& f) │ │ │ │ -668 { │ │ │ │ -669 DUNE_THROW(NotImplemented, "derivative of derivative is not implemented"); │ │ │ │ -670 } │ │ │ │ -671 │ │ │ │ -_6_7_3 friend _L_o_c_a_l_F_u_n_c_t_i_o_n _l_o_c_a_l_F_u_n_c_t_i_o_n(const │ │ │ │ -_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e& f) │ │ │ │ -674 { │ │ │ │ -675 return _L_o_c_a_l_F_u_n_c_t_i_o_n(f); │ │ │ │ -676 } │ │ │ │ -677}; │ │ │ │ -678 │ │ │ │ -679 │ │ │ │ -680} // namespace Functions │ │ │ │ -681} // namespace Dune │ │ │ │ -682 │ │ │ │ -683#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH │ │ │ │ -_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h │ │ │ │ -_g_r_i_d_f_u_n_c_t_i_o_n_._h_h │ │ │ │ -_h_i_e_r_a_r_c_h_i_c_n_o_d_e_t_o_r_a_n_g_e_m_a_p_._h_h │ │ │ │ -_f_l_a_t_v_e_c_t_o_r_v_i_e_w_._h_h │ │ │ │ -_i_s_t_l_v_e_c_t_o_r_b_a_c_k_e_n_d_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_m_a_k_e_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n │ │ │ │ -auto makeDiscreteGlobalBasisFunction(B &&basis, V &&vector) │ │ │ │ -Generate a DiscreteGlobalBasisFunction. │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:458 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d │ │ │ │ -auto istlVectorBackend(Vector &v) │ │ │ │ -Return a vector backend wrapping non-const ISTL like containers. │ │ │ │ -DDeeffiinniittiioonn istlvectorbackend.hh:350 │ │ │ │ +74 │ │ │ │ +75}} // namespace Dune::Functions │ │ │ │ +76 │ │ │ │ +77#endif // DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_S_i_z_e │ │ │ │ +std::enable_if_t< HasStaticSize_v< T >, decltype(Dune::Hybrid::size(std:: │ │ │ │ +declval< T >()))> StaticSize │ │ │ │ +Obtain size of statically sized container as integral_constant, or fail. │ │ │ │ +DDeeffiinniittiioonn type_traits.hh:71 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_e_n_a_b_l_e_I_f_C_o_n_s_t_r_u_c_t_i_b_l_e │ │ │ │ +std::enable_if_t< std::is_constructible_v< T, Args... >, int > │ │ │ │ +enableIfConstructible │ │ │ │ +Helper to constrain forwarding constructors. │ │ │ │ +DDeeffiinniittiioonn type_traits.hh:30 │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_l_a_t_V_e_c_t_o_r_V_i_e_w │ │ │ │ -auto flatVectorView(T &t) │ │ │ │ -Create flat vector view of passed mutable container. │ │ │ │ -DDeeffiinniittiioonn flatvectorview.hh:183 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:32 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ -Default implementation for derivative traits. │ │ │ │ -DDeeffiinniittiioonn defaultderivativetraits.hh:41 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_g_n_a_t_u_r_e_T_r_a_i_t_s │ │ │ │ -Helper class to deduce the signature of a callable. │ │ │ │ -DDeeffiinniittiioonn signature.hh:60 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_N_o_d_e_T_o_R_a_n_g_e_M_a_p │ │ │ │ -A simple node to range map using the nested tree indices. │ │ │ │ -DDeeffiinniittiioonn hierarchicnodetorangemap.hh:34 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:36 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_<_ _t_y_p_e_n_a_m_e_ _D_G_B_F_:_: │ │ │ │ -_B_a_s_i_s_,_ _t_y_p_e_n_a_m_e_ _D_G_B_F_:_:_V_e_c_t_o_r_,_ _t_y_p_e_n_a_m_e_ _D_G_B_F_:_:_N_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y_ _>_:_:_d_a_t_a__ │ │ │ │ -std::shared_ptr< const Data > data_ │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:225 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_d_o_f_s │ │ │ │ -const Vector & dofs() const │ │ │ │ -Return the coefficients of this discrete function by reference. │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:207 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_B_a_s_i_s │ │ │ │ -B Basis │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:38 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_T_r_e_e │ │ │ │ -typename Basis::LocalView::Tree Tree │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:47 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_V_e_c_t_o_r │ │ │ │ -V Vector │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:39 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_E_l_e_m_e_n_t │ │ │ │ -typename EntitySet::Element Element │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:53 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_D_o_m_a_i_n │ │ │ │ -typename EntitySet::LocalCoordinate LocalDomain │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:52 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_n_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y │ │ │ │ -const NodeToRangeEntry & nodeToRangeEntry() const │ │ │ │ -Return the stored node-to-range map. │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:213 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_N_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y │ │ │ │ -NTRE NodeToRangeEntry │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:48 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ -_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e │ │ │ │ -DiscreteGlobalBasisFunctionBase(const std::shared_ptr< const Data > &data) │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:192 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_G_r_i_d_V_i_e_w │ │ │ │ -typename Basis::GridView GridView │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:45 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_b_a_s_i_s │ │ │ │ -const Basis & basis() const │ │ │ │ -Return a const reference to the stored basis. │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:201 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_E_n_t_i_t_y_S_e_t │ │ │ │ -GridViewEntitySet< GridView, 0 > EntitySet │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:46 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_e_n_t_i_t_y_S_e_t │ │ │ │ -const EntitySet & entitySet() const │ │ │ │ -Get associated set of entities the local-function can be bound to. │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:219 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_D_o_m_a_i_n │ │ │ │ -typename EntitySet::GlobalCoordinate Domain │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:50 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_C_o_e_f_f_i_c_i_e_n_t │ │ │ │ -Dune::AutonomousValue< decltype(std::declval< Vector >()[std::declval< typename │ │ │ │ -Basis::MultiIndex >()])> Coefficient │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:43 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_D_a_t_a │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:61 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_D_a_t_a_:_:_e_n_t_i_t_y_S_e_t │ │ │ │ -EntitySet entitySet │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:62 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_D_a_t_a_:_: │ │ │ │ -_n_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y │ │ │ │ -std::shared_ptr< const NodeToRangeEntry > nodeToRangeEntry │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:65 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_D_a_t_a_:_:_b_a_s_i_s │ │ │ │ -std::shared_ptr< const Basis > basis │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:63 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_D_a_t_a_:_:_c_o_e_f_f_i_c_i_e_n_t_s │ │ │ │ -std::shared_ptr< const Vector > coefficients │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:64 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:70 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ -_o_p_e_r_a_t_o_r_= │ │ │ │ -LocalFunctionBase & operator=(const LocalFunctionBase &other) │ │ │ │ -Copy-assignment of the local-function. │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:108 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ -_b_o_u_n_d │ │ │ │ -bool bound() const │ │ │ │ -Check if LocalFunction is already bound to an element. │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:157 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ -_b_i_n_d │ │ │ │ -void bind(const Element &element) │ │ │ │ -Bind LocalFunction to grid element. │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:124 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ -_E_l_e_m_e_n_t │ │ │ │ -typename EntitySet::Element Element │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:76 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ -_l_o_c_a_l_C_o_n_t_e_x_t │ │ │ │ -const Element & localContext() const │ │ │ │ -Return the element the local-function is bound to. │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:163 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ -_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e │ │ │ │ -LocalFunctionBase(const LocalFunctionBase &other) │ │ │ │ -Copy-construct the local-function. │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:92 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ -_l_o_c_a_l_D_o_F_s__ │ │ │ │ -std::vector< Coefficient > localDoFs_ │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:188 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ -_a_s_s_i_g_n_W_i_t_h │ │ │ │ -void assignWith(To &to, const From &from) const │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:171 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ -_d_a_t_a__ │ │ │ │ -std::shared_ptr< const Data > data_ │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:186 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ -_n_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y │ │ │ │ -decltype(auto) nodeToRangeEntry(const Node &node, const TreePath &treePath, │ │ │ │ -Range &y) const │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:181 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ -_l_o_c_a_l_V_i_e_w__ │ │ │ │ -LocalView localView_ │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:187 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ -_u_n_b_i_n_d │ │ │ │ -void unbind() │ │ │ │ -Unbind the local-function. │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:151 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ -_D_o_m_a_i_n │ │ │ │ -LocalDomain Domain │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:75 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ -_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e │ │ │ │ -LocalFunctionBase(const std::shared_ptr< const Data > &data) │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:79 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e │ │ │ │ -Derivative of a DiscreteGlobalBasisFunction. │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:498 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_B_a_s_i_s │ │ │ │ -typename Base::Basis Basis │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:505 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ -friend Traits::DerivativeInterface derivative(const │ │ │ │ -DiscreteGlobalBasisFunctionDerivative &f) │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:667 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ -Range operator()(const Domain &x) const │ │ │ │ -Evaluate the discrete grid-function derivative in global coordinates. │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:657 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_R_a_n_g_e │ │ │ │ -typename SignatureTraits< typename DiscreteGlobalBasisFunction::Traits:: │ │ │ │ -DerivativeInterface >::Range Range │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:509 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_l_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -friend LocalFunction localFunction(const DiscreteGlobalBasisFunctionDerivative │ │ │ │ -&f) │ │ │ │ -Construct local function from a DiscreteGlobalBasisFunctionDerivative. │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:673 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_: │ │ │ │ -_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e │ │ │ │ -DiscreteGlobalBasisFunctionDerivative(const std::shared_ptr< const Data > │ │ │ │ -&data) │ │ │ │ -create object from DiscreateGlobalBasisFunction data │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:646 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_: │ │ │ │ -_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n │ │ │ │ -DGBF DiscreteGlobalBasisFunction │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:503 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_V_e_c_t_o_r │ │ │ │ -typename Base::Vector Vector │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:506 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_T_r_a_i_t_s │ │ │ │ -Imp::GridFunctionTraits< Range(Domain), typename Base::EntitySet, │ │ │ │ -DefaultDerivativeTraits, 16 > Traits │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:511 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_D_o_m_a_i_n │ │ │ │ -typename Base::Domain Domain │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:508 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ -friend DiscreteGlobalBasisFunctionDerivative< DiscreteGlobalBasisFunction > │ │ │ │ -derivative(const DiscreteGlobalBasisFunction &f) │ │ │ │ -Derivative of the DiscreteGlobalBasisFunction. │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:413 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n │ │ │ │ -DiscreteGlobalBasisFunction(B_T &&basis, V_T &&coefficients, NTRE_T │ │ │ │ -&&nodeToRangeEntry) │ │ │ │ -Create a grid-function, by wrapping the arguments in std::shared_ptr. │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:388 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n │ │ │ │ -DiscreteGlobalBasisFunction(std::shared_ptr< const Basis > basis, std:: │ │ │ │ -shared_ptr< const V > coefficients, std::shared_ptr< const typename Base:: │ │ │ │ -NodeToRangeEntry > nodeToRangeEntry) │ │ │ │ -Create a grid-function, by moving the arguments in std::shared_ptr. │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:393 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_l_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -friend LocalFunction localFunction(const DiscreteGlobalBasisFunction &t) │ │ │ │ -Construct local function from a DiscreteGlobalBasisFunction. │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:426 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_B_a_s_i_s │ │ │ │ -typename Base::Basis Basis │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:288 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_T_r_a_i_t_s │ │ │ │ -Imp::GridFunctionTraits< Range(Domain), typename Base::EntitySet, │ │ │ │ -DefaultDerivativeTraits, 16 > Traits │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:294 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_R_a_n_g_e │ │ │ │ -R Range │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:292 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_V_e_c_t_o_r │ │ │ │ -typename Base::Vector Vector │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:289 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_D_o_m_a_i_n │ │ │ │ -typename Base::Domain Domain │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:291 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:307 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_:_R_a_n_g_e │ │ │ │ -GlobalFunction::Range Range │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:316 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_:_D_o_m_a_i_n │ │ │ │ -typename LocalBase::Domain Domain │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:315 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -LocalFunction(const DiscreteGlobalBasisFunction &globalFunction) │ │ │ │ -Create a local-function from the associated grid-function. │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:320 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ -friend DiscreteGlobalBasisFunctionDerivative< DiscreteGlobalBasisFunction >:: │ │ │ │ -LocalFunction derivative(const LocalFunction &lf) │ │ │ │ -Local function of the derivative. │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:374 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_:_G_l_o_b_a_l_F_u_n_c_t_i_o_n │ │ │ │ -DiscreteGlobalBasisFunction GlobalFunction │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:314 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ -Range operator()(const Domain &x) const │ │ │ │ -Evaluate this local-function in coordinates x in the bound element. │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:336 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_:_E_l_e_m_e_n_t │ │ │ │ -typename LocalBase::Element Element │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:317 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -local function evaluating the derivative in reference coordinates │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:532 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_:_o_p_e_r_a_t_o_r │ │ │ │ -_(_) │ │ │ │ -Range operator()(const Domain &x) const │ │ │ │ -Evaluate this local-function in coordinates x in the bound element. │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:583 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_:_D_o_m_a_i_n │ │ │ │ -typename LocalBase::Domain Domain │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:539 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_:_E_l_e_m_e_n_t │ │ │ │ -typename LocalBase::Element Element │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:541 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_: │ │ │ │ -_d_e_r_i_v_a_t_i_v_e │ │ │ │ -friend Traits::LocalFunctionTraits::DerivativeInterface derivative(const │ │ │ │ -LocalFunction &) │ │ │ │ -Not implemented. │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:630 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_: │ │ │ │ -_G_l_o_b_a_l_F_u_n_c_t_i_o_n │ │ │ │ -DiscreteGlobalBasisFunctionDerivative GlobalFunction │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:538 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_:_R_a_n_g_e │ │ │ │ -GlobalFunction::Range Range │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:540 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_:_u_n_b_i_n_d │ │ │ │ -void unbind() │ │ │ │ -Unbind the local-function. │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:564 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_: │ │ │ │ -_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -LocalFunction(const GlobalFunction &globalFunction) │ │ │ │ -Create a local function from the associated grid function. │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:544 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_:_b_i_n_d │ │ │ │ -void bind(const Element &element) │ │ │ │ -Bind LocalFunction to grid element. │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:557 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t │ │ │ │ -An entity set for all entities of given codim in a grid view. │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:27 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_E_l_e_m_e_n_t │ │ │ │ -GridView::template Codim< codim >::Entity Element │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:36 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ -Element::Geometry::LocalCoordinate LocalCoordinate │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:39 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ -Element::Geometry::GlobalCoordinate GlobalCoordinate │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:40 │ │ │ │ -_c_o_n_c_e_p_t_s_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_a_s_S_t_a_t_i_c_S_i_z_e___v │ │ │ │ +constexpr bool HasStaticSize_v │ │ │ │ +A variable template representing the value of HasStaticSize. │ │ │ │ +DDeeffiinniittiioonn type_traits.hh:49 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_a_s_S_t_a_t_i_c_S_i_z_e │ │ │ │ +Check if type is a statically sized container. │ │ │ │ +DDeeffiinniittiioonn type_traits.hh:45 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_S_i_z_e_O_r_Z_e_r_o │ │ │ │ +Obtain size of statically sized container, or 0 if dynamic size. │ │ │ │ +DDeeffiinniittiioonn type_traits.hh:64 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ - * _d_i_s_c_r_e_t_e_g_l_o_b_a_l_b_a_s_i_s_f_u_n_c_t_i_o_n_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _t_y_p_e___t_r_a_i_t_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00065.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: composedgridfunction.hh File Reference │ │ │ +Dune-Functions: differentiablefunction.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,57 +88,51 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
composedgridfunction.hh File Reference
│ │ │ +
differentiablefunction.hh File Reference
│ │ │
│ │ │
│ │ │
#include <type_traits>
│ │ │ -#include <tuple>
│ │ │ -#include <dune/common/referencehelper.hh>
│ │ │ #include <dune/common/typeutilities.hh>
│ │ │ -#include <dune/functions/common/defaultderivativetraits.hh>
│ │ │ -#include <dune/functions/common/differentiablefunction.hh>
│ │ │ -#include <dune/functions/gridfunctions/gridfunction.hh>
│ │ │ +#include <dune/functions/common/type_traits.hh>
│ │ │ +#include <dune/functions/common/defaultderivativetraits.hh>
│ │ │ +#include <dune/functions/common/differentiablefunction_imp.hh>
│ │ │ +#include <dune/functions/common/signature.hh>
│ │ │ +#include <dune/functions/common/typeerasure.hh>
│ │ │ +#include <dune/functions/common/functionconcepts.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::ComposedGridFunction< OF, IF >
 Composition of grid functions with another function. More...
class  Dune::Functions::DifferentiableFunction< Signature, DerivativeTraits, bufferSize >
class  Dune::Functions::DifferentiableFunction< Range(Domain), DerivativeTraits, bufferSize >
 Class storing differentiable functions using type erasure. More...
│ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │

│ │ │ -Functions

template<class OF, class... IF>
 Dune::Functions::ComposedGridFunction (const OF &, const IF &...) -> ComposedGridFunction< OF, IF... >
template<class OF, class... IF>
auto Dune::Functions::makeComposedGridFunction (OF &&outerFunction, IF &&... innerFunction)
 Create a ComposedGridFunction that composes grid-functions with another function.
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,33 +1,28 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -composedgridfunction.hh File Reference │ │ │ │ +differentiablefunction.hh File Reference │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ #include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ #include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n___i_m_p_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_s_i_g_n_a_t_u_r_e_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e_e_r_a_s_u_r_e_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_<_ _O_F_,_ _I_F_ _> │ │ │ │ -  Composition of grid functions with another function. _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_<_ _S_i_g_n_a_t_u_r_e_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_, │ │ │ │ + _b_u_f_f_e_r_S_i_z_e_ _> │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ + _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_ _> │ │ │ │ +  Class storing differentiable functions using type erasure. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n (const OF &, const IF &...) - │ │ │ │ - > ComposedGridFunction< OF, IF... > │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n (OF &&outerFunction, IF &&... │ │ │ │ - innerFunction) │ │ │ │ -  Create a _C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n that composes grid-functions with another │ │ │ │ - function. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_p_o_s_e_d_g_r_i_d_f_u_n_c_t_i_o_n_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00065.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,4 +1,3 @@ │ │ │ │ var a00065 = [ │ │ │ │ - ["Dune::Functions::ComposedGridFunction", "a00318.html#ae70612d0758e301c3168bdeb2dad5bff", null], │ │ │ │ - ["Dune::Functions::makeComposedGridFunction", "a00308.html#ga9e5ac1cc0fdfb7d7a0e937f58aff21fd", null] │ │ │ │ + ["Dune::Functions::DifferentiableFunction< Signature, DerivativeTraits, bufferSize >", "a01238.html", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00065_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: composedgridfunction.hh Source File │ │ │ +Dune-Functions: differentiablefunction.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,226 +88,152 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
composedgridfunction.hh
│ │ │ +
differentiablefunction.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_HH
│ │ │ -
8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH
│ │ │ +
8#define DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH
│ │ │
9
│ │ │
10#include <type_traits>
│ │ │ -
11#include <tuple>
│ │ │ -
12
│ │ │ -
13#include <dune/common/referencehelper.hh>
│ │ │ -
14#include <dune/common/typeutilities.hh>
│ │ │ -
15
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
19
│ │ │ +
11
│ │ │ +
12#include <dune/common/typeutilities.hh>
│ │ │ +
13
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │
20
│ │ │
21namespace Dune {
│ │ │
22namespace Functions {
│ │ │
23
│ │ │
24
│ │ │ -
25
│ │ │ -
44template<class OF, class... IF>
│ │ │ -
│ │ │ - │ │ │ -
46{
│ │ │ -
47 using InnerFunctions = std::tuple<IF...>;
│ │ │ -
48 using InnerLocalFunctions = std::tuple<decltype(localFunction(resolveRef(std::declval<const IF&>())))...>;
│ │ │ -
49
│ │ │ -
50 template<std::size_t i>
│ │ │ -
51 using InnerFunction = std::decay_t<ResolveRef_t<std::tuple_element_t<i, InnerFunctions>>>;
│ │ │ -
52
│ │ │ -
53 using OuterFunction = OF;
│ │ │ -
54
│ │ │ -
55public:
│ │ │ -
56
│ │ │ -
57 using EntitySet = typename InnerFunction<0>::EntitySet;
│ │ │ -
58 using Element = typename EntitySet::Element;
│ │ │ -
59
│ │ │ -
60 using Domain = typename EntitySet::GlobalCoordinate;
│ │ │ -
61 using LocalDomain = typename EntitySet::LocalCoordinate;
│ │ │ -
62
│ │ │ -
63 using Range = decltype(std::declval<OF>()(localFunction(std::declval<IF>())(std::declval<LocalDomain>())...));
│ │ │ -
64
│ │ │ -
65private:
│ │ │ -
66
│ │ │ -
67 using Traits = Imp::GridFunctionTraits<Range(Domain), EntitySet, DefaultDerivativeTraits, 16>;
│ │ │ +
25
│ │ │ +
26/*
│ │ │ +
27 * Default implementation is empty
│ │ │ +
28 * The actual implementation is only given if Signature is an type
│ │ │ +
29 * describing a function signature as Range(Domain).
│ │ │ +
30 */
│ │ │ +
31template<class Signature, template<class> class DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>
│ │ │ +
│ │ │ + │ │ │ +
33{};
│ │ │ +
│ │ │ +
34
│ │ │ +
35
│ │ │ +
36
│ │ │ +
37namespace Imp
│ │ │ +
38{
│ │ │ +
39
│ │ │ +
41 template<class S, template<class> class DerivativeTraits, size_t bufferSize>
│ │ │ +
42 struct DifferentiableFunctionTraits
│ │ │ +
43 {
│ │ │ +
45 using Signature = S;
│ │ │ +
46
│ │ │ +
48 using Range = typename SignatureTraits<Signature>::Range;
│ │ │ +
49
│ │ │ +
51 using Domain = typename SignatureTraits<Signature>::Domain;
│ │ │ +
52
│ │ │ +
54 using DerivativeSignature = typename SignatureTraits<Signature>::template DerivativeSignature<DerivativeTraits>;
│ │ │ +
55
│ │ │ + │ │ │ +
58
│ │ │ +
60 using Concept = DifferentiableFunctionWrapperInterface<Signature, DerivativeInterface>;
│ │ │ +
61
│ │ │ +
63 template<class B>
│ │ │ +
64 using Model = DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>;
│ │ │ +
65 };
│ │ │ +
66}
│ │ │ +
67
│ │ │
68
│ │ │ -
69 class LocalFunction
│ │ │ -
70 {
│ │ │ -
71 public:
│ │ │ -
78 LocalFunction(const ComposedGridFunction& globalFunction) :
│ │ │ -
79 globalFunction_(globalFunction),
│ │ │ -
80 innerLocalFunctions_(globalFunction.innerLocalFunctions())
│ │ │ -
81 {}
│ │ │ -
82
│ │ │ -
92 void bind(const Element& element)
│ │ │ -
93 {
│ │ │ -
94 std::apply([&](auto&... innerFunction) {
│ │ │ -
95 (innerFunction.bind(element),...);
│ │ │ -
96 }, innerLocalFunctions_);
│ │ │ -
97 }
│ │ │ -
98
│ │ │ -
100 void unbind()
│ │ │ -
101 {
│ │ │ -
102 std::apply([&](auto&... innerFunction) {
│ │ │ -
103 (innerFunction.unbind(),...);
│ │ │ -
104 }, innerLocalFunctions_);
│ │ │ -
105 }
│ │ │ -
106
│ │ │ -
109 bool bound() const
│ │ │ -
110 {
│ │ │ -
111 return std::apply([](const auto&... innerFunction) {
│ │ │ -
112 return (innerFunction.bound() && ...);
│ │ │ -
113 }, innerLocalFunctions_);
│ │ │ -
114 }
│ │ │ +
69
│ │ │ +
84template<class Range, class Domain, template<class> class DerivativeTraits, size_t bufferSize>
│ │ │ +
│ │ │ +
85class DifferentiableFunction< Range(Domain), DerivativeTraits, bufferSize> :
│ │ │ +
86 public TypeErasureBase<
│ │ │ +
87 typename Imp::DifferentiableFunctionTraits<Range(Domain), DerivativeTraits, bufferSize>::Concept,
│ │ │ +
88 Imp::DifferentiableFunctionTraits<Range(Domain), DerivativeTraits, bufferSize>::template Model>
│ │ │ +
89{
│ │ │ +
90 using Traits = Imp::DifferentiableFunctionTraits<Range(Domain), DerivativeTraits, bufferSize>;
│ │ │ +
91
│ │ │ + │ │ │ +
93
│ │ │ +
94 using DerivativeInterface = typename Traits::DerivativeInterface;
│ │ │ +
95
│ │ │ +
96public:
│ │ │ +
97
│ │ │ +
109 template<class F, disableCopyMove<DifferentiableFunction, F> = 0 >
│ │ │ +
│ │ │ + │ │ │ +
111 Base(std::forward<F>(f))
│ │ │ +
112 {
│ │ │ +
113 static_assert(Dune::Functions::Concept::isFunction<F, Range(Domain)>(), "Trying to construct a DifferentiableFunction from type that does not model the Function concept");
│ │ │ +
114 }
│ │ │ +
│ │ │
115
│ │ │ -
125 Range operator()(const LocalDomain& x) const
│ │ │ -
126 {
│ │ │ -
127 return std::apply([&](const auto&... innerFunction) {
│ │ │ -
128 return globalFunction_.outerFunction_(innerFunction(x)...);
│ │ │ -
129 }, innerLocalFunctions_);
│ │ │ -
130 }
│ │ │ -
131
│ │ │ -
141 const Element& localContext() const
│ │ │ -
142 {
│ │ │ -
143 return std::get<0>(innerLocalFunctions_).localContext();
│ │ │ -
144 }
│ │ │ -
145
│ │ │ -
147 friend typename Traits::LocalFunctionTraits::DerivativeInterface derivative(const LocalFunction& t)
│ │ │ -
148 {
│ │ │ -
149 DUNE_THROW(NotImplemented,"not implemented");
│ │ │ -
150 }
│ │ │ -
151
│ │ │ -
152 private:
│ │ │ -
153 const ComposedGridFunction& globalFunction_;
│ │ │ -
154 InnerLocalFunctions innerLocalFunctions_;
│ │ │ -
155 };
│ │ │ -
156
│ │ │ -
157public:
│ │ │ -
158
│ │ │ -
168 template<class OFT, class... IFT,
│ │ │ -
169 disableCopyMove<ComposedGridFunction, OFT> = 0,
│ │ │ -
170 std::enable_if_t<(sizeof...(IFT) > 0), int> = 0>
│ │ │ -
│ │ │ -
171 ComposedGridFunction(OFT&& outerFunction, IFT&&... innerFunctions) :
│ │ │ -
172 outerFunction_(std::forward<OFT>(outerFunction)),
│ │ │ -
173 innerFunctions_(std::forward<IFT>(innerFunctions)...)
│ │ │ -
174 {}
│ │ │ -
│ │ │ -
175
│ │ │ -
│ │ │ -
177 Range operator()(const Domain& x) const
│ │ │ -
178 {
│ │ │ -
179 return std::apply([&](const auto&... innerFunction) {
│ │ │ -
180 return outerFunction_(innerFunction(x)...);
│ │ │ -
181 }, innerFunctions_);
│ │ │ -
182 }
│ │ │ -
│ │ │ -
183
│ │ │ -
│ │ │ -
185 friend typename Traits::DerivativeInterface derivative(const ComposedGridFunction& t)
│ │ │ -
186 {
│ │ │ -
187 DUNE_THROW(NotImplemented,"not implemented");
│ │ │ -
188 }
│ │ │ -
│ │ │ -
189
│ │ │ -
│ │ │ -
196 friend LocalFunction localFunction(const ComposedGridFunction& cgf)
│ │ │ -
197 {
│ │ │ -
198 return LocalFunction(cgf);
│ │ │ -
199 }
│ │ │ -
│ │ │ -
200
│ │ │ -
│ │ │ -
211 const EntitySet& entitySet() const
│ │ │ -
212 {
│ │ │ -
213 return resolveRef(std::get<0>(innerFunctions_)).entitySet();
│ │ │ -
214 }
│ │ │ -
│ │ │ -
215
│ │ │ -
216protected:
│ │ │ -
217
│ │ │ -
│ │ │ -
218 InnerLocalFunctions innerLocalFunctions() const
│ │ │ -
219 {
│ │ │ -
220 return std::apply([&](const auto&... innerFunction) {
│ │ │ -
221 return std::make_tuple(localFunction(resolveRef(innerFunction))...);
│ │ │ -
222 }, innerFunctions_);
│ │ │ -
223 }
│ │ │ -
│ │ │ -
224
│ │ │ -
225 OuterFunction outerFunction_;
│ │ │ -
226 InnerFunctions innerFunctions_;
│ │ │ -
227};
│ │ │ -
│ │ │ -
228
│ │ │ -
229// deduction guides
│ │ │ -
230template<class OF, class... IF>
│ │ │ -
231ComposedGridFunction(const OF&, const IF&...)
│ │ │ -
232 -> ComposedGridFunction<OF,IF...>;
│ │ │ -
233
│ │ │ -
234
│ │ │ -
257template<class OF, class... IF>
│ │ │ -
│ │ │ -
258auto makeComposedGridFunction(OF&& outerFunction, IF&&... innerFunction)
│ │ │ -
259{
│ │ │ -
260 using ComposedGridFunctionType = ComposedGridFunction<std::decay_t<OF>, std::decay_t<IF>...>;
│ │ │ -
261 return ComposedGridFunctionType(std::forward<OF>(outerFunction), std::forward<IF>(innerFunction)...);
│ │ │ -
262}
│ │ │ -
│ │ │ -
263
│ │ │ -
264
│ │ │ -
265
│ │ │ -
266}} // namespace Dune::Functions
│ │ │ -
267
│ │ │ -
268
│ │ │ -
269
│ │ │ -
270#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_HH
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
auto makeComposedGridFunction(OF &&outerFunction, IF &&... innerFunction)
Create a ComposedGridFunction that composes grid-functions with another function.
Definition composedgridfunction.hh:258
│ │ │ + │ │ │ +
118
│ │ │ +
│ │ │ +
122 Range operator() (const Domain& x) const
│ │ │ +
123 {
│ │ │ +
124 return this->asInterface().operator()(x);
│ │ │ +
125 }
│ │ │ +
│ │ │ +
126
│ │ │ +
│ │ │ +
134 friend DerivativeInterface derivative(const DifferentiableFunction& t)
│ │ │ +
135 {
│ │ │ +
136 return t.asInterface().derivative();
│ │ │ +
137 }
│ │ │ +
│ │ │ +
138};
│ │ │ +
│ │ │ +
139
│ │ │ +
140
│ │ │ +
141
│ │ │ +
142}} // namespace Dune::Functions
│ │ │ +
143
│ │ │ +
144
│ │ │ +
145
│ │ │ +
146#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
static constexpr bool isFunction()
Check if F models the Function concept with given signature.
Definition functionconcepts.hh:92
│ │ │ +
friend DerivativeInterface derivative(const DifferentiableFunction &t)
Get derivative of wrapped function.
Definition differentiablefunction.hh:134
│ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
ComposedGridFunction(const OF &, const IF &...) -> ComposedGridFunction< OF, IF... >
│ │ │ +
Definition backends/concepts.hh:17
│ │ │
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:41
│ │ │ -
Composition of grid functions with another function.
Definition composedgridfunction.hh:46
│ │ │ -
OuterFunction outerFunction_
Definition composedgridfunction.hh:225
│ │ │ -
InnerFunctions innerFunctions_
Definition composedgridfunction.hh:226
│ │ │ -
ComposedGridFunction(OFT &&outerFunction, IFT &&... innerFunctions)
Create ComposedGridFunction.
Definition composedgridfunction.hh:171
│ │ │ -
const EntitySet & entitySet() const
Return the EntitySet associated to this composed grid-function.
Definition composedgridfunction.hh:211
│ │ │ -
typename InnerFunction< 0 >::EntitySet EntitySet
Definition composedgridfunction.hh:57
│ │ │ -
typename EntitySet::LocalCoordinate LocalDomain
Definition composedgridfunction.hh:61
│ │ │ -
typename EntitySet::Element Element
Definition composedgridfunction.hh:58
│ │ │ -
InnerLocalFunctions innerLocalFunctions() const
Definition composedgridfunction.hh:218
│ │ │ -
friend LocalFunction localFunction(const ComposedGridFunction &cgf)
Create a local-function of this composed grid-function.
Definition composedgridfunction.hh:196
│ │ │ -
typename EntitySet::GlobalCoordinate Domain
Definition composedgridfunction.hh:60
│ │ │ -
Range operator()(const Domain &x) const
Evaluation of the composed grid function in coordinates x.
Definition composedgridfunction.hh:177
│ │ │ -
friend Traits::DerivativeInterface derivative(const ComposedGridFunction &t)
Not implemented.
Definition composedgridfunction.hh:185
│ │ │ -
decltype(std::declval< OF >()(localFunction(std::declval< IF >())(std::declval< LocalDomain >())...)) Range
Definition composedgridfunction.hh:63
│ │ │ +
Definition differentiablefunction.hh:33
│ │ │ +
DifferentiableFunction(F &&f)
Construct from function.
Definition differentiablefunction.hh:110
│ │ │ + │ │ │ +
Helper class to deduce the signature of a callable.
Definition signature.hh:60
│ │ │ + │ │ │ + │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,253 +1,178 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -composedgridfunction.hh │ │ │ │ +differentiablefunction.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_HH │ │ │ │ -8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH │ │ │ │ +8#define DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH │ │ │ │ 9 │ │ │ │ 10#include │ │ │ │ -11#include │ │ │ │ -12 │ │ │ │ -13#include │ │ │ │ -14#include │ │ │ │ -15 │ │ │ │ -16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ -17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ -18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ -19 │ │ │ │ +11 │ │ │ │ +12#include │ │ │ │ +13 │ │ │ │ +14#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ +15#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ +16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n___i_m_p_._h_h> │ │ │ │ +17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_s_i_g_n_a_t_u_r_e_._h_h> │ │ │ │ +18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e_e_r_a_s_u_r_e_._h_h> │ │ │ │ +19#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ 20 │ │ │ │ 21namespace _D_u_n_e { │ │ │ │ 22namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ 23 │ │ │ │ 24 │ │ │ │ 25 │ │ │ │ -44template │ │ │ │ -_4_5class _C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ -46{ │ │ │ │ -47 using InnerFunctions = std::tuple; │ │ │ │ -48 using InnerLocalFunctions = std::tuple())))...>; │ │ │ │ +26/* │ │ │ │ +27 * Default implementation is empty │ │ │ │ +28 * The actual implementation is only given if Signature is an type │ │ │ │ +29 * describing a function signature as Range(Domain). │ │ │ │ +30 */ │ │ │ │ +31template class │ │ │ │ +DerivativeTraits=_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s, size_t bufferSize=56> │ │ │ │ +_3_2class _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n │ │ │ │ +33{}; │ │ │ │ +34 │ │ │ │ +35 │ │ │ │ +36 │ │ │ │ +37namespace Imp │ │ │ │ +38{ │ │ │ │ +39 │ │ │ │ +41 template class DerivativeTraits, size_t bufferSize> │ │ │ │ +42 struct DifferentiableFunctionTraits │ │ │ │ +43 { │ │ │ │ +45 using Signature = S; │ │ │ │ +46 │ │ │ │ +48 using Range = typename _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s_<_S_i_g_n_a_t_u_r_e_>_:_:_R_a_n_g_e; │ │ │ │ 49 │ │ │ │ -50 template │ │ │ │ -51 using InnerFunction = std::decay_t>>; │ │ │ │ +51 using Domain = typename _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s_<_S_i_g_n_a_t_u_r_e_>_:_:_D_o_m_a_i_n; │ │ │ │ 52 │ │ │ │ -53 using OuterFunction = OF; │ │ │ │ -54 │ │ │ │ -55public: │ │ │ │ -56 │ │ │ │ -_5_7 using _E_n_t_i_t_y_S_e_t = typename InnerFunction<0>::EntitySet; │ │ │ │ -_5_8 using _E_l_e_m_e_n_t = typename EntitySet::Element; │ │ │ │ -59 │ │ │ │ -_6_0 using _D_o_m_a_i_n = typename EntitySet::GlobalCoordinate; │ │ │ │ -_6_1 using _L_o_c_a_l_D_o_m_a_i_n = typename EntitySet::LocalCoordinate; │ │ │ │ -62 │ │ │ │ -_6_3 using _R_a_n_g_e = decltype(std::declval()(_l_o_c_a_l_F_u_n_c_t_i_o_n(std::declval()) │ │ │ │ -(std::declval())...)); │ │ │ │ -64 │ │ │ │ -65private: │ │ │ │ -66 │ │ │ │ -67 using Traits = Imp::GridFunctionTraits<_R_a_n_g_e(_D_o_m_a_i_n), _E_n_t_i_t_y_S_e_t, │ │ │ │ -_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s, 16>; │ │ │ │ +54 using DerivativeSignature = typename _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s_<_S_i_g_n_a_t_u_r_e_>_:_:_t_e_m_p_l_a_t_e │ │ │ │ +DerivativeSignature; │ │ │ │ +55 │ │ │ │ +57 using DerivativeInterface = _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_<_D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_>; │ │ │ │ +58 │ │ │ │ +60 using _C_o_n_c_e_p_t = DifferentiableFunctionWrapperInterface; │ │ │ │ +61 │ │ │ │ +63 template │ │ │ │ +64 using Model = DifferentiableFunctionWrapperImplementation; │ │ │ │ +65 }; │ │ │ │ +66} │ │ │ │ +67 │ │ │ │ 68 │ │ │ │ -69 class LocalFunction │ │ │ │ -70 { │ │ │ │ -71 public: │ │ │ │ -78 LocalFunction(const _C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n& globalFunction) : │ │ │ │ -79 globalFunction_(globalFunction), │ │ │ │ -80 innerLocalFunctions_(globalFunction._i_n_n_e_r_L_o_c_a_l_F_u_n_c_t_i_o_n_s()) │ │ │ │ -81 {} │ │ │ │ -82 │ │ │ │ -92 void bind(const _E_l_e_m_e_n_t& element) │ │ │ │ -93 { │ │ │ │ -94 std::apply([&](auto&... innerFunction) { │ │ │ │ -95 (innerFunction.bind(element),...); │ │ │ │ -96 }, innerLocalFunctions_); │ │ │ │ -97 } │ │ │ │ -98 │ │ │ │ -100 void unbind() │ │ │ │ -101 { │ │ │ │ -102 std::apply([&](auto&... innerFunction) { │ │ │ │ -103 (innerFunction.unbind(),...); │ │ │ │ -104 }, innerLocalFunctions_); │ │ │ │ -105 } │ │ │ │ -106 │ │ │ │ -109 bool bound() const │ │ │ │ -110 { │ │ │ │ -111 return std::apply([](const auto&... innerFunction) { │ │ │ │ -112 return (innerFunction.bound() && ...); │ │ │ │ -113 }, innerLocalFunctions_); │ │ │ │ +69 │ │ │ │ +84template class DerivativeTraits, │ │ │ │ +size_t bufferSize> │ │ │ │ +_8_5class _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n< Range(Domain), DerivativeTraits, bufferSize> : │ │ │ │ +86 public _T_y_p_e_E_r_a_s_u_r_e_B_a_s_e< │ │ │ │ +87 typename Imp::DifferentiableFunctionTraits::Concept, │ │ │ │ +88 Imp::DifferentiableFunctionTraits::template Model> │ │ │ │ +89{ │ │ │ │ +90 using Traits = Imp::DifferentiableFunctionTraits; │ │ │ │ +91 │ │ │ │ +92 using Base = _T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_<_t_y_p_e_n_a_m_e_ _T_r_a_i_t_s_:_:_C_o_n_c_e_p_t_,_ _T_r_a_i_t_s_:_:_t_e_m_p_l_a_t_e │ │ │ │ +_M_o_d_e_l_>; │ │ │ │ +93 │ │ │ │ +94 using DerivativeInterface = typename Traits::DerivativeInterface; │ │ │ │ +95 │ │ │ │ +96public: │ │ │ │ +97 │ │ │ │ +109 template = 0 > │ │ │ │ +_1_1_0 _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n(F&& f) : │ │ │ │ +111 Base(std::forward(f)) │ │ │ │ +112 { │ │ │ │ +113 static_assert(_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_F_u_n_c_t_i_o_n_<_F_,_ _R_a_n_g_e_(_D_o_m_a_i_n_)_>(), │ │ │ │ +"Trying to construct a DifferentiableFunction from type that does not model the │ │ │ │ +Function concept"); │ │ │ │ 114 } │ │ │ │ 115 │ │ │ │ -125 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(const _L_o_c_a_l_D_o_m_a_i_n& x) const │ │ │ │ -126 { │ │ │ │ -127 return std::apply([&](const auto&... innerFunction) { │ │ │ │ -128 return globalFunction_._o_u_t_e_r_F_u_n_c_t_i_o_n__(innerFunction(x)...); │ │ │ │ -129 }, innerLocalFunctions_); │ │ │ │ -130 } │ │ │ │ -131 │ │ │ │ -141 const _E_l_e_m_e_n_t& localContext() const │ │ │ │ -142 { │ │ │ │ -143 return std::get<0>(innerLocalFunctions_).localContext(); │ │ │ │ -144 } │ │ │ │ +_1_1_7 _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n() = default; │ │ │ │ +118 │ │ │ │ +_1_2_2 Range operator() (const Domain& x) const │ │ │ │ +123 { │ │ │ │ +124 return this->_a_s_I_n_t_e_r_f_a_c_e().operator()(x); │ │ │ │ +125 } │ │ │ │ +126 │ │ │ │ +_1_3_4 friend DerivativeInterface _d_e_r_i_v_a_t_i_v_e(const _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n& t) │ │ │ │ +135 { │ │ │ │ +136 return t.asInterface().derivative(); │ │ │ │ +137 } │ │ │ │ +138}; │ │ │ │ +139 │ │ │ │ +140 │ │ │ │ +141 │ │ │ │ +142}} // namespace Dune::Functions │ │ │ │ +143 │ │ │ │ +144 │ │ │ │ 145 │ │ │ │ -147 friend typename Traits::LocalFunctionTraits::DerivativeInterface _d_e_r_i_v_a_t_i_v_e │ │ │ │ -(const LocalFunction& t) │ │ │ │ -148 { │ │ │ │ -149 DUNE_THROW(NotImplemented,"not implemented"); │ │ │ │ -150 } │ │ │ │ -151 │ │ │ │ -152 private: │ │ │ │ -153 const _C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n& globalFunction_; │ │ │ │ -154 InnerLocalFunctions innerLocalFunctions_; │ │ │ │ -155 }; │ │ │ │ -156 │ │ │ │ -157public: │ │ │ │ -158 │ │ │ │ -168 template = 0, │ │ │ │ -170 std::enable_if_t<(sizeof...(IFT) > 0), int> = 0> │ │ │ │ -_1_7_1 _C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n(OFT&& outerFunction, IFT&&... innerFunctions) : │ │ │ │ -172 _o_u_t_e_r_F_u_n_c_t_i_o_n__(std::forward(outerFunction)), │ │ │ │ -173 _i_n_n_e_r_F_u_n_c_t_i_o_n_s__(std::forward(innerFunctions)...) │ │ │ │ -174 {} │ │ │ │ -175 │ │ │ │ -_1_7_7 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(const _D_o_m_a_i_n& x) const │ │ │ │ -178 { │ │ │ │ -179 return std::apply([&](const auto&... innerFunction) { │ │ │ │ -180 return _o_u_t_e_r_F_u_n_c_t_i_o_n__(innerFunction(x)...); │ │ │ │ -181 }, _i_n_n_e_r_F_u_n_c_t_i_o_n_s__); │ │ │ │ -182 } │ │ │ │ -183 │ │ │ │ -_1_8_5 friend typename Traits::DerivativeInterface _d_e_r_i_v_a_t_i_v_e(const │ │ │ │ -_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n& t) │ │ │ │ -186 { │ │ │ │ -187 DUNE_THROW(NotImplemented,"not implemented"); │ │ │ │ -188 } │ │ │ │ -189 │ │ │ │ -_1_9_6 friend LocalFunction _l_o_c_a_l_F_u_n_c_t_i_o_n(const _C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n& cgf) │ │ │ │ -197 { │ │ │ │ -198 return LocalFunction(cgf); │ │ │ │ -199 } │ │ │ │ -200 │ │ │ │ -_2_1_1 const _E_n_t_i_t_y_S_e_t& _e_n_t_i_t_y_S_e_t() const │ │ │ │ -212 { │ │ │ │ -213 return resolveRef(std::get<0>(_i_n_n_e_r_F_u_n_c_t_i_o_n_s__)).entitySet(); │ │ │ │ -214 } │ │ │ │ -215 │ │ │ │ -216protected: │ │ │ │ -217 │ │ │ │ -_2_1_8 InnerLocalFunctions _i_n_n_e_r_L_o_c_a_l_F_u_n_c_t_i_o_n_s() const │ │ │ │ -219 { │ │ │ │ -220 return std::apply([&](const auto&... innerFunction) { │ │ │ │ -221 return std::make_tuple(_l_o_c_a_l_F_u_n_c_t_i_o_n(resolveRef(innerFunction))...); │ │ │ │ -222 }, _i_n_n_e_r_F_u_n_c_t_i_o_n_s__); │ │ │ │ -223 } │ │ │ │ -224 │ │ │ │ -_2_2_5 OuterFunction _o_u_t_e_r_F_u_n_c_t_i_o_n__; │ │ │ │ -_2_2_6 InnerFunctions _i_n_n_e_r_F_u_n_c_t_i_o_n_s__; │ │ │ │ -227}; │ │ │ │ -228 │ │ │ │ -229// deduction guides │ │ │ │ -230template │ │ │ │ -_2_3_1_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n(const OF&, const IF&...) │ │ │ │ -232 -> _C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n; │ │ │ │ -233 │ │ │ │ -234 │ │ │ │ -257template │ │ │ │ -_2_5_8auto _m_a_k_e_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n(OF&& outerFunction, IF&&... innerFunction) │ │ │ │ -259{ │ │ │ │ -260 using ComposedGridFunctionType = _C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_<_s_t_d_:_:_d_e_c_a_y___t_<_O_F_>, │ │ │ │ -std::decay_t...>; │ │ │ │ -261 return ComposedGridFunctionType(std::forward(outerFunction), std:: │ │ │ │ -forward(innerFunction)...); │ │ │ │ -262} │ │ │ │ -263 │ │ │ │ -264 │ │ │ │ -265 │ │ │ │ -266}} // namespace Dune::Functions │ │ │ │ -267 │ │ │ │ -268 │ │ │ │ -269 │ │ │ │ -270#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_HH │ │ │ │ -_g_r_i_d_f_u_n_c_t_i_o_n_._h_h │ │ │ │ -_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h │ │ │ │ +146#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH │ │ │ │ +_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h │ │ │ │ +_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n___i_m_p_._h_h │ │ │ │ +_t_y_p_e___t_r_a_i_t_s_._h_h │ │ │ │ +_t_y_p_e_e_r_a_s_u_r_e_._h_h │ │ │ │ +_s_i_g_n_a_t_u_r_e_._h_h │ │ │ │ _d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_:_:_m_a_k_e_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ -auto makeComposedGridFunction(OF &&outerFunction, IF &&... innerFunction) │ │ │ │ -Create a ComposedGridFunction that composes grid-functions with another │ │ │ │ -function. │ │ │ │ -DDeeffiinniittiioonn composedgridfunction.hh:258 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_F_u_n_c_t_i_o_n │ │ │ │ +static constexpr bool isFunction() │ │ │ │ +Check if F models the Function concept with given signature. │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:92 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_, │ │ │ │ +_b_u_f_f_e_r_S_i_z_e_ _>_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ +friend DerivativeInterface derivative(const DifferentiableFunction &t) │ │ │ │ +Get derivative of wrapped function. │ │ │ │ +DDeeffiinniittiioonn differentiablefunction.hh:134 │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ -ComposedGridFunction(const OF &, const IF &...) -> ComposedGridFunction< OF, │ │ │ │ -IF... > │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t │ │ │ │ +DDeeffiinniittiioonn backends/concepts.hh:17 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ Default implementation for derivative traits. │ │ │ │ DDeeffiinniittiioonn defaultderivativetraits.hh:41 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ -Composition of grid functions with another function. │ │ │ │ -DDeeffiinniittiioonn composedgridfunction.hh:46 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_:_:_o_u_t_e_r_F_u_n_c_t_i_o_n__ │ │ │ │ -OuterFunction outerFunction_ │ │ │ │ -DDeeffiinniittiioonn composedgridfunction.hh:225 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_:_:_i_n_n_e_r_F_u_n_c_t_i_o_n_s__ │ │ │ │ -InnerFunctions innerFunctions_ │ │ │ │ -DDeeffiinniittiioonn composedgridfunction.hh:226 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ -ComposedGridFunction(OFT &&outerFunction, IFT &&... innerFunctions) │ │ │ │ -Create ComposedGridFunction. │ │ │ │ -DDeeffiinniittiioonn composedgridfunction.hh:171 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_:_:_e_n_t_i_t_y_S_e_t │ │ │ │ -const EntitySet & entitySet() const │ │ │ │ -Return the EntitySet associated to this composed grid-function. │ │ │ │ -DDeeffiinniittiioonn composedgridfunction.hh:211 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_:_:_E_n_t_i_t_y_S_e_t │ │ │ │ -typename InnerFunction< 0 >::EntitySet EntitySet │ │ │ │ -DDeeffiinniittiioonn composedgridfunction.hh:57 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_:_:_L_o_c_a_l_D_o_m_a_i_n │ │ │ │ -typename EntitySet::LocalCoordinate LocalDomain │ │ │ │ -DDeeffiinniittiioonn composedgridfunction.hh:61 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_:_:_E_l_e_m_e_n_t │ │ │ │ -typename EntitySet::Element Element │ │ │ │ -DDeeffiinniittiioonn composedgridfunction.hh:58 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_:_:_i_n_n_e_r_L_o_c_a_l_F_u_n_c_t_i_o_n_s │ │ │ │ -InnerLocalFunctions innerLocalFunctions() const │ │ │ │ -DDeeffiinniittiioonn composedgridfunction.hh:218 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_:_:_l_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -friend LocalFunction localFunction(const ComposedGridFunction &cgf) │ │ │ │ -Create a local-function of this composed grid-function. │ │ │ │ -DDeeffiinniittiioonn composedgridfunction.hh:196 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_:_:_D_o_m_a_i_n │ │ │ │ -typename EntitySet::GlobalCoordinate Domain │ │ │ │ -DDeeffiinniittiioonn composedgridfunction.hh:60 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ -Range operator()(const Domain &x) const │ │ │ │ -Evaluation of the composed grid function in coordinates x. │ │ │ │ -DDeeffiinniittiioonn composedgridfunction.hh:177 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ -friend Traits::DerivativeInterface derivative(const ComposedGridFunction &t) │ │ │ │ -Not implemented. │ │ │ │ -DDeeffiinniittiioonn composedgridfunction.hh:185 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_:_:_R_a_n_g_e │ │ │ │ -decltype(std::declval< OF >()(localFunction(std::declval< IF >())(std::declval< │ │ │ │ -LocalDomain >())...)) Range │ │ │ │ -DDeeffiinniittiioonn composedgridfunction.hh:63 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n │ │ │ │ +DDeeffiinniittiioonn differentiablefunction.hh:33 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_, │ │ │ │ +_b_u_f_f_e_r_S_i_z_e_ _>_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n │ │ │ │ +DifferentiableFunction(F &&f) │ │ │ │ +Construct from function. │ │ │ │ +DDeeffiinniittiioonn differentiablefunction.hh:110 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_, │ │ │ │ +_b_u_f_f_e_r_S_i_z_e_ _>_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n │ │ │ │ +DifferentiableFunction()=default │ │ │ │ +Default constructor. │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_g_n_a_t_u_r_e_T_r_a_i_t_s │ │ │ │ +Helper class to deduce the signature of a callable. │ │ │ │ +DDeeffiinniittiioonn signature.hh:60 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_<_ _I_m_p_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_T_r_a_i_t_s_<_ _R_a_n_g_e │ │ │ │ +_(_D_o_m_a_i_n_)_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_ _>_:_:_C_o_n_c_e_p_t_,_ _I_m_p_:_: │ │ │ │ +_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_T_r_a_i_t_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_ _>_:_: │ │ │ │ +_t_e_m_p_l_a_t_e_ _M_o_d_e_l_ _>_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e │ │ │ │ +TypeErasureBase(T &&t) │ │ │ │ +DDeeffiinniittiioonn typeerasure.hh:174 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_<_ _I_m_p_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_T_r_a_i_t_s_<_ _R_a_n_g_e │ │ │ │ +_(_D_o_m_a_i_n_)_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_ _>_:_:_C_o_n_c_e_p_t_,_ _I_m_p_:_: │ │ │ │ +_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_T_r_a_i_t_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_ _>_:_: │ │ │ │ +_t_e_m_p_l_a_t_e_ _M_o_d_e_l_ _>_:_:_a_s_I_n_t_e_r_f_a_c_e │ │ │ │ +Imp::DifferentiableFunctionTraits< Range(Domain), DerivativeTraits, bufferSize │ │ │ │ +>::Concept & asInterface() │ │ │ │ +DDeeffiinniittiioonn typeerasure.hh:182 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_p_o_s_e_d_g_r_i_d_f_u_n_c_t_i_o_n_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00068.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: coarsefunctiononfinegridview.hh File Reference │ │ │ +Dune-Functions: squeezetensor.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,33 +88,22 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
coarsefunctiononfinegridview.hh File Reference
│ │ │ +
squeezetensor.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <optional>
│ │ │ -#include <type_traits>
│ │ │ -#include <utility>
│ │ │ -#include <dune/common/referencehelper.hh>
│ │ │ -#include <dune/functions/common/defaultderivativetraits.hh>
│ │ │ -#include <dune/functions/common/geometryinancestor.hh>
│ │ │ -#include <dune/functions/gridfunctions/gridfunction.hh>
│ │ │ -#include <dune/functions/gridfunctions/gridviewentityset.hh>
│ │ │ +
#include <dune/common/fvector.hh>
│ │ │ +#include <dune/common/fmatrix.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ -

│ │ │ -Classes

class  Dune::Functions::CoarseFunctionOnFineGridView< GridFunction, GV, DerivativeTraits >
 A wrapper representing a coarse grid function on a fine gridview. More...
│ │ │ │ │ │ │ │ │ │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
│ │ │
│ │ │
│ │ │ @@ -125,13 +114,13 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,27 +1,16 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -coarsefunctiononfinegridview.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_g_e_o_m_e_t_r_y_i_n_a_n_c_e_s_t_o_r_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h> │ │ │ │ +squeezetensor.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ -CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_<_ _G_r_i_d_F_u_n_c_t_i_o_n_,_ _G_V_, │ │ │ │ - _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _> │ │ │ │ -  A wrapper representing a coarse grid function on a fine gridview. │ │ │ │ - _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_a_r_s_e_f_u_n_c_t_i_o_n_o_n_f_i_n_e_g_r_i_d_v_i_e_w_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _s_q_u_e_e_z_e_t_e_n_s_o_r_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00068_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: coarsefunctiononfinegridview.hh Source File │ │ │ +Dune-Functions: squeezetensor.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,236 +88,83 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
coarsefunctiononfinegridview.hh
│ │ │ +
squeezetensor.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │ -
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_COARSEFUNCTIONONFINEGRIDVIEW_HH
│ │ │ -
8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_COARSEFUNCTIONONFINEGRIDVIEW_HH
│ │ │ -
9
│ │ │ -
10#include <optional>
│ │ │ -
11#include <type_traits>
│ │ │ -
12#include <utility>
│ │ │ -
13
│ │ │ -
14#include <dune/common/referencehelper.hh>
│ │ │ -
15
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
20
│ │ │ -
21namespace Dune::Functions {
│ │ │ -
22
│ │ │ -
23
│ │ │ +
6#ifndef DUNE_FUNCTIONS_COMMON_SQUEEZETENSOR_HH
│ │ │ +
7#define DUNE_FUNCTIONS_COMMON_SQUEEZETENSOR_HH
│ │ │ +
8
│ │ │ +
9#include <dune/common/fvector.hh>
│ │ │ +
10#include <dune/common/fmatrix.hh>
│ │ │ +
11
│ │ │ +
12namespace Dune::Functions
│ │ │ +
13{
│ │ │ +
14 namespace Impl
│ │ │ +
15 {
│ │ │ +
20 template<class Object>
│ │ │ +
21 constexpr Object& squeezeTensor(Object& o){
│ │ │ +
22 return o;
│ │ │ +
23 }
│ │ │
24
│ │ │ -
39template<class GridFunction, class GV, template<class> class DerivativeTraits=Dune::Functions::DefaultDerivativeTraits>
│ │ │ -
│ │ │ - │ │ │ -
41{
│ │ │ -
42 using RawGridFunction = Dune::ResolveRef_t<GridFunction>;
│ │ │ -
43
│ │ │ -
44 auto&& rawFunction() const
│ │ │ -
45 {
│ │ │ -
46 return Dune::resolveRef(function_);
│ │ │ -
47 }
│ │ │ -
48
│ │ │ -
49public:
│ │ │ -
50
│ │ │ -
51 using GridView = GV;
│ │ │ - │ │ │ -
53 using Element = typename EntitySet::Element;
│ │ │ - │ │ │ - │ │ │ -
56 using Range = std::decay_t<decltype(std::declval<RawGridFunction>()(std::declval<Domain>()))>;
│ │ │ -
57
│ │ │ -
58private:
│ │ │ -
59
│ │ │ -
60 using CoarseEntitySet = std::decay_t<decltype(std::declval<RawGridFunction>().entitySet())>;
│ │ │ -
61 using GeometryInAncestor = Dune::Functions::GeometryInAncestor<Element>;
│ │ │ -
62 using Traits = Dune::Functions::Imp::GridFunctionTraits<Range(Domain), EntitySet, DerivativeTraits, 56>;
│ │ │ -
63
│ │ │ -
64 class CoarseLocalFunctionOnFineGridView
│ │ │ -
65 {
│ │ │ -
66 using Traits = typename CoarseFunctionOnFineGridView::Traits::LocalFunctionTraits;
│ │ │ -
67
│ │ │ -
68 public:
│ │ │ -
69
│ │ │ -
70 using Derivative = decltype(localFunction(derivative(std::declval<CoarseFunctionOnFineGridView>())));
│ │ │ -
71 using RawLocalFunction = std::decay_t<decltype(localFunction(std::declval<const RawGridFunction&>()))>;
│ │ │ -
72
│ │ │ -
78 CoarseLocalFunctionOnFineGridView(RawLocalFunction&& localFunction, const CoarseEntitySet& coarseEntitySet)
│ │ │ -
79 : element_()
│ │ │ -
80 , localFunction_(localFunction)
│ │ │ -
81 , coarseEntitySet_(coarseEntitySet)
│ │ │ -
82 , geometryInAncestor_()
│ │ │ -
83 {}
│ │ │ -
84
│ │ │ -
90 CoarseLocalFunctionOnFineGridView(
│ │ │ -
91 RawLocalFunction&& localFunction,
│ │ │ -
92 const CoarseEntitySet& coarseEntitySet,
│ │ │ -
93 const GeometryInAncestor& geometryInAncestor,
│ │ │ -
94 const std::optional<Element>& element
│ │ │ -
95 )
│ │ │ -
96 : element_(element)
│ │ │ -
97 , localFunction_(localFunction)
│ │ │ -
98 , coarseEntitySet_(coarseEntitySet)
│ │ │ -
99 , geometryInAncestor_(geometryInAncestor, *element_)
│ │ │ -
100 {}
│ │ │ -
101
│ │ │ -
103 void bind(const Element& element)
│ │ │ -
104 {
│ │ │ -
105 element_ = element;
│ │ │ -
106 geometryInAncestor_.bind(*element_, [&](const auto& e) { return not coarseEntitySet_.contains(e); });
│ │ │ -
107 localFunction_.bind(geometryInAncestor_.coarseElement());
│ │ │ -
108 }
│ │ │ -
109
│ │ │ -
111 void unbind()
│ │ │ -
112 {
│ │ │ -
113 element_.reset();
│ │ │ -
114 }
│ │ │ -
115
│ │ │ -
117 bool bound() const
│ │ │ -
118 {
│ │ │ -
119 return static_cast<bool>(element_);
│ │ │ -
120 }
│ │ │ -
121
│ │ │ -
123 const Element& localContext() const
│ │ │ -
124 {
│ │ │ -
125 return *element_;
│ │ │ -
126 }
│ │ │ -
127
│ │ │ -
129 friend auto derivative(const CoarseLocalFunctionOnFineGridView& f)
│ │ │ -
130 {
│ │ │ -
131 if constexpr(requires{ derivative(f.localFunction_); })
│ │ │ -
132 return Derivative(derivative(f.localFunction_), f.coarseEntitySet_, f.geometryInAncestor_, f.element_);
│ │ │ -
133 else
│ │ │ -
134 return typename Traits::DerivativeInterface{};
│ │ │ -
135 }
│ │ │ -
136
│ │ │ - │ │ │ -
139 {
│ │ │ -
140 return localFunction_(geometryInAncestor_.global(x));
│ │ │ -
141 }
│ │ │ -
142
│ │ │ -
143 private:
│ │ │ -
144 std::optional<Element> element_;
│ │ │ -
145 RawLocalFunction localFunction_;
│ │ │ -
146 const CoarseEntitySet& coarseEntitySet_;
│ │ │ -
147 GeometryInAncestor geometryInAncestor_;
│ │ │ -
148 };
│ │ │ -
149
│ │ │ -
150public:
│ │ │ -
151
│ │ │ -
152 using LocalFunction = CoarseLocalFunctionOnFineGridView;
│ │ │ -
153
│ │ │ -
│ │ │ -
160 CoarseFunctionOnFineGridView(const GridFunction& function, const GridView& gridView)
│ │ │ -
161 : function_(function)
│ │ │ -
162 , entitySet_(gridView)
│ │ │ -
163 {}
│ │ │ -
│ │ │ -
164
│ │ │ -
│ │ │ - │ │ │ -
172 : function_(std::move(function))
│ │ │ -
173 , entitySet_(gridView)
│ │ │ -
174 {}
│ │ │ -
│ │ │ -
175
│ │ │ -
│ │ │ -
177 Range operator()(const Domain& x) const
│ │ │ -
178 {
│ │ │ -
179 return function_(x);
│ │ │ -
180 }
│ │ │ -
│ │ │ -
181
│ │ │ -
│ │ │ - │ │ │ -
184 {
│ │ │ -
185 if constexpr(requires{ derivative(f.rawFunction()); })
│ │ │ -
186 {
│ │ │ -
187 using RawDerivative = std::decay_t<decltype(derivative(f.rawFunction()))>;
│ │ │ - │ │ │ -
189 }
│ │ │ -
190 else
│ │ │ -
191 return typename Traits::DerivativeInterface{};
│ │ │ -
192 }
│ │ │ -
│ │ │ -
193
│ │ │ -
│ │ │ - │ │ │ -
196 {
│ │ │ -
197 return LocalFunction(localFunction(f.rawFunction()), f.rawFunction().entitySet());
│ │ │ -
198 }
│ │ │ -
│ │ │ -
199
│ │ │ -
│ │ │ -
201 const EntitySet& entitySet() const
│ │ │ -
202 {
│ │ │ -
203 return entitySet_;
│ │ │ -
204 }
│ │ │ -
│ │ │ -
205
│ │ │ -
206protected:
│ │ │ -
207
│ │ │ - │ │ │ - │ │ │ -
210};
│ │ │ -
│ │ │ -
211
│ │ │ -
212
│ │ │ -
213
│ │ │ -
214} // namespace Dune::Functions
│ │ │ -
215
│ │ │ -
216#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_COARSEFUNCTIONONFINEGRIDVIEW_HH
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ +
29 template<class Object>
│ │ │ +
30 constexpr Object const& squeezeTensor(Object const& o){
│ │ │ +
31 return o;
│ │ │ +
32 }
│ │ │ +
33
│ │ │ +
38 template<class K>
│ │ │ +
39 constexpr K const& squeezeTensor(Dune::FieldVector<K,1> const& v){
│ │ │ +
40 return v[0];
│ │ │ +
41 }
│ │ │ +
42
│ │ │ +
45 template<class K>
│ │ │ +
46 constexpr K& squeezeTensor(Dune::FieldVector<K,1>& v){
│ │ │ +
47 return v[0];
│ │ │ +
48 }
│ │ │ +
49
│ │ │ +
52 template<class K, int N>
│ │ │ +
53 constexpr Dune::FieldVector<K, N> const& squeezeTensor(Dune::FieldMatrix<K,1,N> const& m){
│ │ │ +
54 return m[0];
│ │ │ +
55 }
│ │ │ +
56
│ │ │ +
59 template<class K, int N>
│ │ │ +
60 constexpr Dune::FieldVector<K, N>& squeezeTensor(Dune::FieldMatrix<K,1,N>& m){
│ │ │ +
61 return m[0];
│ │ │ +
62 }
│ │ │ +
63
│ │ │ +
66 template<class K, int N, int M>
│ │ │ +
67 constexpr Dune::FieldMatrix<K, N, M> const& squeezeTensor(std::array<Dune::FieldMatrix<K,N,M>, 1> const& m){
│ │ │ +
68 return m[0];
│ │ │ +
69 }
│ │ │ +
70
│ │ │ +
73 template<class K, int N, int M>
│ │ │ +
74 constexpr Dune::FieldMatrix<K, N, M>& squeezeTensor(std::array<Dune::FieldMatrix<K,N,M>, 1>& m){
│ │ │ +
75 return m[0];
│ │ │ +
76 }
│ │ │ +
77
│ │ │ +
78 } // namespace Impl
│ │ │ +
79
│ │ │ +
80} // namespace Dune::Functions
│ │ │ +
81
│ │ │ +
82#endif // DUNE_FUNCTIONS_COMMON_SQUEEZETENSOR_HH
│ │ │
Definition monomialset.hh:19
│ │ │ -
A geometry embedding a descendent element into an ancestor.
Definition geometryinancestor.hh:39
│ │ │ -
GlobalCoordinate global(LocalCoordinate x) const
Map local coordinate in fine element into coarse element.
Definition geometryinancestor.hh:169
│ │ │ -
const Element & bind(const Element &fineElement, F &&includeFather)
Bind this GeometryInAncestor to a fine element and search coarse element.
Definition geometryinancestor.hh:119
│ │ │ -
const Element & coarseElement() const
Return the coarse element.
Definition geometryinancestor.hh:163
│ │ │ -
friend auto derivative(const CoarseFunctionOnFineGridView &f)
Obtain global derivative of this function.
Definition coarsefunctiononfinegridview.hh:183
│ │ │ -
Dune::Functions::GridViewEntitySet< GridView, 0 > EntitySet
Definition coarsefunctiononfinegridview.hh:52
│ │ │ -
Range operator()(const Domain &x) const
Evaluate function in global coordinates.
Definition coarsefunctiononfinegridview.hh:177
│ │ │ -
typename EntitySet::GlobalCoordinate Domain
Definition coarsefunctiononfinegridview.hh:54
│ │ │ -
CoarseFunctionOnFineGridView(GridFunction &&function, const GridView &gridView)
Create CoarseFunctionOnFineGridView from GridFunction and GridView.
Definition coarsefunctiononfinegridview.hh:171
│ │ │ -
const EntitySet & entitySet() const
Return the EntitySet associated to this GridViewFunction.
Definition coarsefunctiononfinegridview.hh:201
│ │ │ -
CoarseLocalFunctionOnFineGridView LocalFunction
Definition coarsefunctiononfinegridview.hh:152
│ │ │ -
typename EntitySet::Element Element
Definition coarsefunctiononfinegridview.hh:53
│ │ │ -
GridFunction function_
Definition coarsefunctiononfinegridview.hh:208
│ │ │ -
CoarseFunctionOnFineGridView(const GridFunction &function, const GridView &gridView)
Create CoarseFunctionOnFineGridView from GridFunction and GridView.
Definition coarsefunctiononfinegridview.hh:160
│ │ │ -
EntitySet entitySet_
Definition coarsefunctiononfinegridview.hh:209
│ │ │ -
typename EntitySet::LocalCoordinate LocalDomain
Definition coarsefunctiononfinegridview.hh:55
│ │ │ -
friend LocalFunction localFunction(const CoarseFunctionOnFineGridView &f)
Create a LocalFunction for evaluation in local coordinates.
Definition coarsefunctiononfinegridview.hh:195
│ │ │ -
std::decay_t< decltype(std::declval< RawGridFunction >()(std::declval< Domain >()))> Range
Definition coarsefunctiononfinegridview.hh:56
│ │ │ -
GV GridView
Definition coarsefunctiononfinegridview.hh:51
│ │ │ -
Definition gridfunction.hh:36
│ │ │ -
An entity set for all entities of given codim in a grid view.
Definition gridviewentityset.hh:27
│ │ │ -
GridView::template Codim< codim >::Entity Element
Definition gridviewentityset.hh:36
│ │ │ -
const GridView & gridView() const
Return the associated GridView.
Definition gridviewentityset.hh:80
│ │ │ -
Element::Geometry::LocalCoordinate LocalCoordinate
Definition gridviewentityset.hh:39
│ │ │ -
Element::Geometry::GlobalCoordinate GlobalCoordinate
Definition gridviewentityset.hh:40
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,289 +1,79 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -coarsefunctiononfinegridview.hh │ │ │ │ +squeezetensor.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ -6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_COARSEFUNCTIONONFINEGRIDVIEW_HH │ │ │ │ -8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_COARSEFUNCTIONONFINEGRIDVIEW_HH │ │ │ │ -9 │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ -12#include │ │ │ │ -13 │ │ │ │ -14#include │ │ │ │ -15 │ │ │ │ -16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ -17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_g_e_o_m_e_t_r_y_i_n_a_n_c_e_s_t_o_r_._h_h> │ │ │ │ -18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ -19#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h> │ │ │ │ -20 │ │ │ │ -21namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ -22 │ │ │ │ -23 │ │ │ │ +6#ifndef DUNE_FUNCTIONS_COMMON_SQUEEZETENSOR_HH │ │ │ │ +7#define DUNE_FUNCTIONS_COMMON_SQUEEZETENSOR_HH │ │ │ │ +8 │ │ │ │ +9#include │ │ │ │ +10#include │ │ │ │ +11 │ │ │ │ +12namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ +13{ │ │ │ │ +14 namespace Impl │ │ │ │ +15 { │ │ │ │ +20 template │ │ │ │ +21 constexpr Object& squeezeTensor(Object& o){ │ │ │ │ +22 return o; │ │ │ │ +23 } │ │ │ │ 24 │ │ │ │ -39template class │ │ │ │ -DerivativeTraits=Dune::Functions::DefaultDerivativeTraits> │ │ │ │ -_4_0class _C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w │ │ │ │ -41{ │ │ │ │ -42 using RawGridFunction = Dune::ResolveRef_t; │ │ │ │ -43 │ │ │ │ -44 auto&& rawFunction() const │ │ │ │ -45 { │ │ │ │ -46 return Dune::resolveRef(_f_u_n_c_t_i_o_n__); │ │ │ │ -47 } │ │ │ │ -48 │ │ │ │ -49public: │ │ │ │ -50 │ │ │ │ -_5_1 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ -_5_2 using _E_n_t_i_t_y_S_e_t = _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_G_r_i_d_V_i_e_w_,_ _0_>; │ │ │ │ -_5_3 using _E_l_e_m_e_n_t = typename _E_n_t_i_t_y_S_e_t_:_:_E_l_e_m_e_n_t; │ │ │ │ -_5_4 using _D_o_m_a_i_n = typename _E_n_t_i_t_y_S_e_t_:_:_G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e; │ │ │ │ -_5_5 using _L_o_c_a_l_D_o_m_a_i_n = typename _E_n_t_i_t_y_S_e_t_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e; │ │ │ │ -_5_6 using _R_a_n_g_e = std::decay_t()(std:: │ │ │ │ -declval()))>; │ │ │ │ -57 │ │ │ │ -58private: │ │ │ │ -59 │ │ │ │ -60 using CoarseEntitySet = std::decay_t │ │ │ │ -().entitySet())>; │ │ │ │ -61 using GeometryInAncestor = _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_<_E_l_e_m_e_n_t_>; │ │ │ │ -62 using Traits = Dune::Functions::Imp::GridFunctionTraits<_R_a_n_g_e(_D_o_m_a_i_n), │ │ │ │ -_E_n_t_i_t_y_S_e_t, DerivativeTraits, 56>; │ │ │ │ +29 template │ │ │ │ +30 constexpr Object const& squeezeTensor(Object const& o){ │ │ │ │ +31 return o; │ │ │ │ +32 } │ │ │ │ +33 │ │ │ │ +38 template │ │ │ │ +39 constexpr K const& squeezeTensor(Dune::FieldVector const& v){ │ │ │ │ +40 return v[0]; │ │ │ │ +41 } │ │ │ │ +42 │ │ │ │ +45 template │ │ │ │ +46 constexpr K& squeezeTensor(Dune::FieldVector& v){ │ │ │ │ +47 return v[0]; │ │ │ │ +48 } │ │ │ │ +49 │ │ │ │ +52 template │ │ │ │ +53 constexpr Dune::FieldVector const& squeezeTensor(Dune:: │ │ │ │ +FieldMatrix const& m){ │ │ │ │ +54 return m[0]; │ │ │ │ +55 } │ │ │ │ +56 │ │ │ │ +59 template │ │ │ │ +60 constexpr Dune::FieldVector& squeezeTensor(Dune::FieldMatrix& │ │ │ │ +m){ │ │ │ │ +61 return m[0]; │ │ │ │ +62 } │ │ │ │ 63 │ │ │ │ -64 class CoarseLocalFunctionOnFineGridView │ │ │ │ -65 { │ │ │ │ -66 using Traits = typename CoarseFunctionOnFineGridView::Traits:: │ │ │ │ -LocalFunctionTraits; │ │ │ │ -67 │ │ │ │ -68 public: │ │ │ │ -69 │ │ │ │ -70 using Derivative = decltype(_l_o_c_a_l_F_u_n_c_t_i_o_n(_d_e_r_i_v_a_t_i_v_e(std:: │ │ │ │ -declval()))); │ │ │ │ -71 using RawLocalFunction = std::decay_t()))>; │ │ │ │ -72 │ │ │ │ -78 CoarseLocalFunctionOnFineGridView(RawLocalFunction&& _l_o_c_a_l_F_u_n_c_t_i_o_n, const │ │ │ │ -CoarseEntitySet& coarseEntitySet) │ │ │ │ -79 : element_() │ │ │ │ -80 , localFunction_(_l_o_c_a_l_F_u_n_c_t_i_o_n) │ │ │ │ -81 , coarseEntitySet_(coarseEntitySet) │ │ │ │ -82 , geometryInAncestor_() │ │ │ │ -83 {} │ │ │ │ -84 │ │ │ │ -90 CoarseLocalFunctionOnFineGridView( │ │ │ │ -91 RawLocalFunction&& _l_o_c_a_l_F_u_n_c_t_i_o_n, │ │ │ │ -92 const CoarseEntitySet& coarseEntitySet, │ │ │ │ -93 const GeometryInAncestor& geometryInAncestor, │ │ │ │ -94 const std::optional& element │ │ │ │ -95 ) │ │ │ │ -96 : element_(element) │ │ │ │ -97 , localFunction_(_l_o_c_a_l_F_u_n_c_t_i_o_n) │ │ │ │ -98 , coarseEntitySet_(coarseEntitySet) │ │ │ │ -99 , geometryInAncestor_(geometryInAncestor, *element_) │ │ │ │ -100 {} │ │ │ │ -101 │ │ │ │ -103 void bind(const _E_l_e_m_e_n_t& element) │ │ │ │ -104 { │ │ │ │ -105 element_ = element; │ │ │ │ -106 geometryInAncestor_._b_i_n_d(*element_, [&](const auto& e) { return not │ │ │ │ -coarseEntitySet_.contains(e); }); │ │ │ │ -107 localFunction_.bind(geometryInAncestor_._c_o_a_r_s_e_E_l_e_m_e_n_t()); │ │ │ │ -108 } │ │ │ │ -109 │ │ │ │ -111 void unbind() │ │ │ │ -112 { │ │ │ │ -113 element_.reset(); │ │ │ │ -114 } │ │ │ │ -115 │ │ │ │ -117 bool bound() const │ │ │ │ -118 { │ │ │ │ -119 return static_cast(element_); │ │ │ │ -120 } │ │ │ │ -121 │ │ │ │ -123 const _E_l_e_m_e_n_t& localContext() const │ │ │ │ -124 { │ │ │ │ -125 return *element_; │ │ │ │ -126 } │ │ │ │ -127 │ │ │ │ -129 friend auto _d_e_r_i_v_a_t_i_v_e(const CoarseLocalFunctionOnFineGridView& f) │ │ │ │ -130 { │ │ │ │ -131 if constexpr(requires{ _d_e_r_i_v_a_t_i_v_e(f.localFunction_); }) │ │ │ │ -132 return Derivative(_d_e_r_i_v_a_t_i_v_e(f.localFunction_), f.coarseEntitySet_, │ │ │ │ -f.geometryInAncestor_, f.element_); │ │ │ │ -133 else │ │ │ │ -134 return typename Traits::DerivativeInterface{}; │ │ │ │ -135 } │ │ │ │ -136 │ │ │ │ -138 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(_L_o_c_a_l_D_o_m_a_i_n x) const │ │ │ │ -139 { │ │ │ │ -140 return localFunction_(geometryInAncestor_._g_l_o_b_a_l(x)); │ │ │ │ -141 } │ │ │ │ -142 │ │ │ │ -143 private: │ │ │ │ -144 std::optional element_; │ │ │ │ -145 RawLocalFunction localFunction_; │ │ │ │ -146 const CoarseEntitySet& coarseEntitySet_; │ │ │ │ -147 GeometryInAncestor geometryInAncestor_; │ │ │ │ -148 }; │ │ │ │ -149 │ │ │ │ -150public: │ │ │ │ -151 │ │ │ │ -_1_5_2 using _L_o_c_a_l_F_u_n_c_t_i_o_n = CoarseLocalFunctionOnFineGridView; │ │ │ │ -153 │ │ │ │ -_1_6_0 _C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w(const _G_r_i_d_F_u_n_c_t_i_o_n& function, const _G_r_i_d_V_i_e_w& │ │ │ │ -gridView) │ │ │ │ -161 : _f_u_n_c_t_i_o_n__(function) │ │ │ │ -162 , _e_n_t_i_t_y_S_e_t__(gridView) │ │ │ │ -163 {} │ │ │ │ -164 │ │ │ │ -_1_7_1 _C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w(_G_r_i_d_F_u_n_c_t_i_o_n&& function, const _G_r_i_d_V_i_e_w& │ │ │ │ -gridView) │ │ │ │ -172 : _f_u_n_c_t_i_o_n__(std::move(function)) │ │ │ │ -173 , _e_n_t_i_t_y_S_e_t__(gridView) │ │ │ │ -174 {} │ │ │ │ -175 │ │ │ │ -_1_7_7 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(const _D_o_m_a_i_n& x) const │ │ │ │ -178 { │ │ │ │ -179 return _f_u_n_c_t_i_o_n__(x); │ │ │ │ -180 } │ │ │ │ -181 │ │ │ │ -_1_8_3 friend auto _d_e_r_i_v_a_t_i_v_e(const _C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w& f) │ │ │ │ -184 { │ │ │ │ -185 if constexpr(requires{ _d_e_r_i_v_a_t_i_v_e(f.rawFunction()); }) │ │ │ │ -186 { │ │ │ │ -187 using RawDerivative = std::decay_t; │ │ │ │ -188 return _C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_<_R_a_w_D_e_r_i_v_a_t_i_v_e_,_ _G_r_i_d_V_i_e_w_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_>(_d_e_r_i_v_a_t_i_v_e(f.rawFunction()), f._e_n_t_i_t_y_S_e_t__._g_r_i_d_V_i_e_w()); │ │ │ │ -189 } │ │ │ │ -190 else │ │ │ │ -191 return typename Traits::DerivativeInterface{}; │ │ │ │ -192 } │ │ │ │ -193 │ │ │ │ -_1_9_5 friend _L_o_c_a_l_F_u_n_c_t_i_o_n _l_o_c_a_l_F_u_n_c_t_i_o_n(const _C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w& f) │ │ │ │ -196 { │ │ │ │ -197 return _L_o_c_a_l_F_u_n_c_t_i_o_n(_l_o_c_a_l_F_u_n_c_t_i_o_n(f.rawFunction()), f.rawFunction │ │ │ │ -().entitySet()); │ │ │ │ -198 } │ │ │ │ -199 │ │ │ │ -_2_0_1 const _E_n_t_i_t_y_S_e_t& _e_n_t_i_t_y_S_e_t() const │ │ │ │ -202 { │ │ │ │ -203 return _e_n_t_i_t_y_S_e_t__; │ │ │ │ -204 } │ │ │ │ -205 │ │ │ │ -206protected: │ │ │ │ -207 │ │ │ │ -_2_0_8 _G_r_i_d_F_u_n_c_t_i_o_n _f_u_n_c_t_i_o_n__; │ │ │ │ -_2_0_9 _E_n_t_i_t_y_S_e_t _e_n_t_i_t_y_S_e_t__; │ │ │ │ -210}; │ │ │ │ -211 │ │ │ │ -212 │ │ │ │ -213 │ │ │ │ -214} // namespace Dune::Functions │ │ │ │ -215 │ │ │ │ -216#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_COARSEFUNCTIONONFINEGRIDVIEW_HH │ │ │ │ -_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h │ │ │ │ -_g_r_i_d_f_u_n_c_t_i_o_n_._h_h │ │ │ │ -_g_e_o_m_e_t_r_y_i_n_a_n_c_e_s_t_o_r_._h_h │ │ │ │ -_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h │ │ │ │ +66 template │ │ │ │ +67 constexpr Dune::FieldMatrix const& squeezeTensor(std::array, 1> const& m){ │ │ │ │ +68 return m[0]; │ │ │ │ +69 } │ │ │ │ +70 │ │ │ │ +73 template │ │ │ │ +74 constexpr Dune::FieldMatrix& squeezeTensor(std::array, 1>& m){ │ │ │ │ +75 return m[0]; │ │ │ │ +76 } │ │ │ │ +77 │ │ │ │ +78 } // namespace Impl │ │ │ │ +79 │ │ │ │ +80} // namespace Dune::Functions │ │ │ │ +81 │ │ │ │ +82#endif // DUNE_FUNCTIONS_COMMON_SQUEEZETENSOR_HH │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r │ │ │ │ -A geometry embedding a descendent element into an ancestor. │ │ │ │ -DDeeffiinniittiioonn geometryinancestor.hh:39 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_g_l_o_b_a_l │ │ │ │ -GlobalCoordinate global(LocalCoordinate x) const │ │ │ │ -Map local coordinate in fine element into coarse element. │ │ │ │ -DDeeffiinniittiioonn geometryinancestor.hh:169 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_b_i_n_d │ │ │ │ -const Element & bind(const Element &fineElement, F &&includeFather) │ │ │ │ -Bind this GeometryInAncestor to a fine element and search coarse element. │ │ │ │ -DDeeffiinniittiioonn geometryinancestor.hh:119 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_c_o_a_r_s_e_E_l_e_m_e_n_t │ │ │ │ -const Element & coarseElement() const │ │ │ │ -Return the coarse element. │ │ │ │ -DDeeffiinniittiioonn geometryinancestor.hh:163 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ -friend auto derivative(const CoarseFunctionOnFineGridView &f) │ │ │ │ -Obtain global derivative of this function. │ │ │ │ -DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:183 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_E_n_t_i_t_y_S_e_t │ │ │ │ -Dune::Functions::GridViewEntitySet< GridView, 0 > EntitySet │ │ │ │ -DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:52 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ -Range operator()(const Domain &x) const │ │ │ │ -Evaluate function in global coordinates. │ │ │ │ -DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:177 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_D_o_m_a_i_n │ │ │ │ -typename EntitySet::GlobalCoordinate Domain │ │ │ │ -DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:54 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w │ │ │ │ -CoarseFunctionOnFineGridView(GridFunction &&function, const GridView &gridView) │ │ │ │ -Create CoarseFunctionOnFineGridView from GridFunction and GridView. │ │ │ │ -DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:171 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_e_n_t_i_t_y_S_e_t │ │ │ │ -const EntitySet & entitySet() const │ │ │ │ -Return the EntitySet associated to this GridViewFunction. │ │ │ │ -DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:201 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -CoarseLocalFunctionOnFineGridView LocalFunction │ │ │ │ -DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:152 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_E_l_e_m_e_n_t │ │ │ │ -typename EntitySet::Element Element │ │ │ │ -DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:53 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_f_u_n_c_t_i_o_n__ │ │ │ │ -GridFunction function_ │ │ │ │ -DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:208 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w │ │ │ │ -CoarseFunctionOnFineGridView(const GridFunction &function, const GridView │ │ │ │ -&gridView) │ │ │ │ -Create CoarseFunctionOnFineGridView from GridFunction and GridView. │ │ │ │ -DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:160 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_e_n_t_i_t_y_S_e_t__ │ │ │ │ -EntitySet entitySet_ │ │ │ │ -DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:209 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_L_o_c_a_l_D_o_m_a_i_n │ │ │ │ -typename EntitySet::LocalCoordinate LocalDomain │ │ │ │ -DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:55 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_l_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -friend LocalFunction localFunction(const CoarseFunctionOnFineGridView &f) │ │ │ │ -Create a LocalFunction for evaluation in local coordinates. │ │ │ │ -DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:195 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_R_a_n_g_e │ │ │ │ -std::decay_t< decltype(std::declval< RawGridFunction >()(std::declval< Domain > │ │ │ │ -()))> Range │ │ │ │ -DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:56 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_G_r_i_d_V_i_e_w │ │ │ │ -GV GridView │ │ │ │ -DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:51 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ -DDeeffiinniittiioonn gridfunction.hh:36 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t │ │ │ │ -An entity set for all entities of given codim in a grid view. │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:27 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_E_l_e_m_e_n_t │ │ │ │ -GridView::template Codim< codim >::Entity Element │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:36 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_:_:_g_r_i_d_V_i_e_w │ │ │ │ -const GridView & gridView() const │ │ │ │ -Return the associated GridView. │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:80 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ -Element::Geometry::LocalCoordinate LocalCoordinate │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:39 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ -Element::Geometry::GlobalCoordinate GlobalCoordinate │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:40 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_a_r_s_e_f_u_n_c_t_i_o_n_o_n_f_i_n_e_g_r_i_d_v_i_e_w_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _s_q_u_e_e_z_e_t_e_n_s_o_r_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00071.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: analyticgridviewfunction.hh File Reference │ │ │ +Dune-Functions: typeerasure.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,60 +88,47 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
analyticgridviewfunction.hh File Reference
│ │ │ +
typeerasure.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <type_traits>
│ │ │ -#include <optional>
│ │ │ -#include <dune/common/copyableoptional.hh>
│ │ │ +
#include <typeinfo>
│ │ │ #include <dune/common/typeutilities.hh>
│ │ │ -#include <dune/functions/common/signature.hh>
│ │ │ -#include <dune/functions/common/defaultderivativetraits.hh>
│ │ │ -#include <dune/functions/common/differentiablefunction_imp.hh>
│ │ │ -#include <dune/functions/common/differentiablefunction.hh>
│ │ │ -#include <dune/functions/gridfunctions/gridviewentityset.hh>
│ │ │ -#include <dune/functions/gridfunctions/localderivativetraits.hh>
│ │ │ +#include <dune/functions/common/type_traits.hh>
│ │ │ +#include <dune/functions/common/interfaces.hh>
│ │ │ +#include <dune/functions/common/polymorphicsmallobject.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::AnalyticGridViewFunction< Range(Domain), GV, F, DerivativeTraits >
 Class wrapping any differentiable function as grid function. More...
class  Dune::Functions::TypeErasureBase< Interface, Implementation, bufferSize >
 Base class for type-erased interface wrapper. More...
│ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │

│ │ │ -Functions

template<class F, class GridView, class Domain = typename GridView::template Codim<0>::Geometry::GlobalCoordinate, class Range = std::invoke_result_t<F,Domain>>
 Dune::Functions::AnalyticGridViewFunction (const F &, const GridView &) -> AnalyticGridViewFunction< Range(Domain), GridView, F >
template<class F, class GridView>
auto Dune::Functions::makeAnalyticGridViewFunction (F &&f, const GridView &gridView)
 Create an AnalyticGridViewFunction from a function and a grid view.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,38 +1,23 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -analyticgridviewfunction.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ +typeerasure.hh File Reference │ │ │ │ +#include │ │ │ │ #include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_s_i_g_n_a_t_u_r_e_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n___i_m_p_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_l_o_c_a_l_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_i_n_t_e_r_f_a_c_e_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_p_o_l_y_m_o_r_p_h_i_c_s_m_a_l_l_o_b_j_e_c_t_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ - _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _> │ │ │ │ -  Class wrapping any differentiable function as grid function. _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_<_ _I_n_t_e_r_f_a_c_e_,_ _I_m_p_l_e_m_e_n_t_a_t_i_o_n_,_ _b_u_f_f_e_r_S_i_z_e │ │ │ │ + _> │ │ │ │ +  Base class for type-erased interface wrapper. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -FFuunnccttiioonnss │ │ │ │ -template::Geometry::GlobalCoordinate, class Range = std:: │ │ │ │ -invoke_result_t> │ │ │ │ -   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n (const F &, const GridView &) - │ │ │ │ - > AnalyticGridViewFunction< Range(Domain), GridView, F > │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n (F &&f, const GridView │ │ │ │ - &gridView) │ │ │ │ -  Create an _A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n from a function and a grid view. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ - * _a_n_a_l_y_t_i_c_g_r_i_d_v_i_e_w_f_u_n_c_t_i_o_n_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _t_y_p_e_e_r_a_s_u_r_e_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00071_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: analyticgridviewfunction.hh Source File │ │ │ +Dune-Functions: typeerasure.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,268 +88,186 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
analyticgridviewfunction.hh
│ │ │ +
typeerasure.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH
│ │ │ -
8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH
│ │ │ +
8#define DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH
│ │ │
9
│ │ │ -
10#include <type_traits>
│ │ │ -
11#include <optional>
│ │ │ -
12
│ │ │ -
13#include <dune/common/copyableoptional.hh>
│ │ │ -
14#include <dune/common/typeutilities.hh>
│ │ │ -
15
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ +
10#include <typeinfo>
│ │ │ +
11
│ │ │ +
12#include <dune/common/typeutilities.hh>
│ │ │ +
13
│ │ │ + │ │ │ + │ │ │ + │ │ │ +
17
│ │ │ +
18namespace Dune {
│ │ │ +
19namespace Functions {
│ │ │ +
20namespace Imp {
│ │ │ +
21
│ │ │
22
│ │ │ -
23
│ │ │ -
24namespace Dune {
│ │ │ -
25namespace Functions {
│ │ │ -
26
│ │ │ -
27namespace Imp {
│ │ │ -
28
│ │ │ -
29template<class Signature, class GV, class FLocal, template<class> class DerivativeTraits=DefaultDerivativeTraits>
│ │ │ -
30class LocalAnalyticGridViewFunction;
│ │ │ -
31
│ │ │ -
32template<class Range, class LocalDomain, class GV, class F, template<class> class DerivativeTraits>
│ │ │ -
33class LocalAnalyticGridViewFunction<Range(LocalDomain), GV, F, DerivativeTraits>
│ │ │ -
34{
│ │ │ -
35public:
│ │ │ -
36 using Signature = Range(LocalDomain);
│ │ │ -
37 using RawSignature = typename SignatureTraits<Signature>::RawSignature;
│ │ │ -
38 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(LocalDomain);
│ │ │ -
39
│ │ │ -
40 using GridView = GV;
│ │ │ -
41 using EntitySet = GridViewEntitySet<GridView, 0>;
│ │ │ -
42 using Element = typename EntitySet::Element;
│ │ │ -
43// using Geometry = typename Element::Geometry;
│ │ │ -
44 using Geometry = std::decay_t<typename Element::Geometry>;
│ │ │ +
23
│ │ │ +
37template<class Interface>
│ │ │ +
38class TypeErasureWrapperInterface :
│ │ │ +
39 public Interface,
│ │ │ +
40 public PolymorphicType<TypeErasureWrapperInterface<Interface>>
│ │ │ +
41{
│ │ │ +
42public:
│ │ │ +
43 virtual const std::type_info& target_type() const = 0;
│ │ │ +
44};
│ │ │
45
│ │ │ -
46 // Use the indirection via derivativeIfImplemented to also support
│ │ │ -
47 // function types F that do not implement derivative. In this case
│ │ │ -
48 // the interface type DifferentiableFunction is using a dummy for
│ │ │ -
49 // the derivative type
│ │ │ -
50 using DerivativeDummy = DifferentiableFunction<DerivativeSignature>;
│ │ │ -
51 using GlobalRawDerivative = decltype(Imp::derivativeIfImplemented<DerivativeDummy, F>(std::declval<F>()));
│ │ │ -
52 using LocalDerivative = LocalAnalyticGridViewFunction<DerivativeSignature, GridView, GlobalRawDerivative, DerivativeTraits>;
│ │ │ -
53
│ │ │ -
55 template<class FT, disableCopyMove<LocalAnalyticGridViewFunction, FT> = 0>
│ │ │ -
56 LocalAnalyticGridViewFunction(FT&& f) :
│ │ │ -
57 f_(std::forward<FT>(f))
│ │ │ -
58 {}
│ │ │ -
59
│ │ │ -
61 template<class FT>
│ │ │ -
62 LocalAnalyticGridViewFunction(FT&& f, const Element& element, const std::optional<Geometry>& geometry) :
│ │ │ -
63 f_(std::forward<FT>(f)),
│ │ │ -
64 element_(element),
│ │ │ -
65 geometry_(geometry)
│ │ │ -
66 {}
│ │ │ -
67
│ │ │ -
68
│ │ │ -
77 void bind(const Element& element)
│ │ │ -
78 {
│ │ │ -
79 element_ = element;
│ │ │ -
80 geometry_.emplace(element_.geometry());
│ │ │ -
81 }
│ │ │ -
82
│ │ │ -
84 void unbind()
│ │ │ -
85 {
│ │ │ -
86 geometry_.reset();
│ │ │ -
87 }
│ │ │ -
88
│ │ │ -
91 bool bound() const
│ │ │ -
92 {
│ │ │ -
93 return static_cast<bool>(geometry_);
│ │ │ -
94 }
│ │ │ -
95
│ │ │ -
105 Range operator()(const LocalDomain& x) const
│ │ │ -
106 {
│ │ │ -
107 assert(!!geometry_);
│ │ │ -
108 return (*f_)(geometry_->global(x));
│ │ │ -
109 }
│ │ │ -
110
│ │ │ -
112 const Element& localContext() const
│ │ │ -
113 {
│ │ │ -
114 assert(!!geometry_);
│ │ │ -
115 return element_;
│ │ │ -
116 }
│ │ │ -
117
│ │ │ -
126 friend LocalDerivative derivative(const LocalAnalyticGridViewFunction& t)
│ │ │ -
127 {
│ │ │ -
128 return LocalDerivative(Imp::derivativeIfImplemented<DerivativeDummy, F>(*t.f_), t.element_, t.geometry_);
│ │ │ -
129 }
│ │ │ -
130
│ │ │ -
131private:
│ │ │ -
132 // Wrap the function into CopyableOptional to make it copy-assignable
│ │ │ -
133 CopyableOptional<F> f_;
│ │ │ -
134 Element element_;
│ │ │ -
135 std::optional<Geometry> geometry_ = std::nullopt;
│ │ │ -
136};
│ │ │ -
137
│ │ │ -
138} // end namespace Imp
│ │ │ -
139
│ │ │ -
140
│ │ │ -
141
│ │ │ -
142
│ │ │ -
143template<class Signature, class GV, class F, template<class> class DerivativeTraits=DefaultDerivativeTraits>
│ │ │ - │ │ │ -
145
│ │ │ -
146
│ │ │ -
152template<class Range, class Domain, class GV, class F, template<class> class DerivativeTraits>
│ │ │ -
│ │ │ -
153class AnalyticGridViewFunction<Range(Domain), GV, F, DerivativeTraits>
│ │ │ -
154{
│ │ │ -
155public:
│ │ │ -
156 using Signature = Range(Domain);
│ │ │ - │ │ │ -
158 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(Domain);
│ │ │ -
159
│ │ │ -
160 using GridView = GV;
│ │ │ - │ │ │ -
162 using Element = typename EntitySet::Element;
│ │ │ -
163 using Geometry = typename Element::Geometry;
│ │ │ -
164
│ │ │ -
165 // Use the indirection via derivativeIfImplemented to also support
│ │ │ -
166 // function types F that do not implement derivative. In this case
│ │ │ -
167 // the interface type DifferentiableFunction is used a dummy for
│ │ │ -
168 // the derivative type
│ │ │ - │ │ │ -
170 using GlobalRawDerivative = decltype(Imp::derivativeIfImplemented<DerivativeDummy, F>(std::declval<F>()));
│ │ │ - │ │ │ -
172
│ │ │ - │ │ │ -
174 using LocalFunction = typename Imp::LocalAnalyticGridViewFunction<Range(LocalDomain), GridView, F, LocalDerivativeTraits<EntitySet, DerivativeTraits>::template Traits>;
│ │ │ -
175
│ │ │ -
177 template<class FT>
│ │ │ -
│ │ │ -
178 AnalyticGridViewFunction(FT&& f, const GridView& gridView) :
│ │ │ -
179 f_(std::forward<FT>(f)),
│ │ │ -
180 entitySet_(gridView)
│ │ │ -
181 {}
│ │ │ -
│ │ │ -
182
│ │ │ -
│ │ │ -
184 Range operator()(const Domain& x) const
│ │ │ -
185 {
│ │ │ -
186 return (*f_)(x);
│ │ │ -
187 }
│ │ │ -
│ │ │ -
188
│ │ │ -
│ │ │ - │ │ │ -
191 {
│ │ │ -
192 return Derivative(Imp::derivativeIfImplemented<DerivativeDummy, F>(*t.f_), t.entitySet_.gridView());
│ │ │ -
193 }
│ │ │ -
│ │ │ -
194
│ │ │ -
│ │ │ - │ │ │ -
197 {
│ │ │ -
198 return LocalFunction(*t.f_);
│ │ │ -
199 }
│ │ │ -
│ │ │ -
200
│ │ │ -
│ │ │ -
202 const EntitySet& entitySet() const
│ │ │ -
203 {
│ │ │ -
204 return entitySet_;
│ │ │ -
205 }
│ │ │ -
│ │ │ -
206
│ │ │ -
207private:
│ │ │ -
208 // Wrap the function into CopyableOptional to make it copy-assignable
│ │ │ -
209 CopyableOptional<F> f_;
│ │ │ -
210 EntitySet entitySet_;
│ │ │ -
211};
│ │ │ -
│ │ │ +
46
│ │ │ +
47
│ │ │ +
64template<class Interface, class T>
│ │ │ +
65class TypeErasureWrapperBase :
│ │ │ +
66 public TypeErasureWrapperInterface<Interface>
│ │ │ +
67{
│ │ │ +
68public:
│ │ │ +
69 template<class TT, disableCopyMove<TypeErasureWrapperBase, TT> = 0>
│ │ │ +
70 TypeErasureWrapperBase(TT&& t) :
│ │ │ +
71 wrapped_(std::forward<TT>(t))
│ │ │ +
72 {}
│ │ │ +
73
│ │ │ +
75 T& get()
│ │ │ +
76 {
│ │ │ +
77 return wrapped_;
│ │ │ +
78 }
│ │ │ +
79
│ │ │ +
81 const T& get() const
│ │ │ +
82 {
│ │ │ +
83 return wrapped_;
│ │ │ +
84 }
│ │ │ +
85
│ │ │ +
86protected:
│ │ │ +
87 using Wrapped = T;
│ │ │ +
88 Wrapped wrapped_;
│ │ │ +
89};
│ │ │ +
90
│ │ │ +
91
│ │ │ +
92
│ │ │ +
116template<class Interface, template<class> class Implementation, class T>
│ │ │ +
117class TypeErasureWrapperImplementation :
│ │ │ +
118 public Implementation<TypeErasureWrapperBase<Interface, T> >
│ │ │ +
119{
│ │ │ +
120public:
│ │ │ +
121
│ │ │ +
123 template<class TT, disableCopyMove<TypeErasureWrapperImplementation, T> = 0>
│ │ │ +
124 TypeErasureWrapperImplementation(TT&& t) :
│ │ │ +
125 Implementation<TypeErasureWrapperBase<Interface, T> >(std::forward<TT>(t))
│ │ │ +
126 {}
│ │ │ +
127
│ │ │ +
129 virtual TypeErasureWrapperImplementation* clone() const
│ │ │ +
130 {
│ │ │ +
131 return new TypeErasureWrapperImplementation(*this);
│ │ │ +
132 }
│ │ │ +
133
│ │ │ +
135 virtual TypeErasureWrapperImplementation* clone(void* buffer) const
│ │ │ +
136 {
│ │ │ +
137 return new (buffer) TypeErasureWrapperImplementation(*this);
│ │ │ +
138 }
│ │ │ +
139
│ │ │ +
141 virtual TypeErasureWrapperImplementation* move(void* buffer)
│ │ │ +
142 {
│ │ │ +
143 return new (buffer) TypeErasureWrapperImplementation(std::move(*this));
│ │ │ +
144 }
│ │ │ +
145
│ │ │ +
147 virtual const std::type_info& target_type() const
│ │ │ +
148 {
│ │ │ +
149 return typeid(T);
│ │ │ +
150 }
│ │ │ +
151};
│ │ │ +
152
│ │ │ +
153} // namespace Dune::Functions::Imp
│ │ │ +
154
│ │ │ +
155
│ │ │ +
156
│ │ │ +
167template<class Interface, template<class> class Implementation, size_t bufferSize = 56>
│ │ │ +
│ │ │ + │ │ │ +
169{
│ │ │ +
170public:
│ │ │ +
171
│ │ │ +
173 template<class T, disableCopyMove<TypeErasureBase, T> = 0 >
│ │ │ +
│ │ │ + │ │ │ +
175 wrapped_(Imp::TypeErasureWrapperImplementation<Interface, Implementation, std::decay_t<T>>(std::forward<T>(t)))
│ │ │ +
176 {}
│ │ │ +
│ │ │ +
177
│ │ │ +
179 TypeErasureBase() = default;
│ │ │ +
180
│ │ │ +
│ │ │ +
182 Interface& asInterface()
│ │ │ +
183 {
│ │ │ +
184 return wrapped_.get();
│ │ │ +
185 }
│ │ │ +
│ │ │ +
186
│ │ │ +
│ │ │ +
188 const Interface& asInterface() const
│ │ │ +
189 {
│ │ │ +
190 return wrapped_.get();
│ │ │ +
191 }
│ │ │ +
│ │ │ +
192
│ │ │ +
│ │ │ +
194 explicit operator bool() const noexcept
│ │ │ +
195 {
│ │ │ +
196 // Forward the query to the wrapped object
│ │ │ +
197 return static_cast<bool>(wrapped_);
│ │ │ +
198 }
│ │ │ +
│ │ │ +
199
│ │ │ +
│ │ │ +
201 const std::type_info& target_type() const
│ │ │ +
202 {
│ │ │ +
203 return wrapped_.get().target_type();
│ │ │ +
204 }
│ │ │ +
│ │ │ +
205
│ │ │ +
206protected:
│ │ │ + │ │ │ +
208};
│ │ │ +
│ │ │ +
209
│ │ │ +
210
│ │ │ +
211}} // namespace Dune::Functions
│ │ │
212
│ │ │ -
213// deduction guides
│ │ │ -
214template<class F, class GridView,
│ │ │ -
215 class Domain = typename GridView::template Codim<0>::Geometry::GlobalCoordinate,
│ │ │ -
216 class Range = std::invoke_result_t<F,Domain>>
│ │ │ -
217AnalyticGridViewFunction(const F&, const GridView&)
│ │ │ -
218 -> AnalyticGridViewFunction<Range(Domain), GridView, F>;
│ │ │ -
219
│ │ │ -
220
│ │ │ -
237template<class F, class GridView>
│ │ │ -
│ │ │ -
238auto makeAnalyticGridViewFunction(F&& f, const GridView& gridView)
│ │ │ -
239{
│ │ │ -
240 using Domain = typename GridView::template Codim<0>::Geometry::GlobalCoordinate;
│ │ │ -
241 using Range = std::invoke_result_t<F, Domain>;
│ │ │ -
242 using FRaw = std::decay_t<F>;
│ │ │ -
243
│ │ │ -
244 return AnalyticGridViewFunction<Range(Domain), GridView, FRaw>(std::forward<F>(f), gridView);
│ │ │ -
245}
│ │ │ -
│ │ │ -
246
│ │ │ -
247
│ │ │ -
248
│ │ │ -
249}} // namespace Dune::Functions
│ │ │ -
250
│ │ │ -
251
│ │ │ -
252
│ │ │ -
253#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
Obtain derivative of TrigonometricFunction function.
Definition trigonometricfunction.hh:43
│ │ │ -
auto makeAnalyticGridViewFunction(F &&f, const GridView &gridView)
Create an AnalyticGridViewFunction from a function and a grid view.
Definition analyticgridviewfunction.hh:238
│ │ │ +
213
│ │ │ +
214
│ │ │ +
215#endif // DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH
│ │ │ + │ │ │ + │ │ │ + │ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
AnalyticGridViewFunction(const F &, const GridView &) -> AnalyticGridViewFunction< Range(Domain), GridView, F >
│ │ │ -
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:41
│ │ │ -
Definition differentiablefunction.hh:33
│ │ │ -
Helper class to deduce the signature of a callable.
Definition signature.hh:60
│ │ │ -
Definition analyticgridviewfunction.hh:144
│ │ │ -
Range operator()(const Domain &x) const
Evaluate the wrapped function f directly in global coordinates x.
Definition analyticgridviewfunction.hh:184
│ │ │ -
typename EntitySet::LocalCoordinate LocalDomain
Definition analyticgridviewfunction.hh:173
│ │ │ -
friend Derivative derivative(const AnalyticGridViewFunction &t)
Create a derivative grid-function by wrapping the derivative of f.
Definition analyticgridviewfunction.hh:190
│ │ │ -
typename Element::Geometry Geometry
Definition analyticgridviewfunction.hh:163
│ │ │ -
typename EntitySet::Element Element
Definition analyticgridviewfunction.hh:162
│ │ │ - │ │ │ -
decltype(Imp::derivativeIfImplemented< DerivativeDummy, F >(std::declval< F >())) GlobalRawDerivative
Definition analyticgridviewfunction.hh:170
│ │ │ -
DifferentiableFunction< DerivativeSignature > DerivativeDummy
Definition analyticgridviewfunction.hh:169
│ │ │ -
Range(Domain) Signature
Definition analyticgridviewfunction.hh:156
│ │ │ -
AnalyticGridViewFunction(FT &&f, const GridView &gridView)
Create the grid-function by wrapping a function f and create a GridViewEntitySet.
Definition analyticgridviewfunction.hh:178
│ │ │ -
friend LocalFunction localFunction(const AnalyticGridViewFunction &t)
Construct the associated local-function.
Definition analyticgridviewfunction.hh:196
│ │ │ -
typename Imp::LocalAnalyticGridViewFunction< Range(LocalDomain), GridView, F, LocalDerivativeTraits< EntitySet, DerivativeTraits >::template Traits > LocalFunction
Definition analyticgridviewfunction.hh:174
│ │ │ -
typename SignatureTraits< Signature >::RawSignature RawSignature
Definition analyticgridviewfunction.hh:157
│ │ │ -
GridViewEntitySet< GridView, 0 > EntitySet
Definition analyticgridviewfunction.hh:161
│ │ │ -
const EntitySet & entitySet() const
Return the set of entities this local-function can be bound to.
Definition analyticgridviewfunction.hh:202
│ │ │ -
typename DerivativeTraits< RawSignature >::Range(Domain) DerivativeSignature
Definition analyticgridviewfunction.hh:158
│ │ │ -
AnalyticGridViewFunction< DerivativeSignature, GridView, GlobalRawDerivative, DerivativeTraits > Derivative
Definition analyticgridviewfunction.hh:171
│ │ │ -
An entity set for all entities of given codim in a grid view.
Definition gridviewentityset.hh:27
│ │ │ -
GridView::template Codim< codim >::Entity Element
Definition gridviewentityset.hh:36
│ │ │ -
Element::Geometry::LocalCoordinate LocalCoordinate
Definition gridviewentityset.hh:39
│ │ │ -
Derivative traits for local functions.
Definition localderivativetraits.hh:32
│ │ │ +
A wrapper providing small object optimization with polymorphic types.
Definition polymorphicsmallobject.hh:51
│ │ │ +
const std::type_info & target_type() const
Get type of stored object.
Definition typeerasure.hh:201
│ │ │ +
TypeErasureBase(T &&t)
Construct wrapper from object.
Definition typeerasure.hh:174
│ │ │ +
PolymorphicSmallObject< Imp::TypeErasureWrapperInterface< typename Traits::Concept >, 56 > wrapped_
Definition typeerasure.hh:207
│ │ │ +
TypeErasureBase()=default
Default constructor.
│ │ │ +
Interface & asInterface()
Get mutable reference to wrapped object.
Definition typeerasure.hh:182
│ │ │ +
const Interface & asInterface() const
Get reference to wrapped object.
Definition typeerasure.hh:188
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,350 +1,191 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -analyticgridviewfunction.hh │ │ │ │ +typeerasure.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH │ │ │ │ -8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH │ │ │ │ +8#define DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ -12 │ │ │ │ -13#include │ │ │ │ -14#include │ │ │ │ -15 │ │ │ │ -16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_s_i_g_n_a_t_u_r_e_._h_h> │ │ │ │ -17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ -18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n___i_m_p_._h_h> │ │ │ │ -19#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ -20#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h> │ │ │ │ -21#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_l_o_c_a_l_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ +10#include │ │ │ │ +11 │ │ │ │ +12#include │ │ │ │ +13 │ │ │ │ +14#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ +15#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_i_n_t_e_r_f_a_c_e_s_._h_h> │ │ │ │ +16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_p_o_l_y_m_o_r_p_h_i_c_s_m_a_l_l_o_b_j_e_c_t_._h_h> │ │ │ │ +17 │ │ │ │ +18namespace _D_u_n_e { │ │ │ │ +19namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +20namespace Imp { │ │ │ │ +21 │ │ │ │ 22 │ │ │ │ 23 │ │ │ │ -24namespace _D_u_n_e { │ │ │ │ -25namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -26 │ │ │ │ -27namespace Imp { │ │ │ │ -28 │ │ │ │ -29template class │ │ │ │ -DerivativeTraits=DefaultDerivativeTraits> │ │ │ │ -30class LocalAnalyticGridViewFunction; │ │ │ │ -31 │ │ │ │ -32template │ │ │ │ -class DerivativeTraits> │ │ │ │ -33class LocalAnalyticGridViewFunction │ │ │ │ -34{ │ │ │ │ -35public: │ │ │ │ -36 using Signature = Range(LocalDomain); │ │ │ │ -37 using RawSignature = typename SignatureTraits::RawSignature; │ │ │ │ -38 using DerivativeSignature = typename DerivativeTraits::Range │ │ │ │ -(LocalDomain); │ │ │ │ -39 │ │ │ │ -40 using GridView = GV; │ │ │ │ -41 using EntitySet = GridViewEntitySet; │ │ │ │ -42 using Element = typename EntitySet::Element; │ │ │ │ -43// using Geometry = typename Element::Geometry; │ │ │ │ -44 using Geometry = std::decay_t; │ │ │ │ +37template │ │ │ │ +38class TypeErasureWrapperInterface : │ │ │ │ +39 public Interface, │ │ │ │ +40 public PolymorphicType> │ │ │ │ +41{ │ │ │ │ +42public: │ │ │ │ +43 virtual const std::type_info& target_type() const = 0; │ │ │ │ +44}; │ │ │ │ 45 │ │ │ │ -46 // Use the indirection via derivativeIfImplemented to also support │ │ │ │ -47 // function types F that do not implement derivative. In this case │ │ │ │ -48 // the interface type DifferentiableFunction is using a dummy for │ │ │ │ -49 // the derivative type │ │ │ │ -50 using DerivativeDummy = DifferentiableFunction; │ │ │ │ -51 using GlobalRawDerivative = decltype(Imp:: │ │ │ │ -derivativeIfImplemented(std::declval())); │ │ │ │ -52 using LocalDerivative = LocalAnalyticGridViewFunction; │ │ │ │ -53 │ │ │ │ -55 template = 0> │ │ │ │ -56 LocalAnalyticGridViewFunction(FT&& f) : │ │ │ │ -57 f_(std::forward(f)) │ │ │ │ -58 {} │ │ │ │ -59 │ │ │ │ -61 template │ │ │ │ -62 LocalAnalyticGridViewFunction(FT&& f, const Element& element, const std:: │ │ │ │ -optional& geometry) : │ │ │ │ -63 f_(std::forward(f)), │ │ │ │ -64 element_(element), │ │ │ │ -65 geometry_(geometry) │ │ │ │ -66 {} │ │ │ │ -67 │ │ │ │ -68 │ │ │ │ -77 void bind(const Element& element) │ │ │ │ -78 { │ │ │ │ -79 element_ = element; │ │ │ │ -80 geometry_.emplace(element_.geometry()); │ │ │ │ -81 } │ │ │ │ -82 │ │ │ │ -84 void unbind() │ │ │ │ -85 { │ │ │ │ -86 geometry_.reset(); │ │ │ │ -87 } │ │ │ │ -88 │ │ │ │ -91 bool bound() const │ │ │ │ -92 { │ │ │ │ -93 return static_cast(geometry_); │ │ │ │ -94 } │ │ │ │ -95 │ │ │ │ -105 Range operator()(const LocalDomain& x) const │ │ │ │ -106 { │ │ │ │ -107 assert(!!geometry_); │ │ │ │ -108 return (*f_)(geometry_->global(x)); │ │ │ │ -109 } │ │ │ │ -110 │ │ │ │ -112 const Element& localContext() const │ │ │ │ -113 { │ │ │ │ -114 assert(!!geometry_); │ │ │ │ -115 return element_; │ │ │ │ -116 } │ │ │ │ -117 │ │ │ │ -126 friend LocalDerivative _d_e_r_i_v_a_t_i_v_e(const LocalAnalyticGridViewFunction& t) │ │ │ │ -127 { │ │ │ │ -128 return LocalDerivative(Imp::derivativeIfImplemented │ │ │ │ -(*t.f_), t.element_, t.geometry_); │ │ │ │ -129 } │ │ │ │ -130 │ │ │ │ -131private: │ │ │ │ -132 // Wrap the function into CopyableOptional to make it copy-assignable │ │ │ │ -133 CopyableOptional f_; │ │ │ │ -134 Element element_; │ │ │ │ -135 std::optional geometry_ = std::nullopt; │ │ │ │ -136}; │ │ │ │ -137 │ │ │ │ -138} // end namespace Imp │ │ │ │ +46 │ │ │ │ +47 │ │ │ │ +64template │ │ │ │ +65class TypeErasureWrapperBase : │ │ │ │ +66 public TypeErasureWrapperInterface │ │ │ │ +67{ │ │ │ │ +68public: │ │ │ │ +69 template = 0> │ │ │ │ +70 TypeErasureWrapperBase(TT&& t) : │ │ │ │ +71 wrapped_(std::forward(t)) │ │ │ │ +72 {} │ │ │ │ +73 │ │ │ │ +75 T& get() │ │ │ │ +76 { │ │ │ │ +77 return wrapped_; │ │ │ │ +78 } │ │ │ │ +79 │ │ │ │ +81 const T& get() const │ │ │ │ +82 { │ │ │ │ +83 return wrapped_; │ │ │ │ +84 } │ │ │ │ +85 │ │ │ │ +86protected: │ │ │ │ +87 using Wrapped = T; │ │ │ │ +88 Wrapped wrapped_; │ │ │ │ +89}; │ │ │ │ +90 │ │ │ │ +91 │ │ │ │ +92 │ │ │ │ +116template class Implementation, class T> │ │ │ │ +117class TypeErasureWrapperImplementation : │ │ │ │ +118 public Implementation > │ │ │ │ +119{ │ │ │ │ +120public: │ │ │ │ +121 │ │ │ │ +123 template = │ │ │ │ +0> │ │ │ │ +124 TypeErasureWrapperImplementation(TT&& t) : │ │ │ │ +125 Implementation >(std::forward(t)) │ │ │ │ +126 {} │ │ │ │ +127 │ │ │ │ +129 virtual TypeErasureWrapperImplementation* clone() const │ │ │ │ +130 { │ │ │ │ +131 return new TypeErasureWrapperImplementation(*this); │ │ │ │ +132 } │ │ │ │ +133 │ │ │ │ +135 virtual TypeErasureWrapperImplementation* clone(void* buffer) const │ │ │ │ +136 { │ │ │ │ +137 return new (buffer) TypeErasureWrapperImplementation(*this); │ │ │ │ +138 } │ │ │ │ 139 │ │ │ │ -140 │ │ │ │ -141 │ │ │ │ -142 │ │ │ │ -143template class │ │ │ │ -DerivativeTraits=_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s> │ │ │ │ -_1_4_4class _A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n; │ │ │ │ +141 virtual TypeErasureWrapperImplementation* move(void* buffer) │ │ │ │ +142 { │ │ │ │ +143 return new (buffer) TypeErasureWrapperImplementation(std::move(*this)); │ │ │ │ +144 } │ │ │ │ 145 │ │ │ │ -146 │ │ │ │ -152template class │ │ │ │ -DerivativeTraits> │ │ │ │ -_1_5_3class _A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ -154{ │ │ │ │ -155public: │ │ │ │ -_1_5_6 using _S_i_g_n_a_t_u_r_e = Range(Domain); │ │ │ │ -_1_5_7 using _R_a_w_S_i_g_n_a_t_u_r_e = typename _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s_<_S_i_g_n_a_t_u_r_e_>_:_:_R_a_w_S_i_g_n_a_t_u_r_e; │ │ │ │ -_1_5_8 using _D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e = typename DerivativeTraits::Range │ │ │ │ -(Domain); │ │ │ │ -159 │ │ │ │ -_1_6_0 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ -_1_6_1 using _E_n_t_i_t_y_S_e_t = _G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_G_r_i_d_V_i_e_w_,_ _0_>; │ │ │ │ -_1_6_2 using _E_l_e_m_e_n_t = typename _E_n_t_i_t_y_S_e_t_:_:_E_l_e_m_e_n_t; │ │ │ │ -_1_6_3 using _G_e_o_m_e_t_r_y = typename Element::Geometry; │ │ │ │ -164 │ │ │ │ -165 // Use the indirection via derivativeIfImplemented to also support │ │ │ │ -166 // function types F that do not implement derivative. In this case │ │ │ │ -167 // the interface type DifferentiableFunction is used a dummy for │ │ │ │ -168 // the derivative type │ │ │ │ -_1_6_9 using _D_e_r_i_v_a_t_i_v_e_D_u_m_m_y = _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_<_D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e_>; │ │ │ │ -_1_7_0 using _G_l_o_b_a_l_R_a_w_D_e_r_i_v_a_t_i_v_e = decltype(Imp:: │ │ │ │ -derivativeIfImplemented(std::declval())); │ │ │ │ -_1_7_1 using _D_e_r_i_v_a_t_i_v_e = _A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e_,_ _G_r_i_d_V_i_e_w_, │ │ │ │ -_G_l_o_b_a_l_R_a_w_D_e_r_i_v_a_t_i_v_e_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_>; │ │ │ │ -172 │ │ │ │ -_1_7_3 using _L_o_c_a_l_D_o_m_a_i_n = typename _E_n_t_i_t_y_S_e_t_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e; │ │ │ │ -_1_7_4 using _L_o_c_a_l_F_u_n_c_t_i_o_n = typename Imp::LocalAnalyticGridViewFunction_:_:_t_e_m_p_l_a_t_e Traits>; │ │ │ │ -175 │ │ │ │ -177 template │ │ │ │ -_1_7_8 _A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n(FT&& f, const _G_r_i_d_V_i_e_w& gridView) : │ │ │ │ -179 f_(std::forward(f)), │ │ │ │ -180 entitySet_(gridView) │ │ │ │ -181 {} │ │ │ │ -182 │ │ │ │ -_1_8_4 Range _o_p_e_r_a_t_o_r_(_)(const Domain& x) const │ │ │ │ -185 { │ │ │ │ -186 return (*f_)(x); │ │ │ │ -187 } │ │ │ │ -188 │ │ │ │ -_1_9_0 friend _D_e_r_i_v_a_t_i_v_e _d_e_r_i_v_a_t_i_v_e(const _A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n& t) │ │ │ │ -191 { │ │ │ │ -192 return _D_e_r_i_v_a_t_i_v_e(Imp::derivativeIfImplemented(*t.f_), │ │ │ │ -t.entitySet_.gridView()); │ │ │ │ -193 } │ │ │ │ -194 │ │ │ │ -_1_9_6 friend _L_o_c_a_l_F_u_n_c_t_i_o_n _l_o_c_a_l_F_u_n_c_t_i_o_n(const _A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n& t) │ │ │ │ -197 { │ │ │ │ -198 return _L_o_c_a_l_F_u_n_c_t_i_o_n(*t.f_); │ │ │ │ -199 } │ │ │ │ -200 │ │ │ │ -_2_0_2 const _E_n_t_i_t_y_S_e_t& _e_n_t_i_t_y_S_e_t() const │ │ │ │ -203 { │ │ │ │ -204 return entitySet_; │ │ │ │ -205 } │ │ │ │ -206 │ │ │ │ -207private: │ │ │ │ -208 // Wrap the function into CopyableOptional to make it copy-assignable │ │ │ │ -209 CopyableOptional f_; │ │ │ │ -210 EntitySet entitySet_; │ │ │ │ -211}; │ │ │ │ +147 virtual const std::type_info& target_type() const │ │ │ │ +148 { │ │ │ │ +149 return typeid(T); │ │ │ │ +150 } │ │ │ │ +151}; │ │ │ │ +152 │ │ │ │ +153} // namespace Dune::Functions::Imp │ │ │ │ +154 │ │ │ │ +155 │ │ │ │ +156 │ │ │ │ +167template class Implementation, size_t │ │ │ │ +bufferSize = 56> │ │ │ │ +_1_6_8class _T_y_p_e_E_r_a_s_u_r_e_B_a_s_e │ │ │ │ +169{ │ │ │ │ +170public: │ │ │ │ +171 │ │ │ │ +173 template = 0 > │ │ │ │ +_1_7_4 _T_y_p_e_E_r_a_s_u_r_e_B_a_s_e(T&& t) : │ │ │ │ +175 _w_r_a_p_p_e_d__(Imp::TypeErasureWrapperImplementation>(std::forward(t))) │ │ │ │ +176 {} │ │ │ │ +177 │ │ │ │ +_1_7_9 _T_y_p_e_E_r_a_s_u_r_e_B_a_s_e() = default; │ │ │ │ +180 │ │ │ │ +_1_8_2 Interface& _a_s_I_n_t_e_r_f_a_c_e() │ │ │ │ +183 { │ │ │ │ +184 return _w_r_a_p_p_e_d__.get(); │ │ │ │ +185 } │ │ │ │ +186 │ │ │ │ +_1_8_8 const Interface& _a_s_I_n_t_e_r_f_a_c_e() const │ │ │ │ +189 { │ │ │ │ +190 return _w_r_a_p_p_e_d__.get(); │ │ │ │ +191 } │ │ │ │ +192 │ │ │ │ +_1_9_4 explicit operator bool() const noexcept │ │ │ │ +195 { │ │ │ │ +196 // Forward the query to the wrapped object │ │ │ │ +197 return static_cast(_w_r_a_p_p_e_d__); │ │ │ │ +198 } │ │ │ │ +199 │ │ │ │ +_2_0_1 const std::type_info& _t_a_r_g_e_t___t_y_p_e() const │ │ │ │ +202 { │ │ │ │ +203 return _w_r_a_p_p_e_d__.get().target_type(); │ │ │ │ +204 } │ │ │ │ +205 │ │ │ │ +206protected: │ │ │ │ +_2_0_7 _P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t_<_I_m_p_:_:_T_y_p_e_E_r_a_s_u_r_e_W_r_a_p_p_e_r_I_n_t_e_r_f_a_c_e_<_I_n_t_e_r_f_a_c_e_>, │ │ │ │ +bufferSize > _w_r_a_p_p_e_d__; │ │ │ │ +208}; │ │ │ │ +209 │ │ │ │ +210 │ │ │ │ +211}} // namespace Dune::Functions │ │ │ │ 212 │ │ │ │ -213// deduction guides │ │ │ │ -214template::Geometry:: │ │ │ │ -GlobalCoordinate, │ │ │ │ -216 class Range = std::invoke_result_t> │ │ │ │ -_2_1_7_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n(const F&, const GridView&) │ │ │ │ -218 -> _A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n; │ │ │ │ -219 │ │ │ │ -220 │ │ │ │ -237template │ │ │ │ -_2_3_8auto _m_a_k_e_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n(F&& f, const GridView& gridView) │ │ │ │ -239{ │ │ │ │ -240 using Domain = typename GridView::template Codim<0>::Geometry:: │ │ │ │ -GlobalCoordinate; │ │ │ │ -241 using Range = std::invoke_result_t; │ │ │ │ -242 using FRaw = std::decay_t; │ │ │ │ -243 │ │ │ │ -244 return _A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_r_i_d_V_i_e_w_,_ _F_R_a_w_>(std:: │ │ │ │ -forward(f), gridView); │ │ │ │ -245} │ │ │ │ -246 │ │ │ │ -247 │ │ │ │ -248 │ │ │ │ -249}} // namespace Dune::Functions │ │ │ │ -250 │ │ │ │ -251 │ │ │ │ -252 │ │ │ │ -253#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH │ │ │ │ -_l_o_c_a_l_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h │ │ │ │ -_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h │ │ │ │ -_s_i_g_n_a_t_u_r_e_._h_h │ │ │ │ -_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n___i_m_p_._h_h │ │ │ │ -_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h │ │ │ │ -_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ -TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const │ │ │ │ -TrigonometricFunction< K, sinFactor, cosFactor > &f) │ │ │ │ -Obtain derivative of TrigonometricFunction function. │ │ │ │ -DDeeffiinniittiioonn trigonometricfunction.hh:43 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_:_:_m_a_k_e_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ -auto makeAnalyticGridViewFunction(F &&f, const GridView &gridView) │ │ │ │ -Create an AnalyticGridViewFunction from a function and a grid view. │ │ │ │ -DDeeffiinniittiioonn analyticgridviewfunction.hh:238 │ │ │ │ +213 │ │ │ │ +214 │ │ │ │ +215#endif // DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH │ │ │ │ +_p_o_l_y_m_o_r_p_h_i_c_s_m_a_l_l_o_b_j_e_c_t_._h_h │ │ │ │ +_t_y_p_e___t_r_a_i_t_s_._h_h │ │ │ │ +_i_n_t_e_r_f_a_c_e_s_._h_h │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ -AnalyticGridViewFunction(const F &, const GridView &) - │ │ │ │ -> AnalyticGridViewFunction< Range(Domain), GridView, F > │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ -Default implementation for derivative traits. │ │ │ │ -DDeeffiinniittiioonn defaultderivativetraits.hh:41 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n │ │ │ │ -DDeeffiinniittiioonn differentiablefunction.hh:33 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_g_n_a_t_u_r_e_T_r_a_i_t_s │ │ │ │ -Helper class to deduce the signature of a callable. │ │ │ │ -DDeeffiinniittiioonn signature.hh:60 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ -DDeeffiinniittiioonn analyticgridviewfunction.hh:144 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ -Range operator()(const Domain &x) const │ │ │ │ -Evaluate the wrapped function f directly in global coordinates x. │ │ │ │ -DDeeffiinniittiioonn analyticgridviewfunction.hh:184 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_L_o_c_a_l_D_o_m_a_i_n │ │ │ │ -typename EntitySet::LocalCoordinate LocalDomain │ │ │ │ -DDeeffiinniittiioonn analyticgridviewfunction.hh:173 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ -friend Derivative derivative(const AnalyticGridViewFunction &t) │ │ │ │ -Create a derivative grid-function by wrapping the derivative of f. │ │ │ │ -DDeeffiinniittiioonn analyticgridviewfunction.hh:190 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_G_e_o_m_e_t_r_y │ │ │ │ -typename Element::Geometry Geometry │ │ │ │ -DDeeffiinniittiioonn analyticgridviewfunction.hh:163 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_E_l_e_m_e_n_t │ │ │ │ -typename EntitySet::Element Element │ │ │ │ -DDeeffiinniittiioonn analyticgridviewfunction.hh:162 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_G_r_i_d_V_i_e_w │ │ │ │ -GV GridView │ │ │ │ -DDeeffiinniittiioonn analyticgridviewfunction.hh:160 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_G_l_o_b_a_l_R_a_w_D_e_r_i_v_a_t_i_v_e │ │ │ │ -decltype(Imp::derivativeIfImplemented< DerivativeDummy, F >(std::declval< F > │ │ │ │ -())) GlobalRawDerivative │ │ │ │ -DDeeffiinniittiioonn analyticgridviewfunction.hh:170 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_D_e_r_i_v_a_t_i_v_e_D_u_m_m_y │ │ │ │ -DifferentiableFunction< DerivativeSignature > DerivativeDummy │ │ │ │ -DDeeffiinniittiioonn analyticgridviewfunction.hh:169 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_S_i_g_n_a_t_u_r_e │ │ │ │ -Range(Domain) Signature │ │ │ │ -DDeeffiinniittiioonn analyticgridviewfunction.hh:156 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ -AnalyticGridViewFunction(FT &&f, const GridView &gridView) │ │ │ │ -Create the grid-function by wrapping a function f and create a │ │ │ │ -GridViewEntitySet. │ │ │ │ -DDeeffiinniittiioonn analyticgridviewfunction.hh:178 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_l_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -friend LocalFunction localFunction(const AnalyticGridViewFunction &t) │ │ │ │ -Construct the associated local-function. │ │ │ │ -DDeeffiinniittiioonn analyticgridviewfunction.hh:196 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -typename Imp::LocalAnalyticGridViewFunction< Range(LocalDomain), GridView, F, │ │ │ │ -LocalDerivativeTraits< EntitySet, DerivativeTraits >::template Traits > │ │ │ │ -LocalFunction │ │ │ │ -DDeeffiinniittiioonn analyticgridviewfunction.hh:174 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_R_a_w_S_i_g_n_a_t_u_r_e │ │ │ │ -typename SignatureTraits< Signature >::RawSignature RawSignature │ │ │ │ -DDeeffiinniittiioonn analyticgridviewfunction.hh:157 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_E_n_t_i_t_y_S_e_t │ │ │ │ -GridViewEntitySet< GridView, 0 > EntitySet │ │ │ │ -DDeeffiinniittiioonn analyticgridviewfunction.hh:161 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_e_n_t_i_t_y_S_e_t │ │ │ │ -const EntitySet & entitySet() const │ │ │ │ -Return the set of entities this local-function can be bound to. │ │ │ │ -DDeeffiinniittiioonn analyticgridviewfunction.hh:202 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e │ │ │ │ -typename DerivativeTraits< RawSignature >::Range(Domain) DerivativeSignature │ │ │ │ -DDeeffiinniittiioonn analyticgridviewfunction.hh:158 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_D_e_r_i_v_a_t_i_v_e │ │ │ │ -AnalyticGridViewFunction< DerivativeSignature, GridView, GlobalRawDerivative, │ │ │ │ -DerivativeTraits > Derivative │ │ │ │ -DDeeffiinniittiioonn analyticgridviewfunction.hh:171 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t │ │ │ │ -An entity set for all entities of given codim in a grid view. │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:27 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_E_l_e_m_e_n_t │ │ │ │ -GridView::template Codim< codim >::Entity Element │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:36 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ -Element::Geometry::LocalCoordinate LocalCoordinate │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:39 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ -Derivative traits for local functions. │ │ │ │ -DDeeffiinniittiioonn localderivativetraits.hh:32 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t │ │ │ │ +A wrapper providing small object optimization with polymorphic types. │ │ │ │ +DDeeffiinniittiioonn polymorphicsmallobject.hh:51 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_:_:_t_a_r_g_e_t___t_y_p_e │ │ │ │ +const std::type_info & target_type() const │ │ │ │ +Get type of stored object. │ │ │ │ +DDeeffiinniittiioonn typeerasure.hh:201 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e │ │ │ │ +TypeErasureBase(T &&t) │ │ │ │ +Construct wrapper from object. │ │ │ │ +DDeeffiinniittiioonn typeerasure.hh:174 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_<_ _t_y_p_e_n_a_m_e_ _T_r_a_i_t_s_:_:_C_o_n_c_e_p_t_,_ _T_r_a_i_t_s_:_:_t_e_m_p_l_a_t_e │ │ │ │ +_M_o_d_e_l_ _>_:_:_w_r_a_p_p_e_d__ │ │ │ │ +PolymorphicSmallObject< Imp::TypeErasureWrapperInterface< typename Traits:: │ │ │ │ +Concept >, 56 > wrapped_ │ │ │ │ +DDeeffiinniittiioonn typeerasure.hh:207 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e │ │ │ │ +TypeErasureBase()=default │ │ │ │ +Default constructor. │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_:_:_a_s_I_n_t_e_r_f_a_c_e │ │ │ │ +Interface & asInterface() │ │ │ │ +Get mutable reference to wrapped object. │ │ │ │ +DDeeffiinniittiioonn typeerasure.hh:182 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_:_:_a_s_I_n_t_e_r_f_a_c_e │ │ │ │ +const Interface & asInterface() const │ │ │ │ +Get reference to wrapped object. │ │ │ │ +DDeeffiinniittiioonn typeerasure.hh:188 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ - * _a_n_a_l_y_t_i_c_g_r_i_d_v_i_e_w_f_u_n_c_t_i_o_n_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _t_y_p_e_e_r_a_s_u_r_e_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00074.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: transformedindexbasis.hh File Reference │ │ │ +Dune-Functions: geometryinancestor.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,73 +88,44 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
transformedindexbasis.hh File Reference
│ │ │ +
geometryinancestor.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <tuple>
│ │ │ -#include <utility>
│ │ │ -#include <dune/common/hybridutilities.hh>
│ │ │ -#include <dune/common/reservedvector.hh>
│ │ │ -#include <dune/common/typeutilities.hh>
│ │ │ -#include <dune/functions/common/staticforloop.hh>
│ │ │ -#include <dune/functions/common/type_traits.hh>
│ │ │ -#include <dune/functions/common/utility.hh>
│ │ │ -#include <dune/functions/functionspacebases/basistags.hh>
│ │ │ -#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ -#include <dune/functions/functionspacebases/concepts.hh>
│ │ │ -#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │ +
#include <vector>
│ │ │ +#include <dune/common/iteratorrange.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::Experimental::TransformedIndexPreBasis< RPB, T >
 A pre-basis transforming multi-indices. More...
class  Dune::Functions::BasisFactory::Experimental::GenericIndexingTransformation< IndexTransformation, SizeImplementation, ContainerDescriptorImplementation, minIS, maxIS >
 A generic implementation of a transformation. More...
class  Dune::Functions::GeometryInAncestor< Element >
 A geometry embedding a descendent element into an ancestor. More...
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ -

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::Experimental
namespace  Dune::Functions::BasisFactory
namespace  Dune::Functions::BasisFactory::Experimental
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │

│ │ │ -Functions

template<class RPB, class T>
 Dune::Functions::Experimental::TransformedIndexPreBasis (RPB &&, T &&) -> TransformedIndexPreBasis< std::decay_t< RPB >, std::decay_t< T > >
template<class RawPreBasisFactory, class Transformation>
auto Dune::Functions::BasisFactory::Experimental::transformIndices (RawPreBasisFactory &&preBasisFactory, Transformation &&transformation)
 Create a TransformedIndexPreBasisFactory.
template<class IndexTransformation, class SizeImplementation, class ContainerDescriptorImplementation, std::size_t minIndexSize, std::size_t maxIndexSize>
auto Dune::Functions::BasisFactory::Experimental::indexTransformation (IndexTransformation &&indexTransformation, SizeImplementation &&sizeImplementation, ContainerDescriptorImplementation &&containerDescriptorImplementation, Dune::index_constant< minIndexSize >, Dune::index_constant< maxIndexSize >)
 A generic implementation of a transformation.
template<class IndexTransformation, class SizeImplementation, std::size_t minIndexSize, std::size_t maxIndexSize>
auto Dune::Functions::BasisFactory::Experimental::indexTransformation (IndexTransformation &&indexTrafo, SizeImplementation &&sizeImpl, Dune::index_constant< minIndexSize > minSize, Dune::index_constant< maxIndexSize > maxSize)
 Fallback implementation if no container descriptor argument is given.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,60 +1,19 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -transformedindexbasis.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_s_t_a_t_i_c_f_o_r_l_o_o_p_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_b_a_s_i_s_t_a_g_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ +geometryinancestor.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_<_ _R_P_B_,_ _T_ _> │ │ │ │ -  A pre-basis transforming multi-indices. _M_o_r_e_._._. │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_: │ │ │ │ - _G_e_n_e_r_i_c_I_n_d_e_x_i_n_g_T_r_a_n_s_f_o_r_m_a_t_i_o_n_<_ _I_n_d_e_x_T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _S_i_z_e_I_m_p_l_e_m_e_n_t_a_t_i_o_n_, │ │ │ │ - _C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_I_m_p_l_e_m_e_n_t_a_t_i_o_n_,_ _m_i_n_I_S_,_ _m_a_x_I_S_ _> │ │ │ │ -  A generic implementation of a transformation. _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_<_ _E_l_e_m_e_n_t_ _> │ │ │ │ +  A geometry embedding a descendent element into an ancestor. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l │ │ │ │ -FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s (RPB &&, T &&) - │ │ │ │ - > TransformedIndexPreBasis< std::decay_t< RPB >, std::decay_t< T > > │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_t_r_a_n_s_f_o_r_m_I_n_d_i_c_e_s │ │ │ │ - (RawPreBasisFactory &&preBasisFactory, Transformation &&transformation) │ │ │ │ -  Create a TransformedIndexPreBasisFactory. │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_i_n_d_e_x_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ - (IndexTransformation &&indexTransformation, SizeImplementation │ │ │ │ - &&sizeImplementation, ContainerDescriptorImplementation │ │ │ │ - &&containerDescriptorImplementation, Dune::index_constant< minIndexSize │ │ │ │ - >, Dune::index_constant< maxIndexSize >) │ │ │ │ -  A generic implementation of a transformation. │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_i_n_d_e_x_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ - (IndexTransformation &&indexTrafo, SizeImplementation &&sizeImpl, Dune:: │ │ │ │ - index_constant< minIndexSize > minSize, Dune::index_constant< │ │ │ │ - maxIndexSize > maxSize) │ │ │ │ -  Fallback implementation if no container descriptor argument is given. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _t_r_a_n_s_f_o_r_m_e_d_i_n_d_e_x_b_a_s_i_s_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _g_e_o_m_e_t_r_y_i_n_a_n_c_e_s_t_o_r_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00074_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: transformedindexbasis.hh Source File │ │ │ +Dune-Functions: geometryinancestor.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,364 +88,186 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
transformedindexbasis.hh
│ │ │ +
geometryinancestor.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_COMMON_GEOMETRYINANCESTOR_HH
│ │ │ +
8#define DUNE_FUNCTIONS_COMMON_GEOMETRYINANCESTOR_HH
│ │ │
9
│ │ │ -
10#include <tuple>
│ │ │ -
11#include <utility>
│ │ │ -
12
│ │ │ -
13#include <dune/common/hybridutilities.hh>
│ │ │ -
14#include <dune/common/reservedvector.hh>
│ │ │ -
15#include <dune/common/typeutilities.hh>
│ │ │ -
16#include <dune/common/hybridutilities.hh>
│ │ │ -
17
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
25
│ │ │ -
26
│ │ │ -
27namespace Dune {
│ │ │ -
28namespace Functions {
│ │ │ -
29namespace Experimental {
│ │ │ -
30
│ │ │ -
31// *****************************************************************************
│ │ │ -
32// *****************************************************************************
│ │ │ -
33
│ │ │ -
50template<class RPB, class T>
│ │ │ -
│ │ │ - │ │ │ -
52{
│ │ │ -
53 using Transformation = T;
│ │ │ -
54
│ │ │ - │ │ │ -
56
│ │ │ -
57public:
│ │ │ -
58
│ │ │ -
59 using RawPreBasis = RPB;
│ │ │ -
60
│ │ │ -
62 using GridView = typename RawPreBasis::GridView;
│ │ │ -
63
│ │ │ -
65 using size_type = std::size_t;
│ │ │ -
66
│ │ │ -
68 using Node = typename RawPreBasis::Node;
│ │ │ -
69
│ │ │ -
70 static constexpr size_type maxMultiIndexSize = Transformation::maxIndexSize;
│ │ │ -
71 static constexpr size_type minMultiIndexSize = Transformation::minIndexSize;
│ │ │ -
72 static constexpr size_type multiIndexBufferSize = std::max(RawPreBasis::multiIndexBufferSize, maxMultiIndexSize);
│ │ │ -
73
│ │ │ -
79 template<class RPB_R, class T_R>
│ │ │ -
│ │ │ -
80 TransformedIndexPreBasis(RPB_R&& rawPreBasis, T_R&& transformation) :
│ │ │ -
81 rawPreBasis_(std::forward<RPB_R>(rawPreBasis)),
│ │ │ -
82 transformation_(std::forward<T_R>(transformation))
│ │ │ -
83 {}
│ │ │ -
│ │ │ -
84
│ │ │ -
│ │ │ - │ │ │ -
87 {
│ │ │ -
88 rawPreBasis_.initializeIndices();
│ │ │ -
89 }
│ │ │ -
│ │ │ -
90
│ │ │ -
│ │ │ -
92 const GridView& gridView() const
│ │ │ -
93 {
│ │ │ -
94 return rawPreBasis_.gridView();
│ │ │ -
95 }
│ │ │ -
│ │ │ -
96
│ │ │ -
│ │ │ -
98 void update(const GridView& gv)
│ │ │ -
99 {
│ │ │ -
100 rawPreBasis_.update(gv);
│ │ │ -
101 }
│ │ │ -
│ │ │ -
102
│ │ │ -
│ │ │ - │ │ │ -
107 {
│ │ │ -
108 return rawPreBasis_.makeNode();
│ │ │ -
109 }
│ │ │ -
│ │ │ -
110
│ │ │ -
│ │ │ - │ │ │ -
113 {
│ │ │ -
114 return size(Dune::ReservedVector<size_type, multiIndexBufferSize>{});
│ │ │ -
115 }
│ │ │ -
│ │ │ -
116
│ │ │ -
118 template<class SizePrefix>
│ │ │ +
10#include <vector>
│ │ │ +
11
│ │ │ +
12#include <dune/common/iteratorrange.hh>
│ │ │ +
13
│ │ │ +
14namespace Dune::Functions {
│ │ │ +
15
│ │ │ +
16
│ │ │ +
17
│ │ │ +
37template<class Element>
│ │ │ +
│ │ │ + │ │ │ +
39{
│ │ │ +
40 using GeometryInFather = typename Element::LocalGeometry;
│ │ │ +
41
│ │ │ +
42 template<class V>
│ │ │ +
43 static auto reverse_view(V&& v)
│ │ │ +
44 {
│ │ │ +
45 return Dune::IteratorRange(v.rbegin(), v.rend());
│ │ │ +
46 }
│ │ │ +
47
│ │ │ +
48public:
│ │ │ +
49
│ │ │ +
51 using LocalCoordinate = typename Element::Geometry::LocalCoordinate;
│ │ │ +
52 //
│ │ │ +
54 using GlobalCoordinate = typename Element::Geometry::LocalCoordinate;
│ │ │ +
55
│ │ │ +
56 GeometryInAncestor() = default;
│ │ │ + │ │ │ +
58
│ │ │ +
│ │ │ + │ │ │ +
67 : storedFineElement_(other.storedFineElement_)
│ │ │ +
68 , storedCoarseElement_(other.storedCoarseElement_)
│ │ │ +
69 , fineElementPtr_(&storedFineElement_)
│ │ │ +
70 , coarseElementPtr_(&storedFineElement_)
│ │ │ +
71 , geometryInFathersVector_(other.geometryInFathersVector_)
│ │ │ +
72 {
│ │ │ +
73 // If other points to external fine element,
│ │ │ +
74 // we point to the same one.
│ │ │ +
75 if (other.fineElementPtr_ != & other.storedFineElement_)
│ │ │ +
76 fineElementPtr_ = other.fineElementPtr_;
│ │ │ +
77 // If the other coarse element is not the stored one,
│ │ │ +
78 // then it's the fine one.
│ │ │ +
79 if (other.coarseElementPtr_ != & other.storedCoarseElement_)
│ │ │ +
80 coarseElementPtr_ = fineElementPtr_;
│ │ │ +
81 }
│ │ │ +
│ │ │ +
82
│ │ │ +
│ │ │ + │ │ │ +
90 : storedFineElement_(other.storedFineElement_)
│ │ │ +
91 , storedCoarseElement_(other.storedCoarseElement_)
│ │ │ +
92 , fineElementPtr_(&fineElement)
│ │ │ +
93 , coarseElementPtr_(&storedFineElement_)
│ │ │ +
94 , geometryInFathersVector_(other.geometryInFathersVector_)
│ │ │ +
95 {
│ │ │ +
96 // If the other coarse element is not the stored one,
│ │ │ +
97 // then it's the fine one.
│ │ │ +
98 if (other.coarseElementPtr_ != & other.storedCoarseElement_)
│ │ │ +
99 coarseElementPtr_ = fineElementPtr_;
│ │ │ +
100 }
│ │ │ +
│ │ │ +
101
│ │ │ +
117 template<class F>
│ │ │ +
118 requires (std::is_invocable_r_v<bool,F,Element>)
│ │ │
│ │ │ -
119 size_type size(const SizePrefix& prefix) const
│ │ │ -
120 {
│ │ │ -
121 return transformation_.size(prefix, rawPreBasis_);
│ │ │ -
122 }
│ │ │ -
│ │ │ -
123
│ │ │ -
│ │ │ - │ │ │ -
126 {
│ │ │ -
127 return transformation_.containerDescriptor(rawPreBasis_);
│ │ │ -
128 }
│ │ │ -
│ │ │ -
129
│ │ │ -
│ │ │ - │ │ │ -
132 {
│ │ │ -
133 return transformation_.dimension(rawPreBasis_);
│ │ │ -
134 }
│ │ │ -
│ │ │ -
135
│ │ │ -
│ │ │ - │ │ │ -
138 {
│ │ │ -
139 return rawPreBasis_.maxNodeSize();
│ │ │ -
140 }
│ │ │ -
│ │ │ -
141
│ │ │ -
│ │ │ - │ │ │ -
143 {
│ │ │ -
144 return rawPreBasis_;
│ │ │ -
145 }
│ │ │ -
│ │ │ -
146
│ │ │ -
│ │ │ - │ │ │ -
148 {
│ │ │ -
149 return rawPreBasis_;
│ │ │ -
150 }
│ │ │ -
│ │ │ -
151
│ │ │ -
152 template<class MultiIndex>
│ │ │ -
│ │ │ -
153 void transformIndex(MultiIndex& multiIndex) const
│ │ │ -
154 {
│ │ │ -
155 transformation_.transformIndex(multiIndex, rawPreBasis_);
│ │ │ -
156 }
│ │ │ -
│ │ │ -
157
│ │ │ -
158 template<typename It>
│ │ │ -
│ │ │ -
159 It indices(const Node& node, It it) const
│ │ │ -
160 {
│ │ │ -
161 rawPreBasis().indices(node, it);
│ │ │ -
162 for(std::size_t i=0; i<node.size(); ++i)
│ │ │ -
163 {
│ │ │ -
164 transformIndex(*it);
│ │ │ -
165 ++it;
│ │ │ -
166 }
│ │ │ -
167 return it;
│ │ │ -
168 }
│ │ │ -
│ │ │ -
169
│ │ │ -
170protected:
│ │ │ - │ │ │ -
172 Transformation transformation_;
│ │ │ -
173};
│ │ │ -
│ │ │ -
174
│ │ │ -
175template<class RPB, class T>
│ │ │ - │ │ │ -
177
│ │ │ -
178
│ │ │ -
179} // end namespace Experimental
│ │ │ -
180
│ │ │ -
181
│ │ │ -
182namespace BasisFactory {
│ │ │ -
183namespace Experimental {
│ │ │ -
184
│ │ │ -
196template<class RawPreBasisFactory, class Transformation>
│ │ │ -
│ │ │ - │ │ │ -
198 RawPreBasisFactory&& preBasisFactory,
│ │ │ -
199 Transformation&& transformation)
│ │ │ -
200{
│ │ │ -
201 return [
│ │ │ -
202 preBasisFactory=std::forward<RawPreBasisFactory>(preBasisFactory),
│ │ │ -
203 transformation =std::forward<Transformation>(transformation)
│ │ │ -
204 ](const auto& gridView) {
│ │ │ -
205 return Dune::Functions::Experimental::TransformedIndexPreBasis(preBasisFactory(gridView), std::move(transformation));
│ │ │ -
206 };
│ │ │ -
207}
│ │ │ -
│ │ │ -
208
│ │ │ -
209
│ │ │ -
210
│ │ │ -
229template<class IndexTransformation, class SizeImplementation, class ContainerDescriptorImplementation, std::size_t minIS, std::size_t maxIS>
│ │ │ -
│ │ │ - │ │ │ -
231{
│ │ │ -
232public:
│ │ │ -
233
│ │ │ -
234 static constexpr std::size_t minIndexSize = minIS;
│ │ │ -
235 static constexpr std::size_t maxIndexSize = maxIS;
│ │ │ -
236
│ │ │ -
237 template<class IT_R, class SI_R, class CD_R>
│ │ │ -
│ │ │ -
238 GenericIndexingTransformation(IT_R&& indexTransformation, SI_R&& sizeImplementation, CD_R&& containerDescriptorImplementation) :
│ │ │ -
239 indexTransformation_(std::forward<IT_R>(indexTransformation)),
│ │ │ -
240 sizeImplementation_(std::forward<SI_R>(sizeImplementation)),
│ │ │ -
241 containerDescriptorImplementation_(std::forward<CD_R>(containerDescriptorImplementation))
│ │ │ -
242 {}
│ │ │ -
│ │ │ -
243
│ │ │ -
244 template<class MultiIndex, class PreBasis>
│ │ │ -
│ │ │ -
245 void transformIndex(MultiIndex& multiIndex, const PreBasis& preBasis) const
│ │ │ -
246 {
│ │ │ -
247 indexTransformation_(multiIndex, preBasis);
│ │ │ -
248 }
│ │ │ -
│ │ │ -
249
│ │ │ -
250 template<class Prefix, class PreBasis>
│ │ │ -
│ │ │ -
251 auto size(const Prefix& prefix, const PreBasis& preBasis) const
│ │ │ -
252 {
│ │ │ -
253 return sizeImplementation_(prefix, preBasis);
│ │ │ -
254 }
│ │ │ -
│ │ │ -
255
│ │ │ -
256 template<class PreBasis>
│ │ │ -
│ │ │ -
257 auto dimension(const PreBasis& preBasis) const
│ │ │ -
258 {
│ │ │ -
259 return preBasis.dimension();
│ │ │ -
260 }
│ │ │ -
│ │ │ -
261
│ │ │ -
262 template<class PreBasis>
│ │ │ -
│ │ │ -
263 auto containerDescriptor(const PreBasis& preBasis) const
│ │ │ -
264 {
│ │ │ -
265 return containerDescriptorImplementation_(preBasis);
│ │ │ -
266 }
│ │ │ -
│ │ │ -
267
│ │ │ -
268private:
│ │ │ -
269 IndexTransformation indexTransformation_;
│ │ │ -
270 SizeImplementation sizeImplementation_;
│ │ │ -
271 ContainerDescriptorImplementation containerDescriptorImplementation_;
│ │ │ -
272};
│ │ │ -
│ │ │ -
273
│ │ │ -
274
│ │ │ -
275
│ │ │ -
295template<class IndexTransformation, class SizeImplementation, class ContainerDescriptorImplementation, std::size_t minIndexSize, std::size_t maxIndexSize>
│ │ │ -
│ │ │ -
296auto indexTransformation(IndexTransformation&& indexTransformation,
│ │ │ -
297 SizeImplementation&& sizeImplementation,
│ │ │ -
298 ContainerDescriptorImplementation&& containerDescriptorImplementation,
│ │ │ -
299 Dune::index_constant<minIndexSize>,
│ │ │ -
300 Dune::index_constant<maxIndexSize>)
│ │ │ -
301{
│ │ │ - │ │ │ -
303 std::decay_t<IndexTransformation>,
│ │ │ -
304 std::decay_t<SizeImplementation>,
│ │ │ -
305 std::decay_t<ContainerDescriptorImplementation>,
│ │ │ -
306 minIndexSize, maxIndexSize>(
│ │ │ -
307 std::forward<IndexTransformation>(indexTransformation),
│ │ │ -
308 std::forward<SizeImplementation>(sizeImplementation),
│ │ │ -
309 std::forward<ContainerDescriptorImplementation>(containerDescriptorImplementation));
│ │ │ -
310}
│ │ │ -
│ │ │ -
311
│ │ │ -
313template<class IndexTransformation, class SizeImplementation,
│ │ │ -
314 std::size_t minIndexSize, std::size_t maxIndexSize>
│ │ │ -
│ │ │ -
315auto indexTransformation(IndexTransformation&& indexTrafo,
│ │ │ -
316 SizeImplementation&& sizeImpl,
│ │ │ -
317 Dune::index_constant<minIndexSize> minSize,
│ │ │ -
318 Dune::index_constant<maxIndexSize> maxSize)
│ │ │ -
319{
│ │ │ -
320 return indexTransformation(indexTrafo, sizeImpl,
│ │ │ -
321 [](auto&&) { return Dune::Functions::ContainerDescriptors::Unknown{}; },
│ │ │ -
322 minSize, maxSize);
│ │ │ -
323}
│ │ │ -
│ │ │ -
324
│ │ │ -
325} // end namespace Experimental
│ │ │ -
326} // end namespace BasisFactory
│ │ │ -
327} // end namespace Functions
│ │ │ -
328} // end namespace Dune
│ │ │ -
329
│ │ │ -
330
│ │ │ -
331#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
Definition monomialset.hh:19
│ │ │ +
119 const Element& bind(const Element& fineElement, F&& includeFather)
│ │ │ +
120 {
│ │ │ +
121 fineElementPtr_ = &fineElement;
│ │ │ +
122 geometryInFathersVector_.clear();
│ │ │ +
123 coarseElementPtr_ = fineElementPtr_;
│ │ │ +
124 while (includeFather(*coarseElementPtr_))
│ │ │ +
125 {
│ │ │ +
126 geometryInFathersVector_.push_back(coarseElementPtr_->geometryInFather());
│ │ │ +
127 storedCoarseElement_ = coarseElementPtr_->father();
│ │ │ +
128 coarseElementPtr_ = &storedCoarseElement_;
│ │ │ +
129 }
│ │ │ +
130 return coarseElement();
│ │ │ +
131 }
│ │ │ +
│ │ │ +
132
│ │ │ +
148 template<class F>
│ │ │ +
149 requires (std::is_invocable_r_v<bool,F,Element>)
│ │ │ +
│ │ │ +
150 const Element& bind(Element&& fineElement, F&& includeFather)
│ │ │ +
151 {
│ │ │ +
152 storedFineElement_ = fineElement;
│ │ │ +
153 bind(storedFineElement_, includeFather);
│ │ │ +
154 }
│ │ │ +
│ │ │ +
155
│ │ │ +
│ │ │ +
157 const Element& fineElement() const
│ │ │ +
158 {
│ │ │ +
159 return *fineElementPtr_;
│ │ │ +
160 }
│ │ │ +
│ │ │ +
161
│ │ │ +
│ │ │ +
163 const Element& coarseElement() const
│ │ │ +
164 {
│ │ │ +
165 return *coarseElementPtr_;
│ │ │ +
166 }
│ │ │ +
│ │ │ +
167
│ │ │ +
│ │ │ + │ │ │ +
170 {
│ │ │ +
171 for (const auto& g : geometryInFathersVector_)
│ │ │ +
172 x = g.global(x);
│ │ │ +
173 return x;
│ │ │ +
174 }
│ │ │ +
│ │ │ +
175
│ │ │ +
│ │ │ + │ │ │ +
178 {
│ │ │ +
179 // Here we can be instead use std::ranges::reverse_view once
│ │ │ +
180 // all supported compilers provide this (gcc>=10, clang>=16).
│ │ │ +
181 for (const auto& g : reverse_view(geometryInFathersVector_))
│ │ │ +
182 x = g.local(x);
│ │ │ +
183 return x;
│ │ │ +
184 }
│ │ │ +
│ │ │ +
185
│ │ │ +
186private:
│ │ │ +
187 Element storedFineElement_;
│ │ │ +
188 Element storedCoarseElement_;
│ │ │ +
189 const Element* fineElementPtr_ = nullptr;
│ │ │ +
190 const Element* coarseElementPtr_ = nullptr;
│ │ │ +
191 std::vector<GeometryInFather> geometryInFathersVector_;
│ │ │ +
192};
│ │ │ +
│ │ │ +
193
│ │ │ +
194
│ │ │ +
195
│ │ │ +
196} // namespace Dune::Functions
│ │ │ +
197
│ │ │ +
198
│ │ │ +
199
│ │ │ +
200
│ │ │ +
201#endif // DUNE_FUNCTIONS_COMMON_GEOMETRYINANCESTOR_HH
│ │ │
Definition monomialset.hh:19
│ │ │ -
Definition subdomain.hh:28
│ │ │ -
TransformedIndexPreBasis(RPB &&, T &&) -> TransformedIndexPreBasis< std::decay_t< RPB >, std::decay_t< T > >
│ │ │ -
Definition argyrisbasis.hh:926
│ │ │ -
auto indexTransformation(IndexTransformation &&indexTransformation, SizeImplementation &&sizeImplementation, ContainerDescriptorImplementation &&containerDescriptorImplementation, Dune::index_constant< minIndexSize >, Dune::index_constant< maxIndexSize >)
A generic implementation of a transformation.
Definition transformedindexbasis.hh:296
│ │ │ -
auto transformIndices(RawPreBasisFactory &&preBasisFactory, Transformation &&transformation)
Create a TransformedIndexPreBasisFactory.
Definition transformedindexbasis.hh:197
│ │ │ -
Fallback container descriptor if nothing else fits.
Definition containerdescriptors.hh:52
│ │ │ -
A pre-basis transforming multi-indices.
Definition transformedindexbasis.hh:52
│ │ │ -
It indices(const Node &node, It it) const
Definition transformedindexbasis.hh:159
│ │ │ -
Transformation transformation_
Definition transformedindexbasis.hh:172
│ │ │ -
void initializeIndices()
Initialize the global indices.
Definition transformedindexbasis.hh:86
│ │ │ -
typename RawPreBasis::GridView GridView
The grid view that the FE basis is defined on.
Definition transformedindexbasis.hh:62
│ │ │ -
void transformIndex(MultiIndex &multiIndex) const
Definition transformedindexbasis.hh:153
│ │ │ -
RawPreBasis rawPreBasis_
Definition transformedindexbasis.hh:171
│ │ │ -
typename RawPreBasis::Node Node
Template mapping root tree path to type of created tree node.
Definition transformedindexbasis.hh:68
│ │ │ -
TransformedIndexPreBasis(RPB_R &&rawPreBasis, T_R &&transformation)
Constructor for given child pre-basis objects.
Definition transformedindexbasis.hh:80
│ │ │ -
RawPreBasis & rawPreBasis()
Definition transformedindexbasis.hh:147
│ │ │ -
static constexpr size_type maxMultiIndexSize
Definition transformedindexbasis.hh:70
│ │ │ -
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition transformedindexbasis.hh:98
│ │ │ -
Node makeNode() const
Create tree node.
Definition transformedindexbasis.hh:106
│ │ │ -
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition transformedindexbasis.hh:92
│ │ │ -
size_type size(const SizePrefix &prefix) const
Return number of possible values for next position in multi index.
Definition transformedindexbasis.hh:119
│ │ │ -
RPB RawPreBasis
Definition transformedindexbasis.hh:59
│ │ │ -
size_type size() const
Same as size(prefix) with empty prefix.
Definition transformedindexbasis.hh:112
│ │ │ -
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition transformedindexbasis.hh:137
│ │ │ -
std::size_t size_type
Type used for indices and size information.
Definition transformedindexbasis.hh:65
│ │ │ -
static constexpr size_type multiIndexBufferSize
Definition transformedindexbasis.hh:72
│ │ │ -
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition transformedindexbasis.hh:131
│ │ │ -
const RawPreBasis & rawPreBasis() const
Definition transformedindexbasis.hh:142
│ │ │ -
static constexpr size_type minMultiIndexSize
Definition transformedindexbasis.hh:71
│ │ │ -
auto containerDescriptor() const
Return the container descriptor of the transformed pre-basis.
Definition transformedindexbasis.hh:125
│ │ │ -
A generic implementation of a transformation.
Definition transformedindexbasis.hh:231
│ │ │ -
GenericIndexingTransformation(IT_R &&indexTransformation, SI_R &&sizeImplementation, CD_R &&containerDescriptorImplementation)
Definition transformedindexbasis.hh:238
│ │ │ -
static constexpr std::size_t maxIndexSize
Definition transformedindexbasis.hh:235
│ │ │ -
auto containerDescriptor(const PreBasis &preBasis) const
Definition transformedindexbasis.hh:263
│ │ │ -
auto dimension(const PreBasis &preBasis) const
Definition transformedindexbasis.hh:257
│ │ │ -
auto size(const Prefix &prefix, const PreBasis &preBasis) const
Definition transformedindexbasis.hh:251
│ │ │ -
static constexpr std::size_t minIndexSize
Definition transformedindexbasis.hh:234
│ │ │ -
void transformIndex(MultiIndex &multiIndex, const PreBasis &preBasis) const
Definition transformedindexbasis.hh:245
│ │ │ - │ │ │ +
GeometryInAncestor(const GeometryInAncestor &other, const Element &fineElement)
Copy construction setting an external fine element.
Definition geometryinancestor.hh:89
│ │ │ +
GeometryInAncestor(GeometryInAncestor &&)=delete
│ │ │ +
const Element & fineElement() const
Return the fine element.
Definition geometryinancestor.hh:157
│ │ │ +
GlobalCoordinate global(LocalCoordinate x) const
Map local coordinate in fine element into coarse element.
Definition geometryinancestor.hh:169
│ │ │ +
const Element & bind(const Element &fineElement, F &&includeFather)
Bind this GeometryInAncestor to a fine element and search coarse element.
Definition geometryinancestor.hh:119
│ │ │ +
const Element & coarseElement() const
Return the coarse element.
Definition geometryinancestor.hh:163
│ │ │ + │ │ │ +
GeometryInAncestor(const GeometryInAncestor &other)
Copy constructor.
Definition geometryinancestor.hh:66
│ │ │ +
LocalCoordinate local(GlobalCoordinate x) const
Map local coordinate in coarse element into fine element.
Definition geometryinancestor.hh:177
│ │ │ +
typename Element::Geometry::LocalCoordinate LocalCoordinate
Type of local coordinate (local within fine element).
Definition geometryinancestor.hh:51
│ │ │ +
typename Element::Geometry::LocalCoordinate GlobalCoordinate
Type of global coordinate (local within coarse element).
Definition geometryinancestor.hh:54
│ │ │ +
const Element & bind(Element &&fineElement, F &&includeFather)
Bind this GeometryInAncestor to a fine element and search coarse element.
Definition geometryinancestor.hh:150
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,422 +1,193 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -transformedindexbasis.hh │ │ │ │ +geometryinancestor.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_COMMON_GEOMETRYINANCESTOR_HH │ │ │ │ +8#define DUNE_FUNCTIONS_COMMON_GEOMETRYINANCESTOR_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ -12 │ │ │ │ -13#include │ │ │ │ -14#include │ │ │ │ -15#include │ │ │ │ -16#include │ │ │ │ +10#include │ │ │ │ +11 │ │ │ │ +12#include │ │ │ │ +13 │ │ │ │ +14namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ +15 │ │ │ │ +16 │ │ │ │ 17 │ │ │ │ -18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_s_t_a_t_i_c_f_o_r_l_o_o_p_._h_h> │ │ │ │ -19#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ -20#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ -21#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_b_a_s_i_s_t_a_g_s_._h_h> │ │ │ │ -22#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -23#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ -24#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ -25 │ │ │ │ -26 │ │ │ │ -27namespace _D_u_n_e { │ │ │ │ -28namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -29namespace _E_x_p_e_r_i_m_e_n_t_a_l { │ │ │ │ -30 │ │ │ │ -31/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -32/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -33 │ │ │ │ -50template │ │ │ │ -_5_1class _T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s │ │ │ │ -52{ │ │ │ │ -53 using Transformation = T; │ │ │ │ -54 │ │ │ │ -55 using This = _T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_<_R_P_B_,_ _T_>; │ │ │ │ -56 │ │ │ │ -57public: │ │ │ │ +37template │ │ │ │ +_3_8class _G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r │ │ │ │ +39{ │ │ │ │ +40 using GeometryInFather = typename Element::LocalGeometry; │ │ │ │ +41 │ │ │ │ +42 template │ │ │ │ +43 static auto reverse_view(V&& v) │ │ │ │ +44 { │ │ │ │ +45 return Dune::IteratorRange(v.rbegin(), v.rend()); │ │ │ │ +46 } │ │ │ │ +47 │ │ │ │ +48public: │ │ │ │ +49 │ │ │ │ +_5_1 using _L_o_c_a_l_C_o_o_r_d_i_n_a_t_e = typename Element::Geometry::LocalCoordinate; │ │ │ │ +52 // │ │ │ │ +_5_4 using _G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e = typename Element::Geometry::LocalCoordinate; │ │ │ │ +55 │ │ │ │ +_5_6 _G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r() = default; │ │ │ │ +_5_7 _G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r(_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r&&) = delete; │ │ │ │ 58 │ │ │ │ -_5_9 using _R_a_w_P_r_e_B_a_s_i_s = RPB; │ │ │ │ -60 │ │ │ │ -_6_2 using _G_r_i_d_V_i_e_w = typename RawPreBasis::GridView; │ │ │ │ -63 │ │ │ │ -_6_5 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ -66 │ │ │ │ -_6_8 using _N_o_d_e = typename RawPreBasis::Node; │ │ │ │ -69 │ │ │ │ -_7_0 static constexpr _s_i_z_e___t_y_p_e _m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e = Transformation::maxIndexSize; │ │ │ │ -_7_1 static constexpr _s_i_z_e___t_y_p_e _m_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e = Transformation::minIndexSize; │ │ │ │ -_7_2 static constexpr _s_i_z_e___t_y_p_e _m_u_l_t_i_I_n_d_e_x_B_u_f_f_e_r_S_i_z_e = std::max(RawPreBasis:: │ │ │ │ -multiIndexBufferSize, _m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e); │ │ │ │ -73 │ │ │ │ -79 template │ │ │ │ -_8_0 _T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s(RPB_R&& _r_a_w_P_r_e_B_a_s_i_s, T_R&& transformation) : │ │ │ │ -81 _r_a_w_P_r_e_B_a_s_i_s__(std::forward(_r_a_w_P_r_e_B_a_s_i_s)), │ │ │ │ -82 _t_r_a_n_s_f_o_r_m_a_t_i_o_n__(std::forward(transformation)) │ │ │ │ -83 {} │ │ │ │ -84 │ │ │ │ -_8_6 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ -87 { │ │ │ │ -88 _r_a_w_P_r_e_B_a_s_i_s__.initializeIndices(); │ │ │ │ -89 } │ │ │ │ -90 │ │ │ │ -_9_2 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ -93 { │ │ │ │ -94 return _r_a_w_P_r_e_B_a_s_i_s__.gridView(); │ │ │ │ -95 } │ │ │ │ -96 │ │ │ │ -_9_8 void _u_p_d_a_t_e(const _G_r_i_d_V_i_e_w& gv) │ │ │ │ -99 { │ │ │ │ -100 _r_a_w_P_r_e_B_a_s_i_s__.update(gv); │ │ │ │ -101 } │ │ │ │ -102 │ │ │ │ -_1_0_6 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ -107 { │ │ │ │ -108 return _r_a_w_P_r_e_B_a_s_i_s__.makeNode(); │ │ │ │ -109 } │ │ │ │ -110 │ │ │ │ -_1_1_2 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ -113 { │ │ │ │ -114 return _s_i_z_e(Dune::ReservedVector{}); │ │ │ │ -115 } │ │ │ │ -116 │ │ │ │ -118 template │ │ │ │ -_1_1_9 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix) const │ │ │ │ +_6_6 _G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r(const _G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r& other) │ │ │ │ +67 : storedFineElement_(other.storedFineElement_) │ │ │ │ +68 , storedCoarseElement_(other.storedCoarseElement_) │ │ │ │ +69 , fineElementPtr_(&storedFineElement_) │ │ │ │ +70 , coarseElementPtr_(&storedFineElement_) │ │ │ │ +71 , geometryInFathersVector_(other.geometryInFathersVector_) │ │ │ │ +72 { │ │ │ │ +73 // If other points to external fine element, │ │ │ │ +74 // we point to the same one. │ │ │ │ +75 if (other.fineElementPtr_ != & other.storedFineElement_) │ │ │ │ +76 fineElementPtr_ = other.fineElementPtr_; │ │ │ │ +77 // If the other coarse element is not the stored one, │ │ │ │ +78 // then it's the fine one. │ │ │ │ +79 if (other.coarseElementPtr_ != & other.storedCoarseElement_) │ │ │ │ +80 coarseElementPtr_ = fineElementPtr_; │ │ │ │ +81 } │ │ │ │ +82 │ │ │ │ +_8_9 _G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r(const _G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r& other, const Element& │ │ │ │ +_f_i_n_e_E_l_e_m_e_n_t) │ │ │ │ +90 : storedFineElement_(other.storedFineElement_) │ │ │ │ +91 , storedCoarseElement_(other.storedCoarseElement_) │ │ │ │ +92 , fineElementPtr_(&_f_i_n_e_E_l_e_m_e_n_t) │ │ │ │ +93 , coarseElementPtr_(&storedFineElement_) │ │ │ │ +94 , geometryInFathersVector_(other.geometryInFathersVector_) │ │ │ │ +95 { │ │ │ │ +96 // If the other coarse element is not the stored one, │ │ │ │ +97 // then it's the fine one. │ │ │ │ +98 if (other.coarseElementPtr_ != & other.storedCoarseElement_) │ │ │ │ +99 coarseElementPtr_ = fineElementPtr_; │ │ │ │ +100 } │ │ │ │ +101 │ │ │ │ +117 template │ │ │ │ +118 requires (std::is_invocable_r_v) │ │ │ │ +_1_1_9 const Element& _b_i_n_d(const Element& _f_i_n_e_E_l_e_m_e_n_t, F&& includeFather) │ │ │ │ 120 { │ │ │ │ -121 return _t_r_a_n_s_f_o_r_m_a_t_i_o_n__.size(prefix, _r_a_w_P_r_e_B_a_s_i_s__); │ │ │ │ -122 } │ │ │ │ -123 │ │ │ │ -_1_2_5 auto _c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r() const │ │ │ │ -126 { │ │ │ │ -127 return _t_r_a_n_s_f_o_r_m_a_t_i_o_n__.containerDescriptor(_r_a_w_P_r_e_B_a_s_i_s__); │ │ │ │ -128 } │ │ │ │ -129 │ │ │ │ -_1_3_1 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ -132 { │ │ │ │ -133 return _t_r_a_n_s_f_o_r_m_a_t_i_o_n__.dimension(_r_a_w_P_r_e_B_a_s_i_s__); │ │ │ │ -134 } │ │ │ │ -135 │ │ │ │ -_1_3_7 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ -138 { │ │ │ │ -139 return _r_a_w_P_r_e_B_a_s_i_s__.maxNodeSize(); │ │ │ │ -140 } │ │ │ │ -141 │ │ │ │ -_1_4_2 const _R_a_w_P_r_e_B_a_s_i_s& _r_a_w_P_r_e_B_a_s_i_s() const │ │ │ │ -143 { │ │ │ │ -144 return _r_a_w_P_r_e_B_a_s_i_s__; │ │ │ │ -145 } │ │ │ │ -146 │ │ │ │ -_1_4_7 _R_a_w_P_r_e_B_a_s_i_s& _r_a_w_P_r_e_B_a_s_i_s() │ │ │ │ -148 { │ │ │ │ -149 return _r_a_w_P_r_e_B_a_s_i_s__; │ │ │ │ -150 } │ │ │ │ -151 │ │ │ │ -152 template │ │ │ │ -_1_5_3 void _t_r_a_n_s_f_o_r_m_I_n_d_e_x(MultiIndex& multiIndex) const │ │ │ │ -154 { │ │ │ │ -155 _t_r_a_n_s_f_o_r_m_a_t_i_o_n__.transformIndex(multiIndex, _r_a_w_P_r_e_B_a_s_i_s__); │ │ │ │ -156 } │ │ │ │ -157 │ │ │ │ -158 template │ │ │ │ -_1_5_9 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ -160 { │ │ │ │ -161 _r_a_w_P_r_e_B_a_s_i_s().indices(node, it); │ │ │ │ -162 for(std::size_t i=0; igeometryInFather()); │ │ │ │ +127 storedCoarseElement_ = coarseElementPtr_->father(); │ │ │ │ +128 coarseElementPtr_ = &storedCoarseElement_; │ │ │ │ +129 } │ │ │ │ +130 return _c_o_a_r_s_e_E_l_e_m_e_n_t(); │ │ │ │ +131 } │ │ │ │ +132 │ │ │ │ +148 template │ │ │ │ +149 requires (std::is_invocable_r_v) │ │ │ │ +_1_5_0 const Element& _b_i_n_d(Element&& _f_i_n_e_E_l_e_m_e_n_t, F&& includeFather) │ │ │ │ +151 { │ │ │ │ +152 storedFineElement_ = _f_i_n_e_E_l_e_m_e_n_t; │ │ │ │ +153 _b_i_n_d(storedFineElement_, includeFather); │ │ │ │ +154 } │ │ │ │ +155 │ │ │ │ +_1_5_7 const Element& _f_i_n_e_E_l_e_m_e_n_t() const │ │ │ │ +158 { │ │ │ │ +159 return *fineElementPtr_; │ │ │ │ +160 } │ │ │ │ +161 │ │ │ │ +_1_6_3 const Element& _c_o_a_r_s_e_E_l_e_m_e_n_t() const │ │ │ │ +164 { │ │ │ │ +165 return *coarseElementPtr_; │ │ │ │ 166 } │ │ │ │ -167 return it; │ │ │ │ -168 } │ │ │ │ -169 │ │ │ │ -170protected: │ │ │ │ -_1_7_1 _R_a_w_P_r_e_B_a_s_i_s _r_a_w_P_r_e_B_a_s_i_s__; │ │ │ │ -_1_7_2 Transformation _t_r_a_n_s_f_o_r_m_a_t_i_o_n__; │ │ │ │ -173}; │ │ │ │ -174 │ │ │ │ -175template │ │ │ │ -_1_7_6_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s(RPB&&, T&&) -> _T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_<_s_t_d_:_: │ │ │ │ -_d_e_c_a_y___t_<_R_P_B_>, std::decay_t>; │ │ │ │ -177 │ │ │ │ -178 │ │ │ │ -179} // end namespace Experimental │ │ │ │ -180 │ │ │ │ -181 │ │ │ │ -182namespace _B_a_s_i_s_F_a_c_t_o_r_y { │ │ │ │ -183namespace _E_x_p_e_r_i_m_e_n_t_a_l { │ │ │ │ -184 │ │ │ │ -196template │ │ │ │ -_1_9_7auto _t_r_a_n_s_f_o_r_m_I_n_d_i_c_e_s( │ │ │ │ -198 RawPreBasisFactory&& preBasisFactory, │ │ │ │ -199 Transformation&& transformation) │ │ │ │ -200{ │ │ │ │ -201 return [ │ │ │ │ -202 preBasisFactory=std::forward(preBasisFactory), │ │ │ │ -203 transformation =std::forward(transformation) │ │ │ │ -204 ](const auto& gridView) { │ │ │ │ -205 return _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s │ │ │ │ -(preBasisFactory(gridView), std::move(transformation)); │ │ │ │ -206 }; │ │ │ │ -207} │ │ │ │ -208 │ │ │ │ -209 │ │ │ │ -210 │ │ │ │ -229template │ │ │ │ -_2_3_0class _G_e_n_e_r_i_c_I_n_d_e_x_i_n_g_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ -231{ │ │ │ │ -232public: │ │ │ │ -233 │ │ │ │ -_2_3_4 static constexpr std::size_t _m_i_n_I_n_d_e_x_S_i_z_e = minIS; │ │ │ │ -_2_3_5 static constexpr std::size_t _m_a_x_I_n_d_e_x_S_i_z_e = maxIS; │ │ │ │ -236 │ │ │ │ -237 template │ │ │ │ -_2_3_8 _G_e_n_e_r_i_c_I_n_d_e_x_i_n_g_T_r_a_n_s_f_o_r_m_a_t_i_o_n(IT_R&& _i_n_d_e_x_T_r_a_n_s_f_o_r_m_a_t_i_o_n, SI_R&& │ │ │ │ -sizeImplementation, CD_R&& containerDescriptorImplementation) : │ │ │ │ -239 indexTransformation_(std::forward(_i_n_d_e_x_T_r_a_n_s_f_o_r_m_a_t_i_o_n)), │ │ │ │ -240 sizeImplementation_(std::forward(sizeImplementation)), │ │ │ │ -241 containerDescriptorImplementation_(std::forward │ │ │ │ -(containerDescriptorImplementation)) │ │ │ │ -242 {} │ │ │ │ -243 │ │ │ │ -244 template │ │ │ │ -_2_4_5 void _t_r_a_n_s_f_o_r_m_I_n_d_e_x(MultiIndex& multiIndex, const PreBasis& preBasis) const │ │ │ │ -246 { │ │ │ │ -247 indexTransformation_(multiIndex, preBasis); │ │ │ │ -248 } │ │ │ │ -249 │ │ │ │ -250 template │ │ │ │ -_2_5_1 auto _s_i_z_e(const Prefix& prefix, const PreBasis& preBasis) const │ │ │ │ -252 { │ │ │ │ -253 return sizeImplementation_(prefix, preBasis); │ │ │ │ -254 } │ │ │ │ -255 │ │ │ │ -256 template │ │ │ │ -_2_5_7 auto _d_i_m_e_n_s_i_o_n(const PreBasis& preBasis) const │ │ │ │ -258 { │ │ │ │ -259 return preBasis.dimension(); │ │ │ │ -260 } │ │ │ │ -261 │ │ │ │ -262 template │ │ │ │ -_2_6_3 auto _c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r(const PreBasis& preBasis) const │ │ │ │ -264 { │ │ │ │ -265 return containerDescriptorImplementation_(preBasis); │ │ │ │ -266 } │ │ │ │ -267 │ │ │ │ -268private: │ │ │ │ -269 IndexTransformation indexTransformation_; │ │ │ │ -270 SizeImplementation sizeImplementation_; │ │ │ │ -271 ContainerDescriptorImplementation containerDescriptorImplementation_; │ │ │ │ -272}; │ │ │ │ -273 │ │ │ │ -274 │ │ │ │ -275 │ │ │ │ -295template │ │ │ │ -_2_9_6auto _i_n_d_e_x_T_r_a_n_s_f_o_r_m_a_t_i_o_n(IndexTransformation&& _i_n_d_e_x_T_r_a_n_s_f_o_r_m_a_t_i_o_n, │ │ │ │ -297 SizeImplementation&& sizeImplementation, │ │ │ │ -298 ContainerDescriptorImplementation&& containerDescriptorImplementation, │ │ │ │ -299 Dune::index_constant, │ │ │ │ -300 Dune::index_constant) │ │ │ │ -301{ │ │ │ │ -302 return _G_e_n_e_r_i_c_I_n_d_e_x_i_n_g_T_r_a_n_s_f_o_r_m_a_t_i_o_n< │ │ │ │ -303 std::decay_t, │ │ │ │ -304 std::decay_t, │ │ │ │ -305 std::decay_t, │ │ │ │ -306 minIndexSize, maxIndexSize>( │ │ │ │ -307 std::forward(_i_n_d_e_x_T_r_a_n_s_f_o_r_m_a_t_i_o_n), │ │ │ │ -308 std::forward(sizeImplementation), │ │ │ │ -309 std::forward │ │ │ │ -(containerDescriptorImplementation)); │ │ │ │ -310} │ │ │ │ -311 │ │ │ │ -313template │ │ │ │ -_3_1_5auto _i_n_d_e_x_T_r_a_n_s_f_o_r_m_a_t_i_o_n(IndexTransformation&& indexTrafo, │ │ │ │ -316 SizeImplementation&& sizeImpl, │ │ │ │ -317 Dune::index_constant minSize, │ │ │ │ -318 Dune::index_constant maxSize) │ │ │ │ -319{ │ │ │ │ -320 return _i_n_d_e_x_T_r_a_n_s_f_o_r_m_a_t_i_o_n(indexTrafo, sizeImpl, │ │ │ │ -321 [](auto&&) { return _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_k_n_o_w_n{}; }, │ │ │ │ -322 minSize, maxSize); │ │ │ │ -323} │ │ │ │ -324 │ │ │ │ -325} // end namespace Experimental │ │ │ │ -326} // end namespace BasisFactory │ │ │ │ -327} // end namespace Functions │ │ │ │ -328} // end namespace Dune │ │ │ │ -329 │ │ │ │ -330 │ │ │ │ -331#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH │ │ │ │ -_n_o_d_e_s_._h_h │ │ │ │ -_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ -_b_a_s_i_s_t_a_g_s_._h_h │ │ │ │ -_u_t_i_l_i_t_y_._h_h │ │ │ │ -_t_y_p_e___t_r_a_i_t_s_._h_h │ │ │ │ -_s_t_a_t_i_c_f_o_r_l_o_o_p_._h_h │ │ │ │ -_D_u_n_e │ │ │ │ -DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ +167 │ │ │ │ +_1_6_9 _G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e _g_l_o_b_a_l(_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e x) const │ │ │ │ +170 { │ │ │ │ +171 for (const auto& g : geometryInFathersVector_) │ │ │ │ +172 x = g.global(x); │ │ │ │ +173 return x; │ │ │ │ +174 } │ │ │ │ +175 │ │ │ │ +_1_7_7 _L_o_c_a_l_C_o_o_r_d_i_n_a_t_e _l_o_c_a_l(_G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e x) const │ │ │ │ +178 { │ │ │ │ +179 // Here we can be instead use std::ranges::reverse_view once │ │ │ │ +180 // all supported compilers provide this (gcc>=10, clang>=16). │ │ │ │ +181 for (const auto& g : reverse_view(geometryInFathersVector_)) │ │ │ │ +182 x = g.local(x); │ │ │ │ +183 return x; │ │ │ │ +184 } │ │ │ │ +185 │ │ │ │ +186private: │ │ │ │ +187 Element storedFineElement_; │ │ │ │ +188 Element storedCoarseElement_; │ │ │ │ +189 const Element* fineElementPtr_ = nullptr; │ │ │ │ +190 const Element* coarseElementPtr_ = nullptr; │ │ │ │ +191 std::vector geometryInFathersVector_; │ │ │ │ +192}; │ │ │ │ +193 │ │ │ │ +194 │ │ │ │ +195 │ │ │ │ +196} // namespace Dune::Functions │ │ │ │ +197 │ │ │ │ +198 │ │ │ │ +199 │ │ │ │ +200 │ │ │ │ +201#endif // DUNE_FUNCTIONS_COMMON_GEOMETRYINANCESTOR_HH │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:28 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s │ │ │ │ -TransformedIndexPreBasis(RPB &&, T &&) -> TransformedIndexPreBasis< std:: │ │ │ │ -decay_t< RPB >, std::decay_t< T > > │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:926 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_i_n_d_e_x_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ -auto indexTransformation(IndexTransformation &&indexTransformation, │ │ │ │ -SizeImplementation &&sizeImplementation, ContainerDescriptorImplementation │ │ │ │ -&&containerDescriptorImplementation, Dune::index_constant< minIndexSize >, │ │ │ │ -Dune::index_constant< maxIndexSize >) │ │ │ │ -A generic implementation of a transformation. │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:296 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_t_r_a_n_s_f_o_r_m_I_n_d_i_c_e_s │ │ │ │ -auto transformIndices(RawPreBasisFactory &&preBasisFactory, Transformation │ │ │ │ -&&transformation) │ │ │ │ -Create a TransformedIndexPreBasisFactory. │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:197 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_k_n_o_w_n │ │ │ │ -Fallback container descriptor if nothing else fits. │ │ │ │ -DDeeffiinniittiioonn containerdescriptors.hh:52 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s │ │ │ │ -A pre-basis transforming multi-indices. │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:52 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_i_n_d_i_c_e_s │ │ │ │ -It indices(const Node &node, It it) const │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:159 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_t_r_a_n_s_f_o_r_m_a_t_i_o_n__ │ │ │ │ -Transformation transformation_ │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:172 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ -void initializeIndices() │ │ │ │ -Initialize the global indices. │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:86 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ -typename RawPreBasis::GridView GridView │ │ │ │ -The grid view that the FE basis is defined on. │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:62 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_t_r_a_n_s_f_o_r_m_I_n_d_e_x │ │ │ │ -void transformIndex(MultiIndex &multiIndex) const │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:153 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_r_a_w_P_r_e_B_a_s_i_s__ │ │ │ │ -RawPreBasis rawPreBasis_ │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:171 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_N_o_d_e │ │ │ │ -typename RawPreBasis::Node Node │ │ │ │ -Template mapping root tree path to type of created tree node. │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:68 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_: │ │ │ │ -_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s │ │ │ │ -TransformedIndexPreBasis(RPB_R &&rawPreBasis, T_R &&transformation) │ │ │ │ -Constructor for given child pre-basis objects. │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:80 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_r_a_w_P_r_e_B_a_s_i_s │ │ │ │ -RawPreBasis & rawPreBasis() │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:147 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ -static constexpr size_type maxMultiIndexSize │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:70 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_u_p_d_a_t_e │ │ │ │ -void update(const GridView &gv) │ │ │ │ -Update the stored grid view, to be called if the grid has changed. │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:98 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_m_a_k_e_N_o_d_e │ │ │ │ -Node makeNode() const │ │ │ │ -Create tree node. │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:106 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_g_r_i_d_V_i_e_w │ │ │ │ -const GridView & gridView() const │ │ │ │ -Obtain the grid view that the basis is defined on. │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:92 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ -size_type size(const SizePrefix &prefix) const │ │ │ │ -Return number of possible values for next position in multi index. │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:119 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_R_a_w_P_r_e_B_a_s_i_s │ │ │ │ -RPB RawPreBasis │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:59 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ -size_type size() const │ │ │ │ -Same as size(prefix) with empty prefix. │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:112 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_m_a_x_N_o_d_e_S_i_z_e │ │ │ │ -size_type maxNodeSize() const │ │ │ │ -Get the maximal number of DOFs associated to node for any element. │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:137 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -Type used for indices and size information. │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:65 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_m_u_l_t_i_I_n_d_e_x_B_u_f_f_e_r_S_i_z_e │ │ │ │ -static constexpr size_type multiIndexBufferSize │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:72 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ -size_type dimension() const │ │ │ │ -Get the total dimension of the space spanned by this basis. │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:131 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_r_a_w_P_r_e_B_a_s_i_s │ │ │ │ -const RawPreBasis & rawPreBasis() const │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:142 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_m_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ -static constexpr size_type minMultiIndexSize │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:71 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r │ │ │ │ -auto containerDescriptor() const │ │ │ │ -Return the container descriptor of the transformed pre-basis. │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:125 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_G_e_n_e_r_i_c_I_n_d_e_x_i_n_g_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ -A generic implementation of a transformation. │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:231 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_G_e_n_e_r_i_c_I_n_d_e_x_i_n_g_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_: │ │ │ │ -_G_e_n_e_r_i_c_I_n_d_e_x_i_n_g_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ -GenericIndexingTransformation(IT_R &&indexTransformation, SI_R │ │ │ │ -&&sizeImplementation, CD_R &&containerDescriptorImplementation) │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:238 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_G_e_n_e_r_i_c_I_n_d_e_x_i_n_g_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_: │ │ │ │ -_m_a_x_I_n_d_e_x_S_i_z_e │ │ │ │ -static constexpr std::size_t maxIndexSize │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:235 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_G_e_n_e_r_i_c_I_n_d_e_x_i_n_g_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_: │ │ │ │ -_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r │ │ │ │ -auto containerDescriptor(const PreBasis &preBasis) const │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:263 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_G_e_n_e_r_i_c_I_n_d_e_x_i_n_g_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_: │ │ │ │ -_d_i_m_e_n_s_i_o_n │ │ │ │ -auto dimension(const PreBasis &preBasis) const │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:257 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_G_e_n_e_r_i_c_I_n_d_e_x_i_n_g_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_: │ │ │ │ -_s_i_z_e │ │ │ │ -auto size(const Prefix &prefix, const PreBasis &preBasis) const │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:251 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_G_e_n_e_r_i_c_I_n_d_e_x_i_n_g_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_: │ │ │ │ -_m_i_n_I_n_d_e_x_S_i_z_e │ │ │ │ -static constexpr std::size_t minIndexSize │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:234 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_G_e_n_e_r_i_c_I_n_d_e_x_i_n_g_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_: │ │ │ │ -_t_r_a_n_s_f_o_r_m_I_n_d_e_x │ │ │ │ -void transformIndex(MultiIndex &multiIndex, const PreBasis &preBasis) const │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:245 │ │ │ │ -_c_o_n_c_e_p_t_s_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r │ │ │ │ +GeometryInAncestor(const GeometryInAncestor &other, const Element &fineElement) │ │ │ │ +Copy construction setting an external fine element. │ │ │ │ +DDeeffiinniittiioonn geometryinancestor.hh:89 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r │ │ │ │ +GeometryInAncestor(GeometryInAncestor &&)=delete │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_f_i_n_e_E_l_e_m_e_n_t │ │ │ │ +const Element & fineElement() const │ │ │ │ +Return the fine element. │ │ │ │ +DDeeffiinniittiioonn geometryinancestor.hh:157 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_g_l_o_b_a_l │ │ │ │ +GlobalCoordinate global(LocalCoordinate x) const │ │ │ │ +Map local coordinate in fine element into coarse element. │ │ │ │ +DDeeffiinniittiioonn geometryinancestor.hh:169 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_b_i_n_d │ │ │ │ +const Element & bind(const Element &fineElement, F &&includeFather) │ │ │ │ +Bind this GeometryInAncestor to a fine element and search coarse element. │ │ │ │ +DDeeffiinniittiioonn geometryinancestor.hh:119 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_c_o_a_r_s_e_E_l_e_m_e_n_t │ │ │ │ +const Element & coarseElement() const │ │ │ │ +Return the coarse element. │ │ │ │ +DDeeffiinniittiioonn geometryinancestor.hh:163 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r │ │ │ │ +GeometryInAncestor()=default │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r │ │ │ │ +GeometryInAncestor(const GeometryInAncestor &other) │ │ │ │ +Copy constructor. │ │ │ │ +DDeeffiinniittiioonn geometryinancestor.hh:66 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_l_o_c_a_l │ │ │ │ +LocalCoordinate local(GlobalCoordinate x) const │ │ │ │ +Map local coordinate in coarse element into fine element. │ │ │ │ +DDeeffiinniittiioonn geometryinancestor.hh:177 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ +typename Element::Geometry::LocalCoordinate LocalCoordinate │ │ │ │ +Type of local coordinate (local within fine element). │ │ │ │ +DDeeffiinniittiioonn geometryinancestor.hh:51 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ +typename Element::Geometry::LocalCoordinate GlobalCoordinate │ │ │ │ +Type of global coordinate (local within coarse element). │ │ │ │ +DDeeffiinniittiioonn geometryinancestor.hh:54 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_b_i_n_d │ │ │ │ +const Element & bind(Element &&fineElement, F &&includeFather) │ │ │ │ +Bind this GeometryInAncestor to a fine element and search coarse element. │ │ │ │ +DDeeffiinniittiioonn geometryinancestor.hh:150 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _t_r_a_n_s_f_o_r_m_e_d_i_n_d_e_x_b_a_s_i_s_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _g_e_o_m_e_t_r_y_i_n_a_n_c_e_s_t_o_r_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00077.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: transformedfiniteelementmixin.hh File Reference │ │ │ +Dune-Functions: densevectorview.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,21 +88,19 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
transformedfiniteelementmixin.hh File Reference
│ │ │ +
densevectorview.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <array>
│ │ │ -#include <type_traits>
│ │ │ -#include <utility>
│ │ │ -#include <vector>
│ │ │ +
#include <type_traits>
│ │ │ +#include <dune/common/densevector.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -116,13 +114,13 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,18 +1,16 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -transformedfiniteelementmixin.hh File Reference │ │ │ │ -#include │ │ │ │ +densevectorview.hh File Reference │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ +#include │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _t_r_a_n_s_f_o_r_m_e_d_f_i_n_i_t_e_e_l_e_m_e_n_t_m_i_x_i_n_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _d_e_n_s_e_v_e_c_t_o_r_v_i_e_w_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00077_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: transformedfiniteelementmixin.hh Source File │ │ │ +Dune-Functions: densevectorview.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,129 +88,120 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
transformedfiniteelementmixin.hh
│ │ │ +
densevectorview.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDFINITEELEMENTMIXIN_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDFINITEELEMENTMIXIN_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_COMMON_DENSEVECTORVIEW_HH
│ │ │ +
8#define DUNE_FUNCTIONS_COMMON_DENSEVECTORVIEW_HH
│ │ │
9
│ │ │ -
10#include <array>
│ │ │ -
11#include <type_traits>
│ │ │ -
12#include <utility>
│ │ │ -
13#include <vector>
│ │ │ +
10#include <type_traits>
│ │ │ +
11
│ │ │ +
12#include <dune/common/densevector.hh>
│ │ │ +
13
│ │ │
14
│ │ │
15namespace Dune::Functions::Impl {
│ │ │
16
│ │ │ -
24template<class FEImplementation, class ReferenceLocalBasisTraits>
│ │ │ -
25class TransformedLocalBasis
│ │ │ -
26{
│ │ │ -
27 public:
│ │ │ -
28 using Traits = ReferenceLocalBasisTraits;
│ │ │ -
29
│ │ │ -
30 TransformedLocalBasis(FEImplementation const& feImpl)
│ │ │ -
31 : feImpl_(&feImpl)
│ │ │ -
32 {}
│ │ │ -
33
│ │ │ -
34 public:
│ │ │ -
39 auto size() const
│ │ │ -
40 {
│ │ │ -
41 return feImpl_->size();
│ │ │ -
42 }
│ │ │ +
20 template<class R>
│ │ │ +
21 class DenseVectorView
│ │ │ +
22 : public DenseVector<DenseVectorView<R>>
│ │ │ +
23 {
│ │ │ +
24 R& data_;
│ │ │ +
25
│ │ │ +
26 using mutable_reference = typename std::decay_t<R>::reference;
│ │ │ +
27
│ │ │ +
28 public:
│ │ │ +
29
│ │ │ +
31 using size_type = typename std::decay_t<R>::size_type;
│ │ │ +
32
│ │ │ +
34 using value_type = typename std::decay_t<R>::value_type;
│ │ │ +
35
│ │ │ +
37 using const_reference = typename std::decay_t<R>::const_reference;
│ │ │ +
38
│ │ │ +
40 using reference = std::conditional_t<std::is_const_v<R>,
│ │ │ +
41 const_reference,
│ │ │ +
42 mutable_reference>;
│ │ │
43
│ │ │ -
45 void evaluateFunction(const typename Traits::DomainType &x,
│ │ │ -
46 std::vector<typename Traits::RangeType> &out) const
│ │ │ -
47 {
│ │ │ -
48 feImpl_->referenceLocalBasis().evaluateFunction(x, rangeBuffer_);
│ │ │ -
49 out.resize(size());
│ │ │ -
50 feImpl_->transform(rangeBuffer_, out);
│ │ │ -
51 }
│ │ │ -
52
│ │ │ -
59 void evaluateJacobian(const typename Traits::DomainType &x,
│ │ │ -
60 std::vector<typename Traits::JacobianType> &out) const
│ │ │ -
61 {
│ │ │ -
62 feImpl_->referenceLocalBasis().evaluateJacobian(x, jacobianBuffer_);
│ │ │ -
63 out.resize(size());
│ │ │ -
64 feImpl_->transform(jacobianBuffer_, out);
│ │ │ -
65 }
│ │ │ -
66
│ │ │ -
77 template<class TT,
│ │ │ -
78 std::enable_if_t<std::is_same_v<TT, typename Traits::HessianType>, int> = 0>
│ │ │ -
79 void evaluateHessian(const typename Traits::DomainType &x,
│ │ │ -
80 std::vector<TT> &out) const
│ │ │ -
81 {
│ │ │ -
82 feImpl_->referenceLocalBasis().evaluateHessian(x, hessianBuffer_);
│ │ │ -
83 out.resize(size());
│ │ │ -
84 feImpl_->transform(hessianBuffer_, out);
│ │ │ -
85 }
│ │ │ -
86
│ │ │ -
94 void partial(std::array<unsigned int, Traits::dimDomain> const &order,
│ │ │ -
95 const typename Traits::DomainType &x,
│ │ │ -
96 std::vector<typename Traits::RangeType> &out) const
│ │ │ -
97 {
│ │ │ -
98 feImpl_->referenceLocalBasis().partial(order, x, rangeBuffer_);
│ │ │ -
99 out.resize(size());
│ │ │ -
100 feImpl_->transform(rangeBuffer_, out);
│ │ │ -
101 }
│ │ │ -
102
│ │ │ -
104 auto order() const { return feImpl_->referenceLocalBasis().order(); }
│ │ │ -
105
│ │ │ -
106 private:
│ │ │ -
107 FEImplementation const* feImpl_;
│ │ │ -
108 mutable std::vector<typename Traits::RangeType> rangeBuffer_;
│ │ │ -
109 mutable std::vector<typename Traits::JacobianType> jacobianBuffer_;
│ │ │ -
110 mutable std::vector<typename Traits::HessianType> hessianBuffer_;
│ │ │ -
111};
│ │ │ -
112
│ │ │ -
113
│ │ │ -
114
│ │ │ -
146template<class FEImplementation, class ReferenceLocalBasisTraits>
│ │ │ -
147class TransformedFiniteElementMixin
│ │ │ -
148{
│ │ │ -
149 public:
│ │ │ -
150 TransformedFiniteElementMixin()
│ │ │ -
151 : tlb_(this->asImpl())
│ │ │ -
152 {}
│ │ │ -
153
│ │ │ -
154 TransformedFiniteElementMixin(TransformedFiniteElementMixin const& other)
│ │ │ -
155 : TransformedFiniteElementMixin()
│ │ │ -
156 {}
│ │ │ -
157
│ │ │ -
158 const FEImplementation& asImpl() const
│ │ │ -
159 {
│ │ │ -
160 return *(static_cast<FEImplementation const*>(this));
│ │ │ -
161 }
│ │ │ -
162
│ │ │ -
163 auto const& localBasis() const
│ │ │ -
164 {
│ │ │ -
165 return tlb_;
│ │ │ -
166 }
│ │ │ -
167
│ │ │ -
168 protected:
│ │ │ -
169 TransformedLocalBasis<FEImplementation, ReferenceLocalBasisTraits> tlb_;
│ │ │ -
170};
│ │ │ -
171
│ │ │ -
172} // end namespace Dune::Functions::Impl
│ │ │ -
173
│ │ │ -
174#endif
│ │ │ +
45 DenseVectorView (R& data)
│ │ │ +
46 : data_(data)
│ │ │ +
47 {}
│ │ │ +
48
│ │ │ +
50 DenseVectorView (const DenseVectorView &other) = delete;
│ │ │ +
51
│ │ │ +
53 DenseVectorView (DenseVectorView &&other) :
│ │ │ +
54 data_( other.data_ )
│ │ │ +
55 {}
│ │ │ +
56
│ │ │ +
58 DenseVectorView& operator= (const DenseVectorView& other)
│ │ │ +
59 {
│ │ │ +
60 data_ = other.data_;
│ │ │ +
61 return *this;
│ │ │ +
62 }
│ │ │ +
63
│ │ │ +
65 template<class RR>
│ │ │ +
66 DenseVectorView& operator= (const DenseVectorView<RR>& other)
│ │ │ +
67 {
│ │ │ +
68 data_ = other.data_;
│ │ │ +
69 return *this;
│ │ │ +
70 }
│ │ │ +
71
│ │ │ +
73 size_type size () const
│ │ │ +
74 {
│ │ │ +
75 return data_.size();
│ │ │ +
76 }
│ │ │ +
77
│ │ │ +
79 reference operator[] (size_type i)
│ │ │ +
80 {
│ │ │ +
81 return data_[i];
│ │ │ +
82 }
│ │ │ +
83
│ │ │ +
85 const_reference operator[] (size_type i) const
│ │ │ +
86 {
│ │ │ +
87 return data_[i];
│ │ │ +
88 }
│ │ │ +
89
│ │ │ +
90 }; // class DenseVectorView
│ │ │ +
91
│ │ │ +
92}
│ │ │ +
93
│ │ │ +
94namespace Dune {
│ │ │ +
95
│ │ │ +
96 template< class R>
│ │ │ +
97 struct DenseMatVecTraits< Dune::Functions::Impl::DenseVectorView<R> >
│ │ │ +
98 {
│ │ │ +
99 using derived_type = Dune::Functions::Impl::DenseVectorView<R>;
│ │ │ +
100 using value_type = typename R::value_type;
│ │ │ +
101 using size_type = typename R::size_type;
│ │ │ +
102 };
│ │ │ +
103
│ │ │ +
104 template< class R >
│ │ │ +
105 struct FieldTraits< Dune::Functions::Impl::DenseVectorView<R> >
│ │ │ +
106 : public FieldTraits<std::remove_const_t<typename Dune::Functions::Impl::DenseVectorView<R>::value_type>>
│ │ │ +
107 {};
│ │ │ +
108
│ │ │ +
109}
│ │ │ +
110
│ │ │ +
111
│ │ │ +
112#endif // DUNE_FUNCTIONS_COMMON_DENSEVECTORVIEW_HH
│ │ │ +
Definition monomialset.hh:19
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,120 +1,113 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -transformedfiniteelementmixin.hh │ │ │ │ +densevectorview.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDFINITEELEMENTMIXIN_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDFINITEELEMENTMIXIN_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_COMMON_DENSEVECTORVIEW_HH │ │ │ │ +8#define DUNE_FUNCTIONS_COMMON_DENSEVECTORVIEW_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ -12#include │ │ │ │ -13#include │ │ │ │ +10#include │ │ │ │ +11 │ │ │ │ +12#include │ │ │ │ +13 │ │ │ │ 14 │ │ │ │ 15namespace Dune::Functions::Impl { │ │ │ │ 16 │ │ │ │ -24template │ │ │ │ -25class TransformedLocalBasis │ │ │ │ -26{ │ │ │ │ -27 public: │ │ │ │ -28 using Traits = ReferenceLocalBasisTraits; │ │ │ │ +20 template │ │ │ │ +21 class DenseVectorView │ │ │ │ +22 : public DenseVector> │ │ │ │ +23 { │ │ │ │ +24 R& data_; │ │ │ │ +25 │ │ │ │ +26 using mutable_reference = typename std::decay_t::reference; │ │ │ │ +27 │ │ │ │ +28 public: │ │ │ │ 29 │ │ │ │ -30 TransformedLocalBasis(FEImplementation const& feImpl) │ │ │ │ -31 : feImpl_(&feImpl) │ │ │ │ -32 {} │ │ │ │ -33 │ │ │ │ -34 public: │ │ │ │ -39 auto size() const │ │ │ │ -40 { │ │ │ │ -41 return feImpl_->size(); │ │ │ │ -42 } │ │ │ │ +31 using size_type = typename std::decay_t::size_type; │ │ │ │ +32 │ │ │ │ +34 using value_type = typename std::decay_t::value_type; │ │ │ │ +35 │ │ │ │ +37 using const_reference = typename std::decay_t::const_reference; │ │ │ │ +38 │ │ │ │ +40 using reference = std::conditional_t, │ │ │ │ +41 const_reference, │ │ │ │ +42 mutable_reference>; │ │ │ │ 43 │ │ │ │ -45 void evaluateFunction(const typename Traits::DomainType &x, │ │ │ │ -46 std::vector &out) const │ │ │ │ -47 { │ │ │ │ -48 feImpl_->referenceLocalBasis().evaluateFunction(x, rangeBuffer_); │ │ │ │ -49 out.resize(size()); │ │ │ │ -50 feImpl_->transform(rangeBuffer_, out); │ │ │ │ -51 } │ │ │ │ -52 │ │ │ │ -59 void evaluateJacobian(const typename Traits::DomainType &x, │ │ │ │ -60 std::vector &out) const │ │ │ │ -61 { │ │ │ │ -62 feImpl_->referenceLocalBasis().evaluateJacobian(x, jacobianBuffer_); │ │ │ │ -63 out.resize(size()); │ │ │ │ -64 feImpl_->transform(jacobianBuffer_, out); │ │ │ │ -65 } │ │ │ │ -66 │ │ │ │ -77 template, int> = 0> │ │ │ │ -79 void evaluateHessian(const typename Traits::DomainType &x, │ │ │ │ -80 std::vector &out) const │ │ │ │ -81 { │ │ │ │ -82 feImpl_->referenceLocalBasis().evaluateHessian(x, hessianBuffer_); │ │ │ │ -83 out.resize(size()); │ │ │ │ -84 feImpl_->transform(hessianBuffer_, out); │ │ │ │ -85 } │ │ │ │ -86 │ │ │ │ -94 void partial(std::array const &order, │ │ │ │ -95 const typename Traits::DomainType &x, │ │ │ │ -96 std::vector &out) const │ │ │ │ -97 { │ │ │ │ -98 feImpl_->referenceLocalBasis().partial(order, x, rangeBuffer_); │ │ │ │ -99 out.resize(size()); │ │ │ │ -100 feImpl_->transform(rangeBuffer_, out); │ │ │ │ -101 } │ │ │ │ -102 │ │ │ │ -104 auto order() const { return feImpl_->referenceLocalBasis().order(); } │ │ │ │ -105 │ │ │ │ -106 private: │ │ │ │ -107 FEImplementation const* feImpl_; │ │ │ │ -108 mutable std::vector rangeBuffer_; │ │ │ │ -109 mutable std::vector jacobianBuffer_; │ │ │ │ -110 mutable std::vector hessianBuffer_; │ │ │ │ -111}; │ │ │ │ -112 │ │ │ │ -113 │ │ │ │ -114 │ │ │ │ -146template │ │ │ │ -147class TransformedFiniteElementMixin │ │ │ │ -148{ │ │ │ │ -149 public: │ │ │ │ -150 TransformedFiniteElementMixin() │ │ │ │ -151 : tlb_(this->asImpl()) │ │ │ │ -152 {} │ │ │ │ -153 │ │ │ │ -154 TransformedFiniteElementMixin(TransformedFiniteElementMixin const& other) │ │ │ │ -155 : TransformedFiniteElementMixin() │ │ │ │ -156 {} │ │ │ │ -157 │ │ │ │ -158 const FEImplementation& asImpl() const │ │ │ │ -159 { │ │ │ │ -160 return *(static_cast(this)); │ │ │ │ -161 } │ │ │ │ -162 │ │ │ │ -163 auto const& localBasis() const │ │ │ │ -164 { │ │ │ │ -165 return tlb_; │ │ │ │ -166 } │ │ │ │ -167 │ │ │ │ -168 protected: │ │ │ │ -169 TransformedLocalBasis tlb_; │ │ │ │ -170}; │ │ │ │ -171 │ │ │ │ -172} // end namespace Dune::Functions::Impl │ │ │ │ -173 │ │ │ │ -174#endif │ │ │ │ +45 DenseVectorView (R& data) │ │ │ │ +46 : data_(data) │ │ │ │ +47 {} │ │ │ │ +48 │ │ │ │ +50 DenseVectorView (const DenseVectorView &other) = delete; │ │ │ │ +51 │ │ │ │ +53 DenseVectorView (DenseVectorView &&other) : │ │ │ │ +54 data_( other.data_ ) │ │ │ │ +55 {} │ │ │ │ +56 │ │ │ │ +58 DenseVectorView& operator= (const DenseVectorView& other) │ │ │ │ +59 { │ │ │ │ +60 data_ = other.data_; │ │ │ │ +61 return *this; │ │ │ │ +62 } │ │ │ │ +63 │ │ │ │ +65 template │ │ │ │ +66 DenseVectorView& operator= (const DenseVectorView& other) │ │ │ │ +67 { │ │ │ │ +68 data_ = other.data_; │ │ │ │ +69 return *this; │ │ │ │ +70 } │ │ │ │ +71 │ │ │ │ +73 size_type size () const │ │ │ │ +74 { │ │ │ │ +75 return data_.size(); │ │ │ │ +76 } │ │ │ │ +77 │ │ │ │ +79 reference operator[] (size_type i) │ │ │ │ +80 { │ │ │ │ +81 return data_[i]; │ │ │ │ +82 } │ │ │ │ +83 │ │ │ │ +85 const_reference operator[] (size_type i) const │ │ │ │ +86 { │ │ │ │ +87 return data_[i]; │ │ │ │ +88 } │ │ │ │ +89 │ │ │ │ +90 }; // class DenseVectorView │ │ │ │ +91 │ │ │ │ +92} │ │ │ │ +93 │ │ │ │ +94namespace _D_u_n_e { │ │ │ │ +95 │ │ │ │ +96 template< class R> │ │ │ │ +97 struct DenseMatVecTraits< Dune::Functions::Impl::DenseVectorView > │ │ │ │ +98 { │ │ │ │ +99 using derived_type = Dune::Functions::Impl::DenseVectorView; │ │ │ │ +100 using value_type = typename R::value_type; │ │ │ │ +101 using size_type = typename R::size_type; │ │ │ │ +102 }; │ │ │ │ +103 │ │ │ │ +104 template< class R > │ │ │ │ +105 struct FieldTraits< Dune::Functions::Impl::DenseVectorView > │ │ │ │ +106 : public FieldTraits::value_type>> │ │ │ │ +107 {}; │ │ │ │ +108 │ │ │ │ +109} │ │ │ │ +110 │ │ │ │ +111 │ │ │ │ +112#endif // DUNE_FUNCTIONS_COMMON_DENSEVECTORVIEW_HH │ │ │ │ +_D_u_n_e │ │ │ │ +DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _t_r_a_n_s_f_o_r_m_e_d_f_i_n_i_t_e_e_l_e_m_e_n_t_m_i_x_i_n_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _d_e_n_s_e_v_e_c_t_o_r_v_i_e_w_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00080.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: taylorhoodbasis.hh File Reference │ │ │ +Dune-Functions: interfaces.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,62 +88,43 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
taylorhoodbasis.hh File Reference
│ │ │ +
interfaces.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <dune/common/exceptions.hh>
│ │ │ -#include <dune/common/reservedvector.hh>
│ │ │ -#include <dune/common/indices.hh>
│ │ │ -#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ -#include <dune/functions/functionspacebases/lagrangebasis.hh>
│ │ │ -#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │ +
#include <type_traits>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::TaylorHoodPreBasis< GV, HI >
 Pre-basis for lowest order Taylor-Hood basis. More...
class  Dune::Functions::TaylorHoodVelocityTree< GV >
class  Dune::Functions::TaylorHoodBasisTree< GV >
class  Dune::Functions::PolymorphicType< Interface >
 Base class with polymorphic type boiler plate code. More...
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ -

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::BasisFactory
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -

│ │ │ -Typedefs

template<typename GV>
using Dune::Functions::TaylorHoodBasis = DefaultGlobalBasis<TaylorHoodPreBasis<GV> >
 Nodal basis for a lowest order Taylor-Hood Lagrangean finite element space.
│ │ │ - │ │ │ - │ │ │ - │ │ │

│ │ │ -Functions

auto Dune::Functions::BasisFactory::taylorHood ()
 Create a pre-basis factory that can create a Taylor-Hood pre-basis.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,35 +1,18 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -taylorhoodbasis.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_a_g_r_a_n_g_e_b_a_s_i_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ +interfaces.hh File Reference │ │ │ │ +#include │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_<_ _G_V_,_ _H_I_ _> │ │ │ │ -  Pre-basis for lowest order Taylor-Hood basis. _M_o_r_e_._._. │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_V_e_l_o_c_i_t_y_T_r_e_e_<_ _G_V_ _> │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_B_a_s_i_s_T_r_e_e_<_ _G_V_ _> │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_T_y_p_e_<_ _I_n_t_e_r_f_a_c_e_ _> │ │ │ │ +  Base class with polymorphic type boiler plate code. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -TTyyppeeddeeffss │ │ │ │ -template │ │ │ │ -using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_B_a_s_i_s = │ │ │ │ - _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s<_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s > │ │ │ │ -  Nodal basis for a lowest order Taylor-Hood Lagrangean finite element │ │ │ │ - space. │ │ │ │ -FFuunnccttiioonnss │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_t_a_y_l_o_r_H_o_o_d () │ │ │ │ -  Create a pre-basis factory that can create a Taylor-Hood pre-basis. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _t_a_y_l_o_r_h_o_o_d_b_a_s_i_s_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _i_n_t_e_r_f_a_c_e_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00080_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: taylorhoodbasis.hh Source File │ │ │ +Dune-Functions: interfaces.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,414 +88,70 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
taylorhoodbasis.hh
│ │ │ +
interfaces.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_COMMON_INTERFACES_HH
│ │ │ +
8#define DUNE_FUNCTIONS_COMMON_INTERFACES_HH
│ │ │
9
│ │ │ -
10#include <dune/common/exceptions.hh>
│ │ │ -
11#include <dune/common/reservedvector.hh>
│ │ │ -
12#include <dune/common/indices.hh>
│ │ │ -
13
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
17
│ │ │ -
18namespace Dune {
│ │ │ -
19namespace Functions {
│ │ │ -
20
│ │ │ -
21
│ │ │ -
22// *****************************************************************************
│ │ │ -
23// This is the reusable part of the basis. It contains
│ │ │ -
24//
│ │ │ -
25// TaylorHoodPreBasis
│ │ │ -
26// TaylorHoodBasisTree
│ │ │ -
27// TaylorHoodVelocityTree
│ │ │ -
28//
│ │ │ -
29// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ -
30// state. These components do _not_ depend on the global basis and local view
│ │ │ -
31// and can be used without a global basis.
│ │ │ -
32// *****************************************************************************
│ │ │ -
33
│ │ │ -
34template<typename GV>
│ │ │ - │ │ │ -
36
│ │ │ -
37template<typename GV>
│ │ │ - │ │ │ -
39
│ │ │ -
59template<typename GV, bool HI=false>
│ │ │ -
│ │ │ - │ │ │ -
61{
│ │ │ -
62 static const bool useHybridIndices = HI;
│ │ │ -
63
│ │ │ -
64 static const int dim = GV::dimension;
│ │ │ -
65
│ │ │ -
66public:
│ │ │ -
67
│ │ │ -
69 using GridView = GV;
│ │ │ -
70
│ │ │ -
72 using size_type = std::size_t;
│ │ │ -
73
│ │ │ - │ │ │ -
76
│ │ │ -
77 static constexpr size_type maxMultiIndexSize = useHybridIndices ? 3 : 2;
│ │ │ -
78 static constexpr size_type minMultiIndexSize = 2;
│ │ │ - │ │ │ -
80
│ │ │ -
81private:
│ │ │ -
82
│ │ │ -
83 using PQ1PreBasis = LagrangePreBasis<GV,1>;
│ │ │ -
84 using PQ2PreBasis = LagrangePreBasis<GV,2>;
│ │ │ -
85
│ │ │ -
86public:
│ │ │ -
87
│ │ │ -
│ │ │ - │ │ │ -
90 gridView_(gv),
│ │ │ -
91 pq1PreBasis_(gv),
│ │ │ -
92 pq2PreBasis_(gv)
│ │ │ -
93 {}
│ │ │ -
│ │ │ -
94
│ │ │ -
│ │ │ - │ │ │ -
97 {
│ │ │ -
98 pq1PreBasis_.initializeIndices();
│ │ │ -
99 pq2PreBasis_.initializeIndices();
│ │ │ -
100 }
│ │ │ -
│ │ │ -
101
│ │ │ -
│ │ │ -
103 const GridView& gridView() const
│ │ │ -
104 {
│ │ │ -
105 return gridView_;
│ │ │ -
106 }
│ │ │ -
│ │ │ -
107
│ │ │ -
│ │ │ -
109 void update (const GridView& gv)
│ │ │ -
110 {
│ │ │ -
111 pq1PreBasis_.update(gv);
│ │ │ -
112 pq2PreBasis_.update(gv);
│ │ │ -
113 }
│ │ │ -
│ │ │ -
114
│ │ │ -
│ │ │ - │ │ │ -
119 {
│ │ │ -
120 return Node{};
│ │ │ -
121 }
│ │ │ -
│ │ │ -
122
│ │ │ -
│ │ │ - │ │ │ -
125 {
│ │ │ -
126 return 2;
│ │ │ -
127 }
│ │ │ -
│ │ │ -
128
│ │ │ -
130 template<class SizePrefix>
│ │ │ -
│ │ │ -
131 size_type size(const SizePrefix& prefix) const
│ │ │ -
132 {
│ │ │ -
133 return sizeImp<useHybridIndices>(prefix);
│ │ │ -
134 }
│ │ │ -
│ │ │ -
135
│ │ │ -
136private:
│ │ │ -
137
│ │ │ -
138 template<bool hi, class SizePrefix,
│ │ │ -
139 std::enable_if_t<not hi,int> = 0>
│ │ │ -
140 size_type sizeImp(const SizePrefix& prefix) const
│ │ │ -
141 {
│ │ │ -
142 if (prefix.size() == 0)
│ │ │ -
143 return 2;
│ │ │ -
144 if (prefix.size() == 1)
│ │ │ -
145 {
│ │ │ -
146 if (prefix[0] == 0)
│ │ │ -
147 return dim * pq2PreBasis_.size();
│ │ │ -
148 if (prefix[0] == 1)
│ │ │ -
149 return pq1PreBasis_.size();
│ │ │ -
150 }
│ │ │ -
151 assert(prefix.size() == 2);
│ │ │ -
152 return 0;
│ │ │ -
153 }
│ │ │ -
154
│ │ │ -
155 template<bool hi, class SizePrefix,
│ │ │ -
156 std::enable_if_t<hi,int> = 0>
│ │ │ -
157 size_type sizeImp(const SizePrefix& prefix) const
│ │ │ -
158 {
│ │ │ -
159 if (prefix.size() == 0)
│ │ │ -
160 return 2;
│ │ │ -
161 if (prefix.size() == 1)
│ │ │ -
162 {
│ │ │ -
163 if (prefix[0] == 0)
│ │ │ -
164 return pq2PreBasis_.size();
│ │ │ -
165 if (prefix[0] == 1)
│ │ │ -
166 return pq1PreBasis_.size();
│ │ │ -
167 }
│ │ │ -
168 if (prefix.size() == 2)
│ │ │ -
169 {
│ │ │ -
170 if (prefix[0] == 0)
│ │ │ -
171 return dim;
│ │ │ -
172 if (prefix[0] == 1)
│ │ │ -
173 return 0;
│ │ │ -
174 }
│ │ │ -
175 assert(prefix.size() == 3);
│ │ │ -
176 return 0;
│ │ │ -
177 }
│ │ │ -
178
│ │ │ -
179public:
│ │ │ -
180
│ │ │ -
│ │ │ - │ │ │ -
183 {
│ │ │ -
184 return dim * pq2PreBasis_.size() + pq1PreBasis_.size();
│ │ │ -
185 }
│ │ │ -
│ │ │ -
186
│ │ │ -
│ │ │ - │ │ │ -
189 {
│ │ │ -
190 return dim * pq2PreBasis_.maxNodeSize() + pq1PreBasis_.maxNodeSize();
│ │ │ -
191 }
│ │ │ -
│ │ │ -
192
│ │ │ -
193 template<typename It>
│ │ │ -
│ │ │ -
194 It indices(const Node& node, It it) const
│ │ │ -
195 {
│ │ │ -
196 return indicesImp<useHybridIndices>(node, it);
│ │ │ -
197 }
│ │ │ -
│ │ │ -
198
│ │ │ -
│ │ │ - │ │ │ -
205 {
│ │ │ - │ │ │ -
207 if constexpr(HI)
│ │ │ -
208 return CD::makeDescriptor(
│ │ │ -
209 CD::makeUniformDescriptor(pq2PreBasis_.size(),
│ │ │ -
210 CD::FlatArray<GV::dimension>{}),
│ │ │ -
211 CD::FlatVector{pq1PreBasis_.size()});
│ │ │ -
212 else
│ │ │ -
213 return CD::Array<CD::FlatVector,2>{
│ │ │ -
214 CD::FlatVector{GV::dimension * pq2PreBasis_.size()},
│ │ │ -
215 CD::FlatVector{pq1PreBasis_.size()} };
│ │ │ -
216 }
│ │ │ -
│ │ │ -
217
│ │ │ -
218protected:
│ │ │ -
219
│ │ │ -
220 template<class MultiIndex>
│ │ │ -
│ │ │ -
221 static const void multiIndexPushFront(MultiIndex& M, size_type M0)
│ │ │ -
222 {
│ │ │ -
223 M.resize(M.size()+1);
│ │ │ -
224 for(std::size_t i=M.size()-1; i>0; --i)
│ │ │ -
225 M[i] = M[i-1];
│ │ │ -
226 M[0] = M0;
│ │ │ -
227 }
│ │ │ -
│ │ │ -
228
│ │ │ -
229 template<bool hi, class It,
│ │ │ -
230 std::enable_if_t<not hi,int> = 0>
│ │ │ -
│ │ │ -
231 It indicesImp(const Node& node, It multiIndices) const
│ │ │ -
232 {
│ │ │ -
233 using namespace Dune::Indices;
│ │ │ -
234 for(std::size_t child=0; child<dim; ++child)
│ │ │ -
235 {
│ │ │ -
236 size_type subTreeSize = node.child(_0, 0).size();
│ │ │ -
237 pq2PreBasis_.indices(node.child(_0, 0), multiIndices);
│ │ │ -
238 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ -
239 {
│ │ │ -
240 multiIndexPushFront(multiIndices[i], 0);
│ │ │ -
241 multiIndices[i][1] = multiIndices[i][1]*dim + child;
│ │ │ -
242 }
│ │ │ -
243 multiIndices += subTreeSize;
│ │ │ -
244 }
│ │ │ -
245 size_type subTreeSize = node.child(_1).size();
│ │ │ -
246 pq1PreBasis_.indices(node.child(_1), multiIndices);
│ │ │ -
247 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ -
248 multiIndexPushFront(multiIndices[i], 1);
│ │ │ -
249 multiIndices += subTreeSize;
│ │ │ -
250 return multiIndices;
│ │ │ -
251 }
│ │ │ -
│ │ │ -
252
│ │ │ -
253 template<bool hi, class It,
│ │ │ -
254 std::enable_if_t<hi,int> = 0>
│ │ │ -
│ │ │ -
255 It indicesImp(const Node& node, It multiIndices) const
│ │ │ -
256 {
│ │ │ -
257 using namespace Dune::Indices;
│ │ │ -
258 for(std::size_t child=0; child<dim; ++child)
│ │ │ -
259 {
│ │ │ -
260 size_type subTreeSize = node.child(_0, 0).size();
│ │ │ -
261 pq2PreBasis_.indices(node.child(_0, 0), multiIndices);
│ │ │ -
262 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ -
263 {
│ │ │ -
264 multiIndexPushFront(multiIndices[i], 0);
│ │ │ -
265 multiIndices[i].push_back(i);
│ │ │ -
266 }
│ │ │ -
267 multiIndices += subTreeSize;
│ │ │ -
268 }
│ │ │ -
269 size_type subTreeSize = node.child(_1).size();
│ │ │ -
270 pq1PreBasis_.indices(node.child(_1), multiIndices);
│ │ │ -
271 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ -
272 multiIndexPushFront(multiIndices[i], 1);
│ │ │ -
273 multiIndices += subTreeSize;
│ │ │ -
274 return multiIndices;
│ │ │ -
275 }
│ │ │ -
│ │ │ -
276
│ │ │ - │ │ │ -
278
│ │ │ -
279 PQ1PreBasis pq1PreBasis_;
│ │ │ -
280 PQ2PreBasis pq2PreBasis_;
│ │ │ -
281};
│ │ │ -
│ │ │ -
282
│ │ │ -
283
│ │ │ -
284
│ │ │ -
285template<typename GV>
│ │ │ -
│ │ │ - │ │ │ -
287 public PowerBasisNode<LagrangeNode<GV,2>, GV::dimension>
│ │ │ -
288{
│ │ │ -
289 using PQ2Node = LagrangeNode<GV,2>;
│ │ │ - │ │ │ -
291
│ │ │ -
292public:
│ │ │ -
│ │ │ - │ │ │ -
294 {
│ │ │ -
295 for(int i=0; i<GV::dimension; ++i)
│ │ │ -
296 this->setChild(i, PQ2Node());
│ │ │ -
297 }
│ │ │ -
│ │ │ -
298};
│ │ │ -
│ │ │ -
299
│ │ │ -
300template<typename GV>
│ │ │ -
│ │ │ - │ │ │ -
302 public CompositeBasisNode<
│ │ │ -
303 TaylorHoodVelocityTree<GV>,
│ │ │ -
304 LagrangeNode<GV,1>
│ │ │ -
305 >
│ │ │ -
306{
│ │ │ -
307 using VelocityNode=TaylorHoodVelocityTree<GV>;
│ │ │ -
308 using PressureNode=LagrangeNode<GV,1>;
│ │ │ -
309
│ │ │ - │ │ │ -
311
│ │ │ -
312public:
│ │ │ -
│ │ │ - │ │ │ -
314 {
│ │ │ -
315 this->template setChild<0>(VelocityNode());
│ │ │ -
316 this->template setChild<1>(PressureNode());
│ │ │ -
317 }
│ │ │ -
│ │ │ -
318};
│ │ │ -
│ │ │ -
319
│ │ │ -
320
│ │ │ -
321
│ │ │ -
322namespace BasisFactory {
│ │ │ -
323
│ │ │ -
│ │ │ -
330inline auto taylorHood()
│ │ │ -
331{
│ │ │ -
332 return [](const auto& gridView) {
│ │ │ -
333 return TaylorHoodPreBasis<std::decay_t<decltype(gridView)>>(gridView);
│ │ │ -
334 };
│ │ │ -
335}
│ │ │ -
│ │ │ -
336
│ │ │ -
337} // end namespace BasisFactory
│ │ │ -
338
│ │ │ -
339// *****************************************************************************
│ │ │ -
340// This is the actual global basis implementation based on the reusable parts.
│ │ │ -
341// *****************************************************************************
│ │ │ -
342
│ │ │ -
364template<typename GV>
│ │ │ - │ │ │ -
366
│ │ │ -
367
│ │ │ -
368
│ │ │ -
369} // end namespace Functions
│ │ │ -
370} // end namespace Dune
│ │ │ -
371
│ │ │ -
372
│ │ │ -
373#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
auto taylorHood()
Create a pre-basis factory that can create a Taylor-Hood pre-basis.
Definition taylorhoodbasis.hh:330
│ │ │ -
DefaultGlobalBasis< TaylorHoodPreBasis< GV > > TaylorHoodBasis
Nodal basis for a lowest order Taylor-Hood Lagrangean finite element space.
Definition taylorhoodbasis.hh:365
│ │ │ +
10#include <type_traits>
│ │ │ +
11
│ │ │ +
12
│ │ │ +
13namespace Dune {
│ │ │ +
14namespace Functions {
│ │ │ +
15
│ │ │ +
16
│ │ │ +
17
│ │ │ +
27template<class Interface>
│ │ │ +
│ │ │ + │ │ │ +
29{
│ │ │ +
30public:
│ │ │ +
31
│ │ │ +
│ │ │ + │ │ │ +
34 {}
│ │ │ +
│ │ │ +
35
│ │ │ +
44 virtual Interface* clone() const = 0;
│ │ │ +
45
│ │ │ +
55 virtual Interface* clone(void* buffer) const = 0;
│ │ │ +
56
│ │ │ +
66 virtual Interface* move(void* buffer) = 0;
│ │ │ +
67};
│ │ │ +
│ │ │ +
68
│ │ │ +
69
│ │ │ +
70
│ │ │ +
71}} // namespace Dune::Functions
│ │ │ +
72
│ │ │ +
73#endif // DUNE_FUNCTIONS_COMMON_EXTENDED_CLONEABLE_HH
│ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
Definition containerfactory.hh:20
│ │ │ -
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:53
│ │ │ -
Definition lagrangebasis.hh:379
│ │ │ -
A pre-basis for a PQ-lagrange bases with given order.
Definition lagrangebasis.hh:65
│ │ │ -
size_type size(const SizePrefix &prefix) const
Definition leafprebasismixin.hh:53
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
const auto & child(Dune::index_constant< i > ii) const
Definition nodes.hh:408
│ │ │ -
void setChild(TT &&t, Dune::index_constant< i > ii={})
Definition nodes.hh:458
│ │ │ -
Definition taylorhoodbasis.hh:288
│ │ │ -
TaylorHoodVelocityTree()
Definition taylorhoodbasis.hh:293
│ │ │ -
Definition taylorhoodbasis.hh:306
│ │ │ -
TaylorHoodBasisTree()
Definition taylorhoodbasis.hh:313
│ │ │ -
Pre-basis for lowest order Taylor-Hood basis.
Definition taylorhoodbasis.hh:61
│ │ │ -
TaylorHoodPreBasis(const GridView &gv)
Constructor for a given grid view object.
Definition taylorhoodbasis.hh:89
│ │ │ -
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition taylorhoodbasis.hh:103
│ │ │ -
static constexpr size_type minMultiIndexSize
Definition taylorhoodbasis.hh:78
│ │ │ -
size_type size(const SizePrefix &prefix) const
Return number of possible values for next position in multi index.
Definition taylorhoodbasis.hh:131
│ │ │ -
GridView gridView_
Definition taylorhoodbasis.hh:277
│ │ │ -
GV GridView
The grid view that the FE basis is defined on.
Definition taylorhoodbasis.hh:69
│ │ │ -
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition taylorhoodbasis.hh:109
│ │ │ -
auto containerDescriptor() const
Return an container descriptor depending on the flag HI. Either return a Tuple if hybrid indices shou...
Definition taylorhoodbasis.hh:204
│ │ │ -
TaylorHoodBasisTree< GV > Node
Template mapping root tree path to type of created tree node.
Definition taylorhoodbasis.hh:75
│ │ │ -
PQ2PreBasis pq2PreBasis_
Definition taylorhoodbasis.hh:280
│ │ │ -
size_type size() const
Same as size(prefix) with empty prefix.
Definition taylorhoodbasis.hh:124
│ │ │ -
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition taylorhoodbasis.hh:182
│ │ │ -
PQ1PreBasis pq1PreBasis_
Definition taylorhoodbasis.hh:279
│ │ │ -
static const void multiIndexPushFront(MultiIndex &M, size_type M0)
Definition taylorhoodbasis.hh:221
│ │ │ -
static constexpr size_type maxMultiIndexSize
Definition taylorhoodbasis.hh:77
│ │ │ -
Node makeNode() const
Create tree node.
Definition taylorhoodbasis.hh:118
│ │ │ -
It indices(const Node &node, It it) const
Definition taylorhoodbasis.hh:194
│ │ │ -
static constexpr size_type multiIndexBufferSize
Definition taylorhoodbasis.hh:79
│ │ │ -
void initializeIndices()
Initialize the global indices.
Definition taylorhoodbasis.hh:96
│ │ │ -
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition taylorhoodbasis.hh:188
│ │ │ -
std::size_t size_type
Type used for indices and size information.
Definition taylorhoodbasis.hh:72
│ │ │ -
It indicesImp(const Node &node, It multiIndices) const
Definition taylorhoodbasis.hh:231
│ │ │ +
Base class with polymorphic type boiler plate code.
Definition interfaces.hh:29
│ │ │ +
virtual Interface * clone(void *buffer) const =0
Clones the object into buffer.
│ │ │ +
virtual Interface * clone() const =0
Clones the object.
│ │ │ +
virtual Interface * move(void *buffer)=0
Move object into buffer.
│ │ │ +
virtual ~PolymorphicType()
Destructor.
Definition interfaces.hh:33
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,465 +1,70 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -taylorhoodbasis.hh │ │ │ │ +interfaces.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_COMMON_INTERFACES_HH │ │ │ │ +8#define DUNE_FUNCTIONS_COMMON_INTERFACES_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ -12#include │ │ │ │ -13 │ │ │ │ -14#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -15#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_a_g_r_a_n_g_e_b_a_s_i_s_._h_h> │ │ │ │ -16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ +10#include │ │ │ │ +11 │ │ │ │ +12 │ │ │ │ +13namespace _D_u_n_e { │ │ │ │ +14namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +15 │ │ │ │ +16 │ │ │ │ 17 │ │ │ │ -18namespace _D_u_n_e { │ │ │ │ -19namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -20 │ │ │ │ -21 │ │ │ │ -22/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -23// This is the reusable part of the basis. It contains │ │ │ │ -24// │ │ │ │ -25// TaylorHoodPreBasis │ │ │ │ -26// TaylorHoodBasisTree │ │ │ │ -27// TaylorHoodVelocityTree │ │ │ │ -28// │ │ │ │ -29// The pre-basis allows to create the others and is the owner of possible │ │ │ │ -shared │ │ │ │ -30// state. These components do _not_ depend on the global basis and local view │ │ │ │ -31// and can be used without a global basis. │ │ │ │ -32/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -33 │ │ │ │ -34template │ │ │ │ -35class _T_a_y_l_o_r_H_o_o_d_V_e_l_o_c_i_t_y_T_r_e_e; │ │ │ │ -36 │ │ │ │ -37template │ │ │ │ -38class _T_a_y_l_o_r_H_o_o_d_B_a_s_i_s_T_r_e_e; │ │ │ │ -39 │ │ │ │ -59template │ │ │ │ -_6_0class _T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s │ │ │ │ -61{ │ │ │ │ -62 static const bool useHybridIndices = HI; │ │ │ │ -63 │ │ │ │ -64 static const int dim = GV::dimension; │ │ │ │ -65 │ │ │ │ -66public: │ │ │ │ -67 │ │ │ │ -_6_9 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ +27template │ │ │ │ +_2_8class _P_o_l_y_m_o_r_p_h_i_c_T_y_p_e │ │ │ │ +29{ │ │ │ │ +30public: │ │ │ │ +31 │ │ │ │ +_3_3 virtual _~_P_o_l_y_m_o_r_p_h_i_c_T_y_p_e() │ │ │ │ +34 {} │ │ │ │ +35 │ │ │ │ +_4_4 virtual Interface* _c_l_o_n_e() const = 0; │ │ │ │ +45 │ │ │ │ +_5_5 virtual Interface* _c_l_o_n_e(void* buffer) const = 0; │ │ │ │ +56 │ │ │ │ +_6_6 virtual Interface* _m_o_v_e(void* buffer) = 0; │ │ │ │ +67}; │ │ │ │ +68 │ │ │ │ +69 │ │ │ │ 70 │ │ │ │ -_7_2 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ -73 │ │ │ │ -_7_5 using _N_o_d_e = _T_a_y_l_o_r_H_o_o_d_B_a_s_i_s_T_r_e_e_<_G_V_>; │ │ │ │ -76 │ │ │ │ -_7_7 static constexpr _s_i_z_e___t_y_p_e _m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e = useHybridIndices ? 3 : 2; │ │ │ │ -_7_8 static constexpr _s_i_z_e___t_y_p_e _m_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e = 2; │ │ │ │ -_7_9 static constexpr _s_i_z_e___t_y_p_e _m_u_l_t_i_I_n_d_e_x_B_u_f_f_e_r_S_i_z_e = _m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e; │ │ │ │ -80 │ │ │ │ -81private: │ │ │ │ -82 │ │ │ │ -83 using PQ1PreBasis = _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_G_V_,_1_>; │ │ │ │ -84 using PQ2PreBasis = _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_G_V_,_2_>; │ │ │ │ -85 │ │ │ │ -86public: │ │ │ │ -87 │ │ │ │ -_8_9 _T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s(const _G_r_i_d_V_i_e_w& gv) : │ │ │ │ -90 _g_r_i_d_V_i_e_w__(gv), │ │ │ │ -91 _p_q_1_P_r_e_B_a_s_i_s__(gv), │ │ │ │ -92 _p_q_2_P_r_e_B_a_s_i_s__(gv) │ │ │ │ -93 {} │ │ │ │ -94 │ │ │ │ -_9_6 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ -97 { │ │ │ │ -98 _p_q_1_P_r_e_B_a_s_i_s__.initializeIndices(); │ │ │ │ -99 _p_q_2_P_r_e_B_a_s_i_s__.initializeIndices(); │ │ │ │ -100 } │ │ │ │ -101 │ │ │ │ -_1_0_3 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ -104 { │ │ │ │ -105 return _g_r_i_d_V_i_e_w__; │ │ │ │ -106 } │ │ │ │ -107 │ │ │ │ -_1_0_9 void _u_p_d_a_t_e (const _G_r_i_d_V_i_e_w& gv) │ │ │ │ -110 { │ │ │ │ -111 _p_q_1_P_r_e_B_a_s_i_s__.update(gv); │ │ │ │ -112 _p_q_2_P_r_e_B_a_s_i_s__.update(gv); │ │ │ │ -113 } │ │ │ │ -114 │ │ │ │ -_1_1_8 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ -119 { │ │ │ │ -120 return _N_o_d_e{}; │ │ │ │ -121 } │ │ │ │ -122 │ │ │ │ -_1_2_4 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ -125 { │ │ │ │ -126 return 2; │ │ │ │ -127 } │ │ │ │ -128 │ │ │ │ -130 template │ │ │ │ -_1_3_1 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix) const │ │ │ │ -132 { │ │ │ │ -133 return sizeImp(prefix); │ │ │ │ -134 } │ │ │ │ -135 │ │ │ │ -136private: │ │ │ │ -137 │ │ │ │ -138 template = 0> │ │ │ │ -140 _s_i_z_e___t_y_p_e sizeImp(const SizePrefix& prefix) const │ │ │ │ -141 { │ │ │ │ -142 if (prefix.size() == 0) │ │ │ │ -143 return 2; │ │ │ │ -144 if (prefix.size() == 1) │ │ │ │ -145 { │ │ │ │ -146 if (prefix[0] == 0) │ │ │ │ -147 return dim * _p_q_2_P_r_e_B_a_s_i_s__._s_i_z_e(); │ │ │ │ -148 if (prefix[0] == 1) │ │ │ │ -149 return _p_q_1_P_r_e_B_a_s_i_s__._s_i_z_e(); │ │ │ │ -150 } │ │ │ │ -151 assert(prefix.size() == 2); │ │ │ │ -152 return 0; │ │ │ │ -153 } │ │ │ │ -154 │ │ │ │ -155 template = 0> │ │ │ │ -157 _s_i_z_e___t_y_p_e sizeImp(const SizePrefix& prefix) const │ │ │ │ -158 { │ │ │ │ -159 if (prefix.size() == 0) │ │ │ │ -160 return 2; │ │ │ │ -161 if (prefix.size() == 1) │ │ │ │ -162 { │ │ │ │ -163 if (prefix[0] == 0) │ │ │ │ -164 return _p_q_2_P_r_e_B_a_s_i_s__._s_i_z_e(); │ │ │ │ -165 if (prefix[0] == 1) │ │ │ │ -166 return _p_q_1_P_r_e_B_a_s_i_s__._s_i_z_e(); │ │ │ │ -167 } │ │ │ │ -168 if (prefix.size() == 2) │ │ │ │ -169 { │ │ │ │ -170 if (prefix[0] == 0) │ │ │ │ -171 return dim; │ │ │ │ -172 if (prefix[0] == 1) │ │ │ │ -173 return 0; │ │ │ │ -174 } │ │ │ │ -175 assert(prefix.size() == 3); │ │ │ │ -176 return 0; │ │ │ │ -177 } │ │ │ │ -178 │ │ │ │ -179public: │ │ │ │ -180 │ │ │ │ -_1_8_2 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ -183 { │ │ │ │ -184 return dim * _p_q_2_P_r_e_B_a_s_i_s__.size() + _p_q_1_P_r_e_B_a_s_i_s__.size(); │ │ │ │ -185 } │ │ │ │ -186 │ │ │ │ -_1_8_8 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ -189 { │ │ │ │ -190 return dim * _p_q_2_P_r_e_B_a_s_i_s__.maxNodeSize() + _p_q_1_P_r_e_B_a_s_i_s__.maxNodeSize(); │ │ │ │ -191 } │ │ │ │ -192 │ │ │ │ -193 template │ │ │ │ -_1_9_4 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ -195 { │ │ │ │ -196 return _i_n_d_i_c_e_s_I_m_p_<_u_s_e_H_y_b_r_i_d_I_n_d_i_c_e_s_>(node, it); │ │ │ │ -197 } │ │ │ │ -198 │ │ │ │ -_2_0_4 auto _c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r() const │ │ │ │ -205 { │ │ │ │ -206 namespace CD = _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s; │ │ │ │ -207 if constexpr(HI) │ │ │ │ -208 return CD::makeDescriptor( │ │ │ │ -209 CD::makeUniformDescriptor(_p_q_2_P_r_e_B_a_s_i_s__.size(), │ │ │ │ -210 CD::FlatArray{}), │ │ │ │ -211 CD::FlatVector{pq1PreBasis_.size()}); │ │ │ │ -212 else │ │ │ │ -213 return CD::Array{ │ │ │ │ -214 CD::FlatVector{GV::dimension * _p_q_2_P_r_e_B_a_s_i_s__.size()}, │ │ │ │ -215 CD::FlatVector{_p_q_1_P_r_e_B_a_s_i_s__.size()} }; │ │ │ │ -216 } │ │ │ │ -217 │ │ │ │ -218protected: │ │ │ │ -219 │ │ │ │ -220 template │ │ │ │ -_2_2_1 static const void _m_u_l_t_i_I_n_d_e_x_P_u_s_h_F_r_o_n_t(MultiIndex& M, _s_i_z_e___t_y_p_e M0) │ │ │ │ -222 { │ │ │ │ -223 M.resize(M.size()+1); │ │ │ │ -224 for(std::size_t i=M.size()-1; i>0; --i) │ │ │ │ -225 M[i] = M[i-1]; │ │ │ │ -226 M[0] = M0; │ │ │ │ -227 } │ │ │ │ -228 │ │ │ │ -229 template = 0> │ │ │ │ -_2_3_1 It _i_n_d_i_c_e_s_I_m_p(const _N_o_d_e& node, It multiIndices) const │ │ │ │ -232 { │ │ │ │ -233 using namespace Dune::Indices; │ │ │ │ -234 for(std::size_t child=0; child = 0> │ │ │ │ -_2_5_5 It _i_n_d_i_c_e_s_I_m_p(const _N_o_d_e& node, It multiIndices) const │ │ │ │ -256 { │ │ │ │ -257 using namespace Dune::Indices; │ │ │ │ -258 for(std::size_t child=0; child │ │ │ │ -_2_8_6class _T_a_y_l_o_r_H_o_o_d_V_e_l_o_c_i_t_y_T_r_e_e : │ │ │ │ -287 public _P_o_w_e_r_B_a_s_i_s_N_o_d_e, GV::dimension> │ │ │ │ -288{ │ │ │ │ -289 using PQ2Node = _L_a_g_r_a_n_g_e_N_o_d_e_<_G_V_,_2_>; │ │ │ │ -290 using Base = _P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_P_Q_2_N_o_d_e_,_ _G_V_:_:_d_i_m_e_n_s_i_o_n_>; │ │ │ │ -291 │ │ │ │ -292public: │ │ │ │ -_2_9_3 _T_a_y_l_o_r_H_o_o_d_V_e_l_o_c_i_t_y_T_r_e_e() │ │ │ │ -294 { │ │ │ │ -295 for(int i=0; i_s_e_t_C_h_i_l_d(i, PQ2Node()); │ │ │ │ -297 } │ │ │ │ -298}; │ │ │ │ -299 │ │ │ │ -300template │ │ │ │ -_3_0_1class _T_a_y_l_o_r_H_o_o_d_B_a_s_i_s_T_r_e_e : │ │ │ │ -302 public _C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e< │ │ │ │ -303 TaylorHoodVelocityTree, │ │ │ │ -304 LagrangeNode │ │ │ │ -305 > │ │ │ │ -306{ │ │ │ │ -307 using VelocityNode=_T_a_y_l_o_r_H_o_o_d_V_e_l_o_c_i_t_y_T_r_e_e_<_G_V_>; │ │ │ │ -308 using PressureNode=_L_a_g_r_a_n_g_e_N_o_d_e_<_G_V_,_1_>; │ │ │ │ -309 │ │ │ │ -310 using Base=_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_<_V_e_l_o_c_i_t_y_N_o_d_e_,_ _P_r_e_s_s_u_r_e_N_o_d_e_>; │ │ │ │ -311 │ │ │ │ -312public: │ │ │ │ -_3_1_3 _T_a_y_l_o_r_H_o_o_d_B_a_s_i_s_T_r_e_e() │ │ │ │ -314 { │ │ │ │ -315 this->template _s_e_t_C_h_i_l_d_<_0_>(VelocityNode()); │ │ │ │ -316 this->template _s_e_t_C_h_i_l_d_<_1_>(PressureNode()); │ │ │ │ -317 } │ │ │ │ -318}; │ │ │ │ -319 │ │ │ │ -320 │ │ │ │ -321 │ │ │ │ -322namespace BasisFactory { │ │ │ │ -323 │ │ │ │ -_3_3_0inline auto _t_a_y_l_o_r_H_o_o_d() │ │ │ │ -331{ │ │ │ │ -332 return [](const auto& gridView) { │ │ │ │ -333 return _T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s>(gridView); │ │ │ │ -334 }; │ │ │ │ -335} │ │ │ │ -336 │ │ │ │ -337} // end namespace BasisFactory │ │ │ │ -338 │ │ │ │ -339/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -340// This is the actual global basis implementation based on the reusable │ │ │ │ -parts. │ │ │ │ -341/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -342 │ │ │ │ -364template │ │ │ │ -_3_6_5using _T_a_y_l_o_r_H_o_o_d_B_a_s_i_s = _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_<_G_V_> >; │ │ │ │ -366 │ │ │ │ -367 │ │ │ │ -368 │ │ │ │ -369} // end namespace Functions │ │ │ │ -370} // end namespace Dune │ │ │ │ -371 │ │ │ │ -372 │ │ │ │ -373#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH │ │ │ │ -_n_o_d_e_s_._h_h │ │ │ │ -_l_a_g_r_a_n_g_e_b_a_s_i_s_._h_h │ │ │ │ -_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_t_a_y_l_o_r_H_o_o_d │ │ │ │ -auto taylorHood() │ │ │ │ -Create a pre-basis factory that can create a Taylor-Hood pre-basis. │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:330 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_B_a_s_i_s │ │ │ │ -DefaultGlobalBasis< TaylorHoodPreBasis< GV > > TaylorHoodBasis │ │ │ │ -Nodal basis for a lowest order Taylor-Hood Lagrangean finite element space. │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:365 │ │ │ │ +71}} // namespace Dune::Functions │ │ │ │ +72 │ │ │ │ +73#endif // DUNE_FUNCTIONS_COMMON_EXTENDED_CLONEABLE_HH │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s │ │ │ │ -DDeeffiinniittiioonn containerfactory.hh:20 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ -Global basis for given pre-basis. │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:53 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:379 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s │ │ │ │ -A pre-basis for a PQ-lagrange bases with given order. │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:65 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_i_x_i_n_<_ _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _k_,_ _R_ _>_ _>_:_:_s_i_z_e │ │ │ │ -size_type size(const SizePrefix &prefix) const │ │ │ │ -DDeeffiinniittiioonn leafprebasismixin.hh:53 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_ _L_a_g_r_a_n_g_e_N_o_d_e_<_ _G_V_,_ _2_ _>_,_ _G_V_:_:_d_i_m_e_n_s_i_o_n_ _>_:_: │ │ │ │ -_P_o_w_e_r_B_a_s_i_s_N_o_d_e │ │ │ │ -PowerBasisNode()=default │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_ _L_a_g_r_a_n_g_e_N_o_d_e_<_ _G_V_,_ _2_ _>_,_ _G_V_:_:_d_i_m_e_n_s_i_o_n_ _>_:_: │ │ │ │ -_s_e_t_C_h_i_l_d │ │ │ │ -void setChild(Index i, TT &&t) │ │ │ │ -DDeeffiinniittiioonn nodes.hh:317 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_<_ _T_a_y_l_o_r_H_o_o_d_V_e_l_o_c_i_t_y_T_r_e_e_<_ _G_V_ _>_, │ │ │ │ -_L_a_g_r_a_n_g_e_N_o_d_e_<_ _G_V_,_ _1_ _>_ _>_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e │ │ │ │ -CompositeBasisNode()=default │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ -const auto & child(Dune::index_constant< i > ii) const │ │ │ │ -DDeeffiinniittiioonn nodes.hh:408 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_<_ _T_a_y_l_o_r_H_o_o_d_V_e_l_o_c_i_t_y_T_r_e_e_<_ _G_V_ _>_, │ │ │ │ -_L_a_g_r_a_n_g_e_N_o_d_e_<_ _G_V_,_ _1_ _>_ _>_:_:_s_e_t_C_h_i_l_d │ │ │ │ -void setChild(TT &&t, Dune::index_constant< i > ii={}) │ │ │ │ -DDeeffiinniittiioonn nodes.hh:458 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_V_e_l_o_c_i_t_y_T_r_e_e │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:288 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_V_e_l_o_c_i_t_y_T_r_e_e_:_:_T_a_y_l_o_r_H_o_o_d_V_e_l_o_c_i_t_y_T_r_e_e │ │ │ │ -TaylorHoodVelocityTree() │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:293 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_B_a_s_i_s_T_r_e_e │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:306 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_B_a_s_i_s_T_r_e_e_:_:_T_a_y_l_o_r_H_o_o_d_B_a_s_i_s_T_r_e_e │ │ │ │ -TaylorHoodBasisTree() │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:313 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s │ │ │ │ -Pre-basis for lowest order Taylor-Hood basis. │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:61 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s │ │ │ │ -TaylorHoodPreBasis(const GridView &gv) │ │ │ │ -Constructor for a given grid view object. │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:89 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_g_r_i_d_V_i_e_w │ │ │ │ -const GridView & gridView() const │ │ │ │ -Obtain the grid view that the basis is defined on. │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:103 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_m_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ -static constexpr size_type minMultiIndexSize │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:78 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ -size_type size(const SizePrefix &prefix) const │ │ │ │ -Return number of possible values for next position in multi index. │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:131 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_g_r_i_d_V_i_e_w__ │ │ │ │ -GridView gridView_ │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:277 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ -GV GridView │ │ │ │ -The grid view that the FE basis is defined on. │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:69 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_u_p_d_a_t_e │ │ │ │ -void update(const GridView &gv) │ │ │ │ -Update the stored grid view, to be called if the grid has changed. │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:109 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r │ │ │ │ -auto containerDescriptor() const │ │ │ │ -Return an container descriptor depending on the flag HI. Either return a Tuple │ │ │ │ -if hybrid indices shou... │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:204 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_N_o_d_e │ │ │ │ -TaylorHoodBasisTree< GV > Node │ │ │ │ -Template mapping root tree path to type of created tree node. │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:75 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_p_q_2_P_r_e_B_a_s_i_s__ │ │ │ │ -PQ2PreBasis pq2PreBasis_ │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:280 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ -size_type size() const │ │ │ │ -Same as size(prefix) with empty prefix. │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:124 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ -size_type dimension() const │ │ │ │ -Get the total dimension of the space spanned by this basis. │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:182 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_p_q_1_P_r_e_B_a_s_i_s__ │ │ │ │ -PQ1PreBasis pq1PreBasis_ │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:279 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_m_u_l_t_i_I_n_d_e_x_P_u_s_h_F_r_o_n_t │ │ │ │ -static const void multiIndexPushFront(MultiIndex &M, size_type M0) │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:221 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ -static constexpr size_type maxMultiIndexSize │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:77 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_m_a_k_e_N_o_d_e │ │ │ │ -Node makeNode() const │ │ │ │ -Create tree node. │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:118 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_i_n_d_i_c_e_s │ │ │ │ -It indices(const Node &node, It it) const │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:194 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_m_u_l_t_i_I_n_d_e_x_B_u_f_f_e_r_S_i_z_e │ │ │ │ -static constexpr size_type multiIndexBufferSize │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:79 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ -void initializeIndices() │ │ │ │ -Initialize the global indices. │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:96 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_m_a_x_N_o_d_e_S_i_z_e │ │ │ │ -size_type maxNodeSize() const │ │ │ │ -Get the maximal number of DOFs associated to node for any element. │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:188 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -Type used for indices and size information. │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:72 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_i_n_d_i_c_e_s_I_m_p │ │ │ │ -It indicesImp(const Node &node, It multiIndices) const │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:231 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_T_y_p_e │ │ │ │ +Base class with polymorphic type boiler plate code. │ │ │ │ +DDeeffiinniittiioonn interfaces.hh:29 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_T_y_p_e_:_:_c_l_o_n_e │ │ │ │ +virtual Interface * clone(void *buffer) const =0 │ │ │ │ +Clones the object into buffer. │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_T_y_p_e_:_:_c_l_o_n_e │ │ │ │ +virtual Interface * clone() const =0 │ │ │ │ +Clones the object. │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_T_y_p_e_:_:_m_o_v_e │ │ │ │ +virtual Interface * move(void *buffer)=0 │ │ │ │ +Move object into buffer. │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_T_y_p_e_:_:_~_P_o_l_y_m_o_r_p_h_i_c_T_y_p_e │ │ │ │ +virtual ~PolymorphicType() │ │ │ │ +Destructor. │ │ │ │ +DDeeffiinniittiioonn interfaces.hh:33 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _t_a_y_l_o_r_h_o_o_d_b_a_s_i_s_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _i_n_t_e_r_f_a_c_e_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00083.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: subspacelocalview.hh File Reference │ │ │ +Dune-Functions: indexaccess.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,46 +88,64 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
subspacelocalview.hh File Reference
│ │ │ +
indexaccess.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <tuple>
│ │ │ +
#include <utility>
│ │ │ +#include <type_traits>
│ │ │ +#include <dune/common/typetraits.hh>
│ │ │ #include <dune/common/concept.hh>
│ │ │ -#include <dune/common/typetree/childaccess.hh>
│ │ │ -#include <dune/functions/functionspacebases/concepts.hh>
│ │ │ +#include <dune/common/hybridutilities.hh>
│ │ │ +#include <dune/functions/common/utility.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ -

│ │ │ -Classes

class  Dune::Functions::SubspaceLocalView< RLV, PP >
 The restriction of a finite element basis to a single element. More...
│ │ │ │ │ │ │ │ │ │ │ │ +

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ +Functions

template<class C, class I, class F, std::enable_if_t< Dune::models< Imp::Concept::HasDynamicIndexAccess< I >, C >(), int > = 0>
auto Dune::Functions::hybridIndexAccess (C &&c, const I &i, F &&f) -> decltype(f(c[i]))
 Provide operator[] index-access for containers.
template<class C, class I, class F, std::enable_if_t< not Dune::models< Imp::Concept::HasDynamicIndexAccess< I >, C >(), int > = 0>
decltype(auto) Dune::Functions::hybridIndexAccess (C &&c, const I &i, F &&f)
 Provide operator[] index-access for containers.
template<class Result, class C, class MultiIndex>
Result Dune::Functions::hybridMultiIndexAccess (C &&c, const MultiIndex &index)
 Provide multi-index access by chaining operator[].
template<class C, class MultiIndex, class IsFinal>
constexpr decltype(auto) Dune::Functions::resolveDynamicMultiIndex (C &&c, const MultiIndex &multiIndex, const IsFinal &isFinal)
 Provide multi-index access by chaining operator[].
template<class C, class MultiIndex>
constexpr decltype(auto) Dune::Functions::resolveDynamicMultiIndex (C &&c, const MultiIndex &multiIndex)
 Provide multi-index access by chaining operator[].
template<class C, class MultiIndex>
constexpr decltype(auto) Dune::Functions::resolveStaticMultiIndex (C &&c, const MultiIndex &multiIndex)
 Provide multi-index access by chaining operator[].
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,21 +1,47 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -subspacelocalview.hh File Reference │ │ │ │ -#include │ │ │ │ +indexaccess.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ -CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_<_ _R_L_V_,_ _P_P_ _> │ │ │ │ -  The restriction of a finite element basis to a single element. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ +FFuunnccttiioonnss │ │ │ │ +template, C >(), int > = 0> │ │ │ │ + auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_h_y_b_r_i_d_I_n_d_e_x_A_c_c_e_s_s (C &&c, const I │ │ │ │ + &i, F &&f) -> decltype(f(c[i])) │ │ │ │ +  Provide operator[] index-access for containers. │ │ │ │ +template, C >(), int > = 0> │ │ │ │ + decltype(auto)  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_h_y_b_r_i_d_I_n_d_e_x_A_c_c_e_s_s (C &&c, const I │ │ │ │ + &i, F &&f) │ │ │ │ +  Provide operator[] index-access for containers. │ │ │ │ +template │ │ │ │ + Result  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_h_y_b_r_i_d_M_u_l_t_i_I_n_d_e_x_A_c_c_e_s_s (C &&c, const │ │ │ │ + MultiIndex &index) │ │ │ │ +  Provide multi-index access by chaining operator[]. │ │ │ │ +template │ │ │ │ +constexpr decltype(auto)  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_r_e_s_o_l_v_e_D_y_n_a_m_i_c_M_u_l_t_i_I_n_d_e_x (C &&c, │ │ │ │ + const MultiIndex &multiIndex, const IsFinal &isFinal) │ │ │ │ +  Provide multi-index access by chaining operator[]. │ │ │ │ +template │ │ │ │ +constexpr decltype(auto)  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_r_e_s_o_l_v_e_D_y_n_a_m_i_c_M_u_l_t_i_I_n_d_e_x (C &&c, │ │ │ │ + const MultiIndex &multiIndex) │ │ │ │ +  Provide multi-index access by chaining operator[]. │ │ │ │ +template │ │ │ │ +constexpr decltype(auto)  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_r_e_s_o_l_v_e_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x (C &&c, │ │ │ │ + const MultiIndex &multiIndex) │ │ │ │ +  Provide multi-index access by chaining operator[]. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _s_u_b_s_p_a_c_e_l_o_c_a_l_v_i_e_w_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _i_n_d_e_x_a_c_c_e_s_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00083.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,3 +1,8 @@ │ │ │ │ var a00083 = [ │ │ │ │ - ["Dune::Functions::SubspaceLocalView< RLV, PP >", "a02146.html", "a02146"] │ │ │ │ + ["Dune::Functions::hybridIndexAccess", "a00314.html#gaf9258d92263effe55f9201af1ba2532e", null], │ │ │ │ + ["Dune::Functions::hybridIndexAccess", "a00314.html#ga2226fe3a86eb176df27c9801a98a10ae", null], │ │ │ │ + ["Dune::Functions::hybridMultiIndexAccess", "a00314.html#gabd5106817636cc5542dc4e9a1817551b", null], │ │ │ │ + ["Dune::Functions::resolveDynamicMultiIndex", "a00314.html#ga89fbdd009241b14e86b4fff7ba208a04", null], │ │ │ │ + ["Dune::Functions::resolveDynamicMultiIndex", "a00314.html#ga9aaec884c080483fea267d1098f81590", null], │ │ │ │ + ["Dune::Functions::resolveStaticMultiIndex", "a00314.html#ga4cc6af2842348271c242c048e0411637", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00083_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: subspacelocalview.hh Source File │ │ │ +Dune-Functions: indexaccess.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,195 +88,345 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
subspacelocalview.hh
│ │ │ +
indexaccess.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH
│ │ │ +
8#define DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH
│ │ │
9
│ │ │
10
│ │ │ -
11#include <tuple>
│ │ │ -
12
│ │ │ -
13#include <dune/common/concept.hh>
│ │ │ -
14
│ │ │ -
15#include <dune/common/typetree/childaccess.hh>
│ │ │ -
16
│ │ │ - │ │ │ -
18
│ │ │ +
11#include <utility>
│ │ │ +
12#include <type_traits>
│ │ │ +
13
│ │ │ +
14#include <dune/common/typetraits.hh>
│ │ │ +
15#include <dune/common/concept.hh>
│ │ │ +
16#include <dune/common/hybridutilities.hh>
│ │ │ +
17
│ │ │ + │ │ │
19
│ │ │
20
│ │ │ -
21namespace Dune {
│ │ │ -
22namespace Functions {
│ │ │ -
23
│ │ │ +
21
│ │ │ +
22namespace Dune {
│ │ │ +
23namespace Functions {
│ │ │
24
│ │ │
25
│ │ │ -
26template<class RB, class PP>
│ │ │ -
27class SubspaceBasis;
│ │ │ -
28
│ │ │ +
26namespace Imp {
│ │ │ +
27
│ │ │ +
28namespace Concept {
│ │ │
29
│ │ │ -
30
│ │ │ -
32template<class RLV, class PP>
│ │ │ -
│ │ │ - │ │ │ -
34{
│ │ │ -
35 using PrefixPath = PP;
│ │ │ -
36
│ │ │ -
37public:
│ │ │ +
30template<class size_type>
│ │ │ +
31struct HasDynamicIndexAccess
│ │ │ +
32{
│ │ │ +
33 template<class C>
│ │ │ +
34 auto require(C&& c) -> decltype(
│ │ │ +
35 c[std::declval<size_type>()]
│ │ │ +
36 );
│ │ │ +
37};
│ │ │
38
│ │ │ -
39 using RootLocalView = RLV;
│ │ │ -
40
│ │ │ - │ │ │ -
43
│ │ │ - │ │ │ -
46
│ │ │ -
48 using Element = typename GridView::template Codim<0>::Entity;
│ │ │ -
49
│ │ │ -
51 using size_type = std::size_t;
│ │ │ +
39struct HasStaticIndexAccess
│ │ │ +
40{
│ │ │ +
41 template<class C>
│ │ │ +
42 auto require(C&& c) -> decltype(
│ │ │ +
43 c[Dune::Indices::_0]
│ │ │ +
44 );
│ │ │ +
45};
│ │ │ +
46
│ │ │ +
47} // namespace Concept
│ │ │ +
48
│ │ │ +
49} // namespace Imp
│ │ │ +
50
│ │ │ +
51
│ │ │
52
│ │ │ -
54 using RootTree = typename RootLocalView::Tree;
│ │ │ -
55
│ │ │ -
57 using Tree = typename TypeTree::ChildForTreePath<RootTree, PrefixPath>;
│ │ │ -
58
│ │ │ -
60 using MultiIndex = typename RootLocalView::MultiIndex;
│ │ │ -
61
│ │ │ -
│ │ │ -
63 SubspaceLocalView(const GlobalBasis& globalBasis, const PrefixPath& /*prefixPath*/) :
│ │ │ - │ │ │ -
65 rootLocalView_(globalBasis.rootBasis().localView())
│ │ │ -
66 {
│ │ │ -
67// static_assert(models<Concept::BasisTree<GridView>, Tree>(), "Tree type passed to SubspaceLocalView does not model the BasisNode concept.");
│ │ │ -
68 }
│ │ │ -
│ │ │ -
69
│ │ │ -
│ │ │ -
75 void bind(const Element& e)
│ │ │ -
76 {
│ │ │ -
77 rootLocalView_.bind(e);
│ │ │ -
78 }
│ │ │ -
│ │ │ -
79
│ │ │ -
│ │ │ -
84 const Element& element() const
│ │ │ -
85 {
│ │ │ -
86 return rootLocalView_.element();
│ │ │ -
87 }
│ │ │ -
│ │ │ -
88
│ │ │ -
│ │ │ -
93 void unbind()
│ │ │ -
94 {
│ │ │ -
95 rootLocalView_.unbind();
│ │ │ -
96 }
│ │ │ -
│ │ │ -
97
│ │ │ -
│ │ │ -
100 bool bound() const
│ │ │ -
101 {
│ │ │ -
102 return rootLocalView_.bound();
│ │ │ -
103 }
│ │ │ -
│ │ │ -
104
│ │ │ -
│ │ │ -
109 const Tree& tree() const
│ │ │ -
110 {
│ │ │ -
111 return TypeTree::child(rootLocalView_.tree(), globalBasis_->prefixPath());
│ │ │ -
112 }
│ │ │ -
│ │ │ -
113
│ │ │ -
│ │ │ - │ │ │ -
117 {
│ │ │ -
118 return rootLocalView_.size();
│ │ │ -
119 }
│ │ │ -
│ │ │ -
120
│ │ │ -
│ │ │ - │ │ │ -
128 {
│ │ │ -
129 return rootLocalView_.maxSize();
│ │ │ -
130 }
│ │ │ -
│ │ │ -
131
│ │ │ -
│ │ │ - │ │ │ -
134 {
│ │ │ -
135 return rootLocalView_.index(i);
│ │ │ -
136 }
│ │ │ -
│ │ │ -
137
│ │ │ -
│ │ │ - │ │ │ -
141 {
│ │ │ -
142 return *globalBasis_;
│ │ │ -
143 }
│ │ │ -
│ │ │ -
144
│ │ │ -
│ │ │ - │ │ │ -
146 {
│ │ │ -
147 return rootLocalView_;
│ │ │ -
148 }
│ │ │ -
│ │ │ -
149
│ │ │ -
150protected:
│ │ │ - │ │ │ - │ │ │ -
153};
│ │ │ -
│ │ │ -
154
│ │ │ +
65template<class C, class I, class F,
│ │ │ +
66 std::enable_if_t< Dune::models<Imp::Concept::HasDynamicIndexAccess<I>, C>(), int> = 0>
│ │ │ +
│ │ │ +
67auto hybridIndexAccess(C&& c, const I& i, F&& f)
│ │ │ +
68 -> decltype(f(c[i]))
│ │ │ +
69{
│ │ │ +
70 return f(c[i]);
│ │ │ +
71}
│ │ │ +
│ │ │ +
72
│ │ │ +
90template<class C, class I, class F,
│ │ │ +
91 std::enable_if_t< not Dune::models<Imp::Concept::HasDynamicIndexAccess<I>, C>(), int> = 0>
│ │ │ +
│ │ │ +
92decltype(auto) hybridIndexAccess(C&& c, const I& i, F&& f)
│ │ │ +
93{
│ │ │ +
94 using Size = decltype(Hybrid::size(c));
│ │ │ +
95 return Hybrid::switchCases(std::make_index_sequence<Size::value>(), i,
│ │ │ +
96 [&](const auto& ii) -> decltype(auto){
│ │ │ +
97 return f(c[ii]);
│ │ │ +
98 }, [&]() -> decltype(auto){
│ │ │ +
99 return f(c[Dune::Indices::_0]);
│ │ │ +
100 });
│ │ │ +
101}
│ │ │ +
│ │ │ +
102
│ │ │ +
103
│ │ │ +
104namespace Imp {
│ │ │ +
105
│ │ │ +
119 template<class Index, std::size_t offset=1>
│ │ │ +
120 class ShiftedDynamicMultiIndex
│ │ │ +
121 {
│ │ │ +
122 public:
│ │ │ +
123 ShiftedDynamicMultiIndex(const Index& index) :
│ │ │ +
124 index_(index)
│ │ │ +
125 {}
│ │ │ +
126
│ │ │ +
127 std::size_t operator[](std::size_t position) const
│ │ │ +
128 {
│ │ │ +
129 if (position<size())
│ │ │ +
130 return index_[position+offset];
│ │ │ +
131 else
│ │ │ +
132 return 0;
│ │ │ +
133 }
│ │ │ +
134
│ │ │ +
138 ShiftedDynamicMultiIndex<Index, offset+1> pop() const
│ │ │ +
139 {
│ │ │ +
140 return {index_};
│ │ │ +
141 }
│ │ │ +
142
│ │ │ +
143 std::size_t size() const
│ │ │ +
144 {
│ │ │ +
145 if (offset < index_.size())
│ │ │ +
146 return index_.size() - offset;
│ │ │ +
147 else
│ │ │ +
148 return 0;
│ │ │ +
149 }
│ │ │ +
150
│ │ │ +
151 const Index& originalIndex() const
│ │ │ +
152 {
│ │ │ +
153 return index_;
│ │ │ +
154 }
│ │ │
155
│ │ │ -
156
│ │ │ -
157} // end namespace Functions
│ │ │ -
158} // end namespace Dune
│ │ │ +
156 private:
│ │ │ +
157 const Index& index_;
│ │ │ +
158 };
│ │ │
159
│ │ │ -
160
│ │ │ -
161
│ │ │ -
162#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH
│ │ │ +
160 template<class Index, std::size_t offset=1>
│ │ │ +
161 class ShiftedStaticMultiIndex
│ │ │ +
162 {
│ │ │ +
163 public:
│ │ │ +
164 ShiftedStaticMultiIndex(const Index& index) :
│ │ │ +
165 index_(index)
│ │ │ +
166 {}
│ │ │ +
167
│ │ │ +
168 template<std::size_t i>
│ │ │ +
169 auto operator[](Dune::index_constant<i>) const
│ │ │ +
170 {
│ │ │ +
171 if constexpr (i<size()) {
│ │ │ +
172 return index_[Dune::index_constant<i+offset>{}];
│ │ │ +
173 } else {
│ │ │ +
174 return Dune::index_constant<0>{};
│ │ │ +
175 }
│ │ │ +
176 }
│ │ │ +
177
│ │ │ +
181 ShiftedStaticMultiIndex<Index, offset+1> pop() const
│ │ │ +
182 {
│ │ │ +
183 return {index_};
│ │ │ +
184 }
│ │ │ +
185
│ │ │ +
186 static constexpr std::size_t size()
│ │ │ +
187 {
│ │ │ +
188 auto fullSize = decltype(Hybrid::size(std::declval<Index>()))::value;
│ │ │ +
189 if (offset < fullSize)
│ │ │ +
190 return fullSize - offset;
│ │ │ +
191 else
│ │ │ +
192 return 0;
│ │ │ +
193 }
│ │ │ +
194
│ │ │ +
195 private:
│ │ │ +
196 const Index& index_;
│ │ │ +
197 };
│ │ │ +
198
│ │ │ +
204 template<std::size_t offset, class Index>
│ │ │ +
205 ShiftedDynamicMultiIndex<Index, offset> shiftedDynamicMultiIndex(const Index& index)
│ │ │ +
206 {
│ │ │ +
207 return {index};
│ │ │ +
208 }
│ │ │ +
209
│ │ │ +
218 template<std::size_t offset, class Index, std::size_t oldOffset>
│ │ │ +
219 ShiftedDynamicMultiIndex<Index, offset+oldOffset> shiftedDynamicMultiIndex(const ShiftedDynamicMultiIndex<Index, oldOffset>& index)
│ │ │ +
220 {
│ │ │ +
221 return {index.originalIndex()};
│ │ │ +
222 }
│ │ │ +
223
│ │ │ +
224 template<std::size_t offset, class Index>
│ │ │ +
225 ShiftedStaticMultiIndex<Index, offset> shiftedStaticMultiIndex(const Index& index)
│ │ │ +
226 {
│ │ │ +
227 return {index};
│ │ │ +
228 }
│ │ │ +
229
│ │ │ +
230} // namespace Imp
│ │ │ +
231
│ │ │ +
232
│ │ │ +
233
│ │ │ +
234
│ │ │ +
235namespace Imp {
│ │ │ +
236
│ │ │ +
237template<class Result, class Index>
│ │ │ +
238struct MultiIndexResolver
│ │ │ +
239{
│ │ │ +
240 MultiIndexResolver(const Index& index) :
│ │ │ +
241 index_(index)
│ │ │ +
242 {}
│ │ │ +
243
│ │ │ +
244 template<class C,
│ │ │ +
245 std::enable_if_t<not std::is_convertible_v<C&, Result>, int> = 0>
│ │ │ +
246 Result operator()(C&& c)
│ │ │ +
247 {
│ │ │ +
248 auto&& subIndex = Imp::shiftedDynamicMultiIndex<1>(index_);
│ │ │ +
249 auto&& subIndexResolver = MultiIndexResolver<Result, decltype(subIndex)>(subIndex);
│ │ │ +
250 return (Result)(hybridIndexAccess(c, index_[Dune::Indices::_0], subIndexResolver));
│ │ │ +
251 }
│ │ │ +
252
│ │ │ +
253 template<class C,
│ │ │ +
254 std::enable_if_t<std::is_convertible_v<C&, Result>, int> = 0>
│ │ │ +
255 Result operator()(C&& c)
│ │ │ +
256 {
│ │ │ +
257 return (Result)(std::forward<C>(c));
│ │ │ +
258 }
│ │ │ +
259
│ │ │ +
260 const Index& index_;
│ │ │ +
261};
│ │ │ +
262
│ │ │ +
263} // namespace Imp
│ │ │ +
264
│ │ │ +
265
│ │ │ +
266
│ │ │ +
285template<class Result, class C, class MultiIndex>
│ │ │ +
│ │ │ +
286Result hybridMultiIndexAccess(C&& c, const MultiIndex& index)
│ │ │ +
287{
│ │ │ +
288
│ │ │ +
289 Imp::MultiIndexResolver<Result, MultiIndex> multiIndexResolver(index);
│ │ │ +
290 return multiIndexResolver(c);
│ │ │ +
291}
│ │ │ +
│ │ │ +
292
│ │ │ +
293
│ │ │ +
294
│ │ │ +
295
│ │ │ +
296
│ │ │ +
297
│ │ │ +
298namespace Imp {
│ │ │ +
299
│ │ │ +
300 template<class C, class MultiIndex, class IsFinal>
│ │ │ +
301 constexpr decltype(auto) resolveDynamicMultiIndex(C&& c, const MultiIndex& multiIndex, const IsFinal& isFinal)
│ │ │ +
302 {
│ │ │ +
303 // If c is already considered final simply return it,
│ │ │ +
304 // else resolve the next multiIndex entry.
│ │ │ +
305 return Hybrid::ifElse(isFinal(c), [&, c = forwardCapture(std::forward<C>(c))](auto) -> decltype(auto) {
│ │ │ +
306 assert(multiIndex.size() == 0);
│ │ │ +
307 return c.forward();
│ │ │ +
308 }, [&](auto) -> decltype(auto) {
│ │ │ +
309 auto hasDynamicAccess = callableCheck([](auto&& cc) -> std::void_t<decltype(cc[0])> {});
│ │ │ +
310
│ │ │ +
311 // Split multiIndex into first entry and remaining ones.
│ │ │ +
312 auto i = multiIndex[0];
│ │ │ +
313 auto tail = multiIndex.pop();
│ │ │ +
314
│ │ │ +
315 // Resolve first multiIndex entry by c[multiIndex[0]] and
│ │ │ +
316 // continue resolving with the remaining remaining ones.
│ │ │ +
317 // If c has a dynamic operator[] this is straight forward.
│ │ │ +
318 // Else the dynamic multiIndex[0] has to be translated into
│ │ │ +
319 // a static one using hybridIndexAccess.
│ │ │ +
320 return Hybrid::ifElse(hasDynamicAccess(c), [&](auto id) -> decltype(auto) {
│ │ │ +
321 return Imp::resolveDynamicMultiIndex(id(c)[i], tail, isFinal);
│ │ │ +
322 }, [&](auto id) -> decltype(auto) {
│ │ │ +
323 // auto indexRange = range(Hybrid::size(id(c)));
│ │ │ +
324 auto indexRange = typename decltype(range(Hybrid::size(id(c))))::integer_sequence();
│ │ │ +
325 return Hybrid::switchCases(indexRange, i, [&](auto static_i) -> decltype(auto){
│ │ │ +
326 // Do rescursion with static version of i
│ │ │ +
327 return Imp::resolveDynamicMultiIndex(id(c)[static_i], tail, isFinal);
│ │ │ +
328 }, [&]() -> decltype(auto){
│ │ │ +
329 // As fallback we use c[0] this is needed, because there must be one branch that matches.
│ │ │ +
330 return Imp::resolveDynamicMultiIndex(id(c)[Dune::Indices::_0], tail, isFinal);
│ │ │ +
331 });
│ │ │ +
332 });
│ │ │ +
333 });
│ │ │ +
334 }
│ │ │ +
335
│ │ │ +
336 template<class C, class MultiIndex>
│ │ │ +
337 constexpr decltype(auto) resolveStaticMultiIndex(C&& c, const MultiIndex& multiIndex)
│ │ │ +
338 {
│ │ │ +
339 auto isExhausted = Hybrid::equal_to(Hybrid::size(multiIndex), Dune::Indices::_0);
│ │ │ +
340 return Hybrid::ifElse(isExhausted, [&, c = forwardCapture(std::forward<C>(c))](auto) -> decltype(auto) {
│ │ │ +
341 return c.forward();
│ │ │ +
342 }, [&](auto id) -> decltype(auto) {
│ │ │ +
343 auto head = multiIndex[Dune::Indices::_0];
│ │ │ +
344 auto tail = multiIndex.pop();
│ │ │ +
345
│ │ │ +
346 return Imp::resolveStaticMultiIndex(id(c)[head], tail);
│ │ │ +
347 });
│ │ │ +
348 }
│ │ │ +
349
│ │ │ +
350} // namespace Imp
│ │ │ +
351
│ │ │ +
352
│ │ │ +
353
│ │ │ +
376template<class C, class MultiIndex, class IsFinal>
│ │ │ +
│ │ │ +
377constexpr decltype(auto) resolveDynamicMultiIndex(C&& c, const MultiIndex& multiIndex, const IsFinal& isFinal)
│ │ │ +
378{
│ │ │ +
379 return Imp::resolveDynamicMultiIndex(std::forward<C>(c), Imp::shiftedDynamicMultiIndex<0>(multiIndex), isFinal);
│ │ │ +
380}
│ │ │ +
│ │ │ +
381
│ │ │ +
398template<class C, class MultiIndex>
│ │ │ +
│ │ │ +
399constexpr decltype(auto) resolveDynamicMultiIndex(C&& c, const MultiIndex& multiIndex)
│ │ │ +
400{
│ │ │ +
401 auto hasNoIndexAccess = negatePredicate(callableCheck([](auto&& cc) -> std::void_t<decltype(cc[Dune::Indices::_0])> {}));
│ │ │ +
402 return Imp::resolveDynamicMultiIndex(std::forward<C>(c), Imp::shiftedDynamicMultiIndex<0>(multiIndex), hasNoIndexAccess);
│ │ │ +
403}
│ │ │ +
│ │ │ +
404
│ │ │ +
420template<class C, class MultiIndex>
│ │ │ +
│ │ │ +
421constexpr decltype(auto) resolveStaticMultiIndex(C&& c, const MultiIndex& multiIndex)
│ │ │ +
422{
│ │ │ +
423 return Imp::resolveStaticMultiIndex(std::forward<C>(c), Imp::shiftedStaticMultiIndex<0>(multiIndex));
│ │ │ +
424}
│ │ │ +
│ │ │ +
425
│ │ │ +
426
│ │ │ +
427
│ │ │ +
428} // namespace Dune::Functions
│ │ │ +
429} // namespace Dune
│ │ │ +
430
│ │ │ +
431
│ │ │ +
432
│ │ │ +
433#endif // DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH
│ │ │ + │ │ │ +
auto hybridIndexAccess(C &&c, const I &i, F &&f) -> decltype(f(c[i]))
Provide operator[] index-access for containers.
Definition indexaccess.hh:67
│ │ │ +
constexpr decltype(auto) resolveStaticMultiIndex(C &&c, const MultiIndex &multiIndex)
Provide multi-index access by chaining operator[].
Definition indexaccess.hh:421
│ │ │ +
auto callableCheck(Expression f)
Create a predicate for checking validity of expressions.
Definition utility.hh:287
│ │ │ +
constexpr decltype(auto) resolveDynamicMultiIndex(C &&c, const MultiIndex &multiIndex, const IsFinal &isFinal)
Provide multi-index access by chaining operator[].
Definition indexaccess.hh:377
│ │ │ +
Result hybridMultiIndexAccess(C &&c, const MultiIndex &index)
Provide multi-index access by chaining operator[].
Definition indexaccess.hh:286
│ │ │ +
auto negatePredicate(Check check)
Negate given predicate.
Definition utility.hh:312
│ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
Definition subspacebasis.hh:29
│ │ │ -
typename RootBasis::GridView GridView
Definition subspacebasis.hh:39
│ │ │ -
typename TypeTree::ChildForTreePath< RootTree, PrefixPath > Tree
Definition subspacelocalview.hh:57
│ │ │ -
void unbind()
Unbind from the current element.
Definition subspacelocalview.hh:93
│ │ │ -
const Element & element() const
Return the grid element that the view is bound to.
Definition subspacelocalview.hh:84
│ │ │ -
const GlobalBasis * globalBasis_
Definition subspacelocalview.hh:151
│ │ │ -
bool bound() const
Return if the view is bound to a grid element.
Definition subspacelocalview.hh:100
│ │ │ -
typename RootLocalView::MultiIndex MultiIndex
Definition subspacelocalview.hh:60
│ │ │ -
SubspaceBasis< typename RootLocalView::GlobalBasis, PrefixPath > GlobalBasis
Definition subspacelocalview.hh:42
│ │ │ -
size_type size() const
Total number of degrees of freedom on this element.
Definition subspacelocalview.hh:116
│ │ │ -
RootLocalView rootLocalView_
Definition subspacelocalview.hh:152
│ │ │ -
void bind(const Element &e)
Bind the view to a grid element.
Definition subspacelocalview.hh:75
│ │ │ -
typename GlobalBasis::GridView GridView
Definition subspacelocalview.hh:45
│ │ │ -
SubspaceLocalView(const GlobalBasis &globalBasis, const PrefixPath &)
Construct local view for a given global finite element basis.
Definition subspacelocalview.hh:63
│ │ │ -
RootLocalView RootLocalView
Definition subspacelocalview.hh:39
│ │ │ -
const RootLocalView & rootLocalView() const
Definition subspacelocalview.hh:145
│ │ │ -
std::size_t size_type
Definition subspacelocalview.hh:51
│ │ │ -
typename GridView::template Codim< 0 >::Entity Element
Definition subspacelocalview.hh:48
│ │ │ -
const GlobalBasis & globalBasis() const
Definition subspacelocalview.hh:140
│ │ │ -
size_type maxSize() const
Maximum local size for any element on the GridView.
Definition subspacelocalview.hh:127
│ │ │ -
const Tree & tree() const
Return the local ansatz tree associated to the bound entity.
Definition subspacelocalview.hh:109
│ │ │ -
MultiIndex index(size_type i) const
Maps from subtree index set [0..size-1] to a globally unique multi index in global basis.
Definition subspacelocalview.hh:133
│ │ │ -
typename RootLocalView::Tree RootTree
Definition subspacelocalview.hh:54
│ │ │ - │ │ │ +
auto forwardCapture(T &&t)
Create a capture object for perfect forwarding.
Definition utility.hh:380
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,223 +1,373 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -subspacelocalview.hh │ │ │ │ +indexaccess.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH │ │ │ │ +8#define DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH │ │ │ │ 9 │ │ │ │ 10 │ │ │ │ -11#include │ │ │ │ -12 │ │ │ │ -13#include │ │ │ │ -14 │ │ │ │ -15#include │ │ │ │ -16 │ │ │ │ -17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ -18 │ │ │ │ +11#include │ │ │ │ +12#include │ │ │ │ +13 │ │ │ │ +14#include │ │ │ │ +15#include │ │ │ │ +16#include │ │ │ │ +17 │ │ │ │ +18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ 19 │ │ │ │ 20 │ │ │ │ -21namespace _D_u_n_e { │ │ │ │ -22namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -23 │ │ │ │ +21 │ │ │ │ +22namespace _D_u_n_e { │ │ │ │ +23namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ 24 │ │ │ │ 25 │ │ │ │ -26template │ │ │ │ -27class _S_u_b_s_p_a_c_e_B_a_s_i_s; │ │ │ │ -28 │ │ │ │ +26namespace Imp { │ │ │ │ +27 │ │ │ │ +28namespace Concept { │ │ │ │ 29 │ │ │ │ -30 │ │ │ │ -32template │ │ │ │ -_3_3class _S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w │ │ │ │ -34{ │ │ │ │ -35 using PrefixPath = PP; │ │ │ │ -36 │ │ │ │ -37public: │ │ │ │ +30template │ │ │ │ +31struct HasDynamicIndexAccess │ │ │ │ +32{ │ │ │ │ +33 template │ │ │ │ +34 auto require(C&& c) -> decltype( │ │ │ │ +35 c[std::declval()] │ │ │ │ +36 ); │ │ │ │ +37}; │ │ │ │ 38 │ │ │ │ -_3_9 using _R_o_o_t_L_o_c_a_l_V_i_e_w = RLV; │ │ │ │ -40 │ │ │ │ -_4_2 using _G_l_o_b_a_l_B_a_s_i_s = _S_u_b_s_p_a_c_e_B_a_s_i_s_<_t_y_p_e_n_a_m_e_ _R_o_o_t_L_o_c_a_l_V_i_e_w_:_:_G_l_o_b_a_l_B_a_s_i_s_, │ │ │ │ -_P_r_e_f_i_x_P_a_t_h_>; │ │ │ │ -43 │ │ │ │ -_4_5 using _G_r_i_d_V_i_e_w = typename _G_l_o_b_a_l_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w; │ │ │ │ +39struct HasStaticIndexAccess │ │ │ │ +40{ │ │ │ │ +41 template │ │ │ │ +42 auto require(C&& c) -> decltype( │ │ │ │ +43 c[Dune::Indices::_0] │ │ │ │ +44 ); │ │ │ │ +45}; │ │ │ │ 46 │ │ │ │ -_4_8 using _E_l_e_m_e_n_t = typename GridView::template Codim<0>::Entity; │ │ │ │ -49 │ │ │ │ -_5_1 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ +47} // namespace Concept │ │ │ │ +48 │ │ │ │ +49} // namespace Imp │ │ │ │ +50 │ │ │ │ +51 │ │ │ │ 52 │ │ │ │ -_5_4 using _R_o_o_t_T_r_e_e = typename RootLocalView::Tree; │ │ │ │ -55 │ │ │ │ -_5_7 using _T_r_e_e = typename TypeTree::ChildForTreePath; │ │ │ │ -58 │ │ │ │ -_6_0 using _M_u_l_t_i_I_n_d_e_x = typename RootLocalView::MultiIndex; │ │ │ │ -61 │ │ │ │ -_6_3 _S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w(const _G_l_o_b_a_l_B_a_s_i_s& _g_l_o_b_a_l_B_a_s_i_s, const PrefixPath& / │ │ │ │ -*prefixPath*/) : │ │ │ │ -64 _g_l_o_b_a_l_B_a_s_i_s__(&_g_l_o_b_a_l_B_a_s_i_s), │ │ │ │ -65 _r_o_o_t_L_o_c_a_l_V_i_e_w__(_g_l_o_b_a_l_B_a_s_i_s.rootBasis().localView()) │ │ │ │ -66 { │ │ │ │ -67// static_assert(models, Tree>(), "Tree type │ │ │ │ -passed to SubspaceLocalView does not model the BasisNode concept."); │ │ │ │ -68 } │ │ │ │ -69 │ │ │ │ -_7_5 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ -76 { │ │ │ │ -77 _r_o_o_t_L_o_c_a_l_V_i_e_w__.bind(e); │ │ │ │ -78 } │ │ │ │ -79 │ │ │ │ -_8_4 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ -85 { │ │ │ │ -86 return _r_o_o_t_L_o_c_a_l_V_i_e_w__.element(); │ │ │ │ -87 } │ │ │ │ -88 │ │ │ │ -_9_3 void _u_n_b_i_n_d() │ │ │ │ -94 { │ │ │ │ -95 _r_o_o_t_L_o_c_a_l_V_i_e_w__.unbind(); │ │ │ │ -96 } │ │ │ │ -97 │ │ │ │ -_1_0_0 bool _b_o_u_n_d() const │ │ │ │ -101 { │ │ │ │ -102 return _r_o_o_t_L_o_c_a_l_V_i_e_w__.bound(); │ │ │ │ -103 } │ │ │ │ -104 │ │ │ │ -_1_0_9 const _T_r_e_e& _t_r_e_e() const │ │ │ │ -110 { │ │ │ │ -111 return TypeTree::child(_r_o_o_t_L_o_c_a_l_V_i_e_w__.tree(), _g_l_o_b_a_l_B_a_s_i_s__->prefixPath()); │ │ │ │ -112 } │ │ │ │ -113 │ │ │ │ -_1_1_6 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ -117 { │ │ │ │ -118 return _r_o_o_t_L_o_c_a_l_V_i_e_w__.size(); │ │ │ │ -119 } │ │ │ │ -120 │ │ │ │ -_1_2_7 _s_i_z_e___t_y_p_e _m_a_x_S_i_z_e() const │ │ │ │ +65template, C>(), │ │ │ │ +int> = 0> │ │ │ │ +_6_7auto _h_y_b_r_i_d_I_n_d_e_x_A_c_c_e_s_s(C&& c, const I& i, F&& f) │ │ │ │ +68 -> decltype(f(c[i])) │ │ │ │ +69{ │ │ │ │ +70 return f(c[i]); │ │ │ │ +71} │ │ │ │ +72 │ │ │ │ +90template, │ │ │ │ +C>(), int> = 0> │ │ │ │ +_9_2decltype(auto) _h_y_b_r_i_d_I_n_d_e_x_A_c_c_e_s_s(C&& c, const I& i, F&& f) │ │ │ │ +93{ │ │ │ │ +94 using Size = decltype(Hybrid::size(c)); │ │ │ │ +95 return Hybrid::switchCases(std::make_index_sequence(), i, │ │ │ │ +96 [&](const auto& ii) -> decltype(auto){ │ │ │ │ +97 return f(c[ii]); │ │ │ │ +98 }, [&]() -> decltype(auto){ │ │ │ │ +99 return f(c[Dune::Indices::_0]); │ │ │ │ +100 }); │ │ │ │ +101} │ │ │ │ +102 │ │ │ │ +103 │ │ │ │ +104namespace Imp { │ │ │ │ +105 │ │ │ │ +119 template │ │ │ │ +120 class ShiftedDynamicMultiIndex │ │ │ │ +121 { │ │ │ │ +122 public: │ │ │ │ +123 ShiftedDynamicMultiIndex(const Index& index) : │ │ │ │ +124 index_(index) │ │ │ │ +125 {} │ │ │ │ +126 │ │ │ │ +127 std::size_t operator[](std::size_t position) const │ │ │ │ 128 { │ │ │ │ -129 return _r_o_o_t_L_o_c_a_l_V_i_e_w__.maxSize(); │ │ │ │ -130 } │ │ │ │ -131 │ │ │ │ -_1_3_3 _M_u_l_t_i_I_n_d_e_x _i_n_d_e_x(_s_i_z_e___t_y_p_e i) const │ │ │ │ -134 { │ │ │ │ -135 return _r_o_o_t_L_o_c_a_l_V_i_e_w__.index(i); │ │ │ │ -136 } │ │ │ │ -137 │ │ │ │ -_1_4_0 const _G_l_o_b_a_l_B_a_s_i_s& _g_l_o_b_a_l_B_a_s_i_s() const │ │ │ │ -141 { │ │ │ │ -142 return *_g_l_o_b_a_l_B_a_s_i_s__; │ │ │ │ -143 } │ │ │ │ -144 │ │ │ │ -_1_4_5 const _R_o_o_t_L_o_c_a_l_V_i_e_w& _r_o_o_t_L_o_c_a_l_V_i_e_w() const │ │ │ │ -146 { │ │ │ │ -147 return _r_o_o_t_L_o_c_a_l_V_i_e_w__; │ │ │ │ -148 } │ │ │ │ -149 │ │ │ │ -150protected: │ │ │ │ -_1_5_1 const _G_l_o_b_a_l_B_a_s_i_s* _g_l_o_b_a_l_B_a_s_i_s__; │ │ │ │ -_1_5_2 _R_o_o_t_L_o_c_a_l_V_i_e_w _r_o_o_t_L_o_c_a_l_V_i_e_w__; │ │ │ │ -153}; │ │ │ │ -154 │ │ │ │ +129 if (position pop() const │ │ │ │ +139 { │ │ │ │ +140 return {index_}; │ │ │ │ +141 } │ │ │ │ +142 │ │ │ │ +143 std::size_t size() const │ │ │ │ +144 { │ │ │ │ +145 if (offset < index_.size()) │ │ │ │ +146 return index_.size() - offset; │ │ │ │ +147 else │ │ │ │ +148 return 0; │ │ │ │ +149 } │ │ │ │ +150 │ │ │ │ +151 const Index& originalIndex() const │ │ │ │ +152 { │ │ │ │ +153 return index_; │ │ │ │ +154 } │ │ │ │ 155 │ │ │ │ -156 │ │ │ │ -157} // end namespace Functions │ │ │ │ -158} // end namespace Dune │ │ │ │ +156 private: │ │ │ │ +157 const Index& index_; │ │ │ │ +158 }; │ │ │ │ 159 │ │ │ │ -160 │ │ │ │ -161 │ │ │ │ -162#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH │ │ │ │ +160 template │ │ │ │ +161 class ShiftedStaticMultiIndex │ │ │ │ +162 { │ │ │ │ +163 public: │ │ │ │ +164 ShiftedStaticMultiIndex(const Index& index) : │ │ │ │ +165 index_(index) │ │ │ │ +166 {} │ │ │ │ +167 │ │ │ │ +168 template │ │ │ │ +169 auto operator[](Dune::index_constant) const │ │ │ │ +170 { │ │ │ │ +171 if constexpr (i{}]; │ │ │ │ +173 } else { │ │ │ │ +174 return Dune::index_constant<0>{}; │ │ │ │ +175 } │ │ │ │ +176 } │ │ │ │ +177 │ │ │ │ +181 ShiftedStaticMultiIndex pop() const │ │ │ │ +182 { │ │ │ │ +183 return {index_}; │ │ │ │ +184 } │ │ │ │ +185 │ │ │ │ +186 static constexpr std::size_t size() │ │ │ │ +187 { │ │ │ │ +188 auto fullSize = decltype(Hybrid::size(std::declval()))::value; │ │ │ │ +189 if (offset < fullSize) │ │ │ │ +190 return fullSize - offset; │ │ │ │ +191 else │ │ │ │ +192 return 0; │ │ │ │ +193 } │ │ │ │ +194 │ │ │ │ +195 private: │ │ │ │ +196 const Index& index_; │ │ │ │ +197 }; │ │ │ │ +198 │ │ │ │ +204 template │ │ │ │ +205 ShiftedDynamicMultiIndex shiftedDynamicMultiIndex(const │ │ │ │ +Index& index) │ │ │ │ +206 { │ │ │ │ +207 return {index}; │ │ │ │ +208 } │ │ │ │ +209 │ │ │ │ +218 template │ │ │ │ +219 ShiftedDynamicMultiIndex shiftedDynamicMultiIndex │ │ │ │ +(const ShiftedDynamicMultiIndex& index) │ │ │ │ +220 { │ │ │ │ +221 return {index.originalIndex()}; │ │ │ │ +222 } │ │ │ │ +223 │ │ │ │ +224 template │ │ │ │ +225 ShiftedStaticMultiIndex shiftedStaticMultiIndex(const Index& │ │ │ │ +index) │ │ │ │ +226 { │ │ │ │ +227 return {index}; │ │ │ │ +228 } │ │ │ │ +229 │ │ │ │ +230} // namespace Imp │ │ │ │ +231 │ │ │ │ +232 │ │ │ │ +233 │ │ │ │ +234 │ │ │ │ +235namespace Imp { │ │ │ │ +236 │ │ │ │ +237template │ │ │ │ +238struct MultiIndexResolver │ │ │ │ +239{ │ │ │ │ +240 MultiIndexResolver(const Index& index) : │ │ │ │ +241 index_(index) │ │ │ │ +242 {} │ │ │ │ +243 │ │ │ │ +244 template, int> = 0> │ │ │ │ +246 Result operator()(C&& c) │ │ │ │ +247 { │ │ │ │ +248 auto&& subIndex = Imp::shiftedDynamicMultiIndex<1>(index_); │ │ │ │ +249 auto&& subIndexResolver = MultiIndexResolver │ │ │ │ +(subIndex); │ │ │ │ +250 return (Result)(_h_y_b_r_i_d_I_n_d_e_x_A_c_c_e_s_s(c, index_[Dune::Indices::_0], │ │ │ │ +subIndexResolver)); │ │ │ │ +251 } │ │ │ │ +252 │ │ │ │ +253 template, int> = 0> │ │ │ │ +255 Result operator()(C&& c) │ │ │ │ +256 { │ │ │ │ +257 return (Result)(std::forward(c)); │ │ │ │ +258 } │ │ │ │ +259 │ │ │ │ +260 const Index& index_; │ │ │ │ +261}; │ │ │ │ +262 │ │ │ │ +263} // namespace Imp │ │ │ │ +264 │ │ │ │ +265 │ │ │ │ +266 │ │ │ │ +285template │ │ │ │ +_2_8_6Result _h_y_b_r_i_d_M_u_l_t_i_I_n_d_e_x_A_c_c_e_s_s(C&& c, const MultiIndex& index) │ │ │ │ +287{ │ │ │ │ +288 │ │ │ │ +289 Imp::MultiIndexResolver multiIndexResolver(index); │ │ │ │ +290 return multiIndexResolver(c); │ │ │ │ +291} │ │ │ │ +292 │ │ │ │ +293 │ │ │ │ +294 │ │ │ │ +295 │ │ │ │ +296 │ │ │ │ +297 │ │ │ │ +298namespace Imp { │ │ │ │ +299 │ │ │ │ +300 template │ │ │ │ +301 constexpr decltype(auto) resolveDynamicMultiIndex(C&& c, const MultiIndex& │ │ │ │ +multiIndex, const IsFinal& isFinal) │ │ │ │ +302 { │ │ │ │ +303 // If c is already considered final simply return it, │ │ │ │ +304 // else resolve the next multiIndex entry. │ │ │ │ +305 return Hybrid::ifElse(isFinal(c), [&, c = _f_o_r_w_a_r_d_C_a_p_t_u_r_e(std::forward │ │ │ │ +(c))](auto) -> decltype(auto) { │ │ │ │ +306 assert(multiIndex.size() == 0); │ │ │ │ +307 return c.forward(); │ │ │ │ +308 }, [&](auto) -> decltype(auto) { │ │ │ │ +309 auto hasDynamicAccess = _c_a_l_l_a_b_l_e_C_h_e_c_k([](auto&& cc) -> std::void_t {}); │ │ │ │ +310 │ │ │ │ +311 // Split multiIndex into first entry and remaining ones. │ │ │ │ +312 auto i = multiIndex[0]; │ │ │ │ +313 auto tail = multiIndex.pop(); │ │ │ │ +314 │ │ │ │ +315 // Resolve first multiIndex entry by c[multiIndex[0]] and │ │ │ │ +316 // continue resolving with the remaining remaining ones. │ │ │ │ +317 // If c has a dynamic operator[] this is straight forward. │ │ │ │ +318 // Else the dynamic multiIndex[0] has to be translated into │ │ │ │ +319 // a static one using hybridIndexAccess. │ │ │ │ +320 return Hybrid::ifElse(hasDynamicAccess(c), [&](auto id) -> decltype(auto) { │ │ │ │ +321 return Imp::resolveDynamicMultiIndex(id(c)[i], tail, isFinal); │ │ │ │ +322 }, [&](auto id) -> decltype(auto) { │ │ │ │ +323 // auto indexRange = range(Hybrid::size(id(c))); │ │ │ │ +324 auto indexRange = typename decltype(range(Hybrid::size(id(c)))):: │ │ │ │ +integer_sequence(); │ │ │ │ +325 return Hybrid::switchCases(indexRange, i, [&](auto static_i) -> decltype │ │ │ │ +(auto){ │ │ │ │ +326 // Do rescursion with static version of i │ │ │ │ +327 return Imp::resolveDynamicMultiIndex(id(c)[static_i], tail, isFinal); │ │ │ │ +328 }, [&]() -> decltype(auto){ │ │ │ │ +329 // As fallback we use c[0] this is needed, because there must be one branch │ │ │ │ +that matches. │ │ │ │ +330 return Imp::resolveDynamicMultiIndex(id(c)[Dune::Indices::_0], tail, │ │ │ │ +isFinal); │ │ │ │ +331 }); │ │ │ │ +332 }); │ │ │ │ +333 }); │ │ │ │ +334 } │ │ │ │ +335 │ │ │ │ +336 template │ │ │ │ +337 constexpr decltype(auto) resolveStaticMultiIndex(C&& c, const MultiIndex& │ │ │ │ +multiIndex) │ │ │ │ +338 { │ │ │ │ +339 auto isExhausted = Hybrid::equal_to(Hybrid::size(multiIndex), Dune:: │ │ │ │ +Indices::_0); │ │ │ │ +340 return Hybrid::ifElse(isExhausted, [&, c = _f_o_r_w_a_r_d_C_a_p_t_u_r_e(std::forward │ │ │ │ +(c))](auto) -> decltype(auto) { │ │ │ │ +341 return c.forward(); │ │ │ │ +342 }, [&](auto id) -> decltype(auto) { │ │ │ │ +343 auto head = multiIndex[Dune::Indices::_0]; │ │ │ │ +344 auto tail = multiIndex.pop(); │ │ │ │ +345 │ │ │ │ +346 return Imp::resolveStaticMultiIndex(id(c)[head], tail); │ │ │ │ +347 }); │ │ │ │ +348 } │ │ │ │ +349 │ │ │ │ +350} // namespace Imp │ │ │ │ +351 │ │ │ │ +352 │ │ │ │ +353 │ │ │ │ +376template │ │ │ │ +_3_7_7constexpr decltype(auto) _r_e_s_o_l_v_e_D_y_n_a_m_i_c_M_u_l_t_i_I_n_d_e_x(C&& c, const MultiIndex& │ │ │ │ +multiIndex, const IsFinal& isFinal) │ │ │ │ +378{ │ │ │ │ +379 return Imp::resolveDynamicMultiIndex(std::forward(c), Imp:: │ │ │ │ +shiftedDynamicMultiIndex<0>(multiIndex), isFinal); │ │ │ │ +380} │ │ │ │ +381 │ │ │ │ +398template │ │ │ │ +_3_9_9constexpr decltype(auto) _r_e_s_o_l_v_e_D_y_n_a_m_i_c_M_u_l_t_i_I_n_d_e_x(C&& c, const MultiIndex& │ │ │ │ +multiIndex) │ │ │ │ +400{ │ │ │ │ +401 auto hasNoIndexAccess = _n_e_g_a_t_e_P_r_e_d_i_c_a_t_e(_c_a_l_l_a_b_l_e_C_h_e_c_k([](auto&& cc) - │ │ │ │ +> std::void_t {})); │ │ │ │ +402 return Imp::resolveDynamicMultiIndex(std::forward(c), Imp:: │ │ │ │ +shiftedDynamicMultiIndex<0>(multiIndex), hasNoIndexAccess); │ │ │ │ +403} │ │ │ │ +404 │ │ │ │ +420template │ │ │ │ +_4_2_1constexpr decltype(auto) _r_e_s_o_l_v_e_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x(C&& c, const MultiIndex& │ │ │ │ +multiIndex) │ │ │ │ +422{ │ │ │ │ +423 return Imp::resolveStaticMultiIndex(std::forward(c), Imp:: │ │ │ │ +shiftedStaticMultiIndex<0>(multiIndex)); │ │ │ │ +424} │ │ │ │ +425 │ │ │ │ +426 │ │ │ │ +427 │ │ │ │ +428} // namespace Dune::Functions │ │ │ │ +429} // namespace Dune │ │ │ │ +430 │ │ │ │ +431 │ │ │ │ +432 │ │ │ │ +433#endif // DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH │ │ │ │ +_u_t_i_l_i_t_y_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_h_y_b_r_i_d_I_n_d_e_x_A_c_c_e_s_s │ │ │ │ +auto hybridIndexAccess(C &&c, const I &i, F &&f) -> decltype(f(c[i])) │ │ │ │ +Provide operator[] index-access for containers. │ │ │ │ +DDeeffiinniittiioonn indexaccess.hh:67 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_r_e_s_o_l_v_e_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x │ │ │ │ +constexpr decltype(auto) resolveStaticMultiIndex(C &&c, const MultiIndex │ │ │ │ +&multiIndex) │ │ │ │ +Provide multi-index access by chaining operator[]. │ │ │ │ +DDeeffiinniittiioonn indexaccess.hh:421 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_a_l_l_a_b_l_e_C_h_e_c_k │ │ │ │ +auto callableCheck(Expression f) │ │ │ │ +Create a predicate for checking validity of expressions. │ │ │ │ +DDeeffiinniittiioonn utility.hh:287 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_r_e_s_o_l_v_e_D_y_n_a_m_i_c_M_u_l_t_i_I_n_d_e_x │ │ │ │ +constexpr decltype(auto) resolveDynamicMultiIndex(C &&c, const MultiIndex │ │ │ │ +&multiIndex, const IsFinal &isFinal) │ │ │ │ +Provide multi-index access by chaining operator[]. │ │ │ │ +DDeeffiinniittiioonn indexaccess.hh:377 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_h_y_b_r_i_d_M_u_l_t_i_I_n_d_e_x_A_c_c_e_s_s │ │ │ │ +Result hybridMultiIndexAccess(C &&c, const MultiIndex &index) │ │ │ │ +Provide multi-index access by chaining operator[]. │ │ │ │ +DDeeffiinniittiioonn indexaccess.hh:286 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_n_e_g_a_t_e_P_r_e_d_i_c_a_t_e │ │ │ │ +auto negatePredicate(Check check) │ │ │ │ +Negate given predicate. │ │ │ │ +DDeeffiinniittiioonn utility.hh:312 │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:29 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s_<_ _t_y_p_e_n_a_m_e_ _R_o_o_t_L_o_c_a_l_V_i_e_w_:_:_G_l_o_b_a_l_B_a_s_i_s_,_ _P_r_e_f_i_x_P_a_t_h │ │ │ │ -_>_:_:_G_r_i_d_V_i_e_w │ │ │ │ -typename RootBasis::GridView GridView │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:39 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_<_ _R_o_o_t_L_o_c_a_l_V_i_e_w_,_ _P_r_e_f_i_x_P_a_t_h_ _>_:_:_T_r_e_e │ │ │ │ -typename TypeTree::ChildForTreePath< RootTree, PrefixPath > Tree │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:57 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_:_:_u_n_b_i_n_d │ │ │ │ -void unbind() │ │ │ │ -Unbind from the current element. │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:93 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_:_:_e_l_e_m_e_n_t │ │ │ │ -const Element & element() const │ │ │ │ -Return the grid element that the view is bound to. │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:84 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_<_ _R_o_o_t_L_o_c_a_l_V_i_e_w_,_ _P_r_e_f_i_x_P_a_t_h_ _>_:_:_g_l_o_b_a_l_B_a_s_i_s__ │ │ │ │ -const GlobalBasis * globalBasis_ │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:151 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_:_:_b_o_u_n_d │ │ │ │ -bool bound() const │ │ │ │ -Return if the view is bound to a grid element. │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:100 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_<_ _R_o_o_t_L_o_c_a_l_V_i_e_w_,_ _P_r_e_f_i_x_P_a_t_h_ _>_:_:_M_u_l_t_i_I_n_d_e_x │ │ │ │ -typename RootLocalView::MultiIndex MultiIndex │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:60 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_<_ _R_o_o_t_L_o_c_a_l_V_i_e_w_,_ _P_r_e_f_i_x_P_a_t_h_ _>_:_:_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ -SubspaceBasis< typename RootLocalView::GlobalBasis, PrefixPath > GlobalBasis │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:42 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_:_:_s_i_z_e │ │ │ │ -size_type size() const │ │ │ │ -Total number of degrees of freedom on this element. │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:116 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_<_ _R_o_o_t_L_o_c_a_l_V_i_e_w_,_ _P_r_e_f_i_x_P_a_t_h_ _>_:_:_r_o_o_t_L_o_c_a_l_V_i_e_w__ │ │ │ │ -RootLocalView rootLocalView_ │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:152 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_:_:_b_i_n_d │ │ │ │ -void bind(const Element &e) │ │ │ │ -Bind the view to a grid element. │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:75 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_<_ _R_o_o_t_L_o_c_a_l_V_i_e_w_,_ _P_r_e_f_i_x_P_a_t_h_ _>_:_:_G_r_i_d_V_i_e_w │ │ │ │ -typename GlobalBasis::GridView GridView │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:45 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w │ │ │ │ -SubspaceLocalView(const GlobalBasis &globalBasis, const PrefixPath &) │ │ │ │ -Construct local view for a given global finite element basis. │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:63 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_<_ _R_o_o_t_L_o_c_a_l_V_i_e_w_,_ _P_r_e_f_i_x_P_a_t_h_ _>_:_:_R_o_o_t_L_o_c_a_l_V_i_e_w │ │ │ │ -RootLocalView RootLocalView │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:39 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_:_:_r_o_o_t_L_o_c_a_l_V_i_e_w │ │ │ │ -const RootLocalView & rootLocalView() const │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:145 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_<_ _R_o_o_t_L_o_c_a_l_V_i_e_w_,_ _P_r_e_f_i_x_P_a_t_h_ _>_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:51 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_<_ _R_o_o_t_L_o_c_a_l_V_i_e_w_,_ _P_r_e_f_i_x_P_a_t_h_ _>_:_:_E_l_e_m_e_n_t │ │ │ │ -typename GridView::template Codim< 0 >::Entity Element │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:48 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_<_ _R_o_o_t_L_o_c_a_l_V_i_e_w_,_ _P_r_e_f_i_x_P_a_t_h_ _>_:_:_g_l_o_b_a_l_B_a_s_i_s │ │ │ │ -const GlobalBasis & globalBasis() const │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:140 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_:_:_m_a_x_S_i_z_e │ │ │ │ -size_type maxSize() const │ │ │ │ -Maximum local size for any element on the GridView. │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:127 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_:_:_t_r_e_e │ │ │ │ -const Tree & tree() const │ │ │ │ -Return the local ansatz tree associated to the bound entity. │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:109 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_:_:_i_n_d_e_x │ │ │ │ -MultiIndex index(size_type i) const │ │ │ │ -Maps from subtree index set [0..size-1] to a globally unique multi index in │ │ │ │ -global basis. │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:133 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_<_ _R_o_o_t_L_o_c_a_l_V_i_e_w_,_ _P_r_e_f_i_x_P_a_t_h_ _>_:_:_R_o_o_t_T_r_e_e │ │ │ │ -typename RootLocalView::Tree RootTree │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:54 │ │ │ │ -_c_o_n_c_e_p_t_s_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_o_r_w_a_r_d_C_a_p_t_u_r_e │ │ │ │ +auto forwardCapture(T &&t) │ │ │ │ +Create a capture object for perfect forwarding. │ │ │ │ +DDeeffiinniittiioonn utility.hh:380 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _s_u_b_s_p_a_c_e_l_o_c_a_l_v_i_e_w_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _i_n_d_e_x_a_c_c_e_s_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00086.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: subspacebasis.hh File Reference │ │ │ +Dune-Functions: differentiablefunctionfromcallables.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,60 +88,55 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
subspacebasis.hh File Reference
│ │ │ +
differentiablefunctionfromcallables.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <dune/common/reservedvector.hh>
│ │ │ -#include <dune/common/typeutilities.hh>
│ │ │ -#include <dune/common/concept.hh>
│ │ │ -#include <dune/common/typetree/treepath.hh>
│ │ │ -#include <dune/functions/common/type_traits.hh>
│ │ │ -#include <dune/functions/functionspacebases/subspacelocalview.hh>
│ │ │ -#include <dune/functions/functionspacebases/concepts.hh>
│ │ │ +
#include <dune/common/typeutilities.hh>
│ │ │ +#include <dune/common/hybridutilities.hh>
│ │ │ +#include <dune/functions/common/signature.hh>
│ │ │ +#include <dune/functions/common/differentiablefunction.hh>
│ │ │ +#include <dune/functions/common/functionconcepts.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::SubspaceBasis< RB, TP >
class  Dune::Functions::DifferentiableFunctionFromCallables< Range(Domain), DerivativeTraits, F >
 Wrap a list of callable objects as derivative sequence modelling Concept::DifferentiableFunction<Range(Domain), DerivativeTraits>. More...
class  Dune::Functions::DifferentiableFunctionFromCallables< Range(Domain), DerivativeTraits, F, DF, Derivatives... >
 Wrap a list of callable objects as derivative sequence modelling Concept::DifferentiableFunction<Range(Domain), DerivativeTraits>. More...
│ │ │ │ │ │ │ │ │ │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Functions

template<class RB, class TP>
 Dune::Functions::SubspaceBasis (const RB &, const TP) -> SubspaceBasis< RB, TP >
template<class RootRootBasis, class InnerTP, class OuterTP>
 Dune::Functions::SubspaceBasis (const SubspaceBasis< RootRootBasis, InnerTP > &rootBasis, const OuterTP &prefixPath) -> SubspaceBasis< std::decay_t< decltype(rootBasis.rootBasis())>, decltype(Dune::TypeTree::join(rootBasis.prefixPath(), prefixPath))>
template<class RootBasis, class... PrefixTreeIndices>
auto Dune::Functions::subspaceBasis (const RootBasis &rootBasis, const TypeTree::TreePath< PrefixTreeIndices... > &prefixPath)
 Create SubspaceBasis from a root basis and a prefixPath.
template<class RootBasis, class... PrefixTreeIndices>
auto Dune::Functions::subspaceBasis (const RootBasis &rootBasis, const PrefixTreeIndices &... prefixTreeIndices)
template<class Signature, template< class > class DerivativeTraits, class... F>
DifferentiableFunctionFromCallables< Signature, DerivativeTraits, F... > Dune::Functions::makeDifferentiableFunctionFromCallables (const SignatureTag< Signature, DerivativeTraits > &signatureTag, F &&... f)
 Create a DifferentiableFunction from callables.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,39 +1,40 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -subspacebasis.hh File Reference │ │ │ │ -#include │ │ │ │ +differentiablefunctionfromcallables.hh File Reference │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_s_u_b_s_p_a_c_e_l_o_c_a_l_v_i_e_w_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_s_i_g_n_a_t_u_r_e_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s_<_ _R_B_,_ _T_P_ _> │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ + _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _F_ _> │ │ │ │ + Wrap a list of callable objects as derivative sequence modelling │ │ │ │ +  _C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_<_R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_>. │ │ │ │ + _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ + _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _F_,_ _D_F_,_ _D_e_r_i_v_a_t_i_v_e_s_._._._ _> │ │ │ │ + Wrap a list of callable objects as derivative sequence modelling │ │ │ │ +  _C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_<_R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_>. │ │ │ │ + _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s (const RB &, const TP) -> SubspaceBasis< │ │ │ │ - RB, TP > │ │ │ │ -template │ │ │ │ -   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s (const SubspaceBasis< RootRootBasis, │ │ │ │ - InnerTP > &rootBasis, const OuterTP &prefixPath) -> SubspaceBasis< std:: │ │ │ │ - decay_t< decltype(rootBasis.rootBasis())>, decltype(Dune::TypeTree::join │ │ │ │ - (rootBasis.prefixPath(), prefixPath))> │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_s_u_b_s_p_a_c_e_B_a_s_i_s (const RootBasis &rootBasis, const │ │ │ │ - TypeTree::TreePath< PrefixTreeIndices... > &prefixPath) │ │ │ │ -  Create _S_u_b_s_p_a_c_e_B_a_s_i_s from a root basis and a prefixPath. │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_s_u_b_s_p_a_c_e_B_a_s_i_s (const RootBasis &rootBasis, const │ │ │ │ - PrefixTreeIndices &... prefixTreeIndices) │ │ │ │ +template class DerivativeTraits, class... │ │ │ │ +F> │ │ │ │ +_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s< _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_: │ │ │ │ +Signature, DerivativeTraits, F... >  _m_a_k_e_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s │ │ │ │ + (const _S_i_g_n_a_t_u_r_e_T_a_g< Signature, │ │ │ │ + DerivativeTraits > &signatureTag, F &&... │ │ │ │ + f) │ │ │ │ +  Create a _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n from │ │ │ │ + callables. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _s_u_b_s_p_a_c_e_b_a_s_i_s_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_f_r_o_m_c_a_l_l_a_b_l_e_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00086.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,7 +1,3 @@ │ │ │ │ var a00086 = [ │ │ │ │ - ["Dune::Functions::SubspaceBasis< RB, TP >", "a02142.html", "a02142"], │ │ │ │ - ["Dune::Functions::SubspaceBasis", "a00318.html#a17589fdc18b015644525c7ad037e6441", null], │ │ │ │ - ["Dune::Functions::SubspaceBasis", "a00318.html#aa5a95a8db4998a1cbfc36f86b3bf7fca", null], │ │ │ │ - ["Dune::Functions::subspaceBasis", "a00318.html#abb8781cf3fb98ca29446be66bcf65ac4", null], │ │ │ │ - ["Dune::Functions::subspaceBasis", "a00318.html#a6e116b9fe81aac2fed32284922a2d28c", null] │ │ │ │ + ["Dune::Functions::makeDifferentiableFunctionFromCallables", "a00308.html#gad3bb1b3fe74c7f750a3980f4c0ce0449", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00086_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: subspacebasis.hh Source File │ │ │ +Dune-Functions: differentiablefunctionfromcallables.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,213 +88,171 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
subspacebasis.hh
│ │ │ +
differentiablefunctionfromcallables.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACEBASIS_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACEBASIS_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH
│ │ │ +
8#define DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH
│ │ │
9
│ │ │ -
10#include <dune/common/reservedvector.hh>
│ │ │ +
10
│ │ │
11#include <dune/common/typeutilities.hh>
│ │ │ -
12#include <dune/common/concept.hh>
│ │ │ +
12#include <dune/common/hybridutilities.hh>
│ │ │
13
│ │ │ -
14#include <dune/common/typetree/treepath.hh>
│ │ │ + │ │ │
15
│ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ +
18
│ │ │
19
│ │ │
20
│ │ │ -
21
│ │ │ -
22namespace Dune {
│ │ │ -
23namespace Functions {
│ │ │ +
21namespace Dune {
│ │ │ +
22namespace Functions {
│ │ │ +
23
│ │ │
24
│ │ │
25
│ │ │ -
26
│ │ │ -
27template<class RB, class TP>
│ │ │ -
│ │ │ - │ │ │ -
29{
│ │ │ -
30public:
│ │ │ -
31
│ │ │ -
32 using RootBasis = RB;
│ │ │ -
33
│ │ │ -
34 using RootLocalView = typename RootBasis::LocalView;
│ │ │ -
35
│ │ │ -
36 using PrefixPath = TP;
│ │ │ -
37
│ │ │ -
39 using GridView = typename RootBasis::GridView;
│ │ │ -
40
│ │ │ -
42 using MultiIndex = typename RootBasis::MultiIndex;
│ │ │ -
43
│ │ │ -
44 using size_type = std::size_t;
│ │ │ -
45
│ │ │ - │ │ │ -
48
│ │ │ -
49 using SizePrefix = typename RootBasis::SizePrefix;
│ │ │ -
50
│ │ │ +
26template<class Signature, template<class> class DerivativeTraits, class... Callables>
│ │ │ + │ │ │ +
28
│ │ │ +
29
│ │ │ +
30
│ │ │ +
47template<class Range, class Domain, template<class> class DerivativeTraits, class F>
│ │ │ +
│ │ │ +
48class DifferentiableFunctionFromCallables<Range(Domain), DerivativeTraits, F>
│ │ │ +
49{
│ │ │ +
50public:
│ │ │
51
│ │ │ -
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
56 {}
│ │ │ -
│ │ │ -
57
│ │ │ -
63 template<class RootRootBasis, class InnerTP, class OuterTP>
│ │ │ -
│ │ │ - │ │ │ - │ │ │ -
66 {}
│ │ │ +
53 using Signature = Range(Domain);
│ │ │ +
54
│ │ │ + │ │ │ +
56
│ │ │ +
58 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(Domain);
│ │ │ +
59
│ │ │ + │ │ │ +
62
│ │ │ +
64 template<class FF, disableCopyMove<DifferentiableFunctionFromCallables, FF> = 0>
│ │ │ +
│ │ │ + │ │ │ +
66 f_(std::forward<FF>(f))
│ │ │ +
67 {}
│ │ │
│ │ │ -
67
│ │ │
68
│ │ │ -
│ │ │ -
71 const GridView& gridView() const
│ │ │ -
72 {
│ │ │ -
73 return rootBasis_->gridView();
│ │ │ -
74 }
│ │ │ -
│ │ │ -
75
│ │ │ -
│ │ │ - │ │ │ -
80 {
│ │ │ -
81 return rootBasis_->dimension();
│ │ │ -
82 }
│ │ │ -
│ │ │ -
83
│ │ │ -
│ │ │ - │ │ │ -
86 {
│ │ │ -
87 return rootBasis_->size();
│ │ │ -
88 }
│ │ │ -
│ │ │ -
89
│ │ │ -
│ │ │ -
91 size_type size(const SizePrefix& prefix) const
│ │ │ -
92 {
│ │ │ -
93 return rootBasis_->size(prefix);
│ │ │ -
94 }
│ │ │ -
│ │ │ -
95
│ │ │ -
│ │ │ - │ │ │ -
100 {
│ │ │ -
101 return LocalView(*this, prefixPath_);
│ │ │ -
102 }
│ │ │ -
│ │ │ -
103
│ │ │ -
│ │ │ -
104 const RootBasis& rootBasis() const
│ │ │ -
105 {
│ │ │ -
106 return *rootBasis_;
│ │ │ -
107 }
│ │ │ -
│ │ │ -
108
│ │ │ -
│ │ │ -
109 const PrefixPath& prefixPath() const
│ │ │ -
110 {
│ │ │ -
111 return prefixPath_;
│ │ │ -
112 }
│ │ │ -
│ │ │ -
113
│ │ │ -
│ │ │ - │ │ │ -
116 {
│ │ │ -
117 return rootBasis_->containerDescriptor();
│ │ │ -
118 }
│ │ │ -
│ │ │ -
119
│ │ │ -
120protected:
│ │ │ - │ │ │ - │ │ │ -
123};
│ │ │ -
│ │ │ -
124
│ │ │ -
125
│ │ │ -
126// CTAD guide for a non-SubspaceBasis root basis
│ │ │ -
127template<class RB, class TP>
│ │ │ -
128SubspaceBasis(const RB&, const TP) -> SubspaceBasis<RB, TP>;
│ │ │ -
129
│ │ │ -
130// CTAD guide for a SubspaceBasis root basis
│ │ │ -
131template<class RootRootBasis, class InnerTP, class OuterTP>
│ │ │ -
132SubspaceBasis(const SubspaceBasis<RootRootBasis, InnerTP>& rootBasis, const OuterTP& prefixPath)
│ │ │ -
133 -> SubspaceBasis<std::decay_t<decltype(rootBasis.rootBasis())>, decltype(Dune::TypeTree::join(rootBasis.prefixPath(), prefixPath))>;
│ │ │ -
134
│ │ │ -
135
│ │ │ -
136
│ │ │ -
147template<class RootBasis, class... PrefixTreeIndices>
│ │ │ -
│ │ │ -
148auto subspaceBasis(const RootBasis& rootBasis, const TypeTree::TreePath<PrefixTreeIndices...>& prefixPath)
│ │ │ -
149{
│ │ │ -
150 return SubspaceBasis(rootBasis, prefixPath);
│ │ │ -
151}
│ │ │ -
│ │ │ -
152
│ │ │ -
153template<class RootBasis, class... PrefixTreeIndices>
│ │ │ -
│ │ │ -
154auto subspaceBasis(const RootBasis& rootBasis, const PrefixTreeIndices&... prefixTreeIndices)
│ │ │ -
155{
│ │ │ -
156 return subspaceBasis(rootBasis, TypeTree::treePath(prefixTreeIndices...));
│ │ │ -
157}
│ │ │ -
│ │ │ -
158
│ │ │ -
159
│ │ │ -
160
│ │ │ -
161} // end namespace Functions
│ │ │ -
162} // end namespace Dune
│ │ │ -
163
│ │ │ -
164
│ │ │ -
165
│ │ │ -
166#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH
│ │ │ - │ │ │ - │ │ │ +
│ │ │ +
70 Range operator() (const Domain& x) const
│ │ │ +
71 {
│ │ │ +
72 return f_(x);
│ │ │ +
73 }
│ │ │ +
│ │ │ +
74
│ │ │ +
│ │ │ + │ │ │ +
81 {
│ │ │ +
82 DUNE_THROW(Dune::NotImplemented, "Derivative not implemented");
│ │ │ +
83 }
│ │ │ +
│ │ │ +
84
│ │ │ +
85private:
│ │ │ +
86 F f_;
│ │ │ +
87};
│ │ │ +
│ │ │ +
88
│ │ │ +
89
│ │ │ +
90
│ │ │ +
107template<class Range, class Domain, template<class> class DerivativeTraits, class F, class DF, class... Derivatives>
│ │ │ +
│ │ │ +
108class DifferentiableFunctionFromCallables<Range(Domain), DerivativeTraits, F, DF, Derivatives...>
│ │ │ +
109{
│ │ │ +
110public:
│ │ │ +
111
│ │ │ +
112 using Signature = Range(Domain);
│ │ │ + │ │ │ +
114 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(Domain);
│ │ │ +
115
│ │ │ +
116 using Derivative = DifferentiableFunctionFromCallables<DerivativeSignature, DerivativeTraits, DF, Derivatives...>;
│ │ │ +
117
│ │ │ +
124 template<class FF, class DFF, class... DDFF>
│ │ │ +
│ │ │ +
125 DifferentiableFunctionFromCallables(FF&& f, DFF&& df, DDFF&&... ddf) :
│ │ │ +
126 f_(std::forward<FF>(f)),
│ │ │ +
127 df_(std::forward<DFF>(df), std::forward<DDFF>(ddf)...)
│ │ │ +
128 {}
│ │ │ +
│ │ │ +
129
│ │ │ +
│ │ │ +
131 Range operator() (const Domain& x) const
│ │ │ +
132 {
│ │ │ +
133 return f_(x);
│ │ │ +
134 }
│ │ │ +
│ │ │ +
135
│ │ │ +
│ │ │ + │ │ │ +
142 {
│ │ │ +
143 return t.df_;
│ │ │ +
144 }
│ │ │ +
│ │ │ +
145
│ │ │ +
146private:
│ │ │ +
147 F f_;
│ │ │ +
148 Derivative df_;
│ │ │ +
149};
│ │ │ +
│ │ │ +
150
│ │ │ +
151
│ │ │ +
166template<class Signature, template<class> class DerivativeTraits, class... F>
│ │ │ +
167DifferentiableFunctionFromCallables<Signature, DerivativeTraits, F...>
│ │ │ +
│ │ │ + │ │ │ +
169{
│ │ │ +
170 return DifferentiableFunctionFromCallables<Signature, DerivativeTraits, F...>(f...);
│ │ │ +
171}
│ │ │ +
│ │ │ +
172
│ │ │ +
173
│ │ │ +
174
│ │ │ +
175} // namespace Functions
│ │ │ +
176} // namespace Dune
│ │ │ +
177
│ │ │ +
178#endif //DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH
│ │ │ + │ │ │ + │ │ │ + │ │ │ +
friend Derivative derivative(const DifferentiableFunctionFromCallables &t)
Get derivative of DifferentiableFunctionFromCallables.
Definition differentiablefunctionfromcallables.hh:80
│ │ │ +
DifferentiableFunctionFromCallables< Signature, DerivativeTraits, F... > makeDifferentiableFunctionFromCallables(const SignatureTag< Signature, DerivativeTraits > &signatureTag, F &&... f)
Create a DifferentiableFunction from callables.
Definition differentiablefunctionfromcallables.hh:168
│ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
SubspaceBasis(const RB &, const TP) -> SubspaceBasis< RB, TP >
│ │ │ -
auto subspaceBasis(const RootBasis &rootBasis, const TypeTree::TreePath< PrefixTreeIndices... > &prefixPath)
Create SubspaceBasis from a root basis and a prefixPath.
Definition subspacebasis.hh:148
│ │ │ -
Definition subspacebasis.hh:29
│ │ │ -
typename RootBasis::LocalView RootLocalView
Definition subspacebasis.hh:34
│ │ │ -
LocalView localView() const
Return local view for basis.
Definition subspacebasis.hh:99
│ │ │ - │ │ │ -
typename RootBasis::SizePrefix SizePrefix
Definition subspacebasis.hh:49
│ │ │ -
TP PrefixPath
Definition subspacebasis.hh:36
│ │ │ -
SubspaceLocalView< RootLocalView, PrefixPath > LocalView
Type of the local view on the restriction of the basis to a single element.
Definition subspacebasis.hh:47
│ │ │ -
size_type size(const SizePrefix &prefix) const
Return number possible values for next position in multi index.
Definition subspacebasis.hh:91
│ │ │ -
typename RootBasis::GridView GridView
The grid view that the FE space is defined on.
Definition subspacebasis.hh:39
│ │ │ -
const PrefixPath & prefixPath() const
Definition subspacebasis.hh:109
│ │ │ -
SubspaceBasis(const SubspaceBasis< RootRootBasis, InnerTP > &rootBasis, const OuterTP &prefixPath)
Constructor from another SubspaceBasis.
Definition subspacebasis.hh:64
│ │ │ -
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition subspacebasis.hh:71
│ │ │ -
auto containerDescriptor() const
Return the associated container descriptor.
Definition subspacebasis.hh:115
│ │ │ -
RB RootBasis
Definition subspacebasis.hh:32
│ │ │ - │ │ │ -
size_type size() const
Return number of possible values for next position in empty multi index.
Definition subspacebasis.hh:85
│ │ │ -
const RootBasis & rootBasis() const
Definition subspacebasis.hh:104
│ │ │ -
typename RootBasis::MultiIndex MultiIndex
Type used for global numbering of the basis vectors.
Definition subspacebasis.hh:42
│ │ │ -
size_type dimension() const
Definition subspacebasis.hh:79
│ │ │ -
std::size_t size_type
Definition subspacebasis.hh:44
│ │ │ -
SubspaceBasis(const RootBasis &rootBasis, const PrefixPath &prefixPath)
Constructor for a given grid view object.
Definition subspacebasis.hh:53
│ │ │ -
The restriction of a finite element basis to a single element.
Definition subspacelocalview.hh:34
│ │ │ - │ │ │ +
Definition differentiablefunction.hh:33
│ │ │ +
Definition differentiablefunctionfromcallables.hh:27
│ │ │ +
DifferentiableFunction< DerivativeSignature, DerivativeTraits > Derivative
Type of derivative.
Definition differentiablefunctionfromcallables.hh:61
│ │ │ +
DifferentiableFunctionFromCallables(FF &&f)
Constructor copying the given function.
Definition differentiablefunctionfromcallables.hh:65
│ │ │ +
typename SignatureTraits< Signature >::RawSignature RawSignature
Definition differentiablefunctionfromcallables.hh:55
│ │ │ +
Range(Domain) Signature
Signature of function.
Definition differentiablefunctionfromcallables.hh:53
│ │ │ +
typename DerivativeTraits< RawSignature >::Range(Domain) DerivativeSignature
Signature of derivative.
Definition differentiablefunctionfromcallables.hh:58
│ │ │ +
typename DerivativeTraits< RawSignature >::Range(Domain) DerivativeSignature
Definition differentiablefunctionfromcallables.hh:114
│ │ │ +
DifferentiableFunctionFromCallables< DerivativeSignature, DerivativeTraits, DF, Derivatives... > Derivative
Definition differentiablefunctionfromcallables.hh:116
│ │ │ + │ │ │ +
typename SignatureTraits< Signature >::RawSignature RawSignature
Definition differentiablefunctionfromcallables.hh:113
│ │ │ +
DifferentiableFunctionFromCallables(FF &&f, DFF &&df, DDFF &&... ddf)
Constructor copying the given functions.
Definition differentiablefunctionfromcallables.hh:125
│ │ │ +
Helper class to deduce the signature of a callable.
Definition signature.hh:60
│ │ │ +
Definition signature.hh:106
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,249 +1,208 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -subspacebasis.hh │ │ │ │ +differentiablefunctionfromcallables.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACEBASIS_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACEBASIS_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH │ │ │ │ +8#define DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ +10 │ │ │ │ 11#include │ │ │ │ -12#include │ │ │ │ +12#include │ │ │ │ 13 │ │ │ │ -14#include │ │ │ │ +14#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_s_i_g_n_a_t_u_r_e_._h_h> │ │ │ │ 15 │ │ │ │ -16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ -17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_s_u_b_s_p_a_c_e_l_o_c_a_l_v_i_e_w_._h_h> │ │ │ │ -18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +18 │ │ │ │ 19 │ │ │ │ 20 │ │ │ │ -21 │ │ │ │ -22namespace _D_u_n_e { │ │ │ │ -23namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +21namespace _D_u_n_e { │ │ │ │ +22namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +23 │ │ │ │ 24 │ │ │ │ 25 │ │ │ │ -26 │ │ │ │ -27template │ │ │ │ -_2_8class _S_u_b_s_p_a_c_e_B_a_s_i_s │ │ │ │ -29{ │ │ │ │ -30public: │ │ │ │ -31 │ │ │ │ -_3_2 using _R_o_o_t_B_a_s_i_s = RB; │ │ │ │ -33 │ │ │ │ -_3_4 using _R_o_o_t_L_o_c_a_l_V_i_e_w = typename RootBasis::LocalView; │ │ │ │ -35 │ │ │ │ -_3_6 using _P_r_e_f_i_x_P_a_t_h = TP; │ │ │ │ -37 │ │ │ │ -_3_9 using _G_r_i_d_V_i_e_w = typename RootBasis::GridView; │ │ │ │ -40 │ │ │ │ -_4_2 using _M_u_l_t_i_I_n_d_e_x = typename RootBasis::MultiIndex; │ │ │ │ -43 │ │ │ │ -_4_4 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ -45 │ │ │ │ -_4_7 using _L_o_c_a_l_V_i_e_w = _S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_<_R_o_o_t_L_o_c_a_l_V_i_e_w_,_ _P_r_e_f_i_x_P_a_t_h_>; │ │ │ │ -48 │ │ │ │ -_4_9 using _S_i_z_e_P_r_e_f_i_x = typename RootBasis::SizePrefix; │ │ │ │ -50 │ │ │ │ +26template class DerivativeTraits, class... │ │ │ │ +Callables> │ │ │ │ +_2_7class _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s; │ │ │ │ +28 │ │ │ │ +29 │ │ │ │ +30 │ │ │ │ +47template class DerivativeTraits, │ │ │ │ +class F> │ │ │ │ +_4_8class _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s │ │ │ │ +49{ │ │ │ │ +50public: │ │ │ │ 51 │ │ │ │ -_5_3 _S_u_b_s_p_a_c_e_B_a_s_i_s(const _R_o_o_t_B_a_s_i_s& _r_o_o_t_B_a_s_i_s, const _P_r_e_f_i_x_P_a_t_h& _p_r_e_f_i_x_P_a_t_h) : │ │ │ │ -54 _r_o_o_t_B_a_s_i_s__(&_r_o_o_t_B_a_s_i_s), │ │ │ │ -55 _p_r_e_f_i_x_P_a_t_h__(_p_r_e_f_i_x_P_a_t_h) │ │ │ │ -56 {} │ │ │ │ -57 │ │ │ │ -63 template │ │ │ │ -_6_4 _S_u_b_s_p_a_c_e_B_a_s_i_s(const _S_u_b_s_p_a_c_e_B_a_s_i_s_<_R_o_o_t_R_o_o_t_B_a_s_i_s_,_ _I_n_n_e_r_T_P_>& _r_o_o_t_B_a_s_i_s, const │ │ │ │ -OuterTP& _p_r_e_f_i_x_P_a_t_h) : │ │ │ │ -65 _S_u_b_s_p_a_c_e_B_a_s_i_s(_r_o_o_t_B_a_s_i_s._r_o_o_t_B_a_s_i_s(), _D_u_n_e::TypeTree::join │ │ │ │ -(_r_o_o_t_B_a_s_i_s._p_r_e_f_i_x_P_a_t_h(), _p_r_e_f_i_x_P_a_t_h)) │ │ │ │ -66 {} │ │ │ │ -67 │ │ │ │ +_5_3 using _S_i_g_n_a_t_u_r_e = Range(Domain); │ │ │ │ +54 │ │ │ │ +_5_5 using _R_a_w_S_i_g_n_a_t_u_r_e = typename _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s_<_S_i_g_n_a_t_u_r_e_>_:_:_R_a_w_S_i_g_n_a_t_u_r_e; │ │ │ │ +56 │ │ │ │ +_5_8 using _D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e = typename DerivativeTraits::Range │ │ │ │ +(Domain); │ │ │ │ +59 │ │ │ │ +_6_1 using _D_e_r_i_v_a_t_i_v_e = _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_<_D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_>; │ │ │ │ +62 │ │ │ │ +64 template │ │ │ │ += 0> │ │ │ │ +_6_5 _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s(FF&& f) : │ │ │ │ +66 f_(std::forward(f)) │ │ │ │ +67 {} │ │ │ │ 68 │ │ │ │ -_7_1 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ -72 { │ │ │ │ -73 return _r_o_o_t_B_a_s_i_s__->gridView(); │ │ │ │ -74 } │ │ │ │ -75 │ │ │ │ -_7_9 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ -80 { │ │ │ │ -81 return _r_o_o_t_B_a_s_i_s__->dimension(); │ │ │ │ -82 } │ │ │ │ -83 │ │ │ │ -_8_5 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ -86 { │ │ │ │ -87 return _r_o_o_t_B_a_s_i_s__->size(); │ │ │ │ -88 } │ │ │ │ +_7_0 Range operator() (const Domain& x) const │ │ │ │ +71 { │ │ │ │ +72 return f_(x); │ │ │ │ +73 } │ │ │ │ +74 │ │ │ │ +_8_0 friend _D_e_r_i_v_a_t_i_v_e _d_e_r_i_v_a_t_i_v_e(const _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s& t) │ │ │ │ +81 { │ │ │ │ +82 DUNE_THROW(Dune::NotImplemented, "Derivative not implemented"); │ │ │ │ +83 } │ │ │ │ +84 │ │ │ │ +85private: │ │ │ │ +86 F f_; │ │ │ │ +87}; │ │ │ │ +88 │ │ │ │ 89 │ │ │ │ -_9_1 _s_i_z_e___t_y_p_e _s_i_z_e(const _S_i_z_e_P_r_e_f_i_x& prefix) const │ │ │ │ -92 { │ │ │ │ -93 return _r_o_o_t_B_a_s_i_s__->size(prefix); │ │ │ │ -94 } │ │ │ │ -95 │ │ │ │ -_9_9 _L_o_c_a_l_V_i_e_w _l_o_c_a_l_V_i_e_w() const │ │ │ │ -100 { │ │ │ │ -101 return _L_o_c_a_l_V_i_e_w(*this, _p_r_e_f_i_x_P_a_t_h__); │ │ │ │ -102 } │ │ │ │ -103 │ │ │ │ -_1_0_4 const _R_o_o_t_B_a_s_i_s& _r_o_o_t_B_a_s_i_s() const │ │ │ │ -105 { │ │ │ │ -106 return *_r_o_o_t_B_a_s_i_s__; │ │ │ │ -107 } │ │ │ │ -108 │ │ │ │ -_1_0_9 const _P_r_e_f_i_x_P_a_t_h& _p_r_e_f_i_x_P_a_t_h() const │ │ │ │ -110 { │ │ │ │ -111 return _p_r_e_f_i_x_P_a_t_h__; │ │ │ │ -112 } │ │ │ │ -113 │ │ │ │ -_1_1_5 auto _c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r() const │ │ │ │ -116 { │ │ │ │ -117 return _r_o_o_t_B_a_s_i_s__->containerDescriptor(); │ │ │ │ -118 } │ │ │ │ -119 │ │ │ │ -120protected: │ │ │ │ -_1_2_1 const _R_o_o_t_B_a_s_i_s* _r_o_o_t_B_a_s_i_s__; │ │ │ │ -_1_2_2 _P_r_e_f_i_x_P_a_t_h _p_r_e_f_i_x_P_a_t_h__; │ │ │ │ -123}; │ │ │ │ -124 │ │ │ │ -125 │ │ │ │ -126// CTAD guide for a non-SubspaceBasis root basis │ │ │ │ -127template │ │ │ │ -_1_2_8_S_u_b_s_p_a_c_e_B_a_s_i_s(const RB&, const TP) -> _S_u_b_s_p_a_c_e_B_a_s_i_s_<_R_B_,_ _T_P_>; │ │ │ │ +90 │ │ │ │ +107template class DerivativeTraits, │ │ │ │ +class F, class DF, class... Derivatives> │ │ │ │ +_1_0_8class _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s │ │ │ │ +109{ │ │ │ │ +110public: │ │ │ │ +111 │ │ │ │ +_1_1_2 using _S_i_g_n_a_t_u_r_e = Range(Domain); │ │ │ │ +_1_1_3 using _R_a_w_S_i_g_n_a_t_u_r_e = typename _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s_<_S_i_g_n_a_t_u_r_e_>_:_:_R_a_w_S_i_g_n_a_t_u_r_e; │ │ │ │ +_1_1_4 using _D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e = typename DerivativeTraits::Range │ │ │ │ +(Domain); │ │ │ │ +115 │ │ │ │ +_1_1_6 using _D_e_r_i_v_a_t_i_v_e = _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s<_D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e, │ │ │ │ +DerivativeTraits, DF, Derivatives...>; │ │ │ │ +117 │ │ │ │ +124 template │ │ │ │ +_1_2_5 _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s(FF&& f, DFF&& df, DDFF&&... ddf) : │ │ │ │ +126 f_(std::forward(f)), │ │ │ │ +127 df_(std::forward(df), std::forward(ddf)...) │ │ │ │ +128 {} │ │ │ │ 129 │ │ │ │ -130// CTAD guide for a SubspaceBasis root basis │ │ │ │ -131template │ │ │ │ -_1_3_2_S_u_b_s_p_a_c_e_B_a_s_i_s(const _S_u_b_s_p_a_c_e_B_a_s_i_s_<_R_o_o_t_R_o_o_t_B_a_s_i_s_,_ _I_n_n_e_r_T_P_>& rootBasis, const │ │ │ │ -OuterTP& prefixPath) │ │ │ │ -133 -> _S_u_b_s_p_a_c_e_B_a_s_i_s, decltype │ │ │ │ -(Dune::TypeTree::join(rootBasis.prefixPath(), prefixPath))>; │ │ │ │ -134 │ │ │ │ +_1_3_1 Range operator() (const Domain& x) const │ │ │ │ +132 { │ │ │ │ +133 return f_(x); │ │ │ │ +134 } │ │ │ │ 135 │ │ │ │ -136 │ │ │ │ -147template │ │ │ │ -_1_4_8auto _s_u_b_s_p_a_c_e_B_a_s_i_s(const RootBasis& rootBasis, const TypeTree:: │ │ │ │ -TreePath& prefixPath) │ │ │ │ -149{ │ │ │ │ -150 return _S_u_b_s_p_a_c_e_B_a_s_i_s(rootBasis, prefixPath); │ │ │ │ -151} │ │ │ │ -152 │ │ │ │ -153template │ │ │ │ -_1_5_4auto _s_u_b_s_p_a_c_e_B_a_s_i_s(const RootBasis& rootBasis, const PrefixTreeIndices&... │ │ │ │ -prefixTreeIndices) │ │ │ │ -155{ │ │ │ │ -156 return _s_u_b_s_p_a_c_e_B_a_s_i_s(rootBasis, TypeTree::treePath(prefixTreeIndices...)); │ │ │ │ -157} │ │ │ │ -158 │ │ │ │ -159 │ │ │ │ -160 │ │ │ │ -161} // end namespace Functions │ │ │ │ -162} // end namespace Dune │ │ │ │ -163 │ │ │ │ -164 │ │ │ │ -165 │ │ │ │ -166#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH │ │ │ │ -_s_u_b_s_p_a_c_e_l_o_c_a_l_v_i_e_w_._h_h │ │ │ │ -_t_y_p_e___t_r_a_i_t_s_._h_h │ │ │ │ +_1_4_1 friend _D_e_r_i_v_a_t_i_v_e _d_e_r_i_v_a_t_i_v_e(const _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s& t) │ │ │ │ +142 { │ │ │ │ +143 return t.df_; │ │ │ │ +144 } │ │ │ │ +145 │ │ │ │ +146private: │ │ │ │ +147 F f_; │ │ │ │ +148 Derivative df_; │ │ │ │ +149}; │ │ │ │ +150 │ │ │ │ +151 │ │ │ │ +166template class DerivativeTraits, class... │ │ │ │ +F> │ │ │ │ +167DifferentiableFunctionFromCallables │ │ │ │ +_1_6_8 _m_a_k_e_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s(const _S_i_g_n_a_t_u_r_e_T_a_g_<_S_i_g_n_a_t_u_r_e_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_>& signatureTag, F&&... f) │ │ │ │ +169{ │ │ │ │ +170 return _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s(f...); │ │ │ │ +171} │ │ │ │ +172 │ │ │ │ +173 │ │ │ │ +174 │ │ │ │ +175} // namespace Functions │ │ │ │ +176} // namespace Dune │ │ │ │ +177 │ │ │ │ +178#endif //DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH │ │ │ │ +_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h │ │ │ │ +_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h │ │ │ │ +_s_i_g_n_a_t_u_r_e_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _F_ _>_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ +friend Derivative derivative(const DifferentiableFunctionFromCallables &t) │ │ │ │ +Get derivative of DifferentiableFunctionFromCallables. │ │ │ │ +DDeeffiinniittiioonn differentiablefunctionfromcallables.hh:80 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s │ │ │ │ +DifferentiableFunctionFromCallables< Signature, DerivativeTraits, F... > │ │ │ │ +makeDifferentiableFunctionFromCallables(const SignatureTag< Signature, │ │ │ │ +DerivativeTraits > &signatureTag, F &&... f) │ │ │ │ +Create a DifferentiableFunction from callables. │ │ │ │ +DDeeffiinniittiioonn differentiablefunctionfromcallables.hh:168 │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s │ │ │ │ -SubspaceBasis(const RB &, const TP) -> SubspaceBasis< RB, TP > │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_s_u_b_s_p_a_c_e_B_a_s_i_s │ │ │ │ -auto subspaceBasis(const RootBasis &rootBasis, const TypeTree::TreePath< │ │ │ │ -PrefixTreeIndices... > &prefixPath) │ │ │ │ -Create SubspaceBasis from a root basis and a prefixPath. │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:148 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:29 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s_:_:_R_o_o_t_L_o_c_a_l_V_i_e_w │ │ │ │ -typename RootBasis::LocalView RootLocalView │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:34 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s_:_:_l_o_c_a_l_V_i_e_w │ │ │ │ -LocalView localView() const │ │ │ │ -Return local view for basis. │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:99 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s_<_ _t_y_p_e_n_a_m_e_ _R_o_o_t_L_o_c_a_l_V_i_e_w_:_:_G_l_o_b_a_l_B_a_s_i_s_,_ _P_r_e_f_i_x_P_a_t_h │ │ │ │ -_>_:_:_r_o_o_t_B_a_s_i_s__ │ │ │ │ -const RootBasis * rootBasis_ │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:121 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s_:_:_S_i_z_e_P_r_e_f_i_x │ │ │ │ -typename RootBasis::SizePrefix SizePrefix │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:49 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s_:_:_P_r_e_f_i_x_P_a_t_h │ │ │ │ -TP PrefixPath │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:36 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s_:_:_L_o_c_a_l_V_i_e_w │ │ │ │ -SubspaceLocalView< RootLocalView, PrefixPath > LocalView │ │ │ │ -Type of the local view on the restriction of the basis to a single element. │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:47 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ -size_type size(const SizePrefix &prefix) const │ │ │ │ -Return number possible values for next position in multi index. │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:91 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ -typename RootBasis::GridView GridView │ │ │ │ -The grid view that the FE space is defined on. │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:39 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s_<_ _t_y_p_e_n_a_m_e_ _R_o_o_t_L_o_c_a_l_V_i_e_w_:_:_G_l_o_b_a_l_B_a_s_i_s_,_ _P_r_e_f_i_x_P_a_t_h │ │ │ │ -_>_:_:_p_r_e_f_i_x_P_a_t_h │ │ │ │ -const PrefixPath & prefixPath() const │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:109 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s │ │ │ │ -SubspaceBasis(const SubspaceBasis< RootRootBasis, InnerTP > &rootBasis, const │ │ │ │ -OuterTP &prefixPath) │ │ │ │ -Constructor from another SubspaceBasis. │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:64 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s_:_:_g_r_i_d_V_i_e_w │ │ │ │ -const GridView & gridView() const │ │ │ │ -Obtain the grid view that the basis is defined on. │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:71 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r │ │ │ │ -auto containerDescriptor() const │ │ │ │ -Return the associated container descriptor. │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:115 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s_:_:_R_o_o_t_B_a_s_i_s │ │ │ │ -RB RootBasis │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:32 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s_<_ _t_y_p_e_n_a_m_e_ _R_o_o_t_L_o_c_a_l_V_i_e_w_:_:_G_l_o_b_a_l_B_a_s_i_s_,_ _P_r_e_f_i_x_P_a_t_h │ │ │ │ -_>_:_:_p_r_e_f_i_x_P_a_t_h__ │ │ │ │ -PrefixPath prefixPath_ │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:122 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ -size_type size() const │ │ │ │ -Return number of possible values for next position in empty multi index. │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:85 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s_<_ _t_y_p_e_n_a_m_e_ _R_o_o_t_L_o_c_a_l_V_i_e_w_:_:_G_l_o_b_a_l_B_a_s_i_s_,_ _P_r_e_f_i_x_P_a_t_h │ │ │ │ -_>_:_:_r_o_o_t_B_a_s_i_s │ │ │ │ -const RootBasis & rootBasis() const │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:104 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s_:_:_M_u_l_t_i_I_n_d_e_x │ │ │ │ -typename RootBasis::MultiIndex MultiIndex │ │ │ │ -Type used for global numbering of the basis vectors. │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:42 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ -size_type dimension() const │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:79 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:44 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s │ │ │ │ -SubspaceBasis(const RootBasis &rootBasis, const PrefixPath &prefixPath) │ │ │ │ -Constructor for a given grid view object. │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:53 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w │ │ │ │ -The restriction of a finite element basis to a single element. │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:34 │ │ │ │ -_c_o_n_c_e_p_t_s_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n │ │ │ │ +DDeeffiinniittiioonn differentiablefunction.hh:33 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s │ │ │ │ +DDeeffiinniittiioonn differentiablefunctionfromcallables.hh:27 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _F_ _>_:_:_D_e_r_i_v_a_t_i_v_e │ │ │ │ +DifferentiableFunction< DerivativeSignature, DerivativeTraits > Derivative │ │ │ │ +Type of derivative. │ │ │ │ +DDeeffiinniittiioonn differentiablefunctionfromcallables.hh:61 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _F_ _>_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s │ │ │ │ +DifferentiableFunctionFromCallables(FF &&f) │ │ │ │ +Constructor copying the given function. │ │ │ │ +DDeeffiinniittiioonn differentiablefunctionfromcallables.hh:65 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _F_ _>_:_:_R_a_w_S_i_g_n_a_t_u_r_e │ │ │ │ +typename SignatureTraits< Signature >::RawSignature RawSignature │ │ │ │ +DDeeffiinniittiioonn differentiablefunctionfromcallables.hh:55 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _F_ _>_:_:_S_i_g_n_a_t_u_r_e │ │ │ │ +Range(Domain) Signature │ │ │ │ +Signature of function. │ │ │ │ +DDeeffiinniittiioonn differentiablefunctionfromcallables.hh:53 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _F_ _>_:_:_D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e │ │ │ │ +typename DerivativeTraits< RawSignature >::Range(Domain) DerivativeSignature │ │ │ │ +Signature of derivative. │ │ │ │ +DDeeffiinniittiioonn differentiablefunctionfromcallables.hh:58 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _F_,_ _D_F_,_ _D_e_r_i_v_a_t_i_v_e_s_._._._ _>_:_:_D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e │ │ │ │ +typename DerivativeTraits< RawSignature >::Range(Domain) DerivativeSignature │ │ │ │ +DDeeffiinniittiioonn differentiablefunctionfromcallables.hh:114 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _F_,_ _D_F_,_ _D_e_r_i_v_a_t_i_v_e_s_._._._ _>_:_:_D_e_r_i_v_a_t_i_v_e │ │ │ │ +DifferentiableFunctionFromCallables< DerivativeSignature, DerivativeTraits, DF, │ │ │ │ +Derivatives... > Derivative │ │ │ │ +DDeeffiinniittiioonn differentiablefunctionfromcallables.hh:116 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _F_,_ _D_F_,_ _D_e_r_i_v_a_t_i_v_e_s_._._._ _>_:_:_S_i_g_n_a_t_u_r_e │ │ │ │ +Range(Domain) Signature │ │ │ │ +DDeeffiinniittiioonn differentiablefunctionfromcallables.hh:112 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _F_,_ _D_F_,_ _D_e_r_i_v_a_t_i_v_e_s_._._._ _>_:_:_R_a_w_S_i_g_n_a_t_u_r_e │ │ │ │ +typename SignatureTraits< Signature >::RawSignature RawSignature │ │ │ │ +DDeeffiinniittiioonn differentiablefunctionfromcallables.hh:113 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _F_,_ _D_F_,_ _D_e_r_i_v_a_t_i_v_e_s_._._._ _>_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s │ │ │ │ +DifferentiableFunctionFromCallables(FF &&f, DFF &&df, DDFF &&... ddf) │ │ │ │ +Constructor copying the given functions. │ │ │ │ +DDeeffiinniittiioonn differentiablefunctionfromcallables.hh:125 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_g_n_a_t_u_r_e_T_r_a_i_t_s │ │ │ │ +Helper class to deduce the signature of a callable. │ │ │ │ +DDeeffiinniittiioonn signature.hh:60 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_g_n_a_t_u_r_e_T_a_g │ │ │ │ +DDeeffiinniittiioonn signature.hh:106 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _s_u_b_s_p_a_c_e_b_a_s_i_s_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_f_r_o_m_c_a_l_l_a_b_l_e_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00089.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: subentitydofs.hh File Reference │ │ │ +Dune-Functions: staticforloop.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,57 +88,46 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
subentitydofs.hh File Reference
│ │ │ +
staticforloop.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <vector>
│ │ │ -#include <dune/geometry/referenceelements.hh>
│ │ │ -#include <dune/common/typetree/traversal.hh>
│ │ │ +
#include <dune/common/concept.hh>
│ │ │ +#include <dune/functions/common/type_traits.hh>
│ │ │ +#include <dune/functions/functionspacebases/concepts.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ -

│ │ │ -Classes

class  Dune::Functions::SubEntityDOFs< GridView >
 Range of DOFs associated to sub-entity. More...
│ │ │ │ │ │ │ │ │ │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Functions

template<class T>
auto Dune::Functions::subEntityDOFs (const T &)
 Create SubEntityDOFs object.
template<class LocalView>
auto Dune::Functions::subEntityDOFs (const LocalView &localView, std::size_t subEntityIndex, std::size_t subEntityCodim)
 Create bound SubEntityDOFs object.
template<class LocalView, class Intersection>
auto Dune::Functions::subEntityDOFs (const LocalView &localView, const Intersection &intersection)
 Create bound SubEntityDOFs object.
template<std::size_t begin_t, std::size_t end_t, class F, class... Args>
void Dune::Functions::staticFindInRange (F &&f, Args &&... args)
 Static find loop.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,32 +1,21 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -subentitydofs.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ +staticforloop.hh File Reference │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ -CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_E_n_t_i_t_y_D_O_F_s_<_ _G_r_i_d_V_i_e_w_ _> │ │ │ │ -  Range of DOFs associated to sub-entity. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_s_u_b_E_n_t_i_t_y_D_O_F_s (const T &) │ │ │ │ -  Create _S_u_b_E_n_t_i_t_y_D_O_F_s object. │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_s_u_b_E_n_t_i_t_y_D_O_F_s (const LocalView &localView, std::size_t │ │ │ │ - subEntityIndex, std::size_t subEntityCodim) │ │ │ │ -  Create bound _S_u_b_E_n_t_i_t_y_D_O_F_s object. │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_s_u_b_E_n_t_i_t_y_D_O_F_s (const LocalView &localView, const │ │ │ │ - Intersection &intersection) │ │ │ │ -  Create bound _S_u_b_E_n_t_i_t_y_D_O_F_s object. │ │ │ │ +template │ │ │ │ +void  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_s_t_a_t_i_c_F_i_n_d_I_n_R_a_n_g_e (F &&f, Args &&... args) │ │ │ │ +  Static find loop. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _s_u_b_e_n_t_i_t_y_d_o_f_s_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _s_t_a_t_i_c_f_o_r_l_o_o_p_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00089.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,5 +1,3 @@ │ │ │ │ var a00089 = [ │ │ │ │ - ["Dune::Functions::subEntityDOFs", "a00313.html#ga09ad7987f85909bfcf269a0de9c652d8", null], │ │ │ │ - ["Dune::Functions::subEntityDOFs", "a00313.html#ga5803226b1ed4bf848a9532181c952244", null], │ │ │ │ - ["Dune::Functions::subEntityDOFs", "a00313.html#ga0b9da94fff21e98877d0e3fe1c1554c7", null] │ │ │ │ + ["Dune::Functions::staticFindInRange", "a00314.html#gaa625ea93bc3285b8a09c9267302386ec", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00089_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: subentitydofs.hh Source File │ │ │ +Dune-Functions: staticforloop.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,183 +88,87 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
subentitydofs.hh
│ │ │ +
staticforloop.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH
│ │ │ +
8#define DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH
│ │ │
9
│ │ │ -
10#include <vector>
│ │ │ -
11
│ │ │ -
12#include <dune/geometry/referenceelements.hh>
│ │ │ -
13
│ │ │ -
14#include <dune/common/typetree/traversal.hh>
│ │ │ +
10
│ │ │ +
11#include <dune/common/concept.hh>
│ │ │ +
12
│ │ │ + │ │ │ + │ │ │
15
│ │ │
16
│ │ │ -
17
│ │ │ -
18namespace Dune {
│ │ │ -
19namespace Functions {
│ │ │ -
20
│ │ │ +
17namespace Dune {
│ │ │ +
18namespace Functions {
│ │ │ +
19
│ │ │ +
20namespace Imp {
│ │ │
21
│ │ │ -
22
│ │ │ -
45template<class GridView>
│ │ │ -
│ │ │ - │ │ │ -
47{
│ │ │ -
48 static const int dim = GridView::dimension;
│ │ │ -
49
│ │ │ -
50public:
│ │ │ -
51
│ │ │ -
68 template<class LocalView>
│ │ │ -
│ │ │ -
69 SubEntityDOFs& bind(const LocalView& localView, std::size_t subEntityIndex, std::size_t subEntityCodim)
│ │ │ -
70 {
│ │ │ -
71 // fill vector with local indices of all DOFs contained in subentity
│ │ │ -
72 containedDOFs_.clear();
│ │ │ -
73 dofIsContained_.assign(localView.size(), false);
│ │ │ -
74
│ │ │ -
75 auto re = Dune::referenceElement<double,dim>(localView.element().type());
│ │ │ -
76
│ │ │ -
77 Dune::TypeTree::forEachLeafNode(localView.tree(), [&](auto&& node, auto&& /*treePath*/) {
│ │ │ -
78 if (node.empty())
│ │ │ -
79 return;
│ │ │ -
80 const auto& localCoefficients = node.finiteElement().localCoefficients();
│ │ │ -
81 std::size_t localSize = localCoefficients.size();
│ │ │ -
82 for(std::size_t i=0; i<localSize; ++i)
│ │ │ -
83 {
│ │ │ -
84 auto localKey = localCoefficients.localKey(i);
│ │ │ -
85 if (re.subEntities(subEntityIndex, subEntityCodim, localKey.codim()).contains(localKey.subEntity()))
│ │ │ -
86 {
│ │ │ -
87 containedDOFs_.push_back(node.localIndex(i));
│ │ │ -
88 dofIsContained_[node.localIndex(i)] = true;
│ │ │ -
89 }
│ │ │ -
90 }
│ │ │ -
91 });
│ │ │ -
92 return *this;
│ │ │ -
93 }
│ │ │ -
│ │ │ -
94
│ │ │ -
110 template<class LocalView, class Intersection>
│ │ │ -
│ │ │ -
111 SubEntityDOFs& bind(const LocalView& localView, const Intersection& intersection)
│ │ │ -
112 {
│ │ │ -
113 return bind(localView, intersection.indexInInside(), 1);
│ │ │ -
114 }
│ │ │ -
│ │ │ -
115
│ │ │ -
│ │ │ -
117 auto begin() const
│ │ │ -
118 {
│ │ │ -
119 return containedDOFs_.cbegin();
│ │ │ -
120 }
│ │ │ -
│ │ │ -
121
│ │ │ -
│ │ │ -
123 auto end() const
│ │ │ -
124 {
│ │ │ -
125 return containedDOFs_.cend();
│ │ │ -
126 }
│ │ │ -
│ │ │ -
127
│ │ │ -
│ │ │ -
129 auto size() const
│ │ │ -
130 {
│ │ │ -
131 return containedDOFs_.size();
│ │ │ -
132 }
│ │ │ -
│ │ │ -
133
│ │ │ -
│ │ │ -
135 decltype(auto) operator[](std::size_t i) const
│ │ │ -
136 {
│ │ │ -
137 return containedDOFs_[i];
│ │ │ -
138 }
│ │ │ -
│ │ │ -
139
│ │ │ -
│ │ │ -
141 bool contains(std::size_t localIndex) const
│ │ │ -
142 {
│ │ │ -
143 return dofIsContained_[localIndex];
│ │ │ -
144 }
│ │ │ -
│ │ │ -
145
│ │ │ -
146private:
│ │ │ -
147
│ │ │ -
148 std::vector<std::size_t> containedDOFs_;
│ │ │ -
149 std::vector<bool> dofIsContained_;
│ │ │ -
150};
│ │ │ -
│ │ │ -
151
│ │ │ -
152
│ │ │ -
153
│ │ │ -
166template<class T>
│ │ │ -
│ │ │ -
167auto subEntityDOFs(const T&)
│ │ │ -
168{
│ │ │ - │ │ │ -
170}
│ │ │ -
│ │ │ -
171
│ │ │ -
172
│ │ │ -
173
│ │ │ -
193template<class LocalView>
│ │ │ -
│ │ │ -
194auto subEntityDOFs(const LocalView& localView, std::size_t subEntityIndex, std::size_t subEntityCodim)
│ │ │ -
195{
│ │ │ -
196 using GridView = typename LocalView::GridView;
│ │ │ - │ │ │ -
198 subEntityDOFs.bind(localView, subEntityIndex, subEntityCodim);
│ │ │ -
199 return subEntityDOFs;
│ │ │ -
200}
│ │ │ -
│ │ │ -
201
│ │ │ -
202
│ │ │ -
203
│ │ │ -
222template<class LocalView, class Intersection>
│ │ │ -
│ │ │ -
223auto subEntityDOFs(const LocalView& localView, const Intersection& intersection)
│ │ │ -
224{
│ │ │ -
225 using GridView = typename LocalView::GridView;
│ │ │ - │ │ │ -
227 subEntityDOFs.bind(localView, intersection);
│ │ │ -
228 return subEntityDOFs;
│ │ │ -
229}
│ │ │ -
│ │ │ -
230
│ │ │ -
231
│ │ │ -
232
│ │ │ -
233} // namespace Functions
│ │ │ -
234} // namespace Dune
│ │ │ -
235
│ │ │ -
236#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH
│ │ │ -
auto subEntityDOFs(const T &)
Create SubEntityDOFs object.
Definition subentitydofs.hh:167
│ │ │ +
22template<class ST, ST begin, ST end>
│ │ │ +
23struct StaticFindInRange
│ │ │ +
24{
│ │ │ +
25 template<class F, class...Args>
│ │ │ +
26 static void apply(F&& f, Args&&... args)
│ │ │ +
27 {
│ │ │ +
28 if (f(std::integral_constant<ST, begin>(), std::forward<Args>(args)...))
│ │ │ +
29 return;
│ │ │ +
30 StaticFindInRange<ST, begin+1, end>::apply(std::forward<F>(f), std::forward<Args>(args)...);
│ │ │ +
31 }
│ │ │ +
32};
│ │ │ +
33
│ │ │ +
34template<class ST, ST end>
│ │ │ +
35struct StaticFindInRange<ST, end, end>
│ │ │ +
36{
│ │ │ +
37 template<class F, class...Args>
│ │ │ +
38 static void apply(F&& f, Args&&...)
│ │ │ +
39 {}
│ │ │ +
40};
│ │ │ +
41
│ │ │ +
42} //end namespace Imp
│ │ │ +
43
│ │ │ +
44
│ │ │ +
45
│ │ │ +
59template<std::size_t begin_t, std::size_t end_t, class F, class... Args>
│ │ │ +
│ │ │ +
60void staticFindInRange(F&& f, Args&&... args)
│ │ │ +
61{
│ │ │ +
62 Imp::StaticFindInRange<std::size_t, begin_t, end_t>::apply(std::forward<F>(f), std::forward<Args>(args)...);
│ │ │ +
63}
│ │ │ +
│ │ │ +
64
│ │ │ +
65
│ │ │ +
66} // namespace Dune::Functions
│ │ │ +
67} // namespace Dune
│ │ │ +
68
│ │ │ +
69
│ │ │ +
70
│ │ │ +
71#endif //DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH
│ │ │ + │ │ │ +
void staticFindInRange(F &&f, Args &&... args)
Static find loop.
Definition staticforloop.hh:60
│ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
Range of DOFs associated to sub-entity.
Definition subentitydofs.hh:47
│ │ │ -
auto begin() const
Create begin iterator for access to range of contained local indices.
Definition subentitydofs.hh:117
│ │ │ -
auto size() const
Return number of contained DOFs.
Definition subentitydofs.hh:129
│ │ │ -
SubEntityDOFs & bind(const LocalView &localView, const Intersection &intersection)
Bind SubEntityDOFs object to LocalView and sub-entity.
Definition subentitydofs.hh:111
│ │ │ -
bool contains(std::size_t localIndex) const
Check if given local index is contained in this range of DOFs.
Definition subentitydofs.hh:141
│ │ │ -
auto end() const
Create end iterator for access to range of contained local indices.
Definition subentitydofs.hh:123
│ │ │ -
SubEntityDOFs & bind(const LocalView &localView, std::size_t subEntityIndex, std::size_t subEntityCodim)
Bind SubEntityDOFs object to LocalView and sub-entity.
Definition subentitydofs.hh:69
│ │ │ + │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,185 +1,83 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -subentitydofs.hh │ │ │ │ +staticforloop.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH │ │ │ │ +8#define DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11 │ │ │ │ -12#include │ │ │ │ -13 │ │ │ │ -14#include │ │ │ │ +10 │ │ │ │ +11#include │ │ │ │ +12 │ │ │ │ +13#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ +14#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ 15 │ │ │ │ 16 │ │ │ │ -17 │ │ │ │ -18namespace _D_u_n_e { │ │ │ │ -19namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -20 │ │ │ │ +17namespace _D_u_n_e { │ │ │ │ +18namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +19 │ │ │ │ +20namespace Imp { │ │ │ │ 21 │ │ │ │ -22 │ │ │ │ -45template │ │ │ │ -_4_6class _S_u_b_E_n_t_i_t_y_D_O_F_s │ │ │ │ -47{ │ │ │ │ -48 static const int dim = GridView::dimension; │ │ │ │ -49 │ │ │ │ -50public: │ │ │ │ -51 │ │ │ │ -68 template │ │ │ │ -_6_9 _S_u_b_E_n_t_i_t_y_D_O_F_s& _b_i_n_d(const LocalView& localView, std::size_t subEntityIndex, │ │ │ │ -std::size_t subEntityCodim) │ │ │ │ -70 { │ │ │ │ -71 // fill vector with local indices of all DOFs contained in subentity │ │ │ │ -72 containedDOFs_.clear(); │ │ │ │ -73 dofIsContained_.assign(localView.size(), false); │ │ │ │ -74 │ │ │ │ -75 auto re = Dune::referenceElement(localView.element().type()); │ │ │ │ -76 │ │ │ │ -77 Dune::TypeTree::forEachLeafNode(localView.tree(), [&](auto&& node, auto&& / │ │ │ │ -*treePath*/) { │ │ │ │ -78 if (node.empty()) │ │ │ │ -79 return; │ │ │ │ -80 const auto& localCoefficients = node.finiteElement().localCoefficients(); │ │ │ │ -81 std::size_t localSize = localCoefficients.size(); │ │ │ │ -82 for(std::size_t i=0; i │ │ │ │ -_1_1_1 _S_u_b_E_n_t_i_t_y_D_O_F_s& _b_i_n_d(const LocalView& localView, const Intersection& │ │ │ │ -intersection) │ │ │ │ -112 { │ │ │ │ -113 return _b_i_n_d(localView, intersection.indexInInside(), 1); │ │ │ │ -114 } │ │ │ │ -115 │ │ │ │ -_1_1_7 auto _b_e_g_i_n() const │ │ │ │ -118 { │ │ │ │ -119 return containedDOFs_.cbegin(); │ │ │ │ -120 } │ │ │ │ -121 │ │ │ │ -_1_2_3 auto _e_n_d() const │ │ │ │ -124 { │ │ │ │ -125 return containedDOFs_.cend(); │ │ │ │ -126 } │ │ │ │ -127 │ │ │ │ -_1_2_9 auto _s_i_z_e() const │ │ │ │ -130 { │ │ │ │ -131 return containedDOFs_.size(); │ │ │ │ -132 } │ │ │ │ -133 │ │ │ │ -_1_3_5 decltype(auto) operator[](std::size_t i) const │ │ │ │ -136 { │ │ │ │ -137 return containedDOFs_[i]; │ │ │ │ -138 } │ │ │ │ -139 │ │ │ │ -_1_4_1 bool _c_o_n_t_a_i_n_s(std::size_t localIndex) const │ │ │ │ -142 { │ │ │ │ -143 return dofIsContained_[localIndex]; │ │ │ │ -144 } │ │ │ │ -145 │ │ │ │ -146private: │ │ │ │ -147 │ │ │ │ -148 std::vector containedDOFs_; │ │ │ │ -149 std::vector dofIsContained_; │ │ │ │ -150}; │ │ │ │ -151 │ │ │ │ -152 │ │ │ │ -153 │ │ │ │ -166template │ │ │ │ -_1_6_7auto _s_u_b_E_n_t_i_t_y_D_O_F_s(const T&) │ │ │ │ -168{ │ │ │ │ -169 return _S_u_b_E_n_t_i_t_y_D_O_F_s_<_t_y_p_e_n_a_m_e_ _T_:_:_G_r_i_d_V_i_e_w_>{}; │ │ │ │ -170} │ │ │ │ -171 │ │ │ │ -172 │ │ │ │ -173 │ │ │ │ -193template │ │ │ │ -_1_9_4auto _s_u_b_E_n_t_i_t_y_D_O_F_s(const LocalView& localView, std::size_t subEntityIndex, │ │ │ │ -std::size_t subEntityCodim) │ │ │ │ -195{ │ │ │ │ -196 using GridView = typename LocalView::GridView; │ │ │ │ -197 _S_u_b_E_n_t_i_t_y_D_O_F_s_<_G_r_i_d_V_i_e_w_> _s_u_b_E_n_t_i_t_y_D_O_F_s; │ │ │ │ -198 _s_u_b_E_n_t_i_t_y_D_O_F_s.bind(localView, subEntityIndex, subEntityCodim); │ │ │ │ -199 return _s_u_b_E_n_t_i_t_y_D_O_F_s; │ │ │ │ -200} │ │ │ │ -201 │ │ │ │ -202 │ │ │ │ -203 │ │ │ │ -222template │ │ │ │ -_2_2_3auto _s_u_b_E_n_t_i_t_y_D_O_F_s(const LocalView& localView, const Intersection& │ │ │ │ -intersection) │ │ │ │ -224{ │ │ │ │ -225 using GridView = typename LocalView::GridView; │ │ │ │ -226 _S_u_b_E_n_t_i_t_y_D_O_F_s_<_G_r_i_d_V_i_e_w_> _s_u_b_E_n_t_i_t_y_D_O_F_s; │ │ │ │ -227 _s_u_b_E_n_t_i_t_y_D_O_F_s.bind(localView, intersection); │ │ │ │ -228 return _s_u_b_E_n_t_i_t_y_D_O_F_s; │ │ │ │ -229} │ │ │ │ -230 │ │ │ │ -231 │ │ │ │ -232 │ │ │ │ -233} // namespace Functions │ │ │ │ -234} // namespace Dune │ │ │ │ -235 │ │ │ │ -236#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_s_u_b_E_n_t_i_t_y_D_O_F_s │ │ │ │ -auto subEntityDOFs(const T &) │ │ │ │ -Create SubEntityDOFs object. │ │ │ │ -DDeeffiinniittiioonn subentitydofs.hh:167 │ │ │ │ +22template │ │ │ │ +23struct StaticFindInRange │ │ │ │ +24{ │ │ │ │ +25 template │ │ │ │ +26 static void apply(F&& f, Args&&... args) │ │ │ │ +27 { │ │ │ │ +28 if (f(std::integral_constant(), std::forward(args)...)) │ │ │ │ +29 return; │ │ │ │ +30 StaticFindInRange::apply(std::forward(f), std:: │ │ │ │ +forward(args)...); │ │ │ │ +31 } │ │ │ │ +32}; │ │ │ │ +33 │ │ │ │ +34template │ │ │ │ +35struct StaticFindInRange │ │ │ │ +36{ │ │ │ │ +37 template │ │ │ │ +38 static void apply(F&& f, Args&&...) │ │ │ │ +39 {} │ │ │ │ +40}; │ │ │ │ +41 │ │ │ │ +42} //end namespace Imp │ │ │ │ +43 │ │ │ │ +44 │ │ │ │ +45 │ │ │ │ +59template │ │ │ │ +_6_0void _s_t_a_t_i_c_F_i_n_d_I_n_R_a_n_g_e(F&& f, Args&&... args) │ │ │ │ +61{ │ │ │ │ +62 Imp::StaticFindInRange::apply(std::forward │ │ │ │ +(f), std::forward(args)...); │ │ │ │ +63} │ │ │ │ +64 │ │ │ │ +65 │ │ │ │ +66} // namespace Dune::Functions │ │ │ │ +67} // namespace Dune │ │ │ │ +68 │ │ │ │ +69 │ │ │ │ +70 │ │ │ │ +71#endif //DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH │ │ │ │ +_t_y_p_e___t_r_a_i_t_s_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_s_t_a_t_i_c_F_i_n_d_I_n_R_a_n_g_e │ │ │ │ +void staticFindInRange(F &&f, Args &&... args) │ │ │ │ +Static find loop. │ │ │ │ +DDeeffiinniittiioonn staticforloop.hh:60 │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_E_n_t_i_t_y_D_O_F_s │ │ │ │ -Range of DOFs associated to sub-entity. │ │ │ │ -DDeeffiinniittiioonn subentitydofs.hh:47 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_E_n_t_i_t_y_D_O_F_s_:_:_b_e_g_i_n │ │ │ │ -auto begin() const │ │ │ │ -Create begin iterator for access to range of contained local indices. │ │ │ │ -DDeeffiinniittiioonn subentitydofs.hh:117 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_E_n_t_i_t_y_D_O_F_s_:_:_s_i_z_e │ │ │ │ -auto size() const │ │ │ │ -Return number of contained DOFs. │ │ │ │ -DDeeffiinniittiioonn subentitydofs.hh:129 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_E_n_t_i_t_y_D_O_F_s_:_:_b_i_n_d │ │ │ │ -SubEntityDOFs & bind(const LocalView &localView, const Intersection │ │ │ │ -&intersection) │ │ │ │ -Bind SubEntityDOFs object to LocalView and sub-entity. │ │ │ │ -DDeeffiinniittiioonn subentitydofs.hh:111 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_E_n_t_i_t_y_D_O_F_s_:_:_c_o_n_t_a_i_n_s │ │ │ │ -bool contains(std::size_t localIndex) const │ │ │ │ -Check if given local index is contained in this range of DOFs. │ │ │ │ -DDeeffiinniittiioonn subentitydofs.hh:141 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_E_n_t_i_t_y_D_O_F_s_:_:_e_n_d │ │ │ │ -auto end() const │ │ │ │ -Create end iterator for access to range of contained local indices. │ │ │ │ -DDeeffiinniittiioonn subentitydofs.hh:123 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_E_n_t_i_t_y_D_O_F_s_:_:_b_i_n_d │ │ │ │ -SubEntityDOFs & bind(const LocalView &localView, std::size_t subEntityIndex, │ │ │ │ -std::size_t subEntityCodim) │ │ │ │ -Bind SubEntityDOFs object to LocalView and sub-entity. │ │ │ │ -DDeeffiinniittiioonn subentitydofs.hh:69 │ │ │ │ +_c_o_n_c_e_p_t_s_._h_h │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _s_u_b_e_n_t_i_t_y_d_o_f_s_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _s_t_a_t_i_c_f_o_r_l_o_o_p_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00092.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: restrictedbasis.hh File Reference │ │ │ +Dune-Functions: signature.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,56 +88,56 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
restrictedbasis.hh File Reference
│ │ │ +
signature.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <cstddef>
│ │ │ -#include <utility>
│ │ │ -#include <dune/common/typetree/traversal.hh>
│ │ │ -#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ +
#include <type_traits>
│ │ │ +#include <tuple>
│ │ │ +#include <dune/functions/common/defaultderivativetraits.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::Experimental::RestrictedPreBasis< GV, SDPB, SD >
 A pre-basis restricted to a sub-domain. More...
class  Dune::Functions::Experimental::RestrictedPreBasis< GV, SDPB, SD >::Node
 Template mapping root tree path to type of created tree node. More...
struct  Dune::Functions::SignatureTraits< Signature, isCallable >
 Helper class to deduce the signature of a callable. More...
struct  Dune::Functions::SignatureTag< Range(Domain), DerivativeTraitsT >
 Tag-class to encapsulate signature information. More...
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::Experimental
namespace  Dune::Functions::Experimental::BasisFactory
│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Functions

template<class SubDomainBasisFactory, class SubDomain>
auto Dune::Functions::Experimental::BasisFactory::restrict (SubDomainBasisFactory &&subPreBasisFactory, const SubDomain &subDomain)
 Create a RestrictedPreBasisFactory.
template<class Range, class Domain, template< class > class DerivativeTraits>
auto Dune::Functions::derivativeSignatureTag (SignatureTag< Range(Domain), DerivativeTraits > tag)
 Construct SignatureTag for derivative.
template<std::size_t maxOrder, class Signature, template< class > class DerivativeTraits>
auto Dune::Functions::derivativeSignatureTags (Dune::Functions::SignatureTag< Signature, DerivativeTraits > tag)
 Construct SignatureTags for derivatives.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,30 +1,32 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -restrictedbasis.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ +signature.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_<_ _G_V_,_ _S_D_P_B_,_ _S_D_ _> │ │ │ │ -  A pre-basis restricted to a sub-domain. _M_o_r_e_._._. │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_<_ _G_V_,_ _S_D_P_B_,_ _S_D_ _>_:_:_N_o_d_e │ │ │ │ -  Template mapping root tree path to type of created tree node. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_g_n_a_t_u_r_e_T_r_a_i_t_s_<_ _S_i_g_n_a_t_u_r_e_,_ _i_s_C_a_l_l_a_b_l_e_ _> │ │ │ │ +  Helper class to deduce the signature of a callable. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_g_n_a_t_u_r_e_T_a_g_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_T_ _> │ │ │ │ +  Tag-class to encapsulate signature information. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_r_e_s_t_r_i_c_t │ │ │ │ - (SubDomainBasisFactory &&subPreBasisFactory, const _S_u_b_D_o_m_a_i_n &subDomain) │ │ │ │ -  Create a RestrictedPreBasisFactory. │ │ │ │ +template class DerivativeTraits> │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_d_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e_T_a_g (_S_i_g_n_a_t_u_r_e_T_a_g< Range(Domain), │ │ │ │ + DerivativeTraits > tag) │ │ │ │ +  Construct _S_i_g_n_a_t_u_r_e_T_a_g for derivative. │ │ │ │ +template class │ │ │ │ +DerivativeTraits> │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_d_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e_T_a_g_s (_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_g_n_a_t_u_r_e_T_a_g< │ │ │ │ + Signature, DerivativeTraits > tag) │ │ │ │ +  Construct SignatureTags for derivatives. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _r_e_s_t_r_i_c_t_e_d_b_a_s_i_s_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _s_i_g_n_a_t_u_r_e_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00092.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,4 +1,4 @@ │ │ │ │ var a00092 = [ │ │ │ │ - ["Dune::Functions::Experimental::RestrictedPreBasis< GV, SDPB, SD >::Node", "a02134.html", "a02134"], │ │ │ │ - ["Dune::Functions::Experimental::BasisFactory::restrict", "a00312.html#gac8fb8e934e9b092c8da8de6b22e69e82", null] │ │ │ │ + ["Dune::Functions::derivativeSignatureTag", "a00309.html#ga18b2a675f9153814c422d33878daebb2", null], │ │ │ │ + ["Dune::Functions::derivativeSignatureTags", "a00309.html#ga95d38d90c6b8ee6d3a2a0202cb80b56d", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00092_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: restrictedbasis.hh Source File │ │ │ +Dune-Functions: signature.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,274 +88,175 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
restrictedbasis.hh
│ │ │ +
signature.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RESTRICTEDBASIS_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RESTRICTEDBASIS_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_COMMON_SIGNATURE_HH
│ │ │ +
8#define DUNE_FUNCTIONS_COMMON_SIGNATURE_HH
│ │ │
9
│ │ │ -
10#include <cstddef>
│ │ │ -
11#include <utility>
│ │ │ +
10#include <type_traits>
│ │ │ +
11#include <tuple>
│ │ │
12
│ │ │ -
13#include <dune/common/typetree/traversal.hh>
│ │ │ + │ │ │
14
│ │ │ - │ │ │ -
16
│ │ │ -
17
│ │ │ - │ │ │ -
19
│ │ │ -
20
│ │ │ -
21
│ │ │ -
42template<class GV, class SDPB, class SD>
│ │ │ -
│ │ │ - │ │ │ -
44{
│ │ │ - │ │ │ +
15namespace Dune {
│ │ │ +
16namespace Functions {
│ │ │ +
17
│ │ │ +
23template<typename F>
│ │ │ + │ │ │ +
25
│ │ │ +
26#ifndef DOXYGEN
│ │ │ +
27template<typename F>
│ │ │ +
28struct IsCallable
│ │ │ +
29{
│ │ │ +
30 struct yes { std::size_t dummy[2]; };
│ │ │ +
31 struct no { std::size_t dummy[1]; };
│ │ │ +
32
│ │ │ +
33 template<typename C>
│ │ │ +
34 static yes test(const decltype(&C::operator()) *);
│ │ │ +
35 template<typename C>
│ │ │ +
36 static no test(...);
│ │ │ +
37
│ │ │ +
38 enum { value = (sizeof(test<F>(0)) == sizeof(yes)) };
│ │ │ +
39};
│ │ │ +
40
│ │ │ +
41template<typename R, typename D>
│ │ │ +
42struct IsCallable<R(D)>
│ │ │ +
43{
│ │ │ +
44 enum { value = true };
│ │ │ +
45};
│ │ │
46
│ │ │ -
47public:
│ │ │ -
48
│ │ │ -
49 using SubDomain = SD;
│ │ │ -
50 using SubDomainPreBasis = SDPB;
│ │ │ -
51 using SubDomainGridView = typename SubDomainPreBasis::GridView;
│ │ │ -
52
│ │ │ -
54 using GridView = GV;
│ │ │ -
55
│ │ │ -
57 using size_type = std::size_t;
│ │ │ -
58
│ │ │ -
│ │ │ -
60 class Node
│ │ │ -
61 : public SubDomainPreBasis::Node
│ │ │ -
62 {
│ │ │ -
63 using Base = typename SubDomainPreBasis::Node;
│ │ │ -
64 public:
│ │ │ -
65
│ │ │ -
66 using Element = typename Base::Element;
│ │ │ -
67
│ │ │ -
│ │ │ -
68 Node(Base&& base, const SubDomainGridView& subDomainGridView, const SubDomain& subDomain)
│ │ │ -
69 : Base(base)
│ │ │ -
70 , subDomainGridView_(subDomainGridView)
│ │ │ -
71 , subDomain_(subDomain)
│ │ │ -
72 {}
│ │ │ -
│ │ │ -
73
│ │ │ -
│ │ │ -
74 void bind(const Element& element)
│ │ │ -
75 {
│ │ │ -
76 if (subDomainGridView_.contains(element))
│ │ │ -
77 Base::bind(element);
│ │ │ -
78 else
│ │ │ -
79 {
│ │ │ -
80 Dune::TypeTree::forEachNode(static_cast<Base&>(*this) , [&](auto& node, const auto& treePath) {
│ │ │ -
81 Dune::Functions::Impl::BasisNodeSetupHelper::setOffset(node, this->offset());
│ │ │ -
82 Dune::Functions::Impl::BasisNodeSetupHelper::setSize(node, 0);
│ │ │ -
83 });
│ │ │ -
84 }
│ │ │ -
85 }
│ │ │ -
│ │ │ -
86
│ │ │ -
│ │ │ -
87 const SubDomain& subDomain() const
│ │ │ -
88 {
│ │ │ -
89 return subDomain_;
│ │ │ -
90 }
│ │ │ -
│ │ │ -
91
│ │ │ -
92 private:
│ │ │ -
93 const SubDomainGridView& subDomainGridView_;
│ │ │ -
94 const SubDomain& subDomain_;
│ │ │ -
95 };
│ │ │ -
│ │ │ +
47template<typename R, typename D>
│ │ │ +
48struct IsCallable<R(*)(D)>
│ │ │ +
49{
│ │ │ +
50 enum { value = true };
│ │ │ +
51};
│ │ │ +
52#endif
│ │ │ +
53
│ │ │ +
59template<class Signature, bool isCallable = IsCallable<Signature>::value >
│ │ │ + │ │ │ +
61
│ │ │ +
62#ifndef DOXYGEN
│ │ │ +
64template<class T>
│ │ │ +
65struct SignatureTraits<T, true>
│ │ │ +
66 : public SignatureTraits<decltype(&T::operator()), true>
│ │ │ +
67{};
│ │ │ +
68
│ │ │ +
70template <typename C, typename R, typename D>
│ │ │ +
71struct SignatureTraits<R(C::*)(D) const, true>
│ │ │ +
72 : public SignatureTraits<R(D), true>
│ │ │ +
73{};
│ │ │ +
74
│ │ │ +
76template <typename C, typename R, typename D>
│ │ │ +
77struct SignatureTraits<R(C::*)(D), true>
│ │ │ +
78 : public SignatureTraits<R(D), true>
│ │ │ +
79{};
│ │ │ +
80
│ │ │ +
82template <typename R, typename D>
│ │ │ +
83struct SignatureTraits<R(*)(D), true>
│ │ │ +
84 : public SignatureTraits<R(D), true>
│ │ │ +
85{};
│ │ │ +
86
│ │ │ +
88template<class R, class D>
│ │ │ +
89struct SignatureTraits<R(D), true>
│ │ │ +
90{
│ │ │ +
91 using Range = R;
│ │ │ +
92 using Domain = D;
│ │ │ +
93
│ │ │ +
94 using RawRange = std::decay_t<Range>;
│ │ │ +
95 using RawDomain = std::decay_t<Domain>;
│ │ │
96
│ │ │ -
97 static constexpr size_type maxMultiIndexSize = SubDomainPreBasis::maxMultiIndexSize;
│ │ │ -
98 static constexpr size_type minMultiIndexSize = SubDomainPreBasis::minMultiIndexSize;
│ │ │ -
99 static constexpr size_type multiIndexBufferSize = SubDomainPreBasis::multiIndexBufferSize;
│ │ │ -
100
│ │ │ -
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
110 , subDomainPtr_(&subDomain)
│ │ │ -
111 {}
│ │ │ -
│ │ │ -
112
│ │ │ -
│ │ │ - │ │ │ -
115 {
│ │ │ -
116 subDomainPreBasis_.initializeIndices();
│ │ │ -
117 }
│ │ │ -
│ │ │ -
118
│ │ │ -
│ │ │ -
120 const GridView& gridView() const
│ │ │ -
121 {
│ │ │ -
122 return gridView_;
│ │ │ -
123 }
│ │ │ -
│ │ │ -
124
│ │ │ -
│ │ │ -
133 void update(const GridView& gv)
│ │ │ -
134 {
│ │ │ -
135 gridView_ = gv;
│ │ │ -
136 subDomainPreBasis_.update(subDomainPtr_->gridView());
│ │ │ -
137 }
│ │ │ -
│ │ │ -
138
│ │ │ -
│ │ │ - │ │ │ -
143 {
│ │ │ -
144 return Node(subDomainPreBasis_.makeNode(), subDomainPreBasis_.gridView(), *subDomainPtr_);
│ │ │ -
145 }
│ │ │ -
│ │ │ -
146
│ │ │ -
│ │ │ - │ │ │ -
149 {
│ │ │ -
150 return subDomainPreBasis_.size();
│ │ │ -
151 }
│ │ │ -
│ │ │ -
152
│ │ │ -
154 template<class SizePrefix>
│ │ │ -
│ │ │ -
155 size_type size(const SizePrefix& prefix) const
│ │ │ -
156 {
│ │ │ -
157 return subDomainPreBasis_.size(prefix);
│ │ │ -
158 }
│ │ │ -
│ │ │ -
159
│ │ │ -
│ │ │ - │ │ │ -
162 {
│ │ │ -
163 return subDomainPreBasis_.containerDescriptor();
│ │ │ -
164 }
│ │ │ -
│ │ │ -
165
│ │ │ -
│ │ │ - │ │ │ -
168 {
│ │ │ -
169 return subDomainPreBasis_.dimension();
│ │ │ -
170 }
│ │ │ -
│ │ │ -
171
│ │ │ -
│ │ │ - │ │ │ -
174 {
│ │ │ -
175 return subDomainPreBasis_.maxNodeSize();
│ │ │ -
176 }
│ │ │ +
97 using RawSignature = RawRange(RawDomain);
│ │ │ +
98
│ │ │ +
99 template<template<class> class DerivativeTraits=DefaultDerivativeTraits>
│ │ │ +
100 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(Domain);
│ │ │ +
101};
│ │ │ +
102#endif
│ │ │ +
103
│ │ │ +
104
│ │ │ +
105template<class Signature, template<class> class DerivativeTraits=DefaultDerivativeTraits>
│ │ │ + │ │ │ +
107
│ │ │ +
117template<class Range, class Domain, template<class> class DerivativeTraitsT>
│ │ │ +
│ │ │ +
118struct SignatureTag<Range(Domain), DerivativeTraitsT>
│ │ │ +
119{
│ │ │ +
120 using Signature = Range(Domain);
│ │ │ +
121
│ │ │ +
122 template<class T>
│ │ │ +
123 using DerivativeTraits = DerivativeTraitsT<T>;
│ │ │ +
124};
│ │ │ +
│ │ │ +
125
│ │ │ +
126
│ │ │ +
127
│ │ │ +
136template<class Range, class Domain, template<class> class DerivativeTraits>
│ │ │ +
│ │ │ +
137auto derivativeSignatureTag(SignatureTag<Range(Domain), DerivativeTraits> tag)
│ │ │ +
138{
│ │ │ +
139 using DerivativeRange = typename DerivativeTraits<Range(Domain)>::Range;
│ │ │ + │ │ │ +
141}
│ │ │ +
│ │ │ +
142
│ │ │ +
143
│ │ │ +
144
│ │ │ +
158template<std::size_t maxOrder, class Signature, template<class> class DerivativeTraits>
│ │ │ +
│ │ │ + │ │ │ +
160{
│ │ │ +
161 if constexpr (maxOrder==0) {
│ │ │ +
162 // If maxOrder== 0 we just need the given SignatureTag
│ │ │ +
163 return std::make_tuple(tag);
│ │ │ +
164 } else {
│ │ │ +
165 // else we first construct the tail tuple with SignatureTags for derivatives
│ │ │ +
166 // of order 1 to maxOrder
│ │ │ +
167 auto tailTagsTuple = derivativeSignatureTags<std::size_t(maxOrder-1)>(derivativeSignatureTag(tag));
│ │ │ +
168 // and prepend this with the given SignatureTag.
│ │ │ +
169 // This is done by unpacking the tail tuple with apply().
│ │ │ +
170 return std::apply([&](auto&&... tailTags){
│ │ │ +
171 return std::make_tuple(tag, tailTags...);
│ │ │ +
172 }, tailTagsTuple);
│ │ │ +
173 }
│ │ │ +
174}
│ │ │
│ │ │ +
175
│ │ │ +
176
│ │ │
177
│ │ │ -
│ │ │ - │ │ │ -
179 {
│ │ │ -
180 return subDomainPreBasis_;
│ │ │ -
181 }
│ │ │ -
│ │ │ -
182
│ │ │ -
│ │ │ - │ │ │ -
184 {
│ │ │ -
185 return subDomainPreBasis_;
│ │ │ -
186 }
│ │ │ -
│ │ │ -
187
│ │ │ -
188 template<typename It>
│ │ │ -
│ │ │ -
189 It indices(const Node& node, It it) const
│ │ │ -
190 {
│ │ │ -
191 if (node.size() == 0)
│ │ │ -
192 return it;
│ │ │ -
193 else
│ │ │ -
194 return subDomainPreBasis_.indices(node, it);
│ │ │ -
195 }
│ │ │ -
│ │ │ -
196
│ │ │ -
197protected:
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
201};
│ │ │ -
│ │ │ -
202
│ │ │ -
203
│ │ │ -
204
│ │ │ -
│ │ │ -
205namespace BasisFactory {
│ │ │ -
206
│ │ │ -
224template<class SubDomainBasisFactory, class SubDomain>
│ │ │ -
│ │ │ -
225auto restrict(SubDomainBasisFactory&& subPreBasisFactory, const SubDomain& subDomain)
│ │ │ -
226{
│ │ │ -
227 return [
│ │ │ -
228 subPreBasisFactory=std::forward<SubDomainBasisFactory>(subPreBasisFactory),
│ │ │ -
229 &subDomain
│ │ │ -
230 ](const auto& gridView) {
│ │ │ -
231 return Dune::Functions::Experimental::RestrictedPreBasis(gridView, subPreBasisFactory(subDomain.gridView()), subDomain);
│ │ │ -
232 };
│ │ │ -
233}
│ │ │ -
│ │ │ -
234
│ │ │ -
235
│ │ │ -
236} // end namespace BasisFactory
│ │ │ -
│ │ │ -
237} // end namespace Dune::Functions::Experimental
│ │ │ -
238
│ │ │ -
239
│ │ │ -
240#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RESTRICTEDBASIS_HH
│ │ │ - │ │ │ -
auto restrict(SubDomainBasisFactory &&subPreBasisFactory, const SubDomain &subDomain)
Create a RestrictedPreBasisFactory.
Definition restrictedbasis.hh:225
│ │ │ -
Definition subdomain.hh:28
│ │ │ -
Definition restrictedbasis.hh:205
│ │ │ -
Class representing a sub-domain of a GridView.
Definition subdomain.hh:534
│ │ │ -
GridView gridView() const
Create grid view representing the SubDomain.
Definition subdomain.hh:565
│ │ │ -
A pre-basis restricted to a sub-domain.
Definition restrictedbasis.hh:44
│ │ │ -
std::size_t size_type
Type used for indices and size information.
Definition restrictedbasis.hh:57
│ │ │ -
RestrictedPreBasis(const GridView &gridView, SubDomainPreBasis &&subDomainPreBasis, const SubDomain &subDomain)
Constructor for given sub-domain pre-basis.
Definition restrictedbasis.hh:107
│ │ │ -
void initializeIndices()
Initialize the global indices.
Definition restrictedbasis.hh:114
│ │ │ -
const SubDomainPreBasis & subDomainPreBasis() const
Definition restrictedbasis.hh:178
│ │ │ -
SDPB SubDomainPreBasis
Definition restrictedbasis.hh:50
│ │ │ -
static constexpr size_type minMultiIndexSize
Definition restrictedbasis.hh:98
│ │ │ -
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition restrictedbasis.hh:167
│ │ │ -
SubDomainPreBasis subDomainPreBasis_
Definition restrictedbasis.hh:199
│ │ │ -
SubDomainPreBasis & subDomainPreBasis()
Definition restrictedbasis.hh:183
│ │ │ -
GV GridView
The grid view that the FE basis is defined on.
Definition restrictedbasis.hh:54
│ │ │ -
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition restrictedbasis.hh:173
│ │ │ -
SD SubDomain
Definition restrictedbasis.hh:49
│ │ │ -
size_type size() const
Same as size(prefix) with empty prefix.
Definition restrictedbasis.hh:148
│ │ │ -
const SubDomain * subDomainPtr_
Definition restrictedbasis.hh:200
│ │ │ -
size_type size(const SizePrefix &prefix) const
Return number of possible values for next position in multi index.
Definition restrictedbasis.hh:155
│ │ │ -
typename SubDomainPreBasis::GridView SubDomainGridView
Definition restrictedbasis.hh:51
│ │ │ -
static constexpr size_type multiIndexBufferSize
Definition restrictedbasis.hh:99
│ │ │ -
GridView gridView_
Definition restrictedbasis.hh:198
│ │ │ -
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition restrictedbasis.hh:120
│ │ │ -
It indices(const Node &node, It it) const
Definition restrictedbasis.hh:189
│ │ │ -
auto containerDescriptor() const
Return the container descriptor of the pre-basis.
Definition restrictedbasis.hh:161
│ │ │ -
Node makeNode() const
Create tree node.
Definition restrictedbasis.hh:142
│ │ │ -
static constexpr size_type maxMultiIndexSize
Definition restrictedbasis.hh:97
│ │ │ -
void update(const GridView &gv)
Update the stored grid view, to be called.
Definition restrictedbasis.hh:133
│ │ │ -
Template mapping root tree path to type of created tree node.
Definition restrictedbasis.hh:62
│ │ │ -
typename Base::Element Element
Definition restrictedbasis.hh:66
│ │ │ -
void bind(const Element &element)
Definition restrictedbasis.hh:74
│ │ │ -
const SubDomain & subDomain() const
Definition restrictedbasis.hh:87
│ │ │ -
Node(Base &&base, const SubDomainGridView &subDomainGridView, const SubDomain &subDomain)
Definition restrictedbasis.hh:68
│ │ │ +
178} // namespace Functions
│ │ │ +
179} // namespace Dune
│ │ │ +
180
│ │ │ +
181#endif // DUNE_FUNCTIONS_COMMON_SIGNATURE_HH
│ │ │ + │ │ │ +
auto derivativeSignatureTag(SignatureTag< Range(Domain), DerivativeTraits > tag)
Construct SignatureTag for derivative.
Definition signature.hh:137
│ │ │ +
auto derivativeSignatureTags(Dune::Functions::SignatureTag< Signature, DerivativeTraits > tag)
Construct SignatureTags for derivatives.
Definition signature.hh:159
│ │ │ +
Definition monomialset.hh:19
│ │ │ +
Definition monomialset.hh:19
│ │ │ +
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:41
│ │ │ +
Helper class to check that F is callable.
Definition signature.hh:24
│ │ │ +
Helper class to deduce the signature of a callable.
Definition signature.hh:60
│ │ │ +
Definition signature.hh:106
│ │ │ +
DerivativeTraitsT< T > DerivativeTraits
Definition signature.hh:123
│ │ │ + │ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,320 +1,189 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -restrictedbasis.hh │ │ │ │ +signature.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RESTRICTEDBASIS_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RESTRICTEDBASIS_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_COMMON_SIGNATURE_HH │ │ │ │ +8#define DUNE_FUNCTIONS_COMMON_SIGNATURE_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ 12 │ │ │ │ -13#include │ │ │ │ +13#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ 14 │ │ │ │ -15#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -16 │ │ │ │ +15namespace _D_u_n_e { │ │ │ │ +16namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ 17 │ │ │ │ -18namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l { │ │ │ │ -19 │ │ │ │ -20 │ │ │ │ -21 │ │ │ │ -42template │ │ │ │ -_4_3class _R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s │ │ │ │ -44{ │ │ │ │ -45 using This = _R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_<_G_V_,_ _S_D_P_B_,_ _S_D_>; │ │ │ │ +23template │ │ │ │ +_2_4struct _I_s_C_a_l_l_a_b_l_e; │ │ │ │ +25 │ │ │ │ +26#ifndef DOXYGEN │ │ │ │ +27template │ │ │ │ +28struct _I_s_C_a_l_l_a_b_l_e │ │ │ │ +29{ │ │ │ │ +30 struct yes { std::size_t dummy[2]; }; │ │ │ │ +31 struct no { std::size_t dummy[1]; }; │ │ │ │ +32 │ │ │ │ +33 template │ │ │ │ +34 static yes test(const decltype(&C::operator()) *); │ │ │ │ +35 template │ │ │ │ +36 static no test(...); │ │ │ │ +37 │ │ │ │ +38 enum { value = (sizeof(test(0)) == sizeof(yes)) }; │ │ │ │ +39}; │ │ │ │ +40 │ │ │ │ +41template │ │ │ │ +42struct _I_s_C_a_l_l_a_b_l_e │ │ │ │ +43{ │ │ │ │ +44 enum { value = true }; │ │ │ │ +45}; │ │ │ │ 46 │ │ │ │ -47public: │ │ │ │ -48 │ │ │ │ -_4_9 using _S_u_b_D_o_m_a_i_n = SD; │ │ │ │ -_5_0 using _S_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s = SDPB; │ │ │ │ -_5_1 using _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w = typename SubDomainPreBasis::GridView; │ │ │ │ -52 │ │ │ │ -_5_4 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ -55 │ │ │ │ -_5_7 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ -58 │ │ │ │ -_6_0 class _N_o_d_e │ │ │ │ -61 : public SubDomainPreBasis::Node │ │ │ │ -62 { │ │ │ │ -63 using Base = typename SubDomainPreBasis::Node; │ │ │ │ -64 public: │ │ │ │ -65 │ │ │ │ -_6_6 using _E_l_e_m_e_n_t = typename Base::Element; │ │ │ │ -67 │ │ │ │ -_6_8 _N_o_d_e(Base&& base, const _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w& subDomainGridView, const │ │ │ │ -_S_u_b_D_o_m_a_i_n& _s_u_b_D_o_m_a_i_n) │ │ │ │ -69 : Base(base) │ │ │ │ -70 , subDomainGridView_(subDomainGridView) │ │ │ │ -71 , subDomain_(_s_u_b_D_o_m_a_i_n) │ │ │ │ -72 {} │ │ │ │ -73 │ │ │ │ -_7_4 void _b_i_n_d(const _E_l_e_m_e_n_t& element) │ │ │ │ -75 { │ │ │ │ -76 if (subDomainGridView_.contains(element)) │ │ │ │ -77 Base::bind(element); │ │ │ │ -78 else │ │ │ │ -79 { │ │ │ │ -80 Dune::TypeTree::forEachNode(static_cast(*this) , [&](auto& node, │ │ │ │ -const auto& treePath) { │ │ │ │ -81 Dune::Functions::Impl::BasisNodeSetupHelper::setOffset(node, this->offset │ │ │ │ -()); │ │ │ │ -82 Dune::Functions::Impl::BasisNodeSetupHelper::setSize(node, 0); │ │ │ │ -83 }); │ │ │ │ -84 } │ │ │ │ -85 } │ │ │ │ +47template │ │ │ │ +48struct _I_s_C_a_l_l_a_b_l_e │ │ │ │ +49{ │ │ │ │ +50 enum { value = true }; │ │ │ │ +51}; │ │ │ │ +52#endif │ │ │ │ +53 │ │ │ │ +59template::value > │ │ │ │ +_6_0struct _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s {}; │ │ │ │ +61 │ │ │ │ +62#ifndef DOXYGEN │ │ │ │ +64template │ │ │ │ +65struct _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s │ │ │ │ +66 : public _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s │ │ │ │ +67{}; │ │ │ │ +68 │ │ │ │ +70template │ │ │ │ +71struct SignatureTraits │ │ │ │ +72 : public SignatureTraits │ │ │ │ +73{}; │ │ │ │ +74 │ │ │ │ +76template │ │ │ │ +77struct SignatureTraits │ │ │ │ +78 : public SignatureTraits │ │ │ │ +79{}; │ │ │ │ +80 │ │ │ │ +82template │ │ │ │ +83struct _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s │ │ │ │ +84 : public _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s │ │ │ │ +85{}; │ │ │ │ 86 │ │ │ │ -_8_7 const _S_u_b_D_o_m_a_i_n& _s_u_b_D_o_m_a_i_n() const │ │ │ │ -88 { │ │ │ │ -89 return subDomain_; │ │ │ │ -90 } │ │ │ │ -91 │ │ │ │ -92 private: │ │ │ │ -93 const _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w& subDomainGridView_; │ │ │ │ -94 const _S_u_b_D_o_m_a_i_n& subDomain_; │ │ │ │ -95 }; │ │ │ │ +88template │ │ │ │ +89struct _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s │ │ │ │ +90{ │ │ │ │ +91 using Range = R; │ │ │ │ +92 using Domain = D; │ │ │ │ +93 │ │ │ │ +94 using RawRange = std::decay_t; │ │ │ │ +95 using RawDomain = std::decay_t; │ │ │ │ 96 │ │ │ │ -_9_7 static constexpr _s_i_z_e___t_y_p_e _m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e = SubDomainPreBasis:: │ │ │ │ -maxMultiIndexSize; │ │ │ │ -_9_8 static constexpr _s_i_z_e___t_y_p_e _m_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e = SubDomainPreBasis:: │ │ │ │ -minMultiIndexSize; │ │ │ │ -_9_9 static constexpr _s_i_z_e___t_y_p_e _m_u_l_t_i_I_n_d_e_x_B_u_f_f_e_r_S_i_z_e = SubDomainPreBasis:: │ │ │ │ -multiIndexBufferSize; │ │ │ │ -100 │ │ │ │ -_1_0_7 _R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s(const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w, _S_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s&& │ │ │ │ -_s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s, const _S_u_b_D_o_m_a_i_n& subDomain) │ │ │ │ -108 : _g_r_i_d_V_i_e_w__(_g_r_i_d_V_i_e_w) │ │ │ │ -109 , _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__(std::move(_s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s)) │ │ │ │ -110 , _s_u_b_D_o_m_a_i_n_P_t_r__(&subDomain) │ │ │ │ -111 {} │ │ │ │ -112 │ │ │ │ -_1_1_4 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ -115 { │ │ │ │ -116 _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__.initializeIndices(); │ │ │ │ -117 } │ │ │ │ -118 │ │ │ │ -_1_2_0 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ -121 { │ │ │ │ -122 return _g_r_i_d_V_i_e_w__; │ │ │ │ -123 } │ │ │ │ -124 │ │ │ │ -_1_3_3 void _u_p_d_a_t_e(const _G_r_i_d_V_i_e_w& gv) │ │ │ │ -134 { │ │ │ │ -135 _g_r_i_d_V_i_e_w__ = gv; │ │ │ │ -136 _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__.update(_s_u_b_D_o_m_a_i_n_P_t_r__->gridView()); │ │ │ │ -137 } │ │ │ │ -138 │ │ │ │ -_1_4_2 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ -143 { │ │ │ │ -144 return _N_o_d_e(_s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__.makeNode(), _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__.gridView(), │ │ │ │ -*_s_u_b_D_o_m_a_i_n_P_t_r__); │ │ │ │ -145 } │ │ │ │ -146 │ │ │ │ -_1_4_8 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ -149 { │ │ │ │ -150 return _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__.size(); │ │ │ │ -151 } │ │ │ │ -152 │ │ │ │ -154 template │ │ │ │ -_1_5_5 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix) const │ │ │ │ -156 { │ │ │ │ -157 return _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__.size(prefix); │ │ │ │ -158 } │ │ │ │ -159 │ │ │ │ -_1_6_1 auto _c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r() const │ │ │ │ -162 { │ │ │ │ -163 return _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__.containerDescriptor(); │ │ │ │ -164 } │ │ │ │ -165 │ │ │ │ -_1_6_7 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ -168 { │ │ │ │ -169 return _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__.dimension(); │ │ │ │ -170 } │ │ │ │ -171 │ │ │ │ -_1_7_3 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ -174 { │ │ │ │ -175 return _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__.maxNodeSize(); │ │ │ │ -176 } │ │ │ │ +97 using RawSignature = RawRange(RawDomain); │ │ │ │ +98 │ │ │ │ +99 template class DerivativeTraits=DefaultDerivativeTraits> │ │ │ │ +100 using DerivativeSignature = typename DerivativeTraits::Range │ │ │ │ +(Domain); │ │ │ │ +101}; │ │ │ │ +102#endif │ │ │ │ +103 │ │ │ │ +104 │ │ │ │ +105template class │ │ │ │ +DerivativeTraits=_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s> │ │ │ │ +_1_0_6struct _S_i_g_n_a_t_u_r_e_T_a_g; │ │ │ │ +107 │ │ │ │ +117template class DerivativeTraitsT> │ │ │ │ +_1_1_8struct _S_i_g_n_a_t_u_r_e_T_a_g │ │ │ │ +119{ │ │ │ │ +_1_2_0 using _S_i_g_n_a_t_u_r_e = Range(Domain); │ │ │ │ +121 │ │ │ │ +122 template │ │ │ │ +_1_2_3 using _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s = DerivativeTraitsT; │ │ │ │ +124}; │ │ │ │ +125 │ │ │ │ +126 │ │ │ │ +127 │ │ │ │ +136template class DerivativeTraits> │ │ │ │ +_1_3_7auto _d_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e_T_a_g(_S_i_g_n_a_t_u_r_e_T_a_g │ │ │ │ +tag) │ │ │ │ +138{ │ │ │ │ +139 using DerivativeRange = typename DerivativeTraits::Range; │ │ │ │ +140 return _S_i_g_n_a_t_u_r_e_T_a_g_<_D_e_r_i_v_a_t_i_v_e_R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_>(); │ │ │ │ +141} │ │ │ │ +142 │ │ │ │ +143 │ │ │ │ +144 │ │ │ │ +158template class │ │ │ │ +DerivativeTraits> │ │ │ │ +_1_5_9auto _d_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e_T_a_g_s(_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_g_n_a_t_u_r_e_T_a_g_<_S_i_g_n_a_t_u_r_e_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_> tag) │ │ │ │ +160{ │ │ │ │ +161 if constexpr (maxOrder==0) { │ │ │ │ +162 // If maxOrder== 0 we just need the given SignatureTag │ │ │ │ +163 return std::make_tuple(tag); │ │ │ │ +164 } else { │ │ │ │ +165 // else we first construct the tail tuple with SignatureTags for │ │ │ │ +derivatives │ │ │ │ +166 // of order 1 to maxOrder │ │ │ │ +167 auto tailTagsTuple = _d_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e_T_a_g_s │ │ │ │ +(_d_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e_T_a_g(tag)); │ │ │ │ +168 // and prepend this with the given SignatureTag. │ │ │ │ +169 // This is done by unpacking the tail tuple with apply(). │ │ │ │ +170 return std::apply([&](auto&&... tailTags){ │ │ │ │ +171 return std::make_tuple(tag, tailTags...); │ │ │ │ +172 }, tailTagsTuple); │ │ │ │ +173 } │ │ │ │ +174} │ │ │ │ +175 │ │ │ │ +176 │ │ │ │ 177 │ │ │ │ -_1_7_8 const _S_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s& _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s() const │ │ │ │ -179 { │ │ │ │ -180 return _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__; │ │ │ │ -181 } │ │ │ │ -182 │ │ │ │ -_1_8_3 _S_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s& _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s() │ │ │ │ -184 { │ │ │ │ -185 return _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__; │ │ │ │ -186 } │ │ │ │ -187 │ │ │ │ -188 template │ │ │ │ -_1_8_9 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ -190 { │ │ │ │ -191 if (node.size() == 0) │ │ │ │ -192 return it; │ │ │ │ -193 else │ │ │ │ -194 return _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__.indices(node, it); │ │ │ │ -195 } │ │ │ │ -196 │ │ │ │ -197protected: │ │ │ │ -_1_9_8 _G_r_i_d_V_i_e_w _g_r_i_d_V_i_e_w__; │ │ │ │ -_1_9_9 _S_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__; │ │ │ │ -_2_0_0 const _S_u_b_D_o_m_a_i_n* _s_u_b_D_o_m_a_i_n_P_t_r__; │ │ │ │ -201}; │ │ │ │ -202 │ │ │ │ -203 │ │ │ │ -204 │ │ │ │ -_2_0_5namespace _B_a_s_i_s_F_a_c_t_o_r_y { │ │ │ │ -206 │ │ │ │ -224template │ │ │ │ -_2_2_5auto _r_e_s_t_r_i_c_t(SubDomainBasisFactory&& subPreBasisFactory, const _S_u_b_D_o_m_a_i_n& │ │ │ │ -subDomain) │ │ │ │ -226{ │ │ │ │ -227 return [ │ │ │ │ -228 subPreBasisFactory=std::forward(subPreBasisFactory), │ │ │ │ -229 &subDomain │ │ │ │ -230 ](const auto& gridView) { │ │ │ │ -231 return _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s(gridView, │ │ │ │ -subPreBasisFactory(subDomain._g_r_i_d_V_i_e_w()), subDomain); │ │ │ │ -232 }; │ │ │ │ -233} │ │ │ │ -234 │ │ │ │ -235 │ │ │ │ -236} // end namespace BasisFactory │ │ │ │ -237} // end namespace Dune::Functions::Experimental │ │ │ │ -238 │ │ │ │ -239 │ │ │ │ -240#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RESTRICTEDBASIS_HH │ │ │ │ -_n_o_d_e_s_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_r_e_s_t_r_i_c_t │ │ │ │ -auto restrict(SubDomainBasisFactory &&subPreBasisFactory, const SubDomain │ │ │ │ -&subDomain) │ │ │ │ -Create a RestrictedPreBasisFactory. │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:225 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:28 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:205 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n │ │ │ │ -Class representing a sub-domain of a GridView. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:534 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_g_r_i_d_V_i_e_w │ │ │ │ -GridView gridView() const │ │ │ │ -Create grid view representing the SubDomain. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:565 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s │ │ │ │ -A pre-basis restricted to a sub-domain. │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:44 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -Type used for indices and size information. │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:57 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s │ │ │ │ -RestrictedPreBasis(const GridView &gridView, SubDomainPreBasis │ │ │ │ -&&subDomainPreBasis, const SubDomain &subDomain) │ │ │ │ -Constructor for given sub-domain pre-basis. │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:107 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ -void initializeIndices() │ │ │ │ -Initialize the global indices. │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:114 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s │ │ │ │ -const SubDomainPreBasis & subDomainPreBasis() const │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:178 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_S_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s │ │ │ │ -SDPB SubDomainPreBasis │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:50 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_m_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ -static constexpr size_type minMultiIndexSize │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:98 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ -size_type dimension() const │ │ │ │ -Get the total dimension of the space spanned by this basis. │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:167 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__ │ │ │ │ -SubDomainPreBasis subDomainPreBasis_ │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:199 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s │ │ │ │ -SubDomainPreBasis & subDomainPreBasis() │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:183 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ -GV GridView │ │ │ │ -The grid view that the FE basis is defined on. │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:54 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_m_a_x_N_o_d_e_S_i_z_e │ │ │ │ -size_type maxNodeSize() const │ │ │ │ -Get the maximal number of DOFs associated to node for any element. │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:173 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_S_u_b_D_o_m_a_i_n │ │ │ │ -SD SubDomain │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:49 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ -size_type size() const │ │ │ │ -Same as size(prefix) with empty prefix. │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:148 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_s_u_b_D_o_m_a_i_n_P_t_r__ │ │ │ │ -const SubDomain * subDomainPtr_ │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:200 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ -size_type size(const SizePrefix &prefix) const │ │ │ │ -Return number of possible values for next position in multi index. │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:155 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w │ │ │ │ -typename SubDomainPreBasis::GridView SubDomainGridView │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:51 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_m_u_l_t_i_I_n_d_e_x_B_u_f_f_e_r_S_i_z_e │ │ │ │ -static constexpr size_type multiIndexBufferSize │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:99 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_g_r_i_d_V_i_e_w__ │ │ │ │ -GridView gridView_ │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:198 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_g_r_i_d_V_i_e_w │ │ │ │ -const GridView & gridView() const │ │ │ │ -Obtain the grid view that the basis is defined on. │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:120 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_i_n_d_i_c_e_s │ │ │ │ -It indices(const Node &node, It it) const │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:189 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r │ │ │ │ -auto containerDescriptor() const │ │ │ │ -Return the container descriptor of the pre-basis. │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:161 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_m_a_k_e_N_o_d_e │ │ │ │ -Node makeNode() const │ │ │ │ -Create tree node. │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:142 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ -static constexpr size_type maxMultiIndexSize │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:97 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_u_p_d_a_t_e │ │ │ │ -void update(const GridView &gv) │ │ │ │ -Update the stored grid view, to be called. │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:133 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_N_o_d_e │ │ │ │ -Template mapping root tree path to type of created tree node. │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:62 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_N_o_d_e_:_:_E_l_e_m_e_n_t │ │ │ │ -typename Base::Element Element │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:66 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_N_o_d_e_:_:_b_i_n_d │ │ │ │ -void bind(const Element &element) │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:74 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_N_o_d_e_:_:_s_u_b_D_o_m_a_i_n │ │ │ │ -const SubDomain & subDomain() const │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:87 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_N_o_d_e_:_:_N_o_d_e │ │ │ │ -Node(Base &&base, const SubDomainGridView &subDomainGridView, const SubDomain │ │ │ │ -&subDomain) │ │ │ │ -DDeeffiinniittiioonn restrictedbasis.hh:68 │ │ │ │ +178} // namespace Functions │ │ │ │ +179} // namespace Dune │ │ │ │ +180 │ │ │ │ +181#endif // DUNE_FUNCTIONS_COMMON_SIGNATURE_HH │ │ │ │ +_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_d_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e_T_a_g │ │ │ │ +auto derivativeSignatureTag(SignatureTag< Range(Domain), DerivativeTraits > │ │ │ │ +tag) │ │ │ │ +Construct SignatureTag for derivative. │ │ │ │ +DDeeffiinniittiioonn signature.hh:137 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_d_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e_T_a_g_s │ │ │ │ +auto derivativeSignatureTags(Dune::Functions::SignatureTag< Signature, │ │ │ │ +DerivativeTraits > tag) │ │ │ │ +Construct SignatureTags for derivatives. │ │ │ │ +DDeeffiinniittiioonn signature.hh:159 │ │ │ │ +_D_u_n_e │ │ │ │ +DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ +DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ +Default implementation for derivative traits. │ │ │ │ +DDeeffiinniittiioonn defaultderivativetraits.hh:41 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_s_C_a_l_l_a_b_l_e │ │ │ │ +Helper class to check that F is callable. │ │ │ │ +DDeeffiinniittiioonn signature.hh:24 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_g_n_a_t_u_r_e_T_r_a_i_t_s │ │ │ │ +Helper class to deduce the signature of a callable. │ │ │ │ +DDeeffiinniittiioonn signature.hh:60 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_g_n_a_t_u_r_e_T_a_g │ │ │ │ +DDeeffiinniittiioonn signature.hh:106 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_g_n_a_t_u_r_e_T_a_g_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_T_ _>_:_: │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ +DerivativeTraitsT< T > DerivativeTraits │ │ │ │ +DDeeffiinniittiioonn signature.hh:123 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_g_n_a_t_u_r_e_T_a_g_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_T_ _>_:_:_S_i_g_n_a_t_u_r_e │ │ │ │ +Range(Domain) Signature │ │ │ │ +DDeeffiinniittiioonn signature.hh:120 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _r_e_s_t_r_i_c_t_e_d_b_a_s_i_s_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _s_i_g_n_a_t_u_r_e_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00095.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: refinedlagrangebasis.hh File Reference │ │ │ +Dune-Functions: defaultderivativetraits.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,65 +88,56 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
refinedlagrangebasis.hh File Reference
│ │ │ +
defaultderivativetraits.hh File Reference
│ │ │
│ │ │
│ │ │
#include <type_traits>
│ │ │ -#include <dune/common/exceptions.hh>
│ │ │ -#include <dune/common/math.hh>
│ │ │ -#include <dune/localfunctions/refined.hh>
│ │ │ -#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │ -#include <dune/functions/functionspacebases/leafprebasismappermixin.hh>
│ │ │ -#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ -#include <dune/geometry/type.hh>
│ │ │ -#include <dune/grid/common/mcmgmapper.hh>
│ │ │ +#include <utility>
│ │ │ +#include <dune/common/fvector.hh>
│ │ │ +#include <dune/common/fmatrix.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::RefinedLagrangePreBasis< GV, k, R >
 A pre-basis for a refined Lagrange bases. More...
class  Dune::Functions::RefinedLagrangeNode< GV, k, R >
class  Dune::Functions::InvalidRange
 Dummy range class to be used if no proper type is available. More...
struct  Dune::Functions::DefaultDerivativeTraits< Signature >
 Default implementation for derivative traits. More...
struct  Dune::Functions::DefaultDerivativeTraits< double(double) >
 Default implementation for derivative traits. More...
struct  Dune::Functions::DefaultDerivativeTraits< K(FieldVector< K, n >)>
 Default implementation for derivative traits. More...
struct  Dune::Functions::DefaultDerivativeTraits< FieldVector< K, m >(FieldVector< K, n >)>
 Default implementation for derivative traits. More...
struct  Dune::Functions::DefaultDerivativeTraits< FieldMatrix< K, 1, m >(FieldVector< K, n >)>
 Default implementation for derivative traits. More...
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ -

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::BasisFactory
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -

│ │ │ -Typedefs

template<typename GV, int k, typename R = double>
using Dune::Functions::RefinedLagrangeBasis = DefaultGlobalBasis<RefinedLagrangePreBasis<GV,k,R> >
 Nodal basis of a continuous Lagrange finite-element space on a uniformly refined simplex element.
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │

│ │ │ -Functions

template<int k, typename R = double>
auto Dune::Functions::BasisFactory::refinedLagrange ()
 Create a pre-basis factory that can create a RefinedLagrange pre-basis.
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,38 +1,33 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -refinedlagrangebasis.hh File Reference │ │ │ │ +defaultderivativetraits.hh File Reference │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _k_,_ _R_ _> │ │ │ │ -  A pre-basis for a refined Lagrange bases. _M_o_r_e_._._. │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_N_o_d_e_<_ _G_V_,_ _k_,_ _R_ _> │ │ │ │ + class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_n_v_a_l_i_d_R_a_n_g_e │ │ │ │ +  Dummy range class to be used if no proper type is available. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_<_ _S_i_g_n_a_t_u_r_e_ _> │ │ │ │ +  Default implementation for derivative traits. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_<_ _d_o_u_b_l_e_(_d_o_u_b_l_e_)_ _> │ │ │ │ +  Default implementation for derivative traits. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_<_ _K_(_F_i_e_l_d_V_e_c_t_o_r_<_ _K_,_ _n_ _>_)_> │ │ │ │ +  Default implementation for derivative traits. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_<_ _F_i_e_l_d_V_e_c_t_o_r_<_ _K_,_ _m_ _> │ │ │ │ + _(_F_i_e_l_d_V_e_c_t_o_r_<_ _K_,_ _n_ _>_)_> │ │ │ │ +  Default implementation for derivative traits. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_<_ _F_i_e_l_d_M_a_t_r_i_x_<_ _K_,_ _1_,_ _m_ _> │ │ │ │ + _(_F_i_e_l_d_V_e_c_t_o_r_<_ _K_,_ _n_ _>_)_> │ │ │ │ +  Default implementation for derivative traits. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -TTyyppeeddeeffss │ │ │ │ -template │ │ │ │ -using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_B_a_s_i_s = │ │ │ │ - _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s<_R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s > │ │ │ │ -  Nodal basis of a continuous Lagrange finite-element space on a uniformly │ │ │ │ - refined simplex element. │ │ │ │ -FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_r_e_f_i_n_e_d_L_a_g_r_a_n_g_e () │ │ │ │ -  Create a pre-basis factory that can create a RefinedLagrange pre-basis. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _r_e_f_i_n_e_d_l_a_g_r_a_n_g_e_b_a_s_i_s_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00095_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: refinedlagrangebasis.hh Source File │ │ │ +Dune-Functions: defaultderivativetraits.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,231 +88,103 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
refinedlagrangebasis.hh
│ │ │ +
defaultderivativetraits.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_REFINEDLAGRANGEBASIS_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_REFINEDLAGRANGEBASIS_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH
│ │ │ +
8#define DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH
│ │ │
9
│ │ │
10#include <type_traits>
│ │ │ -
11
│ │ │ -
12#include <dune/common/exceptions.hh>
│ │ │ -
13#include <dune/common/math.hh>
│ │ │ -
14
│ │ │ -
15#include <dune/localfunctions/refined.hh>
│ │ │ -
16
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
20
│ │ │ -
21#include <dune/geometry/type.hh>
│ │ │ -
22
│ │ │ -
23#include <dune/grid/common/mcmgmapper.hh>
│ │ │ -
24
│ │ │ -
25
│ │ │ -
26namespace Dune {
│ │ │ -
27namespace Functions {
│ │ │ +
11#include <utility>
│ │ │ +
12
│ │ │ +
13#include <dune/common/fvector.hh>
│ │ │ +
14#include <dune/common/fmatrix.hh>
│ │ │ +
15
│ │ │ +
16namespace Dune {
│ │ │ +
17namespace Functions {
│ │ │ +
18
│ │ │ +
19
│ │ │ +
20
│ │ │ +
│ │ │ + │ │ │ +
27{};
│ │ │ +
│ │ │
28
│ │ │ -
29template<typename GV, int k, typename R>
│ │ │ - │ │ │ -
31
│ │ │ -
43template <typename GV, int k, typename R = double>
│ │ │ -
│ │ │ - │ │ │ -
45 public LeafPreBasisMapperMixin< GV >
│ │ │ -
46{
│ │ │ - │ │ │ -
48
│ │ │ -
49 static const int dim = GV::dimension;
│ │ │ -
50
│ │ │ -
51 // refined basis only implemented for P0 and P1
│ │ │ -
52 static_assert(k == 0 || k == 1);
│ │ │ -
53
│ │ │ -
54 // the layout is defined in terms of a MCMGLayout specialized for k == 0 or 1
│ │ │ -
55 static MCMGLayout dofLayout()
│ │ │ -
56 {
│ │ │ -
57 if constexpr(k == 0)
│ │ │ -
58 // a refined P0 basis assigns each element 2^dim DOFs
│ │ │ -
59 return [](GeometryType gt, int) -> size_t {
│ │ │ -
60 return (gt.dim() == dim) ? (1 << dim) : 0;
│ │ │ -
61 };
│ │ │ -
62 else if constexpr(k == 1)
│ │ │ -
63 // a refined P1 basis has the same layout as a P2 basis
│ │ │ -
64 return [](GeometryType gt, int) -> size_t {
│ │ │ -
65 return Dune::binomial(int(k),int(gt.dim()));
│ │ │ -
66 };
│ │ │ -
67 else
│ │ │ -
68 DUNE_THROW(Dune::NotImplemented,
│ │ │ -
69 "Refined basis not implemented for higher-order Lagrange (k>=2) elements.");
│ │ │ -
70 }
│ │ │ -
71
│ │ │ -
72public:
│ │ │ -
73
│ │ │ -
75 using GridView = GV;
│ │ │ +
29
│ │ │ +
39template<class Signature>
│ │ │ +
│ │ │ + │ │ │ +
41{
│ │ │ + │ │ │ +
44};
│ │ │ +
│ │ │ +
45
│ │ │ +
46
│ │ │ +
54template<>
│ │ │ +
│ │ │ +
55struct DefaultDerivativeTraits< double(double) >
│ │ │ +
56{
│ │ │ +
58 typedef double Range;
│ │ │ +
59};
│ │ │ +
│ │ │ +
60
│ │ │ +
70template<typename K, int n>
│ │ │ +
│ │ │ +
71struct DefaultDerivativeTraits<K(FieldVector<K,n>)>
│ │ │ +
72{
│ │ │ +
74 typedef FieldVector<K,n> Range;
│ │ │ +
75};
│ │ │ +
│ │ │
76
│ │ │ - │ │ │ -
79
│ │ │ -
│ │ │ - │ │ │ -
87 : Base(gv, dofLayout())
│ │ │ -
88 {
│ │ │ -
89 for (auto gt : gv.indexSet().types(0)) {
│ │ │ -
90 if (!gt.isSimplex())
│ │ │ -
91 DUNE_THROW(Dune::NotImplemented,
│ │ │ -
92 "Refined Lagrange basis only implemented for simplex grids.");
│ │ │ -
93 }
│ │ │ -
94 }
│ │ │ -
│ │ │ -
95
│ │ │ -
│ │ │ -
97 Node makeNode () const
│ │ │ -
98 {
│ │ │ -
99 return Node{};
│ │ │ -
100 }
│ │ │ -
│ │ │ -
101
│ │ │ -
│ │ │ -
109 static constexpr unsigned int order()
│ │ │ -
110 {
│ │ │ -
111 return k;
│ │ │ -
112 }
│ │ │ -
│ │ │ -
113};
│ │ │ -
│ │ │ -
114
│ │ │ -
115
│ │ │ -
116
│ │ │ -
117template <typename GV, int k, typename R>
│ │ │ -
│ │ │ - │ │ │ -
119 : public LeafBasisNode
│ │ │ -
120{
│ │ │ -
121 static constexpr int dim = GV::dimension;
│ │ │ -
122
│ │ │ -
123 // refined basis only implemented for P0 and P1
│ │ │ -
124 static_assert(k == 0 || k == 1);
│ │ │ -
125
│ │ │ -
126public:
│ │ │ -
128 using Element = typename GV::template Codim<0>::Entity;
│ │ │ -
129
│ │ │ -
131 using FiniteElement = std::conditional_t<(k==0),
│ │ │ -
132 Dune::RefinedP0LocalFiniteElement<typename GV::ctype,R,dim>,
│ │ │ -
133 Dune::RefinedP1LocalFiniteElement<typename GV::ctype,R,dim>>;
│ │ │ -
134
│ │ │ -
│ │ │ - │ │ │ - │ │ │ -
146 , element_(nullptr)
│ │ │ -
147 {}
│ │ │ -
│ │ │ -
148
│ │ │ -
│ │ │ -
153 const Element& element () const
│ │ │ -
154 {
│ │ │ -
155 return *element_;
│ │ │ -
156 }
│ │ │ -
│ │ │ -
157
│ │ │ -
│ │ │ - │ │ │ -
165 {
│ │ │ -
166 return finiteElement_;
│ │ │ -
167 }
│ │ │ -
│ │ │ -
168
│ │ │ -
│ │ │ -
170 void bind (const Element& e)
│ │ │ -
171 {
│ │ │ -
172 element_ = &e;
│ │ │ -
173 this->setSize(finiteElement_.size());
│ │ │ -
174 }
│ │ │ -
│ │ │ -
175
│ │ │ -
│ │ │ -
180 static constexpr unsigned int order()
│ │ │ -
181 {
│ │ │ -
182 return k;
│ │ │ -
183 }
│ │ │ -
│ │ │ -
184
│ │ │ -
185protected:
│ │ │ - │ │ │ - │ │ │ -
188};
│ │ │ -
│ │ │ -
189
│ │ │ -
190
│ │ │ -
191
│ │ │ -
192namespace BasisFactory {
│ │ │ -
193
│ │ │ -
201template <int k, typename R=double>
│ │ │ -
│ │ │ - │ │ │ -
203{
│ │ │ -
204 return [](const auto& gridView) {
│ │ │ -
205 return RefinedLagrangePreBasis<std::decay_t<decltype(gridView)>, k, R>(gridView);
│ │ │ -
206 };
│ │ │ -
207}
│ │ │ -
│ │ │ -
208
│ │ │ -
209} // end namespace BasisFactory
│ │ │ -
210
│ │ │ -
211
│ │ │ -
225template <typename GV, int k, typename R=double>
│ │ │ - │ │ │ -
227
│ │ │ -
228} // end namespace Functions
│ │ │ -
229} // end namespace Dune
│ │ │ -
230
│ │ │ -
231
│ │ │ -
232#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_REFINEDLAGRANGEBASIS_HH
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
DefaultGlobalBasis< RefinedLagrangePreBasis< GV, k, R > > RefinedLagrangeBasis
Nodal basis of a continuous Lagrange finite-element space on a uniformly refined simplex element.
Definition refinedlagrangebasis.hh:226
│ │ │ -
auto refinedLagrange()
Create a pre-basis factory that can create a RefinedLagrange pre-basis.
Definition refinedlagrangebasis.hh:202
│ │ │ +
86template<typename K, int n, int m>
│ │ │ +
│ │ │ +
87struct DefaultDerivativeTraits<FieldVector<K,m>(FieldVector<K,n>)>
│ │ │ +
88{
│ │ │ +
90 typedef FieldMatrix<K,m,n> Range;
│ │ │ +
91};
│ │ │ +
│ │ │ +
92
│ │ │ +
102template<typename K, int n, int m>
│ │ │ +
│ │ │ +
103struct DefaultDerivativeTraits<FieldMatrix<K,1,m>(FieldVector<K,n>)>
│ │ │ +
104{
│ │ │ +
106 typedef FieldMatrix<K,m,n> Range;
│ │ │ +
107};
│ │ │ +
│ │ │ +
108
│ │ │ +
109
│ │ │ +
110}} // namespace Dune::Functions
│ │ │ +
111
│ │ │ +
112
│ │ │ +
113#endif // DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH
│ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
Definition argyrisbasis.hh:926
│ │ │ -
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:53
│ │ │ -
LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout)
Construct from GridView and local DOF layout.
Definition leafprebasismappermixin.hh:74
│ │ │ -
void setSize(const size_type size)
Definition nodes.hh:197
│ │ │ -
Definition nodes.hh:218
│ │ │ -
Definition refinedlagrangebasis.hh:120
│ │ │ -
std::conditional_t<(k==0), Dune::RefinedP0LocalFiniteElement< typename GV::ctype, R, dim >, Dune::RefinedP1LocalFiniteElement< typename GV::ctype, R, dim > > FiniteElement
Type of the local finite-element.
Definition refinedlagrangebasis.hh:131
│ │ │ -
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition refinedlagrangebasis.hh:164
│ │ │ -
const Element * element_
Definition refinedlagrangebasis.hh:187
│ │ │ -
void bind(const Element &e)
Bind the node to the element e.
Definition refinedlagrangebasis.hh:170
│ │ │ -
const FiniteElement finiteElement_
Definition refinedlagrangebasis.hh:186
│ │ │ -
static constexpr unsigned int order()
Polynomial order used in the local Lagrange finite-elements in subdomains of the element.
Definition refinedlagrangebasis.hh:180
│ │ │ -
typename GV::template Codim< 0 >::Entity Element
Type of the element in the GridView.
Definition refinedlagrangebasis.hh:128
│ │ │ -
RefinedLagrangeNode()
The default constructor initializes all members to their default.
Definition refinedlagrangebasis.hh:144
│ │ │ -
const Element & element() const
Return current element. The behavior is undefined if the node is not bound to any element.
Definition refinedlagrangebasis.hh:153
│ │ │ -
A pre-basis for a refined Lagrange bases.
Definition refinedlagrangebasis.hh:46
│ │ │ -
static constexpr unsigned int order()
Polynomial order used in the local Lagrange finite-elements.
Definition refinedlagrangebasis.hh:109
│ │ │ -
Node makeNode() const
Create tree node.
Definition refinedlagrangebasis.hh:97
│ │ │ -
RefinedLagrangeNode< GV, k, R > Node
Type of the refined Lagrange tree node.
Definition refinedlagrangebasis.hh:78
│ │ │ -
GV GridView
The grid view that the FE basis is defined on.
Definition refinedlagrangebasis.hh:75
│ │ │ -
RefinedLagrangePreBasis(const GridView &gv)
Constructor for a given grid view object.
Definition refinedlagrangebasis.hh:86
│ │ │ +
Dummy range class to be used if no proper type is available.
Definition defaultderivativetraits.hh:27
│ │ │ +
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:41
│ │ │ +
InvalidRange Range
Range of derivative for function with given signature.
Definition defaultderivativetraits.hh:43
│ │ │ +
double Range
Range of derivative for function with given signature.
Definition defaultderivativetraits.hh:58
│ │ │ +
FieldVector< K, n > Range
Range of derivative for function with given signature.
Definition defaultderivativetraits.hh:74
│ │ │ +
FieldMatrix< K, m, n > Range
Range of derivative for function with given signature.
Definition defaultderivativetraits.hh:90
│ │ │ +
FieldMatrix< K, m, n > Range
Range of derivative for function with given signature.
Definition defaultderivativetraits.hh:106
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,268 +1,105 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -refinedlagrangebasis.hh │ │ │ │ +defaultderivativetraits.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_REFINEDLAGRANGEBASIS_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_REFINEDLAGRANGEBASIS_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH │ │ │ │ +8#define DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH │ │ │ │ 9 │ │ │ │ 10#include │ │ │ │ -11 │ │ │ │ -12#include │ │ │ │ -13#include │ │ │ │ -14 │ │ │ │ -15#include │ │ │ │ -16 │ │ │ │ -17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ -18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h> │ │ │ │ -19#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ +11#include │ │ │ │ +12 │ │ │ │ +13#include │ │ │ │ +14#include │ │ │ │ +15 │ │ │ │ +16namespace _D_u_n_e { │ │ │ │ +17namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +18 │ │ │ │ +19 │ │ │ │ 20 │ │ │ │ -21#include │ │ │ │ -22 │ │ │ │ -23#include │ │ │ │ -24 │ │ │ │ -25 │ │ │ │ -26namespace _D_u_n_e { │ │ │ │ -27namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +_2_6class _I_n_v_a_l_i_d_R_a_n_g_e │ │ │ │ +27{}; │ │ │ │ 28 │ │ │ │ -29template │ │ │ │ -30class _R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_N_o_d_e; │ │ │ │ -31 │ │ │ │ -43template │ │ │ │ -_4_4class _R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s : │ │ │ │ -45 public _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n< GV > │ │ │ │ -46{ │ │ │ │ -47 using Base = _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_<_ _G_V_ _>; │ │ │ │ -48 │ │ │ │ -49 static const int dim = GV::dimension; │ │ │ │ -50 │ │ │ │ -51 // refined basis only implemented for P0 and P1 │ │ │ │ -52 static_assert(k == 0 || k == 1); │ │ │ │ -53 │ │ │ │ -54 // the layout is defined in terms of a MCMGLayout specialized for k == 0 or │ │ │ │ -1 │ │ │ │ -55 static MCMGLayout dofLayout() │ │ │ │ -56 { │ │ │ │ -57 if constexpr(k == 0) │ │ │ │ -58 // a refined P0 basis assigns each element 2^dim DOFs │ │ │ │ -59 return [](GeometryType gt, int) -> size_t { │ │ │ │ -60 return (gt.dim() == dim) ? (1 << dim) : 0; │ │ │ │ -61 }; │ │ │ │ -62 else if constexpr(k == 1) │ │ │ │ -63 // a refined P1 basis has the same layout as a P2 basis │ │ │ │ -64 return [](GeometryType gt, int) -> size_t { │ │ │ │ -65 return Dune::binomial(int(k),int(gt.dim())); │ │ │ │ -66 }; │ │ │ │ -67 else │ │ │ │ -68 DUNE_THROW(Dune::NotImplemented, │ │ │ │ -69 "Refined basis not implemented for higher-order Lagrange (k>=2) elements."); │ │ │ │ -70 } │ │ │ │ -71 │ │ │ │ -72public: │ │ │ │ -73 │ │ │ │ -_7_5 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ +29 │ │ │ │ +39template │ │ │ │ +_4_0struct _D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ +41{ │ │ │ │ +_4_3 typedef _I_n_v_a_l_i_d_R_a_n_g_e _R_a_n_g_e; │ │ │ │ +44}; │ │ │ │ +45 │ │ │ │ +46 │ │ │ │ +54template<> │ │ │ │ +_5_5struct _D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s< double(double) > │ │ │ │ +56{ │ │ │ │ +_5_8 typedef double _R_a_n_g_e; │ │ │ │ +59}; │ │ │ │ +60 │ │ │ │ +70template │ │ │ │ +_7_1struct _D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s)> │ │ │ │ +72{ │ │ │ │ +_7_4 typedef FieldVector _R_a_n_g_e; │ │ │ │ +75}; │ │ │ │ 76 │ │ │ │ -_7_8 using _N_o_d_e = _R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_N_o_d_e_<_G_V_,_ _k_,_ _R_>; │ │ │ │ -79 │ │ │ │ -_8_6 _R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s (const _G_r_i_d_V_i_e_w& gv) │ │ │ │ -87 : Base(gv, dofLayout()) │ │ │ │ -88 { │ │ │ │ -89 for (auto gt : gv.indexSet().types(0)) { │ │ │ │ -90 if (!gt.isSimplex()) │ │ │ │ -91 DUNE_THROW(Dune::NotImplemented, │ │ │ │ -92 "Refined Lagrange basis only implemented for simplex grids."); │ │ │ │ -93 } │ │ │ │ -94 } │ │ │ │ -95 │ │ │ │ -_9_7 _N_o_d_e _m_a_k_e_N_o_d_e () const │ │ │ │ -98 { │ │ │ │ -99 return _N_o_d_e{}; │ │ │ │ -100 } │ │ │ │ -101 │ │ │ │ -_1_0_9 static constexpr unsigned int _o_r_d_e_r() │ │ │ │ -110 { │ │ │ │ -111 return k; │ │ │ │ -112 } │ │ │ │ -113}; │ │ │ │ -114 │ │ │ │ -115 │ │ │ │ -116 │ │ │ │ -117template │ │ │ │ -_1_1_8class _R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_N_o_d_e │ │ │ │ -119 : public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ -120{ │ │ │ │ -121 static constexpr int dim = GV::dimension; │ │ │ │ -122 │ │ │ │ -123 // refined basis only implemented for P0 and P1 │ │ │ │ -124 static_assert(k == 0 || k == 1); │ │ │ │ -125 │ │ │ │ -126public: │ │ │ │ -_1_2_8 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ -129 │ │ │ │ -_1_3_1 using _F_i_n_i_t_e_E_l_e_m_e_n_t = std::conditional_t<(k==0), │ │ │ │ -132 Dune::RefinedP0LocalFiniteElement, │ │ │ │ -133 Dune::RefinedP1LocalFiniteElement>; │ │ │ │ -134 │ │ │ │ -_1_4_4 _R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_N_o_d_e () │ │ │ │ -145 : _f_i_n_i_t_e_E_l_e_m_e_n_t__{} │ │ │ │ -146 , _e_l_e_m_e_n_t__(nullptr) │ │ │ │ -147 {} │ │ │ │ -148 │ │ │ │ -_1_5_3 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t () const │ │ │ │ -154 { │ │ │ │ -155 return *_e_l_e_m_e_n_t__; │ │ │ │ -156 } │ │ │ │ -157 │ │ │ │ -_1_6_4 const _F_i_n_i_t_e_E_l_e_m_e_n_t& _f_i_n_i_t_e_E_l_e_m_e_n_t () const │ │ │ │ -165 { │ │ │ │ -166 return _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ -167 } │ │ │ │ -168 │ │ │ │ -_1_7_0 void _b_i_n_d (const _E_l_e_m_e_n_t& e) │ │ │ │ -171 { │ │ │ │ -172 _e_l_e_m_e_n_t__ = &e; │ │ │ │ -173 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__.size()); │ │ │ │ -174 } │ │ │ │ -175 │ │ │ │ -_1_8_0 static constexpr unsigned int _o_r_d_e_r() │ │ │ │ -181 { │ │ │ │ -182 return k; │ │ │ │ -183 } │ │ │ │ -184 │ │ │ │ -185protected: │ │ │ │ -_1_8_6 const _F_i_n_i_t_e_E_l_e_m_e_n_t _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ -_1_8_7 const _E_l_e_m_e_n_t* _e_l_e_m_e_n_t__; │ │ │ │ -188}; │ │ │ │ -189 │ │ │ │ -190 │ │ │ │ -191 │ │ │ │ -192namespace _B_a_s_i_s_F_a_c_t_o_r_y { │ │ │ │ -193 │ │ │ │ -201template │ │ │ │ -_2_0_2auto _r_e_f_i_n_e_d_L_a_g_r_a_n_g_e () │ │ │ │ -203{ │ │ │ │ -204 return [](const auto& gridView) { │ │ │ │ -205 return _R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s, k, R> │ │ │ │ -(gridView); │ │ │ │ -206 }; │ │ │ │ -207} │ │ │ │ -208 │ │ │ │ -209} // end namespace BasisFactory │ │ │ │ -210 │ │ │ │ -211 │ │ │ │ -225template │ │ │ │ -_2_2_6using _R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_B_a_s_i_s = │ │ │ │ -_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_G_V_,_k_,_R_> >; │ │ │ │ -227 │ │ │ │ -228} // end namespace Functions │ │ │ │ -229} // end namespace Dune │ │ │ │ -230 │ │ │ │ -231 │ │ │ │ -232#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_REFINEDLAGRANGEBASIS_HH │ │ │ │ -_n_o_d_e_s_._h_h │ │ │ │ -_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h │ │ │ │ -_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_B_a_s_i_s │ │ │ │ -DefaultGlobalBasis< RefinedLagrangePreBasis< GV, k, R > > RefinedLagrangeBasis │ │ │ │ -Nodal basis of a continuous Lagrange finite-element space on a uniformly │ │ │ │ -refined simplex element. │ │ │ │ -DDeeffiinniittiioonn refinedlagrangebasis.hh:226 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_r_e_f_i_n_e_d_L_a_g_r_a_n_g_e │ │ │ │ -auto refinedLagrange() │ │ │ │ -Create a pre-basis factory that can create a RefinedLagrange pre-basis. │ │ │ │ -DDeeffiinniittiioonn refinedlagrangebasis.hh:202 │ │ │ │ +86template │ │ │ │ +_8_7struct _D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s(FieldVector)> │ │ │ │ +88{ │ │ │ │ +_9_0 typedef FieldMatrix _R_a_n_g_e; │ │ │ │ +91}; │ │ │ │ +92 │ │ │ │ +102template │ │ │ │ +_1_0_3struct _D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s(FieldVector)> │ │ │ │ +104{ │ │ │ │ +_1_0_6 typedef FieldMatrix _R_a_n_g_e; │ │ │ │ +107}; │ │ │ │ +108 │ │ │ │ +109 │ │ │ │ +110}} // namespace Dune::Functions │ │ │ │ +111 │ │ │ │ +112 │ │ │ │ +113#endif // DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:926 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ -Global basis for given pre-basis. │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:53 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n │ │ │ │ -LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout) │ │ │ │ -Construct from GridView and local DOF layout. │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:74 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_e_t_S_i_z_e │ │ │ │ -void setSize(const size_type size) │ │ │ │ -DDeeffiinniittiioonn nodes.hh:197 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ -DDeeffiinniittiioonn nodes.hh:218 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_N_o_d_e │ │ │ │ -DDeeffiinniittiioonn refinedlagrangebasis.hh:120 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_N_o_d_e_:_:_F_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ -std::conditional_t<(k==0), Dune::RefinedP0LocalFiniteElement< typename GV:: │ │ │ │ -ctype, R, dim >, Dune::RefinedP1LocalFiniteElement< typename GV::ctype, R, dim │ │ │ │ -> > FiniteElement │ │ │ │ -Type of the local finite-element. │ │ │ │ -DDeeffiinniittiioonn refinedlagrangebasis.hh:131 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ -const FiniteElement & finiteElement() const │ │ │ │ -Return the LocalFiniteElement for the element we are bound to. │ │ │ │ -DDeeffiinniittiioonn refinedlagrangebasis.hh:164 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_N_o_d_e_:_:_e_l_e_m_e_n_t__ │ │ │ │ -const Element * element_ │ │ │ │ -DDeeffiinniittiioonn refinedlagrangebasis.hh:187 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_N_o_d_e_:_:_b_i_n_d │ │ │ │ -void bind(const Element &e) │ │ │ │ -Bind the node to the element e. │ │ │ │ -DDeeffiinniittiioonn refinedlagrangebasis.hh:170 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t__ │ │ │ │ -const FiniteElement finiteElement_ │ │ │ │ -DDeeffiinniittiioonn refinedlagrangebasis.hh:186 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_N_o_d_e_:_:_o_r_d_e_r │ │ │ │ -static constexpr unsigned int order() │ │ │ │ -Polynomial order used in the local Lagrange finite-elements in subdomains of │ │ │ │ -the element. │ │ │ │ -DDeeffiinniittiioonn refinedlagrangebasis.hh:180 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_N_o_d_e_:_:_E_l_e_m_e_n_t │ │ │ │ -typename GV::template Codim< 0 >::Entity Element │ │ │ │ -Type of the element in the GridView. │ │ │ │ -DDeeffiinniittiioonn refinedlagrangebasis.hh:128 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_N_o_d_e_:_:_R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_N_o_d_e │ │ │ │ -RefinedLagrangeNode() │ │ │ │ -The default constructor initializes all members to their default. │ │ │ │ -DDeeffiinniittiioonn refinedlagrangebasis.hh:144 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_N_o_d_e_:_:_e_l_e_m_e_n_t │ │ │ │ -const Element & element() const │ │ │ │ -Return current element. The behavior is undefined if the node is not bound to │ │ │ │ -any element. │ │ │ │ -DDeeffiinniittiioonn refinedlagrangebasis.hh:153 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s │ │ │ │ -A pre-basis for a refined Lagrange bases. │ │ │ │ -DDeeffiinniittiioonn refinedlagrangebasis.hh:46 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_o_r_d_e_r │ │ │ │ -static constexpr unsigned int order() │ │ │ │ -Polynomial order used in the local Lagrange finite-elements. │ │ │ │ -DDeeffiinniittiioonn refinedlagrangebasis.hh:109 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_m_a_k_e_N_o_d_e │ │ │ │ -Node makeNode() const │ │ │ │ -Create tree node. │ │ │ │ -DDeeffiinniittiioonn refinedlagrangebasis.hh:97 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_N_o_d_e │ │ │ │ -RefinedLagrangeNode< GV, k, R > Node │ │ │ │ -Type of the refined Lagrange tree node. │ │ │ │ -DDeeffiinniittiioonn refinedlagrangebasis.hh:78 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ -GV GridView │ │ │ │ -The grid view that the FE basis is defined on. │ │ │ │ -DDeeffiinniittiioonn refinedlagrangebasis.hh:75 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_R_e_f_i_n_e_d_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s │ │ │ │ -RefinedLagrangePreBasis(const GridView &gv) │ │ │ │ -Constructor for a given grid view object. │ │ │ │ -DDeeffiinniittiioonn refinedlagrangebasis.hh:86 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_n_v_a_l_i_d_R_a_n_g_e │ │ │ │ +Dummy range class to be used if no proper type is available. │ │ │ │ +DDeeffiinniittiioonn defaultderivativetraits.hh:27 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ +Default implementation for derivative traits. │ │ │ │ +DDeeffiinniittiioonn defaultderivativetraits.hh:41 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_:_:_R_a_n_g_e │ │ │ │ +InvalidRange Range │ │ │ │ +Range of derivative for function with given signature. │ │ │ │ +DDeeffiinniittiioonn defaultderivativetraits.hh:43 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_<_ _d_o_u_b_l_e_(_d_o_u_b_l_e_)_ _>_:_:_R_a_n_g_e │ │ │ │ +double Range │ │ │ │ +Range of derivative for function with given signature. │ │ │ │ +DDeeffiinniittiioonn defaultderivativetraits.hh:58 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_<_ _K_(_F_i_e_l_d_V_e_c_t_o_r_<_ _K_,_ _n_ _>_)_>_:_:_R_a_n_g_e │ │ │ │ +FieldVector< K, n > Range │ │ │ │ +Range of derivative for function with given signature. │ │ │ │ +DDeeffiinniittiioonn defaultderivativetraits.hh:74 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_<_ _F_i_e_l_d_V_e_c_t_o_r_<_ _K_,_ _m_ _>_(_F_i_e_l_d_V_e_c_t_o_r_<_ _K_,_ _n │ │ │ │ +_>_)_>_:_:_R_a_n_g_e │ │ │ │ +FieldMatrix< K, m, n > Range │ │ │ │ +Range of derivative for function with given signature. │ │ │ │ +DDeeffiinniittiioonn defaultderivativetraits.hh:90 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_<_ _F_i_e_l_d_M_a_t_r_i_x_<_ _K_,_ _1_,_ _m_ _>_(_F_i_e_l_d_V_e_c_t_o_r_< │ │ │ │ +_K_,_ _n_ _>_)_>_:_:_R_a_n_g_e │ │ │ │ +FieldMatrix< K, m, n > Range │ │ │ │ +Range of derivative for function with given signature. │ │ │ │ +DDeeffiinniittiioonn defaultderivativetraits.hh:106 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _r_e_f_i_n_e_d_l_a_g_r_a_n_g_e_b_a_s_i_s_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00098.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: raviartthomasbasis.hh File Reference │ │ │ +Dune-Functions: mapperutilities.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,73 +88,42 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
raviartthomasbasis.hh File Reference
│ │ │ +
mapperutilities.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <array>
│ │ │ -#include <dune/common/exceptions.hh>
│ │ │ -#include <dune/grid/common/capabilities.hh>
│ │ │ +
#include <vector>
│ │ │ +#include <bitset>
│ │ │ +#include <dune/common/rangeutilities.hh>
│ │ │ +#include <dune/grid/common/rangegenerators.hh>
│ │ │ #include <dune/grid/common/mcmgmapper.hh>
│ │ │ -#include <dune/localfunctions/common/localfiniteelementvariant.hh>
│ │ │ -#include <dune/localfunctions/raviartthomas.hh>
│ │ │ -#include <dune/localfunctions/raviartthomas/raviartthomas0cube2d.hh>
│ │ │ -#include <dune/localfunctions/raviartthomas/raviartthomas0cube3d.hh>
│ │ │ -#include <dune/localfunctions/raviartthomas/raviartthomas02d.hh>
│ │ │ -#include <dune/localfunctions/raviartthomas/raviartthomas03d.hh>
│ │ │ -#include <dune/localfunctions/raviartthomas/raviartthomas1cube2d.hh>
│ │ │ -#include <dune/localfunctions/raviartthomas/raviartthomas1cube3d.hh>
│ │ │ -#include <dune/localfunctions/raviartthomas/raviartthomas12d.hh>
│ │ │ -#include <dune/localfunctions/raviartthomas/raviartthomas2cube2d.hh>
│ │ │ -#include <dune/functions/functionspacebases/globalvaluedlocalfiniteelement.hh>
│ │ │ -#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ -#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │ -#include <dune/functions/functionspacebases/leafprebasismappermixin.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ -

│ │ │ -Classes

class  Dune::Functions::RaviartThomasPreBasis< GV, k >
class  Dune::Functions::RaviartThomasNode< GV, k >
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ -

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::BasisFactory
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -

│ │ │ -Typedefs

template<typename GV, int k>
using Dune::Functions::RaviartThomasBasis = DefaultGlobalBasis<RaviartThomasPreBasis<GV, k> >
 Basis of a k-th-order Raviart Thomas finite element space.
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │

│ │ │ -Functions

template<std::size_t k>
auto Dune::Functions::BasisFactory::raviartThomas ()
 Create a pre-basis factory that can create a Raviart-Thomas pre-basis.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,45 +1,19 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -raviartthomasbasis.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ +mapperutilities.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_g_l_o_b_a_l_v_a_l_u_e_d_l_o_c_a_l_f_i_n_i_t_e_e_l_e_m_e_n_t_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ -CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s_<_ _G_V_,_ _k_ _> │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e_<_ _G_V_,_ _k_ _> │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -TTyyppeeddeeffss │ │ │ │ -template │ │ │ │ -using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_B_a_s_i_s = │ │ │ │ - _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s<_R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s > │ │ │ │ -  Basis of a k-th-order Raviart Thomas finite element space. │ │ │ │ -FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_r_a_v_i_a_r_t_T_h_o_m_a_s () │ │ │ │ -  Create a pre-basis factory that can create a Raviart-Thomas pre-basis. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _r_a_v_i_a_r_t_t_h_o_m_a_s_b_a_s_i_s_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _m_a_p_p_e_r_u_t_i_l_i_t_i_e_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00098_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: raviartthomasbasis.hh Source File │ │ │ +Dune-Functions: mapperutilities.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,468 +88,183 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
raviartthomasbasis.hh
│ │ │ +
mapperutilities.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_COMMON_MAPPERUTILITIES_HH
│ │ │ +
8#define DUNE_FUNCTIONS_COMMON_MAPPERUTILITIES_HH
│ │ │
9
│ │ │ -
10#include <array>
│ │ │ -
11#include <dune/common/exceptions.hh>
│ │ │ +
10#include <vector>
│ │ │ +
11#include <bitset>
│ │ │
12
│ │ │ -
13#include <dune/grid/common/capabilities.hh>
│ │ │ -
14#include <dune/grid/common/mcmgmapper.hh>
│ │ │ -
15
│ │ │ -
16#include <dune/localfunctions/common/localfiniteelementvariant.hh>
│ │ │ -
17#include <dune/localfunctions/raviartthomas.hh>
│ │ │ -
18#include <dune/localfunctions/raviartthomas/raviartthomas0cube2d.hh>
│ │ │ -
19#include <dune/localfunctions/raviartthomas/raviartthomas0cube3d.hh>
│ │ │ -
20#include <dune/localfunctions/raviartthomas/raviartthomas02d.hh>
│ │ │ -
21#include <dune/localfunctions/raviartthomas/raviartthomas03d.hh>
│ │ │ -
22#include <dune/localfunctions/raviartthomas/raviartthomas1cube2d.hh>
│ │ │ -
23#include <dune/localfunctions/raviartthomas/raviartthomas1cube3d.hh>
│ │ │ -
24#include <dune/localfunctions/raviartthomas/raviartthomas12d.hh>
│ │ │ -
25#include <dune/localfunctions/raviartthomas/raviartthomas2cube2d.hh>
│ │ │ +
13#include <dune/common/rangeutilities.hh>
│ │ │ +
14
│ │ │ +
15#include <dune/grid/common/rangegenerators.hh>
│ │ │ +
16#include <dune/grid/common/mcmgmapper.hh>
│ │ │ +
17
│ │ │ +
18namespace Dune::Functions {
│ │ │ +
19
│ │ │ +
20// All utilities are in Impl:: and thus considered implementation
│ │ │ +
21// details for now. However, one may want to think about making
│ │ │ +
22// them public. Then they could also be put into dune-grid,
│ │ │ +
23// since there's nothing dune-function specific about them.
│ │ │ +
24namespace Impl {
│ │ │ +
25
│ │ │
26
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
31
│ │ │ -
32namespace Dune {
│ │ │ -
33namespace Functions {
│ │ │ -
34
│ │ │ -
35namespace Impl {
│ │ │ -
36
│ │ │ -
37 template<int dim, typename D, typename R, std::size_t k>
│ │ │ -
38 struct RaviartThomasSimplexLocalInfo
│ │ │ -
39 {
│ │ │ -
40 // Dummy type, must be something that we can have a std::unique_ptr to
│ │ │ -
41 using FiniteElement = void*;
│ │ │ -
42 };
│ │ │ -
43
│ │ │ -
44 template<typename D, typename R>
│ │ │ -
45 struct RaviartThomasSimplexLocalInfo<2,D,R,0>
│ │ │ -
46 {
│ │ │ -
47 using FiniteElement = RT02DLocalFiniteElement<D,R>;
│ │ │ -
48 };
│ │ │ -
49
│ │ │ -
50 template<typename D, typename R>
│ │ │ -
51 struct RaviartThomasSimplexLocalInfo<2,D,R,1>
│ │ │ -
52 {
│ │ │ -
53 using FiniteElement = RT12DLocalFiniteElement<D,R>;
│ │ │ -
54 };
│ │ │ -
55
│ │ │ -
56 template<typename D, typename R>
│ │ │ -
57 struct RaviartThomasSimplexLocalInfo<3,D,R,0>
│ │ │ -
58 {
│ │ │ -
59 using FiniteElement = RT03DLocalFiniteElement<D,R>;
│ │ │ -
60 };
│ │ │ -
61
│ │ │ -
62 template<int dim, typename D, typename R, std::size_t k>
│ │ │ -
63 struct RaviartThomasCubeLocalInfo
│ │ │ -
64 {
│ │ │ -
65 // Dummy type, must be something that we can have a std::unique_ptr to
│ │ │ -
66 using FiniteElement = void*;
│ │ │ -
67 };
│ │ │ -
68
│ │ │ -
69 template<typename D, typename R>
│ │ │ -
70 struct RaviartThomasCubeLocalInfo<2,D,R,0>
│ │ │ -
71 {
│ │ │ -
72 using FiniteElement = RT0Cube2DLocalFiniteElement<D,R>;
│ │ │ -
73 };
│ │ │ -
74
│ │ │ -
75 template<typename D, typename R>
│ │ │ -
76 struct RaviartThomasCubeLocalInfo<2,D,R,1>
│ │ │ -
77 {
│ │ │ -
78 using FiniteElement = RT1Cube2DLocalFiniteElement<D,R>;
│ │ │ +
27
│ │ │ +
28 // Helper class providing an unordered range
│ │ │ +
29 // of global indices associated to the element
│ │ │ +
30 // within a MultipleCodimMultipleGeomTypeMapper.
│ │ │ +
31 // This has to be bound to an element, before
│ │ │ +
32 // it can be used.
│ │ │ +
33 template<class GV>
│ │ │ +
34 class MapperElementSubIndices
│ │ │ +
35 {
│ │ │ +
36 using IndexContainer = std::vector<typename Dune::MultipleCodimMultipleGeomTypeMapper<GV>::Index>;
│ │ │ +
37 public:
│ │ │ +
38 using GridView = GV;
│ │ │ +
39 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView>;
│ │ │ +
40 using Index = typename Mapper::Index;
│ │ │ +
41 using Element = typename GridView::template Codim<0>::Entity;
│ │ │ +
42
│ │ │ +
43 MapperElementSubIndices(const Mapper& mapper)
│ │ │ +
44 : mapper_(mapper)
│ │ │ +
45 {}
│ │ │ +
46
│ │ │ +
47 // Bind to given element and precompute all indices.
│ │ │ +
48 void bind(const Element& element)
│ │ │ +
49 {
│ │ │ +
50 constexpr auto dimension = GridView::dimension;
│ │ │ +
51 indices_.clear();
│ │ │ +
52 auto referenceElement = Dune::referenceElement<double, dimension>(element.type());
│ │ │ +
53 for (auto codim : Dune::range(dimension + 1)) {
│ │ │ +
54 for (auto subEntity : Dune::range(referenceElement.size(codim))) {
│ │ │ +
55 std::size_t c = mapper_.layout()(referenceElement.type(subEntity, codim), dimension);
│ │ │ +
56 if (c > 0) {
│ │ │ +
57 std::size_t firstIndex = mapper_.subIndex(element, subEntity, codim);
│ │ │ +
58 for (auto j : Dune::range(firstIndex, firstIndex + c)) {
│ │ │ +
59 indices_.push_back(j);
│ │ │ +
60 }
│ │ │ +
61 }
│ │ │ +
62 }
│ │ │ +
63 }
│ │ │ +
64 }
│ │ │ +
65
│ │ │ +
66 auto begin() const
│ │ │ +
67 {
│ │ │ +
68 return indices_.begin();
│ │ │ +
69 }
│ │ │ +
70
│ │ │ +
71 auto end() const
│ │ │ +
72 {
│ │ │ +
73 return indices_.end();
│ │ │ +
74 }
│ │ │ +
75
│ │ │ +
76 private:
│ │ │ +
77 const Mapper mapper_;
│ │ │ +
78 IndexContainer indices_;
│ │ │
79 };
│ │ │
80
│ │ │ -
81 template<typename D, typename R>
│ │ │ -
82 struct RaviartThomasCubeLocalInfo<2,D,R,2>
│ │ │ -
83 {
│ │ │ -
84 using FiniteElement = RT2Cube2DLocalFiniteElement<D,R>;
│ │ │ -
85 };
│ │ │ -
86
│ │ │ -
87 template<typename D, typename R>
│ │ │ -
88 struct RaviartThomasCubeLocalInfo<3,D,R,0>
│ │ │ -
89 {
│ │ │ -
90 using FiniteElement = RT0Cube3DLocalFiniteElement<D,R>;
│ │ │ -
91 };
│ │ │ -
92
│ │ │ -
93 template<typename D, typename R>
│ │ │ -
94 struct RaviartThomasCubeLocalInfo<3,D,R,1>
│ │ │ -
95 {
│ │ │ -
96 using FiniteElement = RT1Cube3DLocalFiniteElement<D,R>;
│ │ │ -
97 };
│ │ │ -
98
│ │ │ -
99 template<int dim, typename D, typename R, std::size_t k>
│ │ │ -
100 struct RaviartThomasPyramidLocalInfo
│ │ │ -
101 {
│ │ │ -
102 // Dummy type, must be something that we can have a std::unique_ptr to
│ │ │ -
103 using FiniteElement = void*;
│ │ │ -
104 };
│ │ │ -
105
│ │ │ -
106 template<typename D, typename R>
│ │ │ -
107 struct RaviartThomasPyramidLocalInfo<3,D,R,0>
│ │ │ -
108 {
│ │ │ -
109 using FiniteElement = RT0PyramidLocalFiniteElement<D,R>;
│ │ │ -
110 };
│ │ │ -
111
│ │ │ -
112 template<int dim, typename D, typename R, std::size_t k>
│ │ │ -
113 struct RaviartThomasPrismLocalInfo
│ │ │ -
114 {
│ │ │ -
115 // Dummy type, must be something that we can have a std::unique_ptr to
│ │ │ -
116 using FiniteElement = void*;
│ │ │ -
117 };
│ │ │ -
118
│ │ │ -
119 template<typename D, typename R>
│ │ │ -
120 struct RaviartThomasPrismLocalInfo<3,D,R,0>
│ │ │ -
121 {
│ │ │ -
122 using FiniteElement = RT0PrismLocalFiniteElement<D,R>;
│ │ │ -
123 };
│ │ │ -
124
│ │ │ -
125 template<typename GV, int dim, typename R, std::size_t k>
│ │ │ -
126 class RaviartThomasLocalFiniteElementMap
│ │ │ -
127 {
│ │ │ -
128 using D = typename GV::ctype;
│ │ │ -
129 constexpr static bool hasFixedElementType = Capabilities::hasSingleGeometryType<typename GV::Grid>::v;
│ │ │ -
130
│ │ │ -
131 using CubeFiniteElement = typename RaviartThomasCubeLocalInfo<dim, D, R, k>::FiniteElement;
│ │ │ -
132 using SimplexFiniteElement = typename RaviartThomasSimplexLocalInfo<dim, D, R, k>::FiniteElement;
│ │ │ -
133 using PyramidFiniteElement = typename RaviartThomasPyramidLocalInfo<dim, D, R, k>::FiniteElement;
│ │ │ -
134 using PrismFiniteElement = typename RaviartThomasPrismLocalInfo<dim, D, R, k>::FiniteElement;
│ │ │ -
135
│ │ │ -
136 public:
│ │ │ -
137
│ │ │ -
138 using T = LocalBasisTraits<D, dim, FieldVector<D,dim>, R, dim, FieldVector<R,dim>, FieldMatrix<D,dim,dim> >;
│ │ │ +
81
│ │ │ +
82
│ │ │ +
83 // Helper function computing an average mesh size per subentity
│ │ │ +
84 // by averaging over the adjacent elements. This only considers
│ │ │ +
85 // the subentities handled by the given mapper and returns a
│ │ │ +
86 // std::vector<FieldType> of mesh sizes indexed according to the mapper.
│ │ │ +
87 //
│ │ │ +
88 // The average is determined by first computing the average volume
│ │ │ +
89 // of adjacent elements and then taking the d-th root for a d-dimensional
│ │ │ +
90 // grid.
│ │ │ +
91 //
│ │ │ +
92 // This operation has O(n) runtime (with n=mapper.size()),
│ │ │ +
93 // allocates O(n) memory for the returned vector and additional
│ │ │ +
94 // O(n) temporary memory.
│ │ │ +
95 template<class FieldType = double, class Mapper>
│ │ │ +
96 auto computeAverageSubEntityMeshSize(const Mapper& mapper)
│ │ │ +
97 {
│ │ │ +
98 constexpr auto dimension = Mapper::GridView::dimension;
│ │ │ +
99 std::vector<unsigned int> adjacentElements(mapper.size(), 0);
│ │ │ +
100 std::vector<FieldType> subEntityMeshSize(mapper.size(), 0.0);
│ │ │ +
101 auto subIndices = Impl::MapperElementSubIndices(mapper);
│ │ │ +
102 for(const auto& element : Dune::elements(mapper.gridView()))
│ │ │ +
103 {
│ │ │ +
104 auto A = element.geometry().volume();
│ │ │ +
105 subIndices.bind(element);
│ │ │ +
106 for(auto i : subIndices)
│ │ │ +
107 {
│ │ │ +
108 subEntityMeshSize[i] += A;
│ │ │ +
109 ++(adjacentElements[i]);
│ │ │ +
110 }
│ │ │ +
111 }
│ │ │ +
112 for(auto i : Dune::range(mapper.size()))
│ │ │ +
113 subEntityMeshSize[i] = std::pow(subEntityMeshSize[i]/adjacentElements[i], 1./dimension);
│ │ │ +
114 return subEntityMeshSize;
│ │ │ +
115 }
│ │ │ +
116
│ │ │ +
128 template<class ElementMapper>
│ │ │ +
129 std::vector<std::bitset<3>> computeEdgeOrientations(ElementMapper mapper)
│ │ │ +
130 {
│ │ │ +
131 constexpr int dim = 2;
│ │ │ +
132 static_assert(dim == ElementMapper::GridView::dimension);
│ │ │ +
133
│ │ │ +
134 auto const& gridView = mapper.gridView();
│ │ │ +
135 std::vector<std::bitset<3>> orientations;
│ │ │ +
136 orientations.resize(gridView.size(0));
│ │ │ +
137 // compute orientation for all elements
│ │ │ +
138 auto const& idSet = gridView.grid().globalIdSet();
│ │ │
139
│ │ │ -
140 constexpr static unsigned int topologyId = Capabilities::hasSingleGeometryType<typename GV::Grid>::topologyId; // meaningless if hasFixedElementType is false
│ │ │ -
141 constexpr static GeometryType type = GeometryType(topologyId, GV::dimension);
│ │ │ -
142
│ │ │ -
143 using FiniteElement = std::conditional_t<hasFixedElementType,
│ │ │ -
144 std::conditional_t<type.isCube(), CubeFiniteElement, SimplexFiniteElement>,
│ │ │ -
145 std::conditional_t<dim == 3,
│ │ │ -
146 LocalFiniteElementVariant<CubeFiniteElement, SimplexFiniteElement, PyramidFiniteElement, PrismFiniteElement>,
│ │ │ -
147 LocalFiniteElementVariant<CubeFiniteElement, SimplexFiniteElement> > >;
│ │ │ -
148
│ │ │ -
149 // Each element facet can have its orientation reversed, hence there are
│ │ │ -
150 // 2^#facets different variants.
│ │ │ -
151 static std::size_t numVariants(GeometryType type)
│ │ │ -
152 {
│ │ │ -
153 auto numFacets = referenceElement<D,dim>(type).size(1);
│ │ │ -
154 return power(2,numFacets);
│ │ │ -
155 }
│ │ │ -
156
│ │ │ -
157 RaviartThomasLocalFiniteElementMap(const GV& gv)
│ │ │ -
158 : elementMapper_(gv, mcmgElementLayout())
│ │ │ -
159 {
│ │ │ -
160 update(gv);
│ │ │ +
140 for (const auto &element : elements(gridView))
│ │ │ +
141 {
│ │ │ +
142 const auto &refElement = referenceElement(element);
│ │ │ +
143 auto elementIndex = mapper.index(element);
│ │ │ +
144
│ │ │ +
145 std::bitset<3>& orientation = orientations[elementIndex];
│ │ │ +
146
│ │ │ +
147
│ │ │ +
148 for (std::size_t i = 0; i < element.subEntities(dim - 1); i++)
│ │ │ +
149 {
│ │ │ +
150 // Local vertex indices within the element are ordered, localV0 < localV1
│ │ │ +
151 auto localV0 = refElement.subEntity(i, dim - 1, 0, dim);
│ │ │ +
152 auto localV1 = refElement.subEntity(i, dim - 1, 1, dim);
│ │ │ +
153
│ │ │ +
154 // Global vertex indices within the grid
│ │ │ +
155 auto globalV0 = idSet.subId(element, localV0, dim);
│ │ │ +
156 auto globalV1 = idSet.subId(element, localV1, dim);
│ │ │ +
157
│ │ │ +
158 // The edge is flipped if the local ordering disagrees with global ordering
│ │ │ +
159 orientation[i] = globalV0 > globalV1;
│ │ │ +
160 }
│ │ │
161 }
│ │ │ -
162
│ │ │ -
163 void update (const GV& gv)
│ │ │ -
164 {
│ │ │ -
165 elementMapper_.update(gv);
│ │ │ -
166 if constexpr (hasFixedElementType)
│ │ │ -
167 {
│ │ │ -
168 variants_.resize(numVariants(type));
│ │ │ -
169 for (size_t i = 0; i < numVariants(type); i++)
│ │ │ -
170 variants_[i] = FiniteElement(i);
│ │ │ -
171 }
│ │ │ -
172 else
│ │ │ -
173 {
│ │ │ -
174 // for mixed grids add offset for cubes
│ │ │ -
175 size_t numVariantsSimplex = numVariants(GeometryTypes::simplex(dim));
│ │ │ -
176 size_t numVariantsCube = numVariants(GeometryTypes::cube(dim));
│ │ │ -
177
│ │ │ -
178 variants_.resize(numVariantsSimplex + numVariantsCube);
│ │ │ -
179 for (size_t i = 0; i < numVariantsSimplex; i++)
│ │ │ -
180 variants_[i] = SimplexFiniteElement(i);
│ │ │ -
181 for (size_t i = 0; i < numVariantsCube; i++)
│ │ │ -
182 variants_[i + numVariantsSimplex] = CubeFiniteElement(i);
│ │ │ -
183 if constexpr (dim == 3)
│ │ │ -
184 {
│ │ │ -
185 size_t numVariantsPyramid = numVariants(GeometryTypes::pyramid);
│ │ │ -
186 size_t numVariantsPrism = numVariants(GeometryTypes::prism);
│ │ │ -
187
│ │ │ -
188 variants_.resize(numVariantsSimplex + numVariantsCube + numVariantsPyramid + numVariantsPrism );
│ │ │ -
189
│ │ │ -
190 for (size_t i = 0; i < numVariantsPyramid; i++)
│ │ │ -
191 variants_[i + numVariantsSimplex + numVariantsCube] = PyramidFiniteElement(i);
│ │ │ -
192 for (size_t i = 0; i < numVariantsPrism; i++)
│ │ │ -
193 variants_[i + numVariantsSimplex + numVariantsCube + numVariantsPyramid] = PrismFiniteElement(i);
│ │ │ -
194 }
│ │ │ -
195 }
│ │ │ -
196
│ │ │ -
197 orient_.resize(gv.size(0));
│ │ │ -
198 for(const auto& cell : elements(gv))
│ │ │ -
199 {
│ │ │ -
200 unsigned int myId = elementMapper_.index(cell);
│ │ │ -
201 orient_[myId] = 0;
│ │ │ -
202
│ │ │ -
203 for (const auto& intersection : intersections(gv,cell))
│ │ │ -
204 {
│ │ │ -
205 if (intersection.neighbor() && (gv.contains(intersection.outside())) && (elementMapper_.index(intersection.outside()) > myId))
│ │ │ -
206 orient_[myId] |= (1 << intersection.indexInInside());
│ │ │ -
207 }
│ │ │ -
208
│ │ │ -
209 // for mixed grids add offset for cubes and pyramids
│ │ │ -
210 if constexpr (!hasFixedElementType)
│ │ │ -
211 {
│ │ │ -
212 size_t numVariantsSimplex = numVariants(GeometryTypes::simplex(dim));
│ │ │ -
213 size_t numVariantsCube = numVariants(GeometryTypes::cube(dim));
│ │ │ -
214
│ │ │ -
215 if (cell.type().isCube())
│ │ │ -
216 orient_[myId] += numVariantsSimplex;
│ │ │ -
217 if constexpr (dim == 3)
│ │ │ -
218 {
│ │ │ -
219 size_t numVariantsPyramid = numVariants(GeometryTypes::pyramid);
│ │ │ -
220
│ │ │ -
221 if (cell.type().isPyramid())
│ │ │ -
222 orient_[myId] += numVariantsSimplex + numVariantsCube;
│ │ │ -
223 if (cell.type().isPrism())
│ │ │ -
224 orient_[myId] += numVariantsSimplex + numVariantsCube + numVariantsPyramid;
│ │ │ -
225 }
│ │ │ -
226 }
│ │ │ -
227 }
│ │ │ -
228 }
│ │ │ -
229
│ │ │ -
230 template<class EntityType>
│ │ │ -
231 const FiniteElement& find(const EntityType& e) const
│ │ │ -
232 {
│ │ │ -
233 return variants_[orient_[elementMapper_.index(e)]];
│ │ │ -
234 }
│ │ │ -
235
│ │ │ -
236 private:
│ │ │ -
237 std::vector<FiniteElement> variants_;
│ │ │ -
238 Dune::MultipleCodimMultipleGeomTypeMapper<GV> elementMapper_;
│ │ │ -
239 std::vector<unsigned char> orient_;
│ │ │ -
240 };
│ │ │ -
241
│ │ │ -
242
│ │ │ -
243} // namespace Impl
│ │ │ -
244
│ │ │ -
245
│ │ │ -
246// *****************************************************************************
│ │ │ -
247// This is the reusable part of the basis. It contains
│ │ │ -
248//
│ │ │ -
249// RaviartThomasPreBasis
│ │ │ -
250// RaviartThomasNode
│ │ │ -
251//
│ │ │ -
252// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ -
253// state. These components do _not_ depend on the global basis and local view
│ │ │ -
254// and can be used without a global basis.
│ │ │ -
255// *****************************************************************************
│ │ │ -
256
│ │ │ -
257template<typename GV, int k>
│ │ │ - │ │ │ -
259
│ │ │ -
260template<typename GV, int k>
│ │ │ -
│ │ │ - │ │ │ -
262 public LeafPreBasisMapperMixin<GV>
│ │ │ -
263{
│ │ │ -
264 using Base = LeafPreBasisMapperMixin<GV>;
│ │ │ -
265
│ │ │ -
266 // the layout is defined in terms of a MCMGLayout specialized for k == 0 or 1
│ │ │ -
267 static MCMGLayout dofLayout()
│ │ │ -
268 {
│ │ │ -
269 return [](GeometryType gt, size_t gridDim) -> size_t {
│ │ │ -
270 if ((gt.isPyramid()) and (k==0))
│ │ │ -
271 return 1;
│ │ │ -
272 if (gt.dim() == gridDim)
│ │ │ -
273 return gt.isCube() ? ((dim == 2) ? k*(k+1)*dim : k*(k+1)*(k+1)*dim) : k*dim;
│ │ │ -
274 if (gt.dim() == gridDim-1)
│ │ │ -
275 return gt.isCube() ? (dim-2)*2*k+k+1 : (dim-1)*k+1 ;
│ │ │ -
276 return 0;
│ │ │ -
277 };
│ │ │ -
278 }
│ │ │ -
279
│ │ │ -
280 static const int dim = GV::dimension;
│ │ │ -
281 using FiniteElementMap = typename Impl::RaviartThomasLocalFiniteElementMap<GV, dim, double, k>;
│ │ │ -
282
│ │ │ -
283public:
│ │ │ -
284
│ │ │ -
286 using GridView = GV;
│ │ │ -
287 using size_type = std::size_t;
│ │ │ -
288
│ │ │ - │ │ │ -
290
│ │ │ -
│ │ │ - │ │ │ -
293 Base(gv, dofLayout()),
│ │ │ - │ │ │ -
295 {
│ │ │ -
296 // Currently there are some unresolved bugs with hybrid grids and higher order Raviart-Thomas elements
│ │ │ -
297 if (gv.indexSet().types(0).size() > 1 and k>0)
│ │ │ -
298 DUNE_THROW(Dune::NotImplemented, "Raviart-Thomas basis with index k>0 is only implemented for grids with a single element type");
│ │ │ -
299
│ │ │ -
300 for(auto type : gv.indexSet().types(0))
│ │ │ -
301 if (!type.isSimplex() && !type.isCube() && !type.isPyramid() && !type.isPrism())
│ │ │ -
302 DUNE_THROW(Dune::NotImplemented, "Raviart-Thomas elements are only implemented for grids with simplex, cube, pyramid or prism elements.");
│ │ │ -
303 }
│ │ │ -
│ │ │ -
304
│ │ │ -
│ │ │ -
306 void update(const GridView& gv)
│ │ │ -
307 {
│ │ │ -
308 Base::update(gv);
│ │ │ -
309 finiteElementMap_.update(gv);
│ │ │ -
310 }
│ │ │ -
│ │ │ -
311
│ │ │ -
│ │ │ - │ │ │ -
316 {
│ │ │ -
317 return Node{&finiteElementMap_};
│ │ │ -
318 }
│ │ │ -
│ │ │ -
319
│ │ │ -
320protected:
│ │ │ -
321 FiniteElementMap finiteElementMap_;
│ │ │ -
322};
│ │ │ -
│ │ │ -
323
│ │ │ -
324
│ │ │ -
325
│ │ │ -
326template<typename GV, int k>
│ │ │ -
│ │ │ - │ │ │ -
328 public LeafBasisNode
│ │ │ -
329{
│ │ │ -
330 static const int dim = GV::dimension;
│ │ │ -
331
│ │ │ -
332public:
│ │ │ -
333
│ │ │ -
334 using size_type = std::size_t;
│ │ │ -
335 using Element = typename GV::template Codim<0>::Entity;
│ │ │ -
336 using FiniteElementMap = typename Impl::RaviartThomasLocalFiniteElementMap<GV, dim, double, k>;
│ │ │ -
337 using FiniteElement = Impl::GlobalValuedLocalFiniteElement<Impl::ContravariantPiolaTransformator,
│ │ │ -
338 typename FiniteElementMap::FiniteElement,
│ │ │ -
339 Element>;
│ │ │ -
340
│ │ │ -
│ │ │ -
341 RaviartThomasNode(const FiniteElementMap* finiteElementMap) :
│ │ │ -
342 element_(nullptr),
│ │ │ -
343 finiteElementMap_(finiteElementMap)
│ │ │ -
344 { }
│ │ │ -
│ │ │ -
345
│ │ │ -
│ │ │ -
347 const Element& element() const
│ │ │ -
348 {
│ │ │ -
349 return *element_;
│ │ │ -
350 }
│ │ │ -
│ │ │ -
351
│ │ │ -
│ │ │ - │ │ │ -
357 {
│ │ │ -
358 return finiteElement_;
│ │ │ -
359 }
│ │ │ -
│ │ │ -
360
│ │ │ -
│ │ │ -
362 void bind(const Element& e)
│ │ │ -
363 {
│ │ │ -
364 element_ = &e;
│ │ │ -
365 finiteElement_.bind((finiteElementMap_->find(*element_)), e);
│ │ │ -
366 this->setSize(finiteElement_.size());
│ │ │ -
367 }
│ │ │ -
│ │ │ -
368
│ │ │ -
369protected:
│ │ │ -
370
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
374};
│ │ │ -
│ │ │ -
375
│ │ │ -
376namespace BasisFactory {
│ │ │ -
377
│ │ │ -
385template<std::size_t k>
│ │ │ -
│ │ │ - │ │ │ -
387{
│ │ │ -
388 return [](const auto& gridView) {
│ │ │ -
389 return RaviartThomasPreBasis<std::decay_t<decltype(gridView)>, k>(gridView);
│ │ │ -
390 };
│ │ │ -
391}
│ │ │ -
│ │ │ -
392
│ │ │ -
393} // end namespace BasisFactory
│ │ │ -
394
│ │ │ -
395
│ │ │ -
396
│ │ │ -
397// *****************************************************************************
│ │ │ -
398// This is the actual global basis implementation based on the reusable parts.
│ │ │ -
399// *****************************************************************************
│ │ │ -
400
│ │ │ -
408template<typename GV, int k>
│ │ │ - │ │ │ -
410
│ │ │ -
411} // end namespace Functions
│ │ │ -
412} // end namespace Dune
│ │ │ -
413
│ │ │ -
414
│ │ │ -
415#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
auto raviartThomas()
Create a pre-basis factory that can create a Raviart-Thomas pre-basis.
Definition raviartthomasbasis.hh:386
│ │ │ -
auto power(ChildPreBasisFactory &&childPreBasisFactory, std::size_t k, const IndexMergingStrategy &)
Create a pre-basis factory that can build a PowerPreBasis.
Definition dynamicpowerbasis.hh:410
│ │ │ +
162 return orientations;
│ │ │ +
163 }
│ │ │ +
164
│ │ │ +
165} // end namespace Impl
│ │ │ +
166
│ │ │ +
167} // end namespace Dune::Functions
│ │ │ +
168
│ │ │ +
169
│ │ │ +
170#endif // end namespace DUNE_FUNCTIONS_COMMON_MAPPERUTILITIES_HH
│ │ │
auto elements(const SubDomainGridView< HostGridView > &subDomainGridView)
ADL findable access to element range for a SubDomainGridView.
Definition subdomain.hh:487
│ │ │ -
auto intersections(const SubDomainGridView< HostGridView > &subDomainGridView, const Element &element)
ADL findable access to intersection range for an element of a SubDomainGridView.
Definition subdomain.hh:510
│ │ │ -
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
DefaultGlobalBasis< RaviartThomasPreBasis< GV, k > > RaviartThomasBasis
Basis of a k-th-order Raviart Thomas finite element space.
Definition raviartthomasbasis.hh:409
│ │ │ -
Definition argyrisbasis.hh:926
│ │ │ -
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:53
│ │ │ -
void update(const GridView &gv)
Update the stored GridView.
Definition leafprebasismappermixin.hh:101
│ │ │ -
LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout)
Construct from GridView and local DOF layout.
Definition leafprebasismappermixin.hh:74
│ │ │ -
void setSize(const size_type size)
Definition nodes.hh:197
│ │ │ -
Definition nodes.hh:218
│ │ │ -
Definition raviartthomasbasis.hh:329
│ │ │ -
typename Impl::RaviartThomasLocalFiniteElementMap< GV, dim, double, k > FiniteElementMap
Definition raviartthomasbasis.hh:336
│ │ │ -
void bind(const Element &e)
Bind to element.
Definition raviartthomasbasis.hh:362
│ │ │ -
typename GV::template Codim< 0 >::Entity Element
Definition raviartthomasbasis.hh:335
│ │ │ -
const Element * element_
Definition raviartthomasbasis.hh:372
│ │ │ -
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition raviartthomasbasis.hh:356
│ │ │ -
std::size_t size_type
Definition raviartthomasbasis.hh:334
│ │ │ -
Impl::GlobalValuedLocalFiniteElement< Impl::ContravariantPiolaTransformator, typename FiniteElementMap::FiniteElement, Element > FiniteElement
Definition raviartthomasbasis.hh:337
│ │ │ -
RaviartThomasNode(const FiniteElementMap *finiteElementMap)
Definition raviartthomasbasis.hh:341
│ │ │ -
const Element & element() const
Return current element, throw if unbound.
Definition raviartthomasbasis.hh:347
│ │ │ -
FiniteElement finiteElement_
Definition raviartthomasbasis.hh:371
│ │ │ -
const FiniteElementMap * finiteElementMap_
Definition raviartthomasbasis.hh:373
│ │ │ -
Definition raviartthomasbasis.hh:263
│ │ │ -
Node makeNode() const
Create tree node.
Definition raviartthomasbasis.hh:315
│ │ │ -
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition raviartthomasbasis.hh:306
│ │ │ -
RaviartThomasPreBasis(const GridView &gv)
Constructor for a given grid view object.
Definition raviartthomasbasis.hh:292
│ │ │ -
std::size_t size_type
Definition raviartthomasbasis.hh:287
│ │ │ -
FiniteElementMap finiteElementMap_
Definition raviartthomasbasis.hh:321
│ │ │ -
RaviartThomasNode< GV, k > Node
Definition raviartthomasbasis.hh:289
│ │ │ -
GV GridView
The grid view that the FE space is defined on.
Definition raviartthomasbasis.hh:286
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,551 +1,182 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -raviartthomasbasis.hh │ │ │ │ +mapperutilities.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_COMMON_MAPPERUTILITIES_HH │ │ │ │ +8#define DUNE_FUNCTIONS_COMMON_MAPPERUTILITIES_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ 12 │ │ │ │ -13#include │ │ │ │ -14#include │ │ │ │ -15 │ │ │ │ -16#include │ │ │ │ -17#include │ │ │ │ -18#include │ │ │ │ -19#include │ │ │ │ -20#include │ │ │ │ -21#include │ │ │ │ -22#include │ │ │ │ -23#include │ │ │ │ -24#include │ │ │ │ -25#include │ │ │ │ +13#include │ │ │ │ +14 │ │ │ │ +15#include │ │ │ │ +16#include │ │ │ │ +17 │ │ │ │ +18namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ +19 │ │ │ │ +20// All utilities are in Impl:: and thus considered implementation │ │ │ │ +21// details for now. However, one may want to think about making │ │ │ │ +22// them public. Then they could also be put into dune-grid, │ │ │ │ +23// since there's nothing dune-function specific about them. │ │ │ │ +24namespace Impl { │ │ │ │ +25 │ │ │ │ 26 │ │ │ │ -27#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/ │ │ │ │ -_g_l_o_b_a_l_v_a_l_u_e_d_l_o_c_a_l_f_i_n_i_t_e_e_l_e_m_e_n_t_._h_h> │ │ │ │ -28#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -29#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ -30#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h> │ │ │ │ -31 │ │ │ │ -32namespace _D_u_n_e { │ │ │ │ -33namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -34 │ │ │ │ -35namespace Impl { │ │ │ │ -36 │ │ │ │ -37 template │ │ │ │ -38 struct RaviartThomasSimplexLocalInfo │ │ │ │ -39 { │ │ │ │ -40 // Dummy type, must be something that we can have a std::unique_ptr to │ │ │ │ -41 using FiniteElement = void*; │ │ │ │ -42 }; │ │ │ │ -43 │ │ │ │ -44 template │ │ │ │ -45 struct RaviartThomasSimplexLocalInfo<2,D,R,0> │ │ │ │ -46 { │ │ │ │ -47 using FiniteElement = RT02DLocalFiniteElement; │ │ │ │ -48 }; │ │ │ │ -49 │ │ │ │ -50 template │ │ │ │ -51 struct RaviartThomasSimplexLocalInfo<2,D,R,1> │ │ │ │ -52 { │ │ │ │ -53 using FiniteElement = RT12DLocalFiniteElement; │ │ │ │ -54 }; │ │ │ │ -55 │ │ │ │ -56 template │ │ │ │ -57 struct RaviartThomasSimplexLocalInfo<3,D,R,0> │ │ │ │ -58 { │ │ │ │ -59 using FiniteElement = RT03DLocalFiniteElement; │ │ │ │ -60 }; │ │ │ │ -61 │ │ │ │ -62 template │ │ │ │ -63 struct RaviartThomasCubeLocalInfo │ │ │ │ -64 { │ │ │ │ -65 // Dummy type, must be something that we can have a std::unique_ptr to │ │ │ │ -66 using FiniteElement = void*; │ │ │ │ -67 }; │ │ │ │ -68 │ │ │ │ -69 template │ │ │ │ -70 struct RaviartThomasCubeLocalInfo<2,D,R,0> │ │ │ │ -71 { │ │ │ │ -72 using FiniteElement = RT0Cube2DLocalFiniteElement; │ │ │ │ -73 }; │ │ │ │ -74 │ │ │ │ -75 template │ │ │ │ -76 struct RaviartThomasCubeLocalInfo<2,D,R,1> │ │ │ │ -77 { │ │ │ │ -78 using FiniteElement = RT1Cube2DLocalFiniteElement; │ │ │ │ +27 │ │ │ │ +28 // Helper class providing an unordered range │ │ │ │ +29 // of global indices associated to the element │ │ │ │ +30 // within a MultipleCodimMultipleGeomTypeMapper. │ │ │ │ +31 // This has to be bound to an element, before │ │ │ │ +32 // it can be used. │ │ │ │ +33 template │ │ │ │ +34 class MapperElementSubIndices │ │ │ │ +35 { │ │ │ │ +36 using IndexContainer = std::vector::Index>; │ │ │ │ +37 public: │ │ │ │ +38 using GridView = GV; │ │ │ │ +39 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper; │ │ │ │ +40 using Index = typename Mapper::Index; │ │ │ │ +41 using Element = typename GridView::template Codim<0>::Entity; │ │ │ │ +42 │ │ │ │ +43 MapperElementSubIndices(const Mapper& mapper) │ │ │ │ +44 : mapper_(mapper) │ │ │ │ +45 {} │ │ │ │ +46 │ │ │ │ +47 // Bind to given element and precompute all indices. │ │ │ │ +48 void bind(const Element& element) │ │ │ │ +49 { │ │ │ │ +50 constexpr auto dimension = GridView::dimension; │ │ │ │ +51 indices_.clear(); │ │ │ │ +52 auto referenceElement = Dune::referenceElement │ │ │ │ +(element.type()); │ │ │ │ +53 for (auto codim : Dune::range(dimension + 1)) { │ │ │ │ +54 for (auto subEntity : Dune::range(referenceElement.size(codim))) { │ │ │ │ +55 std::size_t c = mapper_.layout()(referenceElement.type(subEntity, codim), │ │ │ │ +dimension); │ │ │ │ +56 if (c > 0) { │ │ │ │ +57 std::size_t firstIndex = mapper_.subIndex(element, subEntity, codim); │ │ │ │ +58 for (auto j : Dune::range(firstIndex, firstIndex + c)) { │ │ │ │ +59 indices_.push_back(j); │ │ │ │ +60 } │ │ │ │ +61 } │ │ │ │ +62 } │ │ │ │ +63 } │ │ │ │ +64 } │ │ │ │ +65 │ │ │ │ +66 auto begin() const │ │ │ │ +67 { │ │ │ │ +68 return indices_.begin(); │ │ │ │ +69 } │ │ │ │ +70 │ │ │ │ +71 auto end() const │ │ │ │ +72 { │ │ │ │ +73 return indices_.end(); │ │ │ │ +74 } │ │ │ │ +75 │ │ │ │ +76 private: │ │ │ │ +77 const Mapper mapper_; │ │ │ │ +78 IndexContainer indices_; │ │ │ │ 79 }; │ │ │ │ 80 │ │ │ │ -81 template │ │ │ │ -82 struct RaviartThomasCubeLocalInfo<2,D,R,2> │ │ │ │ -83 { │ │ │ │ -84 using FiniteElement = RT2Cube2DLocalFiniteElement; │ │ │ │ -85 }; │ │ │ │ -86 │ │ │ │ -87 template │ │ │ │ -88 struct RaviartThomasCubeLocalInfo<3,D,R,0> │ │ │ │ -89 { │ │ │ │ -90 using FiniteElement = RT0Cube3DLocalFiniteElement; │ │ │ │ -91 }; │ │ │ │ -92 │ │ │ │ -93 template │ │ │ │ -94 struct RaviartThomasCubeLocalInfo<3,D,R,1> │ │ │ │ -95 { │ │ │ │ -96 using FiniteElement = RT1Cube3DLocalFiniteElement; │ │ │ │ -97 }; │ │ │ │ -98 │ │ │ │ -99 template │ │ │ │ -100 struct RaviartThomasPyramidLocalInfo │ │ │ │ -101 { │ │ │ │ -102 // Dummy type, must be something that we can have a std::unique_ptr to │ │ │ │ -103 using FiniteElement = void*; │ │ │ │ -104 }; │ │ │ │ -105 │ │ │ │ -106 template │ │ │ │ -107 struct RaviartThomasPyramidLocalInfo<3,D,R,0> │ │ │ │ -108 { │ │ │ │ -109 using FiniteElement = RT0PyramidLocalFiniteElement; │ │ │ │ -110 }; │ │ │ │ -111 │ │ │ │ -112 template │ │ │ │ -113 struct RaviartThomasPrismLocalInfo │ │ │ │ -114 { │ │ │ │ -115 // Dummy type, must be something that we can have a std::unique_ptr to │ │ │ │ -116 using FiniteElement = void*; │ │ │ │ -117 }; │ │ │ │ -118 │ │ │ │ -119 template │ │ │ │ -120 struct RaviartThomasPrismLocalInfo<3,D,R,0> │ │ │ │ -121 { │ │ │ │ -122 using FiniteElement = RT0PrismLocalFiniteElement; │ │ │ │ -123 }; │ │ │ │ -124 │ │ │ │ -125 template │ │ │ │ -126 class RaviartThomasLocalFiniteElementMap │ │ │ │ -127 { │ │ │ │ -128 using D = typename GV::ctype; │ │ │ │ -129 constexpr static bool hasFixedElementType = Capabilities:: │ │ │ │ -hasSingleGeometryType::v; │ │ │ │ -130 │ │ │ │ -131 using CubeFiniteElement = typename RaviartThomasCubeLocalInfo::FiniteElement; │ │ │ │ -132 using SimplexFiniteElement = typename RaviartThomasSimplexLocalInfo::FiniteElement; │ │ │ │ -133 using PyramidFiniteElement = typename RaviartThomasPyramidLocalInfo::FiniteElement; │ │ │ │ -134 using PrismFiniteElement = typename RaviartThomasPrismLocalInfo::FiniteElement; │ │ │ │ -135 │ │ │ │ -136 public: │ │ │ │ -137 │ │ │ │ -138 using T = LocalBasisTraits, R, dim, │ │ │ │ -FieldVector, FieldMatrix >; │ │ │ │ +81 │ │ │ │ +82 │ │ │ │ +83 // Helper function computing an average mesh size per subentity │ │ │ │ +84 // by averaging over the adjacent elements. This only considers │ │ │ │ +85 // the subentities handled by the given mapper and returns a │ │ │ │ +86 // std::vector of mesh sizes indexed according to the mapper. │ │ │ │ +87 // │ │ │ │ +88 // The average is determined by first computing the average volume │ │ │ │ +89 // of adjacent elements and then taking the d-th root for a d-dimensional │ │ │ │ +90 // grid. │ │ │ │ +91 // │ │ │ │ +92 // This operation has O(n) runtime (with n=mapper.size()), │ │ │ │ +93 // allocates O(n) memory for the returned vector and additional │ │ │ │ +94 // O(n) temporary memory. │ │ │ │ +95 template │ │ │ │ +96 auto computeAverageSubEntityMeshSize(const Mapper& mapper) │ │ │ │ +97 { │ │ │ │ +98 constexpr auto dimension = Mapper::GridView::dimension; │ │ │ │ +99 std::vector adjacentElements(mapper.size(), 0); │ │ │ │ +100 std::vector subEntityMeshSize(mapper.size(), 0.0); │ │ │ │ +101 auto subIndices = Impl::MapperElementSubIndices(mapper); │ │ │ │ +102 for(const auto& element : Dune::elements(mapper.gridView())) │ │ │ │ +103 { │ │ │ │ +104 auto A = element.geometry().volume(); │ │ │ │ +105 subIndices.bind(element); │ │ │ │ +106 for(auto i : subIndices) │ │ │ │ +107 { │ │ │ │ +108 subEntityMeshSize[i] += A; │ │ │ │ +109 ++(adjacentElements[i]); │ │ │ │ +110 } │ │ │ │ +111 } │ │ │ │ +112 for(auto i : Dune::range(mapper.size())) │ │ │ │ +113 subEntityMeshSize[i] = std::pow(subEntityMeshSize[i]/adjacentElements[i], │ │ │ │ +1./dimension); │ │ │ │ +114 return subEntityMeshSize; │ │ │ │ +115 } │ │ │ │ +116 │ │ │ │ +128 template │ │ │ │ +129 std::vector> computeEdgeOrientations(ElementMapper mapper) │ │ │ │ +130 { │ │ │ │ +131 constexpr int dim = 2; │ │ │ │ +132 static_assert(dim == ElementMapper::GridView::dimension); │ │ │ │ +133 │ │ │ │ +134 auto const& gridView = mapper.gridView(); │ │ │ │ +135 std::vector> orientations; │ │ │ │ +136 orientations.resize(gridView.size(0)); │ │ │ │ +137 // compute orientation for all elements │ │ │ │ +138 auto const& idSet = gridView.grid().globalIdSet(); │ │ │ │ 139 │ │ │ │ -140 constexpr static unsigned int topologyId = Capabilities:: │ │ │ │ -hasSingleGeometryType::topologyId; // meaningless if │ │ │ │ -hasFixedElementType is false │ │ │ │ -141 constexpr static GeometryType type = GeometryType(topologyId, GV:: │ │ │ │ -dimension); │ │ │ │ -142 │ │ │ │ -143 using FiniteElement = std::conditional_t, │ │ │ │ -145 std::conditional_t, │ │ │ │ -147 LocalFiniteElementVariant > >; │ │ │ │ -148 │ │ │ │ -149 // Each element facet can have its orientation reversed, hence there are │ │ │ │ -150 // 2^#facets different variants. │ │ │ │ -151 static std::size_t numVariants(GeometryType type) │ │ │ │ -152 { │ │ │ │ -153 auto numFacets = referenceElement(type).size(1); │ │ │ │ -154 return _p_o_w_e_r(2,numFacets); │ │ │ │ -155 } │ │ │ │ -156 │ │ │ │ -157 RaviartThomasLocalFiniteElementMap(const GV& gv) │ │ │ │ -158 : elementMapper_(gv, mcmgElementLayout()) │ │ │ │ -159 { │ │ │ │ -160 update(gv); │ │ │ │ +140 for (const auto &element : _e_l_e_m_e_n_t_s(gridView)) │ │ │ │ +141 { │ │ │ │ +142 const auto &refElement = referenceElement(element); │ │ │ │ +143 auto elementIndex = mapper.index(element); │ │ │ │ +144 │ │ │ │ +145 std::bitset<3>& orientation = orientations[elementIndex]; │ │ │ │ +146 │ │ │ │ +147 │ │ │ │ +148 for (std::size_t i = 0; i < element.subEntities(dim - 1); i++) │ │ │ │ +149 { │ │ │ │ +150 // Local vertex indices within the element are ordered, localV0 < localV1 │ │ │ │ +151 auto localV0 = refElement.subEntity(i, dim - 1, 0, dim); │ │ │ │ +152 auto localV1 = refElement.subEntity(i, dim - 1, 1, dim); │ │ │ │ +153 │ │ │ │ +154 // Global vertex indices within the grid │ │ │ │ +155 auto globalV0 = idSet.subId(element, localV0, dim); │ │ │ │ +156 auto globalV1 = idSet.subId(element, localV1, dim); │ │ │ │ +157 │ │ │ │ +158 // The edge is flipped if the local ordering disagrees with global ordering │ │ │ │ +159 orientation[i] = globalV0 > globalV1; │ │ │ │ +160 } │ │ │ │ 161 } │ │ │ │ -162 │ │ │ │ -163 void update (const GV& gv) │ │ │ │ -164 { │ │ │ │ -165 elementMapper_.update(gv); │ │ │ │ -166 if constexpr (hasFixedElementType) │ │ │ │ -167 { │ │ │ │ -168 variants_.resize(numVariants(type)); │ │ │ │ -169 for (size_t i = 0; i < numVariants(type); i++) │ │ │ │ -170 variants_[i] = FiniteElement(i); │ │ │ │ -171 } │ │ │ │ -172 else │ │ │ │ -173 { │ │ │ │ -174 // for mixed grids add offset for cubes │ │ │ │ -175 size_t numVariantsSimplex = numVariants(GeometryTypes::simplex(dim)); │ │ │ │ -176 size_t numVariantsCube = numVariants(GeometryTypes::cube(dim)); │ │ │ │ -177 │ │ │ │ -178 variants_.resize(numVariantsSimplex + numVariantsCube); │ │ │ │ -179 for (size_t i = 0; i < numVariantsSimplex; i++) │ │ │ │ -180 variants_[i] = SimplexFiniteElement(i); │ │ │ │ -181 for (size_t i = 0; i < numVariantsCube; i++) │ │ │ │ -182 variants_[i + numVariantsSimplex] = CubeFiniteElement(i); │ │ │ │ -183 if constexpr (dim == 3) │ │ │ │ -184 { │ │ │ │ -185 size_t numVariantsPyramid = numVariants(GeometryTypes::pyramid); │ │ │ │ -186 size_t numVariantsPrism = numVariants(GeometryTypes::prism); │ │ │ │ -187 │ │ │ │ -188 variants_.resize(numVariantsSimplex + numVariantsCube + numVariantsPyramid │ │ │ │ -+ numVariantsPrism ); │ │ │ │ -189 │ │ │ │ -190 for (size_t i = 0; i < numVariantsPyramid; i++) │ │ │ │ -191 variants_[i + numVariantsSimplex + numVariantsCube] = PyramidFiniteElement │ │ │ │ -(i); │ │ │ │ -192 for (size_t i = 0; i < numVariantsPrism; i++) │ │ │ │ -193 variants_[i + numVariantsSimplex + numVariantsCube + numVariantsPyramid] = │ │ │ │ -PrismFiniteElement(i); │ │ │ │ -194 } │ │ │ │ -195 } │ │ │ │ -196 │ │ │ │ -197 orient_.resize(gv.size(0)); │ │ │ │ -198 for(const auto& cell : _e_l_e_m_e_n_t_s(gv)) │ │ │ │ -199 { │ │ │ │ -200 unsigned int myId = elementMapper_.index(cell); │ │ │ │ -201 orient_[myId] = 0; │ │ │ │ -202 │ │ │ │ -203 for (const auto& intersection : _i_n_t_e_r_s_e_c_t_i_o_n_s(gv,cell)) │ │ │ │ -204 { │ │ │ │ -205 if (intersection.neighbor() && (gv.contains(intersection.outside())) && │ │ │ │ -(elementMapper_.index(intersection.outside()) > myId)) │ │ │ │ -206 orient_[myId] |= (1 << intersection.indexInInside()); │ │ │ │ -207 } │ │ │ │ -208 │ │ │ │ -209 // for mixed grids add offset for cubes and pyramids │ │ │ │ -210 if constexpr (!hasFixedElementType) │ │ │ │ -211 { │ │ │ │ -212 size_t numVariantsSimplex = numVariants(GeometryTypes::simplex(dim)); │ │ │ │ -213 size_t numVariantsCube = numVariants(GeometryTypes::cube(dim)); │ │ │ │ -214 │ │ │ │ -215 if (cell.type().isCube()) │ │ │ │ -216 orient_[myId] += numVariantsSimplex; │ │ │ │ -217 if constexpr (dim == 3) │ │ │ │ -218 { │ │ │ │ -219 size_t numVariantsPyramid = numVariants(GeometryTypes::pyramid); │ │ │ │ -220 │ │ │ │ -221 if (cell.type().isPyramid()) │ │ │ │ -222 orient_[myId] += numVariantsSimplex + numVariantsCube; │ │ │ │ -223 if (cell.type().isPrism()) │ │ │ │ -224 orient_[myId] += numVariantsSimplex + numVariantsCube + numVariantsPyramid; │ │ │ │ -225 } │ │ │ │ -226 } │ │ │ │ -227 } │ │ │ │ -228 } │ │ │ │ -229 │ │ │ │ -230 template │ │ │ │ -231 const FiniteElement& find(const EntityType& e) const │ │ │ │ -232 { │ │ │ │ -233 return variants_[orient_[elementMapper_.index(e)]]; │ │ │ │ -234 } │ │ │ │ -235 │ │ │ │ -236 private: │ │ │ │ -237 std::vector variants_; │ │ │ │ -238 Dune::MultipleCodimMultipleGeomTypeMapper elementMapper_; │ │ │ │ -239 std::vector orient_; │ │ │ │ -240 }; │ │ │ │ -241 │ │ │ │ -242 │ │ │ │ -243} // namespace Impl │ │ │ │ -244 │ │ │ │ -245 │ │ │ │ -246/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -247// This is the reusable part of the basis. It contains │ │ │ │ -248// │ │ │ │ -249// RaviartThomasPreBasis │ │ │ │ -250// RaviartThomasNode │ │ │ │ -251// │ │ │ │ -252// The pre-basis allows to create the others and is the owner of possible │ │ │ │ -shared │ │ │ │ -253// state. These components do _not_ depend on the global basis and local │ │ │ │ -view │ │ │ │ -254// and can be used without a global basis. │ │ │ │ -255/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -256 │ │ │ │ -257template │ │ │ │ -258class _R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e; │ │ │ │ -259 │ │ │ │ -260template │ │ │ │ -_2_6_1class _R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s : │ │ │ │ -262 public _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n │ │ │ │ -263{ │ │ │ │ -264 using Base = _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_<_G_V_>; │ │ │ │ -265 │ │ │ │ -266 // the layout is defined in terms of a MCMGLayout specialized for k == 0 or │ │ │ │ -1 │ │ │ │ -267 static MCMGLayout dofLayout() │ │ │ │ -268 { │ │ │ │ -269 return [](GeometryType gt, size_t gridDim) -> size_t { │ │ │ │ -270 if ((gt.isPyramid()) and (k==0)) │ │ │ │ -271 return 1; │ │ │ │ -272 if (gt.dim() == gridDim) │ │ │ │ -273 return gt.isCube() ? ((dim == 2) ? k*(k+1)*dim : k*(k+1)*(k+1)*dim) : │ │ │ │ -k*dim; │ │ │ │ -274 if (gt.dim() == gridDim-1) │ │ │ │ -275 return gt.isCube() ? (dim-2)*2*k+k+1 : (dim-1)*k+1 ; │ │ │ │ -276 return 0; │ │ │ │ -277 }; │ │ │ │ -278 } │ │ │ │ -279 │ │ │ │ -280 static const int dim = GV::dimension; │ │ │ │ -281 using FiniteElementMap = typename Impl:: │ │ │ │ -RaviartThomasLocalFiniteElementMap; │ │ │ │ -282 │ │ │ │ -283public: │ │ │ │ -284 │ │ │ │ -_2_8_6 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ -_2_8_7 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ -288 │ │ │ │ -_2_8_9 using _N_o_d_e = _R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e_<_G_V_,_ _k_>; │ │ │ │ -290 │ │ │ │ -_2_9_2 _R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s(const _G_r_i_d_V_i_e_w& gv) : │ │ │ │ -293 Base(gv, dofLayout()), │ │ │ │ -294 _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__(gv) │ │ │ │ -295 { │ │ │ │ -296 // Currently there are some unresolved bugs with hybrid grids and higher │ │ │ │ -order Raviart-Thomas elements │ │ │ │ -297 if (gv.indexSet().types(0).size() > 1 and k>0) │ │ │ │ -298 DUNE_THROW(Dune::NotImplemented, "Raviart-Thomas basis with index k>0 is │ │ │ │ -only implemented for grids with a single element type"); │ │ │ │ -299 │ │ │ │ -300 for(auto type : gv.indexSet().types(0)) │ │ │ │ -301 if (!type.isSimplex() && !type.isCube() && !type.isPyramid() && │ │ │ │ -!type.isPrism()) │ │ │ │ -302 DUNE_THROW(Dune::NotImplemented, "Raviart-Thomas elements are only │ │ │ │ -implemented for grids with simplex, cube, pyramid or prism elements."); │ │ │ │ -303 } │ │ │ │ -304 │ │ │ │ -_3_0_6 void _u_p_d_a_t_e(const _G_r_i_d_V_i_e_w& gv) │ │ │ │ -307 { │ │ │ │ -308 _B_a_s_e_:_:_u_p_d_a_t_e(gv); │ │ │ │ -309 _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__.update(gv); │ │ │ │ -310 } │ │ │ │ -311 │ │ │ │ -_3_1_5 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ -316 { │ │ │ │ -317 return _N_o_d_e{&_f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__}; │ │ │ │ -318 } │ │ │ │ -319 │ │ │ │ -320protected: │ │ │ │ -_3_2_1 FiniteElementMap _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__; │ │ │ │ -322}; │ │ │ │ -323 │ │ │ │ -324 │ │ │ │ -325 │ │ │ │ -326template │ │ │ │ -_3_2_7class _R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e : │ │ │ │ -328 public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ -329{ │ │ │ │ -330 static const int dim = GV::dimension; │ │ │ │ -331 │ │ │ │ -332public: │ │ │ │ -333 │ │ │ │ -_3_3_4 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ -_3_3_5 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ -_3_3_6 using _F_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p = typename Impl:: │ │ │ │ -RaviartThomasLocalFiniteElementMap; │ │ │ │ -_3_3_7 using _F_i_n_i_t_e_E_l_e_m_e_n_t = Impl::GlobalValuedLocalFiniteElement; │ │ │ │ -340 │ │ │ │ -_3_4_1 _R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e(const _F_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p* finiteElementMap) : │ │ │ │ -342 _e_l_e_m_e_n_t__(nullptr), │ │ │ │ -343 _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__(finiteElementMap) │ │ │ │ -344 { } │ │ │ │ -345 │ │ │ │ -_3_4_7 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ -348 { │ │ │ │ -349 return *_e_l_e_m_e_n_t__; │ │ │ │ -350 } │ │ │ │ -351 │ │ │ │ -_3_5_6 const _F_i_n_i_t_e_E_l_e_m_e_n_t& _f_i_n_i_t_e_E_l_e_m_e_n_t() const │ │ │ │ -357 { │ │ │ │ -358 return _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ -359 } │ │ │ │ -360 │ │ │ │ -_3_6_2 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ -363 { │ │ │ │ -364 _e_l_e_m_e_n_t__ = &e; │ │ │ │ -365 _f_i_n_i_t_e_E_l_e_m_e_n_t__.bind((_f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__->find(*_e_l_e_m_e_n_t__)), e); │ │ │ │ -366 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__.size()); │ │ │ │ -367 } │ │ │ │ -368 │ │ │ │ -369protected: │ │ │ │ -370 │ │ │ │ -_3_7_1 _F_i_n_i_t_e_E_l_e_m_e_n_t _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ -_3_7_2 const _E_l_e_m_e_n_t* _e_l_e_m_e_n_t__; │ │ │ │ -_3_7_3 const _F_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p* _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__; │ │ │ │ -374}; │ │ │ │ -375 │ │ │ │ -376namespace _B_a_s_i_s_F_a_c_t_o_r_y { │ │ │ │ -377 │ │ │ │ -385template │ │ │ │ -_3_8_6auto _r_a_v_i_a_r_t_T_h_o_m_a_s() │ │ │ │ -387{ │ │ │ │ -388 return [](const auto& gridView) { │ │ │ │ -389 return _R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s, k> │ │ │ │ -(gridView); │ │ │ │ -390 }; │ │ │ │ -391} │ │ │ │ -392 │ │ │ │ -393} // end namespace BasisFactory │ │ │ │ -394 │ │ │ │ -395 │ │ │ │ -396 │ │ │ │ -397/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -398// This is the actual global basis implementation based on the reusable │ │ │ │ -parts. │ │ │ │ -399/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -400 │ │ │ │ -408template │ │ │ │ -_4_0_9using _R_a_v_i_a_r_t_T_h_o_m_a_s_B_a_s_i_s = _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s_<_G_V_,_ _k_> │ │ │ │ ->; │ │ │ │ -410 │ │ │ │ -411} // end namespace Functions │ │ │ │ -412} // end namespace Dune │ │ │ │ -413 │ │ │ │ -414 │ │ │ │ -415#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH │ │ │ │ -_n_o_d_e_s_._h_h │ │ │ │ -_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h │ │ │ │ -_g_l_o_b_a_l_v_a_l_u_e_d_l_o_c_a_l_f_i_n_i_t_e_e_l_e_m_e_n_t_._h_h │ │ │ │ -_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_r_a_v_i_a_r_t_T_h_o_m_a_s │ │ │ │ -auto raviartThomas() │ │ │ │ -Create a pre-basis factory that can create a Raviart-Thomas pre-basis. │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:386 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_p_o_w_e_r │ │ │ │ -auto power(ChildPreBasisFactory &&childPreBasisFactory, std::size_t k, const │ │ │ │ -IndexMergingStrategy &) │ │ │ │ -Create a pre-basis factory that can build a PowerPreBasis. │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:410 │ │ │ │ +162 return orientations; │ │ │ │ +163 } │ │ │ │ +164 │ │ │ │ +165} // end namespace Impl │ │ │ │ +166 │ │ │ │ +167} // end namespace Dune::Functions │ │ │ │ +168 │ │ │ │ +169 │ │ │ │ +170#endif // end namespace DUNE_FUNCTIONS_COMMON_MAPPERUTILITIES_HH │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_e_l_e_m_e_n_t_s │ │ │ │ auto elements(const SubDomainGridView< HostGridView > &subDomainGridView) │ │ │ │ ADL findable access to element range for a SubDomainGridView. │ │ │ │ DDeeffiinniittiioonn subdomain.hh:487 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_i_n_t_e_r_s_e_c_t_i_o_n_s │ │ │ │ -auto intersections(const SubDomainGridView< HostGridView > &subDomainGridView, │ │ │ │ -const Element &element) │ │ │ │ -ADL findable access to intersection range for an element of a │ │ │ │ -SubDomainGridView. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:510 │ │ │ │ -_D_u_n_e │ │ │ │ -DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_B_a_s_i_s │ │ │ │ -DefaultGlobalBasis< RaviartThomasPreBasis< GV, k > > RaviartThomasBasis │ │ │ │ -Basis of a k-th-order Raviart Thomas finite element space. │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:409 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:926 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ -Global basis for given pre-basis. │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:53 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_u_p_d_a_t_e │ │ │ │ -void update(const GridView &gv) │ │ │ │ -Update the stored GridView. │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:101 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n │ │ │ │ -LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout) │ │ │ │ -Construct from GridView and local DOF layout. │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:74 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_e_t_S_i_z_e │ │ │ │ -void setSize(const size_type size) │ │ │ │ -DDeeffiinniittiioonn nodes.hh:197 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ -DDeeffiinniittiioonn nodes.hh:218 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:329 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e_:_:_F_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p │ │ │ │ -typename Impl::RaviartThomasLocalFiniteElementMap< GV, dim, double, k > │ │ │ │ -FiniteElementMap │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:336 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e_:_:_b_i_n_d │ │ │ │ -void bind(const Element &e) │ │ │ │ -Bind to element. │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:362 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e_:_:_E_l_e_m_e_n_t │ │ │ │ -typename GV::template Codim< 0 >::Entity Element │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:335 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e_:_:_e_l_e_m_e_n_t__ │ │ │ │ -const Element * element_ │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:372 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ -const FiniteElement & finiteElement() const │ │ │ │ -Return the LocalFiniteElement for the element we are bound to. │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:356 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:334 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e_:_:_F_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ -Impl::GlobalValuedLocalFiniteElement< Impl::ContravariantPiolaTransformator, │ │ │ │ -typename FiniteElementMap::FiniteElement, Element > FiniteElement │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:337 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e │ │ │ │ -RaviartThomasNode(const FiniteElementMap *finiteElementMap) │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:341 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e_:_:_e_l_e_m_e_n_t │ │ │ │ -const Element & element() const │ │ │ │ -Return current element, throw if unbound. │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:347 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t__ │ │ │ │ -FiniteElement finiteElement_ │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:371 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__ │ │ │ │ -const FiniteElementMap * finiteElementMap_ │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:373 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:263 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s_:_:_m_a_k_e_N_o_d_e │ │ │ │ -Node makeNode() const │ │ │ │ -Create tree node. │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:315 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s_:_:_u_p_d_a_t_e │ │ │ │ -void update(const GridView &gv) │ │ │ │ -Update the stored grid view, to be called if the grid has changed. │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:306 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s │ │ │ │ -RaviartThomasPreBasis(const GridView &gv) │ │ │ │ -Constructor for a given grid view object. │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:292 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:287 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__ │ │ │ │ -FiniteElementMap finiteElementMap_ │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:321 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s_:_:_N_o_d_e │ │ │ │ -RaviartThomasNode< GV, k > Node │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:289 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ -GV GridView │ │ │ │ -The grid view that the FE space is defined on. │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:286 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _r_a_v_i_a_r_t_t_h_o_m_a_s_b_a_s_i_s_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _m_a_p_p_e_r_u_t_i_l_i_t_i_e_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00101.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: rannacherturekbasis.hh File Reference │ │ │ +Dune-Functions: subdomain.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,64 +88,84 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
rannacherturekbasis.hh File Reference
│ │ │ +
subdomain.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <dune/common/exceptions.hh>
│ │ │ -#include <dune/grid/common/capabilities.hh>
│ │ │ -#include <dune/localfunctions/common/localfiniteelementvariant.hh>
│ │ │ -#include <dune/localfunctions/rannacherturek.hh>
│ │ │ -#include <dune/localfunctions/crouzeixraviart.hh>
│ │ │ -#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ -#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │ -#include <dune/functions/functionspacebases/leafprebasismixin.hh>
│ │ │ +
#include <array>
│ │ │ +#include <cstddef>
│ │ │ +#include <limits>
│ │ │ +#include <type_traits>
│ │ │ +#include <utility>
│ │ │ +#include <vector>
│ │ │ +#include <dune/common/exceptions.hh>
│ │ │ +#include <dune/common/iteratorfacades.hh>
│ │ │ +#include <dune/common/iteratorrange.hh>
│ │ │ +#include <dune/common/rangeutilities.hh>
│ │ │ +#include <dune/geometry/type.hh>
│ │ │ +#include <dune/geometry/typeindex.hh>
│ │ │ +#include <dune/grid/common/mcmgmapper.hh>
│ │ │ +#include <dune/grid/common/partitionset.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::RannacherTurekPreBasis< GV >
 Pre-basis for a Rannacher-Turek basis. More...
class  Dune::Functions::RannacherTurekNode< GV >
class  Dune::Functions::Experimental::SubDomainIndexSet< HGV >
 An IndexSet for a sub-domain. More...
struct  Dune::Functions::Experimental::SubDomainIndexSet< HGV >::Codim< codim >
 Codim specific typedefs. More...
class  Dune::Functions::Experimental::SubDomainGridView< HGV >
 A GridView for a sub-domain. More...
struct  Dune::Functions::Experimental::SubDomainGridView< HGV >::Codim< codim >
 Codim specific typedefs. More...
struct  Dune::Functions::Experimental::SubDomainGridView< HGV >::Codim< codim >::Partition< pit >
class  Dune::Functions::Experimental::SubDomain< HGV >
 Class representing a sub-domain of a GridView. More...
struct  Dune::Functions::Experimental::SubDomain< HGV >::Codim< codim >
 Codim specific typedefs. More...
class  Dune::Functions::Experimental::SubDomainInterface< SubDomainA, SubDomainB >
 Class representing the intersection between two subdomains. More...
class  Dune::Functions::Experimental::SubDomainSkeleton< SubDomain >
 Class representing the skeleton of a subdomain. More...
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ -

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::BasisFactory
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │

│ │ │ -Typedefs

template<typename GV>
using Dune::Functions::RannacherTurekBasis = DefaultGlobalBasis<RannacherTurekPreBasis<GV> >
 Rannacher-Turek basis.
namespace  Dune::Functions::Experimental
│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Functions

template<class Dummy = void>
auto Dune::Functions::BasisFactory::rannacherTurek ()
 Create a pre-basis factory that can create a Rannacher-Turek pre-basis.
template<class HostGridView>
auto Dune::Functions::Experimental::elements (const SubDomainGridView< HostGridView > &subDomainGridView)
 ADL findable access to element range for a SubDomainGridView.
template<class HostGridView, unsigned int partitions>
auto Dune::Functions::Experimental::elements (const SubDomainGridView< HostGridView > &subDomainGridView, Dune::PartitionSet< partitions > partitionSet)
 ADL findable access to element range for a SubDomainGridView.
template<class HostGridView, class Element>
auto Dune::Functions::Experimental::intersections (const SubDomainGridView< HostGridView > &subDomainGridView, const Element &element)
 ADL findable access to intersection range for an element of a SubDomainGridView.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,36 +1,66 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -rannacherturekbasis.hh File Reference │ │ │ │ +subdomain.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h> │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s_<_ _G_V_ _> │ │ │ │ -  Pre-basis for a Rannacher-Turek basis. _M_o_r_e_._._. │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e_<_ _G_V_ _> │ │ │ │ + class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_<_ _H_G_V_ _> │ │ │ │ +  An IndexSet for a sub-domain. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_<_ _H_G_V_ _>_:_:_C_o_d_i_m_<_ _c_o_d_i_m │ │ │ │ + _> │ │ │ │ +  _C_o_d_i_m specific typedefs. _M_o_r_e_._._. │ │ │ │ + class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_<_ _H_G_V_ _> │ │ │ │ +  A GridView for a sub-domain. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_<_ _H_G_V_ _>_:_:_C_o_d_i_m_<_ _c_o_d_i_m │ │ │ │ + _> │ │ │ │ +  _C_o_d_i_m specific typedefs. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_<_ _H_G_V_ _>_:_:_C_o_d_i_m_<_ _c_o_d_i_m │ │ │ │ + _>_:_:_P_a_r_t_i_t_i_o_n_<_ _p_i_t_ _> │ │ │ │ + class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_<_ _H_G_V_ _> │ │ │ │ +  Class representing a sub-domain of a _G_r_i_d_V_i_e_w. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_<_ _H_G_V_ _>_:_:_C_o_d_i_m_<_ _c_o_d_i_m_ _> │ │ │ │ +  _C_o_d_i_m specific typedefs. _M_o_r_e_._._. │ │ │ │ + class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_t_e_r_f_a_c_e_<_ _S_u_b_D_o_m_a_i_n_A_, │ │ │ │ + _S_u_b_D_o_m_a_i_n_B_ _> │ │ │ │ +  Class representing the intersection between two subdomains. _M_o_r_e_._._. │ │ │ │ + class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_S_k_e_l_e_t_o_n_<_ _S_u_b_D_o_m_a_i_n_ _> │ │ │ │ +  Class representing the skeleton of a subdomain. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -TTyyppeeddeeffss │ │ │ │ -template │ │ │ │ -using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_B_a_s_i_s = │ │ │ │ - _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s<_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s > │ │ │ │ -  Rannacher-Turek basis. │ │ │ │ +namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l │ │ │ │ FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_r_a_n_n_a_c_h_e_r_T_u_r_e_k () │ │ │ │ -  Create a pre-basis factory that can create a Rannacher-Turek pre-basis. │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_e_l_e_m_e_n_t_s (const _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w< │ │ │ │ + HostGridView > &subDomainGridView) │ │ │ │ +  ADL findable access to element range for a _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w. │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_e_l_e_m_e_n_t_s (const _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w< │ │ │ │ + HostGridView > &subDomainGridView, Dune::PartitionSet< partitions > │ │ │ │ + partitionSet) │ │ │ │ +  ADL findable access to element range for a _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w. │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_i_n_t_e_r_s_e_c_t_i_o_n_s (const _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w< │ │ │ │ + HostGridView > &subDomainGridView, const Element &element) │ │ │ │ +  ADL findable access to intersection range for an element of a │ │ │ │ + _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _r_a_n_n_a_c_h_e_r_t_u_r_e_k_b_a_s_i_s_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _s_u_b_d_o_m_a_i_n_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00101.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,5 +1,11 @@ │ │ │ │ var a00101 = [ │ │ │ │ - ["Dune::Functions::RannacherTurekNode< GV >", "a02046.html", "a02046"], │ │ │ │ - ["Dune::Functions::RannacherTurekBasis", "a00312.html#ga39599d1e02b6e64c057e402fe1686532", null], │ │ │ │ - ["Dune::Functions::BasisFactory::rannacherTurek", "a00312.html#ga366449c1a41fc29ff55fed0c1485f60b", null] │ │ │ │ + ["Dune::Functions::Experimental::SubDomainIndexSet< HGV >::Codim< codim >", "a01466.html", "a01466"], │ │ │ │ + ["Dune::Functions::Experimental::SubDomainGridView< HGV >::Codim< codim >", "a01482.html", "a01482"], │ │ │ │ + ["Dune::Functions::Experimental::SubDomainGridView< HGV >::Codim< codim >::Partition< pit >", "a01486.html", "a01486"], │ │ │ │ + ["Dune::Functions::Experimental::SubDomain< HGV >::Codim< codim >", "a01494.html", "a01494"], │ │ │ │ + ["Dune::Functions::Experimental::SubDomainInterface< SubDomainA, SubDomainB >", "a01498.html", "a01498"], │ │ │ │ + ["Dune::Functions::Experimental::SubDomainSkeleton< SubDomain >", "a01502.html", "a01502"], │ │ │ │ + ["Dune::Functions::Experimental::elements", "a00314.html#ga37f1ba65a546014639ebd40cf4684f6e", null], │ │ │ │ + ["Dune::Functions::Experimental::elements", "a00314.html#gaf4cd7cbb2c4a7d410769c3c50c8adb21", null], │ │ │ │ + ["Dune::Functions::Experimental::intersections", "a00314.html#gafa4d95e964b201085853ca60963de460", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00101_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: rannacherturekbasis.hh Source File │ │ │ +Dune-Functions: subdomain.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,277 +88,806 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
rannacherturekbasis.hh
│ │ │ +
subdomain.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_COMMON_SUBDOMAIN_HH
│ │ │ +
8#define DUNE_FUNCTIONS_COMMON_SUBDOMAIN_HH
│ │ │
9
│ │ │ -
10#include <dune/common/exceptions.hh>
│ │ │ -
11
│ │ │ -
12#include <dune/grid/common/capabilities.hh>
│ │ │ -
13
│ │ │ -
14#include <dune/localfunctions/common/localfiniteelementvariant.hh>
│ │ │ -
15#include <dune/localfunctions/rannacherturek.hh>
│ │ │ -
16#include <dune/localfunctions/crouzeixraviart.hh>
│ │ │ -
17
│ │ │ - │ │ │ - │ │ │ - │ │ │ +
10#include <array>
│ │ │ +
11#include <cstddef>
│ │ │ +
12#include <limits>
│ │ │ +
13#include <type_traits>
│ │ │ +
14#include <utility>
│ │ │ +
15#include <vector>
│ │ │ +
16
│ │ │ +
17#include <dune/common/exceptions.hh>
│ │ │ +
18#include <dune/common/iteratorfacades.hh>
│ │ │ +
19#include <dune/common/iteratorrange.hh>
│ │ │ +
20#include <dune/common/rangeutilities.hh>
│ │ │
21
│ │ │ -
22
│ │ │ -
23namespace Dune {
│ │ │ -
24namespace Functions {
│ │ │ -
25
│ │ │ -
26// *****************************************************************************
│ │ │ -
27// This is the reusable part of the basis. It contains
│ │ │ -
28//
│ │ │ -
29// RannacherTurekPreBasis
│ │ │ -
30// RannacherTurekNode
│ │ │ -
31//
│ │ │ -
32// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ -
33// state. These components do _not_ depend on the global basis and local view
│ │ │ -
34// and can be used without a global basis.
│ │ │ -
35// *****************************************************************************
│ │ │ +
22#include <dune/geometry/type.hh>
│ │ │ +
23#include <dune/geometry/typeindex.hh>
│ │ │ +
24
│ │ │ +
25#include <dune/grid/common/mcmgmapper.hh>
│ │ │ +
26#include <dune/grid/common/partitionset.hh>
│ │ │ +
27
│ │ │ +
│ │ │ + │ │ │ +
29
│ │ │ +
30 namespace Impl {
│ │ │ +
31
│ │ │ +
32 template<class GridView>
│ │ │ +
33 using GlobalIntersectionIteratorTraits = Dune::DefaultIteratorTraits<
│ │ │ +
34 std::forward_iterator_tag,
│ │ │ +
35 decltype(*std::declval<typename GridView::IntersectionIterator>())>;
│ │ │
36
│ │ │ -
37template<typename GV>
│ │ │ - │ │ │ -
39
│ │ │ -
40template<typename GV>
│ │ │ - │ │ │ -
42
│ │ │ -
55template<typename GV>
│ │ │ -
│ │ │ - │ │ │ -
57 public LeafPreBasisMixin< RannacherTurekPreBasis<GV> >
│ │ │ -
58{
│ │ │ -
59 static const int dim = GV::dimension;
│ │ │ -
60
│ │ │ -
61public:
│ │ │ -
62
│ │ │ -
64 using GridView = GV;
│ │ │ -
65
│ │ │ -
67 using size_type = std::size_t;
│ │ │ -
68
│ │ │ - │ │ │ -
71
│ │ │ -
│ │ │ - │ │ │ -
74 gridView_(gv)
│ │ │ -
75 {
│ │ │ -
76 for(auto type : gv.indexSet().types(0))
│ │ │ -
77 if (!type.isSimplex() && !type.isCube())
│ │ │ -
78 DUNE_THROW(Dune::NotImplemented, "Rannacher-Turek or Crouzeix-Raviart elements are only implemented for grids with simplex or cube elements.");
│ │ │ -
79 }
│ │ │ -
│ │ │ -
80
│ │ │ -
│ │ │ - │ │ │ -
83 {}
│ │ │ -
│ │ │ -
84
│ │ │ -
│ │ │ -
86 const GridView& gridView() const
│ │ │ -
87 {
│ │ │ -
88 return gridView_;
│ │ │ -
89 }
│ │ │ -
│ │ │ -
90
│ │ │ -
│ │ │ -
92 void update (const GridView& gv)
│ │ │ -
93 {
│ │ │ -
94 gridView_ = gv;
│ │ │ -
95 }
│ │ │ -
│ │ │ -
96
│ │ │ -
│ │ │ - │ │ │ -
101 {
│ │ │ -
102 return Node{};
│ │ │ -
103 }
│ │ │ -
│ │ │ -
104
│ │ │ -
│ │ │ - │ │ │ -
107 {
│ │ │ -
108 return (size_type)(gridView_.size(1));
│ │ │ -
109 }
│ │ │ -
│ │ │ -
110
│ │ │ -
│ │ │ - │ │ │ -
113 {
│ │ │ -
114 return 2*GV::dimension;
│ │ │ -
115 }
│ │ │ -
│ │ │ -
116
│ │ │ -
117 template<typename It>
│ │ │ -
│ │ │ -
118 It indices(const Node& node, It it) const
│ │ │ -
119 {
│ │ │ -
120 for (size_type i = 0, end = node.size() ; i < end ; ++i, ++it)
│ │ │ -
121 {
│ │ │ -
122 Dune::LocalKey localKey = node.finiteElement().localCoefficients().localKey(i);
│ │ │ -
123 const auto& gridIndexSet = gridView().indexSet();
│ │ │ -
124 const auto& element = node.element();
│ │ │ -
125
│ │ │ -
126 *it = {{ (size_type)(gridIndexSet.subIndex(element,localKey.subEntity(),1)) }};
│ │ │ -
127 }
│ │ │ -
128 return it;
│ │ │ -
129 }
│ │ │ -
│ │ │ -
130
│ │ │ -
131protected:
│ │ │ - │ │ │ -
133};
│ │ │ -
│ │ │ -
134
│ │ │ -
135
│ │ │ -
136
│ │ │ -
137template<typename GV>
│ │ │ -
│ │ │ - │ │ │ -
139 public LeafBasisNode
│ │ │ -
140{
│ │ │ -
141 static const int dim = GV::dimension;
│ │ │ -
142 static const int maxSize = 2*dim;
│ │ │ -
143
│ │ │ -
144 constexpr static bool hasFixedElementType = Capabilities::hasSingleGeometryType<typename GV::Grid>::v;
│ │ │ -
145
│ │ │ -
146 using CubeFiniteElement = RannacherTurekLocalFiniteElement<typename GV::ctype,double,dim>;
│ │ │ -
147 using SimplexFiniteElement = CrouzeixRaviartLocalFiniteElement<typename GV::ctype,double,dim>;
│ │ │ -
148
│ │ │ -
149 constexpr static unsigned int topologyId = Capabilities::hasSingleGeometryType<typename GV::Grid>::topologyId; // meaningless if hasFixedElementType is false
│ │ │ -
150 constexpr static GeometryType type = GeometryType(topologyId, GV::dimension);
│ │ │ -
151
│ │ │ -
152public:
│ │ │ -
153
│ │ │ -
154 using size_type = std::size_t;
│ │ │ -
155 using Element = typename GV::template Codim<0>::Entity;
│ │ │ -
156 using FiniteElement = std::conditional_t<hasFixedElementType,
│ │ │ -
157 std::conditional_t<type.isCube(),CubeFiniteElement,SimplexFiniteElement>,
│ │ │ -
158 LocalFiniteElementVariant<CubeFiniteElement, SimplexFiniteElement> >;
│ │ │ -
159
│ │ │ -
│ │ │ - │ │ │ - │ │ │ -
162 element_(nullptr)
│ │ │ -
163 {}
│ │ │ -
│ │ │ -
164
│ │ │ -
│ │ │ -
166 const Element& element() const
│ │ │ -
167 {
│ │ │ -
168 return *element_;
│ │ │ -
169 }
│ │ │ -
│ │ │ -
170
│ │ │ -
│ │ │ - │ │ │ -
176 {
│ │ │ -
177 return finiteElement_;
│ │ │ -
178 }
│ │ │ -
│ │ │ -
179
│ │ │ -
│ │ │ -
181 void bind(const Element& e)
│ │ │ -
182 {
│ │ │ -
183 element_ = &e;
│ │ │ -
184 if constexpr (!hasFixedElementType)
│ │ │ -
185 finiteElement_ = e.type().isCube() ? static_cast<FiniteElement>(CubeFiniteElement())
│ │ │ -
186 : static_cast<FiniteElement>(SimplexFiniteElement()) ;
│ │ │ -
187 this->setSize(finiteElement_.size());
│ │ │ -
188 }
│ │ │ -
│ │ │ -
189
│ │ │ -
190protected:
│ │ │ -
191
│ │ │ - │ │ │ - │ │ │ -
194};
│ │ │ -
│ │ │ -
195
│ │ │ -
196
│ │ │ -
197
│ │ │ -
198namespace BasisFactory {
│ │ │ -
199
│ │ │ -
205template<class Dummy=void>
│ │ │ +
37
│ │ │ +
38 template<class GV, class ContainsCallback>
│ │ │ +
39 class GlobalIntersectionIt
│ │ │ +
40 : public Dune::IteratorFacadeForTraits<GlobalIntersectionIt<GV, ContainsCallback>, GlobalIntersectionIteratorTraits<GV>>
│ │ │ +
41 {
│ │ │ +
42 using Facade = Dune::IteratorFacadeForTraits<GlobalIntersectionIt<GV, ContainsCallback>, GlobalIntersectionIteratorTraits<GV>>;
│ │ │ +
43
│ │ │ +
44 public:
│ │ │ +
45
│ │ │ +
46 using GridView = GV;
│ │ │ +
47 using Element = typename GridView::template Codim<0>::Entity;
│ │ │ +
48 using ElementIterator = typename GridView::template Codim<0>::Iterator;
│ │ │ +
49 using IntersectionIterator = typename GridView::IntersectionIterator;
│ │ │ +
50
│ │ │ +
51 class SentinelIterator
│ │ │ +
52 {};
│ │ │ +
53
│ │ │ +
54 GlobalIntersectionIt(const GridView& gridView, const ContainsCallback& contains, ElementIterator elementIt, ElementIterator elementEnd)
│ │ │ +
55 : gridView_(gridView)
│ │ │ +
56 , contains_(contains)
│ │ │ +
57 , elementIt_(std::move(elementIt))
│ │ │ +
58 , elementEnd_(std::move(elementEnd))
│ │ │ +
59 {
│ │ │ +
60 if (elementIt_ != elementEnd_)
│ │ │ +
61 {
│ │ │ +
62 element_ = *elementIt_;
│ │ │ +
63 iIt_ = gridView_.ibegin(element_);
│ │ │ +
64 iEnd_ = gridView_.iend(element_);
│ │ │ +
65 if (not contains_(*iIt_))
│ │ │ +
66 ++(*this);
│ │ │ +
67 }
│ │ │ +
68 }
│ │ │ +
69
│ │ │ +
70 using reference = typename Facade::reference;
│ │ │ +
71
│ │ │ +
72 reference operator*() const
│ │ │ +
73 {
│ │ │ +
74 return *iIt_;
│ │ │ +
75 }
│ │ │ +
76
│ │ │ +
77 GlobalIntersectionIt& operator++()
│ │ │ +
78 {
│ │ │ +
79 while(true)
│ │ │ +
80 {
│ │ │ +
81 ++iIt_;
│ │ │ +
82 if (iIt_ == iEnd_)
│ │ │ +
83 {
│ │ │ +
84 ++elementIt_;
│ │ │ +
85 if (elementIt_ == elementEnd_)
│ │ │ +
86 return *this;
│ │ │ +
87 element_ = *elementIt_;
│ │ │ +
88 iIt_ = gridView_.ibegin(element_);
│ │ │ +
89 iIt_ = gridView_.ibegin(element_);
│ │ │ +
90 iEnd_ = gridView_.iend(element_);
│ │ │ +
91 }
│ │ │ +
92 if (contains_(*iIt_))
│ │ │ +
93 return *this;
│ │ │ +
94 }
│ │ │ +
95 return *this;
│ │ │ +
96 }
│ │ │ +
97
│ │ │ +
98 friend bool operator==(const GlobalIntersectionIt& it1, const GlobalIntersectionIt& it2)
│ │ │ +
99 {
│ │ │ +
100 if (it1.elementIt_ != it2.elementIt_)
│ │ │ +
101 return false;
│ │ │ +
102 if (it1.elementIt_ == it1.elementEnd_)
│ │ │ +
103 return true;
│ │ │ +
104 return (it1.iIt_ == it2.iIt_);
│ │ │ +
105 }
│ │ │ +
106
│ │ │ +
107 friend bool operator==(const GlobalIntersectionIt& it1, const SentinelIterator& it2)
│ │ │ +
108 {
│ │ │ +
109 return it1.elementIt_ == it1.elementEnd_;
│ │ │ +
110 }
│ │ │ +
111
│ │ │ +
112 private:
│ │ │ +
113 GridView gridView_;
│ │ │ +
114 ContainsCallback contains_;
│ │ │ +
115 ElementIterator elementIt_;
│ │ │ +
116 ElementIterator elementEnd_;
│ │ │ +
117 Element element_;
│ │ │ +
118 IntersectionIterator iIt_;
│ │ │ +
119 IntersectionIterator iEnd_;
│ │ │ +
120 };
│ │ │ +
121
│ │ │ +
122 }
│ │ │ +
123
│ │ │ +
124
│ │ │ +
125
│ │ │ +
146 template<class HGV>
│ │ │ +
│ │ │ + │ │ │ +
148 {
│ │ │ +
149 using HostGridView = HGV;
│ │ │ +
150
│ │ │ +
151 public:
│ │ │ +
152
│ │ │ +
153 using Grid = typename HostGridView::Grid;
│ │ │ +
154 using Types = std::vector<Dune::GeometryType>;
│ │ │ +
155 using IndexType = std::size_t;
│ │ │ +
156
│ │ │ +
158 template<int codim>
│ │ │ +
│ │ │ +
159 struct Codim
│ │ │ +
160 {
│ │ │ +
161 using Entity = typename Grid::template Codim<codim>::Entity;
│ │ │ +
162 using EntitySeed = typename Grid::template Codim<codim>::EntitySeed;
│ │ │ +
163 using Geometry = typename Grid::template Codim<codim>::Geometry;
│ │ │ +
164 using LocalGeometry = typename Grid::template Codim<codim>::LocalGeometry;
│ │ │ +
165 };
│ │ │ +
│ │ │ +
166
│ │ │ +
167 enum {dimension = Grid::dimension};
│ │ │ +
168
│ │ │ +
169 private:
│ │ │ +
170
│ │ │ +
171 using AllEntityMapper = Dune::MultipleCodimMultipleGeomTypeMapper<HostGridView>;
│ │ │ +
172
│ │ │ +
173 static auto allCodimLayout()
│ │ │ +
174 {
│ │ │ +
175 return [](Dune::GeometryType, int) { return true; };
│ │ │ +
176 }
│ │ │ +
177
│ │ │ +
178 static constexpr auto typeIndexSize = Dune::GlobalGeometryTypeIndex::size(dimension);
│ │ │ +
179 static constexpr auto unusesIndex = std::numeric_limits<IndexType>::max();
│ │ │ +
180
│ │ │ +
181 public:
│ │ │ +
182
│ │ │ +
│ │ │ +
184 SubDomainIndexSet(const HostGridView& hostGridView)
│ │ │ + │ │ │ +
186 , allEntityMapper_(hostGridView_, allCodimLayout())
│ │ │ +
187 {
│ │ │ +
188 clear();
│ │ │ +
189 }
│ │ │ +
│ │ │ +
190
│ │ │ +
191 // *********************************
│ │ │ +
192 // IndexSet interface methods
│ │ │ +
193 // *********************************
│ │ │ +
194
│ │ │ +
│ │ │ +
195 IndexType size(Dune::GeometryType gt) const
│ │ │ +
196 {
│ │ │ +
197 return sizePerGT_[Dune::GlobalGeometryTypeIndex::index(gt)];
│ │ │ +
198 }
│ │ │ +
│ │ │ +
199
│ │ │ +
│ │ │ +
200 IndexType size(int codim) const
│ │ │ +
201 {
│ │ │ +
202 return sizePerCodim_[codim];
│ │ │ +
203 }
│ │ │ +
│ │ │ +
204
│ │ │ +
205 template<class Entity>
│ │ │
│ │ │ - │ │ │ -
207{
│ │ │ -
208 return [](const auto& gridView) {
│ │ │ -
209 return RannacherTurekPreBasis<std::decay_t<decltype(gridView)>>(gridView);
│ │ │ -
210 };
│ │ │ -
211}
│ │ │ -
│ │ │ -
212
│ │ │ -
213} // end namespace BasisFactory
│ │ │ -
214
│ │ │ -
215
│ │ │ -
216
│ │ │ -
217
│ │ │ -
229template<typename GV>
│ │ │ - │ │ │ -
231
│ │ │ -
232} // end namespace Functions
│ │ │ -
233} // end namespace Dune
│ │ │ +
206 IndexType index(const Entity& entity) const
│ │ │ +
207 {
│ │ │ +
208 auto index = indices_[allEntityMapper_.index(entity)];
│ │ │ +
209 if (index==unusesIndex)
│ │ │ +
210 DUNE_THROW(Dune::InvalidStateException, "Accessing nonexisting entry using SubDomainIndexSet::index()!");
│ │ │ +
211 return index;
│ │ │ +
212 }
│ │ │ +
│ │ │ +
213
│ │ │ +
214 template<int cc>
│ │ │ +
│ │ │ +
215 IndexType index(const typename Codim<cc>::Entity& entity) const
│ │ │ +
216 {
│ │ │ +
217 return index<typename Codim<cc>::Entity>(entity);
│ │ │ +
218 }
│ │ │ +
│ │ │ +
219
│ │ │ +
220 template<class Entity>
│ │ │ +
│ │ │ +
221 IndexType subIndex(const Entity& entity, int subEntity, unsigned int codim) const
│ │ │ +
222 {
│ │ │ +
223 auto index = indices_[allEntityMapper_.subIndex(entity, subEntity, codim)];
│ │ │ +
224 if (index==unusesIndex)
│ │ │ +
225 DUNE_THROW(Dune::InvalidStateException, "Accessing nonexisting entry using SubDomainIndexSet::subIndex()!");
│ │ │ +
226 return index;
│ │ │ +
227 }
│ │ │ +
│ │ │ +
228
│ │ │ +
229 template<int cc>
│ │ │ +
│ │ │ +
230 IndexType subIndex(const typename Codim<cc>::Entity& entity, int subEntity, unsigned int codim) const
│ │ │ +
231 {
│ │ │ +
232 return subIndex<typename Codim<cc>::Entity>(entity, subEntity, codim);
│ │ │ +
233 }
│ │ │ +
│ │ │
234
│ │ │ -
235#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
auto rannacherTurek()
Create a pre-basis factory that can create a Rannacher-Turek pre-basis.
Definition rannacherturekbasis.hh:206
│ │ │ -
DefaultGlobalBasis< RannacherTurekPreBasis< GV > > RannacherTurekBasis
Rannacher-Turek basis.
Definition rannacherturekbasis.hh:230
│ │ │ -
Definition monomialset.hh:19
│ │ │ -
Definition monomialset.hh:19
│ │ │ -
Definition argyrisbasis.hh:926
│ │ │ -
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:53
│ │ │ -
A generic MixIn class for PreBasis.
Definition leafprebasismixin.hh:36
│ │ │ -
size_type size() const
Obtain the number of basis function in the local node.
Definition nodes.hh:162
│ │ │ -
void setSize(const size_type size)
Definition nodes.hh:197
│ │ │ -
Definition nodes.hh:218
│ │ │ -
Definition rannacherturekbasis.hh:140
│ │ │ -
void bind(const Element &e)
Bind to element.
Definition rannacherturekbasis.hh:181
│ │ │ -
std::conditional_t< hasFixedElementType, std::conditional_t< type.isCube(), CubeFiniteElement, SimplexFiniteElement >, LocalFiniteElementVariant< CubeFiniteElement, SimplexFiniteElement > > FiniteElement
Definition rannacherturekbasis.hh:156
│ │ │ -
FiniteElement finiteElement_
Definition rannacherturekbasis.hh:192
│ │ │ -
std::size_t size_type
Definition rannacherturekbasis.hh:154
│ │ │ -
typename GV::template Codim< 0 >::Entity Element
Definition rannacherturekbasis.hh:155
│ │ │ -
RannacherTurekNode()
Definition rannacherturekbasis.hh:160
│ │ │ -
const Element * element_
Definition rannacherturekbasis.hh:193
│ │ │ -
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition rannacherturekbasis.hh:175
│ │ │ -
const Element & element() const
Return current element, throw if unbound.
Definition rannacherturekbasis.hh:166
│ │ │ -
Pre-basis for a Rannacher-Turek basis.
Definition rannacherturekbasis.hh:58
│ │ │ -
void initializeIndices()
Initialize the global indices.
Definition rannacherturekbasis.hh:82
│ │ │ -
std::size_t size_type
Type used for indices and size information.
Definition rannacherturekbasis.hh:67
│ │ │ -
Node makeNode() const
Create tree node.
Definition rannacherturekbasis.hh:100
│ │ │ -
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition rannacherturekbasis.hh:92
│ │ │ -
It indices(const Node &node, It it) const
Definition rannacherturekbasis.hh:118
│ │ │ -
GV GridView
The grid view that the FE basis is defined on.
Definition rannacherturekbasis.hh:64
│ │ │ -
size_type dimension() const
Same as size(prefix) with empty prefix.
Definition rannacherturekbasis.hh:106
│ │ │ -
RannacherTurekPreBasis(const GridView &gv)
Constructor for a given grid view object.
Definition rannacherturekbasis.hh:73
│ │ │ -
RannacherTurekNode< GV > Node
Template mapping root tree path to type of created tree node.
Definition rannacherturekbasis.hh:70
│ │ │ -
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition rannacherturekbasis.hh:86
│ │ │ -
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition rannacherturekbasis.hh:112
│ │ │ -
GridView gridView_
Definition rannacherturekbasis.hh:132
│ │ │ +
235 template<class Entity >
│ │ │ +
│ │ │ +
236 bool contains(const Entity& entity) const
│ │ │ +
237 {
│ │ │ +
238 return (indices_[allEntityMapper_.index(entity)] != unusesIndex);
│ │ │ +
239 }
│ │ │ +
│ │ │ +
240
│ │ │ +
│ │ │ +
241 Types types(int codim) const
│ │ │ +
242 {
│ │ │ +
243 return typesPerCodim_[codim];
│ │ │ +
244 }
│ │ │ +
│ │ │ +
245
│ │ │ +
246 // *********************************
│ │ │ +
247 // Extended methods
│ │ │ +
248 // *********************************
│ │ │ +
249
│ │ │ +
│ │ │ +
251 const HostGridView& hostGridView() const
│ │ │ +
252 {
│ │ │ +
253 return hostGridView_;
│ │ │ +
254 }
│ │ │ +
│ │ │ +
255
│ │ │ +
│ │ │ +
257 void insertElement(const typename Codim<0>::Entity& element)
│ │ │ +
258 {
│ │ │ +
259 const auto& re = referenceElement(element);
│ │ │ +
260 for (auto codim : Dune::range(0, dimension+1))
│ │ │ +
261 {
│ │ │ +
262 for (auto subEntity : Dune::range(re.size(codim)))
│ │ │ +
263 {
│ │ │ +
264 auto& index = indices_[allEntityMapper_.subIndex(element, subEntity, codim)];
│ │ │ +
265 if (index==unusesIndex)
│ │ │ +
266 {
│ │ │ +
267 const auto& type = re.type(subEntity, codim);
│ │ │ +
268 const auto typeIndex = Dune::GlobalGeometryTypeIndex::index(type);
│ │ │ +
269 index = sizePerGT_[typeIndex];
│ │ │ +
270 if (sizePerGT_[typeIndex]==0)
│ │ │ +
271 typesPerCodim_[codim].push_back(type);
│ │ │ +
272 sizePerGT_[typeIndex]++;
│ │ │ +
273 sizePerCodim_[codim]++;
│ │ │ +
274 }
│ │ │ +
275 }
│ │ │ +
276 }
│ │ │ +
277 }
│ │ │ +
│ │ │ +
278
│ │ │ +
279 protected:
│ │ │ +
280
│ │ │ +
281 // Clear all data
│ │ │ +
│ │ │ +
282 void clear()
│ │ │ +
283 {
│ │ │ +
284 for(auto& size : sizePerGT_)
│ │ │ +
285 size = 0;
│ │ │ +
286 for(auto& size : sizePerCodim_)
│ │ │ +
287 size = 0;
│ │ │ +
288 for(auto& types : typesPerCodim_)
│ │ │ +
289 types.clear();
│ │ │ +
290 indices_.clear();
│ │ │ +
291 indices_.resize(allEntityMapper_.size(), unusesIndex);
│ │ │ +
292 }
│ │ │ +
│ │ │ +
293
│ │ │ +
294 HostGridView hostGridView_;
│ │ │ +
295
│ │ │ +
296 // Global size information
│ │ │ +
297 std::array<std::size_t, typeIndexSize> sizePerGT_;
│ │ │ +
298 std::array<std::size_t, dimension+1> sizePerCodim_;
│ │ │ +
299 std::array<Types, dimension+1> typesPerCodim_;
│ │ │ +
300
│ │ │ +
301 AllEntityMapper allEntityMapper_;
│ │ │ +
302
│ │ │ +
303 // Index map
│ │ │ +
304 std::vector<IndexType> indices_;
│ │ │ +
305 };
│ │ │ +
│ │ │ +
306
│ │ │ +
307
│ │ │ +
308
│ │ │ +
321 template<class HGV>
│ │ │ +
│ │ │ + │ │ │ +
323 {
│ │ │ +
324
│ │ │ +
325 template<int codim>
│ │ │ +
326 class NonImplementedIterator
│ │ │ +
327 {
│ │ │ +
328 public:
│ │ │ +
329 NonImplementedIterator()
│ │ │ +
330 {
│ │ │ +
331 static_assert(codim==0, "SubDomainGridView::Codim::Iterator<codim> is only implemented for codim=0");
│ │ │ +
332 }
│ │ │ +
333 };
│ │ │ +
334
│ │ │ +
335 template<PartitionIteratorType pit>
│ │ │ +
336 class ElementIterator
│ │ │ +
337 {
│ │ │ +
338 using Element = typename HGV::template Codim<0>::Entity;
│ │ │ +
339 public:
│ │ │ +
340
│ │ │ +
341 using HostElementIterator = typename HGV::template Codim<0>::template Partition<pit>::Iterator;
│ │ │ +
342
│ │ │ +
343 ElementIterator(const SubDomainIndexSet<HGV>& indexSet, HostElementIterator&& it, HostElementIterator&& endIt)
│ │ │ + │ │ │ +
345 , hostIt_(std::move(it))
│ │ │ +
346 , hostEndIt_(std::move(endIt))
│ │ │ +
347 {
│ │ │ +
348 while ((hostIt_!= hostEndIt_) and (not indexSet_->contains(*hostIt_)))
│ │ │ +
349 ++hostIt_;
│ │ │ +
350 }
│ │ │ +
351
│ │ │ +
352 ElementIterator& operator++()
│ │ │ +
353 {
│ │ │ +
354 ++hostIt_;
│ │ │ +
355 while ((hostIt_!= hostEndIt_) and (not indexSet_->contains(*hostIt_)))
│ │ │ +
356 ++hostIt_;
│ │ │ +
357 return *this;
│ │ │ +
358 }
│ │ │ +
359
│ │ │ +
360 const Element& operator*() const
│ │ │ +
361 {
│ │ │ +
362 return *hostIt_;
│ │ │ +
363 }
│ │ │ +
364
│ │ │ +
365 friend bool operator==(const ElementIterator& a, const ElementIterator& b)
│ │ │ +
366 {
│ │ │ +
367 return a.hostIt_==b.hostIt_;
│ │ │ +
368 }
│ │ │ +
369
│ │ │ +
370 private:
│ │ │ +
371 HostElementIterator hostIt_;
│ │ │ +
372 HostElementIterator hostEndIt_;
│ │ │ + │ │ │ +
374 };
│ │ │ +
375
│ │ │ +
376 public:
│ │ │ +
377
│ │ │ +
378 using HostGridView = HGV;
│ │ │ +
379
│ │ │ +
380 using Grid = typename HostGridView::Grid;
│ │ │ +
381 using ctype = typename Grid::ctype;
│ │ │ + │ │ │ +
383 using Intersection = typename HostGridView::Intersection;
│ │ │ +
384 using IntersectionIterator = typename HostGridView::IntersectionIterator;
│ │ │ +
385
│ │ │ +
387 template<int codim>
│ │ │ +
│ │ │ +
388 struct Codim
│ │ │ +
389 {
│ │ │ +
390 using Entity = typename Grid::template Codim<codim>::Entity;
│ │ │ +
391 using EntitySeed = typename Grid::template Codim<codim>::EntitySeed;
│ │ │ +
392 using Geometry = typename Grid::template Codim<codim>::Geometry;
│ │ │ +
393 using LocalGeometry = typename Grid::template Codim<codim>::LocalGeometry;
│ │ │ +
394 using Iterator = std::conditional_t<codim==0, ElementIterator<All_Partition>, NonImplementedIterator<codim>>;
│ │ │ +
395
│ │ │ +
396 template<PartitionIteratorType pit>
│ │ │ +
│ │ │ + │ │ │ +
398 {
│ │ │ +
399 using Iterator = std::conditional_t<codim==0, ElementIterator<pit>, NonImplementedIterator<codim>>;
│ │ │ +
400 };
│ │ │ +
│ │ │ +
401 };
│ │ │ +
│ │ │ +
402
│ │ │ +
403 enum {dimension = Grid::dimension};
│ │ │ +
404 enum {dimensionworld = Grid::dimensionworld};
│ │ │ +
405
│ │ │ +
│ │ │ + │ │ │ + │ │ │ +
408 {}
│ │ │ +
│ │ │ +
409
│ │ │ +
410 SubDomainGridView(const SubDomainGridView& other) = default;
│ │ │ +
411
│ │ │ +
│ │ │ +
412 const Grid& grid() const
│ │ │ +
413 {
│ │ │ +
414 return indexSet_->hostGridView().grid();
│ │ │ +
415 }
│ │ │ +
│ │ │ +
416
│ │ │ +
│ │ │ +
417 const IndexSet& indexSet() const
│ │ │ +
418 {
│ │ │ +
419 return *indexSet_;
│ │ │ +
420 }
│ │ │ +
│ │ │ +
421
│ │ │ +
│ │ │ +
422 int size(int codim) const
│ │ │ +
423 {
│ │ │ +
424 return indexSet_->size(codim);
│ │ │ +
425 }
│ │ │ +
│ │ │ +
426
│ │ │ +
│ │ │ +
427 int size(Dune::GeometryType gt) const
│ │ │ +
428 {
│ │ │ +
429 return indexSet_->size(gt);
│ │ │ +
430 }
│ │ │ +
│ │ │ +
431
│ │ │ +
432 template<class Entity>
│ │ │ +
│ │ │ +
433 bool contains(const Entity& entity) const
│ │ │ +
434 {
│ │ │ +
435 return indexSet_->contains(entity);
│ │ │ +
436 }
│ │ │ +
│ │ │ +
437
│ │ │ +
439 template<int codim, PartitionIteratorType pit = All_Partition>
│ │ │ +
│ │ │ +
440 typename Codim<codim>::template Partition<pit>::Iterator begin() const
│ │ │ +
441 {
│ │ │ +
442 static_assert(codim==0, "SubDomainGridView::begin<codim> is only implemented for codim=0");
│ │ │ +
443 return {indexSet(), hostGridView().template begin<codim, pit>(), hostGridView().template end<codim, pit>()};
│ │ │ +
444 }
│ │ │ +
│ │ │ +
445
│ │ │ +
447 template<int codim, PartitionIteratorType pit = All_Partition>
│ │ │ +
│ │ │ +
448 typename Codim<codim>::template Partition<pit>::Iterator end() const
│ │ │ +
449 {
│ │ │ +
450 static_assert(codim==0, "SubDomainGridView::end<codim> is only implemented for codim=0");
│ │ │ +
451 return {indexSet(), hostGridView().template end<codim, pit>(), hostGridView().template end<codim, pit>()};
│ │ │ +
452 }
│ │ │ +
│ │ │ +
453
│ │ │ +
│ │ │ +
454 decltype(auto) comm() const
│ │ │ +
455 {
│ │ │ +
456 return hostGridView().comm();
│ │ │ +
457 }
│ │ │ +
│ │ │ +
458
│ │ │ +
│ │ │ +
459 decltype(auto) ibegin(const typename Codim<0>::Entity& element) const
│ │ │ +
460 {
│ │ │ +
461 return hostGridView().ibegin(element);
│ │ │ +
462 }
│ │ │ +
│ │ │ +
463
│ │ │ +
│ │ │ +
464 decltype(auto) iend(const typename Codim<0>::Entity& element) const
│ │ │ +
465 {
│ │ │ +
466 return hostGridView().iend(element);
│ │ │ +
467 }
│ │ │ +
│ │ │ +
468
│ │ │ +
│ │ │ + │ │ │ +
471 {
│ │ │ +
472 return indexSet_->hostGridView();
│ │ │ +
473 }
│ │ │ +
│ │ │ +
474
│ │ │ +
475 protected:
│ │ │ + │ │ │ +
477 };
│ │ │ +
│ │ │ +
478
│ │ │ +
479
│ │ │ +
480
│ │ │ +
486 template<class HostGridView>
│ │ │ +
│ │ │ +
487 auto elements(const SubDomainGridView<HostGridView>& subDomainGridView)
│ │ │ +
488 {
│ │ │ +
489 return Dune::IteratorRange(subDomainGridView.template begin<0>(), subDomainGridView.template end<0>());
│ │ │ +
490 }
│ │ │ +
│ │ │ +
491
│ │ │ +
497 template<class HostGridView, unsigned int partitions>
│ │ │ +
│ │ │ +
498 auto elements(const SubDomainGridView<HostGridView>& subDomainGridView, Dune::PartitionSet<partitions> partitionSet)
│ │ │ +
499 {
│ │ │ +
500 constexpr auto pit = partitionSet.partitionIterator();
│ │ │ +
501 return Dune::IteratorRange(subDomainGridView.template begin<0, pit>(), subDomainGridView.template end<0, pit>());
│ │ │ +
502 }
│ │ │ +
│ │ │ +
503
│ │ │ +
509 template<class HostGridView, class Element>
│ │ │ +
│ │ │ +
510 auto intersections(const SubDomainGridView<HostGridView>& subDomainGridView, const Element& element)
│ │ │ +
511 {
│ │ │ +
512 return Dune::IteratorRange(subDomainGridView.ibegin(element), subDomainGridView.iend(element));
│ │ │ +
513 }
│ │ │ +
│ │ │ +
514
│ │ │ +
515
│ │ │ +
516
│ │ │ +
532 template<class HGV>
│ │ │ +
│ │ │ + │ │ │ +
534 {
│ │ │ +
535 public:
│ │ │ +
536
│ │ │ +
537 using HostGridView = HGV;
│ │ │ +
538 using Grid = typename HostGridView::Grid;
│ │ │ + │ │ │ + │ │ │ +
541
│ │ │ +
543 template<int codim>
│ │ │ +
│ │ │ +
544 struct Codim
│ │ │ +
545 {
│ │ │ +
546 using Entity = typename Grid::template Codim<codim>::Entity;
│ │ │ +
547 using EntitySeed = typename Grid::template Codim<codim>::EntitySeed;
│ │ │ +
548 using Geometry = typename Grid::template Codim<codim>::Geometry;
│ │ │ +
549 using LocalGeometry = typename Grid::template Codim<codim>::LocalGeometry;
│ │ │ +
550 };
│ │ │ +
│ │ │ +
551
│ │ │ +
552 enum {dimension = Grid::dimension};
│ │ │ +
553
│ │ │ +
│ │ │ + │ │ │ +
556 : indexSet_(hostGridView)
│ │ │ +
557 {}
│ │ │ +
│ │ │ +
558
│ │ │ +
│ │ │ +
559 const IndexSet& indexSet() const
│ │ │ +
560 {
│ │ │ +
561 return indexSet_;
│ │ │ +
562 }
│ │ │ +
│ │ │ +
563
│ │ │ +
│ │ │ + │ │ │ +
566 {
│ │ │ +
567 return GridView(indexSet_);
│ │ │ +
568 }
│ │ │ +
│ │ │ +
569
│ │ │ +
│ │ │ + │ │ │ +
572 {
│ │ │ +
573 return indexSet_.hostGridView();
│ │ │ +
574 }
│ │ │ +
│ │ │ +
575
│ │ │ +
│ │ │ +
577 void insertElement(const typename Codim<0>::Entity& element)
│ │ │ +
578 {
│ │ │ +
579 indexSet_.insertElement(element);
│ │ │ +
580 }
│ │ │ +
│ │ │ +
581
│ │ │ +
│ │ │ +
583 bool contains(const typename Codim<0>::Entity& element) const
│ │ │ +
584 {
│ │ │ +
585 return indexSet_.contains(element);
│ │ │ +
586 }
│ │ │ +
│ │ │ +
587
│ │ │ +
588 private:
│ │ │ +
589 IndexSet indexSet_;
│ │ │ +
590 };
│ │ │ +
│ │ │ +
591
│ │ │ +
592
│ │ │ +
593
│ │ │ +
599 template<class SubDomainA, class SubDomainB>
│ │ │ +
│ │ │ + │ │ │ +
601 {
│ │ │ +
602 static_assert(
│ │ │ +
603 std::is_same_v<typename SubDomainA::GridView::Intersection, typename SubDomainB::GridView::Intersection>,
│ │ │ +
604 "SubDomainInterface requires that both SubDomain types have the same Intersection type");
│ │ │ +
605
│ │ │ +
606 public:
│ │ │ +
607
│ │ │ +
608 using Intersection = typename SubDomainA::GridView::Intersection;
│ │ │ +
609
│ │ │ +
│ │ │ +
617 SubDomainInterface(const SubDomainA& subDomainA, const SubDomainB& subDomainB)
│ │ │ +
618 : subDomainA_(subDomainA)
│ │ │ +
619 , subDomainB_(subDomainB)
│ │ │ +
620 {}
│ │ │ +
│ │ │ +
621
│ │ │ +
│ │ │ +
631 bool contains(const Intersection& is) const
│ │ │ +
632 {
│ │ │ +
633 if (is.boundary() or not(is.neighbor()))
│ │ │ +
634 return false;
│ │ │ +
635 return (subDomainA_.contains(is.inside()) && subDomainB_.contains(is.outside()))
│ │ │ +
636 || (subDomainA_.contains(is.outside()) && subDomainB_.contains(is.inside()));
│ │ │ +
637 }
│ │ │ +
│ │ │ +
638
│ │ │ +
│ │ │ +
647 bool isOriented(const Intersection& is) const
│ │ │ +
648 {
│ │ │ +
649 if (is.boundary() or not(is.neighbor()))
│ │ │ +
650 return false;
│ │ │ +
651 return (subDomainA_.contains(is.inside()) && subDomainB_.contains(is.outside()));
│ │ │ +
652 }
│ │ │ +
│ │ │ +
653
│ │ │ +
│ │ │ +
660 const auto begin() const
│ │ │ +
661 {
│ │ │ +
662 return Impl::GlobalIntersectionIt(subDomainA_.gridView(), [&](const auto& is) {
│ │ │ +
663 if (is.boundary() or not(is.neighbor()))
│ │ │ +
664 return false;
│ │ │ +
665 return subDomainB_.indexSet().contains(is.outside());
│ │ │ +
666 }, subDomainA_.gridView().template begin<0>(), subDomainA_.gridView().template end<0>());
│ │ │ +
667 }
│ │ │ +
│ │ │ +
668
│ │ │ +
│ │ │ +
670 const auto end() const
│ │ │ +
671 {
│ │ │ +
672 return typename decltype(begin())::SentinelIterator();
│ │ │ +
673 }
│ │ │ +
│ │ │ +
674
│ │ │ +
675 private:
│ │ │ +
676 const SubDomainA& subDomainA_;
│ │ │ +
677 const SubDomainB& subDomainB_;
│ │ │ +
678 };
│ │ │ +
│ │ │ +
679
│ │ │ +
680
│ │ │ +
681
│ │ │ +
687 template<class SubDomain>
│ │ │ +
│ │ │ + │ │ │ +
689 {
│ │ │ +
690 public:
│ │ │ +
691
│ │ │ + │ │ │ +
693
│ │ │ +
│ │ │ +
695 SubDomainSkeleton(const SubDomain& subDomain)
│ │ │ +
696 : subDomain_(subDomain)
│ │ │ +
697 {}
│ │ │ +
│ │ │ +
698
│ │ │ +
│ │ │ +
700 bool contains(const Intersection& is) const
│ │ │ +
701 {
│ │ │ +
702 if (is.boundary() or not(is.neighbor()))
│ │ │ +
703 return false;
│ │ │ +
704 return subDomain_.contains(is.inside()) and subDomain_.contains(is.outside());
│ │ │ +
705 }
│ │ │ +
│ │ │ +
706
│ │ │ +
707 private:
│ │ │ +
708 const SubDomain& subDomain_;
│ │ │ +
709 };
│ │ │ +
│ │ │ +
710
│ │ │ +
711
│ │ │ +
712
│ │ │ +
713} // namespace Dune::Functions::Experimental
│ │ │ +
│ │ │ +
714
│ │ │ +
715#endif// DUNE_FUNCTIONS_COMMON_SUBDOMAIN_HH
│ │ │ +
auto elements(const SubDomainGridView< HostGridView > &subDomainGridView)
ADL findable access to element range for a SubDomainGridView.
Definition subdomain.hh:487
│ │ │ +
auto intersections(const SubDomainGridView< HostGridView > &subDomainGridView, const Element &element)
ADL findable access to intersection range for an element of a SubDomainGridView.
Definition subdomain.hh:510
│ │ │ +
Definition subdomain.hh:28
│ │ │ +
An IndexSet for a sub-domain.
Definition subdomain.hh:148
│ │ │ +
SubDomainIndexSet(const HostGridView &hostGridView)
Construct SubDomainIndexSet for underlying host grid view.
Definition subdomain.hh:184
│ │ │ +
std::array< std::size_t, typeIndexSize > sizePerGT_
Definition subdomain.hh:297
│ │ │ +
std::vector< IndexType > indices_
Definition subdomain.hh:304
│ │ │ +
IndexType index(const typename Codim< cc >::Entity &entity) const
Definition subdomain.hh:215
│ │ │ + │ │ │ +
IndexType index(const Entity &entity) const
Definition subdomain.hh:206
│ │ │ +
IndexType size(int codim) const
Definition subdomain.hh:200
│ │ │ +
AllEntityMapper allEntityMapper_
Definition subdomain.hh:301
│ │ │ +
IndexType size(Dune::GeometryType gt) const
Definition subdomain.hh:195
│ │ │ +
void insertElement(const typename Codim< 0 >::Entity &element)
Insert element and all its sub-entities into SubDomainIndexSet.
Definition subdomain.hh:257
│ │ │ +
Types types(int codim) const
Definition subdomain.hh:241
│ │ │ +
std::vector< Dune::GeometryType > Types
Definition subdomain.hh:154
│ │ │ +
IndexType subIndex(const typename Codim< cc >::Entity &entity, int subEntity, unsigned int codim) const
Definition subdomain.hh:230
│ │ │ +
HostGridView hostGridView_
Definition subdomain.hh:294
│ │ │ +
std::array< std::size_t, dimension+1 > sizePerCodim_
Definition subdomain.hh:298
│ │ │ +
typename HostGridView::Grid Grid
Definition subdomain.hh:153
│ │ │ +
const HostGridView & hostGridView() const
Definition subdomain.hh:251
│ │ │ +
void clear()
Definition subdomain.hh:282
│ │ │ +
bool contains(const Entity &entity) const
Definition subdomain.hh:236
│ │ │ +
std::array< Types, dimension+1 > typesPerCodim_
Definition subdomain.hh:299
│ │ │ +
std::size_t IndexType
Definition subdomain.hh:155
│ │ │ +
IndexType subIndex(const Entity &entity, int subEntity, unsigned int codim) const
Definition subdomain.hh:221
│ │ │ +
Codim specific typedefs.
Definition subdomain.hh:160
│ │ │ +
typename Grid::template Codim< codim >::EntitySeed EntitySeed
Definition subdomain.hh:162
│ │ │ +
typename Grid::template Codim< codim >::Geometry Geometry
Definition subdomain.hh:163
│ │ │ +
typename Grid::template Codim< codim >::LocalGeometry LocalGeometry
Definition subdomain.hh:164
│ │ │ +
typename Grid::template Codim< codim >::Entity Entity
Definition subdomain.hh:161
│ │ │ +
A GridView for a sub-domain.
Definition subdomain.hh:323
│ │ │ + │ │ │ + │ │ │ +
typename HostGridView::Grid Grid
Definition subdomain.hh:380
│ │ │ +
Codim< codim >::template Partition< pit >::Iterator end() const
Create an iterator pointing to the end of the range.
Definition subdomain.hh:448
│ │ │ +
bool contains(const Entity &entity) const
Definition subdomain.hh:433
│ │ │ +
const IndexSet * indexSet_
Definition subdomain.hh:476
│ │ │ +
const IndexSet & indexSet() const
Definition subdomain.hh:417
│ │ │ +
SubDomainGridView(const SubDomainGridView &other)=default
│ │ │ +
const Grid & grid() const
Definition subdomain.hh:412
│ │ │ +
typename Grid::ctype ctype
Definition subdomain.hh:381
│ │ │ +
typename HostGridView::IntersectionIterator IntersectionIterator
Definition subdomain.hh:384
│ │ │ +
const HostGridView & hostGridView() const
Access underlying host grid view.
Definition subdomain.hh:470
│ │ │ +
SubDomainIndexSet< HostGridView > IndexSet
Definition subdomain.hh:382
│ │ │ +
typename HostGridView::Intersection Intersection
Definition subdomain.hh:383
│ │ │ +
decltype(auto) comm() const
Definition subdomain.hh:454
│ │ │ +
int size(int codim) const
Definition subdomain.hh:422
│ │ │ +
decltype(auto) ibegin(const typename Codim< 0 >::Entity &element) const
Definition subdomain.hh:459
│ │ │ +
int size(Dune::GeometryType gt) const
Definition subdomain.hh:427
│ │ │ +
decltype(auto) iend(const typename Codim< 0 >::Entity &element) const
Definition subdomain.hh:464
│ │ │ +
HGV HostGridView
Definition subdomain.hh:378
│ │ │ +
Codim< codim >::template Partition< pit >::Iterator begin() const
Create an iterator pointing to the begin of the range.
Definition subdomain.hh:440
│ │ │ +
SubDomainGridView(const IndexSet &indexSet)
Definition subdomain.hh:406
│ │ │ +
Codim specific typedefs.
Definition subdomain.hh:389
│ │ │ +
typename Grid::template Codim< codim >::Entity Entity
Definition subdomain.hh:390
│ │ │ +
typename Grid::template Codim< codim >::Geometry Geometry
Definition subdomain.hh:392
│ │ │ +
typename Grid::template Codim< codim >::LocalGeometry LocalGeometry
Definition subdomain.hh:393
│ │ │ +
typename Grid::template Codim< codim >::EntitySeed EntitySeed
Definition subdomain.hh:391
│ │ │ +
std::conditional_t< codim==0, ElementIterator< All_Partition >, NonImplementedIterator< codim > > Iterator
Definition subdomain.hh:394
│ │ │ + │ │ │ +
std::conditional_t< codim==0, ElementIterator< pit >, NonImplementedIterator< codim > > Iterator
Definition subdomain.hh:399
│ │ │ +
Class representing a sub-domain of a GridView.
Definition subdomain.hh:534
│ │ │ +
void insertElement(const typename Codim< 0 >::Entity &element)
Insert element and all its sub-entities into SubDomain.
Definition subdomain.hh:577
│ │ │ +
GridView gridView() const
Create grid view representing the SubDomain.
Definition subdomain.hh:565
│ │ │ +
const IndexSet & indexSet() const
Definition subdomain.hh:559
│ │ │ +
SubDomainGridView< HostGridView > GridView
Definition subdomain.hh:540
│ │ │ +
HostGridView hostGridView() const
Access underlying host grid view.
Definition subdomain.hh:571
│ │ │ +
SubDomain(const HostGridView &hostGridView)
Construct SubDomain for underlying host grid view.
Definition subdomain.hh:555
│ │ │ +
typename HostGridView::Grid Grid
Definition subdomain.hh:538
│ │ │ +
@ dimension
Definition subdomain.hh:552
│ │ │ +
bool contains(const typename Codim< 0 >::Entity &element) const
Check if element is contained in SubDomain.
Definition subdomain.hh:583
│ │ │ +
SubDomainIndexSet< HostGridView > IndexSet
Definition subdomain.hh:539
│ │ │ +
HGV HostGridView
Definition subdomain.hh:537
│ │ │ +
Codim specific typedefs.
Definition subdomain.hh:545
│ │ │ +
typename Grid::template Codim< codim >::Geometry Geometry
Definition subdomain.hh:548
│ │ │ +
typename Grid::template Codim< codim >::Entity Entity
Definition subdomain.hh:546
│ │ │ +
typename Grid::template Codim< codim >::LocalGeometry LocalGeometry
Definition subdomain.hh:549
│ │ │ +
typename Grid::template Codim< codim >::EntitySeed EntitySeed
Definition subdomain.hh:547
│ │ │ +
const auto end() const
End iterator (sentinel).
Definition subdomain.hh:670
│ │ │ +
bool contains(const Intersection &is) const
Check if intersection is contained in the interface between the subdomains.
Definition subdomain.hh:631
│ │ │ +
const auto begin() const
Begin iterator over all intersection between the subdomains.
Definition subdomain.hh:660
│ │ │ +
SubDomainInterface(const SubDomainA &subDomainA, const SubDomainB &subDomainB)
Create interface between two subdomains.
Definition subdomain.hh:617
│ │ │ +
bool isOriented(const Intersection &is) const
Check if intersection is oriented.
Definition subdomain.hh:647
│ │ │ +
typename SubDomainA::GridView::Intersection Intersection
Definition subdomain.hh:608
│ │ │ +
SubDomainSkeleton(const SubDomain &subDomain)
Create skeleton of a subdomain.
Definition subdomain.hh:695
│ │ │ +
bool contains(const Intersection &is) const
Check if intersection is contained in the skeleton of the subdomain.
Definition subdomain.hh:700
│ │ │ +
typename SubDomain::GridView::Intersection Intersection
Definition subdomain.hh:692
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,330 +1,933 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -rannacherturekbasis.hh │ │ │ │ +subdomain.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_COMMON_SUBDOMAIN_HH │ │ │ │ +8#define DUNE_FUNCTIONS_COMMON_SUBDOMAIN_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11 │ │ │ │ -12#include │ │ │ │ -13 │ │ │ │ -14#include │ │ │ │ -15#include │ │ │ │ -16#include │ │ │ │ -17 │ │ │ │ -18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -19#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ -20#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h> │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ +12#include │ │ │ │ +13#include │ │ │ │ +14#include │ │ │ │ +15#include │ │ │ │ +16 │ │ │ │ +17#include │ │ │ │ +18#include │ │ │ │ +19#include │ │ │ │ +20#include │ │ │ │ 21 │ │ │ │ -22 │ │ │ │ -23namespace _D_u_n_e { │ │ │ │ -24namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -25 │ │ │ │ -26/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -27// This is the reusable part of the basis. It contains │ │ │ │ -28// │ │ │ │ -29// RannacherTurekPreBasis │ │ │ │ -30// RannacherTurekNode │ │ │ │ -31// │ │ │ │ -32// The pre-basis allows to create the others and is the owner of possible │ │ │ │ -shared │ │ │ │ -33// state. These components do _not_ depend on the global basis and local view │ │ │ │ -34// and can be used without a global basis. │ │ │ │ -35/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ +22#include │ │ │ │ +23#include │ │ │ │ +24 │ │ │ │ +25#include │ │ │ │ +26#include │ │ │ │ +27 │ │ │ │ +_2_8namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l { │ │ │ │ +29 │ │ │ │ +30 namespace Impl { │ │ │ │ +31 │ │ │ │ +32 template │ │ │ │ +33 using GlobalIntersectionIteratorTraits = Dune::DefaultIteratorTraits< │ │ │ │ +34 std::forward_iterator_tag, │ │ │ │ +35 decltype(*std::declval())>; │ │ │ │ 36 │ │ │ │ -37template │ │ │ │ -38class _R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e; │ │ │ │ -39 │ │ │ │ -40template │ │ │ │ -41class _R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s; │ │ │ │ -42 │ │ │ │ -55template │ │ │ │ -_5_6class _R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s : │ │ │ │ -57 public _L_e_a_f_P_r_e_B_a_s_i_s_M_i_x_i_n< RannacherTurekPreBasis > │ │ │ │ -58{ │ │ │ │ -59 static const int dim = GV::dimension; │ │ │ │ -60 │ │ │ │ -61public: │ │ │ │ -62 │ │ │ │ -_6_4 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ -65 │ │ │ │ -_6_7 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ -68 │ │ │ │ -_7_0 using _N_o_d_e = _R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e_<_G_V_>; │ │ │ │ +37 │ │ │ │ +38 template │ │ │ │ +39 class GlobalIntersectionIt │ │ │ │ +40 : public Dune::IteratorFacadeForTraits, GlobalIntersectionIteratorTraits> │ │ │ │ +41 { │ │ │ │ +42 using Facade = Dune::IteratorFacadeForTraits, GlobalIntersectionIteratorTraits>; │ │ │ │ +43 │ │ │ │ +44 public: │ │ │ │ +45 │ │ │ │ +46 using GridView = GV; │ │ │ │ +47 using Element = typename GridView::template Codim<0>::Entity; │ │ │ │ +48 using ElementIterator = typename GridView::template Codim<0>::Iterator; │ │ │ │ +49 using IntersectionIterator = typename GridView::IntersectionIterator; │ │ │ │ +50 │ │ │ │ +51 class SentinelIterator │ │ │ │ +52 {}; │ │ │ │ +53 │ │ │ │ +54 GlobalIntersectionIt(const GridView& gridView, const ContainsCallback& │ │ │ │ +contains, ElementIterator elementIt, ElementIterator elementEnd) │ │ │ │ +55 : gridView_(gridView) │ │ │ │ +56 , contains_(contains) │ │ │ │ +57 , elementIt_(std::move(elementIt)) │ │ │ │ +58 , elementEnd_(std::move(elementEnd)) │ │ │ │ +59 { │ │ │ │ +60 if (elementIt_ != elementEnd_) │ │ │ │ +61 { │ │ │ │ +62 element_ = *elementIt_; │ │ │ │ +63 iIt_ = gridView_.ibegin(element_); │ │ │ │ +64 iEnd_ = gridView_.iend(element_); │ │ │ │ +65 if (not contains_(*iIt_)) │ │ │ │ +66 ++(*this); │ │ │ │ +67 } │ │ │ │ +68 } │ │ │ │ +69 │ │ │ │ +70 using reference = typename Facade::reference; │ │ │ │ 71 │ │ │ │ -_7_3 _R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s(const _G_r_i_d_V_i_e_w& gv) : │ │ │ │ -74 _g_r_i_d_V_i_e_w__(gv) │ │ │ │ -75 { │ │ │ │ -76 for(auto type : gv.indexSet().types(0)) │ │ │ │ -77 if (!type.isSimplex() && !type.isCube()) │ │ │ │ -78 DUNE_THROW(Dune::NotImplemented, "Rannacher-Turek or Crouzeix-Raviart │ │ │ │ -elements are only implemented for grids with simplex or cube elements."); │ │ │ │ -79 } │ │ │ │ -80 │ │ │ │ -_8_2 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ -83 {} │ │ │ │ -84 │ │ │ │ -_8_6 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ -87 { │ │ │ │ -88 return _g_r_i_d_V_i_e_w__; │ │ │ │ -89 } │ │ │ │ -90 │ │ │ │ -_9_2 void _u_p_d_a_t_e (const _G_r_i_d_V_i_e_w& gv) │ │ │ │ -93 { │ │ │ │ -94 _g_r_i_d_V_i_e_w__ = gv; │ │ │ │ -95 } │ │ │ │ -96 │ │ │ │ -_1_0_0 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ -101 { │ │ │ │ -102 return _N_o_d_e{}; │ │ │ │ -103 } │ │ │ │ -104 │ │ │ │ -_1_0_6 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ -107 { │ │ │ │ -108 return (_s_i_z_e___t_y_p_e)(_g_r_i_d_V_i_e_w__.size(1)); │ │ │ │ -109 } │ │ │ │ -110 │ │ │ │ -_1_1_2 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ -113 { │ │ │ │ -114 return 2*GV::dimension; │ │ │ │ -115 } │ │ │ │ -116 │ │ │ │ -117 template │ │ │ │ -_1_1_8 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ -119 { │ │ │ │ -120 for (_s_i_z_e___t_y_p_e i = 0, end = node._s_i_z_e() ; i < end ; ++i, ++it) │ │ │ │ -121 { │ │ │ │ -122 Dune::LocalKey localKey = node._f_i_n_i_t_e_E_l_e_m_e_n_t().localCoefficients().localKey │ │ │ │ -(i); │ │ │ │ -123 const auto& gridIndexSet = _g_r_i_d_V_i_e_w().indexSet(); │ │ │ │ -124 const auto& element = node._e_l_e_m_e_n_t(); │ │ │ │ +72 reference operator*() const │ │ │ │ +73 { │ │ │ │ +74 return *iIt_; │ │ │ │ +75 } │ │ │ │ +76 │ │ │ │ +77 GlobalIntersectionIt& operator++() │ │ │ │ +78 { │ │ │ │ +79 while(true) │ │ │ │ +80 { │ │ │ │ +81 ++iIt_; │ │ │ │ +82 if (iIt_ == iEnd_) │ │ │ │ +83 { │ │ │ │ +84 ++elementIt_; │ │ │ │ +85 if (elementIt_ == elementEnd_) │ │ │ │ +86 return *this; │ │ │ │ +87 element_ = *elementIt_; │ │ │ │ +88 iIt_ = gridView_.ibegin(element_); │ │ │ │ +89 iIt_ = gridView_.ibegin(element_); │ │ │ │ +90 iEnd_ = gridView_.iend(element_); │ │ │ │ +91 } │ │ │ │ +92 if (contains_(*iIt_)) │ │ │ │ +93 return *this; │ │ │ │ +94 } │ │ │ │ +95 return *this; │ │ │ │ +96 } │ │ │ │ +97 │ │ │ │ +98 friend bool operator==(const GlobalIntersectionIt& it1, const │ │ │ │ +GlobalIntersectionIt& it2) │ │ │ │ +99 { │ │ │ │ +100 if (it1.elementIt_ != it2.elementIt_) │ │ │ │ +101 return false; │ │ │ │ +102 if (it1.elementIt_ == it1.elementEnd_) │ │ │ │ +103 return true; │ │ │ │ +104 return (it1.iIt_ == it2.iIt_); │ │ │ │ +105 } │ │ │ │ +106 │ │ │ │ +107 friend bool operator==(const GlobalIntersectionIt& it1, const │ │ │ │ +SentinelIterator& it2) │ │ │ │ +108 { │ │ │ │ +109 return it1.elementIt_ == it1.elementEnd_; │ │ │ │ +110 } │ │ │ │ +111 │ │ │ │ +112 private: │ │ │ │ +113 GridView gridView_; │ │ │ │ +114 ContainsCallback contains_; │ │ │ │ +115 ElementIterator elementIt_; │ │ │ │ +116 ElementIterator elementEnd_; │ │ │ │ +117 Element element_; │ │ │ │ +118 IntersectionIterator iIt_; │ │ │ │ +119 IntersectionIterator iEnd_; │ │ │ │ +120 }; │ │ │ │ +121 │ │ │ │ +122 } │ │ │ │ +123 │ │ │ │ +124 │ │ │ │ 125 │ │ │ │ -126 *it = {{ (_s_i_z_e___t_y_p_e)(gridIndexSet.subIndex(element,localKey.subEntity(),1)) │ │ │ │ -}}; │ │ │ │ -127 } │ │ │ │ -128 return it; │ │ │ │ -129 } │ │ │ │ -130 │ │ │ │ -131protected: │ │ │ │ -_1_3_2 _G_r_i_d_V_i_e_w _g_r_i_d_V_i_e_w__; │ │ │ │ -133}; │ │ │ │ -134 │ │ │ │ -135 │ │ │ │ -136 │ │ │ │ -137template │ │ │ │ -_1_3_8class _R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e : │ │ │ │ -139 public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ -140{ │ │ │ │ -141 static const int dim = GV::dimension; │ │ │ │ -142 static const int maxSize = 2*dim; │ │ │ │ -143 │ │ │ │ -144 constexpr static bool hasFixedElementType = Capabilities:: │ │ │ │ -hasSingleGeometryType::v; │ │ │ │ -145 │ │ │ │ -146 using CubeFiniteElement = RannacherTurekLocalFiniteElement; │ │ │ │ -147 using SimplexFiniteElement = CrouzeixRaviartLocalFiniteElement; │ │ │ │ -148 │ │ │ │ -149 constexpr static unsigned int topologyId = Capabilities:: │ │ │ │ -hasSingleGeometryType::topologyId; // meaningless if │ │ │ │ -hasFixedElementType is false │ │ │ │ -150 constexpr static GeometryType type = GeometryType(topologyId, GV:: │ │ │ │ -dimension); │ │ │ │ -151 │ │ │ │ -152public: │ │ │ │ -153 │ │ │ │ -_1_5_4 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ -_1_5_5 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ -_1_5_6 using _F_i_n_i_t_e_E_l_e_m_e_n_t = std::conditional_t, │ │ │ │ -158 LocalFiniteElementVariant >; │ │ │ │ -159 │ │ │ │ -_1_6_0 _R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e() : │ │ │ │ -161 _f_i_n_i_t_e_E_l_e_m_e_n_t__(), │ │ │ │ -162 _e_l_e_m_e_n_t__(nullptr) │ │ │ │ -163 {} │ │ │ │ -164 │ │ │ │ -_1_6_6 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ -167 { │ │ │ │ -168 return *_e_l_e_m_e_n_t__; │ │ │ │ -169 } │ │ │ │ +146 template │ │ │ │ +_1_4_7 class _S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t │ │ │ │ +148 { │ │ │ │ +149 using HostGridView = HGV; │ │ │ │ +150 │ │ │ │ +151 public: │ │ │ │ +152 │ │ │ │ +_1_5_3 using _G_r_i_d = typename HostGridView::Grid; │ │ │ │ +_1_5_4 using _T_y_p_e_s = std::vector; │ │ │ │ +_1_5_5 using _I_n_d_e_x_T_y_p_e = std::size_t; │ │ │ │ +156 │ │ │ │ +158 template │ │ │ │ +_1_5_9 struct _C_o_d_i_m │ │ │ │ +160 { │ │ │ │ +_1_6_1 using _E_n_t_i_t_y = typename Grid::template _C_o_d_i_m_<_c_o_d_i_m_>_:_:_E_n_t_i_t_y; │ │ │ │ +_1_6_2 using _E_n_t_i_t_y_S_e_e_d = typename Grid::template _C_o_d_i_m_<_c_o_d_i_m_>_:_:_E_n_t_i_t_y_S_e_e_d; │ │ │ │ +_1_6_3 using _G_e_o_m_e_t_r_y = typename Grid::template _C_o_d_i_m_<_c_o_d_i_m_>_:_:_G_e_o_m_e_t_r_y; │ │ │ │ +_1_6_4 using _L_o_c_a_l_G_e_o_m_e_t_r_y = typename Grid::template _C_o_d_i_m_<_c_o_d_i_m_>_:_:_L_o_c_a_l_G_e_o_m_e_t_r_y; │ │ │ │ +165 }; │ │ │ │ +166 │ │ │ │ +_1_6_7 enum {_d_i_m_e_n_s_i_o_n = Grid::dimension}; │ │ │ │ +168 │ │ │ │ +169 private: │ │ │ │ 170 │ │ │ │ -_1_7_5 const _F_i_n_i_t_e_E_l_e_m_e_n_t& _f_i_n_i_t_e_E_l_e_m_e_n_t() const │ │ │ │ -176 { │ │ │ │ -177 return _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ -178 } │ │ │ │ -179 │ │ │ │ -_1_8_1 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ -182 { │ │ │ │ -183 _e_l_e_m_e_n_t__ = &e; │ │ │ │ -184 if constexpr (!hasFixedElementType) │ │ │ │ -185 _f_i_n_i_t_e_E_l_e_m_e_n_t__ = e.type().isCube() ? static_cast<_F_i_n_i_t_e_E_l_e_m_e_n_t> │ │ │ │ -(CubeFiniteElement()) │ │ │ │ -186 : static_cast<_F_i_n_i_t_e_E_l_e_m_e_n_t>(SimplexFiniteElement()) ; │ │ │ │ -187 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__.size()); │ │ │ │ -188 } │ │ │ │ -189 │ │ │ │ -190protected: │ │ │ │ -191 │ │ │ │ -_1_9_2 _F_i_n_i_t_e_E_l_e_m_e_n_t _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ -_1_9_3 const _E_l_e_m_e_n_t* _e_l_e_m_e_n_t__; │ │ │ │ -194}; │ │ │ │ -195 │ │ │ │ -196 │ │ │ │ -197 │ │ │ │ -198namespace _B_a_s_i_s_F_a_c_t_o_r_y { │ │ │ │ +171 using AllEntityMapper = Dune:: │ │ │ │ +MultipleCodimMultipleGeomTypeMapper; │ │ │ │ +172 │ │ │ │ +173 static auto allCodimLayout() │ │ │ │ +174 { │ │ │ │ +175 return [](Dune::GeometryType, int) { return true; }; │ │ │ │ +176 } │ │ │ │ +177 │ │ │ │ +178 static constexpr auto typeIndexSize = Dune::GlobalGeometryTypeIndex::size │ │ │ │ +(_d_i_m_e_n_s_i_o_n); │ │ │ │ +179 static constexpr auto unusesIndex = std::numeric_limits::max(); │ │ │ │ +180 │ │ │ │ +181 public: │ │ │ │ +182 │ │ │ │ +_1_8_4 _S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t(const HostGridView& _h_o_s_t_G_r_i_d_V_i_e_w) │ │ │ │ +185 : _h_o_s_t_G_r_i_d_V_i_e_w__(_h_o_s_t_G_r_i_d_V_i_e_w) │ │ │ │ +186 , _a_l_l_E_n_t_i_t_y_M_a_p_p_e_r__(_h_o_s_t_G_r_i_d_V_i_e_w__, allCodimLayout()) │ │ │ │ +187 { │ │ │ │ +188 _c_l_e_a_r(); │ │ │ │ +189 } │ │ │ │ +190 │ │ │ │ +191 // ********************************* │ │ │ │ +192 // IndexSet interface methods │ │ │ │ +193 // ********************************* │ │ │ │ +194 │ │ │ │ +_1_9_5 _I_n_d_e_x_T_y_p_e _s_i_z_e(Dune::GeometryType gt) const │ │ │ │ +196 { │ │ │ │ +197 return _s_i_z_e_P_e_r_G_T__[Dune::GlobalGeometryTypeIndex::index(gt)]; │ │ │ │ +198 } │ │ │ │ 199 │ │ │ │ -205template │ │ │ │ -_2_0_6auto _r_a_n_n_a_c_h_e_r_T_u_r_e_k() │ │ │ │ -207{ │ │ │ │ -208 return [](const auto& gridView) { │ │ │ │ -209 return _R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s>(gridView); │ │ │ │ -210 }; │ │ │ │ -211} │ │ │ │ -212 │ │ │ │ -213} // end namespace BasisFactory │ │ │ │ -214 │ │ │ │ -215 │ │ │ │ -216 │ │ │ │ -217 │ │ │ │ -229template │ │ │ │ -_2_3_0using _R_a_n_n_a_c_h_e_r_T_u_r_e_k_B_a_s_i_s = _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s_<_G_V_> >; │ │ │ │ -231 │ │ │ │ -232} // end namespace Functions │ │ │ │ -233} // end namespace Dune │ │ │ │ +_2_0_0 _I_n_d_e_x_T_y_p_e _s_i_z_e(int codim) const │ │ │ │ +201 { │ │ │ │ +202 return _s_i_z_e_P_e_r_C_o_d_i_m__[codim]; │ │ │ │ +203 } │ │ │ │ +204 │ │ │ │ +205 template │ │ │ │ +_2_0_6 _I_n_d_e_x_T_y_p_e _i_n_d_e_x(const Entity& entity) const │ │ │ │ +207 { │ │ │ │ +208 auto _i_n_d_e_x = _i_n_d_i_c_e_s__[_a_l_l_E_n_t_i_t_y_M_a_p_p_e_r__.index(entity)]; │ │ │ │ +209 if (_i_n_d_e_x==unusesIndex) │ │ │ │ +210 DUNE_THROW(Dune::InvalidStateException, "Accessing nonexisting entry using │ │ │ │ +SubDomainIndexSet::index()!"); │ │ │ │ +211 return _i_n_d_e_x; │ │ │ │ +212 } │ │ │ │ +213 │ │ │ │ +214 template │ │ │ │ +_2_1_5 _I_n_d_e_x_T_y_p_e _i_n_d_e_x(const typename _C_o_d_i_m_<_c_c_>_:_:_E_n_t_i_t_y& entity) const │ │ │ │ +216 { │ │ │ │ +217 return _i_n_d_e_x_<_t_y_p_e_n_a_m_e_ _C_o_d_i_m_<_c_c_>_:_:_E_n_t_i_t_y>(entity); │ │ │ │ +218 } │ │ │ │ +219 │ │ │ │ +220 template │ │ │ │ +_2_2_1 _I_n_d_e_x_T_y_p_e _s_u_b_I_n_d_e_x(const Entity& entity, int subEntity, unsigned int codim) │ │ │ │ +const │ │ │ │ +222 { │ │ │ │ +223 auto _i_n_d_e_x = _i_n_d_i_c_e_s__[_a_l_l_E_n_t_i_t_y_M_a_p_p_e_r__.subIndex(entity, subEntity, codim)]; │ │ │ │ +224 if (_i_n_d_e_x==unusesIndex) │ │ │ │ +225 DUNE_THROW(Dune::InvalidStateException, "Accessing nonexisting entry using │ │ │ │ +SubDomainIndexSet::subIndex()!"); │ │ │ │ +226 return _i_n_d_e_x; │ │ │ │ +227 } │ │ │ │ +228 │ │ │ │ +229 template │ │ │ │ +_2_3_0 _I_n_d_e_x_T_y_p_e _s_u_b_I_n_d_e_x(const typename _C_o_d_i_m_<_c_c_>_:_:_E_n_t_i_t_y& entity, int subEntity, │ │ │ │ +unsigned int codim) const │ │ │ │ +231 { │ │ │ │ +232 return _s_u_b_I_n_d_e_x_<_t_y_p_e_n_a_m_e_ _C_o_d_i_m_<_c_c_>_:_:_E_n_t_i_t_y>(entity, subEntity, codim); │ │ │ │ +233 } │ │ │ │ 234 │ │ │ │ -235#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH │ │ │ │ -_n_o_d_e_s_._h_h │ │ │ │ -_l_e_a_f_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h │ │ │ │ -_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_r_a_n_n_a_c_h_e_r_T_u_r_e_k │ │ │ │ -auto rannacherTurek() │ │ │ │ -Create a pre-basis factory that can create a Rannacher-Turek pre-basis. │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:206 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_B_a_s_i_s │ │ │ │ -DefaultGlobalBasis< RannacherTurekPreBasis< GV > > RannacherTurekBasis │ │ │ │ -Rannacher-Turek basis. │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:230 │ │ │ │ -_D_u_n_e │ │ │ │ -DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:926 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ -Global basis for given pre-basis. │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:53 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_i_x_i_n │ │ │ │ -A generic MixIn class for PreBasis. │ │ │ │ -DDeeffiinniittiioonn leafprebasismixin.hh:36 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_i_z_e │ │ │ │ -size_type size() const │ │ │ │ -Obtain the number of basis function in the local node. │ │ │ │ -DDeeffiinniittiioonn nodes.hh:162 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_e_t_S_i_z_e │ │ │ │ -void setSize(const size_type size) │ │ │ │ -DDeeffiinniittiioonn nodes.hh:197 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ -DDeeffiinniittiioonn nodes.hh:218 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:140 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e_:_:_b_i_n_d │ │ │ │ -void bind(const Element &e) │ │ │ │ -Bind to element. │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:181 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e_:_:_F_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ -std::conditional_t< hasFixedElementType, std::conditional_t< type.isCube(), │ │ │ │ -CubeFiniteElement, SimplexFiniteElement >, LocalFiniteElementVariant< │ │ │ │ -CubeFiniteElement, SimplexFiniteElement > > FiniteElement │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:156 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t__ │ │ │ │ -FiniteElement finiteElement_ │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:192 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:154 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e_:_:_E_l_e_m_e_n_t │ │ │ │ -typename GV::template Codim< 0 >::Entity Element │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:155 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e │ │ │ │ -RannacherTurekNode() │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:160 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e_:_:_e_l_e_m_e_n_t__ │ │ │ │ -const Element * element_ │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:193 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ -const FiniteElement & finiteElement() const │ │ │ │ -Return the LocalFiniteElement for the element we are bound to. │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:175 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e_:_:_e_l_e_m_e_n_t │ │ │ │ -const Element & element() const │ │ │ │ -Return current element, throw if unbound. │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:166 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s │ │ │ │ -Pre-basis for a Rannacher-Turek basis. │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:58 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s_:_:_i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ -void initializeIndices() │ │ │ │ -Initialize the global indices. │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:82 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -Type used for indices and size information. │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:67 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s_:_:_m_a_k_e_N_o_d_e │ │ │ │ -Node makeNode() const │ │ │ │ -Create tree node. │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:100 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s_:_:_u_p_d_a_t_e │ │ │ │ -void update(const GridView &gv) │ │ │ │ -Update the stored grid view, to be called if the grid has changed. │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:92 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s_:_:_i_n_d_i_c_e_s │ │ │ │ -It indices(const Node &node, It it) const │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:118 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ -GV GridView │ │ │ │ -The grid view that the FE basis is defined on. │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:64 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ -size_type dimension() const │ │ │ │ -Same as size(prefix) with empty prefix. │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:106 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s │ │ │ │ -RannacherTurekPreBasis(const GridView &gv) │ │ │ │ -Constructor for a given grid view object. │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:73 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s_:_:_N_o_d_e │ │ │ │ -RannacherTurekNode< GV > Node │ │ │ │ -Template mapping root tree path to type of created tree node. │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:70 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s_:_:_g_r_i_d_V_i_e_w │ │ │ │ -const GridView & gridView() const │ │ │ │ -Obtain the grid view that the basis is defined on. │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:86 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s_:_:_m_a_x_N_o_d_e_S_i_z_e │ │ │ │ -size_type maxNodeSize() const │ │ │ │ -Get the maximal number of DOFs associated to node for any element. │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:112 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s_:_:_g_r_i_d_V_i_e_w__ │ │ │ │ -GridView gridView_ │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:132 │ │ │ │ +235 template │ │ │ │ +_2_3_6 bool _c_o_n_t_a_i_n_s(const Entity& entity) const │ │ │ │ +237 { │ │ │ │ +238 return (_i_n_d_i_c_e_s__[_a_l_l_E_n_t_i_t_y_M_a_p_p_e_r__.index(entity)] != unusesIndex); │ │ │ │ +239 } │ │ │ │ +240 │ │ │ │ +_2_4_1 _T_y_p_e_s _t_y_p_e_s(int codim) const │ │ │ │ +242 { │ │ │ │ +243 return _t_y_p_e_s_P_e_r_C_o_d_i_m__[codim]; │ │ │ │ +244 } │ │ │ │ +245 │ │ │ │ +246 // ********************************* │ │ │ │ +247 // Extended methods │ │ │ │ +248 // ********************************* │ │ │ │ +249 │ │ │ │ +_2_5_1 const HostGridView& _h_o_s_t_G_r_i_d_V_i_e_w() const │ │ │ │ +252 { │ │ │ │ +253 return _h_o_s_t_G_r_i_d_V_i_e_w__; │ │ │ │ +254 } │ │ │ │ +255 │ │ │ │ +_2_5_7 void _i_n_s_e_r_t_E_l_e_m_e_n_t(const typename _C_o_d_i_m_<_0_>_:_:_E_n_t_i_t_y& element) │ │ │ │ +258 { │ │ │ │ +259 const auto& re = referenceElement(element); │ │ │ │ +260 for (auto codim : Dune::range(0, _d_i_m_e_n_s_i_o_n+1)) │ │ │ │ +261 { │ │ │ │ +262 for (auto subEntity : Dune::range(re.size(codim))) │ │ │ │ +263 { │ │ │ │ +264 auto& _i_n_d_e_x = _i_n_d_i_c_e_s__[_a_l_l_E_n_t_i_t_y_M_a_p_p_e_r__.subIndex(element, subEntity, │ │ │ │ +codim)]; │ │ │ │ +265 if (_i_n_d_e_x==unusesIndex) │ │ │ │ +266 { │ │ │ │ +267 const auto& type = re.type(subEntity, codim); │ │ │ │ +268 const auto typeIndex = Dune::GlobalGeometryTypeIndex::index(type); │ │ │ │ +269 _i_n_d_e_x = _s_i_z_e_P_e_r_G_T__[typeIndex]; │ │ │ │ +270 if (_s_i_z_e_P_e_r_G_T__[typeIndex]==0) │ │ │ │ +271 _t_y_p_e_s_P_e_r_C_o_d_i_m__[codim].push_back(type); │ │ │ │ +272 _s_i_z_e_P_e_r_G_T__[typeIndex]++; │ │ │ │ +273 _s_i_z_e_P_e_r_C_o_d_i_m__[codim]++; │ │ │ │ +274 } │ │ │ │ +275 } │ │ │ │ +276 } │ │ │ │ +277 } │ │ │ │ +278 │ │ │ │ +279 protected: │ │ │ │ +280 │ │ │ │ +281 // Clear all data │ │ │ │ +_2_8_2 void _c_l_e_a_r() │ │ │ │ +283 { │ │ │ │ +284 for(auto& _s_i_z_e : _s_i_z_e_P_e_r_G_T__) │ │ │ │ +285 _s_i_z_e = 0; │ │ │ │ +286 for(auto& _s_i_z_e : _s_i_z_e_P_e_r_C_o_d_i_m__) │ │ │ │ +287 _s_i_z_e = 0; │ │ │ │ +288 for(auto& _t_y_p_e_s : _t_y_p_e_s_P_e_r_C_o_d_i_m__) │ │ │ │ +289 _t_y_p_e_s.clear(); │ │ │ │ +290 _i_n_d_i_c_e_s__.clear(); │ │ │ │ +291 _i_n_d_i_c_e_s__.resize(_a_l_l_E_n_t_i_t_y_M_a_p_p_e_r__.size(), unusesIndex); │ │ │ │ +292 } │ │ │ │ +293 │ │ │ │ +_2_9_4 HostGridView _h_o_s_t_G_r_i_d_V_i_e_w__; │ │ │ │ +295 │ │ │ │ +296 // Global size information │ │ │ │ +_2_9_7 std::array _s_i_z_e_P_e_r_G_T__; │ │ │ │ +_2_9_8 std::array _s_i_z_e_P_e_r_C_o_d_i_m__; │ │ │ │ +_2_9_9 std::array _t_y_p_e_s_P_e_r_C_o_d_i_m__; │ │ │ │ +300 │ │ │ │ +_3_0_1 AllEntityMapper _a_l_l_E_n_t_i_t_y_M_a_p_p_e_r__; │ │ │ │ +302 │ │ │ │ +303 // Index map │ │ │ │ +_3_0_4 std::vector _i_n_d_i_c_e_s__; │ │ │ │ +305 }; │ │ │ │ +306 │ │ │ │ +307 │ │ │ │ +308 │ │ │ │ +321 template │ │ │ │ +_3_2_2 class _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w │ │ │ │ +323 { │ │ │ │ +324 │ │ │ │ +325 template │ │ │ │ +326 class NonImplementedIterator │ │ │ │ +327 { │ │ │ │ +328 public: │ │ │ │ +329 NonImplementedIterator() │ │ │ │ +330 { │ │ │ │ +331 static_assert(codim==0, "SubDomainGridView::Codim::Iterator is only │ │ │ │ +implemented for codim=0"); │ │ │ │ +332 } │ │ │ │ +333 }; │ │ │ │ +334 │ │ │ │ +335 template │ │ │ │ +336 class ElementIterator │ │ │ │ +337 { │ │ │ │ +338 using Element = typename HGV::template _C_o_d_i_m_<_0_>_:_:_E_n_t_i_t_y; │ │ │ │ +339 public: │ │ │ │ +340 │ │ │ │ +341 using HostElementIterator = typename HGV::template _C_o_d_i_m_<_0_>_:_:_t_e_m_p_l_a_t_e │ │ │ │ +Partition::Iterator; │ │ │ │ +342 │ │ │ │ +343 ElementIterator(const _S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_<_H_G_V_>& _i_n_d_e_x_S_e_t, │ │ │ │ +HostElementIterator&& it, HostElementIterator&& endIt) │ │ │ │ +344 : _i_n_d_e_x_S_e_t__(&_i_n_d_e_x_S_e_t) │ │ │ │ +345 , hostIt_(std::move(it)) │ │ │ │ +346 , hostEndIt_(std::move(endIt)) │ │ │ │ +347 { │ │ │ │ +348 while ((hostIt_!= hostEndIt_) and (not _i_n_d_e_x_S_e_t__->contains(*hostIt_))) │ │ │ │ +349 ++hostIt_; │ │ │ │ +350 } │ │ │ │ +351 │ │ │ │ +352 ElementIterator& operator++() │ │ │ │ +353 { │ │ │ │ +354 ++hostIt_; │ │ │ │ +355 while ((hostIt_!= hostEndIt_) and (not _i_n_d_e_x_S_e_t__->contains(*hostIt_))) │ │ │ │ +356 ++hostIt_; │ │ │ │ +357 return *this; │ │ │ │ +358 } │ │ │ │ +359 │ │ │ │ +360 const Element& operator*() const │ │ │ │ +361 { │ │ │ │ +362 return *hostIt_; │ │ │ │ +363 } │ │ │ │ +364 │ │ │ │ +365 friend bool operator==(const ElementIterator& a, const ElementIterator& b) │ │ │ │ +366 { │ │ │ │ +367 return a.hostIt_==b.hostIt_; │ │ │ │ +368 } │ │ │ │ +369 │ │ │ │ +370 private: │ │ │ │ +371 HostElementIterator hostIt_; │ │ │ │ +372 HostElementIterator hostEndIt_; │ │ │ │ +373 const _S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_<_H_G_V_>* _i_n_d_e_x_S_e_t__; │ │ │ │ +374 }; │ │ │ │ +375 │ │ │ │ +376 public: │ │ │ │ +377 │ │ │ │ +_3_7_8 using _H_o_s_t_G_r_i_d_V_i_e_w = HGV; │ │ │ │ +379 │ │ │ │ +_3_8_0 using _G_r_i_d = typename HostGridView::Grid; │ │ │ │ +_3_8_1 using _c_t_y_p_e = typename Grid::ctype; │ │ │ │ +_3_8_2 using _I_n_d_e_x_S_e_t = _S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_<_H_o_s_t_G_r_i_d_V_i_e_w_>; │ │ │ │ +_3_8_3 using _I_n_t_e_r_s_e_c_t_i_o_n = typename HostGridView::Intersection; │ │ │ │ +_3_8_4 using _I_n_t_e_r_s_e_c_t_i_o_n_I_t_e_r_a_t_o_r = typename HostGridView::IntersectionIterator; │ │ │ │ +385 │ │ │ │ +387 template │ │ │ │ +_3_8_8 struct _C_o_d_i_m │ │ │ │ +389 { │ │ │ │ +_3_9_0 using _E_n_t_i_t_y = typename Grid::template _C_o_d_i_m_<_c_o_d_i_m_>_:_:_E_n_t_i_t_y; │ │ │ │ +_3_9_1 using _E_n_t_i_t_y_S_e_e_d = typename Grid::template _C_o_d_i_m_<_c_o_d_i_m_>_:_:_E_n_t_i_t_y_S_e_e_d; │ │ │ │ +_3_9_2 using _G_e_o_m_e_t_r_y = typename Grid::template _C_o_d_i_m_<_c_o_d_i_m_>_:_:_G_e_o_m_e_t_r_y; │ │ │ │ +_3_9_3 using _L_o_c_a_l_G_e_o_m_e_t_r_y = typename Grid::template _C_o_d_i_m_<_c_o_d_i_m_>_:_:_L_o_c_a_l_G_e_o_m_e_t_r_y; │ │ │ │ +_3_9_4 using _I_t_e_r_a_t_o_r = std::conditional_t, NonImplementedIterator>; │ │ │ │ +395 │ │ │ │ +396 template │ │ │ │ +_3_9_7 struct _P_a_r_t_i_t_i_o_n │ │ │ │ +398 { │ │ │ │ +_3_9_9 using _I_t_e_r_a_t_o_r = std::conditional_t, │ │ │ │ +NonImplementedIterator>; │ │ │ │ +400 }; │ │ │ │ +401 }; │ │ │ │ +402 │ │ │ │ +_4_0_3 enum {_d_i_m_e_n_s_i_o_n = Grid::dimension}; │ │ │ │ +_4_0_4 enum {_d_i_m_e_n_s_i_o_n_w_o_r_l_d = Grid::dimensionworld}; │ │ │ │ +405 │ │ │ │ +_4_0_6 _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w(const _I_n_d_e_x_S_e_t& _i_n_d_e_x_S_e_t) │ │ │ │ +407 : _i_n_d_e_x_S_e_t__(&_i_n_d_e_x_S_e_t) │ │ │ │ +408 {} │ │ │ │ +409 │ │ │ │ +_4_1_0 _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w(const _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w& other) = default; │ │ │ │ +411 │ │ │ │ +_4_1_2 const _G_r_i_d& _g_r_i_d() const │ │ │ │ +413 { │ │ │ │ +414 return _i_n_d_e_x_S_e_t__->hostGridView().grid(); │ │ │ │ +415 } │ │ │ │ +416 │ │ │ │ +_4_1_7 const _I_n_d_e_x_S_e_t& _i_n_d_e_x_S_e_t() const │ │ │ │ +418 { │ │ │ │ +419 return *_i_n_d_e_x_S_e_t__; │ │ │ │ +420 } │ │ │ │ +421 │ │ │ │ +_4_2_2 int _s_i_z_e(int codim) const │ │ │ │ +423 { │ │ │ │ +424 return _i_n_d_e_x_S_e_t__->size(codim); │ │ │ │ +425 } │ │ │ │ +426 │ │ │ │ +_4_2_7 int _s_i_z_e(Dune::GeometryType gt) const │ │ │ │ +428 { │ │ │ │ +429 return _i_n_d_e_x_S_e_t__->size(gt); │ │ │ │ +430 } │ │ │ │ +431 │ │ │ │ +432 template │ │ │ │ +_4_3_3 bool _c_o_n_t_a_i_n_s(const Entity& entity) const │ │ │ │ +434 { │ │ │ │ +435 return _i_n_d_e_x_S_e_t__->contains(entity); │ │ │ │ +436 } │ │ │ │ +437 │ │ │ │ +439 template │ │ │ │ +_4_4_0 typename Codim::template Partition::Iterator _b_e_g_i_n() const │ │ │ │ +441 { │ │ │ │ +442 static_assert(codim==0, "SubDomainGridView::begin is only │ │ │ │ +implemented for codim=0"); │ │ │ │ +443 return {_i_n_d_e_x_S_e_t(), _h_o_s_t_G_r_i_d_V_i_e_w().template _b_e_g_i_n_<_c_o_d_i_m_,_ _p_i_t_>(), │ │ │ │ +_h_o_s_t_G_r_i_d_V_i_e_w().template _e_n_d_<_c_o_d_i_m_,_ _p_i_t_>()}; │ │ │ │ +444 } │ │ │ │ +445 │ │ │ │ +447 template │ │ │ │ +_4_4_8 typename Codim::template Partition::Iterator _e_n_d() const │ │ │ │ +449 { │ │ │ │ +450 static_assert(codim==0, "SubDomainGridView::end is only implemented │ │ │ │ +for codim=0"); │ │ │ │ +451 return {_i_n_d_e_x_S_e_t(), _h_o_s_t_G_r_i_d_V_i_e_w().template _e_n_d_<_c_o_d_i_m_,_ _p_i_t_>(), _h_o_s_t_G_r_i_d_V_i_e_w │ │ │ │ +().template _e_n_d_<_c_o_d_i_m_,_ _p_i_t_>()}; │ │ │ │ +452 } │ │ │ │ +453 │ │ │ │ +_4_5_4 decltype(auto) _c_o_m_m() const │ │ │ │ +455 { │ │ │ │ +456 return _h_o_s_t_G_r_i_d_V_i_e_w().comm(); │ │ │ │ +457 } │ │ │ │ +458 │ │ │ │ +_4_5_9 decltype(auto) _i_b_e_g_i_n(const typename _C_o_d_i_m_<_0_>_:_:_E_n_t_i_t_y& element) const │ │ │ │ +460 { │ │ │ │ +461 return _h_o_s_t_G_r_i_d_V_i_e_w().ibegin(element); │ │ │ │ +462 } │ │ │ │ +463 │ │ │ │ +_4_6_4 decltype(auto) _i_e_n_d(const typename _C_o_d_i_m_<_0_>_:_:_E_n_t_i_t_y& element) const │ │ │ │ +465 { │ │ │ │ +466 return _h_o_s_t_G_r_i_d_V_i_e_w().iend(element); │ │ │ │ +467 } │ │ │ │ +468 │ │ │ │ +_4_7_0 const _H_o_s_t_G_r_i_d_V_i_e_w& _h_o_s_t_G_r_i_d_V_i_e_w() const │ │ │ │ +471 { │ │ │ │ +472 return _i_n_d_e_x_S_e_t__->hostGridView(); │ │ │ │ +473 } │ │ │ │ +474 │ │ │ │ +475 protected: │ │ │ │ +_4_7_6 const _I_n_d_e_x_S_e_t* _i_n_d_e_x_S_e_t__; │ │ │ │ +477 }; │ │ │ │ +478 │ │ │ │ +479 │ │ │ │ +480 │ │ │ │ +486 template │ │ │ │ +_4_8_7 auto _e_l_e_m_e_n_t_s(const _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_<_H_o_s_t_G_r_i_d_V_i_e_w_>& subDomainGridView) │ │ │ │ +488 { │ │ │ │ +489 return Dune::IteratorRange(subDomainGridView.template begin<0>(), │ │ │ │ +subDomainGridView.template end<0>()); │ │ │ │ +490 } │ │ │ │ +491 │ │ │ │ +497 template │ │ │ │ +_4_9_8 auto _e_l_e_m_e_n_t_s(const _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_<_H_o_s_t_G_r_i_d_V_i_e_w_>& subDomainGridView, │ │ │ │ +Dune::PartitionSet partitionSet) │ │ │ │ +499 { │ │ │ │ +500 constexpr auto pit = partitionSet.partitionIterator(); │ │ │ │ +501 return Dune::IteratorRange(subDomainGridView.template begin<0, pit>(), │ │ │ │ +subDomainGridView.template end<0, pit>()); │ │ │ │ +502 } │ │ │ │ +503 │ │ │ │ +509 template │ │ │ │ +_5_1_0 auto _i_n_t_e_r_s_e_c_t_i_o_n_s(const _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_<_H_o_s_t_G_r_i_d_V_i_e_w_>& │ │ │ │ +subDomainGridView, const Element& element) │ │ │ │ +511 { │ │ │ │ +512 return Dune::IteratorRange(subDomainGridView._i_b_e_g_i_n(element), │ │ │ │ +subDomainGridView._i_e_n_d(element)); │ │ │ │ +513 } │ │ │ │ +514 │ │ │ │ +515 │ │ │ │ +516 │ │ │ │ +532 template │ │ │ │ +_5_3_3 class _S_u_b_D_o_m_a_i_n │ │ │ │ +534 { │ │ │ │ +535 public: │ │ │ │ +536 │ │ │ │ +_5_3_7 using _H_o_s_t_G_r_i_d_V_i_e_w = HGV; │ │ │ │ +_5_3_8 using _G_r_i_d = typename HostGridView::Grid; │ │ │ │ +_5_3_9 using _I_n_d_e_x_S_e_t = _S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_<_H_o_s_t_G_r_i_d_V_i_e_w_>; │ │ │ │ +_5_4_0 using _G_r_i_d_V_i_e_w = _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_<_H_o_s_t_G_r_i_d_V_i_e_w_>; │ │ │ │ +541 │ │ │ │ +543 template │ │ │ │ +_5_4_4 struct _C_o_d_i_m │ │ │ │ +545 { │ │ │ │ +_5_4_6 using _E_n_t_i_t_y = typename Grid::template _C_o_d_i_m_<_c_o_d_i_m_>_:_:_E_n_t_i_t_y; │ │ │ │ +_5_4_7 using _E_n_t_i_t_y_S_e_e_d = typename Grid::template _C_o_d_i_m_<_c_o_d_i_m_>_:_:_E_n_t_i_t_y_S_e_e_d; │ │ │ │ +_5_4_8 using _G_e_o_m_e_t_r_y = typename Grid::template _C_o_d_i_m_<_c_o_d_i_m_>_:_:_G_e_o_m_e_t_r_y; │ │ │ │ +_5_4_9 using _L_o_c_a_l_G_e_o_m_e_t_r_y = typename Grid::template _C_o_d_i_m_<_c_o_d_i_m_>_:_:_L_o_c_a_l_G_e_o_m_e_t_r_y; │ │ │ │ +550 }; │ │ │ │ +551 │ │ │ │ +_5_5_2 enum {_d_i_m_e_n_s_i_o_n = Grid::dimension}; │ │ │ │ +553 │ │ │ │ +_5_5_5 _S_u_b_D_o_m_a_i_n(const _H_o_s_t_G_r_i_d_V_i_e_w& _h_o_s_t_G_r_i_d_V_i_e_w) │ │ │ │ +556 : indexSet_(_h_o_s_t_G_r_i_d_V_i_e_w) │ │ │ │ +557 {} │ │ │ │ +558 │ │ │ │ +_5_5_9 const _I_n_d_e_x_S_e_t& _i_n_d_e_x_S_e_t() const │ │ │ │ +560 { │ │ │ │ +561 return indexSet_; │ │ │ │ +562 } │ │ │ │ +563 │ │ │ │ +_5_6_5 _G_r_i_d_V_i_e_w _g_r_i_d_V_i_e_w() const │ │ │ │ +566 { │ │ │ │ +567 return _G_r_i_d_V_i_e_w(indexSet_); │ │ │ │ +568 } │ │ │ │ +569 │ │ │ │ +_5_7_1 _H_o_s_t_G_r_i_d_V_i_e_w _h_o_s_t_G_r_i_d_V_i_e_w() const │ │ │ │ +572 { │ │ │ │ +573 return indexSet_.hostGridView(); │ │ │ │ +574 } │ │ │ │ +575 │ │ │ │ +_5_7_7 void _i_n_s_e_r_t_E_l_e_m_e_n_t(const typename _C_o_d_i_m_<_0_>_:_:_E_n_t_i_t_y& element) │ │ │ │ +578 { │ │ │ │ +579 indexSet_.insertElement(element); │ │ │ │ +580 } │ │ │ │ +581 │ │ │ │ +_5_8_3 bool _c_o_n_t_a_i_n_s(const typename _C_o_d_i_m_<_0_>_:_:_E_n_t_i_t_y& element) const │ │ │ │ +584 { │ │ │ │ +585 return indexSet_.contains(element); │ │ │ │ +586 } │ │ │ │ +587 │ │ │ │ +588 private: │ │ │ │ +589 _I_n_d_e_x_S_e_t indexSet_; │ │ │ │ +590 }; │ │ │ │ +591 │ │ │ │ +592 │ │ │ │ +593 │ │ │ │ +599 template │ │ │ │ +_6_0_0 class _S_u_b_D_o_m_a_i_n_I_n_t_e_r_f_a_c_e │ │ │ │ +601 { │ │ │ │ +602 static_assert( │ │ │ │ +603 std::is_same_v, │ │ │ │ +604 "SubDomainInterface requires that both SubDomain types have the same │ │ │ │ +Intersection type"); │ │ │ │ +605 │ │ │ │ +606 public: │ │ │ │ +607 │ │ │ │ +_6_0_8 using _I_n_t_e_r_s_e_c_t_i_o_n = typename SubDomainA::GridView::Intersection; │ │ │ │ +609 │ │ │ │ +_6_1_7 _S_u_b_D_o_m_a_i_n_I_n_t_e_r_f_a_c_e(const SubDomainA& subDomainA, const SubDomainB& │ │ │ │ +subDomainB) │ │ │ │ +618 : subDomainA_(subDomainA) │ │ │ │ +619 , subDomainB_(subDomainB) │ │ │ │ +620 {} │ │ │ │ +621 │ │ │ │ +_6_3_1 bool _c_o_n_t_a_i_n_s(const _I_n_t_e_r_s_e_c_t_i_o_n& is) const │ │ │ │ +632 { │ │ │ │ +633 if (is.boundary() or not(is.neighbor())) │ │ │ │ +634 return false; │ │ │ │ +635 return (subDomainA_.contains(is.inside()) && subDomainB_.contains │ │ │ │ +(is.outside())) │ │ │ │ +636 || (subDomainA_.contains(is.outside()) && subDomainB_.contains(is.inside │ │ │ │ +())); │ │ │ │ +637 } │ │ │ │ +638 │ │ │ │ +_6_4_7 bool _i_s_O_r_i_e_n_t_e_d(const _I_n_t_e_r_s_e_c_t_i_o_n& is) const │ │ │ │ +648 { │ │ │ │ +649 if (is.boundary() or not(is.neighbor())) │ │ │ │ +650 return false; │ │ │ │ +651 return (subDomainA_.contains(is.inside()) && subDomainB_.contains │ │ │ │ +(is.outside())); │ │ │ │ +652 } │ │ │ │ +653 │ │ │ │ +_6_6_0 const auto _b_e_g_i_n() const │ │ │ │ +661 { │ │ │ │ +662 return Impl::GlobalIntersectionIt(subDomainA_.gridView(), [&](const auto& │ │ │ │ +is) { │ │ │ │ +663 if (is.boundary() or not(is.neighbor())) │ │ │ │ +664 return false; │ │ │ │ +665 return subDomainB_.indexSet().contains(is.outside()); │ │ │ │ +666 }, subDomainA_.gridView().template _b_e_g_i_n_<_0_>(), subDomainA_.gridView │ │ │ │ +().template _e_n_d_<_0_>()); │ │ │ │ +667 } │ │ │ │ +668 │ │ │ │ +_6_7_0 const auto _e_n_d() const │ │ │ │ +671 { │ │ │ │ +672 return typename decltype(_b_e_g_i_n())::SentinelIterator(); │ │ │ │ +673 } │ │ │ │ +674 │ │ │ │ +675 private: │ │ │ │ +676 const SubDomainA& subDomainA_; │ │ │ │ +677 const SubDomainB& subDomainB_; │ │ │ │ +678 }; │ │ │ │ +679 │ │ │ │ +680 │ │ │ │ +681 │ │ │ │ +687 template │ │ │ │ +_6_8_8 class _S_u_b_D_o_m_a_i_n_S_k_e_l_e_t_o_n │ │ │ │ +689 { │ │ │ │ +690 public: │ │ │ │ +691 │ │ │ │ +_6_9_2 using _I_n_t_e_r_s_e_c_t_i_o_n = typename _S_u_b_D_o_m_a_i_n_:_:_G_r_i_d_V_i_e_w_:_:_I_n_t_e_r_s_e_c_t_i_o_n; │ │ │ │ +693 │ │ │ │ +_6_9_5 _S_u_b_D_o_m_a_i_n_S_k_e_l_e_t_o_n(const _S_u_b_D_o_m_a_i_n& subDomain) │ │ │ │ +696 : subDomain_(subDomain) │ │ │ │ +697 {} │ │ │ │ +698 │ │ │ │ +_7_0_0 bool _c_o_n_t_a_i_n_s(const _I_n_t_e_r_s_e_c_t_i_o_n& is) const │ │ │ │ +701 { │ │ │ │ +702 if (is.boundary() or not(is.neighbor())) │ │ │ │ +703 return false; │ │ │ │ +704 return subDomain_.contains(is.inside()) and subDomain_.contains(is.outside │ │ │ │ +()); │ │ │ │ +705 } │ │ │ │ +706 │ │ │ │ +707 private: │ │ │ │ +708 const _S_u_b_D_o_m_a_i_n& subDomain_; │ │ │ │ +709 }; │ │ │ │ +710 │ │ │ │ +711 │ │ │ │ +712 │ │ │ │ +713} // namespace Dune::Functions::Experimental │ │ │ │ +714 │ │ │ │ +715#endif// DUNE_FUNCTIONS_COMMON_SUBDOMAIN_HH │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_e_l_e_m_e_n_t_s │ │ │ │ +auto elements(const SubDomainGridView< HostGridView > &subDomainGridView) │ │ │ │ +ADL findable access to element range for a SubDomainGridView. │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:487 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_i_n_t_e_r_s_e_c_t_i_o_n_s │ │ │ │ +auto intersections(const SubDomainGridView< HostGridView > &subDomainGridView, │ │ │ │ +const Element &element) │ │ │ │ +ADL findable access to intersection range for an element of a │ │ │ │ +SubDomainGridView. │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:510 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:28 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t │ │ │ │ +An IndexSet for a sub-domain. │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:148 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t │ │ │ │ +SubDomainIndexSet(const HostGridView &hostGridView) │ │ │ │ +Construct SubDomainIndexSet for underlying host grid view. │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:184 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_<_ _H_o_s_t_G_r_i_d_V_i_e_w_ _>_:_:_s_i_z_e_P_e_r_G_T__ │ │ │ │ +std::array< std::size_t, typeIndexSize > sizePerGT_ │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:297 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_<_ _H_o_s_t_G_r_i_d_V_i_e_w_ _>_:_:_i_n_d_i_c_e_s__ │ │ │ │ +std::vector< IndexType > indices_ │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:304 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_i_n_d_e_x │ │ │ │ +IndexType index(const typename Codim< cc >::Entity &entity) const │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:215 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_<_ _H_o_s_t_G_r_i_d_V_i_e_w_ _>_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ +@ dimension │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:167 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_i_n_d_e_x │ │ │ │ +IndexType index(const Entity &entity) const │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:206 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_s_i_z_e │ │ │ │ +IndexType size(int codim) const │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:200 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_<_ _H_o_s_t_G_r_i_d_V_i_e_w_ _>_:_: │ │ │ │ +_a_l_l_E_n_t_i_t_y_M_a_p_p_e_r__ │ │ │ │ +AllEntityMapper allEntityMapper_ │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:301 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_s_i_z_e │ │ │ │ +IndexType size(Dune::GeometryType gt) const │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:195 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_i_n_s_e_r_t_E_l_e_m_e_n_t │ │ │ │ +void insertElement(const typename Codim< 0 >::Entity &element) │ │ │ │ +Insert element and all its sub-entities into SubDomainIndexSet. │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:257 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_t_y_p_e_s │ │ │ │ +Types types(int codim) const │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:241 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_T_y_p_e_s │ │ │ │ +std::vector< Dune::GeometryType > Types │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:154 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_s_u_b_I_n_d_e_x │ │ │ │ +IndexType subIndex(const typename Codim< cc >::Entity &entity, int subEntity, │ │ │ │ +unsigned int codim) const │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:230 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_<_ _H_o_s_t_G_r_i_d_V_i_e_w_ _>_:_:_h_o_s_t_G_r_i_d_V_i_e_w__ │ │ │ │ +HostGridView hostGridView_ │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:294 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_<_ _H_o_s_t_G_r_i_d_V_i_e_w_ _>_:_:_s_i_z_e_P_e_r_C_o_d_i_m__ │ │ │ │ +std::array< std::size_t, dimension+1 > sizePerCodim_ │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:298 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_G_r_i_d │ │ │ │ +typename HostGridView::Grid Grid │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:153 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_<_ _H_o_s_t_G_r_i_d_V_i_e_w_ _>_:_:_h_o_s_t_G_r_i_d_V_i_e_w │ │ │ │ +const HostGridView & hostGridView() const │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:251 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_c_l_e_a_r │ │ │ │ +void clear() │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:282 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_c_o_n_t_a_i_n_s │ │ │ │ +bool contains(const Entity &entity) const │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:236 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_<_ _H_o_s_t_G_r_i_d_V_i_e_w_ _>_:_: │ │ │ │ +_t_y_p_e_s_P_e_r_C_o_d_i_m__ │ │ │ │ +std::array< Types, dimension+1 > typesPerCodim_ │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:299 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_I_n_d_e_x_T_y_p_e │ │ │ │ +std::size_t IndexType │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:155 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_s_u_b_I_n_d_e_x │ │ │ │ +IndexType subIndex(const Entity &entity, int subEntity, unsigned int codim) │ │ │ │ +const │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:221 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_C_o_d_i_m │ │ │ │ +Codim specific typedefs. │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:160 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_C_o_d_i_m_:_:_E_n_t_i_t_y_S_e_e_d │ │ │ │ +typename Grid::template Codim< codim >::EntitySeed EntitySeed │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:162 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_C_o_d_i_m_:_:_G_e_o_m_e_t_r_y │ │ │ │ +typename Grid::template Codim< codim >::Geometry Geometry │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:163 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_C_o_d_i_m_:_:_L_o_c_a_l_G_e_o_m_e_t_r_y │ │ │ │ +typename Grid::template Codim< codim >::LocalGeometry LocalGeometry │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:164 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_C_o_d_i_m_:_:_E_n_t_i_t_y │ │ │ │ +typename Grid::template Codim< codim >::Entity Entity │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:161 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w │ │ │ │ +A GridView for a sub-domain. │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:323 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_<_ _H_o_s_t_G_r_i_d_V_i_e_w_ _>_:_: │ │ │ │ +_d_i_m_e_n_s_i_o_n_w_o_r_l_d │ │ │ │ +@ dimensionworld │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:404 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_<_ _H_o_s_t_G_r_i_d_V_i_e_w_ _>_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ +@ dimension │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:403 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_G_r_i_d │ │ │ │ +typename HostGridView::Grid Grid │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:380 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_e_n_d │ │ │ │ +Codim< codim >::template Partition< pit >::Iterator end() const │ │ │ │ +Create an iterator pointing to the end of the range. │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:448 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_c_o_n_t_a_i_n_s │ │ │ │ +bool contains(const Entity &entity) const │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:433 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_i_n_d_e_x_S_e_t__ │ │ │ │ +const IndexSet * indexSet_ │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:476 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_i_n_d_e_x_S_e_t │ │ │ │ +const IndexSet & indexSet() const │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:417 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w │ │ │ │ +SubDomainGridView(const SubDomainGridView &other)=default │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_g_r_i_d │ │ │ │ +const Grid & grid() const │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:412 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_c_t_y_p_e │ │ │ │ +typename Grid::ctype ctype │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:381 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_I_n_t_e_r_s_e_c_t_i_o_n_I_t_e_r_a_t_o_r │ │ │ │ +typename HostGridView::IntersectionIterator IntersectionIterator │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:384 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_h_o_s_t_G_r_i_d_V_i_e_w │ │ │ │ +const HostGridView & hostGridView() const │ │ │ │ +Access underlying host grid view. │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:470 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_I_n_d_e_x_S_e_t │ │ │ │ +SubDomainIndexSet< HostGridView > IndexSet │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:382 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_I_n_t_e_r_s_e_c_t_i_o_n │ │ │ │ +typename HostGridView::Intersection Intersection │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:383 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_c_o_m_m │ │ │ │ +decltype(auto) comm() const │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:454 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_s_i_z_e │ │ │ │ +int size(int codim) const │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:422 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_i_b_e_g_i_n │ │ │ │ +decltype(auto) ibegin(const typename Codim< 0 >::Entity &element) const │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:459 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_s_i_z_e │ │ │ │ +int size(Dune::GeometryType gt) const │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:427 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_i_e_n_d │ │ │ │ +decltype(auto) iend(const typename Codim< 0 >::Entity &element) const │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:464 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_H_o_s_t_G_r_i_d_V_i_e_w │ │ │ │ +HGV HostGridView │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:378 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_b_e_g_i_n │ │ │ │ +Codim< codim >::template Partition< pit >::Iterator begin() const │ │ │ │ +Create an iterator pointing to the begin of the range. │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:440 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w │ │ │ │ +SubDomainGridView(const IndexSet &indexSet) │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:406 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_C_o_d_i_m │ │ │ │ +Codim specific typedefs. │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:389 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_C_o_d_i_m_:_:_E_n_t_i_t_y │ │ │ │ +typename Grid::template Codim< codim >::Entity Entity │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:390 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_C_o_d_i_m_:_:_G_e_o_m_e_t_r_y │ │ │ │ +typename Grid::template Codim< codim >::Geometry Geometry │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:392 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_C_o_d_i_m_:_:_L_o_c_a_l_G_e_o_m_e_t_r_y │ │ │ │ +typename Grid::template Codim< codim >::LocalGeometry LocalGeometry │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:393 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_C_o_d_i_m_:_:_E_n_t_i_t_y_S_e_e_d │ │ │ │ +typename Grid::template Codim< codim >::EntitySeed EntitySeed │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:391 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_C_o_d_i_m_:_:_I_t_e_r_a_t_o_r │ │ │ │ +std::conditional_t< codim==0, ElementIterator< All_Partition >, │ │ │ │ +NonImplementedIterator< codim > > Iterator │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:394 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_C_o_d_i_m_:_:_P_a_r_t_i_t_i_o_n │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:398 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_C_o_d_i_m_:_:_P_a_r_t_i_t_i_o_n_:_:_I_t_e_r_a_t_o_r │ │ │ │ +std::conditional_t< codim==0, ElementIterator< pit >, NonImplementedIterator< │ │ │ │ +codim > > Iterator │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:399 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n │ │ │ │ +Class representing a sub-domain of a GridView. │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:534 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_i_n_s_e_r_t_E_l_e_m_e_n_t │ │ │ │ +void insertElement(const typename Codim< 0 >::Entity &element) │ │ │ │ +Insert element and all its sub-entities into SubDomain. │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:577 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_g_r_i_d_V_i_e_w │ │ │ │ +GridView gridView() const │ │ │ │ +Create grid view representing the SubDomain. │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:565 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_i_n_d_e_x_S_e_t │ │ │ │ +const IndexSet & indexSet() const │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:559 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_G_r_i_d_V_i_e_w │ │ │ │ +SubDomainGridView< HostGridView > GridView │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:540 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_h_o_s_t_G_r_i_d_V_i_e_w │ │ │ │ +HostGridView hostGridView() const │ │ │ │ +Access underlying host grid view. │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:571 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_S_u_b_D_o_m_a_i_n │ │ │ │ +SubDomain(const HostGridView &hostGridView) │ │ │ │ +Construct SubDomain for underlying host grid view. │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:555 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_G_r_i_d │ │ │ │ +typename HostGridView::Grid Grid │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:538 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ +@ dimension │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:552 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_c_o_n_t_a_i_n_s │ │ │ │ +bool contains(const typename Codim< 0 >::Entity &element) const │ │ │ │ +Check if element is contained in SubDomain. │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:583 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_I_n_d_e_x_S_e_t │ │ │ │ +SubDomainIndexSet< HostGridView > IndexSet │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:539 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_H_o_s_t_G_r_i_d_V_i_e_w │ │ │ │ +HGV HostGridView │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:537 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_C_o_d_i_m │ │ │ │ +Codim specific typedefs. │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:545 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_C_o_d_i_m_:_:_G_e_o_m_e_t_r_y │ │ │ │ +typename Grid::template Codim< codim >::Geometry Geometry │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:548 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_C_o_d_i_m_:_:_E_n_t_i_t_y │ │ │ │ +typename Grid::template Codim< codim >::Entity Entity │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:546 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_C_o_d_i_m_:_:_L_o_c_a_l_G_e_o_m_e_t_r_y │ │ │ │ +typename Grid::template Codim< codim >::LocalGeometry LocalGeometry │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:549 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_C_o_d_i_m_:_:_E_n_t_i_t_y_S_e_e_d │ │ │ │ +typename Grid::template Codim< codim >::EntitySeed EntitySeed │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:547 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_t_e_r_f_a_c_e_:_:_e_n_d │ │ │ │ +const auto end() const │ │ │ │ +End iterator (sentinel). │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:670 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_t_e_r_f_a_c_e_:_:_c_o_n_t_a_i_n_s │ │ │ │ +bool contains(const Intersection &is) const │ │ │ │ +Check if intersection is contained in the interface between the subdomains. │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:631 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_t_e_r_f_a_c_e_:_:_b_e_g_i_n │ │ │ │ +const auto begin() const │ │ │ │ +Begin iterator over all intersection between the subdomains. │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:660 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_t_e_r_f_a_c_e_:_:_S_u_b_D_o_m_a_i_n_I_n_t_e_r_f_a_c_e │ │ │ │ +SubDomainInterface(const SubDomainA &subDomainA, const SubDomainB &subDomainB) │ │ │ │ +Create interface between two subdomains. │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:617 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_t_e_r_f_a_c_e_:_:_i_s_O_r_i_e_n_t_e_d │ │ │ │ +bool isOriented(const Intersection &is) const │ │ │ │ +Check if intersection is oriented. │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:647 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_t_e_r_f_a_c_e_:_:_I_n_t_e_r_s_e_c_t_i_o_n │ │ │ │ +typename SubDomainA::GridView::Intersection Intersection │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:608 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_S_k_e_l_e_t_o_n_:_:_S_u_b_D_o_m_a_i_n_S_k_e_l_e_t_o_n │ │ │ │ +SubDomainSkeleton(const SubDomain &subDomain) │ │ │ │ +Create skeleton of a subdomain. │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:695 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_S_k_e_l_e_t_o_n_:_:_c_o_n_t_a_i_n_s │ │ │ │ +bool contains(const Intersection &is) const │ │ │ │ +Check if intersection is contained in the skeleton of the subdomain. │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:700 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_S_k_e_l_e_t_o_n_:_:_I_n_t_e_r_s_e_c_t_i_o_n │ │ │ │ +typename SubDomain::GridView::Intersection Intersection │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:692 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _r_a_n_n_a_c_h_e_r_t_u_r_e_k_b_a_s_i_s_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _s_u_b_d_o_m_a_i_n_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00104.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: powerbasis.hh File Reference │ │ │ +Dune-Functions: reserveddeque.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,64 +88,75 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
powerbasis.hh File Reference
│ │ │ +
reserveddeque.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <dune/common/reservedvector.hh>
│ │ │ -#include <dune/common/typeutilities.hh>
│ │ │ -#include <dune/common/indices.hh>
│ │ │ -#include <dune/common/typetree/nodeconcepts.hh>
│ │ │ -#include <dune/functions/common/utility.hh>
│ │ │ -#include <dune/functions/common/type_traits.hh>
│ │ │ -#include <dune/functions/functionspacebases/basistags.hh>
│ │ │ -#include <dune/functions/functionspacebases/dynamicpowerbasis.hh>
│ │ │ -#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ -#include <dune/functions/functionspacebases/concepts.hh>
│ │ │ -#include <dune/functions/functionspacebases/containerdescriptors.hh>
│ │ │ -#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │ + │ │ │ +

An stl-compliant double-ended queue which stores everything on the stack. │ │ │ +More...

│ │ │ +
#include <algorithm>
│ │ │ +#include <iostream>
│ │ │ +#include <cstddef>
│ │ │ +#include <initializer_list>
│ │ │ +#include <dune/common/genericiterator.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::PowerPreBasis< IMS, SPB, C >
 A pre-basis for power bases. More...
class  Dune::Functions::ReservedDeque< T, n >
 A double-ended queue (deque) class with statically reserved memory. More...
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::BasisFactory
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │

│ │ │ -Functions

template<std::size_t k, class ChildPreBasisFactory, class IndexMergingStrategy>
auto Dune::Functions::BasisFactory::power (ChildPreBasisFactory &&childPreBasisFactory, const IndexMergingStrategy &)
 Create a pre-basis factory that can build a PowerPreBasis.
template<std::size_t k, class ChildPreBasisFactory>
auto Dune::Functions::BasisFactory::power (ChildPreBasisFactory &&childPreBasisFactory)
 Create a factory builder that can build a PowerPreBasis.

│ │ │ +Macros

#define CHECKSIZE(X)
│ │ │ +

Detailed Description

│ │ │ +

An stl-compliant double-ended queue which stores everything on the stack.

│ │ │ +

Macro Definition Documentation

│ │ │ + │ │ │ +

◆ CHECKSIZE

│ │ │ + │ │ │ +
│ │ │ +
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
#define CHECKSIZE( X)
│ │ │ +
│ │ │ +Value:
{}
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,40 +1,34 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -powerbasis.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_b_a_s_i_s_t_a_g_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_y_n_a_m_i_c_p_o_w_e_r_b_a_s_i_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ +reserveddeque.hh File Reference │ │ │ │ +An stl-compliant double-ended queue which stores everything on the stack. │ │ │ │ +_M_o_r_e_._._. │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_P_r_e_B_a_s_i_s_<_ _I_M_S_,_ _S_P_B_,_ _C_ _> │ │ │ │ -  A pre-basis for power bases. _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_<_ _T_,_ _n_ _> │ │ │ │ +  A double-ended queue (deque) class with statically reserved memory. │ │ │ │ + _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_p_o_w_e_r (ChildPreBasisFactory │ │ │ │ - &&childPreBasisFactory, const _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y &) │ │ │ │ -  Create a pre-basis factory that can build a _P_o_w_e_r_P_r_e_B_a_s_i_s. │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_p_o_w_e_r (ChildPreBasisFactory │ │ │ │ - &&childPreBasisFactory) │ │ │ │ -  Create a factory builder that can build a _P_o_w_e_r_P_r_e_B_a_s_i_s. │ │ │ │ +MMaaccrrooss │ │ │ │ +#define  _C_H_E_C_K_S_I_Z_E(X) │ │ │ │ +********** DDeettaaiilleedd DDeessccrriippttiioonn ********** │ │ │ │ +An stl-compliant double-ended queue which stores everything on the stack. │ │ │ │ +********** MMaaccrroo DDeeffiinniittiioonn DDooccuummeennttaattiioonn ********** │ │ │ │ +********** _?◆_? CCHHEECCKKSSIIZZEE ********** │ │ │ │ +#define CHECKSIZE ( XX ) │ │ │ │ +VVaalluuee:: │ │ │ │ +{} │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _p_o_w_e_r_b_a_s_i_s_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _r_e_s_e_r_v_e_d_d_e_q_u_e_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00104.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,5 +1,3 @@ │ │ │ │ var a00104 = [ │ │ │ │ - ["Dune::Functions::PowerPreBasis< IMS, SPB, C >", "a02042.html", "a02042"], │ │ │ │ - ["Dune::Functions::BasisFactory::power", "a00312.html#gab84b622cf7be16d0373640b6f0478eb0", null], │ │ │ │ - ["Dune::Functions::BasisFactory::power", "a00312.html#ga0d8eb549af76bc2563ab189e63668ee5", null] │ │ │ │ + ["CHECKSIZE", "a00104.html#a65543e75bc949ecdb95a25b1f4e11675", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00104_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: powerbasis.hh Source File │ │ │ +Dune-Functions: reserveddeque.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,205 +88,294 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
powerbasis.hh
│ │ │ +
reserveddeque.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH
│ │ │ -
9
│ │ │ -
10#include <dune/common/reservedvector.hh>
│ │ │ -
11#include <dune/common/typeutilities.hh>
│ │ │ -
12#include <dune/common/indices.hh>
│ │ │ +
7#ifndef DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH
│ │ │ +
8#define DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH
│ │ │ +
9
│ │ │
13
│ │ │ -
14#include <dune/common/typetree/nodeconcepts.hh>
│ │ │ -
15
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
24
│ │ │ -
25
│ │ │ +
14#include <algorithm>
│ │ │ +
15#include <iostream>
│ │ │ +
16#include <cstddef>
│ │ │ +
17#include <initializer_list>
│ │ │ +
18
│ │ │ +
19#include <dune/common/genericiterator.hh>
│ │ │ +
20
│ │ │ +
21#ifdef CHECK_RESERVEDDEQUE
│ │ │ +
22#define CHECKSIZE(X) assert(X)
│ │ │ +
23#else
│ │ │ +
24#define CHECKSIZE(X) {}
│ │ │ +
25#endif
│ │ │
26
│ │ │
27namespace Dune {
│ │ │ -
28namespace Functions {
│ │ │ -
29
│ │ │ -
30
│ │ │ -
31// *****************************************************************************
│ │ │ -
32// This is the reusable part of the power bases. It contains
│ │ │ -
33//
│ │ │ -
34// PowerPreBasis
│ │ │ -
35//
│ │ │ -
36// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ -
37// state. These components do _not_ depend on the global basis and local view
│ │ │ -
38// and can be used without a global basis.
│ │ │ -
39// *****************************************************************************
│ │ │ -
40
│ │ │ -
51template<class IMS, class SPB, std::size_t C>
│ │ │ -
│ │ │ - │ │ │ -
53 public DynamicPowerPreBasis<IMS,SPB>
│ │ │ -
54{
│ │ │ - │ │ │ -
56
│ │ │ -
57public:
│ │ │ -
58
│ │ │ -
60 using SubPreBasis = SPB;
│ │ │ -
61
│ │ │ - │ │ │ -
64
│ │ │ -
66 using size_type = typename Base::size_type;
│ │ │ -
67
│ │ │ - │ │ │ +
28namespace Functions {
│ │ │ +
29
│ │ │ +
47 template<class T, int n>
│ │ │ +
│ │ │ + │ │ │ +
49 {
│ │ │ +
50 public:
│ │ │ +
51
│ │ │ +
53
│ │ │ +
55 typedef T value_type;
│ │ │ +
57 typedef T* pointer;
│ │ │ +
59 typedef T& reference;
│ │ │ +
61 typedef const T& const_reference;
│ │ │ +
63 typedef size_t size_type;
│ │ │ +
65 typedef std::ptrdiff_t difference_type;
│ │ │ +
67 typedef Dune::GenericIterator<ReservedDeque, value_type> iterator;
│ │ │ +
69 typedef Dune::GenericIterator<const ReservedDeque, const value_type> const_iterator;
│ │ │
70
│ │ │ -
72 inline static constexpr std::integral_constant<std::size_t,C> children = {};
│ │ │ -
73
│ │ │ -
79 template<class... SFArgs,
│ │ │ -
80 disableCopyMove<PowerPreBasis, SFArgs...> = 0,
│ │ │ -
81 enableIfConstructible<SubPreBasis, SFArgs...> = 0>
│ │ │ -
│ │ │ -
82 explicit PowerPreBasis(SFArgs&&... sfArgs) :
│ │ │ -
83 Base(std::size_t(C), std::forward<SFArgs>(sfArgs)...)
│ │ │ -
84 {}
│ │ │ -
│ │ │ -
85
│ │ │ -
│ │ │ -
89 Node makeNode() const
│ │ │ -
90 {
│ │ │ -
91 Node node{};
│ │ │ -
92 for (std::size_t i=0; i<children(); ++i)
│ │ │ -
93 node.setChild(i, Base::subPreBasis_.makeNode());
│ │ │ -
94 return node;
│ │ │ -
95 }
│ │ │ -
│ │ │ -
96
│ │ │ -
│ │ │ - │ │ │ -
99 {
│ │ │ -
100 return size(Dune::ReservedVector<size_type, Base::multiIndexBufferSize>{});
│ │ │ -
101 }
│ │ │ -
│ │ │ -
102
│ │ │ -
104 template<class SizePrefix>
│ │ │ -
│ │ │ -
105 size_type size(const SizePrefix& prefix) const
│ │ │ -
106 {
│ │ │ - │ │ │ -
108 }
│ │ │ -
│ │ │ -
109
│ │ │ -
111 template<class NodeType, typename It>
│ │ │ -
112 requires Dune::TypeTree::Concept::UniformInnerTreeNode<NodeType>
│ │ │ -
│ │ │ -
113 It indices(const NodeType& node, It it) const
│ │ │ -
114 {
│ │ │ - │ │ │ -
116 }
│ │ │ -
│ │ │ -
117
│ │ │ -
│ │ │ - │ │ │ -
120 {
│ │ │ - │ │ │ -
122 }
│ │ │ -
│ │ │ -
123};
│ │ │ -
│ │ │ -
124
│ │ │ -
125
│ │ │ -
126
│ │ │ -
127namespace BasisFactory {
│ │ │ +
72
│ │ │ +
74
│ │ │ +
│ │ │ + │ │ │ +
77 size_(0),
│ │ │ +
78 first_(0)
│ │ │ +
79 {}
│ │ │ +
│ │ │ +
80
│ │ │ +
│ │ │ +
81 ReservedDeque(std::initializer_list<T> const &l)
│ │ │ +
82 {
│ │ │ +
83 assert(l.size() <= n);// Actually, this is not needed any more!
│ │ │ +
84 size_ = l.size();
│ │ │ +
85 std::copy_n(l.begin(), size_, data_);
│ │ │ +
86 }
│ │ │ +
│ │ │ +
87
│ │ │ +
89
│ │ │ +
91
│ │ │ +
│ │ │ +
93 void clear()
│ │ │ +
94 {
│ │ │ +
95 first_ = 0;
│ │ │ +
96 size_ = 0;
│ │ │ +
97 }
│ │ │ +
│ │ │ +
98
│ │ │ +
│ │ │ +
100 void resize(size_t s)
│ │ │ +
101 {
│ │ │ +
102 CHECKSIZE(s<=n);
│ │ │ +
103 size_ = s;
│ │ │ +
104 }
│ │ │ +
│ │ │ +
105
│ │ │ +
│ │ │ +
107 void push_back(const T& t)
│ │ │ +
108 {
│ │ │ +
109 CHECKSIZE(size_<n);
│ │ │ +
110 data_[size_++ % n] = t;
│ │ │ +
111 }
│ │ │ +
│ │ │ +
112
│ │ │ +
│ │ │ +
114 void push_front(const T& t)
│ │ │ +
115 {
│ │ │ +
116 CHECKSIZE(size_<n);
│ │ │ +
117 ++size_;
│ │ │ +
118 first_ = (first_+(n-1)) % n;
│ │ │ +
119 data_[first_] = t;
│ │ │ +
120 }
│ │ │ +
│ │ │ +
121
│ │ │ +
│ │ │ +
123 void pop_back()
│ │ │ +
124 {
│ │ │ +
125 if (! empty())
│ │ │ +
126 size_--;
│ │ │ +
127 }
│ │ │ +
│ │ │
128
│ │ │ -
140template<std::size_t k, class ChildPreBasisFactory, class IndexMergingStrategy>
│ │ │ -
│ │ │ -
141auto power(ChildPreBasisFactory&& childPreBasisFactory, const IndexMergingStrategy&)
│ │ │ -
142{
│ │ │ -
143 return [childPreBasisFactory](const auto& gridView) {
│ │ │ -
144 auto childPreBasis = childPreBasisFactory(gridView);
│ │ │ - │ │ │ -
146 };
│ │ │ -
147}
│ │ │ +
│ │ │ + │ │ │ +
131 {
│ │ │ +
132 if (! empty())
│ │ │ +
133 {
│ │ │ +
134 size_--;
│ │ │ +
135 first_ = (++first_) % n;
│ │ │ +
136 }
│ │ │ +
137 }
│ │ │ +
│ │ │ +
138
│ │ │ +
│ │ │ + │ │ │ +
141 return iterator(*this, 0);
│ │ │ +
142 }
│ │ │ +
│ │ │ +
143
│ │ │ +
│ │ │ + │ │ │ +
146 return const_iterator(*this, 0);
│ │ │ +
147 }
│ │ │
│ │ │
148
│ │ │ -
159template<std::size_t k, class ChildPreBasisFactory>
│ │ │ -
160[[deprecated("Using the method `power` without an explicit index merging strategy"
│ │ │ -
161 " will change its meaning after the release of dune-functions 2.11."
│ │ │ -
162 " Previously, the default merging strategy was `BlockedInterleaved`,"
│ │ │ -
163 " but this will change to `FlatInterleaved`."
│ │ │ -
164 " Change the call to `power(..., blockedInterleaved())` to retain the old behavior.")]]
│ │ │ -
│ │ │ -
165auto power(ChildPreBasisFactory&& childPreBasisFactory)
│ │ │ -
166{
│ │ │ -
167 return [childPreBasisFactory](const auto& gridView) {
│ │ │ -
168 auto childPreBasis = childPreBasisFactory(gridView);
│ │ │ - │ │ │ -
170 };
│ │ │ -
171}
│ │ │ -
│ │ │ -
172
│ │ │ -
173} // end namespace BasisFactory
│ │ │ -
174
│ │ │ -
175
│ │ │ -
176} // end namespace Functions
│ │ │ -
177} // end namespace Dune
│ │ │ -
178
│ │ │ -
179
│ │ │ -
180#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
Lightweight representation of (hierarchical) size and block structure extracted from a basis to descr...
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
auto power(ChildPreBasisFactory &&childPreBasisFactory, std::size_t k, const IndexMergingStrategy &)
Create a pre-basis factory that can build a PowerPreBasis.
Definition dynamicpowerbasis.hh:410
│ │ │ -
std::enable_if_t< std::is_constructible_v< T, Args... >, int > enableIfConstructible
Helper to constrain forwarding constructors.
Definition type_traits.hh:30
│ │ │ +
│ │ │ + │ │ │ +
151 return iterator(*this, size_);
│ │ │ +
152 }
│ │ │ +
│ │ │ +
153
│ │ │ +
│ │ │ + │ │ │ +
156 return const_iterator(*this, size_);
│ │ │ +
157 }
│ │ │ +
│ │ │ +
158
│ │ │ +
│ │ │ + │ │ │ +
161 {
│ │ │ +
162 CHECKSIZE(size_>i);
│ │ │ +
163 return data_[(first_ + i) % n];
│ │ │ +
164 }
│ │ │ +
│ │ │ +
165
│ │ │ +
│ │ │ + │ │ │ +
168 {
│ │ │ +
169 CHECKSIZE(size_>i);
│ │ │ +
170 return data_[(first_ + i) % n];
│ │ │ +
171 }
│ │ │ +
│ │ │ +
172
│ │ │ +
│ │ │ + │ │ │ +
175 {
│ │ │ +
176 CHECKSIZE(size_>0);
│ │ │ +
177 return data_[first_];
│ │ │ +
178 }
│ │ │ +
│ │ │ +
179
│ │ │ +
│ │ │ + │ │ │ +
182 {
│ │ │ +
183 CHECKSIZE(size_>0);
│ │ │ +
184 return data_[first_];
│ │ │ +
185 }
│ │ │ +
│ │ │ +
186
│ │ │ +
│ │ │ + │ │ │ +
189 {
│ │ │ +
190 CHECKSIZE(size_>0);
│ │ │ +
191 return data_[(first_ + size_-1) % n];
│ │ │ +
192 }
│ │ │ +
│ │ │ +
193
│ │ │ +
│ │ │ + │ │ │ +
196 {
│ │ │ +
197 CHECKSIZE(size_>0);
│ │ │ +
198 return data_[(first_ + size_-1) % n];
│ │ │ +
199 }
│ │ │ +
│ │ │ +
200
│ │ │ +
202
│ │ │ +
204
│ │ │ +
│ │ │ + │ │ │ +
207 {
│ │ │ +
208 return size_;
│ │ │ +
209 }
│ │ │ +
│ │ │ +
210
│ │ │ +
│ │ │ +
212 bool empty() const
│ │ │ +
213 {
│ │ │ +
214 return size_==0;
│ │ │ +
215 }
│ │ │ +
│ │ │ +
216
│ │ │ +
│ │ │ +
218 static constexpr size_type capacity()
│ │ │ +
219 {
│ │ │ +
220 return n;
│ │ │ +
221 }
│ │ │ +
│ │ │ +
222
│ │ │ +
│ │ │ +
224 static constexpr size_type max_size()
│ │ │ +
225 {
│ │ │ +
226 return n;
│ │ │ +
227 }
│ │ │ +
│ │ │ +
228
│ │ │ +
230
│ │ │ +
│ │ │ +
232 friend std::ostream& operator<< (std::ostream& s, const ReservedDeque& v)
│ │ │ +
233 {
│ │ │ +
234 for (size_t i=0; i<v.size(); i++)
│ │ │ +
235 s << v[i] << " ";
│ │ │ +
236 return s;
│ │ │ +
237 }
│ │ │ +
│ │ │ +
238
│ │ │ +
239 private:
│ │ │ +
240 T data_[n];
│ │ │ +
241 size_type first_;
│ │ │ +
242 size_type size_;
│ │ │ +
243 };
│ │ │ +
│ │ │ +
244
│ │ │ +
245} // end namespace Functions
│ │ │ +
246} // end namespace Dune
│ │ │ +
247
│ │ │ +
248#undef CHECKSIZE
│ │ │ +
249
│ │ │ +
250#endif // DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH
│ │ │ +
#define CHECKSIZE(X)
Definition reserveddeque.hh:24
│ │ │
Definition monomialset.hh:19
│ │ │ -
Definition monomialset.hh:19
│ │ │ -
Base class for index merging strategies to simplify detection.
Definition basistags.hh:48
│ │ │ -
std::size_t size_type
Type used for indices and size information.
Definition dynamicpowerbasis.hh:62
│ │ │ -
DynamicPowerPreBasis(std::size_t c, SFArgs &&... sfArgs)
Constructor for given child pre-basis objects.
Definition dynamicpowerbasis.hh:82
│ │ │ -
auto containerDescriptorImpl(Children children) const
Definition dynamicpowerbasis.hh:374
│ │ │ -
size_type sizeImpl(SizePrefix prefix, Children children, BasisFactory::FlatInterleaved) const
Definition dynamicpowerbasis.hh:139
│ │ │ -
SubPreBasis subPreBasis_
Definition dynamicpowerbasis.hh:391
│ │ │ -
It indicesImpl(const NodeType &node, It multiIndices, Children children, BasisFactory::FlatInterleaved) const
Definition dynamicpowerbasis.hh:264
│ │ │ -
Definition nodes.hh:268
│ │ │ -
void setChild(Index i, TT &&t)
Definition nodes.hh:317
│ │ │ -
A pre-basis for power bases.
Definition powerbasis.hh:54
│ │ │ -
IMS IndexMergingStrategy
Strategy used to merge the global indices of the child factories.
Definition powerbasis.hh:69
│ │ │ -
typename Base::size_type size_type
Type used for indices and size information.
Definition powerbasis.hh:66
│ │ │ -
SPB SubPreBasis
The child pre-basis.
Definition powerbasis.hh:60
│ │ │ -
auto containerDescriptor() const
Return the associated container descriptor.
Definition powerbasis.hh:119
│ │ │ -
PowerBasisNode< typename SubPreBasis::Node, C > Node
Template mapping root tree path to type of created tree node.
Definition powerbasis.hh:63
│ │ │ -
PowerPreBasis(SFArgs &&... sfArgs)
Constructor for given child pre-basis objects for static size of the power-basis.
Definition powerbasis.hh:82
│ │ │ -
size_type size() const
Same as size(prefix) with empty prefix.
Definition powerbasis.hh:98
│ │ │ -
Node makeNode() const
Create tree node.
Definition powerbasis.hh:89
│ │ │ -
static constexpr std::integral_constant< std::size_t, C > children
Number of children provided as an integral constant.
Definition powerbasis.hh:72
│ │ │ -
It indices(const NodeType &node, It it) const
Maps from subtree index set [0..size-1] to a globally unique multi index in global basis.
Definition powerbasis.hh:113
│ │ │ -
size_type size(const SizePrefix &prefix) const
Return number of possible values for next position in multi index.
Definition powerbasis.hh:105
│ │ │ - │ │ │ +
void pop_front()
Erases the first element of the vector, O(1) time.
Definition reserveddeque.hh:130
│ │ │ +
static constexpr size_type capacity()
Returns current capacity (allocated memory) of the vector.
Definition reserveddeque.hh:218
│ │ │ +
void clear()
Erases all elements.
Definition reserveddeque.hh:93
│ │ │ +
Dune::GenericIterator< ReservedDeque, value_type > iterator
Iterator used to iterate through a vector.
Definition reserveddeque.hh:67
│ │ │ +
T value_type
The type of object, T, stored in the vector.
Definition reserveddeque.hh:55
│ │ │ +
ReservedDeque()
Constructor.
Definition reserveddeque.hh:76
│ │ │ +
bool empty() const
Returns true if vector has no elements.
Definition reserveddeque.hh:212
│ │ │ +
const_reference back() const
Returns const reference to last element of vector.
Definition reserveddeque.hh:195
│ │ │ +
friend std::ostream & operator<<(std::ostream &s, const ReservedDeque &v)
Send ReservedDeque to an output stream.
Definition reserveddeque.hh:232
│ │ │ +
void push_front(const T &t)
Prepends an element to the begin of a deque if size<capacity, O(1) time.
Definition reserveddeque.hh:114
│ │ │ +
reference operator[](size_type i)
Returns reference to the i'th element.
Definition reserveddeque.hh:160
│ │ │ +
reference front()
Returns reference to first element of vector.
Definition reserveddeque.hh:174
│ │ │ +
T * pointer
Pointer to T.
Definition reserveddeque.hh:57
│ │ │ +
const_reference front() const
Returns const reference to first element of vector.
Definition reserveddeque.hh:181
│ │ │ +
iterator end()
Returns an iterator pointing to the end of the vector.
Definition reserveddeque.hh:150
│ │ │ +
reference back()
Returns reference to last element of vector.
Definition reserveddeque.hh:188
│ │ │ +
void pop_back()
Erases the last element of the vector, O(1) time.
Definition reserveddeque.hh:123
│ │ │ +
const T & const_reference
Const reference to T.
Definition reserveddeque.hh:61
│ │ │ +
static constexpr size_type max_size()
Returns the maximum length of the vector.
Definition reserveddeque.hh:224
│ │ │ +
std::ptrdiff_t difference_type
A signed integral type.
Definition reserveddeque.hh:65
│ │ │ +
T & reference
Reference to T.
Definition reserveddeque.hh:59
│ │ │ +
Dune::GenericIterator< const ReservedDeque, const value_type > const_iterator
Const iterator used to iterate through a vector.
Definition reserveddeque.hh:69
│ │ │ +
size_type size() const
Returns number of elements in the vector.
Definition reserveddeque.hh:206
│ │ │ +
const_iterator end() const
Returns a const_iterator pointing to the end of the vector.
Definition reserveddeque.hh:155
│ │ │ +
void resize(size_t s)
Specifies a new size for the vector.
Definition reserveddeque.hh:100
│ │ │ +
iterator begin()
Returns a iterator pointing to the beginning of the vector.
Definition reserveddeque.hh:140
│ │ │ +
const_iterator begin() const
Returns a const_iterator pointing to the beginning of the vector.
Definition reserveddeque.hh:145
│ │ │ +
ReservedDeque(std::initializer_list< T > const &l)
Definition reserveddeque.hh:81
│ │ │ +
size_t size_type
An unsigned integral type.
Definition reserveddeque.hh:63
│ │ │ +
void push_back(const T &t)
Appends an element to the end of a vector, up to the maximum size n, O(1) time.
Definition reserveddeque.hh:107
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,257 +1,330 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -powerbasis.hh │ │ │ │ +reserveddeque.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH │ │ │ │ +8#define DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ -12#include │ │ │ │ 13 │ │ │ │ -14#include │ │ │ │ -15 │ │ │ │ -16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ -17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ -18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_b_a_s_i_s_t_a_g_s_._h_h> │ │ │ │ -19#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_y_n_a_m_i_c_p_o_w_e_r_b_a_s_i_s_._h_h> │ │ │ │ -20#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -21#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ -22#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h> │ │ │ │ -23#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ -24 │ │ │ │ -25 │ │ │ │ +14#include │ │ │ │ +15#include │ │ │ │ +16#include │ │ │ │ +17#include │ │ │ │ +18 │ │ │ │ +19#include │ │ │ │ +20 │ │ │ │ +21#ifdef CHECK_RESERVEDDEQUE │ │ │ │ +22#define CHECKSIZE(X) assert(X) │ │ │ │ +23#else │ │ │ │ +_2_4#define CHECKSIZE(X) {} │ │ │ │ +25#endif │ │ │ │ 26 │ │ │ │ 27namespace _D_u_n_e { │ │ │ │ -28namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +28namespace Functions { │ │ │ │ 29 │ │ │ │ -30 │ │ │ │ -31/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -32// This is the reusable part of the power bases. It contains │ │ │ │ -33// │ │ │ │ -34// PowerPreBasis │ │ │ │ -35// │ │ │ │ -36// The pre-basis allows to create the others and is the owner of possible │ │ │ │ -shared │ │ │ │ -37// state. These components do _not_ depend on the global basis and local view │ │ │ │ -38// and can be used without a global basis. │ │ │ │ -39/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -40 │ │ │ │ -51template │ │ │ │ -_5_2class _P_o_w_e_r_P_r_e_B_a_s_i_s : │ │ │ │ -53 public _D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s │ │ │ │ -54{ │ │ │ │ -55 using Base = _D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_<_I_M_S_,_S_P_B_>; │ │ │ │ -56 │ │ │ │ -57public: │ │ │ │ -58 │ │ │ │ -_6_0 using _S_u_b_P_r_e_B_a_s_i_s = SPB; │ │ │ │ -61 │ │ │ │ -_6_3 using _N_o_d_e = _P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_t_y_p_e_n_a_m_e_ _S_u_b_P_r_e_B_a_s_i_s_:_:_N_o_d_e_,_ _C_>; │ │ │ │ -64 │ │ │ │ -_6_6 using _s_i_z_e___t_y_p_e = typename _B_a_s_e_:_:_s_i_z_e___t_y_p_e; │ │ │ │ -67 │ │ │ │ -_6_9 using _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y = IMS; │ │ │ │ +47 template │ │ │ │ +_4_8 class _R_e_s_e_r_v_e_d_D_e_q_u_e │ │ │ │ +49 { │ │ │ │ +50 public: │ │ │ │ +51 │ │ │ │ +53 │ │ │ │ +_5_5 typedef T _v_a_l_u_e___t_y_p_e; │ │ │ │ +_5_7 typedef T* _p_o_i_n_t_e_r; │ │ │ │ +_5_9 typedef T& _r_e_f_e_r_e_n_c_e; │ │ │ │ +_6_1 typedef const T& _c_o_n_s_t___r_e_f_e_r_e_n_c_e; │ │ │ │ +_6_3 typedef size_t _s_i_z_e___t_y_p_e; │ │ │ │ +_6_5 typedef std::ptrdiff_t _d_i_f_f_e_r_e_n_c_e___t_y_p_e; │ │ │ │ +_6_7 typedef Dune::GenericIterator _i_t_e_r_a_t_o_r; │ │ │ │ +_6_9 typedef Dune::GenericIterator │ │ │ │ +_c_o_n_s_t___i_t_e_r_a_t_o_r; │ │ │ │ 70 │ │ │ │ -_7_2 inline static constexpr std::integral_constant _c_h_i_l_d_r_e_n = {}; │ │ │ │ -73 │ │ │ │ -79 template = 0, │ │ │ │ -81 _e_n_a_b_l_e_I_f_C_o_n_s_t_r_u_c_t_i_b_l_e<_S_u_b_P_r_e_B_a_s_i_s, SFArgs...> = 0> │ │ │ │ -_8_2 explicit _P_o_w_e_r_P_r_e_B_a_s_i_s(SFArgs&&... sfArgs) : │ │ │ │ -83 Base(std::size_t(C), std::forward(sfArgs)...) │ │ │ │ -84 {} │ │ │ │ -85 │ │ │ │ -_8_9 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ -90 { │ │ │ │ -91 _N_o_d_e node{}; │ │ │ │ -92 for (std::size_t i=0; i<_c_h_i_l_d_r_e_n(); ++i) │ │ │ │ -93 node._s_e_t_C_h_i_l_d(i, _B_a_s_e_:_:_s_u_b_P_r_e_B_a_s_i_s__.makeNode()); │ │ │ │ -94 return node; │ │ │ │ -95 } │ │ │ │ -96 │ │ │ │ -_9_8 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ -99 { │ │ │ │ -100 return _s_i_z_e(Dune::ReservedVector{}); │ │ │ │ -101 } │ │ │ │ -102 │ │ │ │ -104 template │ │ │ │ -_1_0_5 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix) const │ │ │ │ -106 { │ │ │ │ -107 return _B_a_s_e_:_:_s_i_z_e_I_m_p_l(prefix, _c_h_i_l_d_r_e_n, _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y{}); │ │ │ │ -108 } │ │ │ │ -109 │ │ │ │ -111 template │ │ │ │ -112 requires Dune::TypeTree::Concept::UniformInnerTreeNode │ │ │ │ -_1_1_3 It _i_n_d_i_c_e_s(const NodeType& node, It it) const │ │ │ │ -114 { │ │ │ │ -115 return _B_a_s_e_:_:_i_n_d_i_c_e_s_I_m_p_l(node, it, _c_h_i_l_d_r_e_n, _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y{}); │ │ │ │ -116 } │ │ │ │ -117 │ │ │ │ -_1_1_9 auto _c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r() const │ │ │ │ -120 { │ │ │ │ -121 return _B_a_s_e_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_I_m_p_l(_c_h_i_l_d_r_e_n); │ │ │ │ -122 } │ │ │ │ -123}; │ │ │ │ -124 │ │ │ │ -125 │ │ │ │ -126 │ │ │ │ -127namespace BasisFactory { │ │ │ │ +72 │ │ │ │ +74 │ │ │ │ +_7_6 _R_e_s_e_r_v_e_d_D_e_q_u_e() : │ │ │ │ +77 size_(0), │ │ │ │ +78 first_(0) │ │ │ │ +79 {} │ │ │ │ +80 │ │ │ │ +_8_1 _R_e_s_e_r_v_e_d_D_e_q_u_e(std::initializer_list const &l) │ │ │ │ +82 { │ │ │ │ +83 assert(l.size() <= n);// Actually, this is not needed any more! │ │ │ │ +84 size_ = l.size(); │ │ │ │ +85 std::copy_n(l.begin(), size_, data_); │ │ │ │ +86 } │ │ │ │ +87 │ │ │ │ +89 │ │ │ │ +91 │ │ │ │ +_9_3 void _c_l_e_a_r() │ │ │ │ +94 { │ │ │ │ +95 first_ = 0; │ │ │ │ +96 size_ = 0; │ │ │ │ +97 } │ │ │ │ +98 │ │ │ │ +_1_0_0 void _r_e_s_i_z_e(size_t s) │ │ │ │ +101 { │ │ │ │ +102 _C_H_E_C_K_S_I_Z_E(s<=n); │ │ │ │ +103 size_ = s; │ │ │ │ +104 } │ │ │ │ +105 │ │ │ │ +_1_0_7 void _p_u_s_h___b_a_c_k(const T& t) │ │ │ │ +108 { │ │ │ │ +109 _C_H_E_C_K_S_I_Z_E(size_ │ │ │ │ -_1_4_1auto _p_o_w_e_r(ChildPreBasisFactory&& childPreBasisFactory, const │ │ │ │ -_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y&) │ │ │ │ -142{ │ │ │ │ -143 return [childPreBasisFactory](const auto& gridView) { │ │ │ │ -144 auto childPreBasis = childPreBasisFactory(gridView); │ │ │ │ -145 return _P_o_w_e_r_P_r_e_B_a_s_i_s_<_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y_,_ _d_e_c_l_t_y_p_e_(_c_h_i_l_d_P_r_e_B_a_s_i_s_)_,_ _k_> │ │ │ │ -(std::move(childPreBasis)); │ │ │ │ -146 }; │ │ │ │ -147} │ │ │ │ +_1_3_0 void _p_o_p___f_r_o_n_t() │ │ │ │ +131 { │ │ │ │ +132 if (! _e_m_p_t_y()) │ │ │ │ +133 { │ │ │ │ +134 size_--; │ │ │ │ +135 first_ = (++first_) % n; │ │ │ │ +136 } │ │ │ │ +137 } │ │ │ │ +138 │ │ │ │ +_1_4_0 _i_t_e_r_a_t_o_r _b_e_g_i_n(){ │ │ │ │ +141 return _i_t_e_r_a_t_o_r(*this, 0); │ │ │ │ +142 } │ │ │ │ +143 │ │ │ │ +_1_4_5 _c_o_n_s_t___i_t_e_r_a_t_o_r _b_e_g_i_n() const { │ │ │ │ +146 return _c_o_n_s_t___i_t_e_r_a_t_o_r(*this, 0); │ │ │ │ +147 } │ │ │ │ 148 │ │ │ │ -159template │ │ │ │ -160[[deprecated("Using the method `power` without an explicit index merging │ │ │ │ -strategy" │ │ │ │ -161 " will change its meaning after the release of dune-functions 2.11." │ │ │ │ -162 " Previously, the default merging strategy was `BlockedInterleaved`," │ │ │ │ -163 " but this will change to `FlatInterleaved`." │ │ │ │ -164 " Change the call to `power(..., blockedInterleaved())` to retain the old │ │ │ │ -behavior.")]] │ │ │ │ -_1_6_5auto _p_o_w_e_r(ChildPreBasisFactory&& childPreBasisFactory) │ │ │ │ -166{ │ │ │ │ -167 return [childPreBasisFactory](const auto& gridView) { │ │ │ │ -168 auto childPreBasis = childPreBasisFactory(gridView); │ │ │ │ -169 return _P_o_w_e_r_P_r_e_B_a_s_i_s_<_B_l_o_c_k_e_d_I_n_t_e_r_l_e_a_v_e_d_,_ _d_e_c_l_t_y_p_e_(_c_h_i_l_d_P_r_e_B_a_s_i_s_)_,_ _k_>(std:: │ │ │ │ -move(childPreBasis)); │ │ │ │ -170 }; │ │ │ │ -171} │ │ │ │ +_1_5_0 _i_t_e_r_a_t_o_r _e_n_d(){ │ │ │ │ +151 return _i_t_e_r_a_t_o_r(*this, size_); │ │ │ │ +152 } │ │ │ │ +153 │ │ │ │ +_1_5_5 _c_o_n_s_t___i_t_e_r_a_t_o_r _e_n_d() const { │ │ │ │ +156 return _c_o_n_s_t___i_t_e_r_a_t_o_r(*this, size_); │ │ │ │ +157 } │ │ │ │ +158 │ │ │ │ +_1_6_0 _r_e_f_e_r_e_n_c_e _o_p_e_r_a_t_o_r_[_]_ (_s_i_z_e___t_y_p_e i) │ │ │ │ +161 { │ │ │ │ +162 _C_H_E_C_K_S_I_Z_E(size_>i); │ │ │ │ +163 return data_[(first_ + i) % n]; │ │ │ │ +164 } │ │ │ │ +165 │ │ │ │ +_1_6_7 _c_o_n_s_t___r_e_f_e_r_e_n_c_e _o_p_e_r_a_t_o_r_[_]_ (_s_i_z_e___t_y_p_e i) const │ │ │ │ +168 { │ │ │ │ +169 _C_H_E_C_K_S_I_Z_E(size_>i); │ │ │ │ +170 return data_[(first_ + i) % n]; │ │ │ │ +171 } │ │ │ │ 172 │ │ │ │ -173} // end namespace BasisFactory │ │ │ │ -174 │ │ │ │ -175 │ │ │ │ -176} // end namespace Functions │ │ │ │ -177} // end namespace Dune │ │ │ │ -178 │ │ │ │ +_1_7_4 _r_e_f_e_r_e_n_c_e _f_r_o_n_t() │ │ │ │ +175 { │ │ │ │ +176 _C_H_E_C_K_S_I_Z_E(size_>0); │ │ │ │ +177 return data_[first_]; │ │ │ │ +178 } │ │ │ │ 179 │ │ │ │ -180#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH │ │ │ │ -_n_o_d_e_s_._h_h │ │ │ │ -_d_y_n_a_m_i_c_p_o_w_e_r_b_a_s_i_s_._h_h │ │ │ │ -_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ -_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h │ │ │ │ -Lightweight representation of (hierarchical) size and block structure extracted │ │ │ │ -from a basis to descr... │ │ │ │ -_b_a_s_i_s_t_a_g_s_._h_h │ │ │ │ -_u_t_i_l_i_t_y_._h_h │ │ │ │ -_t_y_p_e___t_r_a_i_t_s_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_p_o_w_e_r │ │ │ │ -auto power(ChildPreBasisFactory &&childPreBasisFactory, std::size_t k, const │ │ │ │ -IndexMergingStrategy &) │ │ │ │ -Create a pre-basis factory that can build a PowerPreBasis. │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:410 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_e_n_a_b_l_e_I_f_C_o_n_s_t_r_u_c_t_i_b_l_e │ │ │ │ -std::enable_if_t< std::is_constructible_v< T, Args... >, int > │ │ │ │ -enableIfConstructible │ │ │ │ -Helper to constrain forwarding constructors. │ │ │ │ -DDeeffiinniittiioonn type_traits.hh:30 │ │ │ │ +_1_8_1 _c_o_n_s_t___r_e_f_e_r_e_n_c_e _f_r_o_n_t() const │ │ │ │ +182 { │ │ │ │ +183 _C_H_E_C_K_S_I_Z_E(size_>0); │ │ │ │ +184 return data_[first_]; │ │ │ │ +185 } │ │ │ │ +186 │ │ │ │ +_1_8_8 _r_e_f_e_r_e_n_c_e _b_a_c_k() │ │ │ │ +189 { │ │ │ │ +190 _C_H_E_C_K_S_I_Z_E(size_>0); │ │ │ │ +191 return data_[(first_ + size_-1) % n]; │ │ │ │ +192 } │ │ │ │ +193 │ │ │ │ +_1_9_5 _c_o_n_s_t___r_e_f_e_r_e_n_c_e _b_a_c_k() const │ │ │ │ +196 { │ │ │ │ +197 _C_H_E_C_K_S_I_Z_E(size_>0); │ │ │ │ +198 return data_[(first_ + size_-1) % n]; │ │ │ │ +199 } │ │ │ │ +200 │ │ │ │ +202 │ │ │ │ +204 │ │ │ │ +_2_0_6 _s_i_z_e___t_y_p_e _s_i_z_e () const │ │ │ │ +207 { │ │ │ │ +208 return size_; │ │ │ │ +209 } │ │ │ │ +210 │ │ │ │ +_2_1_2 bool _e_m_p_t_y() const │ │ │ │ +213 { │ │ │ │ +214 return size_==0; │ │ │ │ +215 } │ │ │ │ +216 │ │ │ │ +_2_1_8 static constexpr _s_i_z_e___t_y_p_e _c_a_p_a_c_i_t_y() │ │ │ │ +219 { │ │ │ │ +220 return n; │ │ │ │ +221 } │ │ │ │ +222 │ │ │ │ +_2_2_4 static constexpr _s_i_z_e___t_y_p_e _m_a_x___s_i_z_e() │ │ │ │ +225 { │ │ │ │ +226 return n; │ │ │ │ +227 } │ │ │ │ +228 │ │ │ │ +230 │ │ │ │ +_2_3_2 friend std::ostream& _o_p_e_r_a_t_o_r_<_<_ (std::ostream& s, const _R_e_s_e_r_v_e_d_D_e_q_u_e& v) │ │ │ │ +233 { │ │ │ │ +234 for (size_t i=0; i Node │ │ │ │ -Template mapping root tree path to type of created tree node. │ │ │ │ -DDeeffiinniittiioonn powerbasis.hh:63 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_P_o_w_e_r_P_r_e_B_a_s_i_s │ │ │ │ -PowerPreBasis(SFArgs &&... sfArgs) │ │ │ │ -Constructor for given child pre-basis objects for static size of the power- │ │ │ │ -basis. │ │ │ │ -DDeeffiinniittiioonn powerbasis.hh:82 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_p_o_p___f_r_o_n_t │ │ │ │ +void pop_front() │ │ │ │ +Erases the first element of the vector, O(1) time. │ │ │ │ +DDeeffiinniittiioonn reserveddeque.hh:130 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_c_a_p_a_c_i_t_y │ │ │ │ +static constexpr size_type capacity() │ │ │ │ +Returns current capacity (allocated memory) of the vector. │ │ │ │ +DDeeffiinniittiioonn reserveddeque.hh:218 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_c_l_e_a_r │ │ │ │ +void clear() │ │ │ │ +Erases all elements. │ │ │ │ +DDeeffiinniittiioonn reserveddeque.hh:93 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_i_t_e_r_a_t_o_r │ │ │ │ +Dune::GenericIterator< ReservedDeque, value_type > iterator │ │ │ │ +Iterator used to iterate through a vector. │ │ │ │ +DDeeffiinniittiioonn reserveddeque.hh:67 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_v_a_l_u_e___t_y_p_e │ │ │ │ +T value_type │ │ │ │ +The type of object, T, stored in the vector. │ │ │ │ +DDeeffiinniittiioonn reserveddeque.hh:55 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e │ │ │ │ +ReservedDeque() │ │ │ │ +Constructor. │ │ │ │ +DDeeffiinniittiioonn reserveddeque.hh:76 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_e_m_p_t_y │ │ │ │ +bool empty() const │ │ │ │ +Returns true if vector has no elements. │ │ │ │ +DDeeffiinniittiioonn reserveddeque.hh:212 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_b_a_c_k │ │ │ │ +const_reference back() const │ │ │ │ +Returns const reference to last element of vector. │ │ │ │ +DDeeffiinniittiioonn reserveddeque.hh:195 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_o_p_e_r_a_t_o_r_<_< │ │ │ │ +friend std::ostream & operator<<(std::ostream &s, const ReservedDeque &v) │ │ │ │ +Send ReservedDeque to an output stream. │ │ │ │ +DDeeffiinniittiioonn reserveddeque.hh:232 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_p_u_s_h___f_r_o_n_t │ │ │ │ +void push_front(const T &t) │ │ │ │ +Prepends an element to the begin of a deque if size const_iterator │ │ │ │ +Const iterator used to iterate through a vector. │ │ │ │ +DDeeffiinniittiioonn reserveddeque.hh:69 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_s_i_z_e │ │ │ │ size_type size() const │ │ │ │ -Same as size(prefix) with empty prefix. │ │ │ │ -DDeeffiinniittiioonn powerbasis.hh:98 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_m_a_k_e_N_o_d_e │ │ │ │ -Node makeNode() const │ │ │ │ -Create tree node. │ │ │ │ -DDeeffiinniittiioonn powerbasis.hh:89 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_c_h_i_l_d_r_e_n │ │ │ │ -static constexpr std::integral_constant< std::size_t, C > children │ │ │ │ -Number of children provided as an integral constant. │ │ │ │ -DDeeffiinniittiioonn powerbasis.hh:72 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_i_n_d_i_c_e_s │ │ │ │ -It indices(const NodeType &node, It it) const │ │ │ │ -Maps from subtree index set [0..size-1] to a globally unique multi index in │ │ │ │ -global basis. │ │ │ │ -DDeeffiinniittiioonn powerbasis.hh:113 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ -size_type size(const SizePrefix &prefix) const │ │ │ │ -Return number of possible values for next position in multi index. │ │ │ │ -DDeeffiinniittiioonn powerbasis.hh:105 │ │ │ │ -_c_o_n_c_e_p_t_s_._h_h │ │ │ │ +Returns number of elements in the vector. │ │ │ │ +DDeeffiinniittiioonn reserveddeque.hh:206 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_e_n_d │ │ │ │ +const_iterator end() const │ │ │ │ +Returns a const_iterator pointing to the end of the vector. │ │ │ │ +DDeeffiinniittiioonn reserveddeque.hh:155 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_r_e_s_i_z_e │ │ │ │ +void resize(size_t s) │ │ │ │ +Specifies a new size for the vector. │ │ │ │ +DDeeffiinniittiioonn reserveddeque.hh:100 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_b_e_g_i_n │ │ │ │ +iterator begin() │ │ │ │ +Returns a iterator pointing to the beginning of the vector. │ │ │ │ +DDeeffiinniittiioonn reserveddeque.hh:140 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_b_e_g_i_n │ │ │ │ +const_iterator begin() const │ │ │ │ +Returns a const_iterator pointing to the beginning of the vector. │ │ │ │ +DDeeffiinniittiioonn reserveddeque.hh:145 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e │ │ │ │ +ReservedDeque(std::initializer_list< T > const &l) │ │ │ │ +DDeeffiinniittiioonn reserveddeque.hh:81 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_s_i_z_e___t_y_p_e │ │ │ │ +size_t size_type │ │ │ │ +An unsigned integral type. │ │ │ │ +DDeeffiinniittiioonn reserveddeque.hh:63 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_p_u_s_h___b_a_c_k │ │ │ │ +void push_back(const T &t) │ │ │ │ +Appends an element to the end of a vector, up to the maximum size n, O(1) time. │ │ │ │ +DDeeffiinniittiioonn reserveddeque.hh:107 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _p_o_w_e_r_b_a_s_i_s_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _r_e_s_e_r_v_e_d_d_e_q_u_e_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00107.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: periodicbasis.hh File Reference │ │ │ +Dune-Functions: multiindex.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,58 +88,55 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
periodicbasis.hh File Reference
│ │ │ +
multiindex.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <utility>
│ │ │ -#include <type_traits>
│ │ │ -#include <limits>
│ │ │ -#include <set>
│ │ │ -#include <vector>
│ │ │ -#include <dune/functions/functionspacebases/concepts.hh>
│ │ │ -#include <dune/functions/functionspacebases/containerdescriptors.hh>
│ │ │ -#include <dune/functions/functionspacebases/transformedindexbasis.hh>
│ │ │ +
#include <cstddef>
│ │ │ +#include <array>
│ │ │ +#include <iostream>
│ │ │ +#include <ostream>
│ │ │ +#include <dune/common/hash.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::BasisFactory::Experimental::PeriodicIndexSet
 Container storing identified indices for a periodic basis. More...
class  Dune::Functions::StaticMultiIndex< size_type, n >
 A statically sized MultiIndex type. More...
class  Dune::Functions::StaticMultiIndex< size_type, 1 >
 A statically sized MultiIndex type. More...
struct  std::tuple_size< Dune::Functions::StaticMultiIndex< size_type, n > >
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::BasisFactory
namespace  Dune::Functions::BasisFactory::Experimental
│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │

│ │ │ Functions

template<class RawPreBasisIndicator, class PIS>
auto Dune::Functions::BasisFactory::Experimental::periodic (RawPreBasisIndicator &&rawPreBasisIndicator, PIS &&periodicIndexSet)
 Create a pre-basis factory that can create a periodic pre-basis.
template<class size_type, std::size_t n>
std::ostream & Dune::Functions::operator<< (std::ostream &stream, const StaticMultiIndex< size_type, n > &c)
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,32 +1,29 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -periodicbasis.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_t_r_a_n_s_f_o_r_m_e_d_i_n_d_e_x_b_a_s_i_s_._h_h> │ │ │ │ +multiindex.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_P_e_r_i_o_d_i_c_I_n_d_e_x_S_e_t │ │ │ │ -  Container storing identified indices for a periodic basis. _M_o_r_e_._._. │ │ │ │ + class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x_<_ _s_i_z_e___t_y_p_e_,_ _n_ _> │ │ │ │ +  A statically sized MultiIndex type. _M_o_r_e_._._. │ │ │ │ + class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x_<_ _s_i_z_e___t_y_p_e_,_ _1_ _> │ │ │ │ +  A statically sized MultiIndex type. _M_o_r_e_._._. │ │ │ │ +struct   _s_t_d_:_:_t_u_p_l_e___s_i_z_e_<_ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x_<_ _s_i_z_e___t_y_p_e_,_ _n_ _>_ _> │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l │ │ │ │ FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_p_e_r_i_o_d_i_c │ │ │ │ - (RawPreBasisIndicator &&rawPreBasisIndicator, PIS &&periodicIndexSet) │ │ │ │ -  Create a pre-basis factory that can create a periodic pre-basis. │ │ │ │ +template │ │ │ │ +std::ostream &  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_o_p_e_r_a_t_o_r_<_< (std::ostream &stream, const │ │ │ │ + _S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x< size_type, n > &c) │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _p_e_r_i_o_d_i_c_b_a_s_i_s_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _m_u_l_t_i_i_n_d_e_x_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00107.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,4 +1,6 @@ │ │ │ │ var a00107 = [ │ │ │ │ - ["Dune::Functions::BasisFactory::Experimental::PeriodicIndexSet", "a02030.html", "a02030"], │ │ │ │ - ["Dune::Functions::BasisFactory::Experimental::periodic", "a00312.html#ga797d4c1dfcfe6b0a98de9284c4f6b5e3", null] │ │ │ │ + ["Dune::Functions::StaticMultiIndex< size_type, n >", "a01406.html", "a01406"], │ │ │ │ + ["Dune::Functions::StaticMultiIndex< size_type, 1 >", "a01410.html", "a01410"], │ │ │ │ + ["std::tuple_size< Dune::Functions::StaticMultiIndex< size_type, n > >", "a01414.html", null], │ │ │ │ + ["Dune::Functions::operator<<", "a00318.html#a6f484615f50c48002eaf30ed99750d64", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00107_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: periodicbasis.hh Source File │ │ │ +Dune-Functions: multiindex.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,234 +88,129 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
periodicbasis.hh
│ │ │ +
multiindex.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_PERIODICBASIS_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_PERIODICBASIS_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH
│ │ │ +
8#define DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH
│ │ │
9
│ │ │ -
10#include <utility>
│ │ │ -
11#include <type_traits>
│ │ │ -
12#include <limits>
│ │ │ -
13#include <set>
│ │ │ -
14#include <vector>
│ │ │ -
15
│ │ │ - │ │ │ - │ │ │ - │ │ │ +
10#include <cstddef>
│ │ │ +
11#include <array>
│ │ │ +
12#include <iostream>
│ │ │ +
13#include <ostream>
│ │ │ +
14
│ │ │ +
15#include <dune/common/hash.hh>
│ │ │ +
16
│ │ │ +
17
│ │ │ +
18namespace Dune::Functions {
│ │ │
19
│ │ │
20
│ │ │ -
21namespace Dune::Functions {
│ │ │ -
22
│ │ │ -
23namespace BasisFactory {
│ │ │ -
24
│ │ │ -
25// The PeriodicBasis class is in the Experimental namespace because we are
│ │ │ -
26// not completely sure yet whether we like it. We reserve the right to
│ │ │ -
27// modify it without advance warning. Use at your own risk!
│ │ │ -
28
│ │ │ -
│ │ │ -
29namespace Experimental {
│ │ │ -
30
│ │ │ -
31
│ │ │ -
│ │ │ - │ │ │ -
41{
│ │ │ -
42 using IndexPairSet = std::set<std::pair<std::size_t,std::size_t>>;
│ │ │ -
43public:
│ │ │ -
44
│ │ │ -
│ │ │ -
52 void unifyIndexPair(std::size_t a, std::size_t b)
│ │ │ -
53 {
│ │ │ -
54 if (a>b)
│ │ │ -
55 std::swap(a,b);
│ │ │ -
56 if (a==b)
│ │ │ -
57 return;
│ │ │ -
58 indexPairSet_.insert(std::make_pair(a,b));
│ │ │ -
59 }
│ │ │ -
│ │ │ +
21
│ │ │ +
27template<class size_type, std::size_t n>
│ │ │ +
│ │ │ + │ │ │ +
29 public std::array<size_type, n>
│ │ │ +
30{
│ │ │ +
31public:
│ │ │ +
32 static constexpr std::size_t size() { return n; }
│ │ │ +
33 static constexpr std::size_t max_size() { return n; }
│ │ │ +
34
│ │ │ +
│ │ │ +
35 inline friend std::size_t hash_value(const StaticMultiIndex& v) noexcept {
│ │ │ +
36 return hash_range(v.begin(), v.end());
│ │ │ +
37 }
│ │ │ +
│ │ │ +
38
│ │ │ +
39};
│ │ │ +
│ │ │ +
40
│ │ │ +
41
│ │ │ +
42
│ │ │ +
52template<class size_type>
│ │ │ +
│ │ │ +
53class StaticMultiIndex<size_type,1> :
│ │ │ +
54 public std::array<size_type, 1>
│ │ │ +
55{
│ │ │ +
56public:
│ │ │ +
57
│ │ │ +
58 static constexpr std::size_t size() { return 1; }
│ │ │ +
59 static constexpr std::size_t max_size() { return 1; }
│ │ │
60
│ │ │ -
│ │ │ -
61 const auto& indexPairSet() const
│ │ │ -
62 {
│ │ │ -
63 return indexPairSet_;
│ │ │ +
61
│ │ │ +
│ │ │ +
62 operator const size_type& () const {
│ │ │ +
63 return (*this)[0];
│ │ │
64 }
│ │ │
│ │ │
65
│ │ │ -
66private:
│ │ │ -
67 IndexPairSet indexPairSet_;
│ │ │ -
68};
│ │ │ +
│ │ │ +
66 inline friend std::size_t hash_value(const StaticMultiIndex& v) noexcept {
│ │ │ +
67 return hash_range(v.begin(), v.end());
│ │ │ +
68 }
│ │ │
│ │ │
69
│ │ │ -
70
│ │ │ -
71
│ │ │ -
72namespace Impl {
│ │ │ +
│ │ │ +
70 operator size_type& () {
│ │ │ +
71 return (*this)[0];
│ │ │ +
72 }
│ │ │ +
│ │ │
73
│ │ │ -
74// An index transformation for a TransformedIndexPreBasis
│ │ │ -
75// implementing periodic functions by merging indices.
│ │ │ -
76// Currently only flat indices are supported.
│ │ │ -
77class PeriodicIndexingTransformation
│ │ │ -
78{
│ │ │ -
79public:
│ │ │ -
80
│ │ │ -
81 static constexpr std::size_t minIndexSize = 1;
│ │ │ -
82 static constexpr std::size_t maxIndexSize = 1;
│ │ │ -
83
│ │ │ -
84 template<class RawPreBasis, class IndexPairSet>
│ │ │ -
85 PeriodicIndexingTransformation(const RawPreBasis& rawPreBasis, const IndexPairSet& indexPairSet)
│ │ │ -
86 {
│ │ │ -
87 static_assert(RawPreBasis::maxMultiIndexSize==1, "PeriodicIndexingTransformation is only implemented for flat multi-indices");
│ │ │ -
88 std::size_t invalid = {std::numeric_limits<std::size_t>::max()};
│ │ │ -
89 mappedIdx_.resize(rawPreBasis.size(), invalid);
│ │ │ -
90 numIndices_ = 0;
│ │ │ -
91 std::size_t i = 0;
│ │ │ -
92 for(const auto& [a, b] : indexPairSet)
│ │ │ -
93 {
│ │ │ -
94 for(; i<=a; ++i)
│ │ │ -
95 if (mappedIdx_[i] == invalid)
│ │ │ -
96 mappedIdx_[i] = numIndices_++;
│ │ │ -
97 mappedIdx_[b] = mappedIdx_[a];
│ │ │ -
98 }
│ │ │ -
99 for(; i<rawPreBasis.size(); ++i)
│ │ │ -
100 if (mappedIdx_[i] == invalid)
│ │ │ -
101 mappedIdx_[i] = numIndices_++;
│ │ │ -
102 }
│ │ │ -
103
│ │ │ -
104 template<class MultiIndex, class PreBasis>
│ │ │ -
105 void transformIndex(MultiIndex& multiIndex, const PreBasis& preBasis) const
│ │ │ -
106 {
│ │ │ -
107 multiIndex = {{ mappedIdx_[multiIndex[0]] }};
│ │ │ -
108 }
│ │ │ -
109
│ │ │ -
110 template<class Prefix, class PreBasis>
│ │ │ -
111 std::size_t size(const Prefix& prefix, const PreBasis& preBasis) const
│ │ │ -
112 {
│ │ │ -
113 if (prefix.size() == 1)
│ │ │ -
114 return 0;
│ │ │ -
115 return numIndices_;
│ │ │ -
116 }
│ │ │ -
117
│ │ │ -
118 template<class PreBasis>
│ │ │ -
119 auto dimension(const PreBasis& preBasis) const
│ │ │ -
120 {
│ │ │ -
121 return numIndices_;
│ │ │ -
122 }
│ │ │ -
123
│ │ │ -
125 template<class PreBasis>
│ │ │ -
126 auto containerDescriptor(const PreBasis& preBasis) const
│ │ │ -
127 {
│ │ │ - │ │ │ -
129 }
│ │ │ -
130
│ │ │ -
131private:
│ │ │ -
132 std::vector<std::size_t> mappedIdx_;
│ │ │ -
133 std::size_t numIndices_;
│ │ │ -
134};
│ │ │ -
135
│ │ │ -
136
│ │ │ -
137
│ │ │ -
138template<class RawPreBasisIndicator>
│ │ │ -
139class PeriodicPreBasisFactory
│ │ │ -
140{
│ │ │ -
141public:
│ │ │ -
142 PeriodicPreBasisFactory()
│ │ │ -
143 {}
│ │ │ -
144
│ │ │ -
145 template<class RPBI, class PIS>
│ │ │ -
146 PeriodicPreBasisFactory(RPBI&& rawPreBasisIndicator, PIS&& periodicIndexSet) :
│ │ │ -
147 rawPreBasisIndicator_(std::forward<RPBI>(rawPreBasisIndicator)),
│ │ │ -
148 periodicIndexSet_(std::forward<PIS>(periodicIndexSet))
│ │ │ -
149 {}
│ │ │ -
150
│ │ │ -
151 template<class GridView,
│ │ │ -
152 std::enable_if_t<models<Concept::GlobalBasis<GridView>,RawPreBasisIndicator>(), int> = 0>
│ │ │ -
153 auto operator()(const GridView& gridView) const
│ │ │ -
154 {
│ │ │ -
155 const auto& rawPreBasis = rawPreBasisIndicator_.preBasis();
│ │ │ -
156 auto transformation = PeriodicIndexingTransformation(rawPreBasis, periodicIndexSet_.indexPairSet());
│ │ │ -
157 return Dune::Functions::Experimental::TransformedIndexPreBasis(std::move(rawPreBasis), std::move(transformation));
│ │ │ -
158 }
│ │ │ -
159
│ │ │ -
160 template<class GridView,
│ │ │ -
161 std::enable_if_t<models<Concept::PreBasis<GridView>,RawPreBasisIndicator>(), int> = 0>
│ │ │ -
162 auto operator()(const GridView& gridView) const
│ │ │ -
163 {
│ │ │ -
164 const auto& rawPreBasis = rawPreBasisIndicator_;
│ │ │ -
165 auto transformation = PeriodicIndexingTransformation(rawPreBasis, periodicIndexSet_.indexPairSet());
│ │ │ -
166 return Dune::Functions::Experimental::TransformedIndexPreBasis(std::move(rawPreBasis), std::move(transformation));
│ │ │ -
167 }
│ │ │ -
168
│ │ │ -
169 template<class GridView,
│ │ │ -
170 std::enable_if_t<not models<Concept::GlobalBasis<GridView>,RawPreBasisIndicator>(), int> = 0,
│ │ │ -
171 std::enable_if_t<not models<Concept::PreBasis<GridView>,RawPreBasisIndicator>(), int> = 0>
│ │ │ -
172 auto operator()(const GridView& gridView) const
│ │ │ -
173 {
│ │ │ -
174 auto rawPreBasis = rawPreBasisIndicator_(gridView);
│ │ │ -
175 rawPreBasis.initializeIndices();
│ │ │ -
176 auto transformation = PeriodicIndexingTransformation(rawPreBasis, periodicIndexSet_.indexPairSet());
│ │ │ -
177 return Dune::Functions::Experimental::TransformedIndexPreBasis(std::move(rawPreBasis), std::move(transformation));
│ │ │ -
178 }
│ │ │ -
179
│ │ │ -
180private:
│ │ │ -
181 RawPreBasisIndicator rawPreBasisIndicator_;
│ │ │ -
182 PeriodicIndexSet periodicIndexSet_;
│ │ │ -
183};
│ │ │ -
184
│ │ │ -
185} // end namespace BasisFactory::Impl
│ │ │ -
186
│ │ │ -
187
│ │ │ -
188
│ │ │ -
202template<class RawPreBasisIndicator, class PIS>
│ │ │ -
│ │ │ - │ │ │ -
204 RawPreBasisIndicator&& rawPreBasisIndicator,
│ │ │ -
205 PIS&& periodicIndexSet
│ │ │ -
206 )
│ │ │ -
207{
│ │ │ -
208 return Impl::PeriodicPreBasisFactory<std::decay_t<RawPreBasisIndicator>>(
│ │ │ -
209 std::forward<RawPreBasisIndicator>(rawPreBasisIndicator),
│ │ │ -
210 std::forward<PIS>(periodicIndexSet));
│ │ │ -
211}
│ │ │ -
│ │ │ -
212
│ │ │ -
213} // end namespace Experimental
│ │ │ -
│ │ │ -
214
│ │ │ -
215} // end namespace BasisFactory
│ │ │ -
216
│ │ │ -
217} // end namespace Dune::Functions
│ │ │ -
218
│ │ │ -
219#endif // DUNE_FUFEM_PERIODICBASIS_HH
│ │ │ - │ │ │ -
Lightweight representation of (hierarchical) size and block structure extracted from a basis to descr...
│ │ │ -
auto periodic(RawPreBasisIndicator &&rawPreBasisIndicator, PIS &&periodicIndexSet)
Create a pre-basis factory that can create a periodic pre-basis.
Definition periodicbasis.hh:203
│ │ │ +
74};
│ │ │ +
│ │ │ +
75
│ │ │ +
76
│ │ │ +
77
│ │ │ +
78template<class size_type, std::size_t n>
│ │ │ +
│ │ │ +
79inline std::ostream& operator<<(std::ostream& stream, const StaticMultiIndex<size_type,n>& c) {
│ │ │ +
80 for (const auto& ci : c)
│ │ │ +
81 stream << ci << " ";
│ │ │ +
82 return stream;
│ │ │ +
83}
│ │ │ +
│ │ │ +
84
│ │ │ +
85
│ │ │ +
86
│ │ │ +
87} // namespace Dune::Functions
│ │ │ +
88
│ │ │ +
89template<class size_type, std::size_t n>
│ │ │ +
│ │ │ +
90struct std::tuple_size< Dune::Functions::StaticMultiIndex<size_type,n> >
│ │ │ +
91 : std::integral_constant<std::size_t, n> { };
│ │ │ +
│ │ │ +
92
│ │ │ +
93DUNE_DEFINE_HASH(DUNE_HASH_TEMPLATE_ARGS(typename size_type, std::size_t n),DUNE_HASH_TYPE(Dune::Functions::StaticMultiIndex<size_type,n>))
│ │ │ +
94
│ │ │ +
95#endif // DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH
│ │ │ +
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
auto containerDescriptor(const PreBasis &preBasis)
Return the container descriptor of the pre-basis, if defined, otherwise ContainerDescriptor::Unknown.
Definition containerdescriptors.hh:58
│ │ │ -
TransformedIndexPreBasis(RPB &&, T &&) -> TransformedIndexPreBasis< std::decay_t< RPB >, std::decay_t< T > >
│ │ │ -
Definition argyrisbasis.hh:926
│ │ │ -
Definition periodicbasis.hh:29
│ │ │ -
Container storing identified indices for a periodic basis.
Definition periodicbasis.hh:41
│ │ │ -
void unifyIndexPair(std::size_t a, std::size_t b)
Insert a pair of indices.
Definition periodicbasis.hh:52
│ │ │ -
const auto & indexPairSet() const
Definition periodicbasis.hh:61
│ │ │ - │ │ │ +
std::ostream & operator<<(std::ostream &stream, const StaticMultiIndex< size_type, n > &c)
Definition multiindex.hh:79
│ │ │ +
A statically sized MultiIndex type.
Definition multiindex.hh:30
│ │ │ +
static constexpr std::size_t size()
Definition multiindex.hh:32
│ │ │ +
friend std::size_t hash_value(const StaticMultiIndex &v) noexcept
Definition multiindex.hh:35
│ │ │ +
static constexpr std::size_t max_size()
Definition multiindex.hh:33
│ │ │ +
static constexpr std::size_t max_size()
Definition multiindex.hh:59
│ │ │ +
static constexpr std::size_t size()
Definition multiindex.hh:58
│ │ │ +
friend std::size_t hash_value(const StaticMultiIndex &v) noexcept
Definition multiindex.hh:66
│ │ │
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,250 +1,125 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -periodicbasis.hh │ │ │ │ +multiindex.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_PERIODICBASIS_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_PERIODICBASIS_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH │ │ │ │ +8#define DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ -12#include │ │ │ │ -13#include │ │ │ │ -14#include │ │ │ │ -15 │ │ │ │ -16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ -17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h> │ │ │ │ -18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_t_r_a_n_s_f_o_r_m_e_d_i_n_d_e_x_b_a_s_i_s_._h_h> │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ +12#include │ │ │ │ +13#include │ │ │ │ +14 │ │ │ │ +15#include │ │ │ │ +16 │ │ │ │ +17 │ │ │ │ +18namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ 19 │ │ │ │ 20 │ │ │ │ -21namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ -22 │ │ │ │ -23namespace _B_a_s_i_s_F_a_c_t_o_r_y { │ │ │ │ -24 │ │ │ │ -25// The PeriodicBasis class is in the Experimental namespace because we are │ │ │ │ -26// not completely sure yet whether we like it. We reserve the right to │ │ │ │ -27// modify it without advance warning. Use at your own risk! │ │ │ │ -28 │ │ │ │ -_2_9namespace _E_x_p_e_r_i_m_e_n_t_a_l { │ │ │ │ -30 │ │ │ │ -31 │ │ │ │ -_4_0class _P_e_r_i_o_d_i_c_I_n_d_e_x_S_e_t │ │ │ │ -41{ │ │ │ │ -42 using IndexPairSet = std::set>; │ │ │ │ -43public: │ │ │ │ -44 │ │ │ │ -_5_2 void _u_n_i_f_y_I_n_d_e_x_P_a_i_r(std::size_t a, std::size_t b) │ │ │ │ -53 { │ │ │ │ -54 if (a>b) │ │ │ │ -55 std::swap(a,b); │ │ │ │ -56 if (a==b) │ │ │ │ -57 return; │ │ │ │ -58 indexPairSet_.insert(std::make_pair(a,b)); │ │ │ │ -59 } │ │ │ │ +21 │ │ │ │ +27template │ │ │ │ +_2_8class _S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x : │ │ │ │ +29 public std::array │ │ │ │ +30{ │ │ │ │ +31public: │ │ │ │ +_3_2 static constexpr std::size_t _s_i_z_e() { return n; } │ │ │ │ +_3_3 static constexpr std::size_t _m_a_x___s_i_z_e() { return n; } │ │ │ │ +34 │ │ │ │ +_3_5 inline friend std::size_t _h_a_s_h___v_a_l_u_e(const _S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x& v) noexcept { │ │ │ │ +36 return hash_range(v.begin(), v.end()); │ │ │ │ +37 } │ │ │ │ +38 │ │ │ │ +39}; │ │ │ │ +40 │ │ │ │ +41 │ │ │ │ +42 │ │ │ │ +52template │ │ │ │ +_5_3class _S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x : │ │ │ │ +54 public std::array │ │ │ │ +55{ │ │ │ │ +56public: │ │ │ │ +57 │ │ │ │ +_5_8 static constexpr std::size_t _s_i_z_e() { return 1; } │ │ │ │ +_5_9 static constexpr std::size_t _m_a_x___s_i_z_e() { return 1; } │ │ │ │ 60 │ │ │ │ -_6_1 const auto& _i_n_d_e_x_P_a_i_r_S_e_t() const │ │ │ │ -62 { │ │ │ │ -63 return indexPairSet_; │ │ │ │ +61 │ │ │ │ +_6_2 operator const size_type& () const { │ │ │ │ +63 return (*this)[0]; │ │ │ │ 64 } │ │ │ │ 65 │ │ │ │ -66private: │ │ │ │ -67 IndexPairSet indexPairSet_; │ │ │ │ -68}; │ │ │ │ +_6_6 inline friend std::size_t _h_a_s_h___v_a_l_u_e(const _S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x& v) noexcept { │ │ │ │ +67 return hash_range(v.begin(), v.end()); │ │ │ │ +68 } │ │ │ │ 69 │ │ │ │ -70 │ │ │ │ -71 │ │ │ │ -72namespace Impl { │ │ │ │ +_7_0 operator size_type& () { │ │ │ │ +71 return (*this)[0]; │ │ │ │ +72 } │ │ │ │ 73 │ │ │ │ -74// An index transformation for a TransformedIndexPreBasis │ │ │ │ -75// implementing periodic functions by merging indices. │ │ │ │ -76// Currently only flat indices are supported. │ │ │ │ -77class PeriodicIndexingTransformation │ │ │ │ -78{ │ │ │ │ -79public: │ │ │ │ -80 │ │ │ │ -81 static constexpr std::size_t minIndexSize = 1; │ │ │ │ -82 static constexpr std::size_t maxIndexSize = 1; │ │ │ │ -83 │ │ │ │ -84 template │ │ │ │ -85 PeriodicIndexingTransformation(const RawPreBasis& rawPreBasis, const │ │ │ │ -IndexPairSet& indexPairSet) │ │ │ │ -86 { │ │ │ │ -87 static_assert(RawPreBasis::maxMultiIndexSize==1, │ │ │ │ -"PeriodicIndexingTransformation is only implemented for flat multi-indices"); │ │ │ │ -88 std::size_t invalid = {std::numeric_limits::max()}; │ │ │ │ -89 mappedIdx_.resize(rawPreBasis.size(), invalid); │ │ │ │ -90 numIndices_ = 0; │ │ │ │ -91 std::size_t i = 0; │ │ │ │ -92 for(const auto& [a, b] : indexPairSet) │ │ │ │ -93 { │ │ │ │ -94 for(; i<=a; ++i) │ │ │ │ -95 if (mappedIdx_[i] == invalid) │ │ │ │ -96 mappedIdx_[i] = numIndices_++; │ │ │ │ -97 mappedIdx_[b] = mappedIdx_[a]; │ │ │ │ -98 } │ │ │ │ -99 for(; i │ │ │ │ -105 void transformIndex(MultiIndex& multiIndex, const PreBasis& preBasis) const │ │ │ │ -106 { │ │ │ │ -107 multiIndex = {{ mappedIdx_[multiIndex[0]] }}; │ │ │ │ -108 } │ │ │ │ -109 │ │ │ │ -110 template │ │ │ │ -111 std::size_t size(const Prefix& prefix, const PreBasis& preBasis) const │ │ │ │ -112 { │ │ │ │ -113 if (prefix.size() == 1) │ │ │ │ -114 return 0; │ │ │ │ -115 return numIndices_; │ │ │ │ -116 } │ │ │ │ -117 │ │ │ │ -118 template │ │ │ │ -119 auto dimension(const PreBasis& preBasis) const │ │ │ │ -120 { │ │ │ │ -121 return numIndices_; │ │ │ │ -122 } │ │ │ │ -123 │ │ │ │ -125 template │ │ │ │ -126 auto containerDescriptor(const PreBasis& preBasis) const │ │ │ │ -127 { │ │ │ │ -128 return _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r(preBasis); │ │ │ │ -129 } │ │ │ │ -130 │ │ │ │ -131private: │ │ │ │ -132 std::vector mappedIdx_; │ │ │ │ -133 std::size_t numIndices_; │ │ │ │ -134}; │ │ │ │ -135 │ │ │ │ -136 │ │ │ │ -137 │ │ │ │ -138template │ │ │ │ -139class PeriodicPreBasisFactory │ │ │ │ -140{ │ │ │ │ -141public: │ │ │ │ -142 PeriodicPreBasisFactory() │ │ │ │ -143 {} │ │ │ │ -144 │ │ │ │ -145 template │ │ │ │ -146 PeriodicPreBasisFactory(RPBI&& rawPreBasisIndicator, PIS&& │ │ │ │ -periodicIndexSet) : │ │ │ │ -147 rawPreBasisIndicator_(std::forward(rawPreBasisIndicator)), │ │ │ │ -148 periodicIndexSet_(std::forward(periodicIndexSet)) │ │ │ │ -149 {} │ │ │ │ -150 │ │ │ │ -151 template,RawPreBasisIndicator>(), int> = 0> │ │ │ │ -153 auto operator()(const GridView& gridView) const │ │ │ │ -154 { │ │ │ │ -155 const auto& rawPreBasis = rawPreBasisIndicator_.preBasis(); │ │ │ │ -156 auto transformation = PeriodicIndexingTransformation(rawPreBasis, │ │ │ │ -periodicIndexSet_.indexPairSet()); │ │ │ │ -157 return _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s(std::move │ │ │ │ -(rawPreBasis), std::move(transformation)); │ │ │ │ -158 } │ │ │ │ -159 │ │ │ │ -160 template,RawPreBasisIndicator> │ │ │ │ -(), int> = 0> │ │ │ │ -162 auto operator()(const GridView& gridView) const │ │ │ │ -163 { │ │ │ │ -164 const auto& rawPreBasis = rawPreBasisIndicator_; │ │ │ │ -165 auto transformation = PeriodicIndexingTransformation(rawPreBasis, │ │ │ │ -periodicIndexSet_.indexPairSet()); │ │ │ │ -166 return _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s(std::move │ │ │ │ -(rawPreBasis), std::move(transformation)); │ │ │ │ -167 } │ │ │ │ -168 │ │ │ │ -169 template,RawPreBasisIndicator>(), int> = 0, │ │ │ │ -171 std::enable_if_t,RawPreBasisIndicator>(), int> = 0> │ │ │ │ -172 auto operator()(const GridView& gridView) const │ │ │ │ -173 { │ │ │ │ -174 auto rawPreBasis = rawPreBasisIndicator_(gridView); │ │ │ │ -175 rawPreBasis.initializeIndices(); │ │ │ │ -176 auto transformation = PeriodicIndexingTransformation(rawPreBasis, │ │ │ │ -periodicIndexSet_.indexPairSet()); │ │ │ │ -177 return _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s(std::move │ │ │ │ -(rawPreBasis), std::move(transformation)); │ │ │ │ -178 } │ │ │ │ -179 │ │ │ │ -180private: │ │ │ │ -181 RawPreBasisIndicator rawPreBasisIndicator_; │ │ │ │ -182 PeriodicIndexSet periodicIndexSet_; │ │ │ │ -183}; │ │ │ │ -184 │ │ │ │ -185} // end namespace BasisFactory::Impl │ │ │ │ -186 │ │ │ │ -187 │ │ │ │ -188 │ │ │ │ -202template │ │ │ │ -_2_0_3auto _p_e_r_i_o_d_i_c( │ │ │ │ -204 RawPreBasisIndicator&& rawPreBasisIndicator, │ │ │ │ -205 PIS&& periodicIndexSet │ │ │ │ -206 ) │ │ │ │ -207{ │ │ │ │ -208 return Impl::PeriodicPreBasisFactory>( │ │ │ │ -209 std::forward(rawPreBasisIndicator), │ │ │ │ -210 std::forward(periodicIndexSet)); │ │ │ │ -211} │ │ │ │ -212 │ │ │ │ -213} // end namespace Experimental │ │ │ │ -214 │ │ │ │ -215} // end namespace BasisFactory │ │ │ │ -216 │ │ │ │ -217} // end namespace Dune::Functions │ │ │ │ -218 │ │ │ │ -219#endif // DUNE_FUFEM_PERIODICBASIS_HH │ │ │ │ -_t_r_a_n_s_f_o_r_m_e_d_i_n_d_e_x_b_a_s_i_s_._h_h │ │ │ │ -_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h │ │ │ │ -Lightweight representation of (hierarchical) size and block structure extracted │ │ │ │ -from a basis to descr... │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_p_e_r_i_o_d_i_c │ │ │ │ -auto periodic(RawPreBasisIndicator &&rawPreBasisIndicator, PIS │ │ │ │ -&&periodicIndexSet) │ │ │ │ -Create a pre-basis factory that can create a periodic pre-basis. │ │ │ │ -DDeeffiinniittiioonn periodicbasis.hh:203 │ │ │ │ +74}; │ │ │ │ +75 │ │ │ │ +76 │ │ │ │ +77 │ │ │ │ +78template │ │ │ │ +_7_9inline std::ostream& _o_p_e_r_a_t_o_r_<_<(std::ostream& stream, const │ │ │ │ +_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x_<_s_i_z_e___t_y_p_e_,_n_>& c) { │ │ │ │ +80 for (const auto& ci : c) │ │ │ │ +81 stream << ci << " "; │ │ │ │ +82 return stream; │ │ │ │ +83} │ │ │ │ +84 │ │ │ │ +85 │ │ │ │ +86 │ │ │ │ +87} // namespace Dune::Functions │ │ │ │ +88 │ │ │ │ +89template │ │ │ │ +_9_0struct std::tuple_size< _D_u_n_e::Functions::StaticMultiIndex > │ │ │ │ +91 : std::integral_constant { }; │ │ │ │ +92 │ │ │ │ +93DUNE_DEFINE_HASH(DUNE_HASH_TEMPLATE_ARGS(typename size_type, std::size_t │ │ │ │ +n),DUNE_HASH_TYPE(_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x_<_s_i_z_e___t_y_p_e_,_n_>)) │ │ │ │ +94 │ │ │ │ +95#endif // DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH │ │ │ │ +_D_u_n_e │ │ │ │ +DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r │ │ │ │ -auto containerDescriptor(const PreBasis &preBasis) │ │ │ │ -Return the container descriptor of the pre-basis, if defined, otherwise │ │ │ │ -ContainerDescriptor::Unknown. │ │ │ │ -DDeeffiinniittiioonn containerdescriptors.hh:58 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s │ │ │ │ -TransformedIndexPreBasis(RPB &&, T &&) -> TransformedIndexPreBasis< std:: │ │ │ │ -decay_t< RPB >, std::decay_t< T > > │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:926 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l │ │ │ │ -DDeeffiinniittiioonn periodicbasis.hh:29 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_P_e_r_i_o_d_i_c_I_n_d_e_x_S_e_t │ │ │ │ -Container storing identified indices for a periodic basis. │ │ │ │ -DDeeffiinniittiioonn periodicbasis.hh:41 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_P_e_r_i_o_d_i_c_I_n_d_e_x_S_e_t_:_:_u_n_i_f_y_I_n_d_e_x_P_a_i_r │ │ │ │ -void unifyIndexPair(std::size_t a, std::size_t b) │ │ │ │ -Insert a pair of indices. │ │ │ │ -DDeeffiinniittiioonn periodicbasis.hh:52 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_P_e_r_i_o_d_i_c_I_n_d_e_x_S_e_t_:_:_i_n_d_e_x_P_a_i_r_S_e_t │ │ │ │ -const auto & indexPairSet() const │ │ │ │ -DDeeffiinniittiioonn periodicbasis.hh:61 │ │ │ │ -_c_o_n_c_e_p_t_s_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_o_p_e_r_a_t_o_r_<_< │ │ │ │ +std::ostream & operator<<(std::ostream &stream, const StaticMultiIndex< │ │ │ │ +size_type, n > &c) │ │ │ │ +DDeeffiinniittiioonn multiindex.hh:79 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x │ │ │ │ +A statically sized MultiIndex type. │ │ │ │ +DDeeffiinniittiioonn multiindex.hh:30 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x_:_:_s_i_z_e │ │ │ │ +static constexpr std::size_t size() │ │ │ │ +DDeeffiinniittiioonn multiindex.hh:32 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x_:_:_h_a_s_h___v_a_l_u_e │ │ │ │ +friend std::size_t hash_value(const StaticMultiIndex &v) noexcept │ │ │ │ +DDeeffiinniittiioonn multiindex.hh:35 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x_:_:_m_a_x___s_i_z_e │ │ │ │ +static constexpr std::size_t max_size() │ │ │ │ +DDeeffiinniittiioonn multiindex.hh:33 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x_<_ _s_i_z_e___t_y_p_e_,_ _1_ _>_:_:_m_a_x___s_i_z_e │ │ │ │ +static constexpr std::size_t max_size() │ │ │ │ +DDeeffiinniittiioonn multiindex.hh:59 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x_<_ _s_i_z_e___t_y_p_e_,_ _1_ _>_:_:_s_i_z_e │ │ │ │ +static constexpr std::size_t size() │ │ │ │ +DDeeffiinniittiioonn multiindex.hh:58 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x_<_ _s_i_z_e___t_y_p_e_,_ _1_ _>_:_:_h_a_s_h___v_a_l_u_e │ │ │ │ +friend std::size_t hash_value(const StaticMultiIndex &v) noexcept │ │ │ │ +DDeeffiinniittiioonn multiindex.hh:66 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _p_e_r_i_o_d_i_c_b_a_s_i_s_._h_h │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ + * _m_u_l_t_i_i_n_d_e_x_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00110.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: nodes.hh File Reference │ │ │ +Dune-Functions: polynomial.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,64 +88,63 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
nodes.hh File Reference
│ │ │ +
polynomial.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <cassert>
│ │ │ -#include <memory>
│ │ │ +
#include <cmath>
│ │ │ +#include <initializer_list>
│ │ │ #include <vector>
│ │ │ -#include <array>
│ │ │ -#include <optional>
│ │ │ -#include <dune/common/indices.hh>
│ │ │ -#include <dune/common/tuplevector.hh>
│ │ │ -#include <dune/common/typelist.hh>
│ │ │ -#include <dune/common/hybridmultiindex.hh>
│ │ │ -#include <dune/common/typetree/traversal.hh>
│ │ │ +#include <dune/common/hybridutilities.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::BasisNodeMixin
class  Dune::Functions::LeafBasisNode
class  Dune::Functions::InnerBasisNodeMixin< Node, Element >
class  Dune::Functions::PowerBasisNode< T, n >
class  Dune::Functions::DynamicPowerBasisNode< T >
class  Dune::Functions::CompositeBasisNode< T >
struct  Dune::Functions::CompositeBasisNode< T >::Child< k >
class  Dune::Functions::Polynomial< K, C >
 A univariate polynomial implementation. More...
│ │ │ │ │ │ │ │ │ │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Functions

template<typename Tree, typename Entity>
void Dune::Functions::bindTree (Tree &tree, const Entity &entity, std::size_t offset=0)
template<typename Tree>
void Dune::Functions::initializeTree (Tree &tree, std::size_t treeIndexOffset=0)
template<class K>
 Dune::Functions::Polynomial (std::vector< K >) -> Polynomial< K, std::vector< K > >
template<class K, std::size_t n>
 Dune::Functions::Polynomial (std::array< K, n >) -> Polynomial< K, std::array< K, n > >
template<class K, K... ci>
 Dune::Functions::Polynomial (std::integer_sequence< K, ci... >) -> Polynomial< K, std::integer_sequence< K, ci... > >
template<class K>
 Dune::Functions::Polynomial (std::initializer_list< K >) -> Polynomial< K, std::vector< K > >
template<class K, class Coefficients>
auto Dune::Functions::makePolynomial (Coefficients coefficients)
 Create Polynomial.
template<class K, class C>
auto Dune::Functions::makePolynomial (std::initializer_list< C > coefficients)
 Create Polynomial.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,39 +1,40 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -nodes.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ +polynomial.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ +#include │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ - class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n │ │ │ │ - class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ - class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_n_n_e_r_B_a_s_i_s_N_o_d_e_M_i_x_i_n_<_ _N_o_d_e_,_ _E_l_e_m_e_n_t_ _> │ │ │ │ - class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_ _T_,_ _n_ _> │ │ │ │ - class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_ _T_ _> │ │ │ │ - class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_<_ _T_ _> │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_<_ _T_ _>_:_:_C_h_i_l_d_<_ _k_ _> │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_n_o_m_i_a_l_<_ _K_,_ _C_ _> │ │ │ │ +  A univariate polynomial implementation. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -void  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_b_i_n_d_T_r_e_e (Tree &tree, const Entity &entity, std::size_t │ │ │ │ - offset=0) │ │ │ │ -template │ │ │ │ -void  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_i_n_i_t_i_a_l_i_z_e_T_r_e_e (Tree &tree, std::size_t │ │ │ │ - treeIndexOffset=0) │ │ │ │ +template │ │ │ │ +   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_n_o_m_i_a_l (std::vector< K >) -> Polynomial< K, std:: │ │ │ │ + vector< K > > │ │ │ │ +template │ │ │ │ +   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_n_o_m_i_a_l (std::array< K, n >) -> Polynomial< K, std:: │ │ │ │ + array< K, n > > │ │ │ │ +template │ │ │ │ +   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_n_o_m_i_a_l (std::integer_sequence< K, ci... >) - │ │ │ │ + > Polynomial< K, std::integer_sequence< K, ci... > > │ │ │ │ +template │ │ │ │ +   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_n_o_m_i_a_l (std::initializer_list< K >) -> Polynomial< │ │ │ │ + K, std::vector< K > > │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_P_o_l_y_n_o_m_i_a_l (Coefficients coefficients) │ │ │ │ +  Create _P_o_l_y_n_o_m_i_a_l. │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_P_o_l_y_n_o_m_i_a_l (std::initializer_list< C > coefficients) │ │ │ │ +  Create _P_o_l_y_n_o_m_i_a_l. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _n_o_d_e_s_._h_h │ │ │ │ + * _a_n_a_l_y_t_i_c_f_u_n_c_t_i_o_n_s │ │ │ │ + * _p_o_l_y_n_o_m_i_a_l_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00110.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,11 +1,8 @@ │ │ │ │ var a00110 = [ │ │ │ │ - ["Dune::Functions::BasisNodeMixin", "a02002.html", "a02002"], │ │ │ │ - ["Dune::Functions::LeafBasisNode", "a02006.html", "a02006"], │ │ │ │ - ["Dune::Functions::InnerBasisNodeMixin< Node, Element >", "a02010.html", "a02010"], │ │ │ │ - ["Dune::Functions::PowerBasisNode< T, n >", "a02014.html", "a02014"], │ │ │ │ - ["Dune::Functions::DynamicPowerBasisNode< T >", "a02018.html", "a02018"], │ │ │ │ - ["Dune::Functions::CompositeBasisNode< T >", "a02022.html", "a02022"], │ │ │ │ - ["Dune::Functions::CompositeBasisNode< T >::Child< k >", "a02026.html", "a02026"], │ │ │ │ - ["Dune::Functions::bindTree", "a00318.html#a4dc892a209e0f55bc65eadaf2c808454", null], │ │ │ │ - ["Dune::Functions::initializeTree", "a00318.html#a5e19b913a34ad68144f4fd873c51b977", null] │ │ │ │ + ["Dune::Functions::makePolynomial", "a00318.html#ae39290bbc7f0c8afc2a2234e2038ee43", null], │ │ │ │ + ["Dune::Functions::makePolynomial", "a00318.html#a0f2765282a4f56600544187da5350845", null], │ │ │ │ + ["Dune::Functions::Polynomial", "a00318.html#a016550b1c91d9134c26429189244978d", null], │ │ │ │ + ["Dune::Functions::Polynomial", "a00318.html#a85fee67e59a9cdf2dc2e12b4abdbb16b", null], │ │ │ │ + ["Dune::Functions::Polynomial", "a00318.html#a1dba9ae8fffc043b3e692e34991565ac", null], │ │ │ │ + ["Dune::Functions::Polynomial", "a00318.html#a368f344cc96ccfadd1c947cefb82789f", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00110_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: nodes.hh Source File │ │ │ +Dune-Functions: polynomial.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,607 +88,264 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
nodes.hh
│ │ │ +
polynomial.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_ANALYTICFUNCTIONS_POLYNOMIAL_HH
│ │ │ +
8#define DUNE_FUNCTIONS_ANALYTICFUNCTIONS_POLYNOMIAL_HH
│ │ │
9
│ │ │ -
10#include <cassert>
│ │ │ -
11#include <memory>
│ │ │ +
10#include <cmath>
│ │ │ +
11#include <initializer_list>
│ │ │
12#include <vector>
│ │ │ -
13#include <array>
│ │ │ -
14#include <optional>
│ │ │ -
15
│ │ │ -
16#include <dune/common/indices.hh>
│ │ │ -
17#include <dune/common/tuplevector.hh>
│ │ │ -
18#include <dune/common/typelist.hh>
│ │ │ +
13
│ │ │ +
14
│ │ │ +
15#include <dune/common/hybridutilities.hh>
│ │ │ +
16
│ │ │ +
17namespace Dune {
│ │ │ +
18namespace Functions {
│ │ │
19
│ │ │ -
20#include <dune/common/hybridmultiindex.hh>
│ │ │ -
21#include <dune/common/typetree/traversal.hh>
│ │ │ -
22
│ │ │ -
23#ifdef HAVE_DUNE_TYPETREE
│ │ │ -
24#include <dune/typetree/nodetags.hh>
│ │ │ -
25#endif
│ │ │ -
26
│ │ │ -
27namespace Dune {
│ │ │ -
28 namespace Functions {
│ │ │ -
29
│ │ │ -
30
│ │ │ -
31 namespace Impl {
│ │ │ -
32
│ │ │ -
33 // This class encapsulates the access to the setOffset()
│ │ │ -
34 // and setTreeIndex() methods of a node. This way we
│ │ │ -
35 // can hide the methods from the user but still provide
│ │ │ -
36 // access where this is needed.
│ │ │ -
37 struct BasisNodeSetupHelper
│ │ │ -
38 {
│ │ │ -
39
│ │ │ -
40 template<class Node, class size_type>
│ │ │ -
41 static void setSize(Node& node, const size_type size)
│ │ │ -
42 {
│ │ │ -
43 node.setSize(size);
│ │ │ -
44 }
│ │ │ -
45
│ │ │ -
46 template<class Node, class size_type>
│ │ │ -
47 static void setOffset(Node& node, const size_type offset)
│ │ │ -
48 {
│ │ │ -
49 node.setOffset(offset);
│ │ │ -
50 }
│ │ │ -
51
│ │ │ -
52 template<class Node, class size_type>
│ │ │ -
53 static void setTreeIndex(Node& node, const size_type index)
│ │ │ -
54 {
│ │ │ -
55 node.setTreeIndex(index);
│ │ │ -
56 }
│ │ │ -
57
│ │ │ -
58 };
│ │ │ -
59
│ │ │ -
60
│ │ │ -
61
│ │ │ -
62 // A mixin class for generalized child access from
│ │ │ -
63 // multiple indices or a tree path. The derived class
│ │ │ -
64 // only has to provide the child(i) method with
│ │ │ -
65 // a single index for accessing direct children.
│ │ │ -
66 template<class Impl>
│ │ │ -
67 class ChildAccessMixIn
│ │ │ -
68 {
│ │ │ -
69
│ │ │ -
70 Impl& asImpl()
│ │ │ -
71 {
│ │ │ -
72 return static_cast<Impl&>(*this);
│ │ │ -
73 }
│ │ │ -
74
│ │ │ -
75 const Impl& asImpl() const
│ │ │ -
76 {
│ │ │ -
77 return static_cast<const Impl&>(*this);
│ │ │ -
78 }
│ │ │ -
79
│ │ │ -
80 public:
│ │ │ -
81
│ │ │ -
87 template<class... II>
│ │ │ -
88 const auto& child(II... ii) const
│ │ │ -
89 requires (sizeof...(II) != 1)
│ │ │ -
90 {
│ │ │ -
91 return Dune::TypeTree::child(asImpl(), ii...);
│ │ │ -
92 }
│ │ │ -
93
│ │ │ -
99
│ │ │ -
100 template<class... II>
│ │ │ -
101 auto& child(II... ii)
│ │ │ -
102 requires (sizeof...(II) != 1)
│ │ │ -
103 {
│ │ │ -
104 return Dune::TypeTree::child(asImpl(), ii...);
│ │ │ -
105 }
│ │ │ -
106
│ │ │ -
112 template<class... II>
│ │ │ -
113 const auto& child(Dune::HybridMultiIndex<II...> treePath) const
│ │ │ -
114 {
│ │ │ -
115 return Dune::TypeTree::child(asImpl(), treePath);
│ │ │ -
116 }
│ │ │ -
117
│ │ │ -
123 template<class... II>
│ │ │ -
124 auto& child(Dune::HybridMultiIndex<II...> treePath)
│ │ │ -
125 {
│ │ │ -
126 return Dune::TypeTree::child(asImpl(), treePath);
│ │ │ -
127 }
│ │ │ +
20namespace Impl {
│ │ │ +
21
│ │ │ +
22 // Compute coefficients of derivative of polynomial.
│ │ │ +
23 // Overload for std::vector
│ │ │ +
24 template<class K, class Allocator>
│ │ │ +
25 auto polynomialDerivativeCoefficients(const std::vector<K, Allocator>& coefficients) {
│ │ │ +
26 if (coefficients.size()==0)
│ │ │ +
27 return std::vector<K, Allocator>();
│ │ │ +
28 std::vector<K, Allocator> dpCoefficients(coefficients.size()-1);
│ │ │ +
29 for (size_t i=1; i<coefficients.size(); ++i)
│ │ │ +
30 dpCoefficients[i-1] = coefficients[i]*K(i);
│ │ │ +
31 return dpCoefficients;
│ │ │ +
32 }
│ │ │ +
33
│ │ │ +
34 // Compute coefficients of derivative of polynomial.
│ │ │ +
35 // Overload for std::array
│ │ │ +
36 template<class K, std::size_t n>
│ │ │ +
37 auto polynomialDerivativeCoefficients(const std::array<K, n>& coefficients) {
│ │ │ +
38 if constexpr (n==0)
│ │ │ +
39 return coefficients;
│ │ │ +
40 else
│ │ │ +
41 {
│ │ │ +
42 std::array<K, n-1> dpCoefficients;
│ │ │ +
43 for (size_t i=1; i<coefficients.size(); ++i)
│ │ │ +
44 dpCoefficients[i-1] = coefficients[i]*K(i);
│ │ │ +
45 return dpCoefficients;
│ │ │ +
46 }
│ │ │ +
47 }
│ │ │ +
48
│ │ │ +
49 // Compute coefficients of derivative of polynomial.
│ │ │ +
50 // Helper function for the std::integer_sequence overload.
│ │ │ +
51 // With C++20 this can be avoided, because lambda function
│ │ │ +
52 // can partially specify template arguments which allows
│ │ │ +
53 // to do the same inline.
│ │ │ +
54 template<class I, I i0, I... i, class J, J j0, J... j>
│ │ │ +
55 auto polynomialDerivativeCoefficientsHelper(std::integer_sequence<I, i0, i...>, std::integer_sequence<J, j0, j...>) {
│ │ │ +
56 return std::integer_sequence<I, i*I(j)...>();
│ │ │ +
57 }
│ │ │ +
58
│ │ │ +
59 // Compute coefficients of derivative of polynomial.
│ │ │ +
60 // Overload for std::integer_sequence
│ │ │ +
61 template<class I, I... i>
│ │ │ +
62 auto polynomialDerivativeCoefficients(std::integer_sequence<I, i...> coefficients) {
│ │ │ +
63 if constexpr (sizeof...(i)==0)
│ │ │ +
64 return coefficients;
│ │ │ +
65 else
│ │ │ +
66 return polynomialDerivativeCoefficientsHelper(coefficients, std::make_index_sequence<sizeof...(i)>());
│ │ │ +
67 }
│ │ │ +
68
│ │ │ +
69 // Compute coefficients of derivative of polynomial.
│ │ │ +
70 // Overload for std::tuple
│ │ │ +
71 template<class...T>
│ │ │ +
72 auto polynomialDerivativeCoefficients(const std::tuple<T...>& coefficients) {
│ │ │ +
73 if constexpr (sizeof...(T)==0)
│ │ │ +
74 return coefficients;
│ │ │ +
75 else
│ │ │ +
76 {
│ │ │ +
77 // Notice that std::multiplies<void> has issues with signed types.
│ │ │ +
78 // E.g., `decltype(-2,2ul)` is `long unsigned int`.
│ │ │ +
79 // Hence the same is deduced as return type in std::multiplies.
│ │ │ +
80 // To avoid this, we explicitly pass the exponent `i+1` as signed type.
│ │ │ +
81 // If the coefficient is signed, both types are now signed and
│ │ │ +
82 // so is the deduced result type of std::multiplies.
│ │ │ +
83 auto mult = Dune::Hybrid::hybridFunctor(std::multiplies());
│ │ │ +
84 return Dune::unpackIntegerSequence([&](auto... i) {
│ │ │ +
85 using signed_type = std::conditional_t<std::is_same_v<std::size_t, long unsigned int>,
│ │ │ +
86 long signed int, signed int>;
│ │ │ +
87 return std::tuple(mult(std::get<i+1>(coefficients),
│ │ │ +
88 std::integral_constant<signed_type, (signed_type)(i+1)>()) ...);
│ │ │ +
89 }, std::make_index_sequence<sizeof...(T)-1>());
│ │ │ +
90 }
│ │ │ +
91 }
│ │ │ +
92
│ │ │ +
93} // namespace Impl in Dune::Functions::
│ │ │ +
94
│ │ │ +
95
│ │ │ +
96
│ │ │ +
123template<class K, class C=std::vector<K>>
│ │ │ +
│ │ │ + │ │ │ +
125{
│ │ │ +
126 template<class CC>
│ │ │ +
127 struct IsIntegerSequence : public std::false_type {};
│ │ │
128
│ │ │ -
129 };
│ │ │ -
130
│ │ │ -
131 } // end namespace Impl
│ │ │ -
132
│ │ │ -
133
│ │ │ -
│ │ │ - │ │ │ -
135 {
│ │ │ -
136
│ │ │ -
137 friend struct Impl::BasisNodeSetupHelper;
│ │ │ -
138
│ │ │ -
139 public:
│ │ │ -
140
│ │ │ -
141 using size_type = std::size_t;
│ │ │ -
142
│ │ │ -
│ │ │ - │ │ │ -
144 offset_(0),
│ │ │ -
145 size_(0),
│ │ │ -
146 treeIndex_(0)
│ │ │ -
147 {}
│ │ │ -
│ │ │ -
148
│ │ │ -
│ │ │ - │ │ │ -
150 {
│ │ │ -
151 assert(i < size_);
│ │ │ -
152 return offset_ + i;
│ │ │ -
153 }
│ │ │ -
│ │ │ +
129 template<class I, I... i>
│ │ │ +
130 struct IsIntegerSequence<std::integer_sequence<I, i...>> : public std::true_type {};
│ │ │ +
131
│ │ │ +
141 template <typename Coefficient>
│ │ │ +
142 static void add(K& y, const Coefficient &c)
│ │ │ +
143 {
│ │ │ +
144 if constexpr (!IsIntegralConstant<Coefficient>::value)
│ │ │ +
145 {
│ │ │ +
146 if (c!=0)
│ │ │ +
147 y += c;
│ │ │ +
148 }
│ │ │ +
149 else
│ │ │ +
150 y += c;
│ │ │ +
151 }
│ │ │ +
152
│ │ │ +
153public:
│ │ │
154
│ │ │ -
│ │ │ - │ │ │ -
163 {
│ │ │ -
164 return size_;
│ │ │ -
165 }
│ │ │ -
│ │ │ -
166
│ │ │ -
│ │ │ -
175 bool empty() const
│ │ │ -
176 {
│ │ │ -
177 return (size_ == 0);
│ │ │ -
178 }
│ │ │ -
│ │ │ -
179
│ │ │ -
│ │ │ - │ │ │ -
181 {
│ │ │ -
182 return treeIndex_;
│ │ │ -
183 }
│ │ │ -
│ │ │ -
184
│ │ │ -
185 protected:
│ │ │ -
186
│ │ │ -
│ │ │ - │ │ │ -
188 {
│ │ │ -
189 return offset_;
│ │ │ -
190 }
│ │ │ -
│ │ │ -
191
│ │ │ -
│ │ │ - │ │ │ -
193 {
│ │ │ -
194 offset_ = offset;
│ │ │ -
195 }
│ │ │ -
│ │ │ -
196
│ │ │ -
│ │ │ - │ │ │ -
198 {
│ │ │ -
199 size_ = size;
│ │ │ -
200 }
│ │ │ -
│ │ │ -
201
│ │ │ -
│ │ │ - │ │ │ -
203 {
│ │ │ -
204 treeIndex_ = treeIndex;
│ │ │ -
205 }
│ │ │ -
│ │ │ -
206
│ │ │ -
207 private:
│ │ │ -
208
│ │ │ -
209 size_type offset_;
│ │ │ -
210 size_type size_;
│ │ │ -
211 size_type treeIndex_;
│ │ │ -
212
│ │ │ -
213 };
│ │ │ -
│ │ │ -
214
│ │ │ -
215
│ │ │ -
│ │ │ - │ │ │ -
217 public BasisNodeMixin
│ │ │ -
218 {
│ │ │ -
219 public:
│ │ │ -
220
│ │ │ -
221 // Begin of node interface
│ │ │ -
222
│ │ │ -
│ │ │ -
223 static constexpr auto degree()
│ │ │ -
224 {
│ │ │ -
225 return Dune::index_constant<0>{};
│ │ │ -
226 }
│ │ │ -
│ │ │ -
227
│ │ │ -
228 // Historic node interface
│ │ │ -
229
│ │ │ -
230 static const bool isLeaf [[deprecated]] = true;
│ │ │ -
231 static const bool isPower [[deprecated]] = false;
│ │ │ -
232 static const bool isComposite [[deprecated]] = false;
│ │ │ -
233#ifdef HAVE_DUNE_TYPETREE
│ │ │ -
234 using NodeTag [[deprecated]] = Dune::TypeTree::LeafNodeTag;
│ │ │ -
235#endif
│ │ │ -
236
│ │ │ -
237 // End of node interface
│ │ │ -
238
│ │ │ -
239 };
│ │ │ +
156 using Coefficients = C;
│ │ │ +
157
│ │ │ +
159 Polynomial() = default;
│ │ │ +
160
│ │ │ +
│ │ │ + │ │ │ +
170 coefficients_(std::move(coefficients))
│ │ │ +
171 {}
│ │ │ +
│ │ │ +
172
│ │ │ +
│ │ │ +
178 K operator() (const K& x) const
│ │ │ +
179 {
│ │ │ +
180 using namespace Dune::Indices;
│ │ │ +
181
│ │ │ +
182 auto n = Dune::Hybrid::size(coefficients_);
│ │ │ +
183
│ │ │ +
184 // Explicitly handling the corner case of an empty coefficient set
│ │ │ +
185 // allows to save one multiplication.
│ │ │ +
186 return Hybrid::ifElse(Hybrid::equal_to(n, _0),
│ │ │ +
187 [&](auto id) { /* then */
│ │ │ +
188 // No coefficients at all
│ │ │ +
189 return K(0);
│ │ │ +
190 },
│ │ │ +
191 [&](auto id) { /* else */
│ │ │ +
192 // Do the Horner scheme knowing that there is at least one coefficient
│ │ │ +
193 K y = Hybrid::elementAt(coefficients_, Hybrid::minus(id(n), _1) );
│ │ │ +
194 Dune::Hybrid::forEach(Dune::range(Hybrid::minus(id(n), _1) ), [&](auto i)
│ │ │ +
195 {
│ │ │ +
196 y *= x;
│ │ │ +
197 // Do y+= _next coefficient_, unless that coefficient is std::integral_constant<0>.
│ │ │ +
198 add(y,Hybrid::elementAt(coefficients_, Hybrid::minus(Hybrid::minus(id(n),_2), i)));
│ │ │ +
199 });
│ │ │ +
200 return y;
│ │ │ +
201 });
│ │ │ +
202 }
│ │ │ +
│ │ │ +
203
│ │ │ +
│ │ │ +
205 bool operator==(const Polynomial& other) const
│ │ │ +
206 {
│ │ │ +
207 if constexpr (IsIntegerSequence<Coefficients>::value)
│ │ │ +
208 return true;
│ │ │ +
209 else
│ │ │ +
210 return coefficients()==other.coefficients();
│ │ │ +
211 }
│ │ │ +
│ │ │ +
212
│ │ │ +
│ │ │ +
222 friend auto derivative(const Polynomial& p)
│ │ │ +
223 {
│ │ │ +
224 auto derivativeCoefficients = Impl::polynomialDerivativeCoefficients(p.coefficients());
│ │ │ +
225 using DerivativeCoefficients = decltype(derivativeCoefficients);
│ │ │ +
226 return Polynomial<K, DerivativeCoefficients>(std::move(derivativeCoefficients));
│ │ │ +
227 }
│ │ │ +
│ │ │ +
228
│ │ │ +
│ │ │ + │ │ │ +
231 {
│ │ │ +
232 return coefficients_;
│ │ │ +
233 }
│ │ │ +
│ │ │ +
234
│ │ │ +
235private:
│ │ │ +
236 Coefficients coefficients_;
│ │ │ +
237};
│ │ │
│ │ │ +
238
│ │ │ +
239
│ │ │
240
│ │ │ -
241
│ │ │ -
242
│ │ │ -
243 template<typename Node, typename Element>
│ │ │ -
│ │ │ - │ │ │ -
245 : public BasisNodeMixin
│ │ │ -
246 {
│ │ │ -
247 public:
│ │ │ -
248
│ │ │ -
│ │ │ -
249 void bind(const Element& entity)
│ │ │ -
250 {
│ │ │ -
251 Node& self = *static_cast<Node*>(this);
│ │ │ -
252 std::size_t offset = this->offset();
│ │ │ -
253 Dune::Hybrid::forEach(Dune::range(self.degree()), [&](auto i) {
│ │ │ -
254 bindTree(self.child(i), entity, offset);
│ │ │ -
255 offset += self.child(i).size();
│ │ │ -
256 });
│ │ │ -
257 this->setSize(offset - this->offset());
│ │ │ -
258 }
│ │ │ -
│ │ │ -
259
│ │ │ -
260 };
│ │ │ -
│ │ │ -
261
│ │ │ -
262
│ │ │ -
263
│ │ │ -
264 template<typename T, std::size_t n>
│ │ │ -
│ │ │ - │ │ │ -
266 public InnerBasisNodeMixin<PowerBasisNode<T, n>, typename T::Element>,
│ │ │ -
267 public Impl::ChildAccessMixIn<PowerBasisNode<T, n>>
│ │ │ -
268 {
│ │ │ -
269 public:
│ │ │ -
270
│ │ │ -
271 // Begin of node interface
│ │ │ -
272
│ │ │ -
│ │ │ -
273 static constexpr auto degree()
│ │ │ -
274 {
│ │ │ -
275 return Dune::index_constant<n>{};
│ │ │ -
276 }
│ │ │ -
│ │ │ -
277
│ │ │ -
278 template<class Index>
│ │ │ -
279 requires (std::is_convertible_v<Index, std::size_t>)
│ │ │ -
│ │ │ -
280 const auto& child(Index i) const
│ │ │ -
281 {
│ │ │ -
282 return children_[i].value();
│ │ │ -
283 }
│ │ │ -
│ │ │ -
284
│ │ │ -
285 template<class Index>
│ │ │ -
286 requires (std::is_convertible_v<Index, std::size_t>)
│ │ │ -
│ │ │ -
287 auto& child(Index i)
│ │ │ -
288 {
│ │ │ -
289 return children_[i].value();
│ │ │ -
290 }
│ │ │ -
│ │ │ +
241template<class K>
│ │ │ + │ │ │ +
243
│ │ │ +
244template<class K, std::size_t n>
│ │ │ + │ │ │ +
246
│ │ │ +
247template<class K, K... ci>
│ │ │ +
248Polynomial(std::integer_sequence<K, ci...>) -> Polynomial<K, std::integer_sequence<K,ci...>>;
│ │ │ +
249
│ │ │ +
250template<class K>
│ │ │ +
251Polynomial(std::initializer_list<K>) -> Polynomial<K, std::vector<K>>;
│ │ │ +
252
│ │ │ +
253
│ │ │ +
254
│ │ │ +
267template<class K, class Coefficients>
│ │ │ +
│ │ │ +
268auto makePolynomial(Coefficients coefficients)
│ │ │ +
269{
│ │ │ +
270 return Polynomial<K, Coefficients>(std::move(coefficients));
│ │ │ +
271}
│ │ │ +
│ │ │ +
272
│ │ │ +
282template<class K, class C>
│ │ │ +
│ │ │ +
283auto makePolynomial(std::initializer_list<C> coefficients)
│ │ │ +
284{
│ │ │ +
285 return Polynomial<K>(std::move(coefficients));
│ │ │ +
286}
│ │ │ +
│ │ │ +
287
│ │ │ +
288
│ │ │ +
289
│ │ │ +
290
│ │ │
291
│ │ │ -
292 using Impl::ChildAccessMixIn<PowerBasisNode<T, n>>::child;
│ │ │ +
292}} // namespace Dune::Functions
│ │ │
293
│ │ │ -
294 // Historic node interface
│ │ │ +
294
│ │ │
295
│ │ │ -
296 using ChildType [[deprecated]] = T;
│ │ │ -
297
│ │ │ -
298 static const bool isLeaf [[deprecated]] = false;
│ │ │ -
299 static const bool isPower [[deprecated]] = true;
│ │ │ -
300 static const bool isComposite [[deprecated]] = false;
│ │ │ -
301#ifdef HAVE_DUNE_TYPETREE
│ │ │ -
302 using NodeTag [[deprecated]] = Dune::TypeTree::PowerNodeTag;
│ │ │ -
303#endif
│ │ │ -
304
│ │ │ -
305 // End of node interface
│ │ │ -
306
│ │ │ -
307 using Element = typename T::Element;
│ │ │ -
308
│ │ │ -
309 PowerBasisNode() = default;
│ │ │ -
310
│ │ │ -
│ │ │ -
311 const Element& element() const
│ │ │ -
312 {
│ │ │ -
313 return child(Dune::Indices::_0).element();
│ │ │ -
314 }
│ │ │ -
│ │ │ -
315
│ │ │ -
316 template<class Index, class TT>
│ │ │ -
│ │ │ -
317 void setChild(Index i, TT&& t)
│ │ │ -
318 {
│ │ │ -
319 children_[i].emplace(std::forward<TT>(t));
│ │ │ -
320 }
│ │ │ -
│ │ │ -
321
│ │ │ -
322 private:
│ │ │ -
323 std::array<std::optional<T>, n> children_;
│ │ │ -
324 };
│ │ │ -
│ │ │ -
325
│ │ │ -
326
│ │ │ -
327
│ │ │ -
328 template<typename T>
│ │ │ -
│ │ │ - │ │ │ -
330 public InnerBasisNodeMixin<DynamicPowerBasisNode<T>, typename T::Element>,
│ │ │ -
331 public Impl::ChildAccessMixIn<DynamicPowerBasisNode<T>>
│ │ │ -
332 {
│ │ │ -
333 public:
│ │ │ -
334
│ │ │ -
335 // Begin of node interface
│ │ │ -
336
│ │ │ -
│ │ │ -
337 std::size_t degree() const
│ │ │ -
338 {
│ │ │ -
339 return children_.size();
│ │ │ -
340 }
│ │ │ -
│ │ │ -
341
│ │ │ -
342 template<class Index>
│ │ │ -
343 requires (std::is_convertible_v<Index, std::size_t>)
│ │ │ -
│ │ │ -
344 const auto& child(Index i) const
│ │ │ -
345 {
│ │ │ -
346 return children_[i].value();
│ │ │ -
347 }
│ │ │ -
│ │ │ -
348
│ │ │ -
349 template<class Index>
│ │ │ -
350 requires (std::is_convertible_v<Index, std::size_t>)
│ │ │ -
│ │ │ -
351 auto& child(Index i)
│ │ │ -
352 {
│ │ │ -
353 return children_[i].value();
│ │ │ -
354 }
│ │ │ -
│ │ │ -
355
│ │ │ -
356 using Impl::ChildAccessMixIn<DynamicPowerBasisNode<T>>::child;
│ │ │ -
357
│ │ │ -
358 // Historic node interface
│ │ │ -
359
│ │ │ -
360 using ChildType [[deprecated]] = T;
│ │ │ -
361
│ │ │ -
362 static const bool isLeaf [[deprecated]] = false;
│ │ │ -
363 static const bool isPower [[deprecated]] = true;
│ │ │ -
364 static const bool isComposite [[deprecated]] = false;
│ │ │ -
365#ifdef HAVE_DUNE_TYPETREE
│ │ │ -
366 using NodeTag [[deprecated]] = Dune::TypeTree::DynamicPowerNodeTag;
│ │ │ -
367#endif
│ │ │ -
368
│ │ │ -
369 // End of node interface
│ │ │ -
370
│ │ │ -
371 using Element = typename T::Element;
│ │ │ -
372
│ │ │ -
│ │ │ -
373 DynamicPowerBasisNode (std::size_t children)
│ │ │ -
374 : children_(children)
│ │ │ -
375 {}
│ │ │ -
│ │ │ -
376
│ │ │ -
│ │ │ -
377 const Element& element() const
│ │ │ -
378 {
│ │ │ -
379 return child(Dune::Indices::_0).element();
│ │ │ -
380 }
│ │ │ -
│ │ │ -
381
│ │ │ -
382 template<class Index, class TT>
│ │ │ -
│ │ │ -
383 void setChild(Index i, TT&& t)
│ │ │ -
384 {
│ │ │ -
385 children_[i].emplace(std::forward<TT>(t));
│ │ │ -
386 }
│ │ │ -
│ │ │ -
387
│ │ │ -
388 private:
│ │ │ -
389 std::vector<std::optional<T>> children_;
│ │ │ -
390 };
│ │ │ -
│ │ │ -
391
│ │ │ -
392
│ │ │ -
393 template<typename... T>
│ │ │ -
│ │ │ - │ │ │ -
395 public InnerBasisNodeMixin<CompositeBasisNode<T...>, typename TypeListEntry_t<0, TypeList<T...>>::Element>,
│ │ │ -
396 public Impl::ChildAccessMixIn<CompositeBasisNode<T...>>
│ │ │ -
397 {
│ │ │ -
398 public:
│ │ │ -
399
│ │ │ -
400 // Begin of node interface
│ │ │ -
401
│ │ │ -
│ │ │ -
402 static constexpr auto degree()
│ │ │ -
403 {
│ │ │ -
404 return Dune::index_constant<sizeof...(T)>{};
│ │ │ -
405 }
│ │ │ -
│ │ │ -
406
│ │ │ -
407 template<std::size_t i>
│ │ │ -
│ │ │ -
408 const auto& child(Dune::index_constant<i> ii) const
│ │ │ -
409 {
│ │ │ -
410 return children_[ii].value();
│ │ │ -
411 }
│ │ │ -
│ │ │ -
412
│ │ │ -
413 template<std::size_t i>
│ │ │ -
│ │ │ -
414 auto& child(Dune::index_constant<i> ii)
│ │ │ -
415 {
│ │ │ -
416 return children_[ii].value();
│ │ │ -
417 }
│ │ │ -
│ │ │ -
418
│ │ │ -
419 using Impl::ChildAccessMixIn<CompositeBasisNode<T...>>::child;
│ │ │ -
420
│ │ │ -
421 // Historic node interface
│ │ │ -
422
│ │ │ -
423 using ChildTypes [[deprecated]] = std::tuple<T...>;
│ │ │ -
424
│ │ │ -
425 static const bool isLeaf [[deprecated]] = false;
│ │ │ -
426 static const bool isPower [[deprecated]] = false;
│ │ │ -
427 static const bool isComposite [[deprecated]] = true;
│ │ │ -
428#ifdef HAVE_DUNE_TYPETREE
│ │ │ -
429 using NodeTag [[deprecated]] = Dune::TypeTree::CompositeNodeTag;
│ │ │ -
430#endif
│ │ │ -
431
│ │ │ -
432 template<std::size_t k>
│ │ │ -
│ │ │ -
433 struct [[deprecated]] Child {
│ │ │ -
434 static_assert((k < degree()), "child index out of range");
│ │ │ -
435
│ │ │ -
437 using Type = typename std::tuple_element_t<k, std::tuple<T...>>;
│ │ │ -
438
│ │ │ -
439 using type = Type;
│ │ │ -
440 };
│ │ │ -
│ │ │ -
441
│ │ │ -
442 // End of node interface
│ │ │ -
443
│ │ │ -
444 using Element = typename std::tuple_element_t<0, std::tuple<T...>>::Element;
│ │ │ -
445
│ │ │ - │ │ │ -
447
│ │ │ -
│ │ │ -
448 explicit CompositeBasisNode(const T&... children) :
│ │ │ -
449 children_(children...)
│ │ │ -
450 {}
│ │ │ -
│ │ │ -
451
│ │ │ -
│ │ │ -
452 const Element& element() const
│ │ │ -
453 {
│ │ │ -
454 return child(Dune::Indices::_0).element();
│ │ │ -
455 }
│ │ │ -
│ │ │ -
456
│ │ │ -
457 template<std::size_t i, class TT>
│ │ │ -
│ │ │ -
458 void setChild (TT&& t, Dune::index_constant<i> ii = {})
│ │ │ -
459 {
│ │ │ -
460 children_[ii].emplace(std::forward<TT>(t));
│ │ │ -
461 }
│ │ │ -
│ │ │ -
462
│ │ │ -
463 private:
│ │ │ -
464 Dune::TupleVector<std::optional<T>...> children_;
│ │ │ -
465 };
│ │ │ -
│ │ │ -
466
│ │ │ -
467
│ │ │ -
468 template<typename Tree, typename Entity>
│ │ │ -
│ │ │ -
469 void bindTree(Tree& tree, const Entity& entity, std::size_t offset = 0)
│ │ │ -
470 {
│ │ │ -
471 Impl::BasisNodeSetupHelper::setOffset(tree, offset);
│ │ │ -
472 tree.bind(entity);
│ │ │ -
473 }
│ │ │ -
│ │ │ -
474
│ │ │ -
475 template<typename Tree>
│ │ │ -
│ │ │ -
476 void initializeTree(Tree& tree, std::size_t treeIndexOffset = 0)
│ │ │ -
477 {
│ │ │ -
478 Dune::TypeTree::forEachNode(tree, [&](auto& node, const auto& treePath) {
│ │ │ -
479 Impl::BasisNodeSetupHelper::setTreeIndex(node, treeIndexOffset);
│ │ │ -
480 ++treeIndexOffset;
│ │ │ -
481 });
│ │ │ -
482 }
│ │ │ -
│ │ │ -
483
│ │ │ -
484
│ │ │ -
485 } // namespace Functions
│ │ │ -
486
│ │ │ -
487} // namespace Dune
│ │ │ -
488
│ │ │ -
489#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH
│ │ │ +
296#endif // DUNE_FUNCTIONS_ANALYTICFUNCTIONS_POLYNOMIAL_HH
│ │ │ +
friend auto derivative(const Polynomial &p)
Obtain derivative of Polynomial function.
Definition polynomial.hh:222
│ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
void bindTree(Tree &tree, const Entity &entity, std::size_t offset=0)
Definition nodes.hh:469
│ │ │ -
void initializeTree(Tree &tree, std::size_t treeIndexOffset=0)
Definition nodes.hh:476
│ │ │ -
size_type treeIndex() const
Definition nodes.hh:180
│ │ │ -
size_type localIndex(size_type i) const
Definition nodes.hh:149
│ │ │ -
size_type offset() const
Definition nodes.hh:187
│ │ │ -
bool empty() const
Check if the node is empty.
Definition nodes.hh:175
│ │ │ -
size_type size() const
Obtain the number of basis function in the local node.
Definition nodes.hh:162
│ │ │ -
void setOffset(const size_type offset)
Definition nodes.hh:192
│ │ │ -
std::size_t size_type
Definition nodes.hh:141
│ │ │ -
BasisNodeMixin()
Definition nodes.hh:143
│ │ │ -
void setSize(const size_type size)
Definition nodes.hh:197
│ │ │ -
void setTreeIndex(size_type treeIndex)
Definition nodes.hh:202
│ │ │ -
Definition nodes.hh:218
│ │ │ -
static const bool isLeaf
Definition nodes.hh:230
│ │ │ -
static const bool isComposite
Definition nodes.hh:232
│ │ │ -
static const bool isPower
Definition nodes.hh:231
│ │ │ -
static constexpr auto degree()
Definition nodes.hh:223
│ │ │ - │ │ │ -
void bind(const Element &entity)
Definition nodes.hh:249
│ │ │ -
Definition nodes.hh:268
│ │ │ -
auto & child(Index i)
Definition nodes.hh:287
│ │ │ - │ │ │ -
const Element & element() const
Definition nodes.hh:311
│ │ │ -
typename T::Element Element
Definition nodes.hh:307
│ │ │ -
const auto & child(Index i) const
Definition nodes.hh:280
│ │ │ -
static constexpr auto degree()
Definition nodes.hh:273
│ │ │ - │ │ │ - │ │ │ -
static const bool isComposite
Definition nodes.hh:300
│ │ │ -
void setChild(Index i, TT &&t)
Definition nodes.hh:317
│ │ │ - │ │ │ -
const Element & element() const
Definition nodes.hh:377
│ │ │ - │ │ │ -
void setChild(Index i, TT &&t)
Definition nodes.hh:383
│ │ │ -
const auto & child(Index i) const
Definition nodes.hh:344
│ │ │ - │ │ │ -
DynamicPowerBasisNode(std::size_t children)
Definition nodes.hh:373
│ │ │ -
auto & child(Index i)
Definition nodes.hh:351
│ │ │ - │ │ │ -
std::size_t degree() const
Definition nodes.hh:337
│ │ │ -
typename typename SubPreBasis::Node::Element Element
Definition nodes.hh:371
│ │ │ - │ │ │ - │ │ │ -
static constexpr auto degree()
Definition nodes.hh:402
│ │ │ -
static const bool isLeaf
Definition nodes.hh:425
│ │ │ -
auto & child(Dune::index_constant< i > ii)
Definition nodes.hh:414
│ │ │ -
static const bool isPower
Definition nodes.hh:426
│ │ │ -
typename std::tuple_element_t< 0, std::tuple< T... > >::Element Element
Definition nodes.hh:444
│ │ │ -
const Element & element() const
Definition nodes.hh:452
│ │ │ -
const auto & child(Dune::index_constant< i > ii) const
Definition nodes.hh:408
│ │ │ -
static const bool isComposite
Definition nodes.hh:427
│ │ │ -
void setChild(TT &&t, Dune::index_constant< i > ii={})
Definition nodes.hh:458
│ │ │ -
CompositeBasisNode(const T &... children)
Definition nodes.hh:448
│ │ │ - │ │ │ -
typename std::tuple_element_t< k, std::tuple< T... > > Type
The type of the child.
Definition nodes.hh:437
│ │ │ -
Type type
Definition nodes.hh:439
│ │ │ +
Polynomial(std::vector< K >) -> Polynomial< K, std::vector< K > >
│ │ │ +
auto makePolynomial(Coefficients coefficients)
Create Polynomial.
Definition polynomial.hh:268
│ │ │ +
A univariate polynomial implementation.
Definition polynomial.hh:125
│ │ │ +
Polynomial()=default
Default constructor.
│ │ │ +
K operator()(const K &x) const
Evaluate polynomial using the Horner scheme.
Definition polynomial.hh:178
│ │ │ +
C Coefficients
The type of the stored coefficient container.
Definition polynomial.hh:156
│ │ │ +
const Coefficients & coefficients() const
Obtain reference to coefficient vector.
Definition polynomial.hh:230
│ │ │ +
Polynomial(Coefficients coefficients)
Create from container of coefficients.
Definition polynomial.hh:169
│ │ │ +
bool operator==(const Polynomial &other) const
Comparison of coefficients.
Definition polynomial.hh:205
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,636 +1,280 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -nodes.hh │ │ │ │ +polynomial.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_ANALYTICFUNCTIONS_POLYNOMIAL_HH │ │ │ │ +8#define DUNE_FUNCTIONS_ANALYTICFUNCTIONS_POLYNOMIAL_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ 12#include │ │ │ │ -13#include │ │ │ │ -14#include │ │ │ │ -15 │ │ │ │ -16#include │ │ │ │ -17#include │ │ │ │ -18#include │ │ │ │ +13 │ │ │ │ +14 │ │ │ │ +15#include │ │ │ │ +16 │ │ │ │ +17namespace _D_u_n_e { │ │ │ │ +18namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ 19 │ │ │ │ -20#include │ │ │ │ -21#include │ │ │ │ -22 │ │ │ │ -23#ifdef HAVE_DUNE_TYPETREE │ │ │ │ -24#include │ │ │ │ -25#endif │ │ │ │ -26 │ │ │ │ -27namespace _D_u_n_e { │ │ │ │ -28 namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -29 │ │ │ │ -30 │ │ │ │ -31 namespace Impl { │ │ │ │ -32 │ │ │ │ -33 // This class encapsulates the access to the setOffset() │ │ │ │ -34 // and setTreeIndex() methods of a node. This way we │ │ │ │ -35 // can hide the methods from the user but still provide │ │ │ │ -36 // access where this is needed. │ │ │ │ -37 struct BasisNodeSetupHelper │ │ │ │ -38 { │ │ │ │ -39 │ │ │ │ -40 template │ │ │ │ -41 static void setSize(Node& node, const size_type size) │ │ │ │ -42 { │ │ │ │ -43 node.setSize(size); │ │ │ │ -44 } │ │ │ │ -45 │ │ │ │ -46 template │ │ │ │ -47 static void setOffset(Node& node, const size_type offset) │ │ │ │ -48 { │ │ │ │ -49 node.setOffset(offset); │ │ │ │ -50 } │ │ │ │ -51 │ │ │ │ -52 template │ │ │ │ -53 static void setTreeIndex(Node& node, const size_type index) │ │ │ │ -54 { │ │ │ │ -55 node.setTreeIndex(index); │ │ │ │ -56 } │ │ │ │ -57 │ │ │ │ -58 }; │ │ │ │ -59 │ │ │ │ -60 │ │ │ │ -61 │ │ │ │ -62 // A mixin class for generalized child access from │ │ │ │ -63 // multiple indices or a tree path. The derived class │ │ │ │ -64 // only has to provide the child(i) method with │ │ │ │ -65 // a single index for accessing direct children. │ │ │ │ -66 template │ │ │ │ -67 class ChildAccessMixIn │ │ │ │ -68 { │ │ │ │ -69 │ │ │ │ -70 Impl& asImpl() │ │ │ │ -71 { │ │ │ │ -72 return static_cast(*this); │ │ │ │ -73 } │ │ │ │ -74 │ │ │ │ -75 const Impl& asImpl() const │ │ │ │ +20namespace Impl { │ │ │ │ +21 │ │ │ │ +22 // Compute coefficients of derivative of polynomial. │ │ │ │ +23 // Overload for std::vector │ │ │ │ +24 template │ │ │ │ +25 auto polynomialDerivativeCoefficients(const std::vector& │ │ │ │ +coefficients) { │ │ │ │ +26 if (coefficients.size()==0) │ │ │ │ +27 return std::vector(); │ │ │ │ +28 std::vector dpCoefficients(coefficients.size()-1); │ │ │ │ +29 for (size_t i=1; i │ │ │ │ +37 auto polynomialDerivativeCoefficients(const std::array& coefficients) │ │ │ │ +{ │ │ │ │ +38 if constexpr (n==0) │ │ │ │ +39 return coefficients; │ │ │ │ +40 else │ │ │ │ +41 { │ │ │ │ +42 std::array dpCoefficients; │ │ │ │ +43 for (size_t i=1; i │ │ │ │ +55 auto polynomialDerivativeCoefficientsHelper(std::integer_sequence, std::integer_sequence) { │ │ │ │ +56 return std::integer_sequence(); │ │ │ │ +57 } │ │ │ │ +58 │ │ │ │ +59 // Compute coefficients of derivative of polynomial. │ │ │ │ +60 // Overload for std::integer_sequence │ │ │ │ +61 template │ │ │ │ +62 auto polynomialDerivativeCoefficients(std::integer_sequence │ │ │ │ +coefficients) { │ │ │ │ +63 if constexpr (sizeof...(i)==0) │ │ │ │ +64 return coefficients; │ │ │ │ +65 else │ │ │ │ +66 return polynomialDerivativeCoefficientsHelper(coefficients, std:: │ │ │ │ +make_index_sequence()); │ │ │ │ +67 } │ │ │ │ +68 │ │ │ │ +69 // Compute coefficients of derivative of polynomial. │ │ │ │ +70 // Overload for std::tuple │ │ │ │ +71 template │ │ │ │ +72 auto polynomialDerivativeCoefficients(const std::tuple& coefficients) │ │ │ │ +{ │ │ │ │ +73 if constexpr (sizeof...(T)==0) │ │ │ │ +74 return coefficients; │ │ │ │ +75 else │ │ │ │ 76 { │ │ │ │ -77 return static_cast(*this); │ │ │ │ -78 } │ │ │ │ -79 │ │ │ │ -80 public: │ │ │ │ -81 │ │ │ │ -87 template │ │ │ │ -88 const auto& child(II... ii) const │ │ │ │ -89 requires (sizeof...(II) != 1) │ │ │ │ -90 { │ │ │ │ -91 return Dune::TypeTree::child(asImpl(), ii...); │ │ │ │ -92 } │ │ │ │ -93 │ │ │ │ -99 │ │ │ │ -100 template │ │ │ │ -101 auto& child(II... ii) │ │ │ │ -102 requires (sizeof...(II) != 1) │ │ │ │ -103 { │ │ │ │ -104 return Dune::TypeTree::child(asImpl(), ii...); │ │ │ │ -105 } │ │ │ │ -106 │ │ │ │ -112 template │ │ │ │ -113 const auto& child(Dune::HybridMultiIndex treePath) const │ │ │ │ -114 { │ │ │ │ -115 return Dune::TypeTree::child(asImpl(), treePath); │ │ │ │ -116 } │ │ │ │ -117 │ │ │ │ -123 template │ │ │ │ -124 auto& child(Dune::HybridMultiIndex treePath) │ │ │ │ -125 { │ │ │ │ -126 return Dune::TypeTree::child(asImpl(), treePath); │ │ │ │ -127 } │ │ │ │ +77 // Notice that std::multiplies has issues with signed types. │ │ │ │ +78 // E.g., `decltype(-2,2ul)` is `long unsigned int`. │ │ │ │ +79 // Hence the same is deduced as return type in std::multiplies. │ │ │ │ +80 // To avoid this, we explicitly pass the exponent `i+1` as signed type. │ │ │ │ +81 // If the coefficient is signed, both types are now signed and │ │ │ │ +82 // so is the deduced result type of std::multiplies. │ │ │ │ +83 auto mult = Dune::Hybrid::hybridFunctor(std::multiplies()); │ │ │ │ +84 return Dune::unpackIntegerSequence([&](auto... i) { │ │ │ │ +85 using signed_type = std::conditional_t, │ │ │ │ +86 long signed int, signed int>; │ │ │ │ +87 return std::tuple(mult(std::get(coefficients), │ │ │ │ +88 std::integral_constant()) ...); │ │ │ │ +89 }, std::make_index_sequence()); │ │ │ │ +90 } │ │ │ │ +91 } │ │ │ │ +92 │ │ │ │ +93} // namespace Impl in Dune::Functions:: │ │ │ │ +94 │ │ │ │ +95 │ │ │ │ +96 │ │ │ │ +123template> │ │ │ │ +_1_2_4class _P_o_l_y_n_o_m_i_a_l │ │ │ │ +125{ │ │ │ │ +126 template │ │ │ │ +127 struct IsIntegerSequence : public std::false_type {}; │ │ │ │ 128 │ │ │ │ -129 }; │ │ │ │ -130 │ │ │ │ -131 } // end namespace Impl │ │ │ │ -132 │ │ │ │ -133 │ │ │ │ -_1_3_4 class _B_a_s_i_s_N_o_d_e_M_i_x_i_n │ │ │ │ -135 { │ │ │ │ -136 │ │ │ │ -137 friend struct Impl::BasisNodeSetupHelper; │ │ │ │ -138 │ │ │ │ -139 public: │ │ │ │ -140 │ │ │ │ -_1_4_1 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ -142 │ │ │ │ -_1_4_3 _B_a_s_i_s_N_o_d_e_M_i_x_i_n() : │ │ │ │ -144 offset_(0), │ │ │ │ -145 size_(0), │ │ │ │ -146 treeIndex_(0) │ │ │ │ -147 {} │ │ │ │ -148 │ │ │ │ -_1_4_9 _s_i_z_e___t_y_p_e _l_o_c_a_l_I_n_d_e_x(_s_i_z_e___t_y_p_e i) const │ │ │ │ -150 { │ │ │ │ -151 assert(i < size_); │ │ │ │ -152 return offset_ + i; │ │ │ │ -153 } │ │ │ │ +129 template │ │ │ │ +130 struct IsIntegerSequence> : public std:: │ │ │ │ +true_type {}; │ │ │ │ +131 │ │ │ │ +141 template │ │ │ │ +142 static void add(K& y, const Coefficient &c) │ │ │ │ +143 { │ │ │ │ +144 if constexpr (!IsIntegralConstant::value) │ │ │ │ +145 { │ │ │ │ +146 if (c!=0) │ │ │ │ +147 y += c; │ │ │ │ +148 } │ │ │ │ +149 else │ │ │ │ +150 y += c; │ │ │ │ +151 } │ │ │ │ +152 │ │ │ │ +153public: │ │ │ │ 154 │ │ │ │ -_1_6_2 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ -163 { │ │ │ │ -164 return size_; │ │ │ │ -165 } │ │ │ │ -166 │ │ │ │ -_1_7_5 bool _e_m_p_t_y() const │ │ │ │ -176 { │ │ │ │ -177 return (size_ == 0); │ │ │ │ -178 } │ │ │ │ -179 │ │ │ │ -_1_8_0 _s_i_z_e___t_y_p_e _t_r_e_e_I_n_d_e_x() const │ │ │ │ -181 { │ │ │ │ -182 return treeIndex_; │ │ │ │ -183 } │ │ │ │ -184 │ │ │ │ -185 protected: │ │ │ │ -186 │ │ │ │ -_1_8_7 _s_i_z_e___t_y_p_e _o_f_f_s_e_t() const │ │ │ │ -188 { │ │ │ │ -189 return offset_; │ │ │ │ -190 } │ │ │ │ -191 │ │ │ │ -_1_9_2 void _s_e_t_O_f_f_s_e_t(const _s_i_z_e___t_y_p_e _o_f_f_s_e_t) │ │ │ │ -193 { │ │ │ │ -194 offset_ = _o_f_f_s_e_t; │ │ │ │ -195 } │ │ │ │ -196 │ │ │ │ -_1_9_7 void _s_e_t_S_i_z_e(const _s_i_z_e___t_y_p_e _s_i_z_e) │ │ │ │ -198 { │ │ │ │ -199 size_ = _s_i_z_e; │ │ │ │ -200 } │ │ │ │ -201 │ │ │ │ -_2_0_2 void _s_e_t_T_r_e_e_I_n_d_e_x(_s_i_z_e___t_y_p_e _t_r_e_e_I_n_d_e_x) │ │ │ │ -203 { │ │ │ │ -204 treeIndex_ = _t_r_e_e_I_n_d_e_x; │ │ │ │ -205 } │ │ │ │ -206 │ │ │ │ -207 private: │ │ │ │ -208 │ │ │ │ -209 _s_i_z_e___t_y_p_e offset_; │ │ │ │ -210 _s_i_z_e___t_y_p_e size_; │ │ │ │ -211 _s_i_z_e___t_y_p_e treeIndex_; │ │ │ │ +_1_5_6 using _C_o_e_f_f_i_c_i_e_n_t_s = C; │ │ │ │ +157 │ │ │ │ +_1_5_9 _P_o_l_y_n_o_m_i_a_l() = default; │ │ │ │ +160 │ │ │ │ +_1_6_9 _P_o_l_y_n_o_m_i_a_l(_C_o_e_f_f_i_c_i_e_n_t_s _c_o_e_f_f_i_c_i_e_n_t_s) : │ │ │ │ +170 coefficients_(std::move(_c_o_e_f_f_i_c_i_e_n_t_s)) │ │ │ │ +171 {} │ │ │ │ +172 │ │ │ │ +_1_7_8 K _o_p_e_r_a_t_o_r_(_)_ (const K& x) const │ │ │ │ +179 { │ │ │ │ +180 using namespace Dune::Indices; │ │ │ │ +181 │ │ │ │ +182 auto n = Dune::Hybrid::size(coefficients_); │ │ │ │ +183 │ │ │ │ +184 // Explicitly handling the corner case of an empty coefficient set │ │ │ │ +185 // allows to save one multiplication. │ │ │ │ +186 return Hybrid::ifElse(Hybrid::equal_to(n, _0), │ │ │ │ +187 [&](auto id) { /* then */ │ │ │ │ +188 // No coefficients at all │ │ │ │ +189 return K(0); │ │ │ │ +190 }, │ │ │ │ +191 [&](auto id) { /* else */ │ │ │ │ +192 // Do the Horner scheme knowing that there is at least one coefficient │ │ │ │ +193 K y = Hybrid::elementAt(coefficients_, Hybrid::minus(id(n), _1) ); │ │ │ │ +194 Dune::Hybrid::forEach(Dune::range(Hybrid::minus(id(n), _1) ), [&](auto i) │ │ │ │ +195 { │ │ │ │ +196 y *= x; │ │ │ │ +197 // Do y+= _next coefficient_, unless that coefficient is std:: │ │ │ │ +integral_constant<0>. │ │ │ │ +198 add(y,Hybrid::elementAt(coefficients_, Hybrid::minus(Hybrid::minus(id │ │ │ │ +(n),_2), i))); │ │ │ │ +199 }); │ │ │ │ +200 return y; │ │ │ │ +201 }); │ │ │ │ +202 } │ │ │ │ +203 │ │ │ │ +_2_0_5 bool _o_p_e_r_a_t_o_r_=_=(const _P_o_l_y_n_o_m_i_a_l& other) const │ │ │ │ +206 { │ │ │ │ +207 if constexpr (IsIntegerSequence::value) │ │ │ │ +208 return true; │ │ │ │ +209 else │ │ │ │ +210 return _c_o_e_f_f_i_c_i_e_n_t_s()==other._c_o_e_f_f_i_c_i_e_n_t_s(); │ │ │ │ +211 } │ │ │ │ 212 │ │ │ │ -213 }; │ │ │ │ -214 │ │ │ │ -215 │ │ │ │ -_2_1_6 class _L_e_a_f_B_a_s_i_s_N_o_d_e : │ │ │ │ -217 public _B_a_s_i_s_N_o_d_e_M_i_x_i_n │ │ │ │ -218 { │ │ │ │ -219 public: │ │ │ │ -220 │ │ │ │ -221 // Begin of node interface │ │ │ │ -222 │ │ │ │ -_2_2_3 static constexpr auto _d_e_g_r_e_e() │ │ │ │ -224 { │ │ │ │ -225 return Dune::index_constant<0>{}; │ │ │ │ -226 } │ │ │ │ -227 │ │ │ │ -228 // Historic node interface │ │ │ │ -229 │ │ │ │ -_2_3_0 static const bool _i_s_L_e_a_f [[deprecated]] = true; │ │ │ │ -_2_3_1 static const bool _i_s_P_o_w_e_r [[deprecated]] = false; │ │ │ │ -_2_3_2 static const bool _i_s_C_o_m_p_o_s_i_t_e [[deprecated]] = false; │ │ │ │ -233#ifdef HAVE_DUNE_TYPETREE │ │ │ │ -234 using NodeTag [[deprecated]] = Dune::TypeTree::LeafNodeTag; │ │ │ │ -235#endif │ │ │ │ -236 │ │ │ │ -237 // End of node interface │ │ │ │ +_2_2_2 friend auto _d_e_r_i_v_a_t_i_v_e(const _P_o_l_y_n_o_m_i_a_l& p) │ │ │ │ +223 { │ │ │ │ +224 auto derivativeCoefficients = Impl::polynomialDerivativeCoefficients │ │ │ │ +(p._c_o_e_f_f_i_c_i_e_n_t_s()); │ │ │ │ +225 using DerivativeCoefficients = decltype(derivativeCoefficients); │ │ │ │ +226 return _P_o_l_y_n_o_m_i_a_l_<_K_,_ _D_e_r_i_v_a_t_i_v_e_C_o_e_f_f_i_c_i_e_n_t_s_>(std::move │ │ │ │ +(derivativeCoefficients)); │ │ │ │ +227 } │ │ │ │ +228 │ │ │ │ +_2_3_0 const _C_o_e_f_f_i_c_i_e_n_t_s& _c_o_e_f_f_i_c_i_e_n_t_s() const │ │ │ │ +231 { │ │ │ │ +232 return coefficients_; │ │ │ │ +233 } │ │ │ │ +234 │ │ │ │ +235private: │ │ │ │ +236 _C_o_e_f_f_i_c_i_e_n_t_s coefficients_; │ │ │ │ +237}; │ │ │ │ 238 │ │ │ │ -239 }; │ │ │ │ +239 │ │ │ │ 240 │ │ │ │ -241 │ │ │ │ -242 │ │ │ │ -243 template │ │ │ │ -_2_4_4 class _I_n_n_e_r_B_a_s_i_s_N_o_d_e_M_i_x_i_n │ │ │ │ -245 : public _B_a_s_i_s_N_o_d_e_M_i_x_i_n │ │ │ │ -246 { │ │ │ │ -247 public: │ │ │ │ -248 │ │ │ │ -_2_4_9 void _b_i_n_d(const Element& entity) │ │ │ │ -250 { │ │ │ │ -251 Node& self = *static_cast(this); │ │ │ │ -252 std::size_t _o_f_f_s_e_t = this->_o_f_f_s_e_t(); │ │ │ │ -253 Dune::Hybrid::forEach(Dune::range(self.degree()), [&](auto i) { │ │ │ │ -254 bindTree(self.child(i), entity, offset); │ │ │ │ -255 offset += self.child(i).size(); │ │ │ │ -256 }); │ │ │ │ -257 this->_s_e_t_S_i_z_e(offset - this->_o_f_f_s_e_t()); │ │ │ │ -258 } │ │ │ │ -259 │ │ │ │ -260 }; │ │ │ │ -261 │ │ │ │ -262 │ │ │ │ -263 │ │ │ │ -264 template │ │ │ │ -_2_6_5 class _P_o_w_e_r_B_a_s_i_s_N_o_d_e : │ │ │ │ -266 public _I_n_n_e_r_B_a_s_i_s_N_o_d_e_M_i_x_i_n, typename T::Element>, │ │ │ │ -267 public Impl::ChildAccessMixIn> │ │ │ │ -268 { │ │ │ │ -269 public: │ │ │ │ -270 │ │ │ │ -271 // Begin of node interface │ │ │ │ +241template │ │ │ │ +_2_4_2_P_o_l_y_n_o_m_i_a_l(std::vector) -> _P_o_l_y_n_o_m_i_a_l_<_K_,_ _s_t_d_:_:_v_e_c_t_o_r_<_K_>>; │ │ │ │ +243 │ │ │ │ +244template │ │ │ │ +_2_4_5_P_o_l_y_n_o_m_i_a_l(std::array) -> _P_o_l_y_n_o_m_i_a_l_<_K_,_ _s_t_d_:_:_a_r_r_a_y_<_K_,_n_>>; │ │ │ │ +246 │ │ │ │ +247template │ │ │ │ +_2_4_8_P_o_l_y_n_o_m_i_a_l(std::integer_sequence) -> _P_o_l_y_n_o_m_i_a_l>; │ │ │ │ +249 │ │ │ │ +250template │ │ │ │ +_2_5_1_P_o_l_y_n_o_m_i_a_l(std::initializer_list) -> _P_o_l_y_n_o_m_i_a_l_<_K_,_ _s_t_d_:_:_v_e_c_t_o_r_<_K_>>; │ │ │ │ +252 │ │ │ │ +253 │ │ │ │ +254 │ │ │ │ +267template │ │ │ │ +_2_6_8auto _m_a_k_e_P_o_l_y_n_o_m_i_a_l(Coefficients coefficients) │ │ │ │ +269{ │ │ │ │ +270 return _P_o_l_y_n_o_m_i_a_l_<_K_,_ _C_o_e_f_f_i_c_i_e_n_t_s_>(std::move(coefficients)); │ │ │ │ +271} │ │ │ │ 272 │ │ │ │ -_2_7_3 static constexpr auto _d_e_g_r_e_e() │ │ │ │ -274 { │ │ │ │ -275 return Dune::index_constant{}; │ │ │ │ -276 } │ │ │ │ -277 │ │ │ │ -278 template │ │ │ │ -279 requires (std::is_convertible_v) │ │ │ │ -_2_8_0 const auto& _c_h_i_l_d(Index i) const │ │ │ │ -281 { │ │ │ │ -282 return children_[i].value(); │ │ │ │ -283 } │ │ │ │ -284 │ │ │ │ -285 template │ │ │ │ -286 requires (std::is_convertible_v) │ │ │ │ -_2_8_7 auto& _c_h_i_l_d(Index i) │ │ │ │ -288 { │ │ │ │ -289 return children_[i].value(); │ │ │ │ -290 } │ │ │ │ +282template │ │ │ │ +_2_8_3auto _m_a_k_e_P_o_l_y_n_o_m_i_a_l(std::initializer_list coefficients) │ │ │ │ +284{ │ │ │ │ +285 return _P_o_l_y_n_o_m_i_a_l_<_K_>(std::move(coefficients)); │ │ │ │ +286} │ │ │ │ +287 │ │ │ │ +288 │ │ │ │ +289 │ │ │ │ +290 │ │ │ │ 291 │ │ │ │ -292 using Impl::ChildAccessMixIn<_P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_T_,_ _n_>>_:_:_c_h_i_l_d; │ │ │ │ +292}} // namespace Dune::Functions │ │ │ │ 293 │ │ │ │ -294 // Historic node interface │ │ │ │ +294 │ │ │ │ 295 │ │ │ │ -296 using ChildType [[deprecated]] = T; │ │ │ │ -297 │ │ │ │ -_2_9_8 static const bool _i_s_L_e_a_f [[deprecated]] = false; │ │ │ │ -_2_9_9 static const bool _i_s_P_o_w_e_r [[deprecated]] = true; │ │ │ │ -_3_0_0 static const bool _i_s_C_o_m_p_o_s_i_t_e [[deprecated]] = false; │ │ │ │ -301#ifdef HAVE_DUNE_TYPETREE │ │ │ │ -302 using NodeTag [[deprecated]] = Dune::TypeTree::PowerNodeTag; │ │ │ │ -303#endif │ │ │ │ -304 │ │ │ │ -305 // End of node interface │ │ │ │ -306 │ │ │ │ -_3_0_7 using _E_l_e_m_e_n_t = typename T::Element; │ │ │ │ -308 │ │ │ │ -_3_0_9 _P_o_w_e_r_B_a_s_i_s_N_o_d_e() = default; │ │ │ │ -310 │ │ │ │ -_3_1_1 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ -312 { │ │ │ │ -313 return _c_h_i_l_d(Dune::Indices::_0).element(); │ │ │ │ -314 } │ │ │ │ -315 │ │ │ │ -316 template │ │ │ │ -_3_1_7 void _s_e_t_C_h_i_l_d(Index i, TT&& t) │ │ │ │ -318 { │ │ │ │ -319 children_[i].emplace(std::forward(t)); │ │ │ │ -320 } │ │ │ │ -321 │ │ │ │ -322 private: │ │ │ │ -323 std::array, n> children_; │ │ │ │ -324 }; │ │ │ │ -325 │ │ │ │ -326 │ │ │ │ -327 │ │ │ │ -328 template │ │ │ │ -_3_2_9 class _D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e : │ │ │ │ -330 public _I_n_n_e_r_B_a_s_i_s_N_o_d_e_M_i_x_i_n, typename T::Element>, │ │ │ │ -331 public Impl::ChildAccessMixIn> │ │ │ │ -332 { │ │ │ │ -333 public: │ │ │ │ -334 │ │ │ │ -335 // Begin of node interface │ │ │ │ -336 │ │ │ │ -_3_3_7 std::size_t _d_e_g_r_e_e() const │ │ │ │ -338 { │ │ │ │ -339 return children_.size(); │ │ │ │ -340 } │ │ │ │ -341 │ │ │ │ -342 template │ │ │ │ -343 requires (std::is_convertible_v) │ │ │ │ -_3_4_4 const auto& _c_h_i_l_d(Index i) const │ │ │ │ -345 { │ │ │ │ -346 return children_[i].value(); │ │ │ │ -347 } │ │ │ │ -348 │ │ │ │ -349 template │ │ │ │ -350 requires (std::is_convertible_v) │ │ │ │ -_3_5_1 auto& _c_h_i_l_d(Index i) │ │ │ │ -352 { │ │ │ │ -353 return children_[i].value(); │ │ │ │ -354 } │ │ │ │ -355 │ │ │ │ -356 using Impl::ChildAccessMixIn<_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_T_>>_:_:_c_h_i_l_d; │ │ │ │ -357 │ │ │ │ -358 // Historic node interface │ │ │ │ -359 │ │ │ │ -360 using ChildType [[deprecated]] = T; │ │ │ │ -361 │ │ │ │ -_3_6_2 static const bool _i_s_L_e_a_f [[deprecated]] = false; │ │ │ │ -_3_6_3 static const bool _i_s_P_o_w_e_r [[deprecated]] = true; │ │ │ │ -_3_6_4 static const bool _i_s_C_o_m_p_o_s_i_t_e [[deprecated]] = false; │ │ │ │ -365#ifdef HAVE_DUNE_TYPETREE │ │ │ │ -366 using NodeTag [[deprecated]] = Dune::TypeTree::DynamicPowerNodeTag; │ │ │ │ -367#endif │ │ │ │ -368 │ │ │ │ -369 // End of node interface │ │ │ │ -370 │ │ │ │ -_3_7_1 using _E_l_e_m_e_n_t = typename T::Element; │ │ │ │ -372 │ │ │ │ -_3_7_3 _D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e (std::size_t children) │ │ │ │ -374 : children_(children) │ │ │ │ -375 {} │ │ │ │ -376 │ │ │ │ -_3_7_7 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ -378 { │ │ │ │ -379 return _c_h_i_l_d(Dune::Indices::_0).element(); │ │ │ │ -380 } │ │ │ │ -381 │ │ │ │ -382 template │ │ │ │ -_3_8_3 void _s_e_t_C_h_i_l_d(Index i, TT&& t) │ │ │ │ -384 { │ │ │ │ -385 children_[i].emplace(std::forward(t)); │ │ │ │ -386 } │ │ │ │ -387 │ │ │ │ -388 private: │ │ │ │ -389 std::vector> children_; │ │ │ │ -390 }; │ │ │ │ -391 │ │ │ │ -392 │ │ │ │ -393 template │ │ │ │ -_3_9_4 class _C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e : │ │ │ │ -395 public _I_n_n_e_r_B_a_s_i_s_N_o_d_e_M_i_x_i_n, typename │ │ │ │ -TypeListEntry_t<0, TypeList>::Element>, │ │ │ │ -396 public Impl::ChildAccessMixIn> │ │ │ │ -397 { │ │ │ │ -398 public: │ │ │ │ -399 │ │ │ │ -400 // Begin of node interface │ │ │ │ -401 │ │ │ │ -_4_0_2 static constexpr auto _d_e_g_r_e_e() │ │ │ │ -403 { │ │ │ │ -404 return Dune::index_constant{}; │ │ │ │ -405 } │ │ │ │ -406 │ │ │ │ -407 template │ │ │ │ -_4_0_8 const auto& _c_h_i_l_d(Dune::index_constant ii) const │ │ │ │ -409 { │ │ │ │ -410 return children_[ii].value(); │ │ │ │ -411 } │ │ │ │ -412 │ │ │ │ -413 template │ │ │ │ -_4_1_4 auto& _c_h_i_l_d(Dune::index_constant ii) │ │ │ │ -415 { │ │ │ │ -416 return children_[ii].value(); │ │ │ │ -417 } │ │ │ │ -418 │ │ │ │ -419 using Impl::ChildAccessMixIn<_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e>_:_:_c_h_i_l_d; │ │ │ │ -420 │ │ │ │ -421 // Historic node interface │ │ │ │ -422 │ │ │ │ -423 using ChildTypes [[deprecated]] = std::tuple; │ │ │ │ -424 │ │ │ │ -_4_2_5 static const bool _i_s_L_e_a_f [[deprecated]] = false; │ │ │ │ -_4_2_6 static const bool _i_s_P_o_w_e_r [[deprecated]] = false; │ │ │ │ -_4_2_7 static const bool _i_s_C_o_m_p_o_s_i_t_e [[deprecated]] = true; │ │ │ │ -428#ifdef HAVE_DUNE_TYPETREE │ │ │ │ -429 using NodeTag [[deprecated]] = Dune::TypeTree::CompositeNodeTag; │ │ │ │ -430#endif │ │ │ │ -431 │ │ │ │ -432 template │ │ │ │ -_4_3_3 struct [[deprecated]] _C_h_i_l_d { │ │ │ │ -434 static_assert((k < _d_e_g_r_e_e()), "child index out of range"); │ │ │ │ -435 │ │ │ │ -_4_3_7 using _T_y_p_e = typename std::tuple_element_t>; │ │ │ │ -438 │ │ │ │ -_4_3_9 using _t_y_p_e = _T_y_p_e; │ │ │ │ -440 }; │ │ │ │ -441 │ │ │ │ -442 // End of node interface │ │ │ │ -443 │ │ │ │ -_4_4_4 using _E_l_e_m_e_n_t = typename std::tuple_element_t<0, std::tuple>_:_: │ │ │ │ -_E_l_e_m_e_n_t; │ │ │ │ -445 │ │ │ │ -_4_4_6 _C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e() = default; │ │ │ │ -447 │ │ │ │ -_4_4_8 explicit _C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e(const T&... children) : │ │ │ │ -449 children_(children...) │ │ │ │ -450 {} │ │ │ │ -451 │ │ │ │ -_4_5_2 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ -453 { │ │ │ │ -454 return _c_h_i_l_d(Dune::Indices::_0).element(); │ │ │ │ -455 } │ │ │ │ -456 │ │ │ │ -457 template │ │ │ │ -_4_5_8 void _s_e_t_C_h_i_l_d (TT&& t, Dune::index_constant ii = {}) │ │ │ │ -459 { │ │ │ │ -460 children_[ii].emplace(std::forward(t)); │ │ │ │ -461 } │ │ │ │ -462 │ │ │ │ -463 private: │ │ │ │ -464 Dune::TupleVector...> children_; │ │ │ │ -465 }; │ │ │ │ -466 │ │ │ │ -467 │ │ │ │ -468 template │ │ │ │ -_4_6_9 void _b_i_n_d_T_r_e_e(Tree& tree, const Entity& entity, std::size_t offset = 0) │ │ │ │ -470 { │ │ │ │ -471 Impl::BasisNodeSetupHelper::setOffset(tree, offset); │ │ │ │ -472 tree.bind(entity); │ │ │ │ -473 } │ │ │ │ -474 │ │ │ │ -475 template │ │ │ │ -_4_7_6 void _i_n_i_t_i_a_l_i_z_e_T_r_e_e(Tree& tree, std::size_t treeIndexOffset = 0) │ │ │ │ -477 { │ │ │ │ -478 Dune::TypeTree::forEachNode(tree, [&](auto& node, const auto& treePath) { │ │ │ │ -479 Impl::BasisNodeSetupHelper::setTreeIndex(node, treeIndexOffset); │ │ │ │ -480 ++treeIndexOffset; │ │ │ │ -481 }); │ │ │ │ -482 } │ │ │ │ -483 │ │ │ │ -484 │ │ │ │ -485 } // namespace Functions │ │ │ │ -486 │ │ │ │ -487} // namespace Dune │ │ │ │ -488 │ │ │ │ -489#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH │ │ │ │ +296#endif // DUNE_FUNCTIONS_ANALYTICFUNCTIONS_POLYNOMIAL_HH │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_n_o_m_i_a_l_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ +friend auto derivative(const Polynomial &p) │ │ │ │ +Obtain derivative of Polynomial function. │ │ │ │ +DDeeffiinniittiioonn polynomial.hh:222 │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_b_i_n_d_T_r_e_e │ │ │ │ -void bindTree(Tree &tree, const Entity &entity, std::size_t offset=0) │ │ │ │ -DDeeffiinniittiioonn nodes.hh:469 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_i_n_i_t_i_a_l_i_z_e_T_r_e_e │ │ │ │ -void initializeTree(Tree &tree, std::size_t treeIndexOffset=0) │ │ │ │ -DDeeffiinniittiioonn nodes.hh:476 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_t_r_e_e_I_n_d_e_x │ │ │ │ -size_type treeIndex() const │ │ │ │ -DDeeffiinniittiioonn nodes.hh:180 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_l_o_c_a_l_I_n_d_e_x │ │ │ │ -size_type localIndex(size_type i) const │ │ │ │ -DDeeffiinniittiioonn nodes.hh:149 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_o_f_f_s_e_t │ │ │ │ -size_type offset() const │ │ │ │ -DDeeffiinniittiioonn nodes.hh:187 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_e_m_p_t_y │ │ │ │ -bool empty() const │ │ │ │ -Check if the node is empty. │ │ │ │ -DDeeffiinniittiioonn nodes.hh:175 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_i_z_e │ │ │ │ -size_type size() const │ │ │ │ -Obtain the number of basis function in the local node. │ │ │ │ -DDeeffiinniittiioonn nodes.hh:162 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_e_t_O_f_f_s_e_t │ │ │ │ -void setOffset(const size_type offset) │ │ │ │ -DDeeffiinniittiioonn nodes.hh:192 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -DDeeffiinniittiioonn nodes.hh:141 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n │ │ │ │ -BasisNodeMixin() │ │ │ │ -DDeeffiinniittiioonn nodes.hh:143 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_e_t_S_i_z_e │ │ │ │ -void setSize(const size_type size) │ │ │ │ -DDeeffiinniittiioonn nodes.hh:197 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_e_t_T_r_e_e_I_n_d_e_x │ │ │ │ -void setTreeIndex(size_type treeIndex) │ │ │ │ -DDeeffiinniittiioonn nodes.hh:202 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ -DDeeffiinniittiioonn nodes.hh:218 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_B_a_s_i_s_N_o_d_e_:_:_i_s_L_e_a_f │ │ │ │ -static const bool isLeaf │ │ │ │ -DDeeffiinniittiioonn nodes.hh:230 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_B_a_s_i_s_N_o_d_e_:_:_i_s_C_o_m_p_o_s_i_t_e │ │ │ │ -static const bool isComposite │ │ │ │ -DDeeffiinniittiioonn nodes.hh:232 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_B_a_s_i_s_N_o_d_e_:_:_i_s_P_o_w_e_r │ │ │ │ -static const bool isPower │ │ │ │ -DDeeffiinniittiioonn nodes.hh:231 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_B_a_s_i_s_N_o_d_e_:_:_d_e_g_r_e_e │ │ │ │ -static constexpr auto degree() │ │ │ │ -DDeeffiinniittiioonn nodes.hh:223 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_n_n_e_r_B_a_s_i_s_N_o_d_e_M_i_x_i_n │ │ │ │ -DDeeffiinniittiioonn nodes.hh:246 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_n_n_e_r_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_b_i_n_d │ │ │ │ -void bind(const Element &entity) │ │ │ │ -DDeeffiinniittiioonn nodes.hh:249 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e │ │ │ │ -DDeeffiinniittiioonn nodes.hh:268 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ -auto & child(Index i) │ │ │ │ -DDeeffiinniittiioonn nodes.hh:287 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_ _t_y_p_e_n_a_m_e_ _S_u_b_P_r_e_B_a_s_i_s_:_:_N_o_d_e_,_ _C_ _>_:_:_i_s_L_e_a_f │ │ │ │ -static const bool isLeaf │ │ │ │ -DDeeffiinniittiioonn nodes.hh:298 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e_:_:_e_l_e_m_e_n_t │ │ │ │ -const Element & element() const │ │ │ │ -DDeeffiinniittiioonn nodes.hh:311 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e_:_:_E_l_e_m_e_n_t │ │ │ │ -typename T::Element Element │ │ │ │ -DDeeffiinniittiioonn nodes.hh:307 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ -const auto & child(Index i) const │ │ │ │ -DDeeffiinniittiioonn nodes.hh:280 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e_:_:_d_e_g_r_e_e │ │ │ │ -static constexpr auto degree() │ │ │ │ -DDeeffiinniittiioonn nodes.hh:273 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e │ │ │ │ -PowerBasisNode()=default │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_ _t_y_p_e_n_a_m_e_ _S_u_b_P_r_e_B_a_s_i_s_:_:_N_o_d_e_,_ _C_ _>_:_:_i_s_P_o_w_e_r │ │ │ │ -static const bool isPower │ │ │ │ -DDeeffiinniittiioonn nodes.hh:299 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_ _t_y_p_e_n_a_m_e_ _S_u_b_P_r_e_B_a_s_i_s_:_:_N_o_d_e_,_ _C_ _>_:_:_i_s_C_o_m_p_o_s_i_t_e │ │ │ │ -static const bool isComposite │ │ │ │ -DDeeffiinniittiioonn nodes.hh:300 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ -void setChild(Index i, TT &&t) │ │ │ │ -DDeeffiinniittiioonn nodes.hh:317 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e │ │ │ │ -DDeeffiinniittiioonn nodes.hh:332 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e_:_:_e_l_e_m_e_n_t │ │ │ │ -const Element & element() const │ │ │ │ -DDeeffiinniittiioonn nodes.hh:377 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_ _t_y_p_e_n_a_m_e_ _S_u_b_P_r_e_B_a_s_i_s_:_:_N_o_d_e_ _>_:_:_i_s_L_e_a_f │ │ │ │ -static const bool isLeaf │ │ │ │ -DDeeffiinniittiioonn nodes.hh:362 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ -void setChild(Index i, TT &&t) │ │ │ │ -DDeeffiinniittiioonn nodes.hh:383 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ -const auto & child(Index i) const │ │ │ │ -DDeeffiinniittiioonn nodes.hh:344 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_ _t_y_p_e_n_a_m_e_ _S_u_b_P_r_e_B_a_s_i_s_:_:_N_o_d_e_ _>_:_:_i_s_P_o_w_e_r │ │ │ │ -static const bool isPower │ │ │ │ -DDeeffiinniittiioonn nodes.hh:363 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e │ │ │ │ -DynamicPowerBasisNode(std::size_t children) │ │ │ │ -DDeeffiinniittiioonn nodes.hh:373 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ -auto & child(Index i) │ │ │ │ -DDeeffiinniittiioonn nodes.hh:351 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_ _t_y_p_e_n_a_m_e_ _S_u_b_P_r_e_B_a_s_i_s_:_:_N_o_d_e_ _>_:_: │ │ │ │ -_i_s_C_o_m_p_o_s_i_t_e │ │ │ │ -static const bool isComposite │ │ │ │ -DDeeffiinniittiioonn nodes.hh:364 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e_:_:_d_e_g_r_e_e │ │ │ │ -std::size_t degree() const │ │ │ │ -DDeeffiinniittiioonn nodes.hh:337 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_ _t_y_p_e_n_a_m_e_ _S_u_b_P_r_e_B_a_s_i_s_:_:_N_o_d_e_ _>_:_:_E_l_e_m_e_n_t │ │ │ │ -typename typename SubPreBasis::Node::Element Element │ │ │ │ -DDeeffiinniittiioonn nodes.hh:371 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e │ │ │ │ -DDeeffiinniittiioonn nodes.hh:397 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e │ │ │ │ -CompositeBasisNode()=default │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_:_:_d_e_g_r_e_e │ │ │ │ -static constexpr auto degree() │ │ │ │ -DDeeffiinniittiioonn nodes.hh:402 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_<_ _t_y_p_e_n_a_m_e_ _S_P_B_:_:_N_o_d_e_._._._ _>_:_:_i_s_L_e_a_f │ │ │ │ -static const bool isLeaf │ │ │ │ -DDeeffiinniittiioonn nodes.hh:425 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ -auto & child(Dune::index_constant< i > ii) │ │ │ │ -DDeeffiinniittiioonn nodes.hh:414 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_<_ _t_y_p_e_n_a_m_e_ _S_P_B_:_:_N_o_d_e_._._._ _>_:_:_i_s_P_o_w_e_r │ │ │ │ -static const bool isPower │ │ │ │ -DDeeffiinniittiioonn nodes.hh:426 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_<_ _t_y_p_e_n_a_m_e_ _S_P_B_:_:_N_o_d_e_._._._ _>_:_:_E_l_e_m_e_n_t │ │ │ │ -typename std::tuple_element_t< 0, std::tuple< T... > >::Element Element │ │ │ │ -DDeeffiinniittiioonn nodes.hh:444 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_:_:_e_l_e_m_e_n_t │ │ │ │ -const Element & element() const │ │ │ │ -DDeeffiinniittiioonn nodes.hh:452 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ -const auto & child(Dune::index_constant< i > ii) const │ │ │ │ -DDeeffiinniittiioonn nodes.hh:408 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_<_ _t_y_p_e_n_a_m_e_ _S_P_B_:_:_N_o_d_e_._._._ _>_:_:_i_s_C_o_m_p_o_s_i_t_e │ │ │ │ -static const bool isComposite │ │ │ │ -DDeeffiinniittiioonn nodes.hh:427 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ -void setChild(TT &&t, Dune::index_constant< i > ii={}) │ │ │ │ -DDeeffiinniittiioonn nodes.hh:458 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e │ │ │ │ -CompositeBasisNode(const T &... children) │ │ │ │ -DDeeffiinniittiioonn nodes.hh:448 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_:_:_C_h_i_l_d │ │ │ │ -DDeeffiinniittiioonn nodes.hh:433 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_:_:_C_h_i_l_d_:_:_T_y_p_e │ │ │ │ -typename std::tuple_element_t< k, std::tuple< T... > > Type │ │ │ │ -The type of the child. │ │ │ │ -DDeeffiinniittiioonn nodes.hh:437 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_:_:_C_h_i_l_d_:_:_t_y_p_e │ │ │ │ -Type type │ │ │ │ -DDeeffiinniittiioonn nodes.hh:439 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_n_o_m_i_a_l │ │ │ │ +Polynomial(std::vector< K >) -> Polynomial< K, std::vector< K > > │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_P_o_l_y_n_o_m_i_a_l │ │ │ │ +auto makePolynomial(Coefficients coefficients) │ │ │ │ +Create Polynomial. │ │ │ │ +DDeeffiinniittiioonn polynomial.hh:268 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_n_o_m_i_a_l │ │ │ │ +A univariate polynomial implementation. │ │ │ │ +DDeeffiinniittiioonn polynomial.hh:125 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_n_o_m_i_a_l_:_:_P_o_l_y_n_o_m_i_a_l │ │ │ │ +Polynomial()=default │ │ │ │ +Default constructor. │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_n_o_m_i_a_l_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ +K operator()(const K &x) const │ │ │ │ +Evaluate polynomial using the Horner scheme. │ │ │ │ +DDeeffiinniittiioonn polynomial.hh:178 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_n_o_m_i_a_l_:_:_C_o_e_f_f_i_c_i_e_n_t_s │ │ │ │ +C Coefficients │ │ │ │ +The type of the stored coefficient container. │ │ │ │ +DDeeffiinniittiioonn polynomial.hh:156 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_n_o_m_i_a_l_:_:_c_o_e_f_f_i_c_i_e_n_t_s │ │ │ │ +const Coefficients & coefficients() const │ │ │ │ +Obtain reference to coefficient vector. │ │ │ │ +DDeeffiinniittiioonn polynomial.hh:230 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_n_o_m_i_a_l_:_:_P_o_l_y_n_o_m_i_a_l │ │ │ │ +Polynomial(Coefficients coefficients) │ │ │ │ +Create from container of coefficients. │ │ │ │ +DDeeffiinniittiioonn polynomial.hh:169 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_n_o_m_i_a_l_:_:_o_p_e_r_a_t_o_r_=_= │ │ │ │ +bool operator==(const Polynomial &other) const │ │ │ │ +Comparison of coefficients. │ │ │ │ +DDeeffiinniittiioonn polynomial.hh:205 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _n_o_d_e_s_._h_h │ │ │ │ + * _a_n_a_l_y_t_i_c_f_u_n_c_t_i_o_n_s │ │ │ │ + * _p_o_l_y_n_o_m_i_a_l_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00113.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: nedelecbasis.hh File Reference │ │ │ +Dune-Functions: monomialset.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,65 +88,51 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
nedelecbasis.hh File Reference
│ │ │ +
monomialset.hh File Reference
│ │ │
│ │ │
│ │ │
#include <array>
│ │ │ -#include <dune/common/exceptions.hh>
│ │ │ -#include <dune/grid/common/capabilities.hh>
│ │ │ -#include <dune/grid/common/mcmgmapper.hh>
│ │ │ -#include <dune/localfunctions/common/localfiniteelementvariant.hh>
│ │ │ -#include <dune/localfunctions/nedelec.hh>
│ │ │ -#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │ -#include <dune/functions/functionspacebases/globalvaluedlocalfiniteelement.hh>
│ │ │ -#include <dune/functions/functionspacebases/leafprebasismappermixin.hh>
│ │ │ -#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ +#include <dune/common/fvector.hh>
│ │ │ +#include <dune/common/fmatrix.hh>
│ │ │ +#include <dune/common/math.hh>
│ │ │ +#include <dune/common/rangeutilities.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::NedelecPreBasis< GV, Range, kind, order >
class  Dune::Functions::NedelecNode< GV, Range, kind, order >
struct  Dune::Functions::MonomialSet< RangeFieldType, dimension, maxDegree >
 Function, which evaluates all monomials up to degree maxDegree in a given coordinate. More...
struct  Dune::Functions::MonomialSet< RangeFieldType, dimension, maxDegree >::Derivative
 Set of all first order derivatives of monomials up to degree maxDegree as vector of vector valued functions. More...
struct  Dune::Functions::MonomialSet< RangeFieldType, dimension, maxDegree >::Derivative::Hessian
 Set of all second order derivatives of monomials up to degree maxDegree as vector of matrix valued functions. More...
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ -

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::BasisFactory
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -

│ │ │ -Typedefs

template<typename GV, std::size_t kind, std::size_t order, typename Range = double>
using Dune::Functions::NedelecBasis = DefaultGlobalBasis<NedelecPreBasis<GV, Range, kind, order > >
 Basis of a k-th-order Nédélec finite element space.
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │

│ │ │ -Functions

template<std::size_t kind, std::size_t order, typename Range = double>
auto Dune::Functions::BasisFactory::nedelec ()
 Create a pre-basis factory that can create a Nédélec pre-basis.
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── encoding │ │ │ │ @@ -1 +1 @@ │ │ │ │ -utf-8 │ │ │ │ +us-ascii │ │ │ ├── html2text {} │ │ │ │ @@ -1,38 +1,31 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -nedelecbasis.hh File Reference │ │ │ │ +monomialset.hh File Reference │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_g_l_o_b_a_l_v_a_l_u_e_d_l_o_c_a_l_f_i_n_i_t_e_e_l_e_m_e_n_t_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_P_r_e_B_a_s_i_s_<_ _G_V_,_ _R_a_n_g_e_,_ _k_i_n_d_,_ _o_r_d_e_r_ _> │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_N_o_d_e_<_ _G_V_,_ _R_a_n_g_e_,_ _k_i_n_d_,_ _o_r_d_e_r_ _> │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_n_o_m_i_a_l_S_e_t_<_ _R_a_n_g_e_F_i_e_l_d_T_y_p_e_,_ _d_i_m_e_n_s_i_o_n_,_ _m_a_x_D_e_g_r_e_e_ _> │ │ │ │ +  Function, which evaluates all monomials up to degree maxDegree in a │ │ │ │ + given coordinate. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_n_o_m_i_a_l_S_e_t_<_ _R_a_n_g_e_F_i_e_l_d_T_y_p_e_,_ _d_i_m_e_n_s_i_o_n_,_ _m_a_x_D_e_g_r_e_e_ _>_:_: │ │ │ │ + _D_e_r_i_v_a_t_i_v_e │ │ │ │ +  Set of all first order derivatives of monomials up to degree maxDegree │ │ │ │ + as vector of vector valued functions. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_n_o_m_i_a_l_S_e_t_<_ _R_a_n_g_e_F_i_e_l_d_T_y_p_e_,_ _d_i_m_e_n_s_i_o_n_,_ _m_a_x_D_e_g_r_e_e_ _>_:_: │ │ │ │ + _D_e_r_i_v_a_t_i_v_e_:_:_H_e_s_s_i_a_n │ │ │ │ +  Set of all second order derivatives of monomials up to degree │ │ │ │ + maxDegree as vector of matrix valued functions. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -TTyyppeeddeeffss │ │ │ │ -template │ │ │ │ -using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_B_a_s_i_s = _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s<_N_e_d_e_l_e_c_P_r_e_B_a_s_i_s > │ │ │ │ -  Basis of a k-th-order Nédélec finite element space. │ │ │ │ -FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_n_e_d_e_l_e_c () │ │ │ │ -  Create a pre-basis factory that can create a Nédélec pre-basis. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _n_e_d_e_l_e_c_b_a_s_i_s_._h_h │ │ │ │ + * _a_n_a_l_y_t_i_c_f_u_n_c_t_i_o_n_s │ │ │ │ + * _m_o_n_o_m_i_a_l_s_e_t_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00113.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,6 +1,4 @@ │ │ │ │ var a00113 = [ │ │ │ │ - ["Dune::Functions::NedelecPreBasis< GV, Range, kind, order >", "a01990.html", "a01990"], │ │ │ │ - ["Dune::Functions::NedelecNode< GV, Range, kind, order >", "a01986.html", "a01986"], │ │ │ │ - ["Dune::Functions::NedelecBasis", "a00318.html#aee3286ae752a21e0a52405022a6bd906", null], │ │ │ │ - ["Dune::Functions::BasisFactory::nedelec", "a00312.html#gafe0fe439067c288f197101b8686223e8", null] │ │ │ │ + ["Dune::Functions::MonomialSet< RangeFieldType, dimension, maxDegree >::Derivative", "a01158.html", "a01158"], │ │ │ │ + ["Dune::Functions::MonomialSet< RangeFieldType, dimension, maxDegree >::Derivative::Hessian", "a01162.html", "a01162"] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00113_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: nedelecbasis.hh Source File │ │ │ +Dune-Functions: monomialset.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,351 +88,462 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
nedelecbasis.hh
│ │ │ +
monomialset.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_ANALYTICFUNCTIONS_MONOMIALSET_HH
│ │ │ +
8#define DUNE_FUNCTIONS_ANALYTICFUNCTIONS_MONOMIALSET_HH
│ │ │
9
│ │ │
10#include <array>
│ │ │ -
11#include <dune/common/exceptions.hh>
│ │ │ -
12
│ │ │ -
13#include <dune/grid/common/capabilities.hh>
│ │ │ -
14#include <dune/grid/common/mcmgmapper.hh>
│ │ │ -
15
│ │ │ -
16#include <dune/localfunctions/common/localfiniteelementvariant.hh>
│ │ │ -
17#include <dune/localfunctions/nedelec.hh>
│ │ │ +
11
│ │ │ +
12#include <dune/common/fvector.hh>
│ │ │ +
13#include <dune/common/fmatrix.hh>
│ │ │ +
14#include <dune/common/math.hh>
│ │ │ +
15#include <dune/common/rangeutilities.hh>
│ │ │ +
16
│ │ │ +
17
│ │ │
18
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
23
│ │ │ -
24namespace Dune::Functions
│ │ │ -
25{
│ │ │ -
26
│ │ │ -
27namespace Impl
│ │ │ -
28{
│ │ │ -
29 template<typename GV, int dim, typename R, std::size_t order>
│ │ │ -
30 class Nedelec1stKindLocalFiniteElementMap
│ │ │ -
31 {
│ │ │ -
32 using D = typename GV::ctype;
│ │ │ -
33 constexpr static bool hasFixedElementType = Capabilities::hasSingleGeometryType<typename GV::Grid>::v;
│ │ │ +
│ │ │ +
19namespace Dune::Functions {
│ │ │ +
20
│ │ │ +
21 namespace Impl {
│ │ │ +
22
│ │ │ +
23 // Computes `y = [1, x, x^2, x^3, ..., x^maxDegree]` with `x` a single coordinate
│ │ │ +
24 template<int maxDegree, class DomainFieldType, class RangeType>
│ │ │ +
25 void computePowers(const DomainFieldType& x, RangeType& y)
│ │ │ +
26 {
│ │ │ +
27 if constexpr(maxDegree >= 0)
│ │ │ +
28 {
│ │ │ +
29 y[0] = 1;
│ │ │ +
30 for(auto k : Dune::range(maxDegree))
│ │ │ +
31 y[k+1] = y[k]*x;
│ │ │ +
32 }
│ │ │ +
33 }
│ │ │
34
│ │ │ -
35 using CubeFiniteElement = Nedelec1stKindCubeLocalFiniteElement<D,R,dim,order>;
│ │ │ -
36 using SimplexFiniteElement = Nedelec1stKindSimplexLocalFiniteElement<D,R,dim,order>;
│ │ │ -
37
│ │ │ -
38 public:
│ │ │ -
39
│ │ │ -
40 using T = LocalBasisTraits<D, dim, FieldVector<D,dim>, R, dim, FieldVector<R,dim>, FieldMatrix<D,dim,dim> >;
│ │ │ -
41
│ │ │ -
42 constexpr static unsigned int topologyId = Capabilities::hasSingleGeometryType<typename GV::Grid>::topologyId; // meaningless if hasFixedElementType is false
│ │ │ -
43 constexpr static GeometryType type = GeometryType(topologyId, GV::dimension);
│ │ │ -
44
│ │ │ -
45 using FiniteElement = std::conditional_t<hasFixedElementType,
│ │ │ -
46 std::conditional_t<type.isCube(),CubeFiniteElement,SimplexFiniteElement>,
│ │ │ -
47 LocalFiniteElementVariant<CubeFiniteElement, SimplexFiniteElement> >;
│ │ │ -
48
│ │ │ -
49 static std::size_t numVariants(GeometryType type)
│ │ │ -
50 {
│ │ │ -
51 if (order!=1) // I am not sure whether the formula below is correct for all orders.
│ │ │ -
52 DUNE_THROW(NotImplemented, "Only Nedelec elements of order 1 are implemented!");
│ │ │ -
53
│ │ │ -
54 auto numEdges = referenceElement<D,dim>(type).size(dim-1);
│ │ │ -
55 return power(2,numEdges);
│ │ │ -
56 }
│ │ │ -
57
│ │ │ -
58 Nedelec1stKindLocalFiniteElementMap(const GV& gv)
│ │ │ -
59 : elementMapper_(gv, mcmgElementLayout()),
│ │ │ -
60 orientation_(gv.size(0))
│ │ │ -
61 {
│ │ │ -
62 update(gv);
│ │ │ -
63 }
│ │ │ -
64
│ │ │ -
65 void update(const GV& gv)
│ │ │ -
66 {
│ │ │ -
67 elementMapper_.update(gv);
│ │ │ -
68 orientation_.resize(gv.size(0));
│ │ │ -
69
│ │ │ -
70 // create all variants
│ │ │ -
71 if constexpr (hasFixedElementType)
│ │ │ -
72 {
│ │ │ -
73 variants_.resize(numVariants(type));
│ │ │ -
74 for (size_t i = 0; i < numVariants(type); i++)
│ │ │ -
75 variants_[i] = FiniteElement(i);
│ │ │ -
76 }
│ │ │ -
77 else
│ │ │ -
78 {
│ │ │ -
79 // for mixed grids add offset for cubes
│ │ │ -
80 variants_.resize(numVariants(GeometryTypes::simplex(dim)) + numVariants(GeometryTypes::cube(dim)));
│ │ │ -
81 for (size_t i = 0; i < numVariants(GeometryTypes::simplex(dim)); i++)
│ │ │ -
82 variants_[i] = SimplexFiniteElement(i);
│ │ │ -
83 for (size_t i = 0; i < numVariants(GeometryTypes::cube(dim)); i++)
│ │ │ -
84 variants_[i + numVariants(GeometryTypes::simplex(dim))] = CubeFiniteElement(i);
│ │ │ -
85 }
│ │ │ -
86
│ │ │ -
87
│ │ │ -
88 // compute orientation for all elements
│ │ │ -
89 const auto& indexSet = gv.indexSet();
│ │ │ -
90
│ │ │ -
91 for(const auto& element : elements(gv))
│ │ │ -
92 {
│ │ │ -
93 const auto& refElement = referenceElement(element);
│ │ │ -
94 auto elementIndex = elementMapper_.index(element);
│ │ │ -
95 orientation_[elementIndex] = 0;
│ │ │ -
96
│ │ │ -
97 for (std::size_t i=0; i<element.subEntities(dim-1); i++)
│ │ │ -
98 {
│ │ │ -
99 // Local vertex indices within the element
│ │ │ -
100 auto localV0 = refElement.subEntity(i,dim-1, 0,dim);
│ │ │ -
101 auto localV1 = refElement.subEntity(i,dim-1, 1,dim);
│ │ │ -
102
│ │ │ -
103 // Global vertex indices within the grid
│ │ │ -
104 auto globalV0 = indexSet.subIndex(element,localV0,dim);
│ │ │ -
105 auto globalV1 = indexSet.subIndex(element,localV1,dim);
│ │ │ -
106
│ │ │ -
107 if ( (localV0<localV1 && globalV0>globalV1) || (localV0>localV1 && globalV0<globalV1) )
│ │ │ -
108 orientation_[elementIndex] |= (1 << i);
│ │ │ -
109 }
│ │ │ -
110 // for mixed grids add offset for cubes
│ │ │ -
111 if constexpr (!hasFixedElementType)
│ │ │ -
112 if (element.type().isCube())
│ │ │ -
113 orientation_[elementIndex] += numVariants(GeometryTypes::simplex(dim));
│ │ │ -
114 }
│ │ │ -
115 }
│ │ │ -
116
│ │ │ -
117 template<class Element>
│ │ │ -
118 const auto& find(const Element& element) const
│ │ │ -
119 {
│ │ │ -
120 return variants_[orientation_[elementMapper_.index(element)]];
│ │ │ -
121 }
│ │ │ -
122
│ │ │ -
123 private:
│ │ │ -
124 std::vector<FiniteElement> variants_;
│ │ │ -
125 Dune::MultipleCodimMultipleGeomTypeMapper<GV> elementMapper_;
│ │ │ -
126 std::vector<unsigned short> orientation_;
│ │ │ -
127 };
│ │ │ -
128
│ │ │ +
35 } // namespace Impl
│ │ │ +
36
│ │ │ +
37
│ │ │ +
62 template<class RangeFieldType, int dimension, int maxDegree>
│ │ │ +
│ │ │ + │ │ │ +
64 {
│ │ │ +
65 static constexpr int dim = dimension;
│ │ │ +
66 static constexpr int size = Dune::binomial(maxDegree + dim, dim);
│ │ │ +
67 static_assert(1 <= dim && dim <= 3, "MonomialSet is specialized for dimensions 1,2,3 only.");
│ │ │ +
68
│ │ │ +
80 static constexpr std::array<std::array<std::size_t,dim>,size> exponents();
│ │ │ +
81
│ │ │ +
91 template<class DomainFieldType>
│ │ │ +
92 constexpr Dune::FieldVector<RangeFieldType,size> operator()(const Dune::FieldVector<DomainFieldType,dim>& x) const;
│ │ │ +
93
│ │ │ +
│ │ │ + │ │ │ +
99 {
│ │ │ +
109 template<class DomainFieldType>
│ │ │ +
110 constexpr Dune::FieldMatrix<RangeFieldType,size, dim> operator()(const Dune::FieldVector<DomainFieldType,dim>& x) const;
│ │ │ +
111
│ │ │ +
│ │ │ +
116 struct Hessian
│ │ │ +
117 {
│ │ │ +
127 template<class DomainFieldType>
│ │ │ +
128 constexpr std::array<FieldMatrix<RangeFieldType,dim, dim>, size> operator()(const Dune::FieldVector<DomainFieldType,dim>& x) const;
│ │ │
129
│ │ │ -
130} // namespace Impl
│ │ │ -
131
│ │ │ -
132
│ │ │ -
133// *****************************************************************************
│ │ │ -
134// This is the reusable part of the basis. It contains
│ │ │ -
135//
│ │ │ -
136// NedelecPreBasis
│ │ │ -
137// NedelecNode
│ │ │ -
138//
│ │ │ -
139// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ -
140// state. These components do _not_ depend on the global basis and local view
│ │ │ -
141// and can be used without a global basis.
│ │ │ -
142// *****************************************************************************
│ │ │ -
143
│ │ │ -
144template<typename GV, typename Range, std::size_t kind, int order>
│ │ │ -
145class NedelecNode;
│ │ │ -
146
│ │ │ -
147template<typename GV, typename Range, std::size_t kind, int order>
│ │ │ -
│ │ │ - │ │ │ -
149 public LeafPreBasisMapperMixin<GV>
│ │ │ -
150{
│ │ │ -
151 static const int dim = GV::dimension;
│ │ │ -
152 static_assert(kind==1, "Only the Nedelec basis of the first kind is currently implemented!");
│ │ │ -
153 using FiniteElementMap = typename Impl::Nedelec1stKindLocalFiniteElementMap<GV, dim, Range, order>;
│ │ │ -
154
│ │ │ -
155 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper<GV>;
│ │ │ -
156public:
│ │ │ -
157
│ │ │ -
159 using GridView = GV;
│ │ │ -
160 using size_type = std::size_t;
│ │ │ -
161
│ │ │ - │ │ │ -
163
│ │ │ -
│ │ │ - │ │ │ -
166 : LeafPreBasisMapperMixin<GV>(gv, mcmgLayout(Dim<1>{}))
│ │ │ - │ │ │ -
168 {
│ │ │ -
169 if (kind!=1)
│ │ │ -
170 DUNE_THROW(NotImplemented, "Only Nedelec elements of the first kind are implemented!");
│ │ │ -
171
│ │ │ -
172 // There is no inherent reason why the basis shouldn't work for grids with more than two
│ │ │ -
173 // element types. Somebody simply has to sit down and implement the missing bits.
│ │ │ -
174 if (gv.indexSet().types(0).size() > 2)
│ │ │ -
175 DUNE_THROW(NotImplemented, "Nédélec basis is only implemented for grids with simplex and cube elements");
│ │ │ -
176
│ │ │ -
177 for(auto type : gv.indexSet().types(0))
│ │ │ -
178 if (!type.isSimplex() && !type.isCube())
│ │ │ -
179 DUNE_THROW(NotImplemented, "Nédélec basis is only implemented for grids with simplex or cube elements.");
│ │ │ -
180
│ │ │ -
181 if (order>1)
│ │ │ -
182 DUNE_THROW(NotImplemented, "Only first-order elements are implemented");
│ │ │ -
183
│ │ │ -
184 if (dim!=2 && dim!=3)
│ │ │ -
185 DUNE_THROW(NotImplemented, "Only 2d and 3d Nédélec elements are implemented");
│ │ │ -
186 }
│ │ │ -
│ │ │ -
187
│ │ │ -
│ │ │ -
189 void update (const GridView& gv)
│ │ │ -
190 {
│ │ │ - │ │ │ -
192 finiteElementMap_.update(gv);
│ │ │ -
193 }
│ │ │ -
│ │ │ -
194
│ │ │ -
│ │ │ - │ │ │ -
199 {
│ │ │ -
200 return Node{&finiteElementMap_};
│ │ │ -
201 }
│ │ │ -
│ │ │ -
202
│ │ │ -
203protected:
│ │ │ -
204 FiniteElementMap finiteElementMap_;
│ │ │ -
205};
│ │ │ +
130 };
│ │ │
│ │ │ -
206
│ │ │ +
131
│ │ │ +
│ │ │ +
135 constexpr friend auto derivative(const Derivative & d)
│ │ │ +
136 {
│ │ │ +
137 return Hessian{};
│ │ │ +
138 }
│ │ │ +
│ │ │ +
139
│ │ │ +
140 };
│ │ │ +
│ │ │ +
141
│ │ │ +
│ │ │ +
145 constexpr friend auto derivative(const MonomialSet& m)
│ │ │ +
146 {
│ │ │ +
147 return Derivative{};
│ │ │ +
148 }
│ │ │ +
│ │ │ +
149
│ │ │ +
150 };
│ │ │ +
│ │ │ +
151
│ │ │ +
152
│ │ │ +
153#ifndef DOXYGEN
│ │ │ +
154 // Specialization for dim = 1
│ │ │ +
155 template<class RangeFieldType, int maxDegree>
│ │ │ +
156 struct MonomialSet<RangeFieldType, 1, maxDegree>
│ │ │ +
157 {
│ │ │ +
158 static constexpr int dim = 1;
│ │ │ +
159 static constexpr int size = maxDegree+1;
│ │ │ +
160
│ │ │ +
161 static constexpr auto exponents()
│ │ │ +
162 {
│ │ │ +
163 auto p = std::array<std::array<std::size_t,1>,size>{};
│ │ │ +
164 for(auto k : Dune::range(size))
│ │ │ +
165 p[k][0] = k;
│ │ │ +
166 return p;
│ │ │ +
167 }
│ │ │ +
168
│ │ │ +
169 template<class DomainFieldType>
│ │ │ +
170 constexpr auto operator()(const Dune::FieldVector<DomainFieldType,1>& x) const
│ │ │ +
171 {
│ │ │ +
172 auto y = Dune::FieldVector<RangeFieldType,size>{};
│ │ │ +
173 Impl::computePowers<maxDegree>(x[0], y);
│ │ │ +
174 return y;
│ │ │ +
175 }
│ │ │ +
176
│ │ │ +
177 struct Derivative
│ │ │ +
178 {
│ │ │ +
179 template<class DomainFieldType>
│ │ │ +
180 constexpr auto operator()(const Dune::FieldVector<DomainFieldType,1>& x) const
│ │ │ +
181 {
│ │ │ +
182 auto xPowers = Dune::FieldVector<RangeFieldType,size>{};
│ │ │ +
183 Impl::computePowers<maxDegree-1>(x[0], xPowers);
│ │ │ +
184
│ │ │ +
185 auto y = Dune::FieldMatrix<RangeFieldType,size,1>{};
│ │ │ +
186 for(auto degree : Dune::range(1, maxDegree+1))
│ │ │ +
187 y[degree][0] = degree*xPowers[degree-1];
│ │ │ +
188 return y;
│ │ │ +
189 }
│ │ │ +
190
│ │ │ +
191 struct Hessian
│ │ │ +
192 {
│ │ │ +
193 template<class DomainFieldType>
│ │ │ +
194 constexpr auto operator()(const Dune::FieldVector<DomainFieldType,1>& x) const
│ │ │ +
195 {
│ │ │ +
196 auto xPowers = std::array<RangeFieldType,maxDegree+1>{};
│ │ │ +
197 Impl::computePowers<maxDegree-2>(x[0],xPowers);
│ │ │ +
198
│ │ │ +
199 auto y = std::array<Dune::FieldMatrix<RangeFieldType,1,1>,size>{};
│ │ │ +
200 for(auto degree : Dune::range(maxDegree+1))
│ │ │ +
201 if (degree-1 > 0)
│ │ │ +
202 y[degree][0][0] = degree*(degree-1)*xPowers[degree-2];
│ │ │ +
203 return y;
│ │ │ +
204 }
│ │ │ +
205
│ │ │ +
206 };
│ │ │
207
│ │ │ -
208
│ │ │ -
209template<typename GV, typename Range, size_t kind, int order>
│ │ │ -
│ │ │ - │ │ │ -
211 public LeafBasisNode
│ │ │ -
212{
│ │ │ -
213 static const int dim = GV::dimension;
│ │ │ +
208 constexpr friend auto derivative(const Derivative& d)
│ │ │ +
209 {
│ │ │ +
210 return Hessian{};
│ │ │ +
211 }
│ │ │ +
212
│ │ │ +
213 };
│ │ │
214
│ │ │ -
215public:
│ │ │ -
216
│ │ │ -
217 using size_type = std::size_t;
│ │ │ -
218 using Element = typename GV::template Codim<0>::Entity;
│ │ │ -
219 static_assert(kind==1, "Only Nedelec elements of the first kind are implemented!");
│ │ │ -
220 using FiniteElementMap = typename Impl::Nedelec1stKindLocalFiniteElementMap<GV, dim, Range, order>;
│ │ │ -
221 using FiniteElement = Impl::GlobalValuedLocalFiniteElement<Impl::CovariantPiolaTransformator,
│ │ │ -
222 typename FiniteElementMap::FiniteElement,
│ │ │ -
223 Element>;
│ │ │ -
224
│ │ │ -
│ │ │ -
225 NedelecNode(const FiniteElementMap* finiteElementMap) :
│ │ │ -
226 element_(nullptr),
│ │ │ -
227 finiteElementMap_(finiteElementMap)
│ │ │ -
228 { }
│ │ │ -
│ │ │ -
229
│ │ │ -
│ │ │ -
231 const Element& element() const
│ │ │ -
232 {
│ │ │ -
233 return *element_;
│ │ │ -
234 }
│ │ │ -
│ │ │ -
235
│ │ │ -
│ │ │ - │ │ │ -
241 {
│ │ │ -
242 return finiteElement_;
│ │ │ -
243 }
│ │ │ -
│ │ │ -
244
│ │ │ -
│ │ │ -
246 void bind(const Element& e)
│ │ │ -
247 {
│ │ │ -
248 element_ = &e;
│ │ │ -
249 finiteElement_.bind((finiteElementMap_->find(*element_)), e);
│ │ │ -
250 this->setSize(finiteElement_.size());
│ │ │ -
251 }
│ │ │ -
│ │ │ +
215 constexpr friend auto derivative(const MonomialSet& m)
│ │ │ +
216 {
│ │ │ +
217 return Derivative{};
│ │ │ +
218 }
│ │ │ +
219
│ │ │ +
220 };
│ │ │ +
221
│ │ │ +
222
│ │ │ +
223 // Specialization for dim = 2
│ │ │ +
224 template<class RangeFieldType, int maxDegree>
│ │ │ +
225 struct MonomialSet<RangeFieldType, 2, maxDegree>
│ │ │ +
226 {
│ │ │ +
227 static constexpr int dim = 2;
│ │ │ +
228 static constexpr int size = (maxDegree+1)*(maxDegree+2)/2;
│ │ │ +
229
│ │ │ +
230 static constexpr auto exponents()
│ │ │ +
231 {
│ │ │ +
232 auto p = std::array<std::array<std::size_t,2>,size>{};
│ │ │ +
233 std::size_t index = 0;
│ │ │ +
234 for(auto degree : Dune::range(maxDegree+1))
│ │ │ +
235 {
│ │ │ +
236 for(auto k : Dune::range(degree+1))
│ │ │ +
237 {
│ │ │ +
238 p[index][0] = degree-k;
│ │ │ +
239 p[index][1] = k;
│ │ │ +
240 ++index;
│ │ │ +
241 }
│ │ │ +
242 }
│ │ │ +
243 return p;
│ │ │ +
244 }
│ │ │ +
245
│ │ │ +
246 template<class DomainFieldType>
│ │ │ +
247 constexpr auto operator()(const Dune::FieldVector<DomainFieldType,2>& x) const
│ │ │ +
248 {
│ │ │ +
249 auto xPowers = std::array<Dune::FieldVector<RangeFieldType,size>,dim>{};
│ │ │ +
250 for(auto j : Dune::range(dim))
│ │ │ +
251 Impl::computePowers<maxDegree>(x[j], xPowers[j]);
│ │ │
252
│ │ │ -
253protected:
│ │ │ -
254
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
258};
│ │ │ -
│ │ │ -
259
│ │ │ -
260
│ │ │ -
261
│ │ │ -
262namespace BasisFactory {
│ │ │ -
263
│ │ │ -
273template<std::size_t kind, std::size_t order, typename Range=double>
│ │ │ -
│ │ │ - │ │ │ -
275{
│ │ │ -
276 return [](const auto& gridView) {
│ │ │ -
277 return NedelecPreBasis<std::decay_t<decltype(gridView)>, Range, kind, order>(gridView);
│ │ │ -
278 };
│ │ │ -
279}
│ │ │ -
│ │ │ -
280
│ │ │ -
281} // end namespace BasisFactory
│ │ │ -
282
│ │ │ -
283
│ │ │ -
284
│ │ │ -
285// *****************************************************************************
│ │ │ -
286// This is the actual global basis implementation based on the reusable parts.
│ │ │ -
287// *****************************************************************************
│ │ │ -
288
│ │ │ -
296template<typename GV, std::size_t kind, std::size_t order, typename Range=double>
│ │ │ - │ │ │ -
298
│ │ │ -
299} // end namespace Dune::Functions
│ │ │ -
300
│ │ │ -
301
│ │ │ -
302#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
auto power(ChildPreBasisFactory &&childPreBasisFactory, std::size_t k, const IndexMergingStrategy &)
Create a pre-basis factory that can build a PowerPreBasis.
Definition dynamicpowerbasis.hh:410
│ │ │ -
auto nedelec()
Create a pre-basis factory that can create a Nédélec pre-basis.
Definition nedelecbasis.hh:274
│ │ │ -
auto elements(const SubDomainGridView< HostGridView > &subDomainGridView)
ADL findable access to element range for a SubDomainGridView.
Definition subdomain.hh:487
│ │ │ +
253 auto y = Dune::FieldVector<RangeFieldType,size>{};
│ │ │ +
254 std::size_t index = 0;
│ │ │ +
255 for(auto degree : Dune::range(maxDegree+1))
│ │ │ +
256 {
│ │ │ +
257 for(auto k : Dune::range(degree+1))
│ │ │ +
258 {
│ │ │ +
259 y[index] = xPowers[0][degree-k]*xPowers[1][k];
│ │ │ +
260 ++index;
│ │ │ +
261 }
│ │ │ +
262 }
│ │ │ +
263 return y;
│ │ │ +
264 }
│ │ │ +
265
│ │ │ +
266 struct Derivative
│ │ │ +
267 {
│ │ │ +
268 template<class DomainFieldType>
│ │ │ +
269 constexpr auto operator()(const Dune::FieldVector<DomainFieldType,2>& x) const
│ │ │ +
270 {
│ │ │ +
271 auto xPowers = std::array<Dune::FieldVector<RangeFieldType,size>,dim>{};
│ │ │ +
272 for(auto j : Dune::range(dim))
│ │ │ +
273 Impl::computePowers<maxDegree-1>(x[j], xPowers[j]);
│ │ │ +
274
│ │ │ +
275 auto y = Dune::FieldMatrix<RangeFieldType,size,2>{};
│ │ │ +
276 std::size_t index = 0;
│ │ │ +
277 for(auto degree : Dune::range(maxDegree+1))
│ │ │ +
278 {
│ │ │ +
279 for(auto k : Dune::range(degree+1))
│ │ │ +
280 {
│ │ │ +
281 if (degree-k > 0)
│ │ │ +
282 y[index][0] = (degree-k)*xPowers[0][degree-k-1]*xPowers[1][k];
│ │ │ +
283 if (k > 0)
│ │ │ +
284 y[index][1] = k*xPowers[0][degree-k]*xPowers[1][k-1];
│ │ │ +
285 ++index;
│ │ │ +
286 }
│ │ │ +
287 }
│ │ │ +
288 return y;
│ │ │ +
289 }
│ │ │ +
290
│ │ │ +
291 struct Hessian
│ │ │ +
292 {
│ │ │ +
293 template<class DomainFieldType>
│ │ │ +
294 constexpr auto operator()(const Dune::FieldVector<DomainFieldType,2>& x) const
│ │ │ +
295 {
│ │ │ +
296 auto xPowers = std::array<std::array<RangeFieldType,maxDegree+1>,dim>{};
│ │ │ +
297 for(auto j : Dune::range(dim))
│ │ │ +
298 Impl::computePowers<maxDegree-2>(x[j], xPowers[j]);
│ │ │ +
299
│ │ │ +
300 auto y = std::array<Dune::FieldMatrix<RangeFieldType,2,2>,size>{};
│ │ │ +
301 std::size_t index = 0;
│ │ │ +
302 for(auto degree : Dune::range(maxDegree+1))
│ │ │ +
303 {
│ │ │ +
304 for(auto k : Dune::range(degree+1))
│ │ │ +
305 {
│ │ │ +
306 if (degree-k > 1)
│ │ │ +
307 y[index][0][0] = (degree-k-1)*(degree-k)*xPowers[0][degree-k-2]*xPowers[1][k];
│ │ │ +
308 if (k > 0 and degree-k > 0){
│ │ │ +
309 auto mixed = k*(degree-k)*xPowers[0][degree-k-1]*xPowers[1][k-1];
│ │ │ +
310 y[index][0][1]= mixed;
│ │ │ +
311 y[index][1][0]= mixed;
│ │ │ +
312 }
│ │ │ +
313 if (k > 1)
│ │ │ +
314 y[index][1][1] = k*(k-1)*xPowers[0][degree-k]*xPowers[1][k-2];
│ │ │ +
315
│ │ │ +
316 ++index;
│ │ │ +
317 }
│ │ │ +
318 }
│ │ │ +
319 return y;
│ │ │ +
320 }
│ │ │ +
321
│ │ │ +
322 };
│ │ │ +
323
│ │ │ +
324 constexpr friend auto derivative(const Derivative & d)
│ │ │ +
325 {
│ │ │ +
326 return Hessian{};
│ │ │ +
327 }
│ │ │ +
328
│ │ │ +
329 };
│ │ │ +
330
│ │ │ +
331 constexpr friend auto derivative(const MonomialSet& m)
│ │ │ +
332 {
│ │ │ +
333 return Derivative{};
│ │ │ +
334 }
│ │ │ +
335
│ │ │ +
336 };
│ │ │ +
337
│ │ │ +
338
│ │ │ +
339 // Specialization for dim = 3
│ │ │ +
340 template<class RangeFieldType, int maxDegree>
│ │ │ +
341 struct MonomialSet<RangeFieldType, 3, maxDegree>
│ │ │ +
342 {
│ │ │ +
343 static constexpr int dim = 3;
│ │ │ +
344 static constexpr int size = Dune::binomial(maxDegree + dim, dim);
│ │ │ +
345
│ │ │ +
346 static constexpr auto exponents()
│ │ │ +
347 {
│ │ │ +
348 auto p = std::array<std::array<std::size_t,3>,size>{};
│ │ │ +
349 std::size_t index = 0;
│ │ │ +
350 for(auto degree : Dune::range(maxDegree+1))
│ │ │ +
351 {
│ │ │ +
352 for(auto k : Dune::range(degree+1))
│ │ │ +
353 {
│ │ │ +
354 for (auto l : Dune::range(degree-k+1))
│ │ │ +
355 {
│ │ │ +
356 p[index][0] = degree-k-l;
│ │ │ +
357 p[index][1] = l;
│ │ │ +
358 p[index][2] = k;
│ │ │ +
359 ++index;
│ │ │ +
360 }
│ │ │ +
361
│ │ │ +
362 }
│ │ │ +
363 }
│ │ │ +
364 return p;
│ │ │ +
365 }
│ │ │ +
366
│ │ │ +
367 template<class DomainFieldType>
│ │ │ +
368 constexpr auto operator()(const Dune::FieldVector<DomainFieldType,3>& x) const
│ │ │ +
369 {
│ │ │ +
370 auto xPowers = std::array<std::array<RangeFieldType,maxDegree+1>,dim>{};
│ │ │ +
371 for(auto j : Dune::range(dim))
│ │ │ +
372 Impl::computePowers<maxDegree>(x[j], xPowers[j]);
│ │ │ +
373
│ │ │ +
374 auto y = Dune::FieldVector<RangeFieldType,size>{};
│ │ │ +
375 std::size_t index = 0;
│ │ │ +
376 for(auto degree : Dune::range(maxDegree+1))
│ │ │ +
377 {
│ │ │ +
378 for(auto k : Dune::range(degree+1))
│ │ │ +
379 {
│ │ │ +
380 for (auto l : Dune::range(degree-k+1))
│ │ │ +
381 {
│ │ │ +
382 y[index] = xPowers[0][degree-k-l]*xPowers[1][l]*xPowers[2][k];
│ │ │ +
383 ++index;
│ │ │ +
384 }
│ │ │ +
385 }
│ │ │ +
386 }
│ │ │ +
387 return y;
│ │ │ +
388 }
│ │ │ +
389
│ │ │ +
390 struct Derivative
│ │ │ +
391 {
│ │ │ +
392 template<class DomainFieldType>
│ │ │ +
393 constexpr auto operator()(const Dune::FieldVector<DomainFieldType,3>& x) const
│ │ │ +
394 {
│ │ │ +
395 auto xPowers = std::array<std::array<RangeFieldType,maxDegree+1>,dim>{};
│ │ │ +
396 for(auto j : Dune::range(dim))
│ │ │ +
397 {
│ │ │ +
398 xPowers[j][0] = 1.0;
│ │ │ +
399 for(auto k : Dune::range(maxDegree))
│ │ │ +
400 xPowers[j][k+1] = xPowers[j][k]*x[j];
│ │ │ +
401 }
│ │ │ +
402
│ │ │ +
403 auto y = Dune::FieldMatrix<RangeFieldType,size,3>{};
│ │ │ +
404 std::size_t index = 0;
│ │ │ +
405 for(auto degree : Dune::range(maxDegree+1))
│ │ │ +
406 {
│ │ │ +
407 for(auto k : Dune::range(degree+1))
│ │ │ +
408 {
│ │ │ +
409 for (auto l : Dune::range(degree-k+1))
│ │ │ +
410 {
│ │ │ +
411 if (degree-k-l > 0)
│ │ │ +
412 y[index][0] = (degree-k-l)*xPowers[0][degree-k-l-1]*xPowers[1][l]*xPowers[2][k];
│ │ │ +
413 if (l > 0)
│ │ │ +
414 y[index][1] = l*xPowers[0][degree-k-l]*xPowers[1][l-1]*xPowers[2][k];
│ │ │ +
415 if (k > 0)
│ │ │ +
416 y[index][2] = k*xPowers[0][degree-k-l]*xPowers[1][l]*xPowers[2][k-1];
│ │ │ +
417 ++index;
│ │ │ +
418 }
│ │ │ +
419 }
│ │ │ +
420 }
│ │ │ +
421 return y;
│ │ │ +
422 }
│ │ │ +
423
│ │ │ +
424 struct Hessian
│ │ │ +
425 {
│ │ │ +
426 template<class DomainFieldType>
│ │ │ +
427 constexpr auto operator()(const Dune::FieldVector<DomainFieldType,3>& x) const
│ │ │ +
428 {
│ │ │ +
429 auto xPowers = std::array<std::array<RangeFieldType,maxDegree+1>,dim>{};
│ │ │ +
430 for(auto j : Dune::range(dim))
│ │ │ +
431 Impl::computePowers<maxDegree>(x[j], xPowers[j]);
│ │ │ +
432
│ │ │ +
433 auto y = std::array<Dune::FieldMatrix<RangeFieldType,3,3>,size>{};
│ │ │ +
434 std::size_t index = 0;
│ │ │ +
435 for(auto degree : Dune::range(maxDegree+1))
│ │ │ +
436 {
│ │ │ +
437 for(auto k : Dune::range(degree+1))
│ │ │ +
438 {
│ │ │ +
439 for (auto l : Dune::range(degree-k+1))
│ │ │ +
440 {
│ │ │ +
441 // xx
│ │ │ +
442 if (degree-k-l-1 > 0)
│ │ │ +
443 y[index][0][0] = (degree-k-l)*(degree-k-l-1)*xPowers[0][degree-k-l-2]*xPowers[1][l]*xPowers[2][k];
│ │ │ +
444 // xy and yx
│ │ │ +
445 if (degree-k-l > 0 and l > 0){
│ │ │ +
446 y[index][0][1] = (degree-k-l)*l*xPowers[0][degree-k-l-1]*xPowers[1][l-1]*xPowers[2][k];
│ │ │ +
447 y[index][1][0] = y[index][0][1];
│ │ │ +
448 }
│ │ │ +
449 // yy
│ │ │ +
450 if (l-1 > 0)
│ │ │ +
451 y[index][1][1] = l*(l-1)*xPowers[0][degree-k-l]*xPowers[1][l-2]*xPowers[2][k];
│ │ │ +
452 // xz and zx
│ │ │ +
453 if (k > 0 and degree-k-l > 0)
│ │ │ +
454 {
│ │ │ +
455 y[index][0][2] = (degree-k-l)*k*xPowers[0][degree-k-l-1]*xPowers[1][l]*xPowers[2][k-1];
│ │ │ +
456 y[index][2][0] = y[index][0][2];
│ │ │ +
457 }
│ │ │ +
458 // yz
│ │ │ +
459 if (l > 0 and k > 0)
│ │ │ +
460 {
│ │ │ +
461 y[index][1][2] = l*k*xPowers[0][degree-k-l]*xPowers[1][l-1]*xPowers[2][k-1];
│ │ │ +
462 y[index][2][1] = y[index][1][2];
│ │ │ +
463 }
│ │ │ +
464 // zz
│ │ │ +
465 if (k-1 > 0)
│ │ │ +
466 y[index][2][2] = (k-1)*k*xPowers[0][degree-k-l]*xPowers[1][l]*xPowers[2][k-2];
│ │ │ +
467 ++index;
│ │ │ +
468 }
│ │ │ +
469 }
│ │ │ +
470 }
│ │ │ +
471 return y;
│ │ │ +
472 }
│ │ │ +
473
│ │ │ +
474 };
│ │ │ +
475
│ │ │ +
476 constexpr friend auto derivative(const Derivative & d)
│ │ │ +
477 {
│ │ │ +
478 return Hessian{};
│ │ │ +
479 }
│ │ │ +
480
│ │ │ +
481 };
│ │ │ +
482
│ │ │ +
483 constexpr friend auto derivative(const MonomialSet& m)
│ │ │ +
484 {
│ │ │ +
485 return Derivative{};
│ │ │ +
486 }
│ │ │ +
487
│ │ │ +
488 };
│ │ │ +
489 #endif
│ │ │ +
490} // namespace Dune::Functions
│ │ │ +
│ │ │ +
491
│ │ │ +
492#endif // DUNE_FUNCTIONS_ANALYTICFUNCTIONS_MONOMIALSET_HH
│ │ │
Definition monomialset.hh:19
│ │ │ -
DefaultGlobalBasis< NedelecPreBasis< GV, Range, kind, order > > NedelecBasis
Basis of a k-th-order Nédélec finite element space.
Definition nedelecbasis.hh:297
│ │ │ -
Definition argyrisbasis.hh:926
│ │ │ -
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:53
│ │ │ -
void update(const GridView &gv)
Update the stored GridView.
Definition leafprebasismappermixin.hh:101
│ │ │ -
LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout)
Construct from GridView and local DOF layout.
Definition leafprebasismappermixin.hh:74
│ │ │ -
Definition nedelecbasis.hh:212
│ │ │ -
const FiniteElementMap * finiteElementMap_
Definition nedelecbasis.hh:257
│ │ │ -
FiniteElement finiteElement_
Definition nedelecbasis.hh:255
│ │ │ -
Impl::GlobalValuedLocalFiniteElement< Impl::CovariantPiolaTransformator, typename FiniteElementMap::FiniteElement, Element > FiniteElement
Definition nedelecbasis.hh:221
│ │ │ -
void bind(const Element &e)
Bind to element.
Definition nedelecbasis.hh:246
│ │ │ -
const Element & element() const
Return current element, throw if unbound.
Definition nedelecbasis.hh:231
│ │ │ -
typename GV::template Codim< 0 >::Entity Element
Definition nedelecbasis.hh:218
│ │ │ -
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition nedelecbasis.hh:240
│ │ │ -
NedelecNode(const FiniteElementMap *finiteElementMap)
Definition nedelecbasis.hh:225
│ │ │ -
typename Impl::Nedelec1stKindLocalFiniteElementMap< GV, dim, Range, order > FiniteElementMap
Definition nedelecbasis.hh:220
│ │ │ -
const Element * element_
Definition nedelecbasis.hh:256
│ │ │ -
std::size_t size_type
Definition nedelecbasis.hh:217
│ │ │ -
Definition nedelecbasis.hh:150
│ │ │ -
std::size_t size_type
Definition nedelecbasis.hh:160
│ │ │ -
NedelecPreBasis(const GridView &gv)
Constructor for a given grid view object.
Definition nedelecbasis.hh:165
│ │ │ -
GV GridView
The grid view that the FE space is defined on.
Definition nedelecbasis.hh:159
│ │ │ -
FiniteElementMap finiteElementMap_
Definition nedelecbasis.hh:204
│ │ │ -
NedelecNode< GV, Range, kind, order > Node
Definition nedelecbasis.hh:162
│ │ │ -
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition nedelecbasis.hh:189
│ │ │ -
Node makeNode() const
Create tree node.
Definition nedelecbasis.hh:198
│ │ │ -
void setSize(const size_type size)
Definition nodes.hh:197
│ │ │ -
Definition nodes.hh:218
│ │ │ +
Function, which evaluates all monomials up to degree maxDegree in a given coordinate.
Definition monomialset.hh:64
│ │ │ +
static constexpr int dim
Definition monomialset.hh:65
│ │ │ +
constexpr Dune::FieldVector< RangeFieldType, size > operator()(const Dune::FieldVector< DomainFieldType, dim > &x) const
Return array of monomial evaluations.
│ │ │ +
static constexpr std::array< std::array< std::size_t, dim >, size > exponents()
Return array of monomial exponents with shape size x dim.
│ │ │ +
static constexpr int size
Definition monomialset.hh:66
│ │ │ +
constexpr friend auto derivative(const MonomialSet &m)
Construct the Derivative object from a MonomialSet.
Definition monomialset.hh:145
│ │ │ +
Set of all first order derivatives of monomials up to degree maxDegree as vector of vector valued fun...
Definition monomialset.hh:99
│ │ │ +
constexpr Dune::FieldMatrix< RangeFieldType, size, dim > operator()(const Dune::FieldVector< DomainFieldType, dim > &x) const
Return array of arrays of monomial derivatives.
│ │ │ +
constexpr friend auto derivative(const Derivative &d)
Construct the Hessian object from a Derivative.
Definition monomialset.hh:135
│ │ │ +
Set of all second order derivatives of monomials up to degree maxDegree as vector of matrix valued fu...
Definition monomialset.hh:117
│ │ │ +
constexpr std::array< FieldMatrix< RangeFieldType, dim, dim >, size > operator()(const Dune::FieldVector< DomainFieldType, dim > &x) const
Return array of Matrices of monomial derivatives.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,429 +1,494 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -nedelecbasis.hh │ │ │ │ +monomialset.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_ANALYTICFUNCTIONS_MONOMIALSET_HH │ │ │ │ +8#define DUNE_FUNCTIONS_ANALYTICFUNCTIONS_MONOMIALSET_HH │ │ │ │ 9 │ │ │ │ 10#include │ │ │ │ -11#include │ │ │ │ -12 │ │ │ │ -13#include │ │ │ │ -14#include │ │ │ │ -15 │ │ │ │ -16#include │ │ │ │ -17#include │ │ │ │ +11 │ │ │ │ +12#include │ │ │ │ +13#include │ │ │ │ +14#include │ │ │ │ +15#include │ │ │ │ +16 │ │ │ │ +17 │ │ │ │ 18 │ │ │ │ -19#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ -20#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/ │ │ │ │ -_g_l_o_b_a_l_v_a_l_u_e_d_l_o_c_a_l_f_i_n_i_t_e_e_l_e_m_e_n_t_._h_h> │ │ │ │ -21#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h> │ │ │ │ -22#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -23 │ │ │ │ -24namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -25{ │ │ │ │ -26 │ │ │ │ -27namespace Impl │ │ │ │ -28{ │ │ │ │ -29 template │ │ │ │ -30 class Nedelec1stKindLocalFiniteElementMap │ │ │ │ -31 { │ │ │ │ -32 using D = typename GV::ctype; │ │ │ │ -33 constexpr static bool hasFixedElementType = Capabilities:: │ │ │ │ -hasSingleGeometryType::v; │ │ │ │ +_1_9namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ +20 │ │ │ │ +21 namespace Impl { │ │ │ │ +22 │ │ │ │ +23 // Computes `y = [1, x, x^2, x^3, ..., x^maxDegree]` with `x` a single │ │ │ │ +coordinate │ │ │ │ +24 template │ │ │ │ +25 void computePowers(const DomainFieldType& x, RangeType& y) │ │ │ │ +26 { │ │ │ │ +27 if constexpr(maxDegree >= 0) │ │ │ │ +28 { │ │ │ │ +29 y[0] = 1; │ │ │ │ +30 for(auto k : Dune::range(maxDegree)) │ │ │ │ +31 y[k+1] = y[k]*x; │ │ │ │ +32 } │ │ │ │ +33 } │ │ │ │ 34 │ │ │ │ -35 using CubeFiniteElement = │ │ │ │ -Nedelec1stKindCubeLocalFiniteElement; │ │ │ │ -36 using SimplexFiniteElement = │ │ │ │ -Nedelec1stKindSimplexLocalFiniteElement; │ │ │ │ +35 } // namespace Impl │ │ │ │ +36 │ │ │ │ 37 │ │ │ │ -38 public: │ │ │ │ -39 │ │ │ │ -40 using T = LocalBasisTraits, R, dim, │ │ │ │ -FieldVector, FieldMatrix >; │ │ │ │ -41 │ │ │ │ -42 constexpr static unsigned int topologyId = Capabilities:: │ │ │ │ -hasSingleGeometryType::topologyId; // meaningless if │ │ │ │ -hasFixedElementType is false │ │ │ │ -43 constexpr static GeometryType type = GeometryType(topologyId, GV:: │ │ │ │ -dimension); │ │ │ │ -44 │ │ │ │ -45 using FiniteElement = std::conditional_t, │ │ │ │ -47 LocalFiniteElementVariant >; │ │ │ │ -48 │ │ │ │ -49 static std::size_t numVariants(GeometryType type) │ │ │ │ -50 { │ │ │ │ -51 if (order!=1) // I am not sure whether the formula below is correct for all │ │ │ │ -orders. │ │ │ │ -52 DUNE_THROW(NotImplemented, "Only Nedelec elements of order 1 are │ │ │ │ -implemented!"); │ │ │ │ -53 │ │ │ │ -54 auto numEdges = referenceElement(type).size(dim-1); │ │ │ │ -55 return _p_o_w_e_r(2,numEdges); │ │ │ │ -56 } │ │ │ │ -57 │ │ │ │ -58 Nedelec1stKindLocalFiniteElementMap(const GV& gv) │ │ │ │ -59 : elementMapper_(gv, mcmgElementLayout()), │ │ │ │ -60 orientation_(gv.size(0)) │ │ │ │ -61 { │ │ │ │ -62 update(gv); │ │ │ │ -63 } │ │ │ │ -64 │ │ │ │ -65 void update(const GV& gv) │ │ │ │ -66 { │ │ │ │ -67 elementMapper_.update(gv); │ │ │ │ -68 orientation_.resize(gv.size(0)); │ │ │ │ -69 │ │ │ │ -70 // create all variants │ │ │ │ -71 if constexpr (hasFixedElementType) │ │ │ │ -72 { │ │ │ │ -73 variants_.resize(numVariants(type)); │ │ │ │ -74 for (size_t i = 0; i < numVariants(type); i++) │ │ │ │ -75 variants_[i] = FiniteElement(i); │ │ │ │ -76 } │ │ │ │ -77 else │ │ │ │ -78 { │ │ │ │ -79 // for mixed grids add offset for cubes │ │ │ │ -80 variants_.resize(numVariants(GeometryTypes::simplex(dim)) + numVariants │ │ │ │ -(GeometryTypes::cube(dim))); │ │ │ │ -81 for (size_t i = 0; i < numVariants(GeometryTypes::simplex(dim)); i++) │ │ │ │ -82 variants_[i] = SimplexFiniteElement(i); │ │ │ │ -83 for (size_t i = 0; i < numVariants(GeometryTypes::cube(dim)); i++) │ │ │ │ -84 variants_[i + numVariants(GeometryTypes::simplex(dim))] = CubeFiniteElement │ │ │ │ -(i); │ │ │ │ -85 } │ │ │ │ -86 │ │ │ │ -87 │ │ │ │ -88 // compute orientation for all elements │ │ │ │ -89 const auto& indexSet = gv.indexSet(); │ │ │ │ -90 │ │ │ │ -91 for(const auto& element : _e_l_e_m_e_n_t_s(gv)) │ │ │ │ -92 { │ │ │ │ -93 const auto& refElement = referenceElement(element); │ │ │ │ -94 auto elementIndex = elementMapper_.index(element); │ │ │ │ -95 orientation_[elementIndex] = 0; │ │ │ │ -96 │ │ │ │ -97 for (std::size_t i=0; iglobalV1) || (localV0>localV1 && │ │ │ │ -globalV0 │ │ │ │ -118 const auto& find(const Element& element) const │ │ │ │ -119 { │ │ │ │ -120 return variants_[orientation_[elementMapper_.index(element)]]; │ │ │ │ -121 } │ │ │ │ -122 │ │ │ │ -123 private: │ │ │ │ -124 std::vector variants_; │ │ │ │ -125 Dune::MultipleCodimMultipleGeomTypeMapper elementMapper_; │ │ │ │ -126 std::vector orientation_; │ │ │ │ -127 }; │ │ │ │ -128 │ │ │ │ +62 template │ │ │ │ +_6_3 struct _M_o_n_o_m_i_a_l_S_e_t │ │ │ │ +64 { │ │ │ │ +_6_5 static constexpr int _d_i_m = dimension; │ │ │ │ +_6_6 static constexpr int _s_i_z_e = Dune::binomial(maxDegree + _d_i_m, _d_i_m); │ │ │ │ +67 static_assert(1 <= _d_i_m && _d_i_m <= 3, "MonomialSet is specialized for │ │ │ │ +dimensions 1,2,3 only."); │ │ │ │ +68 │ │ │ │ +_8_0 static constexpr std::array,_s_i_z_e> _e_x_p_o_n_e_n_t_s(); │ │ │ │ +81 │ │ │ │ +91 template │ │ │ │ +_9_2 constexpr Dune::FieldVector _o_p_e_r_a_t_o_r_(_)(const Dune:: │ │ │ │ +FieldVector& x) const; │ │ │ │ +93 │ │ │ │ +_9_8 struct _D_e_r_i_v_a_t_i_v_e │ │ │ │ +99 { │ │ │ │ +109 template │ │ │ │ +_1_1_0 constexpr Dune::FieldMatrix _o_p_e_r_a_t_o_r_(_)(const │ │ │ │ +Dune::FieldVector& x) const; │ │ │ │ +111 │ │ │ │ +_1_1_6 struct _H_e_s_s_i_a_n │ │ │ │ +117 { │ │ │ │ +127 template │ │ │ │ +_1_2_8 constexpr std::array, _s_i_z_e> _o_p_e_r_a_t_o_r_(_) │ │ │ │ +(const Dune::FieldVector& x) const; │ │ │ │ 129 │ │ │ │ -130} // namespace Impl │ │ │ │ +130 }; │ │ │ │ 131 │ │ │ │ -132 │ │ │ │ -133/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -134// This is the reusable part of the basis. It contains │ │ │ │ -135// │ │ │ │ -136// NedelecPreBasis │ │ │ │ -137// NedelecNode │ │ │ │ -138// │ │ │ │ -139// The pre-basis allows to create the others and is the owner of possible │ │ │ │ -shared │ │ │ │ -140// state. These components do _not_ depend on the global basis and local │ │ │ │ -view │ │ │ │ -141// and can be used without a global basis. │ │ │ │ -142/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -143 │ │ │ │ -144template │ │ │ │ -145class _N_e_d_e_l_e_c_N_o_d_e; │ │ │ │ -146 │ │ │ │ -147template │ │ │ │ -_1_4_8class _N_e_d_e_l_e_c_P_r_e_B_a_s_i_s : │ │ │ │ -149 public _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n │ │ │ │ -150{ │ │ │ │ -151 static const int dim = GV::dimension; │ │ │ │ -152 static_assert(kind==1, "Only the Nedelec basis of the first kind is │ │ │ │ -currently implemented!"); │ │ │ │ -153 using FiniteElementMap = typename Impl:: │ │ │ │ -Nedelec1stKindLocalFiniteElementMap; │ │ │ │ -154 │ │ │ │ -155 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper; │ │ │ │ -156public: │ │ │ │ -157 │ │ │ │ -_1_5_9 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ -_1_6_0 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ -161 │ │ │ │ -_1_6_2 using _N_o_d_e = _N_e_d_e_l_e_c_N_o_d_e_<_G_V_,_ _R_a_n_g_e_,_ _k_i_n_d_,_ _o_r_d_e_r_>; │ │ │ │ -163 │ │ │ │ -_1_6_5 _N_e_d_e_l_e_c_P_r_e_B_a_s_i_s(const _G_r_i_d_V_i_e_w& gv) │ │ │ │ -166 : _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n(gv, mcmgLayout(Dim<1>{})) │ │ │ │ -167 , _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__(gv) │ │ │ │ -168 { │ │ │ │ -169 if (kind!=1) │ │ │ │ -170 DUNE_THROW(NotImplemented, "Only Nedelec elements of the first kind are │ │ │ │ -implemented!"); │ │ │ │ -171 │ │ │ │ -172 // There is no inherent reason why the basis shouldn't work for grids with │ │ │ │ -more than two │ │ │ │ -173 // element types. Somebody simply has to sit down and implement the missing │ │ │ │ -bits. │ │ │ │ -174 if (gv.indexSet().types(0).size() > 2) │ │ │ │ -175 DUNE_THROW(NotImplemented, "Nédélec basis is only implemented for grids │ │ │ │ -with simplex and cube elements"); │ │ │ │ +_1_3_5 constexpr friend auto _d_e_r_i_v_a_t_i_v_e(const _D_e_r_i_v_a_t_i_v_e & d) │ │ │ │ +136 { │ │ │ │ +137 return _H_e_s_s_i_a_n{}; │ │ │ │ +138 } │ │ │ │ +139 │ │ │ │ +140 }; │ │ │ │ +141 │ │ │ │ +_1_4_5 constexpr friend auto _d_e_r_i_v_a_t_i_v_e(const _M_o_n_o_m_i_a_l_S_e_t& m) │ │ │ │ +146 { │ │ │ │ +147 return _D_e_r_i_v_a_t_i_v_e{}; │ │ │ │ +148 } │ │ │ │ +149 │ │ │ │ +150 }; │ │ │ │ +151 │ │ │ │ +152 │ │ │ │ +153#ifndef DOXYGEN │ │ │ │ +154 // Specialization for dim = 1 │ │ │ │ +155 template │ │ │ │ +156 struct MonomialSet │ │ │ │ +157 { │ │ │ │ +158 static constexpr int _d_i_m = 1; │ │ │ │ +159 static constexpr int _s_i_z_e = maxDegree+1; │ │ │ │ +160 │ │ │ │ +161 static constexpr auto _e_x_p_o_n_e_n_t_s() │ │ │ │ +162 { │ │ │ │ +163 auto p = std::array,_s_i_z_e>{}; │ │ │ │ +164 for(auto k : Dune::range(_s_i_z_e)) │ │ │ │ +165 p[k][0] = k; │ │ │ │ +166 return p; │ │ │ │ +167 } │ │ │ │ +168 │ │ │ │ +169 template │ │ │ │ +170 constexpr auto _o_p_e_r_a_t_o_r_(_)(const Dune::FieldVector& x) │ │ │ │ +const │ │ │ │ +171 { │ │ │ │ +172 auto y = Dune::FieldVector{}; │ │ │ │ +173 Impl::computePowers(x[0], y); │ │ │ │ +174 return y; │ │ │ │ +175 } │ │ │ │ 176 │ │ │ │ -177 for(auto type : gv.indexSet().types(0)) │ │ │ │ -178 if (!type.isSimplex() && !type.isCube()) │ │ │ │ -179 DUNE_THROW(NotImplemented, "Nédélec basis is only implemented for grids │ │ │ │ -with simplex or cube elements."); │ │ │ │ -180 │ │ │ │ -181 if (order>1) │ │ │ │ -182 DUNE_THROW(NotImplemented, "Only first-order elements are implemented"); │ │ │ │ -183 │ │ │ │ -184 if (dim!=2 && dim!=3) │ │ │ │ -185 DUNE_THROW(NotImplemented, "Only 2d and 3d Nédélec elements are │ │ │ │ -implemented"); │ │ │ │ -186 } │ │ │ │ -187 │ │ │ │ -_1_8_9 void _u_p_d_a_t_e (const _G_r_i_d_V_i_e_w& gv) │ │ │ │ -190 { │ │ │ │ -191 _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_<_G_V_>_:_:_u_p_d_a_t_e(gv); │ │ │ │ -192 _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__.update(gv); │ │ │ │ -193 } │ │ │ │ -194 │ │ │ │ -_1_9_8 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ -199 { │ │ │ │ -200 return _N_o_d_e{&_f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__}; │ │ │ │ -201 } │ │ │ │ -202 │ │ │ │ -203protected: │ │ │ │ -_2_0_4 FiniteElementMap _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__; │ │ │ │ -205}; │ │ │ │ -206 │ │ │ │ +177 struct _D_e_r_i_v_a_t_i_v_e │ │ │ │ +178 { │ │ │ │ +179 template │ │ │ │ +180 constexpr auto _o_p_e_r_a_t_o_r_(_)(const Dune::FieldVector& x) │ │ │ │ +const │ │ │ │ +181 { │ │ │ │ +182 auto xPowers = Dune::FieldVector{}; │ │ │ │ +183 Impl::computePowers(x[0], xPowers); │ │ │ │ +184 │ │ │ │ +185 auto y = Dune::FieldMatrix{}; │ │ │ │ +186 for(auto degree : Dune::range(1, maxDegree+1)) │ │ │ │ +187 y[degree][0] = degree*xPowers[degree-1]; │ │ │ │ +188 return y; │ │ │ │ +189 } │ │ │ │ +190 │ │ │ │ +191 struct _H_e_s_s_i_a_n │ │ │ │ +192 { │ │ │ │ +193 template │ │ │ │ +194 constexpr auto _o_p_e_r_a_t_o_r_(_)(const Dune::FieldVector& x) │ │ │ │ +const │ │ │ │ +195 { │ │ │ │ +196 auto xPowers = std::array{}; │ │ │ │ +197 Impl::computePowers(x[0],xPowers); │ │ │ │ +198 │ │ │ │ +199 auto y = std::array,_s_i_z_e>{}; │ │ │ │ +200 for(auto degree : Dune::range(maxDegree+1)) │ │ │ │ +201 if (degree-1 > 0) │ │ │ │ +202 y[degree][0][0] = degree*(degree-1)*xPowers[degree-2]; │ │ │ │ +203 return y; │ │ │ │ +204 } │ │ │ │ +205 │ │ │ │ +206 }; │ │ │ │ 207 │ │ │ │ -208 │ │ │ │ -209template │ │ │ │ -_2_1_0class _N_e_d_e_l_e_c_N_o_d_e : │ │ │ │ -211 public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ -212{ │ │ │ │ -213 static const int dim = GV::dimension; │ │ │ │ +208 constexpr friend auto _d_e_r_i_v_a_t_i_v_e(const Derivative& d) │ │ │ │ +209 { │ │ │ │ +210 return _H_e_s_s_i_a_n{}; │ │ │ │ +211 } │ │ │ │ +212 │ │ │ │ +213 }; │ │ │ │ 214 │ │ │ │ -215public: │ │ │ │ -216 │ │ │ │ -_2_1_7 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ -_2_1_8 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ -219 static_assert(kind==1, "Only Nedelec elements of the first kind are │ │ │ │ -implemented!"); │ │ │ │ -_2_2_0 using _F_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p = typename Impl:: │ │ │ │ -Nedelec1stKindLocalFiniteElementMap; │ │ │ │ -_2_2_1 using _F_i_n_i_t_e_E_l_e_m_e_n_t = Impl::GlobalValuedLocalFiniteElement; │ │ │ │ -224 │ │ │ │ -_2_2_5 _N_e_d_e_l_e_c_N_o_d_e(const _F_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p* finiteElementMap) : │ │ │ │ -226 _e_l_e_m_e_n_t__(nullptr), │ │ │ │ -227 _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__(finiteElementMap) │ │ │ │ -228 { } │ │ │ │ +215 constexpr friend auto _d_e_r_i_v_a_t_i_v_e(const MonomialSet& m) │ │ │ │ +216 { │ │ │ │ +217 return _D_e_r_i_v_a_t_i_v_e{}; │ │ │ │ +218 } │ │ │ │ +219 │ │ │ │ +220 }; │ │ │ │ +221 │ │ │ │ +222 │ │ │ │ +223 // Specialization for dim = 2 │ │ │ │ +224 template │ │ │ │ +225 struct _M_o_n_o_m_i_a_l_S_e_t │ │ │ │ +226 { │ │ │ │ +227 static constexpr int _d_i_m = 2; │ │ │ │ +228 static constexpr int _s_i_z_e = (maxDegree+1)*(maxDegree+2)/2; │ │ │ │ 229 │ │ │ │ -_2_3_1 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ -232 { │ │ │ │ -233 return *_e_l_e_m_e_n_t__; │ │ │ │ -234 } │ │ │ │ -235 │ │ │ │ -_2_4_0 const _F_i_n_i_t_e_E_l_e_m_e_n_t& _f_i_n_i_t_e_E_l_e_m_e_n_t() const │ │ │ │ -241 { │ │ │ │ -242 return _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ -243 } │ │ │ │ -244 │ │ │ │ -_2_4_6 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ -247 { │ │ │ │ -248 _e_l_e_m_e_n_t__ = &e; │ │ │ │ -249 _f_i_n_i_t_e_E_l_e_m_e_n_t__.bind((_f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__->find(*_e_l_e_m_e_n_t__)), e); │ │ │ │ -250 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__.size()); │ │ │ │ -251 } │ │ │ │ +230 static constexpr auto _e_x_p_o_n_e_n_t_s() │ │ │ │ +231 { │ │ │ │ +232 auto p = std::array,_s_i_z_e>{}; │ │ │ │ +233 std::size_t index = 0; │ │ │ │ +234 for(auto degree : Dune::range(maxDegree+1)) │ │ │ │ +235 { │ │ │ │ +236 for(auto k : Dune::range(degree+1)) │ │ │ │ +237 { │ │ │ │ +238 p[index][0] = degree-k; │ │ │ │ +239 p[index][1] = k; │ │ │ │ +240 ++index; │ │ │ │ +241 } │ │ │ │ +242 } │ │ │ │ +243 return p; │ │ │ │ +244 } │ │ │ │ +245 │ │ │ │ +246 template │ │ │ │ +247 constexpr auto _o_p_e_r_a_t_o_r_(_)(const Dune::FieldVector& x) │ │ │ │ +const │ │ │ │ +248 { │ │ │ │ +249 auto xPowers = std::array,_d_i_m>{}; │ │ │ │ +250 for(auto j : Dune::range(_d_i_m)) │ │ │ │ +251 Impl::computePowers(x[j], xPowers[j]); │ │ │ │ 252 │ │ │ │ -253protected: │ │ │ │ -254 │ │ │ │ -_2_5_5 _F_i_n_i_t_e_E_l_e_m_e_n_t _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ -_2_5_6 const _E_l_e_m_e_n_t* _e_l_e_m_e_n_t__; │ │ │ │ -_2_5_7 const _F_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p* _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__; │ │ │ │ -258}; │ │ │ │ -259 │ │ │ │ -260 │ │ │ │ -261 │ │ │ │ -262namespace _B_a_s_i_s_F_a_c_t_o_r_y { │ │ │ │ -263 │ │ │ │ -273template │ │ │ │ -_2_7_4auto _n_e_d_e_l_e_c() │ │ │ │ -275{ │ │ │ │ -276 return [](const auto& gridView) { │ │ │ │ -277 return _N_e_d_e_l_e_c_P_r_e_B_a_s_i_s, Range, kind, │ │ │ │ -order>(gridView); │ │ │ │ -278 }; │ │ │ │ -279} │ │ │ │ -280 │ │ │ │ -281} // end namespace BasisFactory │ │ │ │ -282 │ │ │ │ -283 │ │ │ │ -284 │ │ │ │ -285/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -286// This is the actual global basis implementation based on the reusable │ │ │ │ -parts. │ │ │ │ -287/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -288 │ │ │ │ -296template │ │ │ │ -_2_9_7using _N_e_d_e_l_e_c_B_a_s_i_s = _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_N_e_d_e_l_e_c_P_r_e_B_a_s_i_s_<_G_V_,_ _R_a_n_g_e_,_ _k_i_n_d_, │ │ │ │ -_o_r_d_e_r_ _> >; │ │ │ │ -298 │ │ │ │ -299} // end namespace Dune::Functions │ │ │ │ -300 │ │ │ │ -301 │ │ │ │ -302#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH │ │ │ │ -_n_o_d_e_s_._h_h │ │ │ │ -_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h │ │ │ │ -_g_l_o_b_a_l_v_a_l_u_e_d_l_o_c_a_l_f_i_n_i_t_e_e_l_e_m_e_n_t_._h_h │ │ │ │ -_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_p_o_w_e_r │ │ │ │ -auto power(ChildPreBasisFactory &&childPreBasisFactory, std::size_t k, const │ │ │ │ -IndexMergingStrategy &) │ │ │ │ -Create a pre-basis factory that can build a PowerPreBasis. │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:410 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_n_e_d_e_l_e_c │ │ │ │ -auto nedelec() │ │ │ │ -Create a pre-basis factory that can create a Nédélec pre-basis. │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:274 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_e_l_e_m_e_n_t_s │ │ │ │ -auto elements(const SubDomainGridView< HostGridView > &subDomainGridView) │ │ │ │ -ADL findable access to element range for a SubDomainGridView. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:487 │ │ │ │ +253 auto y = Dune::FieldVector{}; │ │ │ │ +254 std::size_t index = 0; │ │ │ │ +255 for(auto degree : Dune::range(maxDegree+1)) │ │ │ │ +256 { │ │ │ │ +257 for(auto k : Dune::range(degree+1)) │ │ │ │ +258 { │ │ │ │ +259 y[index] = xPowers[0][degree-k]*xPowers[1][k]; │ │ │ │ +260 ++index; │ │ │ │ +261 } │ │ │ │ +262 } │ │ │ │ +263 return y; │ │ │ │ +264 } │ │ │ │ +265 │ │ │ │ +266 struct _D_e_r_i_v_a_t_i_v_e │ │ │ │ +267 { │ │ │ │ +268 template │ │ │ │ +269 constexpr auto _o_p_e_r_a_t_o_r_(_)(const Dune::FieldVector& x) │ │ │ │ +const │ │ │ │ +270 { │ │ │ │ +271 auto xPowers = std::array,_d_i_m>{}; │ │ │ │ +272 for(auto j : Dune::range(_d_i_m)) │ │ │ │ +273 Impl::computePowers(x[j], xPowers[j]); │ │ │ │ +274 │ │ │ │ +275 auto y = Dune::FieldMatrix{}; │ │ │ │ +276 std::size_t index = 0; │ │ │ │ +277 for(auto degree : Dune::range(maxDegree+1)) │ │ │ │ +278 { │ │ │ │ +279 for(auto k : Dune::range(degree+1)) │ │ │ │ +280 { │ │ │ │ +281 if (degree-k > 0) │ │ │ │ +282 y[index][0] = (degree-k)*xPowers[0][degree-k-1]*xPowers[1][k]; │ │ │ │ +283 if (k > 0) │ │ │ │ +284 y[index][1] = k*xPowers[0][degree-k]*xPowers[1][k-1]; │ │ │ │ +285 ++index; │ │ │ │ +286 } │ │ │ │ +287 } │ │ │ │ +288 return y; │ │ │ │ +289 } │ │ │ │ +290 │ │ │ │ +291 struct _H_e_s_s_i_a_n │ │ │ │ +292 { │ │ │ │ +293 template │ │ │ │ +294 constexpr auto _o_p_e_r_a_t_o_r_(_)(const Dune::FieldVector& x) │ │ │ │ +const │ │ │ │ +295 { │ │ │ │ +296 auto xPowers = std::array,_d_i_m>{}; │ │ │ │ +297 for(auto j : Dune::range(_d_i_m)) │ │ │ │ +298 Impl::computePowers(x[j], xPowers[j]); │ │ │ │ +299 │ │ │ │ +300 auto y = std::array,_s_i_z_e>{}; │ │ │ │ +301 std::size_t index = 0; │ │ │ │ +302 for(auto degree : Dune::range(maxDegree+1)) │ │ │ │ +303 { │ │ │ │ +304 for(auto k : Dune::range(degree+1)) │ │ │ │ +305 { │ │ │ │ +306 if (degree-k > 1) │ │ │ │ +307 y[index][0][0] = (degree-k-1)*(degree-k)*xPowers[0][degree-k-2]*xPowers[1] │ │ │ │ +[k]; │ │ │ │ +308 if (k > 0 and degree-k > 0){ │ │ │ │ +309 auto mixed = k*(degree-k)*xPowers[0][degree-k-1]*xPowers[1][k-1]; │ │ │ │ +310 y[index][0][1]= mixed; │ │ │ │ +311 y[index][1][0]= mixed; │ │ │ │ +312 } │ │ │ │ +313 if (k > 1) │ │ │ │ +314 y[index][1][1] = k*(k-1)*xPowers[0][degree-k]*xPowers[1][k-2]; │ │ │ │ +315 │ │ │ │ +316 ++index; │ │ │ │ +317 } │ │ │ │ +318 } │ │ │ │ +319 return y; │ │ │ │ +320 } │ │ │ │ +321 │ │ │ │ +322 }; │ │ │ │ +323 │ │ │ │ +324 constexpr friend auto _d_e_r_i_v_a_t_i_v_e(const Derivative & d) │ │ │ │ +325 { │ │ │ │ +326 return _H_e_s_s_i_a_n{}; │ │ │ │ +327 } │ │ │ │ +328 │ │ │ │ +329 }; │ │ │ │ +330 │ │ │ │ +331 constexpr friend auto _d_e_r_i_v_a_t_i_v_e(const MonomialSet& m) │ │ │ │ +332 { │ │ │ │ +333 return _D_e_r_i_v_a_t_i_v_e{}; │ │ │ │ +334 } │ │ │ │ +335 │ │ │ │ +336 }; │ │ │ │ +337 │ │ │ │ +338 │ │ │ │ +339 // Specialization for dim = 3 │ │ │ │ +340 template │ │ │ │ +341 struct _M_o_n_o_m_i_a_l_S_e_t │ │ │ │ +342 { │ │ │ │ +343 static constexpr int _d_i_m = 3; │ │ │ │ +344 static constexpr int _s_i_z_e = Dune::binomial(maxDegree + _d_i_m, _d_i_m); │ │ │ │ +345 │ │ │ │ +346 static constexpr auto _e_x_p_o_n_e_n_t_s() │ │ │ │ +347 { │ │ │ │ +348 auto p = std::array,_s_i_z_e>{}; │ │ │ │ +349 std::size_t index = 0; │ │ │ │ +350 for(auto degree : Dune::range(maxDegree+1)) │ │ │ │ +351 { │ │ │ │ +352 for(auto k : Dune::range(degree+1)) │ │ │ │ +353 { │ │ │ │ +354 for (auto l : Dune::range(degree-k+1)) │ │ │ │ +355 { │ │ │ │ +356 p[index][0] = degree-k-l; │ │ │ │ +357 p[index][1] = l; │ │ │ │ +358 p[index][2] = k; │ │ │ │ +359 ++index; │ │ │ │ +360 } │ │ │ │ +361 │ │ │ │ +362 } │ │ │ │ +363 } │ │ │ │ +364 return p; │ │ │ │ +365 } │ │ │ │ +366 │ │ │ │ +367 template │ │ │ │ +368 constexpr auto _o_p_e_r_a_t_o_r_(_)(const Dune::FieldVector& x) │ │ │ │ +const │ │ │ │ +369 { │ │ │ │ +370 auto xPowers = std::array,_d_i_m>{}; │ │ │ │ +371 for(auto j : Dune::range(_d_i_m)) │ │ │ │ +372 Impl::computePowers(x[j], xPowers[j]); │ │ │ │ +373 │ │ │ │ +374 auto y = Dune::FieldVector{}; │ │ │ │ +375 std::size_t index = 0; │ │ │ │ +376 for(auto degree : Dune::range(maxDegree+1)) │ │ │ │ +377 { │ │ │ │ +378 for(auto k : Dune::range(degree+1)) │ │ │ │ +379 { │ │ │ │ +380 for (auto l : Dune::range(degree-k+1)) │ │ │ │ +381 { │ │ │ │ +382 y[index] = xPowers[0][degree-k-l]*xPowers[1][l]*xPowers[2][k]; │ │ │ │ +383 ++index; │ │ │ │ +384 } │ │ │ │ +385 } │ │ │ │ +386 } │ │ │ │ +387 return y; │ │ │ │ +388 } │ │ │ │ +389 │ │ │ │ +390 struct _D_e_r_i_v_a_t_i_v_e │ │ │ │ +391 { │ │ │ │ +392 template │ │ │ │ +393 constexpr auto _o_p_e_r_a_t_o_r_(_)(const Dune::FieldVector& x) │ │ │ │ +const │ │ │ │ +394 { │ │ │ │ +395 auto xPowers = std::array,_d_i_m>{}; │ │ │ │ +396 for(auto j : Dune::range(_d_i_m)) │ │ │ │ +397 { │ │ │ │ +398 xPowers[j][0] = 1.0; │ │ │ │ +399 for(auto k : Dune::range(maxDegree)) │ │ │ │ +400 xPowers[j][k+1] = xPowers[j][k]*x[j]; │ │ │ │ +401 } │ │ │ │ +402 │ │ │ │ +403 auto y = Dune::FieldMatrix{}; │ │ │ │ +404 std::size_t index = 0; │ │ │ │ +405 for(auto degree : Dune::range(maxDegree+1)) │ │ │ │ +406 { │ │ │ │ +407 for(auto k : Dune::range(degree+1)) │ │ │ │ +408 { │ │ │ │ +409 for (auto l : Dune::range(degree-k+1)) │ │ │ │ +410 { │ │ │ │ +411 if (degree-k-l > 0) │ │ │ │ +412 y[index][0] = (degree-k-l)*xPowers[0][degree-k-l-1]*xPowers[1][l]*xPowers │ │ │ │ +[2][k]; │ │ │ │ +413 if (l > 0) │ │ │ │ +414 y[index][1] = l*xPowers[0][degree-k-l]*xPowers[1][l-1]*xPowers[2][k]; │ │ │ │ +415 if (k > 0) │ │ │ │ +416 y[index][2] = k*xPowers[0][degree-k-l]*xPowers[1][l]*xPowers[2][k-1]; │ │ │ │ +417 ++index; │ │ │ │ +418 } │ │ │ │ +419 } │ │ │ │ +420 } │ │ │ │ +421 return y; │ │ │ │ +422 } │ │ │ │ +423 │ │ │ │ +424 struct _H_e_s_s_i_a_n │ │ │ │ +425 { │ │ │ │ +426 template │ │ │ │ +427 constexpr auto _o_p_e_r_a_t_o_r_(_)(const Dune::FieldVector& x) │ │ │ │ +const │ │ │ │ +428 { │ │ │ │ +429 auto xPowers = std::array,_d_i_m>{}; │ │ │ │ +430 for(auto j : Dune::range(_d_i_m)) │ │ │ │ +431 Impl::computePowers(x[j], xPowers[j]); │ │ │ │ +432 │ │ │ │ +433 auto y = std::array,_s_i_z_e>{}; │ │ │ │ +434 std::size_t index = 0; │ │ │ │ +435 for(auto degree : Dune::range(maxDegree+1)) │ │ │ │ +436 { │ │ │ │ +437 for(auto k : Dune::range(degree+1)) │ │ │ │ +438 { │ │ │ │ +439 for (auto l : Dune::range(degree-k+1)) │ │ │ │ +440 { │ │ │ │ +441 // xx │ │ │ │ +442 if (degree-k-l-1 > 0) │ │ │ │ +443 y[index][0][0] = (degree-k-l)*(degree-k-l-1)*xPowers[0][degree-k-l- │ │ │ │ +2]*xPowers[1][l]*xPowers[2][k]; │ │ │ │ +444 // xy and yx │ │ │ │ +445 if (degree-k-l > 0 and l > 0){ │ │ │ │ +446 y[index][0][1] = (degree-k-l)*l*xPowers[0][degree-k-l-1]*xPowers[1][l- │ │ │ │ +1]*xPowers[2][k]; │ │ │ │ +447 y[index][1][0] = y[index][0][1]; │ │ │ │ +448 } │ │ │ │ +449 // yy │ │ │ │ +450 if (l-1 > 0) │ │ │ │ +451 y[index][1][1] = l*(l-1)*xPowers[0][degree-k-l]*xPowers[1][l-2]*xPowers[2] │ │ │ │ +[k]; │ │ │ │ +452 // xz and zx │ │ │ │ +453 if (k > 0 and degree-k-l > 0) │ │ │ │ +454 { │ │ │ │ +455 y[index][0][2] = (degree-k-l)*k*xPowers[0][degree-k-l-1]*xPowers[1] │ │ │ │ +[l]*xPowers[2][k-1]; │ │ │ │ +456 y[index][2][0] = y[index][0][2]; │ │ │ │ +457 } │ │ │ │ +458 // yz │ │ │ │ +459 if (l > 0 and k > 0) │ │ │ │ +460 { │ │ │ │ +461 y[index][1][2] = l*k*xPowers[0][degree-k-l]*xPowers[1][l-1]*xPowers[2][k- │ │ │ │ +1]; │ │ │ │ +462 y[index][2][1] = y[index][1][2]; │ │ │ │ +463 } │ │ │ │ +464 // zz │ │ │ │ +465 if (k-1 > 0) │ │ │ │ +466 y[index][2][2] = (k-1)*k*xPowers[0][degree-k-l]*xPowers[1][l]*xPowers[2][k- │ │ │ │ +2]; │ │ │ │ +467 ++index; │ │ │ │ +468 } │ │ │ │ +469 } │ │ │ │ +470 } │ │ │ │ +471 return y; │ │ │ │ +472 } │ │ │ │ +473 │ │ │ │ +474 }; │ │ │ │ +475 │ │ │ │ +476 constexpr friend auto _d_e_r_i_v_a_t_i_v_e(const Derivative & d) │ │ │ │ +477 { │ │ │ │ +478 return _H_e_s_s_i_a_n{}; │ │ │ │ +479 } │ │ │ │ +480 │ │ │ │ +481 }; │ │ │ │ +482 │ │ │ │ +483 constexpr friend auto _d_e_r_i_v_a_t_i_v_e(const MonomialSet& m) │ │ │ │ +484 { │ │ │ │ +485 return _D_e_r_i_v_a_t_i_v_e{}; │ │ │ │ +486 } │ │ │ │ +487 │ │ │ │ +488 }; │ │ │ │ +489 #endif │ │ │ │ +490} // namespace Dune::Functions │ │ │ │ +491 │ │ │ │ +492#endif // DUNE_FUNCTIONS_ANALYTICFUNCTIONS_MONOMIALSET_HH │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_B_a_s_i_s │ │ │ │ -DefaultGlobalBasis< NedelecPreBasis< GV, Range, kind, order > > NedelecBasis │ │ │ │ -Basis of a k-th-order Nédélec finite element space. │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:297 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:926 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ -Global basis for given pre-basis. │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:53 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_u_p_d_a_t_e │ │ │ │ -void update(const GridView &gv) │ │ │ │ -Update the stored GridView. │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:101 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n │ │ │ │ -LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout) │ │ │ │ -Construct from GridView and local DOF layout. │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:74 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_N_o_d_e │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:212 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__ │ │ │ │ -const FiniteElementMap * finiteElementMap_ │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:257 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t__ │ │ │ │ -FiniteElement finiteElement_ │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:255 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_N_o_d_e_:_:_F_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ -Impl::GlobalValuedLocalFiniteElement< Impl::CovariantPiolaTransformator, │ │ │ │ -typename FiniteElementMap::FiniteElement, Element > FiniteElement │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:221 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_N_o_d_e_:_:_b_i_n_d │ │ │ │ -void bind(const Element &e) │ │ │ │ -Bind to element. │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:246 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_N_o_d_e_:_:_e_l_e_m_e_n_t │ │ │ │ -const Element & element() const │ │ │ │ -Return current element, throw if unbound. │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:231 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_N_o_d_e_:_:_E_l_e_m_e_n_t │ │ │ │ -typename GV::template Codim< 0 >::Entity Element │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:218 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ -const FiniteElement & finiteElement() const │ │ │ │ -Return the LocalFiniteElement for the element we are bound to. │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:240 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_N_o_d_e_:_:_N_e_d_e_l_e_c_N_o_d_e │ │ │ │ -NedelecNode(const FiniteElementMap *finiteElementMap) │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:225 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_N_o_d_e_:_:_F_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p │ │ │ │ -typename Impl::Nedelec1stKindLocalFiniteElementMap< GV, dim, Range, order > │ │ │ │ -FiniteElementMap │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:220 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_N_o_d_e_:_:_e_l_e_m_e_n_t__ │ │ │ │ -const Element * element_ │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:256 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_N_o_d_e_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:217 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_P_r_e_B_a_s_i_s │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:150 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_P_r_e_B_a_s_i_s_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:160 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_P_r_e_B_a_s_i_s_:_:_N_e_d_e_l_e_c_P_r_e_B_a_s_i_s │ │ │ │ -NedelecPreBasis(const GridView &gv) │ │ │ │ -Constructor for a given grid view object. │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:165 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ -GV GridView │ │ │ │ -The grid view that the FE space is defined on. │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:159 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_P_r_e_B_a_s_i_s_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__ │ │ │ │ -FiniteElementMap finiteElementMap_ │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:204 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_P_r_e_B_a_s_i_s_:_:_N_o_d_e │ │ │ │ -NedelecNode< GV, Range, kind, order > Node │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:162 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_P_r_e_B_a_s_i_s_:_:_u_p_d_a_t_e │ │ │ │ -void update(const GridView &gv) │ │ │ │ -Update the stored grid view, to be called if the grid has changed. │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:189 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_P_r_e_B_a_s_i_s_:_:_m_a_k_e_N_o_d_e │ │ │ │ -Node makeNode() const │ │ │ │ -Create tree node. │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:198 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_e_t_S_i_z_e │ │ │ │ -void setSize(const size_type size) │ │ │ │ -DDeeffiinniittiioonn nodes.hh:197 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ -DDeeffiinniittiioonn nodes.hh:218 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_n_o_m_i_a_l_S_e_t │ │ │ │ +Function, which evaluates all monomials up to degree maxDegree in a given │ │ │ │ +coordinate. │ │ │ │ +DDeeffiinniittiioonn monomialset.hh:64 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_n_o_m_i_a_l_S_e_t_:_:_d_i_m │ │ │ │ +static constexpr int dim │ │ │ │ +DDeeffiinniittiioonn monomialset.hh:65 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_n_o_m_i_a_l_S_e_t_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ +constexpr Dune::FieldVector< RangeFieldType, size > operator()(const Dune:: │ │ │ │ +FieldVector< DomainFieldType, dim > &x) const │ │ │ │ +Return array of monomial evaluations. │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_n_o_m_i_a_l_S_e_t_:_:_e_x_p_o_n_e_n_t_s │ │ │ │ +static constexpr std::array< std::array< std::size_t, dim >, size > exponents() │ │ │ │ +Return array of monomial exponents with shape size x dim. │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_n_o_m_i_a_l_S_e_t_:_:_s_i_z_e │ │ │ │ +static constexpr int size │ │ │ │ +DDeeffiinniittiioonn monomialset.hh:66 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_n_o_m_i_a_l_S_e_t_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ +constexpr friend auto derivative(const MonomialSet &m) │ │ │ │ +Construct the Derivative object from a MonomialSet. │ │ │ │ +DDeeffiinniittiioonn monomialset.hh:145 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_n_o_m_i_a_l_S_e_t_:_:_D_e_r_i_v_a_t_i_v_e │ │ │ │ +Set of all first order derivatives of monomials up to degree maxDegree as │ │ │ │ +vector of vector valued fun... │ │ │ │ +DDeeffiinniittiioonn monomialset.hh:99 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_n_o_m_i_a_l_S_e_t_:_:_D_e_r_i_v_a_t_i_v_e_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ +constexpr Dune::FieldMatrix< RangeFieldType, size, dim > operator()(const │ │ │ │ +Dune::FieldVector< DomainFieldType, dim > &x) const │ │ │ │ +Return array of arrays of monomial derivatives. │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_n_o_m_i_a_l_S_e_t_:_:_D_e_r_i_v_a_t_i_v_e_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ +constexpr friend auto derivative(const Derivative &d) │ │ │ │ +Construct the Hessian object from a Derivative. │ │ │ │ +DDeeffiinniittiioonn monomialset.hh:135 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_n_o_m_i_a_l_S_e_t_:_:_D_e_r_i_v_a_t_i_v_e_:_:_H_e_s_s_i_a_n │ │ │ │ +Set of all second order derivatives of monomials up to degree maxDegree as │ │ │ │ +vector of matrix valued fu... │ │ │ │ +DDeeffiinniittiioonn monomialset.hh:117 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_n_o_m_i_a_l_S_e_t_:_:_D_e_r_i_v_a_t_i_v_e_:_:_H_e_s_s_i_a_n_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ +constexpr std::array< FieldMatrix< RangeFieldType, dim, dim >, size > operator │ │ │ │ +()(const Dune::FieldVector< DomainFieldType, dim > &x) const │ │ │ │ +Return array of Matrices of monomial derivatives. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _n_e_d_e_l_e_c_b_a_s_i_s_._h_h │ │ │ │ + * _a_n_a_l_y_t_i_c_f_u_n_c_t_i_o_n_s │ │ │ │ + * _m_o_n_o_m_i_a_l_s_e_t_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00116.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: morleybasis.hh File Reference │ │ │ +Dune-Functions: trigonometricfunction.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,91 +88,49 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
morleybasis.hh File Reference
│ │ │ +
trigonometricfunction.hh File Reference
│ │ │
│ │ │
│ │ │ - │ │ │ -

This file provides an implementation of the quadratic Morley finite element in 1 to 3 dimensions. │ │ │ -More...

│ │ │ -
#include <algorithm>
│ │ │ -#include <type_traits>
│ │ │ -#include <vector>
│ │ │ -#include <array>
│ │ │ -#include <bitset>
│ │ │ -#include <dune/common/boundschecking.hh>
│ │ │ -#include <dune/common/exceptions.hh>
│ │ │ -#include <dune/common/fvector.hh>
│ │ │ -#include <dune/grid/common/mcmgmapper.hh>
│ │ │ -#include <dune/grid/common/rangegenerators.hh>
│ │ │ -#include <dune/localfunctions/common/localbasis.hh>
│ │ │ -#include <dune/localfunctions/common/localfiniteelementtraits.hh>
│ │ │ -#include <dune/localfunctions/common/localkey.hh>
│ │ │ -#include <dune/functions/analyticfunctions/monomialset.hh>
│ │ │ -#include <dune/functions/common/densevectorview.hh>
│ │ │ -#include <dune/functions/common/squeezetensor.hh>
│ │ │ -#include <dune/functions/functionspacebases/cubichermitebasis.hh>
│ │ │ -#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │ -#include <dune/functions/functionspacebases/functionaldescriptor.hh>
│ │ │ -#include <dune/functions/functionspacebases/leafprebasismappermixin.hh>
│ │ │ -#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ -#include <dune/functions/functionspacebases/transformedfiniteelementmixin.hh>
│ │ │ +
#include <cmath>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::MorleyNode< GV, R >
class  Dune::Functions::MorleyPreBasis< GV, R >
 A pre-basis for a Morleybasis. More...
class  Dune::Functions::TrigonometricFunction< K, sinFactor, cosFactor >
 A linear combination of trigonomic functions. More...
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ -

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::BasisFactory
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │

│ │ │ -Typedefs

template<class GV, class R = double>
using Dune::Functions::MorleyBasis = DefaultGlobalBasis<MorleyPreBasis<GV, R> >
 Nodal basis of a scalar quadratic Morley finite element space.
│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Functions

template<class R = double>
auto Dune::Functions::BasisFactory::morley ()
 construct a PreBasisFactory for the Morley Finite Element
template<class K, int sinFactor, int cosFactor>
TrigonometricFunction< K, -cosFactor, sinFactor > Dune::Functions::derivative (const TrigonometricFunction< K, sinFactor, cosFactor > &f)
 Obtain derivative of TrigonometricFunction function.
│ │ │ -

Detailed Description

│ │ │ -

This file provides an implementation of the quadratic Morley finite element in 1 to 3 dimensions.

│ │ │ -

The implementation is based on [Robert Kirby, A general approach to transforming finite elements, 2018]. It contains in the following order:

    │ │ │ -
  • A GlobalBasis typedef MorleyBasis
  • │ │ │ -
  • A template H2LocalBasisTraits, extending the dune-localfunctions LocalBasisTraits by an exported Hessiantype
  • │ │ │ -
  • A template MorleyLocalFiniteElement providing an implementation of the LocalFiniteElement interface, along with its subparts (Impl namespace)
  • │ │ │ -
  • A template MorleyNode
  • │ │ │ -
  • A template MorleyPreBasis
  • │ │ │ -
  • A factory morley() in the BasisFactory namespace
  • │ │ │ -
│ │ │ -
│ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,65 +1,25 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -morleybasis.hh File Reference │ │ │ │ -This file provides an implementation of the quadratic Morley finite element in │ │ │ │ -1 to 3 dimensions. _M_o_r_e_._._. │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_a_n_a_l_y_t_i_c_f_u_n_c_t_i_o_n_s_/_m_o_n_o_m_i_a_l_s_e_t_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_n_s_e_v_e_c_t_o_r_v_i_e_w_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_s_q_u_e_e_z_e_t_e_n_s_o_r_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_u_b_i_c_h_e_r_m_i_t_e_b_a_s_i_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_f_u_n_c_t_i_o_n_a_l_d_e_s_c_r_i_p_t_o_r_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_t_r_a_n_s_f_o_r_m_e_d_f_i_n_i_t_e_e_l_e_m_e_n_t_m_i_x_i_n_._h_h> │ │ │ │ +trigonometricfunction.hh File Reference │ │ │ │ +#include │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_N_o_d_e_<_ _G_V_,_ _R_ _> │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_P_r_e_B_a_s_i_s_<_ _G_V_,_ _R_ _> │ │ │ │ -  A pre-basis for a Morleybasis. _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_i_g_o_n_o_m_e_t_r_i_c_F_u_n_c_t_i_o_n_<_ _K_,_ _s_i_n_F_a_c_t_o_r_,_ _c_o_s_F_a_c_t_o_r_ _> │ │ │ │ +  A linear combination of trigonomic functions. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -TTyyppeeddeeffss │ │ │ │ -template │ │ │ │ -using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_B_a_s_i_s = _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s<_M_o_r_l_e_y_P_r_e_B_a_s_i_s │ │ │ │ - > │ │ │ │ -  Nodal basis of a scalar quadratic Morley finite element space. │ │ │ │ FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_m_o_r_l_e_y () │ │ │ │ -  construct a PreBasisFactory for the Morley Finite Element │ │ │ │ -********** DDeettaaiilleedd DDeessccrriippttiioonn ********** │ │ │ │ -This file provides an implementation of the quadratic Morley finite element in │ │ │ │ -1 to 3 dimensions. │ │ │ │ -The implementation is based on [Robert Kirby, A general approach to │ │ │ │ -transforming finite elements, 2018]. It contains in the following order: │ │ │ │ - * A GlobalBasis typedef MorleyBasis │ │ │ │ - * A template H2LocalBasisTraits, extending the dune-localfunctions │ │ │ │ - LocalBasisTraits by an exported Hessiantype │ │ │ │ - * A template MorleyLocalFiniteElement providing an implementation of the │ │ │ │ - LocalFiniteElement interface, along with its subparts (Impl namespace) │ │ │ │ - * A template MorleyNode │ │ │ │ - * A template MorleyPreBasis │ │ │ │ - * A factory morley() in the BasisFactory namespace │ │ │ │ +template │ │ │ │ +_T_r_i_g_o_n_o_m_e_t_r_i_c_F_u_n_c_t_i_o_n< K, -cosFactor, _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_d_e_r_i_v_a_t_i_v_e (const │ │ │ │ + sinFactor >  _T_r_i_g_o_n_o_m_e_t_r_i_c_F_u_n_c_t_i_o_n< K, sinFactor, │ │ │ │ + cosFactor > &f) │ │ │ │ +  Obtain derivative of │ │ │ │ + _T_r_i_g_o_n_o_m_e_t_r_i_c_F_u_n_c_t_i_o_n function. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _m_o_r_l_e_y_b_a_s_i_s_._h_h │ │ │ │ + * _a_n_a_l_y_t_i_c_f_u_n_c_t_i_o_n_s │ │ │ │ + * _t_r_i_g_o_n_o_m_e_t_r_i_c_f_u_n_c_t_i_o_n_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00116.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,5 +1,3 @@ │ │ │ │ var a00116 = [ │ │ │ │ - ["Dune::Functions::MorleyNode< GV, R >", "a01978.html", "a01978"], │ │ │ │ - ["Dune::Functions::MorleyBasis", "a00312.html#ga8088b673016b66bd019e80f15bd324c5", null], │ │ │ │ - ["Dune::Functions::BasisFactory::morley", "a00327.html#aa2b9ac2be3ebf37e0efd09731c4f1bca", null] │ │ │ │ + ["Dune::Functions::derivative", "a00308.html#ga7ec424ff4be740ad675bd85750940472", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00116_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: morleybasis.hh Source File │ │ │ +Dune-Functions: trigonometricfunction.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,609 +88,73 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
morleybasis.hh
│ │ │ +
trigonometricfunction.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │ -
6#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_MORLEYBASIS_HH
│ │ │ -
7#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_MORLEYBASIS_HH
│ │ │ -
8
│ │ │ -
9#include <algorithm>
│ │ │ -
10#include <type_traits>
│ │ │ -
11#include <vector>
│ │ │ -
12#include <array>
│ │ │ -
13#include <bitset>
│ │ │ +
6
│ │ │ +
7#ifndef DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
│ │ │ +
8#define DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
│ │ │ +
9
│ │ │ +
10#include <cmath>
│ │ │ +
11
│ │ │ +
12namespace Dune {
│ │ │ +
13namespace Functions {
│ │ │
14
│ │ │ -
15#include <dune/common/boundschecking.hh>
│ │ │ -
16#include <dune/common/exceptions.hh>
│ │ │ -
17#include <dune/common/fvector.hh>
│ │ │ -
18
│ │ │ -
19#include <dune/grid/common/mcmgmapper.hh>
│ │ │ -
20#include <dune/grid/common/rangegenerators.hh>
│ │ │ -
21
│ │ │ -
22#include <dune/localfunctions/common/localbasis.hh>
│ │ │ -
23#include <dune/localfunctions/common/localfiniteelementtraits.hh>
│ │ │ -
24#include <dune/localfunctions/common/localkey.hh>
│ │ │ -
25
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
35
│ │ │ -
52namespace Dune::Functions
│ │ │ -
53{
│ │ │ -
54
│ │ │ -
55 template<class GV, class R>
│ │ │ -
56 class MorleyPreBasis;
│ │ │ -
57
│ │ │ -
75 template<class GV, class R = double>
│ │ │ - │ │ │ -
77
│ │ │ -
78
│ │ │ -
79 namespace Impl
│ │ │ -
80 {
│ │ │ -
81
│ │ │ -
88 template<class D, class R>
│ │ │ -
89 class MorleyReferenceLocalBasis
│ │ │ -
90 {
│ │ │ -
91 public:
│ │ │ -
92 static constexpr int dim = 2;
│ │ │ -
93 using Traits = H2LocalBasisTraits<D, dim, FieldVector<D, dim>, R, 1, FieldVector<R, 1>,
│ │ │ -
94 FieldMatrix<R, 1, dim>, FieldMatrix<R, dim, dim>>;
│ │ │ -
95
│ │ │ -
96 private:
│ │ │ -
97
│ │ │ -
110 static constexpr auto getMorleyCoefficients()
│ │ │ -
111 {
│ │ │ -
112 // Define std::sqrt(2.) manually in double precision,
│ │ │ -
113 // because std::sqrt is not constexpr before C++26.
│ │ │ -
114 D sqrt2 = 0.5 * 1.414213562373095;
│ │ │ -
115
│ │ │ -
116 return Dune::FieldMatrix<D, 6,6>({{1, -1, -1, 0, 2, 0},
│ │ │ -
117 {0, 0.5, 0.5, 0.5, -1, -0.5},
│ │ │ -
118 {0, 0.5, 0.5, -0.5, -1, 0.5},
│ │ │ -
119 {0, 0, 1, 0, 0, -1},
│ │ │ -
120 {0, -1., 0, 1., 0, 0},
│ │ │ -
121 {0, sqrt2, sqrt2, -sqrt2, -2. * sqrt2, -sqrt2}});
│ │ │ -
122 }
│ │ │ -
123
│ │ │ -
124 static constexpr auto referenceBasisCoefficients = getMorleyCoefficients();
│ │ │ - │ │ │ -
126
│ │ │ -
127 public:
│ │ │ -
128
│ │ │ -
131 static constexpr unsigned int size()
│ │ │ -
132 {
│ │ │ -
133 return 6;
│ │ │ -
134 }
│ │ │ -
135
│ │ │ -
138 static constexpr unsigned int order()
│ │ │ -
139 {
│ │ │ -
140 return 2;
│ │ │ -
141 }
│ │ │ -
142
│ │ │ -
148 void evaluateFunction(const typename Traits::DomainType &in,
│ │ │ -
149 std::vector<typename Traits::RangeType> &out) const
│ │ │ -
150 {
│ │ │ -
151 out.resize(size());
│ │ │ -
152 auto monomialValues = monomials(in);
│ │ │ -
153 multiplyWithCoefficentMatrix(referenceBasisCoefficients, monomialValues, out);
│ │ │ -
154 }
│ │ │ -
155
│ │ │ -
161 void evaluateJacobian(const typename Traits::DomainType &in,
│ │ │ -
162 std::vector<typename Traits::JacobianType> &out) const
│ │ │ -
163 {
│ │ │ -
164 out.resize(size());
│ │ │ -
165 auto monomialValues = derivative(monomials)(in);
│ │ │ -
166 multiplyWithCoefficentMatrix(referenceBasisCoefficients, monomialValues, out);
│ │ │ -
167 }
│ │ │ -
168
│ │ │ -
174 void evaluateHessian(const typename Traits::DomainType &in,
│ │ │ -
175 std::vector<typename Traits::HessianType> &out) const
│ │ │ -
176 {
│ │ │ -
177 out.resize(size());
│ │ │ -
178 auto monomialValues = derivative(derivative(monomials))(in);
│ │ │ -
179 multiplyWithCoefficentMatrix(referenceBasisCoefficients, monomialValues, out);
│ │ │ -
180 }
│ │ │ -
181
│ │ │ -
188 void partial(std::array<unsigned int, dim> order, const typename Traits::DomainType &in,
│ │ │ -
189 std::vector<typename Traits::RangeType> &out) const
│ │ │ -
190 {
│ │ │ -
191 out.resize(size());
│ │ │ -
192 auto totalOrder = std::accumulate(order.begin(), order.end(), 0);
│ │ │ -
193 if (totalOrder == 0)
│ │ │ -
194 evaluateFunction(in, out);
│ │ │ -
195 else if (totalOrder == 1)
│ │ │ -
196 {
│ │ │ -
197 evaluateJacobian(in,jacobiansBuffer_);
│ │ │ -
198 std::size_t which = std::max_element(order.begin(), order.end()) - order.begin();
│ │ │ -
199 for (auto i : Dune::range(size()))
│ │ │ -
200 out[i] = jacobiansBuffer_[i][0][which];
│ │ │ -
201 }
│ │ │ -
202 else if (totalOrder == 2)
│ │ │ -
203 {
│ │ │ -
204 evaluateHessian(in, hessianBuffer_);
│ │ │ -
205 std::size_t first, second;
│ │ │ -
206 first = std::max_element(order.begin(), order.end()) - order.begin();
│ │ │ -
207 if (order[first] == 2)
│ │ │ -
208 second = first;
│ │ │ -
209 else
│ │ │ -
210 {
│ │ │ -
211 order[first] = 0;
│ │ │ -
212 second = std::max_element(order.begin(), order.end()) - order.begin();
│ │ │ -
213 }
│ │ │ -
214 for (auto i : Dune::range(size()))
│ │ │ -
215 out[i] = hessianBuffer_[i][first][second];
│ │ │ -
216 }
│ │ │ -
217 else
│ │ │ -
218 DUNE_THROW(RangeError, "partial() not implemented for given order");
│ │ │ -
219 }
│ │ │ -
220
│ │ │ -
221 private:
│ │ │ -
222 mutable std::vector<typename Traits::JacobianType> jacobiansBuffer_;
│ │ │ -
223 mutable std::vector<typename Traits::HessianType> hessianBuffer_;
│ │ │ -
224 };
│ │ │ -
225
│ │ │ -
226
│ │ │ -
230 class MorleyLocalCoefficients
│ │ │ -
231 {
│ │ │ -
232 public:
│ │ │ -
233 using size_type = std::size_t;
│ │ │ -
234
│ │ │ -
235 MorleyLocalCoefficients()
│ │ │ -
236 {
│ │ │ -
237 for (size_type i = 0; i < 3; ++i)
│ │ │ -
238 {
│ │ │ -
239 localKeys_[i] = LocalKey(i, 2, 0); // vertex dofs
│ │ │ -
240 localKeys_[3 + i] = LocalKey(i, 1, 0); // edge dofs
│ │ │ -
241 }
│ │ │ -
242 }
│ │ │ -
243
│ │ │ -
246 static constexpr size_type size()
│ │ │ -
247 {
│ │ │ -
248 return 6;
│ │ │ -
249 }
│ │ │ -
250
│ │ │ -
253 constexpr LocalKey const &localKey(size_type i) const
│ │ │ -
254 {
│ │ │ -
255 return localKeys_[i];
│ │ │ -
256 }
│ │ │ -
257
│ │ │ -
258 private:
│ │ │ -
259 std::array<LocalKey, 6> localKeys_;
│ │ │ -
260 };
│ │ │ -
261
│ │ │ -
262
│ │ │ -
268 template<class D>
│ │ │ -
269 class MorleyLocalInterpolation
│ │ │ -
270 {
│ │ │ -
271 using size_type = std::size_t;
│ │ │ -
272 using FunctionalDescriptor = Dune::Functions::Impl::FunctionalDescriptor<2>;
│ │ │ -
273
│ │ │ -
274 public:
│ │ │ -
275
│ │ │ -
276 MorleyLocalInterpolation()
│ │ │ -
277 {
│ │ │ -
278 descriptors_[0] = FunctionalDescriptor();
│ │ │ -
279 descriptors_[1] = FunctionalDescriptor();
│ │ │ -
280 descriptors_[2] = FunctionalDescriptor();
│ │ │ -
281 descriptors_[3] = FunctionalDescriptor(1);
│ │ │ -
282 descriptors_[4] = FunctionalDescriptor(1);
│ │ │ -
283 descriptors_[5] = FunctionalDescriptor(1);
│ │ │ -
284 }
│ │ │ -
285
│ │ │ -
288 template <class Element>
│ │ │ -
289 void bind(const Element &element, const std::bitset<3> &edgeOrientation)
│ │ │ -
290 {
│ │ │ -
291 auto geometry = element.geometry();
│ │ │ -
292
│ │ │ -
293 // get global Normals and midpoints
│ │ │ -
294 auto refElement = Dune::referenceElement<double, 2>(geometry.type());
│ │ │ -
295 for (std::size_t i = 0; i < 3; ++i)
│ │ │ -
296 {
│ │ │ -
297 localVertices_[i] = refElement.position(i, 2);
│ │ │ -
298
│ │ │ -
299 localMidpoints_[i] = refElement.position(i, 1);
│ │ │ -
300 std::size_t lower = (i == 2) ? 1 : 0;
│ │ │ -
301 std::size_t upper = (i == 0) ? 1 : 2;
│ │ │ -
302
│ │ │ -
303 auto edge = geometry.global(refElement.position(upper, 2))
│ │ │ -
304 - geometry.global(refElement.position(lower, 2));
│ │ │ -
305 // normalize and orient
│ │ │ -
306 edge /= edge.two_norm() * (edgeOrientation[i] ? -1. : 1.);
│ │ │ -
307 // Rotation by pi/2. Note that Kirby rotates by 3*pi/2
│ │ │ -
308 globalNormals_[i] = {-edge[1], edge[0]};
│ │ │ -
309 }
│ │ │ -
310 }
│ │ │ -
311
│ │ │ -
319 template <class F, class C>
│ │ │ -
320 void interpolate(const F &f, std::vector<C> &out) const
│ │ │ -
321 {
│ │ │ -
322 out.resize(6);
│ │ │ -
323 auto&& df = derivative(f);
│ │ │ -
324 for (size_type i = 0; i < 3; ++i)
│ │ │ -
325 {
│ │ │ -
326 out[i] = f(localVertices_[i]);
│ │ │ -
327 out[3 + i] = squeezeTensor(df(localMidpoints_[i])).dot(globalNormals_[i]);
│ │ │ -
328 }
│ │ │ -
329 }
│ │ │ -
330
│ │ │ -
331 const FunctionalDescriptor& functionalDescriptor(size_type i) const
│ │ │ -
332 {
│ │ │ -
333 return descriptors_[i];
│ │ │ -
334 }
│ │ │ -
335
│ │ │ -
336 protected:
│ │ │ -
337 std::array<Dune::FieldVector<D, 2>, 3> globalNormals_;
│ │ │ -
338 std::array<Dune::FieldVector<D, 2>, 3> localMidpoints_;
│ │ │ -
339 std::array<Dune::FieldVector<D, 2>, 3> localVertices_;
│ │ │ -
340 std::array<FunctionalDescriptor, 6> descriptors_;
│ │ │ -
341
│ │ │ -
342 };
│ │ │ -
343
│ │ │ -
344 template<class D, class R>
│ │ │ -
345 using MorleyLocalBasisTraits = typename Impl::MorleyReferenceLocalBasis<D, R>::Traits;
│ │ │ -
346
│ │ │ -
355 template<class D, class R>
│ │ │ -
356 class MorleyLocalFiniteElement
│ │ │ -
357 : public Impl::TransformedFiniteElementMixin<MorleyLocalFiniteElement<D,R>, MorleyLocalBasisTraits<D, R>>
│ │ │ -
358 {
│ │ │ -
359 using Base = Impl::TransformedFiniteElementMixin< MorleyLocalFiniteElement<D,R>, MorleyLocalBasisTraits<D, R>>;
│ │ │ -
360 friend class Impl::TransformedLocalBasis<MorleyLocalFiniteElement<D,R>, MorleyLocalBasisTraits<D, R>>;
│ │ │ -
361 static constexpr int dim = 2;
│ │ │ -
362 public:
│ │ │ -
363
│ │ │ -
366 using size_type = std::size_t;
│ │ │ -
367 using Traits = LocalFiniteElementTraits<
│ │ │ -
368 Impl::TransformedLocalBasis<MorleyLocalFiniteElement<D,R>, MorleyLocalBasisTraits<D, R>>,
│ │ │ -
369 Impl::MorleyLocalCoefficients,
│ │ │ -
370 Impl::MorleyLocalInterpolation<D>>;
│ │ │ -
371
│ │ │ -
375 const typename Traits::LocalCoefficientsType &localCoefficients() const
│ │ │ -
376 {
│ │ │ -
377 return coefficients_;
│ │ │ -
378 }
│ │ │ -
379
│ │ │ -
382 const typename Traits::LocalInterpolationType &localInterpolation() const
│ │ │ -
383 {
│ │ │ -
384 return interpolation_;
│ │ │ -
385 }
│ │ │ -
386
│ │ │ -
389 static constexpr GeometryType type()
│ │ │ -
390 {
│ │ │ -
391 return GeometryTypes::simplex(dim);
│ │ │ -
392 }
│ │ │ -
393
│ │ │ -
396 static constexpr size_type size()
│ │ │ -
397 {
│ │ │ -
398 return 6;
│ │ │ -
399 }
│ │ │ -
400
│ │ │ -
403 template<class Element>
│ │ │ -
404 void bind(std::bitset<3> const& data, Element const &e)
│ │ │ -
405 {
│ │ │ -
406 edgeOrientation_ = data;
│ │ │ -
407
│ │ │ -
408 fillMatrix(e.geometry());
│ │ │ -
409 interpolation_.bind(e, edgeOrientation_);
│ │ │ -
410 }
│ │ │ -
411
│ │ │ -
412 protected:
│ │ │ -
413
│ │ │ -
416 Impl::MorleyReferenceLocalBasis<D, R> const& referenceLocalBasis() const
│ │ │ -
417 {
│ │ │ -
418 return basis_;
│ │ │ -
419 }
│ │ │ -
420
│ │ │ -
426 template<class InputValues, class OutputValues>
│ │ │ -
427 void transform(InputValues const& inValues, OutputValues& outValues) const
│ │ │ -
428 {
│ │ │ -
429 // Here we cannot directly use
│ │ │ -
430 // mat_.mv(inValues, outValues);
│ │ │ -
431 // because mv expects the DenseVector interface.
│ │ │ -
432 auto inValuesDenseVector = Impl::DenseVectorView(inValues);
│ │ │ -
433 auto outValuesDenseVector = Impl::DenseVectorView(outValues);
│ │ │ -
434 mat_.mv(inValuesDenseVector, outValuesDenseVector);
│ │ │ -
435 }
│ │ │ -
436
│ │ │ -
437 private:
│ │ │ -
438
│ │ │ -
445 template<class Geometry>
│ │ │ -
446 void fillMatrix(Geometry const &geometry)
│ │ │ -
447 {
│ │ │ -
448 std::array<R, 3> B_11;
│ │ │ -
449 std::array<R, 3> B_12;
│ │ │ -
450 std::array<R, 3> l_inv;
│ │ │ -
451
│ │ │ -
452 std::array<Dune::FieldVector<R, 2>, 3> referenceTangents;
│ │ │ -
453 std::array<Dune::FieldVector<R, 2>, 3> globalTangents;
│ │ │ -
454
│ │ │ -
455 // By default, edges point from the vertex with the smaller index
│ │ │ -
456 // to the vertex with the larger index.
│ │ │ -
457
│ │ │ -
458 // get local and global Tangents
│ │ │ -
459 auto refElement = Dune::referenceElement<double, 2>(geometry.type());
│ │ │ -
460 auto x = refElement.position(0,0);
│ │ │ -
461 for (std::size_t i = 0; i < 3; ++i)
│ │ │ -
462 {
│ │ │ -
463 std::size_t lower = (i == 2) ? 1 : 0;
│ │ │ -
464 std::size_t upper = (i == 0) ? 1 : 2;
│ │ │ -
465 auto edge = refElement.position(upper, 2) - refElement.position(lower, 2);
│ │ │ -
466
│ │ │ -
467 referenceTangents[i] = edge / edge.two_norm();
│ │ │ -
468
│ │ │ -
469 auto globalEdge = geometry.global(refElement.position(upper, 2))
│ │ │ -
470 - geometry.global(refElement.position(lower, 2));
│ │ │ -
471
│ │ │ -
472 l_inv[i] = 1. / globalEdge.two_norm();
│ │ │ -
473 globalTangents[i] = globalEdge * l_inv[i];
│ │ │ -
474 }
│ │ │ -
475
│ │ │ -
476 auto jacobianTransposed = geometry.jacobianTransposed(x);
│ │ │ -
477 for (std::size_t i = 0; i < 3; ++i)
│ │ │ -
478 {
│ │ │ -
479 B_11[i] = -referenceTangents[i][1]
│ │ │ -
480 *(-globalTangents[i][1] * jacobianTransposed[0][0]
│ │ │ -
481 + globalTangents[i][0] * jacobianTransposed[0][1])
│ │ │ -
482 + referenceTangents[i][0]
│ │ │ -
483 *(-globalTangents[i][1] * jacobianTransposed[1][0]
│ │ │ -
484 + globalTangents[i][0] * jacobianTransposed[1][1]);
│ │ │ -
485 B_12[i] = -referenceTangents[i][1]
│ │ │ -
486 *(globalTangents[i][0] * jacobianTransposed[0][0]
│ │ │ -
487 + globalTangents[i][1] * jacobianTransposed[0][1])
│ │ │ -
488 + referenceTangents[i][0]
│ │ │ -
489 *(globalTangents[i][0] * jacobianTransposed[1][0]
│ │ │ -
490 + globalTangents[i][1] * jacobianTransposed[1][1]);
│ │ │ -
491 }
│ │ │ -
492
│ │ │ -
493 // Actually setup matrix
│ │ │ -
494 int sign = -1;
│ │ │ -
495 for (std::size_t i = 0; i < 3; ++i)
│ │ │ -
496 {
│ │ │ -
497 mat_[i][i] = 1.;
│ │ │ -
498 for (std::size_t j = 0; j < 3; ++j)
│ │ │ -
499 {
│ │ │ -
500 if (j != (2 - i)) // dune specific edge order
│ │ │ -
501 {
│ │ │ -
502 mat_[j][3 + i] = sign * B_12[i] * l_inv[i];
│ │ │ -
503 sign *= -1;
│ │ │ -
504 }
│ │ │ -
505 }
│ │ │ -
506 mat_[3 + i][3 + i] = (edgeOrientation_[i] ? -1. : 1.) * B_11[i];
│ │ │ -
507 }
│ │ │ -
508 }
│ │ │ -
509
│ │ │ -
510 // a finite element consists of a basis, coeffiecents and an interpolation
│ │ │ -
511 typename Impl::MorleyReferenceLocalBasis<D, R> basis_;
│ │ │ -
512 typename Traits::LocalCoefficientsType coefficients_;
│ │ │ -
513 typename Traits::LocalInterpolationType interpolation_;
│ │ │ -
514 // This is the matrix M in Kirbys paper
│ │ │ -
515 Dune::FieldMatrix<R, 6, 6>mat_;
│ │ │ -
516 // the local state, i.e. a collection of global information restricted to this element
│ │ │ -
517 std::bitset<3> edgeOrientation_;
│ │ │ -
518
│ │ │ -
519 };
│ │ │ -
520
│ │ │ -
521 } // end namespace Impl
│ │ │ -
522
│ │ │ -
523
│ │ │ -
524
│ │ │ -
525 // *****************************************************************************
│ │ │ -
526 // This is the reusable part of the basis. It contains
│ │ │ -
527 //
│ │ │ -
528 // MorleyPreBasis
│ │ │ -
529 // MorleyNode
│ │ │ -
530 //
│ │ │ -
531 // The pre-basis allows to create the others and is the owner of possible shared
│ │ │ -
532 // state. These components do _not_ depend on the global basis and local view
│ │ │ -
533 // and can be used without a global basis.
│ │ │ -
534 // *****************************************************************************
│ │ │ -
535
│ │ │ -
536 template<class GV, class R>
│ │ │ -
│ │ │ - │ │ │ -
538 : public LeafBasisNode
│ │ │ -
539 {
│ │ │ -
540 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper<GV>;
│ │ │ -
541 public:
│ │ │ -
542 using size_type = std::size_t;
│ │ │ -
543 using Element = typename GV::template Codim<0>::Entity;
│ │ │ -
544 using FiniteElement = typename Impl::MorleyLocalFiniteElement<typename GV::ctype, R>;
│ │ │ -
545
│ │ │ -
546
│ │ │ -
│ │ │ -
547 MorleyNode(Mapper const& m, std::vector<std::bitset<3>> const& data)
│ │ │ -
548 : mapper_(&m), data_(&data)
│ │ │ -
549 {}
│ │ │ -
│ │ │ -
550
│ │ │ -
│ │ │ -
552 Element const &element() const
│ │ │ -
553 {
│ │ │ -
554 return *element_;
│ │ │ -
555 }
│ │ │ -
│ │ │ -
556
│ │ │ -
│ │ │ - │ │ │ -
563 {
│ │ │ -
564 return finiteElement_;
│ │ │ -
565 }
│ │ │ -
│ │ │ -
566
│ │ │ -
│ │ │ -
568 void bind(Element const &e)
│ │ │ -
569 {
│ │ │ -
570 element_ = &e;
│ │ │ -
571 finiteElement_.bind((*data_)[mapper_->index(e)], *element_);
│ │ │ -
572 this->setSize(finiteElement_.size());
│ │ │ -
573 }
│ │ │ -
│ │ │ -
574
│ │ │ -
│ │ │ -
576 unsigned int order() const
│ │ │ -
577 {
│ │ │ -
578 return finiteElement_.localBasis().order();
│ │ │ -
579 }
│ │ │ -
│ │ │ -
580
│ │ │ -
581 protected:
│ │ │ - │ │ │ - │ │ │ -
584 Mapper const* mapper_;
│ │ │ -
585 std::vector<std::bitset<3>> const* data_;
│ │ │ -
586 };
│ │ │ -
│ │ │ -
587
│ │ │ -
588
│ │ │ -
598 template<class GV, class R>
│ │ │ -
│ │ │ - │ │ │ -
600 : public LeafPreBasisMapperMixin<GV>
│ │ │ -
601 {
│ │ │ -
602 using Base = LeafPreBasisMapperMixin<GV>;
│ │ │ -
603 using SubEntityMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GV>;
│ │ │ -
604 using Element = typename GV::template Codim<0>::Entity;
│ │ │ -
605 using D = typename GV::ctype;
│ │ │ -
606 static const std::size_t dim = GV::dimension;
│ │ │ -
607
│ │ │ -
608 // helper methods to assign each subentity the number of dofs. Used by the LeafPreBasisMapperMixin.
│ │ │ -
609 static constexpr auto morleyMapperLayout(Dune::GeometryType type, int gridDim)
│ │ │ -
610 {
│ │ │ -
611 assert(gridDim == 2);
│ │ │ -
612 if (type.isVertex())
│ │ │ -
613 return 1; // one evaluation dof per vertex
│ │ │ -
614 if (type.isLine())
│ │ │ -
615 return 1;
│ │ │ -
616 if ((type.isTriangle()) )
│ │ │ -
617 return 0;
│ │ │ -
618 else
│ │ │ -
619 return 0;
│ │ │ -
620 }
│ │ │ -
621
│ │ │ -
622 public:
│ │ │ -
624 using GridView = GV;
│ │ │ -
625
│ │ │ -
627 using size_type = std::size_t;
│ │ │ -
628
│ │ │ - │ │ │ -
631
│ │ │ -
│ │ │ -
633 MorleyPreBasis(const GV &gv)
│ │ │ -
634 : Base(gv, morleyMapperLayout)
│ │ │ -
635 , mapper_({gv, mcmgElementLayout()})
│ │ │ -
636 {
│ │ │ -
637 data_ = Impl::computeEdgeOrientations(mapper_);
│ │ │ -
638 }
│ │ │ -
│ │ │ -
639
│ │ │ -
│ │ │ -
641 void update(GridView const &gv)
│ │ │ -
642 {
│ │ │ -
643 Base::update(gv);
│ │ │ -
644 data_ = Impl::computeEdgeOrientations(mapper_);
│ │ │ -
645 }
│ │ │ -
│ │ │ -
646
│ │ │ -
│ │ │ - │ │ │ -
651 {
│ │ │ -
652 return Node{mapper_, data_};
│ │ │ -
653 }
│ │ │ -
│ │ │ -
654
│ │ │ -
655 protected:
│ │ │ -
656
│ │ │ -
657 SubEntityMapper mapper_;
│ │ │ -
658 std::vector<std::bitset<3>> data_;
│ │ │ -
659
│ │ │ -
660 }; // class MorleyPreBasis
│ │ │ -
│ │ │ -
661
│ │ │ -
662 namespace BasisFactory
│ │ │ -
663 {
│ │ │ -
664
│ │ │ -
671 template<class R = double>
│ │ │ -
│ │ │ -
672 auto morley()
│ │ │ -
673 {
│ │ │ -
674 return [=](auto const &gridView) {
│ │ │ -
675 return MorleyPreBasis<std::decay_t<decltype(gridView)>, R>(gridView);
│ │ │ -
676 };
│ │ │ -
677 }
│ │ │ -
│ │ │ -
678
│ │ │ -
679 } // end namespace BasisFactory
│ │ │ -
680
│ │ │ -
681} // end namespace Dune::Functions
│ │ │ -
682
│ │ │ -
683#endif
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
This file provides an implementation of the cubic Hermite finite element in 1 to 3 dimensions.
│ │ │ - │ │ │ - │ │ │ - │ │ │ +
15
│ │ │ +
16
│ │ │ +
29template<class K, int sinFactor, int cosFactor>
│ │ │ +
│ │ │ + │ │ │ +
31{
│ │ │ +
32public:
│ │ │ +
│ │ │ +
34 K operator () (const K& x) const
│ │ │ +
35 {
│ │ │ +
36 return sinFactor * std::sin(x) + cosFactor * std::cos(x);
│ │ │ +
37 }
│ │ │ +
│ │ │ +
38};
│ │ │ +
│ │ │ +
39
│ │ │ +
40
│ │ │ +
42template<class K, int sinFactor, int cosFactor>
│ │ │ +
│ │ │ + │ │ │ +
44{
│ │ │ +
45 return TrigonometricFunction<K, -cosFactor, sinFactor>();
│ │ │ +
46}
│ │ │ +
│ │ │ +
47
│ │ │ +
48
│ │ │ +
49
│ │ │ +
50}} // namespace Dune::Functions
│ │ │ +
51
│ │ │ +
52
│ │ │ +
53
│ │ │ +
54#endif // DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
│ │ │
TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
Obtain derivative of TrigonometricFunction function.
Definition trigonometricfunction.hh:43
│ │ │ -
DefaultGlobalBasis< MorleyPreBasis< GV, R > > MorleyBasis
Nodal basis of a scalar quadratic Morley finite element space.
Definition morleybasis.hh:76
│ │ │ +
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
void interpolate(const B &basis, C &&coeff, const F &f, const BV &bv, const NTRE &nodeToRangeEntry)
Interpolate given function in discrete function space.
Definition interpolate.hh:205
│ │ │ -
Definition argyrisbasis.hh:926
│ │ │ -
auto morley()
construct a PreBasisFactory for the Morley Finite Element
Definition morleybasis.hh:672
│ │ │ -
Function, which evaluates all monomials up to degree maxDegree in a given coordinate.
Definition monomialset.hh:64
│ │ │ -
Definition cubichermitebasis.hh:84
│ │ │ -
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:53
│ │ │ -
void update(const GridView &gv)
Update the stored GridView.
Definition leafprebasismappermixin.hh:101
│ │ │ -
LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout)
Construct from GridView and local DOF layout.
Definition leafprebasismappermixin.hh:74
│ │ │ -
A pre-basis for a Morleybasis.
Definition morleybasis.hh:601
│ │ │ -
void update(GridView const &gv)
Update the stored grid view, to be called if the grid has changed.
Definition morleybasis.hh:641
│ │ │ -
SubEntityMapper mapper_
Definition morleybasis.hh:657
│ │ │ -
Node makeNode() const
Create tree node.
Definition morleybasis.hh:650
│ │ │ -
std::vector< std::bitset< 3 > > data_
Definition morleybasis.hh:658
│ │ │ -
std::size_t size_type
Type used for indices and size information.
Definition morleybasis.hh:627
│ │ │ -
GV GridView
The grid view that the FE basis is defined on.
Definition morleybasis.hh:624
│ │ │ -
MorleyNode< GridView, R > Node
Template mapping root tree path to type of created tree node.
Definition morleybasis.hh:630
│ │ │ -
MorleyPreBasis(const GV &gv)
Constructor for a given grid view object.
Definition morleybasis.hh:633
│ │ │ -
Definition morleybasis.hh:539
│ │ │ -
Element const & element() const
Return current element, throw if unbound.
Definition morleybasis.hh:552
│ │ │ -
std::size_t size_type
Definition morleybasis.hh:542
│ │ │ -
FiniteElement const & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition morleybasis.hh:562
│ │ │ -
Element const * element_
Definition morleybasis.hh:583
│ │ │ -
unsigned int order() const
The order of the local basis.
Definition morleybasis.hh:576
│ │ │ -
std::vector< std::bitset< 3 > > const * data_
Definition morleybasis.hh:585
│ │ │ -
Mapper const * mapper_
Definition morleybasis.hh:584
│ │ │ -
typename GV::template Codim< 0 >::Entity Element
Definition morleybasis.hh:543
│ │ │ -
void bind(Element const &e)
Bind to element.
Definition morleybasis.hh:568
│ │ │ -
MorleyNode(Mapper const &m, std::vector< std::bitset< 3 > > const &data)
Definition morleybasis.hh:547
│ │ │ -
typename Impl::MorleyLocalFiniteElement< typename GV::ctype, R > FiniteElement
Definition morleybasis.hh:544
│ │ │ -
FiniteElement finiteElement_
Definition morleybasis.hh:582
│ │ │ -
void setSize(const size_type size)
Definition nodes.hh:197
│ │ │ -
Definition nodes.hh:218
│ │ │ +
A linear combination of trigonomic functions.
Definition trigonometricfunction.hh:31
│ │ │ +
K operator()(const K &x) const
Evaluate function.
Definition trigonometricfunction.hh:34
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,684 +1,70 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -morleybasis.hh │ │ │ │ +trigonometricfunction.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ -6#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_MORLEYBASIS_HH │ │ │ │ -7#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_MORLEYBASIS_HH │ │ │ │ -8 │ │ │ │ -9#include │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ -12#include │ │ │ │ -13#include │ │ │ │ +6 │ │ │ │ +7#ifndef DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH │ │ │ │ +8#define DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH │ │ │ │ +9 │ │ │ │ +10#include │ │ │ │ +11 │ │ │ │ +12namespace _D_u_n_e { │ │ │ │ +13namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ 14 │ │ │ │ -15#include │ │ │ │ -16#include │ │ │ │ -17#include │ │ │ │ -18 │ │ │ │ -19#include │ │ │ │ -20#include │ │ │ │ -21 │ │ │ │ -22#include │ │ │ │ -23#include │ │ │ │ -24#include │ │ │ │ -25 │ │ │ │ -26#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_a_n_a_l_y_t_i_c_f_u_n_c_t_i_o_n_s_/_m_o_n_o_m_i_a_l_s_e_t_._h_h> │ │ │ │ -27#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_n_s_e_v_e_c_t_o_r_v_i_e_w_._h_h> │ │ │ │ -28#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_s_q_u_e_e_z_e_t_e_n_s_o_r_._h_h> │ │ │ │ -29#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_u_b_i_c_h_e_r_m_i_t_e_b_a_s_i_s_._h_h> │ │ │ │ -30#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ -31#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_f_u_n_c_t_i_o_n_a_l_d_e_s_c_r_i_p_t_o_r_._h_h> │ │ │ │ -32#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h> │ │ │ │ -33#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -34#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_t_r_a_n_s_f_o_r_m_e_d_f_i_n_i_t_e_e_l_e_m_e_n_t_m_i_x_i_n_._h_h> │ │ │ │ -35 │ │ │ │ -52namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -53{ │ │ │ │ -54 │ │ │ │ -55 template │ │ │ │ -56 class _M_o_r_l_e_y_P_r_e_B_a_s_i_s; │ │ │ │ -57 │ │ │ │ -75 template │ │ │ │ -_7_6 using _M_o_r_l_e_y_B_a_s_i_s = _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_M_o_r_l_e_y_P_r_e_B_a_s_i_s_<_G_V_,_ _R_> >; │ │ │ │ -77 │ │ │ │ -78 │ │ │ │ -79 namespace Impl │ │ │ │ -80 { │ │ │ │ -81 │ │ │ │ -88 template │ │ │ │ -89 class MorleyReferenceLocalBasis │ │ │ │ -90 { │ │ │ │ -91 public: │ │ │ │ -92 static constexpr int dim = 2; │ │ │ │ -93 using Traits = _H_2_L_o_c_a_l_B_a_s_i_s_T_r_a_i_t_s_<_D_,_ _d_i_m_,_ _F_i_e_l_d_V_e_c_t_o_r_<_D_,_ _d_i_m_>, R, 1, │ │ │ │ -FieldVector, │ │ │ │ -94 FieldMatrix, FieldMatrix>; │ │ │ │ -95 │ │ │ │ -96 private: │ │ │ │ -97 │ │ │ │ -110 static constexpr auto getMorleyCoefficients() │ │ │ │ -111 { │ │ │ │ -112 // Define std::sqrt(2.) manually in double precision, │ │ │ │ -113 // because std::sqrt is not constexpr before C++26. │ │ │ │ -114 D sqrt2 = 0.5 * 1.414213562373095; │ │ │ │ -115 │ │ │ │ -116 return Dune::FieldMatrix({{1, -1, -1, 0, 2, 0}, │ │ │ │ -117 {0, 0.5, 0.5, 0.5, -1, -0.5}, │ │ │ │ -118 {0, 0.5, 0.5, -0.5, -1, 0.5}, │ │ │ │ -119 {0, 0, 1, 0, 0, -1}, │ │ │ │ -120 {0, -1., 0, 1., 0, 0}, │ │ │ │ -121 {0, sqrt2, sqrt2, -sqrt2, -2. * sqrt2, -sqrt2}}); │ │ │ │ -122 } │ │ │ │ -123 │ │ │ │ -124 static constexpr auto referenceBasisCoefficients = getMorleyCoefficients(); │ │ │ │ -125 _M_o_n_o_m_i_a_l_S_e_t_<_t_y_p_e_n_a_m_e_ _T_r_a_i_t_s_:_:_R_a_n_g_e_F_i_e_l_d_T_y_p_e_,_ _d_i_m_,_ _2_> monomials; │ │ │ │ -126 │ │ │ │ -127 public: │ │ │ │ -128 │ │ │ │ -131 static constexpr unsigned int size() │ │ │ │ -132 { │ │ │ │ -133 return 6; │ │ │ │ -134 } │ │ │ │ -135 │ │ │ │ -138 static constexpr unsigned int order() │ │ │ │ -139 { │ │ │ │ -140 return 2; │ │ │ │ -141 } │ │ │ │ -142 │ │ │ │ -148 void evaluateFunction(const typename Traits::DomainType &in, │ │ │ │ -149 std::vector &out) const │ │ │ │ -150 { │ │ │ │ -151 out.resize(size()); │ │ │ │ -152 auto monomialValues = monomials(in); │ │ │ │ -153 multiplyWithCoefficentMatrix(referenceBasisCoefficients, monomialValues, │ │ │ │ -out); │ │ │ │ -154 } │ │ │ │ -155 │ │ │ │ -161 void evaluateJacobian(const typename Traits::DomainType &in, │ │ │ │ -162 std::vector &out) const │ │ │ │ -163 { │ │ │ │ -164 out.resize(size()); │ │ │ │ -165 auto monomialValues = _d_e_r_i_v_a_t_i_v_e(monomials)(in); │ │ │ │ -166 multiplyWithCoefficentMatrix(referenceBasisCoefficients, monomialValues, │ │ │ │ -out); │ │ │ │ -167 } │ │ │ │ -168 │ │ │ │ -174 void evaluateHessian(const typename Traits::DomainType &in, │ │ │ │ -175 std::vector &out) const │ │ │ │ -176 { │ │ │ │ -177 out.resize(size()); │ │ │ │ -178 auto monomialValues = _d_e_r_i_v_a_t_i_v_e(_d_e_r_i_v_a_t_i_v_e(monomials))(in); │ │ │ │ -179 multiplyWithCoefficentMatrix(referenceBasisCoefficients, monomialValues, │ │ │ │ -out); │ │ │ │ -180 } │ │ │ │ -181 │ │ │ │ -188 void partial(std::array order, const typename Traits:: │ │ │ │ -DomainType &in, │ │ │ │ -189 std::vector &out) const │ │ │ │ -190 { │ │ │ │ -191 out.resize(size()); │ │ │ │ -192 auto totalOrder = std::accumulate(order.begin(), order.end(), 0); │ │ │ │ -193 if (totalOrder == 0) │ │ │ │ -194 evaluateFunction(in, out); │ │ │ │ -195 else if (totalOrder == 1) │ │ │ │ -196 { │ │ │ │ -197 evaluateJacobian(in,jacobiansBuffer_); │ │ │ │ -198 std::size_t which = std::max_element(order.begin(), order.end()) - │ │ │ │ -order.begin(); │ │ │ │ -199 for (auto i : Dune::range(size())) │ │ │ │ -200 out[i] = jacobiansBuffer_[i][0][which]; │ │ │ │ -201 } │ │ │ │ -202 else if (totalOrder == 2) │ │ │ │ -203 { │ │ │ │ -204 evaluateHessian(in, hessianBuffer_); │ │ │ │ -205 std::size_t first, second; │ │ │ │ -206 first = std::max_element(order.begin(), order.end()) - order.begin(); │ │ │ │ -207 if (order[first] == 2) │ │ │ │ -208 second = first; │ │ │ │ -209 else │ │ │ │ -210 { │ │ │ │ -211 order[first] = 0; │ │ │ │ -212 second = std::max_element(order.begin(), order.end()) - order.begin(); │ │ │ │ -213 } │ │ │ │ -214 for (auto i : Dune::range(size())) │ │ │ │ -215 out[i] = hessianBuffer_[i][first][second]; │ │ │ │ -216 } │ │ │ │ -217 else │ │ │ │ -218 DUNE_THROW(RangeError, "partial() not implemented for given order"); │ │ │ │ -219 } │ │ │ │ -220 │ │ │ │ -221 private: │ │ │ │ -222 mutable std::vector jacobiansBuffer_; │ │ │ │ -223 mutable std::vector hessianBuffer_; │ │ │ │ -224 }; │ │ │ │ -225 │ │ │ │ -226 │ │ │ │ -230 class MorleyLocalCoefficients │ │ │ │ -231 { │ │ │ │ -232 public: │ │ │ │ -233 using size_type = std::size_t; │ │ │ │ -234 │ │ │ │ -235 MorleyLocalCoefficients() │ │ │ │ -236 { │ │ │ │ -237 for (size_type i = 0; i < 3; ++i) │ │ │ │ -238 { │ │ │ │ -239 localKeys_[i] = LocalKey(i, 2, 0); // vertex dofs │ │ │ │ -240 localKeys_[3 + i] = LocalKey(i, 1, 0); // edge dofs │ │ │ │ -241 } │ │ │ │ -242 } │ │ │ │ -243 │ │ │ │ -246 static constexpr size_type size() │ │ │ │ -247 { │ │ │ │ -248 return 6; │ │ │ │ -249 } │ │ │ │ -250 │ │ │ │ -253 constexpr LocalKey const &localKey(size_type i) const │ │ │ │ -254 { │ │ │ │ -255 return localKeys_[i]; │ │ │ │ -256 } │ │ │ │ -257 │ │ │ │ -258 private: │ │ │ │ -259 std::array localKeys_; │ │ │ │ -260 }; │ │ │ │ -261 │ │ │ │ -262 │ │ │ │ -268 template │ │ │ │ -269 class MorleyLocalInterpolation │ │ │ │ -270 { │ │ │ │ -271 using size_type = std::size_t; │ │ │ │ -272 using FunctionalDescriptor = Dune::Functions::Impl:: │ │ │ │ -FunctionalDescriptor<2>; │ │ │ │ -273 │ │ │ │ -274 public: │ │ │ │ -275 │ │ │ │ -276 MorleyLocalInterpolation() │ │ │ │ -277 { │ │ │ │ -278 descriptors_[0] = FunctionalDescriptor(); │ │ │ │ -279 descriptors_[1] = FunctionalDescriptor(); │ │ │ │ -280 descriptors_[2] = FunctionalDescriptor(); │ │ │ │ -281 descriptors_[3] = FunctionalDescriptor(1); │ │ │ │ -282 descriptors_[4] = FunctionalDescriptor(1); │ │ │ │ -283 descriptors_[5] = FunctionalDescriptor(1); │ │ │ │ -284 } │ │ │ │ -285 │ │ │ │ -288 template │ │ │ │ -289 void bind(const Element &element, const std::bitset<3> &edgeOrientation) │ │ │ │ -290 { │ │ │ │ -291 auto geometry = element.geometry(); │ │ │ │ -292 │ │ │ │ -293 // get global Normals and midpoints │ │ │ │ -294 auto refElement = Dune::referenceElement(geometry.type()); │ │ │ │ -295 for (std::size_t i = 0; i < 3; ++i) │ │ │ │ -296 { │ │ │ │ -297 localVertices_[i] = refElement.position(i, 2); │ │ │ │ -298 │ │ │ │ -299 localMidpoints_[i] = refElement.position(i, 1); │ │ │ │ -300 std::size_t lower = (i == 2) ? 1 : 0; │ │ │ │ -301 std::size_t upper = (i == 0) ? 1 : 2; │ │ │ │ -302 │ │ │ │ -303 auto edge = geometry.global(refElement.position(upper, 2)) │ │ │ │ -304 - geometry.global(refElement.position(lower, 2)); │ │ │ │ -305 // normalize and orient │ │ │ │ -306 edge /= edge.two_norm() * (edgeOrientation[i] ? -1. : 1.); │ │ │ │ -307 // Rotation by pi/2. Note that Kirby rotates by 3*pi/2 │ │ │ │ -308 globalNormals_[i] = {-edge[1], edge[0]}; │ │ │ │ -309 } │ │ │ │ -310 } │ │ │ │ -311 │ │ │ │ -319 template │ │ │ │ -320 void _i_n_t_e_r_p_o_l_a_t_e(const F &f, std::vector &out) const │ │ │ │ -321 { │ │ │ │ -322 out.resize(6); │ │ │ │ -323 auto&& df = _d_e_r_i_v_a_t_i_v_e(f); │ │ │ │ -324 for (size_type i = 0; i < 3; ++i) │ │ │ │ -325 { │ │ │ │ -326 out[i] = f(localVertices_[i]); │ │ │ │ -327 out[3 + i] = squeezeTensor(df(localMidpoints_[i])).dot(globalNormals_[i]); │ │ │ │ -328 } │ │ │ │ -329 } │ │ │ │ -330 │ │ │ │ -331 const FunctionalDescriptor& functionalDescriptor(size_type i) const │ │ │ │ -332 { │ │ │ │ -333 return descriptors_[i]; │ │ │ │ -334 } │ │ │ │ -335 │ │ │ │ -336 protected: │ │ │ │ -337 std::array, 3> globalNormals_; │ │ │ │ -338 std::array, 3> localMidpoints_; │ │ │ │ -339 std::array, 3> localVertices_; │ │ │ │ -340 std::array descriptors_; │ │ │ │ -341 │ │ │ │ -342 }; │ │ │ │ -343 │ │ │ │ -344 template │ │ │ │ -345 using MorleyLocalBasisTraits = typename Impl::MorleyReferenceLocalBasis::Traits; │ │ │ │ -346 │ │ │ │ -355 template │ │ │ │ -356 class MorleyLocalFiniteElement │ │ │ │ -357 : public Impl::TransformedFiniteElementMixin, │ │ │ │ -MorleyLocalBasisTraits> │ │ │ │ -358 { │ │ │ │ -359 using Base = Impl::TransformedFiniteElementMixin< │ │ │ │ -MorleyLocalFiniteElement, MorleyLocalBasisTraits>; │ │ │ │ -360 friend class Impl::TransformedLocalBasis, │ │ │ │ -MorleyLocalBasisTraits>; │ │ │ │ -361 static constexpr int dim = 2; │ │ │ │ -362 public: │ │ │ │ -363 │ │ │ │ -366 using size_type = std::size_t; │ │ │ │ -367 using Traits = LocalFiniteElementTraits< │ │ │ │ -368 Impl::TransformedLocalBasis, │ │ │ │ -MorleyLocalBasisTraits>, │ │ │ │ -369 Impl::MorleyLocalCoefficients, │ │ │ │ -370 Impl::MorleyLocalInterpolation>; │ │ │ │ -371 │ │ │ │ -375 const typename Traits::LocalCoefficientsType &localCoefficients() const │ │ │ │ -376 { │ │ │ │ -377 return coefficients_; │ │ │ │ -378 } │ │ │ │ -379 │ │ │ │ -382 const typename Traits::LocalInterpolationType &localInterpolation() const │ │ │ │ -383 { │ │ │ │ -384 return interpolation_; │ │ │ │ -385 } │ │ │ │ -386 │ │ │ │ -389 static constexpr GeometryType type() │ │ │ │ -390 { │ │ │ │ -391 return GeometryTypes::simplex(dim); │ │ │ │ -392 } │ │ │ │ -393 │ │ │ │ -396 static constexpr size_type size() │ │ │ │ -397 { │ │ │ │ -398 return 6; │ │ │ │ -399 } │ │ │ │ -400 │ │ │ │ -403 template │ │ │ │ -404 void bind(std::bitset<3> const& data, Element const &e) │ │ │ │ -405 { │ │ │ │ -406 edgeOrientation_ = data; │ │ │ │ -407 │ │ │ │ -408 fillMatrix(e.geometry()); │ │ │ │ -409 interpolation_.bind(e, edgeOrientation_); │ │ │ │ -410 } │ │ │ │ -411 │ │ │ │ -412 protected: │ │ │ │ -413 │ │ │ │ -416 Impl::MorleyReferenceLocalBasis const& referenceLocalBasis() const │ │ │ │ -417 { │ │ │ │ -418 return basis_; │ │ │ │ -419 } │ │ │ │ -420 │ │ │ │ -426 template │ │ │ │ -427 void transform(InputValues const& inValues, OutputValues& outValues) const │ │ │ │ -428 { │ │ │ │ -429 // Here we cannot directly use │ │ │ │ -430 // mat_.mv(inValues, outValues); │ │ │ │ -431 // because mv expects the DenseVector interface. │ │ │ │ -432 auto inValuesDenseVector = Impl::DenseVectorView(inValues); │ │ │ │ -433 auto outValuesDenseVector = Impl::DenseVectorView(outValues); │ │ │ │ -434 mat_.mv(inValuesDenseVector, outValuesDenseVector); │ │ │ │ -435 } │ │ │ │ -436 │ │ │ │ -437 private: │ │ │ │ -438 │ │ │ │ -445 template │ │ │ │ -446 void fillMatrix(Geometry const &geometry) │ │ │ │ -447 { │ │ │ │ -448 std::array B_11; │ │ │ │ -449 std::array B_12; │ │ │ │ -450 std::array l_inv; │ │ │ │ -451 │ │ │ │ -452 std::array, 3> referenceTangents; │ │ │ │ -453 std::array, 3> globalTangents; │ │ │ │ -454 │ │ │ │ -455 // By default, edges point from the vertex with the smaller index │ │ │ │ -456 // to the vertex with the larger index. │ │ │ │ -457 │ │ │ │ -458 // get local and global Tangents │ │ │ │ -459 auto refElement = Dune::referenceElement(geometry.type()); │ │ │ │ -460 auto x = refElement.position(0,0); │ │ │ │ -461 for (std::size_t i = 0; i < 3; ++i) │ │ │ │ -462 { │ │ │ │ -463 std::size_t lower = (i == 2) ? 1 : 0; │ │ │ │ -464 std::size_t upper = (i == 0) ? 1 : 2; │ │ │ │ -465 auto edge = refElement.position(upper, 2) - refElement.position(lower, 2); │ │ │ │ -466 │ │ │ │ -467 referenceTangents[i] = edge / edge.two_norm(); │ │ │ │ -468 │ │ │ │ -469 auto globalEdge = geometry.global(refElement.position(upper, 2)) │ │ │ │ -470 - geometry.global(refElement.position(lower, 2)); │ │ │ │ -471 │ │ │ │ -472 l_inv[i] = 1. / globalEdge.two_norm(); │ │ │ │ -473 globalTangents[i] = globalEdge * l_inv[i]; │ │ │ │ -474 } │ │ │ │ -475 │ │ │ │ -476 auto jacobianTransposed = geometry.jacobianTransposed(x); │ │ │ │ -477 for (std::size_t i = 0; i < 3; ++i) │ │ │ │ -478 { │ │ │ │ -479 B_11[i] = -referenceTangents[i][1] │ │ │ │ -480 *(-globalTangents[i][1] * jacobianTransposed[0][0] │ │ │ │ -481 + globalTangents[i][0] * jacobianTransposed[0][1]) │ │ │ │ -482 + referenceTangents[i][0] │ │ │ │ -483 *(-globalTangents[i][1] * jacobianTransposed[1][0] │ │ │ │ -484 + globalTangents[i][0] * jacobianTransposed[1][1]); │ │ │ │ -485 B_12[i] = -referenceTangents[i][1] │ │ │ │ -486 *(globalTangents[i][0] * jacobianTransposed[0][0] │ │ │ │ -487 + globalTangents[i][1] * jacobianTransposed[0][1]) │ │ │ │ -488 + referenceTangents[i][0] │ │ │ │ -489 *(globalTangents[i][0] * jacobianTransposed[1][0] │ │ │ │ -490 + globalTangents[i][1] * jacobianTransposed[1][1]); │ │ │ │ -491 } │ │ │ │ -492 │ │ │ │ -493 // Actually setup matrix │ │ │ │ -494 int sign = -1; │ │ │ │ -495 for (std::size_t i = 0; i < 3; ++i) │ │ │ │ -496 { │ │ │ │ -497 mat_[i][i] = 1.; │ │ │ │ -498 for (std::size_t j = 0; j < 3; ++j) │ │ │ │ -499 { │ │ │ │ -500 if (j != (2 - i)) // dune specific edge order │ │ │ │ -501 { │ │ │ │ -502 mat_[j][3 + i] = sign * B_12[i] * l_inv[i]; │ │ │ │ -503 sign *= -1; │ │ │ │ -504 } │ │ │ │ -505 } │ │ │ │ -506 mat_[3 + i][3 + i] = (edgeOrientation_[i] ? -1. : 1.) * B_11[i]; │ │ │ │ -507 } │ │ │ │ -508 } │ │ │ │ -509 │ │ │ │ -510 // a finite element consists of a basis, coeffiecents and an interpolation │ │ │ │ -511 typename Impl::MorleyReferenceLocalBasis basis_; │ │ │ │ -512 typename Traits::LocalCoefficientsType coefficients_; │ │ │ │ -513 typename Traits::LocalInterpolationType interpolation_; │ │ │ │ -514 // This is the matrix M in Kirbys paper │ │ │ │ -515 Dune::FieldMatrixmat_; │ │ │ │ -516 // the local state, i.e. a collection of global information restricted to │ │ │ │ -this element │ │ │ │ -517 std::bitset<3> edgeOrientation_; │ │ │ │ -518 │ │ │ │ -519 }; │ │ │ │ -520 │ │ │ │ -521 } // end namespace Impl │ │ │ │ -522 │ │ │ │ -523 │ │ │ │ -524 │ │ │ │ -525 / │ │ │ │ -/ ***************************************************************************** │ │ │ │ -526 // This is the reusable part of the basis. It contains │ │ │ │ -527 // │ │ │ │ -528 // MorleyPreBasis │ │ │ │ -529 // MorleyNode │ │ │ │ -530 // │ │ │ │ -531 // The pre-basis allows to create the others and is the owner of possible │ │ │ │ -shared │ │ │ │ -532 // state. These components do _not_ depend on the global basis and local │ │ │ │ -view │ │ │ │ -533 // and can be used without a global basis. │ │ │ │ -534 / │ │ │ │ -/ ***************************************************************************** │ │ │ │ -535 │ │ │ │ -536 template │ │ │ │ -_5_3_7 class _M_o_r_l_e_y_N_o_d_e │ │ │ │ -538 : public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ -539 { │ │ │ │ -540 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper; │ │ │ │ -541 public: │ │ │ │ -_5_4_2 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ -_5_4_3 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ -_5_4_4 using _F_i_n_i_t_e_E_l_e_m_e_n_t = typename Impl::MorleyLocalFiniteElement; │ │ │ │ -545 │ │ │ │ -546 │ │ │ │ -_5_4_7 _M_o_r_l_e_y_N_o_d_e(Mapper const& m, std::vector> const& data) │ │ │ │ -548 : _m_a_p_p_e_r__(&m), _d_a_t_a__(&data) │ │ │ │ -549 {} │ │ │ │ -550 │ │ │ │ -_5_5_2 _E_l_e_m_e_n_t const &_e_l_e_m_e_n_t() const │ │ │ │ -553 { │ │ │ │ -554 return *_e_l_e_m_e_n_t__; │ │ │ │ -555 } │ │ │ │ -556 │ │ │ │ -_5_6_2 _F_i_n_i_t_e_E_l_e_m_e_n_t const &_f_i_n_i_t_e_E_l_e_m_e_n_t() const │ │ │ │ -563 { │ │ │ │ -564 return _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ -565 } │ │ │ │ -566 │ │ │ │ -_5_6_8 void _b_i_n_d(_E_l_e_m_e_n_t const &e) │ │ │ │ -569 { │ │ │ │ -570 _e_l_e_m_e_n_t__ = &e; │ │ │ │ -571 _f_i_n_i_t_e_E_l_e_m_e_n_t__.bind((*_d_a_t_a__)[_m_a_p_p_e_r__->index(e)], *_e_l_e_m_e_n_t__); │ │ │ │ -572 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__.size()); │ │ │ │ -573 } │ │ │ │ -574 │ │ │ │ -_5_7_6 unsigned int _o_r_d_e_r() const │ │ │ │ -577 { │ │ │ │ -578 return _f_i_n_i_t_e_E_l_e_m_e_n_t__.localBasis().order(); │ │ │ │ -579 } │ │ │ │ -580 │ │ │ │ -581 protected: │ │ │ │ -_5_8_2 _F_i_n_i_t_e_E_l_e_m_e_n_t _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ -_5_8_3 _E_l_e_m_e_n_t const* _e_l_e_m_e_n_t__; │ │ │ │ -_5_8_4 Mapper const* _m_a_p_p_e_r__; │ │ │ │ -_5_8_5 std::vector> const* _d_a_t_a__; │ │ │ │ -586 }; │ │ │ │ -587 │ │ │ │ -588 │ │ │ │ -598 template │ │ │ │ -_5_9_9 class _M_o_r_l_e_y_P_r_e_B_a_s_i_s │ │ │ │ -600 : public _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n │ │ │ │ -601 { │ │ │ │ -602 using Base = _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_<_G_V_>; │ │ │ │ -603 using SubEntityMapper = Dune::MultipleCodimMultipleGeomTypeMapper; │ │ │ │ -604 using Element = typename GV::template Codim<0>::Entity; │ │ │ │ -605 using D = typename GV::ctype; │ │ │ │ -606 static const std::size_t dim = GV::dimension; │ │ │ │ -607 │ │ │ │ -608 // helper methods to assign each subentity the number of dofs. Used by the │ │ │ │ -LeafPreBasisMapperMixin. │ │ │ │ -609 static constexpr auto morleyMapperLayout(Dune::GeometryType type, int │ │ │ │ -gridDim) │ │ │ │ -610 { │ │ │ │ -611 assert(gridDim == 2); │ │ │ │ -612 if (type.isVertex()) │ │ │ │ -613 return 1; // one evaluation dof per vertex │ │ │ │ -614 if (type.isLine()) │ │ │ │ -615 return 1; │ │ │ │ -616 if ((type.isTriangle()) ) │ │ │ │ -617 return 0; │ │ │ │ -618 else │ │ │ │ -619 return 0; │ │ │ │ -620 } │ │ │ │ -621 │ │ │ │ -622 public: │ │ │ │ -_6_2_4 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ -625 │ │ │ │ -_6_2_7 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ -628 │ │ │ │ -_6_3_0 using _N_o_d_e = _M_o_r_l_e_y_N_o_d_e_<_G_r_i_d_V_i_e_w_,_ _R_>; │ │ │ │ -631 │ │ │ │ -_6_3_3 _M_o_r_l_e_y_P_r_e_B_a_s_i_s(const GV &gv) │ │ │ │ -634 : Base(gv, morleyMapperLayout) │ │ │ │ -635 , _m_a_p_p_e_r__({gv, mcmgElementLayout()}) │ │ │ │ -636 { │ │ │ │ -637 _d_a_t_a__ = Impl::computeEdgeOrientations(_m_a_p_p_e_r__); │ │ │ │ -638 } │ │ │ │ -639 │ │ │ │ -_6_4_1 void _u_p_d_a_t_e(_G_r_i_d_V_i_e_w const &gv) │ │ │ │ -642 { │ │ │ │ -643 _B_a_s_e_:_:_u_p_d_a_t_e(gv); │ │ │ │ -644 _d_a_t_a__ = Impl::computeEdgeOrientations(_m_a_p_p_e_r__); │ │ │ │ -645 } │ │ │ │ -646 │ │ │ │ -_6_5_0 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ -651 { │ │ │ │ -652 return _N_o_d_e{_m_a_p_p_e_r__, _d_a_t_a__}; │ │ │ │ -653 } │ │ │ │ -654 │ │ │ │ -655 protected: │ │ │ │ -656 │ │ │ │ -_6_5_7 SubEntityMapper _m_a_p_p_e_r__; │ │ │ │ -_6_5_8 std::vector> _d_a_t_a__; │ │ │ │ -659 │ │ │ │ -660 }; // class MorleyPreBasis │ │ │ │ -661 │ │ │ │ -662 namespace _B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -663 { │ │ │ │ -664 │ │ │ │ -671 template │ │ │ │ -_6_7_2 auto _m_o_r_l_e_y() │ │ │ │ -673 { │ │ │ │ -674 return [=](auto const &gridView) { │ │ │ │ -675 return _M_o_r_l_e_y_P_r_e_B_a_s_i_s, R>(gridView); │ │ │ │ -676 }; │ │ │ │ -677 } │ │ │ │ -678 │ │ │ │ -679 } // end namespace BasisFactory │ │ │ │ -680 │ │ │ │ -681} // end namespace Dune::Functions │ │ │ │ -682 │ │ │ │ -683#endif │ │ │ │ -_t_r_a_n_s_f_o_r_m_e_d_f_i_n_i_t_e_e_l_e_m_e_n_t_m_i_x_i_n_._h_h │ │ │ │ -_n_o_d_e_s_._h_h │ │ │ │ -_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h │ │ │ │ -_f_u_n_c_t_i_o_n_a_l_d_e_s_c_r_i_p_t_o_r_._h_h │ │ │ │ -_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ -_c_u_b_i_c_h_e_r_m_i_t_e_b_a_s_i_s_._h_h │ │ │ │ -This file provides an implementation of the cubic Hermite finite element in 1 │ │ │ │ -to 3 dimensions. │ │ │ │ -_s_q_u_e_e_z_e_t_e_n_s_o_r_._h_h │ │ │ │ -_d_e_n_s_e_v_e_c_t_o_r_v_i_e_w_._h_h │ │ │ │ -_m_o_n_o_m_i_a_l_s_e_t_._h_h │ │ │ │ +15 │ │ │ │ +16 │ │ │ │ +29template │ │ │ │ +_3_0class _T_r_i_g_o_n_o_m_e_t_r_i_c_F_u_n_c_t_i_o_n │ │ │ │ +31{ │ │ │ │ +32public: │ │ │ │ +_3_4 K _o_p_e_r_a_t_o_r_ _(_)_ (const K& x) const │ │ │ │ +35 { │ │ │ │ +36 return sinFactor * std::sin(x) + cosFactor * std::cos(x); │ │ │ │ +37 } │ │ │ │ +38}; │ │ │ │ +39 │ │ │ │ +40 │ │ │ │ +42template │ │ │ │ +_4_3_T_r_i_g_o_n_o_m_e_t_r_i_c_F_u_n_c_t_i_o_n _d_e_r_i_v_a_t_i_v_e(const │ │ │ │ +_T_r_i_g_o_n_o_m_e_t_r_i_c_F_u_n_c_t_i_o_n_<_K_,_ _s_i_n_F_a_c_t_o_r_,_ _c_o_s_F_a_c_t_o_r_>& f) │ │ │ │ +44{ │ │ │ │ +45 return _T_r_i_g_o_n_o_m_e_t_r_i_c_F_u_n_c_t_i_o_n(); │ │ │ │ +46} │ │ │ │ +47 │ │ │ │ +48 │ │ │ │ +49 │ │ │ │ +50}} // namespace Dune::Functions │ │ │ │ +51 │ │ │ │ +52 │ │ │ │ +53 │ │ │ │ +54#endif // DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const │ │ │ │ TrigonometricFunction< K, sinFactor, cosFactor > &f) │ │ │ │ Obtain derivative of TrigonometricFunction function. │ │ │ │ DDeeffiinniittiioonn trigonometricfunction.hh:43 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_B_a_s_i_s │ │ │ │ -DefaultGlobalBasis< MorleyPreBasis< GV, R > > MorleyBasis │ │ │ │ -Nodal basis of a scalar quadratic Morley finite element space. │ │ │ │ -DDeeffiinniittiioonn morleybasis.hh:76 │ │ │ │ +_D_u_n_e │ │ │ │ +DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_i_n_t_e_r_p_o_l_a_t_e │ │ │ │ -void interpolate(const B &basis, C &&coeff, const F &f, const BV &bv, const │ │ │ │ -NTRE &nodeToRangeEntry) │ │ │ │ -Interpolate given function in discrete function space. │ │ │ │ -DDeeffiinniittiioonn interpolate.hh:205 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:926 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_m_o_r_l_e_y │ │ │ │ -auto morley() │ │ │ │ -construct a PreBasisFactory for the Morley Finite Element │ │ │ │ -DDeeffiinniittiioonn morleybasis.hh:672 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_n_o_m_i_a_l_S_e_t │ │ │ │ -Function, which evaluates all monomials up to degree maxDegree in a given │ │ │ │ -coordinate. │ │ │ │ -DDeeffiinniittiioonn monomialset.hh:64 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_2_L_o_c_a_l_B_a_s_i_s_T_r_a_i_t_s │ │ │ │ -DDeeffiinniittiioonn cubichermitebasis.hh:84 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ -Global basis for given pre-basis. │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:53 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_u_p_d_a_t_e │ │ │ │ -void update(const GridView &gv) │ │ │ │ -Update the stored GridView. │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:101 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n │ │ │ │ -LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout) │ │ │ │ -Construct from GridView and local DOF layout. │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:74 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_P_r_e_B_a_s_i_s │ │ │ │ -A pre-basis for a Morleybasis. │ │ │ │ -DDeeffiinniittiioonn morleybasis.hh:601 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_P_r_e_B_a_s_i_s_:_:_u_p_d_a_t_e │ │ │ │ -void update(GridView const &gv) │ │ │ │ -Update the stored grid view, to be called if the grid has changed. │ │ │ │ -DDeeffiinniittiioonn morleybasis.hh:641 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_P_r_e_B_a_s_i_s_:_:_m_a_p_p_e_r__ │ │ │ │ -SubEntityMapper mapper_ │ │ │ │ -DDeeffiinniittiioonn morleybasis.hh:657 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_P_r_e_B_a_s_i_s_:_:_m_a_k_e_N_o_d_e │ │ │ │ -Node makeNode() const │ │ │ │ -Create tree node. │ │ │ │ -DDeeffiinniittiioonn morleybasis.hh:650 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_P_r_e_B_a_s_i_s_:_:_d_a_t_a__ │ │ │ │ -std::vector< std::bitset< 3 > > data_ │ │ │ │ -DDeeffiinniittiioonn morleybasis.hh:658 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_P_r_e_B_a_s_i_s_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -Type used for indices and size information. │ │ │ │ -DDeeffiinniittiioonn morleybasis.hh:627 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ -GV GridView │ │ │ │ -The grid view that the FE basis is defined on. │ │ │ │ -DDeeffiinniittiioonn morleybasis.hh:624 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_P_r_e_B_a_s_i_s_:_:_N_o_d_e │ │ │ │ -MorleyNode< GridView, R > Node │ │ │ │ -Template mapping root tree path to type of created tree node. │ │ │ │ -DDeeffiinniittiioonn morleybasis.hh:630 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_P_r_e_B_a_s_i_s_:_:_M_o_r_l_e_y_P_r_e_B_a_s_i_s │ │ │ │ -MorleyPreBasis(const GV &gv) │ │ │ │ -Constructor for a given grid view object. │ │ │ │ -DDeeffiinniittiioonn morleybasis.hh:633 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_N_o_d_e │ │ │ │ -DDeeffiinniittiioonn morleybasis.hh:539 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_N_o_d_e_:_:_e_l_e_m_e_n_t │ │ │ │ -Element const & element() const │ │ │ │ -Return current element, throw if unbound. │ │ │ │ -DDeeffiinniittiioonn morleybasis.hh:552 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_N_o_d_e_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -DDeeffiinniittiioonn morleybasis.hh:542 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ -FiniteElement const & finiteElement() const │ │ │ │ -Return the LocalFiniteElement for the element we are bound to. │ │ │ │ -DDeeffiinniittiioonn morleybasis.hh:562 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_N_o_d_e_<_ _G_r_i_d_V_i_e_w_,_ _R_ _>_:_:_e_l_e_m_e_n_t__ │ │ │ │ -Element const * element_ │ │ │ │ -DDeeffiinniittiioonn morleybasis.hh:583 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_N_o_d_e_:_:_o_r_d_e_r │ │ │ │ -unsigned int order() const │ │ │ │ -The order of the local basis. │ │ │ │ -DDeeffiinniittiioonn morleybasis.hh:576 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_N_o_d_e_<_ _G_r_i_d_V_i_e_w_,_ _R_ _>_:_:_d_a_t_a__ │ │ │ │ -std::vector< std::bitset< 3 > > const * data_ │ │ │ │ -DDeeffiinniittiioonn morleybasis.hh:585 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_N_o_d_e_<_ _G_r_i_d_V_i_e_w_,_ _R_ _>_:_:_m_a_p_p_e_r__ │ │ │ │ -Mapper const * mapper_ │ │ │ │ -DDeeffiinniittiioonn morleybasis.hh:584 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_N_o_d_e_:_:_E_l_e_m_e_n_t │ │ │ │ -typename GV::template Codim< 0 >::Entity Element │ │ │ │ -DDeeffiinniittiioonn morleybasis.hh:543 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_N_o_d_e_:_:_b_i_n_d │ │ │ │ -void bind(Element const &e) │ │ │ │ -Bind to element. │ │ │ │ -DDeeffiinniittiioonn morleybasis.hh:568 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_N_o_d_e_:_:_M_o_r_l_e_y_N_o_d_e │ │ │ │ -MorleyNode(Mapper const &m, std::vector< std::bitset< 3 > > const &data) │ │ │ │ -DDeeffiinniittiioonn morleybasis.hh:547 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_N_o_d_e_:_:_F_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ -typename Impl::MorleyLocalFiniteElement< typename GV::ctype, R > FiniteElement │ │ │ │ -DDeeffiinniittiioonn morleybasis.hh:544 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_N_o_d_e_<_ _G_r_i_d_V_i_e_w_,_ _R_ _>_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t__ │ │ │ │ -FiniteElement finiteElement_ │ │ │ │ -DDeeffiinniittiioonn morleybasis.hh:582 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_e_t_S_i_z_e │ │ │ │ -void setSize(const size_type size) │ │ │ │ -DDeeffiinniittiioonn nodes.hh:197 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ -DDeeffiinniittiioonn nodes.hh:218 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_i_g_o_n_o_m_e_t_r_i_c_F_u_n_c_t_i_o_n │ │ │ │ +A linear combination of trigonomic functions. │ │ │ │ +DDeeffiinniittiioonn trigonometricfunction.hh:31 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_i_g_o_n_o_m_e_t_r_i_c_F_u_n_c_t_i_o_n_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ +K operator()(const K &x) const │ │ │ │ +Evaluate function. │ │ │ │ +DDeeffiinniittiioonn trigonometricfunction.hh:34 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _m_o_r_l_e_y_b_a_s_i_s_._h_h │ │ │ │ + * _a_n_a_l_y_t_i_c_f_u_n_c_t_i_o_n_s │ │ │ │ + * _t_r_i_g_o_n_o_m_e_t_r_i_c_f_u_n_c_t_i_o_n_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00119.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: lfeprebasismixin.hh File Reference │ │ │ +Dune-Functions: istlvectorbackend.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,55 +88,61 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
lfeprebasismixin.hh File Reference
│ │ │ +
istlvectorbackend.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <cassert>
│ │ │ +
#include <cstddef>
│ │ │ +#include <utility>
│ │ │ #include <type_traits>
│ │ │ -#include <dune/common/exceptions.hh>
│ │ │ -#include <dune/functions/functionspacebases/leafprebasismappermixin.hh>
│ │ │ -#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ -#include <dune/grid/common/mcmgmapper.hh>
│ │ │ +#include <dune/common/std/type_traits.hh>
│ │ │ +#include <dune/common/indices.hh>
│ │ │ +#include <dune/common/hybridutilities.hh>
│ │ │ +#include <dune/common/concept.hh>
│ │ │ +#include <dune/functions/common/indexaccess.hh>
│ │ │ +#include <dune/functions/functionspacebases/concepts.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -

│ │ │ -Classes

class  Dune::Functions::LFEPreBasisMixin< GV, LFE >
 A pre-basis mixin class parametrized with a local finite-element and a DOF layout. More...
class  Dune::Functions::LFEPreBasisMixin< GV, LFE >::Node
 Leaf basis node that encapsulates a local finite-element given from the LFEPreBasisMixin of type LFE. More...
│ │ │ │ │ │ │ │ │ │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
│ │ │ │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Functions

template<class GV, class LFE>
 Dune::Functions::LFEPreBasisMixin (const GV &, const LFE &, MCMGLayout) -> LFEPreBasisMixin< GV, LFE >
template<class V>
constexpr auto Dune::Functions::fieldTypes ()
 Generate list of field types in container.
template<class V>
constexpr bool Dune::Functions::hasUniqueFieldType ()
 Check if container has a unique field type.
template<class Vector>
auto Dune::Functions::istlVectorBackend (Vector &v)
 Return a vector backend wrapping non-const ISTL like containers.
template<class Vector>
auto Dune::Functions::istlVectorBackend (const Vector &v)
 Return a vector backend wrapping const ISTL like containers.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,31 +1,37 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -lfeprebasismixin.hh File Reference │ │ │ │ -#include │ │ │ │ +istlvectorbackend.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_i_n_d_e_x_a_c_c_e_s_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ -CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_<_ _G_V_,_ _L_F_E_ _> │ │ │ │ -  A pre-basis mixin class parametrized with a local finite-element and a │ │ │ │ - DOF layout. _M_o_r_e_._._. │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_<_ _G_V_,_ _L_F_E_ _>_:_:_N_o_d_e │ │ │ │ -  Leaf basis node that encapsulates a local finite-element given from the │ │ │ │ - _L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n of type LFE. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n (const GV &, const LFE &, MCMGLayout) - │ │ │ │ - > LFEPreBasisMixin< GV, LFE > │ │ │ │ +template │ │ │ │ +constexpr auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_i_e_l_d_T_y_p_e_s () │ │ │ │ +  Generate list of field types in container. │ │ │ │ +template │ │ │ │ +constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_h_a_s_U_n_i_q_u_e_F_i_e_l_d_T_y_p_e () │ │ │ │ +  Check if container has a unique field type. │ │ │ │ +template │ │ │ │ + auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d (Vector &v) │ │ │ │ +  Return a vector backend wrapping non-const ISTL like │ │ │ │ + containers. │ │ │ │ +template │ │ │ │ + auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d (const Vector &v) │ │ │ │ +  Return a vector backend wrapping const ISTL like containers. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _l_f_e_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h │ │ │ │ + * _b_a_c_k_e_n_d_s │ │ │ │ + * _i_s_t_l_v_e_c_t_o_r_b_a_c_k_e_n_d_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00119.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,4 +1,6 @@ │ │ │ │ var a00119 = [ │ │ │ │ - ["Dune::Functions::LFEPreBasisMixin< GV, LFE >::Node", "a01954.html", "a01954"], │ │ │ │ - ["Dune::Functions::LFEPreBasisMixin", "a00318.html#af37105e3e3c8d996b2a3551286f01be9", null] │ │ │ │ + ["Dune::Functions::fieldTypes", "a00318.html#ad0a3b4e397e76b3d02cb06a7793fdb7b", null], │ │ │ │ + ["Dune::Functions::hasUniqueFieldType", "a00318.html#af8b09a0411c63ab6a6500a7b6edb9dfb", null], │ │ │ │ + ["Dune::Functions::istlVectorBackend", "a00313.html#ga50a181637103e7abc011235a9fd30611", null], │ │ │ │ + ["Dune::Functions::istlVectorBackend", "a00313.html#gae5b9f62f85e3d638423142695a74d056", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00119_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: lfeprebasismixin.hh Source File │ │ │ +Dune-Functions: istlvectorbackend.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,167 +88,353 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
lfeprebasismixin.hh
│ │ │ +
istlvectorbackend.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LFEPREBASISMIXIN_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LFEPREBASISMIXIN_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_ISTLVECTORBACKEND_HH
│ │ │ +
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_ISTLVECTORBACKEND_HH
│ │ │
9
│ │ │ -
10#include <cassert>
│ │ │ -
11#include <type_traits>
│ │ │ -
12
│ │ │ -
13#include <dune/common/exceptions.hh>
│ │ │ -
14
│ │ │ - │ │ │ - │ │ │ -
17
│ │ │ -
18#include <dune/grid/common/mcmgmapper.hh>
│ │ │ -
19
│ │ │ -
20namespace Dune::Functions {
│ │ │ -
21
│ │ │ -
54template <class GV, class LFE>
│ │ │ -
│ │ │ - │ │ │ -
56 public LeafPreBasisMapperMixin< GV >
│ │ │ -
57{
│ │ │ - │ │ │ -
59
│ │ │ -
60public:
│ │ │ -
61
│ │ │ -
63 using GridView = GV;
│ │ │ -
64
│ │ │ -
66 class Node;
│ │ │ -
67
│ │ │ -
73 template <class LFE_ = LFE,
│ │ │ -
74 std::enable_if_t<std::is_default_constructible_v<LFE_>, int> = 0>
│ │ │ -
│ │ │ -
75 LFEPreBasisMixin (const GridView& gv, MCMGLayout layout)
│ │ │ -
76 : Base(gv, layout)
│ │ │ -
77 , lfe_{}
│ │ │ -
78 {}
│ │ │ -
│ │ │ -
79
│ │ │ -
85 template <class LFE_>
│ │ │ -
│ │ │ -
86 LFEPreBasisMixin (const GridView& gv, LFE_&& lfe, MCMGLayout layout)
│ │ │ -
87 : Base(gv, layout)
│ │ │ -
88 , lfe_(std::forward<LFE_>(lfe))
│ │ │ -
89 {}
│ │ │ -
│ │ │ -
90
│ │ │ -
│ │ │ -
92 Node makeNode () const
│ │ │ -
93 {
│ │ │ -
94 return Node(lfe_);
│ │ │ -
95 }
│ │ │ -
│ │ │ -
96
│ │ │ -
97private:
│ │ │ -
98 LFE lfe_;
│ │ │ -
99};
│ │ │ -
│ │ │ -
100
│ │ │ -
101// deduction guide
│ │ │ -
102template <class GV, class LFE>
│ │ │ -
103LFEPreBasisMixin(const GV&, const LFE&, MCMGLayout)
│ │ │ - │ │ │ -
105
│ │ │ -
106
│ │ │ -
107
│ │ │ -
117template <class GV, class LFE>
│ │ │ -
│ │ │ -
118class LFEPreBasisMixin<GV,LFE>::Node
│ │ │ -
119 : public LeafBasisNode
│ │ │ -
120{
│ │ │ -
121 static constexpr int dim = GV::dimension;
│ │ │ -
122
│ │ │ -
123public:
│ │ │ -
124 using size_type = std::size_t;
│ │ │ -
125 using Element = typename GV::template Codim<0>::Entity;
│ │ │ -
126 using FiniteElement = LFE;
│ │ │ -
127
│ │ │ -
│ │ │ -
129 explicit Node (const LFE& lfe)
│ │ │ -
130 : lfe_{&lfe}
│ │ │ -
131 , element_{nullptr}
│ │ │ -
132 {}
│ │ │ -
│ │ │ -
133
│ │ │ -
│ │ │ -
135 const Element& element () const
│ │ │ -
136 {
│ │ │ -
137 assert(!!element_);
│ │ │ -
138 return *element_;
│ │ │ -
139 }
│ │ │ -
│ │ │ -
140
│ │ │ -
│ │ │ - │ │ │ -
147 {
│ │ │ -
148 assert(!!lfe_);
│ │ │ -
149 return *lfe_;
│ │ │ +
10#include <cstddef>
│ │ │ +
11#include <utility>
│ │ │ +
12#include <type_traits>
│ │ │ +
13
│ │ │ +
14#include <dune/common/std/type_traits.hh>
│ │ │ +
15#include <dune/common/indices.hh>
│ │ │ +
16#include <dune/common/hybridutilities.hh>
│ │ │ +
17#include <dune/common/concept.hh>
│ │ │ +
18
│ │ │ + │ │ │ + │ │ │ +
21
│ │ │ +
22
│ │ │ +
23namespace Dune {
│ │ │ +
24namespace Functions {
│ │ │ +
25
│ │ │ +
26namespace Impl {
│ │ │ +
27
│ │ │ +
28template<class V,
│ │ │ +
29 std::enable_if_t<not Dune::models<Imp::Concept::HasStaticIndexAccess, V>() , int> = 0>
│ │ │ +
30auto fieldTypes(V&& /*v*/)
│ │ │ +
31{
│ │ │ +
32 return TypeList<V>{};
│ │ │ +
33}
│ │ │ +
34
│ │ │ +
35template<class V,
│ │ │ +
36 std::enable_if_t<Dune::models<Imp::Concept::HasStaticIndexAccess, V>(), int> = 0>
│ │ │ +
37auto fieldTypes(V&& v)
│ │ │ +
38{
│ │ │ +
39 if constexpr (Dune::models<Imp::Concept::HasDynamicIndexAccess<std::size_t>, V>())
│ │ │ +
40 return fieldTypes(v[std::size_t{0}]);
│ │ │ +
41 else
│ │ │ +
42 {
│ │ │ +
43 auto indexRange = typename decltype(range(Hybrid::size(v)))::integer_sequence();
│ │ │ +
44 return unpackIntegerSequence([&](auto... i) {
│ │ │ +
45 return uniqueTypeList(std::tuple_cat(fieldTypes(v[i])...));
│ │ │ +
46 }, indexRange);
│ │ │ +
47 }
│ │ │ +
48}
│ │ │ +
49
│ │ │ +
50} // namespace Impl
│ │ │ +
51
│ │ │ +
52
│ │ │ +
53
│ │ │ +
66template<class V>
│ │ │ +
│ │ │ +
67constexpr auto fieldTypes()
│ │ │ +
68{
│ │ │ +
69 return decltype(Impl::fieldTypes(std::declval<V>())){};
│ │ │ +
70}
│ │ │ +
│ │ │ +
71
│ │ │ +
77template<class V>
│ │ │ +
│ │ │ +
78constexpr bool hasUniqueFieldType()
│ │ │ +
79{
│ │ │ +
80 return std::tuple_size_v<std::decay_t<decltype(fieldTypes<V>())>> ==1;
│ │ │ +
81}
│ │ │ +
│ │ │ +
82
│ │ │ +
83
│ │ │ +
84
│ │ │ +
85namespace Impl {
│ │ │ +
86
│ │ │ +
87/*
│ │ │ +
88 * \brief A wrapper providing multi-index access to vector entries
│ │ │ +
89 *
│ │ │ +
90 * The wrapped vector type should be an istl like random
│ │ │ +
91 * access container providing operator[] and size() methods.
│ │ │ +
92 * For classical containers this should support indices
│ │ │ +
93 * of type std::size_t. For multi-type containers indices
│ │ │ +
94 * of the form Dune::index_constant<i> should be supported
│ │ │ +
95 * while size() should be a static constexpr method.
│ │ │ +
96 *
│ │ │ +
97 * When resolving multi-indices the backend appends indices
│ │ │ +
98 * using operator[] as long as the result is not a scalar.
│ │ │ +
99 * If this exhausts the digits of the multi-index, additional
│ │ │ +
100 * zeros are appended.
│ │ │ +
101 *
│ │ │ +
102 * \tparam V Type of the raw wrapper vector
│ │ │ +
103 */
│ │ │ +
104template<class V>
│ │ │ +
105class ISTLVectorBackend
│ │ │ +
106{
│ │ │ +
107
│ │ │ +
108 // Template aliases for using detection idiom.
│ │ │ +
109 template<class C>
│ │ │ +
110 using dynamicIndexAccess_t = decltype(std::declval<C>()[0]);
│ │ │ +
111
│ │ │ +
112 template<class C>
│ │ │ +
113 using staticIndexAccess_t = decltype(std::declval<C>()[Dune::Indices::_0]);
│ │ │ +
114
│ │ │ +
115 template<class C>
│ │ │ +
116 using resizeMethod_t = decltype(std::declval<C>().resize(0));
│ │ │ +
117
│ │ │ +
118
│ │ │ +
119
│ │ │ +
120 // Short cuts for feature detection
│ │ │ +
121 template<class C>
│ │ │ +
122 using hasDynamicIndexAccess = Dune::Std::is_detected<dynamicIndexAccess_t, std::remove_reference_t<C>>;
│ │ │ +
123
│ │ │ +
124 template<class C>
│ │ │ +
125 using hasStaticIndexAccess = Dune::Std::is_detected<staticIndexAccess_t, std::remove_reference_t<C>>;
│ │ │ +
126
│ │ │ +
127 template<class C>
│ │ │ +
128 using hasResizeMethod = Dune::Std::is_detected<resizeMethod_t, std::remove_reference_t<C>>;
│ │ │ +
129
│ │ │ +
130 template<class C>
│ │ │ +
131 using isDynamicVector = Dune::Std::is_detected<dynamicIndexAccess_t, std::remove_reference_t<C>>;
│ │ │ +
132
│ │ │ +
133 template<class C>
│ │ │ +
134 using isStaticVector = std::bool_constant<
│ │ │ +
135 Dune::Std::is_detected_v<staticIndexAccess_t, std::remove_reference_t<C>>
│ │ │ +
136 and not Dune::Std::is_detected_v<dynamicIndexAccess_t, std::remove_reference_t<C>>>;
│ │ │ +
137
│ │ │ +
138 template<class C>
│ │ │ +
139 using isScalar = std::bool_constant<not Dune::Std::is_detected_v<staticIndexAccess_t, std::remove_reference_t<C>>>;
│ │ │ +
140
│ │ │ +
141 template<class C>
│ │ │ +
142 using isVector = std::bool_constant<Dune::Std::is_detected_v<staticIndexAccess_t, std::remove_reference_t<C>>>;
│ │ │ +
143
│ │ │ +
144
│ │ │ +
145
│ │ │ +
146 template<class... Args>
│ │ │ +
147 static void forwardToResize(Args&&... args)
│ │ │ +
148 {
│ │ │ +
149 resize(std::forward<Args>(args)...);
│ │ │
150 }
│ │ │ -
│ │ │ -
151
│ │ │ -
│ │ │ -
153 void bind (const Element& e)
│ │ │ -
154 {
│ │ │ -
155 element_ = &e;
│ │ │ -
156 this->setSize(lfe_->size());
│ │ │ -
157 }
│ │ │ -
│ │ │ -
158
│ │ │ -
159protected:
│ │ │ - │ │ │ - │ │ │ -
162};
│ │ │ -
│ │ │ -
163
│ │ │ -
164
│ │ │ -
165} // end namespace Dune::Functions
│ │ │ -
166
│ │ │ -
167
│ │ │ -
168#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LFEPREBASISMIXIN_HH
│ │ │ - │ │ │ - │ │ │ +
151
│ │ │ +
152
│ │ │ +
153 template<class C, class SizeProvider,
│ │ │ +
154 std::enable_if_t<hasResizeMethod<C>::value, int> = 0>
│ │ │ +
155 static void resize(C&& c, const SizeProvider& sizeProvider, typename SizeProvider::SizePrefix prefix)
│ │ │ +
156 {
│ │ │ +
157 auto size = sizeProvider.size(prefix);
│ │ │ +
158 if (size==0)
│ │ │ +
159 {
│ │ │ +
160 // If size==0 this prefix refers to a single coefficient c.
│ │ │ +
161 // But being in this overload means that c is not a scalar
│ │ │ +
162 // because is has a resize() method. Since operator[] deliberately
│ │ │ +
163 // supports implicit padding of multi-indices by as many
│ │ │ +
164 // [0]'s as needed to resolve a scalar entry, we should also
│ │ │ +
165 // except a non-scalar c here. However, this requires that
│ │ │ +
166 // we silently believe that whatever size c already has is
│ │ │ +
167 // intended by the user. The only exception is c.size()==0
│ │ │ +
168 // which is not acceptable but we also cannot know the desired size.
│ │ │ +
169 if (c.size()==0)
│ │ │ +
170 DUNE_THROW(RangeError, "The vector entry v[" << prefix << "] should refer to a "
│ │ │ +
171 << "scalar coefficient, but is a dynamically sized vector of size==0");
│ │ │ +
172 else
│ │ │ +
173 // Accept non-zero sized coefficients to avoid that resize(basis)
│ │ │ +
174 // fails for a vector that works with operator[] and already
│ │ │ +
175 // has the appropriate size.
│ │ │ +
176 return;
│ │ │ +
177 }
│ │ │ +
178 c.resize(size);
│ │ │ +
179 prefix.push_back(0);
│ │ │ +
180 for(std::size_t i=0; i<size; ++i)
│ │ │ +
181 {
│ │ │ +
182 prefix.back() = i;
│ │ │ +
183 resize(c[i], sizeProvider, prefix);
│ │ │ +
184 }
│ │ │ +
185 }
│ │ │ +
186
│ │ │ +
187 template<class C, class SizeProvider,
│ │ │ +
188 std::enable_if_t<not hasResizeMethod<C>::value, int> = 0,
│ │ │ +
189 std::enable_if_t<isVector<C>::value, int> = 0>
│ │ │ +
190 static void resize(C&& c, const SizeProvider& sizeProvider, typename SizeProvider::SizePrefix prefix)
│ │ │ +
191 {
│ │ │ +
192 auto size = sizeProvider.size(prefix);
│ │ │ +
193 // If size == 0 there's nothing to do:
│ │ │ +
194 // We can't resize c and it's already
│ │ │ +
195 // large enough anyway.
│ │ │ +
196 if (size == 0)
│ │ │ +
197 return;
│ │ │ +
198
│ │ │ +
199 // If size>0 but c does not have the appropriate
│ │ │ +
200 // size we throw an exception.
│ │ │ +
201 //
│ │ │ +
202 // We could perhaps also allow c.size()>size.
│ │ │ +
203 // But then looping the loop below gets complicated:
│ │ │ +
204 // We're not allowed to loop until c.size(). But
│ │ │ +
205 // we also cannot use size for termination,
│ │ │ +
206 // because this fails if c is a static vector.
│ │ │ +
207 if (c.size() != size)
│ │ │ +
208 DUNE_THROW(RangeError, "Can't resize non-resizable entry v[" << prefix << "] of size " << c.size() << " to size(" << prefix << ")=" << size);
│ │ │ +
209
│ │ │ +
210 // Recursively resize all entries of c now.
│ │ │ +
211 using namespace Dune::Hybrid;
│ │ │ +
212 prefix.push_back(0);
│ │ │ +
213 forEach(integralRange(Hybrid::size(c)), [&](auto&& i) {
│ │ │ +
214 prefix.back() = i;
│ │ │ +
215 // Here we'd simply like to call resize(c[i], sizeProvider, prefix);
│ │ │ +
216 // but even gcc-7 does not except this bus reports
│ │ │ +
217 // "error: ‘this’ was not captured for this lambda function"
│ │ │ +
218 // although there's no 'this' because we're in a static method.
│ │ │ +
219 // Bypassing this by and additional method that does perfect
│ │ │ +
220 // forwarding allows to workaround this.
│ │ │ +
221 ISTLVectorBackend<V>::forwardToResize(c[i], sizeProvider, prefix);
│ │ │ +
222 });
│ │ │ +
223 }
│ │ │ +
224
│ │ │ +
225 template<class C, class SizeProvider,
│ │ │ +
226 std::enable_if_t<not hasResizeMethod<C>::value, int> = 0,
│ │ │ +
227 std::enable_if_t<isScalar<C>::value, int> = 0>
│ │ │ +
228 static void resize(C&&, const SizeProvider& sizeProvider, typename SizeProvider::SizePrefix prefix)
│ │ │ +
229 {
│ │ │ +
230 auto size = sizeProvider.size(prefix);
│ │ │ +
231 if (size != 0)
│ │ │ +
232 DUNE_THROW(RangeError, "Can't resize scalar vector entry v[" << prefix << "] to size(" << prefix << ")=" << size);
│ │ │ +
233 }
│ │ │ +
234
│ │ │ +
235 template<class C, class T,
│ │ │ +
236 std::enable_if_t<std::is_assignable_v<C&,T>, int> = 0>
│ │ │ +
237 void recursiveAssign(C& c, const T& t)
│ │ │ +
238 {
│ │ │ +
239 c = t;
│ │ │ +
240 }
│ │ │ +
241
│ │ │ +
242 template<class C, class T,
│ │ │ +
243 std::enable_if_t<not std::is_assignable_v<C&,T>, int> = 0>
│ │ │ +
244 void recursiveAssign(C& c, const T& t)
│ │ │ +
245 {
│ │ │ +
246 Dune::Hybrid::forEach(c, [&](auto&& ci) {
│ │ │ +
247 recursiveAssign(ci, t);
│ │ │ +
248 });
│ │ │ +
249 }
│ │ │ +
250
│ │ │ +
251public:
│ │ │ +
252
│ │ │ +
253 using Vector = V;
│ │ │ +
254
│ │ │ +
255 ISTLVectorBackend(Vector& vector) :
│ │ │ +
256 vector_(&vector)
│ │ │ +
257 {}
│ │ │ +
258
│ │ │ +
259 template<class SizeProvider>
│ │ │ +
260 void resize(const SizeProvider& sizeProvider)
│ │ │ +
261 {
│ │ │ +
262 auto prefix = typename SizeProvider::SizePrefix();
│ │ │ +
263 prefix.resize(0);
│ │ │ +
264 resize(*vector_, sizeProvider, prefix);
│ │ │ +
265 }
│ │ │ +
266
│ │ │ +
267 template<class MultiIndex>
│ │ │ +
268 decltype(auto) operator[](const MultiIndex& index) const
│ │ │ +
269 {
│ │ │ +
270 return resolveDynamicMultiIndex(*vector_, index);
│ │ │ +
271 }
│ │ │ +
272
│ │ │ +
273 template<class MultiIndex>
│ │ │ +
274 decltype(auto) operator[](const MultiIndex& index)
│ │ │ +
275 {
│ │ │ +
276 return resolveDynamicMultiIndex(*vector_, index);
│ │ │ +
277 }
│ │ │ +
278
│ │ │ +
287 template<typename T>
│ │ │ +
288 void operator= (const T& other)
│ │ │ +
289 {
│ │ │ +
290 recursiveAssign(vector(), other);
│ │ │ +
291 }
│ │ │ +
292
│ │ │ +
293 template<typename T>
│ │ │ +
294 void operator= (const ISTLVectorBackend<T>& other)
│ │ │ +
295 {
│ │ │ +
296 vector() = other.vector();
│ │ │ +
297 }
│ │ │ +
298
│ │ │ +
299 const Vector& vector() const
│ │ │ +
300 {
│ │ │ +
301 return *vector_;
│ │ │ +
302 }
│ │ │ +
303
│ │ │ +
304 Vector& vector()
│ │ │ +
305 {
│ │ │ +
306 return *vector_;
│ │ │ +
307 }
│ │ │ +
308
│ │ │ +
309private:
│ │ │ +
310
│ │ │ +
311 Vector* vector_;
│ │ │ +
312};
│ │ │ +
313
│ │ │ +
314} // end namespace Impl
│ │ │ +
315
│ │ │ +
316
│ │ │ +
317
│ │ │ +
349template<class Vector>
│ │ │ +
│ │ │ +
350auto istlVectorBackend(Vector& v)
│ │ │ +
351{
│ │ │ +
352 static_assert(hasUniqueFieldType<Vector&>(), "Vector type passed to istlVectorBackend() does not have a unique field type.");
│ │ │ +
353 return Impl::ISTLVectorBackend<Vector>(v);
│ │ │ +
354}
│ │ │ +
│ │ │ +
355
│ │ │ +
356
│ │ │ +
357
│ │ │ +
387template<class Vector>
│ │ │ +
│ │ │ +
388auto istlVectorBackend(const Vector& v)
│ │ │ +
389{
│ │ │ +
390 static_assert(hasUniqueFieldType<const Vector&>(), "Vector type passed to istlVectorBackend() does not have a unique field type.");
│ │ │ +
391 return Impl::ISTLVectorBackend<const Vector>(v);
│ │ │ +
392}
│ │ │ +
│ │ │ +
393
│ │ │ +
394
│ │ │ +
395
│ │ │ +
396} // namespace Functions
│ │ │ +
397} // namespace Dune
│ │ │ +
398
│ │ │ +
399
│ │ │ +
400#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_ISTLVECTORBACKEND_HH
│ │ │ + │ │ │ +
auto istlVectorBackend(Vector &v)
Return a vector backend wrapping non-const ISTL like containers.
Definition istlvectorbackend.hh:350
│ │ │ +
constexpr decltype(auto) resolveDynamicMultiIndex(C &&c, const MultiIndex &multiIndex, const IsFinal &isFinal)
Provide multi-index access by chaining operator[].
Definition indexaccess.hh:377
│ │ │ +
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
LFEPreBasisMixin(const GV &, const LFE &, MCMGLayout) -> LFEPreBasisMixin< GV, LFE >
│ │ │ -
LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout)
Construct from GridView and local DOF layout.
Definition leafprebasismappermixin.hh:74
│ │ │ -
A pre-basis mixin class parametrized with a local finite-element and a DOF layout.
Definition lfeprebasismixin.hh:57
│ │ │ -
LFEPreBasisMixin(const GridView &gv, LFE_ &&lfe, MCMGLayout layout)
Constructor for a given grid view object, local finite-element and layout.
Definition lfeprebasismixin.hh:86
│ │ │ -
LFEPreBasisMixin(const GridView &gv, MCMGLayout layout)
Constructor for a given grid view object and layout.
Definition lfeprebasismixin.hh:75
│ │ │ -
Node makeNode() const
Create tree node.
Definition lfeprebasismixin.hh:92
│ │ │ - │ │ │ -
LFE FiniteElement
Definition lfeprebasismixin.hh:126
│ │ │ -
std::size_t size_type
Definition lfeprebasismixin.hh:124
│ │ │ -
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to; might raise an error if unbound.
Definition lfeprebasismixin.hh:146
│ │ │ -
const Element & element() const
Return current element; might raise an error if unbound.
Definition lfeprebasismixin.hh:135
│ │ │ -
const FiniteElement * lfe_
Definition lfeprebasismixin.hh:160
│ │ │ -
void bind(const Element &e)
Bind to element. Stores a pointer to the passed element reference.
Definition lfeprebasismixin.hh:153
│ │ │ -
Node(const LFE &lfe)
Constructor; stores a pointer to the passed local finite-element lfe.
Definition lfeprebasismixin.hh:129
│ │ │ -
typename GV::template Codim< 0 >::Entity Element
Definition lfeprebasismixin.hh:125
│ │ │ -
const Element * element_
Definition lfeprebasismixin.hh:161
│ │ │ -
void setSize(const size_type size)
Definition nodes.hh:197
│ │ │ -
Definition nodes.hh:218
│ │ │ +
constexpr auto fieldTypes()
Generate list of field types in container.
Definition istlvectorbackend.hh:67
│ │ │ +
constexpr bool hasUniqueFieldType()
Check if container has a unique field type.
Definition istlvectorbackend.hh:78
│ │ │ + │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,187 +1,370 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -lfeprebasismixin.hh │ │ │ │ +istlvectorbackend.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LFEPREBASISMIXIN_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LFEPREBASISMIXIN_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_ISTLVECTORBACKEND_HH │ │ │ │ +8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_ISTLVECTORBACKEND_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ -12 │ │ │ │ -13#include │ │ │ │ -14 │ │ │ │ -15#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h> │ │ │ │ -16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -17 │ │ │ │ -18#include │ │ │ │ -19 │ │ │ │ -20namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ +12#include │ │ │ │ +13 │ │ │ │ +14#include │ │ │ │ +15#include │ │ │ │ +16#include │ │ │ │ +17#include │ │ │ │ +18 │ │ │ │ +19#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_i_n_d_e_x_a_c_c_e_s_s_._h_h> │ │ │ │ +20#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ 21 │ │ │ │ -54template │ │ │ │ -_5_5class _L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n : │ │ │ │ -56 public _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n< GV > │ │ │ │ -57{ │ │ │ │ -58 using Base = _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_<_ _G_V_ _>; │ │ │ │ -59 │ │ │ │ -60public: │ │ │ │ -61 │ │ │ │ -_6_3 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ -64 │ │ │ │ -66 class Node; │ │ │ │ -67 │ │ │ │ -73 template , int> = 0> │ │ │ │ -_7_5 _L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n (const _G_r_i_d_V_i_e_w& gv, MCMGLayout layout) │ │ │ │ -76 : Base(gv, layout) │ │ │ │ -77 , lfe_{} │ │ │ │ -78 {} │ │ │ │ -79 │ │ │ │ -85 template │ │ │ │ -_8_6 _L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n (const _G_r_i_d_V_i_e_w& gv, LFE_&& lfe, MCMGLayout layout) │ │ │ │ -87 : Base(gv, layout) │ │ │ │ -88 , lfe_(std::forward(lfe)) │ │ │ │ -89 {} │ │ │ │ -90 │ │ │ │ -_9_2 Node _m_a_k_e_N_o_d_e () const │ │ │ │ -93 { │ │ │ │ -94 return Node(lfe_); │ │ │ │ -95 } │ │ │ │ -96 │ │ │ │ -97private: │ │ │ │ -98 LFE lfe_; │ │ │ │ -99}; │ │ │ │ -100 │ │ │ │ -101// deduction guide │ │ │ │ -102template │ │ │ │ -_1_0_3_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n(const GV&, const LFE&, MCMGLayout) │ │ │ │ -104 -> _L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_<_G_V_,_L_F_E_>; │ │ │ │ -105 │ │ │ │ -106 │ │ │ │ +22 │ │ │ │ +23namespace _D_u_n_e { │ │ │ │ +24namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +25 │ │ │ │ +26namespace Impl { │ │ │ │ +27 │ │ │ │ +28template() , │ │ │ │ +int> = 0> │ │ │ │ +30auto _f_i_e_l_d_T_y_p_e_s(V&& /*v*/) │ │ │ │ +31{ │ │ │ │ +32 return TypeList{}; │ │ │ │ +33} │ │ │ │ +34 │ │ │ │ +35template(), int> │ │ │ │ += 0> │ │ │ │ +37auto _f_i_e_l_d_T_y_p_e_s(V&& v) │ │ │ │ +38{ │ │ │ │ +39 if constexpr (Dune::models, │ │ │ │ +V>()) │ │ │ │ +40 return _f_i_e_l_d_T_y_p_e_s(v[std::size_t{0}]); │ │ │ │ +41 else │ │ │ │ +42 { │ │ │ │ +43 auto indexRange = typename decltype(range(Hybrid::size(v))):: │ │ │ │ +integer_sequence(); │ │ │ │ +44 return unpackIntegerSequence([&](auto... i) { │ │ │ │ +45 return uniqueTypeList(std::tuple_cat(_f_i_e_l_d_T_y_p_e_s(v[i])...)); │ │ │ │ +46 }, indexRange); │ │ │ │ +47 } │ │ │ │ +48} │ │ │ │ +49 │ │ │ │ +50} // namespace Impl │ │ │ │ +51 │ │ │ │ +52 │ │ │ │ +53 │ │ │ │ +66template │ │ │ │ +_6_7constexpr auto _f_i_e_l_d_T_y_p_e_s() │ │ │ │ +68{ │ │ │ │ +69 return decltype(Impl::fieldTypes(std::declval())){}; │ │ │ │ +70} │ │ │ │ +71 │ │ │ │ +77template │ │ │ │ +_7_8constexpr bool _h_a_s_U_n_i_q_u_e_F_i_e_l_d_T_y_p_e() │ │ │ │ +79{ │ │ │ │ +80 return std::tuple_size_v())>> ==1; │ │ │ │ +81} │ │ │ │ +82 │ │ │ │ +83 │ │ │ │ +84 │ │ │ │ +85namespace Impl { │ │ │ │ +86 │ │ │ │ +87/* │ │ │ │ +88 * \brief A wrapper providing multi-index access to vector entries │ │ │ │ +89 * │ │ │ │ +90 * The wrapped vector type should be an istl like random │ │ │ │ +91 * access container providing operator[] and size() methods. │ │ │ │ +92 * For classical containers this should support indices │ │ │ │ +93 * of type std::size_t. For multi-type containers indices │ │ │ │ +94 * of the form Dune::index_constant should be supported │ │ │ │ +95 * while size() should be a static constexpr method. │ │ │ │ +96 * │ │ │ │ +97 * When resolving multi-indices the backend appends indices │ │ │ │ +98 * using operator[] as long as the result is not a scalar. │ │ │ │ +99 * If this exhausts the digits of the multi-index, additional │ │ │ │ +100 * zeros are appended. │ │ │ │ +101 * │ │ │ │ +102 * \tparam V Type of the raw wrapper vector │ │ │ │ +103 */ │ │ │ │ +104template │ │ │ │ +105class ISTLVectorBackend │ │ │ │ +106{ │ │ │ │ 107 │ │ │ │ -117template │ │ │ │ -_1_1_8class _L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n::_N_o_d_e │ │ │ │ -119 : public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ -120{ │ │ │ │ -121 static constexpr int dim = GV::dimension; │ │ │ │ -122 │ │ │ │ -123public: │ │ │ │ -_1_2_4 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ -_1_2_5 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ -_1_2_6 using _F_i_n_i_t_e_E_l_e_m_e_n_t = LFE; │ │ │ │ -127 │ │ │ │ -_1_2_9 explicit _N_o_d_e (const LFE& lfe) │ │ │ │ -130 : _l_f_e__{&lfe} │ │ │ │ -131 , _e_l_e_m_e_n_t__{nullptr} │ │ │ │ -132 {} │ │ │ │ -133 │ │ │ │ -_1_3_5 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t () const │ │ │ │ -136 { │ │ │ │ -137 assert(!!_e_l_e_m_e_n_t__); │ │ │ │ -138 return *_e_l_e_m_e_n_t__; │ │ │ │ -139 } │ │ │ │ +108 // Template aliases for using detection idiom. │ │ │ │ +109 template │ │ │ │ +110 using dynamicIndexAccess_t = decltype(std::declval()[0]); │ │ │ │ +111 │ │ │ │ +112 template │ │ │ │ +113 using staticIndexAccess_t = decltype(std::declval()[Dune::Indices::_0]); │ │ │ │ +114 │ │ │ │ +115 template │ │ │ │ +116 using resizeMethod_t = decltype(std::declval().resize(0)); │ │ │ │ +117 │ │ │ │ +118 │ │ │ │ +119 │ │ │ │ +120 // Short cuts for feature detection │ │ │ │ +121 template │ │ │ │ +122 using hasDynamicIndexAccess = Dune::Std::is_detected>; │ │ │ │ +123 │ │ │ │ +124 template │ │ │ │ +125 using hasStaticIndexAccess = Dune::Std::is_detected>; │ │ │ │ +126 │ │ │ │ +127 template │ │ │ │ +128 using hasResizeMethod = Dune::Std::is_detected>; │ │ │ │ +129 │ │ │ │ +130 template │ │ │ │ +131 using isDynamicVector = Dune::Std::is_detected>; │ │ │ │ +132 │ │ │ │ +133 template │ │ │ │ +134 using isStaticVector = std::bool_constant< │ │ │ │ +135 Dune::Std::is_detected_v> │ │ │ │ +136 and not Dune::Std::is_detected_v>>; │ │ │ │ +137 │ │ │ │ +138 template │ │ │ │ +139 using isScalar = std::bool_constant>>; │ │ │ │ 140 │ │ │ │ -_1_4_6 const _F_i_n_i_t_e_E_l_e_m_e_n_t& _f_i_n_i_t_e_E_l_e_m_e_n_t () const │ │ │ │ -147 { │ │ │ │ -148 assert(!!_l_f_e__); │ │ │ │ -149 return *_l_f_e__; │ │ │ │ +141 template │ │ │ │ +142 using isVector = std::bool_constant>>; │ │ │ │ +143 │ │ │ │ +144 │ │ │ │ +145 │ │ │ │ +146 template │ │ │ │ +147 static void forwardToResize(Args&&... args) │ │ │ │ +148 { │ │ │ │ +149 resize(std::forward(args)...); │ │ │ │ 150 } │ │ │ │ 151 │ │ │ │ -_1_5_3 void _b_i_n_d (const _E_l_e_m_e_n_t& e) │ │ │ │ -154 { │ │ │ │ -155 _e_l_e_m_e_n_t__ = &e; │ │ │ │ -156 this->_s_e_t_S_i_z_e(_l_f_e__->size()); │ │ │ │ -157 } │ │ │ │ -158 │ │ │ │ -159protected: │ │ │ │ -_1_6_0 const _F_i_n_i_t_e_E_l_e_m_e_n_t* _l_f_e__; │ │ │ │ -_1_6_1 const _E_l_e_m_e_n_t* _e_l_e_m_e_n_t__; │ │ │ │ -162}; │ │ │ │ -163 │ │ │ │ -164 │ │ │ │ -165} // end namespace Dune::Functions │ │ │ │ -166 │ │ │ │ -167 │ │ │ │ -168#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LFEPREBASISMIXIN_HH │ │ │ │ -_n_o_d_e_s_._h_h │ │ │ │ -_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h │ │ │ │ +152 │ │ │ │ +153 template::value, int> = 0> │ │ │ │ +155 static void resize(C&& c, const SizeProvider& sizeProvider, typename │ │ │ │ +SizeProvider::SizePrefix prefix) │ │ │ │ +156 { │ │ │ │ +157 auto size = sizeProvider.size(prefix); │ │ │ │ +158 if (size==0) │ │ │ │ +159 { │ │ │ │ +160 // If size==0 this prefix refers to a single coefficient c. │ │ │ │ +161 // But being in this overload means that c is not a scalar │ │ │ │ +162 // because is has a resize() method. Since operator[] deliberately │ │ │ │ +163 // supports implicit padding of multi-indices by as many │ │ │ │ +164 // [0]'s as needed to resolve a scalar entry, we should also │ │ │ │ +165 // except a non-scalar c here. However, this requires that │ │ │ │ +166 // we silently believe that whatever size c already has is │ │ │ │ +167 // intended by the user. The only exception is c.size()==0 │ │ │ │ +168 // which is not acceptable but we also cannot know the desired size. │ │ │ │ +169 if (c.size()==0) │ │ │ │ +170 DUNE_THROW(RangeError, "The vector entry v[" << prefix << "] should refer │ │ │ │ +to a " │ │ │ │ +171 << "scalar coefficient, but is a dynamically sized vector of size==0"); │ │ │ │ +172 else │ │ │ │ +173 // Accept non-zero sized coefficients to avoid that resize(basis) │ │ │ │ +174 // fails for a vector that works with operator[] and already │ │ │ │ +175 // has the appropriate size. │ │ │ │ +176 return; │ │ │ │ +177 } │ │ │ │ +178 c.resize(size); │ │ │ │ +179 prefix.push_back(0); │ │ │ │ +180 for(std::size_t i=0; i::value, int> = 0, │ │ │ │ +189 std::enable_if_t::value, int> = 0> │ │ │ │ +190 static void resize(C&& c, const SizeProvider& sizeProvider, typename │ │ │ │ +SizeProvider::SizePrefix prefix) │ │ │ │ +191 { │ │ │ │ +192 auto size = sizeProvider.size(prefix); │ │ │ │ +193 // If size == 0 there's nothing to do: │ │ │ │ +194 // We can't resize c and it's already │ │ │ │ +195 // large enough anyway. │ │ │ │ +196 if (size == 0) │ │ │ │ +197 return; │ │ │ │ +198 │ │ │ │ +199 // If size>0 but c does not have the appropriate │ │ │ │ +200 // size we throw an exception. │ │ │ │ +201 // │ │ │ │ +202 // We could perhaps also allow c.size()>size. │ │ │ │ +203 // But then looping the loop below gets complicated: │ │ │ │ +204 // We're not allowed to loop until c.size(). But │ │ │ │ +205 // we also cannot use size for termination, │ │ │ │ +206 // because this fails if c is a static vector. │ │ │ │ +207 if (c.size() != size) │ │ │ │ +208 DUNE_THROW(RangeError, "Can't resize non-resizable entry v[" << prefix << │ │ │ │ +"] of size " << c.size() << " to size(" << prefix << ")=" << size); │ │ │ │ +209 │ │ │ │ +210 // Recursively resize all entries of c now. │ │ │ │ +211 using namespace Dune::Hybrid; │ │ │ │ +212 prefix.push_back(0); │ │ │ │ +213 forEach(integralRange(Hybrid::size(c)), [&](auto&& i) { │ │ │ │ +214 prefix.back() = i; │ │ │ │ +215 // Here we'd simply like to call resize(c[i], sizeProvider, prefix); │ │ │ │ +216 // but even gcc-7 does not except this bus reports │ │ │ │ +217 // "error: ‘this’ was not captured for this lambda function" │ │ │ │ +218 // although there's no 'this' because we're in a static method. │ │ │ │ +219 // Bypassing this by and additional method that does perfect │ │ │ │ +220 // forwarding allows to workaround this. │ │ │ │ +221 ISTLVectorBackend::forwardToResize(c[i], sizeProvider, prefix); │ │ │ │ +222 }); │ │ │ │ +223 } │ │ │ │ +224 │ │ │ │ +225 template::value, int> = 0, │ │ │ │ +227 std::enable_if_t::value, int> = 0> │ │ │ │ +228 static void resize(C&&, const SizeProvider& sizeProvider, typename │ │ │ │ +SizeProvider::SizePrefix prefix) │ │ │ │ +229 { │ │ │ │ +230 auto size = sizeProvider.size(prefix); │ │ │ │ +231 if (size != 0) │ │ │ │ +232 DUNE_THROW(RangeError, "Can't resize scalar vector entry v[" << prefix << │ │ │ │ +"] to size(" << prefix << ")=" << size); │ │ │ │ +233 } │ │ │ │ +234 │ │ │ │ +235 template, int> = 0> │ │ │ │ +237 void recursiveAssign(C& c, const T& t) │ │ │ │ +238 { │ │ │ │ +239 c = t; │ │ │ │ +240 } │ │ │ │ +241 │ │ │ │ +242 template, int> = 0> │ │ │ │ +244 void recursiveAssign(C& c, const T& t) │ │ │ │ +245 { │ │ │ │ +246 Dune::Hybrid::forEach(c, [&](auto&& ci) { │ │ │ │ +247 recursiveAssign(ci, t); │ │ │ │ +248 }); │ │ │ │ +249 } │ │ │ │ +250 │ │ │ │ +251public: │ │ │ │ +252 │ │ │ │ +253 using Vector = V; │ │ │ │ +254 │ │ │ │ +255 ISTLVectorBackend(Vector& vector) : │ │ │ │ +256 vector_(&vector) │ │ │ │ +257 {} │ │ │ │ +258 │ │ │ │ +259 template │ │ │ │ +260 void resize(const SizeProvider& sizeProvider) │ │ │ │ +261 { │ │ │ │ +262 auto prefix = typename SizeProvider::SizePrefix(); │ │ │ │ +263 prefix.resize(0); │ │ │ │ +264 resize(*vector_, sizeProvider, prefix); │ │ │ │ +265 } │ │ │ │ +266 │ │ │ │ +267 template │ │ │ │ +268 decltype(auto) operator[](const MultiIndex& index) const │ │ │ │ +269 { │ │ │ │ +270 return _r_e_s_o_l_v_e_D_y_n_a_m_i_c_M_u_l_t_i_I_n_d_e_x(*vector_, index); │ │ │ │ +271 } │ │ │ │ +272 │ │ │ │ +273 template │ │ │ │ +274 decltype(auto) operator[](const MultiIndex& index) │ │ │ │ +275 { │ │ │ │ +276 return _r_e_s_o_l_v_e_D_y_n_a_m_i_c_M_u_l_t_i_I_n_d_e_x(*vector_, index); │ │ │ │ +277 } │ │ │ │ +278 │ │ │ │ +287 template │ │ │ │ +288 void operator= (const T& other) │ │ │ │ +289 { │ │ │ │ +290 recursiveAssign(vector(), other); │ │ │ │ +291 } │ │ │ │ +292 │ │ │ │ +293 template │ │ │ │ +294 void operator= (const ISTLVectorBackend& other) │ │ │ │ +295 { │ │ │ │ +296 vector() = other.vector(); │ │ │ │ +297 } │ │ │ │ +298 │ │ │ │ +299 const Vector& vector() const │ │ │ │ +300 { │ │ │ │ +301 return *vector_; │ │ │ │ +302 } │ │ │ │ +303 │ │ │ │ +304 Vector& vector() │ │ │ │ +305 { │ │ │ │ +306 return *vector_; │ │ │ │ +307 } │ │ │ │ +308 │ │ │ │ +309private: │ │ │ │ +310 │ │ │ │ +311 Vector* vector_; │ │ │ │ +312}; │ │ │ │ +313 │ │ │ │ +314} // end namespace Impl │ │ │ │ +315 │ │ │ │ +316 │ │ │ │ +317 │ │ │ │ +349template │ │ │ │ +_3_5_0auto _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(Vector& v) │ │ │ │ +351{ │ │ │ │ +352 static_assert(_h_a_s_U_n_i_q_u_e_F_i_e_l_d_T_y_p_e_<_V_e_c_t_o_r_&_>(), "Vector type passed to │ │ │ │ +istlVectorBackend() does not have a unique field type."); │ │ │ │ +353 return Impl::ISTLVectorBackend(v); │ │ │ │ +354} │ │ │ │ +355 │ │ │ │ +356 │ │ │ │ +357 │ │ │ │ +387template │ │ │ │ +_3_8_8auto _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(const Vector& v) │ │ │ │ +389{ │ │ │ │ +390 static_assert(_h_a_s_U_n_i_q_u_e_F_i_e_l_d_T_y_p_e_<_c_o_n_s_t_ _V_e_c_t_o_r_&_>(), "Vector type passed to │ │ │ │ +istlVectorBackend() does not have a unique field type."); │ │ │ │ +391 return Impl::ISTLVectorBackend(v); │ │ │ │ +392} │ │ │ │ +393 │ │ │ │ +394 │ │ │ │ +395 │ │ │ │ +396} // namespace Functions │ │ │ │ +397} // namespace Dune │ │ │ │ +398 │ │ │ │ +399 │ │ │ │ +400#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_ISTLVECTORBACKEND_HH │ │ │ │ +_i_n_d_e_x_a_c_c_e_s_s_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d │ │ │ │ +auto istlVectorBackend(Vector &v) │ │ │ │ +Return a vector backend wrapping non-const ISTL like containers. │ │ │ │ +DDeeffiinniittiioonn istlvectorbackend.hh:350 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_r_e_s_o_l_v_e_D_y_n_a_m_i_c_M_u_l_t_i_I_n_d_e_x │ │ │ │ +constexpr decltype(auto) resolveDynamicMultiIndex(C &&c, const MultiIndex │ │ │ │ +&multiIndex, const IsFinal &isFinal) │ │ │ │ +Provide multi-index access by chaining operator[]. │ │ │ │ +DDeeffiinniittiioonn indexaccess.hh:377 │ │ │ │ +_D_u_n_e │ │ │ │ +DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n │ │ │ │ -LFEPreBasisMixin(const GV &, const LFE &, MCMGLayout) -> LFEPreBasisMixin< GV, │ │ │ │ -LFE > │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n │ │ │ │ -LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout) │ │ │ │ -Construct from GridView and local DOF layout. │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:74 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n │ │ │ │ -A pre-basis mixin class parametrized with a local finite-element and a DOF │ │ │ │ -layout. │ │ │ │ -DDeeffiinniittiioonn lfeprebasismixin.hh:57 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n │ │ │ │ -LFEPreBasisMixin(const GridView &gv, LFE_ &&lfe, MCMGLayout layout) │ │ │ │ -Constructor for a given grid view object, local finite-element and layout. │ │ │ │ -DDeeffiinniittiioonn lfeprebasismixin.hh:86 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n │ │ │ │ -LFEPreBasisMixin(const GridView &gv, MCMGLayout layout) │ │ │ │ -Constructor for a given grid view object and layout. │ │ │ │ -DDeeffiinniittiioonn lfeprebasismixin.hh:75 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_:_:_m_a_k_e_N_o_d_e │ │ │ │ -Node makeNode() const │ │ │ │ -Create tree node. │ │ │ │ -DDeeffiinniittiioonn lfeprebasismixin.hh:92 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_<_ _G_V_,_ _L_a_g_r_a_n_g_e_S_i_m_p_l_e_x_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_< │ │ │ │ -_t_y_p_e_n_a_m_e_ _G_V_:_:_c_t_y_p_e_,_ _R_,_ _G_V_:_:_d_i_m_e_n_s_i_o_n_,_ _1_ _>_ _>_:_:_G_r_i_d_V_i_e_w │ │ │ │ -GV GridView │ │ │ │ -DDeeffiinniittiioonn lfeprebasismixin.hh:63 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_:_:_N_o_d_e_:_:_F_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ -LFE FiniteElement │ │ │ │ -DDeeffiinniittiioonn lfeprebasismixin.hh:126 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_:_:_N_o_d_e_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -DDeeffiinniittiioonn lfeprebasismixin.hh:124 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_:_:_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ -const FiniteElement & finiteElement() const │ │ │ │ -Return the LocalFiniteElement for the element we are bound to; might raise an │ │ │ │ -error if unbound. │ │ │ │ -DDeeffiinniittiioonn lfeprebasismixin.hh:146 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_:_:_N_o_d_e_:_:_e_l_e_m_e_n_t │ │ │ │ -const Element & element() const │ │ │ │ -Return current element; might raise an error if unbound. │ │ │ │ -DDeeffiinniittiioonn lfeprebasismixin.hh:135 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_:_:_N_o_d_e_:_:_l_f_e__ │ │ │ │ -const FiniteElement * lfe_ │ │ │ │ -DDeeffiinniittiioonn lfeprebasismixin.hh:160 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_:_:_N_o_d_e_:_:_b_i_n_d │ │ │ │ -void bind(const Element &e) │ │ │ │ -Bind to element. Stores a pointer to the passed element reference. │ │ │ │ -DDeeffiinniittiioonn lfeprebasismixin.hh:153 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_:_:_N_o_d_e_:_:_N_o_d_e │ │ │ │ -Node(const LFE &lfe) │ │ │ │ -Constructor; stores a pointer to the passed local finite-element lfe. │ │ │ │ -DDeeffiinniittiioonn lfeprebasismixin.hh:129 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_:_:_N_o_d_e_:_:_E_l_e_m_e_n_t │ │ │ │ -typename GV::template Codim< 0 >::Entity Element │ │ │ │ -DDeeffiinniittiioonn lfeprebasismixin.hh:125 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_:_:_N_o_d_e_:_:_e_l_e_m_e_n_t__ │ │ │ │ -const Element * element_ │ │ │ │ -DDeeffiinniittiioonn lfeprebasismixin.hh:161 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_e_t_S_i_z_e │ │ │ │ -void setSize(const size_type size) │ │ │ │ -DDeeffiinniittiioonn nodes.hh:197 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ -DDeeffiinniittiioonn nodes.hh:218 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_i_e_l_d_T_y_p_e_s │ │ │ │ +constexpr auto fieldTypes() │ │ │ │ +Generate list of field types in container. │ │ │ │ +DDeeffiinniittiioonn istlvectorbackend.hh:67 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_h_a_s_U_n_i_q_u_e_F_i_e_l_d_T_y_p_e │ │ │ │ +constexpr bool hasUniqueFieldType() │ │ │ │ +Check if container has a unique field type. │ │ │ │ +DDeeffiinniittiioonn istlvectorbackend.hh:78 │ │ │ │ +_c_o_n_c_e_p_t_s_._h_h │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _l_f_e_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h │ │ │ │ + * _b_a_c_k_e_n_d_s │ │ │ │ + * _i_s_t_l_v_e_c_t_o_r_b_a_c_k_e_n_d_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00125.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: leafprebasismappermixin.hh File Reference │ │ │ +Dune-Functions: containerfactory.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,51 +88,55 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
leafprebasismappermixin.hh File Reference
│ │ │ +
containerfactory.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <dune/common/rangeutilities.hh>
│ │ │ -#include <dune/functions/functionspacebases/leafprebasismixin.hh>
│ │ │ -#include <dune/geometry/referenceelements.hh>
│ │ │ -#include <dune/grid/common/mcmgmapper.hh>
│ │ │ +
#include <type_traits>
│ │ │ +#include <array>
│ │ │ +#include <vector>
│ │ │ +#include <dune/common/exceptions.hh>
│ │ │ +#include <dune/common/fvector.hh>
│ │ │ +#include <dune/common/indices.hh>
│ │ │ +#include <dune/common/tuplevector.hh>
│ │ │ +#include <dune/functions/functionspacebases/containerdescriptors.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ -

│ │ │ -Classes

class  Dune::Functions::LeafPreBasisMapperMixin< GV >
 A generic MixIn class for PreBasis with flat indices computed from a mapper. More...
│ │ │ │ │ │ │ │ │ │ │ │ + │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::ContainerDescriptors
│ │ │ │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Functions

template<class GridView, class LocalCoefficients>
auto Dune::Functions::subIndexRange (const Dune::MultipleCodimMultipleGeomTypeMapper< GridView > &mapper, const typename GridView::template Codim< 0 >::Entity &element, const LocalCoefficients &localCoefficients)
template<class T, class ContainerDescriptor>
auto Dune::Functions::makeContainer (const ContainerDescriptor &descriptor, const T &defaultValue)
 Construct a nested random access container compatible with the container descriptor.
template<class T, class ContainerDescriptor>
auto Dune::Functions::makeContainer (const ContainerDescriptor &descriptor)
 Construct a nested random access container compatible with the container descriptor.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,28 +1,33 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -leafprebasismappermixin.hh File Reference │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h> │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ +containerfactory.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ -CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_<_ _G_V_ _> │ │ │ │ -  A generic MixIn class for PreBasis with flat indices computed from a │ │ │ │ - mapper. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ +namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s │ │ │ │ FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_s_u_b_I_n_d_e_x_R_a_n_g_e (const Dune:: │ │ │ │ - MultipleCodimMultipleGeomTypeMapper< GridView > &mapper, const typename │ │ │ │ - GridView::template Codim< 0 >::Entity &element, const LocalCoefficients │ │ │ │ - &localCoefficients) │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_C_o_n_t_a_i_n_e_r (const ContainerDescriptor &descriptor, │ │ │ │ + const T &defaultValue) │ │ │ │ +  Construct a nested random access container compatible with the container │ │ │ │ + descriptor. │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_C_o_n_t_a_i_n_e_r (const ContainerDescriptor &descriptor) │ │ │ │ +  Construct a nested random access container compatible with the container │ │ │ │ + descriptor. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h │ │ │ │ + * _b_a_c_k_e_n_d_s │ │ │ │ + * _c_o_n_t_a_i_n_e_r_f_a_c_t_o_r_y_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00125.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,4 +1,4 @@ │ │ │ │ var a00125 = [ │ │ │ │ - ["Dune::Functions::LeafPreBasisMapperMixin< GV >", "a01942.html", "a01942"], │ │ │ │ - ["Dune::Functions::subIndexRange", "a00318.html#a0d9958433ba2e4925d415823112ba9fc", null] │ │ │ │ + ["Dune::Functions::makeContainer", "a00318.html#a5615eb8c95f13bfec2cac72f7f3ffcb7", null], │ │ │ │ + ["Dune::Functions::makeContainer", "a00318.html#ae0d46a565069f98abf5baea87e1ec3cb", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00125_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: leafprebasismappermixin.hh Source File │ │ │ +Dune-Functions: containerfactory.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,172 +88,144 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
leafprebasismappermixin.hh
│ │ │ +
containerfactory.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ -
3
│ │ │ -
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │ -
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │ -
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LEAFPREBASISMAPPERMIXIN_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LEAFPREBASISMAPPERMIXIN_HH
│ │ │ -
9
│ │ │ -
10#include <dune/common/rangeutilities.hh>
│ │ │ +
3// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │ +
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │ +
5#ifndef DUNE_FUNCTIONS_BACKENDS_CONTAINERFACTORY_HH
│ │ │ +
6#define DUNE_FUNCTIONS_BACKENDS_CONTAINERFACTORY_HH
│ │ │ +
7
│ │ │ +
8#include <type_traits>
│ │ │ +
9#include <array>
│ │ │ +
10#include <vector>
│ │ │
11
│ │ │ - │ │ │ -
13
│ │ │ -
14#include <dune/geometry/referenceelements.hh>
│ │ │ -
15
│ │ │ -
16#include <dune/grid/common/mcmgmapper.hh>
│ │ │ -
17
│ │ │ +
12#include <dune/common/exceptions.hh>
│ │ │ +
13#include <dune/common/fvector.hh>
│ │ │ +
14#include <dune/common/indices.hh>
│ │ │ +
15#include <dune/common/tuplevector.hh>
│ │ │ +
16
│ │ │ + │ │ │
18
│ │ │ -
19
│ │ │ -
20namespace Dune::Functions {
│ │ │ -
21
│ │ │ +
19namespace Dune::Functions {
│ │ │ +
│ │ │ + │ │ │ +
21namespace Impl {
│ │ │
22
│ │ │ -
23
│ │ │ -
24// Helper function returning a random access range
│ │ │ -
25// of global indices associated to the element. The ordering
│ │ │ -
26// is derived from the LocalCoefficients object.
│ │ │ -
27// Having this as a member of MCMGMapper would be nice.
│ │ │ -
28// But this would introduce the LocalCoefficient in dune-grid.
│ │ │ -
29// This would introduce at least a weak 'conceptual' dependency problem.
│ │ │ -
30template<class GridView, class LocalCoefficients>
│ │ │ -
│ │ │ -
31auto subIndexRange(const Dune::MultipleCodimMultipleGeomTypeMapper<GridView>& mapper, const typename GridView::template Codim<0>::Entity& element, const LocalCoefficients& localCoefficients)
│ │ │ -
32{
│ │ │ -
33 // Here we make use of the 'hidden' (poorly documented) MCMGMapper feature to support
│ │ │ -
34 // multiple DOFs per subentity. However, we do not take care for any reordering.
│ │ │ -
35 return Dune::transformedRangeView(Dune::range(localCoefficients.size()), [&](auto localIndex) {
│ │ │ -
36 auto localKey = localCoefficients.localKey(localIndex);
│ │ │ -
37 return mapper.subIndex(element, localKey.subEntity(), localKey.codim()) + localKey.index();
│ │ │ -
38 });
│ │ │ -
39}
│ │ │ -
│ │ │ -
40
│ │ │ -
41
│ │ │ -
42
│ │ │ -
59template<typename GV>
│ │ │ -
│ │ │ - │ │ │ -
61 : public LeafPreBasisMixin<LeafPreBasisMapperMixin<GV>>
│ │ │ -
62{
│ │ │ -
63 static const int gridDim = GV::dimension;
│ │ │ -
64
│ │ │ -
65public:
│ │ │ -
66
│ │ │ -
68 using GridView = GV;
│ │ │ -
69
│ │ │ -
71 using size_type = std::size_t;
│ │ │ -
72
│ │ │ -
│ │ │ -
74 LeafPreBasisMapperMixin(const GridView& gv, Dune::MCMGLayout layout) :
│ │ │ -
75 gridView_(gv),
│ │ │ -
76 mapper_(gridView_, std::move(layout))
│ │ │ -
77 {}
│ │ │ -
│ │ │ -
78
│ │ │ -
│ │ │ - │ │ │ -
81 {
│ │ │ -
82 // Determine upper bound for node size by traversing
│ │ │ -
83 // the layout for all element types in the grid
│ │ │ -
84 maxNodeSize_ = 0;
│ │ │ -
85 for(const GeometryType& elementType : gridView_.indexSet().types(0))
│ │ │ -
86 {
│ │ │ -
87 auto referenceElement = Dune::referenceElement<double, gridDim>(elementType);
│ │ │ -
88 for(auto codim : Dune::range(gridDim+1))
│ │ │ -
89 for(auto i : Dune::range(referenceElement.size(codim)))
│ │ │ -
90 maxNodeSize_ += mapper_.layout()(referenceElement.type(i, codim), gridDim);
│ │ │ -
91 }
│ │ │ -
92 }
│ │ │ -
│ │ │ -
93
│ │ │ -
│ │ │ -
95 const GridView& gridView() const
│ │ │ -
96 {
│ │ │ -
97 return gridView_;
│ │ │ -
98 }
│ │ │ -
│ │ │ -
99
│ │ │ -
│ │ │ -
101 void update(const GridView& gv)
│ │ │ -
102 {
│ │ │ -
103 gridView_ = gv;
│ │ │ -
104 mapper_.update(gridView_);
│ │ │ -
105 }
│ │ │ -
│ │ │ -
106
│ │ │ -
│ │ │ - │ │ │ -
109 {
│ │ │ -
110 return mapper_.size();
│ │ │ -
111 }
│ │ │ -
│ │ │ -
112
│ │ │ -
│ │ │ - │ │ │ -
115 {
│ │ │ -
116 return maxNodeSize_;
│ │ │ -
117 }
│ │ │ -
│ │ │ -
118
│ │ │ -
120 template<class Node, class It>
│ │ │ -
│ │ │ -
121 It indices(const Node& node, It it) const
│ │ │ -
122 {
│ │ │ -
123 for(const auto& globalIndex : subIndexRange(mapper_, node.element(), node.finiteElement().localCoefficients()))
│ │ │ -
124 {
│ │ │ -
125 *it = {{ (size_type)globalIndex }};
│ │ │ -
126 ++it;
│ │ │ -
127 }
│ │ │ -
128 return it;
│ │ │ -
129 }
│ │ │ -
│ │ │ -
130
│ │ │ -
131protected:
│ │ │ - │ │ │ -
133 Dune::MultipleCodimMultipleGeomTypeMapper<GridView> mapper_;
│ │ │ -
134 std::size_t maxNodeSize_;
│ │ │ -
135};
│ │ │ -
│ │ │ -
136
│ │ │ -
137
│ │ │ -
138
│ │ │ -
139} // end namespace Dune::Functions
│ │ │ -
140
│ │ │ -
141#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LEAFPREBASISMAPPERMIXIN_HH
│ │ │ - │ │ │ +
23template<class T>
│ │ │ +
24struct ContainerFactory
│ │ │ +
25{
│ │ │ +
26 void operator() (const Unknown& descriptor, const T& defaultValue) const
│ │ │ +
27 {
│ │ │ +
28 DUNE_THROW(Dune::NotImplemented, "Cannot create a vector. The container descriptor is unknown.");
│ │ │ +
29 }
│ │ │ +
30
│ │ │ +
31 template<class... ChildDescriptor>
│ │ │ +
32 auto operator() (const Tuple<ChildDescriptor...>& descriptor, const T& defaultValue) const
│ │ │ +
33 {
│ │ │ +
34 return unpackIntegerSequence([&](auto... ii) {
│ │ │ +
35 return Dune::TupleVector<decltype((*this)(descriptor[ii], defaultValue))...>{(*this)(descriptor[ii], defaultValue)...};
│ │ │ +
36 }, std::make_index_sequence<sizeof...(ChildDescriptor)>());
│ │ │ +
37 }
│ │ │ +
38
│ │ │ +
39 template<class ChildDescriptor, std::size_t n>
│ │ │ +
40 auto operator() (const Array<ChildDescriptor,n>& descriptor, const T& defaultValue) const
│ │ │ +
41 {
│ │ │ +
42 using ChildContainer = decltype((*this)(descriptor[0], defaultValue));
│ │ │ +
43 return unpackIntegerSequence([&](auto... ii) {
│ │ │ +
44 return std::array<ChildContainer, n>{(*this)(descriptor[ii], defaultValue)...};
│ │ │ +
45 }, std::make_index_sequence<n>());
│ │ │ +
46 }
│ │ │ +
47
│ │ │ +
48 template<class ChildDescriptor>
│ │ │ +
49 auto operator() (const Vector<ChildDescriptor>& descriptor, const T& defaultValue) const
│ │ │ +
50 {
│ │ │ +
51 using ChildContainer = decltype((*this)(descriptor[0], defaultValue));
│ │ │ +
52 auto result = std::vector<ChildContainer>();
│ │ │ +
53 result.reserve(descriptor.size());
│ │ │ +
54 for (std::size_t i = 0; i < descriptor.size(); ++i)
│ │ │ +
55 result.emplace_back((*this)(descriptor[i], defaultValue));
│ │ │ +
56 return result;
│ │ │ +
57 }
│ │ │ +
58
│ │ │ +
59 template<class ChildDescriptor, std::size_t n>
│ │ │ +
60 auto operator() (const UniformArray<ChildDescriptor,n>& descriptor, const T& defaultValue) const
│ │ │ +
61 {
│ │ │ +
62 using ChildContainer = decltype((*this)(descriptor[0], defaultValue));
│ │ │ +
63 auto childContainer = (*this)(descriptor[0], defaultValue);
│ │ │ +
64 return unpackIntegerSequence([&](auto... ii) {
│ │ │ +
65 return std::array<ChildContainer, n>{((void)(ii),childContainer)...};
│ │ │ +
66 }, std::make_index_sequence<n>());
│ │ │ +
67 }
│ │ │ +
68
│ │ │ +
69 template<class ChildDescriptor>
│ │ │ +
70 auto operator() (const UniformVector<ChildDescriptor>& descriptor, const T& defaultValue) const
│ │ │ +
71 {
│ │ │ +
72 using ChildContainer = decltype((*this)(descriptor[0], defaultValue));
│ │ │ +
73 auto childContainer = (*this)(descriptor[0], defaultValue);
│ │ │ +
74 return std::vector<ChildContainer>(descriptor.size(), childContainer);
│ │ │ +
75 }
│ │ │ +
76
│ │ │ +
77 // scalar types
│ │ │ +
78
│ │ │ +
79 auto operator() (const Value& descriptor, const T& defaultValue) const
│ │ │ +
80 {
│ │ │ +
81 return T(defaultValue);
│ │ │ +
82 }
│ │ │ +
83
│ │ │ +
84};
│ │ │ +
85
│ │ │ +
86} // end namespace Impl
│ │ │ +
87} // end namespace ContainerDescriptors
│ │ │ +
│ │ │ +
88
│ │ │ +
89
│ │ │ +
101template<class T, class ContainerDescriptor>
│ │ │ +
│ │ │ +
102auto makeContainer (const ContainerDescriptor& descriptor, const T& defaultValue)
│ │ │ +
103{
│ │ │ +
104 auto factory = ContainerDescriptors::Impl::ContainerFactory<T>{};
│ │ │ +
105 return factory(descriptor, defaultValue);
│ │ │ +
106}
│ │ │ +
│ │ │ +
107
│ │ │ +
118template<class T, class ContainerDescriptor>
│ │ │ +
│ │ │ +
119auto makeContainer (const ContainerDescriptor& descriptor)
│ │ │ +
120{
│ │ │ +
121 return makeContainer<T>(descriptor, T());
│ │ │ +
122}
│ │ │ +
│ │ │ +
123
│ │ │ +
124} // end namespace Dune::Functions
│ │ │ +
125
│ │ │ +
126#endif // DUNE_FUNCTIONS_BACKENDS_CONTAINERFACTORY_HH
│ │ │ +
Lightweight representation of (hierarchical) size and block structure extracted from a basis to descr...
│ │ │
Definition monomialset.hh:19
│ │ │ -
auto subIndexRange(const Dune::MultipleCodimMultipleGeomTypeMapper< GridView > &mapper, const typename GridView::template Codim< 0 >::Entity &element, const LocalCoefficients &localCoefficients)
Definition leafprebasismappermixin.hh:31
│ │ │ -
const GridView & gridView() const
Export the stored GridView.
Definition leafprebasismappermixin.hh:95
│ │ │ -
size_type dimension() const
Return total number of basis functions.
Definition leafprebasismappermixin.hh:108
│ │ │ -
std::size_t maxNodeSize_
Definition leafprebasismappermixin.hh:134
│ │ │ -
Dune::MultipleCodimMultipleGeomTypeMapper< GridView > mapper_
Definition leafprebasismappermixin.hh:133
│ │ │ -
std::size_t size_type
Type used for index digits.
Definition leafprebasismappermixin.hh:71
│ │ │ -
void update(const GridView &gv)
Update the stored GridView.
Definition leafprebasismappermixin.hh:101
│ │ │ -
LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout)
Construct from GridView and local DOF layout.
Definition leafprebasismappermixin.hh:74
│ │ │ -
GV GridView
Type of the associated GridView.
Definition leafprebasismappermixin.hh:68
│ │ │ -
size_type maxNodeSize() const
Return maximal number of basis functions per element.
Definition leafprebasismappermixin.hh:114
│ │ │ -
GridView gridView_
Definition leafprebasismappermixin.hh:132
│ │ │ -
void initializeIndices()
Initialize the global index information.
Definition leafprebasismappermixin.hh:80
│ │ │ -
It indices(const Node &node, It it) const
Fill cache with global indices of DOFs associated to the given bound node.
Definition leafprebasismappermixin.hh:121
│ │ │ -
A generic MixIn class for PreBasis.
Definition leafprebasismixin.hh:36
│ │ │ +
auto makeContainer(const ContainerDescriptor &descriptor, const T &defaultValue)
Construct a nested random access container compatible with the container descriptor.
Definition containerfactory.hh:102
│ │ │ +
Definition containerfactory.hh:20
│ │ │ +
Dune::TupleVector< Children... > Tuple
Descriptor with all children of possibly different type.
Definition containerdescriptors.hh:82
│ │ │ +
std::vector< Child > Vector
Descriptor for vectors with all children of the same type and dynamic size.
Definition containerdescriptors.hh:112
│ │ │ +
std::array< Child, n > Array
Descriptor for arrays with all children of the same type and static size.
Definition containerdescriptors.hh:98
│ │ │ +
Fallback container descriptor if nothing else fits.
Definition containerdescriptors.hh:52
│ │ │ +
The node in the descriptor tree representing a value placeholder.
Definition containerdescriptors.hh:71
│ │ │ +
Descriptor for arrays with all children identical and the number of children a static size.
Definition containerdescriptors.hh:117
│ │ │ +
Uniform descriptor with dynamic size.
Definition containerdescriptors.hh:156
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,193 +1,165 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -leafprebasismappermixin.hh │ │ │ │ +containerfactory.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ -3 │ │ │ │ -4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ +3// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ -5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ +4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ -6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LEAFPREBASISMAPPERMIXIN_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LEAFPREBASISMAPPERMIXIN_HH │ │ │ │ -9 │ │ │ │ -10#include │ │ │ │ +5#ifndef DUNE_FUNCTIONS_BACKENDS_CONTAINERFACTORY_HH │ │ │ │ +6#define DUNE_FUNCTIONS_BACKENDS_CONTAINERFACTORY_HH │ │ │ │ +7 │ │ │ │ +8#include │ │ │ │ +9#include │ │ │ │ +10#include │ │ │ │ 11 │ │ │ │ -12#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h> │ │ │ │ -13 │ │ │ │ -14#include │ │ │ │ -15 │ │ │ │ -16#include │ │ │ │ -17 │ │ │ │ +12#include │ │ │ │ +13#include │ │ │ │ +14#include │ │ │ │ +15#include │ │ │ │ +16 │ │ │ │ +17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h> │ │ │ │ 18 │ │ │ │ -19 │ │ │ │ -20namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ -21 │ │ │ │ +19namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ +_2_0namespace _C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s { │ │ │ │ +21namespace Impl { │ │ │ │ 22 │ │ │ │ -23 │ │ │ │ -24// Helper function returning a random access range │ │ │ │ -25// of global indices associated to the element. The ordering │ │ │ │ -26// is derived from the LocalCoefficients object. │ │ │ │ -27// Having this as a member of MCMGMapper would be nice. │ │ │ │ -28// But this would introduce the LocalCoefficient in dune-grid. │ │ │ │ -29// This would introduce at least a weak 'conceptual' dependency problem. │ │ │ │ -30template │ │ │ │ -_3_1auto _s_u_b_I_n_d_e_x_R_a_n_g_e(const Dune::MultipleCodimMultipleGeomTypeMapper& │ │ │ │ -mapper, const typename GridView::template Codim<0>::Entity& element, const │ │ │ │ -LocalCoefficients& localCoefficients) │ │ │ │ -32{ │ │ │ │ -33 // Here we make use of the 'hidden' (poorly documented) MCMGMapper feature │ │ │ │ -to support │ │ │ │ -34 // multiple DOFs per subentity. However, we do not take care for any │ │ │ │ -reordering. │ │ │ │ -35 return Dune::transformedRangeView(Dune::range(localCoefficients.size()), [&] │ │ │ │ -(auto localIndex) { │ │ │ │ -36 auto localKey = localCoefficients.localKey(localIndex); │ │ │ │ -37 return mapper.subIndex(element, localKey.subEntity(), localKey.codim()) + │ │ │ │ -localKey.index(); │ │ │ │ -38 }); │ │ │ │ -39} │ │ │ │ -40 │ │ │ │ -41 │ │ │ │ -42 │ │ │ │ -59template │ │ │ │ -_6_0class _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n │ │ │ │ -61 : public _L_e_a_f_P_r_e_B_a_s_i_s_M_i_x_i_n> │ │ │ │ -62{ │ │ │ │ -63 static const int gridDim = GV::dimension; │ │ │ │ -64 │ │ │ │ -65public: │ │ │ │ -66 │ │ │ │ -_6_8 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ -69 │ │ │ │ -_7_1 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ -72 │ │ │ │ -_7_4 _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n(const _G_r_i_d_V_i_e_w& gv, Dune::MCMGLayout layout) : │ │ │ │ -75 _g_r_i_d_V_i_e_w__(gv), │ │ │ │ -76 _m_a_p_p_e_r__(_g_r_i_d_V_i_e_w__, std::move(layout)) │ │ │ │ -77 {} │ │ │ │ +23template │ │ │ │ +24struct ContainerFactory │ │ │ │ +25{ │ │ │ │ +26 void operator() (const _U_n_k_n_o_w_n& descriptor, const T& defaultValue) const │ │ │ │ +27 { │ │ │ │ +28 DUNE_THROW(Dune::NotImplemented, "Cannot create a vector. The container │ │ │ │ +descriptor is unknown."); │ │ │ │ +29 } │ │ │ │ +30 │ │ │ │ +31 template │ │ │ │ +32 auto operator() (const _T_u_p_l_e_<_C_h_i_l_d_D_e_s_c_r_i_p_t_o_r_._._._>& descriptor, const T& │ │ │ │ +defaultValue) const │ │ │ │ +33 { │ │ │ │ +34 return unpackIntegerSequence([&](auto... ii) { │ │ │ │ +35 return Dune::TupleVector │ │ │ │ +{(*this)(descriptor[ii], defaultValue)...}; │ │ │ │ +36 }, std::make_index_sequence()); │ │ │ │ +37 } │ │ │ │ +38 │ │ │ │ +39 template │ │ │ │ +40 auto operator() (const _A_r_r_a_y_<_C_h_i_l_d_D_e_s_c_r_i_p_t_o_r_,_n_>& descriptor, const T& │ │ │ │ +defaultValue) const │ │ │ │ +41 { │ │ │ │ +42 using ChildContainer = decltype((*this)(descriptor[0], defaultValue)); │ │ │ │ +43 return unpackIntegerSequence([&](auto... ii) { │ │ │ │ +44 return std::array{(*this)(descriptor[ii], │ │ │ │ +defaultValue)...}; │ │ │ │ +45 }, std::make_index_sequence()); │ │ │ │ +46 } │ │ │ │ +47 │ │ │ │ +48 template │ │ │ │ +49 auto operator() (const _V_e_c_t_o_r_<_C_h_i_l_d_D_e_s_c_r_i_p_t_o_r_>& descriptor, const T& │ │ │ │ +defaultValue) const │ │ │ │ +50 { │ │ │ │ +51 using ChildContainer = decltype((*this)(descriptor[0], defaultValue)); │ │ │ │ +52 auto result = std::vector(); │ │ │ │ +53 result.reserve(descriptor.size()); │ │ │ │ +54 for (std::size_t i = 0; i < descriptor.size(); ++i) │ │ │ │ +55 result.emplace_back((*this)(descriptor[i], defaultValue)); │ │ │ │ +56 return result; │ │ │ │ +57 } │ │ │ │ +58 │ │ │ │ +59 template │ │ │ │ +60 auto operator() (const _U_n_i_f_o_r_m_A_r_r_a_y_<_C_h_i_l_d_D_e_s_c_r_i_p_t_o_r_,_n_>& descriptor, const T& │ │ │ │ +defaultValue) const │ │ │ │ +61 { │ │ │ │ +62 using ChildContainer = decltype((*this)(descriptor[0], defaultValue)); │ │ │ │ +63 auto childContainer = (*this)(descriptor[0], defaultValue); │ │ │ │ +64 return unpackIntegerSequence([&](auto... ii) { │ │ │ │ +65 return std::array{((void)(ii),childContainer)...}; │ │ │ │ +66 }, std::make_index_sequence()); │ │ │ │ +67 } │ │ │ │ +68 │ │ │ │ +69 template │ │ │ │ +70 auto operator() (const _U_n_i_f_o_r_m_V_e_c_t_o_r_<_C_h_i_l_d_D_e_s_c_r_i_p_t_o_r_>& descriptor, const T& │ │ │ │ +defaultValue) const │ │ │ │ +71 { │ │ │ │ +72 using ChildContainer = decltype((*this)(descriptor[0], defaultValue)); │ │ │ │ +73 auto childContainer = (*this)(descriptor[0], defaultValue); │ │ │ │ +74 return std::vector(descriptor.size(), childContainer); │ │ │ │ +75 } │ │ │ │ +76 │ │ │ │ +77 // scalar types │ │ │ │ 78 │ │ │ │ -_8_0 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ -81 { │ │ │ │ -82 // Determine upper bound for node size by traversing │ │ │ │ -83 // the layout for all element types in the grid │ │ │ │ -84 _m_a_x_N_o_d_e_S_i_z_e__ = 0; │ │ │ │ -85 for(const GeometryType& elementType : _g_r_i_d_V_i_e_w__.indexSet().types(0)) │ │ │ │ -86 { │ │ │ │ -87 auto referenceElement = Dune::referenceElement │ │ │ │ -(elementType); │ │ │ │ -88 for(auto codim : Dune::range(gridDim+1)) │ │ │ │ -89 for(auto i : Dune::range(referenceElement.size(codim))) │ │ │ │ -90 _m_a_x_N_o_d_e_S_i_z_e__ += _m_a_p_p_e_r__.layout()(referenceElement.type(i, codim), gridDim); │ │ │ │ -91 } │ │ │ │ -92 } │ │ │ │ -93 │ │ │ │ -_9_5 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ -96 { │ │ │ │ -97 return _g_r_i_d_V_i_e_w__; │ │ │ │ -98 } │ │ │ │ -99 │ │ │ │ -_1_0_1 void _u_p_d_a_t_e(const _G_r_i_d_V_i_e_w& gv) │ │ │ │ -102 { │ │ │ │ -103 _g_r_i_d_V_i_e_w__ = gv; │ │ │ │ -104 _m_a_p_p_e_r__.update(_g_r_i_d_V_i_e_w__); │ │ │ │ -105 } │ │ │ │ -106 │ │ │ │ -_1_0_8 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ -109 { │ │ │ │ -110 return _m_a_p_p_e_r__.size(); │ │ │ │ -111 } │ │ │ │ -112 │ │ │ │ -_1_1_4 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ -115 { │ │ │ │ -116 return _m_a_x_N_o_d_e_S_i_z_e__; │ │ │ │ -117 } │ │ │ │ -118 │ │ │ │ -120 template │ │ │ │ -_1_2_1 It _i_n_d_i_c_e_s(const Node& node, It it) const │ │ │ │ -122 { │ │ │ │ -123 for(const auto& globalIndex : _s_u_b_I_n_d_e_x_R_a_n_g_e(_m_a_p_p_e_r__, node.element(), │ │ │ │ -node.finiteElement().localCoefficients())) │ │ │ │ -124 { │ │ │ │ -125 *it = {{ (_s_i_z_e___t_y_p_e)globalIndex }}; │ │ │ │ -126 ++it; │ │ │ │ -127 } │ │ │ │ -128 return it; │ │ │ │ -129 } │ │ │ │ -130 │ │ │ │ -131protected: │ │ │ │ -_1_3_2 _G_r_i_d_V_i_e_w _g_r_i_d_V_i_e_w__; │ │ │ │ -_1_3_3 Dune::MultipleCodimMultipleGeomTypeMapper _m_a_p_p_e_r__; │ │ │ │ -_1_3_4 std::size_t _m_a_x_N_o_d_e_S_i_z_e__; │ │ │ │ -135}; │ │ │ │ -136 │ │ │ │ -137 │ │ │ │ -138 │ │ │ │ -139} // end namespace Dune::Functions │ │ │ │ -140 │ │ │ │ -141#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LEAFPREBASISMAPPERMIXIN_HH │ │ │ │ -_l_e_a_f_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h │ │ │ │ +79 auto operator() (const _V_a_l_u_e& descriptor, const T& defaultValue) const │ │ │ │ +80 { │ │ │ │ +81 return T(defaultValue); │ │ │ │ +82 } │ │ │ │ +83 │ │ │ │ +84}; │ │ │ │ +85 │ │ │ │ +86} // end namespace Impl │ │ │ │ +87} // end namespace ContainerDescriptors │ │ │ │ +88 │ │ │ │ +89 │ │ │ │ +101template │ │ │ │ +_1_0_2auto _m_a_k_e_C_o_n_t_a_i_n_e_r (const ContainerDescriptor& descriptor, const T& │ │ │ │ +defaultValue) │ │ │ │ +103{ │ │ │ │ +104 auto factory = ContainerDescriptors::Impl::ContainerFactory{}; │ │ │ │ +105 return factory(descriptor, defaultValue); │ │ │ │ +106} │ │ │ │ +107 │ │ │ │ +118template │ │ │ │ +_1_1_9auto _m_a_k_e_C_o_n_t_a_i_n_e_r (const ContainerDescriptor& descriptor) │ │ │ │ +120{ │ │ │ │ +121 return _m_a_k_e_C_o_n_t_a_i_n_e_r_<_T_>(descriptor, T()); │ │ │ │ +122} │ │ │ │ +123 │ │ │ │ +124} // end namespace Dune::Functions │ │ │ │ +125 │ │ │ │ +126#endif // DUNE_FUNCTIONS_BACKENDS_CONTAINERFACTORY_HH │ │ │ │ +_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h │ │ │ │ +Lightweight representation of (hierarchical) size and block structure extracted │ │ │ │ +from a basis to descr... │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_s_u_b_I_n_d_e_x_R_a_n_g_e │ │ │ │ -auto subIndexRange(const Dune::MultipleCodimMultipleGeomTypeMapper< GridView > │ │ │ │ -&mapper, const typename GridView::template Codim< 0 >::Entity &element, const │ │ │ │ -LocalCoefficients &localCoefficients) │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:31 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_g_r_i_d_V_i_e_w │ │ │ │ -const GridView & gridView() const │ │ │ │ -Export the stored GridView. │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:95 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ -size_type dimension() const │ │ │ │ -Return total number of basis functions. │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:108 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_m_a_x_N_o_d_e_S_i_z_e__ │ │ │ │ -std::size_t maxNodeSize_ │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:134 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_m_a_p_p_e_r__ │ │ │ │ -Dune::MultipleCodimMultipleGeomTypeMapper< GridView > mapper_ │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:133 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -Type used for index digits. │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:71 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_u_p_d_a_t_e │ │ │ │ -void update(const GridView &gv) │ │ │ │ -Update the stored GridView. │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:101 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n │ │ │ │ -LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout) │ │ │ │ -Construct from GridView and local DOF layout. │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:74 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_G_r_i_d_V_i_e_w │ │ │ │ -GV GridView │ │ │ │ -Type of the associated GridView. │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:68 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_m_a_x_N_o_d_e_S_i_z_e │ │ │ │ -size_type maxNodeSize() const │ │ │ │ -Return maximal number of basis functions per element. │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:114 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_g_r_i_d_V_i_e_w__ │ │ │ │ -GridView gridView_ │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:132 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ -void initializeIndices() │ │ │ │ -Initialize the global index information. │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:80 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_i_n_d_i_c_e_s │ │ │ │ -It indices(const Node &node, It it) const │ │ │ │ -Fill cache with global indices of DOFs associated to the given bound node. │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:121 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_i_x_i_n │ │ │ │ -A generic MixIn class for PreBasis. │ │ │ │ -DDeeffiinniittiioonn leafprebasismixin.hh:36 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_C_o_n_t_a_i_n_e_r │ │ │ │ +auto makeContainer(const ContainerDescriptor &descriptor, const T │ │ │ │ +&defaultValue) │ │ │ │ +Construct a nested random access container compatible with the container │ │ │ │ +descriptor. │ │ │ │ +DDeeffiinniittiioonn containerfactory.hh:102 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s │ │ │ │ +DDeeffiinniittiioonn containerfactory.hh:20 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_T_u_p_l_e │ │ │ │ +Dune::TupleVector< Children... > Tuple │ │ │ │ +Descriptor with all children of possibly different type. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:82 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_V_e_c_t_o_r │ │ │ │ +std::vector< Child > Vector │ │ │ │ +Descriptor for vectors with all children of the same type and dynamic size. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:112 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_A_r_r_a_y │ │ │ │ +std::array< Child, n > Array │ │ │ │ +Descriptor for arrays with all children of the same type and static size. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:98 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_k_n_o_w_n │ │ │ │ +Fallback container descriptor if nothing else fits. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:52 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_V_a_l_u_e │ │ │ │ +The node in the descriptor tree representing a value placeholder. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:71 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_i_f_o_r_m_A_r_r_a_y │ │ │ │ +Descriptor for arrays with all children identical and the number of children a │ │ │ │ +static size. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:117 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_i_f_o_r_m_V_e_c_t_o_r │ │ │ │ +Uniform descriptor with dynamic size. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:156 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h │ │ │ │ + * _b_a_c_k_e_n_d_s │ │ │ │ + * _c_o_n_t_a_i_n_e_r_f_a_c_t_o_r_y_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00128.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: lagrangedgbasis.hh File Reference │ │ │ +Dune-Functions: istlvectorfactory.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,66 +88,51 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
lagrangedgbasis.hh File Reference
│ │ │ +
istlvectorfactory.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <dune/common/exceptions.hh>
│ │ │ -#include <dune/common/math.hh>
│ │ │ -#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ -#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │ -#include <dune/functions/functionspacebases/lagrangebasis.hh>
│ │ │ -#include <dune/functions/functionspacebases/leafprebasismappermixin.hh>
│ │ │ +
#include <type_traits>
│ │ │ +#include <dune/common/exceptions.hh>
│ │ │ +#include <dune/common/fvector.hh>
│ │ │ +#include <dune/common/indices.hh>
│ │ │ +#include <dune/functions/functionspacebases/containerdescriptors.hh>
│ │ │ +#include <dune/istl/bvector.hh>
│ │ │ +#include <dune/istl/multitypeblockvector.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ -

│ │ │ -Classes

class  Dune::Functions::LagrangeDGPreBasis< GV, k, R >
 PreBasis implementation for a Lagrangean-DG finite element space. More...
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ -

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::BasisFactory
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │

│ │ │ -Typedefs

template<typename GV, int k, typename R = double>
using Dune::Functions::LagrangeDGNode = LagrangeNode<GV, k, R>
template<typename GV, int k = -1, typename R = double>
using Dune::Functions::LagrangeDGBasis = DefaultGlobalBasis<LagrangeDGPreBasis<GV, k, R> >
 Basis of a scalar k-th-order Lagrangean-DG finite element space.
namespace  Dune::Functions::ContainerDescriptors
│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Functions

template<std::size_t order, typename R = double>
auto Dune::Functions::BasisFactory::lagrangeDG ()
 Create a pre-basis factory that can create a LagrangeDG pre-basis.
template<typename R = double>
auto Dune::Functions::BasisFactory::lagrangeDG (unsigned int order)
 Create a pre-basis factory that can create a LagrangeDG pre-basis.
template<class T = double, class ContainerDescriptor>
auto Dune::Functions::makeISTLVector (const ContainerDescriptor &tree)
 Construct an istl vector type compatible with the container descriptor.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,39 +1,26 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -lagrangedgbasis.hh File Reference │ │ │ │ +istlvectorfactory.hh File Reference │ │ │ │ +#include │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_a_g_r_a_n_g_e_b_a_s_i_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h> │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h> │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ -CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s_<_ _G_V_,_ _k_,_ _R_ _> │ │ │ │ -  PreBasis implementation for a Lagrangean-DG finite element space. │ │ │ │ - _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -TTyyppeeddeeffss │ │ │ │ -template │ │ │ │ -using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_D_G_N_o_d_e = _L_a_g_r_a_n_g_e_N_o_d_e │ │ │ │ -template │ │ │ │ -using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_D_G_B_a_s_i_s = │ │ │ │ - _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s<_L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s > │ │ │ │ -  Basis of a scalar k-th-order Lagrangean-DG finite element space. │ │ │ │ +namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s │ │ │ │ FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_l_a_g_r_a_n_g_e_D_G () │ │ │ │ -  Create a pre-basis factory that can create a LagrangeDG pre-basis. │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_l_a_g_r_a_n_g_e_D_G (unsigned int order) │ │ │ │ -  Create a pre-basis factory that can create a LagrangeDG pre-basis. │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_I_S_T_L_V_e_c_t_o_r (const ContainerDescriptor &tree) │ │ │ │ +  Construct an istl vector type compatible with the container descriptor. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _l_a_g_r_a_n_g_e_d_g_b_a_s_i_s_._h_h │ │ │ │ + * _b_a_c_k_e_n_d_s │ │ │ │ + * _i_s_t_l_v_e_c_t_o_r_f_a_c_t_o_r_y_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00128.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,6 +1,3 @@ │ │ │ │ var a00128 = [ │ │ │ │ - ["Dune::Functions::LagrangeDGBasis", "a00312.html#gad2b4404cb87483db843459e8f120e44d", null], │ │ │ │ - ["Dune::Functions::LagrangeDGNode", "a00318.html#a27276910e0d1b3e7e58b3ae40a419948", null], │ │ │ │ - ["Dune::Functions::BasisFactory::lagrangeDG", "a00312.html#ga383b7a1202716e3773acab3642350df3", null], │ │ │ │ - ["Dune::Functions::BasisFactory::lagrangeDG", "a00312.html#ga7ffaa3ab4154ac5d06ae9dc76695cb42", null] │ │ │ │ + ["Dune::Functions::makeISTLVector", "a00318.html#ab0a758fb42acff3284a5e8e20f73f1ee", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00128_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: lagrangedgbasis.hh Source File │ │ │ +Dune-Functions: istlvectorfactory.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,237 +88,162 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
lagrangedgbasis.hh
│ │ │ +
istlvectorfactory.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ -
3
│ │ │ -
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │ -
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │ -
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH
│ │ │ +
3// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │ +
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │ +
5#ifndef DUNE_FUNCTIONS_BACKENDS_ISTL_VECTORFACTORY_HH
│ │ │ +
6#define DUNE_FUNCTIONS_BACKENDS_ISTL_VECTORFACTORY_HH
│ │ │ +
7
│ │ │ +
8#include <type_traits>
│ │ │
9
│ │ │
10#include <dune/common/exceptions.hh>
│ │ │ -
11#include <dune/common/math.hh>
│ │ │ -
12
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
17
│ │ │ +
11#include <dune/common/fvector.hh>
│ │ │ +
12#include <dune/common/indices.hh>
│ │ │ +
13
│ │ │ + │ │ │ +
15
│ │ │ +
16#include <dune/istl/bvector.hh>
│ │ │ +
17#include <dune/istl/multitypeblockvector.hh>
│ │ │
18
│ │ │ -
19
│ │ │ -
20
│ │ │ -
21namespace Dune {
│ │ │ -
22namespace Functions {
│ │ │ -
23
│ │ │ -
24
│ │ │ -
25
│ │ │ -
26// *****************************************************************************
│ │ │ -
27// This is the reusable part of the basis. It contains
│ │ │ -
28//
│ │ │ -
29// LagrangeDGPreBasis
│ │ │ -
30// LagrangeDGNode
│ │ │ -
31//
│ │ │ -
32// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ -
33// state. These components do _not_ depend on the global basis and local view
│ │ │ -
34// and can be used without a global basis.
│ │ │ -
35// *****************************************************************************
│ │ │ -
36
│ │ │ -
37template<typename GV, int k, typename R=double>
│ │ │ - │ │ │ -
39
│ │ │ -
48template<typename GV, int k, typename R=double>
│ │ │ -
│ │ │ - │ │ │ - │ │ │ -
51{
│ │ │ - │ │ │ -
53
│ │ │ -
54 static constexpr bool useDynamicOrder = (k<0);
│ │ │ -
55
│ │ │ -
56 static MCMGLayout dofLayout(int order)
│ │ │ -
57 {
│ │ │ -
58 return [order](Dune::GeometryType type, size_t dimGrid) {
│ │ │ -
59 if (type.dim() == dimGrid)
│ │ │ -
60 {
│ │ │ -
61 if (type.isLine())
│ │ │ -
62 return order+1;
│ │ │ -
63 if (type.isTriangle())
│ │ │ -
64 return (order+1)*(order+2)/2;
│ │ │ -
65 if (type.isQuadrilateral())
│ │ │ -
66 return (order+1)*(order+1);
│ │ │ -
67 if (type.isTetrahedron())
│ │ │ -
68 return (order+1)*(order+2)*(order+3)/6;
│ │ │ -
69 if (type.isPrism())
│ │ │ -
70 return (order+1)*(order+1)*(order+2)/2;
│ │ │ -
71 if (type.isHexahedron())
│ │ │ -
72 return (order+1)*(order+1)*(order+1);
│ │ │ -
73 if (type.isPyramid())
│ │ │ -
74 return (order+1)*(order+2)*(2*order+3)/6;
│ │ │ -
75 DUNE_THROW(Dune::NotImplemented, "Using LagrangeDGPreBasis with non-supported GeometryType");
│ │ │ -
76 }
│ │ │ -
77 return 0;
│ │ │ -
78 };
│ │ │ -
79 }
│ │ │ -
80
│ │ │ -
81public:
│ │ │ -
82
│ │ │ -
84 using GridView = GV;
│ │ │ -
85 using size_type = typename Base::size_type;
│ │ │ -
86
│ │ │ -
87 // Precompute the number of dofs per entity type
│ │ │ -
88 [[deprecated("This constant will be removed after Dune 2.11")]] const static int dofsPerEdge = k+1;
│ │ │ -
89 [[deprecated("This constant will be removed after Dune 2.11")]] const static int dofsPerTriangle = (k+1)*(k+2)/2;
│ │ │ -
90 [[deprecated("This constant will be removed after Dune 2.11")]] const static int dofsPerQuad = (k+1)*(k+1);
│ │ │ -
91 [[deprecated("This constant will be removed after Dune 2.11")]] const static int dofsPerTetrahedron = (k+1)*(k+2)*(k+3)/6;
│ │ │ -
92 [[deprecated("This constant will be removed after Dune 2.11")]] const static int dofsPerPrism = (k+1)*(k+1)*(k+2)/2;
│ │ │ -
93 [[deprecated("This constant will be removed after Dune 2.11")]] const static int dofsPerHexahedron = (k+1)*(k+1)*(k+1);
│ │ │ -
94 [[deprecated("This constant will be removed after Dune 2.11")]] const static int dofsPerPyramid = (k+1)*(k+2)*(2*k+3)/6;
│ │ │ -
95
│ │ │ - │ │ │ -
97
│ │ │ -
│ │ │ - │ │ │ -
105 requires(k>=0)
│ │ │ -
106 : Base(gv, dofLayout(k))
│ │ │ -
107 , order_(k)
│ │ │ -
108 {}
│ │ │ -
│ │ │ -
109
│ │ │ -
│ │ │ -
116 LagrangeDGPreBasis(const GridView& gv, unsigned int order)
│ │ │ -
117 requires(k<0)
│ │ │ -
118 : Base(gv, dofLayout(order))
│ │ │ -
119 , order_(order)
│ │ │ -
120 {}
│ │ │ -
│ │ │ +
19namespace Dune::Functions {
│ │ │ +
20namespace ContainerDescriptors {
│ │ │ +
21namespace Impl {
│ │ │ +
22
│ │ │ +
23template<class T>
│ │ │ +
24struct ISTLVectorFactory
│ │ │ +
25{
│ │ │ +
26 void operator() (const Unknown& tree) const
│ │ │ +
27 {
│ │ │ +
28 DUNE_THROW(Dune::NotImplemented, "Cannot create a vector. The container descriptor is unknown.");
│ │ │ +
29 }
│ │ │ +
30
│ │ │ +
31 template<class... V>
│ │ │ +
32 auto operator() (const Tuple<V...>& tree) const
│ │ │ +
33 {
│ │ │ +
34 return unpackIntegerSequence([&](auto... ii) {
│ │ │ +
35 return Dune::MultiTypeBlockVector<decltype((*this)(tree[ii]))...>{(*this)(tree[ii])...};
│ │ │ +
36 }, std::make_index_sequence<sizeof...(V)>());
│ │ │ +
37 }
│ │ │ +
38
│ │ │ +
39 template<class V, std::size_t n>
│ │ │ +
40 auto operator() (const Array<V,n>& tree) const
│ │ │ +
41 {
│ │ │ +
42 return unpackIntegerSequence([&](auto... ii) {
│ │ │ +
43 return Dune::BlockVector{(*this)(tree[ii])...};
│ │ │ +
44 }, std::make_index_sequence<n>());
│ │ │ +
45 }
│ │ │ +
46
│ │ │ +
47 template<class V>
│ │ │ +
48 auto operator() (const Vector<V>& tree) const
│ │ │ +
49 {
│ │ │ +
50 using W = decltype((*this)(tree[0]));
│ │ │ +
51 Dune::BlockVector<W> result(tree.size());
│ │ │ +
52 for (std::size_t i = 0; i < tree.size(); ++i)
│ │ │ +
53 result[i] = (*this)(tree[i]);
│ │ │ +
54 return result;
│ │ │ +
55 }
│ │ │ +
56
│ │ │ +
57 template<class V, std::size_t n>
│ │ │ +
58 auto operator() (const UniformArray<V,n>& tree) const
│ │ │ +
59 {
│ │ │ +
60 auto node = (*this)(tree[0]);
│ │ │ +
61 return unpackIntegerSequence([&](auto... ii) {
│ │ │ +
62 return Dune::BlockVector{((void)(ii),node)...};
│ │ │ +
63 }, std::make_index_sequence<n>());
│ │ │ +
64 }
│ │ │ +
65
│ │ │ +
66 template<class V>
│ │ │ +
67 auto operator() (const UniformVector<V>& tree) const
│ │ │ +
68 {
│ │ │ +
69 auto node = (*this)(tree[0]);
│ │ │ +
70 using W = decltype(node);
│ │ │ +
71 Dune::BlockVector<W> result(tree.size());
│ │ │ +
72 for (std::size_t i = 0; i < tree.size(); ++i)
│ │ │ +
73 result[i] = node;
│ │ │ +
74 return result;
│ │ │ +
75 }
│ │ │ +
76
│ │ │ +
77 // scalar types
│ │ │ +
78
│ │ │ +
79 auto operator() (const Value& tree) const
│ │ │ +
80 {
│ │ │ +
81 return T(0);
│ │ │ +
82 }
│ │ │ +
83
│ │ │ +
84 // flat vectors
│ │ │ +
85
│ │ │ +
86 template<std::size_t n>
│ │ │ +
87 auto operator() (const UniformArray<Value,n>& tree) const
│ │ │ +
88 {
│ │ │ +
89 return Dune::FieldVector<T,n>(0);
│ │ │ +
90 }
│ │ │ +
91
│ │ │ +
92 auto operator() (const UniformVector<Value>& tree) const
│ │ │ +
93 {
│ │ │ +
94 return Dune::BlockVector<T>(tree.size());
│ │ │ +
95 }
│ │ │ +
96
│ │ │ +
97 // block vectors
│ │ │ +
98
│ │ │ +
99 template<std::size_t n>
│ │ │ +
100 auto operator() (const UniformVector<UniformArray<Value,n>>& tree) const
│ │ │ +
101 {
│ │ │ +
102 return Dune::BlockVector<Dune::FieldVector<T,n>>(tree.size());
│ │ │ +
103 }
│ │ │ +
104
│ │ │ +
105 template<std::size_t n>
│ │ │ +
106 auto operator() (const Vector<UniformArray<Value,n>>& tree) const
│ │ │ +
107 {
│ │ │ +
108 return Dune::BlockVector<Dune::FieldVector<T,n>>(tree.size());
│ │ │ +
109 }
│ │ │ +
110
│ │ │ +
111 template<std::size_t n, std::size_t m>
│ │ │ +
112 auto operator() (const Array<UniformArray<Value,n>,m>& tree) const
│ │ │ +
113 {
│ │ │ +
114 return Dune::BlockVector<Dune::FieldVector<T,n>>(m);
│ │ │ +
115 }
│ │ │ +
116};
│ │ │ +
117
│ │ │ +
118} // end namespace Impl
│ │ │ +
119} // end namespace ContainerDescriptors
│ │ │ +
120
│ │ │
121
│ │ │ -
│ │ │ - │ │ │ -
126 {
│ │ │ -
127 return Node{order_};
│ │ │ -
128 }
│ │ │ -
│ │ │ -
129
│ │ │ -
130 template<class Node, class It>
│ │ │ +
130template<class T = double, class ContainerDescriptor>
│ │ │
│ │ │ -
131 It indices(const Node& node, It it) const
│ │ │ -
132 {
│ │ │ -
133 size_type elementOffset = Base::mapper_.index(node.element());
│ │ │ -
134 for(auto i : Dune::range(node.size()))
│ │ │ -
135 {
│ │ │ -
136 *it = {{ (size_type)(elementOffset+i) }};
│ │ │ -
137 ++it;
│ │ │ -
138 }
│ │ │ -
139 return it;
│ │ │ -
140 }
│ │ │ -
│ │ │ -
141
│ │ │ -
│ │ │ -
143 unsigned int order() const
│ │ │ -
144 {
│ │ │ -
145 return (useDynamicOrder) ? order_ : k;
│ │ │ -
146 }
│ │ │ -
│ │ │ -
147
│ │ │ -
148protected:
│ │ │ -
149
│ │ │ -
150 unsigned int order_;
│ │ │ -
151};
│ │ │ -
│ │ │ -
152
│ │ │ -
153
│ │ │ -
154
│ │ │ -
155namespace BasisFactory {
│ │ │ -
156
│ │ │ -
165template<std::size_t order, typename R=double>
│ │ │ -
│ │ │ - │ │ │ -
167{
│ │ │ -
168 return [](const auto& gridView) {
│ │ │ -
169 return LagrangeDGPreBasis<std::decay_t<decltype(gridView)>, order, R>(gridView);
│ │ │ -
170 };
│ │ │ -
171}
│ │ │ -
│ │ │ -
172
│ │ │ -
181template<typename R=double>
│ │ │ -
│ │ │ -
182auto lagrangeDG(unsigned int order)
│ │ │ -
183{
│ │ │ -
184 return [order](const auto& gridView) {
│ │ │ -
185 return LagrangeDGPreBasis<std::decay_t<decltype(gridView)>, -1, R>(gridView, order);
│ │ │ -
186 };
│ │ │ -
187}
│ │ │ -
│ │ │ -
188
│ │ │ -
189} // end namespace BasisFactory
│ │ │ -
190
│ │ │ -
191
│ │ │ -
192
│ │ │ -
193// *****************************************************************************
│ │ │ -
194// This is the actual global basis implementation based on the reusable parts.
│ │ │ -
195// *****************************************************************************
│ │ │ -
196
│ │ │ -
205template<typename GV, int k=-1, typename R=double>
│ │ │ - │ │ │ -
207
│ │ │ -
208
│ │ │ -
209
│ │ │ -
210} // end namespace Functions
│ │ │ -
211} // end namespace Dune
│ │ │ -
212
│ │ │ -
213
│ │ │ -
214#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
auto lagrangeDG()
Create a pre-basis factory that can create a LagrangeDG pre-basis.
Definition lagrangedgbasis.hh:166
│ │ │ -
DefaultGlobalBasis< LagrangeDGPreBasis< GV, k, R > > LagrangeDGBasis
Basis of a scalar k-th-order Lagrangean-DG finite element space.
Definition lagrangedgbasis.hh:206
│ │ │ -
Definition monomialset.hh:19
│ │ │ +
131auto makeISTLVector (const ContainerDescriptor& tree)
│ │ │ +
132{
│ │ │ +
133 auto factory = ContainerDescriptors::Impl::ISTLVectorFactory<T>{};
│ │ │ +
134 return factory(tree);
│ │ │ +
135}
│ │ │ +
│ │ │ +
136
│ │ │ +
137} // end namespace Dune::Functions
│ │ │ +
138
│ │ │ +
139#endif // DUNE_FUNCTIONS_BACKENDS_ISTL_VECTORFACTORY_HH
│ │ │ +
Lightweight representation of (hierarchical) size and block structure extracted from a basis to descr...
│ │ │
Definition monomialset.hh:19
│ │ │ -
LagrangeNode< GV, k, R > LagrangeDGNode
Definition lagrangedgbasis.hh:38
│ │ │ -
Definition argyrisbasis.hh:926
│ │ │ -
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:53
│ │ │ -
Definition lagrangebasis.hh:379
│ │ │ -
const Element & element() const
Return current element, throw if unbound.
Definition lagrangebasis.hh:427
│ │ │ -
PreBasis implementation for a Lagrangean-DG finite element space.
Definition lagrangedgbasis.hh:51
│ │ │ -
Node makeNode() const
Create tree node.
Definition lagrangedgbasis.hh:125
│ │ │ -
LagrangeDGPreBasis(const GridView &gv, unsigned int order)
Constructor for a given grid view object.
Definition lagrangedgbasis.hh:116
│ │ │ -
static const int dofsPerPrism
Definition lagrangedgbasis.hh:92
│ │ │ -
LagrangeDGNode< GV, k, R > Node
Definition lagrangedgbasis.hh:96
│ │ │ -
static const int dofsPerQuad
Definition lagrangedgbasis.hh:90
│ │ │ -
static const int dofsPerTriangle
Definition lagrangedgbasis.hh:89
│ │ │ -
typename Base::size_type size_type
Definition lagrangedgbasis.hh:85
│ │ │ -
unsigned int order() const
Polynomial order used in the local Lagrange finite-elements.
Definition lagrangedgbasis.hh:143
│ │ │ -
static const int dofsPerPyramid
Definition lagrangedgbasis.hh:94
│ │ │ -
LagrangeDGPreBasis(const GridView &gv)
Constructor for a given grid view object.
Definition lagrangedgbasis.hh:104
│ │ │ -
static const int dofsPerHexahedron
Definition lagrangedgbasis.hh:93
│ │ │ -
It indices(const Node &node, It it) const
Definition lagrangedgbasis.hh:131
│ │ │ -
static const int dofsPerEdge
Definition lagrangedgbasis.hh:88
│ │ │ -
unsigned int order_
Definition lagrangedgbasis.hh:150
│ │ │ -
static const int dofsPerTetrahedron
Definition lagrangedgbasis.hh:91
│ │ │ -
GV GridView
The grid view that the FE space is defined on.
Definition lagrangedgbasis.hh:84
│ │ │ -
A generic MixIn class for PreBasis with flat indices computed from a mapper.
Definition leafprebasismappermixin.hh:62
│ │ │ -
Dune::MultipleCodimMultipleGeomTypeMapper< GridView > mapper_
Definition leafprebasismappermixin.hh:133
│ │ │ -
std::size_t size_type
Type used for index digits.
Definition leafprebasismappermixin.hh:71
│ │ │ -
size_type size() const
Obtain the number of basis function in the local node.
Definition nodes.hh:162
│ │ │ +
auto makeISTLVector(const ContainerDescriptor &tree)
Construct an istl vector type compatible with the container descriptor.
Definition istlvectorfactory.hh:131
│ │ │ +
Definition containerfactory.hh:20
│ │ │ +
Dune::TupleVector< Children... > Tuple
Descriptor with all children of possibly different type.
Definition containerdescriptors.hh:82
│ │ │ +
std::vector< Child > Vector
Descriptor for vectors with all children of the same type and dynamic size.
Definition containerdescriptors.hh:112
│ │ │ +
std::array< Child, n > Array
Descriptor for arrays with all children of the same type and static size.
Definition containerdescriptors.hh:98
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,294 +1,169 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -lagrangedgbasis.hh │ │ │ │ +istlvectorfactory.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ -3 │ │ │ │ -4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ +3// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ -5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ +4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ -6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH │ │ │ │ +5#ifndef DUNE_FUNCTIONS_BACKENDS_ISTL_VECTORFACTORY_HH │ │ │ │ +6#define DUNE_FUNCTIONS_BACKENDS_ISTL_VECTORFACTORY_HH │ │ │ │ +7 │ │ │ │ +8#include │ │ │ │ 9 │ │ │ │ 10#include │ │ │ │ -11#include │ │ │ │ -12 │ │ │ │ -13#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -14#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ -15#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_a_g_r_a_n_g_e_b_a_s_i_s_._h_h> │ │ │ │ -16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h> │ │ │ │ -17 │ │ │ │ +11#include │ │ │ │ +12#include │ │ │ │ +13 │ │ │ │ +14#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h> │ │ │ │ +15 │ │ │ │ +16#include │ │ │ │ +17#include │ │ │ │ 18 │ │ │ │ -19 │ │ │ │ -20 │ │ │ │ -21namespace _D_u_n_e { │ │ │ │ -22namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -23 │ │ │ │ -24 │ │ │ │ -25 │ │ │ │ -26/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -27// This is the reusable part of the basis. It contains │ │ │ │ -28// │ │ │ │ -29// LagrangeDGPreBasis │ │ │ │ -30// LagrangeDGNode │ │ │ │ -31// │ │ │ │ -32// The pre-basis allows to create the others and is the owner of possible │ │ │ │ -shared │ │ │ │ -33// state. These components do _not_ depend on the global basis and local view │ │ │ │ -34// and can be used without a global basis. │ │ │ │ -35/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -36 │ │ │ │ -37template │ │ │ │ -_3_8using _L_a_g_r_a_n_g_e_D_G_N_o_d_e = _L_a_g_r_a_n_g_e_N_o_d_e_<_G_V_,_ _k_,_ _R_>; │ │ │ │ -39 │ │ │ │ -48template │ │ │ │ -_4_9class _L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s : │ │ │ │ -50 public _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n │ │ │ │ -51{ │ │ │ │ -52 using Base = _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_<_G_V_>; │ │ │ │ -53 │ │ │ │ -54 static constexpr bool useDynamicOrder = (k<0); │ │ │ │ -55 │ │ │ │ -56 static MCMGLayout dofLayout(int _o_r_d_e_r) │ │ │ │ -57 { │ │ │ │ -58 return [_o_r_d_e_r](Dune::GeometryType type, size_t dimGrid) { │ │ │ │ -59 if (type.dim() == dimGrid) │ │ │ │ -60 { │ │ │ │ -61 if (type.isLine()) │ │ │ │ -62 return _o_r_d_e_r+1; │ │ │ │ -63 if (type.isTriangle()) │ │ │ │ -64 return (_o_r_d_e_r+1)*(_o_r_d_e_r+2)/2; │ │ │ │ -65 if (type.isQuadrilateral()) │ │ │ │ -66 return (_o_r_d_e_r+1)*(_o_r_d_e_r+1); │ │ │ │ -67 if (type.isTetrahedron()) │ │ │ │ -68 return (_o_r_d_e_r+1)*(_o_r_d_e_r+2)*(_o_r_d_e_r+3)/6; │ │ │ │ -69 if (type.isPrism()) │ │ │ │ -70 return (_o_r_d_e_r+1)*(_o_r_d_e_r+1)*(_o_r_d_e_r+2)/2; │ │ │ │ -71 if (type.isHexahedron()) │ │ │ │ -72 return (_o_r_d_e_r+1)*(_o_r_d_e_r+1)*(_o_r_d_e_r+1); │ │ │ │ -73 if (type.isPyramid()) │ │ │ │ -74 return (_o_r_d_e_r+1)*(_o_r_d_e_r+2)*(2*_o_r_d_e_r+3)/6; │ │ │ │ -75 DUNE_THROW(Dune::NotImplemented, "Using LagrangeDGPreBasis with non- │ │ │ │ -supported GeometryType"); │ │ │ │ -76 } │ │ │ │ -77 return 0; │ │ │ │ -78 }; │ │ │ │ -79 } │ │ │ │ -80 │ │ │ │ -81public: │ │ │ │ -82 │ │ │ │ -_8_4 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ -_8_5 using _s_i_z_e___t_y_p_e = typename _B_a_s_e_:_:_s_i_z_e___t_y_p_e; │ │ │ │ -86 │ │ │ │ -87 // Precompute the number of dofs per entity type │ │ │ │ -_8_8 [[deprecated("This constant will be removed after Dune 2.11")]] const static │ │ │ │ -int _d_o_f_s_P_e_r_E_d_g_e = k+1; │ │ │ │ -_8_9 [[deprecated("This constant will be removed after Dune 2.11")]] const static │ │ │ │ -int _d_o_f_s_P_e_r_T_r_i_a_n_g_l_e = (k+1)*(k+2)/2; │ │ │ │ -_9_0 [[deprecated("This constant will be removed after Dune 2.11")]] const static │ │ │ │ -int _d_o_f_s_P_e_r_Q_u_a_d = (k+1)*(k+1); │ │ │ │ -_9_1 [[deprecated("This constant will be removed after Dune 2.11")]] const static │ │ │ │ -int _d_o_f_s_P_e_r_T_e_t_r_a_h_e_d_r_o_n = (k+1)*(k+2)*(k+3)/6; │ │ │ │ -_9_2 [[deprecated("This constant will be removed after Dune 2.11")]] const static │ │ │ │ -int _d_o_f_s_P_e_r_P_r_i_s_m = (k+1)*(k+1)*(k+2)/2; │ │ │ │ -_9_3 [[deprecated("This constant will be removed after Dune 2.11")]] const static │ │ │ │ -int _d_o_f_s_P_e_r_H_e_x_a_h_e_d_r_o_n = (k+1)*(k+1)*(k+1); │ │ │ │ -_9_4 [[deprecated("This constant will be removed after Dune 2.11")]] const static │ │ │ │ -int _d_o_f_s_P_e_r_P_y_r_a_m_i_d = (k+1)*(k+2)*(2*k+3)/6; │ │ │ │ -95 │ │ │ │ -_9_6 using _N_o_d_e = _L_a_g_r_a_n_g_e_D_G_N_o_d_e_<_G_V_,_ _k_,_ _R_>; │ │ │ │ -97 │ │ │ │ -_1_0_4 _L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s(const _G_r_i_d_V_i_e_w& gv) │ │ │ │ -105 requires(k>=0) │ │ │ │ -106 : Base(gv, dofLayout(k)) │ │ │ │ -107 , _o_r_d_e_r__(k) │ │ │ │ -108 {} │ │ │ │ -109 │ │ │ │ -_1_1_6 _L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s(const _G_r_i_d_V_i_e_w& gv, unsigned int _o_r_d_e_r) │ │ │ │ -117 requires(k<0) │ │ │ │ -118 : Base(gv, dofLayout(_o_r_d_e_r)) │ │ │ │ -119 , _o_r_d_e_r__(_o_r_d_e_r) │ │ │ │ -120 {} │ │ │ │ +19namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ +20namespace _C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s { │ │ │ │ +21namespace Impl { │ │ │ │ +22 │ │ │ │ +23template │ │ │ │ +24struct ISTLVectorFactory │ │ │ │ +25{ │ │ │ │ +26 void operator() (const Unknown& tree) const │ │ │ │ +27 { │ │ │ │ +28 DUNE_THROW(Dune::NotImplemented, "Cannot create a vector. The container │ │ │ │ +descriptor is unknown."); │ │ │ │ +29 } │ │ │ │ +30 │ │ │ │ +31 template │ │ │ │ +32 auto operator() (const _T_u_p_l_e_<_V_._._._>& tree) const │ │ │ │ +33 { │ │ │ │ +34 return unpackIntegerSequence([&](auto... ii) { │ │ │ │ +35 return Dune::MultiTypeBlockVector{(*this) │ │ │ │ +(tree[ii])...}; │ │ │ │ +36 }, std::make_index_sequence()); │ │ │ │ +37 } │ │ │ │ +38 │ │ │ │ +39 template │ │ │ │ +40 auto operator() (const _A_r_r_a_y_<_V_,_n_>& tree) const │ │ │ │ +41 { │ │ │ │ +42 return unpackIntegerSequence([&](auto... ii) { │ │ │ │ +43 return Dune::BlockVector{(*this)(tree[ii])...}; │ │ │ │ +44 }, std::make_index_sequence()); │ │ │ │ +45 } │ │ │ │ +46 │ │ │ │ +47 template │ │ │ │ +48 auto operator() (const _V_e_c_t_o_r_<_V_>& tree) const │ │ │ │ +49 { │ │ │ │ +50 using W = decltype((*this)(tree[0])); │ │ │ │ +51 Dune::BlockVector result(tree.size()); │ │ │ │ +52 for (std::size_t i = 0; i < tree.size(); ++i) │ │ │ │ +53 result[i] = (*this)(tree[i]); │ │ │ │ +54 return result; │ │ │ │ +55 } │ │ │ │ +56 │ │ │ │ +57 template │ │ │ │ +58 auto operator() (const UniformArray& tree) const │ │ │ │ +59 { │ │ │ │ +60 auto node = (*this)(tree[0]); │ │ │ │ +61 return unpackIntegerSequence([&](auto... ii) { │ │ │ │ +62 return Dune::BlockVector{((void)(ii),node)...}; │ │ │ │ +63 }, std::make_index_sequence()); │ │ │ │ +64 } │ │ │ │ +65 │ │ │ │ +66 template │ │ │ │ +67 auto operator() (const UniformVector& tree) const │ │ │ │ +68 { │ │ │ │ +69 auto node = (*this)(tree[0]); │ │ │ │ +70 using W = decltype(node); │ │ │ │ +71 Dune::BlockVector result(tree.size()); │ │ │ │ +72 for (std::size_t i = 0; i < tree.size(); ++i) │ │ │ │ +73 result[i] = node; │ │ │ │ +74 return result; │ │ │ │ +75 } │ │ │ │ +76 │ │ │ │ +77 // scalar types │ │ │ │ +78 │ │ │ │ +79 auto operator() (const Value& tree) const │ │ │ │ +80 { │ │ │ │ +81 return T(0); │ │ │ │ +82 } │ │ │ │ +83 │ │ │ │ +84 // flat vectors │ │ │ │ +85 │ │ │ │ +86 template │ │ │ │ +87 auto operator() (const UniformArray& tree) const │ │ │ │ +88 { │ │ │ │ +89 return Dune::FieldVector(0); │ │ │ │ +90 } │ │ │ │ +91 │ │ │ │ +92 auto operator() (const UniformVector& tree) const │ │ │ │ +93 { │ │ │ │ +94 return Dune::BlockVector(tree.size()); │ │ │ │ +95 } │ │ │ │ +96 │ │ │ │ +97 // block vectors │ │ │ │ +98 │ │ │ │ +99 template │ │ │ │ +100 auto operator() (const UniformVector>& tree) const │ │ │ │ +101 { │ │ │ │ +102 return Dune::BlockVector>(tree.size()); │ │ │ │ +103 } │ │ │ │ +104 │ │ │ │ +105 template │ │ │ │ +106 auto operator() (const _V_e_c_t_o_r>& tree) const │ │ │ │ +107 { │ │ │ │ +108 return Dune::BlockVector>(tree.size()); │ │ │ │ +109 } │ │ │ │ +110 │ │ │ │ +111 template │ │ │ │ +112 auto operator() (const _A_r_r_a_y,m>& tree) const │ │ │ │ +113 { │ │ │ │ +114 return Dune::BlockVector>(m); │ │ │ │ +115 } │ │ │ │ +116}; │ │ │ │ +117 │ │ │ │ +118} // end namespace Impl │ │ │ │ +119} // end namespace ContainerDescriptors │ │ │ │ +120 │ │ │ │ 121 │ │ │ │ -_1_2_5 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ -126 { │ │ │ │ -127 return _N_o_d_e{_o_r_d_e_r__}; │ │ │ │ -128 } │ │ │ │ -129 │ │ │ │ -130 template │ │ │ │ -_1_3_1 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ -132 { │ │ │ │ -133 _s_i_z_e___t_y_p_e elementOffset = _B_a_s_e_:_:_m_a_p_p_e_r__.index(node._e_l_e_m_e_n_t()); │ │ │ │ -134 for(auto i : Dune::range(node._s_i_z_e())) │ │ │ │ -135 { │ │ │ │ -136 *it = {{ (_s_i_z_e___t_y_p_e)(elementOffset+i) }}; │ │ │ │ -137 ++it; │ │ │ │ -138 } │ │ │ │ -139 return it; │ │ │ │ -140 } │ │ │ │ -141 │ │ │ │ -_1_4_3 unsigned int _o_r_d_e_r() const │ │ │ │ -144 { │ │ │ │ -145 return (useDynamicOrder) ? _o_r_d_e_r__ : k; │ │ │ │ -146 } │ │ │ │ -147 │ │ │ │ -148protected: │ │ │ │ -149 │ │ │ │ -_1_5_0 unsigned int _o_r_d_e_r__; │ │ │ │ -151}; │ │ │ │ -152 │ │ │ │ -153 │ │ │ │ -154 │ │ │ │ -155namespace _B_a_s_i_s_F_a_c_t_o_r_y { │ │ │ │ -156 │ │ │ │ -165template │ │ │ │ -_1_6_6auto _l_a_g_r_a_n_g_e_D_G() │ │ │ │ -167{ │ │ │ │ -168 return [](const auto& gridView) { │ │ │ │ -169 return _L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s, order, R> │ │ │ │ -(gridView); │ │ │ │ -170 }; │ │ │ │ -171} │ │ │ │ -172 │ │ │ │ -181template │ │ │ │ -_1_8_2auto _l_a_g_r_a_n_g_e_D_G(unsigned int order) │ │ │ │ -183{ │ │ │ │ -184 return [order](const auto& gridView) { │ │ │ │ -185 return _L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s, -1, R> │ │ │ │ -(gridView, order); │ │ │ │ -186 }; │ │ │ │ -187} │ │ │ │ -188 │ │ │ │ -189} // end namespace BasisFactory │ │ │ │ -190 │ │ │ │ -191 │ │ │ │ -192 │ │ │ │ -193/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -194// This is the actual global basis implementation based on the reusable │ │ │ │ -parts. │ │ │ │ -195/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -196 │ │ │ │ -205template │ │ │ │ -_2_0_6using _L_a_g_r_a_n_g_e_D_G_B_a_s_i_s = _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s_<_G_V_,_ _k_,_ _R_> >; │ │ │ │ -207 │ │ │ │ -208 │ │ │ │ -209 │ │ │ │ -210} // end namespace Functions │ │ │ │ -211} // end namespace Dune │ │ │ │ -212 │ │ │ │ -213 │ │ │ │ -214#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH │ │ │ │ -_n_o_d_e_s_._h_h │ │ │ │ -_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h │ │ │ │ -_l_a_g_r_a_n_g_e_b_a_s_i_s_._h_h │ │ │ │ -_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_l_a_g_r_a_n_g_e_D_G │ │ │ │ -auto lagrangeDG() │ │ │ │ -Create a pre-basis factory that can create a LagrangeDG pre-basis. │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:166 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_D_G_B_a_s_i_s │ │ │ │ -DefaultGlobalBasis< LagrangeDGPreBasis< GV, k, R > > LagrangeDGBasis │ │ │ │ -Basis of a scalar k-th-order Lagrangean-DG finite element space. │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:206 │ │ │ │ -_D_u_n_e │ │ │ │ -DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ +130template │ │ │ │ +_1_3_1auto _m_a_k_e_I_S_T_L_V_e_c_t_o_r (const ContainerDescriptor& tree) │ │ │ │ +132{ │ │ │ │ +133 auto factory = ContainerDescriptors::Impl::ISTLVectorFactory{}; │ │ │ │ +134 return factory(tree); │ │ │ │ +135} │ │ │ │ +136 │ │ │ │ +137} // end namespace Dune::Functions │ │ │ │ +138 │ │ │ │ +139#endif // DUNE_FUNCTIONS_BACKENDS_ISTL_VECTORFACTORY_HH │ │ │ │ +_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h │ │ │ │ +Lightweight representation of (hierarchical) size and block structure extracted │ │ │ │ +from a basis to descr... │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_D_G_N_o_d_e │ │ │ │ -LagrangeNode< GV, k, R > LagrangeDGNode │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:38 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:926 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ -Global basis for given pre-basis. │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:53 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:379 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_:_:_e_l_e_m_e_n_t │ │ │ │ -const Element & element() const │ │ │ │ -Return current element, throw if unbound. │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:427 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s │ │ │ │ -PreBasis implementation for a Lagrangean-DG finite element space. │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:51 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s_:_:_m_a_k_e_N_o_d_e │ │ │ │ -Node makeNode() const │ │ │ │ -Create tree node. │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:125 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s_:_:_L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s │ │ │ │ -LagrangeDGPreBasis(const GridView &gv, unsigned int order) │ │ │ │ -Constructor for a given grid view object. │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:116 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s_:_:_d_o_f_s_P_e_r_P_r_i_s_m │ │ │ │ -static const int dofsPerPrism │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:92 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s_:_:_N_o_d_e │ │ │ │ -LagrangeDGNode< GV, k, R > Node │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:96 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s_:_:_d_o_f_s_P_e_r_Q_u_a_d │ │ │ │ -static const int dofsPerQuad │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:90 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s_:_:_d_o_f_s_P_e_r_T_r_i_a_n_g_l_e │ │ │ │ -static const int dofsPerTriangle │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:89 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s_:_:_s_i_z_e___t_y_p_e │ │ │ │ -typename Base::size_type size_type │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:85 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s_:_:_o_r_d_e_r │ │ │ │ -unsigned int order() const │ │ │ │ -Polynomial order used in the local Lagrange finite-elements. │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:143 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s_:_:_d_o_f_s_P_e_r_P_y_r_a_m_i_d │ │ │ │ -static const int dofsPerPyramid │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:94 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s_:_:_L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s │ │ │ │ -LagrangeDGPreBasis(const GridView &gv) │ │ │ │ -Constructor for a given grid view object. │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:104 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s_:_:_d_o_f_s_P_e_r_H_e_x_a_h_e_d_r_o_n │ │ │ │ -static const int dofsPerHexahedron │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:93 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s_:_:_i_n_d_i_c_e_s │ │ │ │ -It indices(const Node &node, It it) const │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:131 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s_:_:_d_o_f_s_P_e_r_E_d_g_e │ │ │ │ -static const int dofsPerEdge │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:88 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s_:_:_o_r_d_e_r__ │ │ │ │ -unsigned int order_ │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:150 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s_:_:_d_o_f_s_P_e_r_T_e_t_r_a_h_e_d_r_o_n │ │ │ │ -static const int dofsPerTetrahedron │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:91 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ -GV GridView │ │ │ │ -The grid view that the FE space is defined on. │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:84 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n │ │ │ │ -A generic MixIn class for PreBasis with flat indices computed from a mapper. │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:62 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_m_a_p_p_e_r__ │ │ │ │ -Dune::MultipleCodimMultipleGeomTypeMapper< GridView > mapper_ │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:133 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -Type used for index digits. │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:71 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_i_z_e │ │ │ │ -size_type size() const │ │ │ │ -Obtain the number of basis function in the local node. │ │ │ │ -DDeeffiinniittiioonn nodes.hh:162 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_I_S_T_L_V_e_c_t_o_r │ │ │ │ +auto makeISTLVector(const ContainerDescriptor &tree) │ │ │ │ +Construct an istl vector type compatible with the container descriptor. │ │ │ │ +DDeeffiinniittiioonn istlvectorfactory.hh:131 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s │ │ │ │ +DDeeffiinniittiioonn containerfactory.hh:20 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_T_u_p_l_e │ │ │ │ +Dune::TupleVector< Children... > Tuple │ │ │ │ +Descriptor with all children of possibly different type. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:82 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_V_e_c_t_o_r │ │ │ │ +std::vector< Child > Vector │ │ │ │ +Descriptor for vectors with all children of the same type and dynamic size. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:112 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_A_r_r_a_y │ │ │ │ +std::array< Child, n > Array │ │ │ │ +Descriptor for arrays with all children of the same type and static size. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:98 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _l_a_g_r_a_n_g_e_d_g_b_a_s_i_s_._h_h │ │ │ │ + * _b_a_c_k_e_n_d_s │ │ │ │ + * _i_s_t_l_v_e_c_t_o_r_f_a_c_t_o_r_y_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00131.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: lagrangebasis.hh File Reference │ │ │ +Dune-Functions: coarsefunctiononfinegridview.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,66 +88,50 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
lagrangebasis.hh File Reference
│ │ │ +
coarsefunctiononfinegridview.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <type_traits>
│ │ │ -#include <dune/common/exceptions.hh>
│ │ │ -#include <dune/localfunctions/lagrange/cache.hh>
│ │ │ -#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ -#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │ -#include <dune/functions/functionspacebases/leafprebasismixin.hh>
│ │ │ -#include <dune/grid/common/capabilities.hh>
│ │ │ +
#include <optional>
│ │ │ +#include <type_traits>
│ │ │ +#include <utility>
│ │ │ +#include <dune/common/referencehelper.hh>
│ │ │ +#include <dune/functions/common/defaultderivativetraits.hh>
│ │ │ +#include <dune/functions/common/geometryinancestor.hh>
│ │ │ +#include <dune/functions/gridfunctions/gridfunction.hh>
│ │ │ +#include <dune/functions/gridfunctions/gridviewentityset.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::LagrangePreBasis< GV, k, R >
 A pre-basis for a PQ-lagrange bases with given order. More...
class  Dune::Functions::LagrangeNode< GV, k, R >
class  Dune::Functions::CoarseFunctionOnFineGridView< GridFunction, GV, DerivativeTraits >
 A wrapper representing a coarse grid function on a fine gridview. More...
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ -

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::BasisFactory
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -

│ │ │ -Typedefs

template<typename GV, int k = -1, typename R = double>
using Dune::Functions::LagrangeBasis = DefaultGlobalBasis<LagrangePreBasis<GV, k, R> >
 Nodal basis of a scalar k-th-order Lagrangean finite element space.
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │

│ │ │ -Functions

template<std::size_t k, typename R = double>
auto Dune::Functions::BasisFactory::lagrange ()
 Create a pre-basis factory that can create a Lagrange pre-basis.
template<typename R = double>
auto Dune::Functions::BasisFactory::lagrange (int order)
 Create a pre-basis factory that can create a Lagrange pre-basis with a run-time order.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,39 +1,27 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -lagrangebasis.hh File Reference │ │ │ │ +coarsefunctiononfinegridview.hh File Reference │ │ │ │ +#include │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h> │ │ │ │ -#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_g_e_o_m_e_t_r_y_i_n_a_n_c_e_s_t_o_r_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _k_,_ _R_ _> │ │ │ │ -  A pre-basis for a PQ-lagrange bases with given order. _M_o_r_e_._._. │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_<_ _G_V_,_ _k_,_ _R_ _> │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_<_ _G_r_i_d_F_u_n_c_t_i_o_n_,_ _G_V_, │ │ │ │ + _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _> │ │ │ │ +  A wrapper representing a coarse grid function on a fine gridview. │ │ │ │ + _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -TTyyppeeddeeffss │ │ │ │ -template │ │ │ │ -using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_B_a_s_i_s = _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s<_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s > │ │ │ │ -  Nodal basis of a scalar k-th-order Lagrangean finite element space. │ │ │ │ -FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_l_a_g_r_a_n_g_e () │ │ │ │ -  Create a pre-basis factory that can create a Lagrange pre-basis. │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_l_a_g_r_a_n_g_e (int order) │ │ │ │ -  Create a pre-basis factory that can create a Lagrange pre-basis with a │ │ │ │ - run-time order. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _l_a_g_r_a_n_g_e_b_a_s_i_s_._h_h │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ + * _c_o_a_r_s_e_f_u_n_c_t_i_o_n_o_n_f_i_n_e_g_r_i_d_v_i_e_w_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00131_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: lagrangebasis.hh Source File │ │ │ +Dune-Functions: coarsefunctiononfinegridview.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,594 +88,236 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
lagrangebasis.hh
│ │ │ +
coarsefunctiononfinegridview.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_COARSEFUNCTIONONFINEGRIDVIEW_HH
│ │ │ +
8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_COARSEFUNCTIONONFINEGRIDVIEW_HH
│ │ │
9
│ │ │ -
10#include <type_traits>
│ │ │ -
11#include <dune/common/exceptions.hh>
│ │ │ -
12
│ │ │ -
13#include <dune/localfunctions/lagrange/cache.hh>
│ │ │ -
14
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
18
│ │ │ -
19#include <dune/grid/common/capabilities.hh>
│ │ │ +
10#include <optional>
│ │ │ +
11#include <type_traits>
│ │ │ +
12#include <utility>
│ │ │ +
13
│ │ │ +
14#include <dune/common/referencehelper.hh>
│ │ │ +
15
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │
20
│ │ │ -
21namespace Dune {
│ │ │ -
22namespace Functions {
│ │ │ +
21namespace Dune::Functions {
│ │ │ +
22
│ │ │
23
│ │ │ -
24// *****************************************************************************
│ │ │ -
25// This is the reusable part of the LagrangeBasis. It contains
│ │ │ -
26//
│ │ │ -
27// LagrangePreBasis
│ │ │ -
28// LagrangeNode
│ │ │ -
29//
│ │ │ -
30// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ -
31// state. These components do _not_ depend on the global basis and local view
│ │ │ -
32// and can be used without a global basis.
│ │ │ -
33// *****************************************************************************
│ │ │ -
34
│ │ │ -
35template<typename GV, int k, typename R=double>
│ │ │ -
36class LagrangeNode;
│ │ │ -
37
│ │ │ -
38template<typename GV, int k, typename R=double>
│ │ │ - │ │ │ -
40
│ │ │ -
41
│ │ │ -
42
│ │ │ -
62template<typename GV, int k, typename R>
│ │ │ -
│ │ │ - │ │ │ -
64 public LeafPreBasisMixin< LagrangePreBasis<GV,k,R> >
│ │ │ -
65{
│ │ │ -
66 static const int dim = GV::dimension;
│ │ │ -
67 static const bool useDynamicOrder = (k<0);
│ │ │ -
68
│ │ │ -
69public:
│ │ │ -
70
│ │ │ -
72 using GridView = GV;
│ │ │ -
73
│ │ │ -
75 using size_type = std::size_t;
│ │ │ -
76
│ │ │ - │ │ │ -
79
│ │ │ -
│ │ │ - │ │ │ -
82 : LagrangePreBasis(gv, std::numeric_limits<unsigned int>::max())
│ │ │ -
83 {}
│ │ │ -
│ │ │ +
24
│ │ │ +
39template<class GridFunction, class GV, template<class> class DerivativeTraits=Dune::Functions::DefaultDerivativeTraits>
│ │ │ +
│ │ │ + │ │ │ +
41{
│ │ │ +
42 using RawGridFunction = Dune::ResolveRef_t<GridFunction>;
│ │ │ +
43
│ │ │ +
44 auto&& rawFunction() const
│ │ │ +
45 {
│ │ │ +
46 return Dune::resolveRef(function_);
│ │ │ +
47 }
│ │ │ +
48
│ │ │ +
49public:
│ │ │ +
50
│ │ │ +
51 using GridView = GV;
│ │ │ + │ │ │ +
53 using Element = typename EntitySet::Element;
│ │ │ + │ │ │ + │ │ │ +
56 using Range = std::decay_t<decltype(std::declval<RawGridFunction>()(std::declval<Domain>()))>;
│ │ │ +
57
│ │ │ +
58private:
│ │ │ +
59
│ │ │ +
60 using CoarseEntitySet = std::decay_t<decltype(std::declval<RawGridFunction>().entitySet())>;
│ │ │ +
61 using GeometryInAncestor = Dune::Functions::GeometryInAncestor<Element>;
│ │ │ +
62 using Traits = Dune::Functions::Imp::GridFunctionTraits<Range(Domain), EntitySet, DerivativeTraits, 56>;
│ │ │ +
63
│ │ │ +
64 class CoarseLocalFunctionOnFineGridView
│ │ │ +
65 {
│ │ │ +
66 using Traits = typename CoarseFunctionOnFineGridView::Traits::LocalFunctionTraits;
│ │ │ +
67
│ │ │ +
68 public:
│ │ │ +
69
│ │ │ +
70 using Derivative = decltype(localFunction(derivative(std::declval<CoarseFunctionOnFineGridView>())));
│ │ │ +
71 using RawLocalFunction = std::decay_t<decltype(localFunction(std::declval<const RawGridFunction&>()))>;
│ │ │ +
72
│ │ │ +
78 CoarseLocalFunctionOnFineGridView(RawLocalFunction&& localFunction, const CoarseEntitySet& coarseEntitySet)
│ │ │ +
79 : element_()
│ │ │ +
80 , localFunction_(localFunction)
│ │ │ +
81 , coarseEntitySet_(coarseEntitySet)
│ │ │ +
82 , geometryInAncestor_()
│ │ │ +
83 {}
│ │ │
84
│ │ │ -
│ │ │ -
86 LagrangePreBasis(const GridView& gv, unsigned int order) :
│ │ │ - │ │ │ -
88 {
│ │ │ -
89 if (!useDynamicOrder && order!=std::numeric_limits<unsigned int>::max())
│ │ │ -
90 DUNE_THROW(RangeError, "Template argument k has to be -1 when supplying a run-time order!");
│ │ │ -
91
│ │ │ -
92 for (int i=0; i<=dim; i++)
│ │ │ -
93 {
│ │ │ - │ │ │ - │ │ │ -
96 }
│ │ │ - │ │ │ - │ │ │ -
99 }
│ │ │ -
│ │ │ -
100
│ │ │ -
│ │ │ - │ │ │ -
103 {
│ │ │ -
104 vertexOffset_ = 0;
│ │ │ - │ │ │ -
106
│ │ │ -
107 if (dim>=2)
│ │ │ -
108 {
│ │ │ - │ │ │ -
110
│ │ │ -
111 quadrilateralOffset_ = triangleOffset_ + dofsPerSimplex(2) * ((size_type)gridView_.size(Dune::GeometryTypes::triangle));
│ │ │ -
112 }
│ │ │ -
113
│ │ │ -
114 if (dim==3) {
│ │ │ -
115 tetrahedronOffset_ = quadrilateralOffset_ + dofsPerCube(2) * ((size_type)gridView_.size(Dune::GeometryTypes::quadrilateral));
│ │ │ -
116
│ │ │ -
117 prismOffset_ = tetrahedronOffset_ + dofsPerSimplex(3) * ((size_type)gridView_.size(Dune::GeometryTypes::tetrahedron));
│ │ │ -
118
│ │ │ -
119 hexahedronOffset_ = prismOffset_ + dofsPerPrism() * ((size_type)gridView_.size(Dune::GeometryTypes::prism));
│ │ │ -
120
│ │ │ -
121 pyramidOffset_ = hexahedronOffset_ + dofsPerCube(3) * ((size_type)gridView_.size(Dune::GeometryTypes::hexahedron));
│ │ │ -
122 }
│ │ │ -
123 }
│ │ │ -
│ │ │ -
124
│ │ │ -
│ │ │ -
126 const GridView& gridView() const
│ │ │ -
127 {
│ │ │ -
128 return gridView_;
│ │ │ -
129 }
│ │ │ -
│ │ │ -
130
│ │ │ -
│ │ │ -
132 void update (const GridView& gv)
│ │ │ -
133 {
│ │ │ -
134 gridView_ = gv;
│ │ │ -
135 }
│ │ │ -
│ │ │ +
90 CoarseLocalFunctionOnFineGridView(
│ │ │ +
91 RawLocalFunction&& localFunction,
│ │ │ +
92 const CoarseEntitySet& coarseEntitySet,
│ │ │ +
93 const GeometryInAncestor& geometryInAncestor,
│ │ │ +
94 const std::optional<Element>& element
│ │ │ +
95 )
│ │ │ +
96 : element_(element)
│ │ │ +
97 , localFunction_(localFunction)
│ │ │ +
98 , coarseEntitySet_(coarseEntitySet)
│ │ │ +
99 , geometryInAncestor_(geometryInAncestor, *element_)
│ │ │ +
100 {}
│ │ │ +
101
│ │ │ +
103 void bind(const Element& element)
│ │ │ +
104 {
│ │ │ +
105 element_ = element;
│ │ │ +
106 geometryInAncestor_.bind(*element_, [&](const auto& e) { return not coarseEntitySet_.contains(e); });
│ │ │ +
107 localFunction_.bind(geometryInAncestor_.coarseElement());
│ │ │ +
108 }
│ │ │ +
109
│ │ │ +
111 void unbind()
│ │ │ +
112 {
│ │ │ +
113 element_.reset();
│ │ │ +
114 }
│ │ │ +
115
│ │ │ +
117 bool bound() const
│ │ │ +
118 {
│ │ │ +
119 return static_cast<bool>(element_);
│ │ │ +
120 }
│ │ │ +
121
│ │ │ +
123 const Element& localContext() const
│ │ │ +
124 {
│ │ │ +
125 return *element_;
│ │ │ +
126 }
│ │ │ +
127
│ │ │ +
129 friend auto derivative(const CoarseLocalFunctionOnFineGridView& f)
│ │ │ +
130 {
│ │ │ +
131 if constexpr(requires{ derivative(f.localFunction_); })
│ │ │ +
132 return Derivative(derivative(f.localFunction_), f.coarseEntitySet_, f.geometryInAncestor_, f.element_);
│ │ │ +
133 else
│ │ │ +
134 return typename Traits::DerivativeInterface{};
│ │ │ +
135 }
│ │ │
136
│ │ │ -
│ │ │ - │ │ │ -
141 {
│ │ │ -
142 return Node{order_};
│ │ │ -
143 }
│ │ │ -
│ │ │ -
144
│ │ │ -
│ │ │ - │ │ │ -
147 {
│ │ │ -
148 switch (dim)
│ │ │ -
149 {
│ │ │ -
150 case 1:
│ │ │ -
151 return dofsPerCube(0) * ((size_type)gridView_.size(dim))
│ │ │ -
152 + dofsPerCube(1) * ((size_type)gridView_.size(dim-1));
│ │ │ -
153 case 2:
│ │ │ -
154 {
│ │ │ -
155 return dofsPerCube(0) * ((size_type)gridView_.size(dim))
│ │ │ -
156 + dofsPerCube(1) * ((size_type)gridView_.size(dim-1))
│ │ │ -
157 + dofsPerSimplex(2) * ((size_type)gridView_.size(Dune::GeometryTypes::triangle))
│ │ │ -
158 + dofsPerCube(2) * ((size_type)gridView_.size(Dune::GeometryTypes::quadrilateral));
│ │ │ -
159 }
│ │ │ -
160 case 3:
│ │ │ -
161 {
│ │ │ -
162 return dofsPerCube(0) * ((size_type)gridView_.size(dim))
│ │ │ -
163 + dofsPerCube(1) * ((size_type)gridView_.size(dim-1))
│ │ │ -
164 + dofsPerSimplex(2) * ((size_type)gridView_.size(Dune::GeometryTypes::triangle))
│ │ │ -
165 + dofsPerCube(2) * ((size_type)gridView_.size(Dune::GeometryTypes::quadrilateral))
│ │ │ -
166 + dofsPerSimplex(3) * ((size_type)gridView_.size(Dune::GeometryTypes::tetrahedron))
│ │ │ -
167 + dofsPerPyramid() * ((size_type)gridView_.size(Dune::GeometryTypes::pyramid))
│ │ │ -
168 + dofsPerPrism() * ((size_type)gridView_.size(Dune::GeometryTypes::prism))
│ │ │ -
169 + dofsPerCube(3) * ((size_type)gridView_.size(Dune::GeometryTypes::hexahedron));
│ │ │ -
170 }
│ │ │ -
171 }
│ │ │ -
172 DUNE_THROW(Dune::NotImplemented, "No size method for " << dim << "d grids available yet!");
│ │ │ -
173 }
│ │ │ -
│ │ │ -
174
│ │ │ -
│ │ │ - │ │ │ -
177 {
│ │ │ -
178 // That cast to unsigned int is necessary because GV::dimension is an enum,
│ │ │ -
179 // which is not recognized by the power method as an integer type...
│ │ │ -
180 return power(order()+1, (unsigned int)GV::dimension);
│ │ │ -
181 }
│ │ │ -
│ │ │ -
182
│ │ │ -
183 template<typename It>
│ │ │ -
│ │ │ -
184 It indices(const Node& node, It it) const
│ │ │ -
185 {
│ │ │ -
186 for (size_type i = 0, end = node.finiteElement().size() ; i < end ; ++it, ++i)
│ │ │ -
187 {
│ │ │ -
188 Dune::LocalKey localKey = node.finiteElement().localCoefficients().localKey(i);
│ │ │ -
189 const auto& gridIndexSet = gridView().indexSet();
│ │ │ -
190 const auto& element = node.element();
│ │ │ -
191
│ │ │ -
192 // The dimension of the entity that the current dof is related to
│ │ │ -
193 auto dofDim = dim - localKey.codim();
│ │ │ -
194
│ │ │ -
195 // Test for a vertex dof
│ │ │ -
196 // The test for k==1 is redundant, but having it here allows the compiler to conclude
│ │ │ -
197 // at compile-time that the dofDim==0 case is the only one that will ever happen.
│ │ │ -
198 // This leads to measurable speed-up: see
│ │ │ -
199 // https://gitlab.dune-project.org/staging/dune-functions/issues/30
│ │ │ -
200 if (k==1 || dofDim==0) {
│ │ │ -
201 *it = {{ (size_type)(gridIndexSet.subIndex(element,localKey.subEntity(),dim)) }};
│ │ │ -
202 continue;
│ │ │ -
203 }
│ │ │ -
204
│ │ │ -
205 if (dofDim==1)
│ │ │ -
206 { // edge dof
│ │ │ -
207 if (dim==1) // element dof -- any local numbering is fine
│ │ │ -
208 {
│ │ │ -
209 *it = {{ edgeOffset_
│ │ │ -
210 + dofsPerCube(1) * ((size_type)gridIndexSet.subIndex(element,0,0))
│ │ │ -
211 + localKey.index() }};
│ │ │ -
212 continue;
│ │ │ -
213 }
│ │ │ -
214 else
│ │ │ -
215 {
│ │ │ -
216 const auto refElement
│ │ │ -
217 = Dune::referenceElement<double,dim>(element.type());
│ │ │ -
218
│ │ │ -
219 // We have to reverse the numbering if the local element edge is
│ │ │ -
220 // not aligned with the global edge.
│ │ │ -
221 auto v0 = (size_type)gridIndexSet.subIndex(element,refElement.subEntity(localKey.subEntity(),localKey.codim(),0,dim),dim);
│ │ │ -
222 auto v1 = (size_type)gridIndexSet.subIndex(element,refElement.subEntity(localKey.subEntity(),localKey.codim(),1,dim),dim);
│ │ │ -
223 bool flip = (v0 > v1);
│ │ │ -
224 *it = {{ (flip)
│ │ │ - │ │ │ -
226 + dofsPerCube(1)*((size_type)gridIndexSet.subIndex(element,localKey.subEntity(),localKey.codim()))
│ │ │ -
227 + (dofsPerCube(1)-1)-localKey.index()
│ │ │ - │ │ │ -
229 + dofsPerCube(1)*((size_type)gridIndexSet.subIndex(element,localKey.subEntity(),localKey.codim()))
│ │ │ -
230 + localKey.index() }};
│ │ │ -
231 continue;
│ │ │ -
232 }
│ │ │ -
233 }
│ │ │ -
234
│ │ │ -
235 if (dofDim==2)
│ │ │ -
236 {
│ │ │ -
237 if (dim==2) // element dof -- any local numbering is fine
│ │ │ -
238 {
│ │ │ -
239 if (element.type().isTriangle())
│ │ │ -
240 {
│ │ │ -
241 *it = {{ triangleOffset_ + dofsPerSimplex(2)*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
│ │ │ -
242 continue;
│ │ │ -
243 }
│ │ │ -
244 else if (element.type().isQuadrilateral())
│ │ │ -
245 {
│ │ │ -
246 *it = {{ quadrilateralOffset_ + dofsPerCube(2)*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
│ │ │ -
247 continue;
│ │ │ -
248 }
│ │ │ -
249 else
│ │ │ -
250 DUNE_THROW(Dune::NotImplemented, "2d elements have to be triangles or quadrilaterals");
│ │ │ -
251 } else
│ │ │ -
252 {
│ │ │ -
253 const auto refElement
│ │ │ -
254 = Dune::referenceElement<double,dim>(element.type());
│ │ │ -
255
│ │ │ -
256 if (order()>3)
│ │ │ -
257 DUNE_THROW(Dune::NotImplemented, "LagrangeBasis for 3D grids is only implemented if k<=3");
│ │ │ -
258
│ │ │ -
259 if (order()==3 and !refElement.type(localKey.subEntity(), localKey.codim()).isTriangle())
│ │ │ -
260 DUNE_THROW(Dune::NotImplemented, "LagrangeBasis for 3D grids with k==3 is only implemented if the grid is a simplex grid");
│ │ │ -
261
│ │ │ -
262 *it = {{ triangleOffset_ + ((size_type)gridIndexSet.subIndex(element,localKey.subEntity(),localKey.codim())) }};
│ │ │ -
263 continue;
│ │ │ -
264 }
│ │ │ -
265 }
│ │ │ -
266
│ │ │ -
267 if (dofDim==3)
│ │ │ -
268 {
│ │ │ -
269 if (dim==3) // element dof -- any local numbering is fine
│ │ │ -
270 {
│ │ │ -
271 if (element.type().isTetrahedron())
│ │ │ -
272 {
│ │ │ -
273 *it = {{ tetrahedronOffset_ + dofsPerSimplex(3)*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
│ │ │ -
274 continue;
│ │ │ -
275 }
│ │ │ -
276 else if (element.type().isHexahedron())
│ │ │ -
277 {
│ │ │ -
278 *it = {{ hexahedronOffset_ + dofsPerCube(3)*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
│ │ │ -
279 continue;
│ │ │ -
280 }
│ │ │ -
281 else if (element.type().isPrism())
│ │ │ -
282 {
│ │ │ -
283 *it = {{ prismOffset_ + dofsPerPrism()*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
│ │ │ -
284 continue;
│ │ │ -
285 }
│ │ │ -
286 else if (element.type().isPyramid())
│ │ │ -
287 {
│ │ │ -
288 *it = {{ pyramidOffset_ + dofsPerPyramid()*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
│ │ │ -
289 continue;
│ │ │ -
290 }
│ │ │ -
291 else
│ │ │ -
292 DUNE_THROW(Dune::NotImplemented, "3d elements have to be tetrahedra, hexahedra, prisms, or pyramids");
│ │ │ -
293 } else
│ │ │ -
294 DUNE_THROW(Dune::NotImplemented, "Grids of dimension larger than 3 are no supported");
│ │ │ -
295 }
│ │ │ -
296 DUNE_THROW(Dune::NotImplemented, "Grid contains elements not supported for the LagrangeBasis");
│ │ │ -
297 }
│ │ │ -
298 return it;
│ │ │ -
299 }
│ │ │ -
│ │ │ -
300
│ │ │ -
│ │ │ -
302 unsigned int order() const
│ │ │ -
303 {
│ │ │ -
304 return (useDynamicOrder) ? order_ : k;
│ │ │ -
305 }
│ │ │ -
│ │ │ -
306
│ │ │ -
307protected:
│ │ │ - │ │ │ -
309
│ │ │ -
310 // Run-time order, only valid if k<0
│ │ │ -
311 unsigned int order_;
│ │ │ -
312
│ │ │ -
│ │ │ -
314 size_type dofsPerSimplex(std::size_t simplexDim) const
│ │ │ -
315 {
│ │ │ -
316 return useDynamicOrder ? dofsPerSimplex_[simplexDim] : computeDofsPerSimplex(simplexDim);
│ │ │ -
317 }
│ │ │ -
│ │ │ -
318
│ │ │ -
│ │ │ -
320 size_type dofsPerCube(std::size_t cubeDim) const
│ │ │ -
321 {
│ │ │ -
322 return useDynamicOrder ? dofsPerCube_[cubeDim] : computeDofsPerCube(cubeDim);
│ │ │ -
323 }
│ │ │ -
│ │ │ -
324
│ │ │ -
│ │ │ - │ │ │ -
326 {
│ │ │ -
327 return useDynamicOrder ? dofsPerPrism_ : computeDofsPerPrism();
│ │ │ -
328 }
│ │ │ -
│ │ │ -
329
│ │ │ -
│ │ │ - │ │ │ -
331 {
│ │ │ -
332 return useDynamicOrder ? dofsPerPyramid_ : computeDofsPerPyramid();
│ │ │ -
333 }
│ │ │ -
│ │ │ -
334
│ │ │ -
│ │ │ -
336 size_type computeDofsPerSimplex(std::size_t simplexDim) const
│ │ │ -
337 {
│ │ │ -
338 return order() == 0 ? (dim == simplexDim ? 1 : 0) : Dune::binomial(std::size_t(order()-1),simplexDim);
│ │ │ -
339 }
│ │ │ -
│ │ │ -
340
│ │ │ -
│ │ │ -
342 size_type computeDofsPerCube(std::size_t cubeDim) const
│ │ │ -
343 {
│ │ │ -
344 return order() == 0 ? (dim == cubeDim ? 1 : 0) : Dune::power(order()-1, cubeDim);
│ │ │ -
345 }
│ │ │ -
│ │ │ -
346
│ │ │ -
│ │ │ - │ │ │ -
348 {
│ │ │ -
349 return order() == 0 ? (dim == 3 ? 1 : 0) : (order()-1)*(order()-1)*(order()-2)/2;
│ │ │ -
350 }
│ │ │ -
│ │ │ -
351
│ │ │ -
│ │ │ - │ │ │ -
353 {
│ │ │ -
354 return order() == 0 ? (dim == 3 ? 1 : 0) : (order()-2)*(order()-1)*(2*order()-3)/6;
│ │ │ -
355 }
│ │ │ -
│ │ │ -
356
│ │ │ -
357 // When the order is given at run-time, the following numbers are pre-computed:
│ │ │ -
358 std::array<size_type,dim+1> dofsPerSimplex_;
│ │ │ -
359 std::array<size_type,dim+1> dofsPerCube_;
│ │ │ - │ │ │ - │ │ │ -
362
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
371
│ │ │ -
372};
│ │ │ -
│ │ │ -
373
│ │ │ -
374
│ │ │ -
375
│ │ │ -
376template<typename GV, int k, typename R>
│ │ │ -
│ │ │ - │ │ │ -
378 public LeafBasisNode
│ │ │ -
379{
│ │ │ -
380 static constexpr int dim = GV::dimension;
│ │ │ -
381 static constexpr bool useDynamicOrder = (k<0);
│ │ │ -
382
│ │ │ -
383 // Compute the GeometryType id in case the grid has only a single GeometryType
│ │ │ -
384 static constexpr GeometryType::Id geometryTypeId()
│ │ │ -
385 {
│ │ │ -
386 if constexpr(Dune::Capabilities::hasSingleGeometryType<typename GV::Grid>::v)
│ │ │ -
387 return GeometryType(Dune::Capabilities::hasSingleGeometryType<typename GV::Grid>::topologyId, GV::dimension);
│ │ │ -
388 else
│ │ │ -
389 return GeometryType::Id(~0u);
│ │ │ -
390 }
│ │ │ -
391
│ │ │ -
392 // Select the static LFECache if k >= 0, else the dynamic LFECache
│ │ │ -
393 using FiniteElementCache = std::conditional_t<(useDynamicOrder),
│ │ │ -
394 DynamicLagrangeLocalFiniteElementCache<typename GV::ctype,R,dim>,
│ │ │ -
395 StaticLagrangeLocalFiniteElementCache<geometryTypeId(),typename GV::ctype,R,dim,std::max(k,0)>
│ │ │ -
396 >;
│ │ │ -
397
│ │ │ -
398 // Construct the FiniteElementCache depending on whether the order is dynamic or static
│ │ │ -
399 static auto makeFiniteElementCache(unsigned int order)
│ │ │ -
400 {
│ │ │ -
401 if constexpr (useDynamicOrder)
│ │ │ -
402 return FiniteElementCache{order};
│ │ │ -
403 else
│ │ │ -
404 return FiniteElementCache{};
│ │ │ -
405 }
│ │ │ -
406
│ │ │ -
407public:
│ │ │ -
408
│ │ │ -
409 using size_type = std::size_t;
│ │ │ -
410 using Element = typename GV::template Codim<0>::Entity;
│ │ │ -
411 using FiniteElement = typename FiniteElementCache::FiniteElementType;
│ │ │ -
412
│ │ │ -
│ │ │ - │ │ │ -
415 LagrangeNode(k)
│ │ │ -
416 {}
│ │ │ -
│ │ │ -
417
│ │ │ -
│ │ │ -
419 LagrangeNode(unsigned int order) :
│ │ │ -
420 order_(order),
│ │ │ -
421 cache_(makeFiniteElementCache(order)),
│ │ │ -
422 finiteElement_(nullptr),
│ │ │ -
423 element_(nullptr)
│ │ │ -
424 {}
│ │ │ -
│ │ │ -
425
│ │ │ -
│ │ │ -
427 const Element& element() const
│ │ │ -
428 {
│ │ │ -
429 return *element_;
│ │ │ -
430 }
│ │ │ -
│ │ │ -
431
│ │ │ -
│ │ │ - │ │ │ -
437 {
│ │ │ -
438 return *finiteElement_;
│ │ │ -
439 }
│ │ │ -
│ │ │ -
440
│ │ │ -
│ │ │ -
442 void bind(const Element& e)
│ │ │ -
443 {
│ │ │ -
444 element_ = &e;
│ │ │ -
445 finiteElement_ = &(cache_.get(element_->type()));
│ │ │ -
446 this->setSize(finiteElement_->size());
│ │ │ -
447 }
│ │ │ -
│ │ │ -
448
│ │ │ -
449protected:
│ │ │ -
450
│ │ │ -
│ │ │ -
451 unsigned int order() const
│ │ │ -
452 {
│ │ │ -
453 return order_;
│ │ │ -
454 }
│ │ │ -
│ │ │ -
455
│ │ │ -
456 // Run-time order, only valid if k<0
│ │ │ -
457 unsigned int order_;
│ │ │ -
458
│ │ │ -
459 FiniteElementCache cache_;
│ │ │ - │ │ │ - │ │ │ -
462};
│ │ │ -
│ │ │ -
463
│ │ │ -
464
│ │ │ -
465
│ │ │ -
466namespace BasisFactory {
│ │ │ -
467
│ │ │ -
476template<std::size_t k, typename R=double>
│ │ │ -
│ │ │ - │ │ │ -
478{
│ │ │ -
479 return [](const auto& gridView) {
│ │ │ -
480 return LagrangePreBasis<std::decay_t<decltype(gridView)>, k, R>(gridView);
│ │ │ -
481 };
│ │ │ -
482}
│ │ │ -
│ │ │ -
483
│ │ │ -
491template<typename R=double>
│ │ │ -
│ │ │ -
492auto lagrange(int order)
│ │ │ -
493{
│ │ │ -
494 return [=](const auto& gridView) {
│ │ │ -
495 return LagrangePreBasis<std::decay_t<decltype(gridView)>, -1, R>(gridView, order);
│ │ │ -
496 };
│ │ │ -
497}
│ │ │ -
│ │ │ -
498
│ │ │ -
499} // end namespace BasisFactory
│ │ │ -
500
│ │ │ -
501
│ │ │ -
502
│ │ │ -
531template<typename GV, int k=-1, typename R=double>
│ │ │ - │ │ │ -
533
│ │ │ -
534
│ │ │ -
535
│ │ │ -
536
│ │ │ -
537
│ │ │ -
538} // end namespace Functions
│ │ │ -
539} // end namespace Dune
│ │ │ -
540
│ │ │ -
541
│ │ │ -
542#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
auto lagrange()
Create a pre-basis factory that can create a Lagrange pre-basis.
Definition lagrangebasis.hh:477
│ │ │ -
DefaultGlobalBasis< LagrangePreBasis< GV, k, R > > LagrangeBasis
Nodal basis of a scalar k-th-order Lagrangean finite element space.
Definition lagrangebasis.hh:532
│ │ │ -
Definition monomialset.hh:19
│ │ │ + │ │ │ +
139 {
│ │ │ +
140 return localFunction_(geometryInAncestor_.global(x));
│ │ │ +
141 }
│ │ │ +
142
│ │ │ +
143 private:
│ │ │ +
144 std::optional<Element> element_;
│ │ │ +
145 RawLocalFunction localFunction_;
│ │ │ +
146 const CoarseEntitySet& coarseEntitySet_;
│ │ │ +
147 GeometryInAncestor geometryInAncestor_;
│ │ │ +
148 };
│ │ │ +
149
│ │ │ +
150public:
│ │ │ +
151
│ │ │ +
152 using LocalFunction = CoarseLocalFunctionOnFineGridView;
│ │ │ +
153
│ │ │ +
│ │ │ +
160 CoarseFunctionOnFineGridView(const GridFunction& function, const GridView& gridView)
│ │ │ +
161 : function_(function)
│ │ │ +
162 , entitySet_(gridView)
│ │ │ +
163 {}
│ │ │ +
│ │ │ +
164
│ │ │ +
│ │ │ + │ │ │ +
172 : function_(std::move(function))
│ │ │ +
173 , entitySet_(gridView)
│ │ │ +
174 {}
│ │ │ +
│ │ │ +
175
│ │ │ +
│ │ │ +
177 Range operator()(const Domain& x) const
│ │ │ +
178 {
│ │ │ +
179 return function_(x);
│ │ │ +
180 }
│ │ │ +
│ │ │ +
181
│ │ │ +
│ │ │ + │ │ │ +
184 {
│ │ │ +
185 if constexpr(requires{ derivative(f.rawFunction()); })
│ │ │ +
186 {
│ │ │ +
187 using RawDerivative = std::decay_t<decltype(derivative(f.rawFunction()))>;
│ │ │ + │ │ │ +
189 }
│ │ │ +
190 else
│ │ │ +
191 return typename Traits::DerivativeInterface{};
│ │ │ +
192 }
│ │ │ +
│ │ │ +
193
│ │ │ +
│ │ │ + │ │ │ +
196 {
│ │ │ +
197 return LocalFunction(localFunction(f.rawFunction()), f.rawFunction().entitySet());
│ │ │ +
198 }
│ │ │ +
│ │ │ +
199
│ │ │ +
│ │ │ +
201 const EntitySet& entitySet() const
│ │ │ +
202 {
│ │ │ +
203 return entitySet_;
│ │ │ +
204 }
│ │ │ +
│ │ │ +
205
│ │ │ +
206protected:
│ │ │ +
207
│ │ │ + │ │ │ + │ │ │ +
210};
│ │ │ +
│ │ │ +
211
│ │ │ +
212
│ │ │ +
213
│ │ │ +
214} // namespace Dune::Functions
│ │ │ +
215
│ │ │ +
216#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_COARSEFUNCTIONONFINEGRIDVIEW_HH
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │
Definition monomialset.hh:19
│ │ │ -
Definition argyrisbasis.hh:926
│ │ │ -
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:53
│ │ │ -
Definition lagrangebasis.hh:379
│ │ │ -
LagrangeNode(unsigned int order)
Constructor with a run-time order.
Definition lagrangebasis.hh:419
│ │ │ -
unsigned int order() const
Definition lagrangebasis.hh:451
│ │ │ -
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition lagrangebasis.hh:436
│ │ │ -
const Element * element_
Definition lagrangebasis.hh:461
│ │ │ -
const Element & element() const
Return current element, throw if unbound.
Definition lagrangebasis.hh:427
│ │ │ -
FiniteElementCache cache_
Definition lagrangebasis.hh:459
│ │ │ -
typename FiniteElementCache::FiniteElementType FiniteElement
Definition lagrangebasis.hh:411
│ │ │ -
void bind(const Element &e)
Bind to element.
Definition lagrangebasis.hh:442
│ │ │ -
typename GV::template Codim< 0 >::Entity Element
Definition lagrangebasis.hh:410
│ │ │ -
const FiniteElement * finiteElement_
Definition lagrangebasis.hh:460
│ │ │ -
unsigned int order_
Definition lagrangebasis.hh:457
│ │ │ -
std::size_t size_type
Definition lagrangebasis.hh:409
│ │ │ -
LagrangeNode()
Constructor without order (uses the compile-time value).
Definition lagrangebasis.hh:414
│ │ │ -
A pre-basis for a PQ-lagrange bases with given order.
Definition lagrangebasis.hh:65
│ │ │ -
size_type dofsPerPrism() const
Definition lagrangebasis.hh:325
│ │ │ -
size_type computeDofsPerCube(std::size_t cubeDim) const
Number of degrees of freedom assigned to a cube (without the ones assigned to its faces!...
Definition lagrangebasis.hh:342
│ │ │ -
size_type computeDofsPerSimplex(std::size_t simplexDim) const
Number of degrees of freedom assigned to a simplex (without the ones assigned to its faces!...
Definition lagrangebasis.hh:336
│ │ │ -
size_type computeDofsPerPrism() const
Definition lagrangebasis.hh:347
│ │ │ -
unsigned int order_
Definition lagrangebasis.hh:311
│ │ │ -
size_type edgeOffset_
Definition lagrangebasis.hh:364
│ │ │ -
LagrangeNode< GV, k, R > Node
Template mapping root tree path to type of created tree node.
Definition lagrangebasis.hh:78
│ │ │ -
std::array< size_type, dim+1 > dofsPerSimplex_
Definition lagrangebasis.hh:358
│ │ │ -
It indices(const Node &node, It it) const
Definition lagrangebasis.hh:184
│ │ │ -
size_type vertexOffset_
Definition lagrangebasis.hh:363
│ │ │ -
size_type dofsPerSimplex(std::size_t simplexDim) const
Number of degrees of freedom assigned to a simplex (without the ones assigned to its faces!...
Definition lagrangebasis.hh:314
│ │ │ -
std::size_t size_type
Type used for indices and size information.
Definition lagrangebasis.hh:75
│ │ │ -
size_type pyramidOffset_
Definition lagrangebasis.hh:368
│ │ │ -
size_type prismOffset_
Definition lagrangebasis.hh:369
│ │ │ -
size_type tetrahedronOffset_
Definition lagrangebasis.hh:367
│ │ │ -
void initializeIndices()
Initialize the global indices.
Definition lagrangebasis.hh:102
│ │ │ -
size_type computeDofsPerPyramid() const
Definition lagrangebasis.hh:352
│ │ │ -
LagrangePreBasis(const GridView &gv, unsigned int order)
Constructor for a given grid view object and run-time order.
Definition lagrangebasis.hh:86
│ │ │ -
size_type dofsPerPyramid_
Definition lagrangebasis.hh:361
│ │ │ -
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition lagrangebasis.hh:146
│ │ │ -
LagrangePreBasis(const GridView &gv)
Constructor for a given grid view object with compile-time order.
Definition lagrangebasis.hh:81
│ │ │ -
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition lagrangebasis.hh:132
│ │ │ -
GV GridView
The grid view that the FE basis is defined on.
Definition lagrangebasis.hh:72
│ │ │ -
size_type quadrilateralOffset_
Definition lagrangebasis.hh:366
│ │ │ -
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition lagrangebasis.hh:126
│ │ │ -
GridView gridView_
Definition lagrangebasis.hh:308
│ │ │ -
Node makeNode() const
Create tree node.
Definition lagrangebasis.hh:140
│ │ │ -
unsigned int order() const
Definition lagrangebasis.hh:302
│ │ │ -
std::array< size_type, dim+1 > dofsPerCube_
Definition lagrangebasis.hh:359
│ │ │ -
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition lagrangebasis.hh:176
│ │ │ -
size_type dofsPerPrism_
Definition lagrangebasis.hh:360
│ │ │ -
size_type dofsPerCube(std::size_t cubeDim) const
Number of degrees of freedom assigned to a cube (without the ones assigned to its faces!...
Definition lagrangebasis.hh:320
│ │ │ -
size_type triangleOffset_
Definition lagrangebasis.hh:365
│ │ │ -
size_type hexahedronOffset_
Definition lagrangebasis.hh:370
│ │ │ -
size_type dofsPerPyramid() const
Definition lagrangebasis.hh:330
│ │ │ -
A generic MixIn class for PreBasis.
Definition leafprebasismixin.hh:36
│ │ │ -
void setSize(const size_type size)
Definition nodes.hh:197
│ │ │ -
Definition nodes.hh:218
│ │ │ +
A geometry embedding a descendent element into an ancestor.
Definition geometryinancestor.hh:39
│ │ │ +
GlobalCoordinate global(LocalCoordinate x) const
Map local coordinate in fine element into coarse element.
Definition geometryinancestor.hh:169
│ │ │ +
const Element & bind(const Element &fineElement, F &&includeFather)
Bind this GeometryInAncestor to a fine element and search coarse element.
Definition geometryinancestor.hh:119
│ │ │ +
const Element & coarseElement() const
Return the coarse element.
Definition geometryinancestor.hh:163
│ │ │ +
friend auto derivative(const CoarseFunctionOnFineGridView &f)
Obtain global derivative of this function.
Definition coarsefunctiononfinegridview.hh:183
│ │ │ +
Dune::Functions::GridViewEntitySet< GridView, 0 > EntitySet
Definition coarsefunctiononfinegridview.hh:52
│ │ │ +
Range operator()(const Domain &x) const
Evaluate function in global coordinates.
Definition coarsefunctiononfinegridview.hh:177
│ │ │ +
typename EntitySet::GlobalCoordinate Domain
Definition coarsefunctiononfinegridview.hh:54
│ │ │ +
CoarseFunctionOnFineGridView(GridFunction &&function, const GridView &gridView)
Create CoarseFunctionOnFineGridView from GridFunction and GridView.
Definition coarsefunctiononfinegridview.hh:171
│ │ │ +
const EntitySet & entitySet() const
Return the EntitySet associated to this GridViewFunction.
Definition coarsefunctiononfinegridview.hh:201
│ │ │ +
CoarseLocalFunctionOnFineGridView LocalFunction
Definition coarsefunctiononfinegridview.hh:152
│ │ │ +
typename EntitySet::Element Element
Definition coarsefunctiononfinegridview.hh:53
│ │ │ +
GridFunction function_
Definition coarsefunctiononfinegridview.hh:208
│ │ │ +
CoarseFunctionOnFineGridView(const GridFunction &function, const GridView &gridView)
Create CoarseFunctionOnFineGridView from GridFunction and GridView.
Definition coarsefunctiononfinegridview.hh:160
│ │ │ +
EntitySet entitySet_
Definition coarsefunctiononfinegridview.hh:209
│ │ │ +
typename EntitySet::LocalCoordinate LocalDomain
Definition coarsefunctiononfinegridview.hh:55
│ │ │ +
friend LocalFunction localFunction(const CoarseFunctionOnFineGridView &f)
Create a LocalFunction for evaluation in local coordinates.
Definition coarsefunctiononfinegridview.hh:195
│ │ │ +
std::decay_t< decltype(std::declval< RawGridFunction >()(std::declval< Domain >()))> Range
Definition coarsefunctiononfinegridview.hh:56
│ │ │ +
GV GridView
Definition coarsefunctiononfinegridview.hh:51
│ │ │ +
Definition gridfunction.hh:36
│ │ │ +
An entity set for all entities of given codim in a grid view.
Definition gridviewentityset.hh:27
│ │ │ +
GridView::template Codim< codim >::Entity Element
Definition gridviewentityset.hh:36
│ │ │ +
const GridView & gridView() const
Return the associated GridView.
Definition gridviewentityset.hh:80
│ │ │ +
Element::Geometry::LocalCoordinate LocalCoordinate
Definition gridviewentityset.hh:39
│ │ │ +
Element::Geometry::GlobalCoordinate GlobalCoordinate
Definition gridviewentityset.hh:40
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,723 +1,289 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -lagrangebasis.hh │ │ │ │ +coarsefunctiononfinegridview.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_COARSEFUNCTIONONFINEGRIDVIEW_HH │ │ │ │ +8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_COARSEFUNCTIONONFINEGRIDVIEW_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ -12 │ │ │ │ -13#include │ │ │ │ -14 │ │ │ │ -15#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ -17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h> │ │ │ │ -18 │ │ │ │ -19#include │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ +12#include │ │ │ │ +13 │ │ │ │ +14#include │ │ │ │ +15 │ │ │ │ +16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ +17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_g_e_o_m_e_t_r_y_i_n_a_n_c_e_s_t_o_r_._h_h> │ │ │ │ +18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +19#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h> │ │ │ │ 20 │ │ │ │ -21namespace _D_u_n_e { │ │ │ │ -22namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +21namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ +22 │ │ │ │ 23 │ │ │ │ -24/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -25// This is the reusable part of the LagrangeBasis. It contains │ │ │ │ -26// │ │ │ │ -27// LagrangePreBasis │ │ │ │ -28// LagrangeNode │ │ │ │ -29// │ │ │ │ -30// The pre-basis allows to create the others and is the owner of possible │ │ │ │ -shared │ │ │ │ -31// state. These components do _not_ depend on the global basis and local view │ │ │ │ -32// and can be used without a global basis. │ │ │ │ -33/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -34 │ │ │ │ -35template │ │ │ │ -36class _L_a_g_r_a_n_g_e_N_o_d_e; │ │ │ │ -37 │ │ │ │ -38template │ │ │ │ -39class _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s; │ │ │ │ -40 │ │ │ │ -41 │ │ │ │ -42 │ │ │ │ -62template │ │ │ │ -_6_3class _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s : │ │ │ │ -64 public _L_e_a_f_P_r_e_B_a_s_i_s_M_i_x_i_n< LagrangePreBasis > │ │ │ │ -65{ │ │ │ │ -66 static const int dim = GV::dimension; │ │ │ │ -67 static const bool useDynamicOrder = (k<0); │ │ │ │ -68 │ │ │ │ -69public: │ │ │ │ -70 │ │ │ │ -_7_2 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ -73 │ │ │ │ -_7_5 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ -76 │ │ │ │ -_7_8 using _N_o_d_e = _L_a_g_r_a_n_g_e_N_o_d_e_<_G_V_,_ _k_,_ _R_>; │ │ │ │ -79 │ │ │ │ -_8_1 _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s(const _G_r_i_d_V_i_e_w& gv) │ │ │ │ -82 : _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s(gv, std::numeric_limits::max()) │ │ │ │ +24 │ │ │ │ +39template class │ │ │ │ +DerivativeTraits=Dune::Functions::DefaultDerivativeTraits> │ │ │ │ +_4_0class _C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w │ │ │ │ +41{ │ │ │ │ +42 using RawGridFunction = Dune::ResolveRef_t; │ │ │ │ +43 │ │ │ │ +44 auto&& rawFunction() const │ │ │ │ +45 { │ │ │ │ +46 return Dune::resolveRef(_f_u_n_c_t_i_o_n__); │ │ │ │ +47 } │ │ │ │ +48 │ │ │ │ +49public: │ │ │ │ +50 │ │ │ │ +_5_1 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ +_5_2 using _E_n_t_i_t_y_S_e_t = _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_G_r_i_d_V_i_e_w_,_ _0_>; │ │ │ │ +_5_3 using _E_l_e_m_e_n_t = typename _E_n_t_i_t_y_S_e_t_:_:_E_l_e_m_e_n_t; │ │ │ │ +_5_4 using _D_o_m_a_i_n = typename _E_n_t_i_t_y_S_e_t_:_:_G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e; │ │ │ │ +_5_5 using _L_o_c_a_l_D_o_m_a_i_n = typename _E_n_t_i_t_y_S_e_t_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e; │ │ │ │ +_5_6 using _R_a_n_g_e = std::decay_t()(std:: │ │ │ │ +declval()))>; │ │ │ │ +57 │ │ │ │ +58private: │ │ │ │ +59 │ │ │ │ +60 using CoarseEntitySet = std::decay_t │ │ │ │ +().entitySet())>; │ │ │ │ +61 using GeometryInAncestor = _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_<_E_l_e_m_e_n_t_>; │ │ │ │ +62 using Traits = Dune::Functions::Imp::GridFunctionTraits<_R_a_n_g_e(_D_o_m_a_i_n), │ │ │ │ +_E_n_t_i_t_y_S_e_t, DerivativeTraits, 56>; │ │ │ │ +63 │ │ │ │ +64 class CoarseLocalFunctionOnFineGridView │ │ │ │ +65 { │ │ │ │ +66 using Traits = typename CoarseFunctionOnFineGridView::Traits:: │ │ │ │ +LocalFunctionTraits; │ │ │ │ +67 │ │ │ │ +68 public: │ │ │ │ +69 │ │ │ │ +70 using Derivative = decltype(_l_o_c_a_l_F_u_n_c_t_i_o_n(_d_e_r_i_v_a_t_i_v_e(std:: │ │ │ │ +declval()))); │ │ │ │ +71 using RawLocalFunction = std::decay_t()))>; │ │ │ │ +72 │ │ │ │ +78 CoarseLocalFunctionOnFineGridView(RawLocalFunction&& _l_o_c_a_l_F_u_n_c_t_i_o_n, const │ │ │ │ +CoarseEntitySet& coarseEntitySet) │ │ │ │ +79 : element_() │ │ │ │ +80 , localFunction_(_l_o_c_a_l_F_u_n_c_t_i_o_n) │ │ │ │ +81 , coarseEntitySet_(coarseEntitySet) │ │ │ │ +82 , geometryInAncestor_() │ │ │ │ 83 {} │ │ │ │ 84 │ │ │ │ -_8_6 _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s(const _G_r_i_d_V_i_e_w& gv, unsigned int _o_r_d_e_r) : │ │ │ │ -87 _g_r_i_d_V_i_e_w__(gv), _o_r_d_e_r__(_o_r_d_e_r) │ │ │ │ -88 { │ │ │ │ -89 if (!useDynamicOrder && _o_r_d_e_r!=std::numeric_limits::max()) │ │ │ │ -90 DUNE_THROW(RangeError, "Template argument k has to be -1 when supplying a │ │ │ │ -run-time order!"); │ │ │ │ -91 │ │ │ │ -92 for (int i=0; i<=dim; i++) │ │ │ │ -93 { │ │ │ │ -94 _d_o_f_s_P_e_r_C_u_b_e__[i] = _c_o_m_p_u_t_e_D_o_f_s_P_e_r_C_u_b_e(i); │ │ │ │ -95 _d_o_f_s_P_e_r_S_i_m_p_l_e_x__[i] = _c_o_m_p_u_t_e_D_o_f_s_P_e_r_S_i_m_p_l_e_x(i); │ │ │ │ -96 } │ │ │ │ -97 _d_o_f_s_P_e_r_P_r_i_s_m__ = _c_o_m_p_u_t_e_D_o_f_s_P_e_r_P_r_i_s_m(); │ │ │ │ -98 _d_o_f_s_P_e_r_P_y_r_a_m_i_d__ = _c_o_m_p_u_t_e_D_o_f_s_P_e_r_P_y_r_a_m_i_d(); │ │ │ │ -99 } │ │ │ │ -100 │ │ │ │ -_1_0_2 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ -103 { │ │ │ │ -104 _v_e_r_t_e_x_O_f_f_s_e_t__ = 0; │ │ │ │ -105 _e_d_g_e_O_f_f_s_e_t__ = _v_e_r_t_e_x_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_C_u_b_e(0) * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size │ │ │ │ -(dim)); │ │ │ │ -106 │ │ │ │ -107 if (dim>=2) │ │ │ │ -108 { │ │ │ │ -109 _t_r_i_a_n_g_l_e_O_f_f_s_e_t__ = _e_d_g_e_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_C_u_b_e(1) * ((_s_i_z_e___t_y_p_e) │ │ │ │ -_g_r_i_d_V_i_e_w__.size(dim-1)); │ │ │ │ -110 │ │ │ │ -111 _q_u_a_d_r_i_l_a_t_e_r_a_l_O_f_f_s_e_t__ = _t_r_i_a_n_g_l_e_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_S_i_m_p_l_e_x(2) * ( │ │ │ │ -(_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes::triangle)); │ │ │ │ -112 } │ │ │ │ -113 │ │ │ │ -114 if (dim==3) { │ │ │ │ -115 _t_e_t_r_a_h_e_d_r_o_n_O_f_f_s_e_t__ = _q_u_a_d_r_i_l_a_t_e_r_a_l_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_C_u_b_e(2) * ( │ │ │ │ -(_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes::quadrilateral)); │ │ │ │ -116 │ │ │ │ -117 _p_r_i_s_m_O_f_f_s_e_t__ = _t_e_t_r_a_h_e_d_r_o_n_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_S_i_m_p_l_e_x(3) * ( │ │ │ │ -(_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes::tetrahedron)); │ │ │ │ -118 │ │ │ │ -119 _h_e_x_a_h_e_d_r_o_n_O_f_f_s_e_t__ = _p_r_i_s_m_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_P_r_i_s_m() * ( │ │ │ │ -(_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes::prism)); │ │ │ │ -120 │ │ │ │ -121 _p_y_r_a_m_i_d_O_f_f_s_e_t__ = _h_e_x_a_h_e_d_r_o_n_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_C_u_b_e(3) * ( │ │ │ │ -(_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes::hexahedron)); │ │ │ │ -122 } │ │ │ │ -123 } │ │ │ │ -124 │ │ │ │ -_1_2_6 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ -127 { │ │ │ │ -128 return _g_r_i_d_V_i_e_w__; │ │ │ │ -129 } │ │ │ │ -130 │ │ │ │ -_1_3_2 void _u_p_d_a_t_e (const _G_r_i_d_V_i_e_w& gv) │ │ │ │ -133 { │ │ │ │ -134 _g_r_i_d_V_i_e_w__ = gv; │ │ │ │ +90 CoarseLocalFunctionOnFineGridView( │ │ │ │ +91 RawLocalFunction&& _l_o_c_a_l_F_u_n_c_t_i_o_n, │ │ │ │ +92 const CoarseEntitySet& coarseEntitySet, │ │ │ │ +93 const GeometryInAncestor& geometryInAncestor, │ │ │ │ +94 const std::optional& element │ │ │ │ +95 ) │ │ │ │ +96 : element_(element) │ │ │ │ +97 , localFunction_(_l_o_c_a_l_F_u_n_c_t_i_o_n) │ │ │ │ +98 , coarseEntitySet_(coarseEntitySet) │ │ │ │ +99 , geometryInAncestor_(geometryInAncestor, *element_) │ │ │ │ +100 {} │ │ │ │ +101 │ │ │ │ +103 void bind(const _E_l_e_m_e_n_t& element) │ │ │ │ +104 { │ │ │ │ +105 element_ = element; │ │ │ │ +106 geometryInAncestor_._b_i_n_d(*element_, [&](const auto& e) { return not │ │ │ │ +coarseEntitySet_.contains(e); }); │ │ │ │ +107 localFunction_.bind(geometryInAncestor_._c_o_a_r_s_e_E_l_e_m_e_n_t()); │ │ │ │ +108 } │ │ │ │ +109 │ │ │ │ +111 void unbind() │ │ │ │ +112 { │ │ │ │ +113 element_.reset(); │ │ │ │ +114 } │ │ │ │ +115 │ │ │ │ +117 bool bound() const │ │ │ │ +118 { │ │ │ │ +119 return static_cast(element_); │ │ │ │ +120 } │ │ │ │ +121 │ │ │ │ +123 const _E_l_e_m_e_n_t& localContext() const │ │ │ │ +124 { │ │ │ │ +125 return *element_; │ │ │ │ +126 } │ │ │ │ +127 │ │ │ │ +129 friend auto _d_e_r_i_v_a_t_i_v_e(const CoarseLocalFunctionOnFineGridView& f) │ │ │ │ +130 { │ │ │ │ +131 if constexpr(requires{ _d_e_r_i_v_a_t_i_v_e(f.localFunction_); }) │ │ │ │ +132 return Derivative(_d_e_r_i_v_a_t_i_v_e(f.localFunction_), f.coarseEntitySet_, │ │ │ │ +f.geometryInAncestor_, f.element_); │ │ │ │ +133 else │ │ │ │ +134 return typename Traits::DerivativeInterface{}; │ │ │ │ 135 } │ │ │ │ 136 │ │ │ │ -_1_4_0 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ -141 { │ │ │ │ -142 return _N_o_d_e{_o_r_d_e_r__}; │ │ │ │ -143 } │ │ │ │ -144 │ │ │ │ -_1_4_6 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ -147 { │ │ │ │ -148 switch (dim) │ │ │ │ -149 { │ │ │ │ -150 case 1: │ │ │ │ -151 return _d_o_f_s_P_e_r_C_u_b_e(0) * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(dim)) │ │ │ │ -152 + _d_o_f_s_P_e_r_C_u_b_e(1) * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(dim-1)); │ │ │ │ -153 case 2: │ │ │ │ -154 { │ │ │ │ -155 return _d_o_f_s_P_e_r_C_u_b_e(0) * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(dim)) │ │ │ │ -156 + _d_o_f_s_P_e_r_C_u_b_e(1) * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(dim-1)) │ │ │ │ -157 + _d_o_f_s_P_e_r_S_i_m_p_l_e_x(2) * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes:: │ │ │ │ -triangle)) │ │ │ │ -158 + _d_o_f_s_P_e_r_C_u_b_e(2) * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes:: │ │ │ │ -quadrilateral)); │ │ │ │ -159 } │ │ │ │ -160 case 3: │ │ │ │ -161 { │ │ │ │ -162 return _d_o_f_s_P_e_r_C_u_b_e(0) * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(dim)) │ │ │ │ -163 + _d_o_f_s_P_e_r_C_u_b_e(1) * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(dim-1)) │ │ │ │ -164 + _d_o_f_s_P_e_r_S_i_m_p_l_e_x(2) * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes:: │ │ │ │ -triangle)) │ │ │ │ -165 + _d_o_f_s_P_e_r_C_u_b_e(2) * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes:: │ │ │ │ -quadrilateral)) │ │ │ │ -166 + _d_o_f_s_P_e_r_S_i_m_p_l_e_x(3) * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes:: │ │ │ │ -tetrahedron)) │ │ │ │ -167 + _d_o_f_s_P_e_r_P_y_r_a_m_i_d() * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes:: │ │ │ │ -pyramid)) │ │ │ │ -168 + _d_o_f_s_P_e_r_P_r_i_s_m() * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes::prism)) │ │ │ │ -169 + _d_o_f_s_P_e_r_C_u_b_e(3) * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes:: │ │ │ │ -hexahedron)); │ │ │ │ -170 } │ │ │ │ -171 } │ │ │ │ -172 DUNE_THROW(Dune::NotImplemented, "No size method for " << dim << "d grids │ │ │ │ -available yet!"); │ │ │ │ -173 } │ │ │ │ -174 │ │ │ │ -_1_7_6 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ -177 { │ │ │ │ -178 // That cast to unsigned int is necessary because GV::dimension is an enum, │ │ │ │ -179 // which is not recognized by the power method as an integer type... │ │ │ │ -180 return power(_o_r_d_e_r()+1, (unsigned int)GV::dimension); │ │ │ │ -181 } │ │ │ │ -182 │ │ │ │ -183 template │ │ │ │ -_1_8_4 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ -185 { │ │ │ │ -186 for (_s_i_z_e___t_y_p_e i = 0, end = node._f_i_n_i_t_e_E_l_e_m_e_n_t().size() ; i < end ; ++it, │ │ │ │ -++i) │ │ │ │ -187 { │ │ │ │ -188 Dune::LocalKey localKey = node._f_i_n_i_t_e_E_l_e_m_e_n_t().localCoefficients().localKey │ │ │ │ -(i); │ │ │ │ -189 const auto& gridIndexSet = _g_r_i_d_V_i_e_w().indexSet(); │ │ │ │ -190 const auto& element = node._e_l_e_m_e_n_t(); │ │ │ │ -191 │ │ │ │ -192 // The dimension of the entity that the current dof is related to │ │ │ │ -193 auto dofDim = dim - localKey.codim(); │ │ │ │ -194 │ │ │ │ -195 // Test for a vertex dof │ │ │ │ -196 // The test for k==1 is redundant, but having it here allows the compiler │ │ │ │ -to conclude │ │ │ │ -197 // at compile-time that the dofDim==0 case is the only one that will ever │ │ │ │ -happen. │ │ │ │ -198 // This leads to measurable speed-up: see │ │ │ │ -199 // https://gitlab.dune-project.org/staging/dune-functions/issues/30 │ │ │ │ -200 if (k==1 || dofDim==0) { │ │ │ │ -201 *it = {{ (_s_i_z_e___t_y_p_e)(gridIndexSet.subIndex(element,localKey.subEntity │ │ │ │ -(),dim)) }}; │ │ │ │ -202 continue; │ │ │ │ -203 } │ │ │ │ -204 │ │ │ │ -205 if (dofDim==1) │ │ │ │ -206 { // edge dof │ │ │ │ -207 if (dim==1) // element dof -- any local numbering is fine │ │ │ │ -208 { │ │ │ │ -209 *it = {{ _e_d_g_e_O_f_f_s_e_t__ │ │ │ │ -210 + _d_o_f_s_P_e_r_C_u_b_e(1) * ((_s_i_z_e___t_y_p_e)gridIndexSet.subIndex(element,0,0)) │ │ │ │ -211 + localKey.index() }}; │ │ │ │ -212 continue; │ │ │ │ -213 } │ │ │ │ -214 else │ │ │ │ -215 { │ │ │ │ -216 const auto refElement │ │ │ │ -217 = Dune::referenceElement(element.type()); │ │ │ │ -218 │ │ │ │ -219 // We have to reverse the numbering if the local element edge is │ │ │ │ -220 // not aligned with the global edge. │ │ │ │ -221 auto v0 = (_s_i_z_e___t_y_p_e)gridIndexSet.subIndex(element,refElement.subEntity │ │ │ │ -(localKey.subEntity(),localKey.codim(),0,dim),dim); │ │ │ │ -222 auto v1 = (_s_i_z_e___t_y_p_e)gridIndexSet.subIndex(element,refElement.subEntity │ │ │ │ -(localKey.subEntity(),localKey.codim(),1,dim),dim); │ │ │ │ -223 bool flip = (v0 > v1); │ │ │ │ -224 *it = {{ (flip) │ │ │ │ -225 ? _e_d_g_e_O_f_f_s_e_t__ │ │ │ │ -226 + _d_o_f_s_P_e_r_C_u_b_e(1)*((_s_i_z_e___t_y_p_e)gridIndexSet.subIndex │ │ │ │ -(element,localKey.subEntity(),localKey.codim())) │ │ │ │ -227 + (_d_o_f_s_P_e_r_C_u_b_e(1)-1)-localKey.index() │ │ │ │ -228 : _e_d_g_e_O_f_f_s_e_t__ │ │ │ │ -229 + _d_o_f_s_P_e_r_C_u_b_e(1)*((_s_i_z_e___t_y_p_e)gridIndexSet.subIndex │ │ │ │ -(element,localKey.subEntity(),localKey.codim())) │ │ │ │ -230 + localKey.index() }}; │ │ │ │ -231 continue; │ │ │ │ -232 } │ │ │ │ -233 } │ │ │ │ -234 │ │ │ │ -235 if (dofDim==2) │ │ │ │ -236 { │ │ │ │ -237 if (dim==2) // element dof -- any local numbering is fine │ │ │ │ -238 { │ │ │ │ -239 if (element.type().isTriangle()) │ │ │ │ -240 { │ │ │ │ -241 *it = {{ _t_r_i_a_n_g_l_e_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_S_i_m_p_l_e_x(2)*( │ │ │ │ -(_s_i_z_e___t_y_p_e)gridIndexSet.subIndex(element,0,0)) + localKey.index() }}; │ │ │ │ -242 continue; │ │ │ │ -243 } │ │ │ │ -244 else if (element.type().isQuadrilateral()) │ │ │ │ -245 { │ │ │ │ -246 *it = {{ _q_u_a_d_r_i_l_a_t_e_r_a_l_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_C_u_b_e(2)*( │ │ │ │ -(_s_i_z_e___t_y_p_e)gridIndexSet.subIndex(element,0,0)) + localKey.index() }}; │ │ │ │ -247 continue; │ │ │ │ -248 } │ │ │ │ -249 else │ │ │ │ -250 DUNE_THROW(Dune::NotImplemented, "2d elements have to be triangles or │ │ │ │ -quadrilaterals"); │ │ │ │ -251 } else │ │ │ │ -252 { │ │ │ │ -253 const auto refElement │ │ │ │ -254 = Dune::referenceElement(element.type()); │ │ │ │ -255 │ │ │ │ -256 if (_o_r_d_e_r()>3) │ │ │ │ -257 DUNE_THROW(Dune::NotImplemented, "LagrangeBasis for 3D grids is only │ │ │ │ -implemented if k<=3"); │ │ │ │ -258 │ │ │ │ -259 if (_o_r_d_e_r()==3 and !refElement.type(localKey.subEntity(), localKey.codim │ │ │ │ -()).isTriangle()) │ │ │ │ -260 DUNE_THROW(Dune::NotImplemented, "LagrangeBasis for 3D grids with k==3 is │ │ │ │ -only implemented if the grid is a simplex grid"); │ │ │ │ -261 │ │ │ │ -262 *it = {{ _t_r_i_a_n_g_l_e_O_f_f_s_e_t__ + ((_s_i_z_e___t_y_p_e)gridIndexSet.subIndex │ │ │ │ -(element,localKey.subEntity(),localKey.codim())) }}; │ │ │ │ -263 continue; │ │ │ │ -264 } │ │ │ │ -265 } │ │ │ │ -266 │ │ │ │ -267 if (dofDim==3) │ │ │ │ -268 { │ │ │ │ -269 if (dim==3) // element dof -- any local numbering is fine │ │ │ │ -270 { │ │ │ │ -271 if (element.type().isTetrahedron()) │ │ │ │ -272 { │ │ │ │ -273 *it = {{ _t_e_t_r_a_h_e_d_r_o_n_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_S_i_m_p_l_e_x(3)*( │ │ │ │ -(_s_i_z_e___t_y_p_e)gridIndexSet.subIndex(element,0,0)) + localKey.index() }}; │ │ │ │ -274 continue; │ │ │ │ -275 } │ │ │ │ -276 else if (element.type().isHexahedron()) │ │ │ │ -277 { │ │ │ │ -278 *it = {{ _h_e_x_a_h_e_d_r_o_n_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_C_u_b_e(3)*( │ │ │ │ -(_s_i_z_e___t_y_p_e)gridIndexSet.subIndex(element,0,0)) + localKey.index() }}; │ │ │ │ -279 continue; │ │ │ │ -280 } │ │ │ │ -281 else if (element.type().isPrism()) │ │ │ │ -282 { │ │ │ │ -283 *it = {{ _p_r_i_s_m_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_P_r_i_s_m()*((_s_i_z_e___t_y_p_e)gridIndexSet.subIndex │ │ │ │ -(element,0,0)) + localKey.index() }}; │ │ │ │ -284 continue; │ │ │ │ -285 } │ │ │ │ -286 else if (element.type().isPyramid()) │ │ │ │ -287 { │ │ │ │ -288 *it = {{ _p_y_r_a_m_i_d_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_P_y_r_a_m_i_d()*( │ │ │ │ -(_s_i_z_e___t_y_p_e)gridIndexSet.subIndex(element,0,0)) + localKey.index() }}; │ │ │ │ -289 continue; │ │ │ │ -290 } │ │ │ │ -291 else │ │ │ │ -292 DUNE_THROW(Dune::NotImplemented, "3d elements have to be tetrahedra, │ │ │ │ -hexahedra, prisms, or pyramids"); │ │ │ │ -293 } else │ │ │ │ -294 DUNE_THROW(Dune::NotImplemented, "Grids of dimension larger than 3 are no │ │ │ │ -supported"); │ │ │ │ -295 } │ │ │ │ -296 DUNE_THROW(Dune::NotImplemented, "Grid contains elements not supported for │ │ │ │ -the LagrangeBasis"); │ │ │ │ -297 } │ │ │ │ -298 return it; │ │ │ │ -299 } │ │ │ │ -300 │ │ │ │ -_3_0_2 unsigned int _o_r_d_e_r() const │ │ │ │ -303 { │ │ │ │ -304 return (useDynamicOrder) ? _o_r_d_e_r__ : k; │ │ │ │ -305 } │ │ │ │ -306 │ │ │ │ -307protected: │ │ │ │ -_3_0_8 _G_r_i_d_V_i_e_w _g_r_i_d_V_i_e_w__; │ │ │ │ -309 │ │ │ │ -310 // Run-time order, only valid if k<0 │ │ │ │ -_3_1_1 unsigned int _o_r_d_e_r__; │ │ │ │ -312 │ │ │ │ -_3_1_4 _s_i_z_e___t_y_p_e _d_o_f_s_P_e_r_S_i_m_p_l_e_x(std::size_t simplexDim) const │ │ │ │ -315 { │ │ │ │ -316 return useDynamicOrder ? _d_o_f_s_P_e_r_S_i_m_p_l_e_x__[simplexDim] : │ │ │ │ -_c_o_m_p_u_t_e_D_o_f_s_P_e_r_S_i_m_p_l_e_x(simplexDim); │ │ │ │ -317 } │ │ │ │ -318 │ │ │ │ -_3_2_0 _s_i_z_e___t_y_p_e _d_o_f_s_P_e_r_C_u_b_e(std::size_t cubeDim) const │ │ │ │ -321 { │ │ │ │ -322 return useDynamicOrder ? _d_o_f_s_P_e_r_C_u_b_e__[cubeDim] : _c_o_m_p_u_t_e_D_o_f_s_P_e_r_C_u_b_e │ │ │ │ -(cubeDim); │ │ │ │ -323 } │ │ │ │ -324 │ │ │ │ -_3_2_5 _s_i_z_e___t_y_p_e _d_o_f_s_P_e_r_P_r_i_s_m() const │ │ │ │ -326 { │ │ │ │ -327 return useDynamicOrder ? _d_o_f_s_P_e_r_P_r_i_s_m__ : _c_o_m_p_u_t_e_D_o_f_s_P_e_r_P_r_i_s_m(); │ │ │ │ -328 } │ │ │ │ -329 │ │ │ │ -_3_3_0 _s_i_z_e___t_y_p_e _d_o_f_s_P_e_r_P_y_r_a_m_i_d() const │ │ │ │ -331 { │ │ │ │ -332 return useDynamicOrder ? _d_o_f_s_P_e_r_P_y_r_a_m_i_d__ : _c_o_m_p_u_t_e_D_o_f_s_P_e_r_P_y_r_a_m_i_d(); │ │ │ │ -333 } │ │ │ │ -334 │ │ │ │ -_3_3_6 _s_i_z_e___t_y_p_e _c_o_m_p_u_t_e_D_o_f_s_P_e_r_S_i_m_p_l_e_x(std::size_t simplexDim) const │ │ │ │ -337 { │ │ │ │ -338 return _o_r_d_e_r() == 0 ? (dim == simplexDim ? 1 : 0) : Dune::binomial(std:: │ │ │ │ -size_t(_o_r_d_e_r()-1),simplexDim); │ │ │ │ -339 } │ │ │ │ -340 │ │ │ │ -_3_4_2 _s_i_z_e___t_y_p_e _c_o_m_p_u_t_e_D_o_f_s_P_e_r_C_u_b_e(std::size_t cubeDim) const │ │ │ │ -343 { │ │ │ │ -344 return _o_r_d_e_r() == 0 ? (dim == cubeDim ? 1 : 0) : Dune::power(_o_r_d_e_r()-1, │ │ │ │ -cubeDim); │ │ │ │ -345 } │ │ │ │ -346 │ │ │ │ -_3_4_7 _s_i_z_e___t_y_p_e _c_o_m_p_u_t_e_D_o_f_s_P_e_r_P_r_i_s_m() const │ │ │ │ -348 { │ │ │ │ -349 return _o_r_d_e_r() == 0 ? (dim == 3 ? 1 : 0) : (_o_r_d_e_r()-1)*(_o_r_d_e_r()-1)*(_o_r_d_e_r │ │ │ │ -()-2)/2; │ │ │ │ -350 } │ │ │ │ -351 │ │ │ │ -_3_5_2 _s_i_z_e___t_y_p_e _c_o_m_p_u_t_e_D_o_f_s_P_e_r_P_y_r_a_m_i_d() const │ │ │ │ -353 { │ │ │ │ -354 return _o_r_d_e_r() == 0 ? (dim == 3 ? 1 : 0) : (_o_r_d_e_r()-2)*(_o_r_d_e_r()-1)*(2*_o_r_d_e_r │ │ │ │ -()-3)/6; │ │ │ │ -355 } │ │ │ │ -356 │ │ │ │ -357 // When the order is given at run-time, the following numbers are pre- │ │ │ │ -computed: │ │ │ │ -_3_5_8 std::array _d_o_f_s_P_e_r_S_i_m_p_l_e_x__; │ │ │ │ -_3_5_9 std::array _d_o_f_s_P_e_r_C_u_b_e__; │ │ │ │ -_3_6_0 _s_i_z_e___t_y_p_e _d_o_f_s_P_e_r_P_r_i_s_m__; │ │ │ │ -_3_6_1 _s_i_z_e___t_y_p_e _d_o_f_s_P_e_r_P_y_r_a_m_i_d__; │ │ │ │ -362 │ │ │ │ -_3_6_3 _s_i_z_e___t_y_p_e _v_e_r_t_e_x_O_f_f_s_e_t__; │ │ │ │ -_3_6_4 _s_i_z_e___t_y_p_e _e_d_g_e_O_f_f_s_e_t__; │ │ │ │ -_3_6_5 _s_i_z_e___t_y_p_e _t_r_i_a_n_g_l_e_O_f_f_s_e_t__; │ │ │ │ -_3_6_6 _s_i_z_e___t_y_p_e _q_u_a_d_r_i_l_a_t_e_r_a_l_O_f_f_s_e_t__; │ │ │ │ -_3_6_7 _s_i_z_e___t_y_p_e _t_e_t_r_a_h_e_d_r_o_n_O_f_f_s_e_t__; │ │ │ │ -_3_6_8 _s_i_z_e___t_y_p_e _p_y_r_a_m_i_d_O_f_f_s_e_t__; │ │ │ │ -_3_6_9 _s_i_z_e___t_y_p_e _p_r_i_s_m_O_f_f_s_e_t__; │ │ │ │ -_3_7_0 _s_i_z_e___t_y_p_e _h_e_x_a_h_e_d_r_o_n_O_f_f_s_e_t__; │ │ │ │ -371 │ │ │ │ -372}; │ │ │ │ -373 │ │ │ │ -374 │ │ │ │ -375 │ │ │ │ -376template │ │ │ │ -_3_7_7class _L_a_g_r_a_n_g_e_N_o_d_e : │ │ │ │ -378 public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ -379{ │ │ │ │ -380 static constexpr int dim = GV::dimension; │ │ │ │ -381 static constexpr bool useDynamicOrder = (k<0); │ │ │ │ -382 │ │ │ │ -383 // Compute the GeometryType id in case the grid has only a single │ │ │ │ -GeometryType │ │ │ │ -384 static constexpr GeometryType::Id geometryTypeId() │ │ │ │ -385 { │ │ │ │ -386 if constexpr(Dune::Capabilities::hasSingleGeometryType:: │ │ │ │ -v) │ │ │ │ -387 return GeometryType(Dune::Capabilities::hasSingleGeometryType::topologyId, GV::dimension); │ │ │ │ -388 else │ │ │ │ -389 return GeometryType::Id(~0u); │ │ │ │ -390 } │ │ │ │ -391 │ │ │ │ -392 // Select the static LFECache if k >= 0, else the dynamic LFECache │ │ │ │ -393 using FiniteElementCache = std::conditional_t<(useDynamicOrder), │ │ │ │ -394 DynamicLagrangeLocalFiniteElementCache, │ │ │ │ -395 StaticLagrangeLocalFiniteElementCache │ │ │ │ -396 >; │ │ │ │ -397 │ │ │ │ -398 // Construct the FiniteElementCache depending on whether the order is │ │ │ │ -dynamic or static │ │ │ │ -399 static auto makeFiniteElementCache(unsigned int _o_r_d_e_r) │ │ │ │ -400 { │ │ │ │ -401 if constexpr (useDynamicOrder) │ │ │ │ -402 return FiniteElementCache{_o_r_d_e_r}; │ │ │ │ -403 else │ │ │ │ -404 return FiniteElementCache{}; │ │ │ │ -405 } │ │ │ │ -406 │ │ │ │ -407public: │ │ │ │ -408 │ │ │ │ -_4_0_9 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ -_4_1_0 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ -_4_1_1 using _F_i_n_i_t_e_E_l_e_m_e_n_t = typename FiniteElementCache::FiniteElementType; │ │ │ │ -412 │ │ │ │ -_4_1_4 _L_a_g_r_a_n_g_e_N_o_d_e() : │ │ │ │ -415 _L_a_g_r_a_n_g_e_N_o_d_e(k) │ │ │ │ -416 {} │ │ │ │ -417 │ │ │ │ -_4_1_9 _L_a_g_r_a_n_g_e_N_o_d_e(unsigned int _o_r_d_e_r) : │ │ │ │ -420 _o_r_d_e_r__(_o_r_d_e_r), │ │ │ │ -421 _c_a_c_h_e__(makeFiniteElementCache(_o_r_d_e_r)), │ │ │ │ -422 _f_i_n_i_t_e_E_l_e_m_e_n_t__(nullptr), │ │ │ │ -423 _e_l_e_m_e_n_t__(nullptr) │ │ │ │ -424 {} │ │ │ │ -425 │ │ │ │ -_4_2_7 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ -428 { │ │ │ │ -429 return *_e_l_e_m_e_n_t__; │ │ │ │ -430 } │ │ │ │ -431 │ │ │ │ -_4_3_6 const _F_i_n_i_t_e_E_l_e_m_e_n_t& _f_i_n_i_t_e_E_l_e_m_e_n_t() const │ │ │ │ -437 { │ │ │ │ -438 return *_f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ -439 } │ │ │ │ -440 │ │ │ │ -_4_4_2 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ -443 { │ │ │ │ -444 _e_l_e_m_e_n_t__ = &e; │ │ │ │ -445 _f_i_n_i_t_e_E_l_e_m_e_n_t__ = &(_c_a_c_h_e__.get(_e_l_e_m_e_n_t__->type())); │ │ │ │ -446 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__->size()); │ │ │ │ -447 } │ │ │ │ -448 │ │ │ │ -449protected: │ │ │ │ -450 │ │ │ │ -_4_5_1 unsigned int _o_r_d_e_r() const │ │ │ │ -452 { │ │ │ │ -453 return _o_r_d_e_r__; │ │ │ │ -454 } │ │ │ │ -455 │ │ │ │ -456 // Run-time order, only valid if k<0 │ │ │ │ -_4_5_7 unsigned int _o_r_d_e_r__; │ │ │ │ -458 │ │ │ │ -_4_5_9 FiniteElementCache _c_a_c_h_e__; │ │ │ │ -_4_6_0 const _F_i_n_i_t_e_E_l_e_m_e_n_t* _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ -_4_6_1 const _E_l_e_m_e_n_t* _e_l_e_m_e_n_t__; │ │ │ │ -462}; │ │ │ │ -463 │ │ │ │ -464 │ │ │ │ -465 │ │ │ │ -466namespace _B_a_s_i_s_F_a_c_t_o_r_y { │ │ │ │ -467 │ │ │ │ -476template │ │ │ │ -_4_7_7auto _l_a_g_r_a_n_g_e() │ │ │ │ -478{ │ │ │ │ -479 return [](const auto& gridView) { │ │ │ │ -480 return _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s, k, R>(gridView); │ │ │ │ -481 }; │ │ │ │ -482} │ │ │ │ -483 │ │ │ │ -491template │ │ │ │ -_4_9_2auto _l_a_g_r_a_n_g_e(int order) │ │ │ │ -493{ │ │ │ │ -494 return [=](const auto& gridView) { │ │ │ │ -495 return _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s, -1, R>(gridView, │ │ │ │ -order); │ │ │ │ -496 }; │ │ │ │ -497} │ │ │ │ -498 │ │ │ │ -499} // end namespace BasisFactory │ │ │ │ -500 │ │ │ │ -501 │ │ │ │ -502 │ │ │ │ -531template │ │ │ │ -_5_3_2using _L_a_g_r_a_n_g_e_B_a_s_i_s = _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_G_V_,_ _k_,_ _R_> >; │ │ │ │ -533 │ │ │ │ -534 │ │ │ │ -535 │ │ │ │ -536 │ │ │ │ -537 │ │ │ │ -538} // end namespace Functions │ │ │ │ -539} // end namespace Dune │ │ │ │ -540 │ │ │ │ -541 │ │ │ │ -542#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH │ │ │ │ -_n_o_d_e_s_._h_h │ │ │ │ -_l_e_a_f_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h │ │ │ │ -_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_l_a_g_r_a_n_g_e │ │ │ │ -auto lagrange() │ │ │ │ -Create a pre-basis factory that can create a Lagrange pre-basis. │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:477 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_B_a_s_i_s │ │ │ │ -DefaultGlobalBasis< LagrangePreBasis< GV, k, R > > LagrangeBasis │ │ │ │ -Nodal basis of a scalar k-th-order Lagrangean finite element space. │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:532 │ │ │ │ -_D_u_n_e │ │ │ │ -DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ +138 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(_L_o_c_a_l_D_o_m_a_i_n x) const │ │ │ │ +139 { │ │ │ │ +140 return localFunction_(geometryInAncestor_._g_l_o_b_a_l(x)); │ │ │ │ +141 } │ │ │ │ +142 │ │ │ │ +143 private: │ │ │ │ +144 std::optional element_; │ │ │ │ +145 RawLocalFunction localFunction_; │ │ │ │ +146 const CoarseEntitySet& coarseEntitySet_; │ │ │ │ +147 GeometryInAncestor geometryInAncestor_; │ │ │ │ +148 }; │ │ │ │ +149 │ │ │ │ +150public: │ │ │ │ +151 │ │ │ │ +_1_5_2 using _L_o_c_a_l_F_u_n_c_t_i_o_n = CoarseLocalFunctionOnFineGridView; │ │ │ │ +153 │ │ │ │ +_1_6_0 _C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w(const _G_r_i_d_F_u_n_c_t_i_o_n& function, const _G_r_i_d_V_i_e_w& │ │ │ │ +gridView) │ │ │ │ +161 : _f_u_n_c_t_i_o_n__(function) │ │ │ │ +162 , _e_n_t_i_t_y_S_e_t__(gridView) │ │ │ │ +163 {} │ │ │ │ +164 │ │ │ │ +_1_7_1 _C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w(_G_r_i_d_F_u_n_c_t_i_o_n&& function, const _G_r_i_d_V_i_e_w& │ │ │ │ +gridView) │ │ │ │ +172 : _f_u_n_c_t_i_o_n__(std::move(function)) │ │ │ │ +173 , _e_n_t_i_t_y_S_e_t__(gridView) │ │ │ │ +174 {} │ │ │ │ +175 │ │ │ │ +_1_7_7 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(const _D_o_m_a_i_n& x) const │ │ │ │ +178 { │ │ │ │ +179 return _f_u_n_c_t_i_o_n__(x); │ │ │ │ +180 } │ │ │ │ +181 │ │ │ │ +_1_8_3 friend auto _d_e_r_i_v_a_t_i_v_e(const _C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w& f) │ │ │ │ +184 { │ │ │ │ +185 if constexpr(requires{ _d_e_r_i_v_a_t_i_v_e(f.rawFunction()); }) │ │ │ │ +186 { │ │ │ │ +187 using RawDerivative = std::decay_t; │ │ │ │ +188 return _C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_<_R_a_w_D_e_r_i_v_a_t_i_v_e_,_ _G_r_i_d_V_i_e_w_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_>(_d_e_r_i_v_a_t_i_v_e(f.rawFunction()), f._e_n_t_i_t_y_S_e_t__._g_r_i_d_V_i_e_w()); │ │ │ │ +189 } │ │ │ │ +190 else │ │ │ │ +191 return typename Traits::DerivativeInterface{}; │ │ │ │ +192 } │ │ │ │ +193 │ │ │ │ +_1_9_5 friend _L_o_c_a_l_F_u_n_c_t_i_o_n _l_o_c_a_l_F_u_n_c_t_i_o_n(const _C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w& f) │ │ │ │ +196 { │ │ │ │ +197 return _L_o_c_a_l_F_u_n_c_t_i_o_n(_l_o_c_a_l_F_u_n_c_t_i_o_n(f.rawFunction()), f.rawFunction │ │ │ │ +().entitySet()); │ │ │ │ +198 } │ │ │ │ +199 │ │ │ │ +_2_0_1 const _E_n_t_i_t_y_S_e_t& _e_n_t_i_t_y_S_e_t() const │ │ │ │ +202 { │ │ │ │ +203 return _e_n_t_i_t_y_S_e_t__; │ │ │ │ +204 } │ │ │ │ +205 │ │ │ │ +206protected: │ │ │ │ +207 │ │ │ │ +_2_0_8 _G_r_i_d_F_u_n_c_t_i_o_n _f_u_n_c_t_i_o_n__; │ │ │ │ +_2_0_9 _E_n_t_i_t_y_S_e_t _e_n_t_i_t_y_S_e_t__; │ │ │ │ +210}; │ │ │ │ +211 │ │ │ │ +212 │ │ │ │ +213 │ │ │ │ +214} // namespace Dune::Functions │ │ │ │ +215 │ │ │ │ +216#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_COARSEFUNCTIONONFINEGRIDVIEW_HH │ │ │ │ +_g_e_o_m_e_t_r_y_i_n_a_n_c_e_s_t_o_r_._h_h │ │ │ │ +_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h │ │ │ │ +_g_r_i_d_f_u_n_c_t_i_o_n_._h_h │ │ │ │ +_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:926 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ -Global basis for given pre-basis. │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:53 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:379 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_:_:_L_a_g_r_a_n_g_e_N_o_d_e │ │ │ │ -LagrangeNode(unsigned int order) │ │ │ │ -Constructor with a run-time order. │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:419 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_:_:_o_r_d_e_r │ │ │ │ -unsigned int order() const │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:451 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ -const FiniteElement & finiteElement() const │ │ │ │ -Return the LocalFiniteElement for the element we are bound to. │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:436 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_<_ _G_V_,_ _2_ _>_:_:_e_l_e_m_e_n_t__ │ │ │ │ -const Element * element_ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:461 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_:_:_e_l_e_m_e_n_t │ │ │ │ -const Element & element() const │ │ │ │ -Return current element, throw if unbound. │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:427 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_<_ _G_V_,_ _2_ _>_:_:_c_a_c_h_e__ │ │ │ │ -FiniteElementCache cache_ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:459 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_:_:_F_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ -typename FiniteElementCache::FiniteElementType FiniteElement │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:411 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_:_:_b_i_n_d │ │ │ │ -void bind(const Element &e) │ │ │ │ -Bind to element. │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:442 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_:_:_E_l_e_m_e_n_t │ │ │ │ -typename GV::template Codim< 0 >::Entity Element │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:410 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_<_ _G_V_,_ _2_ _>_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t__ │ │ │ │ -const FiniteElement * finiteElement_ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:460 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_<_ _G_V_,_ _2_ _>_:_:_o_r_d_e_r__ │ │ │ │ -unsigned int order_ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:457 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:409 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_:_:_L_a_g_r_a_n_g_e_N_o_d_e │ │ │ │ -LagrangeNode() │ │ │ │ -Constructor without order (uses the compile-time value). │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:414 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s │ │ │ │ -A pre-basis for a PQ-lagrange bases with given order. │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:65 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_d_o_f_s_P_e_r_P_r_i_s_m │ │ │ │ -size_type dofsPerPrism() const │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:325 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_c_o_m_p_u_t_e_D_o_f_s_P_e_r_C_u_b_e │ │ │ │ -size_type computeDofsPerCube(std::size_t cubeDim) const │ │ │ │ -Number of degrees of freedom assigned to a cube (without the ones assigned to │ │ │ │ -its faces!... │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:342 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_c_o_m_p_u_t_e_D_o_f_s_P_e_r_S_i_m_p_l_e_x │ │ │ │ -size_type computeDofsPerSimplex(std::size_t simplexDim) const │ │ │ │ -Number of degrees of freedom assigned to a simplex (without the ones assigned │ │ │ │ -to its faces!... │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:336 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_c_o_m_p_u_t_e_D_o_f_s_P_e_r_P_r_i_s_m │ │ │ │ -size_type computeDofsPerPrism() const │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:347 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_o_r_d_e_r__ │ │ │ │ -unsigned int order_ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:311 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_e_d_g_e_O_f_f_s_e_t__ │ │ │ │ -size_type edgeOffset_ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:364 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_N_o_d_e │ │ │ │ -LagrangeNode< GV, k, R > Node │ │ │ │ -Template mapping root tree path to type of created tree node. │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:78 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_d_o_f_s_P_e_r_S_i_m_p_l_e_x__ │ │ │ │ -std::array< size_type, dim+1 > dofsPerSimplex_ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:358 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_i_n_d_i_c_e_s │ │ │ │ -It indices(const Node &node, It it) const │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:184 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_v_e_r_t_e_x_O_f_f_s_e_t__ │ │ │ │ -size_type vertexOffset_ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:363 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_d_o_f_s_P_e_r_S_i_m_p_l_e_x │ │ │ │ -size_type dofsPerSimplex(std::size_t simplexDim) const │ │ │ │ -Number of degrees of freedom assigned to a simplex (without the ones assigned │ │ │ │ -to its faces!... │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:314 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -Type used for indices and size information. │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:75 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_p_y_r_a_m_i_d_O_f_f_s_e_t__ │ │ │ │ -size_type pyramidOffset_ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:368 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_p_r_i_s_m_O_f_f_s_e_t__ │ │ │ │ -size_type prismOffset_ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:369 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_t_e_t_r_a_h_e_d_r_o_n_O_f_f_s_e_t__ │ │ │ │ -size_type tetrahedronOffset_ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:367 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ -void initializeIndices() │ │ │ │ -Initialize the global indices. │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:102 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_c_o_m_p_u_t_e_D_o_f_s_P_e_r_P_y_r_a_m_i_d │ │ │ │ -size_type computeDofsPerPyramid() const │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:352 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s │ │ │ │ -LagrangePreBasis(const GridView &gv, unsigned int order) │ │ │ │ -Constructor for a given grid view object and run-time order. │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:86 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_d_o_f_s_P_e_r_P_y_r_a_m_i_d__ │ │ │ │ -size_type dofsPerPyramid_ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:361 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ -size_type dimension() const │ │ │ │ -Get the total dimension of the space spanned by this basis. │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:146 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s │ │ │ │ -LagrangePreBasis(const GridView &gv) │ │ │ │ -Constructor for a given grid view object with compile-time order. │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:81 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_u_p_d_a_t_e │ │ │ │ -void update(const GridView &gv) │ │ │ │ -Update the stored grid view, to be called if the grid has changed. │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:132 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r │ │ │ │ +A geometry embedding a descendent element into an ancestor. │ │ │ │ +DDeeffiinniittiioonn geometryinancestor.hh:39 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_g_l_o_b_a_l │ │ │ │ +GlobalCoordinate global(LocalCoordinate x) const │ │ │ │ +Map local coordinate in fine element into coarse element. │ │ │ │ +DDeeffiinniittiioonn geometryinancestor.hh:169 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_b_i_n_d │ │ │ │ +const Element & bind(const Element &fineElement, F &&includeFather) │ │ │ │ +Bind this GeometryInAncestor to a fine element and search coarse element. │ │ │ │ +DDeeffiinniittiioonn geometryinancestor.hh:119 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_c_o_a_r_s_e_E_l_e_m_e_n_t │ │ │ │ +const Element & coarseElement() const │ │ │ │ +Return the coarse element. │ │ │ │ +DDeeffiinniittiioonn geometryinancestor.hh:163 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ +friend auto derivative(const CoarseFunctionOnFineGridView &f) │ │ │ │ +Obtain global derivative of this function. │ │ │ │ +DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:183 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_E_n_t_i_t_y_S_e_t │ │ │ │ +Dune::Functions::GridViewEntitySet< GridView, 0 > EntitySet │ │ │ │ +DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:52 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ +Range operator()(const Domain &x) const │ │ │ │ +Evaluate function in global coordinates. │ │ │ │ +DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:177 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_D_o_m_a_i_n │ │ │ │ +typename EntitySet::GlobalCoordinate Domain │ │ │ │ +DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:54 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w │ │ │ │ +CoarseFunctionOnFineGridView(GridFunction &&function, const GridView &gridView) │ │ │ │ +Create CoarseFunctionOnFineGridView from GridFunction and GridView. │ │ │ │ +DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:171 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_e_n_t_i_t_y_S_e_t │ │ │ │ +const EntitySet & entitySet() const │ │ │ │ +Return the EntitySet associated to this GridViewFunction. │ │ │ │ +DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:201 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +CoarseLocalFunctionOnFineGridView LocalFunction │ │ │ │ +DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:152 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_E_l_e_m_e_n_t │ │ │ │ +typename EntitySet::Element Element │ │ │ │ +DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:53 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_f_u_n_c_t_i_o_n__ │ │ │ │ +GridFunction function_ │ │ │ │ +DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:208 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w │ │ │ │ +CoarseFunctionOnFineGridView(const GridFunction &function, const GridView │ │ │ │ +&gridView) │ │ │ │ +Create CoarseFunctionOnFineGridView from GridFunction and GridView. │ │ │ │ +DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:160 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_e_n_t_i_t_y_S_e_t__ │ │ │ │ +EntitySet entitySet_ │ │ │ │ +DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:209 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_L_o_c_a_l_D_o_m_a_i_n │ │ │ │ +typename EntitySet::LocalCoordinate LocalDomain │ │ │ │ +DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:55 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_l_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +friend LocalFunction localFunction(const CoarseFunctionOnFineGridView &f) │ │ │ │ +Create a LocalFunction for evaluation in local coordinates. │ │ │ │ +DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:195 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_R_a_n_g_e │ │ │ │ +std::decay_t< decltype(std::declval< RawGridFunction >()(std::declval< Domain > │ │ │ │ +()))> Range │ │ │ │ +DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:56 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_a_r_s_e_F_u_n_c_t_i_o_n_O_n_F_i_n_e_G_r_i_d_V_i_e_w_:_:_G_r_i_d_V_i_e_w │ │ │ │ GV GridView │ │ │ │ -The grid view that the FE basis is defined on. │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:72 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_q_u_a_d_r_i_l_a_t_e_r_a_l_O_f_f_s_e_t__ │ │ │ │ -size_type quadrilateralOffset_ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:366 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_g_r_i_d_V_i_e_w │ │ │ │ +DDeeffiinniittiioonn coarsefunctiononfinegridview.hh:51 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ +DDeeffiinniittiioonn gridfunction.hh:36 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t │ │ │ │ +An entity set for all entities of given codim in a grid view. │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:27 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_E_l_e_m_e_n_t │ │ │ │ +GridView::template Codim< codim >::Entity Element │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:36 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_:_:_g_r_i_d_V_i_e_w │ │ │ │ const GridView & gridView() const │ │ │ │ -Obtain the grid view that the basis is defined on. │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:126 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_g_r_i_d_V_i_e_w__ │ │ │ │ -GridView gridView_ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:308 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_m_a_k_e_N_o_d_e │ │ │ │ -Node makeNode() const │ │ │ │ -Create tree node. │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:140 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_o_r_d_e_r │ │ │ │ -unsigned int order() const │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:302 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_d_o_f_s_P_e_r_C_u_b_e__ │ │ │ │ -std::array< size_type, dim+1 > dofsPerCube_ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:359 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_m_a_x_N_o_d_e_S_i_z_e │ │ │ │ -size_type maxNodeSize() const │ │ │ │ -Get the maximal number of DOFs associated to node for any element. │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:176 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_d_o_f_s_P_e_r_P_r_i_s_m__ │ │ │ │ -size_type dofsPerPrism_ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:360 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_d_o_f_s_P_e_r_C_u_b_e │ │ │ │ -size_type dofsPerCube(std::size_t cubeDim) const │ │ │ │ -Number of degrees of freedom assigned to a cube (without the ones assigned to │ │ │ │ -its faces!... │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:320 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_t_r_i_a_n_g_l_e_O_f_f_s_e_t__ │ │ │ │ -size_type triangleOffset_ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:365 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_h_e_x_a_h_e_d_r_o_n_O_f_f_s_e_t__ │ │ │ │ -size_type hexahedronOffset_ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:370 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_d_o_f_s_P_e_r_P_y_r_a_m_i_d │ │ │ │ -size_type dofsPerPyramid() const │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:330 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_i_x_i_n │ │ │ │ -A generic MixIn class for PreBasis. │ │ │ │ -DDeeffiinniittiioonn leafprebasismixin.hh:36 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_e_t_S_i_z_e │ │ │ │ -void setSize(const size_type size) │ │ │ │ -DDeeffiinniittiioonn nodes.hh:197 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ -DDeeffiinniittiioonn nodes.hh:218 │ │ │ │ +Return the associated GridView. │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:80 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ +Element::Geometry::LocalCoordinate LocalCoordinate │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:39 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ +Element::Geometry::GlobalCoordinate GlobalCoordinate │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:40 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _l_a_g_r_a_n_g_e_b_a_s_i_s_._h_h │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ + * _c_o_a_r_s_e_f_u_n_c_t_i_o_n_o_n_f_i_n_e_g_r_i_d_v_i_e_w_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00134.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: interpolate.hh File Reference │ │ │ +Dune-Functions: gridviewfunction.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,61 +88,57 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
interpolate.hh File Reference
│ │ │ +
gridviewfunction.hh File Reference
│ │ │
│ │ │
│ │ │
#include <memory>
│ │ │ -#include <vector>
│ │ │ -#include <dune/common/exceptions.hh>
│ │ │ -#include <dune/common/bitsetvector.hh>
│ │ │ -#include <dune/common/referencehelper.hh>
│ │ │ -#include <dune/common/typetree/traversal.hh>
│ │ │ -#include <dune/functions/gridfunctions/gridviewfunction.hh>
│ │ │ -#include <dune/functions/common/functionconcepts.hh>
│ │ │ -#include <dune/functions/backends/concepts.hh>
│ │ │ -#include <dune/functions/backends/istlvectorbackend.hh>
│ │ │ -#include <dune/functions/functionspacebases/flatvectorview.hh>
│ │ │ -#include <dune/functions/functionspacebases/hierarchicnodetorangemap.hh>
│ │ │ +#include <dune/common/concept.hh>
│ │ │ +#include <dune/functions/gridfunctions/gridfunction.hh>
│ │ │ +#include <dune/functions/gridfunctions/gridviewentityset.hh>
│ │ │ +#include <dune/functions/gridfunctions/analyticgridviewfunction.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +

│ │ │ +Classes

class  Dune::Functions::GridViewFunction< Signature, GridView, DerivativeTraits, bufferSize >
class  Dune::Functions::GridViewFunction< Range(Domain), GV, DerivativeTraits, bufferSize >
 Wrapper class for functions defined on a GridView. More...
│ │ │ │ │ │ │ │ │ │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Functions

template<class B, class C, class F, class BV, class NTRE>
void Dune::Functions::interpolate (const B &basis, C &&coeff, const F &f, const BV &bv, const NTRE &nodeToRangeEntry)
 Interpolate given function in discrete function space.
template<class B, class C, class F, class BV>
void Dune::Functions::interpolate (const B &basis, C &&coeff, const F &f, const BV &bitVector)
 Interpolate given function in discrete function space.
template<class B, class C, class F>
void Dune::Functions::interpolate (const B &basis, C &&coeff, const F &f)
 Interpolate given function in discrete function space.
template<class F, class GridView, std::enable_if_t< models< Imp::HasFreeLocalFunction, F >(), int > = 0>
std::decay_t< F > Dune::Functions::makeGridViewFunction (F &&f, const GridView &gridView)
 Construct a function modeling GridViewFunction from function and grid view.
template<class F, class GridView, std::enable_if_t< not(models< Imp::HasFreeLocalFunction, F >()), int > = 0>
auto Dune::Functions::makeGridViewFunction (F &&f, const GridView &gridView) -> decltype(makeAnalyticGridViewFunction(std::forward< F >(f), gridView))
 Construct a function modeling GridViewFunction from function and grid view.
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,38 +1,39 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -interpolate.hh File Reference │ │ │ │ +gridviewfunction.hh File Reference │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_b_a_c_k_e_n_d_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_b_a_c_k_e_n_d_s_/_i_s_t_l_v_e_c_t_o_r_b_a_c_k_e_n_d_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_f_l_a_t_v_e_c_t_o_r_v_i_e_w_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_h_i_e_r_a_r_c_h_i_c_n_o_d_e_t_o_r_a_n_g_e_m_a_p_._h_h> │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_a_n_a_l_y_t_i_c_g_r_i_d_v_i_e_w_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ +CCllaasssseess │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _S_i_g_n_a_t_u_r_e_,_ _G_r_i_d_V_i_e_w_, │ │ │ │ + _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_ _> │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_, │ │ │ │ + _b_u_f_f_e_r_S_i_z_e_ _> │ │ │ │ +  Wrapper class for functions defined on a _G_r_i_d_V_i_e_w. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -void  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_i_n_t_e_r_p_o_l_a_t_e (const B &basis, C &&coeff, const F &f, │ │ │ │ - const BV &bv, const NTRE &nodeToRangeEntry) │ │ │ │ -  Interpolate given function in discrete function space. │ │ │ │ -template │ │ │ │ -void  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_i_n_t_e_r_p_o_l_a_t_e (const B &basis, C &&coeff, const F &f, │ │ │ │ - const BV &bitVector) │ │ │ │ -  Interpolate given function in discrete function space. │ │ │ │ -template │ │ │ │ -void  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_i_n_t_e_r_p_o_l_a_t_e (const B &basis, C &&coeff, const F &f) │ │ │ │ -  Interpolate given function in discrete function space. │ │ │ │ +template(), int > = 0> │ │ │ │ +std::decay_t< F >  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n (F &&f, const GridView │ │ │ │ + &gridView) │ │ │ │ +  Construct a function modeling _G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n from function │ │ │ │ + and grid view. │ │ │ │ +template()), int > = 0> │ │ │ │ + auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n (F &&f, const GridView │ │ │ │ + &gridView) -> decltype(_m_a_k_e_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n(std:: │ │ │ │ + forward< F >(f), gridView)) │ │ │ │ +  Construct a function modeling _G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n from function │ │ │ │ + and grid view. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _i_n_t_e_r_p_o_l_a_t_e_._h_h │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ + * _g_r_i_d_v_i_e_w_f_u_n_c_t_i_o_n_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00134.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,5 +1,5 @@ │ │ │ │ var a00134 = [ │ │ │ │ - ["Dune::Functions::interpolate", "a00318.html#a2e34859322800ae26a292903910ef9f7", null], │ │ │ │ - ["Dune::Functions::interpolate", "a00318.html#ae167dc7b5ace0ff9617a3205b05744b5", null], │ │ │ │ - ["Dune::Functions::interpolate", "a00318.html#a13b0c6bf02d744e7b2078d1a535b5211", null] │ │ │ │ + ["Dune::Functions::GridViewFunction< Signature, GridView, DerivativeTraits, bufferSize >", "a02282.html", null], │ │ │ │ + ["Dune::Functions::makeGridViewFunction", "a00318.html#a34ad74c81e35af361861f667bf9742c0", null], │ │ │ │ + ["Dune::Functions::makeGridViewFunction", "a00318.html#a34f2d140a1fed46862286f68d26c9975", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00134_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: interpolate.hh Source File │ │ │ +Dune-Functions: gridviewfunction.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,303 +88,110 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
interpolate.hh
│ │ │ +
gridviewfunction.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH
│ │ │ +
8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH
│ │ │
9
│ │ │
10#include <memory>
│ │ │ -
11#include <vector>
│ │ │ -
12
│ │ │ -
13#include <dune/common/exceptions.hh>
│ │ │ -
14#include <dune/common/bitsetvector.hh>
│ │ │ -
15#include <dune/common/referencehelper.hh>
│ │ │ -
16
│ │ │ -
17#include <dune/common/typetree/traversal.hh>
│ │ │ +
11
│ │ │ +
12#include <dune/common/concept.hh>
│ │ │ +
13
│ │ │ + │ │ │ + │ │ │ + │ │ │ +
17
│ │ │
18
│ │ │ - │ │ │ - │ │ │ +
19namespace Dune {
│ │ │ +
20namespace Functions {
│ │ │
21
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
26
│ │ │ -
27namespace Dune {
│ │ │ -
28namespace Functions {
│ │ │ -
29
│ │ │ -
30namespace Imp {
│ │ │ -
31
│ │ │ -
32struct AllTrueBitSetVector
│ │ │ -
33{
│ │ │ -
34 struct AllTrueBitSet
│ │ │ -
35 {
│ │ │ -
36 bool test(int) const { return true; }
│ │ │ -
37 } allTrue_;
│ │ │ -
38
│ │ │ -
39 operator bool() const
│ │ │ -
40 {
│ │ │ -
41 return true;
│ │ │ -
42 }
│ │ │ -
43
│ │ │ -
44 template<class I>
│ │ │ -
45 const AllTrueBitSetVector& operator[](const I&) const
│ │ │ -
46 {
│ │ │ -
47 return *this;
│ │ │ -
48 }
│ │ │ -
49
│ │ │ -
50 template<class SP>
│ │ │ -
51 void resize(const SP&) const
│ │ │ -
52 {}
│ │ │ -
53
│ │ │ -
54};
│ │ │ +
22
│ │ │ +
23
│ │ │ +
24template<class Signature, class GridView, template<class> class DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>
│ │ │ +
│ │ │ + │ │ │ +
26{};
│ │ │ +
│ │ │ +
27
│ │ │ +
28
│ │ │ +
29
│ │ │ +
44template<class Range, class Domain, class GV, template<class> class DerivativeTraits, size_t bufferSize>
│ │ │ +
│ │ │ +
45class GridViewFunction<Range(Domain), GV, DerivativeTraits, bufferSize> :
│ │ │ +
46 public GridFunction<Range(Domain), GridViewEntitySet<GV, 0>, DerivativeTraits, bufferSize>
│ │ │ +
47{
│ │ │ +
48 using Base = GridFunction<Range(Domain), GridViewEntitySet<GV, 0>, DerivativeTraits, bufferSize>;
│ │ │ +
49public:
│ │ │ +
50 using GridView = GV;
│ │ │ +
51
│ │ │ +
52 using Base::Base;
│ │ │ +
53};
│ │ │ +
│ │ │ +
54
│ │ │
55
│ │ │ -
56
│ │ │ -
57
│ │ │ -
58// This helper function implements the restriction of some given function of type F.
│ │ │ -
59// The restriction is a simple callback that is applied to the values of the
│ │ │ -
60// function and the values of its derivative.
│ │ │ -
61template<class F, class Restriction>
│ │ │ -
62class ComponentFunction
│ │ │ -
63{
│ │ │ -
64public:
│ │ │ -
65
│ │ │ -
66 ComponentFunction(F f, Restriction restriction) :
│ │ │ -
67 f_(std::move(f)),
│ │ │ -
68 restriction_(std::move(restriction))
│ │ │ -
69 {}
│ │ │ -
70
│ │ │ -
71 template<class Domain>
│ │ │ -
72 auto operator()(const Domain& x) const
│ │ │ -
73 {
│ │ │ -
74 return restriction_(f_(x));
│ │ │ -
75 }
│ │ │ +
56
│ │ │ +
68template<class F, class GridView,
│ │ │ +
69 std::enable_if_t<
│ │ │ +
70 models< Imp::HasFreeLocalFunction, F>() , int> = 0>
│ │ │ +
71std::decay_t<F>
│ │ │ +
│ │ │ +
72 makeGridViewFunction(F&& f, const GridView& gridView)
│ │ │ +
73{
│ │ │ +
74 return std::forward<F>(f);
│ │ │ +
75}
│ │ │ +
│ │ │
76
│ │ │ -
77 friend auto derivative(const ComponentFunction& cf)
│ │ │ -
78 {
│ │ │ -
79 // This provides support for capturing the derivative of the function by reference
│ │ │ -
80 // using forwardCapture for perfect forwarding capture. If the function caches its
│ │ │ -
81 // derivative, this saves a potentially costly copy.
│ │ │ -
82 auto&& df = derivative(Dune::resolveRef(cf.f_));
│ │ │ -
83 return [&, df=forwardCapture(std::forward<decltype(df)>(df))](auto&& x) {
│ │ │ -
84 return cf.restriction_(df.forward()(x));
│ │ │ -
85 };
│ │ │ -
86 }
│ │ │ -
87
│ │ │ -
88private:
│ │ │ -
89 F f_;
│ │ │ -
90 Restriction restriction_;
│ │ │ -
91};
│ │ │ -
92
│ │ │ -
93
│ │ │ -
94
│ │ │ -
95
│ │ │ -
96// This helper function implements caching of the derivative for local functions.
│ │ │ -
97// When using an algorithm that gets a LocalFunction and calls its derivative
│ │ │ -
98// on each element, this leads to a costly call of derivative(f). E.g. for a
│ │ │ -
99// DiscreteGlobalBasisFunction, this will allocate several buffer.
│ │ │ -
100// To avoid this, this helper function caches the derivative and hands
│ │ │ -
101// out the cached derivative by reference. To ensure that the handed out
│ │ │ -
102// derivative is appropriately bound, binding the function will automatically
│ │ │ -
103// bind the cached derivative.
│ │ │ -
104//
│ │ │ -
105// Notice that we cannot simply create the derivative in the constructor,
│ │ │ -
106// because this may throw for functions that do not implement the derivative.
│ │ │ -
107template<class F>
│ │ │ -
108class CachedDerivativeLocalFunction
│ │ │ -
109{
│ │ │ -
110 using Derivative = std::decay_t<decltype(derivative(Dune::resolveRef(std::declval<const F&>())))>;
│ │ │ -
111
│ │ │ -
112public:
│ │ │ -
113
│ │ │ -
114 CachedDerivativeLocalFunction(F f) :
│ │ │ -
115 f_(f)
│ │ │ -
116 {}
│ │ │ -
117
│ │ │ -
118 template<class Element>
│ │ │ -
119 void bind(const Element& element)
│ │ │ -
120 {
│ │ │ -
121 Dune::resolveRef(f_).bind(element);
│ │ │ -
122 if (derivative_)
│ │ │ -
123 derivative_.value().bind(element);
│ │ │ -
124 }
│ │ │ -
125
│ │ │ -
126 template<class X>
│ │ │ -
127 auto operator()(const X& x) const
│ │ │ -
128 {
│ │ │ -
129 return f_(x);
│ │ │ -
130 }
│ │ │ -
131
│ │ │ -
132 friend const Derivative& derivative(const CachedDerivativeLocalFunction& cdlf)
│ │ │ -
133 {
│ │ │ -
134 if (not cdlf.derivative_)
│ │ │ -
135 {
│ │ │ -
136 auto&& lf = Dune::resolveRef(cdlf.f_);
│ │ │ -
137 cdlf.derivative_ = derivative(lf);
│ │ │ -
138 if (lf.bound())
│ │ │ -
139 cdlf.derivative_.value().bind(lf.localContext());
│ │ │ -
140 }
│ │ │ -
141 return cdlf.derivative_.value();
│ │ │ -
142 }
│ │ │ -
143
│ │ │ -
144private:
│ │ │ -
145 F f_;
│ │ │ -
146 mutable std::optional<Derivative> derivative_;
│ │ │ -
147};
│ │ │ -
148
│ │ │ -
149
│ │ │ -
150
│ │ │ -
151template<class VectorBackend, class BitVectorBackend, class LocalFunction, class LocalView, class NodeToRangeEntry>
│ │ │ -
152void interpolateLocal(VectorBackend& vector, const BitVectorBackend& bitVector, const LocalFunction& localF, const LocalView& localView, const NodeToRangeEntry& nodeToRangeEntry)
│ │ │ -
153{
│ │ │ -
154 Dune::TypeTree::forEachLeafNode(localView.tree(), [&](auto&& node, auto&& treePath) {
│ │ │ -
155 if (node.empty())
│ │ │ -
156 return;
│ │ │ -
157 using Node = std::decay_t<decltype(node)>;
│ │ │ -
158 using FiniteElement = typename Node::FiniteElement;
│ │ │ -
159 using FiniteElementRangeField = typename FiniteElement::Traits::LocalBasisType::Traits::RangeFieldType;
│ │ │ -
160
│ │ │ -
161 auto interpolationCoefficients = std::vector<FiniteElementRangeField>();
│ │ │ -
162 auto&& fe = node.finiteElement();
│ │ │ -
163 auto localF_RE = ComponentFunction(std::cref(localF), [&](auto&& y) { return nodeToRangeEntry(node, treePath, y); });
│ │ │ -
164
│ │ │ -
165 fe.localInterpolation().interpolate(localF_RE, interpolationCoefficients);
│ │ │ -
166 for (size_t i=0; i<fe.localBasis().size(); ++i)
│ │ │ -
167 {
│ │ │ -
168 auto multiIndex = localView.index(node.localIndex(i));
│ │ │ -
169 if ( bitVector[multiIndex] )
│ │ │ -
170 vector[multiIndex] = interpolationCoefficients[i];
│ │ │ -
171 }
│ │ │ -
172 });
│ │ │ -
173}
│ │ │ -
174
│ │ │ -
175
│ │ │ -
176struct HasDerivative
│ │ │ -
177{
│ │ │ -
178 template<class F>
│ │ │ -
179 auto require(F&& f) -> decltype(derivative(f));
│ │ │ -
180};
│ │ │ -
181
│ │ │ -
182} // namespace Imp
│ │ │ -
183
│ │ │ -
184
│ │ │ -
185
│ │ │ -
186
│ │ │ -
204template <class B, class C, class F, class BV, class NTRE>
│ │ │ -
│ │ │ -
205void interpolate(const B& basis, C&& coeff, const F& f, const BV& bv, const NTRE& nodeToRangeEntry)
│ │ │ -
206{
│ │ │ -
207 using GridView = typename B::GridView;
│ │ │ -
208 using Element = typename GridView::template Codim<0>::Entity;
│ │ │ -
209 using GlobalDomain = typename Element::Geometry::GlobalCoordinate;
│ │ │ -
210
│ │ │ -
211 static_assert(Dune::Functions::Concept::isCallable<F, GlobalDomain>(), "Function passed to interpolate does not model the Callable<GlobalCoordinate> concept");
│ │ │ -
212
│ │ │ -
213 auto&& gridView = basis.gridView();
│ │ │ -
214
│ │ │ -
215 // Small helper functions to wrap vectors using istlVectorBackend
│ │ │ -
216 // if they do not already satisfy the VectorBackend interface.
│ │ │ -
217 auto toVectorBackend = [&](auto& v) -> decltype(auto) {
│ │ │ -
218 if constexpr (models<Concept::VectorBackend<B>, decltype(v)>()) {
│ │ │ -
219 return v;
│ │ │ -
220 } else {
│ │ │ -
221 return istlVectorBackend(v);
│ │ │ -
222 }
│ │ │ -
223 };
│ │ │ -
224
│ │ │ -
225 auto toConstVectorBackend = [&](auto& v) -> decltype(auto) {
│ │ │ -
226 if constexpr (models<Concept::ConstVectorBackend<B>, decltype(v)>()) {
│ │ │ -
227 return v;
│ │ │ -
228 } else {
│ │ │ -
229 return istlVectorBackend(v);
│ │ │ -
230 }
│ │ │ -
231 };
│ │ │ -
232
│ │ │ -
233 auto&& bitVector = toConstVectorBackend(bv);
│ │ │ -
234 auto&& vector = toVectorBackend(coeff);
│ │ │ -
235 vector.resize(basis);
│ │ │ -
236
│ │ │ -
237 // Make a grid function supporting local evaluation out of f
│ │ │ -
238 auto gf = makeGridViewFunction(f, gridView);
│ │ │ -
239
│ │ │ -
240 // Obtain a local view of f
│ │ │ -
241 // To avoid costly reconstruction of the derivative on each element,
│ │ │ -
242 // we use the CachedDerivativeLocalFunction wrapper if the function
│ │ │ -
243 // is differentiable. This wrapper will handout
│ │ │ -
244 // a reference to a single cached derivative object.
│ │ │ -
245 auto localF = [&](){
│ │ │ -
246 if constexpr (models<Imp::HasDerivative, decltype(localFunction(gf))>())
│ │ │ -
247 return Imp::CachedDerivativeLocalFunction(localFunction(gf));
│ │ │ -
248 else
│ │ │ -
249 return localFunction(gf);
│ │ │ -
250 }();
│ │ │ -
251
│ │ │ -
252 auto localView = basis.localView();
│ │ │ -
253
│ │ │ -
254 for (const auto& e : elements(gridView))
│ │ │ -
255 {
│ │ │ -
256 localView.bind(e);
│ │ │ -
257 localF.bind(e);
│ │ │ -
258 Imp::interpolateLocal(vector, bitVector, localF, localView, nodeToRangeEntry);
│ │ │ -
259 }
│ │ │ -
260}
│ │ │ -
│ │ │ -
261
│ │ │ -
278template <class B, class C, class F, class BV>
│ │ │ -
│ │ │ -
279void interpolate(const B& basis, C&& coeff, const F& f, const BV& bitVector)
│ │ │ -
280{
│ │ │ -
281 interpolate(basis, coeff, f, bitVector, HierarchicNodeToRangeMap());
│ │ │ -
282}
│ │ │ -
│ │ │ -
283
│ │ │ -
298template <class B, class C, class F>
│ │ │ -
│ │ │ -
299void interpolate(const B& basis, C&& coeff, const F& f)
│ │ │ -
300{
│ │ │ -
301 interpolate (basis, coeff, f, Imp::AllTrueBitSetVector(), HierarchicNodeToRangeMap());
│ │ │ -
302}
│ │ │ -
│ │ │ -
303
│ │ │ -
304} // namespace Functions
│ │ │ -
305} // namespace Dune
│ │ │ -
306
│ │ │ -
307#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
Obtain derivative of TrigonometricFunction function.
Definition trigonometricfunction.hh:43
│ │ │ -
auto istlVectorBackend(Vector &v)
Return a vector backend wrapping non-const ISTL like containers.
Definition istlvectorbackend.hh:350
│ │ │ -
static constexpr auto isCallable()
Check if f is callable with given argument list.
Definition functionconcepts.hh:51
│ │ │ +
77
│ │ │ +
78
│ │ │ +
94template<class F, class GridView,
│ │ │ +
95 std::enable_if_t<
│ │ │ +
96 not(models< Imp::HasFreeLocalFunction, F>()) , int> = 0>
│ │ │ +
│ │ │ +
97auto makeGridViewFunction(F&& f, const GridView& gridView)
│ │ │ +
98 -> decltype(makeAnalyticGridViewFunction(std::forward<F>(f), gridView))
│ │ │ +
99{
│ │ │ +
100 return makeAnalyticGridViewFunction(std::forward<F>(f), gridView);
│ │ │ +
101}
│ │ │ +
│ │ │ +
102
│ │ │ +
103
│ │ │ +
104
│ │ │ +
105} // end of namespace Dune::Functions
│ │ │ +
106} // end of namespace Dune
│ │ │ +
107
│ │ │ +
108#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH
│ │ │ + │ │ │ + │ │ │ + │ │ │ +
auto makeAnalyticGridViewFunction(F &&f, const GridView &gridView)
Create an AnalyticGridViewFunction from a function and a grid view.
Definition analyticgridviewfunction.hh:238
│ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
void interpolate(const B &basis, C &&coeff, const F &f, const BV &bv, const NTRE &nodeToRangeEntry)
Interpolate given function in discrete function space.
Definition interpolate.hh:205
│ │ │
std::decay_t< F > makeGridViewFunction(F &&f, const GridView &gridView)
Construct a function modeling GridViewFunction from function and grid view.
Definition gridviewfunction.hh:72
│ │ │ -
auto forwardCapture(T &&t)
Create a capture object for perfect forwarding.
Definition utility.hh:380
│ │ │ -
A simple node to range map using the nested tree indices.
Definition hierarchicnodetorangemap.hh:34
│ │ │ - │ │ │ +
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:41
│ │ │ +
Definition gridfunction.hh:36
│ │ │ +
An entity set for all entities of given codim in a grid view.
Definition gridviewentityset.hh:27
│ │ │ +
Definition gridviewfunction.hh:26
│ │ │ + │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,331 +1,114 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -interpolate.hh │ │ │ │ +gridviewfunction.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH │ │ │ │ +8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH │ │ │ │ 9 │ │ │ │ 10#include │ │ │ │ -11#include │ │ │ │ -12 │ │ │ │ -13#include │ │ │ │ -14#include │ │ │ │ -15#include │ │ │ │ -16 │ │ │ │ -17#include │ │ │ │ +11 │ │ │ │ +12#include │ │ │ │ +13 │ │ │ │ +14#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +15#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h> │ │ │ │ +16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_a_n_a_l_y_t_i_c_g_r_i_d_v_i_e_w_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +17 │ │ │ │ 18 │ │ │ │ -19#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ -20#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +19namespace _D_u_n_e { │ │ │ │ +20namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ 21 │ │ │ │ -22#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_b_a_c_k_e_n_d_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ -23#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_b_a_c_k_e_n_d_s_/_i_s_t_l_v_e_c_t_o_r_b_a_c_k_e_n_d_._h_h> │ │ │ │ -24#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_f_l_a_t_v_e_c_t_o_r_v_i_e_w_._h_h> │ │ │ │ -25#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_h_i_e_r_a_r_c_h_i_c_n_o_d_e_t_o_r_a_n_g_e_m_a_p_._h_h> │ │ │ │ -26 │ │ │ │ -27namespace _D_u_n_e { │ │ │ │ -28namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +22 │ │ │ │ +23 │ │ │ │ +24template class │ │ │ │ +DerivativeTraits=_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s, size_t bufferSize=56> │ │ │ │ +_2_5class _G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ +26{}; │ │ │ │ +27 │ │ │ │ +28 │ │ │ │ 29 │ │ │ │ -30namespace Imp { │ │ │ │ -31 │ │ │ │ -32struct AllTrueBitSetVector │ │ │ │ -33{ │ │ │ │ -34 struct AllTrueBitSet │ │ │ │ -35 { │ │ │ │ -36 bool test(int) const { return true; } │ │ │ │ -37 } allTrue_; │ │ │ │ -38 │ │ │ │ -39 operator bool() const │ │ │ │ -40 { │ │ │ │ -41 return true; │ │ │ │ -42 } │ │ │ │ -43 │ │ │ │ -44 template │ │ │ │ -45 const AllTrueBitSetVector& operator[](const I&) const │ │ │ │ -46 { │ │ │ │ -47 return *this; │ │ │ │ -48 } │ │ │ │ -49 │ │ │ │ -50 template │ │ │ │ -51 void resize(const SP&) const │ │ │ │ -52 {} │ │ │ │ -53 │ │ │ │ -54}; │ │ │ │ +44template class │ │ │ │ +DerivativeTraits, size_t bufferSize> │ │ │ │ +_4_5class _G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n : │ │ │ │ +46 public _G_r_i_d_F_u_n_c_t_i_o_n, │ │ │ │ +DerivativeTraits, bufferSize> │ │ │ │ +47{ │ │ │ │ +48 using Base = _G_r_i_d_F_u_n_c_t_i_o_n, │ │ │ │ +DerivativeTraits, bufferSize>; │ │ │ │ +49public: │ │ │ │ +_5_0 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ +51 │ │ │ │ +52 using Base::Base; │ │ │ │ +53}; │ │ │ │ +54 │ │ │ │ 55 │ │ │ │ 56 │ │ │ │ -57 │ │ │ │ -58// This helper function implements the restriction of some given function of │ │ │ │ -type F. │ │ │ │ -59// The restriction is a simple callback that is applied to the values of the │ │ │ │ -60// function and the values of its derivative. │ │ │ │ -61template │ │ │ │ -62class ComponentFunction │ │ │ │ -63{ │ │ │ │ -64public: │ │ │ │ -65 │ │ │ │ -66 ComponentFunction(F f, Restriction restriction) : │ │ │ │ -67 f_(std::move(f)), │ │ │ │ -68 restriction_(std::move(restriction)) │ │ │ │ -69 {} │ │ │ │ -70 │ │ │ │ -71 template │ │ │ │ -72 auto operator()(const Domain& x) const │ │ │ │ -73 { │ │ │ │ -74 return restriction_(f_(x)); │ │ │ │ -75 } │ │ │ │ +68template() , int> = 0> │ │ │ │ +71std::decay_t │ │ │ │ +_7_2 _m_a_k_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n(F&& f, const GridView& gridView) │ │ │ │ +73{ │ │ │ │ +74 return std::forward(f); │ │ │ │ +75} │ │ │ │ 76 │ │ │ │ -77 friend auto derivative(const ComponentFunction& cf) │ │ │ │ -78 { │ │ │ │ -79 // This provides support for capturing the derivative of the function by │ │ │ │ -reference │ │ │ │ -80 // using forwardCapture for perfect forwarding capture. If the function │ │ │ │ -caches its │ │ │ │ -81 // derivative, this saves a potentially costly copy. │ │ │ │ -82 auto&& df = derivative(Dune::resolveRef(cf.f_)); │ │ │ │ -83 return [&, df=_f_o_r_w_a_r_d_C_a_p_t_u_r_e(std::forward(df))](auto&& x) { │ │ │ │ -84 return cf.restriction_(df.forward()(x)); │ │ │ │ -85 }; │ │ │ │ -86 } │ │ │ │ -87 │ │ │ │ -88private: │ │ │ │ -89 F f_; │ │ │ │ -90 Restriction restriction_; │ │ │ │ -91}; │ │ │ │ -92 │ │ │ │ -93 │ │ │ │ -94 │ │ │ │ -95 │ │ │ │ -96// This helper function implements caching of the derivative for local │ │ │ │ -functions. │ │ │ │ -97// When using an algorithm that gets a LocalFunction and calls its derivative │ │ │ │ -98// on each element, this leads to a costly call of derivative(f). E.g. for a │ │ │ │ -99// DiscreteGlobalBasisFunction, this will allocate several buffer. │ │ │ │ -100// To avoid this, this helper function caches the derivative and hands │ │ │ │ -101// out the cached derivative by reference. To ensure that the handed out │ │ │ │ -102// derivative is appropriately bound, binding the function will │ │ │ │ -automatically │ │ │ │ -103// bind the cached derivative. │ │ │ │ -104// │ │ │ │ -105// Notice that we cannot simply create the derivative in the constructor, │ │ │ │ -106// because this may throw for functions that do not implement the │ │ │ │ -derivative. │ │ │ │ -107template │ │ │ │ -108class CachedDerivativeLocalFunction │ │ │ │ -109{ │ │ │ │ -110 using Derivative = std::decay_t())))>; │ │ │ │ -111 │ │ │ │ -112public: │ │ │ │ -113 │ │ │ │ -114 CachedDerivativeLocalFunction(F f) : │ │ │ │ -115 f_(f) │ │ │ │ -116 {} │ │ │ │ -117 │ │ │ │ -118 template │ │ │ │ -119 void bind(const Element& element) │ │ │ │ -120 { │ │ │ │ -121 Dune::resolveRef(f_).bind(element); │ │ │ │ -122 if (derivative_) │ │ │ │ -123 derivative_.value().bind(element); │ │ │ │ -124 } │ │ │ │ -125 │ │ │ │ -126 template │ │ │ │ -127 auto operator()(const X& x) const │ │ │ │ -128 { │ │ │ │ -129 return f_(x); │ │ │ │ -130 } │ │ │ │ -131 │ │ │ │ -132 friend const Derivative& derivative(const CachedDerivativeLocalFunction& │ │ │ │ -cdlf) │ │ │ │ -133 { │ │ │ │ -134 if (not cdlf.derivative_) │ │ │ │ -135 { │ │ │ │ -136 auto&& lf = Dune::resolveRef(cdlf.f_); │ │ │ │ -137 cdlf.derivative_ = derivative(lf); │ │ │ │ -138 if (lf.bound()) │ │ │ │ -139 cdlf.derivative_.value().bind(lf.localContext()); │ │ │ │ -140 } │ │ │ │ -141 return cdlf.derivative_.value(); │ │ │ │ -142 } │ │ │ │ -143 │ │ │ │ -144private: │ │ │ │ -145 F f_; │ │ │ │ -146 mutable std::optional derivative_; │ │ │ │ -147}; │ │ │ │ -148 │ │ │ │ -149 │ │ │ │ -150 │ │ │ │ -151template │ │ │ │ -152void interpolateLocal(VectorBackend& vector, const BitVectorBackend& │ │ │ │ -bitVector, const LocalFunction& localF, const LocalView& localView, const │ │ │ │ -NodeToRangeEntry& nodeToRangeEntry) │ │ │ │ -153{ │ │ │ │ -154 Dune::TypeTree::forEachLeafNode(localView.tree(), [&](auto&& node, auto&& │ │ │ │ -treePath) { │ │ │ │ -155 if (node.empty()) │ │ │ │ -156 return; │ │ │ │ -157 using Node = std::decay_t; │ │ │ │ -158 using FiniteElement = typename Node::FiniteElement; │ │ │ │ -159 using FiniteElementRangeField = typename FiniteElement::Traits:: │ │ │ │ -LocalBasisType::Traits::RangeFieldType; │ │ │ │ -160 │ │ │ │ -161 auto interpolationCoefficients = std::vector(); │ │ │ │ -162 auto&& fe = node.finiteElement(); │ │ │ │ -163 auto localF_RE = ComponentFunction(std::cref(localF), [&](auto&& y) │ │ │ │ -{ return nodeToRangeEntry(node, treePath, y); }); │ │ │ │ -164 │ │ │ │ -165 fe.localInterpolation().interpolate(localF_RE, interpolationCoefficients); │ │ │ │ -166 for (size_t i=0; i │ │ │ │ -179 auto require(F&& f) -> decltype(_d_e_r_i_v_a_t_i_v_e(f)); │ │ │ │ -180}; │ │ │ │ -181 │ │ │ │ -182} // namespace Imp │ │ │ │ -183 │ │ │ │ -184 │ │ │ │ -185 │ │ │ │ -186 │ │ │ │ -204template │ │ │ │ -_2_0_5void _i_n_t_e_r_p_o_l_a_t_e(const B& basis, C&& coeff, const F& f, const BV& bv, const │ │ │ │ -NTRE& nodeToRangeEntry) │ │ │ │ -206{ │ │ │ │ -207 using GridView = typename B::GridView; │ │ │ │ -208 using Element = typename GridView::template Codim<0>::Entity; │ │ │ │ -209 using GlobalDomain = typename Element::Geometry::GlobalCoordinate; │ │ │ │ -210 │ │ │ │ -211 static_assert(_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_C_a_l_l_a_b_l_e_<_F_,_ _G_l_o_b_a_l_D_o_m_a_i_n_>(), │ │ │ │ -"Function passed to interpolate does not model the Callable │ │ │ │ -concept"); │ │ │ │ -212 │ │ │ │ -213 auto&& gridView = basis.gridView(); │ │ │ │ -214 │ │ │ │ -215 // Small helper functions to wrap vectors using istlVectorBackend │ │ │ │ -216 // if they do not already satisfy the VectorBackend interface. │ │ │ │ -217 auto toVectorBackend = [&](auto& v) -> decltype(auto) { │ │ │ │ -218 if constexpr (models, decltype(v)>()) { │ │ │ │ -219 return v; │ │ │ │ -220 } else { │ │ │ │ -221 return _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(v); │ │ │ │ -222 } │ │ │ │ -223 }; │ │ │ │ -224 │ │ │ │ -225 auto toConstVectorBackend = [&](auto& v) -> decltype(auto) { │ │ │ │ -226 if constexpr (models, decltype(v)>()) { │ │ │ │ -227 return v; │ │ │ │ -228 } else { │ │ │ │ -229 return _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(v); │ │ │ │ -230 } │ │ │ │ -231 }; │ │ │ │ -232 │ │ │ │ -233 auto&& bitVector = toConstVectorBackend(bv); │ │ │ │ -234 auto&& vector = toVectorBackend(coeff); │ │ │ │ -235 vector.resize(basis); │ │ │ │ -236 │ │ │ │ -237 // Make a grid function supporting local evaluation out of f │ │ │ │ -238 auto gf = _m_a_k_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n(f, gridView); │ │ │ │ -239 │ │ │ │ -240 // Obtain a local view of f │ │ │ │ -241 // To avoid costly reconstruction of the derivative on each element, │ │ │ │ -242 // we use the CachedDerivativeLocalFunction wrapper if the function │ │ │ │ -243 // is differentiable. This wrapper will handout │ │ │ │ -244 // a reference to a single cached derivative object. │ │ │ │ -245 auto localF = [&](){ │ │ │ │ -246 if constexpr (models()) │ │ │ │ -247 return Imp::CachedDerivativeLocalFunction(localFunction(gf)); │ │ │ │ -248 else │ │ │ │ -249 return localFunction(gf); │ │ │ │ -250 }(); │ │ │ │ -251 │ │ │ │ -252 auto localView = basis.localView(); │ │ │ │ -253 │ │ │ │ -254 for (const auto& e : elements(gridView)) │ │ │ │ -255 { │ │ │ │ -256 localView.bind(e); │ │ │ │ -257 localF.bind(e); │ │ │ │ -258 Imp::interpolateLocal(vector, bitVector, localF, localView, │ │ │ │ -nodeToRangeEntry); │ │ │ │ -259 } │ │ │ │ -260} │ │ │ │ -261 │ │ │ │ -278template │ │ │ │ -_2_7_9void _i_n_t_e_r_p_o_l_a_t_e(const B& basis, C&& coeff, const F& f, const BV& bitVector) │ │ │ │ -280{ │ │ │ │ -281 _i_n_t_e_r_p_o_l_a_t_e(basis, coeff, f, bitVector, _H_i_e_r_a_r_c_h_i_c_N_o_d_e_T_o_R_a_n_g_e_M_a_p()); │ │ │ │ -282} │ │ │ │ -283 │ │ │ │ -298template │ │ │ │ -_2_9_9void _i_n_t_e_r_p_o_l_a_t_e(const B& basis, C&& coeff, const F& f) │ │ │ │ -300{ │ │ │ │ -301 _i_n_t_e_r_p_o_l_a_t_e (basis, coeff, f, Imp::AllTrueBitSetVector(), │ │ │ │ -_H_i_e_r_a_r_c_h_i_c_N_o_d_e_T_o_R_a_n_g_e_M_a_p()); │ │ │ │ -302} │ │ │ │ -303 │ │ │ │ -304} // namespace Functions │ │ │ │ -305} // namespace Dune │ │ │ │ -306 │ │ │ │ -307#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH │ │ │ │ -_g_r_i_d_v_i_e_w_f_u_n_c_t_i_o_n_._h_h │ │ │ │ -_h_i_e_r_a_r_c_h_i_c_n_o_d_e_t_o_r_a_n_g_e_m_a_p_._h_h │ │ │ │ -_f_l_a_t_v_e_c_t_o_r_v_i_e_w_._h_h │ │ │ │ -_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h │ │ │ │ -_i_s_t_l_v_e_c_t_o_r_b_a_c_k_e_n_d_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ -TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const │ │ │ │ -TrigonometricFunction< K, sinFactor, cosFactor > &f) │ │ │ │ -Obtain derivative of TrigonometricFunction function. │ │ │ │ -DDeeffiinniittiioonn trigonometricfunction.hh:43 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d │ │ │ │ -auto istlVectorBackend(Vector &v) │ │ │ │ -Return a vector backend wrapping non-const ISTL like containers. │ │ │ │ -DDeeffiinniittiioonn istlvectorbackend.hh:350 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_C_a_l_l_a_b_l_e │ │ │ │ -static constexpr auto isCallable() │ │ │ │ -Check if f is callable with given argument list. │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:51 │ │ │ │ +77 │ │ │ │ +78 │ │ │ │ +94template()) , int> = 0> │ │ │ │ +_9_7auto _m_a_k_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n(F&& f, const GridView& gridView) │ │ │ │ +98 -> decltype(_m_a_k_e_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n(std::forward(f), gridView)) │ │ │ │ +99{ │ │ │ │ +100 return _m_a_k_e_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n(std::forward(f), gridView); │ │ │ │ +101} │ │ │ │ +102 │ │ │ │ +103 │ │ │ │ +104 │ │ │ │ +105} // end of namespace Dune::Functions │ │ │ │ +106} // end of namespace Dune │ │ │ │ +107 │ │ │ │ +108#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH │ │ │ │ +_a_n_a_l_y_t_i_c_g_r_i_d_v_i_e_w_f_u_n_c_t_i_o_n_._h_h │ │ │ │ +_g_r_i_d_f_u_n_c_t_i_o_n_._h_h │ │ │ │ +_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ +auto makeAnalyticGridViewFunction(F &&f, const GridView &gridView) │ │ │ │ +Create an AnalyticGridViewFunction from a function and a grid view. │ │ │ │ +DDeeffiinniittiioonn analyticgridviewfunction.hh:238 │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_i_n_t_e_r_p_o_l_a_t_e │ │ │ │ -void interpolate(const B &basis, C &&coeff, const F &f, const BV &bv, const │ │ │ │ -NTRE &nodeToRangeEntry) │ │ │ │ -Interpolate given function in discrete function space. │ │ │ │ -DDeeffiinniittiioonn interpolate.hh:205 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ std::decay_t< F > makeGridViewFunction(F &&f, const GridView &gridView) │ │ │ │ Construct a function modeling GridViewFunction from function and grid view. │ │ │ │ DDeeffiinniittiioonn gridviewfunction.hh:72 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_o_r_w_a_r_d_C_a_p_t_u_r_e │ │ │ │ -auto forwardCapture(T &&t) │ │ │ │ -Create a capture object for perfect forwarding. │ │ │ │ -DDeeffiinniittiioonn utility.hh:380 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_N_o_d_e_T_o_R_a_n_g_e_M_a_p │ │ │ │ -A simple node to range map using the nested tree indices. │ │ │ │ -DDeeffiinniittiioonn hierarchicnodetorangemap.hh:34 │ │ │ │ -_c_o_n_c_e_p_t_s_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ +Default implementation for derivative traits. │ │ │ │ +DDeeffiinniittiioonn defaultderivativetraits.hh:41 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ +DDeeffiinniittiioonn gridfunction.hh:36 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t │ │ │ │ +An entity set for all entities of given codim in a grid view. │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:27 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ +DDeeffiinniittiioonn gridviewfunction.hh:26 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_, │ │ │ │ +_b_u_f_f_e_r_S_i_z_e_ _>_:_:_G_r_i_d_V_i_e_w │ │ │ │ +GV GridView │ │ │ │ +DDeeffiinniittiioonn gridviewfunction.hh:50 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _i_n_t_e_r_p_o_l_a_t_e_._h_h │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ + * _g_r_i_d_v_i_e_w_f_u_n_c_t_i_o_n_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00137.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: hierarchicnodetorangemap.hh File Reference │ │ │ +Dune-Functions: composedgridfunction.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,47 +88,57 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
hierarchicnodetorangemap.hh File Reference
│ │ │ +
composedgridfunction.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <utility>
│ │ │ -#include <type_traits>
│ │ │ -#include <dune/common/concept.hh>
│ │ │ -#include <dune/functions/functionspacebases/concepts.hh>
│ │ │ -#include <dune/functions/common/indexaccess.hh>
│ │ │ +
#include <type_traits>
│ │ │ +#include <tuple>
│ │ │ +#include <dune/common/referencehelper.hh>
│ │ │ +#include <dune/common/typeutilities.hh>
│ │ │ +#include <dune/functions/common/defaultderivativetraits.hh>
│ │ │ +#include <dune/functions/common/differentiablefunction.hh>
│ │ │ +#include <dune/functions/gridfunctions/gridfunction.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

struct  Dune::Functions::HierarchicNodeToRangeMap
 A simple node to range map using the nested tree indices. More...
class  Dune::Functions::ComposedGridFunction< OF, IF >
 Composition of grid functions with another function. More...
│ │ │ │ │ │ │ │ │ │ │ │ +

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ +Functions

template<class OF, class... IF>
 Dune::Functions::ComposedGridFunction (const OF &, const IF &...) -> ComposedGridFunction< OF, IF... >
template<class OF, class... IF>
auto Dune::Functions::makeComposedGridFunction (OF &&outerFunction, IF &&... innerFunction)
 Create a ComposedGridFunction that composes grid-functions with another function.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,22 +1,33 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -hierarchicnodetorangemap.hh File Reference │ │ │ │ -#include │ │ │ │ +composedgridfunction.hh File Reference │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_i_n_d_e_x_a_c_c_e_s_s_._h_h> │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_N_o_d_e_T_o_R_a_n_g_e_M_a_p │ │ │ │ -  A simple node to range map using the nested tree indices. _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_<_ _O_F_,_ _I_F_ _> │ │ │ │ +  Composition of grid functions with another function. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ +FFuunnccttiioonnss │ │ │ │ +template │ │ │ │ +   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n (const OF &, const IF &...) - │ │ │ │ + > ComposedGridFunction< OF, IF... > │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n (OF &&outerFunction, IF &&... │ │ │ │ + innerFunction) │ │ │ │ +  Create a _C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n that composes grid-functions with another │ │ │ │ + function. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _h_i_e_r_a_r_c_h_i_c_n_o_d_e_t_o_r_a_n_g_e_m_a_p_._h_h │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ + * _c_o_m_p_o_s_e_d_g_r_i_d_f_u_n_c_t_i_o_n_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00137.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,3 +1,4 @@ │ │ │ │ var a00137 = [ │ │ │ │ - ["Dune::Functions::HierarchicNodeToRangeMap", "a01906.html", "a01906"] │ │ │ │ + ["Dune::Functions::ComposedGridFunction", "a00318.html#ae70612d0758e301c3168bdeb2dad5bff", null], │ │ │ │ + ["Dune::Functions::makeComposedGridFunction", "a00308.html#ga9e5ac1cc0fdfb7d7a0e937f58aff21fd", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00137_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: hierarchicnodetorangemap.hh Source File │ │ │ +Dune-Functions: composedgridfunction.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,83 +88,226 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
hierarchicnodetorangemap.hh
│ │ │ +
composedgridfunction.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_HH
│ │ │ +
8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_HH
│ │ │
9
│ │ │ -
10
│ │ │ -
11#include <utility>
│ │ │ -
12#include <type_traits>
│ │ │ -
13
│ │ │ -
14#include <dune/common/concept.hh>
│ │ │ +
10#include <type_traits>
│ │ │ +
11#include <tuple>
│ │ │ +
12
│ │ │ +
13#include <dune/common/referencehelper.hh>
│ │ │ +
14#include <dune/common/typeutilities.hh>
│ │ │
15
│ │ │ - │ │ │ - │ │ │ -
18
│ │ │ -
19namespace Dune {
│ │ │ -
20namespace Functions {
│ │ │ -
21
│ │ │ -
22
│ │ │ -
23
│ │ │ -
│ │ │ - │ │ │ -
34{
│ │ │ -
35 template<class Node, class TreePath, class Range,
│ │ │ -
36 std::enable_if_t< models<Concept::HasIndexAccess, Range, Dune::index_constant<0>>(), int> = 0>
│ │ │ -
│ │ │ -
37 decltype(auto) operator()(const Node&, const TreePath& treePath, Range&& y) const
│ │ │ -
38 {
│ │ │ -
39 return resolveStaticMultiIndex(y, treePath);
│ │ │ -
40 }
│ │ │ -
│ │ │ -
41
│ │ │ -
42 template<class Node, class TreePath, class Range,
│ │ │ -
43 std::enable_if_t<not models<Concept::HasIndexAccess, Range, Dune::index_constant<0>>(), int> = 0>
│ │ │ -
│ │ │ -
44 decltype(auto) operator()(const Node&, const TreePath&, Range&& y) const
│ │ │ -
45 {
│ │ │ -
46 return std::forward<Range>(y);
│ │ │ -
47 }
│ │ │ -
│ │ │ -
48};
│ │ │ -
│ │ │ + │ │ │ + │ │ │ + │ │ │ +
19
│ │ │ +
20
│ │ │ +
21namespace Dune {
│ │ │ +
22namespace Functions {
│ │ │ +
23
│ │ │ +
24
│ │ │ +
25
│ │ │ +
44template<class OF, class... IF>
│ │ │ +
│ │ │ + │ │ │ +
46{
│ │ │ +
47 using InnerFunctions = std::tuple<IF...>;
│ │ │ +
48 using InnerLocalFunctions = std::tuple<decltype(localFunction(resolveRef(std::declval<const IF&>())))...>;
│ │ │
49
│ │ │ -
50
│ │ │ -
51
│ │ │ -
52} // namespace Dune::Functions
│ │ │ -
53} // namespace Dune
│ │ │ +
50 template<std::size_t i>
│ │ │ +
51 using InnerFunction = std::decay_t<ResolveRef_t<std::tuple_element_t<i, InnerFunctions>>>;
│ │ │ +
52
│ │ │ +
53 using OuterFunction = OF;
│ │ │
54
│ │ │ -
55
│ │ │ -
56#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH
│ │ │ - │ │ │ -
constexpr decltype(auto) resolveStaticMultiIndex(C &&c, const MultiIndex &multiIndex)
Provide multi-index access by chaining operator[].
Definition indexaccess.hh:421
│ │ │ +
55public:
│ │ │ +
56
│ │ │ +
57 using EntitySet = typename InnerFunction<0>::EntitySet;
│ │ │ +
58 using Element = typename EntitySet::Element;
│ │ │ +
59
│ │ │ +
60 using Domain = typename EntitySet::GlobalCoordinate;
│ │ │ +
61 using LocalDomain = typename EntitySet::LocalCoordinate;
│ │ │ +
62
│ │ │ +
63 using Range = decltype(std::declval<OF>()(localFunction(std::declval<IF>())(std::declval<LocalDomain>())...));
│ │ │ +
64
│ │ │ +
65private:
│ │ │ +
66
│ │ │ +
67 using Traits = Imp::GridFunctionTraits<Range(Domain), EntitySet, DefaultDerivativeTraits, 16>;
│ │ │ +
68
│ │ │ +
69 class LocalFunction
│ │ │ +
70 {
│ │ │ +
71 public:
│ │ │ +
78 LocalFunction(const ComposedGridFunction& globalFunction) :
│ │ │ +
79 globalFunction_(globalFunction),
│ │ │ +
80 innerLocalFunctions_(globalFunction.innerLocalFunctions())
│ │ │ +
81 {}
│ │ │ +
82
│ │ │ +
92 void bind(const Element& element)
│ │ │ +
93 {
│ │ │ +
94 std::apply([&](auto&... innerFunction) {
│ │ │ +
95 (innerFunction.bind(element),...);
│ │ │ +
96 }, innerLocalFunctions_);
│ │ │ +
97 }
│ │ │ +
98
│ │ │ +
100 void unbind()
│ │ │ +
101 {
│ │ │ +
102 std::apply([&](auto&... innerFunction) {
│ │ │ +
103 (innerFunction.unbind(),...);
│ │ │ +
104 }, innerLocalFunctions_);
│ │ │ +
105 }
│ │ │ +
106
│ │ │ +
109 bool bound() const
│ │ │ +
110 {
│ │ │ +
111 return std::apply([](const auto&... innerFunction) {
│ │ │ +
112 return (innerFunction.bound() && ...);
│ │ │ +
113 }, innerLocalFunctions_);
│ │ │ +
114 }
│ │ │ +
115
│ │ │ +
125 Range operator()(const LocalDomain& x) const
│ │ │ +
126 {
│ │ │ +
127 return std::apply([&](const auto&... innerFunction) {
│ │ │ +
128 return globalFunction_.outerFunction_(innerFunction(x)...);
│ │ │ +
129 }, innerLocalFunctions_);
│ │ │ +
130 }
│ │ │ +
131
│ │ │ +
141 const Element& localContext() const
│ │ │ +
142 {
│ │ │ +
143 return std::get<0>(innerLocalFunctions_).localContext();
│ │ │ +
144 }
│ │ │ +
145
│ │ │ +
147 friend typename Traits::LocalFunctionTraits::DerivativeInterface derivative(const LocalFunction& t)
│ │ │ +
148 {
│ │ │ +
149 DUNE_THROW(NotImplemented,"not implemented");
│ │ │ +
150 }
│ │ │ +
151
│ │ │ +
152 private:
│ │ │ +
153 const ComposedGridFunction& globalFunction_;
│ │ │ +
154 InnerLocalFunctions innerLocalFunctions_;
│ │ │ +
155 };
│ │ │ +
156
│ │ │ +
157public:
│ │ │ +
158
│ │ │ +
168 template<class OFT, class... IFT,
│ │ │ +
169 disableCopyMove<ComposedGridFunction, OFT> = 0,
│ │ │ +
170 std::enable_if_t<(sizeof...(IFT) > 0), int> = 0>
│ │ │ +
│ │ │ +
171 ComposedGridFunction(OFT&& outerFunction, IFT&&... innerFunctions) :
│ │ │ +
172 outerFunction_(std::forward<OFT>(outerFunction)),
│ │ │ +
173 innerFunctions_(std::forward<IFT>(innerFunctions)...)
│ │ │ +
174 {}
│ │ │ +
│ │ │ +
175
│ │ │ +
│ │ │ +
177 Range operator()(const Domain& x) const
│ │ │ +
178 {
│ │ │ +
179 return std::apply([&](const auto&... innerFunction) {
│ │ │ +
180 return outerFunction_(innerFunction(x)...);
│ │ │ +
181 }, innerFunctions_);
│ │ │ +
182 }
│ │ │ +
│ │ │ +
183
│ │ │ +
│ │ │ +
185 friend typename Traits::DerivativeInterface derivative(const ComposedGridFunction& t)
│ │ │ +
186 {
│ │ │ +
187 DUNE_THROW(NotImplemented,"not implemented");
│ │ │ +
188 }
│ │ │ +
│ │ │ +
189
│ │ │ +
│ │ │ +
196 friend LocalFunction localFunction(const ComposedGridFunction& cgf)
│ │ │ +
197 {
│ │ │ +
198 return LocalFunction(cgf);
│ │ │ +
199 }
│ │ │ +
│ │ │ +
200
│ │ │ +
│ │ │ +
211 const EntitySet& entitySet() const
│ │ │ +
212 {
│ │ │ +
213 return resolveRef(std::get<0>(innerFunctions_)).entitySet();
│ │ │ +
214 }
│ │ │ +
│ │ │ +
215
│ │ │ +
216protected:
│ │ │ +
217
│ │ │ +
│ │ │ +
218 InnerLocalFunctions innerLocalFunctions() const
│ │ │ +
219 {
│ │ │ +
220 return std::apply([&](const auto&... innerFunction) {
│ │ │ +
221 return std::make_tuple(localFunction(resolveRef(innerFunction))...);
│ │ │ +
222 }, innerFunctions_);
│ │ │ +
223 }
│ │ │ +
│ │ │ +
224
│ │ │ +
225 OuterFunction outerFunction_;
│ │ │ +
226 InnerFunctions innerFunctions_;
│ │ │ +
227};
│ │ │ +
│ │ │ +
228
│ │ │ +
229// deduction guides
│ │ │ +
230template<class OF, class... IF>
│ │ │ +
231ComposedGridFunction(const OF&, const IF&...)
│ │ │ +
232 -> ComposedGridFunction<OF,IF...>;
│ │ │ +
233
│ │ │ +
234
│ │ │ +
257template<class OF, class... IF>
│ │ │ +
│ │ │ +
258auto makeComposedGridFunction(OF&& outerFunction, IF&&... innerFunction)
│ │ │ +
259{
│ │ │ +
260 using ComposedGridFunctionType = ComposedGridFunction<std::decay_t<OF>, std::decay_t<IF>...>;
│ │ │ +
261 return ComposedGridFunctionType(std::forward<OF>(outerFunction), std::forward<IF>(innerFunction)...);
│ │ │ +
262}
│ │ │ +
│ │ │ +
263
│ │ │ +
264
│ │ │ +
265
│ │ │ +
266}} // namespace Dune::Functions
│ │ │ +
267
│ │ │ +
268
│ │ │ +
269
│ │ │ +
270#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_HH
│ │ │ + │ │ │ + │ │ │ + │ │ │ +
auto makeComposedGridFunction(OF &&outerFunction, IF &&... innerFunction)
Create a ComposedGridFunction that composes grid-functions with another function.
Definition composedgridfunction.hh:258
│ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
A simple node to range map using the nested tree indices.
Definition hierarchicnodetorangemap.hh:34
│ │ │ -
decltype(auto) operator()(const Node &, const TreePath &treePath, Range &&y) const
Definition hierarchicnodetorangemap.hh:37
│ │ │ -
decltype(auto) operator()(const Node &, const TreePath &, Range &&y) const
Definition hierarchicnodetorangemap.hh:44
│ │ │ - │ │ │ +
ComposedGridFunction(const OF &, const IF &...) -> ComposedGridFunction< OF, IF... >
│ │ │ +
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:41
│ │ │ +
Composition of grid functions with another function.
Definition composedgridfunction.hh:46
│ │ │ +
OuterFunction outerFunction_
Definition composedgridfunction.hh:225
│ │ │ +
InnerFunctions innerFunctions_
Definition composedgridfunction.hh:226
│ │ │ +
ComposedGridFunction(OFT &&outerFunction, IFT &&... innerFunctions)
Create ComposedGridFunction.
Definition composedgridfunction.hh:171
│ │ │ +
const EntitySet & entitySet() const
Return the EntitySet associated to this composed grid-function.
Definition composedgridfunction.hh:211
│ │ │ +
typename InnerFunction< 0 >::EntitySet EntitySet
Definition composedgridfunction.hh:57
│ │ │ +
typename EntitySet::LocalCoordinate LocalDomain
Definition composedgridfunction.hh:61
│ │ │ +
typename EntitySet::Element Element
Definition composedgridfunction.hh:58
│ │ │ +
InnerLocalFunctions innerLocalFunctions() const
Definition composedgridfunction.hh:218
│ │ │ +
friend LocalFunction localFunction(const ComposedGridFunction &cgf)
Create a local-function of this composed grid-function.
Definition composedgridfunction.hh:196
│ │ │ +
typename EntitySet::GlobalCoordinate Domain
Definition composedgridfunction.hh:60
│ │ │ +
Range operator()(const Domain &x) const
Evaluation of the composed grid function in coordinates x.
Definition composedgridfunction.hh:177
│ │ │ +
friend Traits::DerivativeInterface derivative(const ComposedGridFunction &t)
Not implemented.
Definition composedgridfunction.hh:185
│ │ │ +
decltype(std::declval< OF >()(localFunction(std::declval< IF >())(std::declval< LocalDomain >())...)) Range
Definition composedgridfunction.hh:63
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,84 +1,253 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -hierarchicnodetorangemap.hh │ │ │ │ +composedgridfunction.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_HH │ │ │ │ +8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_HH │ │ │ │ 9 │ │ │ │ -10 │ │ │ │ -11#include │ │ │ │ -12#include │ │ │ │ -13 │ │ │ │ -14#include │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ +12 │ │ │ │ +13#include │ │ │ │ +14#include │ │ │ │ 15 │ │ │ │ -16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ -17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_i_n_d_e_x_a_c_c_e_s_s_._h_h> │ │ │ │ -18 │ │ │ │ -19namespace _D_u_n_e { │ │ │ │ -20namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -21 │ │ │ │ -22 │ │ │ │ +16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ +17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +19 │ │ │ │ +20 │ │ │ │ +21namespace _D_u_n_e { │ │ │ │ +22namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ 23 │ │ │ │ -_3_3struct _H_i_e_r_a_r_c_h_i_c_N_o_d_e_T_o_R_a_n_g_e_M_a_p │ │ │ │ -34{ │ │ │ │ -35 template>(), int> = 0> │ │ │ │ -_3_7 decltype(auto) _o_p_e_r_a_t_o_r_(_)(const Node&, const TreePath& treePath, Range&& y) │ │ │ │ -const │ │ │ │ -38 { │ │ │ │ -39 return _r_e_s_o_l_v_e_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x(y, treePath); │ │ │ │ -40 } │ │ │ │ -41 │ │ │ │ -42 template>(), int> = 0> │ │ │ │ -_4_4 decltype(auto) _o_p_e_r_a_t_o_r_(_)(const Node&, const TreePath&, Range&& y) const │ │ │ │ -45 { │ │ │ │ -46 return std::forward(y); │ │ │ │ -47 } │ │ │ │ -48}; │ │ │ │ +24 │ │ │ │ +25 │ │ │ │ +44template │ │ │ │ +_4_5class _C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ +46{ │ │ │ │ +47 using InnerFunctions = std::tuple; │ │ │ │ +48 using InnerLocalFunctions = std::tuple())))...>; │ │ │ │ 49 │ │ │ │ -50 │ │ │ │ -51 │ │ │ │ -52} // namespace Dune::Functions │ │ │ │ -53} // namespace Dune │ │ │ │ +50 template │ │ │ │ +51 using InnerFunction = std::decay_t>>; │ │ │ │ +52 │ │ │ │ +53 using OuterFunction = OF; │ │ │ │ 54 │ │ │ │ -55 │ │ │ │ -56#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH │ │ │ │ -_i_n_d_e_x_a_c_c_e_s_s_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_r_e_s_o_l_v_e_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x │ │ │ │ -constexpr decltype(auto) resolveStaticMultiIndex(C &&c, const MultiIndex │ │ │ │ -&multiIndex) │ │ │ │ -Provide multi-index access by chaining operator[]. │ │ │ │ -DDeeffiinniittiioonn indexaccess.hh:421 │ │ │ │ +55public: │ │ │ │ +56 │ │ │ │ +_5_7 using _E_n_t_i_t_y_S_e_t = typename InnerFunction<0>::EntitySet; │ │ │ │ +_5_8 using _E_l_e_m_e_n_t = typename EntitySet::Element; │ │ │ │ +59 │ │ │ │ +_6_0 using _D_o_m_a_i_n = typename EntitySet::GlobalCoordinate; │ │ │ │ +_6_1 using _L_o_c_a_l_D_o_m_a_i_n = typename EntitySet::LocalCoordinate; │ │ │ │ +62 │ │ │ │ +_6_3 using _R_a_n_g_e = decltype(std::declval()(_l_o_c_a_l_F_u_n_c_t_i_o_n(std::declval()) │ │ │ │ +(std::declval())...)); │ │ │ │ +64 │ │ │ │ +65private: │ │ │ │ +66 │ │ │ │ +67 using Traits = Imp::GridFunctionTraits<_R_a_n_g_e(_D_o_m_a_i_n), _E_n_t_i_t_y_S_e_t, │ │ │ │ +_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s, 16>; │ │ │ │ +68 │ │ │ │ +69 class LocalFunction │ │ │ │ +70 { │ │ │ │ +71 public: │ │ │ │ +78 LocalFunction(const _C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n& globalFunction) : │ │ │ │ +79 globalFunction_(globalFunction), │ │ │ │ +80 innerLocalFunctions_(globalFunction._i_n_n_e_r_L_o_c_a_l_F_u_n_c_t_i_o_n_s()) │ │ │ │ +81 {} │ │ │ │ +82 │ │ │ │ +92 void bind(const _E_l_e_m_e_n_t& element) │ │ │ │ +93 { │ │ │ │ +94 std::apply([&](auto&... innerFunction) { │ │ │ │ +95 (innerFunction.bind(element),...); │ │ │ │ +96 }, innerLocalFunctions_); │ │ │ │ +97 } │ │ │ │ +98 │ │ │ │ +100 void unbind() │ │ │ │ +101 { │ │ │ │ +102 std::apply([&](auto&... innerFunction) { │ │ │ │ +103 (innerFunction.unbind(),...); │ │ │ │ +104 }, innerLocalFunctions_); │ │ │ │ +105 } │ │ │ │ +106 │ │ │ │ +109 bool bound() const │ │ │ │ +110 { │ │ │ │ +111 return std::apply([](const auto&... innerFunction) { │ │ │ │ +112 return (innerFunction.bound() && ...); │ │ │ │ +113 }, innerLocalFunctions_); │ │ │ │ +114 } │ │ │ │ +115 │ │ │ │ +125 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(const _L_o_c_a_l_D_o_m_a_i_n& x) const │ │ │ │ +126 { │ │ │ │ +127 return std::apply([&](const auto&... innerFunction) { │ │ │ │ +128 return globalFunction_._o_u_t_e_r_F_u_n_c_t_i_o_n__(innerFunction(x)...); │ │ │ │ +129 }, innerLocalFunctions_); │ │ │ │ +130 } │ │ │ │ +131 │ │ │ │ +141 const _E_l_e_m_e_n_t& localContext() const │ │ │ │ +142 { │ │ │ │ +143 return std::get<0>(innerLocalFunctions_).localContext(); │ │ │ │ +144 } │ │ │ │ +145 │ │ │ │ +147 friend typename Traits::LocalFunctionTraits::DerivativeInterface _d_e_r_i_v_a_t_i_v_e │ │ │ │ +(const LocalFunction& t) │ │ │ │ +148 { │ │ │ │ +149 DUNE_THROW(NotImplemented,"not implemented"); │ │ │ │ +150 } │ │ │ │ +151 │ │ │ │ +152 private: │ │ │ │ +153 const _C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n& globalFunction_; │ │ │ │ +154 InnerLocalFunctions innerLocalFunctions_; │ │ │ │ +155 }; │ │ │ │ +156 │ │ │ │ +157public: │ │ │ │ +158 │ │ │ │ +168 template = 0, │ │ │ │ +170 std::enable_if_t<(sizeof...(IFT) > 0), int> = 0> │ │ │ │ +_1_7_1 _C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n(OFT&& outerFunction, IFT&&... innerFunctions) : │ │ │ │ +172 _o_u_t_e_r_F_u_n_c_t_i_o_n__(std::forward(outerFunction)), │ │ │ │ +173 _i_n_n_e_r_F_u_n_c_t_i_o_n_s__(std::forward(innerFunctions)...) │ │ │ │ +174 {} │ │ │ │ +175 │ │ │ │ +_1_7_7 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(const _D_o_m_a_i_n& x) const │ │ │ │ +178 { │ │ │ │ +179 return std::apply([&](const auto&... innerFunction) { │ │ │ │ +180 return _o_u_t_e_r_F_u_n_c_t_i_o_n__(innerFunction(x)...); │ │ │ │ +181 }, _i_n_n_e_r_F_u_n_c_t_i_o_n_s__); │ │ │ │ +182 } │ │ │ │ +183 │ │ │ │ +_1_8_5 friend typename Traits::DerivativeInterface _d_e_r_i_v_a_t_i_v_e(const │ │ │ │ +_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n& t) │ │ │ │ +186 { │ │ │ │ +187 DUNE_THROW(NotImplemented,"not implemented"); │ │ │ │ +188 } │ │ │ │ +189 │ │ │ │ +_1_9_6 friend LocalFunction _l_o_c_a_l_F_u_n_c_t_i_o_n(const _C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n& cgf) │ │ │ │ +197 { │ │ │ │ +198 return LocalFunction(cgf); │ │ │ │ +199 } │ │ │ │ +200 │ │ │ │ +_2_1_1 const _E_n_t_i_t_y_S_e_t& _e_n_t_i_t_y_S_e_t() const │ │ │ │ +212 { │ │ │ │ +213 return resolveRef(std::get<0>(_i_n_n_e_r_F_u_n_c_t_i_o_n_s__)).entitySet(); │ │ │ │ +214 } │ │ │ │ +215 │ │ │ │ +216protected: │ │ │ │ +217 │ │ │ │ +_2_1_8 InnerLocalFunctions _i_n_n_e_r_L_o_c_a_l_F_u_n_c_t_i_o_n_s() const │ │ │ │ +219 { │ │ │ │ +220 return std::apply([&](const auto&... innerFunction) { │ │ │ │ +221 return std::make_tuple(_l_o_c_a_l_F_u_n_c_t_i_o_n(resolveRef(innerFunction))...); │ │ │ │ +222 }, _i_n_n_e_r_F_u_n_c_t_i_o_n_s__); │ │ │ │ +223 } │ │ │ │ +224 │ │ │ │ +_2_2_5 OuterFunction _o_u_t_e_r_F_u_n_c_t_i_o_n__; │ │ │ │ +_2_2_6 InnerFunctions _i_n_n_e_r_F_u_n_c_t_i_o_n_s__; │ │ │ │ +227}; │ │ │ │ +228 │ │ │ │ +229// deduction guides │ │ │ │ +230template │ │ │ │ +_2_3_1_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n(const OF&, const IF&...) │ │ │ │ +232 -> _C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n; │ │ │ │ +233 │ │ │ │ +234 │ │ │ │ +257template │ │ │ │ +_2_5_8auto _m_a_k_e_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n(OF&& outerFunction, IF&&... innerFunction) │ │ │ │ +259{ │ │ │ │ +260 using ComposedGridFunctionType = _C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_<_s_t_d_:_:_d_e_c_a_y___t_<_O_F_>, │ │ │ │ +std::decay_t...>; │ │ │ │ +261 return ComposedGridFunctionType(std::forward(outerFunction), std:: │ │ │ │ +forward(innerFunction)...); │ │ │ │ +262} │ │ │ │ +263 │ │ │ │ +264 │ │ │ │ +265 │ │ │ │ +266}} // namespace Dune::Functions │ │ │ │ +267 │ │ │ │ +268 │ │ │ │ +269 │ │ │ │ +270#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_HH │ │ │ │ +_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h │ │ │ │ +_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h │ │ │ │ +_g_r_i_d_f_u_n_c_t_i_o_n_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_:_:_m_a_k_e_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ +auto makeComposedGridFunction(OF &&outerFunction, IF &&... innerFunction) │ │ │ │ +Create a ComposedGridFunction that composes grid-functions with another │ │ │ │ +function. │ │ │ │ +DDeeffiinniittiioonn composedgridfunction.hh:258 │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_N_o_d_e_T_o_R_a_n_g_e_M_a_p │ │ │ │ -A simple node to range map using the nested tree indices. │ │ │ │ -DDeeffiinniittiioonn hierarchicnodetorangemap.hh:34 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_N_o_d_e_T_o_R_a_n_g_e_M_a_p_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ -decltype(auto) operator()(const Node &, const TreePath &treePath, Range &&y) │ │ │ │ -const │ │ │ │ -DDeeffiinniittiioonn hierarchicnodetorangemap.hh:37 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_N_o_d_e_T_o_R_a_n_g_e_M_a_p_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ -decltype(auto) operator()(const Node &, const TreePath &, Range &&y) const │ │ │ │ -DDeeffiinniittiioonn hierarchicnodetorangemap.hh:44 │ │ │ │ -_c_o_n_c_e_p_t_s_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ +ComposedGridFunction(const OF &, const IF &...) -> ComposedGridFunction< OF, │ │ │ │ +IF... > │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ +Default implementation for derivative traits. │ │ │ │ +DDeeffiinniittiioonn defaultderivativetraits.hh:41 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ +Composition of grid functions with another function. │ │ │ │ +DDeeffiinniittiioonn composedgridfunction.hh:46 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_:_:_o_u_t_e_r_F_u_n_c_t_i_o_n__ │ │ │ │ +OuterFunction outerFunction_ │ │ │ │ +DDeeffiinniittiioonn composedgridfunction.hh:225 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_:_:_i_n_n_e_r_F_u_n_c_t_i_o_n_s__ │ │ │ │ +InnerFunctions innerFunctions_ │ │ │ │ +DDeeffiinniittiioonn composedgridfunction.hh:226 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ +ComposedGridFunction(OFT &&outerFunction, IFT &&... innerFunctions) │ │ │ │ +Create ComposedGridFunction. │ │ │ │ +DDeeffiinniittiioonn composedgridfunction.hh:171 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_:_:_e_n_t_i_t_y_S_e_t │ │ │ │ +const EntitySet & entitySet() const │ │ │ │ +Return the EntitySet associated to this composed grid-function. │ │ │ │ +DDeeffiinniittiioonn composedgridfunction.hh:211 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_:_:_E_n_t_i_t_y_S_e_t │ │ │ │ +typename InnerFunction< 0 >::EntitySet EntitySet │ │ │ │ +DDeeffiinniittiioonn composedgridfunction.hh:57 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_:_:_L_o_c_a_l_D_o_m_a_i_n │ │ │ │ +typename EntitySet::LocalCoordinate LocalDomain │ │ │ │ +DDeeffiinniittiioonn composedgridfunction.hh:61 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_:_:_E_l_e_m_e_n_t │ │ │ │ +typename EntitySet::Element Element │ │ │ │ +DDeeffiinniittiioonn composedgridfunction.hh:58 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_:_:_i_n_n_e_r_L_o_c_a_l_F_u_n_c_t_i_o_n_s │ │ │ │ +InnerLocalFunctions innerLocalFunctions() const │ │ │ │ +DDeeffiinniittiioonn composedgridfunction.hh:218 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_:_:_l_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +friend LocalFunction localFunction(const ComposedGridFunction &cgf) │ │ │ │ +Create a local-function of this composed grid-function. │ │ │ │ +DDeeffiinniittiioonn composedgridfunction.hh:196 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_:_:_D_o_m_a_i_n │ │ │ │ +typename EntitySet::GlobalCoordinate Domain │ │ │ │ +DDeeffiinniittiioonn composedgridfunction.hh:60 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ +Range operator()(const Domain &x) const │ │ │ │ +Evaluation of the composed grid function in coordinates x. │ │ │ │ +DDeeffiinniittiioonn composedgridfunction.hh:177 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ +friend Traits::DerivativeInterface derivative(const ComposedGridFunction &t) │ │ │ │ +Not implemented. │ │ │ │ +DDeeffiinniittiioonn composedgridfunction.hh:185 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n_:_:_R_a_n_g_e │ │ │ │ +decltype(std::declval< OF >()(localFunction(std::declval< IF >())(std::declval< │ │ │ │ +LocalDomain >())...)) Range │ │ │ │ +DDeeffiinniittiioonn composedgridfunction.hh:63 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _h_i_e_r_a_r_c_h_i_c_n_o_d_e_t_o_r_a_n_g_e_m_a_p_._h_h │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ + * _c_o_m_p_o_s_e_d_g_r_i_d_f_u_n_c_t_i_o_n_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00140.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: hierarchicallagrangewithelementbubblebasis.hh File Reference │ │ │ +Dune-Functions: localderivativetraits.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,69 +88,45 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
hierarchicallagrangewithelementbubblebasis.hh File Reference
│ │ │ +
localderivativetraits.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <type_traits>
│ │ │ -#include <dune/common/exceptions.hh>
│ │ │ -#include <dune/common/math.hh>
│ │ │ -#include <dune/localfunctions/hierarchical/hierarchicalp1withelementbubble.hh>
│ │ │ -#include <dune/localfunctions/hierarchical/hierarchicalp2withelementbubble.hh>
│ │ │ -#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │ -#include <dune/functions/functionspacebases/lfeprebasismixin.hh>
│ │ │ -#include <dune/geometry/type.hh>
│ │ │ + │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::HierarchicalLagrangeWithElementBubblePreBasis< GV, 1, R >
class  Dune::Functions::HierarchicalLagrangeWithElementBubblePreBasis< GV, 2, R >
struct  Dune::Functions::LocalDerivativeTraits< EntitySet, DerivativeTraits >
 Derivative traits for local functions. More...
struct  Dune::Functions::LocalDerivativeTraits< EntitySet, DerivativeTraits >::Traits< Signature >
struct  Dune::Functions::LocalDerivativeTraits< EntitySet, DerivativeTraits >::Traits< R(LocalDomain)>
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ -

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::BasisFactory
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -

│ │ │ -Typedefs

template<typename GV, int k, typename R = double>
using Dune::Functions::HierarchicalLagrangeWithElementBubbleBasis = DefaultGlobalBasis<HierarchicalLagrangeWithElementBubblePreBasis<GV, k, R> >
 Basis of a Hierarchical Lagrange finite element space with element bubble functions.
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │

│ │ │ -Functions

template<int k, typename R = double>
auto Dune::Functions::BasisFactory::hierarchicalLagrangeWithElementBubble ()
 A factory that can create a HierarchicalLagrangeWithElementBubble pre-basis.
template<typename R = double>
auto Dune::Functions::BasisFactory::hierarchicalP1B ()
 Explicit factory for k=1 for the HierarchicalLagrangeWithElementBubblePreBasis pre-basis.
template<typename R = double>
auto Dune::Functions::BasisFactory::hierarchicalP2B ()
 Explicit factory for k=2 for the HierarchicalLagrangeWithElementBubblePreBasis pre-basis.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,48 +1,22 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -hierarchicallagrangewithelementbubblebasis.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_f_e_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h> │ │ │ │ -#include │ │ │ │ +localderivativetraits.hh File Reference │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_, │ │ │ │ - _R_ _> │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _2_, │ │ │ │ - _R_ _> │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_<_ _E_n_t_i_t_y_S_e_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _> │ │ │ │ +  Derivative traits for local functions. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_<_ _E_n_t_i_t_y_S_e_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ + _>_:_:_T_r_a_i_t_s_<_ _S_i_g_n_a_t_u_r_e_ _> │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_<_ _E_n_t_i_t_y_S_e_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ + _>_:_:_T_r_a_i_t_s_<_ _R_(_L_o_c_a_l_D_o_m_a_i_n_)_> │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -TTyyppeeddeeffss │ │ │ │ -template │ │ │ │ -using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e_B_a_s_i_s = │ │ │ │ - _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s<_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e_P_r_e_B_a_s_i_s > │ │ │ │ -  Basis of a Hierarchical Lagrange finite element space with element │ │ │ │ - bubble functions. │ │ │ │ -FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_h_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e () │ │ │ │ -  A factory that can create a HierarchicalLagrangeWithElementBubble pre- │ │ │ │ - basis. │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_h_i_e_r_a_r_c_h_i_c_a_l_P_1_B () │ │ │ │ -  Explicit factory for k=1 for the │ │ │ │ - _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e_P_r_e_B_a_s_i_s pre-basis. │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_h_i_e_r_a_r_c_h_i_c_a_l_P_2_B () │ │ │ │ -  Explicit factory for k=2 for the │ │ │ │ - _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e_P_r_e_B_a_s_i_s pre-basis. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _h_i_e_r_a_r_c_h_i_c_a_l_l_a_g_r_a_n_g_e_w_i_t_h_e_l_e_m_e_n_t_b_u_b_b_l_e_b_a_s_i_s_._h_h │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ + * _l_o_c_a_l_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00140.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,8 +1,4 @@ │ │ │ │ var a00140 = [ │ │ │ │ - ["Dune::Functions::HierarchicalLagrangeWithElementBubblePreBasis< GV, 1, R >", "a01898.html", "a01898"], │ │ │ │ - ["Dune::Functions::HierarchicalLagrangeWithElementBubblePreBasis< GV, 2, R >", "a01902.html", "a01902"], │ │ │ │ - ["Dune::Functions::HierarchicalLagrangeWithElementBubbleBasis", "a00312.html#ga93629d80f9bbc56263bd671d9d7095e3", null], │ │ │ │ - ["Dune::Functions::BasisFactory::hierarchicalLagrangeWithElementBubble", "a00312.html#ga209c6f38212774585b07161f99f4c43c", null], │ │ │ │ - ["Dune::Functions::BasisFactory::hierarchicalP1B", "a00327.html#add17950d280e320f21d544982d89d236", null], │ │ │ │ - ["Dune::Functions::BasisFactory::hierarchicalP2B", "a00327.html#a20e9647840fd19d21d992e599db0664b", null] │ │ │ │ + ["Dune::Functions::LocalDerivativeTraits< EntitySet, DerivativeTraits >::Traits< Signature >", "a02294.html", "a02294"], │ │ │ │ + ["Dune::Functions::LocalDerivativeTraits< EntitySet, DerivativeTraits >::Traits< R(LocalDomain)>", "a02298.html", "a02298"] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00140_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: hierarchicallagrangewithelementbubblebasis.hh Source File │ │ │ +Dune-Functions: localderivativetraits.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,152 +88,79 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
hierarchicallagrangewithelementbubblebasis.hh
│ │ │ +
localderivativetraits.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ -
3// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │ -
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │ -
5#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HierarchicalLagrangeWOTHELEMENTBUBBLEBASIS_HH
│ │ │ -
6#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HierarchicalLagrangeWOTHELEMENTBUBBLEBASIS_HH
│ │ │ -
7
│ │ │ -
8#include <type_traits>
│ │ │ +
3
│ │ │ +
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │ +
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │ +
6
│ │ │ +
7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH
│ │ │ +
8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH
│ │ │
9
│ │ │ -
10#include <dune/common/exceptions.hh>
│ │ │ -
11#include <dune/common/math.hh>
│ │ │ +
10
│ │ │ + │ │ │
12
│ │ │ -
13#include <dune/localfunctions/hierarchical/hierarchicalp1withelementbubble.hh>
│ │ │ -
14#include <dune/localfunctions/hierarchical/hierarchicalp2withelementbubble.hh>
│ │ │ -
15
│ │ │ - │ │ │ - │ │ │ -
18
│ │ │ -
19#include <dune/geometry/type.hh>
│ │ │ -
20
│ │ │ -
21namespace Dune {
│ │ │ -
22 namespace Functions {
│ │ │ -
23
│ │ │ -
24 // *****************************************************************************
│ │ │ -
25 // Implementation for Hierarchical Lagrange Basis (of order 1-2) with an
│ │ │ -
26 // element bubble function (of order dim+1).
│ │ │ -
27 //
│ │ │ -
28 // - currently only supports simplex grids
│ │ │ -
29 //
│ │ │ -
30 // *****************************************************************************
│ │ │ -
31
│ │ │ -
41 template<typename GV, int k, typename R=double>
│ │ │ - │ │ │ -
43
│ │ │ -
44 template<typename GV, typename R>
│ │ │ -
│ │ │ - │ │ │ -
46 : public LFEPreBasisMixin<GV, HierarchicalP1WithElementBubbleLocalFiniteElement<typename GV::ctype,R,GV::dimension>>
│ │ │ -
47 {
│ │ │ - │ │ │ -
49 public:
│ │ │ -
│ │ │ - │ │ │ -
51 Base(gridView, [](GeometryType gt, int) { return (gt.isVertex() || gt.dim() == GV::dimension) ? 1 : 0; })
│ │ │ -
52 {
│ │ │ -
53 for (auto gt : gridView.indexSet().types(0)) {
│ │ │ -
54 if (!gt.isSimplex())
│ │ │ -
55 DUNE_THROW(Dune::NotImplemented,
│ │ │ -
56 "Hierarchical Lagrange basis only implemented for simplex grids.");
│ │ │ -
57 }
│ │ │ -
58 }
│ │ │ -
│ │ │ -
59 };
│ │ │ -
│ │ │ -
60
│ │ │ -
61 template<typename GV, typename R>
│ │ │ -
│ │ │ - │ │ │ -
63 : public LFEPreBasisMixin<GV, HierarchicalP2WithElementBubbleLocalFiniteElement<typename GV::ctype,R,GV::dimension>>
│ │ │ -
64 {
│ │ │ - │ │ │ -
66 public:
│ │ │ -
│ │ │ - │ │ │ -
68 Base(gridView, [](GeometryType gt, int) { return (gt.dim() <= 1 || gt.dim() == GV::dimension) ? 1 : 0; })
│ │ │ -
69 {
│ │ │ -
70 for (auto gt : gridView.indexSet().types(0)) {
│ │ │ -
71 if (!gt.isSimplex())
│ │ │ -
72 DUNE_THROW(Dune::NotImplemented,
│ │ │ -
73 "Hierarchical Lagrange basis only implemented for simplex grids.");
│ │ │ -
74 }
│ │ │ -
75 }
│ │ │ -
│ │ │ -
76 };
│ │ │ -
│ │ │ -
77
│ │ │ -
78
│ │ │ -
79 namespace BasisFactory {
│ │ │ -
80
│ │ │ -
89 template<int k, typename R=double>
│ │ │ -
│ │ │ - │ │ │ -
91 {
│ │ │ -
92 static_assert(0 < k && k <= 2);
│ │ │ -
93 return [](const auto& gridView) {
│ │ │ -
94 return HierarchicalLagrangeWithElementBubblePreBasis<std::decay_t<decltype(gridView)>, k, R>(gridView);
│ │ │ -
95 };
│ │ │ -
96 }
│ │ │ -
│ │ │ -
97
│ │ │ -
99 template<typename R=double>
│ │ │ -
│ │ │ - │ │ │ -
101 {
│ │ │ - │ │ │ -
103 }
│ │ │ -
│ │ │ -
104
│ │ │ -
106 template<typename R=double>
│ │ │ -
│ │ │ - │ │ │ -
108 {
│ │ │ - │ │ │ -
110 }
│ │ │ -
│ │ │ -
111
│ │ │ -
112 } // end namespace BasisFactory
│ │ │ -
113
│ │ │ -
124 template<typename GV, int k, typename R=double>
│ │ │ - │ │ │ -
126
│ │ │ -
127 } // end namespace Functions
│ │ │ -
128} // end namespace Dune
│ │ │ -
129
│ │ │ -
130#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HierarchicalLagrangeWOTHELEMENTBUBBLEBASIS_HH
│ │ │ - │ │ │ - │ │ │ -
auto hierarchicalLagrangeWithElementBubble()
A factory that can create a HierarchicalLagrangeWithElementBubble pre-basis.
Definition hierarchicallagrangewithelementbubblebasis.hh:90
│ │ │ -
DefaultGlobalBasis< HierarchicalLagrangeWithElementBubblePreBasis< GV, k, R > > HierarchicalLagrangeWithElementBubbleBasis
Basis of a Hierarchical Lagrange finite element space with element bubble functions.
Definition hierarchicallagrangewithelementbubblebasis.hh:125
│ │ │ +
13
│ │ │ +
14namespace Dune {
│ │ │ +
15namespace Functions {
│ │ │ +
16
│ │ │ +
17
│ │ │ +
30template<class EntitySet, template<class> class DerivativeTraits=DefaultDerivativeTraits>
│ │ │ +
│ │ │ + │ │ │ +
32{
│ │ │ +
33 using LocalDomain = typename EntitySet::LocalCoordinate;
│ │ │ +
34 using Domain = typename EntitySet::GlobalCoordinate;
│ │ │ +
35
│ │ │ +
36 template<class Signature>
│ │ │ +
│ │ │ +
37 struct Traits
│ │ │ +
38 {
│ │ │ + │ │ │ +
40 };
│ │ │ +
│ │ │ +
41
│ │ │ +
42 template<class R>
│ │ │ +
│ │ │ + │ │ │ +
44 {
│ │ │ +
45 using Range = typename DerivativeTraits<R(Domain)>::Range;
│ │ │ +
46 };
│ │ │ +
│ │ │ +
47};
│ │ │ +
│ │ │ +
48
│ │ │ +
49
│ │ │ +
50}} // namespace Dune::Functions
│ │ │ +
51
│ │ │ +
52#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH
│ │ │ + │ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
Definition argyrisbasis.hh:926
│ │ │ -
auto hierarchicalP2B()
Explicit factory for k=2 for the HierarchicalLagrangeWithElementBubblePreBasis pre-basis.
Definition hierarchicallagrangewithelementbubblebasis.hh:107
│ │ │ -
auto hierarchicalP1B()
Explicit factory for k=1 for the HierarchicalLagrangeWithElementBubblePreBasis pre-basis.
Definition hierarchicallagrangewithelementbubblebasis.hh:100
│ │ │ -
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:53
│ │ │ -
A pre-basis for a hierarchical basis.
Definition hierarchicallagrangewithelementbubblebasis.hh:42
│ │ │ -
HierarchicalLagrangeWithElementBubblePreBasis(const GV &gridView)
Definition hierarchicallagrangewithelementbubblebasis.hh:50
│ │ │ -
HierarchicalLagrangeWithElementBubblePreBasis(const GV &gridView)
Definition hierarchicallagrangewithelementbubblebasis.hh:67
│ │ │ - │ │ │ - │ │ │ +
Dummy range class to be used if no proper type is available.
Definition defaultderivativetraits.hh:27
│ │ │ +
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:41
│ │ │ +
Derivative traits for local functions.
Definition localderivativetraits.hh:32
│ │ │ +
typename EntitySet::GlobalCoordinate Domain
Definition localderivativetraits.hh:34
│ │ │ +
typename EntitySet::LocalCoordinate LocalDomain
Definition localderivativetraits.hh:33
│ │ │ +
Definition localderivativetraits.hh:38
│ │ │ +
InvalidRange Range
Definition localderivativetraits.hh:39
│ │ │ +
typename DerivativeTraits< R(Domain)>::Range Range
Definition localderivativetraits.hh:45
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,186 +1,82 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -hierarchicallagrangewithelementbubblebasis.hh │ │ │ │ +localderivativetraits.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ -3// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ +3 │ │ │ │ +4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ -4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ +5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ -5#ifndef │ │ │ │ -DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HierarchicalLagrangeWOTHELEMENTBUBBLEBASIS_HH │ │ │ │ -6#define │ │ │ │ -DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HierarchicalLagrangeWOTHELEMENTBUBBLEBASIS_HH │ │ │ │ -7 │ │ │ │ -8#include │ │ │ │ +6 │ │ │ │ +7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH │ │ │ │ +8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ +10 │ │ │ │ +11#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ 12 │ │ │ │ -13#include │ │ │ │ -14#include │ │ │ │ -15 │ │ │ │ -16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ -17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_f_e_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h> │ │ │ │ -18 │ │ │ │ -19#include │ │ │ │ -20 │ │ │ │ -21namespace _D_u_n_e { │ │ │ │ -22 namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -23 │ │ │ │ -24 / │ │ │ │ -/ ***************************************************************************** │ │ │ │ -25 // Implementation for Hierarchical Lagrange Basis (of order 1-2) with an │ │ │ │ -26 // element bubble function (of order dim+1). │ │ │ │ -27 // │ │ │ │ -28 // - currently only supports simplex grids │ │ │ │ -29 // │ │ │ │ -30 / │ │ │ │ -/ ***************************************************************************** │ │ │ │ -31 │ │ │ │ -41 template │ │ │ │ -_4_2 class _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e_P_r_e_B_a_s_i_s; │ │ │ │ -43 │ │ │ │ -44 template │ │ │ │ -_4_5 class _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e_P_r_e_B_a_s_i_s │ │ │ │ -46 : public _L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n> │ │ │ │ -47 { │ │ │ │ -48 using Base = _L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_<_G_V_, │ │ │ │ -_H_i_e_r_a_r_c_h_i_c_a_l_P_1_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_t_y_p_e_n_a_m_e_ _G_V_:_:_c_t_y_p_e_,_R_,_G_V_:_: │ │ │ │ -_d_i_m_e_n_s_i_o_n_>>; │ │ │ │ -49 public: │ │ │ │ -_5_0 _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e_P_r_e_B_a_s_i_s (const GV& _g_r_i_d_V_i_e_w) : │ │ │ │ -51 Base(_g_r_i_d_V_i_e_w, [](GeometryType gt, int) { return (gt.isVertex() || gt.dim() │ │ │ │ -== GV::dimension) ? 1 : 0; }) │ │ │ │ -52 { │ │ │ │ -53 for (auto gt : gridView.indexSet().types(0)) { │ │ │ │ -54 if (!gt.isSimplex()) │ │ │ │ -55 DUNE_THROW(Dune::NotImplemented, │ │ │ │ -56 "Hierarchical Lagrange basis only implemented for simplex grids."); │ │ │ │ -57 } │ │ │ │ -58 } │ │ │ │ -59 }; │ │ │ │ -60 │ │ │ │ -61 template │ │ │ │ -_6_2 class _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e_P_r_e_B_a_s_i_s │ │ │ │ -63 : public _L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n> │ │ │ │ -64 { │ │ │ │ -65 using Base = _L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_<_G_V_, │ │ │ │ -_H_i_e_r_a_r_c_h_i_c_a_l_P_2_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_t_y_p_e_n_a_m_e_ _G_V_:_:_c_t_y_p_e_,_R_,_G_V_:_: │ │ │ │ -_d_i_m_e_n_s_i_o_n_>>; │ │ │ │ -66 public: │ │ │ │ -_6_7 _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e_P_r_e_B_a_s_i_s (const GV& _g_r_i_d_V_i_e_w) : │ │ │ │ -68 Base(_g_r_i_d_V_i_e_w, [](GeometryType gt, int) { return (gt.dim() <= 1 || gt.dim() │ │ │ │ -== GV::dimension) ? 1 : 0; }) │ │ │ │ -69 { │ │ │ │ -70 for (auto gt : gridView.indexSet().types(0)) { │ │ │ │ -71 if (!gt.isSimplex()) │ │ │ │ -72 DUNE_THROW(Dune::NotImplemented, │ │ │ │ -73 "Hierarchical Lagrange basis only implemented for simplex grids."); │ │ │ │ -74 } │ │ │ │ -75 } │ │ │ │ -76 }; │ │ │ │ -77 │ │ │ │ -78 │ │ │ │ -79 namespace _B_a_s_i_s_F_a_c_t_o_r_y { │ │ │ │ -80 │ │ │ │ -89 template │ │ │ │ -_9_0 auto _h_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e() │ │ │ │ -91 { │ │ │ │ -92 static_assert(0 < k && k <= 2); │ │ │ │ -93 return [](const auto& gridView) { │ │ │ │ -94 return _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e_P_r_e_B_a_s_i_s, k, R>(gridView); │ │ │ │ -95 }; │ │ │ │ -96 } │ │ │ │ -97 │ │ │ │ -99 template │ │ │ │ -_1_0_0 auto _h_i_e_r_a_r_c_h_i_c_a_l_P_1_B() │ │ │ │ -101 { │ │ │ │ -102 return _h_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e_<_1_,_R_>(); │ │ │ │ -103 } │ │ │ │ -104 │ │ │ │ -106 template │ │ │ │ -_1_0_7 auto _h_i_e_r_a_r_c_h_i_c_a_l_P_2_B() │ │ │ │ -108 { │ │ │ │ -109 return _h_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e_<_2_,_R_>(); │ │ │ │ -110 } │ │ │ │ -111 │ │ │ │ -112 } // end namespace BasisFactory │ │ │ │ -113 │ │ │ │ -124 template │ │ │ │ -_1_2_5 using _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e_B_a_s_i_s = │ │ │ │ -_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e_P_r_e_B_a_s_i_s_<_G_V_,_ _k_,_ _R_> >; │ │ │ │ -126 │ │ │ │ -127 } // end namespace Functions │ │ │ │ -128} // end namespace Dune │ │ │ │ -129 │ │ │ │ -130#endif / │ │ │ │ -/ │ │ │ │ -DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HierarchicalLagrangeWOTHELEMENTBUBBLEBASIS_HH │ │ │ │ -_l_f_e_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h │ │ │ │ -_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_h_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e │ │ │ │ -auto hierarchicalLagrangeWithElementBubble() │ │ │ │ -A factory that can create a HierarchicalLagrangeWithElementBubble pre-basis. │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangewithelementbubblebasis.hh:90 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e_B_a_s_i_s │ │ │ │ -DefaultGlobalBasis< HierarchicalLagrangeWithElementBubblePreBasis< GV, k, R > > │ │ │ │ -HierarchicalLagrangeWithElementBubbleBasis │ │ │ │ -Basis of a Hierarchical Lagrange finite element space with element bubble │ │ │ │ -functions. │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangewithelementbubblebasis.hh:125 │ │ │ │ +13 │ │ │ │ +14namespace _D_u_n_e { │ │ │ │ +15namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +16 │ │ │ │ +17 │ │ │ │ +30template class │ │ │ │ +DerivativeTraits=_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s> │ │ │ │ +_3_1struct _L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ +32{ │ │ │ │ +_3_3 using _L_o_c_a_l_D_o_m_a_i_n = typename EntitySet::LocalCoordinate; │ │ │ │ +_3_4 using _D_o_m_a_i_n = typename EntitySet::GlobalCoordinate; │ │ │ │ +35 │ │ │ │ +36 template │ │ │ │ +_3_7 struct _T_r_a_i_t_s │ │ │ │ +38 { │ │ │ │ +_3_9 typedef _I_n_v_a_l_i_d_R_a_n_g_e _R_a_n_g_e; │ │ │ │ +40 }; │ │ │ │ +41 │ │ │ │ +42 template │ │ │ │ +_4_3 struct _T_r_a_i_t_s │ │ │ │ +44 { │ │ │ │ +_4_5 using _R_a_n_g_e = typename DerivativeTraits_:_:_R_a_n_g_e; │ │ │ │ +46 }; │ │ │ │ +47}; │ │ │ │ +48 │ │ │ │ +49 │ │ │ │ +50}} // namespace Dune::Functions │ │ │ │ +51 │ │ │ │ +52#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH │ │ │ │ +_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:926 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_h_i_e_r_a_r_c_h_i_c_a_l_P_2_B │ │ │ │ -auto hierarchicalP2B() │ │ │ │ -Explicit factory for k=2 for the HierarchicalLagrangeWithElementBubblePreBasis │ │ │ │ -pre-basis. │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangewithelementbubblebasis.hh:107 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_h_i_e_r_a_r_c_h_i_c_a_l_P_1_B │ │ │ │ -auto hierarchicalP1B() │ │ │ │ -Explicit factory for k=1 for the HierarchicalLagrangeWithElementBubblePreBasis │ │ │ │ -pre-basis. │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangewithelementbubblebasis.hh:100 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ -Global basis for given pre-basis. │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:53 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e_P_r_e_B_a_s_i_s │ │ │ │ -A pre-basis for a hierarchical basis. │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangewithelementbubblebasis.hh:42 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_,_ _R_ _>_:_: │ │ │ │ -_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e_P_r_e_B_a_s_i_s │ │ │ │ -HierarchicalLagrangeWithElementBubblePreBasis(const GV &gridView) │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangewithelementbubblebasis.hh:50 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _2_,_ _R_ _>_:_: │ │ │ │ -_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e_P_r_e_B_a_s_i_s │ │ │ │ -HierarchicalLagrangeWithElementBubblePreBasis(const GV &gridView) │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangewithelementbubblebasis.hh:67 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_<_ _G_V_, │ │ │ │ -_H_i_e_r_a_r_c_h_i_c_a_l_P_1_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_ _G_V_:_:_c_t_y_p_e_,_ _R_,_ _G_V_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ -_>_ _>_:_:_g_r_i_d_V_i_e_w │ │ │ │ -const GridView & gridView() const │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:95 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_<_ _G_V_, │ │ │ │ -_H_i_e_r_a_r_c_h_i_c_a_l_P_1_W_i_t_h_E_l_e_m_e_n_t_B_u_b_b_l_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_ _G_V_:_:_c_t_y_p_e_,_ _R_,_ _G_V_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ -_>_ _>_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n │ │ │ │ -LFEPreBasisMixin(const GridView &gv, MCMGLayout layout) │ │ │ │ -DDeeffiinniittiioonn lfeprebasismixin.hh:75 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_n_v_a_l_i_d_R_a_n_g_e │ │ │ │ +Dummy range class to be used if no proper type is available. │ │ │ │ +DDeeffiinniittiioonn defaultderivativetraits.hh:27 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ +Default implementation for derivative traits. │ │ │ │ +DDeeffiinniittiioonn defaultderivativetraits.hh:41 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ +Derivative traits for local functions. │ │ │ │ +DDeeffiinniittiioonn localderivativetraits.hh:32 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_:_:_D_o_m_a_i_n │ │ │ │ +typename EntitySet::GlobalCoordinate Domain │ │ │ │ +DDeeffiinniittiioonn localderivativetraits.hh:34 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_:_:_L_o_c_a_l_D_o_m_a_i_n │ │ │ │ +typename EntitySet::LocalCoordinate LocalDomain │ │ │ │ +DDeeffiinniittiioonn localderivativetraits.hh:33 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_:_:_T_r_a_i_t_s │ │ │ │ +DDeeffiinniittiioonn localderivativetraits.hh:38 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_:_:_T_r_a_i_t_s_:_:_R_a_n_g_e │ │ │ │ +InvalidRange Range │ │ │ │ +DDeeffiinniittiioonn localderivativetraits.hh:39 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_:_:_T_r_a_i_t_s_<_ _R_(_L_o_c_a_l_D_o_m_a_i_n_)_>_:_:_R_a_n_g_e │ │ │ │ +typename DerivativeTraits< R(Domain)>::Range Range │ │ │ │ +DDeeffiinniittiioonn localderivativetraits.hh:45 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _h_i_e_r_a_r_c_h_i_c_a_l_l_a_g_r_a_n_g_e_w_i_t_h_e_l_e_m_e_n_t_b_u_b_b_l_e_b_a_s_i_s_._h_h │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ + * _l_o_c_a_l_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00143.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: hierarchicallagrangebasis.hh File Reference │ │ │ +Dune-Functions: facenormalgridfunction.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,62 +88,50 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
hierarchicallagrangebasis.hh File Reference
│ │ │ +
facenormalgridfunction.hh File Reference
│ │ │
│ │ │
│ │ │
#include <type_traits>
│ │ │ +#include <optional>
│ │ │ #include <dune/common/exceptions.hh>
│ │ │ -#include <dune/localfunctions/hierarchical/hierarchicalp2.hh>
│ │ │ -#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ -#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │ -#include <dune/functions/functionspacebases/lfeprebasismixin.hh>
│ │ │ -#include <dune/geometry/type.hh>
│ │ │ +#include <dune/common/typeutilities.hh>
│ │ │ +#include <dune/common/rangeutilities.hh>
│ │ │ +#include <dune/geometry/referenceelements.hh>
│ │ │ +#include <dune/functions/gridfunctions/gridfunction.hh>
│ │ │ +#include <dune/functions/gridfunctions/gridviewentityset.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::HierarchicalLagrangePreBasis< GV, 1, R >
class  Dune::Functions::HierarchicalLagrangePreBasis< GV, 2, R >
class  Dune::Functions::FaceNormalGridFunction< GV >
 Grid function implementing the piecewise element face normal. More...
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ -

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::BasisFactory
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -

│ │ │ -Typedefs

template<typename GV, int k, typename R = double>
using Dune::Functions::HierarchicalLagrangeBasis = DefaultGlobalBasis<HierarchicalLagrangePreBasis<GV, k, R> >
 Basis of a scalar Hierarchical Lagrange finite element space.
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │

│ │ │ -Functions

template<int k, typename R = double>
auto Dune::Functions::BasisFactory::hierarchicalLagrange ()
 A factory that can create a HierarchicalLagrange pre-basis.
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,34 +1,25 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -hierarchicallagrangebasis.hh File Reference │ │ │ │ +facenormalgridfunction.hh File Reference │ │ │ │ #include │ │ │ │ +#include │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_f_e_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h> │ │ │ │ -#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_,_ _R_ _> │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _2_,_ _R_ _> │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n_<_ _G_V_ _> │ │ │ │ +  Grid function implementing the piecewise element face normal. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -TTyyppeeddeeffss │ │ │ │ -template │ │ │ │ -using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_B_a_s_i_s = │ │ │ │ - _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s<_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s > │ │ │ │ -  Basis of a scalar Hierarchical Lagrange finite element space. │ │ │ │ -FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_h_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e () │ │ │ │ -  A factory that can create a HierarchicalLagrange pre-basis. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _h_i_e_r_a_r_c_h_i_c_a_l_l_a_g_r_a_n_g_e_b_a_s_i_s_._h_h │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ + * _f_a_c_e_n_o_r_m_a_l_g_r_i_d_f_u_n_c_t_i_o_n_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00143_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: hierarchicallagrangebasis.hh Source File │ │ │ +Dune-Functions: facenormalgridfunction.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,136 +88,210 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
hierarchicallagrangebasis.hh
│ │ │ +
facenormalgridfunction.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH
│ │ │ +
8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH
│ │ │
9
│ │ │
10#include <type_traits>
│ │ │ -
11
│ │ │ -
12#include <dune/common/exceptions.hh>
│ │ │ -
13
│ │ │ -
14#include <dune/localfunctions/hierarchical/hierarchicalp2.hh>
│ │ │ -
15
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
19
│ │ │ -
20#include <dune/geometry/type.hh>
│ │ │ +
11#include <optional>
│ │ │ +
12
│ │ │ +
13#include <dune/common/exceptions.hh>
│ │ │ +
14#include <dune/common/typeutilities.hh>
│ │ │ +
15#include <dune/common/rangeutilities.hh>
│ │ │ +
16#include <dune/geometry/referenceelements.hh>
│ │ │ +
17
│ │ │ + │ │ │ + │ │ │ +
20
│ │ │
21
│ │ │ -
22namespace Dune {
│ │ │ -
23 namespace Functions {
│ │ │ -
24
│ │ │ -
25 // *****************************************************************************
│ │ │ -
26 // Implementation for Hierarchical Lagrange Basis
│ │ │ -
27 //
│ │ │ -
28 // - only orders k=1,2 are implemented up to now
│ │ │ -
29 // - order k=1 is identical to the standard Lagrange basis
│ │ │ -
30 // - implementation is restricted to simplex grids
│ │ │ -
31 //
│ │ │ -
32 // *****************************************************************************
│ │ │ -
33
│ │ │ -
43 template<typename GV, int k, typename R = double>
│ │ │ - │ │ │ -
45
│ │ │ -
46 template<typename GV, typename R>
│ │ │ -
│ │ │ - │ │ │ -
48 : public LFEPreBasisMixin<GV, LagrangeSimplexLocalFiniteElement<typename GV::ctype,R,GV::dimension,1>>
│ │ │ -
49 {
│ │ │ - │ │ │ -
51 public:
│ │ │ -
│ │ │ - │ │ │ -
53 Base(gridView, [](GeometryType gt, int) -> std::size_t { return gt.isVertex() ? 1 : 0; })
│ │ │ -
54 {
│ │ │ -
55 for (auto gt : gridView.indexSet().types(0)) {
│ │ │ -
56 if (!gt.isSimplex())
│ │ │ -
57 DUNE_THROW(Dune::NotImplemented,
│ │ │ -
58 "Hierarchical Lagrange basis only implemented for simplex grids.");
│ │ │ -
59 }
│ │ │ -
60 }
│ │ │ -
│ │ │ -
61 };
│ │ │ -
│ │ │ -
62
│ │ │ -
63 template<typename GV, typename R>
│ │ │ -
│ │ │ - │ │ │ -
65 : public LFEPreBasisMixin<GV, HierarchicalP2LocalFiniteElement<typename GV::ctype,R,GV::dimension>>
│ │ │ -
66 {
│ │ │ - │ │ │ -
68 public:
│ │ │ -
│ │ │ - │ │ │ -
70 Base(gridView, [](GeometryType gt, int) -> std::size_t { return (gt.isVertex() || gt.isLine()) ? 1 : 0; })
│ │ │ -
71 {
│ │ │ -
72 for (auto gt : gridView.indexSet().types(0)) {
│ │ │ -
73 if (!gt.isSimplex())
│ │ │ -
74 DUNE_THROW(Dune::NotImplemented,
│ │ │ -
75 "Hierarchical Lagrange basis only implemented for simplex grids.");
│ │ │ -
76 }
│ │ │ -
77 }
│ │ │ -
│ │ │ -
78 };
│ │ │ -
│ │ │ +
22namespace Dune::Functions {
│ │ │ +
23
│ │ │ +
24namespace Impl {
│ │ │ +
25
│ │ │ +
26// Compute closest face to point
│ │ │ +
27template<class ReferenceElement, class Coordinate>
│ │ │ +
28auto closestFaceIndex(const ReferenceElement& re, const Coordinate& x)
│ │ │ +
29{
│ │ │ +
30 auto closestFaceIndex = decltype(re.subEntity(0,1,0,1)){};
│ │ │ +
31 double closestFaceDistance = std::numeric_limits<double>::max();
│ │ │ +
32 for(auto&& faceIndex : Dune::range(re.size(1)))
│ │ │ +
33 {
│ │ │ +
34 // For a face unit outer normal consider the orthogonal projection
│ │ │ +
35 // Px = x + <c-x,n>*n into the face. Then the distance to the face
│ │ │ +
36 // is given by |x-Px| = |<c-x,n>||n| = <c-x,n>.
│ │ │ +
37 auto normal = re.integrationOuterNormal(faceIndex);
│ │ │ +
38 normal /= normal.two_norm();
│ │ │ +
39 auto c = re.position(faceIndex,1);
│ │ │ +
40 c -= x;
│ │ │ +
41 auto faceDistance = (c*normal);
│ │ │ +
42 if (faceDistance<closestFaceDistance)
│ │ │ +
43 {
│ │ │ +
44 closestFaceDistance = faceDistance;
│ │ │ +
45 closestFaceIndex = faceIndex;
│ │ │ +
46 }
│ │ │ +
47 }
│ │ │ +
48 return closestFaceIndex;
│ │ │ +
49}
│ │ │ +
50
│ │ │ +
51} // end namespace Impl
│ │ │ +
52
│ │ │ +
53
│ │ │ +
54
│ │ │ +
55
│ │ │ +
68template<class GV>
│ │ │ +
│ │ │ + │ │ │ +
70{
│ │ │ +
71public:
│ │ │ +
72 using GridView = GV;
│ │ │ + │ │ │ +
74 using Element = typename EntitySet::Element;
│ │ │ +
75
│ │ │ + │ │ │ + │ │ │ + │ │ │
79
│ │ │ -
80
│ │ │ -
81 namespace BasisFactory {
│ │ │ -
82
│ │ │ -
91 template<int k, typename R=double>
│ │ │ -
│ │ │ - │ │ │ -
93 {
│ │ │ -
94 static_assert(0 < k && k <= 2);
│ │ │ -
95 return [](const auto& gridView) {
│ │ │ -
96 return HierarchicalLagrangePreBasis<std::decay_t<decltype(gridView)>, k, R>(gridView);
│ │ │ -
97 };
│ │ │ -
98 }
│ │ │ -
│ │ │ -
99
│ │ │ -
100 } // end namespace BasisFactory
│ │ │ -
101
│ │ │ -
112 template<typename GV, int k, typename R=double>
│ │ │ - │ │ │ -
114
│ │ │ -
115 } // end namespace Functions
│ │ │ -
116} // end namespace Dune
│ │ │ -
117
│ │ │ -
118#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
DefaultGlobalBasis< HierarchicalLagrangePreBasis< GV, k, R > > HierarchicalLagrangeBasis
Basis of a scalar Hierarchical Lagrange finite element space.
Definition hierarchicallagrangebasis.hh:113
│ │ │ -
auto hierarchicalLagrange()
A factory that can create a HierarchicalLagrange pre-basis.
Definition hierarchicallagrangebasis.hh:92
│ │ │ -
Definition monomialset.hh:19
│ │ │ +
80private:
│ │ │ +
81
│ │ │ +
82 using Traits = Imp::GridFunctionTraits<Range(Domain), EntitySet, DefaultDerivativeTraits, 16>;
│ │ │ +
83
│ │ │ +
84 class LocalFunction
│ │ │ +
85 {
│ │ │ +
86 using Geometry = typename Element::Geometry;
│ │ │ +
87 static const int dimension = GV::dimension;
│ │ │ +
88 public:
│ │ │ +
89
│ │ │ +
101 void bind(const Element& element)
│ │ │ +
102 {
│ │ │ +
103 element_ = element;
│ │ │ +
104 geometry_.emplace(element_.geometry());
│ │ │ +
105 }
│ │ │ +
106
│ │ │ +
107 void unbind()
│ │ │ +
108 {
│ │ │ +
109 geometry_.reset();
│ │ │ +
110 }
│ │ │ +
111
│ │ │ +
114 bool bound() const
│ │ │ +
115 {
│ │ │ +
116 return static_cast<bool>(geometry_);
│ │ │ +
117 }
│ │ │ +
118
│ │ │ +
128 Range operator()(const LocalDomain& x) const
│ │ │ +
129 {
│ │ │ +
130 auto&& re = Dune::referenceElement(*geometry_);
│ │ │ +
131 // Compute reference normal of closest face to given point
│ │ │ +
132 auto face = Impl::closestFaceIndex(re, x);
│ │ │ +
133 auto localNormal = re.integrationOuterNormal(face);
│ │ │ +
134
│ │ │ +
135 // Transform reference normal into global unit outer normal using
│ │ │ +
136 // covariant Piola transformation
│ │ │ +
137 auto normal = Range{};
│ │ │ +
138 geometry_->jacobianInverseTransposed(x).mv(localNormal, normal);
│ │ │ +
139 normal /= normal.two_norm();
│ │ │ +
140 return normal;
│ │ │ +
141 }
│ │ │ +
142
│ │ │ +
144 const Element& localContext() const
│ │ │ +
145 {
│ │ │ +
146 return element_;
│ │ │ +
147 }
│ │ │ +
148
│ │ │ +
150 friend typename Traits::LocalFunctionTraits::DerivativeInterface derivative(const LocalFunction& t)
│ │ │ +
151 {
│ │ │ +
152 DUNE_THROW(NotImplemented,"not implemented");
│ │ │ +
153 }
│ │ │ +
154
│ │ │ +
155 private:
│ │ │ +
156 std::optional<Geometry> geometry_;
│ │ │ +
157 Element element_;
│ │ │ +
158 };
│ │ │ +
159
│ │ │ +
160public:
│ │ │ +
│ │ │ + │ │ │ +
163 entitySet_(gridView)
│ │ │ +
164 {}
│ │ │ +
│ │ │ +
165
│ │ │ +
│ │ │ +
167 Range operator()(const Domain& x) const
│ │ │ +
168 {
│ │ │ +
169 DUNE_THROW(NotImplemented,"not implemented");
│ │ │ +
170 }
│ │ │ +
│ │ │ +
171
│ │ │ +
│ │ │ +
173 friend typename Traits::DerivativeInterface derivative(const FaceNormalGridFunction& t)
│ │ │ +
174 {
│ │ │ +
175 DUNE_THROW(NotImplemented,"not implemented");
│ │ │ +
176 }
│ │ │ +
│ │ │ +
177
│ │ │ +
│ │ │ +
179 friend LocalFunction localFunction(const FaceNormalGridFunction& t)
│ │ │ +
180 {
│ │ │ +
181 return LocalFunction{};
│ │ │ +
182 }
│ │ │ +
│ │ │ +
183
│ │ │ +
│ │ │ +
185 const EntitySet& entitySet() const
│ │ │ +
186 {
│ │ │ +
187 return entitySet_;
│ │ │ +
188 }
│ │ │ +
│ │ │ +
189
│ │ │ +
190private:
│ │ │ +
191 EntitySet entitySet_;
│ │ │ +
192};
│ │ │ +
│ │ │ +
193
│ │ │ +
194
│ │ │ +
195
│ │ │ +
196} // namespace Dune::Functions
│ │ │ +
197
│ │ │ +
198#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH
│ │ │ + │ │ │ + │ │ │
Definition monomialset.hh:19
│ │ │ -
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:53
│ │ │ -
A pre-basis for a hierarchical Lagrange basis.
Definition hierarchicallagrangebasis.hh:44
│ │ │ -
HierarchicalLagrangePreBasis(const GV &gridView)
Definition hierarchicallagrangebasis.hh:52
│ │ │ -
HierarchicalLagrangePreBasis(const GV &gridView)
Definition hierarchicallagrangebasis.hh:69
│ │ │ - │ │ │ -
LFEPreBasisMixin(const GridView &gv, MCMGLayout layout)
Definition lfeprebasismixin.hh:75
│ │ │ +
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:41
│ │ │ +
GridViewEntitySet< GridView, 0 > EntitySet
Definition facenormalgridfunction.hh:73
│ │ │ +
typename EntitySet::LocalCoordinate LocalDomain
Definition facenormalgridfunction.hh:76
│ │ │ +
typename EntitySet::GlobalCoordinate Domain
Definition facenormalgridfunction.hh:77
│ │ │ +
typename EntitySet::GlobalCoordinate Range
Definition facenormalgridfunction.hh:78
│ │ │ +
const EntitySet & entitySet() const
Return the stored GridViewEntitySet.
Definition facenormalgridfunction.hh:185
│ │ │ +
friend Traits::DerivativeInterface derivative(const FaceNormalGridFunction &t)
Not implemented.
Definition facenormalgridfunction.hh:173
│ │ │ +
GV GridView
Definition facenormalgridfunction.hh:72
│ │ │ +
friend LocalFunction localFunction(const FaceNormalGridFunction &t)
Return a local-function associated to FaceNormalGridFunction.
Definition facenormalgridfunction.hh:179
│ │ │ +
FaceNormalGridFunction(const GridView &gridView)
Construct the FaceNormalGridFunction.
Definition facenormalgridfunction.hh:162
│ │ │ +
typename EntitySet::Element Element
Definition facenormalgridfunction.hh:74
│ │ │ +
Range operator()(const Domain &x) const
Not implemented.
Definition facenormalgridfunction.hh:167
│ │ │ +
An entity set for all entities of given codim in a grid view.
Definition gridviewentityset.hh:27
│ │ │ +
GridView::template Codim< codim >::Entity Element
Definition gridviewentityset.hh:36
│ │ │ +
Element::Geometry::LocalCoordinate LocalCoordinate
Definition gridviewentityset.hh:39
│ │ │ +
Element::Geometry::GlobalCoordinate GlobalCoordinate
Definition gridviewentityset.hh:40
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,152 +1,230 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -hierarchicallagrangebasis.hh │ │ │ │ +facenormalgridfunction.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH │ │ │ │ +8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH │ │ │ │ 9 │ │ │ │ 10#include │ │ │ │ -11 │ │ │ │ -12#include │ │ │ │ -13 │ │ │ │ -14#include │ │ │ │ -15 │ │ │ │ -16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ -18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_f_e_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h> │ │ │ │ -19 │ │ │ │ -20#include │ │ │ │ +11#include │ │ │ │ +12 │ │ │ │ +13#include │ │ │ │ +14#include │ │ │ │ +15#include │ │ │ │ +16#include │ │ │ │ +17 │ │ │ │ +18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +19#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h> │ │ │ │ +20 │ │ │ │ 21 │ │ │ │ -22namespace _D_u_n_e { │ │ │ │ -23 namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -24 │ │ │ │ -25 / │ │ │ │ -/ ***************************************************************************** │ │ │ │ -26 // Implementation for Hierarchical Lagrange Basis │ │ │ │ -27 // │ │ │ │ -28 // - only orders k=1,2 are implemented up to now │ │ │ │ -29 // - order k=1 is identical to the standard Lagrange basis │ │ │ │ -30 // - implementation is restricted to simplex grids │ │ │ │ -31 // │ │ │ │ -32 / │ │ │ │ -/ ***************************************************************************** │ │ │ │ -33 │ │ │ │ -43 template │ │ │ │ -_4_4 class _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s; │ │ │ │ -45 │ │ │ │ -46 template │ │ │ │ -_4_7 class _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s │ │ │ │ -48 : public _L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n> │ │ │ │ -49 { │ │ │ │ -50 using Base = _L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_<_G_V_,_ _L_a_g_r_a_n_g_e_S_i_m_p_l_e_x_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_t_y_p_e_n_a_m_e │ │ │ │ -_G_V_:_:_c_t_y_p_e_,_R_,_G_V_:_:_d_i_m_e_n_s_i_o_n_,_1_>>; │ │ │ │ -51 public: │ │ │ │ -_5_2 _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s (const GV& _g_r_i_d_V_i_e_w) : │ │ │ │ -53 Base(_g_r_i_d_V_i_e_w, [](GeometryType gt, int) -> std::size_t { return gt.isVertex │ │ │ │ -() ? 1 : 0; }) │ │ │ │ -54 { │ │ │ │ -55 for (auto gt : gridView.indexSet().types(0)) { │ │ │ │ -56 if (!gt.isSimplex()) │ │ │ │ -57 DUNE_THROW(Dune::NotImplemented, │ │ │ │ -58 "Hierarchical Lagrange basis only implemented for simplex grids."); │ │ │ │ -59 } │ │ │ │ -60 } │ │ │ │ -61 }; │ │ │ │ -62 │ │ │ │ -63 template │ │ │ │ -_6_4 class _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s │ │ │ │ -65 : public _L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n> │ │ │ │ -66 { │ │ │ │ -67 using Base = _L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_<_G_V_,_ _H_i_e_r_a_r_c_h_i_c_a_l_P_2_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_t_y_p_e_n_a_m_e │ │ │ │ -_G_V_:_:_c_t_y_p_e_,_R_,_G_V_:_:_d_i_m_e_n_s_i_o_n_>>; │ │ │ │ -68 public: │ │ │ │ -_6_9 _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s (const GV& _g_r_i_d_V_i_e_w) : │ │ │ │ -70 Base(_g_r_i_d_V_i_e_w, [](GeometryType gt, int) -> std::size_t { return (gt.isVertex │ │ │ │ -() || gt.isLine()) ? 1 : 0; }) │ │ │ │ -71 { │ │ │ │ -72 for (auto gt : gridView.indexSet().types(0)) { │ │ │ │ -73 if (!gt.isSimplex()) │ │ │ │ -74 DUNE_THROW(Dune::NotImplemented, │ │ │ │ -75 "Hierarchical Lagrange basis only implemented for simplex grids."); │ │ │ │ -76 } │ │ │ │ -77 } │ │ │ │ -78 }; │ │ │ │ +22namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ +23 │ │ │ │ +24namespace Impl { │ │ │ │ +25 │ │ │ │ +26// Compute closest face to point │ │ │ │ +27template │ │ │ │ +28auto closestFaceIndex(const ReferenceElement& re, const Coordinate& x) │ │ │ │ +29{ │ │ │ │ +30 auto closestFaceIndex = decltype(re.subEntity(0,1,0,1)){}; │ │ │ │ +31 double closestFaceDistance = std::numeric_limits::max(); │ │ │ │ +32 for(auto&& faceIndex : Dune::range(re.size(1))) │ │ │ │ +33 { │ │ │ │ +34 // For a face unit outer normal consider the orthogonal projection │ │ │ │ +35 // Px = x + *n into the face. Then the distance to the face │ │ │ │ +36 // is given by |x-Px| = |||n| = . │ │ │ │ +37 auto normal = re.integrationOuterNormal(faceIndex); │ │ │ │ +38 normal /= normal.two_norm(); │ │ │ │ +39 auto c = re.position(faceIndex,1); │ │ │ │ +40 c -= x; │ │ │ │ +41 auto faceDistance = (c*normal); │ │ │ │ +42 if (faceDistance │ │ │ │ +_6_9class _F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ +70{ │ │ │ │ +71public: │ │ │ │ +_7_2 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ +_7_3 using _E_n_t_i_t_y_S_e_t = _G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_G_r_i_d_V_i_e_w_,_ _0_>; │ │ │ │ +_7_4 using _E_l_e_m_e_n_t = typename _E_n_t_i_t_y_S_e_t_:_:_E_l_e_m_e_n_t; │ │ │ │ +75 │ │ │ │ +_7_6 using _L_o_c_a_l_D_o_m_a_i_n = typename _E_n_t_i_t_y_S_e_t_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e; │ │ │ │ +_7_7 using _D_o_m_a_i_n = typename _E_n_t_i_t_y_S_e_t_:_:_G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e; │ │ │ │ +_7_8 using _R_a_n_g_e = typename _E_n_t_i_t_y_S_e_t_:_:_G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e; │ │ │ │ 79 │ │ │ │ -80 │ │ │ │ -81 namespace BasisFactory { │ │ │ │ -82 │ │ │ │ -91 template │ │ │ │ -_9_2 auto _h_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e() │ │ │ │ -93 { │ │ │ │ -94 static_assert(0 < k && k <= 2); │ │ │ │ -95 return [](const auto& gridView) { │ │ │ │ -96 return _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s, k, R> │ │ │ │ -(gridView); │ │ │ │ -97 }; │ │ │ │ -98 } │ │ │ │ -99 │ │ │ │ -100 } // end namespace BasisFactory │ │ │ │ -101 │ │ │ │ -112 template │ │ │ │ -_1_1_3 using _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_B_a_s_i_s = │ │ │ │ -_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_G_V_,_ _k_,_ _R_> >; │ │ │ │ -114 │ │ │ │ -115 } // end namespace Functions │ │ │ │ -116} // end namespace Dune │ │ │ │ -117 │ │ │ │ -118#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH │ │ │ │ -_n_o_d_e_s_._h_h │ │ │ │ -_l_f_e_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h │ │ │ │ -_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_B_a_s_i_s │ │ │ │ -DefaultGlobalBasis< HierarchicalLagrangePreBasis< GV, k, R > > │ │ │ │ -HierarchicalLagrangeBasis │ │ │ │ -Basis of a scalar Hierarchical Lagrange finite element space. │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:113 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_h_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e │ │ │ │ -auto hierarchicalLagrange() │ │ │ │ -A factory that can create a HierarchicalLagrange pre-basis. │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:92 │ │ │ │ -_D_u_n_e │ │ │ │ -DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ +80private: │ │ │ │ +81 │ │ │ │ +82 using Traits = Imp::GridFunctionTraits<_R_a_n_g_e(_D_o_m_a_i_n), _E_n_t_i_t_y_S_e_t, │ │ │ │ +_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s, 16>; │ │ │ │ +83 │ │ │ │ +84 class LocalFunction │ │ │ │ +85 { │ │ │ │ +86 using Geometry = typename Element::Geometry; │ │ │ │ +87 static const int dimension = GV::dimension; │ │ │ │ +88 public: │ │ │ │ +89 │ │ │ │ +101 void bind(const _E_l_e_m_e_n_t& element) │ │ │ │ +102 { │ │ │ │ +103 element_ = element; │ │ │ │ +104 geometry_.emplace(element_.geometry()); │ │ │ │ +105 } │ │ │ │ +106 │ │ │ │ +107 void unbind() │ │ │ │ +108 { │ │ │ │ +109 geometry_.reset(); │ │ │ │ +110 } │ │ │ │ +111 │ │ │ │ +114 bool bound() const │ │ │ │ +115 { │ │ │ │ +116 return static_cast(geometry_); │ │ │ │ +117 } │ │ │ │ +118 │ │ │ │ +128 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(const _L_o_c_a_l_D_o_m_a_i_n& x) const │ │ │ │ +129 { │ │ │ │ +130 auto&& re = Dune::referenceElement(*geometry_); │ │ │ │ +131 // Compute reference normal of closest face to given point │ │ │ │ +132 auto face = Impl::closestFaceIndex(re, x); │ │ │ │ +133 auto localNormal = re.integrationOuterNormal(face); │ │ │ │ +134 │ │ │ │ +135 // Transform reference normal into global unit outer normal using │ │ │ │ +136 // covariant Piola transformation │ │ │ │ +137 auto normal = _R_a_n_g_e{}; │ │ │ │ +138 geometry_->jacobianInverseTransposed(x).mv(localNormal, normal); │ │ │ │ +139 normal /= normal.two_norm(); │ │ │ │ +140 return normal; │ │ │ │ +141 } │ │ │ │ +142 │ │ │ │ +144 const _E_l_e_m_e_n_t& localContext() const │ │ │ │ +145 { │ │ │ │ +146 return element_; │ │ │ │ +147 } │ │ │ │ +148 │ │ │ │ +150 friend typename Traits::LocalFunctionTraits::DerivativeInterface _d_e_r_i_v_a_t_i_v_e │ │ │ │ +(const LocalFunction& t) │ │ │ │ +151 { │ │ │ │ +152 DUNE_THROW(NotImplemented,"not implemented"); │ │ │ │ +153 } │ │ │ │ +154 │ │ │ │ +155 private: │ │ │ │ +156 std::optional geometry_; │ │ │ │ +157 _E_l_e_m_e_n_t element_; │ │ │ │ +158 }; │ │ │ │ +159 │ │ │ │ +160public: │ │ │ │ +_1_6_2 _F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n(const _G_r_i_d_V_i_e_w& gridView) : │ │ │ │ +163 entitySet_(gridView) │ │ │ │ +164 {} │ │ │ │ +165 │ │ │ │ +_1_6_7 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(const _D_o_m_a_i_n& x) const │ │ │ │ +168 { │ │ │ │ +169 DUNE_THROW(NotImplemented,"not implemented"); │ │ │ │ +170 } │ │ │ │ +171 │ │ │ │ +_1_7_3 friend typename Traits::DerivativeInterface _d_e_r_i_v_a_t_i_v_e(const │ │ │ │ +_F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n& t) │ │ │ │ +174 { │ │ │ │ +175 DUNE_THROW(NotImplemented,"not implemented"); │ │ │ │ +176 } │ │ │ │ +177 │ │ │ │ +_1_7_9 friend LocalFunction _l_o_c_a_l_F_u_n_c_t_i_o_n(const _F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n& t) │ │ │ │ +180 { │ │ │ │ +181 return LocalFunction{}; │ │ │ │ +182 } │ │ │ │ +183 │ │ │ │ +_1_8_5 const _E_n_t_i_t_y_S_e_t& _e_n_t_i_t_y_S_e_t() const │ │ │ │ +186 { │ │ │ │ +187 return entitySet_; │ │ │ │ +188 } │ │ │ │ +189 │ │ │ │ +190private: │ │ │ │ +191 _E_n_t_i_t_y_S_e_t entitySet_; │ │ │ │ +192}; │ │ │ │ +193 │ │ │ │ +194 │ │ │ │ +195 │ │ │ │ +196} // namespace Dune::Functions │ │ │ │ +197 │ │ │ │ +198#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH │ │ │ │ +_g_r_i_d_f_u_n_c_t_i_o_n_._h_h │ │ │ │ +_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ -Global basis for given pre-basis. │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:53 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s │ │ │ │ -A pre-basis for a hierarchical Lagrange basis. │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:44 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_,_ _R_ _>_:_: │ │ │ │ -_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s │ │ │ │ -HierarchicalLagrangePreBasis(const GV &gridView) │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:52 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _2_,_ _R_ _>_:_: │ │ │ │ -_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s │ │ │ │ -HierarchicalLagrangePreBasis(const GV &gridView) │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:69 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_<_ _G_V_,_ _L_a_g_r_a_n_g_e_S_i_m_p_l_e_x_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_ _G_V_:_: │ │ │ │ -_c_t_y_p_e_,_ _R_,_ _G_V_:_:_d_i_m_e_n_s_i_o_n_,_ _1_ _>_ _>_:_:_g_r_i_d_V_i_e_w │ │ │ │ -const GridView & gridView() const │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:95 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_<_ _G_V_,_ _L_a_g_r_a_n_g_e_S_i_m_p_l_e_x_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_ _G_V_:_: │ │ │ │ -_c_t_y_p_e_,_ _R_,_ _G_V_:_:_d_i_m_e_n_s_i_o_n_,_ _1_ _>_ _>_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n │ │ │ │ -LFEPreBasisMixin(const GridView &gv, MCMGLayout layout) │ │ │ │ -DDeeffiinniittiioonn lfeprebasismixin.hh:75 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ +Default implementation for derivative traits. │ │ │ │ +DDeeffiinniittiioonn defaultderivativetraits.hh:41 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n_:_:_E_n_t_i_t_y_S_e_t │ │ │ │ +GridViewEntitySet< GridView, 0 > EntitySet │ │ │ │ +DDeeffiinniittiioonn facenormalgridfunction.hh:73 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n_:_:_L_o_c_a_l_D_o_m_a_i_n │ │ │ │ +typename EntitySet::LocalCoordinate LocalDomain │ │ │ │ +DDeeffiinniittiioonn facenormalgridfunction.hh:76 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n_:_:_D_o_m_a_i_n │ │ │ │ +typename EntitySet::GlobalCoordinate Domain │ │ │ │ +DDeeffiinniittiioonn facenormalgridfunction.hh:77 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n_:_:_R_a_n_g_e │ │ │ │ +typename EntitySet::GlobalCoordinate Range │ │ │ │ +DDeeffiinniittiioonn facenormalgridfunction.hh:78 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n_:_:_e_n_t_i_t_y_S_e_t │ │ │ │ +const EntitySet & entitySet() const │ │ │ │ +Return the stored GridViewEntitySet. │ │ │ │ +DDeeffiinniittiioonn facenormalgridfunction.hh:185 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ +friend Traits::DerivativeInterface derivative(const FaceNormalGridFunction &t) │ │ │ │ +Not implemented. │ │ │ │ +DDeeffiinniittiioonn facenormalgridfunction.hh:173 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n_:_:_G_r_i_d_V_i_e_w │ │ │ │ +GV GridView │ │ │ │ +DDeeffiinniittiioonn facenormalgridfunction.hh:72 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n_:_:_l_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +friend LocalFunction localFunction(const FaceNormalGridFunction &t) │ │ │ │ +Return a local-function associated to FaceNormalGridFunction. │ │ │ │ +DDeeffiinniittiioonn facenormalgridfunction.hh:179 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n_:_:_F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ +FaceNormalGridFunction(const GridView &gridView) │ │ │ │ +Construct the FaceNormalGridFunction. │ │ │ │ +DDeeffiinniittiioonn facenormalgridfunction.hh:162 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n_:_:_E_l_e_m_e_n_t │ │ │ │ +typename EntitySet::Element Element │ │ │ │ +DDeeffiinniittiioonn facenormalgridfunction.hh:74 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ +Range operator()(const Domain &x) const │ │ │ │ +Not implemented. │ │ │ │ +DDeeffiinniittiioonn facenormalgridfunction.hh:167 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t │ │ │ │ +An entity set for all entities of given codim in a grid view. │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:27 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_E_l_e_m_e_n_t │ │ │ │ +GridView::template Codim< codim >::Entity Element │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:36 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ +Element::Geometry::LocalCoordinate LocalCoordinate │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:39 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ +Element::Geometry::GlobalCoordinate GlobalCoordinate │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:40 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _h_i_e_r_a_r_c_h_i_c_a_l_l_a_g_r_a_n_g_e_b_a_s_i_s_._h_h │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ + * _f_a_c_e_n_o_r_m_a_l_g_r_i_d_f_u_n_c_t_i_o_n_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00146.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: globalvaluedlocalfiniteelement.hh File Reference │ │ │ +Dune-Functions: discreteglobalbasisfunction.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,47 +88,70 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
globalvaluedlocalfiniteelement.hh File Reference
│ │ │ +
discreteglobalbasisfunction.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <array>
│ │ │ -#include <numeric>
│ │ │ -#include <dune/common/fmatrix.hh>
│ │ │ -#include <dune/common/fvector.hh>
│ │ │ -#include <dune/common/math.hh>
│ │ │ -#include <dune/common/rangeutilities.hh>
│ │ │ -#include <dune/geometry/referenceelements.hh>
│ │ │ -#include <dune/localfunctions/common/localbasis.hh>
│ │ │ -#include <dune/localfunctions/common/localfiniteelementtraits.hh>
│ │ │ -#include <dune/functions/common/densevectorview.hh>
│ │ │ +
#include <memory>
│ │ │ +#include <optional>
│ │ │ +#include <dune/common/typetraits.hh>
│ │ │ +#include <dune/common/shared_ptr.hh>
│ │ │ +#include <dune/grid/utility/hierarchicsearch.hh>
│ │ │ +#include <dune/common/typetree/traversal.hh>
│ │ │ +#include <dune/common/typetree/treecontainer.hh>
│ │ │ +#include <dune/functions/functionspacebases/hierarchicnodetorangemap.hh>
│ │ │ +#include <dune/functions/functionspacebases/flatvectorview.hh>
│ │ │ +#include <dune/functions/gridfunctions/gridviewentityset.hh>
│ │ │ +#include <dune/functions/gridfunctions/gridfunction.hh>
│ │ │ +#include <dune/functions/backends/concepts.hh>
│ │ │ +#include <dune/functions/backends/istlvectorbackend.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +

│ │ │ +Classes

class  Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >
struct  Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >::Data
class  Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >::LocalFunctionBase
class  Dune::Functions::DiscreteGlobalBasisFunction< B, V, NTRE, R >
 A grid function induced by a global basis and a coefficient vector. More...
class  Dune::Functions::DiscreteGlobalBasisFunction< B, V, NTRE, R >::LocalFunction
class  Dune::Functions::DiscreteGlobalBasisFunctionDerivative< DGBF >
 Derivative of a DiscreteGlobalBasisFunction. More...
class  Dune::Functions::DiscreteGlobalBasisFunctionDerivative< DGBF >::LocalFunction
 local function evaluating the derivative in reference coordinates More...
│ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ +

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::ImplDoc
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ +Functions

template<typename R, typename B, typename V>
auto Dune::Functions::makeDiscreteGlobalBasisFunction (B &&basis, V &&vector)
 Generate a DiscreteGlobalBasisFunction.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,24 +1,50 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -globalvaluedlocalfiniteelement.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_n_s_e_v_e_c_t_o_r_v_i_e_w_._h_h> │ │ │ │ +discreteglobalbasisfunction.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_h_i_e_r_a_r_c_h_i_c_n_o_d_e_t_o_r_a_n_g_e_m_a_p_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_f_l_a_t_v_e_c_t_o_r_v_i_e_w_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_b_a_c_k_e_n_d_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_b_a_c_k_e_n_d_s_/_i_s_t_l_v_e_c_t_o_r_b_a_c_k_e_n_d_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ +CCllaasssseess │ │ │ │ + class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_<_ _B_,_ _V_,_ _N_T_R_E │ │ │ │ + _> │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_<_ _B_,_ _V_,_ _N_T_R_E │ │ │ │ + _>_:_:_D_a_t_a │ │ │ │ + class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_<_ _B_,_ _V_,_ _N_T_R_E │ │ │ │ + _>_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e │ │ │ │ + class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_<_ _B_,_ _V_,_ _N_T_R_E_,_ _R_ _> │ │ │ │ +  A grid function induced by a global basis and a coefficient vector. │ │ │ │ + _M_o_r_e_._._. │ │ │ │ + class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_<_ _B_,_ _V_,_ _N_T_R_E_,_ _R_ _>_:_: │ │ │ │ + _L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ + class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_<_ _D_G_B_F_ _> │ │ │ │ +  Derivative of a _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n. _M_o_r_e_._._. │ │ │ │ + class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_<_ _D_G_B_F_ _>_:_: │ │ │ │ + _L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +  local function evaluating the derivative in reference coordinates │ │ │ │ + _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ +namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c │ │ │ │ +FFuunnccttiioonnss │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n (B &&basis, V &&vector) │ │ │ │ +  Generate a _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _g_l_o_b_a_l_v_a_l_u_e_d_l_o_c_a_l_f_i_n_i_t_e_e_l_e_m_e_n_t_._h_h │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ + * _d_i_s_c_r_e_t_e_g_l_o_b_a_l_b_a_s_i_s_f_u_n_c_t_i_o_n_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00146_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: globalvaluedlocalfiniteelement.hh Source File │ │ │ +Dune-Functions: discreteglobalbasisfunction.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,355 +88,704 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
globalvaluedlocalfiniteelement.hh
│ │ │ +
discreteglobalbasisfunction.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH
│ │ │ +
8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH
│ │ │
9
│ │ │ -
10#include <array>
│ │ │ -
11#include <numeric>
│ │ │ +
10#include <memory>
│ │ │ +
11#include <optional>
│ │ │
12
│ │ │ -
13#include <dune/common/fmatrix.hh>
│ │ │ -
14#include <dune/common/fvector.hh>
│ │ │ -
15#include <dune/common/math.hh>
│ │ │ -
16#include <dune/common/rangeutilities.hh>
│ │ │ +
13#include <dune/common/typetraits.hh>
│ │ │ +
14#include <dune/common/shared_ptr.hh>
│ │ │ +
15
│ │ │ +
16#include <dune/grid/utility/hierarchicsearch.hh>
│ │ │
17
│ │ │ -
18#include <dune/geometry/referenceelements.hh>
│ │ │ -
19
│ │ │ -
20#include <dune/localfunctions/common/localbasis.hh>
│ │ │ -
21#include <dune/localfunctions/common/localfiniteelementtraits.hh>
│ │ │ -
22
│ │ │ - │ │ │ -
24
│ │ │ -
25namespace Dune::Functions::Impl
│ │ │ -
26{
│ │ │ -
27
│ │ │ -
41 struct ContravariantPiolaTransformator
│ │ │ -
42 {
│ │ │ -
47 template<typename Values, typename LocalCoordinate, typename Geometry>
│ │ │ -
48 static auto apply(Values& values,
│ │ │ -
49 const LocalCoordinate& xi,
│ │ │ -
50 const Geometry& geometry)
│ │ │ -
51 {
│ │ │ -
52 auto jacobianTransposed = geometry.jacobianTransposed(xi);
│ │ │ -
53 auto integrationElement = geometry.integrationElement(xi);
│ │ │ +
18#include <dune/common/typetree/traversal.hh>
│ │ │ +
19#include <dune/common/typetree/treecontainer.hh>
│ │ │ +
20
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
27
│ │ │ +
28namespace Dune {
│ │ │ +
29namespace Functions {
│ │ │ +
30
│ │ │ +
31
│ │ │ +
│ │ │ +
32namespace ImplDoc {
│ │ │ +
33
│ │ │ +
34template<typename B, typename V, typename NTRE>
│ │ │ +
│ │ │ + │ │ │ +
36{
│ │ │ +
37public:
│ │ │ +
38 using Basis = B;
│ │ │ +
39 using Vector = V;
│ │ │ +
40
│ │ │ +
41 // In order to make the cache work for proxy-references
│ │ │ +
42 // we have to use AutonomousValue<T> instead of std::decay_t<T>
│ │ │ +
43 using Coefficient = Dune::AutonomousValue<decltype(std::declval<Vector>()[std::declval<typename Basis::MultiIndex>()])>;
│ │ │ +
44
│ │ │ +
45 using GridView = typename Basis::GridView;
│ │ │ + │ │ │ +
47 using Tree = typename Basis::LocalView::Tree;
│ │ │ +
48 using NodeToRangeEntry = NTRE;
│ │ │ +
49
│ │ │ + │ │ │ +
51
│ │ │ + │ │ │ +
53 using Element = typename EntitySet::Element;
│ │ │
54
│ │ │ -
55 for (auto& value : values)
│ │ │ -
56 {
│ │ │ -
57 auto tmp = value;
│ │ │ -
58 // Here we cannot directly use
│ │ │ -
59 // jacobianTransposed.mtv(tmp, value);
│ │ │ -
60 // because mtv expects the DenseVector interface.
│ │ │ -
61 auto tmpDenseVector = Impl::DenseVectorView(tmp);
│ │ │ -
62 auto valueDenseVector = Impl::DenseVectorView(value);
│ │ │ -
63 jacobianTransposed.mtv(tmpDenseVector, valueDenseVector);
│ │ │ -
64 value /= integrationElement;
│ │ │ -
65 }
│ │ │ -
66 }
│ │ │ -
67
│ │ │ -
77 template<typename Gradients, typename LocalCoordinate, typename Geometry>
│ │ │ -
78 static auto applyJacobian(Gradients& gradients,
│ │ │ -
79 const LocalCoordinate& xi,
│ │ │ -
80 const Geometry& geometry)
│ │ │ -
81 {
│ │ │ -
82 auto jacobianTransposed = geometry.jacobianTransposed(xi);
│ │ │ -
83 auto integrationElement = geometry.integrationElement(xi);
│ │ │ -
84 for (auto& gradient : gradients)
│ │ │ -
85 {
│ │ │ -
86 auto tmp = gradient;
│ │ │ -
87 gradient = 0;
│ │ │ -
88 for (size_t k=0; k<gradient.M(); k++)
│ │ │ -
89 for (size_t l=0; l<tmp.N(); l++)
│ │ │ -
90 // Use sparseRange because jacobianTransposed may be a sparse DiagonalMatrix
│ │ │ -
91 for(auto&& [jacobianTransposed_l_j, j] : sparseRange(jacobianTransposed[l]))
│ │ │ -
92 gradient[j][k] += jacobianTransposed_l_j * tmp[l][k];
│ │ │ -
93 gradient /= integrationElement;
│ │ │ -
94 }
│ │ │ -
95 }
│ │ │ -
96
│ │ │ -
104 template<class Function, class LocalCoordinate, class Element>
│ │ │ -
105 class LocalValuedFunction
│ │ │ -
106 {
│ │ │ -
107 const Function& f_;
│ │ │ -
108 const Element& element_;
│ │ │ -
109
│ │ │ -
110 using LocalValue = LocalCoordinate;
│ │ │ -
111
│ │ │ -
112 public:
│ │ │ -
113
│ │ │ -
114 LocalValuedFunction(const Function& f, const Element& element)
│ │ │ -
115 : f_(f), element_(element)
│ │ │ -
116 {}
│ │ │ -
117
│ │ │ -
118 auto operator()(const LocalCoordinate& xi) const
│ │ │ -
119 {
│ │ │ -
120 auto globalValue = f_(xi);
│ │ │ -
121
│ │ │ -
122 // Apply the inverse Piola transform
│ │ │ -
123 auto jacobianInverseTransposed = element_.geometry().jacobianInverseTransposed(xi);
│ │ │ -
124 auto integrationElement = element_.geometry().integrationElement(xi);
│ │ │ -
125
│ │ │ -
126 auto localValue = LocalValue{};
│ │ │ -
127
│ │ │ -
128 // Here we cannot directly use
│ │ │ -
129 // jacobianInverseTransposed.mtv(globalValue, localValue);
│ │ │ -
130 // because mtv expects the DenseVector interface.
│ │ │ -
131 auto globalValueDenseVector = Impl::DenseVectorView(globalValue);
│ │ │ -
132 auto localValueDenseVector = Impl::DenseVectorView(localValue);
│ │ │ -
133 jacobianInverseTransposed.mtv(globalValueDenseVector, localValueDenseVector);
│ │ │ -
134 localValue *= integrationElement;
│ │ │ -
135
│ │ │ -
136 return localValue;
│ │ │ -
137 }
│ │ │ -
138 };
│ │ │ -
139 };
│ │ │ -
140
│ │ │ -
154 struct CovariantPiolaTransformator
│ │ │ -
155 {
│ │ │ -
160 template<typename Values, typename LocalCoordinate, typename Geometry>
│ │ │ -
161 static auto apply(Values& values,
│ │ │ -
162 const LocalCoordinate& xi,
│ │ │ -
163 const Geometry& geometry)
│ │ │ -
164 {
│ │ │ -
165 auto jacobianInverseTransposed = geometry.jacobianInverseTransposed(xi);
│ │ │ -
166
│ │ │ -
167 for (auto& value : values)
│ │ │ -
168 {
│ │ │ -
169 auto tmp = value;
│ │ │ -
170 // Here we cannot directly use
│ │ │ -
171 // jacobianInverseTransposed.mv(tmp, value);
│ │ │ -
172 // because mv expects the DenseVector interface.
│ │ │ -
173 auto tmpDenseVector = Impl::DenseVectorView(tmp);
│ │ │ -
174 auto valueDenseVector = Impl::DenseVectorView(value);
│ │ │ -
175 jacobianInverseTransposed.mv(tmpDenseVector, valueDenseVector);
│ │ │ -
176 }
│ │ │ -
177 }
│ │ │ -
178
│ │ │ -
188 template<typename Gradients, typename LocalCoordinate, typename Geometry>
│ │ │ -
189 static auto applyJacobian(Gradients& gradients,
│ │ │ -
190 const LocalCoordinate& xi,
│ │ │ -
191 const Geometry& geometry)
│ │ │ -
192 {
│ │ │ -
193 auto jacobianInverseTransposed = geometry.jacobianInverseTransposed(xi);
│ │ │ -
194
│ │ │ -
195 for (auto& gradient : gradients)
│ │ │ -
196 {
│ │ │ -
197 auto tmp = gradient;
│ │ │ -
198 gradient = 0;
│ │ │ -
199 for (size_t j=0; j<gradient.N(); j++)
│ │ │ -
200 for (size_t k=0; k<gradient.M(); k++)
│ │ │ -
201 // Use sparseRange because jacobianTransposed may be a sparse DiagonalMatrix
│ │ │ -
202 for(auto&& [jacobianInverseTransposed_j_l, l] : sparseRange(jacobianInverseTransposed[j]))
│ │ │ -
203 gradient[j][k] += jacobianInverseTransposed_j_l * tmp[l][k];
│ │ │ -
204 }
│ │ │ -
205 }
│ │ │ -
206
│ │ │ -
214 template<class Function, class LocalCoordinate, class Element>
│ │ │ -
215 class LocalValuedFunction
│ │ │ -
216 {
│ │ │ -
217 const Function& f_;
│ │ │ -
218 const Element& element_;
│ │ │ -
219
│ │ │ -
220 public:
│ │ │ -
221
│ │ │ -
222 LocalValuedFunction(const Function& f, const Element& element)
│ │ │ -
223 : f_(f), element_(element)
│ │ │ -
224 {}
│ │ │ -
225
│ │ │ -
226 auto operator()(const LocalCoordinate& xi) const
│ │ │ -
227 {
│ │ │ -
228 auto globalValue = f_(xi);
│ │ │ +
55protected:
│ │ │ +
56
│ │ │ +
57 // This collects all data that is shared by all related
│ │ │ +
58 // global and local functions. This way we don't need to
│ │ │ +
59 // keep track of it individually.
│ │ │ +
│ │ │ +
60 struct Data
│ │ │ +
61 {
│ │ │ + │ │ │ +
63 std::shared_ptr<const Basis> basis;
│ │ │ +
64 std::shared_ptr<const Vector> coefficients;
│ │ │ +
65 std::shared_ptr<const NodeToRangeEntry> nodeToRangeEntry;
│ │ │ +
66 };
│ │ │ +
│ │ │ +
67
│ │ │ +
68public:
│ │ │ +
│ │ │ + │ │ │ +
70 {
│ │ │ +
71 using LocalView = typename Basis::LocalView;
│ │ │ +
72 using size_type = typename Tree::size_type;
│ │ │ +
73
│ │ │ +
74 public:
│ │ │ + │ │ │ +
76 using Element = typename EntitySet::Element;
│ │ │ +
77
│ │ │ +
78 protected:
│ │ │ +
│ │ │ +
79 LocalFunctionBase(const std::shared_ptr<const Data>& data)
│ │ │ +
80 : data_(data)
│ │ │ +
81 , localView_(data_->basis->localView())
│ │ │ +
82 {
│ │ │ +
83 localDoFs_.reserve(localView_.maxSize());
│ │ │ +
84 }
│ │ │ +
│ │ │ +
85
│ │ │ +
│ │ │ + │ │ │ +
93 : data_(other.data_)
│ │ │ +
94 , localView_(other.localView_)
│ │ │ +
95 {
│ │ │ +
96 localDoFs_.reserve(localView_.maxSize());
│ │ │ +
97 if (bound())
│ │ │ +
98 localDoFs_ = other.localDoFs_;
│ │ │ +
99 }
│ │ │ +
│ │ │ +
100
│ │ │ +
│ │ │ + │ │ │ +
109 {
│ │ │ +
110 data_ = other.data_;
│ │ │ +
111 localView_ = other.localView_;
│ │ │ +
112 if (bound())
│ │ │ +
113 localDoFs_ = other.localDoFs_;
│ │ │ +
114 return *this;
│ │ │ +
115 }
│ │ │ +
│ │ │ +
116
│ │ │ +
117 public:
│ │ │ +
│ │ │ +
124 void bind(const Element& element)
│ │ │ +
125 {
│ │ │ +
126 localView_.bind(element);
│ │ │ +
127 // Use cache of full local view size. For a subspace basis,
│ │ │ +
128 // this may be larger than the number of local DOFs in the
│ │ │ +
129 // tree. In this case only cache entries associated to local
│ │ │ +
130 // DOFs in the subspace are filled. Cache entries associated
│ │ │ +
131 // to local DOFs which are not contained in the subspace will
│ │ │ +
132 // not be touched.
│ │ │ +
133 //
│ │ │ +
134 // Alternatively one could use a cache that exactly fits
│ │ │ +
135 // the size of the tree. However, this would require to
│ │ │ +
136 // subtract an offset from localIndex(i) on each cache
│ │ │ +
137 // access in operator().
│ │ │ +
138 localDoFs_.resize(localView_.size());
│ │ │ +
139 const auto& dofs = *data_->coefficients;
│ │ │ +
140 for (size_type i = 0; i < localView_.tree().size(); ++i)
│ │ │ +
141 {
│ │ │ +
142 // For a subspace basis the index-within-tree i
│ │ │ +
143 // is not the same as the localIndex within the
│ │ │ +
144 // full local view.
│ │ │ +
145 size_t localIndex = localView_.tree().localIndex(i);
│ │ │ +
146 localDoFs_[localIndex] = dofs[localView_.index(localIndex)];
│ │ │ +
147 }
│ │ │ +
148 }
│ │ │ +
│ │ │ +
149
│ │ │ +
│ │ │ +
151 void unbind()
│ │ │ +
152 {
│ │ │ +
153 localView_.unbind();
│ │ │ +
154 }
│ │ │ +
│ │ │ +
155
│ │ │ +
│ │ │ +
157 bool bound() const
│ │ │ +
158 {
│ │ │ +
159 return localView_.bound();
│ │ │ +
160 }
│ │ │ +
│ │ │ +
161
│ │ │ +
│ │ │ +
163 const Element& localContext() const
│ │ │ +
164 {
│ │ │ +
165 return localView_.element();
│ │ │ +
166 }
│ │ │ +
│ │ │ +
167
│ │ │ +
168 protected:
│ │ │ +
169
│ │ │ +
170 template<class To, class From>
│ │ │ +
│ │ │ +
171 void assignWith(To& to, const From& from) const
│ │ │ +
172 {
│ │ │ +
173 auto from_flat = flatVectorView(from);
│ │ │ +
174 auto to_flat = flatVectorView(to);
│ │ │ +
175 assert(from_flat.size() == to_flat.size());
│ │ │ +
176 for (size_type i = 0; i < to_flat.size(); ++i)
│ │ │ +
177 to_flat[i] = from_flat[i];
│ │ │ +
178 }
│ │ │ +
│ │ │ +
179
│ │ │ +
180 template<class Node, class TreePath, class Range>
│ │ │ +
│ │ │ +
181 decltype(auto) nodeToRangeEntry(const Node& node, const TreePath& treePath, Range& y) const
│ │ │ +
182 {
│ │ │ +
183 return (*data_->nodeToRangeEntry)(node, treePath, y);
│ │ │ +
184 }
│ │ │ +
│ │ │ +
185
│ │ │ +
186 std::shared_ptr<const Data> data_;
│ │ │ +
187 LocalView localView_;
│ │ │ +
188 std::vector<Coefficient> localDoFs_;
│ │ │ +
189 };
│ │ │ +
│ │ │ +
190
│ │ │ +
191protected:
│ │ │ +
│ │ │ +
192 DiscreteGlobalBasisFunctionBase(const std::shared_ptr<const Data>& data)
│ │ │ +
193 : data_(data)
│ │ │ +
194 {
│ │ │ +
195 /* Nothing. */
│ │ │ +
196 }
│ │ │ +
│ │ │ +
197
│ │ │ +
198public:
│ │ │ +
199
│ │ │ +
│ │ │ +
201 const Basis& basis() const
│ │ │ +
202 {
│ │ │ +
203 return *data_->basis;
│ │ │ +
204 }
│ │ │ +
│ │ │ +
205
│ │ │ +
│ │ │ +
207 const Vector& dofs() const
│ │ │ +
208 {
│ │ │ +
209 return *data_->coefficients;
│ │ │ +
210 }
│ │ │ +
│ │ │ +
211
│ │ │ +
│ │ │ + │ │ │ +
214 {
│ │ │ +
215 return *data_->nodeToRangeEntry;
│ │ │ +
216 }
│ │ │ +
│ │ │ +
217
│ │ │ +
│ │ │ +
219 const EntitySet& entitySet() const
│ │ │ +
220 {
│ │ │ +
221 return data_->entitySet;
│ │ │ +
222 }
│ │ │ +
│ │ │ +
223
│ │ │ +
224protected:
│ │ │ +
225 std::shared_ptr<const Data> data_;
│ │ │ +
226};
│ │ │ +
│ │ │ +
227
│ │ │ +
228} // namespace ImplDoc
│ │ │ +
│ │ │
229
│ │ │ -
230 // Apply the inverse Piola transform
│ │ │ -
231 auto jacobianTransposed = element_.geometry().jacobianTransposed(xi);
│ │ │ -
232
│ │ │ -
233 auto localValue = globalValue;
│ │ │ -
234 // Here we cannot directly use
│ │ │ -
235 // jacobianTransposed.mv(globalValue, localValue);
│ │ │ -
236 // because mv expects the DenseVector interface.
│ │ │ -
237 auto localValueDenseVector = Impl::DenseVectorView(localValue);
│ │ │ -
238 auto globalValueDenseVector = Impl::DenseVectorView(globalValue);
│ │ │ -
239 jacobianTransposed.mv(globalValueDenseVector, localValueDenseVector);
│ │ │ -
240
│ │ │ -
241 return localValue;
│ │ │ -
242 }
│ │ │ -
243 };
│ │ │ -
244 };
│ │ │ -
245
│ │ │ -
252 template<class Transformator, class LocalValuedLocalBasis, class Element>
│ │ │ -
253 class GlobalValuedLocalBasis
│ │ │ -
254 {
│ │ │ -
255 public:
│ │ │ -
256 using Traits = typename LocalValuedLocalBasis::Traits;
│ │ │ -
257
│ │ │ -
260 void bind(const LocalValuedLocalBasis& localValuedLocalBasis, const Element& element)
│ │ │ -
261 {
│ │ │ -
262 localValuedLocalBasis_ = &localValuedLocalBasis;
│ │ │ -
263 element_ = &element;
│ │ │ -
264 }
│ │ │ -
265
│ │ │ -
268 auto size() const
│ │ │ -
269 {
│ │ │ -
270 return localValuedLocalBasis_->size();
│ │ │ -
271 }
│ │ │ -
272
│ │ │ -
274 void evaluateFunction(const typename Traits::DomainType& x,
│ │ │ -
275 std::vector<typename Traits::RangeType>& out) const
│ │ │ -
276 {
│ │ │ -
277 localValuedLocalBasis_->evaluateFunction(x,out);
│ │ │ -
278
│ │ │ -
279 Transformator::apply(out, x, element_->geometry());
│ │ │ -
280 }
│ │ │ -
281
│ │ │ -
287 void evaluateJacobian(const typename Traits::DomainType& x,
│ │ │ -
288 std::vector<typename Traits::JacobianType>& out) const
│ │ │ -
289 {
│ │ │ -
290 localValuedLocalBasis_->evaluateJacobian(x,out);
│ │ │ -
291
│ │ │ -
292 Transformator::applyJacobian(out, x, element_->geometry());
│ │ │ -
293 }
│ │ │ -
294
│ │ │ -
301 void partial(const std::array<unsigned int,2>& order,
│ │ │ -
302 const typename Traits::DomainType& x,
│ │ │ -
303 std::vector<typename Traits::RangeType>& out) const
│ │ │ -
304 {
│ │ │ -
305 auto totalOrder = std::accumulate(order.begin(), order.end(), 0);
│ │ │ -
306 if (totalOrder == 0) {
│ │ │ -
307 evaluateFunction(x, out);
│ │ │ -
308 } else if (totalOrder == 1) {
│ │ │ -
309 auto const direction = std::distance(order.begin(), std::find(order.begin(), order.end(), 1));
│ │ │ -
310 out.resize(size());
│ │ │ +
230
│ │ │ +
231
│ │ │ +
232template<typename DGBF>
│ │ │ + │ │ │ +
234
│ │ │ +
278template<typename B, typename V,
│ │ │ +
279 typename NTRE = HierarchicNodeToRangeMap,
│ │ │ +
280 typename R = typename V::value_type>
│ │ │ +
│ │ │ + │ │ │ + │ │ │ +
283{
│ │ │ + │ │ │ +
285 using Data = typename Base::Data;
│ │ │ +
286
│ │ │ +
287public:
│ │ │ +
288 using Basis = typename Base::Basis;
│ │ │ +
289 using Vector = typename Base::Vector;
│ │ │ +
290
│ │ │ +
291 using Domain = typename Base::Domain;
│ │ │ +
292 using Range = R;
│ │ │ +
293
│ │ │ +
294 using Traits = Imp::GridFunctionTraits<Range(Domain), typename Base::EntitySet, DefaultDerivativeTraits, 16>;
│ │ │ +
295
│ │ │ +
296private:
│ │ │ +
297
│ │ │ +
298 template<class Node>
│ │ │ +
299 using LocalBasisRange = typename Node::FiniteElement::Traits::LocalBasisType::Traits::RangeType;
│ │ │ +
300 template<class Node>
│ │ │ +
301 using NodeData = typename std::vector<LocalBasisRange<Node>>;
│ │ │ +
302 using PerNodeEvaluationBuffer = typename TypeTree::TreeContainer<NodeData, typename Base::Tree>;
│ │ │ +
303
│ │ │ +
304public:
│ │ │ +
│ │ │ + │ │ │ + │ │ │ +
307 {
│ │ │ +
308 using LocalBase = typename Base::LocalFunctionBase;
│ │ │ +
309 using size_type = typename Base::Tree::size_type;
│ │ │ +
310 using LocalBase::nodeToRangeEntry;
│ │ │
311
│ │ │ -
312 // TODO: The following is wasteful: We compute the full Jacobian and then return
│ │ │ -
313 // only a part of it. While we need the full Jacobian of the underlying local-valued LFE,
│ │ │ -
314 // it should be possible to compute only a partial Piola transform for the requested
│ │ │ -
315 // partial derivatives.
│ │ │ -
316 std::vector<typename Traits::JacobianType> fullJacobian;
│ │ │ -
317 localValuedLocalBasis_->evaluateJacobian(x,fullJacobian);
│ │ │ -
318
│ │ │ -
319 Transformator::applyJacobian(fullJacobian, x, element_->geometry());
│ │ │ -
320
│ │ │ -
321 for (std::size_t i=0; i<out.size(); i++)
│ │ │ -
322 for (std::size_t j=0; j<out[i].size(); j++)
│ │ │ -
323 out[i][j] = fullJacobian[i][j][direction];
│ │ │ -
324
│ │ │ -
325 } else
│ │ │ -
326 DUNE_THROW(NotImplemented, "Partial derivatives of order 2 or higher");
│ │ │ -
327 }
│ │ │ -
328
│ │ │ -
330 auto order() const
│ │ │ -
331 {
│ │ │ -
332 return localValuedLocalBasis_->order();
│ │ │ -
333 }
│ │ │ -
334
│ │ │ -
335 const LocalValuedLocalBasis* localValuedLocalBasis_;
│ │ │ -
336 const Element* element_;
│ │ │ -
337 };
│ │ │ -
338
│ │ │ -
347 template<class Transformator, class LocalValuedLocalInterpolation, class Element>
│ │ │ -
348 class GlobalValuedLocalInterpolation
│ │ │ -
349 {
│ │ │ -
350 public:
│ │ │ -
353 void bind(const LocalValuedLocalInterpolation& localValuedLocalInterpolation, const Element& element)
│ │ │ -
354 {
│ │ │ -
355 localValuedLocalInterpolation_ = &localValuedLocalInterpolation;
│ │ │ -
356 element_ = &element;
│ │ │ -
357 }
│ │ │ -
358
│ │ │ -
359 template<typename F, typename C>
│ │ │ -
360 void interpolate (const F& f, std::vector<C>& out) const
│ │ │ -
361 {
│ │ │ -
362 using LocalCoordinate = typename Element::Geometry::LocalCoordinate;
│ │ │ -
363 typename Transformator::template LocalValuedFunction<F,LocalCoordinate,Element> localValuedFunction(f, *element_);
│ │ │ -
364 localValuedLocalInterpolation_->interpolate(localValuedFunction, out);
│ │ │ -
365 }
│ │ │ -
366
│ │ │ -
367 private:
│ │ │ -
368 const LocalValuedLocalInterpolation* localValuedLocalInterpolation_;
│ │ │ -
369 const Element* element_;
│ │ │ -
370 };
│ │ │ -
371
│ │ │ +
312 public:
│ │ │ +
313
│ │ │ + │ │ │ +
315 using Domain = typename LocalBase::Domain;
│ │ │ + │ │ │ +
317 using Element = typename LocalBase::Element;
│ │ │ +
318
│ │ │ +
│ │ │ + │ │ │ +
321 : LocalBase(globalFunction.data_)
│ │ │ +
322 , evaluationBuffer_(this->localView_.tree())
│ │ │ +
323 {
│ │ │ +
324 /* Nothing. */
│ │ │ +
325 }
│ │ │ +
│ │ │ +
326
│ │ │ +
│ │ │ +
336 Range operator()(const Domain& x) const
│ │ │ +
337 {
│ │ │ +
338 Range y;
│ │ │ +
339 istlVectorBackend(y) = 0;
│ │ │ +
340
│ │ │ +
341 TypeTree::forEachLeafNode(this->localView_.tree(), [&](auto&& node, auto&& treePath) {
│ │ │ +
342 if (node.empty())
│ │ │ +
343 return;
│ │ │ +
344 const auto& fe = node.finiteElement();
│ │ │ +
345 const auto& localBasis = fe.localBasis();
│ │ │ +
346 auto& shapeFunctionValues = evaluationBuffer_[treePath];
│ │ │ +
347
│ │ │ +
348 localBasis.evaluateFunction(x, shapeFunctionValues);
│ │ │ +
349
│ │ │ +
350 // Compute linear combinations of basis function jacobian.
│ │ │ +
351 // Non-scalar coefficients of dimension coeffDim are handled by
│ │ │ +
352 // processing the coeffDim linear combinations independently
│ │ │ +
353 // and storing them as entries of an array.
│ │ │ +
354 using Value = LocalBasisRange< std::decay_t<decltype(node)> >;
│ │ │ +
355 static constexpr auto coeffDim = decltype(flatVectorView(this->localDoFs_[node.localIndex(0)]).size())::value;
│ │ │ +
356 auto values = std::array<Value, coeffDim>{};
│ │ │ +
357 istlVectorBackend(values) = 0;
│ │ │ +
358 for (size_type i = 0; i < localBasis.size(); ++i)
│ │ │ +
359 {
│ │ │ +
360 auto c = flatVectorView(this->localDoFs_[node.localIndex(i)]);
│ │ │ +
361 for (std::size_t j = 0; j < coeffDim; ++j)
│ │ │ +
362 values[j].axpy(c[j], shapeFunctionValues[i]);
│ │ │ +
363 }
│ │ │ +
364
│ │ │ +
365 // Assign computed values to node entry of range.
│ │ │ +
366 // Types are matched using the lexicographic ordering provided by flatVectorView.
│ │ │ +
367 LocalBase::assignWith(nodeToRangeEntry(node, treePath, y), values);
│ │ │ +
368 });
│ │ │ +
369
│ │ │ +
370 return y;
│ │ │ +
371 }
│ │ │ +
│ │ │
372
│ │ │ -
379 template<class Transformator, class LocalValuedLFE, class Element>
│ │ │ -
380 class GlobalValuedLocalFiniteElement
│ │ │ -
381 {
│ │ │ -
382 using LocalBasis = GlobalValuedLocalBasis<Transformator,
│ │ │ -
383 typename LocalValuedLFE::Traits::LocalBasisType,
│ │ │ -
384 Element>;
│ │ │ -
385 using LocalInterpolation = GlobalValuedLocalInterpolation<Transformator,
│ │ │ -
386 typename LocalValuedLFE::Traits::LocalInterpolationType,
│ │ │ -
387 Element>;
│ │ │ -
388
│ │ │ -
389 public:
│ │ │ -
392 using Traits = LocalFiniteElementTraits<LocalBasis,
│ │ │ -
393 typename LocalValuedLFE::Traits::LocalCoefficientsType,
│ │ │ -
394 LocalInterpolation>;
│ │ │ -
395
│ │ │ -
396 GlobalValuedLocalFiniteElement() {}
│ │ │ -
397
│ │ │ -
398 void bind(const LocalValuedLFE& localValuedLFE, const Element& element)
│ │ │ -
399 {
│ │ │ -
400 globalValuedLocalBasis_.bind(localValuedLFE.localBasis(), element);
│ │ │ -
401 globalValuedLocalInterpolation_.bind(localValuedLFE.localInterpolation(), element);
│ │ │ -
402 localValuedLFE_ = &localValuedLFE;
│ │ │ -
403 }
│ │ │ -
404
│ │ │ -
407 const typename Traits::LocalBasisType& localBasis() const
│ │ │ -
408 {
│ │ │ -
409 return globalValuedLocalBasis_;
│ │ │ -
410 }
│ │ │ +
│ │ │ + │ │ │ +
375 {
│ │ │ + │ │ │ +
377 if (lf.bound())
│ │ │ +
378 dlf.bind(lf.localContext());
│ │ │ +
379 return dlf;
│ │ │ +
380 }
│ │ │ +
│ │ │ +
381
│ │ │ +
382 private:
│ │ │ +
383 mutable PerNodeEvaluationBuffer evaluationBuffer_;
│ │ │ +
384 };
│ │ │ +
│ │ │ +
385
│ │ │ +
387 template<class B_T, class V_T, class NTRE_T>
│ │ │ +
│ │ │ +
388 DiscreteGlobalBasisFunction(B_T && basis, V_T && coefficients, NTRE_T&& nodeToRangeEntry)
│ │ │ +
389 : Base(std::make_shared<Data>(Data{{basis.gridView()}, wrap_or_move(std::forward<B_T>(basis)), wrap_or_move(std::forward<V_T>(coefficients)), wrap_or_move(std::forward<NTRE_T>(nodeToRangeEntry))}))
│ │ │ +
390 {}
│ │ │ +
│ │ │ +
391
│ │ │ +
│ │ │ +
393 DiscreteGlobalBasisFunction(std::shared_ptr<const Basis> basis, std::shared_ptr<const V> coefficients, std::shared_ptr<const typename Base::NodeToRangeEntry> nodeToRangeEntry)
│ │ │ +
394 : Base(std::make_shared<Data>(Data{{basis->gridView()}, basis, coefficients, nodeToRangeEntry}))
│ │ │ +
395 {}
│ │ │ +
│ │ │ +
396
│ │ │ +
│ │ │ +
402 Range operator() (const Domain& x) const
│ │ │ +
403 {
│ │ │ +
404 HierarchicSearch search(this->data_->basis->gridView().grid(), this->data_->basis->gridView().indexSet());
│ │ │ +
405
│ │ │ +
406 const auto e = search.findEntity(x);
│ │ │ +
407 auto localThis = localFunction(*this);
│ │ │ +
408 localThis.bind(e);
│ │ │ +
409 return localThis(e.geometry().local(x));
│ │ │ +
410 }
│ │ │ +
│ │ │
411
│ │ │ -
414 const typename Traits::LocalCoefficientsType& localCoefficients() const
│ │ │ -
415 {
│ │ │ -
416 return localValuedLFE_->localCoefficients();
│ │ │ -
417 }
│ │ │ -
418
│ │ │ -
421 const typename Traits::LocalInterpolationType& localInterpolation() const
│ │ │ -
422 {
│ │ │ -
423 return globalValuedLocalInterpolation_;
│ │ │ -
424 }
│ │ │ -
425
│ │ │ -
427 std::size_t size() const
│ │ │ -
428 {
│ │ │ -
429 return localValuedLFE_->size();
│ │ │ -
430 }
│ │ │ -
431
│ │ │ -
434 GeometryType type() const
│ │ │ -
435 {
│ │ │ -
436 return localValuedLFE_->type();
│ │ │ -
437 }
│ │ │ -
438
│ │ │ -
439 private:
│ │ │ -
440
│ │ │ -
441 typename Traits::LocalBasisType globalValuedLocalBasis_;
│ │ │ -
442 typename Traits::LocalInterpolationType globalValuedLocalInterpolation_;
│ │ │ -
443 const LocalValuedLFE* localValuedLFE_;
│ │ │ -
444 };
│ │ │ -
445
│ │ │ -
446} // namespace Dune::Functions::Impl
│ │ │ -
447
│ │ │ -
448#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH
│ │ │ - │ │ │ +
│ │ │ + │ │ │ +
414 {
│ │ │ + │ │ │ +
416 }
│ │ │ +
│ │ │ +
417
│ │ │ +
│ │ │ + │ │ │ +
427 {
│ │ │ +
428 return LocalFunction(t);
│ │ │ +
429 }
│ │ │ +
│ │ │ +
430};
│ │ │ +
│ │ │ +
431
│ │ │ +
432
│ │ │ +
457template<typename R, typename B, typename V>
│ │ │ +
│ │ │ + │ │ │ +
459{
│ │ │ +
460 using Basis = std::decay_t<B>;
│ │ │ +
461 using NTREM = HierarchicNodeToRangeMap;
│ │ │ +
462
│ │ │ +
463 // Small helper functions to wrap vectors using istlVectorBackend
│ │ │ +
464 // if they do not already satisfy the VectorBackend interface.
│ │ │ +
465 auto toConstVectorBackend = [&](auto&& v) -> decltype(auto) {
│ │ │ +
466 if constexpr (models<Concept::ConstVectorBackend<Basis>, decltype(v)>()) {
│ │ │ +
467 return std::forward<decltype(v)>(v);
│ │ │ +
468 } else {
│ │ │ +
469 return istlVectorBackend(v);
│ │ │ +
470 }
│ │ │ +
471 };
│ │ │ +
472
│ │ │ +
473 using Vector = std::decay_t<decltype(toConstVectorBackend(std::forward<V>(vector)))>;
│ │ │ + │ │ │ +
475 std::forward<B>(basis),
│ │ │ +
476 toConstVectorBackend(std::forward<V>(vector)),
│ │ │ + │ │ │ +
478}
│ │ │ +
│ │ │ +
479
│ │ │ +
480
│ │ │ +
495template<typename DGBF>
│ │ │ +
│ │ │ + │ │ │ +
497 : public ImplDoc::DiscreteGlobalBasisFunctionBase<typename DGBF::Basis, typename DGBF::Vector, typename DGBF::NodeToRangeEntry>
│ │ │ +
498{
│ │ │ + │ │ │ +
500 using Data = typename Base::Data;
│ │ │ +
501
│ │ │ +
502public:
│ │ │ + │ │ │ +
504
│ │ │ +
505 using Basis = typename Base::Basis;
│ │ │ +
506 using Vector = typename Base::Vector;
│ │ │ +
507
│ │ │ +
508 using Domain = typename Base::Domain;
│ │ │ + │ │ │ +
510
│ │ │ +
511 using Traits = Imp::GridFunctionTraits<Range(Domain), typename Base::EntitySet, DefaultDerivativeTraits, 16>;
│ │ │ +
512
│ │ │ +
513private:
│ │ │ +
514
│ │ │ +
515 template<class Node>
│ │ │ +
516 using LocalBasisRange = typename Node::FiniteElement::Traits::LocalBasisType::Traits::JacobianType;
│ │ │ +
517 template<class Node>
│ │ │ +
518 using NodeData = typename std::vector< LocalBasisRange<Node> >;
│ │ │ +
519 using PerNodeEvaluationBuffer = typename TypeTree::TreeContainer<NodeData, typename Base::Tree>;
│ │ │ +
520
│ │ │ +
521public:
│ │ │ +
522
│ │ │ +
│ │ │ + │ │ │ +
531 : public Base::LocalFunctionBase
│ │ │ +
532 {
│ │ │ +
533 using LocalBase = typename Base::LocalFunctionBase;
│ │ │ +
534 using size_type = typename Base::Tree::size_type;
│ │ │ +
535 using LocalBase::nodeToRangeEntry;
│ │ │ +
536
│ │ │ +
537 public:
│ │ │ + │ │ │ +
539 using Domain = typename LocalBase::Domain;
│ │ │ + │ │ │ +
541 using Element = typename LocalBase::Element;
│ │ │ +
542
│ │ │ +
│ │ │ +
544 LocalFunction(const GlobalFunction& globalFunction)
│ │ │ +
545 : LocalBase(globalFunction.data_)
│ │ │ +
546 , evaluationBuffer_(this->localView_.tree())
│ │ │ +
547 {
│ │ │ +
548 /* Nothing. */
│ │ │ +
549 }
│ │ │ +
│ │ │ +
550
│ │ │ +
│ │ │ +
557 void bind(const Element& element)
│ │ │ +
558 {
│ │ │ +
559 LocalBase::bind(element);
│ │ │ +
560 geometry_.emplace(element.geometry());
│ │ │ +
561 }
│ │ │ +
│ │ │ +
562
│ │ │ +
│ │ │ +
564 void unbind()
│ │ │ +
565 {
│ │ │ +
566 geometry_.reset();
│ │ │ +
567 LocalBase::unbind();
│ │ │ +
568 }
│ │ │ +
│ │ │ +
569
│ │ │ +
│ │ │ +
583 Range operator()(const Domain& x) const
│ │ │ +
584 {
│ │ │ +
585 Range y;
│ │ │ +
586 istlVectorBackend(y) = 0;
│ │ │ +
587
│ │ │ +
588 const auto& jacobianInverse = geometry_->jacobianInverse(x);
│ │ │ +
589
│ │ │ +
590 TypeTree::forEachLeafNode(this->localView_.tree(), [&](auto&& node, auto&& treePath) {
│ │ │ +
591 if (node.empty())
│ │ │ +
592 return;
│ │ │ +
593 const auto& fe = node.finiteElement();
│ │ │ +
594 const auto& localBasis = fe.localBasis();
│ │ │ +
595 auto& shapeFunctionJacobians = evaluationBuffer_[treePath];
│ │ │ +
596
│ │ │ +
597 localBasis.evaluateJacobian(x, shapeFunctionJacobians);
│ │ │ +
598
│ │ │ +
599 // Compute linear combinations of basis function jacobian.
│ │ │ +
600 // Non-scalar coefficients of dimension coeffDim are handled by
│ │ │ +
601 // processing the coeffDim linear combinations independently
│ │ │ +
602 // and storing them as entries of an array.
│ │ │ +
603 using RefJacobian = LocalBasisRange< std::decay_t<decltype(node)> >;
│ │ │ +
604 static constexpr auto coeffDim = decltype(flatVectorView(this->localDoFs_[node.localIndex(0)]).size())::value;
│ │ │ +
605 auto refJacobians = std::array<RefJacobian, coeffDim>{};
│ │ │ +
606 istlVectorBackend(refJacobians) = 0;
│ │ │ +
607 for (size_type i = 0; i < localBasis.size(); ++i)
│ │ │ +
608 {
│ │ │ +
609 auto c = flatVectorView(this->localDoFs_[node.localIndex(i)]);
│ │ │ +
610 for (std::size_t j = 0; j < coeffDim; ++j)
│ │ │ +
611 refJacobians[j].axpy(c[j], shapeFunctionJacobians[i]);
│ │ │ +
612 }
│ │ │ +
613
│ │ │ +
614 // Transform Jacobians form local to global coordinates.
│ │ │ +
615 using Jacobian = decltype(refJacobians[0] * jacobianInverse);
│ │ │ +
616 auto jacobians = std::array<Jacobian, coeffDim>{};
│ │ │ +
617 std::transform(
│ │ │ +
618 refJacobians.begin(), refJacobians.end(), jacobians.begin(),
│ │ │ +
619 [&](const auto& refJacobian) { return refJacobian * jacobianInverse; });
│ │ │ +
620
│ │ │ +
621 // Assign computed Jacobians to node entry of range.
│ │ │ +
622 // Types are matched using the lexicographic ordering provided by flatVectorView.
│ │ │ +
623 LocalBase::assignWith(nodeToRangeEntry(node, treePath, y), jacobians);
│ │ │ +
624 });
│ │ │ +
625
│ │ │ +
626 return y;
│ │ │ +
627 }
│ │ │ +
│ │ │ +
628
│ │ │ +
│ │ │ +
630 friend typename Traits::LocalFunctionTraits::DerivativeInterface derivative(const LocalFunction&)
│ │ │ +
631 {
│ │ │ +
632 DUNE_THROW(NotImplemented, "derivative of derivative is not implemented");
│ │ │ +
633 }
│ │ │ +
│ │ │ +
634
│ │ │ +
635 private:
│ │ │ +
636 mutable PerNodeEvaluationBuffer evaluationBuffer_;
│ │ │ +
637 std::optional<typename Element::Geometry> geometry_;
│ │ │ +
638 };
│ │ │ +
│ │ │ +
639
│ │ │ +
│ │ │ +
646 DiscreteGlobalBasisFunctionDerivative(const std::shared_ptr<const Data>& data)
│ │ │ +
647 : Base(data)
│ │ │ +
648 {
│ │ │ +
649 /* Nothing. */
│ │ │ +
650 }
│ │ │ +
│ │ │ +
651
│ │ │ +
│ │ │ +
657 Range operator()(const Domain& x) const
│ │ │ +
658 {
│ │ │ +
659 HierarchicSearch search(this->data_->basis->gridView().grid(), this->data_->basis->gridView().indexSet());
│ │ │ +
660
│ │ │ +
661 const auto e = search.findEntity(x);
│ │ │ +
662 auto localThis = localFunction(*this);
│ │ │ +
663 localThis.bind(e);
│ │ │ +
664 return localThis(e.geometry().local(x));
│ │ │ +
665 }
│ │ │ +
│ │ │ +
666
│ │ │ +
│ │ │ +
667 friend typename Traits::DerivativeInterface derivative(const DiscreteGlobalBasisFunctionDerivative& f)
│ │ │ +
668 {
│ │ │ +
669 DUNE_THROW(NotImplemented, "derivative of derivative is not implemented");
│ │ │ +
670 }
│ │ │ +
│ │ │ +
671
│ │ │ +
│ │ │ + │ │ │ +
674 {
│ │ │ +
675 return LocalFunction(f);
│ │ │ +
676 }
│ │ │ +
│ │ │ +
677};
│ │ │ +
│ │ │ +
678
│ │ │ +
679
│ │ │ +
680} // namespace Functions
│ │ │ +
681} // namespace Dune
│ │ │ +
682
│ │ │ +
683#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
auto makeDiscreteGlobalBasisFunction(B &&basis, V &&vector)
Generate a DiscreteGlobalBasisFunction.
Definition discreteglobalbasisfunction.hh:458
│ │ │ +
auto istlVectorBackend(Vector &v)
Return a vector backend wrapping non-const ISTL like containers.
Definition istlvectorbackend.hh:350
│ │ │ +
Definition monomialset.hh:19
│ │ │ +
Definition monomialset.hh:19
│ │ │ +
auto flatVectorView(T &t)
Create flat vector view of passed mutable container.
Definition flatvectorview.hh:183
│ │ │ +
Definition discreteglobalbasisfunction.hh:32
│ │ │ +
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:41
│ │ │ +
Helper class to deduce the signature of a callable.
Definition signature.hh:60
│ │ │ +
A simple node to range map using the nested tree indices.
Definition hierarchicnodetorangemap.hh:34
│ │ │ +
Definition discreteglobalbasisfunction.hh:36
│ │ │ + │ │ │ +
const Vector & dofs() const
Return the coefficients of this discrete function by reference.
Definition discreteglobalbasisfunction.hh:207
│ │ │ +
B Basis
Definition discreteglobalbasisfunction.hh:38
│ │ │ +
typename Basis::LocalView::Tree Tree
Definition discreteglobalbasisfunction.hh:47
│ │ │ +
V Vector
Definition discreteglobalbasisfunction.hh:39
│ │ │ +
typename EntitySet::Element Element
Definition discreteglobalbasisfunction.hh:53
│ │ │ +
typename EntitySet::LocalCoordinate LocalDomain
Definition discreteglobalbasisfunction.hh:52
│ │ │ +
const NodeToRangeEntry & nodeToRangeEntry() const
Return the stored node-to-range map.
Definition discreteglobalbasisfunction.hh:213
│ │ │ +
NTRE NodeToRangeEntry
Definition discreteglobalbasisfunction.hh:48
│ │ │ +
DiscreteGlobalBasisFunctionBase(const std::shared_ptr< const Data > &data)
Definition discreteglobalbasisfunction.hh:192
│ │ │ +
typename Basis::GridView GridView
Definition discreteglobalbasisfunction.hh:45
│ │ │ +
const Basis & basis() const
Return a const reference to the stored basis.
Definition discreteglobalbasisfunction.hh:201
│ │ │ +
GridViewEntitySet< GridView, 0 > EntitySet
Definition discreteglobalbasisfunction.hh:46
│ │ │ +
const EntitySet & entitySet() const
Get associated set of entities the local-function can be bound to.
Definition discreteglobalbasisfunction.hh:219
│ │ │ +
typename EntitySet::GlobalCoordinate Domain
Definition discreteglobalbasisfunction.hh:50
│ │ │ +
Dune::AutonomousValue< decltype(std::declval< Vector >()[std::declval< typename Basis::MultiIndex >()])> Coefficient
Definition discreteglobalbasisfunction.hh:43
│ │ │ +
Definition discreteglobalbasisfunction.hh:61
│ │ │ +
EntitySet entitySet
Definition discreteglobalbasisfunction.hh:62
│ │ │ +
std::shared_ptr< const NodeToRangeEntry > nodeToRangeEntry
Definition discreteglobalbasisfunction.hh:65
│ │ │ +
std::shared_ptr< const Basis > basis
Definition discreteglobalbasisfunction.hh:63
│ │ │ +
std::shared_ptr< const Vector > coefficients
Definition discreteglobalbasisfunction.hh:64
│ │ │ + │ │ │ +
LocalFunctionBase & operator=(const LocalFunctionBase &other)
Copy-assignment of the local-function.
Definition discreteglobalbasisfunction.hh:108
│ │ │ +
bool bound() const
Check if LocalFunction is already bound to an element.
Definition discreteglobalbasisfunction.hh:157
│ │ │ +
void bind(const Element &element)
Bind LocalFunction to grid element.
Definition discreteglobalbasisfunction.hh:124
│ │ │ +
typename EntitySet::Element Element
Definition discreteglobalbasisfunction.hh:76
│ │ │ +
const Element & localContext() const
Return the element the local-function is bound to.
Definition discreteglobalbasisfunction.hh:163
│ │ │ +
LocalFunctionBase(const LocalFunctionBase &other)
Copy-construct the local-function.
Definition discreteglobalbasisfunction.hh:92
│ │ │ +
std::vector< Coefficient > localDoFs_
Definition discreteglobalbasisfunction.hh:188
│ │ │ +
void assignWith(To &to, const From &from) const
Definition discreteglobalbasisfunction.hh:171
│ │ │ +
std::shared_ptr< const Data > data_
Definition discreteglobalbasisfunction.hh:186
│ │ │ +
decltype(auto) nodeToRangeEntry(const Node &node, const TreePath &treePath, Range &y) const
Definition discreteglobalbasisfunction.hh:181
│ │ │ +
LocalView localView_
Definition discreteglobalbasisfunction.hh:187
│ │ │ +
void unbind()
Unbind the local-function.
Definition discreteglobalbasisfunction.hh:151
│ │ │ +
LocalDomain Domain
Definition discreteglobalbasisfunction.hh:75
│ │ │ +
LocalFunctionBase(const std::shared_ptr< const Data > &data)
Definition discreteglobalbasisfunction.hh:79
│ │ │ +
Derivative of a DiscreteGlobalBasisFunction.
Definition discreteglobalbasisfunction.hh:498
│ │ │ +
typename Base::Basis Basis
Definition discreteglobalbasisfunction.hh:505
│ │ │ +
friend Traits::DerivativeInterface derivative(const DiscreteGlobalBasisFunctionDerivative &f)
Definition discreteglobalbasisfunction.hh:667
│ │ │ +
Range operator()(const Domain &x) const
Evaluate the discrete grid-function derivative in global coordinates.
Definition discreteglobalbasisfunction.hh:657
│ │ │ +
typename SignatureTraits< typename DiscreteGlobalBasisFunction::Traits::DerivativeInterface >::Range Range
Definition discreteglobalbasisfunction.hh:509
│ │ │ +
friend LocalFunction localFunction(const DiscreteGlobalBasisFunctionDerivative &f)
Construct local function from a DiscreteGlobalBasisFunctionDerivative.
Definition discreteglobalbasisfunction.hh:673
│ │ │ +
DiscreteGlobalBasisFunctionDerivative(const std::shared_ptr< const Data > &data)
create object from DiscreateGlobalBasisFunction data
Definition discreteglobalbasisfunction.hh:646
│ │ │ +
DGBF DiscreteGlobalBasisFunction
Definition discreteglobalbasisfunction.hh:503
│ │ │ +
typename Base::Vector Vector
Definition discreteglobalbasisfunction.hh:506
│ │ │ +
Imp::GridFunctionTraits< Range(Domain), typename Base::EntitySet, DefaultDerivativeTraits, 16 > Traits
Definition discreteglobalbasisfunction.hh:511
│ │ │ +
typename Base::Domain Domain
Definition discreteglobalbasisfunction.hh:508
│ │ │ +
friend DiscreteGlobalBasisFunctionDerivative< DiscreteGlobalBasisFunction > derivative(const DiscreteGlobalBasisFunction &f)
Derivative of the DiscreteGlobalBasisFunction.
Definition discreteglobalbasisfunction.hh:413
│ │ │ +
DiscreteGlobalBasisFunction(B_T &&basis, V_T &&coefficients, NTRE_T &&nodeToRangeEntry)
Create a grid-function, by wrapping the arguments in std::shared_ptr.
Definition discreteglobalbasisfunction.hh:388
│ │ │ +
DiscreteGlobalBasisFunction(std::shared_ptr< const Basis > basis, std::shared_ptr< const V > coefficients, std::shared_ptr< const typename Base::NodeToRangeEntry > nodeToRangeEntry)
Create a grid-function, by moving the arguments in std::shared_ptr.
Definition discreteglobalbasisfunction.hh:393
│ │ │ +
friend LocalFunction localFunction(const DiscreteGlobalBasisFunction &t)
Construct local function from a DiscreteGlobalBasisFunction.
Definition discreteglobalbasisfunction.hh:426
│ │ │ +
typename Base::Basis Basis
Definition discreteglobalbasisfunction.hh:288
│ │ │ +
Imp::GridFunctionTraits< Range(Domain), typename Base::EntitySet, DefaultDerivativeTraits, 16 > Traits
Definition discreteglobalbasisfunction.hh:294
│ │ │ +
R Range
Definition discreteglobalbasisfunction.hh:292
│ │ │ +
typename Base::Vector Vector
Definition discreteglobalbasisfunction.hh:289
│ │ │ +
typename Base::Domain Domain
Definition discreteglobalbasisfunction.hh:291
│ │ │ +
Definition discreteglobalbasisfunction.hh:307
│ │ │ +
GlobalFunction::Range Range
Definition discreteglobalbasisfunction.hh:316
│ │ │ +
typename LocalBase::Domain Domain
Definition discreteglobalbasisfunction.hh:315
│ │ │ +
LocalFunction(const DiscreteGlobalBasisFunction &globalFunction)
Create a local-function from the associated grid-function.
Definition discreteglobalbasisfunction.hh:320
│ │ │ +
friend DiscreteGlobalBasisFunctionDerivative< DiscreteGlobalBasisFunction >::LocalFunction derivative(const LocalFunction &lf)
Local function of the derivative.
Definition discreteglobalbasisfunction.hh:374
│ │ │ +
DiscreteGlobalBasisFunction GlobalFunction
Definition discreteglobalbasisfunction.hh:314
│ │ │ +
Range operator()(const Domain &x) const
Evaluate this local-function in coordinates x in the bound element.
Definition discreteglobalbasisfunction.hh:336
│ │ │ +
typename LocalBase::Element Element
Definition discreteglobalbasisfunction.hh:317
│ │ │ +
local function evaluating the derivative in reference coordinates
Definition discreteglobalbasisfunction.hh:532
│ │ │ +
Range operator()(const Domain &x) const
Evaluate this local-function in coordinates x in the bound element.
Definition discreteglobalbasisfunction.hh:583
│ │ │ +
typename LocalBase::Domain Domain
Definition discreteglobalbasisfunction.hh:539
│ │ │ +
typename LocalBase::Element Element
Definition discreteglobalbasisfunction.hh:541
│ │ │ +
friend Traits::LocalFunctionTraits::DerivativeInterface derivative(const LocalFunction &)
Not implemented.
Definition discreteglobalbasisfunction.hh:630
│ │ │ +
DiscreteGlobalBasisFunctionDerivative GlobalFunction
Definition discreteglobalbasisfunction.hh:538
│ │ │ +
GlobalFunction::Range Range
Definition discreteglobalbasisfunction.hh:540
│ │ │ +
void unbind()
Unbind the local-function.
Definition discreteglobalbasisfunction.hh:564
│ │ │ +
LocalFunction(const GlobalFunction &globalFunction)
Create a local function from the associated grid function.
Definition discreteglobalbasisfunction.hh:544
│ │ │ +
void bind(const Element &element)
Bind LocalFunction to grid element.
Definition discreteglobalbasisfunction.hh:557
│ │ │ +
An entity set for all entities of given codim in a grid view.
Definition gridviewentityset.hh:27
│ │ │ +
GridView::template Codim< codim >::Entity Element
Definition gridviewentityset.hh:36
│ │ │ +
Element::Geometry::LocalCoordinate LocalCoordinate
Definition gridviewentityset.hh:39
│ │ │ +
Element::Geometry::GlobalCoordinate GlobalCoordinate
Definition gridviewentityset.hh:40
│ │ │ + │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,361 +1,884 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -globalvaluedlocalfiniteelement.hh │ │ │ │ +discreteglobalbasisfunction.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH │ │ │ │ +8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ 12 │ │ │ │ -13#include │ │ │ │ -14#include │ │ │ │ -15#include │ │ │ │ -16#include │ │ │ │ +13#include │ │ │ │ +14#include │ │ │ │ +15 │ │ │ │ +16#include │ │ │ │ 17 │ │ │ │ -18#include │ │ │ │ -19 │ │ │ │ -20#include │ │ │ │ -21#include │ │ │ │ -22 │ │ │ │ -23#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_n_s_e_v_e_c_t_o_r_v_i_e_w_._h_h> │ │ │ │ -24 │ │ │ │ -25namespace Dune::Functions::Impl │ │ │ │ -26{ │ │ │ │ +18#include │ │ │ │ +19#include │ │ │ │ +20 │ │ │ │ +21#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_h_i_e_r_a_r_c_h_i_c_n_o_d_e_t_o_r_a_n_g_e_m_a_p_._h_h> │ │ │ │ +22#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_f_l_a_t_v_e_c_t_o_r_v_i_e_w_._h_h> │ │ │ │ +23#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h> │ │ │ │ +24#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +25#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_b_a_c_k_e_n_d_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +26#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_b_a_c_k_e_n_d_s_/_i_s_t_l_v_e_c_t_o_r_b_a_c_k_e_n_d_._h_h> │ │ │ │ 27 │ │ │ │ -41 struct ContravariantPiolaTransformator │ │ │ │ -42 { │ │ │ │ -47 template │ │ │ │ -48 static auto apply(Values& values, │ │ │ │ -49 const LocalCoordinate& xi, │ │ │ │ -50 const Geometry& geometry) │ │ │ │ -51 { │ │ │ │ -52 auto jacobianTransposed = geometry.jacobianTransposed(xi); │ │ │ │ -53 auto integrationElement = geometry.integrationElement(xi); │ │ │ │ +28namespace _D_u_n_e { │ │ │ │ +29namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +30 │ │ │ │ +31 │ │ │ │ +_3_2namespace _I_m_p_l_D_o_c { │ │ │ │ +33 │ │ │ │ +34template │ │ │ │ +_3_5class _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e │ │ │ │ +36{ │ │ │ │ +37public: │ │ │ │ +_3_8 using _B_a_s_i_s = B; │ │ │ │ +_3_9 using _V_e_c_t_o_r = V; │ │ │ │ +40 │ │ │ │ +41 // In order to make the cache work for proxy-references │ │ │ │ +42 // we have to use AutonomousValue instead of std::decay_t │ │ │ │ +_4_3 using _C_o_e_f_f_i_c_i_e_n_t = Dune::AutonomousValue() │ │ │ │ +[std::declval()])>; │ │ │ │ +44 │ │ │ │ +_4_5 using _G_r_i_d_V_i_e_w = typename Basis::GridView; │ │ │ │ +_4_6 using _E_n_t_i_t_y_S_e_t = _G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_G_r_i_d_V_i_e_w_,_ _0_>; │ │ │ │ +_4_7 using _T_r_e_e = typename Basis::LocalView::Tree; │ │ │ │ +_4_8 using _N_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y = NTRE; │ │ │ │ +49 │ │ │ │ +_5_0 using _D_o_m_a_i_n = typename _E_n_t_i_t_y_S_e_t_:_:_G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e; │ │ │ │ +51 │ │ │ │ +_5_2 using _L_o_c_a_l_D_o_m_a_i_n = typename _E_n_t_i_t_y_S_e_t_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e; │ │ │ │ +_5_3 using _E_l_e_m_e_n_t = typename _E_n_t_i_t_y_S_e_t_:_:_E_l_e_m_e_n_t; │ │ │ │ 54 │ │ │ │ -55 for (auto& value : values) │ │ │ │ -56 { │ │ │ │ -57 auto tmp = value; │ │ │ │ -58 // Here we cannot directly use │ │ │ │ -59 // jacobianTransposed.mtv(tmp, value); │ │ │ │ -60 // because mtv expects the DenseVector interface. │ │ │ │ -61 auto tmpDenseVector = Impl::DenseVectorView(tmp); │ │ │ │ -62 auto valueDenseVector = Impl::DenseVectorView(value); │ │ │ │ -63 jacobianTransposed.mtv(tmpDenseVector, valueDenseVector); │ │ │ │ -64 value /= integrationElement; │ │ │ │ -65 } │ │ │ │ -66 } │ │ │ │ +55protected: │ │ │ │ +56 │ │ │ │ +57 // This collects all data that is shared by all related │ │ │ │ +58 // global and local functions. This way we don't need to │ │ │ │ +59 // keep track of it individually. │ │ │ │ +_6_0 struct _D_a_t_a │ │ │ │ +61 { │ │ │ │ +_6_2 _E_n_t_i_t_y_S_e_t _e_n_t_i_t_y_S_e_t; │ │ │ │ +_6_3 std::shared_ptr _b_a_s_i_s; │ │ │ │ +_6_4 std::shared_ptr _c_o_e_f_f_i_c_i_e_n_t_s; │ │ │ │ +_6_5 std::shared_ptr _n_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y; │ │ │ │ +66 }; │ │ │ │ 67 │ │ │ │ -77 template │ │ │ │ -78 static auto applyJacobian(Gradients& gradients, │ │ │ │ -79 const LocalCoordinate& xi, │ │ │ │ -80 const Geometry& geometry) │ │ │ │ -81 { │ │ │ │ -82 auto jacobianTransposed = geometry.jacobianTransposed(xi); │ │ │ │ -83 auto integrationElement = geometry.integrationElement(xi); │ │ │ │ -84 for (auto& gradient : gradients) │ │ │ │ -85 { │ │ │ │ -86 auto tmp = gradient; │ │ │ │ -87 gradient = 0; │ │ │ │ -88 for (size_t k=0; k │ │ │ │ -105 class LocalValuedFunction │ │ │ │ -106 { │ │ │ │ -107 const Function& f_; │ │ │ │ -108 const Element& element_; │ │ │ │ -109 │ │ │ │ -110 using LocalValue = LocalCoordinate; │ │ │ │ -111 │ │ │ │ -112 public: │ │ │ │ -113 │ │ │ │ -114 LocalValuedFunction(const Function& f, const Element& element) │ │ │ │ -115 : f_(f), element_(element) │ │ │ │ -116 {} │ │ │ │ -117 │ │ │ │ -118 auto operator()(const LocalCoordinate& xi) const │ │ │ │ -119 { │ │ │ │ -120 auto globalValue = f_(xi); │ │ │ │ -121 │ │ │ │ -122 // Apply the inverse Piola transform │ │ │ │ -123 auto jacobianInverseTransposed = element_.geometry │ │ │ │ -().jacobianInverseTransposed(xi); │ │ │ │ -124 auto integrationElement = element_.geometry().integrationElement(xi); │ │ │ │ -125 │ │ │ │ -126 auto localValue = LocalValue{}; │ │ │ │ -127 │ │ │ │ -128 // Here we cannot directly use │ │ │ │ -129 // jacobianInverseTransposed.mtv(globalValue, localValue); │ │ │ │ -130 // because mtv expects the DenseVector interface. │ │ │ │ -131 auto globalValueDenseVector = Impl::DenseVectorView(globalValue); │ │ │ │ -132 auto localValueDenseVector = Impl::DenseVectorView(localValue); │ │ │ │ -133 jacobianInverseTransposed.mtv(globalValueDenseVector, │ │ │ │ -localValueDenseVector); │ │ │ │ -134 localValue *= integrationElement; │ │ │ │ -135 │ │ │ │ -136 return localValue; │ │ │ │ -137 } │ │ │ │ -138 }; │ │ │ │ -139 }; │ │ │ │ -140 │ │ │ │ -154 struct CovariantPiolaTransformator │ │ │ │ -155 { │ │ │ │ -160 template │ │ │ │ -161 static auto apply(Values& values, │ │ │ │ -162 const LocalCoordinate& xi, │ │ │ │ -163 const Geometry& geometry) │ │ │ │ +68public: │ │ │ │ +_6_9 class _L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e │ │ │ │ +70 { │ │ │ │ +71 using LocalView = typename Basis::LocalView; │ │ │ │ +72 using size_type = typename Tree::size_type; │ │ │ │ +73 │ │ │ │ +74 public: │ │ │ │ +_7_5 using _D_o_m_a_i_n = _L_o_c_a_l_D_o_m_a_i_n; │ │ │ │ +_7_6 using _E_l_e_m_e_n_t = typename _E_n_t_i_t_y_S_e_t_:_:_E_l_e_m_e_n_t; │ │ │ │ +77 │ │ │ │ +78 protected: │ │ │ │ +_7_9 _L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e(const std::shared_ptr& data) │ │ │ │ +80 : _d_a_t_a__(data) │ │ │ │ +81 , _l_o_c_a_l_V_i_e_w__(_d_a_t_a__->_b_a_s_i_s->localView()) │ │ │ │ +82 { │ │ │ │ +83 _l_o_c_a_l_D_o_F_s__.reserve(_l_o_c_a_l_V_i_e_w__.maxSize()); │ │ │ │ +84 } │ │ │ │ +85 │ │ │ │ +_9_2 _L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e(const _L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e& other) │ │ │ │ +93 : _d_a_t_a__(other._d_a_t_a__) │ │ │ │ +94 , _l_o_c_a_l_V_i_e_w__(other._l_o_c_a_l_V_i_e_w__) │ │ │ │ +95 { │ │ │ │ +96 _l_o_c_a_l_D_o_F_s__.reserve(_l_o_c_a_l_V_i_e_w__.maxSize()); │ │ │ │ +97 if (_b_o_u_n_d()) │ │ │ │ +98 _l_o_c_a_l_D_o_F_s__ = other._l_o_c_a_l_D_o_F_s__; │ │ │ │ +99 } │ │ │ │ +100 │ │ │ │ +_1_0_8 _L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e& _o_p_e_r_a_t_o_r_=(const _L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e& other) │ │ │ │ +109 { │ │ │ │ +110 _d_a_t_a__ = other._d_a_t_a__; │ │ │ │ +111 _l_o_c_a_l_V_i_e_w__ = other._l_o_c_a_l_V_i_e_w__; │ │ │ │ +112 if (_b_o_u_n_d()) │ │ │ │ +113 _l_o_c_a_l_D_o_F_s__ = other._l_o_c_a_l_D_o_F_s__; │ │ │ │ +114 return *this; │ │ │ │ +115 } │ │ │ │ +116 │ │ │ │ +117 public: │ │ │ │ +_1_2_4 void _b_i_n_d(const _E_l_e_m_e_n_t& element) │ │ │ │ +125 { │ │ │ │ +126 _l_o_c_a_l_V_i_e_w__.bind(element); │ │ │ │ +127 // Use cache of full local view size. For a subspace basis, │ │ │ │ +128 // this may be larger than the number of local DOFs in the │ │ │ │ +129 // tree. In this case only cache entries associated to local │ │ │ │ +130 // DOFs in the subspace are filled. Cache entries associated │ │ │ │ +131 // to local DOFs which are not contained in the subspace will │ │ │ │ +132 // not be touched. │ │ │ │ +133 // │ │ │ │ +134 // Alternatively one could use a cache that exactly fits │ │ │ │ +135 // the size of the tree. However, this would require to │ │ │ │ +136 // subtract an offset from localIndex(i) on each cache │ │ │ │ +137 // access in operator(). │ │ │ │ +138 _l_o_c_a_l_D_o_F_s__.resize(_l_o_c_a_l_V_i_e_w__.size()); │ │ │ │ +139 const auto& _d_o_f_s = *_d_a_t_a__->coefficients; │ │ │ │ +140 for (size_type i = 0; i < _l_o_c_a_l_V_i_e_w__.tree().size(); ++i) │ │ │ │ +141 { │ │ │ │ +142 // For a subspace basis the index-within-tree i │ │ │ │ +143 // is not the same as the localIndex within the │ │ │ │ +144 // full local view. │ │ │ │ +145 size_t localIndex = _l_o_c_a_l_V_i_e_w__.tree().localIndex(i); │ │ │ │ +146 _l_o_c_a_l_D_o_F_s__[localIndex] = _d_o_f_s[_l_o_c_a_l_V_i_e_w__.index(localIndex)]; │ │ │ │ +147 } │ │ │ │ +148 } │ │ │ │ +149 │ │ │ │ +_1_5_1 void _u_n_b_i_n_d() │ │ │ │ +152 { │ │ │ │ +153 _l_o_c_a_l_V_i_e_w__.unbind(); │ │ │ │ +154 } │ │ │ │ +155 │ │ │ │ +_1_5_7 bool _b_o_u_n_d() const │ │ │ │ +158 { │ │ │ │ +159 return _l_o_c_a_l_V_i_e_w__.bound(); │ │ │ │ +160 } │ │ │ │ +161 │ │ │ │ +_1_6_3 const _E_l_e_m_e_n_t& _l_o_c_a_l_C_o_n_t_e_x_t() const │ │ │ │ 164 { │ │ │ │ -165 auto jacobianInverseTransposed = geometry.jacobianInverseTransposed(xi); │ │ │ │ -166 │ │ │ │ -167 for (auto& value : values) │ │ │ │ -168 { │ │ │ │ -169 auto tmp = value; │ │ │ │ -170 // Here we cannot directly use │ │ │ │ -171 // jacobianInverseTransposed.mv(tmp, value); │ │ │ │ -172 // because mv expects the DenseVector interface. │ │ │ │ -173 auto tmpDenseVector = Impl::DenseVectorView(tmp); │ │ │ │ -174 auto valueDenseVector = Impl::DenseVectorView(value); │ │ │ │ -175 jacobianInverseTransposed.mv(tmpDenseVector, valueDenseVector); │ │ │ │ -176 } │ │ │ │ -177 } │ │ │ │ -178 │ │ │ │ -188 template │ │ │ │ -189 static auto applyJacobian(Gradients& gradients, │ │ │ │ -190 const LocalCoordinate& xi, │ │ │ │ -191 const Geometry& geometry) │ │ │ │ -192 { │ │ │ │ -193 auto jacobianInverseTransposed = geometry.jacobianInverseTransposed(xi); │ │ │ │ -194 │ │ │ │ -195 for (auto& gradient : gradients) │ │ │ │ -196 { │ │ │ │ -197 auto tmp = gradient; │ │ │ │ -198 gradient = 0; │ │ │ │ -199 for (size_t j=0; j │ │ │ │ +_1_7_1 void _a_s_s_i_g_n_W_i_t_h(To& to, const From& from) const │ │ │ │ +172 { │ │ │ │ +173 auto from_flat = _f_l_a_t_V_e_c_t_o_r_V_i_e_w(from); │ │ │ │ +174 auto to_flat = _f_l_a_t_V_e_c_t_o_r_V_i_e_w(to); │ │ │ │ +175 assert(from_flat.size() == to_flat.size()); │ │ │ │ +176 for (size_type i = 0; i < to_flat.size(); ++i) │ │ │ │ +177 to_flat[i] = from_flat[i]; │ │ │ │ +178 } │ │ │ │ +179 │ │ │ │ +180 template │ │ │ │ +_1_8_1 decltype(auto) _n_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y(const Node& node, const TreePath& treePath, │ │ │ │ +Range& y) const │ │ │ │ +182 { │ │ │ │ +183 return (*_d_a_t_a__->nodeToRangeEntry)(node, treePath, y); │ │ │ │ +184 } │ │ │ │ +185 │ │ │ │ +_1_8_6 std::shared_ptr _d_a_t_a__; │ │ │ │ +_1_8_7 LocalView _l_o_c_a_l_V_i_e_w__; │ │ │ │ +_1_8_8 std::vector _l_o_c_a_l_D_o_F_s__; │ │ │ │ +189 }; │ │ │ │ +190 │ │ │ │ +191protected: │ │ │ │ +_1_9_2 _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e(const std::shared_ptr& data) │ │ │ │ +193 : _d_a_t_a__(data) │ │ │ │ +194 { │ │ │ │ +195 /* Nothing. */ │ │ │ │ +196 } │ │ │ │ +197 │ │ │ │ +198public: │ │ │ │ +199 │ │ │ │ +_2_0_1 const _B_a_s_i_s& _b_a_s_i_s() const │ │ │ │ +202 { │ │ │ │ +203 return *_d_a_t_a__->basis; │ │ │ │ 204 } │ │ │ │ -205 } │ │ │ │ -206 │ │ │ │ -214 template │ │ │ │ -215 class LocalValuedFunction │ │ │ │ -216 { │ │ │ │ -217 const Function& f_; │ │ │ │ -218 const Element& element_; │ │ │ │ -219 │ │ │ │ -220 public: │ │ │ │ -221 │ │ │ │ -222 LocalValuedFunction(const Function& f, const Element& element) │ │ │ │ -223 : f_(f), element_(element) │ │ │ │ -224 {} │ │ │ │ -225 │ │ │ │ -226 auto operator()(const LocalCoordinate& xi) const │ │ │ │ -227 { │ │ │ │ -228 auto globalValue = f_(xi); │ │ │ │ +205 │ │ │ │ +_2_0_7 const _V_e_c_t_o_r& _d_o_f_s() const │ │ │ │ +208 { │ │ │ │ +209 return *_d_a_t_a__->coefficients; │ │ │ │ +210 } │ │ │ │ +211 │ │ │ │ +_2_1_3 const _N_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y& _n_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y() const │ │ │ │ +214 { │ │ │ │ +215 return *_d_a_t_a__->nodeToRangeEntry; │ │ │ │ +216 } │ │ │ │ +217 │ │ │ │ +_2_1_9 const _E_n_t_i_t_y_S_e_t& _e_n_t_i_t_y_S_e_t() const │ │ │ │ +220 { │ │ │ │ +221 return _d_a_t_a__->entitySet; │ │ │ │ +222 } │ │ │ │ +223 │ │ │ │ +224protected: │ │ │ │ +_2_2_5 std::shared_ptr _d_a_t_a__; │ │ │ │ +226}; │ │ │ │ +227 │ │ │ │ +228} // namespace ImplDoc │ │ │ │ 229 │ │ │ │ -230 // Apply the inverse Piola transform │ │ │ │ -231 auto jacobianTransposed = element_.geometry().jacobianTransposed(xi); │ │ │ │ -232 │ │ │ │ -233 auto localValue = globalValue; │ │ │ │ -234 // Here we cannot directly use │ │ │ │ -235 // jacobianTransposed.mv(globalValue, localValue); │ │ │ │ -236 // because mv expects the DenseVector interface. │ │ │ │ -237 auto localValueDenseVector = Impl::DenseVectorView(localValue); │ │ │ │ -238 auto globalValueDenseVector = Impl::DenseVectorView(globalValue); │ │ │ │ -239 jacobianTransposed.mv(globalValueDenseVector, localValueDenseVector); │ │ │ │ -240 │ │ │ │ -241 return localValue; │ │ │ │ -242 } │ │ │ │ -243 }; │ │ │ │ -244 }; │ │ │ │ -245 │ │ │ │ -252 template │ │ │ │ -253 class GlobalValuedLocalBasis │ │ │ │ -254 { │ │ │ │ -255 public: │ │ │ │ -256 using Traits = typename LocalValuedLocalBasis::Traits; │ │ │ │ -257 │ │ │ │ -260 void bind(const LocalValuedLocalBasis& localValuedLocalBasis, const │ │ │ │ -Element& element) │ │ │ │ -261 { │ │ │ │ -262 localValuedLocalBasis_ = &localValuedLocalBasis; │ │ │ │ -263 element_ = &element; │ │ │ │ -264 } │ │ │ │ -265 │ │ │ │ -268 auto size() const │ │ │ │ -269 { │ │ │ │ -270 return localValuedLocalBasis_->size(); │ │ │ │ -271 } │ │ │ │ -272 │ │ │ │ -274 void evaluateFunction(const typename Traits::DomainType& x, │ │ │ │ -275 std::vector& out) const │ │ │ │ -276 { │ │ │ │ -277 localValuedLocalBasis_->evaluateFunction(x,out); │ │ │ │ -278 │ │ │ │ -279 Transformator::apply(out, x, element_->geometry()); │ │ │ │ -280 } │ │ │ │ -281 │ │ │ │ -287 void evaluateJacobian(const typename Traits::DomainType& x, │ │ │ │ -288 std::vector& out) const │ │ │ │ -289 { │ │ │ │ -290 localValuedLocalBasis_->evaluateJacobian(x,out); │ │ │ │ -291 │ │ │ │ -292 Transformator::applyJacobian(out, x, element_->geometry()); │ │ │ │ -293 } │ │ │ │ -294 │ │ │ │ -301 void partial(const std::array& order, │ │ │ │ -302 const typename Traits::DomainType& x, │ │ │ │ -303 std::vector& out) const │ │ │ │ -304 { │ │ │ │ -305 auto totalOrder = std::accumulate(order.begin(), order.end(), 0); │ │ │ │ -306 if (totalOrder == 0) { │ │ │ │ -307 evaluateFunction(x, out); │ │ │ │ -308 } else if (totalOrder == 1) { │ │ │ │ -309 auto const direction = std::distance(order.begin(), std::find(order.begin │ │ │ │ -(), order.end(), 1)); │ │ │ │ -310 out.resize(size()); │ │ │ │ +230 │ │ │ │ +231 │ │ │ │ +232template │ │ │ │ +233class _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e; │ │ │ │ +234 │ │ │ │ +278template │ │ │ │ +_2_8_1class _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n │ │ │ │ +282 : public _I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e │ │ │ │ +283{ │ │ │ │ +284 using Base = _I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_<_B_,_ _V_,_ _N_T_R_E_>; │ │ │ │ +285 using Data = typename _B_a_s_e_:_:_D_a_t_a; │ │ │ │ +286 │ │ │ │ +287public: │ │ │ │ +_2_8_8 using _B_a_s_i_s = typename _B_a_s_e_:_:_B_a_s_i_s; │ │ │ │ +_2_8_9 using _V_e_c_t_o_r = typename _B_a_s_e_:_:_V_e_c_t_o_r; │ │ │ │ +290 │ │ │ │ +_2_9_1 using _D_o_m_a_i_n = typename _B_a_s_e_:_:_D_o_m_a_i_n; │ │ │ │ +_2_9_2 using _R_a_n_g_e = R; │ │ │ │ +293 │ │ │ │ +_2_9_4 using _T_r_a_i_t_s = Imp::GridFunctionTraits<_R_a_n_g_e(_D_o_m_a_i_n), typename _B_a_s_e_:_: │ │ │ │ +_E_n_t_i_t_y_S_e_t, _D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s, 16>; │ │ │ │ +295 │ │ │ │ +296private: │ │ │ │ +297 │ │ │ │ +298 template │ │ │ │ +299 using LocalBasisRange = typename Node::FiniteElement::Traits:: │ │ │ │ +LocalBasisType::Traits::RangeType; │ │ │ │ +300 template │ │ │ │ +301 using NodeData = typename std::vector>; │ │ │ │ +302 using PerNodeEvaluationBuffer = typename TypeTree::TreeContainer; │ │ │ │ +303 │ │ │ │ +304public: │ │ │ │ +_3_0_5 class _L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +306 : public _B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e │ │ │ │ +307 { │ │ │ │ +308 using LocalBase = typename _B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e; │ │ │ │ +309 using size_type = typename Base::Tree::size_type; │ │ │ │ +310 using LocalBase::nodeToRangeEntry; │ │ │ │ 311 │ │ │ │ -312 // TODO: The following is wasteful: We compute the full Jacobian and then │ │ │ │ -return │ │ │ │ -313 // only a part of it. While we need the full Jacobian of the underlying │ │ │ │ -local-valued LFE, │ │ │ │ -314 // it should be possible to compute only a partial Piola transform for the │ │ │ │ -requested │ │ │ │ -315 // partial derivatives. │ │ │ │ -316 std::vector fullJacobian; │ │ │ │ -317 localValuedLocalBasis_->evaluateJacobian(x,fullJacobian); │ │ │ │ +312 public: │ │ │ │ +313 │ │ │ │ +_3_1_4 using _G_l_o_b_a_l_F_u_n_c_t_i_o_n = _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n; │ │ │ │ +_3_1_5 using _D_o_m_a_i_n = typename LocalBase::Domain; │ │ │ │ +_3_1_6 using _R_a_n_g_e = _G_l_o_b_a_l_F_u_n_c_t_i_o_n_:_:_R_a_n_g_e; │ │ │ │ +_3_1_7 using _E_l_e_m_e_n_t = typename LocalBase::Element; │ │ │ │ 318 │ │ │ │ -319 Transformator::applyJacobian(fullJacobian, x, element_->geometry()); │ │ │ │ -320 │ │ │ │ -321 for (std::size_t i=0; iorder(); │ │ │ │ -333 } │ │ │ │ -334 │ │ │ │ -335 const LocalValuedLocalBasis* localValuedLocalBasis_; │ │ │ │ -336 const Element* element_; │ │ │ │ -337 }; │ │ │ │ -338 │ │ │ │ -347 template │ │ │ │ -348 class GlobalValuedLocalInterpolation │ │ │ │ -349 { │ │ │ │ -350 public: │ │ │ │ -353 void bind(const LocalValuedLocalInterpolation& │ │ │ │ -localValuedLocalInterpolation, const Element& element) │ │ │ │ -354 { │ │ │ │ -355 localValuedLocalInterpolation_ = &localValuedLocalInterpolation; │ │ │ │ -356 element_ = &element; │ │ │ │ -357 } │ │ │ │ -358 │ │ │ │ -359 template │ │ │ │ -360 void interpolate (const F& f, std::vector& out) const │ │ │ │ -361 { │ │ │ │ -362 using LocalCoordinate = typename Element::Geometry::LocalCoordinate; │ │ │ │ -363 typename Transformator::template │ │ │ │ -LocalValuedFunction localValuedFunction(f, │ │ │ │ -*element_); │ │ │ │ -364 localValuedLocalInterpolation_->interpolate(localValuedFunction, out); │ │ │ │ -365 } │ │ │ │ -366 │ │ │ │ -367 private: │ │ │ │ -368 const LocalValuedLocalInterpolation* localValuedLocalInterpolation_; │ │ │ │ -369 const Element* element_; │ │ │ │ -370 }; │ │ │ │ -371 │ │ │ │ +_3_2_0 _L_o_c_a_l_F_u_n_c_t_i_o_n(const _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n& globalFunction) │ │ │ │ +321 : LocalBase(globalFunction._d_a_t_a__) │ │ │ │ +322 , evaluationBuffer_(this->_l_o_c_a_l_V_i_e_w__.tree()) │ │ │ │ +323 { │ │ │ │ +324 /* Nothing. */ │ │ │ │ +325 } │ │ │ │ +326 │ │ │ │ +_3_3_6 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(const _D_o_m_a_i_n& x) const │ │ │ │ +337 { │ │ │ │ +338 _R_a_n_g_e y; │ │ │ │ +339 _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(y) = 0; │ │ │ │ +340 │ │ │ │ +341 TypeTree::forEachLeafNode(this->_l_o_c_a_l_V_i_e_w__.tree(), [&](auto&& node, auto&& │ │ │ │ +treePath) { │ │ │ │ +342 if (node.empty()) │ │ │ │ +343 return; │ │ │ │ +344 const auto& fe = node.finiteElement(); │ │ │ │ +345 const auto& localBasis = fe.localBasis(); │ │ │ │ +346 auto& shapeFunctionValues = evaluationBuffer_[treePath]; │ │ │ │ +347 │ │ │ │ +348 localBasis.evaluateFunction(x, shapeFunctionValues); │ │ │ │ +349 │ │ │ │ +350 // Compute linear combinations of basis function jacobian. │ │ │ │ +351 // Non-scalar coefficients of dimension coeffDim are handled by │ │ │ │ +352 // processing the coeffDim linear combinations independently │ │ │ │ +353 // and storing them as entries of an array. │ │ │ │ +354 using Value = LocalBasisRange< std::decay_t >; │ │ │ │ +355 static constexpr auto coeffDim = decltype(flatVectorView(this->localDoFs_ │ │ │ │ +[node.localIndex(0)]).size())::value; │ │ │ │ +356 auto values = std::array{}; │ │ │ │ +357 _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(values) = 0; │ │ │ │ +358 for (size_type i = 0; i < localBasis.size(); ++i) │ │ │ │ +359 { │ │ │ │ +360 auto c = _f_l_a_t_V_e_c_t_o_r_V_i_e_w(this->_l_o_c_a_l_D_o_F_s__[node.localIndex(i)]); │ │ │ │ +361 for (std::size_t j = 0; j < coeffDim; ++j) │ │ │ │ +362 values[j].axpy(c[j], shapeFunctionValues[i]); │ │ │ │ +363 } │ │ │ │ +364 │ │ │ │ +365 // Assign computed values to node entry of range. │ │ │ │ +366 // Types are matched using the lexicographic ordering provided by │ │ │ │ +flatVectorView. │ │ │ │ +367 LocalBase::assignWith(_n_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y(node, treePath, y), values); │ │ │ │ +368 }); │ │ │ │ +369 │ │ │ │ +370 return y; │ │ │ │ +371 } │ │ │ │ 372 │ │ │ │ -379 template │ │ │ │ -380 class GlobalValuedLocalFiniteElement │ │ │ │ -381 { │ │ │ │ -382 using LocalBasis = GlobalValuedLocalBasis; │ │ │ │ -385 using LocalInterpolation = GlobalValuedLocalInterpolation; │ │ │ │ -388 │ │ │ │ -389 public: │ │ │ │ -392 using Traits = LocalFiniteElementTraits; │ │ │ │ -395 │ │ │ │ -396 GlobalValuedLocalFiniteElement() {} │ │ │ │ -397 │ │ │ │ -398 void bind(const LocalValuedLFE& localValuedLFE, const Element& element) │ │ │ │ -399 { │ │ │ │ -400 globalValuedLocalBasis_.bind(localValuedLFE.localBasis(), element); │ │ │ │ -401 globalValuedLocalInterpolation_.bind(localValuedLFE.localInterpolation(), │ │ │ │ -element); │ │ │ │ -402 localValuedLFE_ = &localValuedLFE; │ │ │ │ -403 } │ │ │ │ -404 │ │ │ │ -407 const typename Traits::LocalBasisType& localBasis() const │ │ │ │ -408 { │ │ │ │ -409 return globalValuedLocalBasis_; │ │ │ │ +_3_7_4 friend typename │ │ │ │ +_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_<_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_>_:_: │ │ │ │ +_L_o_c_a_l_F_u_n_c_t_i_o_n _d_e_r_i_v_a_t_i_v_e(const _L_o_c_a_l_F_u_n_c_t_i_o_n& lf) │ │ │ │ +375 { │ │ │ │ +376 auto dlf = _l_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +(_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_<_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_>(lf._d_a_t_a__)); │ │ │ │ +377 if (lf._b_o_u_n_d()) │ │ │ │ +378 dlf.bind(lf._l_o_c_a_l_C_o_n_t_e_x_t()); │ │ │ │ +379 return dlf; │ │ │ │ +380 } │ │ │ │ +381 │ │ │ │ +382 private: │ │ │ │ +383 mutable PerNodeEvaluationBuffer evaluationBuffer_; │ │ │ │ +384 }; │ │ │ │ +385 │ │ │ │ +387 template │ │ │ │ +_3_8_8 _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n(B_T && _b_a_s_i_s, V_T && coefficients, NTRE_T&& │ │ │ │ +_n_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y) │ │ │ │ +389 : Base(std::make_shared(Data{{_b_a_s_i_s.gridView()}, wrap_or_move(std:: │ │ │ │ +forward(basis)), wrap_or_move(std::forward(coefficients)), │ │ │ │ +wrap_or_move(std::forward(nodeToRangeEntry))})) │ │ │ │ +390 {} │ │ │ │ +391 │ │ │ │ +_3_9_3 _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n(std::shared_ptr _b_a_s_i_s, std:: │ │ │ │ +shared_ptr coefficients, std::shared_ptr _n_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y) │ │ │ │ +394 : Base(std::make_shared(Data{{_b_a_s_i_s->gridView()}, basis, │ │ │ │ +coefficients, nodeToRangeEntry})) │ │ │ │ +395 {} │ │ │ │ +396 │ │ │ │ +_4_0_2 _R_a_n_g_e operator() (const _D_o_m_a_i_n& x) const │ │ │ │ +403 { │ │ │ │ +404 HierarchicSearch search(this->_d_a_t_a__->basis->gridView().grid(), this->data_- │ │ │ │ +>basis->gridView().indexSet()); │ │ │ │ +405 │ │ │ │ +406 const auto e = search.findEntity(x); │ │ │ │ +407 auto localThis = _l_o_c_a_l_F_u_n_c_t_i_o_n(*this); │ │ │ │ +408 localThis.bind(e); │ │ │ │ +409 return localThis(e.geometry().local(x)); │ │ │ │ 410 } │ │ │ │ 411 │ │ │ │ -414 const typename Traits::LocalCoefficientsType& localCoefficients() const │ │ │ │ -415 { │ │ │ │ -416 return localValuedLFE_->localCoefficients(); │ │ │ │ -417 } │ │ │ │ -418 │ │ │ │ -421 const typename Traits::LocalInterpolationType& localInterpolation() const │ │ │ │ -422 { │ │ │ │ -423 return globalValuedLocalInterpolation_; │ │ │ │ -424 } │ │ │ │ -425 │ │ │ │ -427 std::size_t size() const │ │ │ │ -428 { │ │ │ │ -429 return localValuedLFE_->size(); │ │ │ │ -430 } │ │ │ │ +_4_1_3 friend _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_<_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_> │ │ │ │ +_d_e_r_i_v_a_t_i_v_e(const _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n& f) │ │ │ │ +414 { │ │ │ │ +415 return _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_<_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_> │ │ │ │ +(f._d_a_t_a__); │ │ │ │ +416 } │ │ │ │ +417 │ │ │ │ +_4_2_6 friend _L_o_c_a_l_F_u_n_c_t_i_o_n _l_o_c_a_l_F_u_n_c_t_i_o_n(const _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n& t) │ │ │ │ +427 { │ │ │ │ +428 return _L_o_c_a_l_F_u_n_c_t_i_o_n(t); │ │ │ │ +429 } │ │ │ │ +430}; │ │ │ │ 431 │ │ │ │ -434 GeometryType type() const │ │ │ │ -435 { │ │ │ │ -436 return localValuedLFE_->type(); │ │ │ │ -437 } │ │ │ │ -438 │ │ │ │ -439 private: │ │ │ │ -440 │ │ │ │ -441 typename Traits::LocalBasisType globalValuedLocalBasis_; │ │ │ │ -442 typename Traits::LocalInterpolationType globalValuedLocalInterpolation_; │ │ │ │ -443 const LocalValuedLFE* localValuedLFE_; │ │ │ │ -444 }; │ │ │ │ -445 │ │ │ │ -446} // namespace Dune::Functions::Impl │ │ │ │ -447 │ │ │ │ -448#endif / │ │ │ │ -/ DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH │ │ │ │ -_d_e_n_s_e_v_e_c_t_o_r_v_i_e_w_._h_h │ │ │ │ +432 │ │ │ │ +457template │ │ │ │ +_4_5_8auto _m_a_k_e_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n(B&& _b_a_s_i_s, V&& vector) │ │ │ │ +459{ │ │ │ │ +460 using _B_a_s_i_s = std::decay_t; │ │ │ │ +461 using NTREM = _H_i_e_r_a_r_c_h_i_c_N_o_d_e_T_o_R_a_n_g_e_M_a_p; │ │ │ │ +462 │ │ │ │ +463 // Small helper functions to wrap vectors using istlVectorBackend │ │ │ │ +464 // if they do not already satisfy the VectorBackend interface. │ │ │ │ +465 auto toConstVectorBackend = [&](auto&& v) -> decltype(auto) { │ │ │ │ +466 if constexpr (models, decltype(v)>()) { │ │ │ │ +467 return std::forward(v); │ │ │ │ +468 } else { │ │ │ │ +469 return _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(v); │ │ │ │ +470 } │ │ │ │ +471 }; │ │ │ │ +472 │ │ │ │ +473 using _V_e_c_t_o_r = std::decay_t │ │ │ │ +(vector)))>; │ │ │ │ +474 return _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_<_B_a_s_i_s_,_ _V_e_c_t_o_r_,_ _N_T_R_E_M_,_ _R_>( │ │ │ │ +475 std::forward(_b_a_s_i_s), │ │ │ │ +476 toConstVectorBackend(std::forward(vector)), │ │ │ │ +477 _H_i_e_r_a_r_c_h_i_c_N_o_d_e_T_o_R_a_n_g_e_M_a_p()); │ │ │ │ +478} │ │ │ │ +479 │ │ │ │ +480 │ │ │ │ +495template │ │ │ │ +_4_9_6class _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e │ │ │ │ +497 : public _I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e │ │ │ │ +498{ │ │ │ │ +499 using Base = _I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_<_t_y_p_e_n_a_m_e_ _D_G_B_F_:_:_B_a_s_i_s_, │ │ │ │ +_t_y_p_e_n_a_m_e_ _D_G_B_F_:_:_V_e_c_t_o_r_,_ _t_y_p_e_n_a_m_e_ _D_G_B_F_:_:_N_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y_>; │ │ │ │ +500 using Data = typename Base::Data; │ │ │ │ +501 │ │ │ │ +502public: │ │ │ │ +_5_0_3 using _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n = DGBF; │ │ │ │ +504 │ │ │ │ +_5_0_5 using _B_a_s_i_s = typename _B_a_s_e_:_:_B_a_s_i_s; │ │ │ │ +_5_0_6 using _V_e_c_t_o_r = typename _B_a_s_e_:_:_V_e_c_t_o_r; │ │ │ │ +507 │ │ │ │ +_5_0_8 using _D_o_m_a_i_n = typename _B_a_s_e_:_:_D_o_m_a_i_n; │ │ │ │ +_5_0_9 using _R_a_n_g_e = typename _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s_<_t_y_p_e_n_a_m_e │ │ │ │ +_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_T_r_a_i_t_s_:_:_D_e_r_i_v_a_t_i_v_e_I_n_t_e_r_f_a_c_e_>_:_:_R_a_n_g_e; │ │ │ │ +510 │ │ │ │ +_5_1_1 using _T_r_a_i_t_s = Imp::GridFunctionTraits<_R_a_n_g_e(_D_o_m_a_i_n), typename _B_a_s_e_:_: │ │ │ │ +_E_n_t_i_t_y_S_e_t, _D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s, 16>; │ │ │ │ +512 │ │ │ │ +513private: │ │ │ │ +514 │ │ │ │ +515 template │ │ │ │ +516 using LocalBasisRange = typename Node::FiniteElement::Traits:: │ │ │ │ +LocalBasisType::Traits::JacobianType; │ │ │ │ +517 template │ │ │ │ +518 using NodeData = typename std::vector< LocalBasisRange >; │ │ │ │ +519 using PerNodeEvaluationBuffer = typename TypeTree::TreeContainer; │ │ │ │ +520 │ │ │ │ +521public: │ │ │ │ +522 │ │ │ │ +_5_3_0 class _L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +531 : public Base::LocalFunctionBase │ │ │ │ +532 { │ │ │ │ +533 using LocalBase = typename Base::LocalFunctionBase; │ │ │ │ +534 using size_type = typename Base::Tree::size_type; │ │ │ │ +535 using LocalBase::nodeToRangeEntry; │ │ │ │ +536 │ │ │ │ +537 public: │ │ │ │ +_5_3_8 using _G_l_o_b_a_l_F_u_n_c_t_i_o_n = _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e; │ │ │ │ +_5_3_9 using _D_o_m_a_i_n = typename LocalBase::Domain; │ │ │ │ +_5_4_0 using _R_a_n_g_e = _G_l_o_b_a_l_F_u_n_c_t_i_o_n_:_:_R_a_n_g_e; │ │ │ │ +_5_4_1 using _E_l_e_m_e_n_t = typename LocalBase::Element; │ │ │ │ +542 │ │ │ │ +_5_4_4 _L_o_c_a_l_F_u_n_c_t_i_o_n(const _G_l_o_b_a_l_F_u_n_c_t_i_o_n& globalFunction) │ │ │ │ +545 : LocalBase(globalFunction._d_a_t_a__) │ │ │ │ +546 , evaluationBuffer_(this->_l_o_c_a_l_V_i_e_w__.tree()) │ │ │ │ +547 { │ │ │ │ +548 /* Nothing. */ │ │ │ │ +549 } │ │ │ │ +550 │ │ │ │ +_5_5_7 void _b_i_n_d(const _E_l_e_m_e_n_t& element) │ │ │ │ +558 { │ │ │ │ +559 LocalBase::bind(element); │ │ │ │ +560 geometry_.emplace(element.geometry()); │ │ │ │ +561 } │ │ │ │ +562 │ │ │ │ +_5_6_4 void _u_n_b_i_n_d() │ │ │ │ +565 { │ │ │ │ +566 geometry_.reset(); │ │ │ │ +567 LocalBase::unbind(); │ │ │ │ +568 } │ │ │ │ +569 │ │ │ │ +_5_8_3 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(const _D_o_m_a_i_n& x) const │ │ │ │ +584 { │ │ │ │ +585 _R_a_n_g_e y; │ │ │ │ +586 _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(y) = 0; │ │ │ │ +587 │ │ │ │ +588 const auto& jacobianInverse = geometry_->jacobianInverse(x); │ │ │ │ +589 │ │ │ │ +590 TypeTree::forEachLeafNode(this->_l_o_c_a_l_V_i_e_w__.tree(), [&](auto&& node, auto&& │ │ │ │ +treePath) { │ │ │ │ +591 if (node.empty()) │ │ │ │ +592 return; │ │ │ │ +593 const auto& fe = node.finiteElement(); │ │ │ │ +594 const auto& localBasis = fe.localBasis(); │ │ │ │ +595 auto& shapeFunctionJacobians = evaluationBuffer_[treePath]; │ │ │ │ +596 │ │ │ │ +597 localBasis.evaluateJacobian(x, shapeFunctionJacobians); │ │ │ │ +598 │ │ │ │ +599 // Compute linear combinations of basis function jacobian. │ │ │ │ +600 // Non-scalar coefficients of dimension coeffDim are handled by │ │ │ │ +601 // processing the coeffDim linear combinations independently │ │ │ │ +602 // and storing them as entries of an array. │ │ │ │ +603 using RefJacobian = LocalBasisRange< std::decay_t >; │ │ │ │ +604 static constexpr auto coeffDim = decltype(flatVectorView(this->localDoFs_ │ │ │ │ +[node.localIndex(0)]).size())::value; │ │ │ │ +605 auto refJacobians = std::array{}; │ │ │ │ +606 _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(refJacobians) = 0; │ │ │ │ +607 for (size_type i = 0; i < localBasis.size(); ++i) │ │ │ │ +608 { │ │ │ │ +609 auto c = _f_l_a_t_V_e_c_t_o_r_V_i_e_w(this->_l_o_c_a_l_D_o_F_s__[node.localIndex(i)]); │ │ │ │ +610 for (std::size_t j = 0; j < coeffDim; ++j) │ │ │ │ +611 refJacobians[j].axpy(c[j], shapeFunctionJacobians[i]); │ │ │ │ +612 } │ │ │ │ +613 │ │ │ │ +614 // Transform Jacobians form local to global coordinates. │ │ │ │ +615 using Jacobian = decltype(refJacobians[0] * jacobianInverse); │ │ │ │ +616 auto jacobians = std::array{}; │ │ │ │ +617 std::transform( │ │ │ │ +618 refJacobians.begin(), refJacobians.end(), jacobians.begin(), │ │ │ │ +619 [&](const auto& refJacobian) { return refJacobian * jacobianInverse; }); │ │ │ │ +620 │ │ │ │ +621 // Assign computed Jacobians to node entry of range. │ │ │ │ +622 // Types are matched using the lexicographic ordering provided by │ │ │ │ +flatVectorView. │ │ │ │ +623 LocalBase::assignWith(_n_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y(node, treePath, y), jacobians); │ │ │ │ +624 }); │ │ │ │ +625 │ │ │ │ +626 return y; │ │ │ │ +627 } │ │ │ │ +628 │ │ │ │ +_6_3_0 friend typename Traits::LocalFunctionTraits::DerivativeInterface _d_e_r_i_v_a_t_i_v_e │ │ │ │ +(const _L_o_c_a_l_F_u_n_c_t_i_o_n&) │ │ │ │ +631 { │ │ │ │ +632 DUNE_THROW(NotImplemented, "derivative of derivative is not implemented"); │ │ │ │ +633 } │ │ │ │ +634 │ │ │ │ +635 private: │ │ │ │ +636 mutable PerNodeEvaluationBuffer evaluationBuffer_; │ │ │ │ +637 std::optional geometry_; │ │ │ │ +638 }; │ │ │ │ +639 │ │ │ │ +_6_4_6 _D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e(const std::shared_ptr& │ │ │ │ +data) │ │ │ │ +647 : Base(data) │ │ │ │ +648 { │ │ │ │ +649 /* Nothing. */ │ │ │ │ +650 } │ │ │ │ +651 │ │ │ │ +_6_5_7 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(const _D_o_m_a_i_n& x) const │ │ │ │ +658 { │ │ │ │ +659 HierarchicSearch search(this->_d_a_t_a__->basis->gridView().grid(), this->data_- │ │ │ │ +>basis->gridView().indexSet()); │ │ │ │ +660 │ │ │ │ +661 const auto e = search.findEntity(x); │ │ │ │ +662 auto localThis = _l_o_c_a_l_F_u_n_c_t_i_o_n(*this); │ │ │ │ +663 localThis.bind(e); │ │ │ │ +664 return localThis(e.geometry().local(x)); │ │ │ │ +665 } │ │ │ │ +666 │ │ │ │ +_6_6_7 friend typename Traits::DerivativeInterface _d_e_r_i_v_a_t_i_v_e(const │ │ │ │ +_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e& f) │ │ │ │ +668 { │ │ │ │ +669 DUNE_THROW(NotImplemented, "derivative of derivative is not implemented"); │ │ │ │ +670 } │ │ │ │ +671 │ │ │ │ +_6_7_3 friend _L_o_c_a_l_F_u_n_c_t_i_o_n _l_o_c_a_l_F_u_n_c_t_i_o_n(const │ │ │ │ +_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e& f) │ │ │ │ +674 { │ │ │ │ +675 return _L_o_c_a_l_F_u_n_c_t_i_o_n(f); │ │ │ │ +676 } │ │ │ │ +677}; │ │ │ │ +678 │ │ │ │ +679 │ │ │ │ +680} // namespace Functions │ │ │ │ +681} // namespace Dune │ │ │ │ +682 │ │ │ │ +683#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH │ │ │ │ +_i_s_t_l_v_e_c_t_o_r_b_a_c_k_e_n_d_._h_h │ │ │ │ +_g_r_i_d_f_u_n_c_t_i_o_n_._h_h │ │ │ │ +_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h │ │ │ │ +_f_l_a_t_v_e_c_t_o_r_v_i_e_w_._h_h │ │ │ │ +_h_i_e_r_a_r_c_h_i_c_n_o_d_e_t_o_r_a_n_g_e_m_a_p_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_m_a_k_e_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n │ │ │ │ +auto makeDiscreteGlobalBasisFunction(B &&basis, V &&vector) │ │ │ │ +Generate a DiscreteGlobalBasisFunction. │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:458 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d │ │ │ │ +auto istlVectorBackend(Vector &v) │ │ │ │ +Return a vector backend wrapping non-const ISTL like containers. │ │ │ │ +DDeeffiinniittiioonn istlvectorbackend.hh:350 │ │ │ │ +_D_u_n_e │ │ │ │ +DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ +DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_l_a_t_V_e_c_t_o_r_V_i_e_w │ │ │ │ +auto flatVectorView(T &t) │ │ │ │ +Create flat vector view of passed mutable container. │ │ │ │ +DDeeffiinniittiioonn flatvectorview.hh:183 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:32 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ +Default implementation for derivative traits. │ │ │ │ +DDeeffiinniittiioonn defaultderivativetraits.hh:41 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_g_n_a_t_u_r_e_T_r_a_i_t_s │ │ │ │ +Helper class to deduce the signature of a callable. │ │ │ │ +DDeeffiinniittiioonn signature.hh:60 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_N_o_d_e_T_o_R_a_n_g_e_M_a_p │ │ │ │ +A simple node to range map using the nested tree indices. │ │ │ │ +DDeeffiinniittiioonn hierarchicnodetorangemap.hh:34 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:36 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_<_ _t_y_p_e_n_a_m_e_ _D_G_B_F_:_: │ │ │ │ +_B_a_s_i_s_,_ _t_y_p_e_n_a_m_e_ _D_G_B_F_:_:_V_e_c_t_o_r_,_ _t_y_p_e_n_a_m_e_ _D_G_B_F_:_:_N_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y_ _>_:_:_d_a_t_a__ │ │ │ │ +std::shared_ptr< const Data > data_ │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:225 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_d_o_f_s │ │ │ │ +const Vector & dofs() const │ │ │ │ +Return the coefficients of this discrete function by reference. │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:207 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_B_a_s_i_s │ │ │ │ +B Basis │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:38 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_T_r_e_e │ │ │ │ +typename Basis::LocalView::Tree Tree │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:47 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_V_e_c_t_o_r │ │ │ │ +V Vector │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:39 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_E_l_e_m_e_n_t │ │ │ │ +typename EntitySet::Element Element │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:53 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_D_o_m_a_i_n │ │ │ │ +typename EntitySet::LocalCoordinate LocalDomain │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:52 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_n_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y │ │ │ │ +const NodeToRangeEntry & nodeToRangeEntry() const │ │ │ │ +Return the stored node-to-range map. │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:213 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_N_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y │ │ │ │ +NTRE NodeToRangeEntry │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:48 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ +_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e │ │ │ │ +DiscreteGlobalBasisFunctionBase(const std::shared_ptr< const Data > &data) │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:192 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_G_r_i_d_V_i_e_w │ │ │ │ +typename Basis::GridView GridView │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:45 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_b_a_s_i_s │ │ │ │ +const Basis & basis() const │ │ │ │ +Return a const reference to the stored basis. │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:201 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_E_n_t_i_t_y_S_e_t │ │ │ │ +GridViewEntitySet< GridView, 0 > EntitySet │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:46 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_e_n_t_i_t_y_S_e_t │ │ │ │ +const EntitySet & entitySet() const │ │ │ │ +Get associated set of entities the local-function can be bound to. │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:219 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_D_o_m_a_i_n │ │ │ │ +typename EntitySet::GlobalCoordinate Domain │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:50 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_C_o_e_f_f_i_c_i_e_n_t │ │ │ │ +Dune::AutonomousValue< decltype(std::declval< Vector >()[std::declval< typename │ │ │ │ +Basis::MultiIndex >()])> Coefficient │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:43 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_D_a_t_a │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:61 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_D_a_t_a_:_:_e_n_t_i_t_y_S_e_t │ │ │ │ +EntitySet entitySet │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:62 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_D_a_t_a_:_: │ │ │ │ +_n_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y │ │ │ │ +std::shared_ptr< const NodeToRangeEntry > nodeToRangeEntry │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:65 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_D_a_t_a_:_:_b_a_s_i_s │ │ │ │ +std::shared_ptr< const Basis > basis │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:63 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_D_a_t_a_:_:_c_o_e_f_f_i_c_i_e_n_t_s │ │ │ │ +std::shared_ptr< const Vector > coefficients │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:64 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:70 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ +_o_p_e_r_a_t_o_r_= │ │ │ │ +LocalFunctionBase & operator=(const LocalFunctionBase &other) │ │ │ │ +Copy-assignment of the local-function. │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:108 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ +_b_o_u_n_d │ │ │ │ +bool bound() const │ │ │ │ +Check if LocalFunction is already bound to an element. │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:157 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ +_b_i_n_d │ │ │ │ +void bind(const Element &element) │ │ │ │ +Bind LocalFunction to grid element. │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:124 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ +_E_l_e_m_e_n_t │ │ │ │ +typename EntitySet::Element Element │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:76 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ +_l_o_c_a_l_C_o_n_t_e_x_t │ │ │ │ +const Element & localContext() const │ │ │ │ +Return the element the local-function is bound to. │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:163 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ +_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e │ │ │ │ +LocalFunctionBase(const LocalFunctionBase &other) │ │ │ │ +Copy-construct the local-function. │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:92 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ +_l_o_c_a_l_D_o_F_s__ │ │ │ │ +std::vector< Coefficient > localDoFs_ │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:188 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ +_a_s_s_i_g_n_W_i_t_h │ │ │ │ +void assignWith(To &to, const From &from) const │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:171 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ +_d_a_t_a__ │ │ │ │ +std::shared_ptr< const Data > data_ │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:186 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ +_n_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y │ │ │ │ +decltype(auto) nodeToRangeEntry(const Node &node, const TreePath &treePath, │ │ │ │ +Range &y) const │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:181 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ +_l_o_c_a_l_V_i_e_w__ │ │ │ │ +LocalView localView_ │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:187 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ +_u_n_b_i_n_d │ │ │ │ +void unbind() │ │ │ │ +Unbind the local-function. │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:151 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ +_D_o_m_a_i_n │ │ │ │ +LocalDomain Domain │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:75 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_m_p_l_D_o_c_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e_:_: │ │ │ │ +_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e │ │ │ │ +LocalFunctionBase(const std::shared_ptr< const Data > &data) │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:79 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e │ │ │ │ +Derivative of a DiscreteGlobalBasisFunction. │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:498 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_B_a_s_i_s │ │ │ │ +typename Base::Basis Basis │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:505 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ +friend Traits::DerivativeInterface derivative(const │ │ │ │ +DiscreteGlobalBasisFunctionDerivative &f) │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:667 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ +Range operator()(const Domain &x) const │ │ │ │ +Evaluate the discrete grid-function derivative in global coordinates. │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:657 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_R_a_n_g_e │ │ │ │ +typename SignatureTraits< typename DiscreteGlobalBasisFunction::Traits:: │ │ │ │ +DerivativeInterface >::Range Range │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:509 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_l_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +friend LocalFunction localFunction(const DiscreteGlobalBasisFunctionDerivative │ │ │ │ +&f) │ │ │ │ +Construct local function from a DiscreteGlobalBasisFunctionDerivative. │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:673 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_: │ │ │ │ +_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e │ │ │ │ +DiscreteGlobalBasisFunctionDerivative(const std::shared_ptr< const Data > │ │ │ │ +&data) │ │ │ │ +create object from DiscreateGlobalBasisFunction data │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:646 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_: │ │ │ │ +_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n │ │ │ │ +DGBF DiscreteGlobalBasisFunction │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:503 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_V_e_c_t_o_r │ │ │ │ +typename Base::Vector Vector │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:506 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_T_r_a_i_t_s │ │ │ │ +Imp::GridFunctionTraits< Range(Domain), typename Base::EntitySet, │ │ │ │ +DefaultDerivativeTraits, 16 > Traits │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:511 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_D_o_m_a_i_n │ │ │ │ +typename Base::Domain Domain │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:508 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ +friend DiscreteGlobalBasisFunctionDerivative< DiscreteGlobalBasisFunction > │ │ │ │ +derivative(const DiscreteGlobalBasisFunction &f) │ │ │ │ +Derivative of the DiscreteGlobalBasisFunction. │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:413 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n │ │ │ │ +DiscreteGlobalBasisFunction(B_T &&basis, V_T &&coefficients, NTRE_T │ │ │ │ +&&nodeToRangeEntry) │ │ │ │ +Create a grid-function, by wrapping the arguments in std::shared_ptr. │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:388 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n │ │ │ │ +DiscreteGlobalBasisFunction(std::shared_ptr< const Basis > basis, std:: │ │ │ │ +shared_ptr< const V > coefficients, std::shared_ptr< const typename Base:: │ │ │ │ +NodeToRangeEntry > nodeToRangeEntry) │ │ │ │ +Create a grid-function, by moving the arguments in std::shared_ptr. │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:393 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_l_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +friend LocalFunction localFunction(const DiscreteGlobalBasisFunction &t) │ │ │ │ +Construct local function from a DiscreteGlobalBasisFunction. │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:426 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_B_a_s_i_s │ │ │ │ +typename Base::Basis Basis │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:288 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_T_r_a_i_t_s │ │ │ │ +Imp::GridFunctionTraits< Range(Domain), typename Base::EntitySet, │ │ │ │ +DefaultDerivativeTraits, 16 > Traits │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:294 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_R_a_n_g_e │ │ │ │ +R Range │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:292 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_V_e_c_t_o_r │ │ │ │ +typename Base::Vector Vector │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:289 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_D_o_m_a_i_n │ │ │ │ +typename Base::Domain Domain │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:291 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:307 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_:_R_a_n_g_e │ │ │ │ +GlobalFunction::Range Range │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:316 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_:_D_o_m_a_i_n │ │ │ │ +typename LocalBase::Domain Domain │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:315 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +LocalFunction(const DiscreteGlobalBasisFunction &globalFunction) │ │ │ │ +Create a local-function from the associated grid-function. │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:320 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ +friend DiscreteGlobalBasisFunctionDerivative< DiscreteGlobalBasisFunction >:: │ │ │ │ +LocalFunction derivative(const LocalFunction &lf) │ │ │ │ +Local function of the derivative. │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:374 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_:_G_l_o_b_a_l_F_u_n_c_t_i_o_n │ │ │ │ +DiscreteGlobalBasisFunction GlobalFunction │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:314 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ +Range operator()(const Domain &x) const │ │ │ │ +Evaluate this local-function in coordinates x in the bound element. │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:336 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_:_E_l_e_m_e_n_t │ │ │ │ +typename LocalBase::Element Element │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:317 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +local function evaluating the derivative in reference coordinates │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:532 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_:_o_p_e_r_a_t_o_r │ │ │ │ +_(_) │ │ │ │ +Range operator()(const Domain &x) const │ │ │ │ +Evaluate this local-function in coordinates x in the bound element. │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:583 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_:_D_o_m_a_i_n │ │ │ │ +typename LocalBase::Domain Domain │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:539 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_:_E_l_e_m_e_n_t │ │ │ │ +typename LocalBase::Element Element │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:541 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_: │ │ │ │ +_d_e_r_i_v_a_t_i_v_e │ │ │ │ +friend Traits::LocalFunctionTraits::DerivativeInterface derivative(const │ │ │ │ +LocalFunction &) │ │ │ │ +Not implemented. │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:630 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_: │ │ │ │ +_G_l_o_b_a_l_F_u_n_c_t_i_o_n │ │ │ │ +DiscreteGlobalBasisFunctionDerivative GlobalFunction │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:538 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_:_R_a_n_g_e │ │ │ │ +GlobalFunction::Range Range │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:540 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_:_u_n_b_i_n_d │ │ │ │ +void unbind() │ │ │ │ +Unbind the local-function. │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:564 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_: │ │ │ │ +_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +LocalFunction(const GlobalFunction &globalFunction) │ │ │ │ +Create a local function from the associated grid function. │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:544 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_s_c_r_e_t_e_G_l_o_b_a_l_B_a_s_i_s_F_u_n_c_t_i_o_n_D_e_r_i_v_a_t_i_v_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_:_:_b_i_n_d │ │ │ │ +void bind(const Element &element) │ │ │ │ +Bind LocalFunction to grid element. │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:557 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t │ │ │ │ +An entity set for all entities of given codim in a grid view. │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:27 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_E_l_e_m_e_n_t │ │ │ │ +GridView::template Codim< codim >::Entity Element │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:36 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ +Element::Geometry::LocalCoordinate LocalCoordinate │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:39 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ +Element::Geometry::GlobalCoordinate GlobalCoordinate │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:40 │ │ │ │ +_c_o_n_c_e_p_t_s_._h_h │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _g_l_o_b_a_l_v_a_l_u_e_d_l_o_c_a_l_f_i_n_i_t_e_e_l_e_m_e_n_t_._h_h │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ + * _d_i_s_c_r_e_t_e_g_l_o_b_a_l_b_a_s_i_s_f_u_n_c_t_i_o_n_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00149.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: functionaldescriptor.hh File Reference │ │ │ +Dune-Functions: finefunctiononcoarsegridview.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,22 +88,36 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
functionaldescriptor.hh File Reference
│ │ │ +
finefunctiononcoarsegridview.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <array>
│ │ │ -#include <dune/common/rangeutilities.hh>
│ │ │ +
#include <optional>
│ │ │ +#include <type_traits>
│ │ │ +#include <utility>
│ │ │ +#include <limits>
│ │ │ +#include <algorithm>
│ │ │ +#include <cmath>
│ │ │ +#include <dune/common/referencehelper.hh>
│ │ │ +#include <dune/geometry/type.hh>
│ │ │ +#include <dune/functions/common/defaultderivativetraits.hh>
│ │ │ +#include <dune/functions/gridfunctions/gridfunction.hh>
│ │ │ +#include <dune/functions/gridfunctions/gridviewentityset.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ + │ │ │ + │ │ │ + │ │ │ +

│ │ │ +Classes

class  Dune::Functions::FineFunctionOnCoarseGridView< GridFunction, GV, DerivativeTraits >
 A wrapper representing a fine grid function on a gridview. More...
│ │ │ │ │ │ │ │ │ │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
│ │ │
│ │ │
│ │ │ @@ -114,13 +128,13 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,16 +1,29 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -functionaldescriptor.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ +finefunctiononcoarsegridview.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ +CCllaasssseess │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_<_ _G_r_i_d_F_u_n_c_t_i_o_n_,_ _G_V_, │ │ │ │ + _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _> │ │ │ │ +  A wrapper representing a fine grid function on a gridview. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _f_u_n_c_t_i_o_n_a_l_d_e_s_c_r_i_p_t_o_r_._h_h │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ + * _f_i_n_e_f_u_n_c_t_i_o_n_o_n_c_o_a_r_s_e_g_r_i_d_v_i_e_w_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00149_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: functionaldescriptor.hh Source File │ │ │ +Dune-Functions: finefunctiononcoarsegridview.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,97 +88,327 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
functionaldescriptor.hh
│ │ │ +
finefunctiononcoarsegridview.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │ -
6#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FUNCTIONALDESCRIPTOR_HH
│ │ │ -
7#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FUNCTIONALDESCRIPTOR_HH
│ │ │ -
8
│ │ │ -
9#include <array>
│ │ │ -
10
│ │ │ -
11#include <dune/common/rangeutilities.hh>
│ │ │ -
12
│ │ │ -
13
│ │ │ -
14namespace Dune::Functions::Impl
│ │ │ -
15{
│ │ │ +
6
│ │ │ +
7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_FINEFUNCTIONONCOARSEGRIDVIEW_HH
│ │ │ +
8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_FINEFUNCTIONONCOARSEGRIDVIEW_HH
│ │ │ +
9
│ │ │ +
10#include <optional>
│ │ │ +
11#include <type_traits>
│ │ │ +
12#include <utility>
│ │ │ +
13#include <limits>
│ │ │ +
14#include <algorithm>
│ │ │ +
15#include <cmath>
│ │ │
16
│ │ │ -
17
│ │ │ -
18
│ │ │ -
35template<std::size_t dim>
│ │ │ -
36class FunctionalDescriptor
│ │ │ -
37{
│ │ │ -
38public:
│ │ │ -
39
│ │ │ -
40 using Order = std::array<unsigned int, dim>;
│ │ │ -
41
│ │ │ -
42 FunctionalDescriptor()
│ │ │ -
43 : partialDerivativeOrder_{}
│ │ │ -
44 , normalDerivativeOrder_(0)
│ │ │ -
45 {}
│ │ │ -
46
│ │ │ -
47 explicit FunctionalDescriptor(const Order& partialDerivativeOrder)
│ │ │ -
48 : partialDerivativeOrder_{partialDerivativeOrder}
│ │ │ -
49 , normalDerivativeOrder_(0)
│ │ │ -
50 {}
│ │ │ -
51
│ │ │ -
52 explicit FunctionalDescriptor(unsigned int normalDerivativeOrder)
│ │ │ -
53 : partialDerivativeOrder_{}
│ │ │ -
54 , normalDerivativeOrder_(normalDerivativeOrder)
│ │ │ -
55 {}
│ │ │ -
56
│ │ │ -
57 bool isNormalDerivative() const
│ │ │ -
58 {
│ │ │ -
59 return normalDerivativeOrder_>0;
│ │ │ -
60 }
│ │ │ -
61
│ │ │ -
62 bool isPartialDerivative() const
│ │ │ -
63 {
│ │ │ -
64 for(auto i: Dune::range(dim))
│ │ │ -
65 {
│ │ │ -
66 if (partialDerivativeOrder(i)>0)
│ │ │ -
67 return true;
│ │ │ -
68 }
│ │ │ -
69 return false;
│ │ │ -
70 }
│ │ │ -
71
│ │ │ -
72 unsigned int normalDerivativeOrder() const
│ │ │ -
73 {
│ │ │ -
74 return normalDerivativeOrder_;
│ │ │ -
75 }
│ │ │ +
17#include <dune/common/referencehelper.hh>
│ │ │ +
18
│ │ │ +
19#include <dune/geometry/type.hh>
│ │ │ +
20
│ │ │ + │ │ │ + │ │ │ + │ │ │ +
24
│ │ │ +
25namespace Dune::Functions {
│ │ │ +
26
│ │ │ +
27namespace Impl {
│ │ │ +
28
│ │ │ +
29namespace ReferenceElementUtilities {
│ │ │ +
30
│ │ │ +
31// Compute the l1-distance of x to the reference element identified
│ │ │ +
32// by the topology id and dimension.
│ │ │ +
33template<class X, class FT = std::decay_t<decltype(std::declval<X>()[0])> >
│ │ │ +
34FT distance(unsigned int topologyId, int dim, X x, FT scaleFactor = FT(1))
│ │ │ +
35{
│ │ │ +
36 using std::abs;
│ │ │ +
37 using std::max;
│ │ │ +
38 using std::min;
│ │ │ +
39 auto dist_x_last = max(max(x[dim-1]-scaleFactor, -x[dim-1]), FT(0));
│ │ │ +
40 if (dim > 1)
│ │ │ +
41 {
│ │ │ +
42 if (Dune::Impl::isPyramid(topologyId, dim))
│ │ │ +
43 scaleFactor -= max(min(x[dim-1], scaleFactor), FT(0));
│ │ │ +
44 return distance(Dune::Impl::baseTopologyId(topologyId, dim), dim-1, x, scaleFactor) + dist_x_last;
│ │ │ +
45 }
│ │ │ +
46 if (dim == 1)
│ │ │ +
47 return dist_x_last;
│ │ │ +
48 return FT(0);
│ │ │ +
49}
│ │ │ +
50
│ │ │ +
51// Check if the l1-distance of x to the reference element identified
│ │ │ +
52// by the topology id and dimension is less than a tolerance. This
│ │ │ +
53// implementation is significantly faster than checking if
│ │ │ +
54// distance(...) <= tolerance. It is almost as fast as checkInside(...)
│ │ │ +
55// of the refenece element, but the latter does not reflect the
│ │ │ +
56// distance wrt any norm while we use the l1-norm here.
│ │ │ +
57template<class X, class FT = std::decay_t<decltype(std::declval<X>()[0])> >
│ │ │ +
58bool checkInside(unsigned int topologyId, int dim, X x, FT tolerance, FT scaleFactor = FT(1))
│ │ │ +
59{
│ │ │ +
60 using std::abs;
│ │ │ +
61 using std::max;
│ │ │ +
62 using std::min;
│ │ │ +
63 if (dim > 0)
│ │ │ +
64 {
│ │ │ +
65 auto dist_x_last = max(x[dim-1]-scaleFactor, -x[dim-1]);
│ │ │ +
66 if (dist_x_last <= tolerance)
│ │ │ +
67 {
│ │ │ +
68 if (Dune::Impl::isPyramid(topologyId, dim))
│ │ │ +
69 scaleFactor -= max(min(x[dim-1], scaleFactor), FT(0));
│ │ │ +
70 return checkInside(Dune::Impl::baseTopologyId(topologyId, dim), dim-1, x, tolerance - max(dist_x_last, FT(0)), scaleFactor);
│ │ │ +
71 }
│ │ │ +
72 return false;
│ │ │ +
73 }
│ │ │ +
74 return true;
│ │ │ +
75}
│ │ │
76
│ │ │ -
77 const Order& partialDerivativeOrder() const
│ │ │ -
78 {
│ │ │ -
79 return partialDerivativeOrder_;
│ │ │ -
80 }
│ │ │ +
77} // namespace ReferenceElementUtilities
│ │ │ +
78
│ │ │ +
79} // namespace Impl
│ │ │ +
80
│ │ │
81
│ │ │ -
82private:
│ │ │ -
83 Order partialDerivativeOrder_;
│ │ │ -
84 unsigned int normalDerivativeOrder_;
│ │ │ -
85};
│ │ │ -
86
│ │ │ -
87
│ │ │ -
88
│ │ │ -
89} // namespace Dune::Functions::Impl
│ │ │ -
90
│ │ │ -
91#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FUNCTIONALDESCRIPTOR_HH
│ │ │ +
82
│ │ │ +
83
│ │ │ +
84
│ │ │ +
85
│ │ │ +
86
│ │ │ +
101template<class GridFunction, class GV, template<class> class DerivativeTraits=Dune::Functions::DefaultDerivativeTraits>
│ │ │ +
│ │ │ + │ │ │ +
103{
│ │ │ +
104 using RawGridFunction = Dune::ResolveRef_t<GridFunction>;
│ │ │ +
105
│ │ │ +
106 auto&& rawFunction() const
│ │ │ +
107 {
│ │ │ +
108 return Dune::resolveRef(function_);
│ │ │ +
109 }
│ │ │ +
110
│ │ │ +
111 static constexpr auto dim = GV::Grid::dimension;
│ │ │ +
112
│ │ │ +
113public:
│ │ │ +
114
│ │ │ +
115 using GridView = GV;
│ │ │ + │ │ │ +
117 using Element = typename EntitySet::Element;
│ │ │ + │ │ │ + │ │ │ +
120 using Range = std::decay_t<decltype(std::declval<RawGridFunction>()(std::declval<Domain>()))>;
│ │ │ +
121
│ │ │ +
122private:
│ │ │ +
123
│ │ │ +
124 using FineEntitySet = std::decay_t<decltype(std::declval<RawGridFunction>().entitySet())>;
│ │ │ +
125 using Traits = Dune::Functions::Imp::GridFunctionTraits<Range(Domain), EntitySet, DerivativeTraits, 56>;
│ │ │ +
126
│ │ │ +
127 class FineLocalFunctionOnCoarseGridView
│ │ │ +
128 {
│ │ │ +
129 using Traits = typename FineFunctionOnCoarseGridView::Traits::LocalFunctionTraits;
│ │ │ +
130
│ │ │ +
131 public:
│ │ │ +
132
│ │ │ +
133 using Derivative = decltype(localFunction(derivative(std::declval<FineFunctionOnCoarseGridView>())));
│ │ │ +
134 using RawLocalFunction = std::decay_t<decltype(localFunction(std::declval<const RawGridFunction&>()))>;
│ │ │ +
135
│ │ │ +
141 FineLocalFunctionOnCoarseGridView(RawLocalFunction&& localFunction, const FineEntitySet& fineEntitySet)
│ │ │ +
142 : element_()
│ │ │ +
143 , localFunction_(localFunction)
│ │ │ +
144 , fineEntitySet_(fineEntitySet)
│ │ │ +
145 , forwardToFineFunction_(false)
│ │ │ +
146 {}
│ │ │ +
147
│ │ │ +
153 FineLocalFunctionOnCoarseGridView(
│ │ │ +
154 RawLocalFunction&& localFunction,
│ │ │ +
155 const FineEntitySet& fineEntitySet,
│ │ │ +
156 bool forwardToFineFunction,
│ │ │ +
157 const std::optional<Element>& element
│ │ │ +
158 )
│ │ │ +
159 : element_(element)
│ │ │ +
160 , localFunction_(localFunction)
│ │ │ +
161 , fineEntitySet_(fineEntitySet)
│ │ │ +
162 , forwardToFineFunction_(forwardToFineFunction)
│ │ │ +
163 {}
│ │ │ +
164
│ │ │ +
166 void bind(const Element& element)
│ │ │ +
167 {
│ │ │ +
168 element_ = element;
│ │ │ +
169 forwardToFineFunction_ = fineEntitySet_.contains(*element_);
│ │ │ +
170 if (forwardToFineFunction_)
│ │ │ +
171 localFunction_.bind(element);
│ │ │ +
172 }
│ │ │ +
173
│ │ │ +
175 void unbind()
│ │ │ +
176 {
│ │ │ +
177 element_.reset();
│ │ │ +
178 }
│ │ │ +
179
│ │ │ +
181 bool bound() const
│ │ │ +
182 {
│ │ │ +
183 return static_cast<bool>(element_);
│ │ │ +
184 }
│ │ │ +
185
│ │ │ +
187 const Element& localContext() const
│ │ │ +
188 {
│ │ │ +
189 return *element_;
│ │ │ +
190 }
│ │ │ +
191
│ │ │ +
193 friend auto derivative(const FineLocalFunctionOnCoarseGridView& f)
│ │ │ +
194 {
│ │ │ +
195 if constexpr(requires{ derivative(f.localFunction_); })
│ │ │ +
196 return Derivative(derivative(f.localFunction_), f.fineEntitySet_, f.forwardToFineFunction_, f.element_);
│ │ │ +
197 else
│ │ │ +
198 return typename Traits::DerivativeInterface{};
│ │ │ +
199 }
│ │ │ +
200
│ │ │ + │ │ │ +
203 {
│ │ │ +
204 if (forwardToFineFunction_)
│ │ │ +
205 return localFunction_(x);
│ │ │ +
206 return evaluateInDescendent(*element_, x);
│ │ │ +
207 }
│ │ │ +
208
│ │ │ +
209 private:
│ │ │ +
210
│ │ │ +
211 // Find a child containing the point and evaluate there recursively
│ │ │ +
212 Range evaluateInDescendent(const Element& element, LocalDomain x) const
│ │ │ +
213 {
│ │ │ +
214 Element closestChild;
│ │ │ +
215 LocalDomain xInClosestChild;
│ │ │ +
216 double distanceToClosestChild = std::numeric_limits<double>::max();
│ │ │ +
217 for(const auto& child : descendantElements(element, element.level()+1))
│ │ │ +
218 {
│ │ │ +
219 auto&& geometry = child.geometryInFather();
│ │ │ +
220 auto xInChild = geometry.local(x);
│ │ │ +
221 auto dist = Impl::ReferenceElementUtilities::distance(child.type().id(), dim, xInChild);
│ │ │ +
222 if (dist < distanceToClosestChild)
│ │ │ +
223 {
│ │ │ +
224 closestChild = child;
│ │ │ +
225 distanceToClosestChild = dist;
│ │ │ +
226 xInClosestChild = xInChild;
│ │ │ +
227 if (distanceToClosestChild==0)
│ │ │ +
228 break;
│ │ │ +
229 }
│ │ │ +
230 }
│ │ │ +
231 if (fineEntitySet_.contains(closestChild))
│ │ │ +
232 {
│ │ │ +
233 localFunction_.bind(closestChild);
│ │ │ +
234 return localFunction_(xInClosestChild);
│ │ │ +
235 }
│ │ │ +
236 else
│ │ │ +
237 return evaluateInDescendent(closestChild, xInClosestChild);
│ │ │ +
238 }
│ │ │ +
239
│ │ │ +
240 std::optional<Element> element_;
│ │ │ +
241 mutable RawLocalFunction localFunction_;
│ │ │ +
242 const FineEntitySet& fineEntitySet_;
│ │ │ +
243 bool forwardToFineFunction_ = false;
│ │ │ +
244 };
│ │ │ +
245
│ │ │ +
246public:
│ │ │ +
247
│ │ │ +
248 using LocalFunction = FineLocalFunctionOnCoarseGridView;
│ │ │ +
249
│ │ │ +
│ │ │ +
256 FineFunctionOnCoarseGridView(const GridFunction& function, const GridView& gridView)
│ │ │ +
257 : function_(function)
│ │ │ +
258 , entitySet_(gridView)
│ │ │ +
259 {}
│ │ │ +
│ │ │ +
260
│ │ │ +
│ │ │ + │ │ │ +
268 : function_(std::move(function))
│ │ │ +
269 , entitySet_(gridView)
│ │ │ +
270 {}
│ │ │ +
│ │ │ +
271
│ │ │ +
│ │ │ +
273 Range operator()(const Domain& x) const
│ │ │ +
274 {
│ │ │ +
275 return function_(x);
│ │ │ +
276 }
│ │ │ +
│ │ │ +
277
│ │ │ +
│ │ │ + │ │ │ +
280 {
│ │ │ +
281 if constexpr(requires{ derivative(f.rawFunction()); })
│ │ │ +
282 {
│ │ │ +
283 using RawDerivative = std::decay_t<decltype(derivative(f.rawFunction()))>;
│ │ │ + │ │ │ +
285 }
│ │ │ +
286 else
│ │ │ +
287 return typename Traits::DerivativeInterface{};
│ │ │ +
288 }
│ │ │ +
│ │ │ +
289
│ │ │ +
│ │ │ + │ │ │ +
292 {
│ │ │ +
293 return LocalFunction(localFunction(f.rawFunction()), f.rawFunction().entitySet());
│ │ │ +
294 }
│ │ │ +
│ │ │ +
295
│ │ │ +
│ │ │ +
297 const EntitySet& entitySet() const
│ │ │ +
298 {
│ │ │ +
299 return entitySet_;
│ │ │ +
300 }
│ │ │ +
│ │ │ +
301
│ │ │ +
302protected:
│ │ │ +
303
│ │ │ + │ │ │ + │ │ │ +
306};
│ │ │ +
│ │ │ +
307
│ │ │ +
308
│ │ │ +
309
│ │ │ +
310} // namespace Dune::Functions
│ │ │ +
311
│ │ │ +
312#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_FINEFUNCTIONONCOARSEGRIDVIEW_HH
│ │ │ + │ │ │ + │ │ │ + │ │ │ +
Definition monomialset.hh:19
│ │ │ +
GridFunction function_
Definition finefunctiononcoarsegridview.hh:304
│ │ │ +
Dune::Functions::GridViewEntitySet< GridView, 0 > EntitySet
Definition finefunctiononcoarsegridview.hh:116
│ │ │ +
Range operator()(const Domain &x) const
Evaluate function in global coordinates.
Definition finefunctiononcoarsegridview.hh:273
│ │ │ +
FineLocalFunctionOnCoarseGridView LocalFunction
Definition finefunctiononcoarsegridview.hh:248
│ │ │ +
FineFunctionOnCoarseGridView(const GridFunction &function, const GridView &gridView)
Create FineFunctionOnCoarseGridView from GridFunction and GridView.
Definition finefunctiononcoarsegridview.hh:256
│ │ │ +
friend auto derivative(const FineFunctionOnCoarseGridView &f)
Obtain global derivative of this function.
Definition finefunctiononcoarsegridview.hh:279
│ │ │ +
typename EntitySet::GlobalCoordinate Domain
Definition finefunctiononcoarsegridview.hh:118
│ │ │ +
FineFunctionOnCoarseGridView(GridFunction &&function, const GridView &gridView)
Create FineFunctionOnCoarseGridView from GridFunction and GridView.
Definition finefunctiononcoarsegridview.hh:267
│ │ │ +
EntitySet entitySet_
Definition finefunctiononcoarsegridview.hh:305
│ │ │ +
std::decay_t< decltype(std::declval< RawGridFunction >()(std::declval< Domain >()))> Range
Definition finefunctiononcoarsegridview.hh:120
│ │ │ +
typename EntitySet::LocalCoordinate LocalDomain
Definition finefunctiononcoarsegridview.hh:119
│ │ │ +
friend LocalFunction localFunction(const FineFunctionOnCoarseGridView &f)
Create a LocalFunction for evaluation in local coordinates.
Definition finefunctiononcoarsegridview.hh:291
│ │ │ +
GV GridView
Definition finefunctiononcoarsegridview.hh:115
│ │ │ +
typename EntitySet::Element Element
Definition finefunctiononcoarsegridview.hh:117
│ │ │ +
const EntitySet & entitySet() const
Return the EntitySet associated to this GridViewFunction.
Definition finefunctiononcoarsegridview.hh:297
│ │ │ +
Definition gridfunction.hh:36
│ │ │ +
An entity set for all entities of given codim in a grid view.
Definition gridviewentityset.hh:27
│ │ │ +
GridView::template Codim< codim >::Entity Element
Definition gridviewentityset.hh:36
│ │ │ +
const GridView & gridView() const
Return the associated GridView.
Definition gridviewentityset.hh:80
│ │ │ +
Element::Geometry::LocalCoordinate LocalCoordinate
Definition gridviewentityset.hh:39
│ │ │ +
Element::Geometry::GlobalCoordinate GlobalCoordinate
Definition gridviewentityset.hh:40
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,88 +1,372 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -functionaldescriptor.hh │ │ │ │ +finefunctiononcoarsegridview.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ -6#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FUNCTIONALDESCRIPTOR_HH │ │ │ │ -7#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FUNCTIONALDESCRIPTOR_HH │ │ │ │ -8 │ │ │ │ -9#include │ │ │ │ -10 │ │ │ │ -11#include │ │ │ │ -12 │ │ │ │ -13 │ │ │ │ -14namespace Dune::Functions::Impl │ │ │ │ -15{ │ │ │ │ +6 │ │ │ │ +7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_FINEFUNCTIONONCOARSEGRIDVIEW_HH │ │ │ │ +8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_FINEFUNCTIONONCOARSEGRIDVIEW_HH │ │ │ │ +9 │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ +12#include │ │ │ │ +13#include │ │ │ │ +14#include │ │ │ │ +15#include │ │ │ │ 16 │ │ │ │ -17 │ │ │ │ +17#include │ │ │ │ 18 │ │ │ │ -35template │ │ │ │ -36class FunctionalDescriptor │ │ │ │ -37{ │ │ │ │ -38public: │ │ │ │ -39 │ │ │ │ -40 using Order = std::array; │ │ │ │ -41 │ │ │ │ -42 FunctionalDescriptor() │ │ │ │ -43 : partialDerivativeOrder_{} │ │ │ │ -44 , normalDerivativeOrder_(0) │ │ │ │ -45 {} │ │ │ │ -46 │ │ │ │ -47 explicit FunctionalDescriptor(const Order& partialDerivativeOrder) │ │ │ │ -48 : partialDerivativeOrder_{partialDerivativeOrder} │ │ │ │ -49 , normalDerivativeOrder_(0) │ │ │ │ -50 {} │ │ │ │ -51 │ │ │ │ -52 explicit FunctionalDescriptor(unsigned int normalDerivativeOrder) │ │ │ │ -53 : partialDerivativeOrder_{} │ │ │ │ -54 , normalDerivativeOrder_(normalDerivativeOrder) │ │ │ │ -55 {} │ │ │ │ -56 │ │ │ │ -57 bool isNormalDerivative() const │ │ │ │ -58 { │ │ │ │ -59 return normalDerivativeOrder_>0; │ │ │ │ -60 } │ │ │ │ -61 │ │ │ │ -62 bool isPartialDerivative() const │ │ │ │ -63 { │ │ │ │ -64 for(auto i: Dune::range(dim)) │ │ │ │ -65 { │ │ │ │ -66 if (partialDerivativeOrder(i)>0) │ │ │ │ -67 return true; │ │ │ │ -68 } │ │ │ │ -69 return false; │ │ │ │ -70 } │ │ │ │ -71 │ │ │ │ -72 unsigned int normalDerivativeOrder() const │ │ │ │ -73 { │ │ │ │ -74 return normalDerivativeOrder_; │ │ │ │ -75 } │ │ │ │ +19#include │ │ │ │ +20 │ │ │ │ +21#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ +22#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +23#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h> │ │ │ │ +24 │ │ │ │ +25namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ +26 │ │ │ │ +27namespace Impl { │ │ │ │ +28 │ │ │ │ +29namespace ReferenceElementUtilities { │ │ │ │ +30 │ │ │ │ +31// Compute the l1-distance of x to the reference element identified │ │ │ │ +32// by the topology id and dimension. │ │ │ │ +33template()[0])> > │ │ │ │ +34FT distance(unsigned int topologyId, int dim, X x, FT scaleFactor = FT(1)) │ │ │ │ +35{ │ │ │ │ +36 using std::abs; │ │ │ │ +37 using std::max; │ │ │ │ +38 using std::min; │ │ │ │ +39 auto dist_x_last = max(max(x[dim-1]-scaleFactor, -x[dim-1]), FT(0)); │ │ │ │ +40 if (dim > 1) │ │ │ │ +41 { │ │ │ │ +42 if (Dune::Impl::isPyramid(topologyId, dim)) │ │ │ │ +43 scaleFactor -= max(min(x[dim-1], scaleFactor), FT(0)); │ │ │ │ +44 return distance(Dune::Impl::baseTopologyId(topologyId, dim), dim-1, x, │ │ │ │ +scaleFactor) + dist_x_last; │ │ │ │ +45 } │ │ │ │ +46 if (dim == 1) │ │ │ │ +47 return dist_x_last; │ │ │ │ +48 return FT(0); │ │ │ │ +49} │ │ │ │ +50 │ │ │ │ +51// Check if the l1-distance of x to the reference element identified │ │ │ │ +52// by the topology id and dimension is less than a tolerance. This │ │ │ │ +53// implementation is significantly faster than checking if │ │ │ │ +54// distance(...) <= tolerance. It is almost as fast as checkInside(...) │ │ │ │ +55// of the refenece element, but the latter does not reflect the │ │ │ │ +56// distance wrt any norm while we use the l1-norm here. │ │ │ │ +57template()[0])> > │ │ │ │ +58bool checkInside(unsigned int topologyId, int dim, X x, FT tolerance, FT │ │ │ │ +scaleFactor = FT(1)) │ │ │ │ +59{ │ │ │ │ +60 using std::abs; │ │ │ │ +61 using std::max; │ │ │ │ +62 using std::min; │ │ │ │ +63 if (dim > 0) │ │ │ │ +64 { │ │ │ │ +65 auto dist_x_last = max(x[dim-1]-scaleFactor, -x[dim-1]); │ │ │ │ +66 if (dist_x_last <= tolerance) │ │ │ │ +67 { │ │ │ │ +68 if (Dune::Impl::isPyramid(topologyId, dim)) │ │ │ │ +69 scaleFactor -= max(min(x[dim-1], scaleFactor), FT(0)); │ │ │ │ +70 return checkInside(Dune::Impl::baseTopologyId(topologyId, dim), dim-1, x, │ │ │ │ +tolerance - max(dist_x_last, FT(0)), scaleFactor); │ │ │ │ +71 } │ │ │ │ +72 return false; │ │ │ │ +73 } │ │ │ │ +74 return true; │ │ │ │ +75} │ │ │ │ 76 │ │ │ │ -77 const Order& partialDerivativeOrder() const │ │ │ │ -78 { │ │ │ │ -79 return partialDerivativeOrder_; │ │ │ │ -80 } │ │ │ │ +77} // namespace ReferenceElementUtilities │ │ │ │ +78 │ │ │ │ +79} // namespace Impl │ │ │ │ +80 │ │ │ │ 81 │ │ │ │ -82private: │ │ │ │ -83 Order partialDerivativeOrder_; │ │ │ │ -84 unsigned int normalDerivativeOrder_; │ │ │ │ -85}; │ │ │ │ +82 │ │ │ │ +83 │ │ │ │ +84 │ │ │ │ +85 │ │ │ │ 86 │ │ │ │ -87 │ │ │ │ -88 │ │ │ │ -89} // namespace Dune::Functions::Impl │ │ │ │ -90 │ │ │ │ -91#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FUNCTIONALDESCRIPTOR_HH │ │ │ │ +101template class │ │ │ │ +DerivativeTraits=Dune::Functions::DefaultDerivativeTraits> │ │ │ │ +_1_0_2class _F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w │ │ │ │ +103{ │ │ │ │ +104 using RawGridFunction = Dune::ResolveRef_t; │ │ │ │ +105 │ │ │ │ +106 auto&& rawFunction() const │ │ │ │ +107 { │ │ │ │ +108 return Dune::resolveRef(_f_u_n_c_t_i_o_n__); │ │ │ │ +109 } │ │ │ │ +110 │ │ │ │ +111 static constexpr auto dim = GV::Grid::dimension; │ │ │ │ +112 │ │ │ │ +113public: │ │ │ │ +114 │ │ │ │ +_1_1_5 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ +_1_1_6 using _E_n_t_i_t_y_S_e_t = _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_G_r_i_d_V_i_e_w_,_ _0_>; │ │ │ │ +_1_1_7 using _E_l_e_m_e_n_t = typename _E_n_t_i_t_y_S_e_t_:_:_E_l_e_m_e_n_t; │ │ │ │ +_1_1_8 using _D_o_m_a_i_n = typename _E_n_t_i_t_y_S_e_t_:_:_G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e; │ │ │ │ +_1_1_9 using _L_o_c_a_l_D_o_m_a_i_n = typename _E_n_t_i_t_y_S_e_t_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e; │ │ │ │ +_1_2_0 using _R_a_n_g_e = std::decay_t()(std:: │ │ │ │ +declval()))>; │ │ │ │ +121 │ │ │ │ +122private: │ │ │ │ +123 │ │ │ │ +124 using FineEntitySet = std::decay_t │ │ │ │ +().entitySet())>; │ │ │ │ +125 using Traits = Dune::Functions::Imp::GridFunctionTraits<_R_a_n_g_e(_D_o_m_a_i_n), │ │ │ │ +_E_n_t_i_t_y_S_e_t, DerivativeTraits, 56>; │ │ │ │ +126 │ │ │ │ +127 class FineLocalFunctionOnCoarseGridView │ │ │ │ +128 { │ │ │ │ +129 using Traits = typename FineFunctionOnCoarseGridView::Traits:: │ │ │ │ +LocalFunctionTraits; │ │ │ │ +130 │ │ │ │ +131 public: │ │ │ │ +132 │ │ │ │ +133 using Derivative = decltype(_l_o_c_a_l_F_u_n_c_t_i_o_n(_d_e_r_i_v_a_t_i_v_e(std:: │ │ │ │ +declval()))); │ │ │ │ +134 using RawLocalFunction = std::decay_t()))>; │ │ │ │ +135 │ │ │ │ +141 FineLocalFunctionOnCoarseGridView(RawLocalFunction&& _l_o_c_a_l_F_u_n_c_t_i_o_n, const │ │ │ │ +FineEntitySet& fineEntitySet) │ │ │ │ +142 : element_() │ │ │ │ +143 , localFunction_(_l_o_c_a_l_F_u_n_c_t_i_o_n) │ │ │ │ +144 , fineEntitySet_(fineEntitySet) │ │ │ │ +145 , forwardToFineFunction_(false) │ │ │ │ +146 {} │ │ │ │ +147 │ │ │ │ +153 FineLocalFunctionOnCoarseGridView( │ │ │ │ +154 RawLocalFunction&& _l_o_c_a_l_F_u_n_c_t_i_o_n, │ │ │ │ +155 const FineEntitySet& fineEntitySet, │ │ │ │ +156 bool forwardToFineFunction, │ │ │ │ +157 const std::optional& element │ │ │ │ +158 ) │ │ │ │ +159 : element_(element) │ │ │ │ +160 , localFunction_(_l_o_c_a_l_F_u_n_c_t_i_o_n) │ │ │ │ +161 , fineEntitySet_(fineEntitySet) │ │ │ │ +162 , forwardToFineFunction_(forwardToFineFunction) │ │ │ │ +163 {} │ │ │ │ +164 │ │ │ │ +166 void bind(const _E_l_e_m_e_n_t& element) │ │ │ │ +167 { │ │ │ │ +168 element_ = element; │ │ │ │ +169 forwardToFineFunction_ = fineEntitySet_.contains(*element_); │ │ │ │ +170 if (forwardToFineFunction_) │ │ │ │ +171 localFunction_.bind(element); │ │ │ │ +172 } │ │ │ │ +173 │ │ │ │ +175 void unbind() │ │ │ │ +176 { │ │ │ │ +177 element_.reset(); │ │ │ │ +178 } │ │ │ │ +179 │ │ │ │ +181 bool bound() const │ │ │ │ +182 { │ │ │ │ +183 return static_cast(element_); │ │ │ │ +184 } │ │ │ │ +185 │ │ │ │ +187 const _E_l_e_m_e_n_t& localContext() const │ │ │ │ +188 { │ │ │ │ +189 return *element_; │ │ │ │ +190 } │ │ │ │ +191 │ │ │ │ +193 friend auto _d_e_r_i_v_a_t_i_v_e(const FineLocalFunctionOnCoarseGridView& f) │ │ │ │ +194 { │ │ │ │ +195 if constexpr(requires{ _d_e_r_i_v_a_t_i_v_e(f.localFunction_); }) │ │ │ │ +196 return Derivative(_d_e_r_i_v_a_t_i_v_e(f.localFunction_), f.fineEntitySet_, │ │ │ │ +f.forwardToFineFunction_, f.element_); │ │ │ │ +197 else │ │ │ │ +198 return typename Traits::DerivativeInterface{}; │ │ │ │ +199 } │ │ │ │ +200 │ │ │ │ +202 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(_L_o_c_a_l_D_o_m_a_i_n x) const │ │ │ │ +203 { │ │ │ │ +204 if (forwardToFineFunction_) │ │ │ │ +205 return localFunction_(x); │ │ │ │ +206 return evaluateInDescendent(*element_, x); │ │ │ │ +207 } │ │ │ │ +208 │ │ │ │ +209 private: │ │ │ │ +210 │ │ │ │ +211 // Find a child containing the point and evaluate there recursively │ │ │ │ +212 _R_a_n_g_e evaluateInDescendent(const _E_l_e_m_e_n_t& element, _L_o_c_a_l_D_o_m_a_i_n x) const │ │ │ │ +213 { │ │ │ │ +214 _E_l_e_m_e_n_t closestChild; │ │ │ │ +215 _L_o_c_a_l_D_o_m_a_i_n xInClosestChild; │ │ │ │ +216 double distanceToClosestChild = std::numeric_limits::max(); │ │ │ │ +217 for(const auto& child : descendantElements(element, element.level()+1)) │ │ │ │ +218 { │ │ │ │ +219 auto&& geometry = child.geometryInFather(); │ │ │ │ +220 auto xInChild = geometry.local(x); │ │ │ │ +221 auto dist = Impl::ReferenceElementUtilities::distance(child.type().id(), │ │ │ │ +dim, xInChild); │ │ │ │ +222 if (dist < distanceToClosestChild) │ │ │ │ +223 { │ │ │ │ +224 closestChild = child; │ │ │ │ +225 distanceToClosestChild = dist; │ │ │ │ +226 xInClosestChild = xInChild; │ │ │ │ +227 if (distanceToClosestChild==0) │ │ │ │ +228 break; │ │ │ │ +229 } │ │ │ │ +230 } │ │ │ │ +231 if (fineEntitySet_.contains(closestChild)) │ │ │ │ +232 { │ │ │ │ +233 localFunction_.bind(closestChild); │ │ │ │ +234 return localFunction_(xInClosestChild); │ │ │ │ +235 } │ │ │ │ +236 else │ │ │ │ +237 return evaluateInDescendent(closestChild, xInClosestChild); │ │ │ │ +238 } │ │ │ │ +239 │ │ │ │ +240 std::optional element_; │ │ │ │ +241 mutable RawLocalFunction localFunction_; │ │ │ │ +242 const FineEntitySet& fineEntitySet_; │ │ │ │ +243 bool forwardToFineFunction_ = false; │ │ │ │ +244 }; │ │ │ │ +245 │ │ │ │ +246public: │ │ │ │ +247 │ │ │ │ +_2_4_8 using _L_o_c_a_l_F_u_n_c_t_i_o_n = FineLocalFunctionOnCoarseGridView; │ │ │ │ +249 │ │ │ │ +_2_5_6 _F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w(const _G_r_i_d_F_u_n_c_t_i_o_n& function, const _G_r_i_d_V_i_e_w& │ │ │ │ +gridView) │ │ │ │ +257 : _f_u_n_c_t_i_o_n__(function) │ │ │ │ +258 , _e_n_t_i_t_y_S_e_t__(gridView) │ │ │ │ +259 {} │ │ │ │ +260 │ │ │ │ +_2_6_7 _F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w(_G_r_i_d_F_u_n_c_t_i_o_n&& function, const _G_r_i_d_V_i_e_w& │ │ │ │ +gridView) │ │ │ │ +268 : _f_u_n_c_t_i_o_n__(std::move(function)) │ │ │ │ +269 , _e_n_t_i_t_y_S_e_t__(gridView) │ │ │ │ +270 {} │ │ │ │ +271 │ │ │ │ +_2_7_3 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(const _D_o_m_a_i_n& x) const │ │ │ │ +274 { │ │ │ │ +275 return _f_u_n_c_t_i_o_n__(x); │ │ │ │ +276 } │ │ │ │ +277 │ │ │ │ +_2_7_9 friend auto _d_e_r_i_v_a_t_i_v_e(const _F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w& f) │ │ │ │ +280 { │ │ │ │ +281 if constexpr(requires{ _d_e_r_i_v_a_t_i_v_e(f.rawFunction()); }) │ │ │ │ +282 { │ │ │ │ +283 using RawDerivative = std::decay_t; │ │ │ │ +284 return _F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_<_R_a_w_D_e_r_i_v_a_t_i_v_e_,_ _G_r_i_d_V_i_e_w_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_>(_d_e_r_i_v_a_t_i_v_e(f.rawFunction()), f._e_n_t_i_t_y_S_e_t__._g_r_i_d_V_i_e_w()); │ │ │ │ +285 } │ │ │ │ +286 else │ │ │ │ +287 return typename Traits::DerivativeInterface{}; │ │ │ │ +288 } │ │ │ │ +289 │ │ │ │ +_2_9_1 friend _L_o_c_a_l_F_u_n_c_t_i_o_n _l_o_c_a_l_F_u_n_c_t_i_o_n(const _F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w& f) │ │ │ │ +292 { │ │ │ │ +293 return _L_o_c_a_l_F_u_n_c_t_i_o_n(_l_o_c_a_l_F_u_n_c_t_i_o_n(f.rawFunction()), f.rawFunction │ │ │ │ +().entitySet()); │ │ │ │ +294 } │ │ │ │ +295 │ │ │ │ +_2_9_7 const _E_n_t_i_t_y_S_e_t& _e_n_t_i_t_y_S_e_t() const │ │ │ │ +298 { │ │ │ │ +299 return _e_n_t_i_t_y_S_e_t__; │ │ │ │ +300 } │ │ │ │ +301 │ │ │ │ +302protected: │ │ │ │ +303 │ │ │ │ +_3_0_4 _G_r_i_d_F_u_n_c_t_i_o_n _f_u_n_c_t_i_o_n__; │ │ │ │ +_3_0_5 _E_n_t_i_t_y_S_e_t _e_n_t_i_t_y_S_e_t__; │ │ │ │ +306}; │ │ │ │ +307 │ │ │ │ +308 │ │ │ │ +309 │ │ │ │ +310} // namespace Dune::Functions │ │ │ │ +311 │ │ │ │ +312#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_FINEFUNCTIONONCOARSEGRIDVIEW_HH │ │ │ │ +_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h │ │ │ │ +_g_r_i_d_f_u_n_c_t_i_o_n_._h_h │ │ │ │ +_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ +DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_f_u_n_c_t_i_o_n__ │ │ │ │ +GridFunction function_ │ │ │ │ +DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:304 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_E_n_t_i_t_y_S_e_t │ │ │ │ +Dune::Functions::GridViewEntitySet< GridView, 0 > EntitySet │ │ │ │ +DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:116 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ +Range operator()(const Domain &x) const │ │ │ │ +Evaluate function in global coordinates. │ │ │ │ +DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:273 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +FineLocalFunctionOnCoarseGridView LocalFunction │ │ │ │ +DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:248 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w │ │ │ │ +FineFunctionOnCoarseGridView(const GridFunction &function, const GridView │ │ │ │ +&gridView) │ │ │ │ +Create FineFunctionOnCoarseGridView from GridFunction and GridView. │ │ │ │ +DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:256 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ +friend auto derivative(const FineFunctionOnCoarseGridView &f) │ │ │ │ +Obtain global derivative of this function. │ │ │ │ +DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:279 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_D_o_m_a_i_n │ │ │ │ +typename EntitySet::GlobalCoordinate Domain │ │ │ │ +DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:118 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w │ │ │ │ +FineFunctionOnCoarseGridView(GridFunction &&function, const GridView &gridView) │ │ │ │ +Create FineFunctionOnCoarseGridView from GridFunction and GridView. │ │ │ │ +DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:267 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_e_n_t_i_t_y_S_e_t__ │ │ │ │ +EntitySet entitySet_ │ │ │ │ +DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:305 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_R_a_n_g_e │ │ │ │ +std::decay_t< decltype(std::declval< RawGridFunction >()(std::declval< Domain > │ │ │ │ +()))> Range │ │ │ │ +DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:120 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_L_o_c_a_l_D_o_m_a_i_n │ │ │ │ +typename EntitySet::LocalCoordinate LocalDomain │ │ │ │ +DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:119 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_l_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +friend LocalFunction localFunction(const FineFunctionOnCoarseGridView &f) │ │ │ │ +Create a LocalFunction for evaluation in local coordinates. │ │ │ │ +DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:291 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_G_r_i_d_V_i_e_w │ │ │ │ +GV GridView │ │ │ │ +DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:115 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_E_l_e_m_e_n_t │ │ │ │ +typename EntitySet::Element Element │ │ │ │ +DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:117 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_i_n_e_F_u_n_c_t_i_o_n_O_n_C_o_a_r_s_e_G_r_i_d_V_i_e_w_:_:_e_n_t_i_t_y_S_e_t │ │ │ │ +const EntitySet & entitySet() const │ │ │ │ +Return the EntitySet associated to this GridViewFunction. │ │ │ │ +DDeeffiinniittiioonn finefunctiononcoarsegridview.hh:297 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ +DDeeffiinniittiioonn gridfunction.hh:36 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t │ │ │ │ +An entity set for all entities of given codim in a grid view. │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:27 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_E_l_e_m_e_n_t │ │ │ │ +GridView::template Codim< codim >::Entity Element │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:36 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_:_:_g_r_i_d_V_i_e_w │ │ │ │ +const GridView & gridView() const │ │ │ │ +Return the associated GridView. │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:80 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ +Element::Geometry::LocalCoordinate LocalCoordinate │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:39 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ +Element::Geometry::GlobalCoordinate GlobalCoordinate │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:40 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _f_u_n_c_t_i_o_n_a_l_d_e_s_c_r_i_p_t_o_r_._h_h │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ + * _f_i_n_e_f_u_n_c_t_i_o_n_o_n_c_o_a_r_s_e_g_r_i_d_v_i_e_w_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00152.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: flatvectorview.hh File Reference │ │ │ +Dune-Functions: analyticgridviewfunction.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,54 +88,60 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
flatvectorview.hh File Reference
│ │ │ +
analyticgridviewfunction.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <array>
│ │ │ -#include <dune/common/concept.hh>
│ │ │ -#include <dune/common/hybridutilities.hh>
│ │ │ -#include <dune/common/indices.hh>
│ │ │ -#include <dune/functions/functionspacebases/concepts.hh>
│ │ │ +
#include <type_traits>
│ │ │ +#include <optional>
│ │ │ +#include <dune/common/copyableoptional.hh>
│ │ │ +#include <dune/common/typeutilities.hh>
│ │ │ +#include <dune/functions/common/signature.hh>
│ │ │ +#include <dune/functions/common/defaultderivativetraits.hh>
│ │ │ +#include <dune/functions/common/differentiablefunction_imp.hh>
│ │ │ +#include <dune/functions/common/differentiablefunction.hh>
│ │ │ +#include <dune/functions/gridfunctions/gridviewentityset.hh>
│ │ │ +#include <dune/functions/gridfunctions/localderivativetraits.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ + │ │ │ + │ │ │ + │ │ │ +

│ │ │ +Classes

class  Dune::Functions::AnalyticGridViewFunction< Range(Domain), GV, F, DerivativeTraits >
 Class wrapping any differentiable function as grid function. More...
│ │ │ │ │ │ │ │ │ │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Functions

template<class T>
auto Dune::Functions::flatVectorView (T &t)
 Create flat vector view of passed mutable container.
template<class T>
auto Dune::Functions::flatVectorView (const T &t)
 Create flat vector view of passed const container.
template<class T>
auto Dune::Functions::flatVectorView (T &&t)
 Create flat vector view of passed container temporary.
template<class F, class GridView, class Domain = typename GridView::template Codim<0>::Geometry::GlobalCoordinate, class Range = std::invoke_result_t<F,Domain>>
 Dune::Functions::AnalyticGridViewFunction (const F &, const GridView &) -> AnalyticGridViewFunction< Range(Domain), GridView, F >
template<class F, class GridView>
auto Dune::Functions::makeAnalyticGridViewFunction (F &&f, const GridView &gridView)
 Create an AnalyticGridViewFunction from a function and a grid view.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,29 +1,38 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -flatvectorview.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +analyticgridviewfunction.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_s_i_g_n_a_t_u_r_e_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n___i_m_p_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_l_o_c_a_l_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ +CCllaasssseess │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ + _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _> │ │ │ │ +  Class wrapping any differentiable function as grid function. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_l_a_t_V_e_c_t_o_r_V_i_e_w (T &t) │ │ │ │ -  Create flat vector view of passed mutable container. │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_l_a_t_V_e_c_t_o_r_V_i_e_w (const T &t) │ │ │ │ -  Create flat vector view of passed const container. │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_l_a_t_V_e_c_t_o_r_V_i_e_w (T &&t) │ │ │ │ -  Create flat vector view of passed container temporary. │ │ │ │ +template::Geometry::GlobalCoordinate, class Range = std:: │ │ │ │ +invoke_result_t> │ │ │ │ +   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n (const F &, const GridView &) - │ │ │ │ + > AnalyticGridViewFunction< Range(Domain), GridView, F > │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n (F &&f, const GridView │ │ │ │ + &gridView) │ │ │ │ +  Create an _A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n from a function and a grid view. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _f_l_a_t_v_e_c_t_o_r_v_i_e_w_._h_h │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ + * _a_n_a_l_y_t_i_c_g_r_i_d_v_i_e_w_f_u_n_c_t_i_o_n_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00152.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,5 +1,4 @@ │ │ │ │ var a00152 = [ │ │ │ │ - ["Dune::Functions::flatVectorView", "a00318.html#ac37c350bd2f6cb4fea793ac4f665c0fe", null], │ │ │ │ - ["Dune::Functions::flatVectorView", "a00318.html#a4fac6802f21000f59e52aade3cd47b08", null], │ │ │ │ - ["Dune::Functions::flatVectorView", "a00318.html#ad98b265d97ebd619e7732df6a8d1f7da", null] │ │ │ │ + ["Dune::Functions::AnalyticGridViewFunction", "a00318.html#a4982d31e3f878344c48b9825e82a4426", null], │ │ │ │ + ["Dune::Functions::makeAnalyticGridViewFunction", "a00308.html#gaf49863bf9728775c1ae6a718aeaaba45", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00152_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: flatvectorview.hh Source File │ │ │ +Dune-Functions: analyticgridviewfunction.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,225 +88,268 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
flatvectorview.hh
│ │ │ +
analyticgridviewfunction.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH
│ │ │ +
8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH
│ │ │
9
│ │ │ -
10
│ │ │ -
11#include <array>
│ │ │ +
10#include <type_traits>
│ │ │ +
11#include <optional>
│ │ │
12
│ │ │ -
13#include <dune/common/concept.hh>
│ │ │ -
14#include <dune/common/hybridutilities.hh>
│ │ │ -
15#include <dune/common/indices.hh>
│ │ │ -
16
│ │ │ - │ │ │ -
18
│ │ │ -
19
│ │ │ -
20
│ │ │ -
21
│ │ │ -
22namespace Dune {
│ │ │ -
23namespace Functions {
│ │ │ -
24namespace Impl {
│ │ │ -
25
│ │ │ +
13#include <dune/common/copyableoptional.hh>
│ │ │ +
14#include <dune/common/typeutilities.hh>
│ │ │ +
15
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
22
│ │ │ +
23
│ │ │ +
24namespace Dune {
│ │ │ +
25namespace Functions {
│ │ │
26
│ │ │ -
27template<class V>
│ │ │ -
28struct FlatVectorBackend
│ │ │ -
29{
│ │ │ -
30
│ │ │ -
31 template<class VV, class Index,
│ │ │ -
32 std::enable_if_t< models<Concept::HasIndexAccess, VV, Index>(), int> = 0>
│ │ │ -
33 static decltype(auto) getEntry(VV&& v, const Index& i)
│ │ │ -
34 {
│ │ │ -
35 return v[i];
│ │ │ -
36 }
│ │ │ -
37
│ │ │ -
38 template<class VV, class Index,
│ │ │ -
39 std::enable_if_t< not models<Concept::HasIndexAccess, VV, Index>(), int> = 0>
│ │ │ -
40 static decltype(auto) getEntry(VV&& v, const Index&)
│ │ │ -
41 {
│ │ │ -
42 return std::forward<VV>(v);
│ │ │ -
43 }
│ │ │ -
44
│ │ │ -
45 template<class VV,
│ │ │ -
46 std::enable_if_t< models<Concept::HasSizeMethod, VV>(), int> = 0>
│ │ │ -
47 static auto size(VV&& v)
│ │ │ -
48 {
│ │ │ -
49 return Dune::Hybrid::size(v);
│ │ │ -
50 }
│ │ │ -
51
│ │ │ -
52 template<class VV,
│ │ │ -
53 std::enable_if_t< not models<Concept::HasSizeMethod, VV>(), int>type = 0>
│ │ │ -
54 static auto size(VV&&)
│ │ │ -
55 {
│ │ │ -
56 return Dune::index_constant<1>{};
│ │ │ -
57 }
│ │ │ -
58};
│ │ │ -
59
│ │ │ -
60
│ │ │ -
61
│ │ │ -
62
│ │ │ -
63template<class K, int n, int m>
│ │ │ -
64struct FlatVectorBackend<typename Dune::FieldMatrix<K, n, m> >
│ │ │ -
65{
│ │ │ -
66
│ │ │ -
67 template<class VV, class Index>
│ │ │ -
68 static decltype(auto) getEntry(VV&& v, const Index& i)
│ │ │ -
69 {
│ │ │ -
70 return v[i/m][i%m];
│ │ │ -
71 }
│ │ │ -
72
│ │ │ -
73 template<class VV>
│ │ │ -
74 static auto size(VV&& v)
│ │ │ -
75 {
│ │ │ -
76 return Dune::index_constant<n*m>{};
│ │ │ -
77 }
│ │ │ -
78};
│ │ │ -
79
│ │ │ -
80
│ │ │ -
81
│ │ │ -
82template<class K, std::size_t n>
│ │ │ -
83struct FlatVectorBackend< std::array<K, n> >
│ │ │ -
84{
│ │ │ -
85
│ │ │ -
86 template<class VV, class Index>
│ │ │ -
87 static decltype(auto) getEntry(VV&& v, const Index& i)
│ │ │ -
88 {
│ │ │ -
89 const auto innerSize = decltype(FlatVectorBackend<K>::size(v[0]))::value;
│ │ │ -
90 return FlatVectorBackend<K>::getEntry(v[i/innerSize], i%innerSize);
│ │ │ -
91 }
│ │ │ -
92
│ │ │ -
93 template<class VV>
│ │ │ -
94 static auto size(VV&& v)
│ │ │ -
95 {
│ │ │ -
96 const auto innerSize = decltype(FlatVectorBackend<K>::size(v[0]))::value;
│ │ │ -
97 return Dune::index_constant<n*innerSize>{};
│ │ │ -
98 }
│ │ │ -
99
│ │ │ -
100};
│ │ │ -
101
│ │ │ -
102
│ │ │ -
103
│ │ │ -
104
│ │ │ -
105template<class T>
│ │ │ -
106class FlatVectorView
│ │ │ -
107{
│ │ │ -
108 using Backend = FlatVectorBackend<std::decay_t<T>>;
│ │ │ -
109public:
│ │ │ -
110 FlatVectorView(T& t) :
│ │ │ -
111 t_(&t)
│ │ │ -
112 {}
│ │ │ -
113
│ │ │ -
114 auto size() const
│ │ │ -
115 {
│ │ │ -
116 return Backend::size(*t_);
│ │ │ -
117 }
│ │ │ -
118
│ │ │ -
119 template<class Index>
│ │ │ -
120 decltype(auto) operator[](const Index& i) const
│ │ │ -
121 {
│ │ │ -
122 return Backend::getEntry(*t_, i);
│ │ │ -
123 }
│ │ │ -
124
│ │ │ -
125 template<class Index>
│ │ │ -
126 decltype(auto) operator[](const Index& i)
│ │ │ +
27namespace Imp {
│ │ │ +
28
│ │ │ +
29template<class Signature, class GV, class FLocal, template<class> class DerivativeTraits=DefaultDerivativeTraits>
│ │ │ +
30class LocalAnalyticGridViewFunction;
│ │ │ +
31
│ │ │ +
32template<class Range, class LocalDomain, class GV, class F, template<class> class DerivativeTraits>
│ │ │ +
33class LocalAnalyticGridViewFunction<Range(LocalDomain), GV, F, DerivativeTraits>
│ │ │ +
34{
│ │ │ +
35public:
│ │ │ +
36 using Signature = Range(LocalDomain);
│ │ │ +
37 using RawSignature = typename SignatureTraits<Signature>::RawSignature;
│ │ │ +
38 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(LocalDomain);
│ │ │ +
39
│ │ │ +
40 using GridView = GV;
│ │ │ +
41 using EntitySet = GridViewEntitySet<GridView, 0>;
│ │ │ +
42 using Element = typename EntitySet::Element;
│ │ │ +
43// using Geometry = typename Element::Geometry;
│ │ │ +
44 using Geometry = std::decay_t<typename Element::Geometry>;
│ │ │ +
45
│ │ │ +
46 // Use the indirection via derivativeIfImplemented to also support
│ │ │ +
47 // function types F that do not implement derivative. In this case
│ │ │ +
48 // the interface type DifferentiableFunction is using a dummy for
│ │ │ +
49 // the derivative type
│ │ │ +
50 using DerivativeDummy = DifferentiableFunction<DerivativeSignature>;
│ │ │ +
51 using GlobalRawDerivative = decltype(Imp::derivativeIfImplemented<DerivativeDummy, F>(std::declval<F>()));
│ │ │ +
52 using LocalDerivative = LocalAnalyticGridViewFunction<DerivativeSignature, GridView, GlobalRawDerivative, DerivativeTraits>;
│ │ │ +
53
│ │ │ +
55 template<class FT, disableCopyMove<LocalAnalyticGridViewFunction, FT> = 0>
│ │ │ +
56 LocalAnalyticGridViewFunction(FT&& f) :
│ │ │ +
57 f_(std::forward<FT>(f))
│ │ │ +
58 {}
│ │ │ +
59
│ │ │ +
61 template<class FT>
│ │ │ +
62 LocalAnalyticGridViewFunction(FT&& f, const Element& element, const std::optional<Geometry>& geometry) :
│ │ │ +
63 f_(std::forward<FT>(f)),
│ │ │ +
64 element_(element),
│ │ │ +
65 geometry_(geometry)
│ │ │ +
66 {}
│ │ │ +
67
│ │ │ +
68
│ │ │ +
77 void bind(const Element& element)
│ │ │ +
78 {
│ │ │ +
79 element_ = element;
│ │ │ +
80 geometry_.emplace(element_.geometry());
│ │ │ +
81 }
│ │ │ +
82
│ │ │ +
84 void unbind()
│ │ │ +
85 {
│ │ │ +
86 geometry_.reset();
│ │ │ +
87 }
│ │ │ +
88
│ │ │ +
91 bool bound() const
│ │ │ +
92 {
│ │ │ +
93 return static_cast<bool>(geometry_);
│ │ │ +
94 }
│ │ │ +
95
│ │ │ +
105 Range operator()(const LocalDomain& x) const
│ │ │ +
106 {
│ │ │ +
107 assert(!!geometry_);
│ │ │ +
108 return (*f_)(geometry_->global(x));
│ │ │ +
109 }
│ │ │ +
110
│ │ │ +
112 const Element& localContext() const
│ │ │ +
113 {
│ │ │ +
114 assert(!!geometry_);
│ │ │ +
115 return element_;
│ │ │ +
116 }
│ │ │ +
117
│ │ │ +
126 friend LocalDerivative derivative(const LocalAnalyticGridViewFunction& t)
│ │ │
127 {
│ │ │ -
128 return Backend::getEntry(*t_, i);
│ │ │ +
128 return LocalDerivative(Imp::derivativeIfImplemented<DerivativeDummy, F>(*t.f_), t.element_, t.geometry_);
│ │ │
129 }
│ │ │
130
│ │ │
131private:
│ │ │ -
132 T* t_;
│ │ │ -
133};
│ │ │ -
134
│ │ │ -
135
│ │ │ -
136template<class T>
│ │ │ -
137class FlatVectorView<T&&>
│ │ │ -
138{
│ │ │ -
139 using Backend = FlatVectorBackend<std::decay_t<T>>;
│ │ │ -
140public:
│ │ │ -
141 FlatVectorView(T&& t) :
│ │ │ -
142 t_(std::move(t))
│ │ │ -
143 {}
│ │ │ -
144
│ │ │ -
145 auto size() const
│ │ │ -
146 {
│ │ │ -
147 return Backend::size(t_);
│ │ │ -
148 }
│ │ │ -
149
│ │ │ -
150 template<class Index>
│ │ │ -
151 decltype(auto) operator[](const Index& i) const
│ │ │ -
152 {
│ │ │ -
153 return Backend::getEntry(t_, i);
│ │ │ -
154 }
│ │ │ -
155
│ │ │ -
156 template<class Index>
│ │ │ -
157 decltype(auto) operator[](const Index& i)
│ │ │ -
158 {
│ │ │ -
159 return Backend::getEntry(t_, i);
│ │ │ -
160 }
│ │ │ -
161
│ │ │ -
162private:
│ │ │ -
163 T t_;
│ │ │ -
164};
│ │ │ -
165
│ │ │ -
166} // namespace Impl
│ │ │ -
167
│ │ │ -
168
│ │ │ -
169
│ │ │ -
182template<class T>
│ │ │ -
│ │ │ - │ │ │ -
184{
│ │ │ -
185 return Impl::FlatVectorView<T>(t);
│ │ │ -
186}
│ │ │ -
│ │ │ -
187
│ │ │ -
200template<class T>
│ │ │ -
│ │ │ -
201auto flatVectorView(const T& t)
│ │ │ -
202{
│ │ │ -
203 return Impl::FlatVectorView<const T>(t);
│ │ │ -
204}
│ │ │ -
│ │ │ -
205
│ │ │ -
218template<class T>
│ │ │ -
│ │ │ -
219auto flatVectorView(T&& t)
│ │ │ -
220{
│ │ │ -
221 return Impl::FlatVectorView<T&&>(std::move(t));
│ │ │ -
222}
│ │ │ -
│ │ │ -
223
│ │ │ -
224
│ │ │ -
225} // namespace Dune::Functions
│ │ │ -
226} // namespace Dune
│ │ │ -
227
│ │ │ -
228
│ │ │ -
229#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH
│ │ │ +
132 // Wrap the function into CopyableOptional to make it copy-assignable
│ │ │ +
133 CopyableOptional<F> f_;
│ │ │ +
134 Element element_;
│ │ │ +
135 std::optional<Geometry> geometry_ = std::nullopt;
│ │ │ +
136};
│ │ │ +
137
│ │ │ +
138} // end namespace Imp
│ │ │ +
139
│ │ │ +
140
│ │ │ +
141
│ │ │ +
142
│ │ │ +
143template<class Signature, class GV, class F, template<class> class DerivativeTraits=DefaultDerivativeTraits>
│ │ │ + │ │ │ +
145
│ │ │ +
146
│ │ │ +
152template<class Range, class Domain, class GV, class F, template<class> class DerivativeTraits>
│ │ │ +
│ │ │ +
153class AnalyticGridViewFunction<Range(Domain), GV, F, DerivativeTraits>
│ │ │ +
154{
│ │ │ +
155public:
│ │ │ +
156 using Signature = Range(Domain);
│ │ │ + │ │ │ +
158 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(Domain);
│ │ │ +
159
│ │ │ +
160 using GridView = GV;
│ │ │ + │ │ │ +
162 using Element = typename EntitySet::Element;
│ │ │ +
163 using Geometry = typename Element::Geometry;
│ │ │ +
164
│ │ │ +
165 // Use the indirection via derivativeIfImplemented to also support
│ │ │ +
166 // function types F that do not implement derivative. In this case
│ │ │ +
167 // the interface type DifferentiableFunction is used a dummy for
│ │ │ +
168 // the derivative type
│ │ │ + │ │ │ +
170 using GlobalRawDerivative = decltype(Imp::derivativeIfImplemented<DerivativeDummy, F>(std::declval<F>()));
│ │ │ + │ │ │ +
172
│ │ │ + │ │ │ +
174 using LocalFunction = typename Imp::LocalAnalyticGridViewFunction<Range(LocalDomain), GridView, F, LocalDerivativeTraits<EntitySet, DerivativeTraits>::template Traits>;
│ │ │ +
175
│ │ │ +
177 template<class FT>
│ │ │ +
│ │ │ +
178 AnalyticGridViewFunction(FT&& f, const GridView& gridView) :
│ │ │ +
179 f_(std::forward<FT>(f)),
│ │ │ +
180 entitySet_(gridView)
│ │ │ +
181 {}
│ │ │ +
│ │ │ +
182
│ │ │ +
│ │ │ +
184 Range operator()(const Domain& x) const
│ │ │ +
185 {
│ │ │ +
186 return (*f_)(x);
│ │ │ +
187 }
│ │ │ +
│ │ │ +
188
│ │ │ +
│ │ │ + │ │ │ +
191 {
│ │ │ +
192 return Derivative(Imp::derivativeIfImplemented<DerivativeDummy, F>(*t.f_), t.entitySet_.gridView());
│ │ │ +
193 }
│ │ │ +
│ │ │ +
194
│ │ │ +
│ │ │ + │ │ │ +
197 {
│ │ │ +
198 return LocalFunction(*t.f_);
│ │ │ +
199 }
│ │ │ +
│ │ │ +
200
│ │ │ +
│ │ │ +
202 const EntitySet& entitySet() const
│ │ │ +
203 {
│ │ │ +
204 return entitySet_;
│ │ │ +
205 }
│ │ │ +
│ │ │ +
206
│ │ │ +
207private:
│ │ │ +
208 // Wrap the function into CopyableOptional to make it copy-assignable
│ │ │ +
209 CopyableOptional<F> f_;
│ │ │ +
210 EntitySet entitySet_;
│ │ │ +
211};
│ │ │ +
│ │ │ +
212
│ │ │ +
213// deduction guides
│ │ │ +
214template<class F, class GridView,
│ │ │ +
215 class Domain = typename GridView::template Codim<0>::Geometry::GlobalCoordinate,
│ │ │ +
216 class Range = std::invoke_result_t<F,Domain>>
│ │ │ +
217AnalyticGridViewFunction(const F&, const GridView&)
│ │ │ +
218 -> AnalyticGridViewFunction<Range(Domain), GridView, F>;
│ │ │ +
219
│ │ │ +
220
│ │ │ +
237template<class F, class GridView>
│ │ │ +
│ │ │ +
238auto makeAnalyticGridViewFunction(F&& f, const GridView& gridView)
│ │ │ +
239{
│ │ │ +
240 using Domain = typename GridView::template Codim<0>::Geometry::GlobalCoordinate;
│ │ │ +
241 using Range = std::invoke_result_t<F, Domain>;
│ │ │ +
242 using FRaw = std::decay_t<F>;
│ │ │ +
243
│ │ │ +
244 return AnalyticGridViewFunction<Range(Domain), GridView, FRaw>(std::forward<F>(f), gridView);
│ │ │ +
245}
│ │ │ +
│ │ │ +
246
│ │ │ +
247
│ │ │ +
248
│ │ │ +
249}} // namespace Dune::Functions
│ │ │ +
250
│ │ │ +
251
│ │ │ +
252
│ │ │ +
253#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
Obtain derivative of TrigonometricFunction function.
Definition trigonometricfunction.hh:43
│ │ │ +
auto makeAnalyticGridViewFunction(F &&f, const GridView &gridView)
Create an AnalyticGridViewFunction from a function and a grid view.
Definition analyticgridviewfunction.hh:238
│ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
auto flatVectorView(T &t)
Create flat vector view of passed mutable container.
Definition flatvectorview.hh:183
│ │ │ - │ │ │ +
AnalyticGridViewFunction(const F &, const GridView &) -> AnalyticGridViewFunction< Range(Domain), GridView, F >
│ │ │ +
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:41
│ │ │ +
Definition differentiablefunction.hh:33
│ │ │ +
Helper class to deduce the signature of a callable.
Definition signature.hh:60
│ │ │ +
Definition analyticgridviewfunction.hh:144
│ │ │ +
Range operator()(const Domain &x) const
Evaluate the wrapped function f directly in global coordinates x.
Definition analyticgridviewfunction.hh:184
│ │ │ +
typename EntitySet::LocalCoordinate LocalDomain
Definition analyticgridviewfunction.hh:173
│ │ │ +
friend Derivative derivative(const AnalyticGridViewFunction &t)
Create a derivative grid-function by wrapping the derivative of f.
Definition analyticgridviewfunction.hh:190
│ │ │ +
typename Element::Geometry Geometry
Definition analyticgridviewfunction.hh:163
│ │ │ +
typename EntitySet::Element Element
Definition analyticgridviewfunction.hh:162
│ │ │ + │ │ │ +
decltype(Imp::derivativeIfImplemented< DerivativeDummy, F >(std::declval< F >())) GlobalRawDerivative
Definition analyticgridviewfunction.hh:170
│ │ │ +
DifferentiableFunction< DerivativeSignature > DerivativeDummy
Definition analyticgridviewfunction.hh:169
│ │ │ +
Range(Domain) Signature
Definition analyticgridviewfunction.hh:156
│ │ │ +
AnalyticGridViewFunction(FT &&f, const GridView &gridView)
Create the grid-function by wrapping a function f and create a GridViewEntitySet.
Definition analyticgridviewfunction.hh:178
│ │ │ +
friend LocalFunction localFunction(const AnalyticGridViewFunction &t)
Construct the associated local-function.
Definition analyticgridviewfunction.hh:196
│ │ │ +
typename Imp::LocalAnalyticGridViewFunction< Range(LocalDomain), GridView, F, LocalDerivativeTraits< EntitySet, DerivativeTraits >::template Traits > LocalFunction
Definition analyticgridviewfunction.hh:174
│ │ │ +
typename SignatureTraits< Signature >::RawSignature RawSignature
Definition analyticgridviewfunction.hh:157
│ │ │ +
GridViewEntitySet< GridView, 0 > EntitySet
Definition analyticgridviewfunction.hh:161
│ │ │ +
const EntitySet & entitySet() const
Return the set of entities this local-function can be bound to.
Definition analyticgridviewfunction.hh:202
│ │ │ +
typename DerivativeTraits< RawSignature >::Range(Domain) DerivativeSignature
Definition analyticgridviewfunction.hh:158
│ │ │ +
AnalyticGridViewFunction< DerivativeSignature, GridView, GlobalRawDerivative, DerivativeTraits > Derivative
Definition analyticgridviewfunction.hh:171
│ │ │ +
An entity set for all entities of given codim in a grid view.
Definition gridviewentityset.hh:27
│ │ │ +
GridView::template Codim< codim >::Entity Element
Definition gridviewentityset.hh:36
│ │ │ +
Element::Geometry::LocalCoordinate LocalCoordinate
Definition gridviewentityset.hh:39
│ │ │ +
Derivative traits for local functions.
Definition localderivativetraits.hh:32
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,216 +1,350 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -flatvectorview.hh │ │ │ │ +analyticgridviewfunction.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH │ │ │ │ +8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH │ │ │ │ 9 │ │ │ │ -10 │ │ │ │ -11#include │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ 12 │ │ │ │ -13#include │ │ │ │ -14#include │ │ │ │ -15#include │ │ │ │ -16 │ │ │ │ -17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ -18 │ │ │ │ -19 │ │ │ │ -20 │ │ │ │ -21 │ │ │ │ -22namespace _D_u_n_e { │ │ │ │ -23namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -24namespace Impl { │ │ │ │ -25 │ │ │ │ +13#include │ │ │ │ +14#include │ │ │ │ +15 │ │ │ │ +16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_s_i_g_n_a_t_u_r_e_._h_h> │ │ │ │ +17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ +18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n___i_m_p_._h_h> │ │ │ │ +19#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +20#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h> │ │ │ │ +21#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_l_o_c_a_l_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ +22 │ │ │ │ +23 │ │ │ │ +24namespace _D_u_n_e { │ │ │ │ +25namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ 26 │ │ │ │ -27template │ │ │ │ -28struct FlatVectorBackend │ │ │ │ -29{ │ │ │ │ -30 │ │ │ │ -31 template(), int> = 0> │ │ │ │ -33 static decltype(auto) getEntry(VV&& v, const Index& i) │ │ │ │ -34 { │ │ │ │ -35 return v[i]; │ │ │ │ -36 } │ │ │ │ -37 │ │ │ │ -38 template(), int> = │ │ │ │ -0> │ │ │ │ -40 static decltype(auto) getEntry(VV&& v, const Index&) │ │ │ │ -41 { │ │ │ │ -42 return std::forward(v); │ │ │ │ -43 } │ │ │ │ -44 │ │ │ │ -45 template(), int> = 0> │ │ │ │ -47 static auto size(VV&& v) │ │ │ │ -48 { │ │ │ │ -49 return Dune::Hybrid::size(v); │ │ │ │ -50 } │ │ │ │ -51 │ │ │ │ -52 template(), int>type = 0> │ │ │ │ -54 static auto size(VV&&) │ │ │ │ -55 { │ │ │ │ -56 return Dune::index_constant<1>{}; │ │ │ │ -57 } │ │ │ │ -58}; │ │ │ │ +27namespace Imp { │ │ │ │ +28 │ │ │ │ +29template class │ │ │ │ +DerivativeTraits=DefaultDerivativeTraits> │ │ │ │ +30class LocalAnalyticGridViewFunction; │ │ │ │ +31 │ │ │ │ +32template │ │ │ │ +class DerivativeTraits> │ │ │ │ +33class LocalAnalyticGridViewFunction │ │ │ │ +34{ │ │ │ │ +35public: │ │ │ │ +36 using Signature = Range(LocalDomain); │ │ │ │ +37 using RawSignature = typename SignatureTraits::RawSignature; │ │ │ │ +38 using DerivativeSignature = typename DerivativeTraits::Range │ │ │ │ +(LocalDomain); │ │ │ │ +39 │ │ │ │ +40 using GridView = GV; │ │ │ │ +41 using EntitySet = GridViewEntitySet; │ │ │ │ +42 using Element = typename EntitySet::Element; │ │ │ │ +43// using Geometry = typename Element::Geometry; │ │ │ │ +44 using Geometry = std::decay_t; │ │ │ │ +45 │ │ │ │ +46 // Use the indirection via derivativeIfImplemented to also support │ │ │ │ +47 // function types F that do not implement derivative. In this case │ │ │ │ +48 // the interface type DifferentiableFunction is using a dummy for │ │ │ │ +49 // the derivative type │ │ │ │ +50 using DerivativeDummy = DifferentiableFunction; │ │ │ │ +51 using GlobalRawDerivative = decltype(Imp:: │ │ │ │ +derivativeIfImplemented(std::declval())); │ │ │ │ +52 using LocalDerivative = LocalAnalyticGridViewFunction; │ │ │ │ +53 │ │ │ │ +55 template = 0> │ │ │ │ +56 LocalAnalyticGridViewFunction(FT&& f) : │ │ │ │ +57 f_(std::forward(f)) │ │ │ │ +58 {} │ │ │ │ 59 │ │ │ │ -60 │ │ │ │ -61 │ │ │ │ -62 │ │ │ │ -63template │ │ │ │ -64struct FlatVectorBackend > │ │ │ │ -65{ │ │ │ │ -66 │ │ │ │ -67 template │ │ │ │ -68 static decltype(auto) getEntry(VV&& v, const Index& i) │ │ │ │ -69 { │ │ │ │ -70 return v[i/m][i%m]; │ │ │ │ -71 } │ │ │ │ -72 │ │ │ │ -73 template │ │ │ │ -74 static auto size(VV&& v) │ │ │ │ -75 { │ │ │ │ -76 return Dune::index_constant{}; │ │ │ │ -77 } │ │ │ │ -78}; │ │ │ │ -79 │ │ │ │ -80 │ │ │ │ -81 │ │ │ │ -82template │ │ │ │ -83struct FlatVectorBackend< std::array > │ │ │ │ -84{ │ │ │ │ -85 │ │ │ │ -86 template │ │ │ │ -87 static decltype(auto) getEntry(VV&& v, const Index& i) │ │ │ │ -88 { │ │ │ │ -89 const auto innerSize = decltype(FlatVectorBackend::size(v[0]))::value; │ │ │ │ -90 return FlatVectorBackend::getEntry(v[i/innerSize], i%innerSize); │ │ │ │ -91 } │ │ │ │ -92 │ │ │ │ -93 template │ │ │ │ -94 static auto size(VV&& v) │ │ │ │ -95 { │ │ │ │ -96 const auto innerSize = decltype(FlatVectorBackend::size(v[0]))::value; │ │ │ │ -97 return Dune::index_constant{}; │ │ │ │ -98 } │ │ │ │ -99 │ │ │ │ -100}; │ │ │ │ -101 │ │ │ │ -102 │ │ │ │ -103 │ │ │ │ -104 │ │ │ │ -105template │ │ │ │ -106class FlatVectorView │ │ │ │ -107{ │ │ │ │ -108 using Backend = FlatVectorBackend>; │ │ │ │ -109public: │ │ │ │ -110 FlatVectorView(T& t) : │ │ │ │ -111 t_(&t) │ │ │ │ -112 {} │ │ │ │ -113 │ │ │ │ -114 auto size() const │ │ │ │ -115 { │ │ │ │ -116 return Backend::size(*t_); │ │ │ │ -117 } │ │ │ │ -118 │ │ │ │ -119 template │ │ │ │ -120 decltype(auto) operator[](const Index& i) const │ │ │ │ -121 { │ │ │ │ -122 return Backend::getEntry(*t_, i); │ │ │ │ -123 } │ │ │ │ -124 │ │ │ │ -125 template │ │ │ │ -126 decltype(auto) operator[](const Index& i) │ │ │ │ +61 template │ │ │ │ +62 LocalAnalyticGridViewFunction(FT&& f, const Element& element, const std:: │ │ │ │ +optional& geometry) : │ │ │ │ +63 f_(std::forward(f)), │ │ │ │ +64 element_(element), │ │ │ │ +65 geometry_(geometry) │ │ │ │ +66 {} │ │ │ │ +67 │ │ │ │ +68 │ │ │ │ +77 void bind(const Element& element) │ │ │ │ +78 { │ │ │ │ +79 element_ = element; │ │ │ │ +80 geometry_.emplace(element_.geometry()); │ │ │ │ +81 } │ │ │ │ +82 │ │ │ │ +84 void unbind() │ │ │ │ +85 { │ │ │ │ +86 geometry_.reset(); │ │ │ │ +87 } │ │ │ │ +88 │ │ │ │ +91 bool bound() const │ │ │ │ +92 { │ │ │ │ +93 return static_cast(geometry_); │ │ │ │ +94 } │ │ │ │ +95 │ │ │ │ +105 Range operator()(const LocalDomain& x) const │ │ │ │ +106 { │ │ │ │ +107 assert(!!geometry_); │ │ │ │ +108 return (*f_)(geometry_->global(x)); │ │ │ │ +109 } │ │ │ │ +110 │ │ │ │ +112 const Element& localContext() const │ │ │ │ +113 { │ │ │ │ +114 assert(!!geometry_); │ │ │ │ +115 return element_; │ │ │ │ +116 } │ │ │ │ +117 │ │ │ │ +126 friend LocalDerivative _d_e_r_i_v_a_t_i_v_e(const LocalAnalyticGridViewFunction& t) │ │ │ │ 127 { │ │ │ │ -128 return Backend::getEntry(*t_, i); │ │ │ │ +128 return LocalDerivative(Imp::derivativeIfImplemented │ │ │ │ +(*t.f_), t.element_, t.geometry_); │ │ │ │ 129 } │ │ │ │ 130 │ │ │ │ 131private: │ │ │ │ -132 T* t_; │ │ │ │ -133}; │ │ │ │ -134 │ │ │ │ -135 │ │ │ │ -136template │ │ │ │ -137class FlatVectorView │ │ │ │ -138{ │ │ │ │ -139 using Backend = FlatVectorBackend>; │ │ │ │ -140public: │ │ │ │ -141 FlatVectorView(T&& t) : │ │ │ │ -142 t_(std::move(t)) │ │ │ │ -143 {} │ │ │ │ -144 │ │ │ │ -145 auto size() const │ │ │ │ -146 { │ │ │ │ -147 return Backend::size(t_); │ │ │ │ -148 } │ │ │ │ -149 │ │ │ │ -150 template │ │ │ │ -151 decltype(auto) operator[](const Index& i) const │ │ │ │ -152 { │ │ │ │ -153 return Backend::getEntry(t_, i); │ │ │ │ -154 } │ │ │ │ -155 │ │ │ │ -156 template │ │ │ │ -157 decltype(auto) operator[](const Index& i) │ │ │ │ -158 { │ │ │ │ -159 return Backend::getEntry(t_, i); │ │ │ │ -160 } │ │ │ │ -161 │ │ │ │ -162private: │ │ │ │ -163 T t_; │ │ │ │ -164}; │ │ │ │ -165 │ │ │ │ -166} // namespace Impl │ │ │ │ -167 │ │ │ │ -168 │ │ │ │ -169 │ │ │ │ -182template │ │ │ │ -_1_8_3auto _f_l_a_t_V_e_c_t_o_r_V_i_e_w(T& t) │ │ │ │ -184{ │ │ │ │ -185 return Impl::FlatVectorView(t); │ │ │ │ -186} │ │ │ │ -187 │ │ │ │ -200template │ │ │ │ -_2_0_1auto _f_l_a_t_V_e_c_t_o_r_V_i_e_w(const T& t) │ │ │ │ -202{ │ │ │ │ -203 return Impl::FlatVectorView(t); │ │ │ │ -204} │ │ │ │ -205 │ │ │ │ -218template │ │ │ │ -_2_1_9auto _f_l_a_t_V_e_c_t_o_r_V_i_e_w(T&& t) │ │ │ │ -220{ │ │ │ │ -221 return Impl::FlatVectorView(std::move(t)); │ │ │ │ -222} │ │ │ │ -223 │ │ │ │ -224 │ │ │ │ -225} // namespace Dune::Functions │ │ │ │ -226} // namespace Dune │ │ │ │ -227 │ │ │ │ -228 │ │ │ │ -229#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH │ │ │ │ +132 // Wrap the function into CopyableOptional to make it copy-assignable │ │ │ │ +133 CopyableOptional f_; │ │ │ │ +134 Element element_; │ │ │ │ +135 std::optional geometry_ = std::nullopt; │ │ │ │ +136}; │ │ │ │ +137 │ │ │ │ +138} // end namespace Imp │ │ │ │ +139 │ │ │ │ +140 │ │ │ │ +141 │ │ │ │ +142 │ │ │ │ +143template class │ │ │ │ +DerivativeTraits=_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s> │ │ │ │ +_1_4_4class _A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n; │ │ │ │ +145 │ │ │ │ +146 │ │ │ │ +152template class │ │ │ │ +DerivativeTraits> │ │ │ │ +_1_5_3class _A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ +154{ │ │ │ │ +155public: │ │ │ │ +_1_5_6 using _S_i_g_n_a_t_u_r_e = Range(Domain); │ │ │ │ +_1_5_7 using _R_a_w_S_i_g_n_a_t_u_r_e = typename _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s_<_S_i_g_n_a_t_u_r_e_>_:_:_R_a_w_S_i_g_n_a_t_u_r_e; │ │ │ │ +_1_5_8 using _D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e = typename DerivativeTraits::Range │ │ │ │ +(Domain); │ │ │ │ +159 │ │ │ │ +_1_6_0 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ +_1_6_1 using _E_n_t_i_t_y_S_e_t = _G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_G_r_i_d_V_i_e_w_,_ _0_>; │ │ │ │ +_1_6_2 using _E_l_e_m_e_n_t = typename _E_n_t_i_t_y_S_e_t_:_:_E_l_e_m_e_n_t; │ │ │ │ +_1_6_3 using _G_e_o_m_e_t_r_y = typename Element::Geometry; │ │ │ │ +164 │ │ │ │ +165 // Use the indirection via derivativeIfImplemented to also support │ │ │ │ +166 // function types F that do not implement derivative. In this case │ │ │ │ +167 // the interface type DifferentiableFunction is used a dummy for │ │ │ │ +168 // the derivative type │ │ │ │ +_1_6_9 using _D_e_r_i_v_a_t_i_v_e_D_u_m_m_y = _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_<_D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e_>; │ │ │ │ +_1_7_0 using _G_l_o_b_a_l_R_a_w_D_e_r_i_v_a_t_i_v_e = decltype(Imp:: │ │ │ │ +derivativeIfImplemented(std::declval())); │ │ │ │ +_1_7_1 using _D_e_r_i_v_a_t_i_v_e = _A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e_,_ _G_r_i_d_V_i_e_w_, │ │ │ │ +_G_l_o_b_a_l_R_a_w_D_e_r_i_v_a_t_i_v_e_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_>; │ │ │ │ +172 │ │ │ │ +_1_7_3 using _L_o_c_a_l_D_o_m_a_i_n = typename _E_n_t_i_t_y_S_e_t_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e; │ │ │ │ +_1_7_4 using _L_o_c_a_l_F_u_n_c_t_i_o_n = typename Imp::LocalAnalyticGridViewFunction_:_:_t_e_m_p_l_a_t_e Traits>; │ │ │ │ +175 │ │ │ │ +177 template │ │ │ │ +_1_7_8 _A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n(FT&& f, const _G_r_i_d_V_i_e_w& gridView) : │ │ │ │ +179 f_(std::forward(f)), │ │ │ │ +180 entitySet_(gridView) │ │ │ │ +181 {} │ │ │ │ +182 │ │ │ │ +_1_8_4 Range _o_p_e_r_a_t_o_r_(_)(const Domain& x) const │ │ │ │ +185 { │ │ │ │ +186 return (*f_)(x); │ │ │ │ +187 } │ │ │ │ +188 │ │ │ │ +_1_9_0 friend _D_e_r_i_v_a_t_i_v_e _d_e_r_i_v_a_t_i_v_e(const _A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n& t) │ │ │ │ +191 { │ │ │ │ +192 return _D_e_r_i_v_a_t_i_v_e(Imp::derivativeIfImplemented(*t.f_), │ │ │ │ +t.entitySet_.gridView()); │ │ │ │ +193 } │ │ │ │ +194 │ │ │ │ +_1_9_6 friend _L_o_c_a_l_F_u_n_c_t_i_o_n _l_o_c_a_l_F_u_n_c_t_i_o_n(const _A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n& t) │ │ │ │ +197 { │ │ │ │ +198 return _L_o_c_a_l_F_u_n_c_t_i_o_n(*t.f_); │ │ │ │ +199 } │ │ │ │ +200 │ │ │ │ +_2_0_2 const _E_n_t_i_t_y_S_e_t& _e_n_t_i_t_y_S_e_t() const │ │ │ │ +203 { │ │ │ │ +204 return entitySet_; │ │ │ │ +205 } │ │ │ │ +206 │ │ │ │ +207private: │ │ │ │ +208 // Wrap the function into CopyableOptional to make it copy-assignable │ │ │ │ +209 CopyableOptional f_; │ │ │ │ +210 EntitySet entitySet_; │ │ │ │ +211}; │ │ │ │ +212 │ │ │ │ +213// deduction guides │ │ │ │ +214template::Geometry:: │ │ │ │ +GlobalCoordinate, │ │ │ │ +216 class Range = std::invoke_result_t> │ │ │ │ +_2_1_7_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n(const F&, const GridView&) │ │ │ │ +218 -> _A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n; │ │ │ │ +219 │ │ │ │ +220 │ │ │ │ +237template │ │ │ │ +_2_3_8auto _m_a_k_e_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n(F&& f, const GridView& gridView) │ │ │ │ +239{ │ │ │ │ +240 using Domain = typename GridView::template Codim<0>::Geometry:: │ │ │ │ +GlobalCoordinate; │ │ │ │ +241 using Range = std::invoke_result_t; │ │ │ │ +242 using FRaw = std::decay_t; │ │ │ │ +243 │ │ │ │ +244 return _A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_r_i_d_V_i_e_w_,_ _F_R_a_w_>(std:: │ │ │ │ +forward(f), gridView); │ │ │ │ +245} │ │ │ │ +246 │ │ │ │ +247 │ │ │ │ +248 │ │ │ │ +249}} // namespace Dune::Functions │ │ │ │ +250 │ │ │ │ +251 │ │ │ │ +252 │ │ │ │ +253#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH │ │ │ │ +_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n___i_m_p_._h_h │ │ │ │ +_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h │ │ │ │ +_s_i_g_n_a_t_u_r_e_._h_h │ │ │ │ +_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h │ │ │ │ +_l_o_c_a_l_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h │ │ │ │ +_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ +TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const │ │ │ │ +TrigonometricFunction< K, sinFactor, cosFactor > &f) │ │ │ │ +Obtain derivative of TrigonometricFunction function. │ │ │ │ +DDeeffiinniittiioonn trigonometricfunction.hh:43 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_:_:_m_a_k_e_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ +auto makeAnalyticGridViewFunction(F &&f, const GridView &gridView) │ │ │ │ +Create an AnalyticGridViewFunction from a function and a grid view. │ │ │ │ +DDeeffiinniittiioonn analyticgridviewfunction.hh:238 │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_l_a_t_V_e_c_t_o_r_V_i_e_w │ │ │ │ -auto flatVectorView(T &t) │ │ │ │ -Create flat vector view of passed mutable container. │ │ │ │ -DDeeffiinniittiioonn flatvectorview.hh:183 │ │ │ │ -_c_o_n_c_e_p_t_s_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ +AnalyticGridViewFunction(const F &, const GridView &) - │ │ │ │ +> AnalyticGridViewFunction< Range(Domain), GridView, F > │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ +Default implementation for derivative traits. │ │ │ │ +DDeeffiinniittiioonn defaultderivativetraits.hh:41 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n │ │ │ │ +DDeeffiinniittiioonn differentiablefunction.hh:33 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_g_n_a_t_u_r_e_T_r_a_i_t_s │ │ │ │ +Helper class to deduce the signature of a callable. │ │ │ │ +DDeeffiinniittiioonn signature.hh:60 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ +DDeeffiinniittiioonn analyticgridviewfunction.hh:144 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ +Range operator()(const Domain &x) const │ │ │ │ +Evaluate the wrapped function f directly in global coordinates x. │ │ │ │ +DDeeffiinniittiioonn analyticgridviewfunction.hh:184 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_L_o_c_a_l_D_o_m_a_i_n │ │ │ │ +typename EntitySet::LocalCoordinate LocalDomain │ │ │ │ +DDeeffiinniittiioonn analyticgridviewfunction.hh:173 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ +friend Derivative derivative(const AnalyticGridViewFunction &t) │ │ │ │ +Create a derivative grid-function by wrapping the derivative of f. │ │ │ │ +DDeeffiinniittiioonn analyticgridviewfunction.hh:190 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_G_e_o_m_e_t_r_y │ │ │ │ +typename Element::Geometry Geometry │ │ │ │ +DDeeffiinniittiioonn analyticgridviewfunction.hh:163 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_E_l_e_m_e_n_t │ │ │ │ +typename EntitySet::Element Element │ │ │ │ +DDeeffiinniittiioonn analyticgridviewfunction.hh:162 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_G_r_i_d_V_i_e_w │ │ │ │ +GV GridView │ │ │ │ +DDeeffiinniittiioonn analyticgridviewfunction.hh:160 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_G_l_o_b_a_l_R_a_w_D_e_r_i_v_a_t_i_v_e │ │ │ │ +decltype(Imp::derivativeIfImplemented< DerivativeDummy, F >(std::declval< F > │ │ │ │ +())) GlobalRawDerivative │ │ │ │ +DDeeffiinniittiioonn analyticgridviewfunction.hh:170 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_D_e_r_i_v_a_t_i_v_e_D_u_m_m_y │ │ │ │ +DifferentiableFunction< DerivativeSignature > DerivativeDummy │ │ │ │ +DDeeffiinniittiioonn analyticgridviewfunction.hh:169 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_S_i_g_n_a_t_u_r_e │ │ │ │ +Range(Domain) Signature │ │ │ │ +DDeeffiinniittiioonn analyticgridviewfunction.hh:156 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ +AnalyticGridViewFunction(FT &&f, const GridView &gridView) │ │ │ │ +Create the grid-function by wrapping a function f and create a │ │ │ │ +GridViewEntitySet. │ │ │ │ +DDeeffiinniittiioonn analyticgridviewfunction.hh:178 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_l_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +friend LocalFunction localFunction(const AnalyticGridViewFunction &t) │ │ │ │ +Construct the associated local-function. │ │ │ │ +DDeeffiinniittiioonn analyticgridviewfunction.hh:196 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +typename Imp::LocalAnalyticGridViewFunction< Range(LocalDomain), GridView, F, │ │ │ │ +LocalDerivativeTraits< EntitySet, DerivativeTraits >::template Traits > │ │ │ │ +LocalFunction │ │ │ │ +DDeeffiinniittiioonn analyticgridviewfunction.hh:174 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_R_a_w_S_i_g_n_a_t_u_r_e │ │ │ │ +typename SignatureTraits< Signature >::RawSignature RawSignature │ │ │ │ +DDeeffiinniittiioonn analyticgridviewfunction.hh:157 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_E_n_t_i_t_y_S_e_t │ │ │ │ +GridViewEntitySet< GridView, 0 > EntitySet │ │ │ │ +DDeeffiinniittiioonn analyticgridviewfunction.hh:161 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_e_n_t_i_t_y_S_e_t │ │ │ │ +const EntitySet & entitySet() const │ │ │ │ +Return the set of entities this local-function can be bound to. │ │ │ │ +DDeeffiinniittiioonn analyticgridviewfunction.hh:202 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e │ │ │ │ +typename DerivativeTraits< RawSignature >::Range(Domain) DerivativeSignature │ │ │ │ +DDeeffiinniittiioonn analyticgridviewfunction.hh:158 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_V_,_ _F_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_D_e_r_i_v_a_t_i_v_e │ │ │ │ +AnalyticGridViewFunction< DerivativeSignature, GridView, GlobalRawDerivative, │ │ │ │ +DerivativeTraits > Derivative │ │ │ │ +DDeeffiinniittiioonn analyticgridviewfunction.hh:171 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t │ │ │ │ +An entity set for all entities of given codim in a grid view. │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:27 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_E_l_e_m_e_n_t │ │ │ │ +GridView::template Codim< codim >::Entity Element │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:36 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ +Element::Geometry::LocalCoordinate LocalCoordinate │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:39 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ +Derivative traits for local functions. │ │ │ │ +DDeeffiinniittiioonn localderivativetraits.hh:32 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _f_l_a_t_v_e_c_t_o_r_v_i_e_w_._h_h │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ + * _a_n_a_l_y_t_i_c_g_r_i_d_v_i_e_w_f_u_n_c_t_i_o_n_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00155.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: flatmultiindex.hh File Reference │ │ │ +Dune-Functions: gridfunction.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,45 +88,52 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
flatmultiindex.hh File Reference
│ │ │ +
gridfunction.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <array>
│ │ │ -#include <dune/functions/common/multiindex.hh>
│ │ │ +
#include <type_traits>
│ │ │ +#include <dune/common/typeutilities.hh>
│ │ │ +#include <dune/functions/common/typeerasure.hh>
│ │ │ +#include <dune/functions/common/defaultderivativetraits.hh>
│ │ │ +#include <dune/functions/common/differentiablefunction.hh>
│ │ │ +#include <dune/functions/common/localfunction.hh>
│ │ │ +#include <dune/functions/common/functionconcepts.hh>
│ │ │ +#include <dune/functions/gridfunctions/localderivativetraits.hh>
│ │ │ +#include <dune/functions/gridfunctions/gridfunction_imp.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +

│ │ │ +Classes

class  Dune::Functions::GridFunction< Signature, EntitySet, DerivativeTraits, bufferSize >
class  Dune::Functions::GridFunction< Range(Domain), ES, DerivativeTraits, bufferSize >
 Wrapper class for functions defined on a Grid. More...
│ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │

│ │ │ -Typedefs

template<class size_type>
using Dune::Functions::FlatMultiIndex = StaticMultiIndex<size_type, 1>
 A multi-index class with only one level.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,20 +1,29 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -flatmultiindex.hh File Reference │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_m_u_l_t_i_i_n_d_e_x_._h_h> │ │ │ │ +gridfunction.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e_e_r_a_s_u_r_e_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_l_o_c_a_l_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_l_o_c_a_l_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n___i_m_p_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ +CCllaasssseess │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_F_u_n_c_t_i_o_n_<_ _S_i_g_n_a_t_u_r_e_,_ _E_n_t_i_t_y_S_e_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_, │ │ │ │ + _b_u_f_f_e_r_S_i_z_e_ _> │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_S_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_, │ │ │ │ + _b_u_f_f_e_r_S_i_z_e_ _> │ │ │ │ +  Wrapper class for functions defined on a Grid. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -TTyyppeeddeeffss │ │ │ │ -template │ │ │ │ -using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_l_a_t_M_u_l_t_i_I_n_d_e_x = _S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x │ │ │ │ -  A multi-index class with only one level. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _f_l_a_t_m_u_l_t_i_i_n_d_e_x_._h_h │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00155.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,3 +1,3 @@ │ │ │ │ var a00155 = [ │ │ │ │ - ["Dune::Functions::FlatMultiIndex", "a00313.html#ga00b16008ca43d0a9a3d3cdb756ee5c56", null] │ │ │ │ + ["Dune::Functions::GridFunction< Signature, EntitySet, DerivativeTraits, bufferSize >", "a02254.html", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00155_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: flatmultiindex.hh Source File │ │ │ +Dune-Functions: gridfunction.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,54 +88,189 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
flatmultiindex.hh
│ │ │ +
gridfunction.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH
│ │ │ +
8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH
│ │ │
9
│ │ │ -
10#include <array>
│ │ │ +
10#include <type_traits>
│ │ │
11
│ │ │ - │ │ │ +
12#include <dune/common/typeutilities.hh>
│ │ │
13
│ │ │ -
14namespace Dune {
│ │ │ -
15namespace Functions {
│ │ │ -
16
│ │ │ -
17
│ │ │ -
18
│ │ │ -
34template<class size_type>
│ │ │ - │ │ │ -
36
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
21
│ │ │ +
22
│ │ │ +
23
│ │ │ +
24namespace Dune {
│ │ │ +
25namespace Functions {
│ │ │ +
26
│ │ │ +
27
│ │ │ +
28
│ │ │ +
29/*
│ │ │ +
30 * Default implementation is empty
│ │ │ +
31 * The actual implementation is only given if Signature is an type
│ │ │ +
32 * describing a function signature as Range(Domain).
│ │ │ +
33 */
│ │ │ +
34template<class Signature, class EntitySet, template<class> class DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>
│ │ │ +
│ │ │ + │ │ │ +
36{};
│ │ │ +
│ │ │
37
│ │ │
38
│ │ │ -
39} // end namespace Functions
│ │ │ -
40} // end namespace Dune
│ │ │ -
41
│ │ │ -
42#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH
│ │ │ - │ │ │ -
StaticMultiIndex< size_type, 1 > FlatMultiIndex
A multi-index class with only one level.
Definition flatmultiindex.hh:35
│ │ │ +
39
│ │ │ +
40namespace Imp
│ │ │ +
41{
│ │ │ +
42
│ │ │ +
44 template<class S, class ES, template<class> class DerivativeTraits, size_t bufferSize>
│ │ │ +
45 struct GridFunctionTraits :
│ │ │ +
46 DifferentiableFunctionTraits<S, DerivativeTraits, bufferSize>
│ │ │ +
47 {
│ │ │ +
48 protected:
│ │ │ +
49 using Base=DifferentiableFunctionTraits<S, DerivativeTraits, bufferSize>;
│ │ │ +
50
│ │ │ +
51 public:
│ │ │ +
53 using EntitySet = ES;
│ │ │ +
54
│ │ │ +
56 using Element = typename EntitySet::Element;
│ │ │ +
57
│ │ │ +
59 using DerivativeSignature = typename Base::DerivativeSignature;
│ │ │ +
60
│ │ │ + │ │ │ +
63
│ │ │ +
65 using LocalSignature = typename Base::Range(typename EntitySet::LocalCoordinate);
│ │ │ +
66
│ │ │ +
68 template<class R>
│ │ │ + │ │ │ +
70
│ │ │ +
72 using LocalFunctionTraits = typename Dune::Functions::Imp::LocalFunctionTraits<LocalSignature, Element, LocalDerivativeTraits, bufferSize>;
│ │ │ +
73
│ │ │ + │ │ │ +
76
│ │ │ +
78 using Concept = GridFunctionWrapperInterface<S, DerivativeInterface, LocalFunctionInterface, ES>;
│ │ │ +
79
│ │ │ +
81 template<class B>
│ │ │ +
82 using Model = GridFunctionWrapperImplementation<S, DerivativeInterface, LocalFunctionInterface, ES, B>;
│ │ │ +
83 };
│ │ │ +
84}
│ │ │ +
85
│ │ │ +
86
│ │ │ +
87
│ │ │ +
99template<class Range, class Domain, class ES, template<class> class DerivativeTraits, size_t bufferSize>
│ │ │ +
│ │ │ +
100class GridFunction<Range(Domain), ES, DerivativeTraits, bufferSize> :
│ │ │ +
101 public TypeErasureBase<
│ │ │ +
102 typename Imp::GridFunctionTraits<Range(Domain), ES, DerivativeTraits, bufferSize>::Concept,
│ │ │ +
103 Imp::GridFunctionTraits<Range(Domain), ES, DerivativeTraits, bufferSize>::template Model>
│ │ │ +
104{
│ │ │ +
105 using Traits = Imp::GridFunctionTraits<Range(Domain), ES, DerivativeTraits, bufferSize>;
│ │ │ +
106
│ │ │ + │ │ │ +
108
│ │ │ +
109 using DerivativeInterface = typename Traits::DerivativeInterface;
│ │ │ +
110
│ │ │ +
111 using LocalFunctionInterface = typename Traits::LocalFunctionInterface;
│ │ │ +
112
│ │ │ +
113 using EntitySet = typename Traits::EntitySet;
│ │ │ +
114
│ │ │ +
115public:
│ │ │ +
116
│ │ │ +
128 template<class F, disableCopyMove<GridFunction, F> = 0 >
│ │ │ +
│ │ │ + │ │ │ +
130 Base(std::forward<F>(f))
│ │ │ +
131 {
│ │ │ +
132 static_assert(Dune::Functions::Concept::isGridFunction<F, Range(Domain), EntitySet>(), "Trying to construct a GridFunction from type that does not model the GridFunction concept");
│ │ │ +
133 }
│ │ │ +
│ │ │ +
134
│ │ │ +
135 GridFunction() = default;
│ │ │ +
136
│ │ │ +
│ │ │ +
142 Range operator() (const Domain& x) const
│ │ │ +
143 {
│ │ │ +
144 return this->asInterface().operator()(x);
│ │ │ +
145 }
│ │ │ +
│ │ │ +
146
│ │ │ +
│ │ │ +
155 friend DerivativeInterface derivative(const GridFunction& t)
│ │ │ +
156 {
│ │ │ +
157 return t.asInterface().derivative();
│ │ │ +
158 }
│ │ │ +
│ │ │ +
159
│ │ │ +
│ │ │ +
169 friend LocalFunctionInterface localFunction(const GridFunction& t)
│ │ │ +
170 {
│ │ │ +
171 return t.asInterface().wrappedLocalFunction();
│ │ │ +
172 }
│ │ │ +
│ │ │ +
173
│ │ │ +
│ │ │ +
180 const EntitySet& entitySet() const
│ │ │ +
181 {
│ │ │ +
182 return this->asInterface().wrappedEntitySet();
│ │ │ +
183 }
│ │ │ +
│ │ │ +
184};
│ │ │ +
│ │ │ +
185
│ │ │ +
186
│ │ │ +
187
│ │ │ +
188}} // namespace Dune::Functions
│ │ │ +
189
│ │ │ +
190
│ │ │ +
191
│ │ │ +
192#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
static constexpr bool isGridFunction()
Check if F models the GridFunction concept with given signature and entity set.
Definition functionconcepts.hh:273
│ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
A statically sized MultiIndex type.
Definition multiindex.hh:30
│ │ │ +
Definition backends/concepts.hh:17
│ │ │ +
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:41
│ │ │ +
Definition localfunction.hh:34
│ │ │ + │ │ │ + │ │ │ +
Definition gridfunction.hh:36
│ │ │ +
friend DerivativeInterface derivative(const GridFunction &t)
Get derivative of wrapped function.
Definition gridfunction.hh:155
│ │ │ + │ │ │ +
const EntitySet & entitySet() const
Get associated EntitySet.
Definition gridfunction.hh:180
│ │ │ +
GridFunction(F &&f)
Construct from function.
Definition gridfunction.hh:129
│ │ │ +
friend LocalFunctionInterface localFunction(const GridFunction &t)
Get local function of wrapped function.
Definition gridfunction.hh:169
│ │ │ +
Derivative traits for local functions.
Definition localderivativetraits.hh:32
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,52 +1,222 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -flatmultiindex.hh │ │ │ │ +gridfunction.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH │ │ │ │ +8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ +10#include │ │ │ │ 11 │ │ │ │ -12#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_m_u_l_t_i_i_n_d_e_x_._h_h> │ │ │ │ +12#include │ │ │ │ 13 │ │ │ │ -14namespace _D_u_n_e { │ │ │ │ -15namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -16 │ │ │ │ -17 │ │ │ │ -18 │ │ │ │ -34template │ │ │ │ -_3_5using _F_l_a_t_M_u_l_t_i_I_n_d_e_x = _S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x_<_s_i_z_e___t_y_p_e_,_ _1_>; │ │ │ │ -36 │ │ │ │ +14#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e_e_r_a_s_u_r_e_._h_h> │ │ │ │ +15#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ +16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_l_o_c_a_l_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +19#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_l_o_c_a_l_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ +20#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n___i_m_p_._h_h> │ │ │ │ +21 │ │ │ │ +22 │ │ │ │ +23 │ │ │ │ +24namespace _D_u_n_e { │ │ │ │ +25namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +26 │ │ │ │ +27 │ │ │ │ +28 │ │ │ │ +29/* │ │ │ │ +30 * Default implementation is empty │ │ │ │ +31 * The actual implementation is only given if Signature is an type │ │ │ │ +32 * describing a function signature as Range(Domain). │ │ │ │ +33 */ │ │ │ │ +34template class │ │ │ │ +DerivativeTraits=_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s, size_t bufferSize=56> │ │ │ │ +_3_5class _G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ +36{}; │ │ │ │ 37 │ │ │ │ 38 │ │ │ │ -39} // end namespace Functions │ │ │ │ -40} // end namespace Dune │ │ │ │ -41 │ │ │ │ -42#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH │ │ │ │ -_m_u_l_t_i_i_n_d_e_x_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_l_a_t_M_u_l_t_i_I_n_d_e_x │ │ │ │ -StaticMultiIndex< size_type, 1 > FlatMultiIndex │ │ │ │ -A multi-index class with only one level. │ │ │ │ -DDeeffiinniittiioonn flatmultiindex.hh:35 │ │ │ │ +39 │ │ │ │ +40namespace Imp │ │ │ │ +41{ │ │ │ │ +42 │ │ │ │ +44 template class DerivativeTraits, size_t │ │ │ │ +bufferSize> │ │ │ │ +45 struct GridFunctionTraits : │ │ │ │ +46 DifferentiableFunctionTraits │ │ │ │ +47 { │ │ │ │ +48 protected: │ │ │ │ +49 using Base=DifferentiableFunctionTraits; │ │ │ │ +50 │ │ │ │ +51 public: │ │ │ │ +53 using EntitySet = ES; │ │ │ │ +54 │ │ │ │ +56 using Element = typename EntitySet::Element; │ │ │ │ +57 │ │ │ │ +59 using DerivativeSignature = typename Base::DerivativeSignature; │ │ │ │ +60 │ │ │ │ +62 using DerivativeInterface = _G_r_i_d_F_u_n_c_t_i_o_n_<_D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e_,_ _E_S_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_>; │ │ │ │ +63 │ │ │ │ +65 using LocalSignature = typename Base::Range(typename EntitySet:: │ │ │ │ +LocalCoordinate); │ │ │ │ +66 │ │ │ │ +68 template │ │ │ │ +69 using _L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s = typename _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_: │ │ │ │ +_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_<_E_n_t_i_t_y_S_e_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_>_:_:_t_e_m_p_l_a_t_e Traits; │ │ │ │ +70 │ │ │ │ +72 using LocalFunctionTraits = typename Dune::Functions::Imp:: │ │ │ │ +LocalFunctionTraits; │ │ │ │ +73 │ │ │ │ +75 using LocalFunctionInterface = _L_o_c_a_l_F_u_n_c_t_i_o_n_<_L_o_c_a_l_S_i_g_n_a_t_u_r_e_,_ _E_l_e_m_e_n_t_, │ │ │ │ +_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_>; │ │ │ │ +76 │ │ │ │ +78 using _C_o_n_c_e_p_t = GridFunctionWrapperInterface; │ │ │ │ +79 │ │ │ │ +81 template │ │ │ │ +82 using Model = GridFunctionWrapperImplementation; │ │ │ │ +83 }; │ │ │ │ +84} │ │ │ │ +85 │ │ │ │ +86 │ │ │ │ +87 │ │ │ │ +99template class │ │ │ │ +DerivativeTraits, size_t bufferSize> │ │ │ │ +_1_0_0class _G_r_i_d_F_u_n_c_t_i_o_n : │ │ │ │ +101 public _T_y_p_e_E_r_a_s_u_r_e_B_a_s_e< │ │ │ │ +102 typename Imp::GridFunctionTraits::Concept, │ │ │ │ +103 Imp::GridFunctionTraits:: │ │ │ │ +template Model> │ │ │ │ +104{ │ │ │ │ +105 using Traits = Imp::GridFunctionTraits; │ │ │ │ +106 │ │ │ │ +107 using Base = _T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_<_t_y_p_e_n_a_m_e_ _T_r_a_i_t_s_:_:_C_o_n_c_e_p_t_,_ _T_r_a_i_t_s_:_:_t_e_m_p_l_a_t_e │ │ │ │ +_M_o_d_e_l_>; │ │ │ │ +108 │ │ │ │ +109 using DerivativeInterface = typename Traits::DerivativeInterface; │ │ │ │ +110 │ │ │ │ +111 using LocalFunctionInterface = typename Traits::LocalFunctionInterface; │ │ │ │ +112 │ │ │ │ +113 using EntitySet = typename Traits::EntitySet; │ │ │ │ +114 │ │ │ │ +115public: │ │ │ │ +116 │ │ │ │ +128 template = 0 > │ │ │ │ +_1_2_9 _G_r_i_d_F_u_n_c_t_i_o_n(F&& f) : │ │ │ │ +130 Base(std::forward(f)) │ │ │ │ +131 { │ │ │ │ +132 static_assert(_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_G_r_i_d_F_u_n_c_t_i_o_n_<_F_,_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ +_E_n_t_i_t_y_S_e_t_>(), "Trying to construct a GridFunction from type that does not model │ │ │ │ +the GridFunction concept"); │ │ │ │ +133 } │ │ │ │ +134 │ │ │ │ +_1_3_5 _G_r_i_d_F_u_n_c_t_i_o_n() = default; │ │ │ │ +136 │ │ │ │ +_1_4_2 Range operator() (const Domain& x) const │ │ │ │ +143 { │ │ │ │ +144 return this->_a_s_I_n_t_e_r_f_a_c_e().operator()(x); │ │ │ │ +145 } │ │ │ │ +146 │ │ │ │ +_1_5_5 friend DerivativeInterface _d_e_r_i_v_a_t_i_v_e(const _G_r_i_d_F_u_n_c_t_i_o_n& t) │ │ │ │ +156 { │ │ │ │ +157 return t.asInterface().derivative(); │ │ │ │ +158 } │ │ │ │ +159 │ │ │ │ +_1_6_9 friend LocalFunctionInterface _l_o_c_a_l_F_u_n_c_t_i_o_n(const _G_r_i_d_F_u_n_c_t_i_o_n& t) │ │ │ │ +170 { │ │ │ │ +171 return t.asInterface().wrappedLocalFunction(); │ │ │ │ +172 } │ │ │ │ +173 │ │ │ │ +_1_8_0 const EntitySet& _e_n_t_i_t_y_S_e_t() const │ │ │ │ +181 { │ │ │ │ +182 return this->_a_s_I_n_t_e_r_f_a_c_e().wrappedEntitySet(); │ │ │ │ +183 } │ │ │ │ +184}; │ │ │ │ +185 │ │ │ │ +186 │ │ │ │ +187 │ │ │ │ +188}} // namespace Dune::Functions │ │ │ │ +189 │ │ │ │ +190 │ │ │ │ +191 │ │ │ │ +192#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH │ │ │ │ +_l_o_c_a_l_f_u_n_c_t_i_o_n_._h_h │ │ │ │ +_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h │ │ │ │ +_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h │ │ │ │ +_t_y_p_e_e_r_a_s_u_r_e_._h_h │ │ │ │ +_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h │ │ │ │ +_l_o_c_a_l_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h │ │ │ │ +_g_r_i_d_f_u_n_c_t_i_o_n___i_m_p_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ +static constexpr bool isGridFunction() │ │ │ │ +Check if F models the GridFunction concept with given signature and entity set. │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:273 │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x │ │ │ │ -A statically sized MultiIndex type. │ │ │ │ -DDeeffiinniittiioonn multiindex.hh:30 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t │ │ │ │ +DDeeffiinniittiioonn backends/concepts.hh:17 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ +Default implementation for derivative traits. │ │ │ │ +DDeeffiinniittiioonn defaultderivativetraits.hh:41 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +DDeeffiinniittiioonn localfunction.hh:34 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_<_ _I_m_p_:_:_G_r_i_d_F_u_n_c_t_i_o_n_T_r_a_i_t_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_S_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_ _>_:_:_C_o_n_c_e_p_t_,_ _I_m_p_:_:_G_r_i_d_F_u_n_c_t_i_o_n_T_r_a_i_t_s_<_ _R_a_n_g_e │ │ │ │ +_(_D_o_m_a_i_n_)_,_ _E_S_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_ _>_:_:_t_e_m_p_l_a_t_e_ _M_o_d_e_l_ _>_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e │ │ │ │ +TypeErasureBase(T &&t) │ │ │ │ +DDeeffiinniittiioonn typeerasure.hh:174 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_<_ _I_m_p_:_:_G_r_i_d_F_u_n_c_t_i_o_n_T_r_a_i_t_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_S_, │ │ │ │ +_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_ _>_:_:_C_o_n_c_e_p_t_,_ _I_m_p_:_:_G_r_i_d_F_u_n_c_t_i_o_n_T_r_a_i_t_s_<_ _R_a_n_g_e │ │ │ │ +_(_D_o_m_a_i_n_)_,_ _E_S_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_ _>_:_:_t_e_m_p_l_a_t_e_ _M_o_d_e_l_ _>_:_:_a_s_I_n_t_e_r_f_a_c_e │ │ │ │ +Imp::GridFunctionTraits< Range(Domain), ES, DerivativeTraits, bufferSize >:: │ │ │ │ +Concept & asInterface() │ │ │ │ +DDeeffiinniittiioonn typeerasure.hh:182 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ +DDeeffiinniittiioonn gridfunction.hh:36 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_S_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e │ │ │ │ +_>_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ +friend DerivativeInterface derivative(const GridFunction &t) │ │ │ │ +Get derivative of wrapped function. │ │ │ │ +DDeeffiinniittiioonn gridfunction.hh:155 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_S_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e │ │ │ │ +_>_:_:_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ +GridFunction()=default │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_S_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e │ │ │ │ +_>_:_:_e_n_t_i_t_y_S_e_t │ │ │ │ +const EntitySet & entitySet() const │ │ │ │ +Get associated EntitySet. │ │ │ │ +DDeeffiinniittiioonn gridfunction.hh:180 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_S_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e │ │ │ │ +_>_:_:_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ +GridFunction(F &&f) │ │ │ │ +Construct from function. │ │ │ │ +DDeeffiinniittiioonn gridfunction.hh:129 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_S_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e │ │ │ │ +_>_:_:_l_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ +friend LocalFunctionInterface localFunction(const GridFunction &t) │ │ │ │ +Get local function of wrapped function. │ │ │ │ +DDeeffiinniittiioonn gridfunction.hh:169 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ +Derivative traits for local functions. │ │ │ │ +DDeeffiinniittiioonn localderivativetraits.hh:32 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _f_l_a_t_m_u_l_t_i_i_n_d_e_x_._h_h │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00158.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: dynamicpowerbasis.hh File Reference │ │ │ +Dune-Functions: gridfunction_imp.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,62 +88,40 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
dynamicpowerbasis.hh File Reference
│ │ │ +
gridfunction_imp.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <dune/common/reservedvector.hh>
│ │ │ -#include <dune/common/typeutilities.hh>
│ │ │ -#include <dune/common/indices.hh>
│ │ │ -#include <dune/common/typetree/nodeconcepts.hh>
│ │ │ -#include <dune/functions/common/utility.hh>
│ │ │ -#include <dune/functions/common/type_traits.hh>
│ │ │ -#include <dune/functions/functionspacebases/basistags.hh>
│ │ │ -#include <dune/functions/functionspacebases/containerdescriptors.hh>
│ │ │ -#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ -#include <dune/functions/functionspacebases/concepts.hh>
│ │ │ + │ │ │

Go to the source code of this file.

│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ -

│ │ │ -Classes

class  Dune::Functions::DynamicPowerPreBasis< IMS, SPB >
 A pre-basis for dynamic power bases. More...
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ -

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::BasisFactory
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │

│ │ │ -Functions

template<class ChildPreBasisFactory, class IndexMergingStrategy>
auto Dune::Functions::BasisFactory::power (ChildPreBasisFactory &&childPreBasisFactory, std::size_t k, const IndexMergingStrategy &)
 Create a pre-basis factory that can build a PowerPreBasis.
template<class ChildPreBasisFactory>
auto Dune::Functions::BasisFactory::power (ChildPreBasisFactory &&childPreBasisFactory, std::size_t k)
 Create a factory builder that can build a PowerPreBasis.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,37 +1,17 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -dynamicpowerbasis.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ +gridfunction_imp.hh File Reference │ │ │ │ #include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_b_a_s_i_s_t_a_g_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_i_n_t_e_r_f_a_c_e_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n___i_m_p_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ -CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_<_ _I_M_S_,_ _S_P_B_ _> │ │ │ │ -  A pre-basis for dynamic power bases. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_p_o_w_e_r (ChildPreBasisFactory │ │ │ │ - &&childPreBasisFactory, std::size_t k, const _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y &) │ │ │ │ -  Create a pre-basis factory that can build a _P_o_w_e_r_P_r_e_B_a_s_i_s. │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_p_o_w_e_r (ChildPreBasisFactory │ │ │ │ - &&childPreBasisFactory, std::size_t k) │ │ │ │ -  Create a factory builder that can build a _P_o_w_e_r_P_r_e_B_a_s_i_s. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _d_y_n_a_m_i_c_p_o_w_e_r_b_a_s_i_s_._h_h │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n___i_m_p_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00158_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: dynamicpowerbasis.hh Source File │ │ │ +Dune-Functions: gridfunction_imp.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,528 +88,98 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
dynamicpowerbasis.hh
│ │ │ +
gridfunction_imp.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DYNAMICPOWERBASIS_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DYNAMICPOWERBASIS_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH
│ │ │ +
8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH
│ │ │
9
│ │ │ -
10#include <dune/common/reservedvector.hh>
│ │ │ -
11#include <dune/common/typeutilities.hh>
│ │ │ -
12#include <dune/common/indices.hh>
│ │ │ + │ │ │ + │ │ │ + │ │ │
13
│ │ │ -
14#include <dune/common/typetree/nodeconcepts.hh>
│ │ │ +
14
│ │ │
15
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
22
│ │ │ -
23
│ │ │ -
24
│ │ │ -
25namespace Dune {
│ │ │ -
26namespace Functions {
│ │ │ -
27
│ │ │ -
28
│ │ │ -
29// *****************************************************************************
│ │ │ -
30// This is the reusable part of the dynamic power bases. It contains
│ │ │ -
31//
│ │ │ -
32// DynamicPowerPreBasis
│ │ │ -
33//
│ │ │ -
34// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ -
35// state. These components do _not_ depend on the global basis and local view
│ │ │ -
36// and can be used without a global basis.
│ │ │ -
37// *****************************************************************************
│ │ │ -
38
│ │ │ -
48template<class IMS, class SPB>
│ │ │ -
│ │ │ - │ │ │ -
50{
│ │ │ -
51 static const bool isBlocked = std::is_same_v<IMS,BasisFactory::BlockedLexicographic> or std::is_same_v<IMS,BasisFactory::BlockedInterleaved>;
│ │ │ -
52
│ │ │ -
53public:
│ │ │ -
54
│ │ │ -
56 using SubPreBasis = SPB;
│ │ │ -
57
│ │ │ -
59 using GridView = typename SPB::GridView;
│ │ │ -
60
│ │ │ -
62 using size_type = std::size_t;
│ │ │ -
63
│ │ │ - │ │ │ -
66
│ │ │ - │ │ │ +
16namespace Dune {
│ │ │ +
17namespace Functions {
│ │ │ +
18namespace Imp {
│ │ │ +
19
│ │ │ +
23struct HasFreeLocalFunction
│ │ │ +
24{
│ │ │ +
25 template<class F>
│ │ │ +
26 auto require(F&& f) -> decltype(
│ │ │ +
27 localFunction(f)
│ │ │ +
28 );
│ │ │ +
29};
│ │ │ +
30
│ │ │ +
31
│ │ │ +
32
│ │ │ +
33// Interface of type erasure wrapper
│ │ │ +
34//
│ │ │ +
35// Notice that the basic interface of polymorphic classes (destructor, clone, ...)
│ │ │ +
36// will be added by the type erasure foundation classes.
│ │ │ +
37template<class Signature, class DerivativeInterface, class LocalFunctionInterface, class EntitySet>
│ │ │ +
38class GridFunctionWrapperInterface :
│ │ │ +
39 public DifferentiableFunctionWrapperInterface<Signature, DerivativeInterface>
│ │ │ +
40{
│ │ │ +
41public:
│ │ │ +
42 virtual LocalFunctionInterface wrappedLocalFunction() const = 0;
│ │ │ +
43
│ │ │ +
44 virtual const EntitySet& wrappedEntitySet() const = 0;
│ │ │ +
45};
│ │ │ +
46
│ │ │ +
47
│ │ │ +
48// Implementation of type erasure wrapper
│ │ │ +
49template<class Signature, class DerivativeInterface, class LocalFunctionInterface, class EntitySet, class B>
│ │ │ +
50class GridFunctionWrapperImplementation :
│ │ │ +
51 public DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>
│ │ │ +
52{
│ │ │ +
53 using Base = DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>;
│ │ │ +
54public:
│ │ │ +
55 using Base::Base;
│ │ │ +
56
│ │ │ +
57 virtual LocalFunctionInterface wrappedLocalFunction() const
│ │ │ +
58 {
│ │ │ +
59 return localFunction(this->get());
│ │ │ +
60 }
│ │ │ +
61
│ │ │ +
62 virtual const EntitySet& wrappedEntitySet() const
│ │ │ +
63 {
│ │ │ +
64 return this->get().entitySet();
│ │ │ +
65 }
│ │ │ +
66};
│ │ │ +
67
│ │ │ +
68
│ │ │
69
│ │ │ -
70 static constexpr size_type maxMultiIndexSize = SubPreBasis::maxMultiIndexSize + isBlocked;
│ │ │ -
71 static constexpr size_type minMultiIndexSize = SubPreBasis::minMultiIndexSize + isBlocked;
│ │ │ -
72 static constexpr size_type multiIndexBufferSize = SubPreBasis::multiIndexBufferSize + isBlocked;
│ │ │ -
73
│ │ │ -
79 template<class... SFArgs,
│ │ │ -
80 disableCopyMove<DynamicPowerPreBasis, SFArgs...> = 0,
│ │ │ -
81 enableIfConstructible<SubPreBasis, SFArgs...> = 0>
│ │ │ -
│ │ │ -
82 explicit DynamicPowerPreBasis(std::size_t c, SFArgs&&... sfArgs) :
│ │ │ -
83 children_(c),
│ │ │ -
84 subPreBasis_(std::forward<SFArgs>(sfArgs)...)
│ │ │ -
85 {
│ │ │ -
86 static_assert(models<Concept::PreBasis<GridView>, SubPreBasis>(), "Subprebasis passed to DynamicPowerPreBasis does not model the PreBasis concept.");
│ │ │ -
87 }
│ │ │ -
│ │ │ -
88
│ │ │ -
│ │ │ - │ │ │ -
91 {
│ │ │ -
92 subPreBasis_.initializeIndices();
│ │ │ -
93 }
│ │ │ -
│ │ │ -
94
│ │ │ -
│ │ │ -
96 const GridView& gridView() const
│ │ │ -
97 {
│ │ │ -
98 return subPreBasis_.gridView();
│ │ │ -
99 }
│ │ │ -
│ │ │ -
100
│ │ │ -
│ │ │ -
102 void update(const GridView& gv)
│ │ │ -
103 {
│ │ │ -
104 subPreBasis_.update(gv);
│ │ │ -
105 }
│ │ │ -
│ │ │ -
106
│ │ │ -
│ │ │ - │ │ │ -
111 {
│ │ │ -
112 auto node = Node{children_};
│ │ │ -
113 for (std::size_t i=0; i<children_; ++i)
│ │ │ -
114 node.setChild(i, subPreBasis_.makeNode());
│ │ │ -
115 return node;
│ │ │ -
116 }
│ │ │ -
│ │ │ -
117
│ │ │ -
│ │ │ -
118 std::size_t children() const
│ │ │ -
119 {
│ │ │ -
120 return children_;
│ │ │ -
121 }
│ │ │ -
│ │ │ -
122
│ │ │ -
│ │ │ - │ │ │ -
125 {
│ │ │ -
126 return size(Dune::ReservedVector<size_type, multiIndexBufferSize>{});
│ │ │ -
127 }
│ │ │ -
│ │ │ -
128
│ │ │ -
130 template<class SizePrefix>
│ │ │ -
│ │ │ -
131 size_type size(const SizePrefix& prefix) const
│ │ │ -
132 {
│ │ │ -
133 return sizeImpl(prefix, children_, IndexMergingStrategy{});
│ │ │ -
134 }
│ │ │ -
│ │ │ -
135
│ │ │ -
136protected:
│ │ │ -
137
│ │ │ -
138 template<class SizePrefix, class Children>
│ │ │ -
│ │ │ -
139 size_type sizeImpl(SizePrefix prefix, Children children, BasisFactory::FlatInterleaved) const
│ │ │ -
140 {
│ │ │ -
141 // The root index size is the root index size of a single subnode
│ │ │ -
142 // multiplied by the number of subnodes, because we enumerate all
│ │ │ -
143 // child indices in a row.
│ │ │ -
144 if (prefix.size() == 0)
│ │ │ -
145 return children*subPreBasis_.size();
│ │ │ -
146
│ │ │ -
147 // The FlatInterleaved index merging strategy only changes the first
│ │ │ -
148 // index digit. Hence, we have to reconstruct the corresponding digit
│ │ │ -
149 // for the subtree and can then return the corresponding size of the subtree.
│ │ │ -
150 prefix[0] = prefix[0] / children;
│ │ │ -
151 return subPreBasis_.size(prefix);
│ │ │ -
152 }
│ │ │ -
│ │ │ -
153
│ │ │ -
154 template<class SizePrefix, class Children>
│ │ │ -
│ │ │ -
155 size_type sizeImpl(SizePrefix prefix, Children children, BasisFactory::FlatLexicographic) const
│ │ │ -
156 {
│ │ │ -
157 // The size at the index tree root is the size of at the index tree
│ │ │ -
158 // root of a single subnode multiplied by the number of subnodes,
│ │ │ -
159 // because we enumerate all child indices in a row.
│ │ │ -
160 if (prefix.size() == 0)
│ │ │ -
161 return children*subPreBasis_.size();
│ │ │ -
162
│ │ │ -
163 // The first prefix entry refers to one of the (root index size)
│ │ │ -
164 // subindex trees. Hence, we have to first compute the corresponding
│ │ │ -
165 // prefix entry for a single subnode subnode. Then we can append
│ │ │ -
166 // the other prefix entries unmodified, because the index tree
│ │ │ -
167 // looks the same after the first level.
│ │ │ -
168
│ │ │ -
169 // The FlatLexicographic index merging strategy only changes the first
│ │ │ -
170 // index digit. Hence, we have to reconstruct the corresponding digit
│ │ │ -
171 // for the subtree and can then return the corresponding size of the subtree.
│ │ │ -
172 prefix[0] = prefix[0] % subPreBasis_.size();
│ │ │ -
173 return subPreBasis_.size(prefix);
│ │ │ -
174 }
│ │ │ -
│ │ │ -
175
│ │ │ -
176 template<class MultiIndex>
│ │ │ -
│ │ │ -
177 static void multiIndexPopFront(MultiIndex& M)
│ │ │ -
178 {
│ │ │ -
179 for(std::size_t i=0; i<M.size()-1; ++i)
│ │ │ -
180 M[i] = M[i+1];
│ │ │ -
181 M.resize(M.size()-1);
│ │ │ -
182 }
│ │ │ -
│ │ │ -
183
│ │ │ -
184 template<class SizePrefix, class Children>
│ │ │ -
│ │ │ - │ │ │ -
186 {
│ │ │ -
187 if (prefix.size() == 0)
│ │ │ -
188 return children;
│ │ │ -
189 multiIndexPopFront(prefix);
│ │ │ -
190 return subPreBasis_.size(prefix);
│ │ │ -
191 }
│ │ │ -
│ │ │ -
192
│ │ │ -
193 template<class SizePrefix, class Children>
│ │ │ -
│ │ │ - │ │ │ -
195 {
│ │ │ -
196 if (prefix.size() == 0)
│ │ │ -
197 return subPreBasis_.size();
│ │ │ -
198
│ │ │ -
199 // Remember last index, remove it and check if the remaining
│ │ │ -
200 // prefix refers to a leaf in the subPreBasis index tree.
│ │ │ -
201 // If yes, then the full prefix must also refer to a
│ │ │ -
202 // leaf in the merged index tree. If not, then restore the full
│ │ │ -
203 // prefix and proceed.
│ │ │ -
204 auto tail = prefix.back();
│ │ │ -
205 prefix.pop_back();
│ │ │ -
206 if (subPreBasis_.size(prefix) == 0)
│ │ │ -
207 return 0;
│ │ │ -
208 prefix.push_back(tail);
│ │ │ -
209
│ │ │ -
210 // Now check if the full prefix refers to a leaf in the subPreBasis
│ │ │ -
211 // index tree.
│ │ │ -
212 // If yes, then it has exactly 'children' appended children in the subtree.
│ │ │ -
213 // If not, then the index tree looks the same in the merged subtree and we
│ │ │ -
214 // can forward the result.
│ │ │ -
215 auto subSize = subPreBasis_.size(prefix);
│ │ │ -
216 if (subSize == 0)
│ │ │ -
217 return children;
│ │ │ -
218 return subSize;
│ │ │ -
219 }
│ │ │ -
│ │ │ -
220
│ │ │ -
221public:
│ │ │ -
222
│ │ │ -
│ │ │ - │ │ │ -
225 {
│ │ │ -
226 return subPreBasis_.dimension() * children_;
│ │ │ -
227 }
│ │ │ -
│ │ │ -
228
│ │ │ -
│ │ │ - │ │ │ -
231 {
│ │ │ -
232 return subPreBasis_.maxNodeSize() * children_;
│ │ │ -
233 }
│ │ │ -
│ │ │ -
234
│ │ │ -
│ │ │ - │ │ │ -
237 {
│ │ │ -
238 return subPreBasis_;
│ │ │ -
239 }
│ │ │ -
│ │ │ -
240
│ │ │ -
│ │ │ - │ │ │ -
243 {
│ │ │ -
244 return subPreBasis_;
│ │ │ -
245 }
│ │ │ -
│ │ │ -
246
│ │ │ -
248 template<class NodeType, typename It>
│ │ │ -
249 requires Dune::TypeTree::Concept::UniformInnerTreeNode<NodeType>
│ │ │ -
│ │ │ -
250 It indices(const NodeType& node, It it) const
│ │ │ -
251 {
│ │ │ -
252 return indicesImpl(node, it, children_, IndexMergingStrategy{});
│ │ │ -
253 }
│ │ │ -
│ │ │ -
254
│ │ │ -
│ │ │ - │ │ │ -
257 {
│ │ │ - │ │ │ -
259 }
│ │ │ -
│ │ │ -
260
│ │ │ -
261protected:
│ │ │ -
262
│ │ │ -
263 template<class NodeType, typename It, class Children>
│ │ │ -
│ │ │ -
264 It indicesImpl(const NodeType& node, It multiIndices, Children children, BasisFactory::FlatInterleaved) const
│ │ │ -
265 {
│ │ │ -
266 using namespace Dune::Indices;
│ │ │ -
267 size_type subTreeSize = node.child(_0).size();
│ │ │ -
268 // Fill indices for first child at the beginning.
│ │ │ -
269 auto next = subPreBasis().indices(node.child(_0), multiIndices);
│ │ │ -
270 // Multiply first component of all indices for first child by
│ │ │ -
271 // number of children to stretch the index range for interleaving.
│ │ │ -
272 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ -
273 multiIndices[i][0] *= children;
│ │ │ -
274 for (std::size_t child = 1; child<children; ++child)
│ │ │ -
275 {
│ │ │ -
276 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ -
277 {
│ │ │ -
278 // Copy indices from first child for all other children
│ │ │ -
279 // and shift them by child index to interleave indices.
│ │ │ -
280 // multiIndices[child*subTreeSize+i] = multiIndices[i];
│ │ │ -
281 // multiIndices[child*subTreeSize+i][0] = multiIndices[i][0]+child;
│ │ │ -
282 (*next) = multiIndices[i];
│ │ │ -
283 (*next)[0] = multiIndices[i][0]+child;
│ │ │ -
284 ++next;
│ │ │ -
285 }
│ │ │ -
286 }
│ │ │ -
287 return next;
│ │ │ -
288 }
│ │ │ -
│ │ │ -
289
│ │ │ -
290 template<class NodeType, typename It, class Children>
│ │ │ -
│ │ │ -
291 It indicesImpl(const NodeType& node, It multiIndices, Children children, BasisFactory::FlatLexicographic) const
│ │ │ -
292 {
│ │ │ -
293 using namespace Dune::Indices;
│ │ │ -
294 size_type subTreeSize = node.child(_0).size();
│ │ │ -
295 size_type firstIndexEntrySize = subPreBasis().size();
│ │ │ -
296 // Fill indices for first child at the beginning.
│ │ │ -
297 auto next = subPreBasis().indices(node.child(_0), multiIndices);
│ │ │ -
298 for (std::size_t child = 1; child<children_; ++child)
│ │ │ -
299 {
│ │ │ -
300 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ -
301 {
│ │ │ -
302 // Copy indices from first child for all other children
│ │ │ -
303 // and shift them by suitable offset to get lexicographic indices.
│ │ │ -
304 // multiIndices[child*subTreeSize+i] = multiIndices[i];
│ │ │ -
305 // multiIndices[child*subTreeSize+i][0] += child*firstIndexEntrySize;
│ │ │ -
306 (*next) = multiIndices[i];
│ │ │ -
307 (*next)[0] += child*firstIndexEntrySize;
│ │ │ -
308 ++next;
│ │ │ -
309 }
│ │ │ -
310 }
│ │ │ -
311 return next;
│ │ │ -
312 }
│ │ │ -
│ │ │ -
313
│ │ │ -
314 template<class MultiIndex>
│ │ │ -
│ │ │ -
315 static void multiIndexPushFront(MultiIndex& M, size_type M0)
│ │ │ -
316 {
│ │ │ -
317 M.resize(M.size()+1);
│ │ │ -
318 for(std::size_t i=M.size()-1; i>0; --i)
│ │ │ -
319 M[i] = M[i-1];
│ │ │ -
320 M[0] = M0;
│ │ │ -
321 }
│ │ │ -
│ │ │ -
322
│ │ │ -
323 template<class NodeType, typename It, class Children>
│ │ │ -
│ │ │ -
324 It indicesImpl(const NodeType& node, It multiIndices, Children children, BasisFactory::BlockedLexicographic) const
│ │ │ -
325 {
│ │ │ -
326 using namespace Dune::Indices;
│ │ │ -
327 size_type subTreeSize = node.child(_0).size();
│ │ │ -
328 // Fill indices for first child at the beginning.
│ │ │ -
329 auto next = subPreBasis().indices(node.child(_0), multiIndices);
│ │ │ -
330 // Insert 0 before first component of all indices for first child.
│ │ │ -
331 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ -
332 multiIndexPushFront(multiIndices[i], 0);
│ │ │ -
333 for (std::size_t child = 1; child<children_; ++child)
│ │ │ -
334 {
│ │ │ -
335 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ -
336 {
│ │ │ -
337 // Copy indices from first child for all other children and overwrite
│ │ │ -
338 // zero in first component as inserted above by child index.
│ │ │ -
339 // multiIndices[child*subTreeSize+i] = multiIndices[i];
│ │ │ -
340 // multiIndices[child*subTreeSize+i][0] = child;
│ │ │ -
341 (*next) = multiIndices[i];
│ │ │ -
342 (*next)[0] = child;
│ │ │ -
343 ++next;
│ │ │ -
344 }
│ │ │ -
345 }
│ │ │ -
346 return next;
│ │ │ -
347 }
│ │ │ -
│ │ │ -
348
│ │ │ -
349 template<class NodeType, typename It, class Children>
│ │ │ -
│ │ │ -
350 It indicesImpl(const NodeType& node, It multiIndices, Children children, BasisFactory::BlockedInterleaved) const
│ │ │ -
351 {
│ │ │ -
352 using namespace Dune::Indices;
│ │ │ -
353 size_type subTreeSize = node.child(_0).size();
│ │ │ -
354 // Fill indices for first child at the beginning.
│ │ │ -
355 auto next = subPreBasis().indices(node.child(_0), multiIndices);
│ │ │ -
356 // Append 0 after last component of all indices for first child.
│ │ │ -
357 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ -
358 multiIndices[i].push_back(0);
│ │ │ -
359 for (std::size_t child = 1; child<children_; ++child)
│ │ │ -
360 {
│ │ │ -
361 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ -
362 {
│ │ │ -
363 // Copy indices from first child for all other children and overwrite
│ │ │ -
364 // zero in last component as appended above by child index.
│ │ │ -
365 (*next) = multiIndices[i];
│ │ │ -
366 (*next).back() = child;
│ │ │ -
367 ++next;
│ │ │ -
368 }
│ │ │ -
369 }
│ │ │ -
370 return next;
│ │ │ -
371 }
│ │ │ -
│ │ │ -
372
│ │ │ -
373 template<class Children>
│ │ │ -
│ │ │ - │ │ │ -
375 {
│ │ │ - │ │ │ -
377 if constexpr(std::is_same_v<IMS, BasisFactory::FlatInterleaved>)
│ │ │ -
378 return ContainerDescriptors::Impl::flatInterleavedN(children,std::move(subTree));
│ │ │ -
379 else if constexpr(std::is_same_v<IMS, BasisFactory::FlatLexicographic>)
│ │ │ -
380 return ContainerDescriptors::Impl::flatLexicographicN(children,std::move(subTree));
│ │ │ -
381 else if constexpr(std::is_same_v<IMS, BasisFactory::BlockedLexicographic>)
│ │ │ -
382 return ContainerDescriptors::makeUniformDescriptor(children,std::move(subTree));
│ │ │ -
383 else if constexpr(std::is_same_v<IMS, BasisFactory::BlockedInterleaved>)
│ │ │ -
384 return ContainerDescriptors::Impl::appendToTree(children,std::move(subTree));
│ │ │ -
385 else
│ │ │ - │ │ │ -
387 }
│ │ │ -
│ │ │ -
388
│ │ │ -
389protected:
│ │ │ -
390 std::size_t children_;
│ │ │ - │ │ │ -
392};
│ │ │ -
│ │ │ -
393
│ │ │ -
394
│ │ │ -
395
│ │ │ -
396namespace BasisFactory {
│ │ │ -
397
│ │ │ -
409template<class ChildPreBasisFactory, class IndexMergingStrategy>
│ │ │ -
│ │ │ -
410auto power(ChildPreBasisFactory&& childPreBasisFactory, std::size_t k, const IndexMergingStrategy&)
│ │ │ -
411{
│ │ │ -
412 return [childPreBasisFactory,k](const auto& gridView) {
│ │ │ -
413 auto childPreBasis = childPreBasisFactory(gridView);
│ │ │ - │ │ │ -
415 };
│ │ │ -
416}
│ │ │ -
│ │ │ -
417
│ │ │ -
428template<class ChildPreBasisFactory>
│ │ │ -
429[[deprecated("Using the method `power` without an explicit index merging strategy"
│ │ │ -
430 " will change its meaning after the release of dune-functions 2.11."
│ │ │ -
431 " Previously, the default merging strategy was `BlockedInterleaved`,"
│ │ │ -
432 " but this will change to `FlatInterleaved`."
│ │ │ -
433 " Change the call to `power(..., blockedInterleaved())` to retain the old behavior.")]]
│ │ │ -
│ │ │ -
434auto power(ChildPreBasisFactory&& childPreBasisFactory, std::size_t k)
│ │ │ -
435{
│ │ │ -
436 return [childPreBasisFactory,k](const auto& gridView) {
│ │ │ -
437 auto childPreBasis = childPreBasisFactory(gridView);
│ │ │ - │ │ │ -
439 };
│ │ │ -
440}
│ │ │ -
│ │ │ -
441
│ │ │ -
442} // end namespace BasisFactory
│ │ │ -
443
│ │ │ -
444} // end namespace Functions
│ │ │ -
445} // end namespace Dune
│ │ │ -
446
│ │ │ -
447
│ │ │ -
448#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DYNAMICPOWERBASIS_HH
│ │ │ - │ │ │ -
Lightweight representation of (hierarchical) size and block structure extracted from a basis to descr...
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
auto power(ChildPreBasisFactory &&childPreBasisFactory, std::size_t k, const IndexMergingStrategy &)
Create a pre-basis factory that can build a PowerPreBasis.
Definition dynamicpowerbasis.hh:410
│ │ │ -
std::enable_if_t< std::is_constructible_v< T, Args... >, int > enableIfConstructible
Helper to constrain forwarding constructors.
Definition type_traits.hh:30
│ │ │ +
70}}} // namespace Dune::Functions::Imp
│ │ │ +
71
│ │ │ +
72
│ │ │ +
73
│ │ │ +
74#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH
│ │ │ + │ │ │ + │ │ │ + │ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
auto containerDescriptor(const PreBasis &preBasis)
Return the container descriptor of the pre-basis, if defined, otherwise ContainerDescriptor::Unknown.
Definition containerdescriptors.hh:58
│ │ │ -
auto makeUniformDescriptor(std::integral_constant< std::size_t, n >, Child child)
Generate a uniform descriptor in case the size is a static constant.
Definition containerdescriptors.hh:147
│ │ │ -
Definition argyrisbasis.hh:926
│ │ │ -
Base class for index merging strategies to simplify detection.
Definition basistags.hh:48
│ │ │ -
Lexicographic merging of direct children without blocking.
Definition basistags.hh:84
│ │ │ -
Interleaved merging of direct children without blocking.
Definition basistags.hh:118
│ │ │ -
Lexicographic merging of direct children with blocking (i.e. creating one block per direct child).
Definition basistags.hh:152
│ │ │ -
Interleaved merging of direct children with blocking (i.e. creating blocks at the leaves containing o...
Definition basistags.hh:184
│ │ │ -
Fallback container descriptor if nothing else fits.
Definition containerdescriptors.hh:52
│ │ │ -
A pre-basis for dynamic power bases.
Definition dynamicpowerbasis.hh:50
│ │ │ -
std::size_t size_type
Type used for indices and size information.
Definition dynamicpowerbasis.hh:62
│ │ │ -
IMS IndexMergingStrategy
Strategy used to merge the global indices of the child factories.
Definition dynamicpowerbasis.hh:65
│ │ │ -
DynamicPowerPreBasis(std::size_t c, SFArgs &&... sfArgs)
Constructor for given child pre-basis objects.
Definition dynamicpowerbasis.hh:82
│ │ │ -
static void multiIndexPopFront(MultiIndex &M)
Definition dynamicpowerbasis.hh:177
│ │ │ -
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition dynamicpowerbasis.hh:224
│ │ │ -
auto containerDescriptorImpl(Children children) const
Definition dynamicpowerbasis.hh:374
│ │ │ -
void initializeIndices()
Initialize the global indices.
Definition dynamicpowerbasis.hh:90
│ │ │ -
size_type sizeImpl(SizePrefix prefix, Children children, BasisFactory::FlatInterleaved) const
Definition dynamicpowerbasis.hh:139
│ │ │ -
static constexpr size_type maxMultiIndexSize
Definition dynamicpowerbasis.hh:70
│ │ │ -
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition dynamicpowerbasis.hh:102
│ │ │ -
auto containerDescriptor() const
Return the associated container descriptor.
Definition dynamicpowerbasis.hh:256
│ │ │ -
size_type size() const
Same as size(prefix) with empty prefix.
Definition dynamicpowerbasis.hh:124
│ │ │ -
It indicesImpl(const NodeType &node, It multiIndices, Children children, BasisFactory::BlockedInterleaved) const
Definition dynamicpowerbasis.hh:350
│ │ │ -
SubPreBasis & subPreBasis()
Mutable access to the stored prebasis of the factor in the power space.
Definition dynamicpowerbasis.hh:242
│ │ │ -
size_type sizeImpl(SizePrefix prefix, Children children, BasisFactory::FlatLexicographic) const
Definition dynamicpowerbasis.hh:155
│ │ │ -
static void multiIndexPushFront(MultiIndex &M, size_type M0)
Definition dynamicpowerbasis.hh:315
│ │ │ -
SubPreBasis subPreBasis_
Definition dynamicpowerbasis.hh:391
│ │ │ -
It indices(const NodeType &node, It it) const
Maps from subtree index set [0..size-1] to a globally unique multi index in global basis.
Definition dynamicpowerbasis.hh:250
│ │ │ -
size_type sizeImpl(SizePrefix prefix, Children children, BasisFactory::BlockedLexicographic) const
Definition dynamicpowerbasis.hh:185
│ │ │ -
size_type sizeImpl(SizePrefix prefix, Children children, BasisFactory::BlockedInterleaved) const
Definition dynamicpowerbasis.hh:194
│ │ │ -
It indicesImpl(const NodeType &node, It multiIndices, Children children, BasisFactory::BlockedLexicographic) const
Definition dynamicpowerbasis.hh:324
│ │ │ -
static constexpr size_type multiIndexBufferSize
Definition dynamicpowerbasis.hh:72
│ │ │ -
SPB SubPreBasis
The child pre-basis.
Definition dynamicpowerbasis.hh:56
│ │ │ -
Node makeNode() const
Create tree node.
Definition dynamicpowerbasis.hh:110
│ │ │ -
const SubPreBasis & subPreBasis() const
Const access to the stored prebasis of the factor in the power space.
Definition dynamicpowerbasis.hh:236
│ │ │ -
It indicesImpl(const NodeType &node, It multiIndices, Children children, BasisFactory::FlatInterleaved) const
Definition dynamicpowerbasis.hh:264
│ │ │ -
std::size_t children() const
Definition dynamicpowerbasis.hh:118
│ │ │ -
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition dynamicpowerbasis.hh:230
│ │ │ -
It indicesImpl(const NodeType &node, It multiIndices, Children children, BasisFactory::FlatLexicographic) const
Definition dynamicpowerbasis.hh:291
│ │ │ -
size_type size(const SizePrefix &prefix) const
Return number of possible values for next position in multi index.
Definition dynamicpowerbasis.hh:131
│ │ │ -
DynamicPowerBasisNode< typename SubPreBasis::Node > Node
Template mapping root tree path to type of created tree node.
Definition dynamicpowerbasis.hh:68
│ │ │ -
typename SPB::GridView GridView
The grid view that the FE basis is defined on.
Definition dynamicpowerbasis.hh:59
│ │ │ -
std::size_t children_
Definition dynamicpowerbasis.hh:390
│ │ │ -
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition dynamicpowerbasis.hh:96
│ │ │ -
static constexpr size_type minMultiIndexSize
Definition dynamicpowerbasis.hh:71
│ │ │ - │ │ │ - │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,626 +1,97 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -dynamicpowerbasis.hh │ │ │ │ +gridfunction_imp.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DYNAMICPOWERBASIS_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DYNAMICPOWERBASIS_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH │ │ │ │ +8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ -12#include │ │ │ │ +10#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ +11#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_i_n_t_e_r_f_a_c_e_s_._h_h> │ │ │ │ +12#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n___i_m_p_._h_h> │ │ │ │ 13 │ │ │ │ -14#include │ │ │ │ +14 │ │ │ │ 15 │ │ │ │ -16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ -17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ -18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_b_a_s_i_s_t_a_g_s_._h_h> │ │ │ │ -19#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h> │ │ │ │ -20#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -21#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ -22 │ │ │ │ -23 │ │ │ │ -24 │ │ │ │ -25namespace _D_u_n_e { │ │ │ │ -26namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -27 │ │ │ │ -28 │ │ │ │ -29/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -30// This is the reusable part of the dynamic power bases. It contains │ │ │ │ -31// │ │ │ │ -32// DynamicPowerPreBasis │ │ │ │ -33// │ │ │ │ -34// The pre-basis allows to create the others and is the owner of possible │ │ │ │ -shared │ │ │ │ -35// state. These components do _not_ depend on the global basis and local view │ │ │ │ -36// and can be used without a global basis. │ │ │ │ -37/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -38 │ │ │ │ -48template │ │ │ │ -_4_9class _D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s │ │ │ │ -50{ │ │ │ │ -51 static const bool isBlocked = std::is_same_v or std::is_same_v; │ │ │ │ -52 │ │ │ │ -53public: │ │ │ │ -54 │ │ │ │ -_5_6 using _S_u_b_P_r_e_B_a_s_i_s = SPB; │ │ │ │ -57 │ │ │ │ -_5_9 using _G_r_i_d_V_i_e_w = typename SPB::GridView; │ │ │ │ -60 │ │ │ │ -_6_2 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ -63 │ │ │ │ -_6_5 using _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y = IMS; │ │ │ │ -66 │ │ │ │ -_6_8 using _N_o_d_e = _D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_t_y_p_e_n_a_m_e_ _S_u_b_P_r_e_B_a_s_i_s_:_:_N_o_d_e_>; │ │ │ │ +16namespace _D_u_n_e { │ │ │ │ +17namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +18namespace Imp { │ │ │ │ +19 │ │ │ │ +23struct HasFreeLocalFunction │ │ │ │ +24{ │ │ │ │ +25 template │ │ │ │ +26 auto require(F&& f) -> decltype( │ │ │ │ +27 localFunction(f) │ │ │ │ +28 ); │ │ │ │ +29}; │ │ │ │ +30 │ │ │ │ +31 │ │ │ │ +32 │ │ │ │ +33// Interface of type erasure wrapper │ │ │ │ +34// │ │ │ │ +35// Notice that the basic interface of polymorphic classes (destructor, clone, │ │ │ │ +...) │ │ │ │ +36// will be added by the type erasure foundation classes. │ │ │ │ +37template │ │ │ │ +38class GridFunctionWrapperInterface : │ │ │ │ +39 public DifferentiableFunctionWrapperInterface │ │ │ │ +40{ │ │ │ │ +41public: │ │ │ │ +42 virtual LocalFunctionInterface wrappedLocalFunction() const = 0; │ │ │ │ +43 │ │ │ │ +44 virtual const EntitySet& wrappedEntitySet() const = 0; │ │ │ │ +45}; │ │ │ │ +46 │ │ │ │ +47 │ │ │ │ +48// Implementation of type erasure wrapper │ │ │ │ +49template │ │ │ │ +50class GridFunctionWrapperImplementation : │ │ │ │ +51 public DifferentiableFunctionWrapperImplementation │ │ │ │ +52{ │ │ │ │ +53 using Base = DifferentiableFunctionWrapperImplementation; │ │ │ │ +54public: │ │ │ │ +55 using Base::Base; │ │ │ │ +56 │ │ │ │ +57 virtual LocalFunctionInterface wrappedLocalFunction() const │ │ │ │ +58 { │ │ │ │ +59 return localFunction(this->get()); │ │ │ │ +60 } │ │ │ │ +61 │ │ │ │ +62 virtual const EntitySet& wrappedEntitySet() const │ │ │ │ +63 { │ │ │ │ +64 return this->get().entitySet(); │ │ │ │ +65 } │ │ │ │ +66}; │ │ │ │ +67 │ │ │ │ +68 │ │ │ │ 69 │ │ │ │ -_7_0 static constexpr _s_i_z_e___t_y_p_e _m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e = SubPreBasis:: │ │ │ │ -maxMultiIndexSize + isBlocked; │ │ │ │ -_7_1 static constexpr _s_i_z_e___t_y_p_e _m_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e = SubPreBasis:: │ │ │ │ -minMultiIndexSize + isBlocked; │ │ │ │ -_7_2 static constexpr _s_i_z_e___t_y_p_e _m_u_l_t_i_I_n_d_e_x_B_u_f_f_e_r_S_i_z_e = SubPreBasis:: │ │ │ │ -multiIndexBufferSize + isBlocked; │ │ │ │ +70}}} // namespace Dune::Functions::Imp │ │ │ │ +71 │ │ │ │ +72 │ │ │ │ 73 │ │ │ │ -79 template = 0, │ │ │ │ -81 _e_n_a_b_l_e_I_f_C_o_n_s_t_r_u_c_t_i_b_l_e<_S_u_b_P_r_e_B_a_s_i_s, SFArgs...> = 0> │ │ │ │ -_8_2 explicit _D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s(std::size_t c, SFArgs&&... sfArgs) : │ │ │ │ -83 _c_h_i_l_d_r_e_n__(c), │ │ │ │ -84 _s_u_b_P_r_e_B_a_s_i_s__(std::forward(sfArgs)...) │ │ │ │ -85 { │ │ │ │ -86 static_assert(models, _S_u_b_P_r_e_B_a_s_i_s>(), │ │ │ │ -"Subprebasis passed to DynamicPowerPreBasis does not model the PreBasis │ │ │ │ -concept."); │ │ │ │ -87 } │ │ │ │ -88 │ │ │ │ -_9_0 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ -91 { │ │ │ │ -92 _s_u_b_P_r_e_B_a_s_i_s__.initializeIndices(); │ │ │ │ -93 } │ │ │ │ -94 │ │ │ │ -_9_6 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ -97 { │ │ │ │ -98 return _s_u_b_P_r_e_B_a_s_i_s__.gridView(); │ │ │ │ -99 } │ │ │ │ -100 │ │ │ │ -_1_0_2 void _u_p_d_a_t_e(const _G_r_i_d_V_i_e_w& gv) │ │ │ │ -103 { │ │ │ │ -104 _s_u_b_P_r_e_B_a_s_i_s__.update(gv); │ │ │ │ -105 } │ │ │ │ -106 │ │ │ │ -_1_1_0 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ -111 { │ │ │ │ -112 auto node = _N_o_d_e{_c_h_i_l_d_r_e_n__}; │ │ │ │ -113 for (std::size_t i=0; i<_c_h_i_l_d_r_e_n__; ++i) │ │ │ │ -114 node.setChild(i, _s_u_b_P_r_e_B_a_s_i_s__.makeNode()); │ │ │ │ -115 return node; │ │ │ │ -116 } │ │ │ │ -117 │ │ │ │ -_1_1_8 std::size_t _c_h_i_l_d_r_e_n() const │ │ │ │ -119 { │ │ │ │ -120 return _c_h_i_l_d_r_e_n__; │ │ │ │ -121 } │ │ │ │ -122 │ │ │ │ -_1_2_4 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ -125 { │ │ │ │ -126 return _s_i_z_e(Dune::ReservedVector{}); │ │ │ │ -127 } │ │ │ │ -128 │ │ │ │ -130 template │ │ │ │ -_1_3_1 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix) const │ │ │ │ -132 { │ │ │ │ -133 return _s_i_z_e_I_m_p_l(prefix, _c_h_i_l_d_r_e_n__, _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y{}); │ │ │ │ -134 } │ │ │ │ -135 │ │ │ │ -136protected: │ │ │ │ -137 │ │ │ │ -138 template │ │ │ │ -_1_3_9 _s_i_z_e___t_y_p_e _s_i_z_e_I_m_p_l(SizePrefix prefix, Children _c_h_i_l_d_r_e_n, _B_a_s_i_s_F_a_c_t_o_r_y_:_: │ │ │ │ -_F_l_a_t_I_n_t_e_r_l_e_a_v_e_d) const │ │ │ │ -140 { │ │ │ │ -141 // The root index size is the root index size of a single subnode │ │ │ │ -142 // multiplied by the number of subnodes, because we enumerate all │ │ │ │ -143 // child indices in a row. │ │ │ │ -144 if (prefix.size() == 0) │ │ │ │ -145 return _c_h_i_l_d_r_e_n*_s_u_b_P_r_e_B_a_s_i_s__.size(); │ │ │ │ -146 │ │ │ │ -147 // The FlatInterleaved index merging strategy only changes the first │ │ │ │ -148 // index digit. Hence, we have to reconstruct the corresponding digit │ │ │ │ -149 // for the subtree and can then return the corresponding size of the │ │ │ │ -subtree. │ │ │ │ -150 prefix[0] = prefix[0] / _c_h_i_l_d_r_e_n; │ │ │ │ -151 return _s_u_b_P_r_e_B_a_s_i_s__.size(prefix); │ │ │ │ -152 } │ │ │ │ -153 │ │ │ │ -154 template │ │ │ │ -_1_5_5 _s_i_z_e___t_y_p_e _s_i_z_e_I_m_p_l(SizePrefix prefix, Children _c_h_i_l_d_r_e_n, _B_a_s_i_s_F_a_c_t_o_r_y_:_: │ │ │ │ -_F_l_a_t_L_e_x_i_c_o_g_r_a_p_h_i_c) const │ │ │ │ -156 { │ │ │ │ -157 // The size at the index tree root is the size of at the index tree │ │ │ │ -158 // root of a single subnode multiplied by the number of subnodes, │ │ │ │ -159 // because we enumerate all child indices in a row. │ │ │ │ -160 if (prefix.size() == 0) │ │ │ │ -161 return _c_h_i_l_d_r_e_n*_s_u_b_P_r_e_B_a_s_i_s__.size(); │ │ │ │ -162 │ │ │ │ -163 // The first prefix entry refers to one of the (root index size) │ │ │ │ -164 // subindex trees. Hence, we have to first compute the corresponding │ │ │ │ -165 // prefix entry for a single subnode subnode. Then we can append │ │ │ │ -166 // the other prefix entries unmodified, because the index tree │ │ │ │ -167 // looks the same after the first level. │ │ │ │ -168 │ │ │ │ -169 // The FlatLexicographic index merging strategy only changes the first │ │ │ │ -170 // index digit. Hence, we have to reconstruct the corresponding digit │ │ │ │ -171 // for the subtree and can then return the corresponding size of the │ │ │ │ -subtree. │ │ │ │ -172 prefix[0] = prefix[0] % _s_u_b_P_r_e_B_a_s_i_s__.size(); │ │ │ │ -173 return _s_u_b_P_r_e_B_a_s_i_s__.size(prefix); │ │ │ │ -174 } │ │ │ │ -175 │ │ │ │ -176 template │ │ │ │ -_1_7_7 static void _m_u_l_t_i_I_n_d_e_x_P_o_p_F_r_o_n_t(MultiIndex& M) │ │ │ │ -178 { │ │ │ │ -179 for(std::size_t i=0; i │ │ │ │ -_1_8_5 _s_i_z_e___t_y_p_e _s_i_z_e_I_m_p_l(SizePrefix prefix, Children _c_h_i_l_d_r_e_n, _B_a_s_i_s_F_a_c_t_o_r_y_:_: │ │ │ │ -_B_l_o_c_k_e_d_L_e_x_i_c_o_g_r_a_p_h_i_c) const │ │ │ │ -186 { │ │ │ │ -187 if (prefix.size() == 0) │ │ │ │ -188 return _c_h_i_l_d_r_e_n; │ │ │ │ -189 _m_u_l_t_i_I_n_d_e_x_P_o_p_F_r_o_n_t(prefix); │ │ │ │ -190 return _s_u_b_P_r_e_B_a_s_i_s__.size(prefix); │ │ │ │ -191 } │ │ │ │ -192 │ │ │ │ -193 template │ │ │ │ -_1_9_4 _s_i_z_e___t_y_p_e _s_i_z_e_I_m_p_l(SizePrefix prefix, Children _c_h_i_l_d_r_e_n, _B_a_s_i_s_F_a_c_t_o_r_y_:_: │ │ │ │ -_B_l_o_c_k_e_d_I_n_t_e_r_l_e_a_v_e_d) const │ │ │ │ -195 { │ │ │ │ -196 if (prefix.size() == 0) │ │ │ │ -197 return _s_u_b_P_r_e_B_a_s_i_s__.size(); │ │ │ │ -198 │ │ │ │ -199 // Remember last index, remove it and check if the remaining │ │ │ │ -200 // prefix refers to a leaf in the subPreBasis index tree. │ │ │ │ -201 // If yes, then the full prefix must also refer to a │ │ │ │ -202 // leaf in the merged index tree. If not, then restore the full │ │ │ │ -203 // prefix and proceed. │ │ │ │ -204 auto tail = prefix.back(); │ │ │ │ -205 prefix.pop_back(); │ │ │ │ -206 if (_s_u_b_P_r_e_B_a_s_i_s__.size(prefix) == 0) │ │ │ │ -207 return 0; │ │ │ │ -208 prefix.push_back(tail); │ │ │ │ -209 │ │ │ │ -210 // Now check if the full prefix refers to a leaf in the subPreBasis │ │ │ │ -211 // index tree. │ │ │ │ -212 // If yes, then it has exactly 'children' appended children in the subtree. │ │ │ │ -213 // If not, then the index tree looks the same in the merged subtree and we │ │ │ │ -214 // can forward the result. │ │ │ │ -215 auto subSize = _s_u_b_P_r_e_B_a_s_i_s__.size(prefix); │ │ │ │ -216 if (subSize == 0) │ │ │ │ -217 return _c_h_i_l_d_r_e_n; │ │ │ │ -218 return subSize; │ │ │ │ -219 } │ │ │ │ -220 │ │ │ │ -221public: │ │ │ │ -222 │ │ │ │ -_2_2_4 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ -225 { │ │ │ │ -226 return _s_u_b_P_r_e_B_a_s_i_s__.dimension() * _c_h_i_l_d_r_e_n__; │ │ │ │ -227 } │ │ │ │ -228 │ │ │ │ -_2_3_0 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ -231 { │ │ │ │ -232 return _s_u_b_P_r_e_B_a_s_i_s__.maxNodeSize() * _c_h_i_l_d_r_e_n__; │ │ │ │ -233 } │ │ │ │ -234 │ │ │ │ -_2_3_6 const _S_u_b_P_r_e_B_a_s_i_s& _s_u_b_P_r_e_B_a_s_i_s() const │ │ │ │ -237 { │ │ │ │ -238 return _s_u_b_P_r_e_B_a_s_i_s__; │ │ │ │ -239 } │ │ │ │ -240 │ │ │ │ -_2_4_2 _S_u_b_P_r_e_B_a_s_i_s& _s_u_b_P_r_e_B_a_s_i_s() │ │ │ │ -243 { │ │ │ │ -244 return _s_u_b_P_r_e_B_a_s_i_s__; │ │ │ │ -245 } │ │ │ │ -246 │ │ │ │ -248 template │ │ │ │ -249 requires Dune::TypeTree::Concept::UniformInnerTreeNode │ │ │ │ -_2_5_0 It _i_n_d_i_c_e_s(const NodeType& node, It it) const │ │ │ │ -251 { │ │ │ │ -252 return _i_n_d_i_c_e_s_I_m_p_l(node, it, _c_h_i_l_d_r_e_n__, _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y{}); │ │ │ │ -253 } │ │ │ │ -254 │ │ │ │ -_2_5_6 auto _c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r() const │ │ │ │ -257 { │ │ │ │ -258 return _c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_I_m_p_l(_c_h_i_l_d_r_e_n__); │ │ │ │ -259 } │ │ │ │ -260 │ │ │ │ -261protected: │ │ │ │ -262 │ │ │ │ -263 template │ │ │ │ -_2_6_4 It _i_n_d_i_c_e_s_I_m_p_l(const NodeType& node, It multiIndices, Children _c_h_i_l_d_r_e_n, │ │ │ │ -_B_a_s_i_s_F_a_c_t_o_r_y_:_:_F_l_a_t_I_n_t_e_r_l_e_a_v_e_d) const │ │ │ │ -265 { │ │ │ │ -266 using namespace Dune::Indices; │ │ │ │ -267 _s_i_z_e___t_y_p_e subTreeSize = node.child(_0).size(); │ │ │ │ -268 // Fill indices for first child at the beginning. │ │ │ │ -269 auto next = _s_u_b_P_r_e_B_a_s_i_s().indices(node.child(_0), multiIndices); │ │ │ │ -270 // Multiply first component of all indices for first child by │ │ │ │ -271 // number of children to stretch the index range for interleaving. │ │ │ │ -272 for (std::size_t i = 0; i │ │ │ │ -_2_9_1 It _i_n_d_i_c_e_s_I_m_p_l(const NodeType& node, It multiIndices, Children _c_h_i_l_d_r_e_n, │ │ │ │ -_B_a_s_i_s_F_a_c_t_o_r_y_:_:_F_l_a_t_L_e_x_i_c_o_g_r_a_p_h_i_c) const │ │ │ │ -292 { │ │ │ │ -293 using namespace Dune::Indices; │ │ │ │ -294 _s_i_z_e___t_y_p_e subTreeSize = node.child(_0).size(); │ │ │ │ -295 _s_i_z_e___t_y_p_e firstIndexEntrySize = _s_u_b_P_r_e_B_a_s_i_s().size(); │ │ │ │ -296 // Fill indices for first child at the beginning. │ │ │ │ -297 auto next = _s_u_b_P_r_e_B_a_s_i_s().indices(node.child(_0), multiIndices); │ │ │ │ -298 for (std::size_t child = 1; child<_c_h_i_l_d_r_e_n__; ++child) │ │ │ │ -299 { │ │ │ │ -300 for (std::size_t i = 0; i │ │ │ │ -_3_1_5 static void _m_u_l_t_i_I_n_d_e_x_P_u_s_h_F_r_o_n_t(MultiIndex& M, _s_i_z_e___t_y_p_e M0) │ │ │ │ -316 { │ │ │ │ -317 M.resize(M.size()+1); │ │ │ │ -318 for(std::size_t i=M.size()-1; i>0; --i) │ │ │ │ -319 M[i] = M[i-1]; │ │ │ │ -320 M[0] = M0; │ │ │ │ -321 } │ │ │ │ -322 │ │ │ │ -323 template │ │ │ │ -_3_2_4 It _i_n_d_i_c_e_s_I_m_p_l(const NodeType& node, It multiIndices, Children _c_h_i_l_d_r_e_n, │ │ │ │ -_B_a_s_i_s_F_a_c_t_o_r_y_:_:_B_l_o_c_k_e_d_L_e_x_i_c_o_g_r_a_p_h_i_c) const │ │ │ │ -325 { │ │ │ │ -326 using namespace Dune::Indices; │ │ │ │ -327 _s_i_z_e___t_y_p_e subTreeSize = node.child(_0).size(); │ │ │ │ -328 // Fill indices for first child at the beginning. │ │ │ │ -329 auto next = _s_u_b_P_r_e_B_a_s_i_s().indices(node.child(_0), multiIndices); │ │ │ │ -330 // Insert 0 before first component of all indices for first child. │ │ │ │ -331 for (std::size_t i = 0; i │ │ │ │ -_3_5_0 It _i_n_d_i_c_e_s_I_m_p_l(const NodeType& node, It multiIndices, Children _c_h_i_l_d_r_e_n, │ │ │ │ -_B_a_s_i_s_F_a_c_t_o_r_y_:_:_B_l_o_c_k_e_d_I_n_t_e_r_l_e_a_v_e_d) const │ │ │ │ -351 { │ │ │ │ -352 using namespace Dune::Indices; │ │ │ │ -353 _s_i_z_e___t_y_p_e subTreeSize = node.child(_0).size(); │ │ │ │ -354 // Fill indices for first child at the beginning. │ │ │ │ -355 auto next = _s_u_b_P_r_e_B_a_s_i_s().indices(node.child(_0), multiIndices); │ │ │ │ -356 // Append 0 after last component of all indices for first child. │ │ │ │ -357 for (std::size_t i = 0; i │ │ │ │ -_3_7_4 auto _c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_I_m_p_l(Children _c_h_i_l_d_r_e_n) const │ │ │ │ -375 { │ │ │ │ -376 auto subTree = _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r(_s_u_b_P_r_e_B_a_s_i_s__); │ │ │ │ -377 if constexpr(std::is_same_v) │ │ │ │ -378 return ContainerDescriptors::Impl::flatInterleavedN(_c_h_i_l_d_r_e_n,std::move │ │ │ │ -(subTree)); │ │ │ │ -379 else if constexpr(std::is_same_v) │ │ │ │ -380 return ContainerDescriptors::Impl::flatLexicographicN(_c_h_i_l_d_r_e_n,std::move │ │ │ │ -(subTree)); │ │ │ │ -381 else if constexpr(std::is_same_v) │ │ │ │ -382 return _C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_m_a_k_e_U_n_i_f_o_r_m_D_e_s_c_r_i_p_t_o_r(_c_h_i_l_d_r_e_n,std::move │ │ │ │ -(subTree)); │ │ │ │ -383 else if constexpr(std::is_same_v) │ │ │ │ -384 return ContainerDescriptors::Impl::appendToTree(_c_h_i_l_d_r_e_n,std::move │ │ │ │ -(subTree)); │ │ │ │ -385 else │ │ │ │ -386 return _C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_k_n_o_w_n{}; │ │ │ │ -387 } │ │ │ │ -388 │ │ │ │ -389protected: │ │ │ │ -_3_9_0 std::size_t _c_h_i_l_d_r_e_n__; │ │ │ │ -_3_9_1 _S_u_b_P_r_e_B_a_s_i_s _s_u_b_P_r_e_B_a_s_i_s__; │ │ │ │ -392}; │ │ │ │ -393 │ │ │ │ -394 │ │ │ │ -395 │ │ │ │ -396namespace _B_a_s_i_s_F_a_c_t_o_r_y { │ │ │ │ -397 │ │ │ │ -409template │ │ │ │ -_4_1_0auto _p_o_w_e_r(ChildPreBasisFactory&& childPreBasisFactory, std::size_t k, const │ │ │ │ -_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y&) │ │ │ │ -411{ │ │ │ │ -412 return [childPreBasisFactory,k](const auto& gridView) { │ │ │ │ -413 auto childPreBasis = childPreBasisFactory(gridView); │ │ │ │ -414 return _D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_<_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y_,_ _d_e_c_l_t_y_p_e_(_c_h_i_l_d_P_r_e_B_a_s_i_s_)_> │ │ │ │ -(k,std::move(childPreBasis)); │ │ │ │ -415 }; │ │ │ │ -416} │ │ │ │ -417 │ │ │ │ -428template │ │ │ │ -429[[deprecated("Using the method `power` without an explicit index merging │ │ │ │ -strategy" │ │ │ │ -430 " will change its meaning after the release of dune-functions 2.11." │ │ │ │ -431 " Previously, the default merging strategy was `BlockedInterleaved`," │ │ │ │ -432 " but this will change to `FlatInterleaved`." │ │ │ │ -433 " Change the call to `power(..., blockedInterleaved())` to retain the old │ │ │ │ -behavior.")]] │ │ │ │ -_4_3_4auto _p_o_w_e_r(ChildPreBasisFactory&& childPreBasisFactory, std::size_t k) │ │ │ │ -435{ │ │ │ │ -436 return [childPreBasisFactory,k](const auto& gridView) { │ │ │ │ -437 auto childPreBasis = childPreBasisFactory(gridView); │ │ │ │ -438 return _D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_<_B_l_o_c_k_e_d_I_n_t_e_r_l_e_a_v_e_d_,_ _d_e_c_l_t_y_p_e_(_c_h_i_l_d_P_r_e_B_a_s_i_s_)_> │ │ │ │ -(k,std::move(childPreBasis)); │ │ │ │ -439 }; │ │ │ │ -440} │ │ │ │ -441 │ │ │ │ -442} // end namespace BasisFactory │ │ │ │ -443 │ │ │ │ -444} // end namespace Functions │ │ │ │ -445} // end namespace Dune │ │ │ │ -446 │ │ │ │ -447 │ │ │ │ -448#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DYNAMICPOWERBASIS_HH │ │ │ │ -_n_o_d_e_s_._h_h │ │ │ │ -_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h │ │ │ │ -Lightweight representation of (hierarchical) size and block structure extracted │ │ │ │ -from a basis to descr... │ │ │ │ -_b_a_s_i_s_t_a_g_s_._h_h │ │ │ │ -_u_t_i_l_i_t_y_._h_h │ │ │ │ +74#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH │ │ │ │ +_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n___i_m_p_._h_h │ │ │ │ _t_y_p_e___t_r_a_i_t_s_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_p_o_w_e_r │ │ │ │ -auto power(ChildPreBasisFactory &&childPreBasisFactory, std::size_t k, const │ │ │ │ -IndexMergingStrategy &) │ │ │ │ -Create a pre-basis factory that can build a PowerPreBasis. │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:410 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_e_n_a_b_l_e_I_f_C_o_n_s_t_r_u_c_t_i_b_l_e │ │ │ │ -std::enable_if_t< std::is_constructible_v< T, Args... >, int > │ │ │ │ -enableIfConstructible │ │ │ │ -Helper to constrain forwarding constructors. │ │ │ │ -DDeeffiinniittiioonn type_traits.hh:30 │ │ │ │ +_i_n_t_e_r_f_a_c_e_s_._h_h │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r │ │ │ │ -auto containerDescriptor(const PreBasis &preBasis) │ │ │ │ -Return the container descriptor of the pre-basis, if defined, otherwise │ │ │ │ -ContainerDescriptor::Unknown. │ │ │ │ -DDeeffiinniittiioonn containerdescriptors.hh:58 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_m_a_k_e_U_n_i_f_o_r_m_D_e_s_c_r_i_p_t_o_r │ │ │ │ -auto makeUniformDescriptor(std::integral_constant< std::size_t, n >, Child │ │ │ │ -child) │ │ │ │ -Generate a uniform descriptor in case the size is a static constant. │ │ │ │ -DDeeffiinniittiioonn containerdescriptors.hh:147 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:926 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ -Base class for index merging strategies to simplify detection. │ │ │ │ -DDeeffiinniittiioonn basistags.hh:48 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_F_l_a_t_L_e_x_i_c_o_g_r_a_p_h_i_c │ │ │ │ -Lexicographic merging of direct children without blocking. │ │ │ │ -DDeeffiinniittiioonn basistags.hh:84 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_F_l_a_t_I_n_t_e_r_l_e_a_v_e_d │ │ │ │ -Interleaved merging of direct children without blocking. │ │ │ │ -DDeeffiinniittiioonn basistags.hh:118 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_B_l_o_c_k_e_d_L_e_x_i_c_o_g_r_a_p_h_i_c │ │ │ │ -Lexicographic merging of direct children with blocking (i.e. creating one block │ │ │ │ -per direct child). │ │ │ │ -DDeeffiinniittiioonn basistags.hh:152 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_B_l_o_c_k_e_d_I_n_t_e_r_l_e_a_v_e_d │ │ │ │ -Interleaved merging of direct children with blocking (i.e. creating blocks at │ │ │ │ -the leaves containing o... │ │ │ │ -DDeeffiinniittiioonn basistags.hh:184 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_k_n_o_w_n │ │ │ │ -Fallback container descriptor if nothing else fits. │ │ │ │ -DDeeffiinniittiioonn containerdescriptors.hh:52 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s │ │ │ │ -A pre-basis for dynamic power bases. │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:50 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -Type used for indices and size information. │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:62 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ -IMS IndexMergingStrategy │ │ │ │ -Strategy used to merge the global indices of the child factories. │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:65 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s │ │ │ │ -DynamicPowerPreBasis(std::size_t c, SFArgs &&... sfArgs) │ │ │ │ -Constructor for given child pre-basis objects. │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:82 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_m_u_l_t_i_I_n_d_e_x_P_o_p_F_r_o_n_t │ │ │ │ -static void multiIndexPopFront(MultiIndex &M) │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:177 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ -size_type dimension() const │ │ │ │ -Get the total dimension of the space spanned by this basis. │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:224 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_I_m_p_l │ │ │ │ -auto containerDescriptorImpl(Children children) const │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:374 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ -void initializeIndices() │ │ │ │ -Initialize the global indices. │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:90 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_s_i_z_e_I_m_p_l │ │ │ │ -size_type sizeImpl(SizePrefix prefix, Children children, BasisFactory:: │ │ │ │ -FlatInterleaved) const │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:139 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ -static constexpr size_type maxMultiIndexSize │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:70 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_u_p_d_a_t_e │ │ │ │ -void update(const GridView &gv) │ │ │ │ -Update the stored grid view, to be called if the grid has changed. │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:102 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r │ │ │ │ -auto containerDescriptor() const │ │ │ │ -Return the associated container descriptor. │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:256 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ -size_type size() const │ │ │ │ -Same as size(prefix) with empty prefix. │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:124 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_i_n_d_i_c_e_s_I_m_p_l │ │ │ │ -It indicesImpl(const NodeType &node, It multiIndices, Children children, │ │ │ │ -BasisFactory::BlockedInterleaved) const │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:350 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_s_u_b_P_r_e_B_a_s_i_s │ │ │ │ -SubPreBasis & subPreBasis() │ │ │ │ -Mutable access to the stored prebasis of the factor in the power space. │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:242 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_s_i_z_e_I_m_p_l │ │ │ │ -size_type sizeImpl(SizePrefix prefix, Children children, BasisFactory:: │ │ │ │ -FlatLexicographic) const │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:155 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_m_u_l_t_i_I_n_d_e_x_P_u_s_h_F_r_o_n_t │ │ │ │ -static void multiIndexPushFront(MultiIndex &M, size_type M0) │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:315 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_s_u_b_P_r_e_B_a_s_i_s__ │ │ │ │ -SubPreBasis subPreBasis_ │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:391 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_i_n_d_i_c_e_s │ │ │ │ -It indices(const NodeType &node, It it) const │ │ │ │ -Maps from subtree index set [0..size-1] to a globally unique multi index in │ │ │ │ -global basis. │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:250 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_s_i_z_e_I_m_p_l │ │ │ │ -size_type sizeImpl(SizePrefix prefix, Children children, BasisFactory:: │ │ │ │ -BlockedLexicographic) const │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:185 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_s_i_z_e_I_m_p_l │ │ │ │ -size_type sizeImpl(SizePrefix prefix, Children children, BasisFactory:: │ │ │ │ -BlockedInterleaved) const │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:194 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_i_n_d_i_c_e_s_I_m_p_l │ │ │ │ -It indicesImpl(const NodeType &node, It multiIndices, Children children, │ │ │ │ -BasisFactory::BlockedLexicographic) const │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:324 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_m_u_l_t_i_I_n_d_e_x_B_u_f_f_e_r_S_i_z_e │ │ │ │ -static constexpr size_type multiIndexBufferSize │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:72 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_S_u_b_P_r_e_B_a_s_i_s │ │ │ │ -SPB SubPreBasis │ │ │ │ -The child pre-basis. │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:56 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_m_a_k_e_N_o_d_e │ │ │ │ -Node makeNode() const │ │ │ │ -Create tree node. │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:110 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_s_u_b_P_r_e_B_a_s_i_s │ │ │ │ -const SubPreBasis & subPreBasis() const │ │ │ │ -Const access to the stored prebasis of the factor in the power space. │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:236 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_i_n_d_i_c_e_s_I_m_p_l │ │ │ │ -It indicesImpl(const NodeType &node, It multiIndices, Children children, │ │ │ │ -BasisFactory::FlatInterleaved) const │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:264 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_c_h_i_l_d_r_e_n │ │ │ │ -std::size_t children() const │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:118 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_m_a_x_N_o_d_e_S_i_z_e │ │ │ │ -size_type maxNodeSize() const │ │ │ │ -Get the maximal number of DOFs associated to node for any element. │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:230 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_i_n_d_i_c_e_s_I_m_p_l │ │ │ │ -It indicesImpl(const NodeType &node, It multiIndices, Children children, │ │ │ │ -BasisFactory::FlatLexicographic) const │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:291 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ -size_type size(const SizePrefix &prefix) const │ │ │ │ -Return number of possible values for next position in multi index. │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:131 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_N_o_d_e │ │ │ │ -DynamicPowerBasisNode< typename SubPreBasis::Node > Node │ │ │ │ -Template mapping root tree path to type of created tree node. │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:68 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ -typename SPB::GridView GridView │ │ │ │ -The grid view that the FE basis is defined on. │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:59 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_c_h_i_l_d_r_e_n__ │ │ │ │ -std::size_t children_ │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:390 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_g_r_i_d_V_i_e_w │ │ │ │ -const GridView & gridView() const │ │ │ │ -Obtain the grid view that the basis is defined on. │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:96 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_m_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ -static constexpr size_type minMultiIndexSize │ │ │ │ -DDeeffiinniittiioonn dynamicpowerbasis.hh:71 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e │ │ │ │ -DDeeffiinniittiioonn nodes.hh:332 │ │ │ │ -_c_o_n_c_e_p_t_s_._h_h │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _d_y_n_a_m_i_c_p_o_w_e_r_b_a_s_i_s_._h_h │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n___i_m_p_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00161.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: defaultlocalview.hh File Reference │ │ │ +Dune-Functions: gridviewentityset.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,32 +88,25 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
defaultlocalview.hh File Reference
│ │ │ +
gridviewentityset.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <tuple>
│ │ │ -#include <optional>
│ │ │ -#include <dune/common/concept.hh>
│ │ │ -#include <dune/common/hybridutilities.hh>
│ │ │ -#include <dune/common/reservedvector.hh>
│ │ │ -#include <dune/functions/common/overflowarray.hh>
│ │ │ -#include <dune/functions/common/multiindex.hh>
│ │ │ -#include <dune/functions/functionspacebases/concepts.hh>
│ │ │ +
#include <memory>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::DefaultLocalView< GB >
 The restriction of a finite element basis to a single element. More...
class  Dune::Functions::GridViewEntitySet< GV, cd >
 An entity set for all entities of given codim in a grid view. More...
│ │ │ │ │ │ │ │ │ │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
│ │ │
│ │ │ @@ -125,13 +118,13 @@ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,25 +1,18 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -defaultlocalview.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_o_v_e_r_f_l_o_w_a_r_r_a_y_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_m_u_l_t_i_i_n_d_e_x_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +gridviewentityset.hh File Reference │ │ │ │ +#include │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _G_B_ _> │ │ │ │ -  The restriction of a finite element basis to a single element. _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_V_,_ _c_d_ _> │ │ │ │ +  An entity set for all entities of given codim in a grid view. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _d_e_f_a_u_l_t_l_o_c_a_l_v_i_e_w_._h_h │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ + * _g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00161_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: defaultlocalview.hh Source File │ │ │ +Dune-Functions: gridviewentityset.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,231 +88,128 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
defaultlocalview.hh
│ │ │ +
gridviewentityset.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH
│ │ │ +
8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH
│ │ │
9
│ │ │ -
10
│ │ │ -
11#include <tuple>
│ │ │ -
12#include <optional>
│ │ │ -
13
│ │ │ -
14#include <dune/common/concept.hh>
│ │ │ -
15#include <dune/common/hybridutilities.hh>
│ │ │ -
16#include <dune/common/reservedvector.hh>
│ │ │ -
17
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
21
│ │ │ -
22
│ │ │ -
23
│ │ │ -
24namespace Dune {
│ │ │ -
25namespace Functions {
│ │ │ -
26
│ │ │ -
27
│ │ │ -
28
│ │ │ -
30template<class GB>
│ │ │ -
│ │ │ - │ │ │ -
32{
│ │ │ -
33public:
│ │ │ +
10#include <memory>
│ │ │ +
11
│ │ │ +
12
│ │ │ +
13namespace Dune {
│ │ │ +
14
│ │ │ +
15namespace Functions {
│ │ │ +
16
│ │ │ +
17
│ │ │ +
25template<class GV, int cd>
│ │ │ +
│ │ │ + │ │ │ +
27{
│ │ │ +
28public:
│ │ │ +
29
│ │ │ +
30 typedef GV GridView;
│ │ │ +
31 enum {
│ │ │ +
32 codim = cd
│ │ │ +
33 };
│ │ │
34
│ │ │ -
36 using GlobalBasis = GB;
│ │ │ +
36 typedef typename GridView::template Codim<codim>::Entity Element;
│ │ │
37
│ │ │ - │ │ │ -
40
│ │ │ -
42 using Element = typename GridView::template Codim<0>::Entity;
│ │ │ +
39 typedef typename Element::Geometry::LocalCoordinate LocalCoordinate;
│ │ │ +
40 typedef typename Element::Geometry::GlobalCoordinate GlobalCoordinate;
│ │ │ +
41
│ │ │ + │ │ │
43
│ │ │ -
45 using size_type = std::size_t;
│ │ │ +
45 typedef typename GridView::template Codim<codim>::Iterator const_iterator;
│ │ │
46
│ │ │ -
48 using Tree = typename GlobalBasis::PreBasis::Node;
│ │ │ -
49
│ │ │ -
50protected:
│ │ │ -
51
│ │ │ - │ │ │ -
53
│ │ │ -
54 // Type used to store the multi indices of the basis vectors.
│ │ │ -
55 // In contrast to MultiIndex this always has dynamic size.
│ │ │ -
56 // It's guaranteed, that you can always cast it to MultiIndex
│ │ │ - │ │ │ -
58 std::conditional_t<(PreBasis::minMultiIndexSize == PreBasis::maxMultiIndexSize),
│ │ │ - │ │ │ -
60 Dune::ReservedVector<size_type, PreBasis::multiIndexBufferSize>>;
│ │ │ -
61
│ │ │ -
62public:
│ │ │ -
63
│ │ │ -
65 using MultiIndex =
│ │ │ -
66 std::conditional_t<(PreBasis::minMultiIndexSize == PreBasis::maxMultiIndexSize),
│ │ │ - │ │ │ -
68 Dune::ReservedVector<size_type, PreBasis::multiIndexBufferSize>>;
│ │ │ -
69
│ │ │ -
70
│ │ │ -
│ │ │ - │ │ │ - │ │ │ -
74 tree_(globalBasis_->preBasis().makeNode())
│ │ │ -
75 {
│ │ │ -
76 static_assert(models<Concept::BasisTree<GridView>, Tree>(), "Tree type passed to DefaultLocalView does not model the BasisNode concept.");
│ │ │ - │ │ │ -
78 }
│ │ │ -
│ │ │ -
79
│ │ │ -
│ │ │ - │ │ │ - │ │ │ -
83 tree_(globalBasis_->preBasis().makeNode())
│ │ │ -
84 {
│ │ │ - │ │ │ -
86 if (other.bound())
│ │ │ -
87 bind(other.element());
│ │ │ -
88 }
│ │ │ -
│ │ │ -
89
│ │ │ -
│ │ │ -
95 void bind(const Element& e)
│ │ │ -
96 {
│ │ │ -
97 element_ = e;
│ │ │ - │ │ │ -
99 indices_.resize(size());
│ │ │ -
100 globalBasis_->preBasis().indices(tree_, indices_.begin());
│ │ │ -
101 }
│ │ │ -
│ │ │ -
102
│ │ │ -
│ │ │ -
105 bool bound() const
│ │ │ -
106 {
│ │ │ -
107 return static_cast<bool>(element_);
│ │ │ -
108 }
│ │ │ -
│ │ │ -
109
│ │ │ -
│ │ │ -
114 const Element& element() const
│ │ │ -
115 {
│ │ │ -
116 return *element_;
│ │ │ -
117 }
│ │ │ -
│ │ │ -
118
│ │ │ -
│ │ │ -
123 void unbind()
│ │ │ -
124 {
│ │ │ -
125 element_.reset();
│ │ │ -
126 }
│ │ │ -
│ │ │ -
127
│ │ │ -
│ │ │ -
132 const Tree& tree() const
│ │ │ -
133 {
│ │ │ -
134 return tree_;
│ │ │ -
135 }
│ │ │ -
│ │ │ -
136
│ │ │ -
│ │ │ - │ │ │ -
140 {
│ │ │ -
141 return tree_.size();
│ │ │ -
142 }
│ │ │ -
│ │ │ -
143
│ │ │ -
│ │ │ - │ │ │ -
151 {
│ │ │ -
152 return globalBasis_->preBasis().maxNodeSize();
│ │ │ -
153 }
│ │ │ -
│ │ │ -
154
│ │ │ -
│ │ │ -
156 const MultiIndex& index(size_type i) const
│ │ │ -
157 {
│ │ │ -
158 return indices_[i];
│ │ │ -
159 }
│ │ │ -
│ │ │ -
160
│ │ │ -
│ │ │ - │ │ │ -
164 {
│ │ │ -
165 return *globalBasis_;
│ │ │ -
166 }
│ │ │ -
│ │ │ -
167
│ │ │ -
│ │ │ - │ │ │ -
169 {
│ │ │ -
170 return *this;
│ │ │ -
171 }
│ │ │ -
│ │ │ -
172
│ │ │ -
173protected:
│ │ │ - │ │ │ -
175 std::optional<Element> element_;
│ │ │ - │ │ │ -
177 std::vector<MultiIndexStorage> indices_;
│ │ │ -
178};
│ │ │ -
│ │ │ -
179
│ │ │ -
180
│ │ │ -
181
│ │ │ -
182} // end namespace Functions
│ │ │ -
183} // end namespace Dune
│ │ │ -
184
│ │ │ -
185
│ │ │ -
186
│ │ │ -
187#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH
│ │ │ - │ │ │ - │ │ │ + │ │ │ +
49
│ │ │ +
│ │ │ + │ │ │ +
52 gv_(gv)
│ │ │ +
53 {}
│ │ │ +
│ │ │ +
54
│ │ │ +
│ │ │ +
56 bool contains(const Element& e) const
│ │ │ +
57 {
│ │ │ +
58 return gv_.contains(e);
│ │ │ +
59 }
│ │ │ +
│ │ │ +
60
│ │ │ +
│ │ │ +
62 size_t size() const
│ │ │ +
63 {
│ │ │ +
64 return gv_.size(codim);
│ │ │ +
65 }
│ │ │ +
│ │ │ +
66
│ │ │ +
│ │ │ + │ │ │ +
69 {
│ │ │ +
70 return gv_.template begin<codim>();
│ │ │ +
71 }
│ │ │ +
│ │ │ +
72
│ │ │ +
│ │ │ + │ │ │ +
75 {
│ │ │ +
76 return gv_.template end<codim>();
│ │ │ +
77 }
│ │ │ +
│ │ │ +
78
│ │ │ +
│ │ │ +
80 const GridView& gridView() const
│ │ │ +
81 {
│ │ │ +
82 return gv_;
│ │ │ +
83 }
│ │ │ +
│ │ │ +
84
│ │ │ +
85private:
│ │ │ +
86 GridView gv_;
│ │ │ +
87};
│ │ │ +
│ │ │ +
88
│ │ │ +
89
│ │ │ +
90} // end of namespace Dune::Functions
│ │ │ +
91} // end of namespace Dune
│ │ │ +
92
│ │ │ +
93#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH
│ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
void bindTree(Tree &tree, const Entity &entity, std::size_t offset=0)
Definition nodes.hh:469
│ │ │ -
void initializeTree(Tree &tree, std::size_t treeIndexOffset=0)
Definition nodes.hh:476
│ │ │ -
A statically sized MultiIndex type.
Definition multiindex.hh:30
│ │ │ -
A dynamically sized array-like class with overflow.
Definition overflowarray.hh:49
│ │ │ -
typename PreBasis::GridView GridView
The grid view that the FE space is defined on.
Definition defaultglobalbasis.hh:64
│ │ │ -
PB PreBasis
Pre-basis providing the implementation details.
Definition defaultglobalbasis.hh:58
│ │ │ -
typename GlobalBasis::PreBasis PreBasis
Definition defaultlocalview.hh:52
│ │ │ -
void unbind()
Unbind from the current element.
Definition defaultlocalview.hh:123
│ │ │ -
bool bound() const
Return if the view is bound to a grid element.
Definition defaultlocalview.hh:105
│ │ │ -
typename GlobalBasis::GridView GridView
Definition defaultlocalview.hh:39
│ │ │ -
const MultiIndex & index(size_type i) const
Maps from subtree index set [0..size-1] to a globally unique multi index in global basis.
Definition defaultlocalview.hh:156
│ │ │ -
DefaultLocalView(const DefaultLocalView &other)
Deep copy of the local view.
Definition defaultlocalview.hh:81
│ │ │ -
std::optional< Element > element_
Definition defaultlocalview.hh:175
│ │ │ -
typename GridView::template Codim< 0 >::Entity Element
Definition defaultlocalview.hh:42
│ │ │ -
const Tree & tree() const
Return the local ansatz tree associated to the bound entity.
Definition defaultlocalview.hh:132
│ │ │ -
std::conditional_t<(PreBasis::minMultiIndexSize==PreBasis::maxMultiIndexSize), StaticMultiIndex< size_type, PreBasis::maxMultiIndexSize >, Dune::ReservedVector< size_type, PreBasis::multiIndexBufferSize > > MultiIndex
Definition defaultlocalview.hh:65
│ │ │ -
void bind(const Element &e)
Bind the view to a grid element.
Definition defaultlocalview.hh:95
│ │ │ -
const Element & element() const
Return the grid element that the view is bound to.
Definition defaultlocalview.hh:114
│ │ │ -
size_type size() const
Total number of degrees of freedom on this element.
Definition defaultlocalview.hh:139
│ │ │ -
DefaultGlobalBasis< PreBasis > GlobalBasis
Definition defaultlocalview.hh:36
│ │ │ - │ │ │ -
size_type maxSize() const
Maximum local size for any element on the GridView.
Definition defaultlocalview.hh:150
│ │ │ -
std::size_t size_type
Definition defaultlocalview.hh:45
│ │ │ -
const DefaultLocalView & rootLocalView() const
Definition defaultlocalview.hh:168
│ │ │ -
std::conditional_t<(PreBasis::minMultiIndexSize==PreBasis::maxMultiIndexSize), OverflowArray< StaticMultiIndex< size_type, PreBasis::maxMultiIndexSize >, PreBasis::multiIndexBufferSize >, Dune::ReservedVector< size_type, PreBasis::multiIndexBufferSize > > MultiIndexStorage
Definition defaultlocalview.hh:57
│ │ │ -
std::vector< MultiIndexStorage > indices_
Definition defaultlocalview.hh:177
│ │ │ -
typename GlobalBasis::PreBasis::Node Tree
Definition defaultlocalview.hh:48
│ │ │ -
DefaultLocalView(const GlobalBasis &globalBasis)
Construct local view for a given global finite element basis.
Definition defaultlocalview.hh:72
│ │ │ -
const GlobalBasis * globalBasis_
Definition defaultlocalview.hh:174
│ │ │ -
const GlobalBasis & globalBasis() const
Definition defaultlocalview.hh:163
│ │ │ - │ │ │ +
GridViewEntitySet(const GridView &gv)
Construct GridViewEntitySet for a GridView.
Definition gridviewentityset.hh:51
│ │ │ +
GridView GridView
Definition gridviewentityset.hh:30
│ │ │ +
GridView::template Codim< codim >::Entity Element
Definition gridviewentityset.hh:36
│ │ │ +
const_iterator end() const
Create an end iterator.
Definition gridviewentityset.hh:74
│ │ │ +
const GridView & gridView() const
Return the associated GridView.
Definition gridviewentityset.hh:80
│ │ │ +
Element value_type
Definition gridviewentityset.hh:42
│ │ │ +
const_iterator begin() const
Create a begin iterator.
Definition gridviewentityset.hh:68
│ │ │ +
GridView::template Codim< codim >::Iterator const_iterator
Definition gridviewentityset.hh:45
│ │ │ +
Element::Geometry::LocalCoordinate LocalCoordinate
Definition gridviewentityset.hh:39
│ │ │ +
size_t size() const
Return number of Elements visited by an iterator.
Definition gridviewentityset.hh:62
│ │ │ +
@ codim
Definition gridviewentityset.hh:32
│ │ │ +
Element::Geometry::GlobalCoordinate GlobalCoordinate
Definition gridviewentityset.hh:40
│ │ │ +
bool contains(const Element &e) const
Return true if e is contained in the EntitySet.
Definition gridviewentityset.hh:56
│ │ │ +
const_iterator iterator
Definition gridviewentityset.hh:48
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,284 +1,141 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -defaultlocalview.hh │ │ │ │ +gridviewentityset.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH │ │ │ │ +8#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH │ │ │ │ 9 │ │ │ │ -10 │ │ │ │ -11#include │ │ │ │ -12#include │ │ │ │ -13 │ │ │ │ -14#include │ │ │ │ -15#include │ │ │ │ -16#include │ │ │ │ +10#include │ │ │ │ +11 │ │ │ │ +12 │ │ │ │ +13namespace _D_u_n_e { │ │ │ │ +14 │ │ │ │ +15namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +16 │ │ │ │ 17 │ │ │ │ -18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_o_v_e_r_f_l_o_w_a_r_r_a_y_._h_h> │ │ │ │ -19#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_m_u_l_t_i_i_n_d_e_x_._h_h> │ │ │ │ -20#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ -21 │ │ │ │ -22 │ │ │ │ -23 │ │ │ │ -24namespace _D_u_n_e { │ │ │ │ -25namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -26 │ │ │ │ -27 │ │ │ │ -28 │ │ │ │ -30template │ │ │ │ -_3_1class _D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w │ │ │ │ -32{ │ │ │ │ -33public: │ │ │ │ +25template │ │ │ │ +_2_6class _G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t │ │ │ │ +27{ │ │ │ │ +28public: │ │ │ │ +29 │ │ │ │ +_3_0 typedef GV _G_r_i_d_V_i_e_w; │ │ │ │ +31 enum { │ │ │ │ +_3_2 _c_o_d_i_m = cd │ │ │ │ +33 }; │ │ │ │ 34 │ │ │ │ -_3_6 using _G_l_o_b_a_l_B_a_s_i_s = GB; │ │ │ │ +_3_6 typedef typename GridView::template Codim::Entity _E_l_e_m_e_n_t; │ │ │ │ 37 │ │ │ │ -_3_9 using _G_r_i_d_V_i_e_w = typename _G_l_o_b_a_l_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w; │ │ │ │ -40 │ │ │ │ -_4_2 using _E_l_e_m_e_n_t = typename GridView::template Codim<0>::Entity; │ │ │ │ +_3_9 typedef typename Element::Geometry::LocalCoordinate _L_o_c_a_l_C_o_o_r_d_i_n_a_t_e; │ │ │ │ +_4_0 typedef typename Element::Geometry::GlobalCoordinate _G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e; │ │ │ │ +41 │ │ │ │ +_4_2 typedef _E_l_e_m_e_n_t _v_a_l_u_e___t_y_p_e; │ │ │ │ 43 │ │ │ │ -_4_5 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ +_4_5 typedef typename GridView::template Codim::Iterator _c_o_n_s_t___i_t_e_r_a_t_o_r; │ │ │ │ 46 │ │ │ │ -_4_8 using _T_r_e_e = typename GlobalBasis::PreBasis::Node; │ │ │ │ +_4_8 typedef _c_o_n_s_t___i_t_e_r_a_t_o_r _i_t_e_r_a_t_o_r; │ │ │ │ 49 │ │ │ │ -50protected: │ │ │ │ -51 │ │ │ │ -_5_2 using _P_r_e_B_a_s_i_s = typename _G_l_o_b_a_l_B_a_s_i_s_:_:_P_r_e_B_a_s_i_s; │ │ │ │ -53 │ │ │ │ -54 // Type used to store the multi indices of the basis vectors. │ │ │ │ -55 // In contrast to MultiIndex this always has dynamic size. │ │ │ │ -56 // It's guaranteed, that you can always cast it to MultiIndex │ │ │ │ -_5_7 using _M_u_l_t_i_I_n_d_e_x_S_t_o_r_a_g_e = │ │ │ │ -58 std::conditional_t<(PreBasis::minMultiIndexSize == PreBasis:: │ │ │ │ -maxMultiIndexSize), │ │ │ │ -59 _O_v_e_r_f_l_o_w_A_r_r_a_y<_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x_<_s_i_z_e___t_y_p_e_,_ _P_r_e_B_a_s_i_s_:_:_m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e_>, │ │ │ │ -PreBasis::multiIndexBufferSize>, │ │ │ │ -60 Dune::ReservedVector>; │ │ │ │ -61 │ │ │ │ -62public: │ │ │ │ -63 │ │ │ │ -_6_5 using _M_u_l_t_i_I_n_d_e_x = │ │ │ │ -66 std::conditional_t<(PreBasis::minMultiIndexSize == PreBasis:: │ │ │ │ -maxMultiIndexSize), │ │ │ │ -67 _S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x_<_s_i_z_e___t_y_p_e_,_ _P_r_e_B_a_s_i_s_:_:_m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e_>, │ │ │ │ -68 Dune::ReservedVector>; │ │ │ │ -69 │ │ │ │ -70 │ │ │ │ -_7_2 _D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w(const _G_l_o_b_a_l_B_a_s_i_s& _g_l_o_b_a_l_B_a_s_i_s) : │ │ │ │ -73 _g_l_o_b_a_l_B_a_s_i_s__(&_g_l_o_b_a_l_B_a_s_i_s), │ │ │ │ -74 _t_r_e_e__(_g_l_o_b_a_l_B_a_s_i_s__->preBasis().makeNode()) │ │ │ │ +_5_1 _G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t(const _G_r_i_d_V_i_e_w& gv) : │ │ │ │ +52 gv_(gv) │ │ │ │ +53 {} │ │ │ │ +54 │ │ │ │ +_5_6 bool _c_o_n_t_a_i_n_s(const _E_l_e_m_e_n_t& e) const │ │ │ │ +57 { │ │ │ │ +58 return gv_.contains(e); │ │ │ │ +59 } │ │ │ │ +60 │ │ │ │ +_6_2 size_t _s_i_z_e() const │ │ │ │ +63 { │ │ │ │ +64 return gv_.size(_c_o_d_i_m); │ │ │ │ +65 } │ │ │ │ +66 │ │ │ │ +_6_8 _c_o_n_s_t___i_t_e_r_a_t_o_r _b_e_g_i_n() const │ │ │ │ +69 { │ │ │ │ +70 return gv_.template _b_e_g_i_n_<_c_o_d_i_m_>(); │ │ │ │ +71 } │ │ │ │ +72 │ │ │ │ +_7_4 _c_o_n_s_t___i_t_e_r_a_t_o_r _e_n_d() const │ │ │ │ 75 { │ │ │ │ -76 static_assert(models, _T_r_e_e>(), "Tree type │ │ │ │ -passed to DefaultLocalView does not model the BasisNode concept."); │ │ │ │ -77 _i_n_i_t_i_a_l_i_z_e_T_r_e_e(_t_r_e_e__); │ │ │ │ -78 } │ │ │ │ -79 │ │ │ │ -_8_1 _D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w(const _D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w& other) : │ │ │ │ -82 _g_l_o_b_a_l_B_a_s_i_s__(other._g_l_o_b_a_l_B_a_s_i_s__), │ │ │ │ -83 _t_r_e_e__(_g_l_o_b_a_l_B_a_s_i_s__->preBasis().makeNode()) │ │ │ │ -84 { │ │ │ │ -85 _i_n_i_t_i_a_l_i_z_e_T_r_e_e(_t_r_e_e__); │ │ │ │ -86 if (other._b_o_u_n_d()) │ │ │ │ -87 _b_i_n_d(other._e_l_e_m_e_n_t()); │ │ │ │ -88 } │ │ │ │ +76 return gv_.template _e_n_d_<_c_o_d_i_m_>(); │ │ │ │ +77 } │ │ │ │ +78 │ │ │ │ +_8_0 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ +81 { │ │ │ │ +82 return gv_; │ │ │ │ +83 } │ │ │ │ +84 │ │ │ │ +85private: │ │ │ │ +86 _G_r_i_d_V_i_e_w gv_; │ │ │ │ +87}; │ │ │ │ +88 │ │ │ │ 89 │ │ │ │ -_9_5 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ -96 { │ │ │ │ -97 _e_l_e_m_e_n_t__ = e; │ │ │ │ -98 _b_i_n_d_T_r_e_e(_t_r_e_e__, *_e_l_e_m_e_n_t__); │ │ │ │ -99 _i_n_d_i_c_e_s__.resize(_s_i_z_e()); │ │ │ │ -100 _g_l_o_b_a_l_B_a_s_i_s__->preBasis().indices(_t_r_e_e__, _i_n_d_i_c_e_s__.begin()); │ │ │ │ -101 } │ │ │ │ -102 │ │ │ │ -_1_0_5 bool _b_o_u_n_d() const │ │ │ │ -106 { │ │ │ │ -107 return static_cast(_e_l_e_m_e_n_t__); │ │ │ │ -108 } │ │ │ │ -109 │ │ │ │ -_1_1_4 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ -115 { │ │ │ │ -116 return *_e_l_e_m_e_n_t__; │ │ │ │ -117 } │ │ │ │ -118 │ │ │ │ -_1_2_3 void _u_n_b_i_n_d() │ │ │ │ -124 { │ │ │ │ -125 _e_l_e_m_e_n_t__.reset(); │ │ │ │ -126 } │ │ │ │ -127 │ │ │ │ -_1_3_2 const _T_r_e_e& _t_r_e_e() const │ │ │ │ -133 { │ │ │ │ -134 return _t_r_e_e__; │ │ │ │ -135 } │ │ │ │ -136 │ │ │ │ -_1_3_9 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ -140 { │ │ │ │ -141 return _t_r_e_e__.size(); │ │ │ │ -142 } │ │ │ │ -143 │ │ │ │ -_1_5_0 _s_i_z_e___t_y_p_e _m_a_x_S_i_z_e() const │ │ │ │ -151 { │ │ │ │ -152 return _g_l_o_b_a_l_B_a_s_i_s__->preBasis().maxNodeSize(); │ │ │ │ -153 } │ │ │ │ -154 │ │ │ │ -_1_5_6 const _M_u_l_t_i_I_n_d_e_x& _i_n_d_e_x(_s_i_z_e___t_y_p_e i) const │ │ │ │ -157 { │ │ │ │ -158 return _i_n_d_i_c_e_s__[i]; │ │ │ │ -159 } │ │ │ │ -160 │ │ │ │ -_1_6_3 const _G_l_o_b_a_l_B_a_s_i_s& _g_l_o_b_a_l_B_a_s_i_s() const │ │ │ │ -164 { │ │ │ │ -165 return *_g_l_o_b_a_l_B_a_s_i_s__; │ │ │ │ -166 } │ │ │ │ -167 │ │ │ │ -_1_6_8 const _D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w& _r_o_o_t_L_o_c_a_l_V_i_e_w() const │ │ │ │ -169 { │ │ │ │ -170 return *this; │ │ │ │ -171 } │ │ │ │ -172 │ │ │ │ -173protected: │ │ │ │ -_1_7_4 const _G_l_o_b_a_l_B_a_s_i_s* _g_l_o_b_a_l_B_a_s_i_s__; │ │ │ │ -_1_7_5 std::optional _e_l_e_m_e_n_t__; │ │ │ │ -_1_7_6 _T_r_e_e _t_r_e_e__; │ │ │ │ -_1_7_7 std::vector _i_n_d_i_c_e_s__; │ │ │ │ -178}; │ │ │ │ -179 │ │ │ │ -180 │ │ │ │ -181 │ │ │ │ -182} // end namespace Functions │ │ │ │ -183} // end namespace Dune │ │ │ │ -184 │ │ │ │ -185 │ │ │ │ -186 │ │ │ │ -187#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH │ │ │ │ -_o_v_e_r_f_l_o_w_a_r_r_a_y_._h_h │ │ │ │ -_m_u_l_t_i_i_n_d_e_x_._h_h │ │ │ │ +90} // end of namespace Dune::Functions │ │ │ │ +91} // end of namespace Dune │ │ │ │ +92 │ │ │ │ +93#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_b_i_n_d_T_r_e_e │ │ │ │ -void bindTree(Tree &tree, const Entity &entity, std::size_t offset=0) │ │ │ │ -DDeeffiinniittiioonn nodes.hh:469 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_i_n_i_t_i_a_l_i_z_e_T_r_e_e │ │ │ │ -void initializeTree(Tree &tree, std::size_t treeIndexOffset=0) │ │ │ │ -DDeeffiinniittiioonn nodes.hh:476 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x │ │ │ │ -A statically sized MultiIndex type. │ │ │ │ -DDeeffiinniittiioonn multiindex.hh:30 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y │ │ │ │ -A dynamically sized array-like class with overflow. │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:49 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ -typename PreBasis::GridView GridView │ │ │ │ -The grid view that the FE space is defined on. │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:64 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_:_:_P_r_e_B_a_s_i_s │ │ │ │ -PB PreBasis │ │ │ │ -Pre-basis providing the implementation details. │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:58 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_r_e_B_a_s_i_s_ _>_ _>_:_:_P_r_e_B_a_s_i_s │ │ │ │ -typename GlobalBasis::PreBasis PreBasis │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:52 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_:_:_u_n_b_i_n_d │ │ │ │ -void unbind() │ │ │ │ -Unbind from the current element. │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:123 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_:_:_b_o_u_n_d │ │ │ │ -bool bound() const │ │ │ │ -Return if the view is bound to a grid element. │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:105 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_r_e_B_a_s_i_s_ _>_ _>_:_:_G_r_i_d_V_i_e_w │ │ │ │ -typename GlobalBasis::GridView GridView │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:39 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_:_:_i_n_d_e_x │ │ │ │ -const MultiIndex & index(size_type i) const │ │ │ │ -Maps from subtree index set [0..size-1] to a globally unique multi index in │ │ │ │ -global basis. │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:156 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w │ │ │ │ -DefaultLocalView(const DefaultLocalView &other) │ │ │ │ -Deep copy of the local view. │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:81 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_r_e_B_a_s_i_s_ _>_ _>_:_:_e_l_e_m_e_n_t__ │ │ │ │ -std::optional< Element > element_ │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:175 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_r_e_B_a_s_i_s_ _>_ _>_:_:_E_l_e_m_e_n_t │ │ │ │ -typename GridView::template Codim< 0 >::Entity Element │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:42 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_:_:_t_r_e_e │ │ │ │ -const Tree & tree() const │ │ │ │ -Return the local ansatz tree associated to the bound entity. │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:132 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_r_e_B_a_s_i_s_ _>_ _>_:_:_M_u_l_t_i_I_n_d_e_x │ │ │ │ -std::conditional_t<(PreBasis::minMultiIndexSize==PreBasis::maxMultiIndexSize), │ │ │ │ -StaticMultiIndex< size_type, PreBasis::maxMultiIndexSize >, Dune:: │ │ │ │ -ReservedVector< size_type, PreBasis::multiIndexBufferSize > > MultiIndex │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:65 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_:_:_b_i_n_d │ │ │ │ -void bind(const Element &e) │ │ │ │ -Bind the view to a grid element. │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:95 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_:_:_e_l_e_m_e_n_t │ │ │ │ -const Element & element() const │ │ │ │ -Return the grid element that the view is bound to. │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:114 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_:_:_s_i_z_e │ │ │ │ -size_type size() const │ │ │ │ -Total number of degrees of freedom on this element. │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:139 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_r_e_B_a_s_i_s_ _>_ _>_:_: │ │ │ │ -_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ -DefaultGlobalBasis< PreBasis > GlobalBasis │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:36 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_r_e_B_a_s_i_s_ _>_ _>_:_:_t_r_e_e__ │ │ │ │ -Tree tree_ │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:176 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_:_:_m_a_x_S_i_z_e │ │ │ │ -size_type maxSize() const │ │ │ │ -Maximum local size for any element on the GridView. │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:150 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_r_e_B_a_s_i_s_ _>_ _>_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:45 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_:_:_r_o_o_t_L_o_c_a_l_V_i_e_w │ │ │ │ -const DefaultLocalView & rootLocalView() const │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:168 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_r_e_B_a_s_i_s_ _>_ _>_:_: │ │ │ │ -_M_u_l_t_i_I_n_d_e_x_S_t_o_r_a_g_e │ │ │ │ -std::conditional_t<(PreBasis::minMultiIndexSize==PreBasis::maxMultiIndexSize), │ │ │ │ -OverflowArray< StaticMultiIndex< size_type, PreBasis::maxMultiIndexSize >, │ │ │ │ -PreBasis::multiIndexBufferSize >, Dune::ReservedVector< size_type, PreBasis:: │ │ │ │ -multiIndexBufferSize > > MultiIndexStorage │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:57 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_r_e_B_a_s_i_s_ _>_ _>_:_:_i_n_d_i_c_e_s__ │ │ │ │ -std::vector< MultiIndexStorage > indices_ │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:177 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_r_e_B_a_s_i_s_ _>_ _>_:_:_T_r_e_e │ │ │ │ -typename GlobalBasis::PreBasis::Node Tree │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:48 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w │ │ │ │ -DefaultLocalView(const GlobalBasis &globalBasis) │ │ │ │ -Construct local view for a given global finite element basis. │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:72 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_r_e_B_a_s_i_s_ _>_ _>_:_: │ │ │ │ -_g_l_o_b_a_l_B_a_s_i_s__ │ │ │ │ -const GlobalBasis * globalBasis_ │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:174 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_r_e_B_a_s_i_s_ _>_ _>_:_: │ │ │ │ -_g_l_o_b_a_l_B_a_s_i_s │ │ │ │ -const GlobalBasis & globalBasis() const │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:163 │ │ │ │ -_c_o_n_c_e_p_t_s_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t │ │ │ │ +GridViewEntitySet(const GridView &gv) │ │ │ │ +Construct GridViewEntitySet for a GridView. │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:51 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_G_r_i_d_V_i_e_w │ │ │ │ +GridView GridView │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:30 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_E_l_e_m_e_n_t │ │ │ │ +GridView::template Codim< codim >::Entity Element │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:36 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_:_:_e_n_d │ │ │ │ +const_iterator end() const │ │ │ │ +Create an end iterator. │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:74 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_:_:_g_r_i_d_V_i_e_w │ │ │ │ +const GridView & gridView() const │ │ │ │ +Return the associated GridView. │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:80 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_v_a_l_u_e___t_y_p_e │ │ │ │ +Element value_type │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:42 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_:_:_b_e_g_i_n │ │ │ │ +const_iterator begin() const │ │ │ │ +Create a begin iterator. │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:68 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_c_o_n_s_t___i_t_e_r_a_t_o_r │ │ │ │ +GridView::template Codim< codim >::Iterator const_iterator │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:45 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ +Element::Geometry::LocalCoordinate LocalCoordinate │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:39 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_:_:_s_i_z_e │ │ │ │ +size_t size() const │ │ │ │ +Return number of Elements visited by an iterator. │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:62 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_c_o_d_i_m │ │ │ │ +@ codim │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:32 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ +Element::Geometry::GlobalCoordinate GlobalCoordinate │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:40 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_:_:_c_o_n_t_a_i_n_s │ │ │ │ +bool contains(const Element &e) const │ │ │ │ +Return true if e is contained in the EntitySet. │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:56 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t_<_ _G_r_i_d_V_i_e_w_,_ _0_ _>_:_:_i_t_e_r_a_t_o_r │ │ │ │ +const_iterator iterator │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:48 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _d_e_f_a_u_l_t_l_o_c_a_l_v_i_e_w_._h_h │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ + * _g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00164.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: defaultglobalbasis.hh File Reference │ │ │ +Dune-Functions: globalvaluedlocalfiniteelement.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,63 +88,47 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
defaultglobalbasis.hh File Reference
│ │ │ +
globalvaluedlocalfiniteelement.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <cstddef>
│ │ │ -#include <type_traits>
│ │ │ -#include <utility>
│ │ │ -#include <dune/common/reservedvector.hh>
│ │ │ -#include <dune/common/typeutilities.hh>
│ │ │ -#include <dune/common/concept.hh>
│ │ │ -#include <dune/common/typetree/treepath.hh>
│ │ │ -#include <dune/functions/common/type_traits.hh>
│ │ │ -#include <dune/functions/functionspacebases/defaultlocalview.hh>
│ │ │ -#include <dune/functions/functionspacebases/concepts.hh>
│ │ │ -#include <dune/functions/functionspacebases/containerdescriptors.hh>
│ │ │ +
#include <array>
│ │ │ +#include <numeric>
│ │ │ +#include <dune/common/fmatrix.hh>
│ │ │ +#include <dune/common/fvector.hh>
│ │ │ +#include <dune/common/math.hh>
│ │ │ +#include <dune/common/rangeutilities.hh>
│ │ │ +#include <dune/geometry/referenceelements.hh>
│ │ │ +#include <dune/localfunctions/common/localbasis.hh>
│ │ │ +#include <dune/localfunctions/common/localfiniteelementtraits.hh>
│ │ │ +#include <dune/functions/common/densevectorview.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ -

│ │ │ -Classes

class  Dune::Functions::DefaultGlobalBasis< PB >
 Global basis for given pre-basis. More...
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ -

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::BasisFactory
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │

│ │ │ -Functions

template<class PreBasis>
 Dune::Functions::DefaultGlobalBasis (PreBasis &&) -> DefaultGlobalBasis< std::decay_t< PreBasis > >
template<class GridView, class PreBasisFactory>
 Dune::Functions::DefaultGlobalBasis (const GridView &gv, PreBasisFactory &&f) -> DefaultGlobalBasis< std::decay_t< decltype(f(gv))> >
template<class GridView, class PreBasisFactory>
auto Dune::Functions::BasisFactory::makeBasis (const GridView &gridView, PreBasisFactory &&preBasisFactory)
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,39 +1,24 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -defaultglobalbasis.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_l_o_c_a_l_v_i_e_w_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h> │ │ │ │ +globalvaluedlocalfiniteelement.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_n_s_e_v_e_c_t_o_r_v_i_e_w_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ -CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_B_ _> │ │ │ │ -  Global basis for given pre-basis. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s (PreBasis &&) -> DefaultGlobalBasis< │ │ │ │ - std::decay_t< PreBasis > > │ │ │ │ -template │ │ │ │ -   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s (const GridView &gv, PreBasisFactory │ │ │ │ - &&f) -> DefaultGlobalBasis< std::decay_t< decltype(f(gv))> > │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_m_a_k_e_B_a_s_i_s (const GridView &gridView, │ │ │ │ - PreBasisFactory &&preBasisFactory) │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ + * _g_l_o_b_a_l_v_a_l_u_e_d_l_o_c_a_l_f_i_n_i_t_e_e_l_e_m_e_n_t_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00164_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: defaultglobalbasis.hh Source File │ │ │ +Dune-Functions: globalvaluedlocalfiniteelement.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,252 +88,355 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
defaultglobalbasis.hh
│ │ │ +
globalvaluedlocalfiniteelement.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH
│ │ │ +
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH
│ │ │
9
│ │ │ -
10#include <cstddef>
│ │ │ -
11#include <type_traits>
│ │ │ -
12#include <utility>
│ │ │ -
13
│ │ │ -
14#include <dune/common/reservedvector.hh>
│ │ │ -
15#include <dune/common/typeutilities.hh>
│ │ │ -
16#include <dune/common/concept.hh>
│ │ │ +
10#include <array>
│ │ │ +
11#include <numeric>
│ │ │ +
12
│ │ │ +
13#include <dune/common/fmatrix.hh>
│ │ │ +
14#include <dune/common/fvector.hh>
│ │ │ +
15#include <dune/common/math.hh>
│ │ │ +
16#include <dune/common/rangeutilities.hh>
│ │ │
17
│ │ │ -
18#include <dune/common/typetree/treepath.hh>
│ │ │ +
18#include <dune/geometry/referenceelements.hh>
│ │ │
19
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ +
20#include <dune/localfunctions/common/localbasis.hh>
│ │ │ +
21#include <dune/localfunctions/common/localfiniteelementtraits.hh>
│ │ │ +
22
│ │ │ + │ │ │
24
│ │ │ -
25
│ │ │ -
26
│ │ │ -
27namespace Dune {
│ │ │ -
28namespace Functions {
│ │ │ -
29
│ │ │ -
30
│ │ │ -
31
│ │ │ -
51template<class PB>
│ │ │ -
│ │ │ - │ │ │ -
53{
│ │ │ +
25namespace Dune::Functions::Impl
│ │ │ +
26{
│ │ │ +
27
│ │ │ +
41 struct ContravariantPiolaTransformator
│ │ │ +
42 {
│ │ │ +
47 template<typename Values, typename LocalCoordinate, typename Geometry>
│ │ │ +
48 static auto apply(Values& values,
│ │ │ +
49 const LocalCoordinate& xi,
│ │ │ +
50 const Geometry& geometry)
│ │ │ +
51 {
│ │ │ +
52 auto jacobianTransposed = geometry.jacobianTransposed(xi);
│ │ │ +
53 auto integrationElement = geometry.integrationElement(xi);
│ │ │
54
│ │ │ -
55public:
│ │ │ -
56
│ │ │ -
58 using PreBasis = PB;
│ │ │ -
59
│ │ │ -
61 using PrefixPath = TypeTree::TreePath<>;
│ │ │ -
62
│ │ │ -
64 using GridView = typename PreBasis::GridView;
│ │ │ -
65
│ │ │ -
67 using size_type = std::size_t;
│ │ │ -
68
│ │ │ - │ │ │ -
71
│ │ │ - │ │ │ -
74
│ │ │ -
76 using SizePrefix = Dune::ReservedVector<std::size_t, PreBasis::multiIndexBufferSize>;
│ │ │ -
77
│ │ │ -
86 template<class... T,
│ │ │ -
87 disableCopyMove<DefaultGlobalBasis, T...> = 0,
│ │ │ - │ │ │ -
│ │ │ - │ │ │ -
90 preBasis_(std::forward<T>(t)...),
│ │ │ - │ │ │ -
92 {
│ │ │ -
93 static_assert(models<Concept::PreBasis<GridView>, PreBasis>(), "Type passed to DefaultGlobalBasis does not model the PreBasis concept.");
│ │ │ -
94 preBasis_.initializeIndices();
│ │ │ -
95 }
│ │ │ -
│ │ │ +
55 for (auto& value : values)
│ │ │ +
56 {
│ │ │ +
57 auto tmp = value;
│ │ │ +
58 // Here we cannot directly use
│ │ │ +
59 // jacobianTransposed.mtv(tmp, value);
│ │ │ +
60 // because mtv expects the DenseVector interface.
│ │ │ +
61 auto tmpDenseVector = Impl::DenseVectorView(tmp);
│ │ │ +
62 auto valueDenseVector = Impl::DenseVectorView(value);
│ │ │ +
63 jacobianTransposed.mtv(tmpDenseVector, valueDenseVector);
│ │ │ +
64 value /= integrationElement;
│ │ │ +
65 }
│ │ │ +
66 }
│ │ │ +
67
│ │ │ +
77 template<typename Gradients, typename LocalCoordinate, typename Geometry>
│ │ │ +
78 static auto applyJacobian(Gradients& gradients,
│ │ │ +
79 const LocalCoordinate& xi,
│ │ │ +
80 const Geometry& geometry)
│ │ │ +
81 {
│ │ │ +
82 auto jacobianTransposed = geometry.jacobianTransposed(xi);
│ │ │ +
83 auto integrationElement = geometry.integrationElement(xi);
│ │ │ +
84 for (auto& gradient : gradients)
│ │ │ +
85 {
│ │ │ +
86 auto tmp = gradient;
│ │ │ +
87 gradient = 0;
│ │ │ +
88 for (size_t k=0; k<gradient.M(); k++)
│ │ │ +
89 for (size_t l=0; l<tmp.N(); l++)
│ │ │ +
90 // Use sparseRange because jacobianTransposed may be a sparse DiagonalMatrix
│ │ │ +
91 for(auto&& [jacobianTransposed_l_j, j] : sparseRange(jacobianTransposed[l]))
│ │ │ +
92 gradient[j][k] += jacobianTransposed_l_j * tmp[l][k];
│ │ │ +
93 gradient /= integrationElement;
│ │ │ +
94 }
│ │ │ +
95 }
│ │ │
96
│ │ │ -
103 template<class PreBasisFactory,
│ │ │ -
104 std::enable_if_t<Dune::IsCallable<PreBasisFactory(GridView), PreBasis>::value, int> = 0>
│ │ │ -
│ │ │ -
105 DefaultGlobalBasis(const GridView& gridView, PreBasisFactory&& factory) :
│ │ │ -
106 preBasis_(factory(gridView)),
│ │ │ - │ │ │ -
108 {
│ │ │ -
109 static_assert(models<Concept::PreBasis<GridView>, PreBasis>(), "Type passed to DefaultGlobalBasis does not model the PreBasis concept.");
│ │ │ -
110 preBasis_.initializeIndices();
│ │ │ -
111 }
│ │ │ -
│ │ │ -
112
│ │ │ -
│ │ │ -
114 const GridView& gridView() const
│ │ │ -
115 {
│ │ │ -
116 return preBasis_.gridView();
│ │ │ -
117 }
│ │ │ -
│ │ │ -
118
│ │ │ -
│ │ │ -
120 const PreBasis& preBasis() const
│ │ │ -
121 {
│ │ │ -
122 return preBasis_;
│ │ │ -
123 }
│ │ │ -
│ │ │ -
124
│ │ │ -
│ │ │ - │ │ │ -
127 {
│ │ │ -
128 return preBasis_;
│ │ │ -
129 }
│ │ │ -
│ │ │ -
130
│ │ │ -
│ │ │ -
137 void update(const GridView & gv)
│ │ │ -
138 {
│ │ │ -
139 preBasis_.update(gv);
│ │ │ -
140 preBasis_.initializeIndices();
│ │ │ -
141 }
│ │ │ -
│ │ │ -
142
│ │ │ -
│ │ │ - │ │ │ -
145 {
│ │ │ -
146 return preBasis_.dimension();
│ │ │ -
147 }
│ │ │ -
│ │ │ -
148
│ │ │ -
│ │ │ - │ │ │ -
151 {
│ │ │ -
152 return preBasis_.size();
│ │ │ -
153 }
│ │ │ -
│ │ │ -
154
│ │ │ -
│ │ │ -
156 size_type size(const SizePrefix& prefix) const
│ │ │ -
157 {
│ │ │ -
158 return preBasis_.size(prefix);
│ │ │ -
159 }
│ │ │ -
│ │ │ -
160
│ │ │ -
│ │ │ - │ │ │ -
163 {
│ │ │ -
164 return LocalView(*this);
│ │ │ -
165 }
│ │ │ -
│ │ │ -
166
│ │ │ -
│ │ │ - │ │ │ -
169 {
│ │ │ -
170 return *this;
│ │ │ -
171 }
│ │ │ -
│ │ │ -
172
│ │ │ -
│ │ │ -
174 const PrefixPath& prefixPath() const
│ │ │ -
175 {
│ │ │ -
176 return prefixPath_;
│ │ │ -
177 }
│ │ │ -
│ │ │ +
104 template<class Function, class LocalCoordinate, class Element>
│ │ │ +
105 class LocalValuedFunction
│ │ │ +
106 {
│ │ │ +
107 const Function& f_;
│ │ │ +
108 const Element& element_;
│ │ │ +
109
│ │ │ +
110 using LocalValue = LocalCoordinate;
│ │ │ +
111
│ │ │ +
112 public:
│ │ │ +
113
│ │ │ +
114 LocalValuedFunction(const Function& f, const Element& element)
│ │ │ +
115 : f_(f), element_(element)
│ │ │ +
116 {}
│ │ │ +
117
│ │ │ +
118 auto operator()(const LocalCoordinate& xi) const
│ │ │ +
119 {
│ │ │ +
120 auto globalValue = f_(xi);
│ │ │ +
121
│ │ │ +
122 // Apply the inverse Piola transform
│ │ │ +
123 auto jacobianInverseTransposed = element_.geometry().jacobianInverseTransposed(xi);
│ │ │ +
124 auto integrationElement = element_.geometry().integrationElement(xi);
│ │ │ +
125
│ │ │ +
126 auto localValue = LocalValue{};
│ │ │ +
127
│ │ │ +
128 // Here we cannot directly use
│ │ │ +
129 // jacobianInverseTransposed.mtv(globalValue, localValue);
│ │ │ +
130 // because mtv expects the DenseVector interface.
│ │ │ +
131 auto globalValueDenseVector = Impl::DenseVectorView(globalValue);
│ │ │ +
132 auto localValueDenseVector = Impl::DenseVectorView(localValue);
│ │ │ +
133 jacobianInverseTransposed.mtv(globalValueDenseVector, localValueDenseVector);
│ │ │ +
134 localValue *= integrationElement;
│ │ │ +
135
│ │ │ +
136 return localValue;
│ │ │ +
137 }
│ │ │ +
138 };
│ │ │ +
139 };
│ │ │ +
140
│ │ │ +
154 struct CovariantPiolaTransformator
│ │ │ +
155 {
│ │ │ +
160 template<typename Values, typename LocalCoordinate, typename Geometry>
│ │ │ +
161 static auto apply(Values& values,
│ │ │ +
162 const LocalCoordinate& xi,
│ │ │ +
163 const Geometry& geometry)
│ │ │ +
164 {
│ │ │ +
165 auto jacobianInverseTransposed = geometry.jacobianInverseTransposed(xi);
│ │ │ +
166
│ │ │ +
167 for (auto& value : values)
│ │ │ +
168 {
│ │ │ +
169 auto tmp = value;
│ │ │ +
170 // Here we cannot directly use
│ │ │ +
171 // jacobianInverseTransposed.mv(tmp, value);
│ │ │ +
172 // because mv expects the DenseVector interface.
│ │ │ +
173 auto tmpDenseVector = Impl::DenseVectorView(tmp);
│ │ │ +
174 auto valueDenseVector = Impl::DenseVectorView(value);
│ │ │ +
175 jacobianInverseTransposed.mv(tmpDenseVector, valueDenseVector);
│ │ │ +
176 }
│ │ │ +
177 }
│ │ │
178
│ │ │ -
│ │ │ - │ │ │ -
181 {
│ │ │ -
182 if constexpr (requires(PreBasis pb){ pb.containerDescriptor(); })
│ │ │ -
183 return preBasis_.containerDescriptor();
│ │ │ -
184 else
│ │ │ - │ │ │ -
186 }
│ │ │ -
│ │ │ -
187
│ │ │ -
188protected:
│ │ │ - │ │ │ - │ │ │ -
191};
│ │ │ -
│ │ │ -
192
│ │ │ -
193
│ │ │ +
188 template<typename Gradients, typename LocalCoordinate, typename Geometry>
│ │ │ +
189 static auto applyJacobian(Gradients& gradients,
│ │ │ +
190 const LocalCoordinate& xi,
│ │ │ +
191 const Geometry& geometry)
│ │ │ +
192 {
│ │ │ +
193 auto jacobianInverseTransposed = geometry.jacobianInverseTransposed(xi);
│ │ │
194
│ │ │ -
195template<class PreBasis>
│ │ │ - │ │ │ -
197
│ │ │ -
198template<class GridView, class PreBasisFactory>
│ │ │ -
199DefaultGlobalBasis(const GridView& gv, PreBasisFactory&& f) -> DefaultGlobalBasis<std::decay_t<decltype(f(gv))>>;
│ │ │ -
200
│ │ │ -
201
│ │ │ -
202
│ │ │ -
203namespace BasisFactory {
│ │ │ -
204
│ │ │ -
205template<class GridView, class PreBasisFactory>
│ │ │ -
│ │ │ -
206auto makeBasis(const GridView& gridView, PreBasisFactory&& preBasisFactory)
│ │ │ -
207{
│ │ │ -
208 return DefaultGlobalBasis(preBasisFactory(gridView));
│ │ │ -
209}
│ │ │ -
│ │ │ -
210
│ │ │ -
211} // end namespace BasisFactory
│ │ │ -
212
│ │ │ -
213
│ │ │ -
214} // end namespace Functions
│ │ │ -
215} // end namespace Dune
│ │ │ -
216
│ │ │ -
217
│ │ │ -
218
│ │ │ -
219#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH
│ │ │ - │ │ │ -
Lightweight representation of (hierarchical) size and block structure extracted from a basis to descr...
│ │ │ - │ │ │ -
std::enable_if_t< std::is_constructible_v< T, Args... >, int > enableIfConstructible
Helper to constrain forwarding constructors.
Definition type_traits.hh:30
│ │ │ -
Definition monomialset.hh:19
│ │ │ -
Definition monomialset.hh:19
│ │ │ -
DefaultGlobalBasis(PreBasis &&) -> DefaultGlobalBasis< std::decay_t< PreBasis > >
│ │ │ -
Definition argyrisbasis.hh:926
│ │ │ -
auto makeBasis(const GridView &gridView, PreBasisFactory &&preBasisFactory)
Definition defaultglobalbasis.hh:206
│ │ │ -
GV GridView
The grid view that the FE basis is defined on.
Definition argyrisbasis.hh:880
│ │ │ -
Fallback container descriptor if nothing else fits.
Definition containerdescriptors.hh:52
│ │ │ -
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:53
│ │ │ -
Dune::ReservedVector< std::size_t, PreBasis::multiIndexBufferSize > SizePrefix
Definition defaultglobalbasis.hh:76
│ │ │ -
std::size_t size_type
Definition defaultglobalbasis.hh:67
│ │ │ -
typename PreBasis::GridView GridView
Definition defaultglobalbasis.hh:64
│ │ │ -
TypeTree::TreePath<> PrefixPath
Definition defaultglobalbasis.hh:61
│ │ │ -
const GridView & gridView() const
Definition defaultglobalbasis.hh:114
│ │ │ -
ArgyrisPreBasis< GV, R > PreBasis
Definition defaultglobalbasis.hh:58
│ │ │ -
DefaultLocalView< DefaultGlobalBasis< PreBasis > > LocalView
Definition defaultglobalbasis.hh:70
│ │ │ -
PreBasis & preBasis()
Obtain the pre-basis providing the implementation details.
Definition defaultglobalbasis.hh:126
│ │ │ -
void update(const GridView &gv)
Update the stored grid view.
Definition defaultglobalbasis.hh:137
│ │ │ -
typename LocalView::MultiIndex MultiIndex
Definition defaultglobalbasis.hh:73
│ │ │ -
size_type size(const SizePrefix &prefix) const
Return number of possible values for next position in multi index.
Definition defaultglobalbasis.hh:156
│ │ │ -
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition defaultglobalbasis.hh:144
│ │ │ -
PreBasis preBasis_
Definition defaultglobalbasis.hh:189
│ │ │ -
LocalView localView() const
Return local view for basis.
Definition defaultglobalbasis.hh:162
│ │ │ -
DefaultGlobalBasis(T &&... t)
Constructor.
Definition defaultglobalbasis.hh:89
│ │ │ -
DefaultGlobalBasis(const GridView &gridView, PreBasisFactory &&factory)
Constructor from a PreBasis factory.
Definition defaultglobalbasis.hh:105
│ │ │ -
size_type size() const
Return number of possible values for next position in empty multi index.
Definition defaultglobalbasis.hh:150
│ │ │ -
const PreBasis & preBasis() const
Obtain the pre-basis providing the implementation details.
Definition defaultglobalbasis.hh:120
│ │ │ -
PrefixPath prefixPath_
Definition defaultglobalbasis.hh:190
│ │ │ -
auto containerDescriptor() const
Return the associated container descriptor.
Definition defaultglobalbasis.hh:180
│ │ │ -
const DefaultGlobalBasis & rootBasis() const
Return *this because we are not embedded in a larger basis.
Definition defaultglobalbasis.hh:168
│ │ │ -
const PrefixPath & prefixPath() const
Return empty path, because this is the root in the local ansatz tree.
Definition defaultglobalbasis.hh:174
│ │ │ -
The restriction of a finite element basis to a single element.
Definition defaultlocalview.hh:32
│ │ │ -
std::conditional_t<(PreBasis::minMultiIndexSize==PreBasis::maxMultiIndexSize), StaticMultiIndex< size_type, PreBasis::maxMultiIndexSize >, Dune::ReservedVector< size_type, PreBasis::multiIndexBufferSize > > MultiIndex
Definition defaultlocalview.hh:65
│ │ │ - │ │ │ +
195 for (auto& gradient : gradients)
│ │ │ +
196 {
│ │ │ +
197 auto tmp = gradient;
│ │ │ +
198 gradient = 0;
│ │ │ +
199 for (size_t j=0; j<gradient.N(); j++)
│ │ │ +
200 for (size_t k=0; k<gradient.M(); k++)
│ │ │ +
201 // Use sparseRange because jacobianTransposed may be a sparse DiagonalMatrix
│ │ │ +
202 for(auto&& [jacobianInverseTransposed_j_l, l] : sparseRange(jacobianInverseTransposed[j]))
│ │ │ +
203 gradient[j][k] += jacobianInverseTransposed_j_l * tmp[l][k];
│ │ │ +
204 }
│ │ │ +
205 }
│ │ │ +
206
│ │ │ +
214 template<class Function, class LocalCoordinate, class Element>
│ │ │ +
215 class LocalValuedFunction
│ │ │ +
216 {
│ │ │ +
217 const Function& f_;
│ │ │ +
218 const Element& element_;
│ │ │ +
219
│ │ │ +
220 public:
│ │ │ +
221
│ │ │ +
222 LocalValuedFunction(const Function& f, const Element& element)
│ │ │ +
223 : f_(f), element_(element)
│ │ │ +
224 {}
│ │ │ +
225
│ │ │ +
226 auto operator()(const LocalCoordinate& xi) const
│ │ │ +
227 {
│ │ │ +
228 auto globalValue = f_(xi);
│ │ │ +
229
│ │ │ +
230 // Apply the inverse Piola transform
│ │ │ +
231 auto jacobianTransposed = element_.geometry().jacobianTransposed(xi);
│ │ │ +
232
│ │ │ +
233 auto localValue = globalValue;
│ │ │ +
234 // Here we cannot directly use
│ │ │ +
235 // jacobianTransposed.mv(globalValue, localValue);
│ │ │ +
236 // because mv expects the DenseVector interface.
│ │ │ +
237 auto localValueDenseVector = Impl::DenseVectorView(localValue);
│ │ │ +
238 auto globalValueDenseVector = Impl::DenseVectorView(globalValue);
│ │ │ +
239 jacobianTransposed.mv(globalValueDenseVector, localValueDenseVector);
│ │ │ +
240
│ │ │ +
241 return localValue;
│ │ │ +
242 }
│ │ │ +
243 };
│ │ │ +
244 };
│ │ │ +
245
│ │ │ +
252 template<class Transformator, class LocalValuedLocalBasis, class Element>
│ │ │ +
253 class GlobalValuedLocalBasis
│ │ │ +
254 {
│ │ │ +
255 public:
│ │ │ +
256 using Traits = typename LocalValuedLocalBasis::Traits;
│ │ │ +
257
│ │ │ +
260 void bind(const LocalValuedLocalBasis& localValuedLocalBasis, const Element& element)
│ │ │ +
261 {
│ │ │ +
262 localValuedLocalBasis_ = &localValuedLocalBasis;
│ │ │ +
263 element_ = &element;
│ │ │ +
264 }
│ │ │ +
265
│ │ │ +
268 auto size() const
│ │ │ +
269 {
│ │ │ +
270 return localValuedLocalBasis_->size();
│ │ │ +
271 }
│ │ │ +
272
│ │ │ +
274 void evaluateFunction(const typename Traits::DomainType& x,
│ │ │ +
275 std::vector<typename Traits::RangeType>& out) const
│ │ │ +
276 {
│ │ │ +
277 localValuedLocalBasis_->evaluateFunction(x,out);
│ │ │ +
278
│ │ │ +
279 Transformator::apply(out, x, element_->geometry());
│ │ │ +
280 }
│ │ │ +
281
│ │ │ +
287 void evaluateJacobian(const typename Traits::DomainType& x,
│ │ │ +
288 std::vector<typename Traits::JacobianType>& out) const
│ │ │ +
289 {
│ │ │ +
290 localValuedLocalBasis_->evaluateJacobian(x,out);
│ │ │ +
291
│ │ │ +
292 Transformator::applyJacobian(out, x, element_->geometry());
│ │ │ +
293 }
│ │ │ +
294
│ │ │ +
301 void partial(const std::array<unsigned int,2>& order,
│ │ │ +
302 const typename Traits::DomainType& x,
│ │ │ +
303 std::vector<typename Traits::RangeType>& out) const
│ │ │ +
304 {
│ │ │ +
305 auto totalOrder = std::accumulate(order.begin(), order.end(), 0);
│ │ │ +
306 if (totalOrder == 0) {
│ │ │ +
307 evaluateFunction(x, out);
│ │ │ +
308 } else if (totalOrder == 1) {
│ │ │ +
309 auto const direction = std::distance(order.begin(), std::find(order.begin(), order.end(), 1));
│ │ │ +
310 out.resize(size());
│ │ │ +
311
│ │ │ +
312 // TODO: The following is wasteful: We compute the full Jacobian and then return
│ │ │ +
313 // only a part of it. While we need the full Jacobian of the underlying local-valued LFE,
│ │ │ +
314 // it should be possible to compute only a partial Piola transform for the requested
│ │ │ +
315 // partial derivatives.
│ │ │ +
316 std::vector<typename Traits::JacobianType> fullJacobian;
│ │ │ +
317 localValuedLocalBasis_->evaluateJacobian(x,fullJacobian);
│ │ │ +
318
│ │ │ +
319 Transformator::applyJacobian(fullJacobian, x, element_->geometry());
│ │ │ +
320
│ │ │ +
321 for (std::size_t i=0; i<out.size(); i++)
│ │ │ +
322 for (std::size_t j=0; j<out[i].size(); j++)
│ │ │ +
323 out[i][j] = fullJacobian[i][j][direction];
│ │ │ +
324
│ │ │ +
325 } else
│ │ │ +
326 DUNE_THROW(NotImplemented, "Partial derivatives of order 2 or higher");
│ │ │ +
327 }
│ │ │ +
328
│ │ │ +
330 auto order() const
│ │ │ +
331 {
│ │ │ +
332 return localValuedLocalBasis_->order();
│ │ │ +
333 }
│ │ │ +
334
│ │ │ +
335 const LocalValuedLocalBasis* localValuedLocalBasis_;
│ │ │ +
336 const Element* element_;
│ │ │ +
337 };
│ │ │ +
338
│ │ │ +
347 template<class Transformator, class LocalValuedLocalInterpolation, class Element>
│ │ │ +
348 class GlobalValuedLocalInterpolation
│ │ │ +
349 {
│ │ │ +
350 public:
│ │ │ +
353 void bind(const LocalValuedLocalInterpolation& localValuedLocalInterpolation, const Element& element)
│ │ │ +
354 {
│ │ │ +
355 localValuedLocalInterpolation_ = &localValuedLocalInterpolation;
│ │ │ +
356 element_ = &element;
│ │ │ +
357 }
│ │ │ +
358
│ │ │ +
359 template<typename F, typename C>
│ │ │ +
360 void interpolate (const F& f, std::vector<C>& out) const
│ │ │ +
361 {
│ │ │ +
362 using LocalCoordinate = typename Element::Geometry::LocalCoordinate;
│ │ │ +
363 typename Transformator::template LocalValuedFunction<F,LocalCoordinate,Element> localValuedFunction(f, *element_);
│ │ │ +
364 localValuedLocalInterpolation_->interpolate(localValuedFunction, out);
│ │ │ +
365 }
│ │ │ +
366
│ │ │ +
367 private:
│ │ │ +
368 const LocalValuedLocalInterpolation* localValuedLocalInterpolation_;
│ │ │ +
369 const Element* element_;
│ │ │ +
370 };
│ │ │ +
371
│ │ │ +
372
│ │ │ +
379 template<class Transformator, class LocalValuedLFE, class Element>
│ │ │ +
380 class GlobalValuedLocalFiniteElement
│ │ │ +
381 {
│ │ │ +
382 using LocalBasis = GlobalValuedLocalBasis<Transformator,
│ │ │ +
383 typename LocalValuedLFE::Traits::LocalBasisType,
│ │ │ +
384 Element>;
│ │ │ +
385 using LocalInterpolation = GlobalValuedLocalInterpolation<Transformator,
│ │ │ +
386 typename LocalValuedLFE::Traits::LocalInterpolationType,
│ │ │ +
387 Element>;
│ │ │ +
388
│ │ │ +
389 public:
│ │ │ +
392 using Traits = LocalFiniteElementTraits<LocalBasis,
│ │ │ +
393 typename LocalValuedLFE::Traits::LocalCoefficientsType,
│ │ │ +
394 LocalInterpolation>;
│ │ │ +
395
│ │ │ +
396 GlobalValuedLocalFiniteElement() {}
│ │ │ +
397
│ │ │ +
398 void bind(const LocalValuedLFE& localValuedLFE, const Element& element)
│ │ │ +
399 {
│ │ │ +
400 globalValuedLocalBasis_.bind(localValuedLFE.localBasis(), element);
│ │ │ +
401 globalValuedLocalInterpolation_.bind(localValuedLFE.localInterpolation(), element);
│ │ │ +
402 localValuedLFE_ = &localValuedLFE;
│ │ │ +
403 }
│ │ │ +
404
│ │ │ +
407 const typename Traits::LocalBasisType& localBasis() const
│ │ │ +
408 {
│ │ │ +
409 return globalValuedLocalBasis_;
│ │ │ +
410 }
│ │ │ +
411
│ │ │ +
414 const typename Traits::LocalCoefficientsType& localCoefficients() const
│ │ │ +
415 {
│ │ │ +
416 return localValuedLFE_->localCoefficients();
│ │ │ +
417 }
│ │ │ +
418
│ │ │ +
421 const typename Traits::LocalInterpolationType& localInterpolation() const
│ │ │ +
422 {
│ │ │ +
423 return globalValuedLocalInterpolation_;
│ │ │ +
424 }
│ │ │ +
425
│ │ │ +
427 std::size_t size() const
│ │ │ +
428 {
│ │ │ +
429 return localValuedLFE_->size();
│ │ │ +
430 }
│ │ │ +
431
│ │ │ +
434 GeometryType type() const
│ │ │ +
435 {
│ │ │ +
436 return localValuedLFE_->type();
│ │ │ +
437 }
│ │ │ +
438
│ │ │ +
439 private:
│ │ │ +
440
│ │ │ +
441 typename Traits::LocalBasisType globalValuedLocalBasis_;
│ │ │ +
442 typename Traits::LocalInterpolationType globalValuedLocalInterpolation_;
│ │ │ +
443 const LocalValuedLFE* localValuedLFE_;
│ │ │ +
444 };
│ │ │ +
445
│ │ │ +
446} // namespace Dune::Functions::Impl
│ │ │ +
447
│ │ │ +
448#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH
│ │ │ + │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,301 +1,361 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -defaultglobalbasis.hh │ │ │ │ +globalvaluedlocalfiniteelement.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH │ │ │ │ +8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ -12#include │ │ │ │ -13 │ │ │ │ -14#include │ │ │ │ -15#include │ │ │ │ -16#include │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ +12 │ │ │ │ +13#include │ │ │ │ +14#include │ │ │ │ +15#include │ │ │ │ +16#include │ │ │ │ 17 │ │ │ │ -18#include │ │ │ │ +18#include │ │ │ │ 19 │ │ │ │ -20#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ -21#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_l_o_c_a_l_v_i_e_w_._h_h> │ │ │ │ -22#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ -23#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h> │ │ │ │ +20#include │ │ │ │ +21#include │ │ │ │ +22 │ │ │ │ +23#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_n_s_e_v_e_c_t_o_r_v_i_e_w_._h_h> │ │ │ │ 24 │ │ │ │ -25 │ │ │ │ -26 │ │ │ │ -27namespace _D_u_n_e { │ │ │ │ -28namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -29 │ │ │ │ -30 │ │ │ │ -31 │ │ │ │ -51template │ │ │ │ -_5_2class _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ -53{ │ │ │ │ +25namespace Dune::Functions::Impl │ │ │ │ +26{ │ │ │ │ +27 │ │ │ │ +41 struct ContravariantPiolaTransformator │ │ │ │ +42 { │ │ │ │ +47 template │ │ │ │ +48 static auto apply(Values& values, │ │ │ │ +49 const LocalCoordinate& xi, │ │ │ │ +50 const Geometry& geometry) │ │ │ │ +51 { │ │ │ │ +52 auto jacobianTransposed = geometry.jacobianTransposed(xi); │ │ │ │ +53 auto integrationElement = geometry.integrationElement(xi); │ │ │ │ 54 │ │ │ │ -55public: │ │ │ │ -56 │ │ │ │ -_5_8 using _P_r_e_B_a_s_i_s = PB; │ │ │ │ -59 │ │ │ │ -_6_1 using _P_r_e_f_i_x_P_a_t_h = TypeTree::TreePath<>; │ │ │ │ -62 │ │ │ │ -_6_4 using _G_r_i_d_V_i_e_w = typename _P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w; │ │ │ │ -65 │ │ │ │ -_6_7 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ -68 │ │ │ │ -_7_0 using _L_o_c_a_l_V_i_e_w = _D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_P_r_e_B_a_s_i_s_>>; │ │ │ │ -71 │ │ │ │ -_7_3 using _M_u_l_t_i_I_n_d_e_x = typename _L_o_c_a_l_V_i_e_w_:_:_M_u_l_t_i_I_n_d_e_x; │ │ │ │ -74 │ │ │ │ -_7_6 using _S_i_z_e_P_r_e_f_i_x = Dune::ReservedVector; │ │ │ │ -77 │ │ │ │ -86 template = 0, │ │ │ │ -88 _e_n_a_b_l_e_I_f_C_o_n_s_t_r_u_c_t_i_b_l_e<_P_r_e_B_a_s_i_s, T...> = 0> │ │ │ │ -_8_9 _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s(T&&... t) : │ │ │ │ -90 _p_r_e_B_a_s_i_s__(std::forward(t)...), │ │ │ │ -91 _p_r_e_f_i_x_P_a_t_h__() │ │ │ │ -92 { │ │ │ │ -93 static_assert(models, _P_r_e_B_a_s_i_s>(), "Type passed │ │ │ │ -to DefaultGlobalBasis does not model the PreBasis concept."); │ │ │ │ -94 _p_r_e_B_a_s_i_s__.initializeIndices(); │ │ │ │ +55 for (auto& value : values) │ │ │ │ +56 { │ │ │ │ +57 auto tmp = value; │ │ │ │ +58 // Here we cannot directly use │ │ │ │ +59 // jacobianTransposed.mtv(tmp, value); │ │ │ │ +60 // because mtv expects the DenseVector interface. │ │ │ │ +61 auto tmpDenseVector = Impl::DenseVectorView(tmp); │ │ │ │ +62 auto valueDenseVector = Impl::DenseVectorView(value); │ │ │ │ +63 jacobianTransposed.mtv(tmpDenseVector, valueDenseVector); │ │ │ │ +64 value /= integrationElement; │ │ │ │ +65 } │ │ │ │ +66 } │ │ │ │ +67 │ │ │ │ +77 template │ │ │ │ +78 static auto applyJacobian(Gradients& gradients, │ │ │ │ +79 const LocalCoordinate& xi, │ │ │ │ +80 const Geometry& geometry) │ │ │ │ +81 { │ │ │ │ +82 auto jacobianTransposed = geometry.jacobianTransposed(xi); │ │ │ │ +83 auto integrationElement = geometry.integrationElement(xi); │ │ │ │ +84 for (auto& gradient : gradients) │ │ │ │ +85 { │ │ │ │ +86 auto tmp = gradient; │ │ │ │ +87 gradient = 0; │ │ │ │ +88 for (size_t k=0; k:: │ │ │ │ -value, int> = 0> │ │ │ │ -_1_0_5 _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s(const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w, PreBasisFactory&& factory) : │ │ │ │ -106 _p_r_e_B_a_s_i_s__(factory(_g_r_i_d_V_i_e_w)), │ │ │ │ -107 _p_r_e_f_i_x_P_a_t_h__() │ │ │ │ -108 { │ │ │ │ -109 static_assert(models, _P_r_e_B_a_s_i_s>(), "Type passed │ │ │ │ -to DefaultGlobalBasis does not model the PreBasis concept."); │ │ │ │ -110 _p_r_e_B_a_s_i_s__.initializeIndices(); │ │ │ │ -111 } │ │ │ │ -112 │ │ │ │ -_1_1_4 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ -115 { │ │ │ │ -116 return _p_r_e_B_a_s_i_s__.gridView(); │ │ │ │ -117 } │ │ │ │ -118 │ │ │ │ -_1_2_0 const _P_r_e_B_a_s_i_s& _p_r_e_B_a_s_i_s() const │ │ │ │ -121 { │ │ │ │ -122 return _p_r_e_B_a_s_i_s__; │ │ │ │ -123 } │ │ │ │ -124 │ │ │ │ -_1_2_6 _P_r_e_B_a_s_i_s& _p_r_e_B_a_s_i_s() │ │ │ │ -127 { │ │ │ │ -128 return _p_r_e_B_a_s_i_s__; │ │ │ │ -129 } │ │ │ │ -130 │ │ │ │ -_1_3_7 void _u_p_d_a_t_e(const _G_r_i_d_V_i_e_w & gv) │ │ │ │ -138 { │ │ │ │ -139 _p_r_e_B_a_s_i_s__.update(gv); │ │ │ │ -140 _p_r_e_B_a_s_i_s__.initializeIndices(); │ │ │ │ -141 } │ │ │ │ -142 │ │ │ │ -_1_4_4 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ -145 { │ │ │ │ -146 return _p_r_e_B_a_s_i_s__.dimension(); │ │ │ │ -147 } │ │ │ │ -148 │ │ │ │ -_1_5_0 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ -151 { │ │ │ │ -152 return _p_r_e_B_a_s_i_s__.size(); │ │ │ │ -153 } │ │ │ │ -154 │ │ │ │ -_1_5_6 _s_i_z_e___t_y_p_e _s_i_z_e(const _S_i_z_e_P_r_e_f_i_x& prefix) const │ │ │ │ -157 { │ │ │ │ -158 return _p_r_e_B_a_s_i_s__.size(prefix); │ │ │ │ -159 } │ │ │ │ -160 │ │ │ │ -_1_6_2 _L_o_c_a_l_V_i_e_w _l_o_c_a_l_V_i_e_w() const │ │ │ │ -163 { │ │ │ │ -164 return _L_o_c_a_l_V_i_e_w(*this); │ │ │ │ -165 } │ │ │ │ +104 template │ │ │ │ +105 class LocalValuedFunction │ │ │ │ +106 { │ │ │ │ +107 const Function& f_; │ │ │ │ +108 const Element& element_; │ │ │ │ +109 │ │ │ │ +110 using LocalValue = LocalCoordinate; │ │ │ │ +111 │ │ │ │ +112 public: │ │ │ │ +113 │ │ │ │ +114 LocalValuedFunction(const Function& f, const Element& element) │ │ │ │ +115 : f_(f), element_(element) │ │ │ │ +116 {} │ │ │ │ +117 │ │ │ │ +118 auto operator()(const LocalCoordinate& xi) const │ │ │ │ +119 { │ │ │ │ +120 auto globalValue = f_(xi); │ │ │ │ +121 │ │ │ │ +122 // Apply the inverse Piola transform │ │ │ │ +123 auto jacobianInverseTransposed = element_.geometry │ │ │ │ +().jacobianInverseTransposed(xi); │ │ │ │ +124 auto integrationElement = element_.geometry().integrationElement(xi); │ │ │ │ +125 │ │ │ │ +126 auto localValue = LocalValue{}; │ │ │ │ +127 │ │ │ │ +128 // Here we cannot directly use │ │ │ │ +129 // jacobianInverseTransposed.mtv(globalValue, localValue); │ │ │ │ +130 // because mtv expects the DenseVector interface. │ │ │ │ +131 auto globalValueDenseVector = Impl::DenseVectorView(globalValue); │ │ │ │ +132 auto localValueDenseVector = Impl::DenseVectorView(localValue); │ │ │ │ +133 jacobianInverseTransposed.mtv(globalValueDenseVector, │ │ │ │ +localValueDenseVector); │ │ │ │ +134 localValue *= integrationElement; │ │ │ │ +135 │ │ │ │ +136 return localValue; │ │ │ │ +137 } │ │ │ │ +138 }; │ │ │ │ +139 }; │ │ │ │ +140 │ │ │ │ +154 struct CovariantPiolaTransformator │ │ │ │ +155 { │ │ │ │ +160 template │ │ │ │ +161 static auto apply(Values& values, │ │ │ │ +162 const LocalCoordinate& xi, │ │ │ │ +163 const Geometry& geometry) │ │ │ │ +164 { │ │ │ │ +165 auto jacobianInverseTransposed = geometry.jacobianInverseTransposed(xi); │ │ │ │ 166 │ │ │ │ -_1_6_8 const _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s& _r_o_o_t_B_a_s_i_s() const │ │ │ │ -169 { │ │ │ │ -170 return *this; │ │ │ │ -171 } │ │ │ │ -172 │ │ │ │ -_1_7_4 const _P_r_e_f_i_x_P_a_t_h& _p_r_e_f_i_x_P_a_t_h() const │ │ │ │ -175 { │ │ │ │ -176 return _p_r_e_f_i_x_P_a_t_h__; │ │ │ │ +167 for (auto& value : values) │ │ │ │ +168 { │ │ │ │ +169 auto tmp = value; │ │ │ │ +170 // Here we cannot directly use │ │ │ │ +171 // jacobianInverseTransposed.mv(tmp, value); │ │ │ │ +172 // because mv expects the DenseVector interface. │ │ │ │ +173 auto tmpDenseVector = Impl::DenseVectorView(tmp); │ │ │ │ +174 auto valueDenseVector = Impl::DenseVectorView(value); │ │ │ │ +175 jacobianInverseTransposed.mv(tmpDenseVector, valueDenseVector); │ │ │ │ +176 } │ │ │ │ 177 } │ │ │ │ 178 │ │ │ │ -_1_8_0 auto _c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r() const │ │ │ │ -181 { │ │ │ │ -182 if constexpr (requires(_P_r_e_B_a_s_i_s pb){ pb.containerDescriptor(); }) │ │ │ │ -183 return _p_r_e_B_a_s_i_s__.containerDescriptor(); │ │ │ │ -184 else │ │ │ │ -185 return _C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_k_n_o_w_n{}; │ │ │ │ -186 } │ │ │ │ -187 │ │ │ │ -188protected: │ │ │ │ -_1_8_9 _P_r_e_B_a_s_i_s _p_r_e_B_a_s_i_s__; │ │ │ │ -_1_9_0 _P_r_e_f_i_x_P_a_t_h _p_r_e_f_i_x_P_a_t_h__; │ │ │ │ -191}; │ │ │ │ -192 │ │ │ │ -193 │ │ │ │ +188 template │ │ │ │ +189 static auto applyJacobian(Gradients& gradients, │ │ │ │ +190 const LocalCoordinate& xi, │ │ │ │ +191 const Geometry& geometry) │ │ │ │ +192 { │ │ │ │ +193 auto jacobianInverseTransposed = geometry.jacobianInverseTransposed(xi); │ │ │ │ 194 │ │ │ │ -195template │ │ │ │ -_1_9_6_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s(PreBasis&&) -> _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_s_t_d_:_: │ │ │ │ -_d_e_c_a_y___t_<_P_r_e_B_a_s_i_s_>>; │ │ │ │ -197 │ │ │ │ -198template │ │ │ │ -_1_9_9_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s(const GridView& gv, PreBasisFactory&& f) - │ │ │ │ -> _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s>; │ │ │ │ -200 │ │ │ │ -201 │ │ │ │ -202 │ │ │ │ -203namespace _B_a_s_i_s_F_a_c_t_o_r_y { │ │ │ │ -204 │ │ │ │ -205template │ │ │ │ -_2_0_6auto _m_a_k_e_B_a_s_i_s(const GridView& gridView, PreBasisFactory&& preBasisFactory) │ │ │ │ -207{ │ │ │ │ -208 return _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s(preBasisFactory(gridView)); │ │ │ │ -209} │ │ │ │ -210 │ │ │ │ -211} // end namespace BasisFactory │ │ │ │ -212 │ │ │ │ -213 │ │ │ │ -214} // end namespace Functions │ │ │ │ -215} // end namespace Dune │ │ │ │ -216 │ │ │ │ -217 │ │ │ │ -218 │ │ │ │ -219#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH │ │ │ │ -_d_e_f_a_u_l_t_l_o_c_a_l_v_i_e_w_._h_h │ │ │ │ -_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h │ │ │ │ -Lightweight representation of (hierarchical) size and block structure extracted │ │ │ │ -from a basis to descr... │ │ │ │ -_t_y_p_e___t_r_a_i_t_s_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_e_n_a_b_l_e_I_f_C_o_n_s_t_r_u_c_t_i_b_l_e │ │ │ │ -std::enable_if_t< std::is_constructible_v< T, Args... >, int > │ │ │ │ -enableIfConstructible │ │ │ │ -Helper to constrain forwarding constructors. │ │ │ │ -DDeeffiinniittiioonn type_traits.hh:30 │ │ │ │ -_D_u_n_e │ │ │ │ -DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ -DefaultGlobalBasis(PreBasis &&) -> DefaultGlobalBasis< std::decay_t< PreBasis > │ │ │ │ -> │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:926 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_m_a_k_e_B_a_s_i_s │ │ │ │ -auto makeBasis(const GridView &gridView, PreBasisFactory &&preBasisFactory) │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:206 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ -GV GridView │ │ │ │ -The grid view that the FE basis is defined on. │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:880 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_k_n_o_w_n │ │ │ │ -Fallback container descriptor if nothing else fits. │ │ │ │ -DDeeffiinniittiioonn containerdescriptors.hh:52 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ -Global basis for given pre-basis. │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:53 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_<_ _G_V_,_ _R_ _>_ _>_:_:_S_i_z_e_P_r_e_f_i_x │ │ │ │ -Dune::ReservedVector< std::size_t, PreBasis::multiIndexBufferSize > SizePrefix │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:76 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_<_ _G_V_,_ _R_ _>_ _>_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:67 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_<_ _G_V_,_ _R_ _>_ _>_:_:_G_r_i_d_V_i_e_w │ │ │ │ -typename PreBasis::GridView GridView │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:64 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_<_ _G_V_,_ _R_ _>_ _>_:_:_P_r_e_f_i_x_P_a_t_h │ │ │ │ -TypeTree::TreePath<> PrefixPath │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:61 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_<_ _G_V_,_ _R_ _>_ _>_:_:_g_r_i_d_V_i_e_w │ │ │ │ -const GridView & gridView() const │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:114 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_<_ _G_V_,_ _R_ _>_ _>_:_:_P_r_e_B_a_s_i_s │ │ │ │ -ArgyrisPreBasis< GV, R > PreBasis │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:58 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_<_ _G_V_,_ _R_ _>_ _>_:_:_L_o_c_a_l_V_i_e_w │ │ │ │ -DefaultLocalView< DefaultGlobalBasis< PreBasis > > LocalView │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:70 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_:_:_p_r_e_B_a_s_i_s │ │ │ │ -PreBasis & preBasis() │ │ │ │ -Obtain the pre-basis providing the implementation details. │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:126 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_:_:_u_p_d_a_t_e │ │ │ │ -void update(const GridView &gv) │ │ │ │ -Update the stored grid view. │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:137 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_<_ _G_V_,_ _R_ _>_ _>_:_:_M_u_l_t_i_I_n_d_e_x │ │ │ │ -typename LocalView::MultiIndex MultiIndex │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:73 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ -size_type size(const SizePrefix &prefix) const │ │ │ │ -Return number of possible values for next position in multi index. │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:156 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ -size_type dimension() const │ │ │ │ -Get the total dimension of the space spanned by this basis. │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:144 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_<_ _G_V_,_ _R_ _>_ _>_:_:_p_r_e_B_a_s_i_s__ │ │ │ │ -PreBasis preBasis_ │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:189 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_:_:_l_o_c_a_l_V_i_e_w │ │ │ │ -LocalView localView() const │ │ │ │ -Return local view for basis. │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:162 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ -DefaultGlobalBasis(T &&... t) │ │ │ │ -Constructor. │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:89 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ -DefaultGlobalBasis(const GridView &gridView, PreBasisFactory &&factory) │ │ │ │ -Constructor from a PreBasis factory. │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:105 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ -size_type size() const │ │ │ │ -Return number of possible values for next position in empty multi index. │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:150 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_:_:_p_r_e_B_a_s_i_s │ │ │ │ -const PreBasis & preBasis() const │ │ │ │ -Obtain the pre-basis providing the implementation details. │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:120 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_<_ _G_V_,_ _R_ _>_ _>_:_:_p_r_e_f_i_x_P_a_t_h__ │ │ │ │ -PrefixPath prefixPath_ │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:190 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r │ │ │ │ -auto containerDescriptor() const │ │ │ │ -Return the associated container descriptor. │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:180 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_:_:_r_o_o_t_B_a_s_i_s │ │ │ │ -const DefaultGlobalBasis & rootBasis() const │ │ │ │ -Return *this because we are not embedded in a larger basis. │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:168 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_:_:_p_r_e_f_i_x_P_a_t_h │ │ │ │ -const PrefixPath & prefixPath() const │ │ │ │ -Return empty path, because this is the root in the local ansatz tree. │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:174 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w │ │ │ │ -The restriction of a finite element basis to a single element. │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:32 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_r_e_B_a_s_i_s_ _>_ _>_:_:_M_u_l_t_i_I_n_d_e_x │ │ │ │ -std::conditional_t<(PreBasis::minMultiIndexSize==PreBasis::maxMultiIndexSize), │ │ │ │ -StaticMultiIndex< size_type, PreBasis::maxMultiIndexSize >, Dune:: │ │ │ │ -ReservedVector< size_type, PreBasis::multiIndexBufferSize > > MultiIndex │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:65 │ │ │ │ -_c_o_n_c_e_p_t_s_._h_h │ │ │ │ +195 for (auto& gradient : gradients) │ │ │ │ +196 { │ │ │ │ +197 auto tmp = gradient; │ │ │ │ +198 gradient = 0; │ │ │ │ +199 for (size_t j=0; j │ │ │ │ +215 class LocalValuedFunction │ │ │ │ +216 { │ │ │ │ +217 const Function& f_; │ │ │ │ +218 const Element& element_; │ │ │ │ +219 │ │ │ │ +220 public: │ │ │ │ +221 │ │ │ │ +222 LocalValuedFunction(const Function& f, const Element& element) │ │ │ │ +223 : f_(f), element_(element) │ │ │ │ +224 {} │ │ │ │ +225 │ │ │ │ +226 auto operator()(const LocalCoordinate& xi) const │ │ │ │ +227 { │ │ │ │ +228 auto globalValue = f_(xi); │ │ │ │ +229 │ │ │ │ +230 // Apply the inverse Piola transform │ │ │ │ +231 auto jacobianTransposed = element_.geometry().jacobianTransposed(xi); │ │ │ │ +232 │ │ │ │ +233 auto localValue = globalValue; │ │ │ │ +234 // Here we cannot directly use │ │ │ │ +235 // jacobianTransposed.mv(globalValue, localValue); │ │ │ │ +236 // because mv expects the DenseVector interface. │ │ │ │ +237 auto localValueDenseVector = Impl::DenseVectorView(localValue); │ │ │ │ +238 auto globalValueDenseVector = Impl::DenseVectorView(globalValue); │ │ │ │ +239 jacobianTransposed.mv(globalValueDenseVector, localValueDenseVector); │ │ │ │ +240 │ │ │ │ +241 return localValue; │ │ │ │ +242 } │ │ │ │ +243 }; │ │ │ │ +244 }; │ │ │ │ +245 │ │ │ │ +252 template │ │ │ │ +253 class GlobalValuedLocalBasis │ │ │ │ +254 { │ │ │ │ +255 public: │ │ │ │ +256 using Traits = typename LocalValuedLocalBasis::Traits; │ │ │ │ +257 │ │ │ │ +260 void bind(const LocalValuedLocalBasis& localValuedLocalBasis, const │ │ │ │ +Element& element) │ │ │ │ +261 { │ │ │ │ +262 localValuedLocalBasis_ = &localValuedLocalBasis; │ │ │ │ +263 element_ = &element; │ │ │ │ +264 } │ │ │ │ +265 │ │ │ │ +268 auto size() const │ │ │ │ +269 { │ │ │ │ +270 return localValuedLocalBasis_->size(); │ │ │ │ +271 } │ │ │ │ +272 │ │ │ │ +274 void evaluateFunction(const typename Traits::DomainType& x, │ │ │ │ +275 std::vector& out) const │ │ │ │ +276 { │ │ │ │ +277 localValuedLocalBasis_->evaluateFunction(x,out); │ │ │ │ +278 │ │ │ │ +279 Transformator::apply(out, x, element_->geometry()); │ │ │ │ +280 } │ │ │ │ +281 │ │ │ │ +287 void evaluateJacobian(const typename Traits::DomainType& x, │ │ │ │ +288 std::vector& out) const │ │ │ │ +289 { │ │ │ │ +290 localValuedLocalBasis_->evaluateJacobian(x,out); │ │ │ │ +291 │ │ │ │ +292 Transformator::applyJacobian(out, x, element_->geometry()); │ │ │ │ +293 } │ │ │ │ +294 │ │ │ │ +301 void partial(const std::array& order, │ │ │ │ +302 const typename Traits::DomainType& x, │ │ │ │ +303 std::vector& out) const │ │ │ │ +304 { │ │ │ │ +305 auto totalOrder = std::accumulate(order.begin(), order.end(), 0); │ │ │ │ +306 if (totalOrder == 0) { │ │ │ │ +307 evaluateFunction(x, out); │ │ │ │ +308 } else if (totalOrder == 1) { │ │ │ │ +309 auto const direction = std::distance(order.begin(), std::find(order.begin │ │ │ │ +(), order.end(), 1)); │ │ │ │ +310 out.resize(size()); │ │ │ │ +311 │ │ │ │ +312 // TODO: The following is wasteful: We compute the full Jacobian and then │ │ │ │ +return │ │ │ │ +313 // only a part of it. While we need the full Jacobian of the underlying │ │ │ │ +local-valued LFE, │ │ │ │ +314 // it should be possible to compute only a partial Piola transform for the │ │ │ │ +requested │ │ │ │ +315 // partial derivatives. │ │ │ │ +316 std::vector fullJacobian; │ │ │ │ +317 localValuedLocalBasis_->evaluateJacobian(x,fullJacobian); │ │ │ │ +318 │ │ │ │ +319 Transformator::applyJacobian(fullJacobian, x, element_->geometry()); │ │ │ │ +320 │ │ │ │ +321 for (std::size_t i=0; iorder(); │ │ │ │ +333 } │ │ │ │ +334 │ │ │ │ +335 const LocalValuedLocalBasis* localValuedLocalBasis_; │ │ │ │ +336 const Element* element_; │ │ │ │ +337 }; │ │ │ │ +338 │ │ │ │ +347 template │ │ │ │ +348 class GlobalValuedLocalInterpolation │ │ │ │ +349 { │ │ │ │ +350 public: │ │ │ │ +353 void bind(const LocalValuedLocalInterpolation& │ │ │ │ +localValuedLocalInterpolation, const Element& element) │ │ │ │ +354 { │ │ │ │ +355 localValuedLocalInterpolation_ = &localValuedLocalInterpolation; │ │ │ │ +356 element_ = &element; │ │ │ │ +357 } │ │ │ │ +358 │ │ │ │ +359 template │ │ │ │ +360 void interpolate (const F& f, std::vector& out) const │ │ │ │ +361 { │ │ │ │ +362 using LocalCoordinate = typename Element::Geometry::LocalCoordinate; │ │ │ │ +363 typename Transformator::template │ │ │ │ +LocalValuedFunction localValuedFunction(f, │ │ │ │ +*element_); │ │ │ │ +364 localValuedLocalInterpolation_->interpolate(localValuedFunction, out); │ │ │ │ +365 } │ │ │ │ +366 │ │ │ │ +367 private: │ │ │ │ +368 const LocalValuedLocalInterpolation* localValuedLocalInterpolation_; │ │ │ │ +369 const Element* element_; │ │ │ │ +370 }; │ │ │ │ +371 │ │ │ │ +372 │ │ │ │ +379 template │ │ │ │ +380 class GlobalValuedLocalFiniteElement │ │ │ │ +381 { │ │ │ │ +382 using LocalBasis = GlobalValuedLocalBasis; │ │ │ │ +385 using LocalInterpolation = GlobalValuedLocalInterpolation; │ │ │ │ +388 │ │ │ │ +389 public: │ │ │ │ +392 using Traits = LocalFiniteElementTraits; │ │ │ │ +395 │ │ │ │ +396 GlobalValuedLocalFiniteElement() {} │ │ │ │ +397 │ │ │ │ +398 void bind(const LocalValuedLFE& localValuedLFE, const Element& element) │ │ │ │ +399 { │ │ │ │ +400 globalValuedLocalBasis_.bind(localValuedLFE.localBasis(), element); │ │ │ │ +401 globalValuedLocalInterpolation_.bind(localValuedLFE.localInterpolation(), │ │ │ │ +element); │ │ │ │ +402 localValuedLFE_ = &localValuedLFE; │ │ │ │ +403 } │ │ │ │ +404 │ │ │ │ +407 const typename Traits::LocalBasisType& localBasis() const │ │ │ │ +408 { │ │ │ │ +409 return globalValuedLocalBasis_; │ │ │ │ +410 } │ │ │ │ +411 │ │ │ │ +414 const typename Traits::LocalCoefficientsType& localCoefficients() const │ │ │ │ +415 { │ │ │ │ +416 return localValuedLFE_->localCoefficients(); │ │ │ │ +417 } │ │ │ │ +418 │ │ │ │ +421 const typename Traits::LocalInterpolationType& localInterpolation() const │ │ │ │ +422 { │ │ │ │ +423 return globalValuedLocalInterpolation_; │ │ │ │ +424 } │ │ │ │ +425 │ │ │ │ +427 std::size_t size() const │ │ │ │ +428 { │ │ │ │ +429 return localValuedLFE_->size(); │ │ │ │ +430 } │ │ │ │ +431 │ │ │ │ +434 GeometryType type() const │ │ │ │ +435 { │ │ │ │ +436 return localValuedLFE_->type(); │ │ │ │ +437 } │ │ │ │ +438 │ │ │ │ +439 private: │ │ │ │ +440 │ │ │ │ +441 typename Traits::LocalBasisType globalValuedLocalBasis_; │ │ │ │ +442 typename Traits::LocalInterpolationType globalValuedLocalInterpolation_; │ │ │ │ +443 const LocalValuedLFE* localValuedLFE_; │ │ │ │ +444 }; │ │ │ │ +445 │ │ │ │ +446} // namespace Dune::Functions::Impl │ │ │ │ +447 │ │ │ │ +448#endif / │ │ │ │ +/ DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH │ │ │ │ +_d_e_n_s_e_v_e_c_t_o_r_v_i_e_w_._h_h │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ + * _g_l_o_b_a_l_v_a_l_u_e_d_l_o_c_a_l_f_i_n_i_t_e_e_l_e_m_e_n_t_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00167.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: cubichermitebasis.hh File Reference │ │ │ +Dune-Functions: bsplinebasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,85 +88,79 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
cubichermitebasis.hh File Reference
│ │ │ +
bsplinebasis.hh File Reference
│ │ │
│ │ │
│ │ │ │ │ │ -

This file provides an implementation of the cubic Hermite finite element in 1 to 3 dimensions. │ │ │ +

The B-spline global function space basis. │ │ │ More...

│ │ │ -
#include <algorithm>
│ │ │ -#include <array>
│ │ │ +
#include <array>
│ │ │ #include <numeric>
│ │ │ -#include <type_traits>
│ │ │ -#include <vector>
│ │ │ -#include <dune/common/exceptions.hh>
│ │ │ -#include <dune/common/fmatrix.hh>
│ │ │ -#include <dune/common/fvector.hh>
│ │ │ -#include <dune/common/rangeutilities.hh>
│ │ │ -#include <dune/grid/common/mcmgmapper.hh>
│ │ │ +#include <dune/common/dynmatrix.hh>
│ │ │ #include <dune/localfunctions/common/localbasis.hh>
│ │ │ -#include <dune/localfunctions/common/localfiniteelementtraits.hh>
│ │ │ +#include <dune/common/diagonalmatrix.hh>
│ │ │ #include <dune/localfunctions/common/localkey.hh>
│ │ │ -#include <dune/functions/common/mapperutilities.hh>
│ │ │ -#include <dune/functions/common/squeezetensor.hh>
│ │ │ -#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │ -#include <dune/functions/functionspacebases/functionaldescriptor.hh>
│ │ │ -#include <dune/functions/functionspacebases/leafprebasismappermixin.hh>
│ │ │ -#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ -#include <dune/functions/functionspacebases/transformedfiniteelementmixin.hh>
│ │ │ -#include <dune/functions/analyticfunctions/monomialset.hh>
│ │ │ +#include <dune/localfunctions/common/localfiniteelementtraits.hh>
│ │ │ +#include <dune/geometry/type.hh>
│ │ │ +#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ +#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │ +#include <dune/functions/functionspacebases/leafprebasismixin.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

struct  Dune::Functions::H2LocalBasisTraits< DF, n, D, RF, m, R, J, H >
class  Dune::Functions::CubicHermiteNode< GV, R, reduced >
class  Dune::Functions::CubicHermitePreBasis< GV, R, reduced >
 A pre-basis for a Hermitebasis. More...
class  Dune::Functions::BSplineLocalBasis< GV, R >
 LocalBasis class in the sense of dune-localfunctions, presenting the restriction of a B-spline patch to a knot span. More...
class  Dune::Functions::BSplineLocalCoefficients< dim >
 Attaches a shape function to an entity. More...
class  Dune::Functions::BSplineLocalInterpolation< dim, LB >
 Local interpolation in the sense of dune-localfunctions, for the B-spline basis on tensor-product grids. More...
class  Dune::Functions::BSplineLocalFiniteElement< GV, R >
 LocalFiniteElement in the sense of dune-localfunctions, for the B-spline basis on tensor-product grids. More...
class  Dune::Functions::BSplinePreBasis< GV >
 Pre-basis for B-spline basis. More...
class  Dune::Functions::BSplineNode< GV >
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::BasisFactory
│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ +

│ │ │ Typedefs

template<class GV, bool reduced = false, class R = double>
using Dune::Functions::CubicHermiteBasis = DefaultGlobalBasis<CubicHermitePreBasis<GV, R, reduced> >
 Nodal basis of a scalar cubic Hermite finite element space.
template<typename GV>
using Dune::Functions::BSplineBasis = DefaultGlobalBasis<BSplinePreBasis<GV> >
 A global B-spline basis.
│ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ +Functions

auto Dune::Functions::BasisFactory::bSpline (const std::vector< double > &knotVector, unsigned int order, bool makeOpen=true)
 Create a pre-basis factory that can create a B-spline pre-basis.
│ │ │

Detailed Description

│ │ │ -

This file provides an implementation of the cubic Hermite finite element in 1 to 3 dimensions.

│ │ │ -

For reference, see[Ciarlet, The Finite Element Method for Elliptic Problems, 2002]. It contains in the following order:

    │ │ │ -
  • A GlobalBasis typedef CubicHermiteBasis
  • │ │ │ -
  • A template H2LocalBasisTraits, extending the dune-localfunctions LocalBasisTraits by an exported Hessiantype
  • │ │ │ -
  • A template CubicHermiteLocalFiniteElement providing an implementation of the LocalFiniteElement interface, along with its subparts (Impl namespace)
  • │ │ │ -
  • A template CubicHermiteNode
  • │ │ │ -
  • A template CubicHermitePreBasis
  • │ │ │ -
  • Two factories hermite() and reducedHermite() in the BasisFactory namespace
  • │ │ │ -
│ │ │ +

The B-spline global function space basis.

│ │ │
│ │ │
│ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,63 +1,52 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -cubichermitebasis.hh File Reference │ │ │ │ -This file provides an implementation of the cubic Hermite finite element in 1 │ │ │ │ -to 3 dimensions. _M_o_r_e_._._. │ │ │ │ -#include │ │ │ │ +bsplinebasis.hh File Reference │ │ │ │ +The B-spline global function space basis. _M_o_r_e_._._. │ │ │ │ #include │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ +#include │ │ │ │ #include │ │ │ │ -#include │ │ │ │ +#include │ │ │ │ #include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_m_a_p_p_e_r_u_t_i_l_i_t_i_e_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_s_q_u_e_e_z_e_t_e_n_s_o_r_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_f_u_n_c_t_i_o_n_a_l_d_e_s_c_r_i_p_t_o_r_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h> │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ #include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_t_r_a_n_s_f_o_r_m_e_d_f_i_n_i_t_e_e_l_e_m_e_n_t_m_i_x_i_n_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_a_n_a_l_y_t_i_c_f_u_n_c_t_i_o_n_s_/_m_o_n_o_m_i_a_l_s_e_t_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_2_L_o_c_a_l_B_a_s_i_s_T_r_a_i_t_s_<_ _D_F_,_ _n_,_ _D_,_ _R_F_,_ _m_,_ _R_,_ _J_,_ _H_ _> │ │ │ │ - class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e_<_ _G_V_,_ _R_,_ _r_e_d_u_c_e_d_ _> │ │ │ │ - class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _R_,_ _r_e_d_u_c_e_d_ _> │ │ │ │ -  A pre-basis for a Hermitebasis. _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s_<_ _G_V_,_ _R_ _> │ │ │ │ +  LocalBasis class in the sense of dune-localfunctions, presenting the │ │ │ │ + restriction of a B-spline patch to a knot span. _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s_<_ _d_i_m_ _> │ │ │ │ +  Attaches a shape function to an entity. _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_I_n_t_e_r_p_o_l_a_t_i_o_n_<_ _d_i_m_,_ _L_B_ _> │ │ │ │ +  Local interpolation in the sense of dune-localfunctions, for the B- │ │ │ │ + spline basis on tensor-product grids. _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_ _G_V_,_ _R_ _> │ │ │ │ +  LocalFiniteElement in the sense of dune-localfunctions, for the B- │ │ │ │ + spline basis on tensor-product grids. _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_<_ _G_V_ _> │ │ │ │ +  Pre-basis for B-spline basis. _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_N_o_d_e_<_ _G_V_ _> │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ TTyyppeeddeeffss │ │ │ │ -template │ │ │ │ -using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_B_a_s_i_s = │ │ │ │ - _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s<_C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s > │ │ │ │ -  Nodal basis of a scalar cubic Hermite finite element space. │ │ │ │ +template │ │ │ │ +using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_B_a_s_i_s = _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s<_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s > │ │ │ │ +  A global B-spline basis. │ │ │ │ +FFuunnccttiioonnss │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_b_S_p_l_i_n_e (const std::vector< double > │ │ │ │ + &knotVector, unsigned int order, bool makeOpen=true) │ │ │ │ +  Create a pre-basis factory that can create a B-spline pre-basis. │ │ │ │ ********** DDeettaaiilleedd DDeessccrriippttiioonn ********** │ │ │ │ -This file provides an implementation of the cubic Hermite finite element in 1 │ │ │ │ -to 3 dimensions. │ │ │ │ -For reference, see[Ciarlet, The Finite Element Method for Elliptic Problems, │ │ │ │ -2002]. It contains in the following order: │ │ │ │ - * A GlobalBasis typedef CubicHermiteBasis │ │ │ │ - * A template H2LocalBasisTraits, extending the dune-localfunctions │ │ │ │ - LocalBasisTraits by an exported Hessiantype │ │ │ │ - * A template CubicHermiteLocalFiniteElement providing an implementation of │ │ │ │ - the LocalFiniteElement interface, along with its subparts (Impl │ │ │ │ - namespace) │ │ │ │ - * A template CubicHermiteNode │ │ │ │ - * A template CubicHermitePreBasis │ │ │ │ - * Two factories hermite() and reducedHermite() in the BasisFactory │ │ │ │ - namespace │ │ │ │ +The B-spline global function space basis. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _c_u_b_i_c_h_e_r_m_i_t_e_b_a_s_i_s_._h_h │ │ │ │ + * _b_s_p_l_i_n_e_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00167.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,5 +1,5 @@ │ │ │ │ var a00167 = [ │ │ │ │ - ["Dune::Functions::H2LocalBasisTraits< DF, n, D, RF, m, R, J, H >", "a01790.html", "a01790"], │ │ │ │ - ["Dune::Functions::CubicHermiteNode< GV, R, reduced >", "a01814.html", "a01814"], │ │ │ │ - ["Dune::Functions::CubicHermiteBasis", "a00312.html#gac2b7a96bb915768e99b49446480615ec", null] │ │ │ │ + ["Dune::Functions::BSplineNode< GV >", "a01698.html", "a01698"], │ │ │ │ + ["Dune::Functions::BSplineBasis", "a00312.html#gaf2f75f87ed4cb5223378259c760c1e97", null], │ │ │ │ + ["Dune::Functions::BasisFactory::bSpline", "a00312.html#ga63a9701af71fffbbb851a38cb8cf886f", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00167_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: cubichermitebasis.hh Source File │ │ │ +Dune-Functions: bsplinebasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,732 +88,1297 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
cubichermitebasis.hh
│ │ │ +
bsplinebasis.hh
│ │ │
│ │ │
│ │ │ -Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ +Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │ -
6#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CUBICHERMITEBASIS_HH
│ │ │ -
7#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CUBICHERMITEBASIS_HH
│ │ │ -
8
│ │ │ -
9#include <algorithm>
│ │ │ -
10#include <array>
│ │ │ -
11#include <numeric>
│ │ │ -
12#include <type_traits>
│ │ │ -
13#include <vector>
│ │ │ -
14
│ │ │ -
15#include <dune/common/exceptions.hh>
│ │ │ -
16#include <dune/common/fmatrix.hh>
│ │ │ -
17#include <dune/common/fvector.hh>
│ │ │ -
18#include <dune/common/rangeutilities.hh>
│ │ │ +
6
│ │ │ +
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BSPLINEBASIS_HH
│ │ │ +
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BSPLINEBASIS_HH
│ │ │ +
9
│ │ │ +
13
│ │ │ +
14#include <array>
│ │ │ +
15#include <numeric>
│ │ │ +
16
│ │ │ +
18#include <dune/common/dynmatrix.hh>
│ │ │
19
│ │ │ -
20#include <dune/grid/common/mcmgmapper.hh>
│ │ │ -
21
│ │ │ -
22#include <dune/localfunctions/common/localbasis.hh>
│ │ │ +
20#include <dune/localfunctions/common/localbasis.hh>
│ │ │ +
21#include <dune/common/diagonalmatrix.hh>
│ │ │ +
22#include <dune/localfunctions/common/localkey.hh>
│ │ │
23#include <dune/localfunctions/common/localfiniteelementtraits.hh>
│ │ │ -
24#include <dune/localfunctions/common/localkey.hh>
│ │ │ -
25
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
33
│ │ │ -
34
│ │ │ -
35
│ │ │ - │ │ │ -
37
│ │ │ -
53namespace Dune::Functions
│ │ │ -
54{
│ │ │ -
55
│ │ │ -
56 template<class GV, class R, bool reduced>
│ │ │ - │ │ │ -
58
│ │ │ -
78 template<class GV,bool reduced = false, class R = double>
│ │ │ - │ │ │ -
80
│ │ │ -
81 template<class DF, int n, class D, class RF, int m, class R, class J, class H>
│ │ │ -
│ │ │ - │ │ │ -
83 : public LocalBasisTraits<DF, n, D, RF, m, R, J>
│ │ │ -
84 {
│ │ │ -
90 using HessianType = H;
│ │ │ -
91 };
│ │ │ -
│ │ │ -
92
│ │ │ -
93 namespace Impl
│ │ │ -
94 {
│ │ │ -
95
│ │ │ -
96 // *****************************************************************************
│ │ │ -
97 // * Some helper functions for building polynomial bases from monomials
│ │ │ -
98 // *****************************************************************************
│ │ │ -
99
│ │ │ -
109 template<class KCoeff, int sizePolynom, int sizeMonom, class In, class Out>
│ │ │ -
110 void multiplyWithCoefficentMatrix(Dune::FieldMatrix<KCoeff, sizePolynom, sizeMonom> const& coefficients,
│ │ │ -
111 In const& monomialValues,
│ │ │ -
112 Out& polynomialValues)
│ │ │ -
113 {
│ │ │ -
114 for (int i = 0; i < sizePolynom; ++i)
│ │ │ -
115 {
│ │ │ -
116 squeezeTensor(polynomialValues[i]) = 0;
│ │ │ -
117 for (int j = 0; j < sizeMonom; ++j)
│ │ │ -
118 squeezeTensor(polynomialValues[i]) += coefficients[i][j]*monomialValues[j];
│ │ │ -
119 }
│ │ │ -
120 }
│ │ │ -
121
│ │ │ -
127 template<int dim, bool reduced>
│ │ │ -
128 class CubicHermiteLocalCoefficients
│ │ │ -
129 {
│ │ │ -
130 public:
│ │ │ -
131 using size_type = std::size_t;
│ │ │ -
132
│ │ │ -
133 CubicHermiteLocalCoefficients()
│ │ │ -
134 : localKeys_(size())
│ │ │ -
135 {
│ │ │ -
136 static_assert((dim > 0) and (dim <= 3), "CubicHermiteLocalCoefficients only implemented for dim=1,2,3");
│ │ │ -
137 static_assert((not reduced) or (dim == 2), "Reduced version of CubicHermiteLocalCoefficients only implemented for dim=2");
│ │ │ -
138 for (size_type i = 0; i < (dim +1); ++i)
│ │ │ -
139 {
│ │ │ -
140 // dim derivatives + 1 evaluation dofs per vertex
│ │ │ -
141 for (size_type k = 0; k < (dim +1); ++k)
│ │ │ -
142 localKeys_[(dim +1) * i + k] = LocalKey(i, dim, k);
│ │ │ -
143 }
│ │ │ -
144 if constexpr (not reduced)
│ │ │ -
145 {
│ │ │ -
146 // 1 evaluation per element (2d) / facets (3d)
│ │ │ -
147 for (size_type i = 0; i < (dim - 1) * (dim - 1); ++i)
│ │ │ -
148 localKeys_[(dim +1) * (dim +1) + i] = LocalKey(i, (dim == 2) ? 0 : 1, 0); // inner dofs
│ │ │ -
149 }
│ │ │ -
150 }
│ │ │ +
24#include <dune/geometry/type.hh>
│ │ │ + │ │ │ + │ │ │ + │ │ │ +
28
│ │ │ +
29namespace Dune
│ │ │ +
30{
│ │ │ +
31namespace Functions {
│ │ │ +
32
│ │ │ +
33// A maze of dependencies between the different parts of this. We need a few forward declarations
│ │ │ +
34template<typename GV, typename R>
│ │ │ + │ │ │ +
36
│ │ │ +
37template<typename GV>
│ │ │ +
38class BSplinePreBasis;
│ │ │ +
39
│ │ │ +
40
│ │ │ +
49template<class GV, class R>
│ │ │ +
│ │ │ + │ │ │ +
51{
│ │ │ +
52 friend class BSplineLocalFiniteElement<GV,R>;
│ │ │ +
53
│ │ │ +
54 typedef typename GV::ctype D;
│ │ │ +
55 enum {dim = GV::dimension};
│ │ │ +
56public:
│ │ │ +
57
│ │ │ +
59 typedef LocalBasisTraits<D,dim,FieldVector<D,dim>,R,1,FieldVector<R,1>,
│ │ │ +
60 FieldMatrix<R,1,dim> > Traits;
│ │ │ +
61
│ │ │ +
│ │ │ + │ │ │ + │ │ │ +
68 : preBasis_(preBasis),
│ │ │ +
69 lFE_(lFE)
│ │ │ +
70 {}
│ │ │ +
│ │ │ +
71
│ │ │ +
│ │ │ +
76 void evaluateFunction (const FieldVector<D,dim>& in,
│ │ │ +
77 std::vector<FieldVector<R,1> >& out) const
│ │ │ +
78 {
│ │ │ +
79 FieldVector<D,dim> globalIn = offset_;
│ │ │ +
80 scaling_.umv(in,globalIn);
│ │ │ +
81
│ │ │ +
82 preBasis_.evaluateFunction(globalIn, out, lFE_.currentKnotSpan_);
│ │ │ +
83 }
│ │ │ +
│ │ │ +
84
│ │ │ +
│ │ │ +
89 void evaluateJacobian (const FieldVector<D,dim>& in,
│ │ │ +
90 std::vector<FieldMatrix<D,1,dim> >& out) const
│ │ │ +
91 {
│ │ │ +
92 FieldVector<D,dim> globalIn = offset_;
│ │ │ +
93 scaling_.umv(in,globalIn);
│ │ │ +
94
│ │ │ +
95 preBasis_.evaluateJacobian(globalIn, out, lFE_.currentKnotSpan_);
│ │ │ +
96
│ │ │ +
97 for (size_t i=0; i<out.size(); i++)
│ │ │ +
98 for (int j=0; j<dim; j++)
│ │ │ +
99 out[i][0][j] *= scaling_[j][j];
│ │ │ +
100 }
│ │ │ +
│ │ │ +
101
│ │ │ +
103 template<size_t k>
│ │ │ +
│ │ │ +
104 inline void evaluate (const typename std::array<int,k>& directions,
│ │ │ +
105 const typename Traits::DomainType& in,
│ │ │ +
106 std::vector<typename Traits::RangeType>& out) const
│ │ │ +
107 {
│ │ │ +
108 switch(k)
│ │ │ +
109 {
│ │ │ +
110 case 0:
│ │ │ +
111 evaluateFunction(in, out);
│ │ │ +
112 break;
│ │ │ +
113 case 1:
│ │ │ +
114 {
│ │ │ +
115 FieldVector<D,dim> globalIn = offset_;
│ │ │ +
116 scaling_.umv(in,globalIn);
│ │ │ +
117
│ │ │ +
118 preBasis_.evaluate(directions, globalIn, out, lFE_.currentKnotSpan_);
│ │ │ +
119
│ │ │ +
120 for (size_t i=0; i<out.size(); i++)
│ │ │ +
121 out[i][0] *= scaling_[directions[0]][directions[0]];
│ │ │ +
122 break;
│ │ │ +
123 }
│ │ │ +
124 case 2:
│ │ │ +
125 {
│ │ │ +
126 FieldVector<D,dim> globalIn = offset_;
│ │ │ +
127 scaling_.umv(in,globalIn);
│ │ │ +
128
│ │ │ +
129 preBasis_.evaluate(directions, globalIn, out, lFE_.currentKnotSpan_);
│ │ │ +
130
│ │ │ +
131 for (size_t i=0; i<out.size(); i++)
│ │ │ +
132 out[i][0] *= scaling_[directions[0]][directions[0]]*scaling_[directions[1]][directions[1]];
│ │ │ +
133 break;
│ │ │ +
134 }
│ │ │ +
135 default:
│ │ │ +
136 DUNE_THROW(NotImplemented, "B-Spline derivatives of order " << k << " not implemented yet!");
│ │ │ +
137 }
│ │ │ +
138 }
│ │ │ +
│ │ │ +
139
│ │ │ +
│ │ │ +
147 unsigned int order () const
│ │ │ +
148 {
│ │ │ +
149 return *std::max_element(preBasis_.order_.begin(), preBasis_.order_.end());
│ │ │ +
150 }
│ │ │ +
│ │ │
151
│ │ │ -
154 static constexpr size_type size()
│ │ │ -
155 {
│ │ │ -
156 if constexpr (dim==1)
│ │ │ -
157 return 4;
│ │ │ -
158 if constexpr ((dim==2) and (reduced))
│ │ │ -
159 return 9;
│ │ │ -
160 if constexpr ((dim==2) and (not reduced))
│ │ │ -
161 return 10;
│ │ │ -
162 if constexpr (dim==3)
│ │ │ -
163 return 20;
│ │ │ -
164 return 0;
│ │ │ -
165 }
│ │ │ -
166
│ │ │ -
169 LocalKey const &localKey(size_type i) const
│ │ │ -
170 {
│ │ │ -
171 return localKeys_[i];
│ │ │ -
172 }
│ │ │ -
173
│ │ │ -
174 private:
│ │ │ -
175 std::vector<LocalKey> localKeys_;
│ │ │ -
176 };
│ │ │ -
177
│ │ │ -
178
│ │ │ -
184 template<class D, class R, int dim, bool reduced>
│ │ │ -
185 class CubicHermiteReferenceLocalBasis
│ │ │ -
186 {
│ │ │ -
187 public:
│ │ │ -
188 using Traits = H2LocalBasisTraits<D, dim, FieldVector<D, dim>, R, 1, FieldVector<R, 1>,
│ │ │ -
189 FieldMatrix<R, 1, dim>, FieldMatrix<R, dim, dim>>;
│ │ │ -
190
│ │ │ -
191 private:
│ │ │ -
192
│ │ │ -
205 static constexpr auto getCubicHermiteCoefficients()
│ │ │ -
206 {
│ │ │ -
207 if constexpr (dim == 1)
│ │ │ -
208 return Dune::FieldMatrix<D, 4, 4>({{1, 0, -3, 2}, {0, 1, -2, 1}, {0, 0, 3, -2}, {0, 0, -1, 1}});
│ │ │ -
209 else if constexpr (dim == 2)
│ │ │ -
210 {
│ │ │ -
211 if constexpr (reduced) {
│ │ │ -
212 auto w = std::array<D, 9>{1. / 3, 1. / 18, 1. / 18, 1. / 3, -1. / 9,
│ │ │ -
213 1. / 18, 1. / 3, 1. / 18, -1. / 9};
│ │ │ -
214 return Dune::FieldMatrix<D, 9, 10>({
│ │ │ -
215 {1, 0, 0, -3, -13 + w[0] * 27, -3, 2, 13 - w[0] * 27, 13 - w[0] * 27, 2},
│ │ │ -
216 {0, 1, 0, -2, -3 + w[1] * 27, 0, 1, 3 - w[1] * 27, 2 - w[1] * 27, 0},
│ │ │ -
217 {0, 0, 1, 0, -3 + w[2] * 27, -2, 0, 2 - w[2] * 27, 3 - w[2] * 27, 1},
│ │ │ -
218 {0, 0, 0, 3, -7 + w[3] * 27, 0, -2, 7 - w[3] * 27, 7 - w[3] * 27, 0},
│ │ │ -
219 {0, 0, 0, -1, 2 + w[4] * 27, 0, 1, -2 - w[4] * 27, -2 - w[4] * 27, 0},
│ │ │ -
220 {0, 0, 0, 0, -1 + w[5] * 27, 0, 0, 2 - w[5] * 27, 1 - w[5] * 27, 0},
│ │ │ -
221 {0, 0, 0, 0, -7 + w[6] * 27, 3, 0, 7 - w[6] * 27, 7 - w[6] * 27, -2},
│ │ │ -
222 {0, 0, 0, 0, -1 + w[7] * 27, 0, 0, 1 - w[7] * 27, 2 - w[7] * 27, 0},
│ │ │ -
223 {0, 0, 0, 0, 2 + w[8] * 27, -1, 0, -2 - w[8] * 27, -2 - w[8] * 27, 1},
│ │ │ -
224 });
│ │ │ -
225 }
│ │ │ -
226 else
│ │ │ -
227 return Dune::FieldMatrix<D, 10,10>({
│ │ │ -
228 {1, 0, 0, -3, -13, -3, 2, 13, 13, 2},
│ │ │ -
229 {0, 1, 0, -2, -3, 0, 1, 3, 2, 0},
│ │ │ -
230 {0, 0, 1, 0, -3, -2, 0, 2, 3, 1}, // l_2
│ │ │ -
231 {0, 0, 0, 3, -7, 0, -2, 7, 7, 0},
│ │ │ -
232 {0, 0, 0, -1, 2, 0, 1, -2, -2, 0},
│ │ │ -
233 {0, 0, 0, 0, -1, 0, 0, 2, 1, 0},
│ │ │ -
234 {0, 0, 0, 0, -7, 3, 0, 7, 7, -2}, // l_6
│ │ │ -
235 {0, 0, 0, 0, -1, 0, 0, 1, 2, 0},
│ │ │ -
236 {0, 0, 0, 0, 2, -1, 0, -2, -2, 1},
│ │ │ -
237 {0, 0, 0, 0, 27, 0, 0, -27, -27, 0}}); // l_9, inner dof
│ │ │ -
238 }
│ │ │ -
239 else if constexpr (dim == 3)
│ │ │ -
240 {
│ │ │ -
241 return Dune::FieldMatrix<D, 20,20>({{1, 0, 0, 0, -3, -13, -3, -13, -13, -3, // deg 0 to 2
│ │ │ -
242 2, 13, 13, 2, 13, 33, 13, 13, 13, 2}, // deg 3
│ │ │ -
243 {0, 1, 0, 0,/*xx*/ -2, /*xy*/-3,/*yy*/ 0,/*xz*/ -3,/*yz*/ 0,/*zz*/ 0, 1, 3, 2, 0, 3, 4, 0, 2, 0, 0},
│ │ │ -
244 {0, 0, 1, 0, 0, -3, -2, 0, -3, 0, 0, 2, 3, 1, 0, 4, 3, 0, 2, 0},
│ │ │ -
245 {0, 0, 0, 1, 0, 0, 0, -3, -3, -2, 0, 0, 0, 0, 2, 4, 2, 3, 3, 1},
│ │ │ -
246 {0, 0, 0, 0, 3, -7, 0, -7, 0, 0, // l_4
│ │ │ -
247 -2, 7, 7, 0, 7, 7, 0, 7, 0, 0},
│ │ │ -
248 {0, 0, 0, 0, -1, 2, 0, 2, 0, 0, 1, -2, -2, 0, -2, -2, 0, -2, 0, 0},
│ │ │ -
249 {0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0},
│ │ │ -
250 {0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 1, 0, 0},
│ │ │ -
251 {0, 0, 0, 0, 0, -7, 3, 0, -7, 0, // l_8
│ │ │ -
252 0, 7, 7, -2, 0, 7, 7, 0, 7, 0},
│ │ │ -
253 {0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0},
│ │ │ -
254 {0, 0, 0, 0, 0, 2, -1, 0, 2, 0, 0, -2, -2, 1, 0, -2, -2, 0, -2, 0},
│ │ │ -
255 {0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0},
│ │ │ -
256 {0, 0, 0, 0, 0, 0, 0, -7, -7, 3, // l_12
│ │ │ -
257 0, 0, 0, 0, 7, 7, 7, 7, 7, -2},
│ │ │ -
258 {0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0},
│ │ │ -
259 {0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0},
│ │ │ -
260 {0, 0, 0, 0, 0, 0, 0, 2, 2, -1, 0, 0, 0, 0, -2, -2, -2, -2, -2, 1},
│ │ │ -
261 // l_16, from here on inner dofs
│ │ │ -
262 {0, 0, 0, 0, 0, 27, 0, 0, 0, 0, // bottom
│ │ │ -
263 0, -27, -27, 0, 0, -27, 0, 0, 0, 0},
│ │ │ -
264 {0, 0, 0, 0, 0, 0, 0, 27, 0, 0, // front
│ │ │ -
265 0, 0, 0, 0, -27, -27, 0, -27, 0, 0},
│ │ │ -
266 {0, 0, 0, 0, 0, 0, 0, 0, 27, 0, // left
│ │ │ -
267 0, 0, 0, 0, 0, -27, -27, 0, -27, 0},
│ │ │ -
268 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // right
│ │ │ -
269 0, 0, 0, 0, 0, 27, 0, 0, 0, 0}});
│ │ │ -
270 }
│ │ │ -
271 }
│ │ │ -
272
│ │ │ -
273 static constexpr auto referenceBasisCoefficients = getCubicHermiteCoefficients();
│ │ │ -
274 static constexpr MonomialSet<typename Traits::RangeFieldType, dim, 3> monomials = {};
│ │ │ -
275
│ │ │ -
276 public:
│ │ │ -
277
│ │ │ -
278 CubicHermiteReferenceLocalBasis()
│ │ │ -
279 {
│ │ │ -
280 static_assert((dim > 0) and (dim <= 3), "CubicHermiteReferenceLocalBasis only implemented for dim=1,2,3");
│ │ │ -
281 static_assert((not reduced) or (dim == 2), "Reduced version of CubicHermiteReferenceLocalBasis only implemented for dim=2");
│ │ │ -
282 }
│ │ │ -
283
│ │ │ -
286 static constexpr unsigned int size()
│ │ │ -
287 {
│ │ │ -
288 return CubicHermiteLocalCoefficients<dim,reduced>::size();
│ │ │ -
289 }
│ │ │ -
290
│ │ │ -
293 unsigned int order() const
│ │ │ -
294 {
│ │ │ -
295 return 3;
│ │ │ -
296 }
│ │ │ -
297
│ │ │ -
303 void evaluateFunction(const typename Traits::DomainType &in,
│ │ │ -
304 std::vector<typename Traits::RangeType> &out) const
│ │ │ -
305 {
│ │ │ -
306 out.resize(size());
│ │ │ -
307 auto monomialValues = monomials(in);
│ │ │ -
308 multiplyWithCoefficentMatrix(referenceBasisCoefficients, monomialValues, out);
│ │ │ -
309 }
│ │ │ -
310
│ │ │ -
316 void evaluateJacobian(const typename Traits::DomainType &in,
│ │ │ -
317 std::vector<typename Traits::JacobianType> &out) const
│ │ │ -
318 {
│ │ │ -
319 out.resize(size());
│ │ │ -
320 auto monomialValues = derivative(monomials)(in);
│ │ │ -
321 multiplyWithCoefficentMatrix(referenceBasisCoefficients, monomialValues, out);
│ │ │ -
322 }
│ │ │ -
323
│ │ │ -
329 void evaluateHessian(const typename Traits::DomainType &in,
│ │ │ -
330 std::vector<typename Traits::HessianType> &out) const
│ │ │ -
331 {
│ │ │ -
332 out.resize(size());
│ │ │ -
333 auto monomialValues = derivative(derivative(monomials))(in);
│ │ │ -
334 multiplyWithCoefficentMatrix(referenceBasisCoefficients, monomialValues, out);
│ │ │ -
335 }
│ │ │ -
336
│ │ │ -
343 void partial(std::array<unsigned int, dim> order, const typename Traits::DomainType &in,
│ │ │ -
344 std::vector<typename Traits::RangeType> &out) const
│ │ │ -
345 {
│ │ │ -
346 out.resize(size());
│ │ │ -
347 auto totalOrder = std::accumulate(order.begin(), order.end(), 0);
│ │ │ -
348 if (totalOrder == 0)
│ │ │ -
349 evaluateFunction(in, out);
│ │ │ -
350 else if (totalOrder == 1)
│ │ │ -
351 {
│ │ │ -
352 evaluateJacobian(in,jacobiansBuffer_);
│ │ │ -
353 std::size_t which = std::max_element(order.begin(), order.end()) - order.begin();
│ │ │ -
354 for (auto i : Dune::range(size()))
│ │ │ -
355 out[i] = jacobiansBuffer_[i][0][which];
│ │ │ -
356 }
│ │ │ -
357 else if (totalOrder == 2)
│ │ │ -
358 {
│ │ │ -
359 evaluateHessian(in, hessianBuffer_);
│ │ │ -
360 std::size_t first, second;
│ │ │ -
361 first = std::max_element(order.begin(), order.end()) - order.begin();
│ │ │ -
362 if (order[first] == 2)
│ │ │ -
363 second = first;
│ │ │ -
364 else
│ │ │ -
365 {
│ │ │ -
366 order[first] = 0;
│ │ │ -
367 second = std::max_element(order.begin(), order.end()) - order.begin();
│ │ │ -
368 }
│ │ │ -
369 for (auto i : Dune::range(size()))
│ │ │ -
370 out[i] = hessianBuffer_[i][first][second];
│ │ │ -
371 }
│ │ │ -
372 else
│ │ │ -
373 DUNE_THROW(RangeError, "partial() not implemented for given order");
│ │ │ -
374 }
│ │ │ -
375
│ │ │ -
376 private:
│ │ │ -
377 mutable std::vector<typename Traits::JacobianType> jacobiansBuffer_;
│ │ │ -
378 mutable std::vector<typename Traits::HessianType> hessianBuffer_;
│ │ │ -
379 };
│ │ │ -
380
│ │ │ -
381
│ │ │ -
387 template<class D, int dim, bool reduced = false>
│ │ │ -
388 class CubicHermiteLocalInterpolation
│ │ │ -
389 {
│ │ │ -
390 using size_type = std::size_t;
│ │ │ -
391
│ │ │ -
392 static constexpr unsigned int size()
│ │ │ -
393 {
│ │ │ -
394 return CubicHermiteLocalCoefficients<dim,reduced>::size();
│ │ │ -
395 }
│ │ │ -
396
│ │ │ -
397 using FunctionalDescriptor = Dune::Functions::Impl::FunctionalDescriptor<dim>;
│ │ │ -
398
│ │ │ -
399 public:
│ │ │ -
400
│ │ │ -
401 CubicHermiteLocalInterpolation()
│ │ │ -
402 {
│ │ │ -
403 static_assert((dim > 0) and (dim <= 3), "CubicHermiteLocalInterpolation only implemented for dim=1,2,3");
│ │ │ -
404 static_assert((not reduced) or (dim == 2), "Reduced version of CubicHermiteLocalInterpolation only implemented for dim=2");
│ │ │ -
405 if constexpr (dim==1)
│ │ │ -
406 {
│ │ │ -
407 descriptors_[0] = FunctionalDescriptor();
│ │ │ -
408 descriptors_[1] = FunctionalDescriptor({1});
│ │ │ -
409 descriptors_[2] = FunctionalDescriptor();
│ │ │ -
410 descriptors_[3] = FunctionalDescriptor({1});
│ │ │ -
411 }
│ │ │ -
412 if constexpr (dim==2)
│ │ │ -
413 {
│ │ │ -
414 descriptors_[0] = FunctionalDescriptor();
│ │ │ -
415 descriptors_[1] = FunctionalDescriptor({1,0});
│ │ │ -
416 descriptors_[2] = FunctionalDescriptor({0,1});
│ │ │ -
417 descriptors_[3] = FunctionalDescriptor();
│ │ │ -
418 descriptors_[4] = FunctionalDescriptor({1,0});
│ │ │ -
419 descriptors_[5] = FunctionalDescriptor({0,1});
│ │ │ -
420 descriptors_[6] = FunctionalDescriptor();
│ │ │ -
421 descriptors_[7] = FunctionalDescriptor({1,0});
│ │ │ -
422 descriptors_[8] = FunctionalDescriptor({0,1});
│ │ │ -
423 if (not reduced)
│ │ │ -
424 descriptors_[9] = FunctionalDescriptor();
│ │ │ -
425 }
│ │ │ -
426 if constexpr (dim==3)
│ │ │ -
427 {
│ │ │ -
428 descriptors_[0] = FunctionalDescriptor();
│ │ │ -
429 descriptors_[1] = FunctionalDescriptor({1,0,0});
│ │ │ -
430 descriptors_[2] = FunctionalDescriptor({0,1,0});
│ │ │ -
431 descriptors_[3] = FunctionalDescriptor({0,0,1});
│ │ │ -
432 descriptors_[4] = FunctionalDescriptor();
│ │ │ -
433 descriptors_[5] = FunctionalDescriptor({1,0,0});
│ │ │ -
434 descriptors_[6] = FunctionalDescriptor({0,1,0});
│ │ │ -
435 descriptors_[7] = FunctionalDescriptor({0,0,1});
│ │ │ -
436 descriptors_[8] = FunctionalDescriptor();
│ │ │ -
437 descriptors_[9] = FunctionalDescriptor({1,0,0});
│ │ │ -
438 descriptors_[10] = FunctionalDescriptor({0,1,0});
│ │ │ -
439 descriptors_[11] = FunctionalDescriptor({0,0,1});
│ │ │ -
440 descriptors_[12] = FunctionalDescriptor();
│ │ │ -
441 descriptors_[13] = FunctionalDescriptor({1,0,0});
│ │ │ -
442 descriptors_[14] = FunctionalDescriptor({0,1,0});
│ │ │ -
443 descriptors_[15] = FunctionalDescriptor({0,0,1});
│ │ │ -
444 descriptors_[16] = FunctionalDescriptor();
│ │ │ -
445 descriptors_[17] = FunctionalDescriptor();
│ │ │ -
446 descriptors_[18] = FunctionalDescriptor();
│ │ │ -
447 descriptors_[19] = FunctionalDescriptor();
│ │ │ -
448 }
│ │ │ -
449 }
│ │ │ +
│ │ │ +
154 std::size_t size() const
│ │ │ +
155 {
│ │ │ +
156 return lFE_.size();
│ │ │ +
157 }
│ │ │ +
│ │ │ +
158
│ │ │ +
159private:
│ │ │ +
160 const BSplinePreBasis<GV>& preBasis_;
│ │ │ +
161
│ │ │ + │ │ │ +
163
│ │ │ +
164 // Coordinates in a single knot span differ from coordinates on the B-spline patch
│ │ │ +
165 // by an affine transformation. This transformation is stored in offset_ and scaling_.
│ │ │ +
166 FieldVector<D,dim> offset_;
│ │ │ +
167 DiagonalMatrix<D,dim> scaling_;
│ │ │ +
168};
│ │ │ +
│ │ │ +
169
│ │ │ +
183template<int dim>
│ │ │ +
│ │ │ + │ │ │ +
185{
│ │ │ +
186 // Return i as a d-digit number in the (k+1)-nary system
│ │ │ +
187 std::array<unsigned int,dim> multiindex (unsigned int i) const
│ │ │ +
188 {
│ │ │ +
189 std::array<unsigned int,dim> alpha;
│ │ │ +
190 for (int j=0; j<dim; j++)
│ │ │ +
191 {
│ │ │ +
192 alpha[j] = i % sizes_[j];
│ │ │ +
193 i = i/sizes_[j];
│ │ │ +
194 }
│ │ │ +
195 return alpha;
│ │ │ +
196 }
│ │ │ +
197
│ │ │ +
199 void setup1d(std::vector<unsigned int>& subEntity)
│ │ │ +
200 {
│ │ │ +
201 if (sizes_[0]==1)
│ │ │ +
202 {
│ │ │ +
203 subEntity[0] = 0;
│ │ │ +
204 return;
│ │ │ +
205 }
│ │ │ +
206
│ │ │ +
207 /* edge and vertex numbering
│ │ │ +
208 0----0----1
│ │ │ +
209 */
│ │ │ +
210 unsigned lastIndex=0;
│ │ │ +
211 subEntity[lastIndex++] = 0; // corner 0
│ │ │ +
212 for (unsigned i = 0; i < sizes_[0] - 2; ++i)
│ │ │ +
213 subEntity[lastIndex++] = 0; // inner dofs of element (0)
│ │ │ +
214
│ │ │ +
215 subEntity[lastIndex++] = 1; // corner 1
│ │ │ +
216
│ │ │ +
217 assert(size()==lastIndex);
│ │ │ +
218 }
│ │ │ +
219
│ │ │ +
220 void setup2d(std::vector<unsigned int>& subEntity)
│ │ │ +
221 {
│ │ │ +
222 unsigned lastIndex=0;
│ │ │ +
223
│ │ │ +
224 // LocalKey: entity number , entity codim, dof indices within each entity
│ │ │ +
225 /* edge and vertex numbering
│ │ │ +
226 2----3----3
│ │ │ +
227 | |
│ │ │ +
228 | |
│ │ │ +
229 0 1
│ │ │ +
230 | |
│ │ │ +
231 | |
│ │ │ +
232 0----2----1
│ │ │ +
233 */
│ │ │ +
234
│ │ │ +
235 // lower edge (2)
│ │ │ +
236 subEntity[lastIndex++] = 0; // corner 0
│ │ │ +
237 for (unsigned i = 0; i < sizes_[0]-2; ++i)
│ │ │ +
238 subEntity[lastIndex++] = 2; // inner dofs of lower edge (2)
│ │ │ +
239
│ │ │ +
240 subEntity[lastIndex++] = 1; // corner 1
│ │ │ +
241
│ │ │ +
242 // iterate from bottom to top over inner edge dofs
│ │ │ +
243 for (unsigned e = 0; e < sizes_[1]-2; ++e)
│ │ │ +
244 {
│ │ │ +
245 subEntity[lastIndex++] = 0; // left edge (0)
│ │ │ +
246 for (unsigned i = 0; i < sizes_[0]-2; ++i)
│ │ │ +
247 subEntity[lastIndex++] = 0; // face dofs
│ │ │ +
248 subEntity[lastIndex++] = 1; // right edge (1)
│ │ │ +
249 }
│ │ │ +
250
│ │ │ +
251 // upper edge (3)
│ │ │ +
252 subEntity[lastIndex++] = 2; // corner 2
│ │ │ +
253 for (unsigned i = 0; i < sizes_[0]-2; ++i)
│ │ │ +
254 subEntity[lastIndex++] = 3; // inner dofs of upper edge (3)
│ │ │ +
255
│ │ │ +
256 subEntity[lastIndex++] = 3; // corner 3
│ │ │ +
257
│ │ │ +
258 assert(size()==lastIndex);
│ │ │ +
259 }
│ │ │ +
260
│ │ │ +
261
│ │ │ +
262public:
│ │ │ +
│ │ │ +
263 void init(const std::array<unsigned,dim>& sizes)
│ │ │ +
264 {
│ │ │ +
265 sizes_ = sizes;
│ │ │ +
266
│ │ │ +
267 li_.resize(size());
│ │ │ +
268
│ │ │ +
269 // Set up array of codimension-per-dof-number
│ │ │ +
270 std::vector<unsigned int> codim(li_.size());
│ │ │ +
271
│ │ │ +
272 for (std::size_t i=0; i<codim.size(); i++)
│ │ │ +
273 {
│ │ │ +
274 codim[i] = 0;
│ │ │ +
275 // Codimension gets increased by 1 for each coordinate direction
│ │ │ +
276 // where dof is on boundary
│ │ │ +
277 std::array<unsigned int,dim> mIdx = multiindex(i);
│ │ │ +
278 for (int j=0; j<dim; j++)
│ │ │ +
279 if (mIdx[j]==0 or mIdx[j]==sizes[j]-1)
│ │ │ +
280 codim[i]++;
│ │ │ +
281 }
│ │ │ +
282
│ │ │ +
283 // Set up index vector (the index of the dof in the set of dofs of a given subentity)
│ │ │ +
284 // Algorithm: the 'index' has the same ordering as the dof number 'i'.
│ │ │ +
285 // To make it consecutive we interpret 'i' in the (k+1)-adic system, omit all digits
│ │ │ +
286 // that correspond to axes where the dof is on the element boundary, and transform the
│ │ │ +
287 // rest to the (k-1)-adic system.
│ │ │ +
288 std::vector<unsigned int> index(size());
│ │ │ +
289
│ │ │ +
290 for (std::size_t i=0; i<index.size(); i++)
│ │ │ +
291 {
│ │ │ +
292 index[i] = 0;
│ │ │ +
293
│ │ │ +
294 std::array<unsigned int,dim> mIdx = multiindex(i);
│ │ │ +
295
│ │ │ +
296 for (int j=dim-1; j>=0; j--)
│ │ │ +
297 if (mIdx[j]>0 and mIdx[j]<sizes[j]-1)
│ │ │ +
298 index[i] = (sizes[j]-1)*index[i] + (mIdx[j]-1);
│ │ │ +
299 }
│ │ │ +
300
│ │ │ +
301 // Set up entity and dof numbers for each (supported) dimension separately
│ │ │ +
302 std::vector<unsigned int> subEntity(li_.size());
│ │ │ +
303
│ │ │ +
304 if (subEntity.size() > 0)
│ │ │ +
305 {
│ │ │ +
306 if (dim==1) {
│ │ │ +
307
│ │ │ +
308 setup1d(subEntity);
│ │ │ +
309
│ │ │ +
310 } else if (dim==2 and sizes_[0]>1 and sizes_[1]>1) {
│ │ │ +
311
│ │ │ +
312 setup2d(subEntity);
│ │ │ +
313
│ │ │ +
314 }
│ │ │ +
315 }
│ │ │ +
316
│ │ │ +
317 for (size_t i=0; i<li_.size(); i++)
│ │ │ +
318 li_[i] = LocalKey(subEntity[i], codim[i], index[i]);
│ │ │ +
319 }
│ │ │ +
│ │ │ +
320
│ │ │ +
│ │ │ +
322 std::size_t size () const
│ │ │ +
323 {
│ │ │ +
324 return std::accumulate(sizes_.begin(), sizes_.end(), 1, std::multiplies<unsigned int>());
│ │ │ +
325 }
│ │ │ +
│ │ │ +
326
│ │ │ +
│ │ │ +
328 const LocalKey& localKey (std::size_t i) const
│ │ │ +
329 {
│ │ │ +
330 return li_[i];
│ │ │ +
331 }
│ │ │ +
│ │ │ +
332
│ │ │ +
333private:
│ │ │ +
334
│ │ │ +
335 // Number of shape functions on this element per coordinate direction
│ │ │ +
336 std::array<unsigned, dim> sizes_;
│ │ │ +
337
│ │ │ +
338 std::vector<LocalKey> li_;
│ │ │ +
339};
│ │ │ +
│ │ │ +
340
│ │ │ +
345template<int dim, class LB>
│ │ │ +
│ │ │ + │ │ │ +
347{
│ │ │ +
348public:
│ │ │ +
350 template<typename F, typename C>
│ │ │ +
│ │ │ +
351 void interpolate (const F& f, std::vector<C>& out) const
│ │ │ +
352 {
│ │ │ +
353 DUNE_THROW(NotImplemented, "BSplineLocalInterpolation::interpolate");
│ │ │ +
354 }
│ │ │ +
│ │ │ +
355
│ │ │ +
356};
│ │ │ +
│ │ │ +
357
│ │ │ +
367template<class GV, class R>
│ │ │ +
│ │ │ + │ │ │ +
369{
│ │ │ +
370 typedef typename GV::ctype D;
│ │ │ +
371 enum {dim = GV::dimension};
│ │ │ +
372 friend class BSplineLocalBasis<GV,R>;
│ │ │ +
373public:
│ │ │ +
374
│ │ │ +
377 typedef LocalFiniteElementTraits<BSplineLocalBasis<GV,R>,
│ │ │ + │ │ │ + │ │ │ +
380
│ │ │ +
│ │ │ + │ │ │ +
384 : preBasis_(preBasis),
│ │ │ +
385 localBasis_(preBasis,*this)
│ │ │ +
386 {}
│ │ │ +
│ │ │ +
387
│ │ │ +
│ │ │ + │ │ │ +
391 : preBasis_(other.preBasis_),
│ │ │ + │ │ │ +
393 {}
│ │ │ +
│ │ │ +
394
│ │ │ +
│ │ │ +
401 void bind(const std::array<unsigned,dim>& elementIdx)
│ │ │ +
402 {
│ │ │ +
403 /* \todo In the long run we need to precompute a table for this */
│ │ │ +
404 for (size_t i=0; i<elementIdx.size(); i++)
│ │ │ +
405 {
│ │ │ +
406 currentKnotSpan_[i] = 0;
│ │ │ +
407
│ │ │ +
408 // Skip over degenerate knot spans
│ │ │ +
409 while (preBasis_.knotVectors_[i][currentKnotSpan_[i]+1] < preBasis_.knotVectors_[i][currentKnotSpan_[i]]+1e-8)
│ │ │ +
410 currentKnotSpan_[i]++;
│ │ │ +
411
│ │ │ +
412 for (size_t j=0; j<elementIdx[i]; j++)
│ │ │ +
413 {
│ │ │ +
414 currentKnotSpan_[i]++;
│ │ │ +
415
│ │ │ +
416 // Skip over degenerate knot spans
│ │ │ +
417 while (preBasis_.knotVectors_[i][currentKnotSpan_[i]+1] < preBasis_.knotVectors_[i][currentKnotSpan_[i]]+1e-8)
│ │ │ +
418 currentKnotSpan_[i]++;
│ │ │ +
419 }
│ │ │ +
420
│ │ │ +
421 // Compute the geometric transformation from knotspan-local to global coordinates
│ │ │ +
422 localBasis_.offset_[i] = preBasis_.knotVectors_[i][currentKnotSpan_[i]];
│ │ │ +
423 localBasis_.scaling_[i][i] = preBasis_.knotVectors_[i][currentKnotSpan_[i]+1] - preBasis_.knotVectors_[i][currentKnotSpan_[i]];
│ │ │ +
424 }
│ │ │ +
425
│ │ │ +
426 // Set up the LocalCoefficients object
│ │ │ +
427 std::array<unsigned int, dim> sizes;
│ │ │ +
428 for (size_t i=0; i<dim; i++)
│ │ │ +
429 sizes[i] = size(i);
│ │ │ +
430 localCoefficients_.init(sizes);
│ │ │ +
431 }
│ │ │ +
│ │ │ +
432
│ │ │ +
│ │ │ + │ │ │ +
435 {
│ │ │ +
436 return localBasis_;
│ │ │ +
437 }
│ │ │ +
│ │ │ +
438
│ │ │ +
│ │ │ + │ │ │ +
441 {
│ │ │ +
442 return localCoefficients_;
│ │ │ +
443 }
│ │ │ +
│ │ │ +
444
│ │ │ +
│ │ │ + │ │ │ +
447 {
│ │ │ +
448 return localInterpolation_;
│ │ │ +
449 }
│ │ │ +
│ │ │
450
│ │ │ -
453 template<class Element>
│ │ │ -
454 void bind( Element const &element, std::array<D, dim+1>const& averageVertexMeshSize)
│ │ │ -
455 {
│ │ │ -
456 averageVertexMeshSize_ = &averageVertexMeshSize;
│ │ │ -
457 }
│ │ │ -
458
│ │ │ -
466 template<class F, class C>
│ │ │ -
467 void interpolate(const F &f, std::vector<C> &out) const
│ │ │ -
468 {
│ │ │ -
469 out.resize(size());
│ │ │ -
470 auto df = derivative(f);
│ │ │ -
471 auto const &refElement = Dune::ReferenceElements<D, dim>::simplex();
│ │ │ -
472
│ │ │ -
473 // Iterate over vertices, dim derivative +1 evaluation dofs per vertex
│ │ │ -
474 for (int i = 0; i < (dim+1); ++i)
│ │ │ -
475 {
│ │ │ -
476 auto x = refElement.position(i, dim);
│ │ │ -
477 auto&& derivativeValue = df(x);
│ │ │ -
478 out[i * (dim +1)] = f(x);
│ │ │ -
479 for (int d = 0; d < dim; ++d)
│ │ │ -
480 out[i * (dim+1) + d + 1] = squeezeTensor(derivativeValue)[d] * (*averageVertexMeshSize_)[i];
│ │ │ -
481 }
│ │ │ +
│ │ │ +
452 unsigned size () const
│ │ │ +
453 {
│ │ │ +
454 std::size_t r = 1;
│ │ │ +
455 for (int i=0; i<dim; i++)
│ │ │ +
456 r *= size(i);
│ │ │ +
457 return r;
│ │ │ +
458 }
│ │ │ +
│ │ │ +
459
│ │ │ +
│ │ │ +
462 GeometryType type () const
│ │ │ +
463 {
│ │ │ +
464 return GeometryTypes::cube(dim);
│ │ │ +
465 }
│ │ │ +
│ │ │ +
466
│ │ │ +
467//private:
│ │ │ +
468
│ │ │ +
│ │ │ +
470 unsigned int size(int i) const
│ │ │ +
471 {
│ │ │ +
472 const auto& order = preBasis_.order_;
│ │ │ +
473 unsigned int r = order[i]+1; // The 'normal' value
│ │ │ +
474 if (currentKnotSpan_[i]<order[i]) // Less near the left end of the knot vector
│ │ │ +
475 r -= (order[i] - currentKnotSpan_[i]);
│ │ │ +
476 if ( order[i] > (preBasis_.knotVectors_[i].size() - currentKnotSpan_[i] - 2) )
│ │ │ +
477 r -= order[i] - (preBasis_.knotVectors_[i].size() - currentKnotSpan_[i] - 2);
│ │ │ +
478 return r;
│ │ │ +
479 }
│ │ │ +
│ │ │ +
480
│ │ │ + │ │ │
482
│ │ │ -
483 if constexpr (not reduced)
│ │ │ -
484 {
│ │ │ -
485 for (size_type i = 0; i < (dim - 1) * (dim - 1); ++i)
│ │ │ -
486 out[(dim +1) * (dim +1) + i] = f(refElement.position(i, (dim == 2) ? 0 : 1));
│ │ │ -
487 }
│ │ │ -
488 }
│ │ │ -
489
│ │ │ -
493 const FunctionalDescriptor& functionalDescriptor(size_type i) const
│ │ │ -
494 {
│ │ │ -
495 return descriptors_[i];
│ │ │ -
496 }
│ │ │ -
497
│ │ │ -
498 protected:
│ │ │ -
499 std::array<D, dim+1> const* averageVertexMeshSize_;
│ │ │ -
500 std::array<FunctionalDescriptor, size()> descriptors_;
│ │ │ -
501 };
│ │ │ -
502
│ │ │ -
503 template<class D, class R, int dim , bool reduced>
│ │ │ -
504 struct CubicHermiteLocalBasisTraits
│ │ │ -
505 : public H2LocalBasisTraits<D, dim, Dune::FieldVector<D,dim>, R, 1,
│ │ │ -
506 Dune::FieldVector<R,1>, Dune::FieldMatrix<R,1,dim>, Dune::FieldMatrix<R,dim,dim>>
│ │ │ -
507 {};
│ │ │ -
508
│ │ │ -
517 template<class D, class R, int dim, bool reduced = false>
│ │ │ -
518 class CubicHermiteLocalFiniteElement
│ │ │ -
519 : public Impl::TransformedFiniteElementMixin<CubicHermiteLocalFiniteElement<D,R,dim,reduced>, CubicHermiteLocalBasisTraits<D, R, dim, reduced>>
│ │ │ -
520 {
│ │ │ -
521 using Base = Impl::TransformedFiniteElementMixin< CubicHermiteLocalFiniteElement<D,R,dim,reduced>, CubicHermiteLocalBasisTraits<D, R, dim, reduced>>;
│ │ │ -
522 friend class Impl::TransformedLocalBasis<CubicHermiteLocalFiniteElement<D,R,dim,reduced>, CubicHermiteLocalBasisTraits<D, R, dim, reduced>>;
│ │ │ -
523
│ │ │ -
524 public:
│ │ │ -
525
│ │ │ -
526 CubicHermiteLocalFiniteElement()
│ │ │ -
527 : Base()
│ │ │ -
528 {
│ │ │ -
529 static_assert((dim > 0) and (dim <= 3), "CubicHermiteLocalFiniteElement only implemented for dim=1,2,3");
│ │ │ -
530 static_assert((not reduced) or (dim == 2), "Reduced version of CubicHermiteLocalFiniteElement only implemented for dim=2");
│ │ │ -
531 }
│ │ │ -
532
│ │ │ -
535 using size_type = std::size_t;
│ │ │ -
536 using Traits = LocalFiniteElementTraits<
│ │ │ -
537 Impl::TransformedLocalBasis<CubicHermiteLocalFiniteElement<D,R,dim,reduced>, CubicHermiteLocalBasisTraits<D, R, dim, reduced>>,
│ │ │ -
538 Impl::CubicHermiteLocalCoefficients<dim, reduced>,
│ │ │ -
539 Impl::CubicHermiteLocalInterpolation<D, dim, reduced>>;
│ │ │ -
540
│ │ │ -
544 const typename Traits::LocalCoefficientsType &localCoefficients() const
│ │ │ -
545 {
│ │ │ -
546 return coefficients_;
│ │ │ -
547 }
│ │ │ -
548
│ │ │ -
551 const typename Traits::LocalInterpolationType &localInterpolation() const
│ │ │ -
552 {
│ │ │ -
553 return interpolation_;
│ │ │ -
554 }
│ │ │ -
555
│ │ │ -
558 static constexpr GeometryType type()
│ │ │ -
559 {
│ │ │ -
560 return GeometryTypes::simplex(dim);
│ │ │ -
561 }
│ │ │ -
562
│ │ │ -
565 static constexpr size_type size()
│ │ │ -
566 {
│ │ │ -
567 return Impl::CubicHermiteLocalCoefficients<dim,reduced>::size();
│ │ │ -
568 }
│ │ │ -
569
│ │ │ -
572 template<class Mapper, class Element>
│ │ │ -
573 void bind(Mapper const& vertexMapper, std::vector<D> const& globalAverageVertexMeshSize, Element const &e)
│ │ │ -
574 {
│ │ │ -
575 // Cache average mesh size for each vertex
│ │ │ -
576 for (auto i : range(dim+1))
│ │ │ -
577 averageVertexMeshSize_[i] = globalAverageVertexMeshSize[vertexMapper.subIndex(e, i, dim)];
│ │ │ -
578
│ │ │ -
579 // Bind LocalInterpolation to updated local state
│ │ │ -
580 interpolation_.bind(e, averageVertexMeshSize_);
│ │ │ -
581
│ │ │ -
582 // Compute local transformation matrices for each vertex
│ │ │ -
583 const auto& geometry = e.geometry();
│ │ │ -
584 const auto& refElement = Dune::ReferenceElements<typename Element::Geometry::ctype, dim>::simplex();
│ │ │ -
585 for (auto i : range(dim+1))
│ │ │ -
586 {
│ │ │ -
587 scaledVertexJacobians_[i] = geometry.jacobian(refElement.position(i, dim));
│ │ │ -
588 scaledVertexJacobians_[i] /= averageVertexMeshSize_[i];
│ │ │ -
589 }
│ │ │ -
590 }
│ │ │ -
591
│ │ │ -
592 protected:
│ │ │ -
593
│ │ │ -
596 Impl::CubicHermiteReferenceLocalBasis<D, R, dim, reduced> const& referenceLocalBasis() const
│ │ │ -
597 {
│ │ │ -
598 return basis_;
│ │ │ -
599 }
│ │ │ -
600
│ │ │ -
605 template<class InputValues, class OutputValues>
│ │ │ -
606 void transform(InputValues const &inValues, OutputValues &outValues) const
│ │ │ -
607 {
│ │ │ -
608 assert(inValues.size() == size());
│ │ │ -
609 assert(outValues.size() == inValues.size());
│ │ │ -
610 auto inIt = inValues.begin();
│ │ │ -
611 auto outIt = outValues.begin();
│ │ │ -
612
│ │ │ -
613 for (auto vertex : Dune::range((dim +1)))
│ │ │ -
614 {
│ │ │ -
615 *outIt = *inIt; // value dof is not transformed
│ │ │ -
616 outIt++, inIt++;
│ │ │ -
617 // transform the gradient dofs together
│ │ │ -
618 for (auto &&[row_i, i] : sparseRange(scaledVertexJacobians_[vertex]))
│ │ │ -
619 {
│ │ │ -
620 outIt[i] = 0.;
│ │ │ -
621 for (auto &&[val_i_j, j] : sparseRange(row_i))
│ │ │ -
622 outIt[i] += val_i_j * inIt[j];
│ │ │ -
623 }
│ │ │ -
624 // increase pointer by size of gradient = dim
│ │ │ -
625 outIt += dim, inIt += dim;
│ │ │ -
626 }
│ │ │ -
627
│ │ │ -
628 // For the non-reduced case: Copy all remaining inner dofs
│ │ │ -
629 if constexpr (dim > 1 and (not reduced))
│ │ │ -
630 std::copy(inIt, inValues.end(), outIt);
│ │ │ -
631 }
│ │ │ -
632
│ │ │ -
633 private:
│ │ │ -
634
│ │ │ -
635 typename Impl::CubicHermiteReferenceLocalBasis<D, R, dim, reduced> basis_;
│ │ │ -
636 typename Traits::LocalCoefficientsType coefficients_;
│ │ │ -
637 typename Traits::LocalInterpolationType interpolation_;
│ │ │ -
638 // the transformation to correct the lack of affine equivalence boils down to
│ │ │ -
639 // one transformation matrix per vertex
│ │ │ -
640 std::array<Dune::FieldMatrix<R, dim, dim>, dim+1> scaledVertexJacobians_;
│ │ │ -
641 // the local state, i.e. a collection of global information restricted to this element
│ │ │ -
642 std::array<D, dim+1> averageVertexMeshSize_;
│ │ │ -
643
│ │ │ -
644 };
│ │ │ -
645
│ │ │ -
646 } // end namespace Impl
│ │ │ -
647
│ │ │ -
648
│ │ │ -
649
│ │ │ -
650 // *****************************************************************************
│ │ │ -
651 // This is the reusable part of the basis. It contains
│ │ │ -
652 //
│ │ │ -
653 // CubicHermitePreBasis
│ │ │ -
654 // CubicHermiteNode
│ │ │ -
655 //
│ │ │ -
656 // The pre-basis allows to create the others and is the owner of possible shared
│ │ │ -
657 // state. These components do _not_ depend on the global basis and local view
│ │ │ -
658 // and can be used without a global basis.
│ │ │ -
659 // *****************************************************************************
│ │ │ -
660
│ │ │ -
661 template<class GV, class R, bool reduced>
│ │ │ -
│ │ │ - │ │ │ -
663 : public LeafBasisNode
│ │ │ -
664 {
│ │ │ -
665 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper<GV>;
│ │ │ -
666
│ │ │ -
667 public:
│ │ │ -
668 using size_type = std::size_t;
│ │ │ -
669 using Element = typename GV::template Codim<0>::Entity;
│ │ │ -
670 using FiniteElement = typename Impl::CubicHermiteLocalFiniteElement<typename GV::ctype, R, GV::dimension, reduced>;
│ │ │ -
671
│ │ │ -
│ │ │ -
672 CubicHermiteNode(Mapper const& m, std::vector<typename GV::ctype> const& averageVertexMeshSize)
│ │ │ -
673 : element_(nullptr)
│ │ │ -
674 , vertexMapper_(&m)
│ │ │ -
675 , averageVertexMeshSize_(&averageVertexMeshSize)
│ │ │ -
676 {}
│ │ │ -
│ │ │ -
677
│ │ │ -
│ │ │ -
679 Element const &element() const
│ │ │ -
680 {
│ │ │ -
681 return *element_;
│ │ │ -
682 }
│ │ │ -
│ │ │ -
683
│ │ │ -
│ │ │ - │ │ │ -
690 {
│ │ │ -
691 return finiteElement_;
│ │ │ -
692 }
│ │ │ -
│ │ │ -
693
│ │ │ -
│ │ │ -
695 void bind(Element const &e)
│ │ │ -
696 {
│ │ │ -
697 element_ = &e;
│ │ │ - │ │ │ -
699 this->setSize(finiteElement_.size());
│ │ │ -
700 }
│ │ │ -
│ │ │ -
701
│ │ │ -
703 unsigned int order() const { return finiteElement_.localBasis().order(); }
│ │ │ -
704
│ │ │ -
705 protected:
│ │ │ - │ │ │ - │ │ │ -
708 Mapper const* vertexMapper_;
│ │ │ -
709 std::vector<typename GV::ctype> const* averageVertexMeshSize_;
│ │ │ -
710 };
│ │ │ -
│ │ │ -
711
│ │ │ -
712
│ │ │ -
722 template<class GV, class R, bool reduced = false>
│ │ │ -
│ │ │ - │ │ │ -
724 : public LeafPreBasisMapperMixin<GV>
│ │ │ -
725 {
│ │ │ -
726 using Base = LeafPreBasisMapperMixin<GV>;
│ │ │ -
727 using SubEntityMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GV>;
│ │ │ -
728 using Element = typename GV::template Codim<0>::Entity;
│ │ │ -
729 using D = typename GV::ctype;
│ │ │ -
730 static const std::size_t dim = GV::dimension;
│ │ │ -
731
│ │ │ -
732 // helper methods to assign each subentity the number of dofs. Used by the LeafPreBasisMapperMixin.
│ │ │ -
733 static constexpr auto cubicHermiteMapperLayout(Dune::GeometryType type, int gridDim)
│ │ │ -
734 {
│ │ │ -
735 if (type.isVertex())
│ │ │ -
736 return 1 + gridDim; // one evaluation dof and gridDim derivative dofs per vertex
│ │ │ -
737 if (gridDim == 1) // in 1d there are no other dofs
│ │ │ -
738 return 0;
│ │ │ -
739 // in 2d we have one inner dof (i.e. on the triangle) or non for the reduced case
│ │ │ -
740 // and in 3d we have one dof on each face (i.e. on each triangle)
│ │ │ -
741 if ((type.isTriangle()) and (not reduced))
│ │ │ -
742 return 1;
│ │ │ -
743 else
│ │ │ -
744 return 0; // this case is only entered for the interior of the 3d element. There are no dofs.
│ │ │ -
745 }
│ │ │ -
746
│ │ │ -
747 public:
│ │ │ -
749 using GridView = GV;
│ │ │ -
750
│ │ │ -
752 using size_type = std::size_t;
│ │ │ -
753
│ │ │ - │ │ │ -
756
│ │ │ -
757 public:
│ │ │ -
758
│ │ │ -
│ │ │ - │ │ │ -
761 : Base(gv, cubicHermiteMapperLayout)
│ │ │ -
762 , vertexMapper_({gv, mcmgVertexLayout()})
│ │ │ -
763 {
│ │ │ -
764 static_assert((dim > 0) and (dim <= 3), "CubicHermitePreBasis only implemented for dim=1,2,3");
│ │ │ -
765 static_assert((not reduced) or (dim == 2), "Reduced version of CubicHermitePreBasis only implemented for dim=2");
│ │ │ -
766 averageVertexMeshSize_ = Impl::computeAverageSubEntityMeshSize<D>(vertexMapper_);
│ │ │ -
767 }
│ │ │ -
│ │ │ -
768
│ │ │ -
│ │ │ -
770 void update(GridView const &gv)
│ │ │ -
771 {
│ │ │ -
772 Base::update(gv);
│ │ │ -
773 vertexMapper_.update(this->gridView());
│ │ │ -
774 averageVertexMeshSize_ = Impl::computeAverageSubEntityMeshSize<D>(vertexMapper_);
│ │ │ -
775 }
│ │ │ -
│ │ │ -
776
│ │ │ -
│ │ │ - │ │ │ -
781 {
│ │ │ - │ │ │ -
783 }
│ │ │ -
│ │ │ -
784
│ │ │ -
785 protected:
│ │ │ -
786
│ │ │ -
787 SubEntityMapper vertexMapper_;
│ │ │ - │ │ │ -
789
│ │ │ -
790 }; // class CubicHermitePreBasis
│ │ │ -
│ │ │ -
791
│ │ │ -
792 namespace BasisFactory
│ │ │ -
793 {
│ │ │ -
794
│ │ │ -
802 template<class R = double>
│ │ │ -
803 auto cubicHermite()
│ │ │ -
804 {
│ │ │ -
805 return [=](auto const &gridView) {
│ │ │ -
806 return CubicHermitePreBasis<std::decay_t<decltype(gridView)>, R>(gridView);
│ │ │ -
807 };
│ │ │ -
808 }
│ │ │ -
809
│ │ │ -
817 template<class R = double>
│ │ │ -
818 auto reducedCubicHermite()
│ │ │ -
819 {
│ │ │ -
820 return [=](auto const &gridView) {
│ │ │ -
821 return CubicHermitePreBasis<std::decay_t<decltype(gridView)>, R, true>(gridView);
│ │ │ -
822 };
│ │ │ -
823 }
│ │ │ -
824
│ │ │ -
825 } // end namespace BasisFactory
│ │ │ -
826
│ │ │ -
827
│ │ │ -
828} // end namespace Dune::Functions
│ │ │ -
829
│ │ │ -
830#endif
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
Obtain derivative of TrigonometricFunction function.
Definition trigonometricfunction.hh:43
│ │ │ -
DefaultGlobalBasis< CubicHermitePreBasis< GV, R, reduced > > CubicHermiteBasis
Nodal basis of a scalar cubic Hermite finite element space.
Definition cubichermitebasis.hh:79
│ │ │ + │ │ │ + │ │ │ + │ │ │ +
486
│ │ │ +
487 // The knot span we are bound to
│ │ │ +
488 std::array<unsigned,dim> currentKnotSpan_;
│ │ │ +
489};
│ │ │ +
│ │ │ +
490
│ │ │ +
491
│ │ │ +
492template<typename GV>
│ │ │ +
493class BSplineNode;
│ │ │ +
494
│ │ │ +
504template<typename GV>
│ │ │ +
│ │ │ + │ │ │ +
506 public LeafPreBasisMixin< BSplinePreBasis<GV> >
│ │ │ +
507{
│ │ │ + │ │ │ +
509
│ │ │ +
510 static const int dim = GV::dimension;
│ │ │ +
511
│ │ │ +
513 class MultiDigitCounter
│ │ │ +
514 {
│ │ │ +
515 public:
│ │ │ +
516
│ │ │ +
520 MultiDigitCounter(const std::array<unsigned int,dim>& limits)
│ │ │ +
521 : limits_(limits)
│ │ │ +
522 {
│ │ │ +
523 std::fill(counter_.begin(), counter_.end(), 0);
│ │ │ +
524 }
│ │ │ +
525
│ │ │ +
527 MultiDigitCounter& operator++()
│ │ │ +
528 {
│ │ │ +
529 for (int i=0; i<dim; i++)
│ │ │ +
530 {
│ │ │ +
531 ++counter_[i];
│ │ │ +
532
│ │ │ +
533 // no overflow?
│ │ │ +
534 if (counter_[i] < limits_[i])
│ │ │ +
535 break;
│ │ │ +
536
│ │ │ +
537 counter_[i] = 0;
│ │ │ +
538 }
│ │ │ +
539 return *this;
│ │ │ +
540 }
│ │ │ +
541
│ │ │ +
543 const unsigned int& operator[](int i) const
│ │ │ +
544 {
│ │ │ +
545 return counter_[i];
│ │ │ +
546 }
│ │ │ +
547
│ │ │ +
549 unsigned int cycle() const
│ │ │ +
550 {
│ │ │ +
551 unsigned int r = 1;
│ │ │ +
552 for (int i=0; i<dim; i++)
│ │ │ +
553 r *= limits_[i];
│ │ │ +
554 return r;
│ │ │ +
555 }
│ │ │ +
556
│ │ │ +
557 private:
│ │ │ +
558
│ │ │ +
560 const std::array<unsigned int,dim> limits_;
│ │ │ +
561
│ │ │ +
563 std::array<unsigned int,dim> counter_;
│ │ │ +
564
│ │ │ +
565 };
│ │ │ +
566
│ │ │ +
567public:
│ │ │ +
568
│ │ │ +
570 using GridView = GV;
│ │ │ +
571 using size_type = std::size_t;
│ │ │ +
572
│ │ │ + │ │ │ +
574
│ │ │ +
575 // Type used for function values
│ │ │ +
576 using R = double;
│ │ │ +
577
│ │ │ +
│ │ │ + │ │ │ +
598 const std::vector<double>& knotVector,
│ │ │ +
599 unsigned int order,
│ │ │ +
600 bool makeOpen = true)
│ │ │ + │ │ │ +
602 {
│ │ │ +
603 // \todo Detection of duplicate knots
│ │ │ +
604 std::fill(elements_.begin(), elements_.end(), knotVector.size()-1);
│ │ │ +
605
│ │ │ +
606 // Mediocre sanity check: we don't know the number of grid elements in each direction.
│ │ │ +
607 // but at least we know the total number of elements.
│ │ │ +
608 assert( std::accumulate(elements_.begin(), elements_.end(), 1, std::multiplies<unsigned>()) == gridView_.size(0) );
│ │ │ +
609
│ │ │ +
610 for (int i=0; i<dim; i++)
│ │ │ +
611 {
│ │ │ +
612 // Prepend the correct number of additional knots to open the knot vector
│ │ │ +
614 if (makeOpen)
│ │ │ +
615 for (unsigned int j=0; j<order; j++)
│ │ │ +
616 knotVectors_[i].push_back(knotVector[0]);
│ │ │ +
617
│ │ │ +
618 knotVectors_[i].insert(knotVectors_[i].end(), knotVector.begin(), knotVector.end());
│ │ │ +
619
│ │ │ +
620 if (makeOpen)
│ │ │ +
621 for (unsigned int j=0; j<order; j++)
│ │ │ +
622 knotVectors_[i].push_back(knotVector.back());
│ │ │ +
623 }
│ │ │ +
624
│ │ │ +
625 std::fill(order_.begin(), order_.end(), order);
│ │ │ +
626 }
│ │ │ +
│ │ │ +
627
│ │ │ +
│ │ │ + │ │ │ +
650 const FieldVector<double,dim>& lowerLeft,
│ │ │ +
651 const FieldVector<double,dim>& upperRight,
│ │ │ +
652 const std::array<unsigned int,dim>& elements,
│ │ │ +
653 unsigned int order,
│ │ │ +
654 bool makeOpen = true)
│ │ │ +
655 : elements_(elements),
│ │ │ + │ │ │ +
657 {
│ │ │ +
658 // Mediocre sanity check: we don't know the number of grid elements in each direction.
│ │ │ +
659 // but at least we know the total number of elements.
│ │ │ +
660 assert( std::accumulate(elements_.begin(), elements_.end(), 1, std::multiplies<unsigned>()) == gridView_.size(0) );
│ │ │ +
661
│ │ │ +
662 for (int i=0; i<dim; i++)
│ │ │ +
663 {
│ │ │ +
664 // Prepend the correct number of additional knots to open the knot vector
│ │ │ +
666 if (makeOpen)
│ │ │ +
667 for (unsigned int j=0; j<order; j++)
│ │ │ +
668 knotVectors_[i].push_back(lowerLeft[i]);
│ │ │ +
669
│ │ │ +
670 // Construct the actual knot vector
│ │ │ +
671 for (size_t j=0; j<elements[i]+1; j++)
│ │ │ +
672 knotVectors_[i].push_back(lowerLeft[i] + j*(upperRight[i]-lowerLeft[i]) / elements[i]);
│ │ │ +
673
│ │ │ +
674 if (makeOpen)
│ │ │ +
675 for (unsigned int j=0; j<order; j++)
│ │ │ +
676 knotVectors_[i].push_back(upperRight[i]);
│ │ │ +
677 }
│ │ │ +
678
│ │ │ +
679 std::fill(order_.begin(), order_.end(), order);
│ │ │ +
680 }
│ │ │ +
│ │ │ +
681
│ │ │ +
│ │ │ + │ │ │ +
684 {}
│ │ │ +
│ │ │ +
685
│ │ │ +
│ │ │ +
687 const GridView& gridView() const
│ │ │ +
688 {
│ │ │ +
689 return gridView_;
│ │ │ +
690 }
│ │ │ +
│ │ │ +
691
│ │ │ +
│ │ │ +
693 void update(const GridView& gv)
│ │ │ +
694 {
│ │ │ +
695 gridView_ = gv;
│ │ │ +
696 }
│ │ │ +
│ │ │ +
697
│ │ │ +
│ │ │ + │ │ │ +
702 {
│ │ │ +
703 return Node{this};
│ │ │ +
704 }
│ │ │ +
│ │ │ +
705
│ │ │ +
│ │ │ + │ │ │ +
708 {
│ │ │ +
709 size_type result = 1;
│ │ │ +
710 for (int i=0; i<dim; i++)
│ │ │ +
711 result *= order_[i]+1;
│ │ │ +
712 return result;
│ │ │ +
713 }
│ │ │ +
│ │ │ +
714
│ │ │ +
716 template<typename It>
│ │ │ +
│ │ │ +
717 It indices(const Node& node, It it) const
│ │ │ +
718 {
│ │ │ +
719 // Local degrees of freedom are arranged in a lattice.
│ │ │ +
720 // We need the lattice dimensions to be able to compute lattice coordinates from a local index
│ │ │ +
721 std::array<unsigned int, dim> localSizes;
│ │ │ +
722 for (int i=0; i<dim; i++)
│ │ │ +
723 localSizes[i] = node.finiteElement().size(i);
│ │ │ +
724 for (size_type i = 0, end = node.size() ; i < end ; ++i, ++it)
│ │ │ +
725 {
│ │ │ +
726 std::array<unsigned int,dim> localIJK = getIJK(i, localSizes);
│ │ │ +
727
│ │ │ +
728 const auto currentKnotSpan = node.finiteElement().currentKnotSpan_;
│ │ │ +
729 const auto order = order_;
│ │ │ +
730
│ │ │ +
731 std::array<unsigned int,dim> globalIJK;
│ │ │ +
732 for (int i=0; i<dim; i++)
│ │ │ +
733 globalIJK[i] = std::max((int)currentKnotSpan[i] - (int)order[i], 0) + localIJK[i]; // needs to be a signed type!
│ │ │ +
734
│ │ │ +
735 // Make one global flat index from the globalIJK tuple
│ │ │ +
736 size_type globalIdx = globalIJK[dim-1];
│ │ │ +
737
│ │ │ +
738 for (int i=dim-2; i>=0; i--)
│ │ │ +
739 globalIdx = globalIdx * size(i) + globalIJK[i];
│ │ │ +
740
│ │ │ +
741 *it = {{globalIdx}};
│ │ │ +
742 }
│ │ │ +
743 return it;
│ │ │ +
744 }
│ │ │ +
│ │ │ +
745
│ │ │ +
│ │ │ +
747 unsigned int dimension () const
│ │ │ +
748 {
│ │ │ +
749 unsigned int result = 1;
│ │ │ +
750 for (size_t i=0; i<dim; i++)
│ │ │ +
751 result *= size(i);
│ │ │ +
752 return result;
│ │ │ +
753 }
│ │ │ +
│ │ │ +
754
│ │ │ +
│ │ │ +
756 unsigned int size (size_t d) const
│ │ │ +
757 {
│ │ │ +
758 return knotVectors_[d].size() - order_[d] - 1;
│ │ │ +
759 }
│ │ │ +
│ │ │ +
760
│ │ │ +
761 using Base::size;
│ │ │ +
762
│ │ │ +
│ │ │ +
765 void evaluateFunction (const FieldVector<typename GV::ctype,dim>& in,
│ │ │ +
766 std::vector<FieldVector<R,1> >& out,
│ │ │ +
767 const std::array<unsigned,dim>& currentKnotSpan) const
│ │ │ +
768 {
│ │ │ +
769 // Evaluate
│ │ │ +
770 std::array<std::vector<R>, dim> oneDValues;
│ │ │ +
771
│ │ │ +
772 for (size_t i=0; i<dim; i++)
│ │ │ +
773 evaluateFunction(in[i], oneDValues[i], knotVectors_[i], order_[i], currentKnotSpan[i]);
│ │ │ +
774
│ │ │ +
775 std::array<unsigned int, dim> limits;
│ │ │ +
776 for (int i=0; i<dim; i++)
│ │ │ +
777 limits[i] = oneDValues[i].size();
│ │ │ +
778
│ │ │ +
779 MultiDigitCounter ijkCounter(limits);
│ │ │ +
780
│ │ │ +
781 out.resize(ijkCounter.cycle());
│ │ │ +
782
│ │ │ +
783 for (size_t i=0; i<out.size(); i++, ++ijkCounter)
│ │ │ +
784 {
│ │ │ +
785 out[i] = R(1.0);
│ │ │ +
786 for (size_t j=0; j<dim; j++)
│ │ │ +
787 out[i] *= oneDValues[j][ijkCounter[j]];
│ │ │ +
788 }
│ │ │ +
789 }
│ │ │ +
│ │ │ +
790
│ │ │ +
│ │ │ +
796 void evaluateJacobian (const FieldVector<typename GV::ctype,dim>& in,
│ │ │ +
797 std::vector<FieldMatrix<R,1,dim> >& out,
│ │ │ +
798 const std::array<unsigned,dim>& currentKnotSpan) const
│ │ │ +
799 {
│ │ │ +
800 // How many shape functions to we have in each coordinate direction?
│ │ │ +
801 std::array<unsigned int, dim> limits;
│ │ │ +
802 for (int i=0; i<dim; i++)
│ │ │ +
803 {
│ │ │ +
804 limits[i] = order_[i]+1; // The 'standard' value away from the boundaries of the knot vector
│ │ │ +
805 if (currentKnotSpan[i]<order_[i])
│ │ │ +
806 limits[i] -= (order_[i] - currentKnotSpan[i]);
│ │ │ +
807 if ( order_[i] > (knotVectors_[i].size() - currentKnotSpan[i] - 2) )
│ │ │ +
808 limits[i] -= order_[i] - (knotVectors_[i].size() - currentKnotSpan[i] - 2);
│ │ │ +
809 }
│ │ │ +
810
│ │ │ +
811 // The lowest knot spans that we need values from
│ │ │ +
812 std::array<unsigned int, dim> offset;
│ │ │ +
813 for (int i=0; i<dim; i++)
│ │ │ +
814 offset[i] = std::max((int)(currentKnotSpan[i] - order_[i]),0);
│ │ │ +
815
│ │ │ +
816 // Evaluate 1d function values (needed for the product rule)
│ │ │ +
817 std::array<std::vector<R>, dim> oneDValues;
│ │ │ +
818
│ │ │ +
819 // Evaluate 1d function values of one order lower (needed for the derivative formula)
│ │ │ +
820 std::array<std::vector<R>, dim> lowOrderOneDValues;
│ │ │ +
821
│ │ │ +
822 std::array<DynamicMatrix<R>, dim> values;
│ │ │ +
823
│ │ │ +
824 for (size_t i=0; i<dim; i++)
│ │ │ +
825 {
│ │ │ +
826 evaluateFunctionFull(in[i], values[i], knotVectors_[i], order_[i], currentKnotSpan[i]);
│ │ │ +
827 oneDValues[i].resize(knotVectors_[i].size()-order_[i]-1);
│ │ │ +
828 for (size_t j=0; j<oneDValues[i].size(); j++)
│ │ │ +
829 oneDValues[i][j] = values[i][order_[i]][j];
│ │ │ +
830
│ │ │ +
831 if (order_[i]!=0)
│ │ │ +
832 {
│ │ │ +
833 lowOrderOneDValues[i].resize(knotVectors_[i].size()-(order_[i]-1)-1);
│ │ │ +
834 for (size_t j=0; j<lowOrderOneDValues[i].size(); j++)
│ │ │ +
835 lowOrderOneDValues[i][j] = values[i][order_[i]-1][j];
│ │ │ +
836 }
│ │ │ +
837 }
│ │ │ +
838
│ │ │ +
839
│ │ │ +
840 // Evaluate 1d function derivatives
│ │ │ +
841 std::array<std::vector<R>, dim> oneDDerivatives;
│ │ │ +
842 for (size_t i=0; i<dim; i++)
│ │ │ +
843 {
│ │ │ +
844 oneDDerivatives[i].resize(limits[i]);
│ │ │ +
845
│ │ │ +
846 if (order_[i]==0) // order-zero functions are piecewise constant, hence all derivatives are zero
│ │ │ +
847 std::fill(oneDDerivatives[i].begin(), oneDDerivatives[i].end(), R(0.0));
│ │ │ +
848 else
│ │ │ +
849 {
│ │ │ +
850 for (size_t j=offset[i]; j<offset[i]+limits[i]; j++)
│ │ │ +
851 {
│ │ │ +
852 R derivativeAddend1 = lowOrderOneDValues[i][j] / (knotVectors_[i][j+order_[i]]-knotVectors_[i][j]);
│ │ │ +
853 R derivativeAddend2 = lowOrderOneDValues[i][j+1] / (knotVectors_[i][j+order_[i]+1]-knotVectors_[i][j+1]);
│ │ │ +
854 // The two previous terms may evaluate as 0/0. This is to be interpreted as 0.
│ │ │ +
855 if (std::isnan(derivativeAddend1))
│ │ │ +
856 derivativeAddend1 = 0;
│ │ │ +
857 if (std::isnan(derivativeAddend2))
│ │ │ +
858 derivativeAddend2 = 0;
│ │ │ +
859 oneDDerivatives[i][j-offset[i]] = order_[i] * ( derivativeAddend1 - derivativeAddend2 );
│ │ │ +
860 }
│ │ │ +
861 }
│ │ │ +
862 }
│ │ │ +
863
│ │ │ +
864 // Working towards computing only the parts that we really need:
│ │ │ +
865 // Let's copy them out into a separate array
│ │ │ +
866 std::array<std::vector<R>, dim> oneDValuesShort;
│ │ │ +
867
│ │ │ +
868 for (int i=0; i<dim; i++)
│ │ │ +
869 {
│ │ │ +
870 oneDValuesShort[i].resize(limits[i]);
│ │ │ +
871
│ │ │ +
872 for (size_t j=0; j<limits[i]; j++)
│ │ │ +
873 oneDValuesShort[i][j] = oneDValues[i][offset[i] + j];
│ │ │ +
874 }
│ │ │ +
875
│ │ │ +
876
│ │ │ +
877
│ │ │ +
878 // Set up a multi-index to go from consecutive indices to integer coordinates
│ │ │ +
879 MultiDigitCounter ijkCounter(limits);
│ │ │ +
880
│ │ │ +
881 out.resize(ijkCounter.cycle());
│ │ │ +
882
│ │ │ +
883 // Complete Jacobian is given by the product rule
│ │ │ +
884 for (size_t i=0; i<out.size(); i++, ++ijkCounter)
│ │ │ +
885 for (int j=0; j<dim; j++)
│ │ │ +
886 {
│ │ │ +
887 out[i][0][j] = 1.0;
│ │ │ +
888 for (int k=0; k<dim; k++)
│ │ │ +
889 out[i][0][j] *= (j==k) ? oneDDerivatives[k][ijkCounter[k]]
│ │ │ +
890 : oneDValuesShort[k][ijkCounter[k]];
│ │ │ +
891 }
│ │ │ +
892
│ │ │ +
893 }
│ │ │ +
│ │ │ +
894
│ │ │ +
896 template <size_type k>
│ │ │ +
│ │ │ +
897 void evaluate(const typename std::array<int,k>& directions,
│ │ │ +
898 const FieldVector<typename GV::ctype,dim>& in,
│ │ │ +
899 std::vector<FieldVector<R,1> >& out,
│ │ │ +
900 const std::array<unsigned,dim>& currentKnotSpan) const
│ │ │ +
901 {
│ │ │ +
902 if (k != 1 && k != 2)
│ │ │ +
903 DUNE_THROW(RangeError, "Differentiation order greater than 2 is not supported!");
│ │ │ +
904
│ │ │ +
905 // Evaluate 1d function values (needed for the product rule)
│ │ │ +
906 std::array<std::vector<R>, dim> oneDValues;
│ │ │ +
907 std::array<std::vector<R>, dim> oneDDerivatives;
│ │ │ +
908 std::array<std::vector<R>, dim> oneDSecondDerivatives;
│ │ │ +
909
│ │ │ +
910 // Evaluate 1d function derivatives
│ │ │ +
911 if (k==1)
│ │ │ +
912 for (size_t i=0; i<dim; i++)
│ │ │ +
913 evaluateAll(in[i], oneDValues[i], true, oneDDerivatives[i], false, oneDSecondDerivatives[i], knotVectors_[i], order_[i], currentKnotSpan[i]);
│ │ │ +
914 else
│ │ │ +
915 for (size_t i=0; i<dim; i++)
│ │ │ +
916 evaluateAll(in[i], oneDValues[i], true, oneDDerivatives[i], true, oneDSecondDerivatives[i], knotVectors_[i], order_[i], currentKnotSpan[i]);
│ │ │ +
917
│ │ │ +
918 // The lowest knot spans that we need values from
│ │ │ +
919 std::array<unsigned int, dim> offset;
│ │ │ +
920 for (int i=0; i<dim; i++)
│ │ │ +
921 offset[i] = std::max((int)(currentKnotSpan[i] - order_[i]),0);
│ │ │ +
922
│ │ │ +
923 // Set up a multi-index to go from consecutive indices to integer coordinates
│ │ │ +
924 std::array<unsigned int, dim> limits;
│ │ │ +
925 for (int i=0; i<dim; i++)
│ │ │ +
926 {
│ │ │ +
927 // In a proper implementation, the following line would do
│ │ │ +
928 //limits[i] = oneDValues[i].size();
│ │ │ +
929 limits[i] = order_[i]+1; // The 'standard' value away from the boundaries of the knot vector
│ │ │ +
930 if (currentKnotSpan[i]<order_[i])
│ │ │ +
931 limits[i] -= (order_[i] - currentKnotSpan[i]);
│ │ │ +
932 if ( order_[i] > (knotVectors_[i].size() - currentKnotSpan[i] - 2) )
│ │ │ +
933 limits[i] -= order_[i] - (knotVectors_[i].size() - currentKnotSpan[i] - 2);
│ │ │ +
934 }
│ │ │ +
935
│ │ │ +
936 // Working towards computing only the parts that we really need:
│ │ │ +
937 // Let's copy them out into a separate array
│ │ │ +
938 std::array<std::vector<R>, dim> oneDValuesShort;
│ │ │ +
939
│ │ │ +
940 for (int i=0; i<dim; i++)
│ │ │ +
941 {
│ │ │ +
942 oneDValuesShort[i].resize(limits[i]);
│ │ │ +
943
│ │ │ +
944 for (size_t j=0; j<limits[i]; j++)
│ │ │ +
945 oneDValuesShort[i][j] = oneDValues[i][offset[i] + j];
│ │ │ +
946 }
│ │ │ +
947
│ │ │ +
948
│ │ │ +
949 MultiDigitCounter ijkCounter(limits);
│ │ │ +
950
│ │ │ +
951 out.resize(ijkCounter.cycle());
│ │ │ +
952
│ │ │ +
953 if (k == 1)
│ │ │ +
954 {
│ │ │ +
955 // Complete Jacobian is given by the product rule
│ │ │ +
956 for (size_t i=0; i<out.size(); i++, ++ijkCounter)
│ │ │ +
957 {
│ │ │ +
958 out[i][0] = 1.0;
│ │ │ +
959 for (int l=0; l<dim; l++)
│ │ │ +
960 out[i][0] *= (directions[0]==l) ? oneDDerivatives[l][ijkCounter[l]]
│ │ │ +
961 : oneDValuesShort[l][ijkCounter[l]];
│ │ │ +
962 }
│ │ │ +
963 }
│ │ │ +
964
│ │ │ +
965 if (k == 2)
│ │ │ +
966 {
│ │ │ +
967 // Complete derivation by deriving the tensor product
│ │ │ +
968 for (size_t i=0; i<out.size(); i++, ++ijkCounter)
│ │ │ +
969 {
│ │ │ +
970 out[i][0] = 1.0;
│ │ │ +
971 for (int j=0; j<dim; j++)
│ │ │ +
972 {
│ │ │ +
973 if (directions[0] != directions[1]) //derivation in two different variables
│ │ │ +
974 if (directions[0] == j || directions[1] == j) //the spline has to be derived (once) in this direction
│ │ │ +
975 out[i][0] *= oneDDerivatives[j][ijkCounter[j]];
│ │ │ +
976 else //no derivation in this direction
│ │ │ +
977 out[i][0] *= oneDValuesShort[j][ijkCounter[j]];
│ │ │ +
978 else //spline is derived two times in the same direction
│ │ │ +
979 if (directions[0] == j) //the spline is derived two times in this direction
│ │ │ +
980 out[i][0] *= oneDSecondDerivatives[j][ijkCounter[j]];
│ │ │ +
981 else //no derivation in this direction
│ │ │ +
982 out[i][0] *= oneDValuesShort[j][ijkCounter[j]];
│ │ │ +
983 }
│ │ │ +
984 }
│ │ │ +
985 }
│ │ │ +
986 }
│ │ │ +
│ │ │ +
987
│ │ │ +
988
│ │ │ +
│ │ │ +
993 static std::array<unsigned int,dim> getIJK(typename GridView::IndexSet::IndexType idx, std::array<unsigned int,dim> elements)
│ │ │ +
994 {
│ │ │ +
995 std::array<unsigned,dim> result;
│ │ │ +
996 for (int i=0; i<dim; i++)
│ │ │ +
997 {
│ │ │ +
998 result[i] = idx%elements[i];
│ │ │ +
999 idx /= elements[i];
│ │ │ +
1000 }
│ │ │ +
1001 return result;
│ │ │ +
1002 }
│ │ │ +
│ │ │ +
1003
│ │ │ +
│ │ │ +
1012 static void evaluateFunction (const typename GV::ctype& in, std::vector<R>& out,
│ │ │ +
1013 const std::vector<R>& knotVector,
│ │ │ +
1014 unsigned int order,
│ │ │ +
1015 unsigned int currentKnotSpan)
│ │ │ +
1016 {
│ │ │ +
1017 std::size_t outSize = order+1; // The 'standard' value away from the boundaries of the knot vector
│ │ │ +
1018 if (currentKnotSpan<order) // Less near the left end of the knot vector
│ │ │ +
1019 outSize -= (order - currentKnotSpan);
│ │ │ +
1020 if ( order > (knotVector.size() - currentKnotSpan - 2) )
│ │ │ +
1021 outSize -= order - (knotVector.size() - currentKnotSpan - 2);
│ │ │ +
1022 out.resize(outSize);
│ │ │ +
1023
│ │ │ +
1024 // It's not really a matrix that is needed here, a plain 2d array would do
│ │ │ +
1025 DynamicMatrix<R> N(order+1, knotVector.size()-1);
│ │ │ +
1026
│ │ │ +
1027 // The text books on splines use the following geometric condition here to fill the array N
│ │ │ +
1028 // (see for example Cottrell, Hughes, Bazilevs, Formula (2.1). However, this condition
│ │ │ +
1029 // only works if splines are never evaluated exactly on the knots.
│ │ │ +
1030 //
│ │ │ +
1031 // for (size_t i=0; i<knotVector.size()-1; i++)
│ │ │ +
1032 // N[0][i] = (knotVector[i] <= in) and (in < knotVector[i+1]);
│ │ │ +
1033 for (size_t i=0; i<knotVector.size()-1; i++)
│ │ │ +
1034 N[0][i] = (i == currentKnotSpan);
│ │ │ +
1035
│ │ │ +
1036 for (size_t r=1; r<=order; r++)
│ │ │ +
1037 for (size_t i=0; i<knotVector.size()-r-1; i++)
│ │ │ +
1038 {
│ │ │ +
1039 R factor1 = ((knotVector[i+r] - knotVector[i]) > 1e-10)
│ │ │ +
1040 ? (in - knotVector[i]) / (knotVector[i+r] - knotVector[i])
│ │ │ +
1041 : 0;
│ │ │ +
1042 R factor2 = ((knotVector[i+r+1] - knotVector[i+1]) > 1e-10)
│ │ │ +
1043 ? (knotVector[i+r+1] - in) / (knotVector[i+r+1] - knotVector[i+1])
│ │ │ +
1044 : 0;
│ │ │ +
1045 N[r][i] = factor1 * N[r-1][i] + factor2 * N[r-1][i+1];
│ │ │ +
1046 }
│ │ │ +
1047
│ │ │ +
1052 for (size_t i=0; i<out.size(); i++) {
│ │ │ +
1053 out[i] = N[order][std::max((int)(currentKnotSpan - order),0) + i];
│ │ │ +
1054 }
│ │ │ +
1055 }
│ │ │ +
│ │ │ +
1056
│ │ │ +
│ │ │ +
1069 static void evaluateFunctionFull(const typename GV::ctype& in,
│ │ │ +
1070 DynamicMatrix<R>& out,
│ │ │ +
1071 const std::vector<R>& knotVector,
│ │ │ +
1072 unsigned int order,
│ │ │ +
1073 unsigned int currentKnotSpan)
│ │ │ +
1074 {
│ │ │ +
1075 // It's not really a matrix that is needed here, a plain 2d array would do
│ │ │ +
1076 DynamicMatrix<R>& N = out;
│ │ │ +
1077
│ │ │ +
1078 N.resize(order+1, knotVector.size()-1);
│ │ │ +
1079
│ │ │ +
1080 // The text books on splines use the following geometric condition here to fill the array N
│ │ │ +
1081 // (see for example Cottrell, Hughes, Bazilevs, Formula (2.1). However, this condition
│ │ │ +
1082 // only works if splines are never evaluated exactly on the knots.
│ │ │ +
1083 //
│ │ │ +
1084 // for (size_t i=0; i<knotVector.size()-1; i++)
│ │ │ +
1085 // N[0][i] = (knotVector[i] <= in) and (in < knotVector[i+1]);
│ │ │ +
1086 for (size_t i=0; i<knotVector.size()-1; i++)
│ │ │ +
1087 N[0][i] = (i == currentKnotSpan);
│ │ │ +
1088
│ │ │ +
1089 for (size_t r=1; r<=order; r++)
│ │ │ +
1090 for (size_t i=0; i<knotVector.size()-r-1; i++)
│ │ │ +
1091 {
│ │ │ +
1092 R factor1 = ((knotVector[i+r] - knotVector[i]) > 1e-10)
│ │ │ +
1093 ? (in - knotVector[i]) / (knotVector[i+r] - knotVector[i])
│ │ │ +
1094 : 0;
│ │ │ +
1095 R factor2 = ((knotVector[i+r+1] - knotVector[i+1]) > 1e-10)
│ │ │ +
1096 ? (knotVector[i+r+1] - in) / (knotVector[i+r+1] - knotVector[i+1])
│ │ │ +
1097 : 0;
│ │ │ +
1098 N[r][i] = factor1 * N[r-1][i] + factor2 * N[r-1][i+1];
│ │ │ +
1099 }
│ │ │ +
1100 }
│ │ │ +
│ │ │ +
1101
│ │ │ +
1102
│ │ │ +
1110
│ │ │ +
│ │ │ +
1111 static void evaluateAll(const typename GV::ctype& in,
│ │ │ +
1112 std::vector<R>& out,
│ │ │ +
1113 bool evaluateJacobian, std::vector<R>& outJac,
│ │ │ +
1114 bool evaluateHessian, std::vector<R>& outHess,
│ │ │ +
1115 const std::vector<R>& knotVector,
│ │ │ +
1116 unsigned int order,
│ │ │ +
1117 unsigned int currentKnotSpan)
│ │ │ +
1118 {
│ │ │ +
1119 // How many shape functions to we have in each coordinate direction?
│ │ │ +
1120 unsigned int limit;
│ │ │ +
1121 limit = order+1; // The 'standard' value away from the boundaries of the knot vector
│ │ │ +
1122 if (currentKnotSpan<order)
│ │ │ +
1123 limit -= (order - currentKnotSpan);
│ │ │ +
1124 if ( order > (knotVector.size() - currentKnotSpan - 2) )
│ │ │ +
1125 limit -= order - (knotVector.size() - currentKnotSpan - 2);
│ │ │ +
1126
│ │ │ +
1127 // The lowest knot spans that we need values from
│ │ │ +
1128 unsigned int offset;
│ │ │ +
1129 offset = std::max((int)(currentKnotSpan - order),0);
│ │ │ +
1130
│ │ │ +
1131 // Evaluate 1d function values (needed for the product rule)
│ │ │ +
1132 DynamicMatrix<R> values;
│ │ │ +
1133
│ │ │ +
1134 evaluateFunctionFull(in, values, knotVector, order, currentKnotSpan);
│ │ │ +
1135
│ │ │ +
1136 out.resize(knotVector.size()-order-1);
│ │ │ +
1137 for (size_t j=0; j<out.size(); j++)
│ │ │ +
1138 out[j] = values[order][j];
│ │ │ +
1139
│ │ │ +
1140 // Evaluate 1d function values of one order lower (needed for the derivative formula)
│ │ │ +
1141 std::vector<R> lowOrderOneDValues;
│ │ │ +
1142
│ │ │ +
1143 if (order!=0)
│ │ │ +
1144 {
│ │ │ +
1145 lowOrderOneDValues.resize(knotVector.size()-(order-1)-1);
│ │ │ +
1146 for (size_t j=0; j<lowOrderOneDValues.size(); j++)
│ │ │ +
1147 lowOrderOneDValues[j] = values[order-1][j];
│ │ │ +
1148 }
│ │ │ +
1149
│ │ │ +
1150 // Evaluate 1d function values of two order lower (needed for the (second) derivative formula)
│ │ │ +
1151 std::vector<R> lowOrderTwoDValues;
│ │ │ +
1152
│ │ │ +
1153 if (order>1 && evaluateHessian)
│ │ │ +
1154 {
│ │ │ +
1155 lowOrderTwoDValues.resize(knotVector.size()-(order-2)-1);
│ │ │ +
1156 for (size_t j=0; j<lowOrderTwoDValues.size(); j++)
│ │ │ +
1157 lowOrderTwoDValues[j] = values[order-2][j];
│ │ │ +
1158 }
│ │ │ +
1159
│ │ │ +
1160 // Evaluate 1d function derivatives
│ │ │ +
1161 if (evaluateJacobian)
│ │ │ +
1162 {
│ │ │ +
1163 outJac.resize(limit);
│ │ │ +
1164
│ │ │ +
1165 if (order==0) // order-zero functions are piecewise constant, hence all derivatives are zero
│ │ │ +
1166 std::fill(outJac.begin(), outJac.end(), R(0.0));
│ │ │ +
1167 else
│ │ │ +
1168 {
│ │ │ +
1169 for (size_t j=offset; j<offset+limit; j++)
│ │ │ +
1170 {
│ │ │ +
1171 R derivativeAddend1 = lowOrderOneDValues[j] / (knotVector[j+order]-knotVector[j]);
│ │ │ +
1172 R derivativeAddend2 = lowOrderOneDValues[j+1] / (knotVector[j+order+1]-knotVector[j+1]);
│ │ │ +
1173 // The two previous terms may evaluate as 0/0. This is to be interpreted as 0.
│ │ │ +
1174 if (std::isnan(derivativeAddend1))
│ │ │ +
1175 derivativeAddend1 = 0;
│ │ │ +
1176 if (std::isnan(derivativeAddend2))
│ │ │ +
1177 derivativeAddend2 = 0;
│ │ │ +
1178 outJac[j-offset] = order * ( derivativeAddend1 - derivativeAddend2 );
│ │ │ +
1179 }
│ │ │ +
1180 }
│ │ │ +
1181 }
│ │ │ +
1182
│ │ │ +
1183 // Evaluate 1d function second derivatives
│ │ │ +
1184 if (evaluateHessian)
│ │ │ +
1185 {
│ │ │ +
1186 outHess.resize(limit);
│ │ │ +
1187
│ │ │ +
1188 if (order<2) // order-zero functions are piecewise constant, hence all derivatives are zero
│ │ │ +
1189 std::fill(outHess.begin(), outHess.end(), R(0.0));
│ │ │ +
1190 else
│ │ │ +
1191 {
│ │ │ +
1192 for (size_t j=offset; j<offset+limit; j++)
│ │ │ +
1193 {
│ │ │ +
1194 assert(j+2 < lowOrderTwoDValues.size());
│ │ │ +
1195 R derivativeAddend1 = lowOrderTwoDValues[j] / (knotVector[j+order]-knotVector[j]) / (knotVector[j+order-1]-knotVector[j]);
│ │ │ +
1196 R derivativeAddend2 = lowOrderTwoDValues[j+1] / (knotVector[j+order]-knotVector[j]) / (knotVector[j+order]-knotVector[j+1]);
│ │ │ +
1197 R derivativeAddend3 = lowOrderTwoDValues[j+1] / (knotVector[j+order+1]-knotVector[j+1]) / (knotVector[j+order]-knotVector[j+1]);
│ │ │ +
1198 R derivativeAddend4 = lowOrderTwoDValues[j+2] / (knotVector[j+order+1]-knotVector[j+1]) / (knotVector[j+1+order]-knotVector[j+2]);
│ │ │ +
1199 // The two previous terms may evaluate as 0/0. This is to be interpreted as 0.
│ │ │ +
1200
│ │ │ +
1201 if (std::isnan(derivativeAddend1))
│ │ │ +
1202 derivativeAddend1 = 0;
│ │ │ +
1203 if (std::isnan(derivativeAddend2))
│ │ │ +
1204 derivativeAddend2 = 0;
│ │ │ +
1205 if (std::isnan(derivativeAddend3))
│ │ │ +
1206 derivativeAddend3 = 0;
│ │ │ +
1207 if (std::isnan(derivativeAddend4))
│ │ │ +
1208 derivativeAddend4 = 0;
│ │ │ +
1209 outHess[j-offset] = order * (order-1) * ( derivativeAddend1 - derivativeAddend2 -derivativeAddend3 + derivativeAddend4 );
│ │ │ +
1210 }
│ │ │ +
1211 }
│ │ │ +
1212 }
│ │ │ +
1213 }
│ │ │ +
│ │ │ +
1214
│ │ │ +
1215
│ │ │ +
1217 std::array<unsigned int, dim> order_;
│ │ │ +
1218
│ │ │ +
1220 std::array<std::vector<double>, dim> knotVectors_;
│ │ │ +
1221
│ │ │ +
1223 std::array<unsigned,dim> elements_;
│ │ │ +
1224
│ │ │ + │ │ │ +
1226};
│ │ │ +
│ │ │ +
1227
│ │ │ +
1228
│ │ │ +
1229
│ │ │ +
1230template<typename GV>
│ │ │ +
│ │ │ + │ │ │ +
1232 public LeafBasisNode
│ │ │ +
1233{
│ │ │ +
1234 static const int dim = GV::dimension;
│ │ │ +
1235
│ │ │ +
1236public:
│ │ │ +
1237
│ │ │ +
1238 using size_type = std::size_t;
│ │ │ +
1239 using Element = typename GV::template Codim<0>::Entity;
│ │ │ + │ │ │ +
1241
│ │ │ +
│ │ │ + │ │ │ +
1243 preBasis_(preBasis),
│ │ │ +
1244 finiteElement_(*preBasis)
│ │ │ +
1245 {}
│ │ │ +
│ │ │ +
1246
│ │ │ +
│ │ │ +
1248 const Element& element() const
│ │ │ +
1249 {
│ │ │ +
1250 return element_;
│ │ │ +
1251 }
│ │ │ +
│ │ │ +
1252
│ │ │ +
│ │ │ + │ │ │ +
1258 {
│ │ │ +
1259 return finiteElement_;
│ │ │ +
1260 }
│ │ │ +
│ │ │ +
1261
│ │ │ +
│ │ │ +
1263 void bind(const Element& e)
│ │ │ +
1264 {
│ │ │ +
1265 element_ = e;
│ │ │ +
1266 auto elementIndex = preBasis_->gridView().indexSet().index(e);
│ │ │ +
1267 finiteElement_.bind(preBasis_->getIJK(elementIndex,preBasis_->elements_));
│ │ │ +
1268 this->setSize(finiteElement_.size());
│ │ │ +
1269 }
│ │ │ +
│ │ │ +
1270
│ │ │ +
1271protected:
│ │ │ +
1272
│ │ │ + │ │ │ +
1274
│ │ │ + │ │ │ + │ │ │ +
1277};
│ │ │ +
│ │ │ +
1278
│ │ │ +
1279
│ │ │ +
1280
│ │ │ +
1281namespace BasisFactory {
│ │ │ +
1282
│ │ │ +
│ │ │ +
1289inline auto bSpline(const std::vector<double>& knotVector,
│ │ │ +
1290 unsigned int order,
│ │ │ +
1291 bool makeOpen = true)
│ │ │ +
1292{
│ │ │ +
1293 return [&knotVector, order, makeOpen](const auto& gridView) {
│ │ │ +
1294 return BSplinePreBasis<std::decay_t<decltype(gridView)>>(gridView, knotVector, order, makeOpen);
│ │ │ +
1295 };
│ │ │ +
1296}
│ │ │ +
│ │ │ +
1297
│ │ │ +
1298} // end namespace BasisFactory
│ │ │ +
1299
│ │ │ +
1300// *****************************************************************************
│ │ │ +
1301// This is the actual global basis implementation based on the reusable parts.
│ │ │ +
1302// *****************************************************************************
│ │ │ +
1303
│ │ │ +
1310template<typename GV>
│ │ │ + │ │ │ +
1312
│ │ │ +
1313
│ │ │ +
1314} // namespace Functions
│ │ │ +
1315
│ │ │ +
1316} // namespace Dune
│ │ │ +
1317
│ │ │ +
1318#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BSPLINEBASIS_HH
│ │ │ + │ │ │ + │ │ │ + │ │ │ +
auto bSpline(const std::vector< double > &knotVector, unsigned int order, bool makeOpen=true)
Create a pre-basis factory that can create a B-spline pre-basis.
Definition bsplinebasis.hh:1289
│ │ │ +
DefaultGlobalBasis< BSplinePreBasis< GV > > BSplineBasis
A global B-spline basis.
Definition bsplinebasis.hh:1311
│ │ │ +
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │
Definition argyrisbasis.hh:926
│ │ │ -
A pre-basis for a Hermitebasis.
Definition cubichermitebasis.hh:725
│ │ │ -
std::vector< D > averageVertexMeshSize_
Definition cubichermitebasis.hh:788
│ │ │ -
Node makeNode() const
Create tree node.
Definition cubichermitebasis.hh:780
│ │ │ -
CubicHermiteNode< GridView, R, reduced > Node
Template mapping root tree path to type of created tree node.
Definition cubichermitebasis.hh:755
│ │ │ -
GV GridView
The grid view that the FE basis is defined on.
Definition cubichermitebasis.hh:749
│ │ │ -
std::size_t size_type
Type used for indices and size information.
Definition cubichermitebasis.hh:752
│ │ │ -
SubEntityMapper vertexMapper_
Definition cubichermitebasis.hh:787
│ │ │ -
void update(GridView const &gv)
Update the stored grid view, to be called if the grid has changed.
Definition cubichermitebasis.hh:770
│ │ │ -
CubicHermitePreBasis(const GV &gv)
Constructor for a given grid view object.
Definition cubichermitebasis.hh:760
│ │ │ -
Definition cubichermitebasis.hh:84
│ │ │ - │ │ │ -
Definition cubichermitebasis.hh:664
│ │ │ -
std::size_t size_type
Definition cubichermitebasis.hh:668
│ │ │ -
typename Impl::CubicHermiteLocalFiniteElement< typename GV::ctype, R, GV::dimension, reduced > FiniteElement
Definition cubichermitebasis.hh:670
│ │ │ -
FiniteElement finiteElement_
Definition cubichermitebasis.hh:706
│ │ │ -
FiniteElement const & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition cubichermitebasis.hh:689
│ │ │ -
Element const & element() const
Return current element, throw if unbound.
Definition cubichermitebasis.hh:679
│ │ │ -
Element const * element_
Definition cubichermitebasis.hh:707
│ │ │ -
void bind(Element const &e)
Bind to element.
Definition cubichermitebasis.hh:695
│ │ │ -
unsigned int order() const
The order of the local basis.
Definition cubichermitebasis.hh:703
│ │ │ -
typename GV::template Codim< 0 >::Entity Element
Definition cubichermitebasis.hh:669
│ │ │ -
Mapper const * vertexMapper_
Definition cubichermitebasis.hh:708
│ │ │ -
std::vector< typename GridView::ctype > const * averageVertexMeshSize_
Definition cubichermitebasis.hh:709
│ │ │ -
CubicHermiteNode(Mapper const &m, std::vector< typename GV::ctype > const &averageVertexMeshSize)
Definition cubichermitebasis.hh:672
│ │ │ +
LocalFiniteElement in the sense of dune-localfunctions, for the B-spline basis on tensor-product grid...
Definition bsplinebasis.hh:369
│ │ │ +
BSplineLocalFiniteElement(const BSplineLocalFiniteElement &other)
Copy constructor.
Definition bsplinebasis.hh:390
│ │ │ +
const BSplinePreBasis< GV > & preBasis_
Definition bsplinebasis.hh:481
│ │ │ +
const BSplineLocalInterpolation< dim, BSplineLocalBasis< GV, R > > & localInterpolation() const
Hand out a LocalInterpolation object.
Definition bsplinebasis.hh:446
│ │ │ +
LocalFiniteElementTraits< BSplineLocalBasis< GV, R >, BSplineLocalCoefficients< dim >, BSplineLocalInterpolation< dim, BSplineLocalBasis< GV, R > > > Traits
Export various types related to this LocalFiniteElement.
Definition bsplinebasis.hh:379
│ │ │ +
std::array< unsigned, dim > currentKnotSpan_
Definition bsplinebasis.hh:488
│ │ │ +
BSplineLocalFiniteElement(const BSplinePreBasis< GV > &preBasis)
Constructor with a given B-spline basis.
Definition bsplinebasis.hh:383
│ │ │ +
const BSplineLocalCoefficients< dim > & localCoefficients() const
Hand out a LocalCoefficients object.
Definition bsplinebasis.hh:440
│ │ │ +
void bind(const std::array< unsigned, dim > &elementIdx)
Bind LocalFiniteElement to a specific knot span of the spline patch.
Definition bsplinebasis.hh:401
│ │ │ +
BSplineLocalInterpolation< dim, BSplineLocalBasis< GV, double > > localInterpolation_
Definition bsplinebasis.hh:485
│ │ │ +
GeometryType type() const
Return the reference element that the local finite element is defined on (here, a hypercube).
Definition bsplinebasis.hh:462
│ │ │ +
unsigned size() const
Number of shape functions in this finite element.
Definition bsplinebasis.hh:452
│ │ │ +
BSplineLocalCoefficients< dim > localCoefficients_
Definition bsplinebasis.hh:484
│ │ │ +
unsigned int size(int i) const
Number of degrees of freedom for one coordinate direction.
Definition bsplinebasis.hh:470
│ │ │ +
BSplineLocalBasis< GV, double > localBasis_
Definition bsplinebasis.hh:483
│ │ │ +
const BSplineLocalBasis< GV, R > & localBasis() const
Hand out a LocalBasis object.
Definition bsplinebasis.hh:434
│ │ │ +
Pre-basis for B-spline basis.
Definition bsplinebasis.hh:507
│ │ │ +
std::array< unsigned, dim > elements_
Number of grid elements in the different coordinate directions.
Definition bsplinebasis.hh:1223
│ │ │ +
GridView gridView_
Definition bsplinebasis.hh:1225
│ │ │ +
double R
Definition bsplinebasis.hh:576
│ │ │ +
static void evaluateFunctionFull(const typename GV::ctype &in, DynamicMatrix< R > &out, const std::vector< R > &knotVector, unsigned int order, unsigned int currentKnotSpan)
Evaluate all one-dimensional B-spline functions for a given coordinate direction.
Definition bsplinebasis.hh:1069
│ │ │ +
void evaluateFunction(const FieldVector< typename GV::ctype, dim > &in, std::vector< FieldVector< R, 1 > > &out, const std::array< unsigned, dim > &currentKnotSpan) const
Evaluate all B-spline basis functions at a given point.
Definition bsplinebasis.hh:765
│ │ │ +
std::array< unsigned int, dim > order_
Order of the B-spline for each space dimension.
Definition bsplinebasis.hh:1217
│ │ │ +
static void evaluateAll(const typename GV::ctype &in, std::vector< R > &out, bool evaluateJacobian, std::vector< R > &outJac, bool evaluateHessian, std::vector< R > &outHess, const std::vector< R > &knotVector, unsigned int order, unsigned int currentKnotSpan)
Evaluate the second derivatives of all one-dimensional B-spline functions for a given coordinate dire...
Definition bsplinebasis.hh:1111
│ │ │ +
static void evaluateFunction(const typename GV::ctype &in, std::vector< R > &out, const std::vector< R > &knotVector, unsigned int order, unsigned int currentKnotSpan)
Evaluate all one-dimensional B-spline functions for a given coordinate direction.
Definition bsplinebasis.hh:1012
│ │ │ +
unsigned int size(size_t d) const
Number of shape functions in one direction.
Definition bsplinebasis.hh:756
│ │ │ +
GV GridView
The grid view that the FE space is defined on.
Definition bsplinebasis.hh:570
│ │ │ +
It indices(const Node &node, It it) const
Maps from subtree index set [0..size-1] to a globally unique multi index in global basis.
Definition bsplinebasis.hh:717
│ │ │ +
void evaluate(const typename std::array< int, k > &directions, const FieldVector< typename GV::ctype, dim > &in, std::vector< FieldVector< R, 1 > > &out, const std::array< unsigned, dim > &currentKnotSpan) const
Evaluate Derivatives of all B-spline basis functions.
Definition bsplinebasis.hh:897
│ │ │ +
std::size_t size_type
Definition bsplinebasis.hh:571
│ │ │ +
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition bsplinebasis.hh:693
│ │ │ +
unsigned int dimension() const
Total number of B-spline basis functions.
Definition bsplinebasis.hh:747
│ │ │ +
void initializeIndices()
Initialize the global indices.
Definition bsplinebasis.hh:683
│ │ │ +
BSplineNode< GV > Node
Definition bsplinebasis.hh:573
│ │ │ +
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition bsplinebasis.hh:687
│ │ │ +
static std::array< unsigned int, dim > getIJK(typename GridView::IndexSet::IndexType idx, std::array< unsigned int, dim > elements)
Compute integer element coordinates from the element index.
Definition bsplinebasis.hh:993
│ │ │ +
Node makeNode() const
Create tree node.
Definition bsplinebasis.hh:701
│ │ │ +
BSplinePreBasis(const GridView &gridView, const std::vector< double > &knotVector, unsigned int order, bool makeOpen=true)
Construct a B-spline basis for a given grid view and set of knot vectors.
Definition bsplinebasis.hh:597
│ │ │ +
void evaluateJacobian(const FieldVector< typename GV::ctype, dim > &in, std::vector< FieldMatrix< R, 1, dim > > &out, const std::array< unsigned, dim > &currentKnotSpan) const
Evaluate Jacobian of all B-spline basis functions.
Definition bsplinebasis.hh:796
│ │ │ +
std::array< std::vector< double >, dim > knotVectors_
The knot vectors, one for each space dimension.
Definition bsplinebasis.hh:1220
│ │ │ +
size_type size() const
Get the total dimension of the space spanned by this basis.
Definition leafprebasismixin.hh:60
│ │ │ +
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition bsplinebasis.hh:707
│ │ │ +
BSplinePreBasis(const GridView &gridView, const FieldVector< double, dim > &lowerLeft, const FieldVector< double, dim > &upperRight, const std::array< unsigned int, dim > &elements, unsigned int order, bool makeOpen=true)
Construct a B-spline basis for a given grid view with uniform knot vectors.
Definition bsplinebasis.hh:649
│ │ │ +
LocalBasis class in the sense of dune-localfunctions, presenting the restriction of a B-spline patch ...
Definition bsplinebasis.hh:51
│ │ │ +
LocalBasisTraits< D, dim, FieldVector< D, dim >, R, 1, FieldVector< R, 1 >, FieldMatrix< R, 1, dim > > Traits
export type traits for function signature
Definition bsplinebasis.hh:60
│ │ │ +
unsigned int order() const
Polynomial order of the shape functions.
Definition bsplinebasis.hh:147
│ │ │ +
std::size_t size() const
Return the number of basis functions on the current knot span.
Definition bsplinebasis.hh:154
│ │ │ +
void evaluate(const typename std::array< int, k > &directions, const typename Traits::DomainType &in, std::vector< typename Traits::RangeType > &out) const
Evaluate all shape functions and derivatives of any order.
Definition bsplinebasis.hh:104
│ │ │ +
void evaluateFunction(const FieldVector< D, dim > &in, std::vector< FieldVector< R, 1 > > &out) const
Evaluate all shape functions.
Definition bsplinebasis.hh:76
│ │ │ +
void evaluateJacobian(const FieldVector< D, dim > &in, std::vector< FieldMatrix< D, 1, dim > > &out) const
Evaluate Jacobian of all shape functions.
Definition bsplinebasis.hh:89
│ │ │ +
BSplineLocalBasis(const BSplinePreBasis< GV > &preBasis, const BSplineLocalFiniteElement< GV, R > &lFE)
Constructor with a given B-spline patch.
Definition bsplinebasis.hh:66
│ │ │ +
Attaches a shape function to an entity.
Definition bsplinebasis.hh:185
│ │ │ +
const LocalKey & localKey(std::size_t i) const
get i'th index
Definition bsplinebasis.hh:328
│ │ │ +
void init(const std::array< unsigned, dim > &sizes)
Definition bsplinebasis.hh:263
│ │ │ +
std::size_t size() const
number of coefficients
Definition bsplinebasis.hh:322
│ │ │ +
Local interpolation in the sense of dune-localfunctions, for the B-spline basis on tensor-product gri...
Definition bsplinebasis.hh:347
│ │ │ +
void interpolate(const F &f, std::vector< C > &out) const
Local interpolation of a function.
Definition bsplinebasis.hh:351
│ │ │ +
Definition bsplinebasis.hh:1233
│ │ │ +
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition bsplinebasis.hh:1257
│ │ │ +
typename GV::template Codim< 0 >::Entity Element
Definition bsplinebasis.hh:1239
│ │ │ +
const BSplinePreBasis< GV > * preBasis_
Definition bsplinebasis.hh:1273
│ │ │ +
BSplineLocalFiniteElement< GV, double > FiniteElement
Definition bsplinebasis.hh:1240
│ │ │ +
Element element_
Definition bsplinebasis.hh:1276
│ │ │ +
void bind(const Element &e)
Bind to element.
Definition bsplinebasis.hh:1263
│ │ │ +
BSplineNode(const BSplinePreBasis< GV > *preBasis)
Definition bsplinebasis.hh:1242
│ │ │ +
const Element & element() const
Return current element, throw if unbound.
Definition bsplinebasis.hh:1248
│ │ │ +
FiniteElement finiteElement_
Definition bsplinebasis.hh:1275
│ │ │ +
std::size_t size_type
Definition bsplinebasis.hh:1238
│ │ │
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:53
│ │ │ -
const GridView & gridView() const
Export the stored GridView.
Definition leafprebasismappermixin.hh:95
│ │ │ -
void update(const GridView &gv)
Update the stored GridView.
Definition leafprebasismappermixin.hh:101
│ │ │ -
LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout)
Construct from GridView and local DOF layout.
Definition leafprebasismappermixin.hh:74
│ │ │ +
A generic MixIn class for PreBasis.
Definition leafprebasismixin.hh:36
│ │ │ +
size_type size() const
Definition leafprebasismixin.hh:60
│ │ │ +
size_type size() const
Obtain the number of basis function in the local node.
Definition nodes.hh:162
│ │ │
void setSize(const size_type size)
Definition nodes.hh:197
│ │ │
Definition nodes.hh:218
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,847 +1,1496 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -cubichermitebasis.hh │ │ │ │ +bsplinebasis.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ -1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ +_1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ -6#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CUBICHERMITEBASIS_HH │ │ │ │ -7#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CUBICHERMITEBASIS_HH │ │ │ │ -8 │ │ │ │ -9#include │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ -12#include │ │ │ │ -13#include │ │ │ │ -14 │ │ │ │ -15#include │ │ │ │ -16#include │ │ │ │ -17#include │ │ │ │ -18#include │ │ │ │ +6 │ │ │ │ +7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BSPLINEBASIS_HH │ │ │ │ +8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BSPLINEBASIS_HH │ │ │ │ +9 │ │ │ │ +13 │ │ │ │ +14#include │ │ │ │ +15#include │ │ │ │ +16 │ │ │ │ +18#include │ │ │ │ 19 │ │ │ │ -20#include │ │ │ │ -21 │ │ │ │ -22#include │ │ │ │ +20#include │ │ │ │ +21#include │ │ │ │ +22#include │ │ │ │ 23#include │ │ │ │ -24#include │ │ │ │ -25 │ │ │ │ -26#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_m_a_p_p_e_r_u_t_i_l_i_t_i_e_s_._h_h> │ │ │ │ -27#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_s_q_u_e_e_z_e_t_e_n_s_o_r_._h_h> │ │ │ │ -28#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ -29#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_f_u_n_c_t_i_o_n_a_l_d_e_s_c_r_i_p_t_o_r_._h_h> │ │ │ │ -30#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h> │ │ │ │ -31#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -32#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_t_r_a_n_s_f_o_r_m_e_d_f_i_n_i_t_e_e_l_e_m_e_n_t_m_i_x_i_n_._h_h> │ │ │ │ -33 │ │ │ │ -34 │ │ │ │ -35 │ │ │ │ -36#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_a_n_a_l_y_t_i_c_f_u_n_c_t_i_o_n_s_/_m_o_n_o_m_i_a_l_s_e_t_._h_h> │ │ │ │ -37 │ │ │ │ -53namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -54{ │ │ │ │ -55 │ │ │ │ -56 template │ │ │ │ -57 class _C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s; │ │ │ │ -58 │ │ │ │ -78 template │ │ │ │ -_7_9 using _C_u_b_i_c_H_e_r_m_i_t_e_B_a_s_i_s = _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s_<_G_V_,_ _R_, │ │ │ │ -_r_e_d_u_c_e_d_> >; │ │ │ │ -80 │ │ │ │ -81 template │ │ │ │ -_8_2 struct _H_2_L_o_c_a_l_B_a_s_i_s_T_r_a_i_t_s │ │ │ │ -83 : public LocalBasisTraits │ │ │ │ -84 { │ │ │ │ -_9_0 using _H_e_s_s_i_a_n_T_y_p_e = H; │ │ │ │ -91 }; │ │ │ │ -92 │ │ │ │ -93 namespace Impl │ │ │ │ -94 { │ │ │ │ -95 │ │ │ │ -96 / │ │ │ │ -/ ***************************************************************************** │ │ │ │ -97 // * Some helper functions for building polynomial bases from monomials │ │ │ │ -98 / │ │ │ │ -/ ***************************************************************************** │ │ │ │ -99 │ │ │ │ -109 template │ │ │ │ -110 void multiplyWithCoefficentMatrix(Dune::FieldMatrix const& coefficients, │ │ │ │ -111 In const& monomialValues, │ │ │ │ -112 Out& polynomialValues) │ │ │ │ -113 { │ │ │ │ -114 for (int i = 0; i < sizePolynom; ++i) │ │ │ │ -115 { │ │ │ │ -116 squeezeTensor(polynomialValues[i]) = 0; │ │ │ │ -117 for (int j = 0; j < sizeMonom; ++j) │ │ │ │ -118 squeezeTensor(polynomialValues[i]) += coefficients[i][j]*monomialValues[j]; │ │ │ │ -119 } │ │ │ │ -120 } │ │ │ │ -121 │ │ │ │ -127 template │ │ │ │ -128 class CubicHermiteLocalCoefficients │ │ │ │ -129 { │ │ │ │ -130 public: │ │ │ │ -131 using size_type = std::size_t; │ │ │ │ -132 │ │ │ │ -133 CubicHermiteLocalCoefficients() │ │ │ │ -134 : localKeys_(size()) │ │ │ │ -135 { │ │ │ │ -136 static_assert((dim > 0) and (dim <= 3), "CubicHermiteLocalCoefficients only │ │ │ │ -implemented for dim=1,2,3"); │ │ │ │ -137 static_assert((not reduced) or (dim == 2), "Reduced version of │ │ │ │ -CubicHermiteLocalCoefficients only implemented for dim=2"); │ │ │ │ -138 for (size_type i = 0; i < (dim +1); ++i) │ │ │ │ -139 { │ │ │ │ -140 // dim derivatives + 1 evaluation dofs per vertex │ │ │ │ -141 for (size_type k = 0; k < (dim +1); ++k) │ │ │ │ -142 localKeys_[(dim +1) * i + k] = LocalKey(i, dim, k); │ │ │ │ -143 } │ │ │ │ -144 if constexpr (not reduced) │ │ │ │ -145 { │ │ │ │ -146 // 1 evaluation per element (2d) / facets (3d) │ │ │ │ -147 for (size_type i = 0; i < (dim - 1) * (dim - 1); ++i) │ │ │ │ -148 localKeys_[(dim +1) * (dim +1) + i] = LocalKey(i, (dim == 2) ? 0 : 1, 0); / │ │ │ │ -/ inner dofs │ │ │ │ -149 } │ │ │ │ +24#include │ │ │ │ +25#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ +26#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ +27#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h> │ │ │ │ +28 │ │ │ │ +29namespace _D_u_n_e │ │ │ │ +30{ │ │ │ │ +31namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +32 │ │ │ │ +33// A maze of dependencies between the different parts of this. We need a few │ │ │ │ +forward declarations │ │ │ │ +34template │ │ │ │ +35class _B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t; │ │ │ │ +36 │ │ │ │ +37template │ │ │ │ +38class _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s; │ │ │ │ +39 │ │ │ │ +40 │ │ │ │ +49template │ │ │ │ +_5_0class _B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s │ │ │ │ +51{ │ │ │ │ +52 friend class _B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t; │ │ │ │ +53 │ │ │ │ +54 typedef typename GV::ctype D; │ │ │ │ +55 enum {dim = GV::dimension}; │ │ │ │ +56public: │ │ │ │ +57 │ │ │ │ +59 typedef LocalBasisTraits,R,1,FieldVector, │ │ │ │ +_6_0 FieldMatrix > _T_r_a_i_t_s; │ │ │ │ +61 │ │ │ │ +_6_6 _B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s(const _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_<_G_V_>& preBasis, │ │ │ │ +67 const _B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_G_V_,_R_>& lFE) │ │ │ │ +68 : preBasis_(preBasis), │ │ │ │ +69 lFE_(lFE) │ │ │ │ +70 {} │ │ │ │ +71 │ │ │ │ +_7_6 void _e_v_a_l_u_a_t_e_F_u_n_c_t_i_o_n (const FieldVector& in, │ │ │ │ +77 std::vector >& out) const │ │ │ │ +78 { │ │ │ │ +79 FieldVector globalIn = offset_; │ │ │ │ +80 scaling_.umv(in,globalIn); │ │ │ │ +81 │ │ │ │ +82 preBasis_.evaluateFunction(globalIn, out, lFE_.currentKnotSpan_); │ │ │ │ +83 } │ │ │ │ +84 │ │ │ │ +_8_9 void _e_v_a_l_u_a_t_e_J_a_c_o_b_i_a_n (const FieldVector& in, │ │ │ │ +90 std::vector >& out) const │ │ │ │ +91 { │ │ │ │ +92 FieldVector globalIn = offset_; │ │ │ │ +93 scaling_.umv(in,globalIn); │ │ │ │ +94 │ │ │ │ +95 preBasis_.evaluateJacobian(globalIn, out, lFE_.currentKnotSpan_); │ │ │ │ +96 │ │ │ │ +97 for (size_t i=0; i │ │ │ │ +_1_0_4 inline void _e_v_a_l_u_a_t_e (const typename std::array& directions, │ │ │ │ +105 const typename Traits::DomainType& in, │ │ │ │ +106 std::vector& out) const │ │ │ │ +107 { │ │ │ │ +108 switch(k) │ │ │ │ +109 { │ │ │ │ +110 case 0: │ │ │ │ +111 _e_v_a_l_u_a_t_e_F_u_n_c_t_i_o_n(in, out); │ │ │ │ +112 break; │ │ │ │ +113 case 1: │ │ │ │ +114 { │ │ │ │ +115 FieldVector globalIn = offset_; │ │ │ │ +116 scaling_.umv(in,globalIn); │ │ │ │ +117 │ │ │ │ +118 preBasis_.evaluate(directions, globalIn, out, lFE_.currentKnotSpan_); │ │ │ │ +119 │ │ │ │ +120 for (size_t i=0; i globalIn = offset_; │ │ │ │ +127 scaling_.umv(in,globalIn); │ │ │ │ +128 │ │ │ │ +129 preBasis_.evaluate(directions, globalIn, out, lFE_.currentKnotSpan_); │ │ │ │ +130 │ │ │ │ +131 for (size_t i=0; i localKeys_; │ │ │ │ -176 }; │ │ │ │ -177 │ │ │ │ -178 │ │ │ │ -184 template │ │ │ │ -185 class CubicHermiteReferenceLocalBasis │ │ │ │ -186 { │ │ │ │ -187 public: │ │ │ │ -188 using Traits = H2LocalBasisTraits, R, 1, │ │ │ │ -FieldVector, │ │ │ │ -189 FieldMatrix, FieldMatrix>; │ │ │ │ -190 │ │ │ │ -191 private: │ │ │ │ -192 │ │ │ │ -205 static constexpr auto getCubicHermiteCoefficients() │ │ │ │ -206 { │ │ │ │ -207 if constexpr (dim == 1) │ │ │ │ -208 return Dune::FieldMatrix({{1, 0, -3, 2}, {0, 1, -2, 1}, {0, 0, 3, │ │ │ │ --2}, {0, 0, -1, 1}}); │ │ │ │ -209 else if constexpr (dim == 2) │ │ │ │ -210 { │ │ │ │ -211 if constexpr (reduced) { │ │ │ │ -212 auto w = std::array{1. / 3, 1. / 18, 1. / 18, 1. / 3, -1. / 9, │ │ │ │ -213 1. / 18, 1. / 3, 1. / 18, -1. / 9}; │ │ │ │ -214 return Dune::FieldMatrix({ │ │ │ │ -215 {1, 0, 0, -3, -13 + w[0] * 27, -3, 2, 13 - w[0] * 27, 13 - w[0] * 27, 2}, │ │ │ │ -216 {0, 1, 0, -2, -3 + w[1] * 27, 0, 1, 3 - w[1] * 27, 2 - w[1] * 27, 0}, │ │ │ │ -217 {0, 0, 1, 0, -3 + w[2] * 27, -2, 0, 2 - w[2] * 27, 3 - w[2] * 27, 1}, │ │ │ │ -218 {0, 0, 0, 3, -7 + w[3] * 27, 0, -2, 7 - w[3] * 27, 7 - w[3] * 27, 0}, │ │ │ │ -219 {0, 0, 0, -1, 2 + w[4] * 27, 0, 1, -2 - w[4] * 27, -2 - w[4] * 27, 0}, │ │ │ │ -220 {0, 0, 0, 0, -1 + w[5] * 27, 0, 0, 2 - w[5] * 27, 1 - w[5] * 27, 0}, │ │ │ │ -221 {0, 0, 0, 0, -7 + w[6] * 27, 3, 0, 7 - w[6] * 27, 7 - w[6] * 27, -2}, │ │ │ │ -222 {0, 0, 0, 0, -1 + w[7] * 27, 0, 0, 1 - w[7] * 27, 2 - w[7] * 27, 0}, │ │ │ │ -223 {0, 0, 0, 0, 2 + w[8] * 27, -1, 0, -2 - w[8] * 27, -2 - w[8] * 27, 1}, │ │ │ │ -224 }); │ │ │ │ -225 } │ │ │ │ -226 else │ │ │ │ -227 return Dune::FieldMatrix({ │ │ │ │ -228 {1, 0, 0, -3, -13, -3, 2, 13, 13, 2}, │ │ │ │ -229 {0, 1, 0, -2, -3, 0, 1, 3, 2, 0}, │ │ │ │ -230 {0, 0, 1, 0, -3, -2, 0, 2, 3, 1}, // l_2 │ │ │ │ -231 {0, 0, 0, 3, -7, 0, -2, 7, 7, 0}, │ │ │ │ -232 {0, 0, 0, -1, 2, 0, 1, -2, -2, 0}, │ │ │ │ -233 {0, 0, 0, 0, -1, 0, 0, 2, 1, 0}, │ │ │ │ -234 {0, 0, 0, 0, -7, 3, 0, 7, 7, -2}, // l_6 │ │ │ │ -235 {0, 0, 0, 0, -1, 0, 0, 1, 2, 0}, │ │ │ │ -236 {0, 0, 0, 0, 2, -1, 0, -2, -2, 1}, │ │ │ │ -237 {0, 0, 0, 0, 27, 0, 0, -27, -27, 0}}); // l_9, inner dof │ │ │ │ -238 } │ │ │ │ -239 else if constexpr (dim == 3) │ │ │ │ -240 { │ │ │ │ -241 return Dune::FieldMatrix({{1, 0, 0, 0, -3, -13, -3, -13, -13, -3, │ │ │ │ -// deg 0 to 2 │ │ │ │ -242 2, 13, 13, 2, 13, 33, 13, 13, 13, 2}, // deg 3 │ │ │ │ -243 {0, 1, 0, 0,/*xx*/ -2, /*xy*/-3,/*yy*/ 0,/*xz*/ -3,/*yz*/ 0,/*zz*/ 0, 1, 3, │ │ │ │ -2, 0, 3, 4, 0, 2, 0, 0}, │ │ │ │ -244 {0, 0, 1, 0, 0, -3, -2, 0, -3, 0, 0, 2, 3, 1, 0, 4, 3, 0, 2, 0}, │ │ │ │ -245 {0, 0, 0, 1, 0, 0, 0, -3, -3, -2, 0, 0, 0, 0, 2, 4, 2, 3, 3, 1}, │ │ │ │ -246 {0, 0, 0, 0, 3, -7, 0, -7, 0, 0, // l_4 │ │ │ │ -247 -2, 7, 7, 0, 7, 7, 0, 7, 0, 0}, │ │ │ │ -248 {0, 0, 0, 0, -1, 2, 0, 2, 0, 0, 1, -2, -2, 0, -2, -2, 0, -2, 0, 0}, │ │ │ │ -249 {0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0}, │ │ │ │ -250 {0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 1, 0, 0}, │ │ │ │ -251 {0, 0, 0, 0, 0, -7, 3, 0, -7, 0, // l_8 │ │ │ │ -252 0, 7, 7, -2, 0, 7, 7, 0, 7, 0}, │ │ │ │ -253 {0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0}, │ │ │ │ -254 {0, 0, 0, 0, 0, 2, -1, 0, 2, 0, 0, -2, -2, 1, 0, -2, -2, 0, -2, 0}, │ │ │ │ -255 {0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0}, │ │ │ │ -256 {0, 0, 0, 0, 0, 0, 0, -7, -7, 3, // l_12 │ │ │ │ -257 0, 0, 0, 0, 7, 7, 7, 7, 7, -2}, │ │ │ │ -258 {0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0}, │ │ │ │ -259 {0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0}, │ │ │ │ -260 {0, 0, 0, 0, 0, 0, 0, 2, 2, -1, 0, 0, 0, 0, -2, -2, -2, -2, -2, 1}, │ │ │ │ -261 // l_16, from here on inner dofs │ │ │ │ -262 {0, 0, 0, 0, 0, 27, 0, 0, 0, 0, // bottom │ │ │ │ -263 0, -27, -27, 0, 0, -27, 0, 0, 0, 0}, │ │ │ │ -264 {0, 0, 0, 0, 0, 0, 0, 27, 0, 0, // front │ │ │ │ -265 0, 0, 0, 0, -27, -27, 0, -27, 0, 0}, │ │ │ │ -266 {0, 0, 0, 0, 0, 0, 0, 0, 27, 0, // left │ │ │ │ -267 0, 0, 0, 0, 0, -27, -27, 0, -27, 0}, │ │ │ │ -268 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // right │ │ │ │ -269 0, 0, 0, 0, 0, 27, 0, 0, 0, 0}}); │ │ │ │ -270 } │ │ │ │ -271 } │ │ │ │ -272 │ │ │ │ -273 static constexpr auto referenceBasisCoefficients = │ │ │ │ -getCubicHermiteCoefficients(); │ │ │ │ -274 static constexpr MonomialSet │ │ │ │ -monomials = {}; │ │ │ │ -275 │ │ │ │ -276 public: │ │ │ │ -277 │ │ │ │ -278 CubicHermiteReferenceLocalBasis() │ │ │ │ -279 { │ │ │ │ -280 static_assert((dim > 0) and (dim <= 3), "CubicHermiteReferenceLocalBasis │ │ │ │ -only implemented for dim=1,2,3"); │ │ │ │ -281 static_assert((not reduced) or (dim == 2), "Reduced version of │ │ │ │ -CubicHermiteReferenceLocalBasis only implemented for dim=2"); │ │ │ │ -282 } │ │ │ │ -283 │ │ │ │ -286 static constexpr unsigned int size() │ │ │ │ -287 { │ │ │ │ -288 return CubicHermiteLocalCoefficients::size(); │ │ │ │ -289 } │ │ │ │ -290 │ │ │ │ -293 unsigned int order() const │ │ │ │ -294 { │ │ │ │ -295 return 3; │ │ │ │ -296 } │ │ │ │ -297 │ │ │ │ -303 void evaluateFunction(const typename Traits::DomainType &in, │ │ │ │ -304 std::vector &out) const │ │ │ │ +156 return lFE_.size(); │ │ │ │ +157 } │ │ │ │ +158 │ │ │ │ +159private: │ │ │ │ +160 const _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_<_G_V_>& preBasis_; │ │ │ │ +161 │ │ │ │ +162 const _B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_G_V_,_R_>& lFE_; │ │ │ │ +163 │ │ │ │ +164 // Coordinates in a single knot span differ from coordinates on the B- │ │ │ │ +spline patch │ │ │ │ +165 // by an affine transformation. This transformation is stored in offset_ │ │ │ │ +and scaling_. │ │ │ │ +166 FieldVector offset_; │ │ │ │ +167 DiagonalMatrix scaling_; │ │ │ │ +168}; │ │ │ │ +169 │ │ │ │ +183template │ │ │ │ +_1_8_4class _B_S_p_l_i_n_e_L_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s │ │ │ │ +185{ │ │ │ │ +186 // Return i as a d-digit number in the (k+1)-nary system │ │ │ │ +187 std::array multiindex (unsigned int i) const │ │ │ │ +188 { │ │ │ │ +189 std::array alpha; │ │ │ │ +190 for (int j=0; j& subEntity) │ │ │ │ +200 { │ │ │ │ +201 if (sizes_[0]==1) │ │ │ │ +202 { │ │ │ │ +203 subEntity[0] = 0; │ │ │ │ +204 return; │ │ │ │ +205 } │ │ │ │ +206 │ │ │ │ +207 /* edge and vertex numbering │ │ │ │ +208 0----0----1 │ │ │ │ +209 */ │ │ │ │ +210 unsigned lastIndex=0; │ │ │ │ +211 subEntity[lastIndex++] = 0; // corner 0 │ │ │ │ +212 for (unsigned i = 0; i < sizes_[0] - 2; ++i) │ │ │ │ +213 subEntity[lastIndex++] = 0; // inner dofs of element (0) │ │ │ │ +214 │ │ │ │ +215 subEntity[lastIndex++] = 1; // corner 1 │ │ │ │ +216 │ │ │ │ +217 assert(_s_i_z_e()==lastIndex); │ │ │ │ +218 } │ │ │ │ +219 │ │ │ │ +220 void setup2d(std::vector& subEntity) │ │ │ │ +221 { │ │ │ │ +222 unsigned lastIndex=0; │ │ │ │ +223 │ │ │ │ +224 // LocalKey: entity number , entity codim, dof indices within each entity │ │ │ │ +225 /* edge and vertex numbering │ │ │ │ +226 2----3----3 │ │ │ │ +227 | | │ │ │ │ +228 | | │ │ │ │ +229 0 1 │ │ │ │ +230 | | │ │ │ │ +231 | | │ │ │ │ +232 0----2----1 │ │ │ │ +233 */ │ │ │ │ +234 │ │ │ │ +235 // lower edge (2) │ │ │ │ +236 subEntity[lastIndex++] = 0; // corner 0 │ │ │ │ +237 for (unsigned i = 0; i < sizes_[0]-2; ++i) │ │ │ │ +238 subEntity[lastIndex++] = 2; // inner dofs of lower edge (2) │ │ │ │ +239 │ │ │ │ +240 subEntity[lastIndex++] = 1; // corner 1 │ │ │ │ +241 │ │ │ │ +242 // iterate from bottom to top over inner edge dofs │ │ │ │ +243 for (unsigned e = 0; e < sizes_[1]-2; ++e) │ │ │ │ +244 { │ │ │ │ +245 subEntity[lastIndex++] = 0; // left edge (0) │ │ │ │ +246 for (unsigned i = 0; i < sizes_[0]-2; ++i) │ │ │ │ +247 subEntity[lastIndex++] = 0; // face dofs │ │ │ │ +248 subEntity[lastIndex++] = 1; // right edge (1) │ │ │ │ +249 } │ │ │ │ +250 │ │ │ │ +251 // upper edge (3) │ │ │ │ +252 subEntity[lastIndex++] = 2; // corner 2 │ │ │ │ +253 for (unsigned i = 0; i < sizes_[0]-2; ++i) │ │ │ │ +254 subEntity[lastIndex++] = 3; // inner dofs of upper edge (3) │ │ │ │ +255 │ │ │ │ +256 subEntity[lastIndex++] = 3; // corner 3 │ │ │ │ +257 │ │ │ │ +258 assert(_s_i_z_e()==lastIndex); │ │ │ │ +259 } │ │ │ │ +260 │ │ │ │ +261 │ │ │ │ +262public: │ │ │ │ +_2_6_3 void _i_n_i_t(const std::array& sizes) │ │ │ │ +264 { │ │ │ │ +265 sizes_ = sizes; │ │ │ │ +266 │ │ │ │ +267 li_.resize(_s_i_z_e()); │ │ │ │ +268 │ │ │ │ +269 // Set up array of codimension-per-dof-number │ │ │ │ +270 std::vector codim(li_.size()); │ │ │ │ +271 │ │ │ │ +272 for (std::size_t i=0; i mIdx = multiindex(i); │ │ │ │ +278 for (int j=0; j index(_s_i_z_e()); │ │ │ │ +289 │ │ │ │ +290 for (std::size_t i=0; i mIdx = multiindex(i); │ │ │ │ +295 │ │ │ │ +296 for (int j=dim-1; j>=0; j--) │ │ │ │ +297 if (mIdx[j]>0 and mIdx[j] subEntity(li_.size()); │ │ │ │ +303 │ │ │ │ +304 if (subEntity.size() > 0) │ │ │ │ 305 { │ │ │ │ -306 out.resize(size()); │ │ │ │ -307 auto monomialValues = monomials(in); │ │ │ │ -308 multiplyWithCoefficentMatrix(referenceBasisCoefficients, monomialValues, │ │ │ │ -out); │ │ │ │ -309 } │ │ │ │ -310 │ │ │ │ -316 void evaluateJacobian(const typename Traits::DomainType &in, │ │ │ │ -317 std::vector &out) const │ │ │ │ -318 { │ │ │ │ -319 out.resize(size()); │ │ │ │ -320 auto monomialValues = _d_e_r_i_v_a_t_i_v_e(monomials)(in); │ │ │ │ -321 multiplyWithCoefficentMatrix(referenceBasisCoefficients, monomialValues, │ │ │ │ -out); │ │ │ │ -322 } │ │ │ │ -323 │ │ │ │ -329 void evaluateHessian(const typename Traits::DomainType &in, │ │ │ │ -330 std::vector &out) const │ │ │ │ -331 { │ │ │ │ -332 out.resize(size()); │ │ │ │ -333 auto monomialValues = _d_e_r_i_v_a_t_i_v_e(_d_e_r_i_v_a_t_i_v_e(monomials))(in); │ │ │ │ -334 multiplyWithCoefficentMatrix(referenceBasisCoefficients, monomialValues, │ │ │ │ -out); │ │ │ │ -335 } │ │ │ │ -336 │ │ │ │ -343 void partial(std::array order, const typename Traits:: │ │ │ │ -DomainType &in, │ │ │ │ -344 std::vector &out) const │ │ │ │ -345 { │ │ │ │ -346 out.resize(size()); │ │ │ │ -347 auto totalOrder = std::accumulate(order.begin(), order.end(), 0); │ │ │ │ -348 if (totalOrder == 0) │ │ │ │ -349 evaluateFunction(in, out); │ │ │ │ -350 else if (totalOrder == 1) │ │ │ │ -351 { │ │ │ │ -352 evaluateJacobian(in,jacobiansBuffer_); │ │ │ │ -353 std::size_t which = std::max_element(order.begin(), order.end()) - │ │ │ │ -order.begin(); │ │ │ │ -354 for (auto i : Dune::range(size())) │ │ │ │ -355 out[i] = jacobiansBuffer_[i][0][which]; │ │ │ │ -356 } │ │ │ │ -357 else if (totalOrder == 2) │ │ │ │ -358 { │ │ │ │ -359 evaluateHessian(in, hessianBuffer_); │ │ │ │ -360 std::size_t first, second; │ │ │ │ -361 first = std::max_element(order.begin(), order.end()) - order.begin(); │ │ │ │ -362 if (order[first] == 2) │ │ │ │ -363 second = first; │ │ │ │ -364 else │ │ │ │ -365 { │ │ │ │ -366 order[first] = 0; │ │ │ │ -367 second = std::max_element(order.begin(), order.end()) - order.begin(); │ │ │ │ -368 } │ │ │ │ -369 for (auto i : Dune::range(size())) │ │ │ │ -370 out[i] = hessianBuffer_[i][first][second]; │ │ │ │ -371 } │ │ │ │ -372 else │ │ │ │ -373 DUNE_THROW(RangeError, "partial() not implemented for given order"); │ │ │ │ -374 } │ │ │ │ -375 │ │ │ │ -376 private: │ │ │ │ -377 mutable std::vector jacobiansBuffer_; │ │ │ │ -378 mutable std::vector hessianBuffer_; │ │ │ │ -379 }; │ │ │ │ +306 if (dim==1) { │ │ │ │ +307 │ │ │ │ +308 setup1d(subEntity); │ │ │ │ +309 │ │ │ │ +310 } else if (dim==2 and sizes_[0]>1 and sizes_[1]>1) { │ │ │ │ +311 │ │ │ │ +312 setup2d(subEntity); │ │ │ │ +313 │ │ │ │ +314 } │ │ │ │ +315 } │ │ │ │ +316 │ │ │ │ +317 for (size_t i=0; i()); │ │ │ │ +325 } │ │ │ │ +326 │ │ │ │ +_3_2_8 const LocalKey& _l_o_c_a_l_K_e_y (std::size_t i) const │ │ │ │ +329 { │ │ │ │ +330 return li_[i]; │ │ │ │ +331 } │ │ │ │ +332 │ │ │ │ +333private: │ │ │ │ +334 │ │ │ │ +335 // Number of shape functions on this element per coordinate direction │ │ │ │ +336 std::array sizes_; │ │ │ │ +337 │ │ │ │ +338 std::vector li_; │ │ │ │ +339}; │ │ │ │ +340 │ │ │ │ +345template │ │ │ │ +_3_4_6class _B_S_p_l_i_n_e_L_o_c_a_l_I_n_t_e_r_p_o_l_a_t_i_o_n │ │ │ │ +347{ │ │ │ │ +348public: │ │ │ │ +350 template │ │ │ │ +_3_5_1 void _i_n_t_e_r_p_o_l_a_t_e (const F& f, std::vector& out) const │ │ │ │ +352 { │ │ │ │ +353 DUNE_THROW(NotImplemented, "BSplineLocalInterpolation::interpolate"); │ │ │ │ +354 } │ │ │ │ +355 │ │ │ │ +356}; │ │ │ │ +357 │ │ │ │ +367template │ │ │ │ +_3_6_8class _B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ +369{ │ │ │ │ +_3_7_0 typedef typename GV::ctype D; │ │ │ │ +371 enum {dim = GV::dimension}; │ │ │ │ +372 friend class _B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s; │ │ │ │ +373public: │ │ │ │ +374 │ │ │ │ +377 typedef LocalFiniteElementTraits, │ │ │ │ +378 _B_S_p_l_i_n_e_L_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s_<_d_i_m_>, │ │ │ │ +_3_7_9 _B_S_p_l_i_n_e_L_o_c_a_l_I_n_t_e_r_p_o_l_a_t_i_o_n_<_d_i_m_,_B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s_<_G_V_,_R_> > > _T_r_a_i_t_s; │ │ │ │ 380 │ │ │ │ -381 │ │ │ │ -387 template │ │ │ │ -388 class CubicHermiteLocalInterpolation │ │ │ │ -389 { │ │ │ │ -390 using size_type = std::size_t; │ │ │ │ -391 │ │ │ │ -392 static constexpr unsigned int size() │ │ │ │ -393 { │ │ │ │ -394 return CubicHermiteLocalCoefficients::size(); │ │ │ │ -395 } │ │ │ │ -396 │ │ │ │ -397 using FunctionalDescriptor = Dune::Functions::Impl:: │ │ │ │ -FunctionalDescriptor; │ │ │ │ -398 │ │ │ │ -399 public: │ │ │ │ -400 │ │ │ │ -401 CubicHermiteLocalInterpolation() │ │ │ │ +_3_8_3 _B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t(const _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_<_G_V_>& preBasis) │ │ │ │ +384 : _p_r_e_B_a_s_i_s__(preBasis), │ │ │ │ +385 _l_o_c_a_l_B_a_s_i_s__(preBasis,*this) │ │ │ │ +386 {} │ │ │ │ +387 │ │ │ │ +_3_9_0 _B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t(const _B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t& other) │ │ │ │ +391 : _p_r_e_B_a_s_i_s__(other._p_r_e_B_a_s_i_s__), │ │ │ │ +392 _l_o_c_a_l_B_a_s_i_s__(_p_r_e_B_a_s_i_s__,*this) │ │ │ │ +393 {} │ │ │ │ +394 │ │ │ │ +_4_0_1 void _b_i_n_d(const std::array& elementIdx) │ │ │ │ 402 { │ │ │ │ -403 static_assert((dim > 0) and (dim <= 3), "CubicHermiteLocalInterpolation │ │ │ │ -only implemented for dim=1,2,3"); │ │ │ │ -404 static_assert((not reduced) or (dim == 2), "Reduced version of │ │ │ │ -CubicHermiteLocalInterpolation only implemented for dim=2"); │ │ │ │ -405 if constexpr (dim==1) │ │ │ │ -406 { │ │ │ │ -407 descriptors_[0] = FunctionalDescriptor(); │ │ │ │ -408 descriptors_[1] = FunctionalDescriptor({1}); │ │ │ │ -409 descriptors_[2] = FunctionalDescriptor(); │ │ │ │ -410 descriptors_[3] = FunctionalDescriptor({1}); │ │ │ │ -411 } │ │ │ │ -412 if constexpr (dim==2) │ │ │ │ +403 /* \todo In the long run we need to precompute a table for this */ │ │ │ │ +404 for (size_t i=0; i sizes; │ │ │ │ +428 for (size_t i=0; i& _l_o_c_a_l_B_a_s_i_s() const │ │ │ │ +435 { │ │ │ │ +436 return _l_o_c_a_l_B_a_s_i_s__; │ │ │ │ +437 } │ │ │ │ +438 │ │ │ │ +_4_4_0 const _B_S_p_l_i_n_e_L_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s_<_d_i_m_>& _l_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s() const │ │ │ │ +441 { │ │ │ │ +442 return _l_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s__; │ │ │ │ +443 } │ │ │ │ +444 │ │ │ │ +_4_4_6 const _B_S_p_l_i_n_e_L_o_c_a_l_I_n_t_e_r_p_o_l_a_t_i_o_n_<_d_i_m_,_B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s_<_G_V_,_R_> >& │ │ │ │ +_l_o_c_a_l_I_n_t_e_r_p_o_l_a_t_i_o_n() const │ │ │ │ +447 { │ │ │ │ +448 return _l_o_c_a_l_I_n_t_e_r_p_o_l_a_t_i_o_n__; │ │ │ │ 449 } │ │ │ │ 450 │ │ │ │ -453 template │ │ │ │ -454 void bind( Element const &element, std::arrayconst& │ │ │ │ -averageVertexMeshSize) │ │ │ │ -455 { │ │ │ │ -456 averageVertexMeshSize_ = &averageVertexMeshSize; │ │ │ │ -457 } │ │ │ │ -458 │ │ │ │ -466 template │ │ │ │ -467 void interpolate(const F &f, std::vector &out) const │ │ │ │ -468 { │ │ │ │ -469 out.resize(size()); │ │ │ │ -470 auto df = _d_e_r_i_v_a_t_i_v_e(f); │ │ │ │ -471 auto const &refElement = Dune::ReferenceElements::simplex(); │ │ │ │ -472 │ │ │ │ -473 // Iterate over vertices, dim derivative +1 evaluation dofs per vertex │ │ │ │ -474 for (int i = 0; i < (dim+1); ++i) │ │ │ │ -475 { │ │ │ │ -476 auto x = refElement.position(i, dim); │ │ │ │ -477 auto&& derivativeValue = df(x); │ │ │ │ -478 out[i * (dim +1)] = f(x); │ │ │ │ -479 for (int d = 0; d < dim; ++d) │ │ │ │ -480 out[i * (dim+1) + d + 1] = squeezeTensor(derivativeValue)[d] * │ │ │ │ -(*averageVertexMeshSize_)[i]; │ │ │ │ -481 } │ │ │ │ +_4_5_2 unsigned _s_i_z_e () const │ │ │ │ +453 { │ │ │ │ +454 std::size_t r = 1; │ │ │ │ +455 for (int i=0; i (_p_r_e_B_a_s_i_s__.knotVectors_[i].size() - _c_u_r_r_e_n_t_K_n_o_t_S_p_a_n__[i] - │ │ │ │ +2) ) │ │ │ │ +477 r -= order[i] - (_p_r_e_B_a_s_i_s__.knotVectors_[i].size() - _c_u_r_r_e_n_t_K_n_o_t_S_p_a_n__[i] - │ │ │ │ +2); │ │ │ │ +478 return r; │ │ │ │ +479 } │ │ │ │ +480 │ │ │ │ +_4_8_1 const _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_<_G_V_>& _p_r_e_B_a_s_i_s__; │ │ │ │ 482 │ │ │ │ -483 if constexpr (not reduced) │ │ │ │ -484 { │ │ │ │ -485 for (size_type i = 0; i < (dim - 1) * (dim - 1); ++i) │ │ │ │ -486 out[(dim +1) * (dim +1) + i] = f(refElement.position(i, (dim == 2) ? 0 : │ │ │ │ -1)); │ │ │ │ -487 } │ │ │ │ -488 } │ │ │ │ -489 │ │ │ │ -493 const FunctionalDescriptor& functionalDescriptor(size_type i) const │ │ │ │ -494 { │ │ │ │ -495 return descriptors_[i]; │ │ │ │ -496 } │ │ │ │ -497 │ │ │ │ -498 protected: │ │ │ │ -499 std::array const* averageVertexMeshSize_; │ │ │ │ -500 std::array descriptors_; │ │ │ │ -501 }; │ │ │ │ -502 │ │ │ │ -503 template │ │ │ │ -504 struct CubicHermiteLocalBasisTraits │ │ │ │ -505 : public H2LocalBasisTraits, R, 1, │ │ │ │ -506 Dune::FieldVector, Dune::FieldMatrix, Dune:: │ │ │ │ -FieldMatrix> │ │ │ │ -507 {}; │ │ │ │ -508 │ │ │ │ -517 template │ │ │ │ -518 class CubicHermiteLocalFiniteElement │ │ │ │ -519 : public Impl:: │ │ │ │ -TransformedFiniteElementMixin, │ │ │ │ -CubicHermiteLocalBasisTraits> │ │ │ │ -520 { │ │ │ │ -521 using Base = Impl::TransformedFiniteElementMixin< │ │ │ │ -CubicHermiteLocalFiniteElement, │ │ │ │ -CubicHermiteLocalBasisTraits>; │ │ │ │ -522 friend class Impl:: │ │ │ │ -TransformedLocalBasis, │ │ │ │ -CubicHermiteLocalBasisTraits>; │ │ │ │ -523 │ │ │ │ -524 public: │ │ │ │ +_4_8_3 _B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s_<_G_V_,_R_> _l_o_c_a_l_B_a_s_i_s__; │ │ │ │ +_4_8_4 _B_S_p_l_i_n_e_L_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s_<_d_i_m_> _l_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s__; │ │ │ │ +_4_8_5 _B_S_p_l_i_n_e_L_o_c_a_l_I_n_t_e_r_p_o_l_a_t_i_o_n_<_d_i_m_,_B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s_<_G_V_,_R_> > │ │ │ │ +_l_o_c_a_l_I_n_t_e_r_p_o_l_a_t_i_o_n__; │ │ │ │ +486 │ │ │ │ +487 // The knot span we are bound to │ │ │ │ +_4_8_8 std::array _c_u_r_r_e_n_t_K_n_o_t_S_p_a_n__; │ │ │ │ +489}; │ │ │ │ +490 │ │ │ │ +491 │ │ │ │ +492template │ │ │ │ +493class _B_S_p_l_i_n_e_N_o_d_e; │ │ │ │ +494 │ │ │ │ +504template │ │ │ │ +_5_0_5class _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s : │ │ │ │ +506 public _L_e_a_f_P_r_e_B_a_s_i_s_M_i_x_i_n< BSplinePreBasis > │ │ │ │ +507{ │ │ │ │ +508 using Base = _L_e_a_f_P_r_e_B_a_s_i_s_M_i_x_i_n_<_ _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_<_G_V_> >; │ │ │ │ +509 │ │ │ │ +510 static const int dim = GV::dimension; │ │ │ │ +511 │ │ │ │ +513 class MultiDigitCounter │ │ │ │ +514 { │ │ │ │ +515 public: │ │ │ │ +516 │ │ │ │ +520 MultiDigitCounter(const std::array& limits) │ │ │ │ +521 : limits_(limits) │ │ │ │ +522 { │ │ │ │ +523 std::fill(counter_.begin(), counter_.end(), 0); │ │ │ │ +524 } │ │ │ │ 525 │ │ │ │ -526 CubicHermiteLocalFiniteElement() │ │ │ │ -527 : Base() │ │ │ │ +527 MultiDigitCounter& operator++() │ │ │ │ 528 { │ │ │ │ -529 static_assert((dim > 0) and (dim <= 3), "CubicHermiteLocalFiniteElement │ │ │ │ -only implemented for dim=1,2,3"); │ │ │ │ -530 static_assert((not reduced) or (dim == 2), "Reduced version of │ │ │ │ -CubicHermiteLocalFiniteElement only implemented for dim=2"); │ │ │ │ -531 } │ │ │ │ +529 for (int i=0; i, │ │ │ │ -CubicHermiteLocalBasisTraits>, │ │ │ │ -538 Impl::CubicHermiteLocalCoefficients, │ │ │ │ -539 Impl::CubicHermiteLocalInterpolation>; │ │ │ │ -540 │ │ │ │ -544 const typename Traits::LocalCoefficientsType &localCoefficients() const │ │ │ │ -545 { │ │ │ │ -546 return coefficients_; │ │ │ │ -547 } │ │ │ │ -548 │ │ │ │ -551 const typename Traits::LocalInterpolationType &localInterpolation() const │ │ │ │ -552 { │ │ │ │ -553 return interpolation_; │ │ │ │ -554 } │ │ │ │ -555 │ │ │ │ -558 static constexpr GeometryType type() │ │ │ │ -559 { │ │ │ │ -560 return GeometryTypes::simplex(dim); │ │ │ │ -561 } │ │ │ │ -562 │ │ │ │ -565 static constexpr size_type size() │ │ │ │ -566 { │ │ │ │ -567 return Impl::CubicHermiteLocalCoefficients::size(); │ │ │ │ -568 } │ │ │ │ -569 │ │ │ │ -572 template │ │ │ │ -573 void bind(Mapper const& vertexMapper, std::vector const& │ │ │ │ -globalAverageVertexMeshSize, Element const &e) │ │ │ │ -574 { │ │ │ │ -575 // Cache average mesh size for each vertex │ │ │ │ -576 for (auto i : range(dim+1)) │ │ │ │ -577 averageVertexMeshSize_[i] = globalAverageVertexMeshSize │ │ │ │ -[vertexMapper.subIndex(e, i, dim)]; │ │ │ │ -578 │ │ │ │ -579 // Bind LocalInterpolation to updated local state │ │ │ │ -580 interpolation_.bind(e, averageVertexMeshSize_); │ │ │ │ -581 │ │ │ │ -582 // Compute local transformation matrices for each vertex │ │ │ │ -583 const auto& geometry = e.geometry(); │ │ │ │ -584 const auto& refElement = Dune::ReferenceElements::simplex(); │ │ │ │ -585 for (auto i : range(dim+1)) │ │ │ │ -586 { │ │ │ │ -587 scaledVertexJacobians_[i] = geometry.jacobian(refElement.position(i, dim)); │ │ │ │ -588 scaledVertexJacobians_[i] /= averageVertexMeshSize_[i]; │ │ │ │ -589 } │ │ │ │ -590 } │ │ │ │ -591 │ │ │ │ -592 protected: │ │ │ │ -593 │ │ │ │ -596 Impl::CubicHermiteReferenceLocalBasis const& │ │ │ │ -referenceLocalBasis() const │ │ │ │ -597 { │ │ │ │ -598 return basis_; │ │ │ │ -599 } │ │ │ │ -600 │ │ │ │ -605 template │ │ │ │ -606 void transform(InputValues const &inValues, OutputValues &outValues) const │ │ │ │ -607 { │ │ │ │ -608 assert(inValues.size() == size()); │ │ │ │ -609 assert(outValues.size() == inValues.size()); │ │ │ │ -610 auto inIt = inValues.begin(); │ │ │ │ -611 auto outIt = outValues.begin(); │ │ │ │ -612 │ │ │ │ -613 for (auto vertex : Dune::range((dim +1))) │ │ │ │ -614 { │ │ │ │ -615 *outIt = *inIt; // value dof is not transformed │ │ │ │ -616 outIt++, inIt++; │ │ │ │ -617 // transform the gradient dofs together │ │ │ │ -618 for (auto &&[row_i, i] : sparseRange(scaledVertexJacobians_[vertex])) │ │ │ │ -619 { │ │ │ │ -620 outIt[i] = 0.; │ │ │ │ -621 for (auto &&[val_i_j, j] : sparseRange(row_i)) │ │ │ │ -622 outIt[i] += val_i_j * inIt[j]; │ │ │ │ +533 // no overflow? │ │ │ │ +534 if (counter_[i] < limits_[i]) │ │ │ │ +535 break; │ │ │ │ +536 │ │ │ │ +537 counter_[i] = 0; │ │ │ │ +538 } │ │ │ │ +539 return *this; │ │ │ │ +540 } │ │ │ │ +541 │ │ │ │ +543 const unsigned int& operator[](int i) const │ │ │ │ +544 { │ │ │ │ +545 return counter_[i]; │ │ │ │ +546 } │ │ │ │ +547 │ │ │ │ +549 unsigned int cycle() const │ │ │ │ +550 { │ │ │ │ +551 unsigned int r = 1; │ │ │ │ +552 for (int i=0; i limits_; │ │ │ │ +561 │ │ │ │ +563 std::array counter_; │ │ │ │ +564 │ │ │ │ +565 }; │ │ │ │ +566 │ │ │ │ +567public: │ │ │ │ +568 │ │ │ │ +_5_7_0 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ +_5_7_1 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ +572 │ │ │ │ +_5_7_3 using _N_o_d_e = _B_S_p_l_i_n_e_N_o_d_e_<_G_V_>; │ │ │ │ +574 │ │ │ │ +575 // Type used for function values │ │ │ │ +_5_7_6 using _R = double; │ │ │ │ +577 │ │ │ │ +_5_9_7 _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s(const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w, │ │ │ │ +598 const std::vector& knotVector, │ │ │ │ +599 unsigned int order, │ │ │ │ +600 bool makeOpen = true) │ │ │ │ +601 : _g_r_i_d_V_i_e_w__(_g_r_i_d_V_i_e_w) │ │ │ │ +602 { │ │ │ │ +603 // \todo Detection of duplicate knots │ │ │ │ +604 std::fill(_e_l_e_m_e_n_t_s__.begin(), _e_l_e_m_e_n_t_s__.end(), knotVector.size()-1); │ │ │ │ +605 │ │ │ │ +606 // Mediocre sanity check: we don't know the number of grid elements in each │ │ │ │ +direction. │ │ │ │ +607 // but at least we know the total number of elements. │ │ │ │ +608 assert( std::accumulate(_e_l_e_m_e_n_t_s__.begin(), _e_l_e_m_e_n_t_s__.end(), 1, std:: │ │ │ │ +multiplies()) == _g_r_i_d_V_i_e_w__.size(0) ); │ │ │ │ +609 │ │ │ │ +610 for (int i=0; i 1 and (not reduced)) │ │ │ │ -630 std::copy(inIt, inValues.end(), outIt); │ │ │ │ -631 } │ │ │ │ -632 │ │ │ │ -633 private: │ │ │ │ -634 │ │ │ │ -635 typename Impl::CubicHermiteReferenceLocalBasis basis_; │ │ │ │ -636 typename Traits::LocalCoefficientsType coefficients_; │ │ │ │ -637 typename Traits::LocalInterpolationType interpolation_; │ │ │ │ -638 // the transformation to correct the lack of affine equivalence boils down │ │ │ │ -to │ │ │ │ -639 // one transformation matrix per vertex │ │ │ │ -640 std::array, dim+1> scaledVertexJacobians_; │ │ │ │ -641 // the local state, i.e. a collection of global information restricted to │ │ │ │ -this element │ │ │ │ -642 std::array averageVertexMeshSize_; │ │ │ │ -643 │ │ │ │ -644 }; │ │ │ │ -645 │ │ │ │ -646 } // end namespace Impl │ │ │ │ -647 │ │ │ │ -648 │ │ │ │ -649 │ │ │ │ -650 / │ │ │ │ +_6_4_9 _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s(const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w, │ │ │ │ +650 const FieldVector& lowerLeft, │ │ │ │ +651 const FieldVector& upperRight, │ │ │ │ +652 const std::array& elements, │ │ │ │ +653 unsigned int order, │ │ │ │ +654 bool makeOpen = true) │ │ │ │ +655 : _e_l_e_m_e_n_t_s__(elements), │ │ │ │ +656 _g_r_i_d_V_i_e_w__(_g_r_i_d_V_i_e_w) │ │ │ │ +657 { │ │ │ │ +658 // Mediocre sanity check: we don't know the number of grid elements in each │ │ │ │ +direction. │ │ │ │ +659 // but at least we know the total number of elements. │ │ │ │ +660 assert( std::accumulate(_e_l_e_m_e_n_t_s__.begin(), _e_l_e_m_e_n_t_s__.end(), 1, std:: │ │ │ │ +multiplies()) == _g_r_i_d_V_i_e_w__.size(0) ); │ │ │ │ +661 │ │ │ │ +662 for (int i=0; i │ │ │ │ +_7_1_7 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ +718 { │ │ │ │ +719 // Local degrees of freedom are arranged in a lattice. │ │ │ │ +720 // We need the lattice dimensions to be able to compute lattice coordinates │ │ │ │ +from a local index │ │ │ │ +721 std::array localSizes; │ │ │ │ +722 for (int i=0; i localIJK = _g_e_t_I_J_K(i, localSizes); │ │ │ │ +727 │ │ │ │ +728 const auto currentKnotSpan = node._f_i_n_i_t_e_E_l_e_m_e_n_t()._c_u_r_r_e_n_t_K_n_o_t_S_p_a_n__; │ │ │ │ +729 const auto order = _o_r_d_e_r__; │ │ │ │ +730 │ │ │ │ +731 std::array globalIJK; │ │ │ │ +732 for (int i=0; i=0; i--) │ │ │ │ +739 globalIdx = globalIdx * _s_i_z_e(i) + globalIJK[i]; │ │ │ │ +740 │ │ │ │ +741 *it = {{globalIdx}}; │ │ │ │ +742 } │ │ │ │ +743 return it; │ │ │ │ +744 } │ │ │ │ +745 │ │ │ │ +_7_4_7 unsigned int _d_i_m_e_n_s_i_o_n () const │ │ │ │ +748 { │ │ │ │ +749 unsigned int result = 1; │ │ │ │ +750 for (size_t i=0; i& in, │ │ │ │ +766 std::vector >& out, │ │ │ │ +767 const std::array& currentKnotSpan) const │ │ │ │ +768 { │ │ │ │ +769 // Evaluate │ │ │ │ +770 std::array, dim> oneDValues; │ │ │ │ +771 │ │ │ │ +772 for (size_t i=0; i limits; │ │ │ │ +776 for (int i=0; i& in, │ │ │ │ +797 std::vector >& out, │ │ │ │ +798 const std::array& currentKnotSpan) const │ │ │ │ +799 { │ │ │ │ +800 // How many shape functions to we have in each coordinate direction? │ │ │ │ +801 std::array limits; │ │ │ │ +802 for (int i=0; i (_k_n_o_t_V_e_c_t_o_r_s__[i]._s_i_z_e() - currentKnotSpan[i] - 2) ) │ │ │ │ +808 limits[i] -= _o_r_d_e_r__[i] - (_k_n_o_t_V_e_c_t_o_r_s__[i].size() - currentKnotSpan[i] - 2); │ │ │ │ +809 } │ │ │ │ +810 │ │ │ │ +811 // The lowest knot spans that we need values from │ │ │ │ +812 std::array offset; │ │ │ │ +813 for (int i=0; i, dim> oneDValues; │ │ │ │ +818 │ │ │ │ +819 // Evaluate 1d function values of one order lower (needed for the │ │ │ │ +derivative formula) │ │ │ │ +820 std::array, dim> lowOrderOneDValues; │ │ │ │ +821 │ │ │ │ +822 std::array, dim> values; │ │ │ │ +823 │ │ │ │ +824 for (size_t i=0; i, dim> oneDDerivatives; │ │ │ │ +842 for (size_t i=0; i, dim> oneDValuesShort; │ │ │ │ +867 │ │ │ │ +868 for (int i=0; i │ │ │ │ +_8_9_7 void _e_v_a_l_u_a_t_e(const typename std::array& directions, │ │ │ │ +898 const FieldVector& in, │ │ │ │ +899 std::vector >& out, │ │ │ │ +900 const std::array& currentKnotSpan) const │ │ │ │ +901 { │ │ │ │ +902 if (k != 1 && k != 2) │ │ │ │ +903 DUNE_THROW(RangeError, "Differentiation order greater than 2 is not │ │ │ │ +supported!"); │ │ │ │ +904 │ │ │ │ +905 // Evaluate 1d function values (needed for the product rule) │ │ │ │ +906 std::array, dim> oneDValues; │ │ │ │ +907 std::array, dim> oneDDerivatives; │ │ │ │ +908 std::array, dim> oneDSecondDerivatives; │ │ │ │ +909 │ │ │ │ +910 // Evaluate 1d function derivatives │ │ │ │ +911 if (k==1) │ │ │ │ +912 for (size_t i=0; i offset; │ │ │ │ +920 for (int i=0; i limits; │ │ │ │ +925 for (int i=0; i (_k_n_o_t_V_e_c_t_o_r_s__[i]._s_i_z_e() - currentKnotSpan[i] - 2) ) │ │ │ │ +933 limits[i] -= _o_r_d_e_r__[i] - (_k_n_o_t_V_e_c_t_o_r_s__[i].size() - currentKnotSpan[i] - 2); │ │ │ │ +934 } │ │ │ │ +935 │ │ │ │ +936 // Working towards computing only the parts that we really need: │ │ │ │ +937 // Let's copy them out into a separate array │ │ │ │ +938 std::array, dim> oneDValuesShort; │ │ │ │ +939 │ │ │ │ +940 for (int i=0; i _g_e_t_I_J_K(typename GridView::IndexSet:: │ │ │ │ +IndexType idx, std::array elements) │ │ │ │ +994 { │ │ │ │ +995 std::array result; │ │ │ │ +996 for (int i=0; i& out, │ │ │ │ +1013 const std::vector& knotVector, │ │ │ │ +1014 unsigned int order, │ │ │ │ +1015 unsigned int currentKnotSpan) │ │ │ │ +1016 { │ │ │ │ +1017 std::size_t outSize = order+1; // The 'standard' value away from the │ │ │ │ +boundaries of the knot vector │ │ │ │ +1018 if (currentKnotSpan (knotVector.size() - currentKnotSpan - 2) ) │ │ │ │ +1021 outSize -= order - (knotVector.size() - currentKnotSpan - 2); │ │ │ │ +1022 out.resize(outSize); │ │ │ │ +1023 │ │ │ │ +1024 // It's not really a matrix that is needed here, a plain 2d array would do │ │ │ │ +1025 DynamicMatrix N(order+1, knotVector.size()-1); │ │ │ │ +1026 │ │ │ │ +1027 // The text books on splines use the following geometric condition here to │ │ │ │ +fill the array N │ │ │ │ +1028 // (see for example Cottrell, Hughes, Bazilevs, Formula (2.1). However, │ │ │ │ +this condition │ │ │ │ +1029 // only works if splines are never evaluated exactly on the knots. │ │ │ │ +1030 // │ │ │ │ +1031 // for (size_t i=0; i 1e-10) │ │ │ │ +1040 ? (in - knotVector[i]) / (knotVector[i+r] - knotVector[i]) │ │ │ │ +1041 : 0; │ │ │ │ +1042 _R factor2 = ((knotVector[i+r+1] - knotVector[i+1]) > 1e-10) │ │ │ │ +1043 ? (knotVector[i+r+1] - in) / (knotVector[i+r+1] - knotVector[i+1]) │ │ │ │ +1044 : 0; │ │ │ │ +1045 N[r][i] = factor1 * N[r-1][i] + factor2 * N[r-1][i+1]; │ │ │ │ +1046 } │ │ │ │ +1047 │ │ │ │ +1052 for (size_t i=0; i& out, │ │ │ │ +1071 const std::vector& knotVector, │ │ │ │ +1072 unsigned int order, │ │ │ │ +1073 unsigned int currentKnotSpan) │ │ │ │ +1074 { │ │ │ │ +1075 // It's not really a matrix that is needed here, a plain 2d array would do │ │ │ │ +1076 DynamicMatrix& N = out; │ │ │ │ +1077 │ │ │ │ +1078 N.resize(order+1, knotVector.size()-1); │ │ │ │ +1079 │ │ │ │ +1080 // The text books on splines use the following geometric condition here to │ │ │ │ +fill the array N │ │ │ │ +1081 // (see for example Cottrell, Hughes, Bazilevs, Formula (2.1). However, │ │ │ │ +this condition │ │ │ │ +1082 // only works if splines are never evaluated exactly on the knots. │ │ │ │ +1083 // │ │ │ │ +1084 // for (size_t i=0; i 1e-10) │ │ │ │ +1093 ? (in - knotVector[i]) / (knotVector[i+r] - knotVector[i]) │ │ │ │ +1094 : 0; │ │ │ │ +1095 _R factor2 = ((knotVector[i+r+1] - knotVector[i+1]) > 1e-10) │ │ │ │ +1096 ? (knotVector[i+r+1] - in) / (knotVector[i+r+1] - knotVector[i+1]) │ │ │ │ +1097 : 0; │ │ │ │ +1098 N[r][i] = factor1 * N[r-1][i] + factor2 * N[r-1][i+1]; │ │ │ │ +1099 } │ │ │ │ +1100 } │ │ │ │ +1101 │ │ │ │ +1102 │ │ │ │ +1110 │ │ │ │ +_1_1_1_1 static void _e_v_a_l_u_a_t_e_A_l_l(const typename GV::ctype& in, │ │ │ │ +1112 std::vector& out, │ │ │ │ +1113 bool _e_v_a_l_u_a_t_e_J_a_c_o_b_i_a_n, std::vector& outJac, │ │ │ │ +1114 bool evaluateHessian, std::vector& outHess, │ │ │ │ +1115 const std::vector& knotVector, │ │ │ │ +1116 unsigned int order, │ │ │ │ +1117 unsigned int currentKnotSpan) │ │ │ │ +1118 { │ │ │ │ +1119 // How many shape functions to we have in each coordinate direction? │ │ │ │ +1120 unsigned int limit; │ │ │ │ +1121 limit = order+1; // The 'standard' value away from the boundaries of the │ │ │ │ +knot vector │ │ │ │ +1122 if (currentKnotSpan (knotVector.size() - currentKnotSpan - 2) ) │ │ │ │ +1125 limit -= order - (knotVector.size() - currentKnotSpan - 2); │ │ │ │ +1126 │ │ │ │ +1127 // The lowest knot spans that we need values from │ │ │ │ +1128 unsigned int offset; │ │ │ │ +1129 offset = std::max((int)(currentKnotSpan - order),0); │ │ │ │ +1130 │ │ │ │ +1131 // Evaluate 1d function values (needed for the product rule) │ │ │ │ +1132 DynamicMatrix values; │ │ │ │ +1133 │ │ │ │ +1134 _e_v_a_l_u_a_t_e_F_u_n_c_t_i_o_n_F_u_l_l(in, values, knotVector, order, currentKnotSpan); │ │ │ │ +1135 │ │ │ │ +1136 out.resize(knotVector.size()-order-1); │ │ │ │ +1137 for (size_t j=0; j lowOrderOneDValues; │ │ │ │ +1142 │ │ │ │ +1143 if (order!=0) │ │ │ │ +1144 { │ │ │ │ +1145 lowOrderOneDValues.resize(knotVector.size()-(order-1)-1); │ │ │ │ +1146 for (size_t j=0; j lowOrderTwoDValues; │ │ │ │ +1152 │ │ │ │ +1153 if (order>1 && evaluateHessian) │ │ │ │ +1154 { │ │ │ │ +1155 lowOrderTwoDValues.resize(knotVector.size()-(order-2)-1); │ │ │ │ +1156 for (size_t j=0; j _o_r_d_e_r__; │ │ │ │ +1218 │ │ │ │ +_1_2_2_0 std::array, dim> _k_n_o_t_V_e_c_t_o_r_s__; │ │ │ │ +1221 │ │ │ │ +_1_2_2_3 std::array _e_l_e_m_e_n_t_s__; │ │ │ │ +1224 │ │ │ │ +_1_2_2_5 _G_r_i_d_V_i_e_w _g_r_i_d_V_i_e_w__; │ │ │ │ +1226}; │ │ │ │ +1227 │ │ │ │ +1228 │ │ │ │ +1229 │ │ │ │ +1230template │ │ │ │ +_1_2_3_1class _B_S_p_l_i_n_e_N_o_d_e : │ │ │ │ +1232 public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ +1233{ │ │ │ │ +1234 static const int dim = GV::dimension; │ │ │ │ +1235 │ │ │ │ +1236public: │ │ │ │ +1237 │ │ │ │ +_1_2_3_8 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ +_1_2_3_9 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ +_1_2_4_0 using _F_i_n_i_t_e_E_l_e_m_e_n_t = _B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_G_V_,_d_o_u_b_l_e_>; │ │ │ │ +1241 │ │ │ │ +_1_2_4_2 _B_S_p_l_i_n_e_N_o_d_e(const _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_<_G_V_>* preBasis) : │ │ │ │ +1243 _p_r_e_B_a_s_i_s__(preBasis), │ │ │ │ +1244 _f_i_n_i_t_e_E_l_e_m_e_n_t__(*preBasis) │ │ │ │ +1245 {} │ │ │ │ +1246 │ │ │ │ +_1_2_4_8 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ +1249 { │ │ │ │ +1250 return _e_l_e_m_e_n_t__; │ │ │ │ +1251 } │ │ │ │ +1252 │ │ │ │ +_1_2_5_7 const _F_i_n_i_t_e_E_l_e_m_e_n_t& _f_i_n_i_t_e_E_l_e_m_e_n_t() const │ │ │ │ +1258 { │ │ │ │ +1259 return _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ +1260 } │ │ │ │ +1261 │ │ │ │ +_1_2_6_3 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ +1264 { │ │ │ │ +1265 _e_l_e_m_e_n_t__ = e; │ │ │ │ +1266 auto elementIndex = _p_r_e_B_a_s_i_s__->gridView().indexSet().index(e); │ │ │ │ +1267 _f_i_n_i_t_e_E_l_e_m_e_n_t__.bind(_p_r_e_B_a_s_i_s__->getIJK(elementIndex,_p_r_e_B_a_s_i_s__->elements_)); │ │ │ │ +1268 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__.size()); │ │ │ │ +1269 } │ │ │ │ +1270 │ │ │ │ +1271protected: │ │ │ │ +1272 │ │ │ │ +_1_2_7_3 const _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_<_G_V_>* _p_r_e_B_a_s_i_s__; │ │ │ │ +1274 │ │ │ │ +_1_2_7_5 _F_i_n_i_t_e_E_l_e_m_e_n_t _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ +_1_2_7_6 _E_l_e_m_e_n_t _e_l_e_m_e_n_t__; │ │ │ │ +1277}; │ │ │ │ +1278 │ │ │ │ +1279 │ │ │ │ +1280 │ │ │ │ +1281namespace _B_a_s_i_s_F_a_c_t_o_r_y { │ │ │ │ +1282 │ │ │ │ +_1_2_8_9inline auto _b_S_p_l_i_n_e(const std::vector& knotVector, │ │ │ │ +1290 unsigned int order, │ │ │ │ +1291 bool makeOpen = true) │ │ │ │ +1292{ │ │ │ │ +1293 return [&knotVector, order, makeOpen](const auto& gridView) { │ │ │ │ +1294 return _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s>(gridView, │ │ │ │ +knotVector, order, makeOpen); │ │ │ │ +1295 }; │ │ │ │ +1296} │ │ │ │ +1297 │ │ │ │ +1298} // end namespace BasisFactory │ │ │ │ +1299 │ │ │ │ +1300/ │ │ │ │ / ***************************************************************************** │ │ │ │ -651 // This is the reusable part of the basis. It contains │ │ │ │ -652 // │ │ │ │ -653 // CubicHermitePreBasis │ │ │ │ -654 // CubicHermiteNode │ │ │ │ -655 // │ │ │ │ -656 // The pre-basis allows to create the others and is the owner of possible │ │ │ │ -shared │ │ │ │ -657 // state. These components do _not_ depend on the global basis and local │ │ │ │ -view │ │ │ │ -658 // and can be used without a global basis. │ │ │ │ -659 / │ │ │ │ +1301// This is the actual global basis implementation based on the reusable │ │ │ │ +parts. │ │ │ │ +1302/ │ │ │ │ / ***************************************************************************** │ │ │ │ -660 │ │ │ │ -661 template │ │ │ │ -_6_6_2 class _C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e │ │ │ │ -663 : public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ -664 { │ │ │ │ -665 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper; │ │ │ │ -666 │ │ │ │ -667 public: │ │ │ │ -_6_6_8 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ -_6_6_9 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ -_6_7_0 using _F_i_n_i_t_e_E_l_e_m_e_n_t = typename Impl:: │ │ │ │ -CubicHermiteLocalFiniteElement; │ │ │ │ -671 │ │ │ │ -_6_7_2 _C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e(Mapper const& m, std::vector const& │ │ │ │ -averageVertexMeshSize) │ │ │ │ -673 : _e_l_e_m_e_n_t__(nullptr) │ │ │ │ -674 , _v_e_r_t_e_x_M_a_p_p_e_r__(&m) │ │ │ │ -675 , _a_v_e_r_a_g_e_V_e_r_t_e_x_M_e_s_h_S_i_z_e__(&averageVertexMeshSize) │ │ │ │ -676 {} │ │ │ │ -677 │ │ │ │ -_6_7_9 _E_l_e_m_e_n_t const &_e_l_e_m_e_n_t() const │ │ │ │ -680 { │ │ │ │ -681 return *_e_l_e_m_e_n_t__; │ │ │ │ -682 } │ │ │ │ -683 │ │ │ │ -_6_8_9 _F_i_n_i_t_e_E_l_e_m_e_n_t const &_f_i_n_i_t_e_E_l_e_m_e_n_t() const │ │ │ │ -690 { │ │ │ │ -691 return _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ -692 } │ │ │ │ -693 │ │ │ │ -_6_9_5 void _b_i_n_d(_E_l_e_m_e_n_t const &e) │ │ │ │ -696 { │ │ │ │ -697 _e_l_e_m_e_n_t__ = &e; │ │ │ │ -698 _f_i_n_i_t_e_E_l_e_m_e_n_t__.bind(*_v_e_r_t_e_x_M_a_p_p_e_r__, *_a_v_e_r_a_g_e_V_e_r_t_e_x_M_e_s_h_S_i_z_e__, *_e_l_e_m_e_n_t__); │ │ │ │ -699 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__.size()); │ │ │ │ -700 } │ │ │ │ -701 │ │ │ │ -_7_0_3 unsigned int _o_r_d_e_r() const { return _f_i_n_i_t_e_E_l_e_m_e_n_t__.localBasis().order(); } │ │ │ │ -704 │ │ │ │ -705 protected: │ │ │ │ -_7_0_6 _F_i_n_i_t_e_E_l_e_m_e_n_t _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ -_7_0_7 _E_l_e_m_e_n_t const* _e_l_e_m_e_n_t__; │ │ │ │ -_7_0_8 Mapper const* _v_e_r_t_e_x_M_a_p_p_e_r__; │ │ │ │ -_7_0_9 std::vector const* _a_v_e_r_a_g_e_V_e_r_t_e_x_M_e_s_h_S_i_z_e__; │ │ │ │ -710 }; │ │ │ │ -711 │ │ │ │ -712 │ │ │ │ -722 template │ │ │ │ -_7_2_3 class _C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s │ │ │ │ -724 : public _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n │ │ │ │ -725 { │ │ │ │ -726 using Base = _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_<_G_V_>; │ │ │ │ -727 using SubEntityMapper = Dune::MultipleCodimMultipleGeomTypeMapper; │ │ │ │ -728 using Element = typename GV::template Codim<0>::Entity; │ │ │ │ -729 using D = typename GV::ctype; │ │ │ │ -730 static const std::size_t dim = GV::dimension; │ │ │ │ -731 │ │ │ │ -732 // helper methods to assign each subentity the number of dofs. Used by the │ │ │ │ -LeafPreBasisMapperMixin. │ │ │ │ -733 static constexpr auto cubicHermiteMapperLayout(Dune::GeometryType type, int │ │ │ │ -gridDim) │ │ │ │ -734 { │ │ │ │ -735 if (type.isVertex()) │ │ │ │ -736 return 1 + gridDim; // one evaluation dof and gridDim derivative dofs per │ │ │ │ -vertex │ │ │ │ -737 if (gridDim == 1) // in 1d there are no other dofs │ │ │ │ -738 return 0; │ │ │ │ -739 // in 2d we have one inner dof (i.e. on the triangle) or non for the │ │ │ │ -reduced case │ │ │ │ -740 // and in 3d we have one dof on each face (i.e. on each triangle) │ │ │ │ -741 if ((type.isTriangle()) and (not reduced)) │ │ │ │ -742 return 1; │ │ │ │ -743 else │ │ │ │ -744 return 0; // this case is only entered for the interior of the 3d element. │ │ │ │ -There are no dofs. │ │ │ │ -745 } │ │ │ │ -746 │ │ │ │ -747 public: │ │ │ │ -_7_4_9 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ -750 │ │ │ │ -_7_5_2 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ -753 │ │ │ │ -_7_5_5 using _N_o_d_e = _C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e_<_G_r_i_d_V_i_e_w_,_ _R_,_r_e_d_u_c_e_d_>; │ │ │ │ -756 │ │ │ │ -757 public: │ │ │ │ -758 │ │ │ │ -_7_6_0 _C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s(const GV &gv) │ │ │ │ -761 : Base(gv, cubicHermiteMapperLayout) │ │ │ │ -762 , _v_e_r_t_e_x_M_a_p_p_e_r__({gv, mcmgVertexLayout()}) │ │ │ │ -763 { │ │ │ │ -764 static_assert((dim > 0) and (dim <= 3), "CubicHermitePreBasis only │ │ │ │ -implemented for dim=1,2,3"); │ │ │ │ -765 static_assert((not reduced) or (dim == 2), "Reduced version of │ │ │ │ -CubicHermitePreBasis only implemented for dim=2"); │ │ │ │ -766 _a_v_e_r_a_g_e_V_e_r_t_e_x_M_e_s_h_S_i_z_e__ = Impl::computeAverageSubEntityMeshSize │ │ │ │ -(_v_e_r_t_e_x_M_a_p_p_e_r__); │ │ │ │ -767 } │ │ │ │ -768 │ │ │ │ -_7_7_0 void _u_p_d_a_t_e(_G_r_i_d_V_i_e_w const &gv) │ │ │ │ -771 { │ │ │ │ -772 _B_a_s_e_:_:_u_p_d_a_t_e(gv); │ │ │ │ -773 _v_e_r_t_e_x_M_a_p_p_e_r__.update(this->_g_r_i_d_V_i_e_w()); │ │ │ │ -774 _a_v_e_r_a_g_e_V_e_r_t_e_x_M_e_s_h_S_i_z_e__ = Impl::computeAverageSubEntityMeshSize │ │ │ │ -(_v_e_r_t_e_x_M_a_p_p_e_r__); │ │ │ │ -775 } │ │ │ │ -776 │ │ │ │ -_7_8_0 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ -781 { │ │ │ │ -782 return _N_o_d_e{_v_e_r_t_e_x_M_a_p_p_e_r__, _a_v_e_r_a_g_e_V_e_r_t_e_x_M_e_s_h_S_i_z_e__}; │ │ │ │ -783 } │ │ │ │ -784 │ │ │ │ -785 protected: │ │ │ │ -786 │ │ │ │ -_7_8_7 SubEntityMapper _v_e_r_t_e_x_M_a_p_p_e_r__; │ │ │ │ -_7_8_8 std::vector _a_v_e_r_a_g_e_V_e_r_t_e_x_M_e_s_h_S_i_z_e__; │ │ │ │ -789 │ │ │ │ -790 }; // class CubicHermitePreBasis │ │ │ │ -791 │ │ │ │ -792 namespace _B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -793 { │ │ │ │ -794 │ │ │ │ -802 template │ │ │ │ -803 auto cubicHermite() │ │ │ │ -804 { │ │ │ │ -805 return [=](auto const &gridView) { │ │ │ │ -806 return _C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s, R>(gridView); │ │ │ │ -807 }; │ │ │ │ -808 } │ │ │ │ -809 │ │ │ │ -817 template │ │ │ │ -818 auto reducedCubicHermite() │ │ │ │ -819 { │ │ │ │ -820 return [=](auto const &gridView) { │ │ │ │ -821 return CubicHermitePreBasis, R, true> │ │ │ │ -(gridView); │ │ │ │ -822 }; │ │ │ │ -823 } │ │ │ │ -824 │ │ │ │ -825 } // end namespace BasisFactory │ │ │ │ -826 │ │ │ │ -827 │ │ │ │ -828} // end namespace Dune::Functions │ │ │ │ -829 │ │ │ │ -830#endif │ │ │ │ -_t_r_a_n_s_f_o_r_m_e_d_f_i_n_i_t_e_e_l_e_m_e_n_t_m_i_x_i_n_._h_h │ │ │ │ +1303 │ │ │ │ +1310template │ │ │ │ +_1_3_1_1using _B_S_p_l_i_n_e_B_a_s_i_s = _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_<_G_V_> >; │ │ │ │ +1312 │ │ │ │ +1313 │ │ │ │ +1314} // namespace Functions │ │ │ │ +1315 │ │ │ │ +1316} // namespace Dune │ │ │ │ +1317 │ │ │ │ +1318#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BSPLINEBASIS_HH │ │ │ │ _n_o_d_e_s_._h_h │ │ │ │ -_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h │ │ │ │ -_f_u_n_c_t_i_o_n_a_l_d_e_s_c_r_i_p_t_o_r_._h_h │ │ │ │ _d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ -_s_q_u_e_e_z_e_t_e_n_s_o_r_._h_h │ │ │ │ -_m_a_p_p_e_r_u_t_i_l_i_t_i_e_s_._h_h │ │ │ │ -_m_o_n_o_m_i_a_l_s_e_t_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ -TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const │ │ │ │ -TrigonometricFunction< K, sinFactor, cosFactor > &f) │ │ │ │ -Obtain derivative of TrigonometricFunction function. │ │ │ │ -DDeeffiinniittiioonn trigonometricfunction.hh:43 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_B_a_s_i_s │ │ │ │ -DefaultGlobalBasis< CubicHermitePreBasis< GV, R, reduced > > CubicHermiteBasis │ │ │ │ -Nodal basis of a scalar cubic Hermite finite element space. │ │ │ │ -DDeeffiinniittiioonn cubichermitebasis.hh:79 │ │ │ │ +_l_e_a_f_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_b_S_p_l_i_n_e │ │ │ │ +auto bSpline(const std::vector< double > &knotVector, unsigned int order, bool │ │ │ │ +makeOpen=true) │ │ │ │ +Create a pre-basis factory that can create a B-spline pre-basis. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:1289 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_B_a_s_i_s │ │ │ │ +DefaultGlobalBasis< BSplinePreBasis< GV > > BSplineBasis │ │ │ │ +A global B-spline basis. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:1311 │ │ │ │ +_D_u_n_e │ │ │ │ +DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ DDeeffiinniittiioonn argyrisbasis.hh:926 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s │ │ │ │ -A pre-basis for a Hermitebasis. │ │ │ │ -DDeeffiinniittiioonn cubichermitebasis.hh:725 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s_:_:_a_v_e_r_a_g_e_V_e_r_t_e_x_M_e_s_h_S_i_z_e__ │ │ │ │ -std::vector< D > averageVertexMeshSize_ │ │ │ │ -DDeeffiinniittiioonn cubichermitebasis.hh:788 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s_:_:_m_a_k_e_N_o_d_e │ │ │ │ -Node makeNode() const │ │ │ │ -Create tree node. │ │ │ │ -DDeeffiinniittiioonn cubichermitebasis.hh:780 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s_:_:_N_o_d_e │ │ │ │ -CubicHermiteNode< GridView, R, reduced > Node │ │ │ │ -Template mapping root tree path to type of created tree node. │ │ │ │ -DDeeffiinniittiioonn cubichermitebasis.hh:755 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ +LocalFiniteElement in the sense of dune-localfunctions, for the B-spline basis │ │ │ │ +on tensor-product grid... │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:369 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ +BSplineLocalFiniteElement(const BSplineLocalFiniteElement &other) │ │ │ │ +Copy constructor. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:390 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_ _G_V_,_ _d_o_u_b_l_e_ _>_:_:_p_r_e_B_a_s_i_s__ │ │ │ │ +const BSplinePreBasis< GV > & preBasis_ │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:481 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_:_:_l_o_c_a_l_I_n_t_e_r_p_o_l_a_t_i_o_n │ │ │ │ +const BSplineLocalInterpolation< dim, BSplineLocalBasis< GV, R > > & │ │ │ │ +localInterpolation() const │ │ │ │ +Hand out a LocalInterpolation object. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:446 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_:_:_T_r_a_i_t_s │ │ │ │ +LocalFiniteElementTraits< BSplineLocalBasis< GV, R >, BSplineLocalCoefficients< │ │ │ │ +dim >, BSplineLocalInterpolation< dim, BSplineLocalBasis< GV, R > > > Traits │ │ │ │ +Export various types related to this LocalFiniteElement. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:379 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_ _G_V_,_ _d_o_u_b_l_e_ _>_:_:_c_u_r_r_e_n_t_K_n_o_t_S_p_a_n__ │ │ │ │ +std::array< unsigned, dim > currentKnotSpan_ │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:488 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ +BSplineLocalFiniteElement(const BSplinePreBasis< GV > &preBasis) │ │ │ │ +Constructor with a given B-spline basis. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:383 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_:_:_l_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s │ │ │ │ +const BSplineLocalCoefficients< dim > & localCoefficients() const │ │ │ │ +Hand out a LocalCoefficients object. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:440 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_:_:_b_i_n_d │ │ │ │ +void bind(const std::array< unsigned, dim > &elementIdx) │ │ │ │ +Bind LocalFiniteElement to a specific knot span of the spline patch. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:401 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_ _G_V_,_ _d_o_u_b_l_e_ _>_:_:_l_o_c_a_l_I_n_t_e_r_p_o_l_a_t_i_o_n__ │ │ │ │ +BSplineLocalInterpolation< dim, BSplineLocalBasis< GV, double > > │ │ │ │ +localInterpolation_ │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:485 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_:_:_t_y_p_e │ │ │ │ +GeometryType type() const │ │ │ │ +Return the reference element that the local finite element is defined on (here, │ │ │ │ +a hypercube). │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:462 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_:_:_s_i_z_e │ │ │ │ +unsigned size() const │ │ │ │ +Number of shape functions in this finite element. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:452 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_ _G_V_,_ _d_o_u_b_l_e_ _>_:_:_l_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s__ │ │ │ │ +BSplineLocalCoefficients< dim > localCoefficients_ │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:484 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_:_:_s_i_z_e │ │ │ │ +unsigned int size(int i) const │ │ │ │ +Number of degrees of freedom for one coordinate direction. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:470 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_ _G_V_,_ _d_o_u_b_l_e_ _>_:_:_l_o_c_a_l_B_a_s_i_s__ │ │ │ │ +BSplineLocalBasis< GV, double > localBasis_ │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:483 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_:_:_l_o_c_a_l_B_a_s_i_s │ │ │ │ +const BSplineLocalBasis< GV, R > & localBasis() const │ │ │ │ +Hand out a LocalBasis object. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:434 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s │ │ │ │ +Pre-basis for B-spline basis. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:507 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_e_l_e_m_e_n_t_s__ │ │ │ │ +std::array< unsigned, dim > elements_ │ │ │ │ +Number of grid elements in the different coordinate directions. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:1223 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_g_r_i_d_V_i_e_w__ │ │ │ │ +GridView gridView_ │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:1225 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_R │ │ │ │ +double R │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:576 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_e_v_a_l_u_a_t_e_F_u_n_c_t_i_o_n_F_u_l_l │ │ │ │ +static void evaluateFunctionFull(const typename GV::ctype &in, DynamicMatrix< R │ │ │ │ +> &out, const std::vector< R > &knotVector, unsigned int order, unsigned int │ │ │ │ +currentKnotSpan) │ │ │ │ +Evaluate all one-dimensional B-spline functions for a given coordinate │ │ │ │ +direction. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:1069 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_e_v_a_l_u_a_t_e_F_u_n_c_t_i_o_n │ │ │ │ +void evaluateFunction(const FieldVector< typename GV::ctype, dim > &in, std:: │ │ │ │ +vector< FieldVector< R, 1 > > &out, const std::array< unsigned, dim > │ │ │ │ +¤tKnotSpan) const │ │ │ │ +Evaluate all B-spline basis functions at a given point. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:765 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_o_r_d_e_r__ │ │ │ │ +std::array< unsigned int, dim > order_ │ │ │ │ +Order of the B-spline for each space dimension. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:1217 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_e_v_a_l_u_a_t_e_A_l_l │ │ │ │ +static void evaluateAll(const typename GV::ctype &in, std::vector< R > &out, │ │ │ │ +bool evaluateJacobian, std::vector< R > &outJac, bool evaluateHessian, std:: │ │ │ │ +vector< R > &outHess, const std::vector< R > &knotVector, unsigned int order, │ │ │ │ +unsigned int currentKnotSpan) │ │ │ │ +Evaluate the second derivatives of all one-dimensional B-spline functions for a │ │ │ │ +given coordinate dire... │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:1111 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_e_v_a_l_u_a_t_e_F_u_n_c_t_i_o_n │ │ │ │ +static void evaluateFunction(const typename GV::ctype &in, std::vector< R > │ │ │ │ +&out, const std::vector< R > &knotVector, unsigned int order, unsigned int │ │ │ │ +currentKnotSpan) │ │ │ │ +Evaluate all one-dimensional B-spline functions for a given coordinate │ │ │ │ +direction. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:1012 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ +unsigned int size(size_t d) const │ │ │ │ +Number of shape functions in one direction. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:756 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ GV GridView │ │ │ │ -The grid view that the FE basis is defined on. │ │ │ │ -DDeeffiinniittiioonn cubichermitebasis.hh:749 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s_:_:_s_i_z_e___t_y_p_e │ │ │ │ +The grid view that the FE space is defined on. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:570 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_i_n_d_i_c_e_s │ │ │ │ +It indices(const Node &node, It it) const │ │ │ │ +Maps from subtree index set [0..size-1] to a globally unique multi index in │ │ │ │ +global basis. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:717 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_e_v_a_l_u_a_t_e │ │ │ │ +void evaluate(const typename std::array< int, k > &directions, const │ │ │ │ +FieldVector< typename GV::ctype, dim > &in, std::vector< FieldVector< R, 1 > > │ │ │ │ +&out, const std::array< unsigned, dim > ¤tKnotSpan) const │ │ │ │ +Evaluate Derivatives of all B-spline basis functions. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:897 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_s_i_z_e___t_y_p_e │ │ │ │ std::size_t size_type │ │ │ │ -Type used for indices and size information. │ │ │ │ -DDeeffiinniittiioonn cubichermitebasis.hh:752 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s_:_:_v_e_r_t_e_x_M_a_p_p_e_r__ │ │ │ │ -SubEntityMapper vertexMapper_ │ │ │ │ -DDeeffiinniittiioonn cubichermitebasis.hh:787 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s_:_:_u_p_d_a_t_e │ │ │ │ -void update(GridView const &gv) │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:571 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_u_p_d_a_t_e │ │ │ │ +void update(const GridView &gv) │ │ │ │ Update the stored grid view, to be called if the grid has changed. │ │ │ │ -DDeeffiinniittiioonn cubichermitebasis.hh:770 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s │ │ │ │ -CubicHermitePreBasis(const GV &gv) │ │ │ │ -Constructor for a given grid view object. │ │ │ │ -DDeeffiinniittiioonn cubichermitebasis.hh:760 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_2_L_o_c_a_l_B_a_s_i_s_T_r_a_i_t_s │ │ │ │ -DDeeffiinniittiioonn cubichermitebasis.hh:84 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_2_L_o_c_a_l_B_a_s_i_s_T_r_a_i_t_s_<_ _D_,_ _d_i_m_,_ _F_i_e_l_d_V_e_c_t_o_r_<_ _D_,_ _d_i_m_ _>_,_ _R_,_ _1_, │ │ │ │ -_F_i_e_l_d_V_e_c_t_o_r_<_ _R_,_ _1_ _>_,_ _F_i_e_l_d_M_a_t_r_i_x_<_ _R_,_ _1_,_ _d_i_m_ _>_,_ _F_i_e_l_d_M_a_t_r_i_x_<_ _R_,_ _d_i_m_,_ _d_i_m_ _>_ _>_:_: │ │ │ │ -_H_e_s_s_i_a_n_T_y_p_e │ │ │ │ -FieldMatrix< R, dim, dim > HessianType │ │ │ │ -DDeeffiinniittiioonn cubichermitebasis.hh:90 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e │ │ │ │ -DDeeffiinniittiioonn cubichermitebasis.hh:664 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -DDeeffiinniittiioonn cubichermitebasis.hh:668 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e_:_:_F_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ -typename Impl::CubicHermiteLocalFiniteElement< typename GV::ctype, R, GV:: │ │ │ │ -dimension, reduced > FiniteElement │ │ │ │ -DDeeffiinniittiioonn cubichermitebasis.hh:670 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e_<_ _G_r_i_d_V_i_e_w_,_ _R_,_ _r_e_d_u_c_e_d_ _>_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t__ │ │ │ │ -FiniteElement finiteElement_ │ │ │ │ -DDeeffiinniittiioonn cubichermitebasis.hh:706 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ -FiniteElement const & finiteElement() const │ │ │ │ -Return the LocalFiniteElement for the element we are bound to. │ │ │ │ -DDeeffiinniittiioonn cubichermitebasis.hh:689 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e_:_:_e_l_e_m_e_n_t │ │ │ │ -Element const & element() const │ │ │ │ -Return current element, throw if unbound. │ │ │ │ -DDeeffiinniittiioonn cubichermitebasis.hh:679 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e_<_ _G_r_i_d_V_i_e_w_,_ _R_,_ _r_e_d_u_c_e_d_ _>_:_:_e_l_e_m_e_n_t__ │ │ │ │ -Element const * element_ │ │ │ │ -DDeeffiinniittiioonn cubichermitebasis.hh:707 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e_:_:_b_i_n_d │ │ │ │ -void bind(Element const &e) │ │ │ │ -Bind to element. │ │ │ │ -DDeeffiinniittiioonn cubichermitebasis.hh:695 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e_:_:_o_r_d_e_r │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:693 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ +unsigned int dimension() const │ │ │ │ +Total number of B-spline basis functions. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:747 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ +void initializeIndices() │ │ │ │ +Initialize the global indices. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:683 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_N_o_d_e │ │ │ │ +BSplineNode< GV > Node │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:573 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_g_r_i_d_V_i_e_w │ │ │ │ +const GridView & gridView() const │ │ │ │ +Obtain the grid view that the basis is defined on. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:687 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_g_e_t_I_J_K │ │ │ │ +static std::array< unsigned int, dim > getIJK(typename GridView::IndexSet:: │ │ │ │ +IndexType idx, std::array< unsigned int, dim > elements) │ │ │ │ +Compute integer element coordinates from the element index. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:993 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_m_a_k_e_N_o_d_e │ │ │ │ +Node makeNode() const │ │ │ │ +Create tree node. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:701 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s │ │ │ │ +BSplinePreBasis(const GridView &gridView, const std::vector< double > │ │ │ │ +&knotVector, unsigned int order, bool makeOpen=true) │ │ │ │ +Construct a B-spline basis for a given grid view and set of knot vectors. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:597 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_e_v_a_l_u_a_t_e_J_a_c_o_b_i_a_n │ │ │ │ +void evaluateJacobian(const FieldVector< typename GV::ctype, dim > &in, std:: │ │ │ │ +vector< FieldMatrix< R, 1, dim > > &out, const std::array< unsigned, dim > │ │ │ │ +¤tKnotSpan) const │ │ │ │ +Evaluate Jacobian of all B-spline basis functions. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:796 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_k_n_o_t_V_e_c_t_o_r_s__ │ │ │ │ +std::array< std::vector< double >, dim > knotVectors_ │ │ │ │ +The knot vectors, one for each space dimension. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:1220 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ +size_type size() const │ │ │ │ +Get the total dimension of the space spanned by this basis. │ │ │ │ +DDeeffiinniittiioonn leafprebasismixin.hh:60 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_m_a_x_N_o_d_e_S_i_z_e │ │ │ │ +size_type maxNodeSize() const │ │ │ │ +Get the maximal number of DOFs associated to node for any element. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:707 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s │ │ │ │ +BSplinePreBasis(const GridView &gridView, const FieldVector< double, dim > │ │ │ │ +&lowerLeft, const FieldVector< double, dim > &upperRight, const std::array< │ │ │ │ +unsigned int, dim > &elements, unsigned int order, bool makeOpen=true) │ │ │ │ +Construct a B-spline basis for a given grid view with uniform knot vectors. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:649 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s │ │ │ │ +LocalBasis class in the sense of dune-localfunctions, presenting the │ │ │ │ +restriction of a B-spline patch ... │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:51 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s_:_:_T_r_a_i_t_s │ │ │ │ +LocalBasisTraits< D, dim, FieldVector< D, dim >, R, 1, FieldVector< R, 1 >, │ │ │ │ +FieldMatrix< R, 1, dim > > Traits │ │ │ │ +export type traits for function signature │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:60 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s_:_:_o_r_d_e_r │ │ │ │ unsigned int order() const │ │ │ │ -The order of the local basis. │ │ │ │ -DDeeffiinniittiioonn cubichermitebasis.hh:703 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e_:_:_E_l_e_m_e_n_t │ │ │ │ +Polynomial order of the shape functions. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:147 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ +std::size_t size() const │ │ │ │ +Return the number of basis functions on the current knot span. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:154 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s_:_:_e_v_a_l_u_a_t_e │ │ │ │ +void evaluate(const typename std::array< int, k > &directions, const typename │ │ │ │ +Traits::DomainType &in, std::vector< typename Traits::RangeType > &out) const │ │ │ │ +Evaluate all shape functions and derivatives of any order. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:104 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s_:_:_e_v_a_l_u_a_t_e_F_u_n_c_t_i_o_n │ │ │ │ +void evaluateFunction(const FieldVector< D, dim > &in, std::vector< │ │ │ │ +FieldVector< R, 1 > > &out) const │ │ │ │ +Evaluate all shape functions. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:76 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s_:_:_e_v_a_l_u_a_t_e_J_a_c_o_b_i_a_n │ │ │ │ +void evaluateJacobian(const FieldVector< D, dim > &in, std::vector< │ │ │ │ +FieldMatrix< D, 1, dim > > &out) const │ │ │ │ +Evaluate Jacobian of all shape functions. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:89 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s │ │ │ │ +BSplineLocalBasis(const BSplinePreBasis< GV > &preBasis, const │ │ │ │ +BSplineLocalFiniteElement< GV, R > &lFE) │ │ │ │ +Constructor with a given B-spline patch. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:66 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s │ │ │ │ +Attaches a shape function to an entity. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:185 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s_:_:_l_o_c_a_l_K_e_y │ │ │ │ +const LocalKey & localKey(std::size_t i) const │ │ │ │ +get i'th index │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:328 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s_:_:_i_n_i_t │ │ │ │ +void init(const std::array< unsigned, dim > &sizes) │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:263 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s_:_:_s_i_z_e │ │ │ │ +std::size_t size() const │ │ │ │ +number of coefficients │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:322 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_I_n_t_e_r_p_o_l_a_t_i_o_n │ │ │ │ +Local interpolation in the sense of dune-localfunctions, for the B-spline basis │ │ │ │ +on tensor-product gri... │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:347 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_I_n_t_e_r_p_o_l_a_t_i_o_n_:_:_i_n_t_e_r_p_o_l_a_t_e │ │ │ │ +void interpolate(const F &f, std::vector< C > &out) const │ │ │ │ +Local interpolation of a function. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:351 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_N_o_d_e │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:1233 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ +const FiniteElement & finiteElement() const │ │ │ │ +Return the LocalFiniteElement for the element we are bound to. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:1257 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_N_o_d_e_:_:_E_l_e_m_e_n_t │ │ │ │ typename GV::template Codim< 0 >::Entity Element │ │ │ │ -DDeeffiinniittiioonn cubichermitebasis.hh:669 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e_<_ _G_r_i_d_V_i_e_w_,_ _R_,_ _r_e_d_u_c_e_d_ _>_:_:_v_e_r_t_e_x_M_a_p_p_e_r__ │ │ │ │ -Mapper const * vertexMapper_ │ │ │ │ -DDeeffiinniittiioonn cubichermitebasis.hh:708 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e_<_ _G_r_i_d_V_i_e_w_,_ _R_,_ _r_e_d_u_c_e_d_ _>_:_: │ │ │ │ -_a_v_e_r_a_g_e_V_e_r_t_e_x_M_e_s_h_S_i_z_e__ │ │ │ │ -std::vector< typename GridView::ctype > const * averageVertexMeshSize_ │ │ │ │ -DDeeffiinniittiioonn cubichermitebasis.hh:709 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e │ │ │ │ -CubicHermiteNode(Mapper const &m, std::vector< typename GV::ctype > const │ │ │ │ -&averageVertexMeshSize) │ │ │ │ -DDeeffiinniittiioonn cubichermitebasis.hh:672 │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:1239 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_N_o_d_e_:_:_p_r_e_B_a_s_i_s__ │ │ │ │ +const BSplinePreBasis< GV > * preBasis_ │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:1273 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_N_o_d_e_:_:_F_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ +BSplineLocalFiniteElement< GV, double > FiniteElement │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:1240 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_N_o_d_e_:_:_e_l_e_m_e_n_t__ │ │ │ │ +Element element_ │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:1276 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_N_o_d_e_:_:_b_i_n_d │ │ │ │ +void bind(const Element &e) │ │ │ │ +Bind to element. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:1263 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_N_o_d_e_:_:_B_S_p_l_i_n_e_N_o_d_e │ │ │ │ +BSplineNode(const BSplinePreBasis< GV > *preBasis) │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:1242 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_N_o_d_e_:_:_e_l_e_m_e_n_t │ │ │ │ +const Element & element() const │ │ │ │ +Return current element, throw if unbound. │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:1248 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t__ │ │ │ │ +FiniteElement finiteElement_ │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:1275 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_N_o_d_e_:_:_s_i_z_e___t_y_p_e │ │ │ │ +std::size_t size_type │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:1238 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ Global basis for given pre-basis. │ │ │ │ DDeeffiinniittiioonn defaultglobalbasis.hh:53 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_g_r_i_d_V_i_e_w │ │ │ │ -const GridView & gridView() const │ │ │ │ -Export the stored GridView. │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:95 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_u_p_d_a_t_e │ │ │ │ -void update(const GridView &gv) │ │ │ │ -Update the stored GridView. │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:101 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n │ │ │ │ -LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout) │ │ │ │ -Construct from GridView and local DOF layout. │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:74 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_i_x_i_n │ │ │ │ +A generic MixIn class for PreBasis. │ │ │ │ +DDeeffiinniittiioonn leafprebasismixin.hh:36 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_i_x_i_n_<_ _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_<_ _G_V_ _>_ _>_:_:_s_i_z_e │ │ │ │ +size_type size() const │ │ │ │ +DDeeffiinniittiioonn leafprebasismixin.hh:60 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_i_z_e │ │ │ │ +size_type size() const │ │ │ │ +Obtain the number of basis function in the local node. │ │ │ │ +DDeeffiinniittiioonn nodes.hh:162 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_e_t_S_i_z_e │ │ │ │ void setSize(const size_type size) │ │ │ │ DDeeffiinniittiioonn nodes.hh:197 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ DDeeffiinniittiioonn nodes.hh:218 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _c_u_b_i_c_h_e_r_m_i_t_e_b_a_s_i_s_._h_h │ │ │ │ + * _b_s_p_l_i_n_e_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00170.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: containerdescriptors.hh File Reference │ │ │ +Dune-Functions: compositebasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,107 +88,67 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
containerdescriptors.hh File Reference
│ │ │ +
compositebasis.hh File Reference
│ │ │
│ │ │
│ │ │ - │ │ │ -

Lightweight representation of (hierarchical) size and block structure extracted from a basis to describe data structures like containers that can be accessed by multi-indices provided by the basis. │ │ │ -More...

│ │ │ -
#include <array>
│ │ │ -#include <cassert>
│ │ │ -#include <functional>
│ │ │ -#include <type_traits>
│ │ │ -#include <vector>
│ │ │ -#include <dune/common/filledarray.hh>
│ │ │ -#include <dune/common/tuplevector.hh>
│ │ │ -#include <dune/common/typeutilities.hh>
│ │ │ +
#include <tuple>
│ │ │ +#include <utility>
│ │ │ #include <dune/common/hybridutilities.hh>
│ │ │ -#include <dune/common/rangeutilities.hh>
│ │ │ -#include <dune/functions/common/type_traits.hh>
│ │ │ -#include <dune/functions/functionspacebases/basistags.hh>
│ │ │ +#include <dune/common/reservedvector.hh>
│ │ │ +#include <dune/common/typeutilities.hh>
│ │ │ +#include <dune/common/tupleutility.hh>
│ │ │ +#include <dune/common/tuplevector.hh>
│ │ │ +#include <dune/functions/common/staticforloop.hh>
│ │ │ +#include <dune/functions/common/type_traits.hh>
│ │ │ +#include <dune/functions/common/utility.hh>
│ │ │ +#include <dune/functions/functionspacebases/basistags.hh>
│ │ │ +#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ +#include <dune/functions/functionspacebases/concepts.hh>
│ │ │ +#include <dune/functions/functionspacebases/containerdescriptors.hh>
│ │ │ +#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

struct  Dune::Functions::ContainerDescriptors::Unknown
 Fallback container descriptor if nothing else fits. More...
struct  Dune::Functions::ContainerDescriptors::Value
 The node in the descriptor tree representing a value placeholder. More...
struct  Dune::Functions::ContainerDescriptors::UniformArray< Child, n >
 Descriptor for arrays with all children identical and the number of children a static size. More...
struct  Dune::Functions::ContainerDescriptors::UniformVector< Child >
 Uniform descriptor with dynamic size. More...
class  Dune::Functions::CompositePreBasis< IMS, SPB >
 A pre-basis for composite bases. More...
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ -

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::ContainerDescriptors
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │

│ │ │ -Typedefs

template<class... Children>
using Dune::Functions::ContainerDescriptors::Tuple = Dune::TupleVector<Children...>
 Descriptor with all children of possibly different type.
template<class Child, std::size_t n>
using Dune::Functions::ContainerDescriptors::Array = std::array<Child, n>
 Descriptor for arrays with all children of the same type and static size.
template<class Child>
using Dune::Functions::ContainerDescriptors::Vector = std::vector<Child>
 Descriptor for vectors with all children of the same type and dynamic size.
template<std::size_t n>
using Dune::Functions::ContainerDescriptors::FlatArray = UniformArray<Value,n>
 Alias for a uniform array storing value placeholders.
using Dune::Functions::ContainerDescriptors::FlatVector = UniformVector<Value>
 Alias for a uniform vector storing value placeholders.
namespace  Dune::Functions::BasisFactory
│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Functions

template<class PreBasis>
auto Dune::Functions::containerDescriptor (const PreBasis &preBasis)
 Return the container descriptor of the pre-basis, if defined, otherwise ContainerDescriptor::Unknown.
template<class Child0, class... Children, std::enable_if_t<(std::is_same_v< Child0, Children > &&...), int > = 0>
auto Dune::Functions::ContainerDescriptors::makeDescriptor (Child0 child, Children... children)
 Generate a descriptor in case the children are all of the same type.
template<class Child, std::size_t n>
auto Dune::Functions::ContainerDescriptors::makeUniformDescriptor (std::integral_constant< std::size_t, n >, Child child)
 Generate a uniform descriptor in case the size is a static constant.
template<class Child>
auto Dune::Functions::ContainerDescriptors::makeUniformDescriptor (std::size_t n, Child child)
 Generate a uniform descriptor in case the size is a dynamic value.
template<typename... Args, std::enable_if_t< Concept::isIndexMergingStrategy< typename LastType< Args... >::type >(), int > = 0>
auto Dune::Functions::BasisFactory::composite (Args &&... args)
 Create a factory builder that can build a CompositePreBasis.
template<typename... Args, std::enable_if_t< not Concept::isIndexMergingStrategy< typename LastType< Args... >::type >(), int > = 0>
auto Dune::Functions::BasisFactory::composite (Args &&... args)
 Create a factory builder that can build a CompositePreBasis.
│ │ │ -

Detailed Description

│ │ │ -

Lightweight representation of (hierarchical) size and block structure extracted from a basis to describe data structures like containers that can be accessed by multi-indices provided by the basis.

│ │ │ -

The structure of a container-descriptor is a reduced container interface:

struct [Container]Descriptor
│ │ │ -
{
│ │ │ -
template<class Index>
│ │ │ -
[SubContainerDescriptor] operator[](Index i) const; // return the i-th sub-container-descriptor
│ │ │ -
│ │ │ -
[static constexpr] std::size_t size() [const]; // return the number of children
│ │ │ -
};
│ │ │ -

With the operator[] you can access the children. The Index type is either an integral value or an integral_constant for tuple nodes.

│ │ │ -

Size is either a static property, or a runtime value.

│ │ │ -
│ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,92 +1,42 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -containerdescriptors.hh File Reference │ │ │ │ -Lightweight representation of (hierarchical) size and block structure extracted │ │ │ │ -from a basis to describe data structures like containers that can be accessed │ │ │ │ -by multi-indices provided by the basis. _M_o_r_e_._._. │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ +compositebasis.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ #include │ │ │ │ -#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_s_t_a_t_i_c_f_o_r_l_o_o_p_._h_h> │ │ │ │ #include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ #include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_b_a_s_i_s_t_a_g_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_k_n_o_w_n │ │ │ │ -  Fallback container descriptor if nothing else fits. _M_o_r_e_._._. │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_V_a_l_u_e │ │ │ │ -  The node in the descriptor tree representing a value placeholder. │ │ │ │ - _M_o_r_e_._._. │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_i_f_o_r_m_A_r_r_a_y_<_ _C_h_i_l_d_,_ _n_ _> │ │ │ │ -  Descriptor for arrays with all children identical and the number of │ │ │ │ - children a static size. _M_o_r_e_._._. │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_i_f_o_r_m_V_e_c_t_o_r_<_ _C_h_i_l_d_ _> │ │ │ │ -  Uniform descriptor with dynamic size. _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_<_ _I_M_S_,_ _S_P_B_ _> │ │ │ │ +  A pre-basis for composite bases. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s │ │ │ │ -TTyyppeeddeeffss │ │ │ │ -template │ │ │ │ -using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_T_u_p_l_e = Dune:: │ │ │ │ - TupleVector │ │ │ │ -  Descriptor with all children of possibly different type. │ │ │ │ -template │ │ │ │ -using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_A_r_r_a_y = std::array │ │ │ │ -  Descriptor for arrays with all children of the same type and static │ │ │ │ - size. │ │ │ │ -template │ │ │ │ -using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_V_e_c_t_o_r = std::vector │ │ │ │ -  Descriptor for vectors with all children of the same type and dynamic │ │ │ │ - size. │ │ │ │ -template │ │ │ │ -using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_F_l_a_t_A_r_r_a_y = _U_n_i_f_o_r_m_A_r_r_a_y<_V_a_l_u_e,n> │ │ │ │ -  Alias for a uniform array storing value placeholders. │ │ │ │ -using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_F_l_a_t_V_e_c_t_o_r = _U_n_i_f_o_r_m_V_e_c_t_o_r<_V_a_l_u_e> │ │ │ │ -  Alias for a uniform vector storing value placeholders. │ │ │ │ +namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r (const PreBasis &preBasis) │ │ │ │ -  Return the container descriptor of the pre-basis, if defined, otherwise │ │ │ │ - ContainerDescriptor::Unknown. │ │ │ │ -template &&...), int > = 0> │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_m_a_k_e_D_e_s_c_r_i_p_t_o_r (Child0 child, │ │ │ │ - Children... children) │ │ │ │ -  Generate a descriptor in case the children are all of the same type. │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_m_a_k_e_U_n_i_f_o_r_m_D_e_s_c_r_i_p_t_o_r (std:: │ │ │ │ - integral_constant< std::size_t, n >, Child child) │ │ │ │ -  Generate a uniform descriptor in case the size is a static constant. │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_m_a_k_e_U_n_i_f_o_r_m_D_e_s_c_r_i_p_t_o_r (std::size_t │ │ │ │ - n, Child child) │ │ │ │ -  Generate a uniform descriptor in case the size is a dynamic value. │ │ │ │ -********** DDeettaaiilleedd DDeessccrriippttiioonn ********** │ │ │ │ -Lightweight representation of (hierarchical) size and block structure extracted │ │ │ │ -from a basis to describe data structures like containers that can be accessed │ │ │ │ -by multi-indices provided by the basis. │ │ │ │ -The structure of a container-descriptor is a reduced container interface: │ │ │ │ -struct [Container]Descriptor │ │ │ │ -{ │ │ │ │ -template │ │ │ │ -[SubContainerDescriptor] operator[](Index i) const; // return the i-th sub- │ │ │ │ -container-descriptor │ │ │ │ -[static constexpr] std::size_t size() [const]; // return the number of children │ │ │ │ -}; │ │ │ │ -With the operator[] you can access the children. The Index type is either an │ │ │ │ -integral value or an integral_constant for tuple nodes. │ │ │ │ -Size is either a static property, or a runtime value. │ │ │ │ +template::type >(), int > = 0> │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_c_o_m_p_o_s_i_t_e (Args &&... args) │ │ │ │ +  Create a factory builder that can build a _C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s. │ │ │ │ +template::type >(), int > = 0> │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_c_o_m_p_o_s_i_t_e (Args &&... args) │ │ │ │ +  Create a factory builder that can build a _C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h │ │ │ │ + * _c_o_m_p_o_s_i_t_e_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00170.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,15 +1,4 @@ │ │ │ │ var a00170 = [ │ │ │ │ - ["Dune::Functions::ContainerDescriptors::Unknown", "a01766.html", null], │ │ │ │ - ["Dune::Functions::ContainerDescriptors::Value", "a01770.html", "a01770"], │ │ │ │ - ["Dune::Functions::ContainerDescriptors::UniformArray< Child, n >", "a01774.html", "a01774"], │ │ │ │ - ["Dune::Functions::ContainerDescriptors::UniformVector< Child >", "a01778.html", "a01778"], │ │ │ │ - ["Dune::Functions::ContainerDescriptors::Array", "a00321.html#a7fd69d40ddb645de01687b67cc377e13", null], │ │ │ │ - ["Dune::Functions::ContainerDescriptors::FlatArray", "a00321.html#a016f06509d4ca71b569d25b8c8cedf10", null], │ │ │ │ - ["Dune::Functions::ContainerDescriptors::FlatVector", "a00321.html#a253fdb1e81571ea944bd6bb21bf4a06e", null], │ │ │ │ - ["Dune::Functions::ContainerDescriptors::Tuple", "a00321.html#a3658e9613f94667b90b8692ec47a0242", null], │ │ │ │ - ["Dune::Functions::ContainerDescriptors::Vector", "a00321.html#a7692987ba816965c1c2df93c39d50ca8", null], │ │ │ │ - ["Dune::Functions::containerDescriptor", "a00318.html#a5aa100c5225a3709fbb096dc9c73d63f", null], │ │ │ │ - ["Dune::Functions::ContainerDescriptors::makeDescriptor", "a00321.html#a92f91149b73e70dbdf2f5270f967a539", null], │ │ │ │ - ["Dune::Functions::ContainerDescriptors::makeUniformDescriptor", "a00321.html#a1cc8d924fe714e87c0318540d14ca61d", null], │ │ │ │ - ["Dune::Functions::ContainerDescriptors::makeUniformDescriptor", "a00321.html#af5f9aa0c6bf206da1efb563cc39f477f", null] │ │ │ │ + ["Dune::Functions::BasisFactory::composite", "a00327.html#ga0ee62f9744ec8ba58fdfc4c68df34449", null], │ │ │ │ + ["Dune::Functions::BasisFactory::composite", "a00312.html#ga0ee62f9744ec8ba58fdfc4c68df34449", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00170_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: containerdescriptors.hh Source File │ │ │ +Dune-Functions: compositebasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,429 +88,497 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
containerdescriptors.hh
│ │ │ +
compositebasis.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CONTAINERDESCRIPTORS_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CONTAINERDESCRIPTORS_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH
│ │ │ +
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH
│ │ │
9
│ │ │ -
10#include <array>
│ │ │ -
11#include <cassert>
│ │ │ -
12#include <functional>
│ │ │ -
13#include <type_traits>
│ │ │ -
14#include <vector>
│ │ │ -
15
│ │ │ -
16#include <dune/common/filledarray.hh>
│ │ │ -
17#include <dune/common/tuplevector.hh>
│ │ │ -
18#include <dune/common/typeutilities.hh>
│ │ │ -
19#include <dune/common/hybridutilities.hh>
│ │ │ -
20#include <dune/common/rangeutilities.hh>
│ │ │ -
21
│ │ │ - │ │ │ - │ │ │ -
24
│ │ │ -
47
│ │ │ -
48namespace Dune::Functions {
│ │ │ -
49namespace ContainerDescriptors {
│ │ │ -
50
│ │ │ -
52struct Unknown {};
│ │ │ -
53
│ │ │ -
54} // end namespace ContainerDescriptors
│ │ │ -
55
│ │ │ -
57template<class PreBasis>
│ │ │ -
│ │ │ -
58auto containerDescriptor(const PreBasis& preBasis)
│ │ │ -
59{
│ │ │ -
60 if constexpr (requires{ preBasis.containerDescriptor(); })
│ │ │ -
61 return preBasis.containerDescriptor();
│ │ │ -
62 else
│ │ │ - │ │ │ -
64}
│ │ │ -
│ │ │ -
65
│ │ │ -
66
│ │ │ -
67namespace ContainerDescriptors {
│ │ │ -
68
│ │ │ -
│ │ │ -
70struct Value
│ │ │ -
71{
│ │ │ -
73 template<class Index>
│ │ │ -
74 Value operator[] (const Index&) const { return {}; }
│ │ │ -
75
│ │ │ -
77 static constexpr std::size_t size () { return 0; }
│ │ │ -
78};
│ │ │ -
│ │ │ -
79
│ │ │ -
81template<class... Children>
│ │ │ -
82using Tuple = Dune::TupleVector<Children...>;
│ │ │ +
10#include <tuple>
│ │ │ +
11#include <utility>
│ │ │ +
12
│ │ │ +
13#include <dune/common/hybridutilities.hh>
│ │ │ +
14#include <dune/common/reservedvector.hh>
│ │ │ +
15#include <dune/common/typeutilities.hh>
│ │ │ +
16#include <dune/common/hybridutilities.hh>
│ │ │ +
17#include <dune/common/tupleutility.hh>
│ │ │ +
18#include <dune/common/tuplevector.hh>
│ │ │ +
19
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
28
│ │ │ +
29
│ │ │ +
30namespace Dune {
│ │ │ +
31namespace Functions {
│ │ │ +
32
│ │ │ +
33// *****************************************************************************
│ │ │ +
34// This is the reusable part of the composite bases. It contains
│ │ │ +
35//
│ │ │ +
36// CompositePreBasis
│ │ │ +
37//
│ │ │ +
38// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ +
39// state. These components do _not_ depend on the global basis and local view
│ │ │ +
40// and can be used without a global basis.
│ │ │ +
41// *****************************************************************************
│ │ │ +
42
│ │ │ +
43
│ │ │ +
55template<class IMS, class... SPB>
│ │ │ +
│ │ │ + │ │ │ +
57{
│ │ │ +
58 static const bool isBlocked = std::is_same_v<IMS,BasisFactory::BlockedLexicographic> or std::is_same_v<IMS,BasisFactory::BlockedInterleaved>;
│ │ │ +
59public:
│ │ │ +
60
│ │ │ +
62 using SubPreBases = std::tuple<SPB...>;
│ │ │ +
63
│ │ │ +
65 template<std::size_t i>
│ │ │ +
66 using SubPreBasis = std::tuple_element_t<i, SubPreBases>;
│ │ │ +
67
│ │ │ +
69 using GridView = typename std::tuple_element_t<0, SubPreBases>::GridView;
│ │ │ +
70
│ │ │ +
72 using size_type = std::size_t;
│ │ │ +
73
│ │ │ + │ │ │ +
76
│ │ │ +
77protected:
│ │ │ +
78 static const std::size_t children = sizeof...(SPB);
│ │ │ +
79
│ │ │ +
80 using ChildIndices = std::make_index_sequence<children>;
│ │ │ +
81
│ │ │ +
82public:
│ │ │
83
│ │ │ -
86template<class Child0, class... Children,
│ │ │ -
87 std::enable_if_t<(sizeof...(Children) > 0), int> = 0,
│ │ │ -
88 std::enable_if_t<(...|| (not std::is_same_v<Child0, Children>)), int> = 0>
│ │ │ -
89auto makeDescriptor (Child0 child0, Children... children)
│ │ │ -
90{
│ │ │ -
91 using Descriptor = Tuple<Child0,Children...>;
│ │ │ -
92 return Descriptor{std::move(child0),std::move(children)...};
│ │ │ -
93}
│ │ │ -
94
│ │ │ -
95
│ │ │ -
97template<class Child, std::size_t n>
│ │ │ -
98using Array = std::array<Child, n>;
│ │ │ -
99
│ │ │ -
101template<class Child0, class... Children,
│ │ │ -
102 std::enable_if_t<(std::is_same_v<Child0, Children> &&...), int> = 0>
│ │ │ -
│ │ │ -
103auto makeDescriptor (Child0 child, Children... children)
│ │ │ -
104{
│ │ │ -
105 using Descriptor = Array<Child0,1+sizeof...(Children)>;
│ │ │ -
106 return Descriptor{std::move(child),std::move(children)...};
│ │ │ -
107}
│ │ │ -
│ │ │ -
108
│ │ │ -
109
│ │ │ -
111template<class Child>
│ │ │ -
112using Vector = std::vector<Child>;
│ │ │ -
113
│ │ │ -
115template<class Child, std::size_t n>
│ │ │ -
│ │ │ - │ │ │ -
117{
│ │ │ -
119 template<class C = Child,
│ │ │ -
120 std::enable_if_t<std::is_default_constructible_v<C>, int> = 0>
│ │ │ -
│ │ │ - │ │ │ -
122 : child_{}
│ │ │ -
123 {}
│ │ │ -
│ │ │ -
124
│ │ │ -
│ │ │ -
126 explicit UniformArray (Child child)
│ │ │ -
127 : child_{std::move(child)}
│ │ │ -
128 {}
│ │ │ -
│ │ │ -
129
│ │ │ -
131 template<class Index>
│ │ │ -
132 const Child& operator[] (const Index& /*i*/) const { return child_; }
│ │ │ -
133
│ │ │ -
135 static constexpr std::size_t size () { return n; }
│ │ │ -
136
│ │ │ -
137private:
│ │ │ -
138 Child child_;
│ │ │ -
139};
│ │ │ +
85 using Node = CompositeBasisNode<typename SPB::Node...>;
│ │ │ +
86
│ │ │ +
87 static constexpr size_type maxMultiIndexSize = std::max({SPB::maxMultiIndexSize...}) + isBlocked;
│ │ │ +
88 static constexpr size_type minMultiIndexSize = std::min({SPB::minMultiIndexSize...}) + isBlocked;
│ │ │ +
89 static constexpr size_type multiIndexBufferSize = std::max({SPB::multiIndexBufferSize...}) + isBlocked;
│ │ │ +
90
│ │ │ +
96 template<class... SFArgs,
│ │ │ +
97 disableCopyMove<CompositePreBasis, SFArgs...> = 0,
│ │ │ +
98 enableIfConstructible<std::tuple<SPB...>, SFArgs...> = 0>
│ │ │ +
│ │ │ +
99 CompositePreBasis(SFArgs&&... sfArgs) :
│ │ │ +
100 subPreBases_(std::forward<SFArgs>(sfArgs)...)
│ │ │ +
101 {
│ │ │ +
102 Hybrid::forEach(subPreBases_, [&](const auto& subPreBasis){
│ │ │ +
103 static_assert(models<Concept::PreBasis<GridView>, std::decay_t<decltype(subPreBasis)>>(), "Subprebases passed to CompositePreBasis does not model the PreBasis concept.");
│ │ │ +
104 });
│ │ │ +
105 }
│ │ │ +
│ │ │ +
106
│ │ │ +
113 template<class GV,
│ │ │ +
114 std::enable_if_t<std::conjunction_v<
│ │ │ +
115 std::bool_constant<(children > 1)>, // Avoid ambiguous constructor if there's only one child
│ │ │ +
116 std::is_same<GV, GridView>,
│ │ │ +
117 std::is_constructible<SPB, GridView>...
│ │ │ +
118 >, int> = 0>
│ │ │ +
│ │ │ +
119 CompositePreBasis(const GV& gv) :
│ │ │ +
120 subPreBases_(SPB(gv)...)
│ │ │ +
121 {
│ │ │ +
122 Hybrid::forEach(subPreBases_, [&](const auto& subPreBasis){
│ │ │ +
123 static_assert(models<Concept::PreBasis<GridView>, std::decay_t<decltype(subPreBasis)>>(), "Subprebases passed to CompositePreBasis does not model the PreBasis concept.");
│ │ │ +
124 });
│ │ │ +
125 }
│ │ │ +
│ │ │ +
126
│ │ │ +
│ │ │ + │ │ │ +
129 {
│ │ │ +
130 Hybrid::forEach(ChildIndices(), [&](auto i) {
│ │ │ +
131 this->subPreBasis(i).initializeIndices();
│ │ │ +
132 });
│ │ │ +
133 }
│ │ │ +
│ │ │ +
134
│ │ │ +
│ │ │ +
136 const GridView& gridView() const
│ │ │ +
137 {
│ │ │ +
138 return std::get<0>(subPreBases_).gridView();
│ │ │ +
139 }
│ │ │
│ │ │
140
│ │ │ -
142template<std::size_t n>
│ │ │ - │ │ │ -
144
│ │ │ -
146template<class Child, std::size_t n>
│ │ │ -
│ │ │ -
147auto makeUniformDescriptor (std::integral_constant<std::size_t,n>, Child child)
│ │ │ -
148{
│ │ │ -
149 return UniformArray<Child,n>{std::move(child)};
│ │ │ -
150}
│ │ │ -
│ │ │ -
151
│ │ │ -
152
│ │ │ -
154template<class Child>
│ │ │ -
│ │ │ - │ │ │ -
156{
│ │ │ -
158 template<class C = Child,
│ │ │ -
159 std::enable_if_t<std::is_default_constructible_v<C>, int> = 0>
│ │ │ -
│ │ │ -
160 explicit UniformVector (std::size_t size)
│ │ │ -
161 : size_{size}
│ │ │ -
162 , child_{}
│ │ │ -
163 {}
│ │ │ -
│ │ │ -
164
│ │ │ -
│ │ │ -
166 UniformVector (std::size_t size, Child child)
│ │ │ -
167 : size_{size}
│ │ │ -
168 , child_{std::move(child)}
│ │ │ -
169 {}
│ │ │ -
│ │ │ -
170
│ │ │ -
172 template<class Index>
│ │ │ -
173 const Child& operator[] (const Index& /*i*/) const { return child_; }
│ │ │ -
174
│ │ │ -
176 std::size_t size () const { return size_; }
│ │ │ -
177
│ │ │ -
178private:
│ │ │ -
179 std::size_t size_;
│ │ │ -
180 Child child_;
│ │ │ -
181};
│ │ │ -
│ │ │ -
182
│ │ │ - │ │ │ -
185
│ │ │ -
187template<class Child>
│ │ │ -
│ │ │ -
188auto makeUniformDescriptor (std::size_t n, Child child)
│ │ │ -
189{
│ │ │ -
190 return UniformVector<Child>{n,std::move(child)};
│ │ │ -
191}
│ │ │ -
│ │ │ -
192
│ │ │ -
193namespace Impl {
│ │ │ -
194
│ │ │ -
195template<class InnerFunc, class LeafFunc>
│ │ │ -
196struct TreeTransform
│ │ │ -
197{
│ │ │ -
198 TreeTransform (const InnerFunc& innerFunc, const LeafFunc& leafFunc)
│ │ │ -
199 : innerFunc_(innerFunc)
│ │ │ -
200 , leafFunc_(leafFunc)
│ │ │ -
201 {}
│ │ │ -
202
│ │ │ -
203 Unknown operator() (const Unknown& tree) const
│ │ │ -
204 {
│ │ │ -
205 return tree;
│ │ │ -
206 }
│ │ │ -
207
│ │ │ -
208 auto operator() (const Value& tree) const
│ │ │ -
209 {
│ │ │ -
210 return leafFunc_(tree);
│ │ │ -
211 }
│ │ │ -
212
│ │ │ -
213 template<class... V>
│ │ │ -
214 auto operator() (const Tuple<V...>& tree) const
│ │ │ -
215 {
│ │ │ -
216 return unpackIntegerSequence([&](auto... ii) {
│ │ │ -
217 return makeDescriptor(innerFunc_(tree[ii])...);
│ │ │ -
218 }, std::make_index_sequence<sizeof...(V)>());
│ │ │ -
219 }
│ │ │ -
220
│ │ │ -
221 template<class V, std::size_t n>
│ │ │ -
222 auto operator() (const Array<V,n>& tree) const
│ │ │ -
223 {
│ │ │ -
224 return unpackIntegerSequence([&](auto... ii) {
│ │ │ -
225 return makeDescriptor(innerFunc_(tree[ii])...);
│ │ │ -
226 }, std::make_index_sequence<n>());
│ │ │ -
227 }
│ │ │ -
228
│ │ │ -
229 template<class V>
│ │ │ -
230 auto operator() (const Vector<V>& tree) const
│ │ │ -
231 {
│ │ │ -
232 using W = decltype(innerFunc_(tree[0]));
│ │ │ -
233 Vector<W> result;
│ │ │ -
234 result.reserve(tree.size());
│ │ │ -
235 for (std::size_t i = 0; i < tree.size(); ++i)
│ │ │ -
236 result.emplace_back(innerFunc_(tree[i]));
│ │ │ -
237 return result;
│ │ │ -
238 }
│ │ │ -
239
│ │ │ -
240 template<class V, std::size_t n>
│ │ │ -
241 auto operator() (const UniformArray<V,n>& tree) const
│ │ │ -
242 {
│ │ │ -
243 return makeUniformDescriptor(Dune::index_constant<n>{}, innerFunc_(tree[0]));
│ │ │ +
│ │ │ +
142 void update(const GridView& gv)
│ │ │ +
143 {
│ │ │ +
144 Hybrid::forEach(ChildIndices(), [&](auto i) {
│ │ │ +
145 this->subPreBasis(i).update(gv);
│ │ │ +
146 });
│ │ │ +
147 }
│ │ │ +
│ │ │ +
148
│ │ │ +
│ │ │ + │ │ │ +
153 {
│ │ │ +
154 auto node = Node{};
│ │ │ +
155 Hybrid::forEach(ChildIndices(), [&](auto i) {
│ │ │ +
156 node.setChild(this->subPreBasis(i).makeNode(), i);
│ │ │ +
157 });
│ │ │ +
158 return node;
│ │ │ +
159 }
│ │ │ +
│ │ │ +
160
│ │ │ +
│ │ │ + │ │ │ +
163 {
│ │ │ +
164 return size(Dune::ReservedVector<size_type, multiIndexBufferSize>{});
│ │ │ +
165 }
│ │ │ +
│ │ │ +
166
│ │ │ +
168 template<class SizePrefix>
│ │ │ +
│ │ │ +
169 size_type size(const SizePrefix& prefix) const
│ │ │ +
170 {
│ │ │ +
171 return size(prefix, IndexMergingStrategy{});
│ │ │ +
172 }
│ │ │ +
│ │ │ +
173
│ │ │ +
174private:
│ │ │ +
175
│ │ │ +
176 template<class MultiIndex>
│ │ │ +
177 static void multiIndexPopFront(MultiIndex& M)
│ │ │ +
178 {
│ │ │ +
179 for(std::size_t i=0; i<M.size()-1; ++i)
│ │ │ +
180 M[i] = M[i+1];
│ │ │ +
181 M.resize(M.size()-1);
│ │ │ +
182 }
│ │ │ +
183
│ │ │ +
184 template<class SizePrefix>
│ │ │ +
185 size_type size(SizePrefix prefix, BasisFactory::BlockedLexicographic) const
│ │ │ +
186 {
│ │ │ +
187 if (prefix.size() == 0)
│ │ │ +
188 return children;
│ │ │ +
189
│ │ │ +
190 auto front = prefix.front();
│ │ │ +
191 multiIndexPopFront(prefix);
│ │ │ +
192 return Hybrid::switchCases(ChildIndices(), front, [&] (auto i) {
│ │ │ +
193 return this->subPreBasis(i).size(prefix);
│ │ │ +
194 }, []() {
│ │ │ +
195 return size_type(0);
│ │ │ +
196 });
│ │ │ +
197 }
│ │ │ +
198
│ │ │ +
199 template<class SizePrefix>
│ │ │ +
200 size_type size(SizePrefix prefix, BasisFactory::FlatLexicographic) const
│ │ │ +
201 {
│ │ │ +
202 size_type result = 0;
│ │ │ +
203 if (prefix.size() == 0)
│ │ │ +
204 Hybrid::forEach(ChildIndices(), [&](auto i) {
│ │ │ +
205 result += this->subPreBasis(i).size();
│ │ │ +
206 });
│ │ │ +
207 else {
│ │ │ + │ │ │ +
209 auto firstDigitSize = this->subPreBasis(i).size();
│ │ │ +
210 if (prefix[0] < firstDigitSize)
│ │ │ +
211 {
│ │ │ +
212 result = this->subPreBasis(i).size(prefix);
│ │ │ +
213 return true;
│ │ │ +
214 }
│ │ │ +
215 prefix[0] -= firstDigitSize;
│ │ │ +
216 return false;
│ │ │ +
217 });
│ │ │ +
218 }
│ │ │ +
219 return result;
│ │ │ +
220 }
│ │ │ +
221
│ │ │ +
222public:
│ │ │ +
223
│ │ │ +
│ │ │ + │ │ │ +
226 {
│ │ │ +
227 size_type r=0;
│ │ │ +
228 // Accumulate dimension() for all subprebases
│ │ │ +
229 Hybrid::forEach(ChildIndices(), [&](auto i) {
│ │ │ +
230 r += this->subPreBasis(i).dimension();
│ │ │ +
231 });
│ │ │ +
232 return r;
│ │ │ +
233 }
│ │ │ +
│ │ │ +
234
│ │ │ +
│ │ │ + │ │ │ +
237 {
│ │ │ +
238 size_type r=0;
│ │ │ +
239 // Accumulate maxNodeSize() for all subprebases
│ │ │ +
240 Hybrid::forEach(ChildIndices(), [&](auto i) {
│ │ │ +
241 r += this->subPreBasis(i).maxNodeSize();
│ │ │ +
242 });
│ │ │ +
243 return r;
│ │ │
244 }
│ │ │ -
245
│ │ │ -
246 template<class V>
│ │ │ -
247 auto operator() (const UniformVector<V>& tree) const
│ │ │ -
248 {
│ │ │ -
249 return makeUniformDescriptor(tree.size(), innerFunc_(tree[0]));
│ │ │ -
250 }
│ │ │ -
251
│ │ │ -
252private:
│ │ │ -
253 InnerFunc innerFunc_;
│ │ │ -
254 LeafFunc leafFunc_;
│ │ │ -
255};
│ │ │ -
256
│ │ │ -
257
│ │ │ -
268template<class Size, class T>
│ │ │ -
269auto appendToTree (Size s, const T& tree)
│ │ │ -
270{
│ │ │ -
271 auto transform = TreeTransform(
│ │ │ -
272 [s](auto&& node) { return appendToTree(s, node); },
│ │ │ -
273 [s](auto&& node) { return makeUniformDescriptor(s, node); });
│ │ │ -
274 return transform(tree);
│ │ │ -
275}
│ │ │ -
276
│ │ │ -
278template<class... Child>
│ │ │ -
279auto flatLexicographic (Child... child)
│ │ │ -
280{
│ │ │ -
281 if constexpr ((std::is_same_v<Child, FlatVector> && ...))
│ │ │ -
282 return FlatVector((child.size() + ...));
│ │ │ -
283 else
│ │ │ -
284 return Unknown{};
│ │ │ -
285}
│ │ │ -
286
│ │ │ -
288template<class N, class Child>
│ │ │ -
289auto flatLexicographicN (N n, Child child)
│ │ │ -
290{
│ │ │ -
291 return Unknown{};
│ │ │ -
292}
│ │ │ -
293
│ │ │ -
295template<class N, class GrandChild>
│ │ │ -
296auto flatLexicographicN (N n, UniformVector<GrandChild> child)
│ │ │ -
297{
│ │ │ -
298 return UniformVector<GrandChild>{child.size()*n, child[0]};
│ │ │ -
299}
│ │ │ -
300
│ │ │ -
302template<class N, class GrandChild, std::size_t m>
│ │ │ -
303auto flatLexicographicN (N n, UniformArray<GrandChild, m> child)
│ │ │ -
304{
│ │ │ -
305 if constexpr (std::is_same_v<N, std::size_t>)
│ │ │ -
306 return UniformVector<GrandChild>{n*m, child[0]};
│ │ │ -
307 else
│ │ │ -
308 return UniformArray<GrandChild, N::value*m>{child[0]};
│ │ │ -
309}
│ │ │ -
310
│ │ │ -
312template<class N, class GrandChild>
│ │ │ -
313auto flatLexicographicN (N n, Vector<GrandChild> child)
│ │ │ -
314{
│ │ │ -
315 auto result = Vector<GrandChild>{};
│ │ │ -
316 result.reserve(child.size()*n);
│ │ │ -
317 for (auto j : Dune::range(n))
│ │ │ -
318 for (auto i : Dune::range(child.size()))
│ │ │ -
319 result.emplace_back(child[i]);
│ │ │ -
320 return result;
│ │ │ -
321}
│ │ │ -
322
│ │ │ -
324template<class N, class GrandChild, std::size_t m>
│ │ │ -
325auto flatLexicographicN (N n, Array<GrandChild, m> child)
│ │ │ -
326{
│ │ │ -
327 if constexpr (std::is_same_v<N, std::size_t>)
│ │ │ -
328 {
│ │ │ -
329 auto result = Vector<GrandChild>{};
│ │ │ -
330 result.reserve(child.size()*n);
│ │ │ -
331 for (auto j : Dune::range(n))
│ │ │ -
332 for (auto i : Dune::range(child.size()))
│ │ │ -
333 result.emplace_back(child[i]);
│ │ │ -
334 return result;
│ │ │ -
335 }
│ │ │ -
336 else
│ │ │ -
337 {
│ │ │ -
338 auto result = Array<GrandChild, N::value*m>{};
│ │ │ -
339 for (auto j : Dune::range(n))
│ │ │ -
340 for (auto i : Dune::range(child.size()))
│ │ │ -
341 result.emplace_back(child[i]);
│ │ │ -
342 return result;
│ │ │ -
343 }
│ │ │ -
344}
│ │ │ -
345
│ │ │ -
347template<class N, class... GrandChild>
│ │ │ -
348auto flatLexicographicN (N n, Tuple<GrandChild...> child)
│ │ │ -
349{
│ │ │ -
350 constexpr std::size_t m = sizeof...(GrandChild);
│ │ │ -
351 return Dune::unpackIntegerSequence([&](auto... i) {
│ │ │ -
352 return makeDescriptor(std::get<i%m>(child)...);
│ │ │ -
353 }, std::make_index_sequence<n*m>{});
│ │ │ -
354}
│ │ │ -
355
│ │ │ -
357template<class N, class Child>
│ │ │ -
358auto flatInterleavedN (N n, Child child)
│ │ │ -
359{
│ │ │ -
360 return Unknown{};
│ │ │ -
361}
│ │ │ -
362
│ │ │ -
364template<class N, class GrandChild>
│ │ │ -
365auto flatInterleavedN (N n, UniformVector<GrandChild> child)
│ │ │ -
366{
│ │ │ -
367 return UniformVector<GrandChild>{child.size()*n, child[0]};
│ │ │ -
368}
│ │ │ -
369
│ │ │ -
371template<class N, class GrandChild, std::size_t m>
│ │ │ -
372auto flatInterleavedN (N n, UniformArray<GrandChild, m> child)
│ │ │ -
373{
│ │ │ -
374 if constexpr (std::is_integral_v<N>)
│ │ │ -
375 return UniformVector<GrandChild>{n*m, child[0]};
│ │ │ -
376 else
│ │ │ -
377 return UniformArray<GrandChild, N::value*m>{child[0]};
│ │ │ -
378}
│ │ │ -
379
│ │ │ -
381template<class N, class GrandChild>
│ │ │ -
382auto flatInterleavedN (N n, Vector<GrandChild> child)
│ │ │ -
383{
│ │ │ -
384 auto result = Vector<GrandChild>{};
│ │ │ -
385 result.reserve(child.size()*n);
│ │ │ -
386 for (auto i : Dune::range(child.size()))
│ │ │ -
387 for (auto j : Dune::range(n))
│ │ │ -
388 result.emplace_back(child[i]);
│ │ │ -
389 return result;
│ │ │ -
390}
│ │ │ -
391
│ │ │ -
393template<class N, class GrandChild, std::size_t m>
│ │ │ -
394auto flatInterleavedN (N n, Array<GrandChild, m> child)
│ │ │ -
395{
│ │ │ -
396 if constexpr (std::is_integral_v<N>)
│ │ │ -
397 {
│ │ │ -
398 auto result = Vector<GrandChild>{};
│ │ │ -
399 result.reserve(child.size()*n);
│ │ │ -
400 for (auto i : Dune::range(child.size()))
│ │ │ -
401 for (auto j : Dune::range(n))
│ │ │ -
402 result.emplace_back(child[i]);
│ │ │ -
403 return result;
│ │ │ -
404 }
│ │ │ -
405 else
│ │ │ -
406 {
│ │ │ -
407 auto result = Array<GrandChild, N::value*m>{};
│ │ │ -
408 for (auto i : Dune::range(child.size()))
│ │ │ -
409 for (auto j : Dune::range(n))
│ │ │ -
410 result.emplace_back(child[i]);
│ │ │ -
411 return result;
│ │ │ -
412 }
│ │ │ -
413}
│ │ │ -
414
│ │ │ -
416template<class N, class... GrandChild>
│ │ │ -
417auto flatInterleavedN (N n, Tuple<GrandChild...> child)
│ │ │ -
418{
│ │ │ -
419 constexpr std::size_t m = sizeof...(GrandChild);
│ │ │ -
420 return Dune::unpackIntegerSequence([&](auto... i) {
│ │ │ -
421 return makeDescriptor(std::get<i/n>(child)...);
│ │ │ -
422 }, std::make_index_sequence<n*m>{});
│ │ │ -
423}
│ │ │ -
424
│ │ │ -
425} // end namespace Impl
│ │ │ -
426} // end namespace ContainerDescriptors
│ │ │ -
427} // end namespace Dune::Functions
│ │ │ -
428
│ │ │ -
429#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CONTAINERDESCRIPTORS_HH
│ │ │ - │ │ │ - │ │ │ +
│ │ │ +
245
│ │ │ +
247 template<std::size_t i>
│ │ │ +
│ │ │ +
248 const SubPreBasis<i>& subPreBasis(Dune::index_constant<i> = {}) const
│ │ │ +
249 {
│ │ │ +
250 return std::get<i>(subPreBases_);
│ │ │ +
251 }
│ │ │ +
│ │ │ +
252
│ │ │ +
254 template<std::size_t i>
│ │ │ +
│ │ │ +
255 SubPreBasis<i>& subPreBasis(Dune::index_constant<i> = {})
│ │ │ +
256 {
│ │ │ +
257 return std::get<i>(subPreBases_);
│ │ │ +
258 }
│ │ │ +
│ │ │ +
259
│ │ │ +
│ │ │ +
261 const auto& subPreBases() const
│ │ │ +
262 {
│ │ │ +
263 return subPreBases_;
│ │ │ +
264 }
│ │ │ +
│ │ │ +
265
│ │ │ +
267 template<typename It>
│ │ │ +
│ │ │ +
268 It indices(const Node& node, It it) const
│ │ │ +
269 {
│ │ │ +
270 return indices(node, it, IndexMergingStrategy{});
│ │ │ +
271 }
│ │ │ +
│ │ │ +
272
│ │ │ +
│ │ │ + │ │ │ +
275 {
│ │ │ + │ │ │ +
277 if constexpr(std::is_same_v<IMS, BasisFactory::BlockedLexicographic>) {
│ │ │ +
278 return std::apply([&](auto const&... spb) {
│ │ │ +
279 return CD::makeDescriptor(Dune::Functions::containerDescriptor(spb)...);
│ │ │ +
280 }, subPreBases_);
│ │ │ +
281 }
│ │ │ +
282 else if constexpr(std::is_same_v<IMS, BasisFactory::FlatLexicographic>) {
│ │ │ +
283 return std::apply([&](auto const&... spb) {
│ │ │ +
284 return CD::Impl::flatLexicographic(Dune::Functions::containerDescriptor(spb)...);
│ │ │ +
285 }, subPreBases_);
│ │ │ +
286 }
│ │ │ +
287 else
│ │ │ +
288 return CD::Unknown{};
│ │ │ +
289 }
│ │ │ +
│ │ │ +
290
│ │ │ +
291private:
│ │ │ +
292
│ │ │ +
293 template<typename It>
│ │ │ +
294 It indices(const Node& node, It multiIndices, BasisFactory::FlatLexicographic) const
│ │ │ +
295 {
│ │ │ +
296 size_type firstComponentOffset = 0;
│ │ │ +
297 // Loop over all children
│ │ │ +
298 Hybrid::forEach(ChildIndices(), [&](auto child){
│ │ │ +
299 size_type subTreeSize = node.child(child).size();
│ │ │ +
300 // Fill indices for current child into index buffer starting from current
│ │ │ +
301 // buffer position and shift first index component of any index for current
│ │ │ +
302 // child by suitable offset to get lexicographic indices.
│ │ │ +
303 subPreBasis(child).indices(node.child(child), multiIndices);
│ │ │ +
304 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ +
305 multiIndices[i][0] += firstComponentOffset;
│ │ │ +
306 // Increment offset by the size for first index component of the current child
│ │ │ +
307 firstComponentOffset += subPreBasis(child).size();
│ │ │ +
308 // Increment buffer iterator by the number of indices processed for current child
│ │ │ +
309 multiIndices += subTreeSize;
│ │ │ +
310 });
│ │ │ +
311 return multiIndices;
│ │ │ +
312 }
│ │ │ +
313
│ │ │ +
314 template<class MultiIndex>
│ │ │ +
315 static void multiIndexPushFront(MultiIndex& M, size_type M0)
│ │ │ +
316 {
│ │ │ +
317 M.resize(M.size()+1);
│ │ │ +
318 for(std::size_t i=M.size()-1; i>0; --i)
│ │ │ +
319 M[i] = M[i-1];
│ │ │ +
320 M[0] = M0;
│ │ │ +
321 }
│ │ │ +
322
│ │ │ +
323 template<typename It>
│ │ │ +
324 It indices(const Node& node, It multiIndices, BasisFactory::BlockedLexicographic) const
│ │ │ +
325 {
│ │ │ +
326 // Loop over all children
│ │ │ +
327 Hybrid::forEach(ChildIndices(), [&](auto child){
│ │ │ +
328 size_type subTreeSize = node.child(child).size();
│ │ │ +
329 // Fill indices for current child into index buffer starting from current position
│ │ │ +
330 subPreBasis(child).indices(node.child(child), multiIndices);
│ │ │ +
331 // Insert child index before first component of all indices of current child.
│ │ │ +
332 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ +
333 this->multiIndexPushFront(multiIndices[i], child);
│ │ │ +
334 // Increment buffer iterator by the number of indices processed for current child
│ │ │ +
335 multiIndices += subTreeSize;
│ │ │ +
336 });
│ │ │ +
337 return multiIndices;
│ │ │ +
338 }
│ │ │ +
339
│ │ │ +
340 std::tuple<SPB...> subPreBases_;
│ │ │ +
341};
│ │ │ +
│ │ │ +
342
│ │ │ +
343
│ │ │ +
344
│ │ │ +
345namespace BasisFactory {
│ │ │ +
346
│ │ │ +
347namespace Imp {
│ │ │ +
348
│ │ │ +
349template<class IndexMergingStrategy, class... ChildPreBasisFactory>
│ │ │ +
350class CompositePreBasisFactory
│ │ │ +
351{
│ │ │ +
352
│ │ │ +
353 template<class GridView, class... ChildPreBasis>
│ │ │ +
354 auto makePreBasisFromChildPreBases(const GridView&, ChildPreBasis&&... childPreBasis) const
│ │ │ +
355 {
│ │ │ +
356 return CompositePreBasis<IndexMergingStrategy, std::decay_t<ChildPreBasis>...>(std::forward<ChildPreBasis>(childPreBasis)...);
│ │ │ +
357 }
│ │ │ +
358
│ │ │ +
359public:
│ │ │ +
360
│ │ │ +
361 CompositePreBasisFactory(const ChildPreBasisFactory&... childPreBasisFactory) :
│ │ │ +
362 childPreBasisFactories_(childPreBasisFactory...)
│ │ │ +
363 {}
│ │ │ +
364
│ │ │ +
365 CompositePreBasisFactory(ChildPreBasisFactory&&... childPreBasisFactory) :
│ │ │ +
366 childPreBasisFactories_(std::move(childPreBasisFactory)...)
│ │ │ +
367 {}
│ │ │ +
368
│ │ │ +
369 template<class GridView>
│ │ │ +
370 auto operator()(const GridView& gridView) const
│ │ │ +
371 {
│ │ │ +
372 // Use std::apply to unpack the tuple childPreBasisFactories_
│ │ │ +
373 return std::apply([&](const auto&... childPreBasisFactory) {
│ │ │ +
374 return this->makePreBasisFromChildPreBases(gridView, childPreBasisFactory(gridView)...);
│ │ │ +
375 }, childPreBasisFactories_);
│ │ │ +
376 }
│ │ │ +
377
│ │ │ +
378private:
│ │ │ +
379 std::tuple<ChildPreBasisFactory...> childPreBasisFactories_;
│ │ │ +
380};
│ │ │ +
381
│ │ │ +
382} // end namespace BasisFactory::Imp
│ │ │ +
383
│ │ │ +
384
│ │ │ +
385
│ │ │ +
396template<
│ │ │ +
397 typename... Args,
│ │ │ +
398 std::enable_if_t<Concept::isIndexMergingStrategy<typename LastType<Args...>::type>(),int> = 0>
│ │ │ +
│ │ │ +
399auto composite(Args&&... args)
│ │ │ +
400{
│ │ │ +
401 // We have to separate the last entry which is the IndexMergingStrategy
│ │ │ +
402 // and the preceding ones, which are the ChildPreBasisFactories
│ │ │ +
403
│ │ │ +
404 using ArgTuple = std::tuple<std::decay_t<Args>...>;
│ │ │ +
405
│ │ │ +
406 // Compute number of children and index of the IndexMergingStrategy argument
│ │ │ +
407 constexpr std::size_t children = sizeof...(Args) - 1;
│ │ │ +
408
│ │ │ +
409 // Use last type as IndexMergingStrategy
│ │ │ +
410 using IndexMergingStrategy = std::tuple_element_t<children, ArgTuple>;
│ │ │ +
411
│ │ │ +
412 // Index sequence for all but the last entry for partial tuple unpacking
│ │ │ +
413 auto childIndices = std::make_index_sequence<children>{};
│ │ │ +
414
│ │ │ +
415 // Unpack tuple only for those entries related to children
│ │ │ +
416 return applyPartial([](auto&&... childPreBasisFactory){
│ │ │ +
417 return Imp::CompositePreBasisFactory<IndexMergingStrategy, std::decay_t<decltype(childPreBasisFactory)>...>(std::forward<decltype(childPreBasisFactory)>(childPreBasisFactory)...);
│ │ │ +
418 },
│ │ │ +
419 std::forward_as_tuple(std::forward<Args>(args)...),
│ │ │ +
420 childIndices);
│ │ │ +
421}
│ │ │ +
│ │ │ +
422
│ │ │ +
434template<
│ │ │ +
435 typename... Args,
│ │ │ +
436 std::enable_if_t<not Concept::isIndexMergingStrategy<typename LastType<Args...>::type>(),int> = 0>
│ │ │ +
437[[deprecated("Using the method `composite` without an explicit index merging strategy"
│ │ │ +
438 " will change its meaning after the release of dune-functions 2.11."
│ │ │ +
439 " Previously, the default merging strategy was `BlockedLexicographic`,"
│ │ │ +
440 " but this will change to `FlatLexicographic`."
│ │ │ +
441 " Change the call to `composite(..., blockedLexicographic())` to retain the old behavior.")]]
│ │ │ +
│ │ │ +
442auto composite(Args&&... args)
│ │ │ +
443{
│ │ │ +
444 return Imp::CompositePreBasisFactory<BasisFactory::BlockedLexicographic, std::decay_t<Args>...>(std::forward<Args>(args)...);
│ │ │ +
445}
│ │ │ +
│ │ │ +
446
│ │ │ +
447} // end namespace BasisFactory
│ │ │ +
448
│ │ │ +
449
│ │ │ +
450
│ │ │ +
451} // end namespace Functions
│ │ │ +
452} // end namespace Dune
│ │ │ +
453
│ │ │ +
454
│ │ │ +
455#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
Lightweight representation of (hierarchical) size and block structure extracted from a basis to descr...
│ │ │ +
auto composite(Args &&... args)
Create a factory builder that can build a CompositePreBasis.
Definition compositebasis.hh:399
│ │ │ +
void staticFindInRange(F &&f, Args &&... args)
Static find loop.
Definition staticforloop.hh:60
│ │ │ +
std::enable_if_t< std::is_constructible_v< T, Args... >, int > enableIfConstructible
Helper to constrain forwarding constructors.
Definition type_traits.hh:30
│ │ │ +
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │
auto containerDescriptor(const PreBasis &preBasis)
Return the container descriptor of the pre-basis, if defined, otherwise ContainerDescriptor::Unknown.
Definition containerdescriptors.hh:58
│ │ │ +
static constexpr bool isIndexMergingStrategy()
Definition basistags.hh:27
│ │ │
Definition containerfactory.hh:20
│ │ │ -
UniformArray< Value, n > FlatArray
Alias for a uniform array storing value placeholders.
Definition containerdescriptors.hh:143
│ │ │ -
auto makeUniformDescriptor(std::integral_constant< std::size_t, n >, Child child)
Generate a uniform descriptor in case the size is a static constant.
Definition containerdescriptors.hh:147
│ │ │ -
UniformVector< Value > FlatVector
Alias for a uniform vector storing value placeholders.
Definition containerdescriptors.hh:184
│ │ │ -
Dune::TupleVector< Children... > Tuple
Descriptor with all children of possibly different type.
Definition containerdescriptors.hh:82
│ │ │ -
std::vector< Child > Vector
Descriptor for vectors with all children of the same type and dynamic size.
Definition containerdescriptors.hh:112
│ │ │ -
std::array< Child, n > Array
Descriptor for arrays with all children of the same type and static size.
Definition containerdescriptors.hh:98
│ │ │ -
auto makeDescriptor(Child0 child, Children... children)
Generate a descriptor in case the children are all of the same type.
Definition containerdescriptors.hh:103
│ │ │ -
Fallback container descriptor if nothing else fits.
Definition containerdescriptors.hh:52
│ │ │ -
The node in the descriptor tree representing a value placeholder.
Definition containerdescriptors.hh:71
│ │ │ -
static constexpr std::size_t size()
A value placeholder does not have any sub-descriptors, thus its size is zero.
Definition containerdescriptors.hh:77
│ │ │ -
Value operator[](const Index &) const
The child access method is only available for the interface, but should not be called.
Definition containerdescriptors.hh:74
│ │ │ -
Descriptor for arrays with all children identical and the number of children a static size.
Definition containerdescriptors.hh:117
│ │ │ -
static constexpr std::size_t size()
The static size information, i.e., number of children.
Definition containerdescriptors.hh:135
│ │ │ -
UniformArray()
Default constructor. Is enable if the child-type is default constructible.
Definition containerdescriptors.hh:121
│ │ │ -
UniformArray(Child child)
Constructor that stores a single child only.
Definition containerdescriptors.hh:126
│ │ │ -
const Child & operator[](const Index &) const
Access the i'th child that is always the same, i.e., child_.
Definition containerdescriptors.hh:132
│ │ │ -
Uniform descriptor with dynamic size.
Definition containerdescriptors.hh:156
│ │ │ -
UniformVector(std::size_t size, Child child)
Constructor that stores the size and a single child only.
Definition containerdescriptors.hh:166
│ │ │ -
std::size_t size() const
Definition containerdescriptors.hh:176
│ │ │ -
UniformVector(std::size_t size)
Default constructor with size. Is enable if the child-type is default constructible.
Definition containerdescriptors.hh:160
│ │ │ -
const Child & operator[](const Index &) const
Access the i'th child that is always the same, i.e., child_.
Definition containerdescriptors.hh:173
│ │ │ +
Definition argyrisbasis.hh:926
│ │ │ +
Get last entry of type list.
Definition utility.hh:230
│ │ │ +
Base class for index merging strategies to simplify detection.
Definition basistags.hh:48
│ │ │ +
Lexicographic merging of direct children without blocking.
Definition basistags.hh:84
│ │ │ +
A pre-basis for composite bases.
Definition compositebasis.hh:57
│ │ │ +
SubPreBasis< i > & subPreBasis(Dune::index_constant< i >={})
Mutable access to the stored prebasis of the factor in the power space.
Definition compositebasis.hh:255
│ │ │ +
IMS IndexMergingStrategy
Strategy used to merge the global indices of the child pre-bases.
Definition compositebasis.hh:75
│ │ │ +
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition compositebasis.hh:236
│ │ │ +
const SubPreBasis< i > & subPreBasis(Dune::index_constant< i >={}) const
Const access to the stored prebasis of the factor in the power space.
Definition compositebasis.hh:248
│ │ │ +
std::size_t size_type
Type used for indices and size information.
Definition compositebasis.hh:72
│ │ │ +
CompositeBasisNode< typename SPB::Node... > Node
Template mapping root tree path to type of created tree node.
Definition compositebasis.hh:85
│ │ │ +
size_type size(const SizePrefix &prefix) const
Return number of possible values for next position in multi index.
Definition compositebasis.hh:169
│ │ │ +
CompositePreBasis(SFArgs &&... sfArgs)
Constructor for given child pre-basis objects.
Definition compositebasis.hh:99
│ │ │ +
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition compositebasis.hh:225
│ │ │ +
CompositePreBasis(const GV &gv)
Constructor for given GridView.
Definition compositebasis.hh:119
│ │ │ +
It indices(const Node &node, It it) const
Maps from subtree index set [0..size-1] to a globally unique multi index in global basis.
Definition compositebasis.hh:268
│ │ │ +
size_type size() const
Same as size(prefix) with empty prefix.
Definition compositebasis.hh:162
│ │ │ +
typename std::tuple_element_t< 0, SubPreBases >::GridView GridView
The grid view that the FE basis is defined on.
Definition compositebasis.hh:69
│ │ │ +
static const std::size_t children
Definition compositebasis.hh:78
│ │ │ +
std::tuple< SPB... > SubPreBases
Tuple of child pre-bases.
Definition compositebasis.hh:62
│ │ │ +
Node makeNode() const
Create tree node.
Definition compositebasis.hh:152
│ │ │ +
void initializeIndices()
Initialize the global indices.
Definition compositebasis.hh:128
│ │ │ +
std::tuple_element_t< i, SubPreBases > SubPreBasis
Export individual child pre-bases by index.
Definition compositebasis.hh:66
│ │ │ +
std::make_index_sequence< children > ChildIndices
Definition compositebasis.hh:80
│ │ │ +
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition compositebasis.hh:142
│ │ │ +
static constexpr size_type multiIndexBufferSize
Definition compositebasis.hh:89
│ │ │ +
const auto & subPreBases() const
Const access to the stored prebases tuple.
Definition compositebasis.hh:261
│ │ │ +
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition compositebasis.hh:136
│ │ │ +
static constexpr size_type minMultiIndexSize
Definition compositebasis.hh:88
│ │ │ +
auto containerDescriptor() const
Return the associated container descriptor.
Definition compositebasis.hh:274
│ │ │ +
static constexpr size_type maxMultiIndexSize
Definition compositebasis.hh:87
│ │ │ + │ │ │ + │ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,468 +1,589 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -containerdescriptors.hh │ │ │ │ +compositebasis.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CONTAINERDESCRIPTORS_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CONTAINERDESCRIPTORS_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH │ │ │ │ +8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ -12#include │ │ │ │ -13#include │ │ │ │ -14#include │ │ │ │ -15 │ │ │ │ -16#include │ │ │ │ -17#include │ │ │ │ -18#include │ │ │ │ -19#include │ │ │ │ -20#include │ │ │ │ -21 │ │ │ │ -22#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ +12 │ │ │ │ +13#include │ │ │ │ +14#include │ │ │ │ +15#include │ │ │ │ +16#include │ │ │ │ +17#include │ │ │ │ +18#include │ │ │ │ +19 │ │ │ │ +20#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_s_t_a_t_i_c_f_o_r_l_o_o_p_._h_h> │ │ │ │ +21#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ +22#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ 23#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_b_a_s_i_s_t_a_g_s_._h_h> │ │ │ │ -24 │ │ │ │ -47 │ │ │ │ -48namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ -49namespace _C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s { │ │ │ │ -50 │ │ │ │ -_5_2struct _U_n_k_n_o_w_n {}; │ │ │ │ -53 │ │ │ │ -54} // end namespace ContainerDescriptors │ │ │ │ -55 │ │ │ │ -57template │ │ │ │ -_5_8auto _c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r(const PreBasis& preBasis) │ │ │ │ -59{ │ │ │ │ -60 if constexpr (requires{ preBasis.containerDescriptor(); }) │ │ │ │ -61 return preBasis.containerDescriptor(); │ │ │ │ -62 else │ │ │ │ -63 return _C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_k_n_o_w_n{}; │ │ │ │ -64} │ │ │ │ -65 │ │ │ │ -66 │ │ │ │ -67namespace ContainerDescriptors { │ │ │ │ -68 │ │ │ │ -_7_0struct _V_a_l_u_e │ │ │ │ -71{ │ │ │ │ -73 template │ │ │ │ -_7_4 _V_a_l_u_e _o_p_e_r_a_t_o_r_[_]_ (const Index&) const { return {}; } │ │ │ │ -75 │ │ │ │ -_7_7 static constexpr std::size_t _s_i_z_e () { return 0; } │ │ │ │ -78}; │ │ │ │ +24#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ +25#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +26#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h> │ │ │ │ +27#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ +28 │ │ │ │ +29 │ │ │ │ +30namespace _D_u_n_e { │ │ │ │ +31namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +32 │ │ │ │ +33/ │ │ │ │ +/ ***************************************************************************** │ │ │ │ +34// This is the reusable part of the composite bases. It contains │ │ │ │ +35// │ │ │ │ +36// CompositePreBasis │ │ │ │ +37// │ │ │ │ +38// The pre-basis allows to create the others and is the owner of possible │ │ │ │ +shared │ │ │ │ +39// state. These components do _not_ depend on the global basis and local view │ │ │ │ +40// and can be used without a global basis. │ │ │ │ +41/ │ │ │ │ +/ ***************************************************************************** │ │ │ │ +42 │ │ │ │ +43 │ │ │ │ +55template │ │ │ │ +_5_6class _C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s │ │ │ │ +57{ │ │ │ │ +58 static const bool isBlocked = std::is_same_v or std::is_same_v; │ │ │ │ +59public: │ │ │ │ +60 │ │ │ │ +_6_2 using _S_u_b_P_r_e_B_a_s_e_s = std::tuple; │ │ │ │ +63 │ │ │ │ +65 template │ │ │ │ +_6_6 using _S_u_b_P_r_e_B_a_s_i_s = std::tuple_element_t; │ │ │ │ +67 │ │ │ │ +_6_9 using _G_r_i_d_V_i_e_w = typename std::tuple_element_t<0, SubPreBases>::GridView; │ │ │ │ +70 │ │ │ │ +_7_2 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ +73 │ │ │ │ +_7_5 using _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y = IMS; │ │ │ │ +76 │ │ │ │ +77protected: │ │ │ │ +_7_8 static const std::size_t _c_h_i_l_d_r_e_n = sizeof...(SPB); │ │ │ │ 79 │ │ │ │ -81template │ │ │ │ -_8_2using _T_u_p_l_e = Dune::TupleVector; │ │ │ │ +_8_0 using _C_h_i_l_d_I_n_d_i_c_e_s = std::make_index_sequence; │ │ │ │ +81 │ │ │ │ +82public: │ │ │ │ 83 │ │ │ │ -86template 0), int> = 0, │ │ │ │ -88 std::enable_if_t<(...|| (not std::is_same_v)), int> = 0> │ │ │ │ -89auto _m_a_k_e_D_e_s_c_r_i_p_t_o_r (Child0 child0, Children... children) │ │ │ │ -90{ │ │ │ │ -91 using Descriptor = _T_u_p_l_e; │ │ │ │ -92 return Descriptor{std::move(child0),std::move(children)...}; │ │ │ │ -93} │ │ │ │ -94 │ │ │ │ -95 │ │ │ │ -97template │ │ │ │ -_9_8using _A_r_r_a_y = std::array; │ │ │ │ -99 │ │ │ │ -101template &&...), int> = 0> │ │ │ │ -_1_0_3auto _m_a_k_e_D_e_s_c_r_i_p_t_o_r (Child0 child, Children... children) │ │ │ │ -104{ │ │ │ │ -105 using Descriptor = _A_r_r_a_y; │ │ │ │ -106 return Descriptor{std::move(child),std::move(children)...}; │ │ │ │ -107} │ │ │ │ -108 │ │ │ │ -109 │ │ │ │ -111template │ │ │ │ -_1_1_2using _V_e_c_t_o_r = std::vector; │ │ │ │ -113 │ │ │ │ -115template │ │ │ │ -_1_1_6struct _U_n_i_f_o_r_m_A_r_r_a_y │ │ │ │ -117{ │ │ │ │ -119 template, int> = 0> │ │ │ │ -_1_2_1 _U_n_i_f_o_r_m_A_r_r_a_y () │ │ │ │ -122 : child_{} │ │ │ │ -123 {} │ │ │ │ -124 │ │ │ │ -_1_2_6 explicit _U_n_i_f_o_r_m_A_r_r_a_y (Child child) │ │ │ │ -127 : child_{std::move(child)} │ │ │ │ -128 {} │ │ │ │ -129 │ │ │ │ -131 template │ │ │ │ -_1_3_2 const Child& _o_p_e_r_a_t_o_r_[_]_ (const Index& /*i*/) const { return child_; } │ │ │ │ -133 │ │ │ │ -_1_3_5 static constexpr std::size_t _s_i_z_e () { return n; } │ │ │ │ -136 │ │ │ │ -137private: │ │ │ │ -138 Child child_; │ │ │ │ -139}; │ │ │ │ +_8_5 using _N_o_d_e = _C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e; │ │ │ │ +86 │ │ │ │ +_8_7 static constexpr _s_i_z_e___t_y_p_e _m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e = std::max({SPB:: │ │ │ │ +maxMultiIndexSize...}) + isBlocked; │ │ │ │ +_8_8 static constexpr _s_i_z_e___t_y_p_e _m_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e = std::min({SPB:: │ │ │ │ +minMultiIndexSize...}) + isBlocked; │ │ │ │ +_8_9 static constexpr _s_i_z_e___t_y_p_e _m_u_l_t_i_I_n_d_e_x_B_u_f_f_e_r_S_i_z_e = std::max({SPB:: │ │ │ │ +multiIndexBufferSize...}) + isBlocked; │ │ │ │ +90 │ │ │ │ +96 template = 0, │ │ │ │ +98 _e_n_a_b_l_e_I_f_C_o_n_s_t_r_u_c_t_i_b_l_e, SFArgs...> = 0> │ │ │ │ +_9_9 _C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s(SFArgs&&... sfArgs) : │ │ │ │ +100 subPreBases_(std::forward(sfArgs)...) │ │ │ │ +101 { │ │ │ │ +102 Hybrid::forEach(subPreBases_, [&](const auto& _s_u_b_P_r_e_B_a_s_i_s){ │ │ │ │ +103 static_assert(models, std::decay_t>(), "Subprebases passed to CompositePreBasis does not model the │ │ │ │ +PreBasis concept."); │ │ │ │ +104 }); │ │ │ │ +105 } │ │ │ │ +106 │ │ │ │ +113 template 1)>, // Avoid ambiguous constructor if │ │ │ │ +there's only one child │ │ │ │ +116 std::is_same, │ │ │ │ +117 std::is_constructible... │ │ │ │ +118 >, int> = 0> │ │ │ │ +_1_1_9 _C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s(const GV& gv) : │ │ │ │ +120 subPreBases_(SPB(gv)...) │ │ │ │ +121 { │ │ │ │ +122 Hybrid::forEach(subPreBases_, [&](const auto& _s_u_b_P_r_e_B_a_s_i_s){ │ │ │ │ +123 static_assert(models, std::decay_t>(), "Subprebases passed to CompositePreBasis does not model the │ │ │ │ +PreBasis concept."); │ │ │ │ +124 }); │ │ │ │ +125 } │ │ │ │ +126 │ │ │ │ +_1_2_8 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ +129 { │ │ │ │ +130 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto i) { │ │ │ │ +131 this->_s_u_b_P_r_e_B_a_s_i_s(i).initializeIndices(); │ │ │ │ +132 }); │ │ │ │ +133 } │ │ │ │ +134 │ │ │ │ +_1_3_6 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ +137 { │ │ │ │ +138 return std::get<0>(subPreBases_).gridView(); │ │ │ │ +139 } │ │ │ │ 140 │ │ │ │ -142template │ │ │ │ -_1_4_3using _F_l_a_t_A_r_r_a_y = _U_n_i_f_o_r_m_A_r_r_a_y_<_V_a_l_u_e_,_n_>; │ │ │ │ -144 │ │ │ │ -146template │ │ │ │ -_1_4_7auto _m_a_k_e_U_n_i_f_o_r_m_D_e_s_c_r_i_p_t_o_r (std::integral_constant, Child │ │ │ │ -child) │ │ │ │ -148{ │ │ │ │ -149 return _U_n_i_f_o_r_m_A_r_r_a_y_<_C_h_i_l_d_,_n_>{std::move(child)}; │ │ │ │ -150} │ │ │ │ -151 │ │ │ │ -152 │ │ │ │ -154template │ │ │ │ -_1_5_5struct _U_n_i_f_o_r_m_V_e_c_t_o_r │ │ │ │ -156{ │ │ │ │ -158 template, int> = 0> │ │ │ │ -_1_6_0 explicit _U_n_i_f_o_r_m_V_e_c_t_o_r (std::size_t _s_i_z_e) │ │ │ │ -161 : size_{_s_i_z_e} │ │ │ │ -162 , child_{} │ │ │ │ -163 {} │ │ │ │ -164 │ │ │ │ -_1_6_6 _U_n_i_f_o_r_m_V_e_c_t_o_r (std::size_t _s_i_z_e, Child child) │ │ │ │ -167 : size_{_s_i_z_e} │ │ │ │ -168 , child_{std::move(child)} │ │ │ │ -169 {} │ │ │ │ -170 │ │ │ │ -172 template │ │ │ │ -_1_7_3 const Child& _o_p_e_r_a_t_o_r_[_]_ (const Index& /*i*/) const { return child_; } │ │ │ │ -174 │ │ │ │ -_1_7_6 std::size_t _s_i_z_e () const { return size_; } │ │ │ │ -177 │ │ │ │ -178private: │ │ │ │ -179 std::size_t size_; │ │ │ │ -180 Child child_; │ │ │ │ -181}; │ │ │ │ -182 │ │ │ │ -_1_8_4using _F_l_a_t_V_e_c_t_o_r = _U_n_i_f_o_r_m_V_e_c_t_o_r_<_V_a_l_u_e_>; │ │ │ │ -185 │ │ │ │ -187template │ │ │ │ -_1_8_8auto _m_a_k_e_U_n_i_f_o_r_m_D_e_s_c_r_i_p_t_o_r (std::size_t n, Child child) │ │ │ │ -189{ │ │ │ │ -190 return _U_n_i_f_o_r_m_V_e_c_t_o_r_<_C_h_i_l_d_>{n,std::move(child)}; │ │ │ │ -191} │ │ │ │ -192 │ │ │ │ -193namespace Impl { │ │ │ │ -194 │ │ │ │ -195template │ │ │ │ -196struct TreeTransform │ │ │ │ -197{ │ │ │ │ -198 TreeTransform (const InnerFunc& innerFunc, const LeafFunc& leafFunc) │ │ │ │ -199 : innerFunc_(innerFunc) │ │ │ │ -200 , leafFunc_(leafFunc) │ │ │ │ -201 {} │ │ │ │ -202 │ │ │ │ -203 Unknown operator() (const Unknown& tree) const │ │ │ │ -204 { │ │ │ │ -205 return tree; │ │ │ │ -206 } │ │ │ │ -207 │ │ │ │ -208 auto operator() (const Value& tree) const │ │ │ │ -209 { │ │ │ │ -210 return leafFunc_(tree); │ │ │ │ -211 } │ │ │ │ -212 │ │ │ │ -213 template │ │ │ │ -214 auto operator() (const _T_u_p_l_e_<_V_._._._>& tree) const │ │ │ │ -215 { │ │ │ │ -216 return unpackIntegerSequence([&](auto... ii) { │ │ │ │ -217 return _m_a_k_e_D_e_s_c_r_i_p_t_o_r(innerFunc_(tree[ii])...); │ │ │ │ -218 }, std::make_index_sequence()); │ │ │ │ -219 } │ │ │ │ -220 │ │ │ │ -221 template │ │ │ │ -222 auto operator() (const _A_r_r_a_y_<_V_,_n_>& tree) const │ │ │ │ -223 { │ │ │ │ -224 return unpackIntegerSequence([&](auto... ii) { │ │ │ │ -225 return _m_a_k_e_D_e_s_c_r_i_p_t_o_r(innerFunc_(tree[ii])...); │ │ │ │ -226 }, std::make_index_sequence()); │ │ │ │ -227 } │ │ │ │ -228 │ │ │ │ -229 template │ │ │ │ -230 auto operator() (const _V_e_c_t_o_r_<_V_>& tree) const │ │ │ │ -231 { │ │ │ │ -232 using W = decltype(innerFunc_(tree[0])); │ │ │ │ -233 _V_e_c_t_o_r_<_W_> result; │ │ │ │ -234 result.reserve(tree.size()); │ │ │ │ -235 for (std::size_t i = 0; i < tree.size(); ++i) │ │ │ │ -236 result.emplace_back(innerFunc_(tree[i])); │ │ │ │ -237 return result; │ │ │ │ -238 } │ │ │ │ -239 │ │ │ │ -240 template │ │ │ │ -241 auto operator() (const UniformArray& tree) const │ │ │ │ -242 { │ │ │ │ -243 return _m_a_k_e_U_n_i_f_o_r_m_D_e_s_c_r_i_p_t_o_r(Dune::index_constant{}, innerFunc_(tree │ │ │ │ -[0])); │ │ │ │ +_1_4_2 void _u_p_d_a_t_e(const _G_r_i_d_V_i_e_w& gv) │ │ │ │ +143 { │ │ │ │ +144 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto i) { │ │ │ │ +145 this->_s_u_b_P_r_e_B_a_s_i_s(i).update(gv); │ │ │ │ +146 }); │ │ │ │ +147 } │ │ │ │ +148 │ │ │ │ +_1_5_2 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ +153 { │ │ │ │ +154 auto node = _N_o_d_e{}; │ │ │ │ +155 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto i) { │ │ │ │ +156 node.setChild(this->_s_u_b_P_r_e_B_a_s_i_s(i)._m_a_k_e_N_o_d_e(), i); │ │ │ │ +157 }); │ │ │ │ +158 return node; │ │ │ │ +159 } │ │ │ │ +160 │ │ │ │ +_1_6_2 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ +163 { │ │ │ │ +164 return _s_i_z_e(Dune::ReservedVector{}); │ │ │ │ +165 } │ │ │ │ +166 │ │ │ │ +168 template │ │ │ │ +_1_6_9 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix) const │ │ │ │ +170 { │ │ │ │ +171 return _s_i_z_e(prefix, _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y{}); │ │ │ │ +172 } │ │ │ │ +173 │ │ │ │ +174private: │ │ │ │ +175 │ │ │ │ +176 template │ │ │ │ +177 static void multiIndexPopFront(MultiIndex& M) │ │ │ │ +178 { │ │ │ │ +179 for(std::size_t i=0; i │ │ │ │ +185 _s_i_z_e___t_y_p_e _s_i_z_e(SizePrefix prefix, BasisFactory::BlockedLexicographic) const │ │ │ │ +186 { │ │ │ │ +187 if (prefix.size() == 0) │ │ │ │ +188 return _c_h_i_l_d_r_e_n; │ │ │ │ +189 │ │ │ │ +190 auto front = prefix.front(); │ │ │ │ +191 multiIndexPopFront(prefix); │ │ │ │ +192 return Hybrid::switchCases(_C_h_i_l_d_I_n_d_i_c_e_s(), front, [&] (auto i) { │ │ │ │ +193 return this->_s_u_b_P_r_e_B_a_s_i_s(i).size(prefix); │ │ │ │ +194 }, []() { │ │ │ │ +195 return _s_i_z_e___t_y_p_e(0); │ │ │ │ +196 }); │ │ │ │ +197 } │ │ │ │ +198 │ │ │ │ +199 template │ │ │ │ +200 _s_i_z_e___t_y_p_e _s_i_z_e(SizePrefix prefix, BasisFactory::FlatLexicographic) const │ │ │ │ +201 { │ │ │ │ +202 _s_i_z_e___t_y_p_e result = 0; │ │ │ │ +203 if (prefix.size() == 0) │ │ │ │ +204 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto i) { │ │ │ │ +205 result += this->_s_u_b_P_r_e_B_a_s_i_s(i).size(); │ │ │ │ +206 }); │ │ │ │ +207 else { │ │ │ │ +208 _s_t_a_t_i_c_F_i_n_d_I_n_R_a_n_g_e_<_0_,_ _c_h_i_l_d_r_e_n_>([&](auto i) { │ │ │ │ +209 auto firstDigitSize = this->_s_u_b_P_r_e_B_a_s_i_s(i).size(); │ │ │ │ +210 if (prefix[0] < firstDigitSize) │ │ │ │ +211 { │ │ │ │ +212 result = this->_s_u_b_P_r_e_B_a_s_i_s(i).size(prefix); │ │ │ │ +213 return true; │ │ │ │ +214 } │ │ │ │ +215 prefix[0] -= firstDigitSize; │ │ │ │ +216 return false; │ │ │ │ +217 }); │ │ │ │ +218 } │ │ │ │ +219 return result; │ │ │ │ +220 } │ │ │ │ +221 │ │ │ │ +222public: │ │ │ │ +223 │ │ │ │ +_2_2_5 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ +226 { │ │ │ │ +227 _s_i_z_e___t_y_p_e r=0; │ │ │ │ +228 // Accumulate dimension() for all subprebases │ │ │ │ +229 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto i) { │ │ │ │ +230 r += this->_s_u_b_P_r_e_B_a_s_i_s(i).dimension(); │ │ │ │ +231 }); │ │ │ │ +232 return r; │ │ │ │ +233 } │ │ │ │ +234 │ │ │ │ +_2_3_6 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ +237 { │ │ │ │ +238 _s_i_z_e___t_y_p_e r=0; │ │ │ │ +239 // Accumulate maxNodeSize() for all subprebases │ │ │ │ +240 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto i) { │ │ │ │ +241 r += this->_s_u_b_P_r_e_B_a_s_i_s(i).maxNodeSize(); │ │ │ │ +242 }); │ │ │ │ +243 return r; │ │ │ │ 244 } │ │ │ │ 245 │ │ │ │ -246 template │ │ │ │ -247 auto operator() (const UniformVector& tree) const │ │ │ │ -248 { │ │ │ │ -249 return _m_a_k_e_U_n_i_f_o_r_m_D_e_s_c_r_i_p_t_o_r(tree.size(), innerFunc_(tree[0])); │ │ │ │ -250 } │ │ │ │ -251 │ │ │ │ -252private: │ │ │ │ -253 InnerFunc innerFunc_; │ │ │ │ -254 LeafFunc leafFunc_; │ │ │ │ -255}; │ │ │ │ -256 │ │ │ │ -257 │ │ │ │ -268template │ │ │ │ -269auto appendToTree (Size s, const T& tree) │ │ │ │ -270{ │ │ │ │ -271 auto transform = TreeTransform( │ │ │ │ -272 [s](auto&& node) { return appendToTree(s, node); }, │ │ │ │ -273 [s](auto&& node) { return _m_a_k_e_U_n_i_f_o_r_m_D_e_s_c_r_i_p_t_o_r(s, node); }); │ │ │ │ -274 return transform(tree); │ │ │ │ -275} │ │ │ │ -276 │ │ │ │ -278template │ │ │ │ -279auto flatLexicographic (Child... child) │ │ │ │ -280{ │ │ │ │ -281 if constexpr ((std::is_same_v && ...)) │ │ │ │ -282 return _F_l_a_t_V_e_c_t_o_r((child.size() + ...)); │ │ │ │ -283 else │ │ │ │ -284 return Unknown{}; │ │ │ │ -285} │ │ │ │ -286 │ │ │ │ -288template │ │ │ │ -289auto flatLexicographicN (N n, Child child) │ │ │ │ -290{ │ │ │ │ -291 return Unknown{}; │ │ │ │ -292} │ │ │ │ -293 │ │ │ │ -295template │ │ │ │ -296auto flatLexicographicN (N n, UniformVector child) │ │ │ │ -297{ │ │ │ │ -298 return UniformVector{child.size()*n, child[0]}; │ │ │ │ -299} │ │ │ │ -300 │ │ │ │ -302template │ │ │ │ -303auto flatLexicographicN (N n, UniformArray child) │ │ │ │ -304{ │ │ │ │ -305 if constexpr (std::is_same_v) │ │ │ │ -306 return UniformVector{n*m, child[0]}; │ │ │ │ -307 else │ │ │ │ -308 return UniformArray{child[0]}; │ │ │ │ -309} │ │ │ │ -310 │ │ │ │ -312template │ │ │ │ -313auto flatLexicographicN (N n, _V_e_c_t_o_r_<_G_r_a_n_d_C_h_i_l_d_> child) │ │ │ │ -314{ │ │ │ │ -315 auto result = _V_e_c_t_o_r_<_G_r_a_n_d_C_h_i_l_d_>{}; │ │ │ │ -316 result.reserve(child.size()*n); │ │ │ │ -317 for (auto j : Dune::range(n)) │ │ │ │ -318 for (auto i : Dune::range(child.size())) │ │ │ │ -319 result.emplace_back(child[i]); │ │ │ │ -320 return result; │ │ │ │ -321} │ │ │ │ +247 template │ │ │ │ +_2_4_8 const _S_u_b_P_r_e_B_a_s_i_s_<_i_>& _s_u_b_P_r_e_B_a_s_i_s(Dune::index_constant = {}) const │ │ │ │ +249 { │ │ │ │ +250 return std::get(subPreBases_); │ │ │ │ +251 } │ │ │ │ +252 │ │ │ │ +254 template │ │ │ │ +_2_5_5 _S_u_b_P_r_e_B_a_s_i_s_<_i_>& _s_u_b_P_r_e_B_a_s_i_s(Dune::index_constant = {}) │ │ │ │ +256 { │ │ │ │ +257 return std::get(subPreBases_); │ │ │ │ +258 } │ │ │ │ +259 │ │ │ │ +_2_6_1 const auto& _s_u_b_P_r_e_B_a_s_e_s() const │ │ │ │ +262 { │ │ │ │ +263 return subPreBases_; │ │ │ │ +264 } │ │ │ │ +265 │ │ │ │ +267 template │ │ │ │ +_2_6_8 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ +269 { │ │ │ │ +270 return _i_n_d_i_c_e_s(node, it, _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y{}); │ │ │ │ +271 } │ │ │ │ +272 │ │ │ │ +_2_7_4 auto _c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r() const │ │ │ │ +275 { │ │ │ │ +276 namespace CD = _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s; │ │ │ │ +277 if constexpr(std::is_same_v) { │ │ │ │ +278 return std::apply([&](auto const&... spb) { │ │ │ │ +279 return CD::makeDescriptor(_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r(spb)...); │ │ │ │ +280 }, subPreBases_); │ │ │ │ +281 } │ │ │ │ +282 else if constexpr(std::is_same_v) { │ │ │ │ +283 return std::apply([&](auto const&... spb) { │ │ │ │ +284 return CD::Impl::flatLexicographic(_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r │ │ │ │ +(spb)...); │ │ │ │ +285 }, subPreBases_); │ │ │ │ +286 } │ │ │ │ +287 else │ │ │ │ +288 return CD::Unknown{}; │ │ │ │ +289 } │ │ │ │ +290 │ │ │ │ +291private: │ │ │ │ +292 │ │ │ │ +293 template │ │ │ │ +294 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It multiIndices, _B_a_s_i_s_F_a_c_t_o_r_y_:_: │ │ │ │ +_F_l_a_t_L_e_x_i_c_o_g_r_a_p_h_i_c) const │ │ │ │ +295 { │ │ │ │ +296 _s_i_z_e___t_y_p_e firstComponentOffset = 0; │ │ │ │ +297 // Loop over all children │ │ │ │ +298 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto child){ │ │ │ │ +299 _s_i_z_e___t_y_p_e subTreeSize = node.child(child).size(); │ │ │ │ +300 // Fill indices for current child into index buffer starting from current │ │ │ │ +301 // buffer position and shift first index component of any index for current │ │ │ │ +302 // child by suitable offset to get lexicographic indices. │ │ │ │ +303 _s_u_b_P_r_e_B_a_s_i_s(child).indices(node.child(child), multiIndices); │ │ │ │ +304 for (std::size_t i = 0; i │ │ │ │ +315 static void multiIndexPushFront(MultiIndex& M, _s_i_z_e___t_y_p_e M0) │ │ │ │ +316 { │ │ │ │ +317 M.resize(M.size()+1); │ │ │ │ +318 for(std::size_t i=M.size()-1; i>0; --i) │ │ │ │ +319 M[i] = M[i-1]; │ │ │ │ +320 M[0] = M0; │ │ │ │ +321 } │ │ │ │ 322 │ │ │ │ -324template │ │ │ │ -325auto flatLexicographicN (N n, _A_r_r_a_y_<_G_r_a_n_d_C_h_i_l_d_,_ _m_> child) │ │ │ │ -326{ │ │ │ │ -327 if constexpr (std::is_same_v) │ │ │ │ -328 { │ │ │ │ -329 auto result = _V_e_c_t_o_r_<_G_r_a_n_d_C_h_i_l_d_>{}; │ │ │ │ -330 result.reserve(child.size()*n); │ │ │ │ -331 for (auto j : Dune::range(n)) │ │ │ │ -332 for (auto i : Dune::range(child.size())) │ │ │ │ -333 result.emplace_back(child[i]); │ │ │ │ -334 return result; │ │ │ │ -335 } │ │ │ │ -336 else │ │ │ │ -337 { │ │ │ │ -338 auto result = _A_r_r_a_y_<_G_r_a_n_d_C_h_i_l_d_,_ _N_:_:_v_a_l_u_e_*_m_>{}; │ │ │ │ -339 for (auto j : Dune::range(n)) │ │ │ │ -340 for (auto i : Dune::range(child.size())) │ │ │ │ -341 result.emplace_back(child[i]); │ │ │ │ -342 return result; │ │ │ │ -343 } │ │ │ │ -344} │ │ │ │ -345 │ │ │ │ -347template │ │ │ │ -348auto flatLexicographicN (N n, _T_u_p_l_e_<_G_r_a_n_d_C_h_i_l_d_._._._> child) │ │ │ │ -349{ │ │ │ │ -350 constexpr std::size_t m = sizeof...(GrandChild); │ │ │ │ -351 return Dune::unpackIntegerSequence([&](auto... i) { │ │ │ │ -352 return _m_a_k_e_D_e_s_c_r_i_p_t_o_r(std::get(child)...); │ │ │ │ -353 }, std::make_index_sequence{}); │ │ │ │ -354} │ │ │ │ -355 │ │ │ │ -357template │ │ │ │ -358auto flatInterleavedN (N n, Child child) │ │ │ │ -359{ │ │ │ │ -360 return Unknown{}; │ │ │ │ -361} │ │ │ │ -362 │ │ │ │ -364template │ │ │ │ -365auto flatInterleavedN (N n, UniformVector child) │ │ │ │ -366{ │ │ │ │ -367 return UniformVector{child.size()*n, child[0]}; │ │ │ │ -368} │ │ │ │ -369 │ │ │ │ -371template │ │ │ │ -372auto flatInterleavedN (N n, UniformArray child) │ │ │ │ -373{ │ │ │ │ -374 if constexpr (std::is_integral_v) │ │ │ │ -375 return UniformVector{n*m, child[0]}; │ │ │ │ -376 else │ │ │ │ -377 return UniformArray{child[0]}; │ │ │ │ -378} │ │ │ │ -379 │ │ │ │ -381template │ │ │ │ -382auto flatInterleavedN (N n, _V_e_c_t_o_r_<_G_r_a_n_d_C_h_i_l_d_> child) │ │ │ │ -383{ │ │ │ │ -384 auto result = _V_e_c_t_o_r_<_G_r_a_n_d_C_h_i_l_d_>{}; │ │ │ │ -385 result.reserve(child.size()*n); │ │ │ │ -386 for (auto i : Dune::range(child.size())) │ │ │ │ -387 for (auto j : Dune::range(n)) │ │ │ │ -388 result.emplace_back(child[i]); │ │ │ │ -389 return result; │ │ │ │ -390} │ │ │ │ -391 │ │ │ │ -393template │ │ │ │ -394auto flatInterleavedN (N n, _A_r_r_a_y_<_G_r_a_n_d_C_h_i_l_d_,_ _m_> child) │ │ │ │ -395{ │ │ │ │ -396 if constexpr (std::is_integral_v) │ │ │ │ -397 { │ │ │ │ -398 auto result = _V_e_c_t_o_r_<_G_r_a_n_d_C_h_i_l_d_>{}; │ │ │ │ -399 result.reserve(child.size()*n); │ │ │ │ -400 for (auto i : Dune::range(child.size())) │ │ │ │ -401 for (auto j : Dune::range(n)) │ │ │ │ -402 result.emplace_back(child[i]); │ │ │ │ -403 return result; │ │ │ │ -404 } │ │ │ │ -405 else │ │ │ │ -406 { │ │ │ │ -407 auto result = _A_r_r_a_y_<_G_r_a_n_d_C_h_i_l_d_,_ _N_:_:_v_a_l_u_e_*_m_>{}; │ │ │ │ -408 for (auto i : Dune::range(child.size())) │ │ │ │ -409 for (auto j : Dune::range(n)) │ │ │ │ -410 result.emplace_back(child[i]); │ │ │ │ -411 return result; │ │ │ │ -412 } │ │ │ │ -413} │ │ │ │ +323 template │ │ │ │ +324 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It multiIndices, BasisFactory:: │ │ │ │ +BlockedLexicographic) const │ │ │ │ +325 { │ │ │ │ +326 // Loop over all children │ │ │ │ +327 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto child){ │ │ │ │ +328 _s_i_z_e___t_y_p_e subTreeSize = node.child(child).size(); │ │ │ │ +329 // Fill indices for current child into index buffer starting from current │ │ │ │ +position │ │ │ │ +330 _s_u_b_P_r_e_B_a_s_i_s(child).indices(node.child(child), multiIndices); │ │ │ │ +331 // Insert child index before first component of all indices of current │ │ │ │ +child. │ │ │ │ +332 for (std::size_t i = 0; imultiIndexPushFront(multiIndices[i], child); │ │ │ │ +334 // Increment buffer iterator by the number of indices processed for current │ │ │ │ +child │ │ │ │ +335 multiIndices += subTreeSize; │ │ │ │ +336 }); │ │ │ │ +337 return multiIndices; │ │ │ │ +338 } │ │ │ │ +339 │ │ │ │ +340 std::tuple subPreBases_; │ │ │ │ +341}; │ │ │ │ +342 │ │ │ │ +343 │ │ │ │ +344 │ │ │ │ +345namespace _B_a_s_i_s_F_a_c_t_o_r_y { │ │ │ │ +346 │ │ │ │ +347namespace Imp { │ │ │ │ +348 │ │ │ │ +349template │ │ │ │ +350class CompositePreBasisFactory │ │ │ │ +351{ │ │ │ │ +352 │ │ │ │ +353 template │ │ │ │ +354 auto makePreBasisFromChildPreBases(const GridView&, ChildPreBasis&&... │ │ │ │ +childPreBasis) const │ │ │ │ +355 { │ │ │ │ +356 return CompositePreBasis...>(std::forward(childPreBasis)...); │ │ │ │ +357 } │ │ │ │ +358 │ │ │ │ +359public: │ │ │ │ +360 │ │ │ │ +361 CompositePreBasisFactory(const ChildPreBasisFactory&... │ │ │ │ +childPreBasisFactory) : │ │ │ │ +362 childPreBasisFactories_(childPreBasisFactory...) │ │ │ │ +363 {} │ │ │ │ +364 │ │ │ │ +365 CompositePreBasisFactory(ChildPreBasisFactory&&... childPreBasisFactory) : │ │ │ │ +366 childPreBasisFactories_(std::move(childPreBasisFactory)...) │ │ │ │ +367 {} │ │ │ │ +368 │ │ │ │ +369 template │ │ │ │ +370 auto operator()(const GridView& gridView) const │ │ │ │ +371 { │ │ │ │ +372 // Use std::apply to unpack the tuple childPreBasisFactories_ │ │ │ │ +373 return std::apply([&](const auto&... childPreBasisFactory) { │ │ │ │ +374 return this->makePreBasisFromChildPreBases(gridView, childPreBasisFactory │ │ │ │ +(gridView)...); │ │ │ │ +375 }, childPreBasisFactories_); │ │ │ │ +376 } │ │ │ │ +377 │ │ │ │ +378private: │ │ │ │ +379 std::tuple childPreBasisFactories_; │ │ │ │ +380}; │ │ │ │ +381 │ │ │ │ +382} // end namespace BasisFactory::Imp │ │ │ │ +383 │ │ │ │ +384 │ │ │ │ +385 │ │ │ │ +396template< │ │ │ │ +397 typename... Args, │ │ │ │ +398 std::enable_if_t<_C_o_n_c_e_p_t_:_:_i_s_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y::type>(),int> = 0> │ │ │ │ +_3_9_9auto _c_o_m_p_o_s_i_t_e(Args&&... args) │ │ │ │ +400{ │ │ │ │ +401 // We have to separate the last entry which is the IndexMergingStrategy │ │ │ │ +402 // and the preceding ones, which are the ChildPreBasisFactories │ │ │ │ +403 │ │ │ │ +404 using ArgTuple = std::tuple...>; │ │ │ │ +405 │ │ │ │ +406 // Compute number of children and index of the IndexMergingStrategy │ │ │ │ +argument │ │ │ │ +407 constexpr std::size_t children = sizeof...(Args) - 1; │ │ │ │ +408 │ │ │ │ +409 // Use last type as IndexMergingStrategy │ │ │ │ +410 using _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y = std::tuple_element_t; │ │ │ │ +411 │ │ │ │ +412 // Index sequence for all but the last entry for partial tuple unpacking │ │ │ │ +413 auto childIndices = std::make_index_sequence{}; │ │ │ │ 414 │ │ │ │ -416template │ │ │ │ -417auto flatInterleavedN (N n, _T_u_p_l_e_<_G_r_a_n_d_C_h_i_l_d_._._._> child) │ │ │ │ -418{ │ │ │ │ -419 constexpr std::size_t m = sizeof...(GrandChild); │ │ │ │ -420 return Dune::unpackIntegerSequence([&](auto... i) { │ │ │ │ -421 return _m_a_k_e_D_e_s_c_r_i_p_t_o_r(std::get(child)...); │ │ │ │ -422 }, std::make_index_sequence{}); │ │ │ │ -423} │ │ │ │ -424 │ │ │ │ -425} // end namespace Impl │ │ │ │ -426} // end namespace ContainerDescriptors │ │ │ │ -427} // end namespace Dune::Functions │ │ │ │ -428 │ │ │ │ -429#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CONTAINERDESCRIPTORS_HH │ │ │ │ -_b_a_s_i_s_t_a_g_s_._h_h │ │ │ │ +415 // Unpack tuple only for those entries related to children │ │ │ │ +416 return applyPartial([](auto&&... childPreBasisFactory){ │ │ │ │ +417 return Imp::CompositePreBasisFactory<_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y, std:: │ │ │ │ +decay_t...>(std::forward(childPreBasisFactory)...); │ │ │ │ +418 }, │ │ │ │ +419 std::forward_as_tuple(std::forward(args)...), │ │ │ │ +420 childIndices); │ │ │ │ +421} │ │ │ │ +422 │ │ │ │ +434template< │ │ │ │ +435 typename... Args, │ │ │ │ +436 std::enable_if_t::type>(),int> = 0> │ │ │ │ +437[[deprecated("Using the method `composite` without an explicit index merging │ │ │ │ +strategy" │ │ │ │ +438 " will change its meaning after the release of dune-functions 2.11." │ │ │ │ +439 " Previously, the default merging strategy was `BlockedLexicographic`," │ │ │ │ +440 " but this will change to `FlatLexicographic`." │ │ │ │ +441 " Change the call to `composite(..., blockedLexicographic())` to retain the │ │ │ │ +old behavior.")]] │ │ │ │ +_4_4_2auto _c_o_m_p_o_s_i_t_e(Args&&... args) │ │ │ │ +443{ │ │ │ │ +444 return Imp::CompositePreBasisFactory...>(std::forward(args)...); │ │ │ │ +445} │ │ │ │ +446 │ │ │ │ +447} // end namespace BasisFactory │ │ │ │ +448 │ │ │ │ +449 │ │ │ │ +450 │ │ │ │ +451} // end namespace Functions │ │ │ │ +452} // end namespace Dune │ │ │ │ +453 │ │ │ │ +454 │ │ │ │ +455#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH │ │ │ │ +_u_t_i_l_i_t_y_._h_h │ │ │ │ _t_y_p_e___t_r_a_i_t_s_._h_h │ │ │ │ +_s_t_a_t_i_c_f_o_r_l_o_o_p_._h_h │ │ │ │ +_n_o_d_e_s_._h_h │ │ │ │ +_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ +_b_a_s_i_s_t_a_g_s_._h_h │ │ │ │ +_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h │ │ │ │ +Lightweight representation of (hierarchical) size and block structure extracted │ │ │ │ +from a basis to descr... │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_c_o_m_p_o_s_i_t_e │ │ │ │ +auto composite(Args &&... args) │ │ │ │ +Create a factory builder that can build a CompositePreBasis. │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:399 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_s_t_a_t_i_c_F_i_n_d_I_n_R_a_n_g_e │ │ │ │ +void staticFindInRange(F &&f, Args &&... args) │ │ │ │ +Static find loop. │ │ │ │ +DDeeffiinniittiioonn staticforloop.hh:60 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_e_n_a_b_l_e_I_f_C_o_n_s_t_r_u_c_t_i_b_l_e │ │ │ │ +std::enable_if_t< std::is_constructible_v< T, Args... >, int > │ │ │ │ +enableIfConstructible │ │ │ │ +Helper to constrain forwarding constructors. │ │ │ │ +DDeeffiinniittiioonn type_traits.hh:30 │ │ │ │ +_D_u_n_e │ │ │ │ +DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r │ │ │ │ auto containerDescriptor(const PreBasis &preBasis) │ │ │ │ Return the container descriptor of the pre-basis, if defined, otherwise │ │ │ │ ContainerDescriptor::Unknown. │ │ │ │ DDeeffiinniittiioonn containerdescriptors.hh:58 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ +static constexpr bool isIndexMergingStrategy() │ │ │ │ +DDeeffiinniittiioonn basistags.hh:27 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s │ │ │ │ DDeeffiinniittiioonn containerfactory.hh:20 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_F_l_a_t_A_r_r_a_y │ │ │ │ -UniformArray< Value, n > FlatArray │ │ │ │ -Alias for a uniform array storing value placeholders. │ │ │ │ -DDeeffiinniittiioonn containerdescriptors.hh:143 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_m_a_k_e_U_n_i_f_o_r_m_D_e_s_c_r_i_p_t_o_r │ │ │ │ -auto makeUniformDescriptor(std::integral_constant< std::size_t, n >, Child │ │ │ │ -child) │ │ │ │ -Generate a uniform descriptor in case the size is a static constant. │ │ │ │ -DDeeffiinniittiioonn containerdescriptors.hh:147 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_F_l_a_t_V_e_c_t_o_r │ │ │ │ -UniformVector< Value > FlatVector │ │ │ │ -Alias for a uniform vector storing value placeholders. │ │ │ │ -DDeeffiinniittiioonn containerdescriptors.hh:184 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_T_u_p_l_e │ │ │ │ -Dune::TupleVector< Children... > Tuple │ │ │ │ -Descriptor with all children of possibly different type. │ │ │ │ -DDeeffiinniittiioonn containerdescriptors.hh:82 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_V_e_c_t_o_r │ │ │ │ -std::vector< Child > Vector │ │ │ │ -Descriptor for vectors with all children of the same type and dynamic size. │ │ │ │ -DDeeffiinniittiioonn containerdescriptors.hh:112 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_A_r_r_a_y │ │ │ │ -std::array< Child, n > Array │ │ │ │ -Descriptor for arrays with all children of the same type and static size. │ │ │ │ -DDeeffiinniittiioonn containerdescriptors.hh:98 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_m_a_k_e_D_e_s_c_r_i_p_t_o_r │ │ │ │ -auto makeDescriptor(Child0 child, Children... children) │ │ │ │ -Generate a descriptor in case the children are all of the same type. │ │ │ │ -DDeeffiinniittiioonn containerdescriptors.hh:103 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_k_n_o_w_n │ │ │ │ -Fallback container descriptor if nothing else fits. │ │ │ │ -DDeeffiinniittiioonn containerdescriptors.hh:52 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_V_a_l_u_e │ │ │ │ -The node in the descriptor tree representing a value placeholder. │ │ │ │ -DDeeffiinniittiioonn containerdescriptors.hh:71 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_V_a_l_u_e_:_:_s_i_z_e │ │ │ │ -static constexpr std::size_t size() │ │ │ │ -A value placeholder does not have any sub-descriptors, thus its size is zero. │ │ │ │ -DDeeffiinniittiioonn containerdescriptors.hh:77 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_V_a_l_u_e_:_:_o_p_e_r_a_t_o_r_[_] │ │ │ │ -Value operator[](const Index &) const │ │ │ │ -The child access method is only available for the interface, but should not be │ │ │ │ -called. │ │ │ │ -DDeeffiinniittiioonn containerdescriptors.hh:74 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_i_f_o_r_m_A_r_r_a_y │ │ │ │ -Descriptor for arrays with all children identical and the number of children a │ │ │ │ -static size. │ │ │ │ -DDeeffiinniittiioonn containerdescriptors.hh:117 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_i_f_o_r_m_A_r_r_a_y_:_:_s_i_z_e │ │ │ │ -static constexpr std::size_t size() │ │ │ │ -The static size information, i.e., number of children. │ │ │ │ -DDeeffiinniittiioonn containerdescriptors.hh:135 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_i_f_o_r_m_A_r_r_a_y_:_:_U_n_i_f_o_r_m_A_r_r_a_y │ │ │ │ -UniformArray() │ │ │ │ -Default constructor. Is enable if the child-type is default constructible. │ │ │ │ -DDeeffiinniittiioonn containerdescriptors.hh:121 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_i_f_o_r_m_A_r_r_a_y_:_:_U_n_i_f_o_r_m_A_r_r_a_y │ │ │ │ -UniformArray(Child child) │ │ │ │ -Constructor that stores a single child only. │ │ │ │ -DDeeffiinniittiioonn containerdescriptors.hh:126 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_i_f_o_r_m_A_r_r_a_y_:_:_o_p_e_r_a_t_o_r_[_] │ │ │ │ -const Child & operator[](const Index &) const │ │ │ │ -Access the i'th child that is always the same, i.e., child_. │ │ │ │ -DDeeffiinniittiioonn containerdescriptors.hh:132 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_i_f_o_r_m_V_e_c_t_o_r │ │ │ │ -Uniform descriptor with dynamic size. │ │ │ │ -DDeeffiinniittiioonn containerdescriptors.hh:156 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_i_f_o_r_m_V_e_c_t_o_r_:_:_U_n_i_f_o_r_m_V_e_c_t_o_r │ │ │ │ -UniformVector(std::size_t size, Child child) │ │ │ │ -Constructor that stores the size and a single child only. │ │ │ │ -DDeeffiinniittiioonn containerdescriptors.hh:166 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_i_f_o_r_m_V_e_c_t_o_r_<_ _V_a_l_u_e_ _>_:_:_s_i_z_e │ │ │ │ -std::size_t size() const │ │ │ │ -DDeeffiinniittiioonn containerdescriptors.hh:176 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_i_f_o_r_m_V_e_c_t_o_r_:_:_U_n_i_f_o_r_m_V_e_c_t_o_r │ │ │ │ -UniformVector(std::size_t size) │ │ │ │ -Default constructor with size. Is enable if the child-type is default │ │ │ │ -constructible. │ │ │ │ -DDeeffiinniittiioonn containerdescriptors.hh:160 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_i_f_o_r_m_V_e_c_t_o_r_:_:_o_p_e_r_a_t_o_r_[_] │ │ │ │ -const Child & operator[](const Index &) const │ │ │ │ -Access the i'th child that is always the same, i.e., child_. │ │ │ │ -DDeeffiinniittiioonn containerdescriptors.hh:173 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ +DDeeffiinniittiioonn argyrisbasis.hh:926 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_s_t_T_y_p_e │ │ │ │ +Get last entry of type list. │ │ │ │ +DDeeffiinniittiioonn utility.hh:230 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ +Base class for index merging strategies to simplify detection. │ │ │ │ +DDeeffiinniittiioonn basistags.hh:48 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_F_l_a_t_L_e_x_i_c_o_g_r_a_p_h_i_c │ │ │ │ +Lexicographic merging of direct children without blocking. │ │ │ │ +DDeeffiinniittiioonn basistags.hh:84 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s │ │ │ │ +A pre-basis for composite bases. │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:57 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_s_u_b_P_r_e_B_a_s_i_s │ │ │ │ +SubPreBasis< i > & subPreBasis(Dune::index_constant< i >={}) │ │ │ │ +Mutable access to the stored prebasis of the factor in the power space. │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:255 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ +IMS IndexMergingStrategy │ │ │ │ +Strategy used to merge the global indices of the child pre-bases. │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:75 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_m_a_x_N_o_d_e_S_i_z_e │ │ │ │ +size_type maxNodeSize() const │ │ │ │ +Get the maximal number of DOFs associated to node for any element. │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:236 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_s_u_b_P_r_e_B_a_s_i_s │ │ │ │ +const SubPreBasis< i > & subPreBasis(Dune::index_constant< i >={}) const │ │ │ │ +Const access to the stored prebasis of the factor in the power space. │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:248 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_s_i_z_e___t_y_p_e │ │ │ │ +std::size_t size_type │ │ │ │ +Type used for indices and size information. │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:72 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_N_o_d_e │ │ │ │ +CompositeBasisNode< typename SPB::Node... > Node │ │ │ │ +Template mapping root tree path to type of created tree node. │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:85 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ +size_type size(const SizePrefix &prefix) const │ │ │ │ +Return number of possible values for next position in multi index. │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:169 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s │ │ │ │ +CompositePreBasis(SFArgs &&... sfArgs) │ │ │ │ +Constructor for given child pre-basis objects. │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:99 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ +size_type dimension() const │ │ │ │ +Get the total dimension of the space spanned by this basis. │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:225 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s │ │ │ │ +CompositePreBasis(const GV &gv) │ │ │ │ +Constructor for given GridView. │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:119 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_i_n_d_i_c_e_s │ │ │ │ +It indices(const Node &node, It it) const │ │ │ │ +Maps from subtree index set [0..size-1] to a globally unique multi index in │ │ │ │ +global basis. │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:268 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ +size_type size() const │ │ │ │ +Same as size(prefix) with empty prefix. │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:162 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ +typename std::tuple_element_t< 0, SubPreBases >::GridView GridView │ │ │ │ +The grid view that the FE basis is defined on. │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:69 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_c_h_i_l_d_r_e_n │ │ │ │ +static const std::size_t children │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:78 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_S_u_b_P_r_e_B_a_s_e_s │ │ │ │ +std::tuple< SPB... > SubPreBases │ │ │ │ +Tuple of child pre-bases. │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:62 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_m_a_k_e_N_o_d_e │ │ │ │ +Node makeNode() const │ │ │ │ +Create tree node. │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:152 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ +void initializeIndices() │ │ │ │ +Initialize the global indices. │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:128 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_S_u_b_P_r_e_B_a_s_i_s │ │ │ │ +std::tuple_element_t< i, SubPreBases > SubPreBasis │ │ │ │ +Export individual child pre-bases by index. │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:66 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_C_h_i_l_d_I_n_d_i_c_e_s │ │ │ │ +std::make_index_sequence< children > ChildIndices │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:80 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_u_p_d_a_t_e │ │ │ │ +void update(const GridView &gv) │ │ │ │ +Update the stored grid view, to be called if the grid has changed. │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:142 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_m_u_l_t_i_I_n_d_e_x_B_u_f_f_e_r_S_i_z_e │ │ │ │ +static constexpr size_type multiIndexBufferSize │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:89 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_s_u_b_P_r_e_B_a_s_e_s │ │ │ │ +const auto & subPreBases() const │ │ │ │ +Const access to the stored prebases tuple. │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:261 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_g_r_i_d_V_i_e_w │ │ │ │ +const GridView & gridView() const │ │ │ │ +Obtain the grid view that the basis is defined on. │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:136 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_m_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ +static constexpr size_type minMultiIndexSize │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:88 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r │ │ │ │ +auto containerDescriptor() const │ │ │ │ +Return the associated container descriptor. │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:274 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ +static constexpr size_type maxMultiIndexSize │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:87 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e │ │ │ │ +DDeeffiinniittiioonn nodes.hh:397 │ │ │ │ +_c_o_n_c_e_p_t_s_._h_h │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h │ │ │ │ + * _c_o_m_p_o_s_i_t_e_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00176.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: compositebasis.hh File Reference │ │ │ +Dune-Functions: periodicbasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,67 +88,58 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
compositebasis.hh File Reference
│ │ │ +
periodicbasis.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <tuple>
│ │ │ -#include <utility>
│ │ │ -#include <dune/common/hybridutilities.hh>
│ │ │ -#include <dune/common/reservedvector.hh>
│ │ │ -#include <dune/common/typeutilities.hh>
│ │ │ -#include <dune/common/tupleutility.hh>
│ │ │ -#include <dune/common/tuplevector.hh>
│ │ │ -#include <dune/functions/common/staticforloop.hh>
│ │ │ -#include <dune/functions/common/type_traits.hh>
│ │ │ -#include <dune/functions/common/utility.hh>
│ │ │ -#include <dune/functions/functionspacebases/basistags.hh>
│ │ │ -#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ +
#include <utility>
│ │ │ +#include <type_traits>
│ │ │ +#include <limits>
│ │ │ +#include <set>
│ │ │ +#include <vector>
│ │ │ #include <dune/functions/functionspacebases/concepts.hh>
│ │ │ -#include <dune/functions/functionspacebases/containerdescriptors.hh>
│ │ │ -#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │ +#include <dune/functions/functionspacebases/containerdescriptors.hh>
│ │ │ +#include <dune/functions/functionspacebases/transformedindexbasis.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::CompositePreBasis< IMS, SPB >
 A pre-basis for composite bases. More...
class  Dune::Functions::BasisFactory::Experimental::PeriodicIndexSet
 Container storing identified indices for a periodic basis. More...
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::BasisFactory
namespace  Dune::Functions::BasisFactory::Experimental
│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Functions

template<typename... Args, std::enable_if_t< Concept::isIndexMergingStrategy< typename LastType< Args... >::type >(), int > = 0>
auto Dune::Functions::BasisFactory::composite (Args &&... args)
 Create a factory builder that can build a CompositePreBasis.
template<typename... Args, std::enable_if_t< not Concept::isIndexMergingStrategy< typename LastType< Args... >::type >(), int > = 0>
auto Dune::Functions::BasisFactory::composite (Args &&... args)
 Create a factory builder that can build a CompositePreBasis.
template<class RawPreBasisIndicator, class PIS>
auto Dune::Functions::BasisFactory::Experimental::periodic (RawPreBasisIndicator &&rawPreBasisIndicator, PIS &&periodicIndexSet)
 Create a pre-basis factory that can create a periodic pre-basis.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,42 +1,32 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -compositebasis.hh File Reference │ │ │ │ -#include │ │ │ │ +periodicbasis.hh File Reference │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_s_t_a_t_i_c_f_o_r_l_o_o_p_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_b_a_s_i_s_t_a_g_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ #include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ #include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_t_r_a_n_s_f_o_r_m_e_d_i_n_d_e_x_b_a_s_i_s_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_<_ _I_M_S_,_ _S_P_B_ _> │ │ │ │ -  A pre-basis for composite bases. _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_P_e_r_i_o_d_i_c_I_n_d_e_x_S_e_t │ │ │ │ +  Container storing identified indices for a periodic basis. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ +namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l │ │ │ │ FFuunnccttiioonnss │ │ │ │ -template::type >(), int > = 0> │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_c_o_m_p_o_s_i_t_e (Args &&... args) │ │ │ │ -  Create a factory builder that can build a _C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s. │ │ │ │ -template::type >(), int > = 0> │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_c_o_m_p_o_s_i_t_e (Args &&... args) │ │ │ │ -  Create a factory builder that can build a _C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s. │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_p_e_r_i_o_d_i_c │ │ │ │ + (RawPreBasisIndicator &&rawPreBasisIndicator, PIS &&periodicIndexSet) │ │ │ │ +  Create a pre-basis factory that can create a periodic pre-basis. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _c_o_m_p_o_s_i_t_e_b_a_s_i_s_._h_h │ │ │ │ + * _p_e_r_i_o_d_i_c_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00176.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,4 +1,4 @@ │ │ │ │ var a00176 = [ │ │ │ │ - ["Dune::Functions::BasisFactory::composite", "a00327.html#ga0ee62f9744ec8ba58fdfc4c68df34449", null], │ │ │ │ - ["Dune::Functions::BasisFactory::composite", "a00312.html#ga0ee62f9744ec8ba58fdfc4c68df34449", null] │ │ │ │ + ["Dune::Functions::BasisFactory::Experimental::PeriodicIndexSet", "a02030.html", "a02030"], │ │ │ │ + ["Dune::Functions::BasisFactory::Experimental::periodic", "a00312.html#ga797d4c1dfcfe6b0a98de9284c4f6b5e3", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00176_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: compositebasis.hh Source File │ │ │ +Dune-Functions: periodicbasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,497 +88,234 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
compositebasis.hh
│ │ │ +
periodicbasis.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_PERIODICBASIS_HH
│ │ │ +
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_PERIODICBASIS_HH
│ │ │
9
│ │ │ -
10#include <tuple>
│ │ │ -
11#include <utility>
│ │ │ -
12
│ │ │ -
13#include <dune/common/hybridutilities.hh>
│ │ │ -
14#include <dune/common/reservedvector.hh>
│ │ │ -
15#include <dune/common/typeutilities.hh>
│ │ │ -
16#include <dune/common/hybridutilities.hh>
│ │ │ -
17#include <dune/common/tupleutility.hh>
│ │ │ -
18#include <dune/common/tuplevector.hh>
│ │ │ +
10#include <utility>
│ │ │ +
11#include <type_traits>
│ │ │ +
12#include <limits>
│ │ │ +
13#include <set>
│ │ │ +
14#include <vector>
│ │ │ +
15
│ │ │ + │ │ │ + │ │ │ + │ │ │
19
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ +
20
│ │ │ +
21namespace Dune::Functions {
│ │ │ +
22
│ │ │ +
23namespace BasisFactory {
│ │ │ +
24
│ │ │ +
25// The PeriodicBasis class is in the Experimental namespace because we are
│ │ │ +
26// not completely sure yet whether we like it. We reserve the right to
│ │ │ +
27// modify it without advance warning. Use at your own risk!
│ │ │
28
│ │ │ -
29
│ │ │ -
30namespace Dune {
│ │ │ -
31namespace Functions {
│ │ │ -
32
│ │ │ -
33// *****************************************************************************
│ │ │ -
34// This is the reusable part of the composite bases. It contains
│ │ │ -
35//
│ │ │ -
36// CompositePreBasis
│ │ │ -
37//
│ │ │ -
38// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ -
39// state. These components do _not_ depend on the global basis and local view
│ │ │ -
40// and can be used without a global basis.
│ │ │ -
41// *****************************************************************************
│ │ │ -
42
│ │ │ -
43
│ │ │ -
55template<class IMS, class... SPB>
│ │ │ -
│ │ │ - │ │ │ -
57{
│ │ │ -
58 static const bool isBlocked = std::is_same_v<IMS,BasisFactory::BlockedLexicographic> or std::is_same_v<IMS,BasisFactory::BlockedInterleaved>;
│ │ │ -
59public:
│ │ │ -
60
│ │ │ -
62 using SubPreBases = std::tuple<SPB...>;
│ │ │ -
63
│ │ │ -
65 template<std::size_t i>
│ │ │ -
66 using SubPreBasis = std::tuple_element_t<i, SubPreBases>;
│ │ │ -
67
│ │ │ -
69 using GridView = typename std::tuple_element_t<0, SubPreBases>::GridView;
│ │ │ -
70
│ │ │ -
72 using size_type = std::size_t;
│ │ │ -
73
│ │ │ - │ │ │ -
76
│ │ │ -
77protected:
│ │ │ -
78 static const std::size_t children = sizeof...(SPB);
│ │ │ -
79
│ │ │ -
80 using ChildIndices = std::make_index_sequence<children>;
│ │ │ -
81
│ │ │ -
82public:
│ │ │ -
83
│ │ │ -
85 using Node = CompositeBasisNode<typename SPB::Node...>;
│ │ │ -
86
│ │ │ -
87 static constexpr size_type maxMultiIndexSize = std::max({SPB::maxMultiIndexSize...}) + isBlocked;
│ │ │ -
88 static constexpr size_type minMultiIndexSize = std::min({SPB::minMultiIndexSize...}) + isBlocked;
│ │ │ -
89 static constexpr size_type multiIndexBufferSize = std::max({SPB::multiIndexBufferSize...}) + isBlocked;
│ │ │ -
90
│ │ │ -
96 template<class... SFArgs,
│ │ │ -
97 disableCopyMove<CompositePreBasis, SFArgs...> = 0,
│ │ │ -
98 enableIfConstructible<std::tuple<SPB...>, SFArgs...> = 0>
│ │ │ -
│ │ │ -
99 CompositePreBasis(SFArgs&&... sfArgs) :
│ │ │ -
100 subPreBases_(std::forward<SFArgs>(sfArgs)...)
│ │ │ -
101 {
│ │ │ -
102 Hybrid::forEach(subPreBases_, [&](const auto& subPreBasis){
│ │ │ -
103 static_assert(models<Concept::PreBasis<GridView>, std::decay_t<decltype(subPreBasis)>>(), "Subprebases passed to CompositePreBasis does not model the PreBasis concept.");
│ │ │ -
104 });
│ │ │ -
105 }
│ │ │ -
│ │ │ -
106
│ │ │ -
113 template<class GV,
│ │ │ -
114 std::enable_if_t<std::conjunction_v<
│ │ │ -
115 std::bool_constant<(children > 1)>, // Avoid ambiguous constructor if there's only one child
│ │ │ -
116 std::is_same<GV, GridView>,
│ │ │ -
117 std::is_constructible<SPB, GridView>...
│ │ │ -
118 >, int> = 0>
│ │ │ -
│ │ │ -
119 CompositePreBasis(const GV& gv) :
│ │ │ -
120 subPreBases_(SPB(gv)...)
│ │ │ -
121 {
│ │ │ -
122 Hybrid::forEach(subPreBases_, [&](const auto& subPreBasis){
│ │ │ -
123 static_assert(models<Concept::PreBasis<GridView>, std::decay_t<decltype(subPreBasis)>>(), "Subprebases passed to CompositePreBasis does not model the PreBasis concept.");
│ │ │ -
124 });
│ │ │ -
125 }
│ │ │ -
│ │ │ -
126
│ │ │ -
│ │ │ - │ │ │ -
129 {
│ │ │ -
130 Hybrid::forEach(ChildIndices(), [&](auto i) {
│ │ │ -
131 this->subPreBasis(i).initializeIndices();
│ │ │ -
132 });
│ │ │ -
133 }
│ │ │ -
│ │ │ -
134
│ │ │ -
│ │ │ -
136 const GridView& gridView() const
│ │ │ -
137 {
│ │ │ -
138 return std::get<0>(subPreBases_).gridView();
│ │ │ -
139 }
│ │ │ -
│ │ │ -
140
│ │ │ -
│ │ │ -
142 void update(const GridView& gv)
│ │ │ -
143 {
│ │ │ -
144 Hybrid::forEach(ChildIndices(), [&](auto i) {
│ │ │ -
145 this->subPreBasis(i).update(gv);
│ │ │ -
146 });
│ │ │ -
147 }
│ │ │ -
│ │ │ -
148
│ │ │ -
│ │ │ - │ │ │ -
153 {
│ │ │ -
154 auto node = Node{};
│ │ │ -
155 Hybrid::forEach(ChildIndices(), [&](auto i) {
│ │ │ -
156 node.setChild(this->subPreBasis(i).makeNode(), i);
│ │ │ -
157 });
│ │ │ -
158 return node;
│ │ │ -
159 }
│ │ │ -
│ │ │ -
160
│ │ │ -
│ │ │ - │ │ │ -
163 {
│ │ │ -
164 return size(Dune::ReservedVector<size_type, multiIndexBufferSize>{});
│ │ │ -
165 }
│ │ │ -
│ │ │ -
166
│ │ │ -
168 template<class SizePrefix>
│ │ │ -
│ │ │ -
169 size_type size(const SizePrefix& prefix) const
│ │ │ -
170 {
│ │ │ -
171 return size(prefix, IndexMergingStrategy{});
│ │ │ -
172 }
│ │ │ -
│ │ │ -
173
│ │ │ -
174private:
│ │ │ -
175
│ │ │ -
176 template<class MultiIndex>
│ │ │ -
177 static void multiIndexPopFront(MultiIndex& M)
│ │ │ -
178 {
│ │ │ -
179 for(std::size_t i=0; i<M.size()-1; ++i)
│ │ │ -
180 M[i] = M[i+1];
│ │ │ -
181 M.resize(M.size()-1);
│ │ │ -
182 }
│ │ │ -
183
│ │ │ -
184 template<class SizePrefix>
│ │ │ -
185 size_type size(SizePrefix prefix, BasisFactory::BlockedLexicographic) const
│ │ │ -
186 {
│ │ │ -
187 if (prefix.size() == 0)
│ │ │ -
188 return children;
│ │ │ -
189
│ │ │ -
190 auto front = prefix.front();
│ │ │ -
191 multiIndexPopFront(prefix);
│ │ │ -
192 return Hybrid::switchCases(ChildIndices(), front, [&] (auto i) {
│ │ │ -
193 return this->subPreBasis(i).size(prefix);
│ │ │ -
194 }, []() {
│ │ │ -
195 return size_type(0);
│ │ │ -
196 });
│ │ │ -
197 }
│ │ │ -
198
│ │ │ -
199 template<class SizePrefix>
│ │ │ -
200 size_type size(SizePrefix prefix, BasisFactory::FlatLexicographic) const
│ │ │ -
201 {
│ │ │ -
202 size_type result = 0;
│ │ │ -
203 if (prefix.size() == 0)
│ │ │ -
204 Hybrid::forEach(ChildIndices(), [&](auto i) {
│ │ │ -
205 result += this->subPreBasis(i).size();
│ │ │ -
206 });
│ │ │ -
207 else {
│ │ │ - │ │ │ -
209 auto firstDigitSize = this->subPreBasis(i).size();
│ │ │ -
210 if (prefix[0] < firstDigitSize)
│ │ │ -
211 {
│ │ │ -
212 result = this->subPreBasis(i).size(prefix);
│ │ │ -
213 return true;
│ │ │ -
214 }
│ │ │ -
215 prefix[0] -= firstDigitSize;
│ │ │ -
216 return false;
│ │ │ -
217 });
│ │ │ -
218 }
│ │ │ -
219 return result;
│ │ │ -
220 }
│ │ │ -
221
│ │ │ -
222public:
│ │ │ -
223
│ │ │ -
│ │ │ - │ │ │ -
226 {
│ │ │ -
227 size_type r=0;
│ │ │ -
228 // Accumulate dimension() for all subprebases
│ │ │ -
229 Hybrid::forEach(ChildIndices(), [&](auto i) {
│ │ │ -
230 r += this->subPreBasis(i).dimension();
│ │ │ -
231 });
│ │ │ -
232 return r;
│ │ │ -
233 }
│ │ │ -
│ │ │ -
234
│ │ │ -
│ │ │ - │ │ │ -
237 {
│ │ │ -
238 size_type r=0;
│ │ │ -
239 // Accumulate maxNodeSize() for all subprebases
│ │ │ -
240 Hybrid::forEach(ChildIndices(), [&](auto i) {
│ │ │ -
241 r += this->subPreBasis(i).maxNodeSize();
│ │ │ -
242 });
│ │ │ -
243 return r;
│ │ │ -
244 }
│ │ │ -
│ │ │ -
245
│ │ │ -
247 template<std::size_t i>
│ │ │ -
│ │ │ -
248 const SubPreBasis<i>& subPreBasis(Dune::index_constant<i> = {}) const
│ │ │ -
249 {
│ │ │ -
250 return std::get<i>(subPreBases_);
│ │ │ -
251 }
│ │ │ -
│ │ │ -
252
│ │ │ -
254 template<std::size_t i>
│ │ │ -
│ │ │ -
255 SubPreBasis<i>& subPreBasis(Dune::index_constant<i> = {})
│ │ │ -
256 {
│ │ │ -
257 return std::get<i>(subPreBases_);
│ │ │ -
258 }
│ │ │ -
│ │ │ -
259
│ │ │ -
│ │ │ -
261 const auto& subPreBases() const
│ │ │ -
262 {
│ │ │ -
263 return subPreBases_;
│ │ │ -
264 }
│ │ │ -
│ │ │ -
265
│ │ │ -
267 template<typename It>
│ │ │ -
│ │ │ -
268 It indices(const Node& node, It it) const
│ │ │ -
269 {
│ │ │ -
270 return indices(node, it, IndexMergingStrategy{});
│ │ │ -
271 }
│ │ │ -
│ │ │ -
272
│ │ │ -
│ │ │ - │ │ │ -
275 {
│ │ │ - │ │ │ -
277 if constexpr(std::is_same_v<IMS, BasisFactory::BlockedLexicographic>) {
│ │ │ -
278 return std::apply([&](auto const&... spb) {
│ │ │ -
279 return CD::makeDescriptor(Dune::Functions::containerDescriptor(spb)...);
│ │ │ -
280 }, subPreBases_);
│ │ │ -
281 }
│ │ │ -
282 else if constexpr(std::is_same_v<IMS, BasisFactory::FlatLexicographic>) {
│ │ │ -
283 return std::apply([&](auto const&... spb) {
│ │ │ -
284 return CD::Impl::flatLexicographic(Dune::Functions::containerDescriptor(spb)...);
│ │ │ -
285 }, subPreBases_);
│ │ │ -
286 }
│ │ │ -
287 else
│ │ │ -
288 return CD::Unknown{};
│ │ │ -
289 }
│ │ │ -
│ │ │ -
290
│ │ │ -
291private:
│ │ │ -
292
│ │ │ -
293 template<typename It>
│ │ │ -
294 It indices(const Node& node, It multiIndices, BasisFactory::FlatLexicographic) const
│ │ │ -
295 {
│ │ │ -
296 size_type firstComponentOffset = 0;
│ │ │ -
297 // Loop over all children
│ │ │ -
298 Hybrid::forEach(ChildIndices(), [&](auto child){
│ │ │ -
299 size_type subTreeSize = node.child(child).size();
│ │ │ -
300 // Fill indices for current child into index buffer starting from current
│ │ │ -
301 // buffer position and shift first index component of any index for current
│ │ │ -
302 // child by suitable offset to get lexicographic indices.
│ │ │ -
303 subPreBasis(child).indices(node.child(child), multiIndices);
│ │ │ -
304 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ -
305 multiIndices[i][0] += firstComponentOffset;
│ │ │ -
306 // Increment offset by the size for first index component of the current child
│ │ │ -
307 firstComponentOffset += subPreBasis(child).size();
│ │ │ -
308 // Increment buffer iterator by the number of indices processed for current child
│ │ │ -
309 multiIndices += subTreeSize;
│ │ │ -
310 });
│ │ │ -
311 return multiIndices;
│ │ │ -
312 }
│ │ │ -
313
│ │ │ -
314 template<class MultiIndex>
│ │ │ -
315 static void multiIndexPushFront(MultiIndex& M, size_type M0)
│ │ │ -
316 {
│ │ │ -
317 M.resize(M.size()+1);
│ │ │ -
318 for(std::size_t i=M.size()-1; i>0; --i)
│ │ │ -
319 M[i] = M[i-1];
│ │ │ -
320 M[0] = M0;
│ │ │ -
321 }
│ │ │ -
322
│ │ │ -
323 template<typename It>
│ │ │ -
324 It indices(const Node& node, It multiIndices, BasisFactory::BlockedLexicographic) const
│ │ │ -
325 {
│ │ │ -
326 // Loop over all children
│ │ │ -
327 Hybrid::forEach(ChildIndices(), [&](auto child){
│ │ │ -
328 size_type subTreeSize = node.child(child).size();
│ │ │ -
329 // Fill indices for current child into index buffer starting from current position
│ │ │ -
330 subPreBasis(child).indices(node.child(child), multiIndices);
│ │ │ -
331 // Insert child index before first component of all indices of current child.
│ │ │ -
332 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ -
333 this->multiIndexPushFront(multiIndices[i], child);
│ │ │ -
334 // Increment buffer iterator by the number of indices processed for current child
│ │ │ -
335 multiIndices += subTreeSize;
│ │ │ -
336 });
│ │ │ -
337 return multiIndices;
│ │ │ -
338 }
│ │ │ -
339
│ │ │ -
340 std::tuple<SPB...> subPreBases_;
│ │ │ -
341};
│ │ │ -
│ │ │ -
342
│ │ │ -
343
│ │ │ -
344
│ │ │ -
345namespace BasisFactory {
│ │ │ -
346
│ │ │ -
347namespace Imp {
│ │ │ -
348
│ │ │ -
349template<class IndexMergingStrategy, class... ChildPreBasisFactory>
│ │ │ -
350class CompositePreBasisFactory
│ │ │ -
351{
│ │ │ -
352
│ │ │ -
353 template<class GridView, class... ChildPreBasis>
│ │ │ -
354 auto makePreBasisFromChildPreBases(const GridView&, ChildPreBasis&&... childPreBasis) const
│ │ │ -
355 {
│ │ │ -
356 return CompositePreBasis<IndexMergingStrategy, std::decay_t<ChildPreBasis>...>(std::forward<ChildPreBasis>(childPreBasis)...);
│ │ │ -
357 }
│ │ │ -
358
│ │ │ -
359public:
│ │ │ -
360
│ │ │ -
361 CompositePreBasisFactory(const ChildPreBasisFactory&... childPreBasisFactory) :
│ │ │ -
362 childPreBasisFactories_(childPreBasisFactory...)
│ │ │ -
363 {}
│ │ │ -
364
│ │ │ -
365 CompositePreBasisFactory(ChildPreBasisFactory&&... childPreBasisFactory) :
│ │ │ -
366 childPreBasisFactories_(std::move(childPreBasisFactory)...)
│ │ │ -
367 {}
│ │ │ -
368
│ │ │ -
369 template<class GridView>
│ │ │ -
370 auto operator()(const GridView& gridView) const
│ │ │ -
371 {
│ │ │ -
372 // Use std::apply to unpack the tuple childPreBasisFactories_
│ │ │ -
373 return std::apply([&](const auto&... childPreBasisFactory) {
│ │ │ -
374 return this->makePreBasisFromChildPreBases(gridView, childPreBasisFactory(gridView)...);
│ │ │ -
375 }, childPreBasisFactories_);
│ │ │ -
376 }
│ │ │ -
377
│ │ │ -
378private:
│ │ │ -
379 std::tuple<ChildPreBasisFactory...> childPreBasisFactories_;
│ │ │ -
380};
│ │ │ -
381
│ │ │ -
382} // end namespace BasisFactory::Imp
│ │ │ -
383
│ │ │ -
384
│ │ │ -
385
│ │ │ -
396template<
│ │ │ -
397 typename... Args,
│ │ │ -
398 std::enable_if_t<Concept::isIndexMergingStrategy<typename LastType<Args...>::type>(),int> = 0>
│ │ │ -
│ │ │ -
399auto composite(Args&&... args)
│ │ │ -
400{
│ │ │ -
401 // We have to separate the last entry which is the IndexMergingStrategy
│ │ │ -
402 // and the preceding ones, which are the ChildPreBasisFactories
│ │ │ -
403
│ │ │ -
404 using ArgTuple = std::tuple<std::decay_t<Args>...>;
│ │ │ -
405
│ │ │ -
406 // Compute number of children and index of the IndexMergingStrategy argument
│ │ │ -
407 constexpr std::size_t children = sizeof...(Args) - 1;
│ │ │ -
408
│ │ │ -
409 // Use last type as IndexMergingStrategy
│ │ │ -
410 using IndexMergingStrategy = std::tuple_element_t<children, ArgTuple>;
│ │ │ -
411
│ │ │ -
412 // Index sequence for all but the last entry for partial tuple unpacking
│ │ │ -
413 auto childIndices = std::make_index_sequence<children>{};
│ │ │ -
414
│ │ │ -
415 // Unpack tuple only for those entries related to children
│ │ │ -
416 return applyPartial([](auto&&... childPreBasisFactory){
│ │ │ -
417 return Imp::CompositePreBasisFactory<IndexMergingStrategy, std::decay_t<decltype(childPreBasisFactory)>...>(std::forward<decltype(childPreBasisFactory)>(childPreBasisFactory)...);
│ │ │ -
418 },
│ │ │ -
419 std::forward_as_tuple(std::forward<Args>(args)...),
│ │ │ -
420 childIndices);
│ │ │ -
421}
│ │ │ -
│ │ │ -
422
│ │ │ -
434template<
│ │ │ -
435 typename... Args,
│ │ │ -
436 std::enable_if_t<not Concept::isIndexMergingStrategy<typename LastType<Args...>::type>(),int> = 0>
│ │ │ -
437[[deprecated("Using the method `composite` without an explicit index merging strategy"
│ │ │ -
438 " will change its meaning after the release of dune-functions 2.11."
│ │ │ -
439 " Previously, the default merging strategy was `BlockedLexicographic`,"
│ │ │ -
440 " but this will change to `FlatLexicographic`."
│ │ │ -
441 " Change the call to `composite(..., blockedLexicographic())` to retain the old behavior.")]]
│ │ │ -
│ │ │ -
442auto composite(Args&&... args)
│ │ │ -
443{
│ │ │ -
444 return Imp::CompositePreBasisFactory<BasisFactory::BlockedLexicographic, std::decay_t<Args>...>(std::forward<Args>(args)...);
│ │ │ -
445}
│ │ │ -
│ │ │ -
446
│ │ │ -
447} // end namespace BasisFactory
│ │ │ -
448
│ │ │ -
449
│ │ │ -
450
│ │ │ -
451} // end namespace Functions
│ │ │ -
452} // end namespace Dune
│ │ │ -
453
│ │ │ -
454
│ │ │ -
455#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH
│ │ │ - │ │ │ - │ │ │ -
Lightweight representation of (hierarchical) size and block structure extracted from a basis to descr...
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
auto composite(Args &&... args)
Create a factory builder that can build a CompositePreBasis.
Definition compositebasis.hh:399
│ │ │ -
void staticFindInRange(F &&f, Args &&... args)
Static find loop.
Definition staticforloop.hh:60
│ │ │ -
std::enable_if_t< std::is_constructible_v< T, Args... >, int > enableIfConstructible
Helper to constrain forwarding constructors.
Definition type_traits.hh:30
│ │ │ -
Definition monomialset.hh:19
│ │ │ +
│ │ │ +
29namespace Experimental {
│ │ │ +
30
│ │ │ +
31
│ │ │ +
│ │ │ + │ │ │ +
41{
│ │ │ +
42 using IndexPairSet = std::set<std::pair<std::size_t,std::size_t>>;
│ │ │ +
43public:
│ │ │ +
44
│ │ │ +
│ │ │ +
52 void unifyIndexPair(std::size_t a, std::size_t b)
│ │ │ +
53 {
│ │ │ +
54 if (a>b)
│ │ │ +
55 std::swap(a,b);
│ │ │ +
56 if (a==b)
│ │ │ +
57 return;
│ │ │ +
58 indexPairSet_.insert(std::make_pair(a,b));
│ │ │ +
59 }
│ │ │ +
│ │ │ +
60
│ │ │ +
│ │ │ +
61 const auto& indexPairSet() const
│ │ │ +
62 {
│ │ │ +
63 return indexPairSet_;
│ │ │ +
64 }
│ │ │ +
│ │ │ +
65
│ │ │ +
66private:
│ │ │ +
67 IndexPairSet indexPairSet_;
│ │ │ +
68};
│ │ │ +
│ │ │ +
69
│ │ │ +
70
│ │ │ +
71
│ │ │ +
72namespace Impl {
│ │ │ +
73
│ │ │ +
74// An index transformation for a TransformedIndexPreBasis
│ │ │ +
75// implementing periodic functions by merging indices.
│ │ │ +
76// Currently only flat indices are supported.
│ │ │ +
77class PeriodicIndexingTransformation
│ │ │ +
78{
│ │ │ +
79public:
│ │ │ +
80
│ │ │ +
81 static constexpr std::size_t minIndexSize = 1;
│ │ │ +
82 static constexpr std::size_t maxIndexSize = 1;
│ │ │ +
83
│ │ │ +
84 template<class RawPreBasis, class IndexPairSet>
│ │ │ +
85 PeriodicIndexingTransformation(const RawPreBasis& rawPreBasis, const IndexPairSet& indexPairSet)
│ │ │ +
86 {
│ │ │ +
87 static_assert(RawPreBasis::maxMultiIndexSize==1, "PeriodicIndexingTransformation is only implemented for flat multi-indices");
│ │ │ +
88 std::size_t invalid = {std::numeric_limits<std::size_t>::max()};
│ │ │ +
89 mappedIdx_.resize(rawPreBasis.size(), invalid);
│ │ │ +
90 numIndices_ = 0;
│ │ │ +
91 std::size_t i = 0;
│ │ │ +
92 for(const auto& [a, b] : indexPairSet)
│ │ │ +
93 {
│ │ │ +
94 for(; i<=a; ++i)
│ │ │ +
95 if (mappedIdx_[i] == invalid)
│ │ │ +
96 mappedIdx_[i] = numIndices_++;
│ │ │ +
97 mappedIdx_[b] = mappedIdx_[a];
│ │ │ +
98 }
│ │ │ +
99 for(; i<rawPreBasis.size(); ++i)
│ │ │ +
100 if (mappedIdx_[i] == invalid)
│ │ │ +
101 mappedIdx_[i] = numIndices_++;
│ │ │ +
102 }
│ │ │ +
103
│ │ │ +
104 template<class MultiIndex, class PreBasis>
│ │ │ +
105 void transformIndex(MultiIndex& multiIndex, const PreBasis& preBasis) const
│ │ │ +
106 {
│ │ │ +
107 multiIndex = {{ mappedIdx_[multiIndex[0]] }};
│ │ │ +
108 }
│ │ │ +
109
│ │ │ +
110 template<class Prefix, class PreBasis>
│ │ │ +
111 std::size_t size(const Prefix& prefix, const PreBasis& preBasis) const
│ │ │ +
112 {
│ │ │ +
113 if (prefix.size() == 1)
│ │ │ +
114 return 0;
│ │ │ +
115 return numIndices_;
│ │ │ +
116 }
│ │ │ +
117
│ │ │ +
118 template<class PreBasis>
│ │ │ +
119 auto dimension(const PreBasis& preBasis) const
│ │ │ +
120 {
│ │ │ +
121 return numIndices_;
│ │ │ +
122 }
│ │ │ +
123
│ │ │ +
125 template<class PreBasis>
│ │ │ +
126 auto containerDescriptor(const PreBasis& preBasis) const
│ │ │ +
127 {
│ │ │ + │ │ │ +
129 }
│ │ │ +
130
│ │ │ +
131private:
│ │ │ +
132 std::vector<std::size_t> mappedIdx_;
│ │ │ +
133 std::size_t numIndices_;
│ │ │ +
134};
│ │ │ +
135
│ │ │ +
136
│ │ │ +
137
│ │ │ +
138template<class RawPreBasisIndicator>
│ │ │ +
139class PeriodicPreBasisFactory
│ │ │ +
140{
│ │ │ +
141public:
│ │ │ +
142 PeriodicPreBasisFactory()
│ │ │ +
143 {}
│ │ │ +
144
│ │ │ +
145 template<class RPBI, class PIS>
│ │ │ +
146 PeriodicPreBasisFactory(RPBI&& rawPreBasisIndicator, PIS&& periodicIndexSet) :
│ │ │ +
147 rawPreBasisIndicator_(std::forward<RPBI>(rawPreBasisIndicator)),
│ │ │ +
148 periodicIndexSet_(std::forward<PIS>(periodicIndexSet))
│ │ │ +
149 {}
│ │ │ +
150
│ │ │ +
151 template<class GridView,
│ │ │ +
152 std::enable_if_t<models<Concept::GlobalBasis<GridView>,RawPreBasisIndicator>(), int> = 0>
│ │ │ +
153 auto operator()(const GridView& gridView) const
│ │ │ +
154 {
│ │ │ +
155 const auto& rawPreBasis = rawPreBasisIndicator_.preBasis();
│ │ │ +
156 auto transformation = PeriodicIndexingTransformation(rawPreBasis, periodicIndexSet_.indexPairSet());
│ │ │ +
157 return Dune::Functions::Experimental::TransformedIndexPreBasis(std::move(rawPreBasis), std::move(transformation));
│ │ │ +
158 }
│ │ │ +
159
│ │ │ +
160 template<class GridView,
│ │ │ +
161 std::enable_if_t<models<Concept::PreBasis<GridView>,RawPreBasisIndicator>(), int> = 0>
│ │ │ +
162 auto operator()(const GridView& gridView) const
│ │ │ +
163 {
│ │ │ +
164 const auto& rawPreBasis = rawPreBasisIndicator_;
│ │ │ +
165 auto transformation = PeriodicIndexingTransformation(rawPreBasis, periodicIndexSet_.indexPairSet());
│ │ │ +
166 return Dune::Functions::Experimental::TransformedIndexPreBasis(std::move(rawPreBasis), std::move(transformation));
│ │ │ +
167 }
│ │ │ +
168
│ │ │ +
169 template<class GridView,
│ │ │ +
170 std::enable_if_t<not models<Concept::GlobalBasis<GridView>,RawPreBasisIndicator>(), int> = 0,
│ │ │ +
171 std::enable_if_t<not models<Concept::PreBasis<GridView>,RawPreBasisIndicator>(), int> = 0>
│ │ │ +
172 auto operator()(const GridView& gridView) const
│ │ │ +
173 {
│ │ │ +
174 auto rawPreBasis = rawPreBasisIndicator_(gridView);
│ │ │ +
175 rawPreBasis.initializeIndices();
│ │ │ +
176 auto transformation = PeriodicIndexingTransformation(rawPreBasis, periodicIndexSet_.indexPairSet());
│ │ │ +
177 return Dune::Functions::Experimental::TransformedIndexPreBasis(std::move(rawPreBasis), std::move(transformation));
│ │ │ +
178 }
│ │ │ +
179
│ │ │ +
180private:
│ │ │ +
181 RawPreBasisIndicator rawPreBasisIndicator_;
│ │ │ +
182 PeriodicIndexSet periodicIndexSet_;
│ │ │ +
183};
│ │ │ +
184
│ │ │ +
185} // end namespace BasisFactory::Impl
│ │ │ +
186
│ │ │ +
187
│ │ │ +
188
│ │ │ +
202template<class RawPreBasisIndicator, class PIS>
│ │ │ +
│ │ │ + │ │ │ +
204 RawPreBasisIndicator&& rawPreBasisIndicator,
│ │ │ +
205 PIS&& periodicIndexSet
│ │ │ +
206 )
│ │ │ +
207{
│ │ │ +
208 return Impl::PeriodicPreBasisFactory<std::decay_t<RawPreBasisIndicator>>(
│ │ │ +
209 std::forward<RawPreBasisIndicator>(rawPreBasisIndicator),
│ │ │ +
210 std::forward<PIS>(periodicIndexSet));
│ │ │ +
211}
│ │ │ +
│ │ │ +
212
│ │ │ +
213} // end namespace Experimental
│ │ │ +
│ │ │ +
214
│ │ │ +
215} // end namespace BasisFactory
│ │ │ +
216
│ │ │ +
217} // end namespace Dune::Functions
│ │ │ +
218
│ │ │ +
219#endif // DUNE_FUFEM_PERIODICBASIS_HH
│ │ │ + │ │ │ +
Lightweight representation of (hierarchical) size and block structure extracted from a basis to descr...
│ │ │ +
auto periodic(RawPreBasisIndicator &&rawPreBasisIndicator, PIS &&periodicIndexSet)
Create a pre-basis factory that can create a periodic pre-basis.
Definition periodicbasis.hh:203
│ │ │
Definition monomialset.hh:19
│ │ │
auto containerDescriptor(const PreBasis &preBasis)
Return the container descriptor of the pre-basis, if defined, otherwise ContainerDescriptor::Unknown.
Definition containerdescriptors.hh:58
│ │ │ -
static constexpr bool isIndexMergingStrategy()
Definition basistags.hh:27
│ │ │ -
Definition containerfactory.hh:20
│ │ │ +
TransformedIndexPreBasis(RPB &&, T &&) -> TransformedIndexPreBasis< std::decay_t< RPB >, std::decay_t< T > >
│ │ │
Definition argyrisbasis.hh:926
│ │ │ -
Get last entry of type list.
Definition utility.hh:230
│ │ │ -
Base class for index merging strategies to simplify detection.
Definition basistags.hh:48
│ │ │ -
Lexicographic merging of direct children without blocking.
Definition basistags.hh:84
│ │ │ -
A pre-basis for composite bases.
Definition compositebasis.hh:57
│ │ │ -
SubPreBasis< i > & subPreBasis(Dune::index_constant< i >={})
Mutable access to the stored prebasis of the factor in the power space.
Definition compositebasis.hh:255
│ │ │ -
IMS IndexMergingStrategy
Strategy used to merge the global indices of the child pre-bases.
Definition compositebasis.hh:75
│ │ │ -
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition compositebasis.hh:236
│ │ │ -
const SubPreBasis< i > & subPreBasis(Dune::index_constant< i >={}) const
Const access to the stored prebasis of the factor in the power space.
Definition compositebasis.hh:248
│ │ │ -
std::size_t size_type
Type used for indices and size information.
Definition compositebasis.hh:72
│ │ │ -
CompositeBasisNode< typename SPB::Node... > Node
Template mapping root tree path to type of created tree node.
Definition compositebasis.hh:85
│ │ │ -
size_type size(const SizePrefix &prefix) const
Return number of possible values for next position in multi index.
Definition compositebasis.hh:169
│ │ │ -
CompositePreBasis(SFArgs &&... sfArgs)
Constructor for given child pre-basis objects.
Definition compositebasis.hh:99
│ │ │ -
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition compositebasis.hh:225
│ │ │ -
CompositePreBasis(const GV &gv)
Constructor for given GridView.
Definition compositebasis.hh:119
│ │ │ -
It indices(const Node &node, It it) const
Maps from subtree index set [0..size-1] to a globally unique multi index in global basis.
Definition compositebasis.hh:268
│ │ │ -
size_type size() const
Same as size(prefix) with empty prefix.
Definition compositebasis.hh:162
│ │ │ -
typename std::tuple_element_t< 0, SubPreBases >::GridView GridView
The grid view that the FE basis is defined on.
Definition compositebasis.hh:69
│ │ │ -
static const std::size_t children
Definition compositebasis.hh:78
│ │ │ -
std::tuple< SPB... > SubPreBases
Tuple of child pre-bases.
Definition compositebasis.hh:62
│ │ │ -
Node makeNode() const
Create tree node.
Definition compositebasis.hh:152
│ │ │ -
void initializeIndices()
Initialize the global indices.
Definition compositebasis.hh:128
│ │ │ -
std::tuple_element_t< i, SubPreBases > SubPreBasis
Export individual child pre-bases by index.
Definition compositebasis.hh:66
│ │ │ -
std::make_index_sequence< children > ChildIndices
Definition compositebasis.hh:80
│ │ │ -
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition compositebasis.hh:142
│ │ │ -
static constexpr size_type multiIndexBufferSize
Definition compositebasis.hh:89
│ │ │ -
const auto & subPreBases() const
Const access to the stored prebases tuple.
Definition compositebasis.hh:261
│ │ │ -
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition compositebasis.hh:136
│ │ │ -
static constexpr size_type minMultiIndexSize
Definition compositebasis.hh:88
│ │ │ -
auto containerDescriptor() const
Return the associated container descriptor.
Definition compositebasis.hh:274
│ │ │ -
static constexpr size_type maxMultiIndexSize
Definition compositebasis.hh:87
│ │ │ - │ │ │ +
Definition periodicbasis.hh:29
│ │ │ +
Container storing identified indices for a periodic basis.
Definition periodicbasis.hh:41
│ │ │ +
void unifyIndexPair(std::size_t a, std::size_t b)
Insert a pair of indices.
Definition periodicbasis.hh:52
│ │ │ +
const auto & indexPairSet() const
Definition periodicbasis.hh:61
│ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,589 +1,250 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -compositebasis.hh │ │ │ │ +periodicbasis.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_PERIODICBASIS_HH │ │ │ │ +8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_PERIODICBASIS_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ -12 │ │ │ │ -13#include │ │ │ │ -14#include │ │ │ │ -15#include │ │ │ │ -16#include │ │ │ │ -17#include │ │ │ │ -18#include │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ +12#include │ │ │ │ +13#include │ │ │ │ +14#include │ │ │ │ +15 │ │ │ │ +16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h> │ │ │ │ +18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_t_r_a_n_s_f_o_r_m_e_d_i_n_d_e_x_b_a_s_i_s_._h_h> │ │ │ │ 19 │ │ │ │ -20#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_s_t_a_t_i_c_f_o_r_l_o_o_p_._h_h> │ │ │ │ -21#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ -22#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ -23#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_b_a_s_i_s_t_a_g_s_._h_h> │ │ │ │ -24#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -25#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ -26#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h> │ │ │ │ -27#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ +20 │ │ │ │ +21namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ +22 │ │ │ │ +23namespace _B_a_s_i_s_F_a_c_t_o_r_y { │ │ │ │ +24 │ │ │ │ +25// The PeriodicBasis class is in the Experimental namespace because we are │ │ │ │ +26// not completely sure yet whether we like it. We reserve the right to │ │ │ │ +27// modify it without advance warning. Use at your own risk! │ │ │ │ 28 │ │ │ │ -29 │ │ │ │ -30namespace _D_u_n_e { │ │ │ │ -31namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -32 │ │ │ │ -33/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -34// This is the reusable part of the composite bases. It contains │ │ │ │ -35// │ │ │ │ -36// CompositePreBasis │ │ │ │ -37// │ │ │ │ -38// The pre-basis allows to create the others and is the owner of possible │ │ │ │ -shared │ │ │ │ -39// state. These components do _not_ depend on the global basis and local view │ │ │ │ -40// and can be used without a global basis. │ │ │ │ -41/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -42 │ │ │ │ -43 │ │ │ │ -55template │ │ │ │ -_5_6class _C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s │ │ │ │ -57{ │ │ │ │ -58 static const bool isBlocked = std::is_same_v or std::is_same_v; │ │ │ │ -59public: │ │ │ │ +_2_9namespace _E_x_p_e_r_i_m_e_n_t_a_l { │ │ │ │ +30 │ │ │ │ +31 │ │ │ │ +_4_0class _P_e_r_i_o_d_i_c_I_n_d_e_x_S_e_t │ │ │ │ +41{ │ │ │ │ +42 using IndexPairSet = std::set>; │ │ │ │ +43public: │ │ │ │ +44 │ │ │ │ +_5_2 void _u_n_i_f_y_I_n_d_e_x_P_a_i_r(std::size_t a, std::size_t b) │ │ │ │ +53 { │ │ │ │ +54 if (a>b) │ │ │ │ +55 std::swap(a,b); │ │ │ │ +56 if (a==b) │ │ │ │ +57 return; │ │ │ │ +58 indexPairSet_.insert(std::make_pair(a,b)); │ │ │ │ +59 } │ │ │ │ 60 │ │ │ │ -_6_2 using _S_u_b_P_r_e_B_a_s_e_s = std::tuple; │ │ │ │ -63 │ │ │ │ -65 template │ │ │ │ -_6_6 using _S_u_b_P_r_e_B_a_s_i_s = std::tuple_element_t; │ │ │ │ -67 │ │ │ │ -_6_9 using _G_r_i_d_V_i_e_w = typename std::tuple_element_t<0, SubPreBases>::GridView; │ │ │ │ +_6_1 const auto& _i_n_d_e_x_P_a_i_r_S_e_t() const │ │ │ │ +62 { │ │ │ │ +63 return indexPairSet_; │ │ │ │ +64 } │ │ │ │ +65 │ │ │ │ +66private: │ │ │ │ +67 IndexPairSet indexPairSet_; │ │ │ │ +68}; │ │ │ │ +69 │ │ │ │ 70 │ │ │ │ -_7_2 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ +71 │ │ │ │ +72namespace Impl { │ │ │ │ 73 │ │ │ │ -_7_5 using _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y = IMS; │ │ │ │ -76 │ │ │ │ -77protected: │ │ │ │ -_7_8 static const std::size_t _c_h_i_l_d_r_e_n = sizeof...(SPB); │ │ │ │ -79 │ │ │ │ -_8_0 using _C_h_i_l_d_I_n_d_i_c_e_s = std::make_index_sequence; │ │ │ │ -81 │ │ │ │ -82public: │ │ │ │ +74// An index transformation for a TransformedIndexPreBasis │ │ │ │ +75// implementing periodic functions by merging indices. │ │ │ │ +76// Currently only flat indices are supported. │ │ │ │ +77class PeriodicIndexingTransformation │ │ │ │ +78{ │ │ │ │ +79public: │ │ │ │ +80 │ │ │ │ +81 static constexpr std::size_t minIndexSize = 1; │ │ │ │ +82 static constexpr std::size_t maxIndexSize = 1; │ │ │ │ 83 │ │ │ │ -_8_5 using _N_o_d_e = _C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e; │ │ │ │ -86 │ │ │ │ -_8_7 static constexpr _s_i_z_e___t_y_p_e _m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e = std::max({SPB:: │ │ │ │ -maxMultiIndexSize...}) + isBlocked; │ │ │ │ -_8_8 static constexpr _s_i_z_e___t_y_p_e _m_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e = std::min({SPB:: │ │ │ │ -minMultiIndexSize...}) + isBlocked; │ │ │ │ -_8_9 static constexpr _s_i_z_e___t_y_p_e _m_u_l_t_i_I_n_d_e_x_B_u_f_f_e_r_S_i_z_e = std::max({SPB:: │ │ │ │ -multiIndexBufferSize...}) + isBlocked; │ │ │ │ -90 │ │ │ │ -96 template = 0, │ │ │ │ -98 _e_n_a_b_l_e_I_f_C_o_n_s_t_r_u_c_t_i_b_l_e, SFArgs...> = 0> │ │ │ │ -_9_9 _C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s(SFArgs&&... sfArgs) : │ │ │ │ -100 subPreBases_(std::forward(sfArgs)...) │ │ │ │ -101 { │ │ │ │ -102 Hybrid::forEach(subPreBases_, [&](const auto& _s_u_b_P_r_e_B_a_s_i_s){ │ │ │ │ -103 static_assert(models, std::decay_t>(), "Subprebases passed to CompositePreBasis does not model the │ │ │ │ -PreBasis concept."); │ │ │ │ -104 }); │ │ │ │ -105 } │ │ │ │ -106 │ │ │ │ -113 template 1)>, // Avoid ambiguous constructor if │ │ │ │ -there's only one child │ │ │ │ -116 std::is_same, │ │ │ │ -117 std::is_constructible... │ │ │ │ -118 >, int> = 0> │ │ │ │ -_1_1_9 _C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s(const GV& gv) : │ │ │ │ -120 subPreBases_(SPB(gv)...) │ │ │ │ -121 { │ │ │ │ -122 Hybrid::forEach(subPreBases_, [&](const auto& _s_u_b_P_r_e_B_a_s_i_s){ │ │ │ │ -123 static_assert(models, std::decay_t>(), "Subprebases passed to CompositePreBasis does not model the │ │ │ │ -PreBasis concept."); │ │ │ │ -124 }); │ │ │ │ -125 } │ │ │ │ -126 │ │ │ │ -_1_2_8 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ -129 { │ │ │ │ -130 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto i) { │ │ │ │ -131 this->_s_u_b_P_r_e_B_a_s_i_s(i).initializeIndices(); │ │ │ │ -132 }); │ │ │ │ -133 } │ │ │ │ -134 │ │ │ │ -_1_3_6 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ -137 { │ │ │ │ -138 return std::get<0>(subPreBases_).gridView(); │ │ │ │ -139 } │ │ │ │ -140 │ │ │ │ -_1_4_2 void _u_p_d_a_t_e(const _G_r_i_d_V_i_e_w& gv) │ │ │ │ -143 { │ │ │ │ -144 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto i) { │ │ │ │ -145 this->_s_u_b_P_r_e_B_a_s_i_s(i).update(gv); │ │ │ │ -146 }); │ │ │ │ -147 } │ │ │ │ -148 │ │ │ │ -_1_5_2 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ -153 { │ │ │ │ -154 auto node = _N_o_d_e{}; │ │ │ │ -155 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto i) { │ │ │ │ -156 node.setChild(this->_s_u_b_P_r_e_B_a_s_i_s(i)._m_a_k_e_N_o_d_e(), i); │ │ │ │ -157 }); │ │ │ │ -158 return node; │ │ │ │ -159 } │ │ │ │ -160 │ │ │ │ -_1_6_2 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ +84 template │ │ │ │ +85 PeriodicIndexingTransformation(const RawPreBasis& rawPreBasis, const │ │ │ │ +IndexPairSet& indexPairSet) │ │ │ │ +86 { │ │ │ │ +87 static_assert(RawPreBasis::maxMultiIndexSize==1, │ │ │ │ +"PeriodicIndexingTransformation is only implemented for flat multi-indices"); │ │ │ │ +88 std::size_t invalid = {std::numeric_limits::max()}; │ │ │ │ +89 mappedIdx_.resize(rawPreBasis.size(), invalid); │ │ │ │ +90 numIndices_ = 0; │ │ │ │ +91 std::size_t i = 0; │ │ │ │ +92 for(const auto& [a, b] : indexPairSet) │ │ │ │ +93 { │ │ │ │ +94 for(; i<=a; ++i) │ │ │ │ +95 if (mappedIdx_[i] == invalid) │ │ │ │ +96 mappedIdx_[i] = numIndices_++; │ │ │ │ +97 mappedIdx_[b] = mappedIdx_[a]; │ │ │ │ +98 } │ │ │ │ +99 for(; i │ │ │ │ +105 void transformIndex(MultiIndex& multiIndex, const PreBasis& preBasis) const │ │ │ │ +106 { │ │ │ │ +107 multiIndex = {{ mappedIdx_[multiIndex[0]] }}; │ │ │ │ +108 } │ │ │ │ +109 │ │ │ │ +110 template │ │ │ │ +111 std::size_t size(const Prefix& prefix, const PreBasis& preBasis) const │ │ │ │ +112 { │ │ │ │ +113 if (prefix.size() == 1) │ │ │ │ +114 return 0; │ │ │ │ +115 return numIndices_; │ │ │ │ +116 } │ │ │ │ +117 │ │ │ │ +118 template │ │ │ │ +119 auto dimension(const PreBasis& preBasis) const │ │ │ │ +120 { │ │ │ │ +121 return numIndices_; │ │ │ │ +122 } │ │ │ │ +123 │ │ │ │ +125 template │ │ │ │ +126 auto containerDescriptor(const PreBasis& preBasis) const │ │ │ │ +127 { │ │ │ │ +128 return _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r(preBasis); │ │ │ │ +129 } │ │ │ │ +130 │ │ │ │ +131private: │ │ │ │ +132 std::vector mappedIdx_; │ │ │ │ +133 std::size_t numIndices_; │ │ │ │ +134}; │ │ │ │ +135 │ │ │ │ +136 │ │ │ │ +137 │ │ │ │ +138template │ │ │ │ +139class PeriodicPreBasisFactory │ │ │ │ +140{ │ │ │ │ +141public: │ │ │ │ +142 PeriodicPreBasisFactory() │ │ │ │ +143 {} │ │ │ │ +144 │ │ │ │ +145 template │ │ │ │ +146 PeriodicPreBasisFactory(RPBI&& rawPreBasisIndicator, PIS&& │ │ │ │ +periodicIndexSet) : │ │ │ │ +147 rawPreBasisIndicator_(std::forward(rawPreBasisIndicator)), │ │ │ │ +148 periodicIndexSet_(std::forward(periodicIndexSet)) │ │ │ │ +149 {} │ │ │ │ +150 │ │ │ │ +151 template,RawPreBasisIndicator>(), int> = 0> │ │ │ │ +153 auto operator()(const GridView& gridView) const │ │ │ │ +154 { │ │ │ │ +155 const auto& rawPreBasis = rawPreBasisIndicator_.preBasis(); │ │ │ │ +156 auto transformation = PeriodicIndexingTransformation(rawPreBasis, │ │ │ │ +periodicIndexSet_.indexPairSet()); │ │ │ │ +157 return _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s(std::move │ │ │ │ +(rawPreBasis), std::move(transformation)); │ │ │ │ +158 } │ │ │ │ +159 │ │ │ │ +160 template,RawPreBasisIndicator> │ │ │ │ +(), int> = 0> │ │ │ │ +162 auto operator()(const GridView& gridView) const │ │ │ │ 163 { │ │ │ │ -164 return _s_i_z_e(Dune::ReservedVector{}); │ │ │ │ -165 } │ │ │ │ -166 │ │ │ │ -168 template │ │ │ │ -_1_6_9 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix) const │ │ │ │ -170 { │ │ │ │ -171 return _s_i_z_e(prefix, _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y{}); │ │ │ │ -172 } │ │ │ │ -173 │ │ │ │ -174private: │ │ │ │ -175 │ │ │ │ -176 template │ │ │ │ -177 static void multiIndexPopFront(MultiIndex& M) │ │ │ │ -178 { │ │ │ │ -179 for(std::size_t i=0; i │ │ │ │ -185 _s_i_z_e___t_y_p_e _s_i_z_e(SizePrefix prefix, BasisFactory::BlockedLexicographic) const │ │ │ │ -186 { │ │ │ │ -187 if (prefix.size() == 0) │ │ │ │ -188 return _c_h_i_l_d_r_e_n; │ │ │ │ -189 │ │ │ │ -190 auto front = prefix.front(); │ │ │ │ -191 multiIndexPopFront(prefix); │ │ │ │ -192 return Hybrid::switchCases(_C_h_i_l_d_I_n_d_i_c_e_s(), front, [&] (auto i) { │ │ │ │ -193 return this->_s_u_b_P_r_e_B_a_s_i_s(i).size(prefix); │ │ │ │ -194 }, []() { │ │ │ │ -195 return _s_i_z_e___t_y_p_e(0); │ │ │ │ -196 }); │ │ │ │ -197 } │ │ │ │ -198 │ │ │ │ -199 template │ │ │ │ -200 _s_i_z_e___t_y_p_e _s_i_z_e(SizePrefix prefix, BasisFactory::FlatLexicographic) const │ │ │ │ -201 { │ │ │ │ -202 _s_i_z_e___t_y_p_e result = 0; │ │ │ │ -203 if (prefix.size() == 0) │ │ │ │ -204 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto i) { │ │ │ │ -205 result += this->_s_u_b_P_r_e_B_a_s_i_s(i).size(); │ │ │ │ -206 }); │ │ │ │ -207 else { │ │ │ │ -208 _s_t_a_t_i_c_F_i_n_d_I_n_R_a_n_g_e_<_0_,_ _c_h_i_l_d_r_e_n_>([&](auto i) { │ │ │ │ -209 auto firstDigitSize = this->_s_u_b_P_r_e_B_a_s_i_s(i).size(); │ │ │ │ -210 if (prefix[0] < firstDigitSize) │ │ │ │ -211 { │ │ │ │ -212 result = this->_s_u_b_P_r_e_B_a_s_i_s(i).size(prefix); │ │ │ │ -213 return true; │ │ │ │ -214 } │ │ │ │ -215 prefix[0] -= firstDigitSize; │ │ │ │ -216 return false; │ │ │ │ -217 }); │ │ │ │ -218 } │ │ │ │ -219 return result; │ │ │ │ -220 } │ │ │ │ -221 │ │ │ │ -222public: │ │ │ │ -223 │ │ │ │ -_2_2_5 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ -226 { │ │ │ │ -227 _s_i_z_e___t_y_p_e r=0; │ │ │ │ -228 // Accumulate dimension() for all subprebases │ │ │ │ -229 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto i) { │ │ │ │ -230 r += this->_s_u_b_P_r_e_B_a_s_i_s(i).dimension(); │ │ │ │ -231 }); │ │ │ │ -232 return r; │ │ │ │ -233 } │ │ │ │ -234 │ │ │ │ -_2_3_6 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ -237 { │ │ │ │ -238 _s_i_z_e___t_y_p_e r=0; │ │ │ │ -239 // Accumulate maxNodeSize() for all subprebases │ │ │ │ -240 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto i) { │ │ │ │ -241 r += this->_s_u_b_P_r_e_B_a_s_i_s(i).maxNodeSize(); │ │ │ │ -242 }); │ │ │ │ -243 return r; │ │ │ │ -244 } │ │ │ │ -245 │ │ │ │ -247 template │ │ │ │ -_2_4_8 const _S_u_b_P_r_e_B_a_s_i_s_<_i_>& _s_u_b_P_r_e_B_a_s_i_s(Dune::index_constant = {}) const │ │ │ │ -249 { │ │ │ │ -250 return std::get(subPreBases_); │ │ │ │ -251 } │ │ │ │ -252 │ │ │ │ -254 template │ │ │ │ -_2_5_5 _S_u_b_P_r_e_B_a_s_i_s_<_i_>& _s_u_b_P_r_e_B_a_s_i_s(Dune::index_constant = {}) │ │ │ │ -256 { │ │ │ │ -257 return std::get(subPreBases_); │ │ │ │ -258 } │ │ │ │ -259 │ │ │ │ -_2_6_1 const auto& _s_u_b_P_r_e_B_a_s_e_s() const │ │ │ │ -262 { │ │ │ │ -263 return subPreBases_; │ │ │ │ -264 } │ │ │ │ -265 │ │ │ │ -267 template │ │ │ │ -_2_6_8 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ -269 { │ │ │ │ -270 return _i_n_d_i_c_e_s(node, it, _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y{}); │ │ │ │ -271 } │ │ │ │ -272 │ │ │ │ -_2_7_4 auto _c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r() const │ │ │ │ -275 { │ │ │ │ -276 namespace CD = _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s; │ │ │ │ -277 if constexpr(std::is_same_v) { │ │ │ │ -278 return std::apply([&](auto const&... spb) { │ │ │ │ -279 return CD::makeDescriptor(_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r(spb)...); │ │ │ │ -280 }, subPreBases_); │ │ │ │ -281 } │ │ │ │ -282 else if constexpr(std::is_same_v) { │ │ │ │ -283 return std::apply([&](auto const&... spb) { │ │ │ │ -284 return CD::Impl::flatLexicographic(_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r │ │ │ │ -(spb)...); │ │ │ │ -285 }, subPreBases_); │ │ │ │ -286 } │ │ │ │ -287 else │ │ │ │ -288 return CD::Unknown{}; │ │ │ │ -289 } │ │ │ │ -290 │ │ │ │ -291private: │ │ │ │ -292 │ │ │ │ -293 template │ │ │ │ -294 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It multiIndices, _B_a_s_i_s_F_a_c_t_o_r_y_:_: │ │ │ │ -_F_l_a_t_L_e_x_i_c_o_g_r_a_p_h_i_c) const │ │ │ │ -295 { │ │ │ │ -296 _s_i_z_e___t_y_p_e firstComponentOffset = 0; │ │ │ │ -297 // Loop over all children │ │ │ │ -298 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto child){ │ │ │ │ -299 _s_i_z_e___t_y_p_e subTreeSize = node.child(child).size(); │ │ │ │ -300 // Fill indices for current child into index buffer starting from current │ │ │ │ -301 // buffer position and shift first index component of any index for current │ │ │ │ -302 // child by suitable offset to get lexicographic indices. │ │ │ │ -303 _s_u_b_P_r_e_B_a_s_i_s(child).indices(node.child(child), multiIndices); │ │ │ │ -304 for (std::size_t i = 0; i │ │ │ │ -315 static void multiIndexPushFront(MultiIndex& M, _s_i_z_e___t_y_p_e M0) │ │ │ │ -316 { │ │ │ │ -317 M.resize(M.size()+1); │ │ │ │ -318 for(std::size_t i=M.size()-1; i>0; --i) │ │ │ │ -319 M[i] = M[i-1]; │ │ │ │ -320 M[0] = M0; │ │ │ │ -321 } │ │ │ │ -322 │ │ │ │ -323 template │ │ │ │ -324 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It multiIndices, BasisFactory:: │ │ │ │ -BlockedLexicographic) const │ │ │ │ -325 { │ │ │ │ -326 // Loop over all children │ │ │ │ -327 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto child){ │ │ │ │ -328 _s_i_z_e___t_y_p_e subTreeSize = node.child(child).size(); │ │ │ │ -329 // Fill indices for current child into index buffer starting from current │ │ │ │ -position │ │ │ │ -330 _s_u_b_P_r_e_B_a_s_i_s(child).indices(node.child(child), multiIndices); │ │ │ │ -331 // Insert child index before first component of all indices of current │ │ │ │ -child. │ │ │ │ -332 for (std::size_t i = 0; imultiIndexPushFront(multiIndices[i], child); │ │ │ │ -334 // Increment buffer iterator by the number of indices processed for current │ │ │ │ -child │ │ │ │ -335 multiIndices += subTreeSize; │ │ │ │ -336 }); │ │ │ │ -337 return multiIndices; │ │ │ │ -338 } │ │ │ │ -339 │ │ │ │ -340 std::tuple subPreBases_; │ │ │ │ -341}; │ │ │ │ -342 │ │ │ │ -343 │ │ │ │ -344 │ │ │ │ -345namespace _B_a_s_i_s_F_a_c_t_o_r_y { │ │ │ │ -346 │ │ │ │ -347namespace Imp { │ │ │ │ -348 │ │ │ │ -349template │ │ │ │ -350class CompositePreBasisFactory │ │ │ │ -351{ │ │ │ │ -352 │ │ │ │ -353 template │ │ │ │ -354 auto makePreBasisFromChildPreBases(const GridView&, ChildPreBasis&&... │ │ │ │ -childPreBasis) const │ │ │ │ -355 { │ │ │ │ -356 return CompositePreBasis...>(std::forward(childPreBasis)...); │ │ │ │ -357 } │ │ │ │ -358 │ │ │ │ -359public: │ │ │ │ -360 │ │ │ │ -361 CompositePreBasisFactory(const ChildPreBasisFactory&... │ │ │ │ -childPreBasisFactory) : │ │ │ │ -362 childPreBasisFactories_(childPreBasisFactory...) │ │ │ │ -363 {} │ │ │ │ -364 │ │ │ │ -365 CompositePreBasisFactory(ChildPreBasisFactory&&... childPreBasisFactory) : │ │ │ │ -366 childPreBasisFactories_(std::move(childPreBasisFactory)...) │ │ │ │ -367 {} │ │ │ │ -368 │ │ │ │ -369 template │ │ │ │ -370 auto operator()(const GridView& gridView) const │ │ │ │ -371 { │ │ │ │ -372 // Use std::apply to unpack the tuple childPreBasisFactories_ │ │ │ │ -373 return std::apply([&](const auto&... childPreBasisFactory) { │ │ │ │ -374 return this->makePreBasisFromChildPreBases(gridView, childPreBasisFactory │ │ │ │ -(gridView)...); │ │ │ │ -375 }, childPreBasisFactories_); │ │ │ │ -376 } │ │ │ │ -377 │ │ │ │ -378private: │ │ │ │ -379 std::tuple childPreBasisFactories_; │ │ │ │ -380}; │ │ │ │ -381 │ │ │ │ -382} // end namespace BasisFactory::Imp │ │ │ │ -383 │ │ │ │ -384 │ │ │ │ -385 │ │ │ │ -396template< │ │ │ │ -397 typename... Args, │ │ │ │ -398 std::enable_if_t<_C_o_n_c_e_p_t_:_:_i_s_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y::type>(),int> = 0> │ │ │ │ -_3_9_9auto _c_o_m_p_o_s_i_t_e(Args&&... args) │ │ │ │ -400{ │ │ │ │ -401 // We have to separate the last entry which is the IndexMergingStrategy │ │ │ │ -402 // and the preceding ones, which are the ChildPreBasisFactories │ │ │ │ -403 │ │ │ │ -404 using ArgTuple = std::tuple...>; │ │ │ │ -405 │ │ │ │ -406 // Compute number of children and index of the IndexMergingStrategy │ │ │ │ -argument │ │ │ │ -407 constexpr std::size_t children = sizeof...(Args) - 1; │ │ │ │ -408 │ │ │ │ -409 // Use last type as IndexMergingStrategy │ │ │ │ -410 using _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y = std::tuple_element_t; │ │ │ │ -411 │ │ │ │ -412 // Index sequence for all but the last entry for partial tuple unpacking │ │ │ │ -413 auto childIndices = std::make_index_sequence{}; │ │ │ │ -414 │ │ │ │ -415 // Unpack tuple only for those entries related to children │ │ │ │ -416 return applyPartial([](auto&&... childPreBasisFactory){ │ │ │ │ -417 return Imp::CompositePreBasisFactory<_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y, std:: │ │ │ │ -decay_t...>(std::forward(childPreBasisFactory)...); │ │ │ │ -418 }, │ │ │ │ -419 std::forward_as_tuple(std::forward(args)...), │ │ │ │ -420 childIndices); │ │ │ │ -421} │ │ │ │ -422 │ │ │ │ -434template< │ │ │ │ -435 typename... Args, │ │ │ │ -436 std::enable_if_t::type>(),int> = 0> │ │ │ │ -437[[deprecated("Using the method `composite` without an explicit index merging │ │ │ │ -strategy" │ │ │ │ -438 " will change its meaning after the release of dune-functions 2.11." │ │ │ │ -439 " Previously, the default merging strategy was `BlockedLexicographic`," │ │ │ │ -440 " but this will change to `FlatLexicographic`." │ │ │ │ -441 " Change the call to `composite(..., blockedLexicographic())` to retain the │ │ │ │ -old behavior.")]] │ │ │ │ -_4_4_2auto _c_o_m_p_o_s_i_t_e(Args&&... args) │ │ │ │ -443{ │ │ │ │ -444 return Imp::CompositePreBasisFactory...>(std::forward(args)...); │ │ │ │ -445} │ │ │ │ -446 │ │ │ │ -447} // end namespace BasisFactory │ │ │ │ -448 │ │ │ │ -449 │ │ │ │ -450 │ │ │ │ -451} // end namespace Functions │ │ │ │ -452} // end namespace Dune │ │ │ │ -453 │ │ │ │ -454 │ │ │ │ -455#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH │ │ │ │ -_n_o_d_e_s_._h_h │ │ │ │ -_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ +164 const auto& rawPreBasis = rawPreBasisIndicator_; │ │ │ │ +165 auto transformation = PeriodicIndexingTransformation(rawPreBasis, │ │ │ │ +periodicIndexSet_.indexPairSet()); │ │ │ │ +166 return _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s(std::move │ │ │ │ +(rawPreBasis), std::move(transformation)); │ │ │ │ +167 } │ │ │ │ +168 │ │ │ │ +169 template,RawPreBasisIndicator>(), int> = 0, │ │ │ │ +171 std::enable_if_t,RawPreBasisIndicator>(), int> = 0> │ │ │ │ +172 auto operator()(const GridView& gridView) const │ │ │ │ +173 { │ │ │ │ +174 auto rawPreBasis = rawPreBasisIndicator_(gridView); │ │ │ │ +175 rawPreBasis.initializeIndices(); │ │ │ │ +176 auto transformation = PeriodicIndexingTransformation(rawPreBasis, │ │ │ │ +periodicIndexSet_.indexPairSet()); │ │ │ │ +177 return _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s(std::move │ │ │ │ +(rawPreBasis), std::move(transformation)); │ │ │ │ +178 } │ │ │ │ +179 │ │ │ │ +180private: │ │ │ │ +181 RawPreBasisIndicator rawPreBasisIndicator_; │ │ │ │ +182 PeriodicIndexSet periodicIndexSet_; │ │ │ │ +183}; │ │ │ │ +184 │ │ │ │ +185} // end namespace BasisFactory::Impl │ │ │ │ +186 │ │ │ │ +187 │ │ │ │ +188 │ │ │ │ +202template │ │ │ │ +_2_0_3auto _p_e_r_i_o_d_i_c( │ │ │ │ +204 RawPreBasisIndicator&& rawPreBasisIndicator, │ │ │ │ +205 PIS&& periodicIndexSet │ │ │ │ +206 ) │ │ │ │ +207{ │ │ │ │ +208 return Impl::PeriodicPreBasisFactory>( │ │ │ │ +209 std::forward(rawPreBasisIndicator), │ │ │ │ +210 std::forward(periodicIndexSet)); │ │ │ │ +211} │ │ │ │ +212 │ │ │ │ +213} // end namespace Experimental │ │ │ │ +214 │ │ │ │ +215} // end namespace BasisFactory │ │ │ │ +216 │ │ │ │ +217} // end namespace Dune::Functions │ │ │ │ +218 │ │ │ │ +219#endif // DUNE_FUFEM_PERIODICBASIS_HH │ │ │ │ +_t_r_a_n_s_f_o_r_m_e_d_i_n_d_e_x_b_a_s_i_s_._h_h │ │ │ │ _c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h │ │ │ │ Lightweight representation of (hierarchical) size and block structure extracted │ │ │ │ from a basis to descr... │ │ │ │ -_b_a_s_i_s_t_a_g_s_._h_h │ │ │ │ -_u_t_i_l_i_t_y_._h_h │ │ │ │ -_t_y_p_e___t_r_a_i_t_s_._h_h │ │ │ │ -_s_t_a_t_i_c_f_o_r_l_o_o_p_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_c_o_m_p_o_s_i_t_e │ │ │ │ -auto composite(Args &&... args) │ │ │ │ -Create a factory builder that can build a CompositePreBasis. │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:399 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_s_t_a_t_i_c_F_i_n_d_I_n_R_a_n_g_e │ │ │ │ -void staticFindInRange(F &&f, Args &&... args) │ │ │ │ -Static find loop. │ │ │ │ -DDeeffiinniittiioonn staticforloop.hh:60 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_e_n_a_b_l_e_I_f_C_o_n_s_t_r_u_c_t_i_b_l_e │ │ │ │ -std::enable_if_t< std::is_constructible_v< T, Args... >, int > │ │ │ │ -enableIfConstructible │ │ │ │ -Helper to constrain forwarding constructors. │ │ │ │ -DDeeffiinniittiioonn type_traits.hh:30 │ │ │ │ -_D_u_n_e │ │ │ │ -DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_p_e_r_i_o_d_i_c │ │ │ │ +auto periodic(RawPreBasisIndicator &&rawPreBasisIndicator, PIS │ │ │ │ +&&periodicIndexSet) │ │ │ │ +Create a pre-basis factory that can create a periodic pre-basis. │ │ │ │ +DDeeffiinniittiioonn periodicbasis.hh:203 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r │ │ │ │ auto containerDescriptor(const PreBasis &preBasis) │ │ │ │ Return the container descriptor of the pre-basis, if defined, otherwise │ │ │ │ ContainerDescriptor::Unknown. │ │ │ │ DDeeffiinniittiioonn containerdescriptors.hh:58 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ -static constexpr bool isIndexMergingStrategy() │ │ │ │ -DDeeffiinniittiioonn basistags.hh:27 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s │ │ │ │ -DDeeffiinniittiioonn containerfactory.hh:20 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s │ │ │ │ +TransformedIndexPreBasis(RPB &&, T &&) -> TransformedIndexPreBasis< std:: │ │ │ │ +decay_t< RPB >, std::decay_t< T > > │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ DDeeffiinniittiioonn argyrisbasis.hh:926 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_s_t_T_y_p_e │ │ │ │ -Get last entry of type list. │ │ │ │ -DDeeffiinniittiioonn utility.hh:230 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ -Base class for index merging strategies to simplify detection. │ │ │ │ -DDeeffiinniittiioonn basistags.hh:48 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_F_l_a_t_L_e_x_i_c_o_g_r_a_p_h_i_c │ │ │ │ -Lexicographic merging of direct children without blocking. │ │ │ │ -DDeeffiinniittiioonn basistags.hh:84 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s │ │ │ │ -A pre-basis for composite bases. │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:57 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_s_u_b_P_r_e_B_a_s_i_s │ │ │ │ -SubPreBasis< i > & subPreBasis(Dune::index_constant< i >={}) │ │ │ │ -Mutable access to the stored prebasis of the factor in the power space. │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:255 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ -IMS IndexMergingStrategy │ │ │ │ -Strategy used to merge the global indices of the child pre-bases. │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:75 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_m_a_x_N_o_d_e_S_i_z_e │ │ │ │ -size_type maxNodeSize() const │ │ │ │ -Get the maximal number of DOFs associated to node for any element. │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:236 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_s_u_b_P_r_e_B_a_s_i_s │ │ │ │ -const SubPreBasis< i > & subPreBasis(Dune::index_constant< i >={}) const │ │ │ │ -Const access to the stored prebasis of the factor in the power space. │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:248 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -Type used for indices and size information. │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:72 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_N_o_d_e │ │ │ │ -CompositeBasisNode< typename SPB::Node... > Node │ │ │ │ -Template mapping root tree path to type of created tree node. │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:85 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ -size_type size(const SizePrefix &prefix) const │ │ │ │ -Return number of possible values for next position in multi index. │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:169 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s │ │ │ │ -CompositePreBasis(SFArgs &&... sfArgs) │ │ │ │ -Constructor for given child pre-basis objects. │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:99 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ -size_type dimension() const │ │ │ │ -Get the total dimension of the space spanned by this basis. │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:225 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s │ │ │ │ -CompositePreBasis(const GV &gv) │ │ │ │ -Constructor for given GridView. │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:119 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_i_n_d_i_c_e_s │ │ │ │ -It indices(const Node &node, It it) const │ │ │ │ -Maps from subtree index set [0..size-1] to a globally unique multi index in │ │ │ │ -global basis. │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:268 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ -size_type size() const │ │ │ │ -Same as size(prefix) with empty prefix. │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:162 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ -typename std::tuple_element_t< 0, SubPreBases >::GridView GridView │ │ │ │ -The grid view that the FE basis is defined on. │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:69 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_c_h_i_l_d_r_e_n │ │ │ │ -static const std::size_t children │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:78 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_S_u_b_P_r_e_B_a_s_e_s │ │ │ │ -std::tuple< SPB... > SubPreBases │ │ │ │ -Tuple of child pre-bases. │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:62 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_m_a_k_e_N_o_d_e │ │ │ │ -Node makeNode() const │ │ │ │ -Create tree node. │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:152 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ -void initializeIndices() │ │ │ │ -Initialize the global indices. │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:128 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_S_u_b_P_r_e_B_a_s_i_s │ │ │ │ -std::tuple_element_t< i, SubPreBases > SubPreBasis │ │ │ │ -Export individual child pre-bases by index. │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:66 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_C_h_i_l_d_I_n_d_i_c_e_s │ │ │ │ -std::make_index_sequence< children > ChildIndices │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:80 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_u_p_d_a_t_e │ │ │ │ -void update(const GridView &gv) │ │ │ │ -Update the stored grid view, to be called if the grid has changed. │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:142 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_m_u_l_t_i_I_n_d_e_x_B_u_f_f_e_r_S_i_z_e │ │ │ │ -static constexpr size_type multiIndexBufferSize │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:89 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_s_u_b_P_r_e_B_a_s_e_s │ │ │ │ -const auto & subPreBases() const │ │ │ │ -Const access to the stored prebases tuple. │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:261 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_g_r_i_d_V_i_e_w │ │ │ │ -const GridView & gridView() const │ │ │ │ -Obtain the grid view that the basis is defined on. │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:136 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_m_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ -static constexpr size_type minMultiIndexSize │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:88 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r │ │ │ │ -auto containerDescriptor() const │ │ │ │ -Return the associated container descriptor. │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:274 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s_:_:_m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ -static constexpr size_type maxMultiIndexSize │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:87 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e │ │ │ │ -DDeeffiinniittiioonn nodes.hh:397 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l │ │ │ │ +DDeeffiinniittiioonn periodicbasis.hh:29 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_P_e_r_i_o_d_i_c_I_n_d_e_x_S_e_t │ │ │ │ +Container storing identified indices for a periodic basis. │ │ │ │ +DDeeffiinniittiioonn periodicbasis.hh:41 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_P_e_r_i_o_d_i_c_I_n_d_e_x_S_e_t_:_:_u_n_i_f_y_I_n_d_e_x_P_a_i_r │ │ │ │ +void unifyIndexPair(std::size_t a, std::size_t b) │ │ │ │ +Insert a pair of indices. │ │ │ │ +DDeeffiinniittiioonn periodicbasis.hh:52 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_P_e_r_i_o_d_i_c_I_n_d_e_x_S_e_t_:_:_i_n_d_e_x_P_a_i_r_S_e_t │ │ │ │ +const auto & indexPairSet() const │ │ │ │ +DDeeffiinniittiioonn periodicbasis.hh:61 │ │ │ │ _c_o_n_c_e_p_t_s_._h_h │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _c_o_m_p_o_s_i_t_e_b_a_s_i_s_._h_h │ │ │ │ + * _p_e_r_i_o_d_i_c_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00179.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: bsplinebasis.hh File Reference │ │ │ +Dune-Functions: nodes.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,79 +88,64 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
bsplinebasis.hh File Reference
│ │ │ +
nodes.hh File Reference
│ │ │
│ │ │
│ │ │ - │ │ │ -

The B-spline global function space basis. │ │ │ -More...

│ │ │ -
#include <array>
│ │ │ -#include <numeric>
│ │ │ -#include <dune/common/dynmatrix.hh>
│ │ │ -#include <dune/localfunctions/common/localbasis.hh>
│ │ │ -#include <dune/common/diagonalmatrix.hh>
│ │ │ -#include <dune/localfunctions/common/localkey.hh>
│ │ │ -#include <dune/localfunctions/common/localfiniteelementtraits.hh>
│ │ │ -#include <dune/geometry/type.hh>
│ │ │ -#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ -#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │ -#include <dune/functions/functionspacebases/leafprebasismixin.hh>
│ │ │ +
#include <cassert>
│ │ │ +#include <memory>
│ │ │ +#include <vector>
│ │ │ +#include <array>
│ │ │ +#include <optional>
│ │ │ +#include <dune/common/indices.hh>
│ │ │ +#include <dune/common/tuplevector.hh>
│ │ │ +#include <dune/common/typelist.hh>
│ │ │ +#include <dune/common/hybridmultiindex.hh>
│ │ │ +#include <dune/common/typetree/traversal.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::BSplineLocalBasis< GV, R >
 LocalBasis class in the sense of dune-localfunctions, presenting the restriction of a B-spline patch to a knot span. More...
class  Dune::Functions::BSplineLocalCoefficients< dim >
 Attaches a shape function to an entity. More...
class  Dune::Functions::BSplineLocalInterpolation< dim, LB >
 Local interpolation in the sense of dune-localfunctions, for the B-spline basis on tensor-product grids. More...
class  Dune::Functions::BSplineLocalFiniteElement< GV, R >
 LocalFiniteElement in the sense of dune-localfunctions, for the B-spline basis on tensor-product grids. More...
class  Dune::Functions::BSplinePreBasis< GV >
 Pre-basis for B-spline basis. More...
class  Dune::Functions::BSplineNode< GV >
class  Dune::Functions::BasisNodeMixin
class  Dune::Functions::LeafBasisNode
class  Dune::Functions::InnerBasisNodeMixin< Node, Element >
class  Dune::Functions::PowerBasisNode< T, n >
class  Dune::Functions::DynamicPowerBasisNode< T >
class  Dune::Functions::CompositeBasisNode< T >
struct  Dune::Functions::CompositeBasisNode< T >::Child< k >
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ -

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::BasisFactory
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │

│ │ │ -Typedefs

template<typename GV>
using Dune::Functions::BSplineBasis = DefaultGlobalBasis<BSplinePreBasis<GV> >
 A global B-spline basis.
│ │ │ │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Functions

auto Dune::Functions::BasisFactory::bSpline (const std::vector< double > &knotVector, unsigned int order, bool makeOpen=true)
 Create a pre-basis factory that can create a B-spline pre-basis.
template<typename Tree, typename Entity>
void Dune::Functions::bindTree (Tree &tree, const Entity &entity, std::size_t offset=0)
template<typename Tree>
void Dune::Functions::initializeTree (Tree &tree, std::size_t treeIndexOffset=0)
│ │ │ -

Detailed Description

│ │ │ -

The B-spline global function space basis.

│ │ │ -
│ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,52 +1,39 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -bsplinebasis.hh File Reference │ │ │ │ -The B-spline global function space basis. _M_o_r_e_._._. │ │ │ │ +nodes.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h> │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s_<_ _G_V_,_ _R_ _> │ │ │ │ -  LocalBasis class in the sense of dune-localfunctions, presenting the │ │ │ │ - restriction of a B-spline patch to a knot span. _M_o_r_e_._._. │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s_<_ _d_i_m_ _> │ │ │ │ -  Attaches a shape function to an entity. _M_o_r_e_._._. │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_I_n_t_e_r_p_o_l_a_t_i_o_n_<_ _d_i_m_,_ _L_B_ _> │ │ │ │ -  Local interpolation in the sense of dune-localfunctions, for the B- │ │ │ │ - spline basis on tensor-product grids. _M_o_r_e_._._. │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_ _G_V_,_ _R_ _> │ │ │ │ -  LocalFiniteElement in the sense of dune-localfunctions, for the B- │ │ │ │ - spline basis on tensor-product grids. _M_o_r_e_._._. │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_<_ _G_V_ _> │ │ │ │ -  Pre-basis for B-spline basis. _M_o_r_e_._._. │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_N_o_d_e_<_ _G_V_ _> │ │ │ │ + class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n │ │ │ │ + class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ + class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_n_n_e_r_B_a_s_i_s_N_o_d_e_M_i_x_i_n_<_ _N_o_d_e_,_ _E_l_e_m_e_n_t_ _> │ │ │ │ + class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_ _T_,_ _n_ _> │ │ │ │ + class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_ _T_ _> │ │ │ │ + class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_<_ _T_ _> │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_<_ _T_ _>_:_:_C_h_i_l_d_<_ _k_ _> │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -TTyyppeeddeeffss │ │ │ │ -template │ │ │ │ -using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_B_a_s_i_s = _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s<_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s > │ │ │ │ -  A global B-spline basis. │ │ │ │ FFuunnccttiioonnss │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_b_S_p_l_i_n_e (const std::vector< double > │ │ │ │ - &knotVector, unsigned int order, bool makeOpen=true) │ │ │ │ -  Create a pre-basis factory that can create a B-spline pre-basis. │ │ │ │ -********** DDeettaaiilleedd DDeessccrriippttiioonn ********** │ │ │ │ -The B-spline global function space basis. │ │ │ │ +template │ │ │ │ +void  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_b_i_n_d_T_r_e_e (Tree &tree, const Entity &entity, std::size_t │ │ │ │ + offset=0) │ │ │ │ +template │ │ │ │ +void  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_i_n_i_t_i_a_l_i_z_e_T_r_e_e (Tree &tree, std::size_t │ │ │ │ + treeIndexOffset=0) │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _b_s_p_l_i_n_e_b_a_s_i_s_._h_h │ │ │ │ + * _n_o_d_e_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00179.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,5 +1,11 @@ │ │ │ │ var a00179 = [ │ │ │ │ - ["Dune::Functions::BSplineNode< GV >", "a01698.html", "a01698"], │ │ │ │ - ["Dune::Functions::BSplineBasis", "a00312.html#gaf2f75f87ed4cb5223378259c760c1e97", null], │ │ │ │ - ["Dune::Functions::BasisFactory::bSpline", "a00312.html#ga63a9701af71fffbbb851a38cb8cf886f", null] │ │ │ │ + ["Dune::Functions::BasisNodeMixin", "a02002.html", "a02002"], │ │ │ │ + ["Dune::Functions::LeafBasisNode", "a02006.html", "a02006"], │ │ │ │ + ["Dune::Functions::InnerBasisNodeMixin< Node, Element >", "a02010.html", "a02010"], │ │ │ │ + ["Dune::Functions::PowerBasisNode< T, n >", "a02014.html", "a02014"], │ │ │ │ + ["Dune::Functions::DynamicPowerBasisNode< T >", "a02018.html", "a02018"], │ │ │ │ + ["Dune::Functions::CompositeBasisNode< T >", "a02022.html", "a02022"], │ │ │ │ + ["Dune::Functions::CompositeBasisNode< T >::Child< k >", "a02026.html", "a02026"], │ │ │ │ + ["Dune::Functions::bindTree", "a00318.html#a4dc892a209e0f55bc65eadaf2c808454", null], │ │ │ │ + ["Dune::Functions::initializeTree", "a00318.html#a5e19b913a34ad68144f4fd873c51b977", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00179_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: bsplinebasis.hh Source File │ │ │ +Dune-Functions: nodes.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,1297 +88,607 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
bsplinebasis.hh
│ │ │ +
nodes.hh
│ │ │
│ │ │
│ │ │ -Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ +Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BSPLINEBASIS_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BSPLINEBASIS_HH
│ │ │ -
9
│ │ │ -
13
│ │ │ -
14#include <array>
│ │ │ -
15#include <numeric>
│ │ │ -
16
│ │ │ -
18#include <dune/common/dynmatrix.hh>
│ │ │ +
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH
│ │ │ +
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH
│ │ │ +
9
│ │ │ +
10#include <cassert>
│ │ │ +
11#include <memory>
│ │ │ +
12#include <vector>
│ │ │ +
13#include <array>
│ │ │ +
14#include <optional>
│ │ │ +
15
│ │ │ +
16#include <dune/common/indices.hh>
│ │ │ +
17#include <dune/common/tuplevector.hh>
│ │ │ +
18#include <dune/common/typelist.hh>
│ │ │
19
│ │ │ -
20#include <dune/localfunctions/common/localbasis.hh>
│ │ │ -
21#include <dune/common/diagonalmatrix.hh>
│ │ │ -
22#include <dune/localfunctions/common/localkey.hh>
│ │ │ -
23#include <dune/localfunctions/common/localfiniteelementtraits.hh>
│ │ │ -
24#include <dune/geometry/type.hh>
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
28
│ │ │ -
29namespace Dune
│ │ │ -
30{
│ │ │ -
31namespace Functions {
│ │ │ +
20#include <dune/common/hybridmultiindex.hh>
│ │ │ +
21#include <dune/common/typetree/traversal.hh>
│ │ │ +
22
│ │ │ +
23#ifdef HAVE_DUNE_TYPETREE
│ │ │ +
24#include <dune/typetree/nodetags.hh>
│ │ │ +
25#endif
│ │ │ +
26
│ │ │ +
27namespace Dune {
│ │ │ +
28 namespace Functions {
│ │ │ +
29
│ │ │ +
30
│ │ │ +
31 namespace Impl {
│ │ │
32
│ │ │ -
33// A maze of dependencies between the different parts of this. We need a few forward declarations
│ │ │ -
34template<typename GV, typename R>
│ │ │ - │ │ │ -
36
│ │ │ -
37template<typename GV>
│ │ │ -
38class BSplinePreBasis;
│ │ │ +
33 // This class encapsulates the access to the setOffset()
│ │ │ +
34 // and setTreeIndex() methods of a node. This way we
│ │ │ +
35 // can hide the methods from the user but still provide
│ │ │ +
36 // access where this is needed.
│ │ │ +
37 struct BasisNodeSetupHelper
│ │ │ +
38 {
│ │ │
39
│ │ │ -
40
│ │ │ -
49template<class GV, class R>
│ │ │ -
│ │ │ - │ │ │ -
51{
│ │ │ -
52 friend class BSplineLocalFiniteElement<GV,R>;
│ │ │ -
53
│ │ │ -
54 typedef typename GV::ctype D;
│ │ │ -
55 enum {dim = GV::dimension};
│ │ │ -
56public:
│ │ │ -
57
│ │ │ -
59 typedef LocalBasisTraits<D,dim,FieldVector<D,dim>,R,1,FieldVector<R,1>,
│ │ │ -
60 FieldMatrix<R,1,dim> > Traits;
│ │ │ -
61
│ │ │ -
│ │ │ - │ │ │ - │ │ │ -
68 : preBasis_(preBasis),
│ │ │ -
69 lFE_(lFE)
│ │ │ -
70 {}
│ │ │ -
│ │ │ -
71
│ │ │ -
│ │ │ -
76 void evaluateFunction (const FieldVector<D,dim>& in,
│ │ │ -
77 std::vector<FieldVector<R,1> >& out) const
│ │ │ -
78 {
│ │ │ -
79 FieldVector<D,dim> globalIn = offset_;
│ │ │ -
80 scaling_.umv(in,globalIn);
│ │ │ -
81
│ │ │ -
82 preBasis_.evaluateFunction(globalIn, out, lFE_.currentKnotSpan_);
│ │ │ -
83 }
│ │ │ -
│ │ │ -
84
│ │ │ -
│ │ │ -
89 void evaluateJacobian (const FieldVector<D,dim>& in,
│ │ │ -
90 std::vector<FieldMatrix<D,1,dim> >& out) const
│ │ │ -
91 {
│ │ │ -
92 FieldVector<D,dim> globalIn = offset_;
│ │ │ -
93 scaling_.umv(in,globalIn);
│ │ │ -
94
│ │ │ -
95 preBasis_.evaluateJacobian(globalIn, out, lFE_.currentKnotSpan_);
│ │ │ -
96
│ │ │ -
97 for (size_t i=0; i<out.size(); i++)
│ │ │ -
98 for (int j=0; j<dim; j++)
│ │ │ -
99 out[i][0][j] *= scaling_[j][j];
│ │ │ -
100 }
│ │ │ -
│ │ │ -
101
│ │ │ -
103 template<size_t k>
│ │ │ -
│ │ │ -
104 inline void evaluate (const typename std::array<int,k>& directions,
│ │ │ -
105 const typename Traits::DomainType& in,
│ │ │ -
106 std::vector<typename Traits::RangeType>& out) const
│ │ │ -
107 {
│ │ │ -
108 switch(k)
│ │ │ -
109 {
│ │ │ -
110 case 0:
│ │ │ -
111 evaluateFunction(in, out);
│ │ │ -
112 break;
│ │ │ -
113 case 1:
│ │ │ -
114 {
│ │ │ -
115 FieldVector<D,dim> globalIn = offset_;
│ │ │ -
116 scaling_.umv(in,globalIn);
│ │ │ -
117
│ │ │ -
118 preBasis_.evaluate(directions, globalIn, out, lFE_.currentKnotSpan_);
│ │ │ -
119
│ │ │ -
120 for (size_t i=0; i<out.size(); i++)
│ │ │ -
121 out[i][0] *= scaling_[directions[0]][directions[0]];
│ │ │ -
122 break;
│ │ │ -
123 }
│ │ │ -
124 case 2:
│ │ │ -
125 {
│ │ │ -
126 FieldVector<D,dim> globalIn = offset_;
│ │ │ -
127 scaling_.umv(in,globalIn);
│ │ │ +
40 template<class Node, class size_type>
│ │ │ +
41 static void setSize(Node& node, const size_type size)
│ │ │ +
42 {
│ │ │ +
43 node.setSize(size);
│ │ │ +
44 }
│ │ │ +
45
│ │ │ +
46 template<class Node, class size_type>
│ │ │ +
47 static void setOffset(Node& node, const size_type offset)
│ │ │ +
48 {
│ │ │ +
49 node.setOffset(offset);
│ │ │ +
50 }
│ │ │ +
51
│ │ │ +
52 template<class Node, class size_type>
│ │ │ +
53 static void setTreeIndex(Node& node, const size_type index)
│ │ │ +
54 {
│ │ │ +
55 node.setTreeIndex(index);
│ │ │ +
56 }
│ │ │ +
57
│ │ │ +
58 };
│ │ │ +
59
│ │ │ +
60
│ │ │ +
61
│ │ │ +
62 // A mixin class for generalized child access from
│ │ │ +
63 // multiple indices or a tree path. The derived class
│ │ │ +
64 // only has to provide the child(i) method with
│ │ │ +
65 // a single index for accessing direct children.
│ │ │ +
66 template<class Impl>
│ │ │ +
67 class ChildAccessMixIn
│ │ │ +
68 {
│ │ │ +
69
│ │ │ +
70 Impl& asImpl()
│ │ │ +
71 {
│ │ │ +
72 return static_cast<Impl&>(*this);
│ │ │ +
73 }
│ │ │ +
74
│ │ │ +
75 const Impl& asImpl() const
│ │ │ +
76 {
│ │ │ +
77 return static_cast<const Impl&>(*this);
│ │ │ +
78 }
│ │ │ +
79
│ │ │ +
80 public:
│ │ │ +
81
│ │ │ +
87 template<class... II>
│ │ │ +
88 const auto& child(II... ii) const
│ │ │ +
89 requires (sizeof...(II) != 1)
│ │ │ +
90 {
│ │ │ +
91 return Dune::TypeTree::child(asImpl(), ii...);
│ │ │ +
92 }
│ │ │ +
93
│ │ │ +
99
│ │ │ +
100 template<class... II>
│ │ │ +
101 auto& child(II... ii)
│ │ │ +
102 requires (sizeof...(II) != 1)
│ │ │ +
103 {
│ │ │ +
104 return Dune::TypeTree::child(asImpl(), ii...);
│ │ │ +
105 }
│ │ │ +
106
│ │ │ +
112 template<class... II>
│ │ │ +
113 const auto& child(Dune::HybridMultiIndex<II...> treePath) const
│ │ │ +
114 {
│ │ │ +
115 return Dune::TypeTree::child(asImpl(), treePath);
│ │ │ +
116 }
│ │ │ +
117
│ │ │ +
123 template<class... II>
│ │ │ +
124 auto& child(Dune::HybridMultiIndex<II...> treePath)
│ │ │ +
125 {
│ │ │ +
126 return Dune::TypeTree::child(asImpl(), treePath);
│ │ │ +
127 }
│ │ │
128
│ │ │ -
129 preBasis_.evaluate(directions, globalIn, out, lFE_.currentKnotSpan_);
│ │ │ +
129 };
│ │ │
130
│ │ │ -
131 for (size_t i=0; i<out.size(); i++)
│ │ │ -
132 out[i][0] *= scaling_[directions[0]][directions[0]]*scaling_[directions[1]][directions[1]];
│ │ │ -
133 break;
│ │ │ -
134 }
│ │ │ -
135 default:
│ │ │ -
136 DUNE_THROW(NotImplemented, "B-Spline derivatives of order " << k << " not implemented yet!");
│ │ │ -
137 }
│ │ │ -
138 }
│ │ │ -
│ │ │ -
139
│ │ │ -
│ │ │ -
147 unsigned int order () const
│ │ │ -
148 {
│ │ │ -
149 return *std::max_element(preBasis_.order_.begin(), preBasis_.order_.end());
│ │ │ -
150 }
│ │ │ -
│ │ │ -
151
│ │ │ -
│ │ │ -
154 std::size_t size() const
│ │ │ -
155 {
│ │ │ -
156 return lFE_.size();
│ │ │ -
157 }
│ │ │ -
│ │ │ -
158
│ │ │ -
159private:
│ │ │ -
160 const BSplinePreBasis<GV>& preBasis_;
│ │ │ -
161
│ │ │ - │ │ │ -
163
│ │ │ -
164 // Coordinates in a single knot span differ from coordinates on the B-spline patch
│ │ │ -
165 // by an affine transformation. This transformation is stored in offset_ and scaling_.
│ │ │ -
166 FieldVector<D,dim> offset_;
│ │ │ -
167 DiagonalMatrix<D,dim> scaling_;
│ │ │ -
168};
│ │ │ -
│ │ │ -
169
│ │ │ -
183template<int dim>
│ │ │ -
│ │ │ - │ │ │ -
185{
│ │ │ -
186 // Return i as a d-digit number in the (k+1)-nary system
│ │ │ -
187 std::array<unsigned int,dim> multiindex (unsigned int i) const
│ │ │ -
188 {
│ │ │ -
189 std::array<unsigned int,dim> alpha;
│ │ │ -
190 for (int j=0; j<dim; j++)
│ │ │ -
191 {
│ │ │ -
192 alpha[j] = i % sizes_[j];
│ │ │ -
193 i = i/sizes_[j];
│ │ │ -
194 }
│ │ │ -
195 return alpha;
│ │ │ -
196 }
│ │ │ -
197
│ │ │ -
199 void setup1d(std::vector<unsigned int>& subEntity)
│ │ │ -
200 {
│ │ │ -
201 if (sizes_[0]==1)
│ │ │ -
202 {
│ │ │ -
203 subEntity[0] = 0;
│ │ │ -
204 return;
│ │ │ -
205 }
│ │ │ +
131 } // end namespace Impl
│ │ │ +
132
│ │ │ +
133
│ │ │ +
│ │ │ + │ │ │ +
135 {
│ │ │ +
136
│ │ │ +
137 friend struct Impl::BasisNodeSetupHelper;
│ │ │ +
138
│ │ │ +
139 public:
│ │ │ +
140
│ │ │ +
141 using size_type = std::size_t;
│ │ │ +
142
│ │ │ +
│ │ │ + │ │ │ +
144 offset_(0),
│ │ │ +
145 size_(0),
│ │ │ +
146 treeIndex_(0)
│ │ │ +
147 {}
│ │ │ +
│ │ │ +
148
│ │ │ +
│ │ │ + │ │ │ +
150 {
│ │ │ +
151 assert(i < size_);
│ │ │ +
152 return offset_ + i;
│ │ │ +
153 }
│ │ │ +
│ │ │ +
154
│ │ │ +
│ │ │ + │ │ │ +
163 {
│ │ │ +
164 return size_;
│ │ │ +
165 }
│ │ │ +
│ │ │ +
166
│ │ │ +
│ │ │ +
175 bool empty() const
│ │ │ +
176 {
│ │ │ +
177 return (size_ == 0);
│ │ │ +
178 }
│ │ │ +
│ │ │ +
179
│ │ │ +
│ │ │ + │ │ │ +
181 {
│ │ │ +
182 return treeIndex_;
│ │ │ +
183 }
│ │ │ +
│ │ │ +
184
│ │ │ +
185 protected:
│ │ │ +
186
│ │ │ +
│ │ │ + │ │ │ +
188 {
│ │ │ +
189 return offset_;
│ │ │ +
190 }
│ │ │ +
│ │ │ +
191
│ │ │ +
│ │ │ + │ │ │ +
193 {
│ │ │ +
194 offset_ = offset;
│ │ │ +
195 }
│ │ │ +
│ │ │ +
196
│ │ │ +
│ │ │ + │ │ │ +
198 {
│ │ │ +
199 size_ = size;
│ │ │ +
200 }
│ │ │ +
│ │ │ +
201
│ │ │ +
│ │ │ + │ │ │ +
203 {
│ │ │ +
204 treeIndex_ = treeIndex;
│ │ │ +
205 }
│ │ │ +
│ │ │
206
│ │ │ -
207 /* edge and vertex numbering
│ │ │ -
208 0----0----1
│ │ │ -
209 */
│ │ │ -
210 unsigned lastIndex=0;
│ │ │ -
211 subEntity[lastIndex++] = 0; // corner 0
│ │ │ -
212 for (unsigned i = 0; i < sizes_[0] - 2; ++i)
│ │ │ -
213 subEntity[lastIndex++] = 0; // inner dofs of element (0)
│ │ │ +
207 private:
│ │ │ +
208
│ │ │ +
209 size_type offset_;
│ │ │ +
210 size_type size_;
│ │ │ +
211 size_type treeIndex_;
│ │ │ +
212
│ │ │ +
213 };
│ │ │ +
│ │ │
214
│ │ │ -
215 subEntity[lastIndex++] = 1; // corner 1
│ │ │ -
216
│ │ │ -
217 assert(size()==lastIndex);
│ │ │ -
218 }
│ │ │ -
219
│ │ │ -
220 void setup2d(std::vector<unsigned int>& subEntity)
│ │ │ -
221 {
│ │ │ -
222 unsigned lastIndex=0;
│ │ │ -
223
│ │ │ -
224 // LocalKey: entity number , entity codim, dof indices within each entity
│ │ │ -
225 /* edge and vertex numbering
│ │ │ -
226 2----3----3
│ │ │ -
227 | |
│ │ │ -
228 | |
│ │ │ -
229 0 1
│ │ │ -
230 | |
│ │ │ -
231 | |
│ │ │ -
232 0----2----1
│ │ │ -
233 */
│ │ │ -
234
│ │ │ -
235 // lower edge (2)
│ │ │ -
236 subEntity[lastIndex++] = 0; // corner 0
│ │ │ -
237 for (unsigned i = 0; i < sizes_[0]-2; ++i)
│ │ │ -
238 subEntity[lastIndex++] = 2; // inner dofs of lower edge (2)
│ │ │ -
239
│ │ │ -
240 subEntity[lastIndex++] = 1; // corner 1
│ │ │ +
215
│ │ │ +
│ │ │ + │ │ │ +
217 public BasisNodeMixin
│ │ │ +
218 {
│ │ │ +
219 public:
│ │ │ +
220
│ │ │ +
221 // Begin of node interface
│ │ │ +
222
│ │ │ +
│ │ │ +
223 static constexpr auto degree()
│ │ │ +
224 {
│ │ │ +
225 return Dune::index_constant<0>{};
│ │ │ +
226 }
│ │ │ +
│ │ │ +
227
│ │ │ +
228 // Historic node interface
│ │ │ +
229
│ │ │ +
230 static const bool isLeaf [[deprecated]] = true;
│ │ │ +
231 static const bool isPower [[deprecated]] = false;
│ │ │ +
232 static const bool isComposite [[deprecated]] = false;
│ │ │ +
233#ifdef HAVE_DUNE_TYPETREE
│ │ │ +
234 using NodeTag [[deprecated]] = Dune::TypeTree::LeafNodeTag;
│ │ │ +
235#endif
│ │ │ +
236
│ │ │ +
237 // End of node interface
│ │ │ +
238
│ │ │ +
239 };
│ │ │ +
│ │ │ +
240
│ │ │
241
│ │ │ -
242 // iterate from bottom to top over inner edge dofs
│ │ │ -
243 for (unsigned e = 0; e < sizes_[1]-2; ++e)
│ │ │ -
244 {
│ │ │ -
245 subEntity[lastIndex++] = 0; // left edge (0)
│ │ │ -
246 for (unsigned i = 0; i < sizes_[0]-2; ++i)
│ │ │ -
247 subEntity[lastIndex++] = 0; // face dofs
│ │ │ -
248 subEntity[lastIndex++] = 1; // right edge (1)
│ │ │ -
249 }
│ │ │ -
250
│ │ │ -
251 // upper edge (3)
│ │ │ -
252 subEntity[lastIndex++] = 2; // corner 2
│ │ │ -
253 for (unsigned i = 0; i < sizes_[0]-2; ++i)
│ │ │ -
254 subEntity[lastIndex++] = 3; // inner dofs of upper edge (3)
│ │ │ -
255
│ │ │ -
256 subEntity[lastIndex++] = 3; // corner 3
│ │ │ -
257
│ │ │ -
258 assert(size()==lastIndex);
│ │ │ -
259 }
│ │ │ -
260
│ │ │ +
242
│ │ │ +
243 template<typename Node, typename Element>
│ │ │ +
│ │ │ + │ │ │ +
245 : public BasisNodeMixin
│ │ │ +
246 {
│ │ │ +
247 public:
│ │ │ +
248
│ │ │ +
│ │ │ +
249 void bind(const Element& entity)
│ │ │ +
250 {
│ │ │ +
251 Node& self = *static_cast<Node*>(this);
│ │ │ +
252 std::size_t offset = this->offset();
│ │ │ +
253 Dune::Hybrid::forEach(Dune::range(self.degree()), [&](auto i) {
│ │ │ +
254 bindTree(self.child(i), entity, offset);
│ │ │ +
255 offset += self.child(i).size();
│ │ │ +
256 });
│ │ │ +
257 this->setSize(offset - this->offset());
│ │ │ +
258 }
│ │ │ +
│ │ │ +
259
│ │ │ +
260 };
│ │ │ +
│ │ │
261
│ │ │ -
262public:
│ │ │ -
│ │ │ -
263 void init(const std::array<unsigned,dim>& sizes)
│ │ │ -
264 {
│ │ │ -
265 sizes_ = sizes;
│ │ │ -
266
│ │ │ -
267 li_.resize(size());
│ │ │ -
268
│ │ │ -
269 // Set up array of codimension-per-dof-number
│ │ │ -
270 std::vector<unsigned int> codim(li_.size());
│ │ │ -
271
│ │ │ -
272 for (std::size_t i=0; i<codim.size(); i++)
│ │ │ -
273 {
│ │ │ -
274 codim[i] = 0;
│ │ │ -
275 // Codimension gets increased by 1 for each coordinate direction
│ │ │ -
276 // where dof is on boundary
│ │ │ -
277 std::array<unsigned int,dim> mIdx = multiindex(i);
│ │ │ -
278 for (int j=0; j<dim; j++)
│ │ │ -
279 if (mIdx[j]==0 or mIdx[j]==sizes[j]-1)
│ │ │ -
280 codim[i]++;
│ │ │ -
281 }
│ │ │ -
282
│ │ │ -
283 // Set up index vector (the index of the dof in the set of dofs of a given subentity)
│ │ │ -
284 // Algorithm: the 'index' has the same ordering as the dof number 'i'.
│ │ │ -
285 // To make it consecutive we interpret 'i' in the (k+1)-adic system, omit all digits
│ │ │ -
286 // that correspond to axes where the dof is on the element boundary, and transform the
│ │ │ -
287 // rest to the (k-1)-adic system.
│ │ │ -
288 std::vector<unsigned int> index(size());
│ │ │ -
289
│ │ │ -
290 for (std::size_t i=0; i<index.size(); i++)
│ │ │ -
291 {
│ │ │ -
292 index[i] = 0;
│ │ │ +
262
│ │ │ +
263
│ │ │ +
264 template<typename T, std::size_t n>
│ │ │ +
│ │ │ + │ │ │ +
266 public InnerBasisNodeMixin<PowerBasisNode<T, n>, typename T::Element>,
│ │ │ +
267 public Impl::ChildAccessMixIn<PowerBasisNode<T, n>>
│ │ │ +
268 {
│ │ │ +
269 public:
│ │ │ +
270
│ │ │ +
271 // Begin of node interface
│ │ │ +
272
│ │ │ +
│ │ │ +
273 static constexpr auto degree()
│ │ │ +
274 {
│ │ │ +
275 return Dune::index_constant<n>{};
│ │ │ +
276 }
│ │ │ +
│ │ │ +
277
│ │ │ +
278 template<class Index>
│ │ │ +
279 requires (std::is_convertible_v<Index, std::size_t>)
│ │ │ +
│ │ │ +
280 const auto& child(Index i) const
│ │ │ +
281 {
│ │ │ +
282 return children_[i].value();
│ │ │ +
283 }
│ │ │ +
│ │ │ +
284
│ │ │ +
285 template<class Index>
│ │ │ +
286 requires (std::is_convertible_v<Index, std::size_t>)
│ │ │ +
│ │ │ +
287 auto& child(Index i)
│ │ │ +
288 {
│ │ │ +
289 return children_[i].value();
│ │ │ +
290 }
│ │ │ +
│ │ │ +
291
│ │ │ +
292 using Impl::ChildAccessMixIn<PowerBasisNode<T, n>>::child;
│ │ │
293
│ │ │ -
294 std::array<unsigned int,dim> mIdx = multiindex(i);
│ │ │ +
294 // Historic node interface
│ │ │
295
│ │ │ -
296 for (int j=dim-1; j>=0; j--)
│ │ │ -
297 if (mIdx[j]>0 and mIdx[j]<sizes[j]-1)
│ │ │ -
298 index[i] = (sizes[j]-1)*index[i] + (mIdx[j]-1);
│ │ │ -
299 }
│ │ │ -
300
│ │ │ -
301 // Set up entity and dof numbers for each (supported) dimension separately
│ │ │ -
302 std::vector<unsigned int> subEntity(li_.size());
│ │ │ -
303
│ │ │ -
304 if (subEntity.size() > 0)
│ │ │ -
305 {
│ │ │ -
306 if (dim==1) {
│ │ │ -
307
│ │ │ -
308 setup1d(subEntity);
│ │ │ -
309
│ │ │ -
310 } else if (dim==2 and sizes_[0]>1 and sizes_[1]>1) {
│ │ │ -
311
│ │ │ -
312 setup2d(subEntity);
│ │ │ -
313
│ │ │ +
296 using ChildType [[deprecated]] = T;
│ │ │ +
297
│ │ │ +
298 static const bool isLeaf [[deprecated]] = false;
│ │ │ +
299 static const bool isPower [[deprecated]] = true;
│ │ │ +
300 static const bool isComposite [[deprecated]] = false;
│ │ │ +
301#ifdef HAVE_DUNE_TYPETREE
│ │ │ +
302 using NodeTag [[deprecated]] = Dune::TypeTree::PowerNodeTag;
│ │ │ +
303#endif
│ │ │ +
304
│ │ │ +
305 // End of node interface
│ │ │ +
306
│ │ │ +
307 using Element = typename T::Element;
│ │ │ +
308
│ │ │ +
309 PowerBasisNode() = default;
│ │ │ +
310
│ │ │ +
│ │ │ +
311 const Element& element() const
│ │ │ +
312 {
│ │ │ +
313 return child(Dune::Indices::_0).element();
│ │ │
314 }
│ │ │ -
315 }
│ │ │ -
316
│ │ │ -
317 for (size_t i=0; i<li_.size(); i++)
│ │ │ -
318 li_[i] = LocalKey(subEntity[i], codim[i], index[i]);
│ │ │ -
319 }
│ │ │ -
│ │ │ -
320
│ │ │ -
│ │ │ -
322 std::size_t size () const
│ │ │ -
323 {
│ │ │ -
324 return std::accumulate(sizes_.begin(), sizes_.end(), 1, std::multiplies<unsigned int>());
│ │ │ -
325 }
│ │ │ -
│ │ │ -
326
│ │ │ -
│ │ │ -
328 const LocalKey& localKey (std::size_t i) const
│ │ │ -
329 {
│ │ │ -
330 return li_[i];
│ │ │ -
331 }
│ │ │
│ │ │ -
332
│ │ │ -
333private:
│ │ │ +
315
│ │ │ +
316 template<class Index, class TT>
│ │ │ +
│ │ │ +
317 void setChild(Index i, TT&& t)
│ │ │ +
318 {
│ │ │ +
319 children_[i].emplace(std::forward<TT>(t));
│ │ │ +
320 }
│ │ │ +
│ │ │ +
321
│ │ │ +
322 private:
│ │ │ +
323 std::array<std::optional<T>, n> children_;
│ │ │ +
324 };
│ │ │ +
│ │ │ +
325
│ │ │ +
326
│ │ │ +
327
│ │ │ +
328 template<typename T>
│ │ │ +
│ │ │ + │ │ │ +
330 public InnerBasisNodeMixin<DynamicPowerBasisNode<T>, typename T::Element>,
│ │ │ +
331 public Impl::ChildAccessMixIn<DynamicPowerBasisNode<T>>
│ │ │ +
332 {
│ │ │ +
333 public:
│ │ │
334
│ │ │ -
335 // Number of shape functions on this element per coordinate direction
│ │ │ -
336 std::array<unsigned, dim> sizes_;
│ │ │ -
337
│ │ │ -
338 std::vector<LocalKey> li_;
│ │ │ -
339};
│ │ │ -
│ │ │ -
340
│ │ │ -
345template<int dim, class LB>
│ │ │ -
│ │ │ - │ │ │ -
347{
│ │ │ -
348public:
│ │ │ -
350 template<typename F, typename C>
│ │ │ +
335 // Begin of node interface
│ │ │ +
336
│ │ │ +
│ │ │ +
337 std::size_t degree() const
│ │ │ +
338 {
│ │ │ +
339 return children_.size();
│ │ │ +
340 }
│ │ │ +
│ │ │ +
341
│ │ │ +
342 template<class Index>
│ │ │ +
343 requires (std::is_convertible_v<Index, std::size_t>)
│ │ │ +
│ │ │ +
344 const auto& child(Index i) const
│ │ │ +
345 {
│ │ │ +
346 return children_[i].value();
│ │ │ +
347 }
│ │ │ +
│ │ │ +
348
│ │ │ +
349 template<class Index>
│ │ │ +
350 requires (std::is_convertible_v<Index, std::size_t>)
│ │ │
│ │ │ -
351 void interpolate (const F& f, std::vector<C>& out) const
│ │ │ -
352 {
│ │ │ -
353 DUNE_THROW(NotImplemented, "BSplineLocalInterpolation::interpolate");
│ │ │ -
354 }
│ │ │ +
351 auto& child(Index i)
│ │ │ +
352 {
│ │ │ +
353 return children_[i].value();
│ │ │ +
354 }
│ │ │
│ │ │
355
│ │ │ -
356};
│ │ │ +
356 using Impl::ChildAccessMixIn<DynamicPowerBasisNode<T>>::child;
│ │ │ +
357
│ │ │ +
358 // Historic node interface
│ │ │ +
359
│ │ │ +
360 using ChildType [[deprecated]] = T;
│ │ │ +
361
│ │ │ +
362 static const bool isLeaf [[deprecated]] = false;
│ │ │ +
363 static const bool isPower [[deprecated]] = true;
│ │ │ +
364 static const bool isComposite [[deprecated]] = false;
│ │ │ +
365#ifdef HAVE_DUNE_TYPETREE
│ │ │ +
366 using NodeTag [[deprecated]] = Dune::TypeTree::DynamicPowerNodeTag;
│ │ │ +
367#endif
│ │ │ +
368
│ │ │ +
369 // End of node interface
│ │ │ +
370
│ │ │ +
371 using Element = typename T::Element;
│ │ │ +
372
│ │ │ +
│ │ │ +
373 DynamicPowerBasisNode (std::size_t children)
│ │ │ +
374 : children_(children)
│ │ │ +
375 {}
│ │ │ +
│ │ │ +
376
│ │ │ +
│ │ │ +
377 const Element& element() const
│ │ │ +
378 {
│ │ │ +
379 return child(Dune::Indices::_0).element();
│ │ │ +
380 }
│ │ │
│ │ │ -
357
│ │ │ -
367template<class GV, class R>
│ │ │ -
│ │ │ - │ │ │ -
369{
│ │ │ -
370 typedef typename GV::ctype D;
│ │ │ -
371 enum {dim = GV::dimension};
│ │ │ -
372 friend class BSplineLocalBasis<GV,R>;
│ │ │ -
373public:
│ │ │ -
374
│ │ │ -
377 typedef LocalFiniteElementTraits<BSplineLocalBasis<GV,R>,
│ │ │ - │ │ │ - │ │ │ -
380
│ │ │ +
381
│ │ │ +
382 template<class Index, class TT>
│ │ │
│ │ │ - │ │ │ -
384 : preBasis_(preBasis),
│ │ │ -
385 localBasis_(preBasis,*this)
│ │ │ -
386 {}
│ │ │ -
│ │ │ -
387
│ │ │ -
│ │ │ - │ │ │ -
391 : preBasis_(other.preBasis_),
│ │ │ - │ │ │ -
393 {}
│ │ │ -
│ │ │ -
394
│ │ │ -
│ │ │ -
401 void bind(const std::array<unsigned,dim>& elementIdx)
│ │ │ -
402 {
│ │ │ -
403 /* \todo In the long run we need to precompute a table for this */
│ │ │ -
404 for (size_t i=0; i<elementIdx.size(); i++)
│ │ │ -
405 {
│ │ │ -
406 currentKnotSpan_[i] = 0;
│ │ │ -
407
│ │ │ -
408 // Skip over degenerate knot spans
│ │ │ -
409 while (preBasis_.knotVectors_[i][currentKnotSpan_[i]+1] < preBasis_.knotVectors_[i][currentKnotSpan_[i]]+1e-8)
│ │ │ -
410 currentKnotSpan_[i]++;
│ │ │ -
411
│ │ │ -
412 for (size_t j=0; j<elementIdx[i]; j++)
│ │ │ -
413 {
│ │ │ -
414 currentKnotSpan_[i]++;
│ │ │ -
415
│ │ │ -
416 // Skip over degenerate knot spans
│ │ │ -
417 while (preBasis_.knotVectors_[i][currentKnotSpan_[i]+1] < preBasis_.knotVectors_[i][currentKnotSpan_[i]]+1e-8)
│ │ │ -
418 currentKnotSpan_[i]++;
│ │ │ -
419 }
│ │ │ +
383 void setChild(Index i, TT&& t)
│ │ │ +
384 {
│ │ │ +
385 children_[i].emplace(std::forward<TT>(t));
│ │ │ +
386 }
│ │ │ +
│ │ │ +
387
│ │ │ +
388 private:
│ │ │ +
389 std::vector<std::optional<T>> children_;
│ │ │ +
390 };
│ │ │ +
│ │ │ +
391
│ │ │ +
392
│ │ │ +
393 template<typename... T>
│ │ │ +
│ │ │ + │ │ │ +
395 public InnerBasisNodeMixin<CompositeBasisNode<T...>, typename TypeListEntry_t<0, TypeList<T...>>::Element>,
│ │ │ +
396 public Impl::ChildAccessMixIn<CompositeBasisNode<T...>>
│ │ │ +
397 {
│ │ │ +
398 public:
│ │ │ +
399
│ │ │ +
400 // Begin of node interface
│ │ │ +
401
│ │ │ +
│ │ │ +
402 static constexpr auto degree()
│ │ │ +
403 {
│ │ │ +
404 return Dune::index_constant<sizeof...(T)>{};
│ │ │ +
405 }
│ │ │ +
│ │ │ +
406
│ │ │ +
407 template<std::size_t i>
│ │ │ +
│ │ │ +
408 const auto& child(Dune::index_constant<i> ii) const
│ │ │ +
409 {
│ │ │ +
410 return children_[ii].value();
│ │ │ +
411 }
│ │ │ +
│ │ │ +
412
│ │ │ +
413 template<std::size_t i>
│ │ │ +
│ │ │ +
414 auto& child(Dune::index_constant<i> ii)
│ │ │ +
415 {
│ │ │ +
416 return children_[ii].value();
│ │ │ +
417 }
│ │ │ +
│ │ │ +
418
│ │ │ +
419 using Impl::ChildAccessMixIn<CompositeBasisNode<T...>>::child;
│ │ │
420
│ │ │ -
421 // Compute the geometric transformation from knotspan-local to global coordinates
│ │ │ -
422 localBasis_.offset_[i] = preBasis_.knotVectors_[i][currentKnotSpan_[i]];
│ │ │ -
423 localBasis_.scaling_[i][i] = preBasis_.knotVectors_[i][currentKnotSpan_[i]+1] - preBasis_.knotVectors_[i][currentKnotSpan_[i]];
│ │ │ -
424 }
│ │ │ -
425
│ │ │ -
426 // Set up the LocalCoefficients object
│ │ │ -
427 std::array<unsigned int, dim> sizes;
│ │ │ -
428 for (size_t i=0; i<dim; i++)
│ │ │ -
429 sizes[i] = size(i);
│ │ │ -
430 localCoefficients_.init(sizes);
│ │ │ -
431 }
│ │ │ -
│ │ │ -
432
│ │ │ -
│ │ │ - │ │ │ -
435 {
│ │ │ -
436 return localBasis_;
│ │ │ -
437 }
│ │ │ -
│ │ │ -
438
│ │ │ -
│ │ │ - │ │ │ -
441 {
│ │ │ -
442 return localCoefficients_;
│ │ │ -
443 }
│ │ │ -
│ │ │ -
444
│ │ │ -
│ │ │ - │ │ │ -
447 {
│ │ │ -
448 return localInterpolation_;
│ │ │ -
449 }
│ │ │ +
421 // Historic node interface
│ │ │ +
422
│ │ │ +
423 using ChildTypes [[deprecated]] = std::tuple<T...>;
│ │ │ +
424
│ │ │ +
425 static const bool isLeaf [[deprecated]] = false;
│ │ │ +
426 static const bool isPower [[deprecated]] = false;
│ │ │ +
427 static const bool isComposite [[deprecated]] = true;
│ │ │ +
428#ifdef HAVE_DUNE_TYPETREE
│ │ │ +
429 using NodeTag [[deprecated]] = Dune::TypeTree::CompositeNodeTag;
│ │ │ +
430#endif
│ │ │ +
431
│ │ │ +
432 template<std::size_t k>
│ │ │ +
│ │ │ +
433 struct [[deprecated]] Child {
│ │ │ +
434 static_assert((k < degree()), "child index out of range");
│ │ │ +
435
│ │ │ +
437 using Type = typename std::tuple_element_t<k, std::tuple<T...>>;
│ │ │ +
438
│ │ │ +
439 using type = Type;
│ │ │ +
440 };
│ │ │ +
│ │ │ +
441
│ │ │ +
442 // End of node interface
│ │ │ +
443
│ │ │ +
444 using Element = typename std::tuple_element_t<0, std::tuple<T...>>::Element;
│ │ │ +
445
│ │ │ + │ │ │ +
447
│ │ │ +
│ │ │ +
448 explicit CompositeBasisNode(const T&... children) :
│ │ │ +
449 children_(children...)
│ │ │ +
450 {}
│ │ │
│ │ │ -
450
│ │ │ +
451
│ │ │
│ │ │ -
452 unsigned size () const
│ │ │ -
453 {
│ │ │ -
454 std::size_t r = 1;
│ │ │ -
455 for (int i=0; i<dim; i++)
│ │ │ -
456 r *= size(i);
│ │ │ -
457 return r;
│ │ │ -
458 }
│ │ │ -
│ │ │ -
459
│ │ │ -
│ │ │ -
462 GeometryType type () const
│ │ │ -
463 {
│ │ │ -
464 return GeometryTypes::cube(dim);
│ │ │ -
465 }
│ │ │ +
452 const Element& element() const
│ │ │ +
453 {
│ │ │ +
454 return child(Dune::Indices::_0).element();
│ │ │ +
455 }
│ │ │ +
│ │ │ +
456
│ │ │ +
457 template<std::size_t i, class TT>
│ │ │ +
│ │ │ +
458 void setChild (TT&& t, Dune::index_constant<i> ii = {})
│ │ │ +
459 {
│ │ │ +
460 children_[ii].emplace(std::forward<TT>(t));
│ │ │ +
461 }
│ │ │ +
│ │ │ +
462
│ │ │ +
463 private:
│ │ │ +
464 Dune::TupleVector<std::optional<T>...> children_;
│ │ │ +
465 };
│ │ │
│ │ │
466
│ │ │ -
467//private:
│ │ │ -
468
│ │ │ -
│ │ │ -
470 unsigned int size(int i) const
│ │ │ -
471 {
│ │ │ -
472 const auto& order = preBasis_.order_;
│ │ │ -
473 unsigned int r = order[i]+1; // The 'normal' value
│ │ │ -
474 if (currentKnotSpan_[i]<order[i]) // Less near the left end of the knot vector
│ │ │ -
475 r -= (order[i] - currentKnotSpan_[i]);
│ │ │ -
476 if ( order[i] > (preBasis_.knotVectors_[i].size() - currentKnotSpan_[i] - 2) )
│ │ │ -
477 r -= order[i] - (preBasis_.knotVectors_[i].size() - currentKnotSpan_[i] - 2);
│ │ │ -
478 return r;
│ │ │ -
479 }
│ │ │ -
│ │ │ -
480
│ │ │ - │ │ │ -
482
│ │ │ - │ │ │ - │ │ │ - │ │ │ +
467
│ │ │ +
468 template<typename Tree, typename Entity>
│ │ │ +
│ │ │ +
469 void bindTree(Tree& tree, const Entity& entity, std::size_t offset = 0)
│ │ │ +
470 {
│ │ │ +
471 Impl::BasisNodeSetupHelper::setOffset(tree, offset);
│ │ │ +
472 tree.bind(entity);
│ │ │ +
473 }
│ │ │ +
│ │ │ +
474
│ │ │ +
475 template<typename Tree>
│ │ │ +
│ │ │ +
476 void initializeTree(Tree& tree, std::size_t treeIndexOffset = 0)
│ │ │ +
477 {
│ │ │ +
478 Dune::TypeTree::forEachNode(tree, [&](auto& node, const auto& treePath) {
│ │ │ +
479 Impl::BasisNodeSetupHelper::setTreeIndex(node, treeIndexOffset);
│ │ │ +
480 ++treeIndexOffset;
│ │ │ +
481 });
│ │ │ +
482 }
│ │ │ +
│ │ │ +
483
│ │ │ +
484
│ │ │ +
485 } // namespace Functions
│ │ │
486
│ │ │ -
487 // The knot span we are bound to
│ │ │ -
488 std::array<unsigned,dim> currentKnotSpan_;
│ │ │ -
489};
│ │ │ -
│ │ │ -
490
│ │ │ -
491
│ │ │ -
492template<typename GV>
│ │ │ -
493class BSplineNode;
│ │ │ -
494
│ │ │ -
504template<typename GV>
│ │ │ -
│ │ │ - │ │ │ -
506 public LeafPreBasisMixin< BSplinePreBasis<GV> >
│ │ │ -
507{
│ │ │ - │ │ │ -
509
│ │ │ -
510 static const int dim = GV::dimension;
│ │ │ -
511
│ │ │ -
513 class MultiDigitCounter
│ │ │ -
514 {
│ │ │ -
515 public:
│ │ │ -
516
│ │ │ -
520 MultiDigitCounter(const std::array<unsigned int,dim>& limits)
│ │ │ -
521 : limits_(limits)
│ │ │ -
522 {
│ │ │ -
523 std::fill(counter_.begin(), counter_.end(), 0);
│ │ │ -
524 }
│ │ │ -
525
│ │ │ -
527 MultiDigitCounter& operator++()
│ │ │ -
528 {
│ │ │ -
529 for (int i=0; i<dim; i++)
│ │ │ -
530 {
│ │ │ -
531 ++counter_[i];
│ │ │ -
532
│ │ │ -
533 // no overflow?
│ │ │ -
534 if (counter_[i] < limits_[i])
│ │ │ -
535 break;
│ │ │ -
536
│ │ │ -
537 counter_[i] = 0;
│ │ │ -
538 }
│ │ │ -
539 return *this;
│ │ │ -
540 }
│ │ │ -
541
│ │ │ -
543 const unsigned int& operator[](int i) const
│ │ │ -
544 {
│ │ │ -
545 return counter_[i];
│ │ │ -
546 }
│ │ │ -
547
│ │ │ -
549 unsigned int cycle() const
│ │ │ -
550 {
│ │ │ -
551 unsigned int r = 1;
│ │ │ -
552 for (int i=0; i<dim; i++)
│ │ │ -
553 r *= limits_[i];
│ │ │ -
554 return r;
│ │ │ -
555 }
│ │ │ -
556
│ │ │ -
557 private:
│ │ │ -
558
│ │ │ -
560 const std::array<unsigned int,dim> limits_;
│ │ │ -
561
│ │ │ -
563 std::array<unsigned int,dim> counter_;
│ │ │ -
564
│ │ │ -
565 };
│ │ │ -
566
│ │ │ -
567public:
│ │ │ -
568
│ │ │ -
570 using GridView = GV;
│ │ │ -
571 using size_type = std::size_t;
│ │ │ -
572
│ │ │ - │ │ │ -
574
│ │ │ -
575 // Type used for function values
│ │ │ -
576 using R = double;
│ │ │ -
577
│ │ │ -
│ │ │ - │ │ │ -
598 const std::vector<double>& knotVector,
│ │ │ -
599 unsigned int order,
│ │ │ -
600 bool makeOpen = true)
│ │ │ - │ │ │ -
602 {
│ │ │ -
603 // \todo Detection of duplicate knots
│ │ │ -
604 std::fill(elements_.begin(), elements_.end(), knotVector.size()-1);
│ │ │ -
605
│ │ │ -
606 // Mediocre sanity check: we don't know the number of grid elements in each direction.
│ │ │ -
607 // but at least we know the total number of elements.
│ │ │ -
608 assert( std::accumulate(elements_.begin(), elements_.end(), 1, std::multiplies<unsigned>()) == gridView_.size(0) );
│ │ │ -
609
│ │ │ -
610 for (int i=0; i<dim; i++)
│ │ │ -
611 {
│ │ │ -
612 // Prepend the correct number of additional knots to open the knot vector
│ │ │ -
614 if (makeOpen)
│ │ │ -
615 for (unsigned int j=0; j<order; j++)
│ │ │ -
616 knotVectors_[i].push_back(knotVector[0]);
│ │ │ -
617
│ │ │ -
618 knotVectors_[i].insert(knotVectors_[i].end(), knotVector.begin(), knotVector.end());
│ │ │ -
619
│ │ │ -
620 if (makeOpen)
│ │ │ -
621 for (unsigned int j=0; j<order; j++)
│ │ │ -
622 knotVectors_[i].push_back(knotVector.back());
│ │ │ -
623 }
│ │ │ -
624
│ │ │ -
625 std::fill(order_.begin(), order_.end(), order);
│ │ │ -
626 }
│ │ │ -
│ │ │ -
627
│ │ │ -
│ │ │ - │ │ │ -
650 const FieldVector<double,dim>& lowerLeft,
│ │ │ -
651 const FieldVector<double,dim>& upperRight,
│ │ │ -
652 const std::array<unsigned int,dim>& elements,
│ │ │ -
653 unsigned int order,
│ │ │ -
654 bool makeOpen = true)
│ │ │ -
655 : elements_(elements),
│ │ │ - │ │ │ -
657 {
│ │ │ -
658 // Mediocre sanity check: we don't know the number of grid elements in each direction.
│ │ │ -
659 // but at least we know the total number of elements.
│ │ │ -
660 assert( std::accumulate(elements_.begin(), elements_.end(), 1, std::multiplies<unsigned>()) == gridView_.size(0) );
│ │ │ -
661
│ │ │ -
662 for (int i=0; i<dim; i++)
│ │ │ -
663 {
│ │ │ -
664 // Prepend the correct number of additional knots to open the knot vector
│ │ │ -
666 if (makeOpen)
│ │ │ -
667 for (unsigned int j=0; j<order; j++)
│ │ │ -
668 knotVectors_[i].push_back(lowerLeft[i]);
│ │ │ -
669
│ │ │ -
670 // Construct the actual knot vector
│ │ │ -
671 for (size_t j=0; j<elements[i]+1; j++)
│ │ │ -
672 knotVectors_[i].push_back(lowerLeft[i] + j*(upperRight[i]-lowerLeft[i]) / elements[i]);
│ │ │ -
673
│ │ │ -
674 if (makeOpen)
│ │ │ -
675 for (unsigned int j=0; j<order; j++)
│ │ │ -
676 knotVectors_[i].push_back(upperRight[i]);
│ │ │ -
677 }
│ │ │ -
678
│ │ │ -
679 std::fill(order_.begin(), order_.end(), order);
│ │ │ -
680 }
│ │ │ -
│ │ │ -
681
│ │ │ -
│ │ │ - │ │ │ -
684 {}
│ │ │ -
│ │ │ -
685
│ │ │ -
│ │ │ -
687 const GridView& gridView() const
│ │ │ -
688 {
│ │ │ -
689 return gridView_;
│ │ │ -
690 }
│ │ │ -
│ │ │ -
691
│ │ │ -
│ │ │ -
693 void update(const GridView& gv)
│ │ │ -
694 {
│ │ │ -
695 gridView_ = gv;
│ │ │ -
696 }
│ │ │ -
│ │ │ -
697
│ │ │ -
│ │ │ - │ │ │ -
702 {
│ │ │ -
703 return Node{this};
│ │ │ -
704 }
│ │ │ -
│ │ │ -
705
│ │ │ -
│ │ │ - │ │ │ -
708 {
│ │ │ -
709 size_type result = 1;
│ │ │ -
710 for (int i=0; i<dim; i++)
│ │ │ -
711 result *= order_[i]+1;
│ │ │ -
712 return result;
│ │ │ -
713 }
│ │ │ -
│ │ │ -
714
│ │ │ -
716 template<typename It>
│ │ │ -
│ │ │ -
717 It indices(const Node& node, It it) const
│ │ │ -
718 {
│ │ │ -
719 // Local degrees of freedom are arranged in a lattice.
│ │ │ -
720 // We need the lattice dimensions to be able to compute lattice coordinates from a local index
│ │ │ -
721 std::array<unsigned int, dim> localSizes;
│ │ │ -
722 for (int i=0; i<dim; i++)
│ │ │ -
723 localSizes[i] = node.finiteElement().size(i);
│ │ │ -
724 for (size_type i = 0, end = node.size() ; i < end ; ++i, ++it)
│ │ │ -
725 {
│ │ │ -
726 std::array<unsigned int,dim> localIJK = getIJK(i, localSizes);
│ │ │ -
727
│ │ │ -
728 const auto currentKnotSpan = node.finiteElement().currentKnotSpan_;
│ │ │ -
729 const auto order = order_;
│ │ │ -
730
│ │ │ -
731 std::array<unsigned int,dim> globalIJK;
│ │ │ -
732 for (int i=0; i<dim; i++)
│ │ │ -
733 globalIJK[i] = std::max((int)currentKnotSpan[i] - (int)order[i], 0) + localIJK[i]; // needs to be a signed type!
│ │ │ -
734
│ │ │ -
735 // Make one global flat index from the globalIJK tuple
│ │ │ -
736 size_type globalIdx = globalIJK[dim-1];
│ │ │ -
737
│ │ │ -
738 for (int i=dim-2; i>=0; i--)
│ │ │ -
739 globalIdx = globalIdx * size(i) + globalIJK[i];
│ │ │ -
740
│ │ │ -
741 *it = {{globalIdx}};
│ │ │ -
742 }
│ │ │ -
743 return it;
│ │ │ -
744 }
│ │ │ -
│ │ │ -
745
│ │ │ -
│ │ │ -
747 unsigned int dimension () const
│ │ │ -
748 {
│ │ │ -
749 unsigned int result = 1;
│ │ │ -
750 for (size_t i=0; i<dim; i++)
│ │ │ -
751 result *= size(i);
│ │ │ -
752 return result;
│ │ │ -
753 }
│ │ │ -
│ │ │ -
754
│ │ │ -
│ │ │ -
756 unsigned int size (size_t d) const
│ │ │ -
757 {
│ │ │ -
758 return knotVectors_[d].size() - order_[d] - 1;
│ │ │ -
759 }
│ │ │ -
│ │ │ -
760
│ │ │ -
761 using Base::size;
│ │ │ -
762
│ │ │ -
│ │ │ -
765 void evaluateFunction (const FieldVector<typename GV::ctype,dim>& in,
│ │ │ -
766 std::vector<FieldVector<R,1> >& out,
│ │ │ -
767 const std::array<unsigned,dim>& currentKnotSpan) const
│ │ │ -
768 {
│ │ │ -
769 // Evaluate
│ │ │ -
770 std::array<std::vector<R>, dim> oneDValues;
│ │ │ -
771
│ │ │ -
772 for (size_t i=0; i<dim; i++)
│ │ │ -
773 evaluateFunction(in[i], oneDValues[i], knotVectors_[i], order_[i], currentKnotSpan[i]);
│ │ │ -
774
│ │ │ -
775 std::array<unsigned int, dim> limits;
│ │ │ -
776 for (int i=0; i<dim; i++)
│ │ │ -
777 limits[i] = oneDValues[i].size();
│ │ │ -
778
│ │ │ -
779 MultiDigitCounter ijkCounter(limits);
│ │ │ -
780
│ │ │ -
781 out.resize(ijkCounter.cycle());
│ │ │ -
782
│ │ │ -
783 for (size_t i=0; i<out.size(); i++, ++ijkCounter)
│ │ │ -
784 {
│ │ │ -
785 out[i] = R(1.0);
│ │ │ -
786 for (size_t j=0; j<dim; j++)
│ │ │ -
787 out[i] *= oneDValues[j][ijkCounter[j]];
│ │ │ -
788 }
│ │ │ -
789 }
│ │ │ -
│ │ │ -
790
│ │ │ -
│ │ │ -
796 void evaluateJacobian (const FieldVector<typename GV::ctype,dim>& in,
│ │ │ -
797 std::vector<FieldMatrix<R,1,dim> >& out,
│ │ │ -
798 const std::array<unsigned,dim>& currentKnotSpan) const
│ │ │ -
799 {
│ │ │ -
800 // How many shape functions to we have in each coordinate direction?
│ │ │ -
801 std::array<unsigned int, dim> limits;
│ │ │ -
802 for (int i=0; i<dim; i++)
│ │ │ -
803 {
│ │ │ -
804 limits[i] = order_[i]+1; // The 'standard' value away from the boundaries of the knot vector
│ │ │ -
805 if (currentKnotSpan[i]<order_[i])
│ │ │ -
806 limits[i] -= (order_[i] - currentKnotSpan[i]);
│ │ │ -
807 if ( order_[i] > (knotVectors_[i].size() - currentKnotSpan[i] - 2) )
│ │ │ -
808 limits[i] -= order_[i] - (knotVectors_[i].size() - currentKnotSpan[i] - 2);
│ │ │ -
809 }
│ │ │ -
810
│ │ │ -
811 // The lowest knot spans that we need values from
│ │ │ -
812 std::array<unsigned int, dim> offset;
│ │ │ -
813 for (int i=0; i<dim; i++)
│ │ │ -
814 offset[i] = std::max((int)(currentKnotSpan[i] - order_[i]),0);
│ │ │ -
815
│ │ │ -
816 // Evaluate 1d function values (needed for the product rule)
│ │ │ -
817 std::array<std::vector<R>, dim> oneDValues;
│ │ │ -
818
│ │ │ -
819 // Evaluate 1d function values of one order lower (needed for the derivative formula)
│ │ │ -
820 std::array<std::vector<R>, dim> lowOrderOneDValues;
│ │ │ -
821
│ │ │ -
822 std::array<DynamicMatrix<R>, dim> values;
│ │ │ -
823
│ │ │ -
824 for (size_t i=0; i<dim; i++)
│ │ │ -
825 {
│ │ │ -
826 evaluateFunctionFull(in[i], values[i], knotVectors_[i], order_[i], currentKnotSpan[i]);
│ │ │ -
827 oneDValues[i].resize(knotVectors_[i].size()-order_[i]-1);
│ │ │ -
828 for (size_t j=0; j<oneDValues[i].size(); j++)
│ │ │ -
829 oneDValues[i][j] = values[i][order_[i]][j];
│ │ │ -
830
│ │ │ -
831 if (order_[i]!=0)
│ │ │ -
832 {
│ │ │ -
833 lowOrderOneDValues[i].resize(knotVectors_[i].size()-(order_[i]-1)-1);
│ │ │ -
834 for (size_t j=0; j<lowOrderOneDValues[i].size(); j++)
│ │ │ -
835 lowOrderOneDValues[i][j] = values[i][order_[i]-1][j];
│ │ │ -
836 }
│ │ │ -
837 }
│ │ │ -
838
│ │ │ -
839
│ │ │ -
840 // Evaluate 1d function derivatives
│ │ │ -
841 std::array<std::vector<R>, dim> oneDDerivatives;
│ │ │ -
842 for (size_t i=0; i<dim; i++)
│ │ │ -
843 {
│ │ │ -
844 oneDDerivatives[i].resize(limits[i]);
│ │ │ -
845
│ │ │ -
846 if (order_[i]==0) // order-zero functions are piecewise constant, hence all derivatives are zero
│ │ │ -
847 std::fill(oneDDerivatives[i].begin(), oneDDerivatives[i].end(), R(0.0));
│ │ │ -
848 else
│ │ │ -
849 {
│ │ │ -
850 for (size_t j=offset[i]; j<offset[i]+limits[i]; j++)
│ │ │ -
851 {
│ │ │ -
852 R derivativeAddend1 = lowOrderOneDValues[i][j] / (knotVectors_[i][j+order_[i]]-knotVectors_[i][j]);
│ │ │ -
853 R derivativeAddend2 = lowOrderOneDValues[i][j+1] / (knotVectors_[i][j+order_[i]+1]-knotVectors_[i][j+1]);
│ │ │ -
854 // The two previous terms may evaluate as 0/0. This is to be interpreted as 0.
│ │ │ -
855 if (std::isnan(derivativeAddend1))
│ │ │ -
856 derivativeAddend1 = 0;
│ │ │ -
857 if (std::isnan(derivativeAddend2))
│ │ │ -
858 derivativeAddend2 = 0;
│ │ │ -
859 oneDDerivatives[i][j-offset[i]] = order_[i] * ( derivativeAddend1 - derivativeAddend2 );
│ │ │ -
860 }
│ │ │ -
861 }
│ │ │ -
862 }
│ │ │ -
863
│ │ │ -
864 // Working towards computing only the parts that we really need:
│ │ │ -
865 // Let's copy them out into a separate array
│ │ │ -
866 std::array<std::vector<R>, dim> oneDValuesShort;
│ │ │ -
867
│ │ │ -
868 for (int i=0; i<dim; i++)
│ │ │ -
869 {
│ │ │ -
870 oneDValuesShort[i].resize(limits[i]);
│ │ │ -
871
│ │ │ -
872 for (size_t j=0; j<limits[i]; j++)
│ │ │ -
873 oneDValuesShort[i][j] = oneDValues[i][offset[i] + j];
│ │ │ -
874 }
│ │ │ -
875
│ │ │ -
876
│ │ │ -
877
│ │ │ -
878 // Set up a multi-index to go from consecutive indices to integer coordinates
│ │ │ -
879 MultiDigitCounter ijkCounter(limits);
│ │ │ -
880
│ │ │ -
881 out.resize(ijkCounter.cycle());
│ │ │ -
882
│ │ │ -
883 // Complete Jacobian is given by the product rule
│ │ │ -
884 for (size_t i=0; i<out.size(); i++, ++ijkCounter)
│ │ │ -
885 for (int j=0; j<dim; j++)
│ │ │ -
886 {
│ │ │ -
887 out[i][0][j] = 1.0;
│ │ │ -
888 for (int k=0; k<dim; k++)
│ │ │ -
889 out[i][0][j] *= (j==k) ? oneDDerivatives[k][ijkCounter[k]]
│ │ │ -
890 : oneDValuesShort[k][ijkCounter[k]];
│ │ │ -
891 }
│ │ │ -
892
│ │ │ -
893 }
│ │ │ -
│ │ │ -
894
│ │ │ -
896 template <size_type k>
│ │ │ -
│ │ │ -
897 void evaluate(const typename std::array<int,k>& directions,
│ │ │ -
898 const FieldVector<typename GV::ctype,dim>& in,
│ │ │ -
899 std::vector<FieldVector<R,1> >& out,
│ │ │ -
900 const std::array<unsigned,dim>& currentKnotSpan) const
│ │ │ -
901 {
│ │ │ -
902 if (k != 1 && k != 2)
│ │ │ -
903 DUNE_THROW(RangeError, "Differentiation order greater than 2 is not supported!");
│ │ │ -
904
│ │ │ -
905 // Evaluate 1d function values (needed for the product rule)
│ │ │ -
906 std::array<std::vector<R>, dim> oneDValues;
│ │ │ -
907 std::array<std::vector<R>, dim> oneDDerivatives;
│ │ │ -
908 std::array<std::vector<R>, dim> oneDSecondDerivatives;
│ │ │ -
909
│ │ │ -
910 // Evaluate 1d function derivatives
│ │ │ -
911 if (k==1)
│ │ │ -
912 for (size_t i=0; i<dim; i++)
│ │ │ -
913 evaluateAll(in[i], oneDValues[i], true, oneDDerivatives[i], false, oneDSecondDerivatives[i], knotVectors_[i], order_[i], currentKnotSpan[i]);
│ │ │ -
914 else
│ │ │ -
915 for (size_t i=0; i<dim; i++)
│ │ │ -
916 evaluateAll(in[i], oneDValues[i], true, oneDDerivatives[i], true, oneDSecondDerivatives[i], knotVectors_[i], order_[i], currentKnotSpan[i]);
│ │ │ -
917
│ │ │ -
918 // The lowest knot spans that we need values from
│ │ │ -
919 std::array<unsigned int, dim> offset;
│ │ │ -
920 for (int i=0; i<dim; i++)
│ │ │ -
921 offset[i] = std::max((int)(currentKnotSpan[i] - order_[i]),0);
│ │ │ -
922
│ │ │ -
923 // Set up a multi-index to go from consecutive indices to integer coordinates
│ │ │ -
924 std::array<unsigned int, dim> limits;
│ │ │ -
925 for (int i=0; i<dim; i++)
│ │ │ -
926 {
│ │ │ -
927 // In a proper implementation, the following line would do
│ │ │ -
928 //limits[i] = oneDValues[i].size();
│ │ │ -
929 limits[i] = order_[i]+1; // The 'standard' value away from the boundaries of the knot vector
│ │ │ -
930 if (currentKnotSpan[i]<order_[i])
│ │ │ -
931 limits[i] -= (order_[i] - currentKnotSpan[i]);
│ │ │ -
932 if ( order_[i] > (knotVectors_[i].size() - currentKnotSpan[i] - 2) )
│ │ │ -
933 limits[i] -= order_[i] - (knotVectors_[i].size() - currentKnotSpan[i] - 2);
│ │ │ -
934 }
│ │ │ -
935
│ │ │ -
936 // Working towards computing only the parts that we really need:
│ │ │ -
937 // Let's copy them out into a separate array
│ │ │ -
938 std::array<std::vector<R>, dim> oneDValuesShort;
│ │ │ -
939
│ │ │ -
940 for (int i=0; i<dim; i++)
│ │ │ -
941 {
│ │ │ -
942 oneDValuesShort[i].resize(limits[i]);
│ │ │ -
943
│ │ │ -
944 for (size_t j=0; j<limits[i]; j++)
│ │ │ -
945 oneDValuesShort[i][j] = oneDValues[i][offset[i] + j];
│ │ │ -
946 }
│ │ │ -
947
│ │ │ -
948
│ │ │ -
949 MultiDigitCounter ijkCounter(limits);
│ │ │ -
950
│ │ │ -
951 out.resize(ijkCounter.cycle());
│ │ │ -
952
│ │ │ -
953 if (k == 1)
│ │ │ -
954 {
│ │ │ -
955 // Complete Jacobian is given by the product rule
│ │ │ -
956 for (size_t i=0; i<out.size(); i++, ++ijkCounter)
│ │ │ -
957 {
│ │ │ -
958 out[i][0] = 1.0;
│ │ │ -
959 for (int l=0; l<dim; l++)
│ │ │ -
960 out[i][0] *= (directions[0]==l) ? oneDDerivatives[l][ijkCounter[l]]
│ │ │ -
961 : oneDValuesShort[l][ijkCounter[l]];
│ │ │ -
962 }
│ │ │ -
963 }
│ │ │ -
964
│ │ │ -
965 if (k == 2)
│ │ │ -
966 {
│ │ │ -
967 // Complete derivation by deriving the tensor product
│ │ │ -
968 for (size_t i=0; i<out.size(); i++, ++ijkCounter)
│ │ │ -
969 {
│ │ │ -
970 out[i][0] = 1.0;
│ │ │ -
971 for (int j=0; j<dim; j++)
│ │ │ -
972 {
│ │ │ -
973 if (directions[0] != directions[1]) //derivation in two different variables
│ │ │ -
974 if (directions[0] == j || directions[1] == j) //the spline has to be derived (once) in this direction
│ │ │ -
975 out[i][0] *= oneDDerivatives[j][ijkCounter[j]];
│ │ │ -
976 else //no derivation in this direction
│ │ │ -
977 out[i][0] *= oneDValuesShort[j][ijkCounter[j]];
│ │ │ -
978 else //spline is derived two times in the same direction
│ │ │ -
979 if (directions[0] == j) //the spline is derived two times in this direction
│ │ │ -
980 out[i][0] *= oneDSecondDerivatives[j][ijkCounter[j]];
│ │ │ -
981 else //no derivation in this direction
│ │ │ -
982 out[i][0] *= oneDValuesShort[j][ijkCounter[j]];
│ │ │ -
983 }
│ │ │ -
984 }
│ │ │ -
985 }
│ │ │ -
986 }
│ │ │ -
│ │ │ -
987
│ │ │ -
988
│ │ │ -
│ │ │ -
993 static std::array<unsigned int,dim> getIJK(typename GridView::IndexSet::IndexType idx, std::array<unsigned int,dim> elements)
│ │ │ -
994 {
│ │ │ -
995 std::array<unsigned,dim> result;
│ │ │ -
996 for (int i=0; i<dim; i++)
│ │ │ -
997 {
│ │ │ -
998 result[i] = idx%elements[i];
│ │ │ -
999 idx /= elements[i];
│ │ │ -
1000 }
│ │ │ -
1001 return result;
│ │ │ -
1002 }
│ │ │ -
│ │ │ -
1003
│ │ │ -
│ │ │ -
1012 static void evaluateFunction (const typename GV::ctype& in, std::vector<R>& out,
│ │ │ -
1013 const std::vector<R>& knotVector,
│ │ │ -
1014 unsigned int order,
│ │ │ -
1015 unsigned int currentKnotSpan)
│ │ │ -
1016 {
│ │ │ -
1017 std::size_t outSize = order+1; // The 'standard' value away from the boundaries of the knot vector
│ │ │ -
1018 if (currentKnotSpan<order) // Less near the left end of the knot vector
│ │ │ -
1019 outSize -= (order - currentKnotSpan);
│ │ │ -
1020 if ( order > (knotVector.size() - currentKnotSpan - 2) )
│ │ │ -
1021 outSize -= order - (knotVector.size() - currentKnotSpan - 2);
│ │ │ -
1022 out.resize(outSize);
│ │ │ -
1023
│ │ │ -
1024 // It's not really a matrix that is needed here, a plain 2d array would do
│ │ │ -
1025 DynamicMatrix<R> N(order+1, knotVector.size()-1);
│ │ │ -
1026
│ │ │ -
1027 // The text books on splines use the following geometric condition here to fill the array N
│ │ │ -
1028 // (see for example Cottrell, Hughes, Bazilevs, Formula (2.1). However, this condition
│ │ │ -
1029 // only works if splines are never evaluated exactly on the knots.
│ │ │ -
1030 //
│ │ │ -
1031 // for (size_t i=0; i<knotVector.size()-1; i++)
│ │ │ -
1032 // N[0][i] = (knotVector[i] <= in) and (in < knotVector[i+1]);
│ │ │ -
1033 for (size_t i=0; i<knotVector.size()-1; i++)
│ │ │ -
1034 N[0][i] = (i == currentKnotSpan);
│ │ │ -
1035
│ │ │ -
1036 for (size_t r=1; r<=order; r++)
│ │ │ -
1037 for (size_t i=0; i<knotVector.size()-r-1; i++)
│ │ │ -
1038 {
│ │ │ -
1039 R factor1 = ((knotVector[i+r] - knotVector[i]) > 1e-10)
│ │ │ -
1040 ? (in - knotVector[i]) / (knotVector[i+r] - knotVector[i])
│ │ │ -
1041 : 0;
│ │ │ -
1042 R factor2 = ((knotVector[i+r+1] - knotVector[i+1]) > 1e-10)
│ │ │ -
1043 ? (knotVector[i+r+1] - in) / (knotVector[i+r+1] - knotVector[i+1])
│ │ │ -
1044 : 0;
│ │ │ -
1045 N[r][i] = factor1 * N[r-1][i] + factor2 * N[r-1][i+1];
│ │ │ -
1046 }
│ │ │ -
1047
│ │ │ -
1052 for (size_t i=0; i<out.size(); i++) {
│ │ │ -
1053 out[i] = N[order][std::max((int)(currentKnotSpan - order),0) + i];
│ │ │ -
1054 }
│ │ │ -
1055 }
│ │ │ -
│ │ │ -
1056
│ │ │ -
│ │ │ -
1069 static void evaluateFunctionFull(const typename GV::ctype& in,
│ │ │ -
1070 DynamicMatrix<R>& out,
│ │ │ -
1071 const std::vector<R>& knotVector,
│ │ │ -
1072 unsigned int order,
│ │ │ -
1073 unsigned int currentKnotSpan)
│ │ │ -
1074 {
│ │ │ -
1075 // It's not really a matrix that is needed here, a plain 2d array would do
│ │ │ -
1076 DynamicMatrix<R>& N = out;
│ │ │ -
1077
│ │ │ -
1078 N.resize(order+1, knotVector.size()-1);
│ │ │ -
1079
│ │ │ -
1080 // The text books on splines use the following geometric condition here to fill the array N
│ │ │ -
1081 // (see for example Cottrell, Hughes, Bazilevs, Formula (2.1). However, this condition
│ │ │ -
1082 // only works if splines are never evaluated exactly on the knots.
│ │ │ -
1083 //
│ │ │ -
1084 // for (size_t i=0; i<knotVector.size()-1; i++)
│ │ │ -
1085 // N[0][i] = (knotVector[i] <= in) and (in < knotVector[i+1]);
│ │ │ -
1086 for (size_t i=0; i<knotVector.size()-1; i++)
│ │ │ -
1087 N[0][i] = (i == currentKnotSpan);
│ │ │ -
1088
│ │ │ -
1089 for (size_t r=1; r<=order; r++)
│ │ │ -
1090 for (size_t i=0; i<knotVector.size()-r-1; i++)
│ │ │ -
1091 {
│ │ │ -
1092 R factor1 = ((knotVector[i+r] - knotVector[i]) > 1e-10)
│ │ │ -
1093 ? (in - knotVector[i]) / (knotVector[i+r] - knotVector[i])
│ │ │ -
1094 : 0;
│ │ │ -
1095 R factor2 = ((knotVector[i+r+1] - knotVector[i+1]) > 1e-10)
│ │ │ -
1096 ? (knotVector[i+r+1] - in) / (knotVector[i+r+1] - knotVector[i+1])
│ │ │ -
1097 : 0;
│ │ │ -
1098 N[r][i] = factor1 * N[r-1][i] + factor2 * N[r-1][i+1];
│ │ │ -
1099 }
│ │ │ -
1100 }
│ │ │ -
│ │ │ -
1101
│ │ │ -
1102
│ │ │ -
1110
│ │ │ -
│ │ │ -
1111 static void evaluateAll(const typename GV::ctype& in,
│ │ │ -
1112 std::vector<R>& out,
│ │ │ -
1113 bool evaluateJacobian, std::vector<R>& outJac,
│ │ │ -
1114 bool evaluateHessian, std::vector<R>& outHess,
│ │ │ -
1115 const std::vector<R>& knotVector,
│ │ │ -
1116 unsigned int order,
│ │ │ -
1117 unsigned int currentKnotSpan)
│ │ │ -
1118 {
│ │ │ -
1119 // How many shape functions to we have in each coordinate direction?
│ │ │ -
1120 unsigned int limit;
│ │ │ -
1121 limit = order+1; // The 'standard' value away from the boundaries of the knot vector
│ │ │ -
1122 if (currentKnotSpan<order)
│ │ │ -
1123 limit -= (order - currentKnotSpan);
│ │ │ -
1124 if ( order > (knotVector.size() - currentKnotSpan - 2) )
│ │ │ -
1125 limit -= order - (knotVector.size() - currentKnotSpan - 2);
│ │ │ -
1126
│ │ │ -
1127 // The lowest knot spans that we need values from
│ │ │ -
1128 unsigned int offset;
│ │ │ -
1129 offset = std::max((int)(currentKnotSpan - order),0);
│ │ │ -
1130
│ │ │ -
1131 // Evaluate 1d function values (needed for the product rule)
│ │ │ -
1132 DynamicMatrix<R> values;
│ │ │ -
1133
│ │ │ -
1134 evaluateFunctionFull(in, values, knotVector, order, currentKnotSpan);
│ │ │ -
1135
│ │ │ -
1136 out.resize(knotVector.size()-order-1);
│ │ │ -
1137 for (size_t j=0; j<out.size(); j++)
│ │ │ -
1138 out[j] = values[order][j];
│ │ │ -
1139
│ │ │ -
1140 // Evaluate 1d function values of one order lower (needed for the derivative formula)
│ │ │ -
1141 std::vector<R> lowOrderOneDValues;
│ │ │ -
1142
│ │ │ -
1143 if (order!=0)
│ │ │ -
1144 {
│ │ │ -
1145 lowOrderOneDValues.resize(knotVector.size()-(order-1)-1);
│ │ │ -
1146 for (size_t j=0; j<lowOrderOneDValues.size(); j++)
│ │ │ -
1147 lowOrderOneDValues[j] = values[order-1][j];
│ │ │ -
1148 }
│ │ │ -
1149
│ │ │ -
1150 // Evaluate 1d function values of two order lower (needed for the (second) derivative formula)
│ │ │ -
1151 std::vector<R> lowOrderTwoDValues;
│ │ │ -
1152
│ │ │ -
1153 if (order>1 && evaluateHessian)
│ │ │ -
1154 {
│ │ │ -
1155 lowOrderTwoDValues.resize(knotVector.size()-(order-2)-1);
│ │ │ -
1156 for (size_t j=0; j<lowOrderTwoDValues.size(); j++)
│ │ │ -
1157 lowOrderTwoDValues[j] = values[order-2][j];
│ │ │ -
1158 }
│ │ │ -
1159
│ │ │ -
1160 // Evaluate 1d function derivatives
│ │ │ -
1161 if (evaluateJacobian)
│ │ │ -
1162 {
│ │ │ -
1163 outJac.resize(limit);
│ │ │ -
1164
│ │ │ -
1165 if (order==0) // order-zero functions are piecewise constant, hence all derivatives are zero
│ │ │ -
1166 std::fill(outJac.begin(), outJac.end(), R(0.0));
│ │ │ -
1167 else
│ │ │ -
1168 {
│ │ │ -
1169 for (size_t j=offset; j<offset+limit; j++)
│ │ │ -
1170 {
│ │ │ -
1171 R derivativeAddend1 = lowOrderOneDValues[j] / (knotVector[j+order]-knotVector[j]);
│ │ │ -
1172 R derivativeAddend2 = lowOrderOneDValues[j+1] / (knotVector[j+order+1]-knotVector[j+1]);
│ │ │ -
1173 // The two previous terms may evaluate as 0/0. This is to be interpreted as 0.
│ │ │ -
1174 if (std::isnan(derivativeAddend1))
│ │ │ -
1175 derivativeAddend1 = 0;
│ │ │ -
1176 if (std::isnan(derivativeAddend2))
│ │ │ -
1177 derivativeAddend2 = 0;
│ │ │ -
1178 outJac[j-offset] = order * ( derivativeAddend1 - derivativeAddend2 );
│ │ │ -
1179 }
│ │ │ -
1180 }
│ │ │ -
1181 }
│ │ │ -
1182
│ │ │ -
1183 // Evaluate 1d function second derivatives
│ │ │ -
1184 if (evaluateHessian)
│ │ │ -
1185 {
│ │ │ -
1186 outHess.resize(limit);
│ │ │ -
1187
│ │ │ -
1188 if (order<2) // order-zero functions are piecewise constant, hence all derivatives are zero
│ │ │ -
1189 std::fill(outHess.begin(), outHess.end(), R(0.0));
│ │ │ -
1190 else
│ │ │ -
1191 {
│ │ │ -
1192 for (size_t j=offset; j<offset+limit; j++)
│ │ │ -
1193 {
│ │ │ -
1194 assert(j+2 < lowOrderTwoDValues.size());
│ │ │ -
1195 R derivativeAddend1 = lowOrderTwoDValues[j] / (knotVector[j+order]-knotVector[j]) / (knotVector[j+order-1]-knotVector[j]);
│ │ │ -
1196 R derivativeAddend2 = lowOrderTwoDValues[j+1] / (knotVector[j+order]-knotVector[j]) / (knotVector[j+order]-knotVector[j+1]);
│ │ │ -
1197 R derivativeAddend3 = lowOrderTwoDValues[j+1] / (knotVector[j+order+1]-knotVector[j+1]) / (knotVector[j+order]-knotVector[j+1]);
│ │ │ -
1198 R derivativeAddend4 = lowOrderTwoDValues[j+2] / (knotVector[j+order+1]-knotVector[j+1]) / (knotVector[j+1+order]-knotVector[j+2]);
│ │ │ -
1199 // The two previous terms may evaluate as 0/0. This is to be interpreted as 0.
│ │ │ -
1200
│ │ │ -
1201 if (std::isnan(derivativeAddend1))
│ │ │ -
1202 derivativeAddend1 = 0;
│ │ │ -
1203 if (std::isnan(derivativeAddend2))
│ │ │ -
1204 derivativeAddend2 = 0;
│ │ │ -
1205 if (std::isnan(derivativeAddend3))
│ │ │ -
1206 derivativeAddend3 = 0;
│ │ │ -
1207 if (std::isnan(derivativeAddend4))
│ │ │ -
1208 derivativeAddend4 = 0;
│ │ │ -
1209 outHess[j-offset] = order * (order-1) * ( derivativeAddend1 - derivativeAddend2 -derivativeAddend3 + derivativeAddend4 );
│ │ │ -
1210 }
│ │ │ -
1211 }
│ │ │ -
1212 }
│ │ │ -
1213 }
│ │ │ -
│ │ │ -
1214
│ │ │ -
1215
│ │ │ -
1217 std::array<unsigned int, dim> order_;
│ │ │ -
1218
│ │ │ -
1220 std::array<std::vector<double>, dim> knotVectors_;
│ │ │ -
1221
│ │ │ -
1223 std::array<unsigned,dim> elements_;
│ │ │ -
1224
│ │ │ - │ │ │ -
1226};
│ │ │ -
│ │ │ -
1227
│ │ │ -
1228
│ │ │ -
1229
│ │ │ -
1230template<typename GV>
│ │ │ -
│ │ │ - │ │ │ -
1232 public LeafBasisNode
│ │ │ -
1233{
│ │ │ -
1234 static const int dim = GV::dimension;
│ │ │ -
1235
│ │ │ -
1236public:
│ │ │ -
1237
│ │ │ -
1238 using size_type = std::size_t;
│ │ │ -
1239 using Element = typename GV::template Codim<0>::Entity;
│ │ │ - │ │ │ -
1241
│ │ │ -
│ │ │ - │ │ │ -
1243 preBasis_(preBasis),
│ │ │ -
1244 finiteElement_(*preBasis)
│ │ │ -
1245 {}
│ │ │ -
│ │ │ -
1246
│ │ │ -
│ │ │ -
1248 const Element& element() const
│ │ │ -
1249 {
│ │ │ -
1250 return element_;
│ │ │ -
1251 }
│ │ │ -
│ │ │ -
1252
│ │ │ -
│ │ │ - │ │ │ -
1258 {
│ │ │ -
1259 return finiteElement_;
│ │ │ -
1260 }
│ │ │ -
│ │ │ -
1261
│ │ │ -
│ │ │ -
1263 void bind(const Element& e)
│ │ │ -
1264 {
│ │ │ -
1265 element_ = e;
│ │ │ -
1266 auto elementIndex = preBasis_->gridView().indexSet().index(e);
│ │ │ -
1267 finiteElement_.bind(preBasis_->getIJK(elementIndex,preBasis_->elements_));
│ │ │ -
1268 this->setSize(finiteElement_.size());
│ │ │ -
1269 }
│ │ │ -
│ │ │ -
1270
│ │ │ -
1271protected:
│ │ │ -
1272
│ │ │ - │ │ │ -
1274
│ │ │ - │ │ │ - │ │ │ -
1277};
│ │ │ -
│ │ │ -
1278
│ │ │ -
1279
│ │ │ -
1280
│ │ │ -
1281namespace BasisFactory {
│ │ │ -
1282
│ │ │ -
│ │ │ -
1289inline auto bSpline(const std::vector<double>& knotVector,
│ │ │ -
1290 unsigned int order,
│ │ │ -
1291 bool makeOpen = true)
│ │ │ -
1292{
│ │ │ -
1293 return [&knotVector, order, makeOpen](const auto& gridView) {
│ │ │ -
1294 return BSplinePreBasis<std::decay_t<decltype(gridView)>>(gridView, knotVector, order, makeOpen);
│ │ │ -
1295 };
│ │ │ -
1296}
│ │ │ -
│ │ │ -
1297
│ │ │ -
1298} // end namespace BasisFactory
│ │ │ -
1299
│ │ │ -
1300// *****************************************************************************
│ │ │ -
1301// This is the actual global basis implementation based on the reusable parts.
│ │ │ -
1302// *****************************************************************************
│ │ │ -
1303
│ │ │ -
1310template<typename GV>
│ │ │ - │ │ │ -
1312
│ │ │ -
1313
│ │ │ -
1314} // namespace Functions
│ │ │ -
1315
│ │ │ -
1316} // namespace Dune
│ │ │ -
1317
│ │ │ -
1318#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BSPLINEBASIS_HH
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
auto bSpline(const std::vector< double > &knotVector, unsigned int order, bool makeOpen=true)
Create a pre-basis factory that can create a B-spline pre-basis.
Definition bsplinebasis.hh:1289
│ │ │ -
DefaultGlobalBasis< BSplinePreBasis< GV > > BSplineBasis
A global B-spline basis.
Definition bsplinebasis.hh:1311
│ │ │ +
487} // namespace Dune
│ │ │ +
488
│ │ │ +
489#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH
│ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
Definition argyrisbasis.hh:926
│ │ │ -
LocalFiniteElement in the sense of dune-localfunctions, for the B-spline basis on tensor-product grid...
Definition bsplinebasis.hh:369
│ │ │ -
BSplineLocalFiniteElement(const BSplineLocalFiniteElement &other)
Copy constructor.
Definition bsplinebasis.hh:390
│ │ │ -
const BSplinePreBasis< GV > & preBasis_
Definition bsplinebasis.hh:481
│ │ │ -
const BSplineLocalInterpolation< dim, BSplineLocalBasis< GV, R > > & localInterpolation() const
Hand out a LocalInterpolation object.
Definition bsplinebasis.hh:446
│ │ │ -
LocalFiniteElementTraits< BSplineLocalBasis< GV, R >, BSplineLocalCoefficients< dim >, BSplineLocalInterpolation< dim, BSplineLocalBasis< GV, R > > > Traits
Export various types related to this LocalFiniteElement.
Definition bsplinebasis.hh:379
│ │ │ -
std::array< unsigned, dim > currentKnotSpan_
Definition bsplinebasis.hh:488
│ │ │ -
BSplineLocalFiniteElement(const BSplinePreBasis< GV > &preBasis)
Constructor with a given B-spline basis.
Definition bsplinebasis.hh:383
│ │ │ -
const BSplineLocalCoefficients< dim > & localCoefficients() const
Hand out a LocalCoefficients object.
Definition bsplinebasis.hh:440
│ │ │ -
void bind(const std::array< unsigned, dim > &elementIdx)
Bind LocalFiniteElement to a specific knot span of the spline patch.
Definition bsplinebasis.hh:401
│ │ │ -
BSplineLocalInterpolation< dim, BSplineLocalBasis< GV, double > > localInterpolation_
Definition bsplinebasis.hh:485
│ │ │ -
GeometryType type() const
Return the reference element that the local finite element is defined on (here, a hypercube).
Definition bsplinebasis.hh:462
│ │ │ -
unsigned size() const
Number of shape functions in this finite element.
Definition bsplinebasis.hh:452
│ │ │ -
BSplineLocalCoefficients< dim > localCoefficients_
Definition bsplinebasis.hh:484
│ │ │ -
unsigned int size(int i) const
Number of degrees of freedom for one coordinate direction.
Definition bsplinebasis.hh:470
│ │ │ -
BSplineLocalBasis< GV, double > localBasis_
Definition bsplinebasis.hh:483
│ │ │ -
const BSplineLocalBasis< GV, R > & localBasis() const
Hand out a LocalBasis object.
Definition bsplinebasis.hh:434
│ │ │ -
Pre-basis for B-spline basis.
Definition bsplinebasis.hh:507
│ │ │ -
std::array< unsigned, dim > elements_
Number of grid elements in the different coordinate directions.
Definition bsplinebasis.hh:1223
│ │ │ -
GridView gridView_
Definition bsplinebasis.hh:1225
│ │ │ -
double R
Definition bsplinebasis.hh:576
│ │ │ -
static void evaluateFunctionFull(const typename GV::ctype &in, DynamicMatrix< R > &out, const std::vector< R > &knotVector, unsigned int order, unsigned int currentKnotSpan)
Evaluate all one-dimensional B-spline functions for a given coordinate direction.
Definition bsplinebasis.hh:1069
│ │ │ -
void evaluateFunction(const FieldVector< typename GV::ctype, dim > &in, std::vector< FieldVector< R, 1 > > &out, const std::array< unsigned, dim > &currentKnotSpan) const
Evaluate all B-spline basis functions at a given point.
Definition bsplinebasis.hh:765
│ │ │ -
std::array< unsigned int, dim > order_
Order of the B-spline for each space dimension.
Definition bsplinebasis.hh:1217
│ │ │ -
static void evaluateAll(const typename GV::ctype &in, std::vector< R > &out, bool evaluateJacobian, std::vector< R > &outJac, bool evaluateHessian, std::vector< R > &outHess, const std::vector< R > &knotVector, unsigned int order, unsigned int currentKnotSpan)
Evaluate the second derivatives of all one-dimensional B-spline functions for a given coordinate dire...
Definition bsplinebasis.hh:1111
│ │ │ -
static void evaluateFunction(const typename GV::ctype &in, std::vector< R > &out, const std::vector< R > &knotVector, unsigned int order, unsigned int currentKnotSpan)
Evaluate all one-dimensional B-spline functions for a given coordinate direction.
Definition bsplinebasis.hh:1012
│ │ │ -
unsigned int size(size_t d) const
Number of shape functions in one direction.
Definition bsplinebasis.hh:756
│ │ │ -
GV GridView
The grid view that the FE space is defined on.
Definition bsplinebasis.hh:570
│ │ │ -
It indices(const Node &node, It it) const
Maps from subtree index set [0..size-1] to a globally unique multi index in global basis.
Definition bsplinebasis.hh:717
│ │ │ -
void evaluate(const typename std::array< int, k > &directions, const FieldVector< typename GV::ctype, dim > &in, std::vector< FieldVector< R, 1 > > &out, const std::array< unsigned, dim > &currentKnotSpan) const
Evaluate Derivatives of all B-spline basis functions.
Definition bsplinebasis.hh:897
│ │ │ -
std::size_t size_type
Definition bsplinebasis.hh:571
│ │ │ -
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition bsplinebasis.hh:693
│ │ │ -
unsigned int dimension() const
Total number of B-spline basis functions.
Definition bsplinebasis.hh:747
│ │ │ -
void initializeIndices()
Initialize the global indices.
Definition bsplinebasis.hh:683
│ │ │ -
BSplineNode< GV > Node
Definition bsplinebasis.hh:573
│ │ │ -
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition bsplinebasis.hh:687
│ │ │ -
static std::array< unsigned int, dim > getIJK(typename GridView::IndexSet::IndexType idx, std::array< unsigned int, dim > elements)
Compute integer element coordinates from the element index.
Definition bsplinebasis.hh:993
│ │ │ -
Node makeNode() const
Create tree node.
Definition bsplinebasis.hh:701
│ │ │ -
BSplinePreBasis(const GridView &gridView, const std::vector< double > &knotVector, unsigned int order, bool makeOpen=true)
Construct a B-spline basis for a given grid view and set of knot vectors.
Definition bsplinebasis.hh:597
│ │ │ -
void evaluateJacobian(const FieldVector< typename GV::ctype, dim > &in, std::vector< FieldMatrix< R, 1, dim > > &out, const std::array< unsigned, dim > &currentKnotSpan) const
Evaluate Jacobian of all B-spline basis functions.
Definition bsplinebasis.hh:796
│ │ │ -
std::array< std::vector< double >, dim > knotVectors_
The knot vectors, one for each space dimension.
Definition bsplinebasis.hh:1220
│ │ │ -
size_type size() const
Get the total dimension of the space spanned by this basis.
Definition leafprebasismixin.hh:60
│ │ │ -
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition bsplinebasis.hh:707
│ │ │ -
BSplinePreBasis(const GridView &gridView, const FieldVector< double, dim > &lowerLeft, const FieldVector< double, dim > &upperRight, const std::array< unsigned int, dim > &elements, unsigned int order, bool makeOpen=true)
Construct a B-spline basis for a given grid view with uniform knot vectors.
Definition bsplinebasis.hh:649
│ │ │ -
LocalBasis class in the sense of dune-localfunctions, presenting the restriction of a B-spline patch ...
Definition bsplinebasis.hh:51
│ │ │ -
LocalBasisTraits< D, dim, FieldVector< D, dim >, R, 1, FieldVector< R, 1 >, FieldMatrix< R, 1, dim > > Traits
export type traits for function signature
Definition bsplinebasis.hh:60
│ │ │ -
unsigned int order() const
Polynomial order of the shape functions.
Definition bsplinebasis.hh:147
│ │ │ -
std::size_t size() const
Return the number of basis functions on the current knot span.
Definition bsplinebasis.hh:154
│ │ │ -
void evaluate(const typename std::array< int, k > &directions, const typename Traits::DomainType &in, std::vector< typename Traits::RangeType > &out) const
Evaluate all shape functions and derivatives of any order.
Definition bsplinebasis.hh:104
│ │ │ -
void evaluateFunction(const FieldVector< D, dim > &in, std::vector< FieldVector< R, 1 > > &out) const
Evaluate all shape functions.
Definition bsplinebasis.hh:76
│ │ │ -
void evaluateJacobian(const FieldVector< D, dim > &in, std::vector< FieldMatrix< D, 1, dim > > &out) const
Evaluate Jacobian of all shape functions.
Definition bsplinebasis.hh:89
│ │ │ -
BSplineLocalBasis(const BSplinePreBasis< GV > &preBasis, const BSplineLocalFiniteElement< GV, R > &lFE)
Constructor with a given B-spline patch.
Definition bsplinebasis.hh:66
│ │ │ -
Attaches a shape function to an entity.
Definition bsplinebasis.hh:185
│ │ │ -
const LocalKey & localKey(std::size_t i) const
get i'th index
Definition bsplinebasis.hh:328
│ │ │ -
void init(const std::array< unsigned, dim > &sizes)
Definition bsplinebasis.hh:263
│ │ │ -
std::size_t size() const
number of coefficients
Definition bsplinebasis.hh:322
│ │ │ -
Local interpolation in the sense of dune-localfunctions, for the B-spline basis on tensor-product gri...
Definition bsplinebasis.hh:347
│ │ │ -
void interpolate(const F &f, std::vector< C > &out) const
Local interpolation of a function.
Definition bsplinebasis.hh:351
│ │ │ -
Definition bsplinebasis.hh:1233
│ │ │ -
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition bsplinebasis.hh:1257
│ │ │ -
typename GV::template Codim< 0 >::Entity Element
Definition bsplinebasis.hh:1239
│ │ │ -
const BSplinePreBasis< GV > * preBasis_
Definition bsplinebasis.hh:1273
│ │ │ -
BSplineLocalFiniteElement< GV, double > FiniteElement
Definition bsplinebasis.hh:1240
│ │ │ -
Element element_
Definition bsplinebasis.hh:1276
│ │ │ -
void bind(const Element &e)
Bind to element.
Definition bsplinebasis.hh:1263
│ │ │ -
BSplineNode(const BSplinePreBasis< GV > *preBasis)
Definition bsplinebasis.hh:1242
│ │ │ -
const Element & element() const
Return current element, throw if unbound.
Definition bsplinebasis.hh:1248
│ │ │ -
FiniteElement finiteElement_
Definition bsplinebasis.hh:1275
│ │ │ -
std::size_t size_type
Definition bsplinebasis.hh:1238
│ │ │ -
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:53
│ │ │ -
A generic MixIn class for PreBasis.
Definition leafprebasismixin.hh:36
│ │ │ -
size_type size() const
Definition leafprebasismixin.hh:60
│ │ │ +
void bindTree(Tree &tree, const Entity &entity, std::size_t offset=0)
Definition nodes.hh:469
│ │ │ +
void initializeTree(Tree &tree, std::size_t treeIndexOffset=0)
Definition nodes.hh:476
│ │ │ +
size_type treeIndex() const
Definition nodes.hh:180
│ │ │ +
size_type localIndex(size_type i) const
Definition nodes.hh:149
│ │ │ +
size_type offset() const
Definition nodes.hh:187
│ │ │ +
bool empty() const
Check if the node is empty.
Definition nodes.hh:175
│ │ │
size_type size() const
Obtain the number of basis function in the local node.
Definition nodes.hh:162
│ │ │ +
void setOffset(const size_type offset)
Definition nodes.hh:192
│ │ │ +
std::size_t size_type
Definition nodes.hh:141
│ │ │ +
BasisNodeMixin()
Definition nodes.hh:143
│ │ │
void setSize(const size_type size)
Definition nodes.hh:197
│ │ │ +
void setTreeIndex(size_type treeIndex)
Definition nodes.hh:202
│ │ │
Definition nodes.hh:218
│ │ │ +
static const bool isLeaf
Definition nodes.hh:230
│ │ │ +
static const bool isComposite
Definition nodes.hh:232
│ │ │ +
static const bool isPower
Definition nodes.hh:231
│ │ │ +
static constexpr auto degree()
Definition nodes.hh:223
│ │ │ + │ │ │ +
void bind(const Element &entity)
Definition nodes.hh:249
│ │ │ +
Definition nodes.hh:268
│ │ │ +
auto & child(Index i)
Definition nodes.hh:287
│ │ │ + │ │ │ +
const Element & element() const
Definition nodes.hh:311
│ │ │ +
typename T::Element Element
Definition nodes.hh:307
│ │ │ +
const auto & child(Index i) const
Definition nodes.hh:280
│ │ │ +
static constexpr auto degree()
Definition nodes.hh:273
│ │ │ + │ │ │ + │ │ │ +
static const bool isComposite
Definition nodes.hh:300
│ │ │ +
void setChild(Index i, TT &&t)
Definition nodes.hh:317
│ │ │ + │ │ │ +
const Element & element() const
Definition nodes.hh:377
│ │ │ + │ │ │ +
void setChild(Index i, TT &&t)
Definition nodes.hh:383
│ │ │ +
const auto & child(Index i) const
Definition nodes.hh:344
│ │ │ + │ │ │ +
DynamicPowerBasisNode(std::size_t children)
Definition nodes.hh:373
│ │ │ +
auto & child(Index i)
Definition nodes.hh:351
│ │ │ + │ │ │ +
std::size_t degree() const
Definition nodes.hh:337
│ │ │ +
typename typename SubPreBasis::Node::Element Element
Definition nodes.hh:371
│ │ │ + │ │ │ + │ │ │ +
static constexpr auto degree()
Definition nodes.hh:402
│ │ │ +
static const bool isLeaf
Definition nodes.hh:425
│ │ │ +
auto & child(Dune::index_constant< i > ii)
Definition nodes.hh:414
│ │ │ +
static const bool isPower
Definition nodes.hh:426
│ │ │ +
typename std::tuple_element_t< 0, std::tuple< T... > >::Element Element
Definition nodes.hh:444
│ │ │ +
const Element & element() const
Definition nodes.hh:452
│ │ │ +
const auto & child(Dune::index_constant< i > ii) const
Definition nodes.hh:408
│ │ │ +
static const bool isComposite
Definition nodes.hh:427
│ │ │ +
void setChild(TT &&t, Dune::index_constant< i > ii={})
Definition nodes.hh:458
│ │ │ +
CompositeBasisNode(const T &... children)
Definition nodes.hh:448
│ │ │ + │ │ │ +
typename std::tuple_element_t< k, std::tuple< T... > > Type
The type of the child.
Definition nodes.hh:437
│ │ │ +
Type type
Definition nodes.hh:439
│ │ │
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,1496 +1,636 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -bsplinebasis.hh │ │ │ │ +nodes.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ -_1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ +1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BSPLINEBASIS_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BSPLINEBASIS_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH │ │ │ │ +8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH │ │ │ │ 9 │ │ │ │ -13 │ │ │ │ -14#include │ │ │ │ -15#include │ │ │ │ -16 │ │ │ │ -18#include │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ +12#include │ │ │ │ +13#include │ │ │ │ +14#include │ │ │ │ +15 │ │ │ │ +16#include │ │ │ │ +17#include │ │ │ │ +18#include │ │ │ │ 19 │ │ │ │ -20#include │ │ │ │ -21#include │ │ │ │ -22#include │ │ │ │ -23#include │ │ │ │ -24#include │ │ │ │ -25#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -26#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ -27#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h> │ │ │ │ -28 │ │ │ │ -29namespace _D_u_n_e │ │ │ │ -30{ │ │ │ │ -31namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +20#include │ │ │ │ +21#include │ │ │ │ +22 │ │ │ │ +23#ifdef HAVE_DUNE_TYPETREE │ │ │ │ +24#include │ │ │ │ +25#endif │ │ │ │ +26 │ │ │ │ +27namespace _D_u_n_e { │ │ │ │ +28 namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +29 │ │ │ │ +30 │ │ │ │ +31 namespace Impl { │ │ │ │ 32 │ │ │ │ -33// A maze of dependencies between the different parts of this. We need a few │ │ │ │ -forward declarations │ │ │ │ -34template │ │ │ │ -35class _B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t; │ │ │ │ -36 │ │ │ │ -37template │ │ │ │ -38class _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s; │ │ │ │ +33 // This class encapsulates the access to the setOffset() │ │ │ │ +34 // and setTreeIndex() methods of a node. This way we │ │ │ │ +35 // can hide the methods from the user but still provide │ │ │ │ +36 // access where this is needed. │ │ │ │ +37 struct BasisNodeSetupHelper │ │ │ │ +38 { │ │ │ │ 39 │ │ │ │ -40 │ │ │ │ -49template │ │ │ │ -_5_0class _B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s │ │ │ │ -51{ │ │ │ │ -52 friend class _B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t; │ │ │ │ -53 │ │ │ │ -54 typedef typename GV::ctype D; │ │ │ │ -55 enum {dim = GV::dimension}; │ │ │ │ -56public: │ │ │ │ +40 template │ │ │ │ +41 static void setSize(Node& node, const size_type size) │ │ │ │ +42 { │ │ │ │ +43 node.setSize(size); │ │ │ │ +44 } │ │ │ │ +45 │ │ │ │ +46 template │ │ │ │ +47 static void setOffset(Node& node, const size_type offset) │ │ │ │ +48 { │ │ │ │ +49 node.setOffset(offset); │ │ │ │ +50 } │ │ │ │ +51 │ │ │ │ +52 template │ │ │ │ +53 static void setTreeIndex(Node& node, const size_type index) │ │ │ │ +54 { │ │ │ │ +55 node.setTreeIndex(index); │ │ │ │ +56 } │ │ │ │ 57 │ │ │ │ -59 typedef LocalBasisTraits,R,1,FieldVector, │ │ │ │ -_6_0 FieldMatrix > _T_r_a_i_t_s; │ │ │ │ +58 }; │ │ │ │ +59 │ │ │ │ +60 │ │ │ │ 61 │ │ │ │ -_6_6 _B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s(const _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_<_G_V_>& preBasis, │ │ │ │ -67 const _B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_G_V_,_R_>& lFE) │ │ │ │ -68 : preBasis_(preBasis), │ │ │ │ -69 lFE_(lFE) │ │ │ │ -70 {} │ │ │ │ -71 │ │ │ │ -_7_6 void _e_v_a_l_u_a_t_e_F_u_n_c_t_i_o_n (const FieldVector& in, │ │ │ │ -77 std::vector >& out) const │ │ │ │ -78 { │ │ │ │ -79 FieldVector globalIn = offset_; │ │ │ │ -80 scaling_.umv(in,globalIn); │ │ │ │ +62 // A mixin class for generalized child access from │ │ │ │ +63 // multiple indices or a tree path. The derived class │ │ │ │ +64 // only has to provide the child(i) method with │ │ │ │ +65 // a single index for accessing direct children. │ │ │ │ +66 template │ │ │ │ +67 class ChildAccessMixIn │ │ │ │ +68 { │ │ │ │ +69 │ │ │ │ +70 Impl& asImpl() │ │ │ │ +71 { │ │ │ │ +72 return static_cast(*this); │ │ │ │ +73 } │ │ │ │ +74 │ │ │ │ +75 const Impl& asImpl() const │ │ │ │ +76 { │ │ │ │ +77 return static_cast(*this); │ │ │ │ +78 } │ │ │ │ +79 │ │ │ │ +80 public: │ │ │ │ 81 │ │ │ │ -82 preBasis_.evaluateFunction(globalIn, out, lFE_.currentKnotSpan_); │ │ │ │ -83 } │ │ │ │ -84 │ │ │ │ -_8_9 void _e_v_a_l_u_a_t_e_J_a_c_o_b_i_a_n (const FieldVector& in, │ │ │ │ -90 std::vector >& out) const │ │ │ │ -91 { │ │ │ │ -92 FieldVector globalIn = offset_; │ │ │ │ -93 scaling_.umv(in,globalIn); │ │ │ │ -94 │ │ │ │ -95 preBasis_.evaluateJacobian(globalIn, out, lFE_.currentKnotSpan_); │ │ │ │ -96 │ │ │ │ -97 for (size_t i=0; i │ │ │ │ -_1_0_4 inline void _e_v_a_l_u_a_t_e (const typename std::array& directions, │ │ │ │ -105 const typename Traits::DomainType& in, │ │ │ │ -106 std::vector& out) const │ │ │ │ -107 { │ │ │ │ -108 switch(k) │ │ │ │ -109 { │ │ │ │ -110 case 0: │ │ │ │ -111 _e_v_a_l_u_a_t_e_F_u_n_c_t_i_o_n(in, out); │ │ │ │ -112 break; │ │ │ │ -113 case 1: │ │ │ │ +87 template │ │ │ │ +88 const auto& child(II... ii) const │ │ │ │ +89 requires (sizeof...(II) != 1) │ │ │ │ +90 { │ │ │ │ +91 return Dune::TypeTree::child(asImpl(), ii...); │ │ │ │ +92 } │ │ │ │ +93 │ │ │ │ +99 │ │ │ │ +100 template │ │ │ │ +101 auto& child(II... ii) │ │ │ │ +102 requires (sizeof...(II) != 1) │ │ │ │ +103 { │ │ │ │ +104 return Dune::TypeTree::child(asImpl(), ii...); │ │ │ │ +105 } │ │ │ │ +106 │ │ │ │ +112 template │ │ │ │ +113 const auto& child(Dune::HybridMultiIndex treePath) const │ │ │ │ 114 { │ │ │ │ -115 FieldVector globalIn = offset_; │ │ │ │ -116 scaling_.umv(in,globalIn); │ │ │ │ +115 return Dune::TypeTree::child(asImpl(), treePath); │ │ │ │ +116 } │ │ │ │ 117 │ │ │ │ -118 preBasis_.evaluate(directions, globalIn, out, lFE_.currentKnotSpan_); │ │ │ │ -119 │ │ │ │ -120 for (size_t i=0; i │ │ │ │ +124 auto& child(Dune::HybridMultiIndex treePath) │ │ │ │ 125 { │ │ │ │ -126 FieldVector globalIn = offset_; │ │ │ │ -127 scaling_.umv(in,globalIn); │ │ │ │ +126 return Dune::TypeTree::child(asImpl(), treePath); │ │ │ │ +127 } │ │ │ │ 128 │ │ │ │ -129 preBasis_.evaluate(directions, globalIn, out, lFE_.currentKnotSpan_); │ │ │ │ +129 }; │ │ │ │ 130 │ │ │ │ -131 for (size_t i=0; i& preBasis_; │ │ │ │ -161 │ │ │ │ -162 const _B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_G_V_,_R_>& lFE_; │ │ │ │ -163 │ │ │ │ -164 // Coordinates in a single knot span differ from coordinates on the B- │ │ │ │ -spline patch │ │ │ │ -165 // by an affine transformation. This transformation is stored in offset_ │ │ │ │ -and scaling_. │ │ │ │ -166 FieldVector offset_; │ │ │ │ -167 DiagonalMatrix scaling_; │ │ │ │ -168}; │ │ │ │ -169 │ │ │ │ -183template │ │ │ │ -_1_8_4class _B_S_p_l_i_n_e_L_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s │ │ │ │ -185{ │ │ │ │ -186 // Return i as a d-digit number in the (k+1)-nary system │ │ │ │ -187 std::array multiindex (unsigned int i) const │ │ │ │ +131 } // end namespace Impl │ │ │ │ +132 │ │ │ │ +133 │ │ │ │ +_1_3_4 class _B_a_s_i_s_N_o_d_e_M_i_x_i_n │ │ │ │ +135 { │ │ │ │ +136 │ │ │ │ +137 friend struct Impl::BasisNodeSetupHelper; │ │ │ │ +138 │ │ │ │ +139 public: │ │ │ │ +140 │ │ │ │ +_1_4_1 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ +142 │ │ │ │ +_1_4_3 _B_a_s_i_s_N_o_d_e_M_i_x_i_n() : │ │ │ │ +144 offset_(0), │ │ │ │ +145 size_(0), │ │ │ │ +146 treeIndex_(0) │ │ │ │ +147 {} │ │ │ │ +148 │ │ │ │ +_1_4_9 _s_i_z_e___t_y_p_e _l_o_c_a_l_I_n_d_e_x(_s_i_z_e___t_y_p_e i) const │ │ │ │ +150 { │ │ │ │ +151 assert(i < size_); │ │ │ │ +152 return offset_ + i; │ │ │ │ +153 } │ │ │ │ +154 │ │ │ │ +_1_6_2 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ +163 { │ │ │ │ +164 return size_; │ │ │ │ +165 } │ │ │ │ +166 │ │ │ │ +_1_7_5 bool _e_m_p_t_y() const │ │ │ │ +176 { │ │ │ │ +177 return (size_ == 0); │ │ │ │ +178 } │ │ │ │ +179 │ │ │ │ +_1_8_0 _s_i_z_e___t_y_p_e _t_r_e_e_I_n_d_e_x() const │ │ │ │ +181 { │ │ │ │ +182 return treeIndex_; │ │ │ │ +183 } │ │ │ │ +184 │ │ │ │ +185 protected: │ │ │ │ +186 │ │ │ │ +_1_8_7 _s_i_z_e___t_y_p_e _o_f_f_s_e_t() const │ │ │ │ 188 { │ │ │ │ -189 std::array alpha; │ │ │ │ -190 for (int j=0; j& subEntity) │ │ │ │ -200 { │ │ │ │ -201 if (sizes_[0]==1) │ │ │ │ -202 { │ │ │ │ -203 subEntity[0] = 0; │ │ │ │ -204 return; │ │ │ │ +189 return offset_; │ │ │ │ +190 } │ │ │ │ +191 │ │ │ │ +_1_9_2 void _s_e_t_O_f_f_s_e_t(const _s_i_z_e___t_y_p_e _o_f_f_s_e_t) │ │ │ │ +193 { │ │ │ │ +194 offset_ = _o_f_f_s_e_t; │ │ │ │ +195 } │ │ │ │ +196 │ │ │ │ +_1_9_7 void _s_e_t_S_i_z_e(const _s_i_z_e___t_y_p_e _s_i_z_e) │ │ │ │ +198 { │ │ │ │ +199 size_ = _s_i_z_e; │ │ │ │ +200 } │ │ │ │ +201 │ │ │ │ +_2_0_2 void _s_e_t_T_r_e_e_I_n_d_e_x(_s_i_z_e___t_y_p_e _t_r_e_e_I_n_d_e_x) │ │ │ │ +203 { │ │ │ │ +204 treeIndex_ = _t_r_e_e_I_n_d_e_x; │ │ │ │ 205 } │ │ │ │ 206 │ │ │ │ -207 /* edge and vertex numbering │ │ │ │ -208 0----0----1 │ │ │ │ -209 */ │ │ │ │ -210 unsigned lastIndex=0; │ │ │ │ -211 subEntity[lastIndex++] = 0; // corner 0 │ │ │ │ -212 for (unsigned i = 0; i < sizes_[0] - 2; ++i) │ │ │ │ -213 subEntity[lastIndex++] = 0; // inner dofs of element (0) │ │ │ │ +207 private: │ │ │ │ +208 │ │ │ │ +209 _s_i_z_e___t_y_p_e offset_; │ │ │ │ +210 _s_i_z_e___t_y_p_e size_; │ │ │ │ +211 _s_i_z_e___t_y_p_e treeIndex_; │ │ │ │ +212 │ │ │ │ +213 }; │ │ │ │ 214 │ │ │ │ -215 subEntity[lastIndex++] = 1; // corner 1 │ │ │ │ -216 │ │ │ │ -217 assert(_s_i_z_e()==lastIndex); │ │ │ │ -218 } │ │ │ │ -219 │ │ │ │ -220 void setup2d(std::vector& subEntity) │ │ │ │ -221 { │ │ │ │ -222 unsigned lastIndex=0; │ │ │ │ -223 │ │ │ │ -224 // LocalKey: entity number , entity codim, dof indices within each entity │ │ │ │ -225 /* edge and vertex numbering │ │ │ │ -226 2----3----3 │ │ │ │ -227 | | │ │ │ │ -228 | | │ │ │ │ -229 0 1 │ │ │ │ -230 | | │ │ │ │ -231 | | │ │ │ │ -232 0----2----1 │ │ │ │ -233 */ │ │ │ │ -234 │ │ │ │ -235 // lower edge (2) │ │ │ │ -236 subEntity[lastIndex++] = 0; // corner 0 │ │ │ │ -237 for (unsigned i = 0; i < sizes_[0]-2; ++i) │ │ │ │ -238 subEntity[lastIndex++] = 2; // inner dofs of lower edge (2) │ │ │ │ -239 │ │ │ │ -240 subEntity[lastIndex++] = 1; // corner 1 │ │ │ │ +215 │ │ │ │ +_2_1_6 class _L_e_a_f_B_a_s_i_s_N_o_d_e : │ │ │ │ +217 public _B_a_s_i_s_N_o_d_e_M_i_x_i_n │ │ │ │ +218 { │ │ │ │ +219 public: │ │ │ │ +220 │ │ │ │ +221 // Begin of node interface │ │ │ │ +222 │ │ │ │ +_2_2_3 static constexpr auto _d_e_g_r_e_e() │ │ │ │ +224 { │ │ │ │ +225 return Dune::index_constant<0>{}; │ │ │ │ +226 } │ │ │ │ +227 │ │ │ │ +228 // Historic node interface │ │ │ │ +229 │ │ │ │ +_2_3_0 static const bool _i_s_L_e_a_f [[deprecated]] = true; │ │ │ │ +_2_3_1 static const bool _i_s_P_o_w_e_r [[deprecated]] = false; │ │ │ │ +_2_3_2 static const bool _i_s_C_o_m_p_o_s_i_t_e [[deprecated]] = false; │ │ │ │ +233#ifdef HAVE_DUNE_TYPETREE │ │ │ │ +234 using NodeTag [[deprecated]] = Dune::TypeTree::LeafNodeTag; │ │ │ │ +235#endif │ │ │ │ +236 │ │ │ │ +237 // End of node interface │ │ │ │ +238 │ │ │ │ +239 }; │ │ │ │ +240 │ │ │ │ 241 │ │ │ │ -242 // iterate from bottom to top over inner edge dofs │ │ │ │ -243 for (unsigned e = 0; e < sizes_[1]-2; ++e) │ │ │ │ -244 { │ │ │ │ -245 subEntity[lastIndex++] = 0; // left edge (0) │ │ │ │ -246 for (unsigned i = 0; i < sizes_[0]-2; ++i) │ │ │ │ -247 subEntity[lastIndex++] = 0; // face dofs │ │ │ │ -248 subEntity[lastIndex++] = 1; // right edge (1) │ │ │ │ -249 } │ │ │ │ -250 │ │ │ │ -251 // upper edge (3) │ │ │ │ -252 subEntity[lastIndex++] = 2; // corner 2 │ │ │ │ -253 for (unsigned i = 0; i < sizes_[0]-2; ++i) │ │ │ │ -254 subEntity[lastIndex++] = 3; // inner dofs of upper edge (3) │ │ │ │ -255 │ │ │ │ -256 subEntity[lastIndex++] = 3; // corner 3 │ │ │ │ -257 │ │ │ │ -258 assert(_s_i_z_e()==lastIndex); │ │ │ │ -259 } │ │ │ │ -260 │ │ │ │ +242 │ │ │ │ +243 template │ │ │ │ +_2_4_4 class _I_n_n_e_r_B_a_s_i_s_N_o_d_e_M_i_x_i_n │ │ │ │ +245 : public _B_a_s_i_s_N_o_d_e_M_i_x_i_n │ │ │ │ +246 { │ │ │ │ +247 public: │ │ │ │ +248 │ │ │ │ +_2_4_9 void _b_i_n_d(const Element& entity) │ │ │ │ +250 { │ │ │ │ +251 Node& self = *static_cast(this); │ │ │ │ +252 std::size_t _o_f_f_s_e_t = this->_o_f_f_s_e_t(); │ │ │ │ +253 Dune::Hybrid::forEach(Dune::range(self.degree()), [&](auto i) { │ │ │ │ +254 bindTree(self.child(i), entity, offset); │ │ │ │ +255 offset += self.child(i).size(); │ │ │ │ +256 }); │ │ │ │ +257 this->_s_e_t_S_i_z_e(offset - this->_o_f_f_s_e_t()); │ │ │ │ +258 } │ │ │ │ +259 │ │ │ │ +260 }; │ │ │ │ 261 │ │ │ │ -262public: │ │ │ │ -_2_6_3 void _i_n_i_t(const std::array& sizes) │ │ │ │ -264 { │ │ │ │ -265 sizes_ = sizes; │ │ │ │ -266 │ │ │ │ -267 li_.resize(_s_i_z_e()); │ │ │ │ -268 │ │ │ │ -269 // Set up array of codimension-per-dof-number │ │ │ │ -270 std::vector codim(li_.size()); │ │ │ │ -271 │ │ │ │ -272 for (std::size_t i=0; i mIdx = multiindex(i); │ │ │ │ -278 for (int j=0; j index(_s_i_z_e()); │ │ │ │ -289 │ │ │ │ -290 for (std::size_t i=0; i │ │ │ │ +_2_6_5 class _P_o_w_e_r_B_a_s_i_s_N_o_d_e : │ │ │ │ +266 public _I_n_n_e_r_B_a_s_i_s_N_o_d_e_M_i_x_i_n, typename T::Element>, │ │ │ │ +267 public Impl::ChildAccessMixIn> │ │ │ │ +268 { │ │ │ │ +269 public: │ │ │ │ +270 │ │ │ │ +271 // Begin of node interface │ │ │ │ +272 │ │ │ │ +_2_7_3 static constexpr auto _d_e_g_r_e_e() │ │ │ │ +274 { │ │ │ │ +275 return Dune::index_constant{}; │ │ │ │ +276 } │ │ │ │ +277 │ │ │ │ +278 template │ │ │ │ +279 requires (std::is_convertible_v) │ │ │ │ +_2_8_0 const auto& _c_h_i_l_d(Index i) const │ │ │ │ +281 { │ │ │ │ +282 return children_[i].value(); │ │ │ │ +283 } │ │ │ │ +284 │ │ │ │ +285 template │ │ │ │ +286 requires (std::is_convertible_v) │ │ │ │ +_2_8_7 auto& _c_h_i_l_d(Index i) │ │ │ │ +288 { │ │ │ │ +289 return children_[i].value(); │ │ │ │ +290 } │ │ │ │ +291 │ │ │ │ +292 using Impl::ChildAccessMixIn<_P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_T_,_ _n_>>_:_:_c_h_i_l_d; │ │ │ │ 293 │ │ │ │ -294 std::array mIdx = multiindex(i); │ │ │ │ +294 // Historic node interface │ │ │ │ 295 │ │ │ │ -296 for (int j=dim-1; j>=0; j--) │ │ │ │ -297 if (mIdx[j]>0 and mIdx[j] subEntity(li_.size()); │ │ │ │ -303 │ │ │ │ -304 if (subEntity.size() > 0) │ │ │ │ -305 { │ │ │ │ -306 if (dim==1) { │ │ │ │ -307 │ │ │ │ -308 setup1d(subEntity); │ │ │ │ -309 │ │ │ │ -310 } else if (dim==2 and sizes_[0]>1 and sizes_[1]>1) { │ │ │ │ -311 │ │ │ │ -312 setup2d(subEntity); │ │ │ │ -313 │ │ │ │ +296 using ChildType [[deprecated]] = T; │ │ │ │ +297 │ │ │ │ +_2_9_8 static const bool _i_s_L_e_a_f [[deprecated]] = false; │ │ │ │ +_2_9_9 static const bool _i_s_P_o_w_e_r [[deprecated]] = true; │ │ │ │ +_3_0_0 static const bool _i_s_C_o_m_p_o_s_i_t_e [[deprecated]] = false; │ │ │ │ +301#ifdef HAVE_DUNE_TYPETREE │ │ │ │ +302 using NodeTag [[deprecated]] = Dune::TypeTree::PowerNodeTag; │ │ │ │ +303#endif │ │ │ │ +304 │ │ │ │ +305 // End of node interface │ │ │ │ +306 │ │ │ │ +_3_0_7 using _E_l_e_m_e_n_t = typename T::Element; │ │ │ │ +308 │ │ │ │ +_3_0_9 _P_o_w_e_r_B_a_s_i_s_N_o_d_e() = default; │ │ │ │ +310 │ │ │ │ +_3_1_1 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ +312 { │ │ │ │ +313 return _c_h_i_l_d(Dune::Indices::_0).element(); │ │ │ │ 314 } │ │ │ │ -315 } │ │ │ │ -316 │ │ │ │ -317 for (size_t i=0; i()); │ │ │ │ -325 } │ │ │ │ +315 │ │ │ │ +316 template │ │ │ │ +_3_1_7 void _s_e_t_C_h_i_l_d(Index i, TT&& t) │ │ │ │ +318 { │ │ │ │ +319 children_[i].emplace(std::forward(t)); │ │ │ │ +320 } │ │ │ │ +321 │ │ │ │ +322 private: │ │ │ │ +323 std::array, n> children_; │ │ │ │ +324 }; │ │ │ │ +325 │ │ │ │ 326 │ │ │ │ -_3_2_8 const LocalKey& _l_o_c_a_l_K_e_y (std::size_t i) const │ │ │ │ -329 { │ │ │ │ -330 return li_[i]; │ │ │ │ -331 } │ │ │ │ -332 │ │ │ │ -333private: │ │ │ │ +327 │ │ │ │ +328 template │ │ │ │ +_3_2_9 class _D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e : │ │ │ │ +330 public _I_n_n_e_r_B_a_s_i_s_N_o_d_e_M_i_x_i_n, typename T::Element>, │ │ │ │ +331 public Impl::ChildAccessMixIn> │ │ │ │ +332 { │ │ │ │ +333 public: │ │ │ │ 334 │ │ │ │ -335 // Number of shape functions on this element per coordinate direction │ │ │ │ -336 std::array sizes_; │ │ │ │ -337 │ │ │ │ -338 std::vector li_; │ │ │ │ -339}; │ │ │ │ -340 │ │ │ │ -345template │ │ │ │ -_3_4_6class _B_S_p_l_i_n_e_L_o_c_a_l_I_n_t_e_r_p_o_l_a_t_i_o_n │ │ │ │ -347{ │ │ │ │ -348public: │ │ │ │ -350 template │ │ │ │ -_3_5_1 void _i_n_t_e_r_p_o_l_a_t_e (const F& f, std::vector& out) const │ │ │ │ +335 // Begin of node interface │ │ │ │ +336 │ │ │ │ +_3_3_7 std::size_t _d_e_g_r_e_e() const │ │ │ │ +338 { │ │ │ │ +339 return children_.size(); │ │ │ │ +340 } │ │ │ │ +341 │ │ │ │ +342 template │ │ │ │ +343 requires (std::is_convertible_v) │ │ │ │ +_3_4_4 const auto& _c_h_i_l_d(Index i) const │ │ │ │ +345 { │ │ │ │ +346 return children_[i].value(); │ │ │ │ +347 } │ │ │ │ +348 │ │ │ │ +349 template │ │ │ │ +350 requires (std::is_convertible_v) │ │ │ │ +_3_5_1 auto& _c_h_i_l_d(Index i) │ │ │ │ 352 { │ │ │ │ -353 DUNE_THROW(NotImplemented, "BSplineLocalInterpolation::interpolate"); │ │ │ │ +353 return children_[i].value(); │ │ │ │ 354 } │ │ │ │ 355 │ │ │ │ -356}; │ │ │ │ +356 using Impl::ChildAccessMixIn<_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_T_>>_:_:_c_h_i_l_d; │ │ │ │ 357 │ │ │ │ -367template │ │ │ │ -_3_6_8class _B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ -369{ │ │ │ │ -_3_7_0 typedef typename GV::ctype D; │ │ │ │ -371 enum {dim = GV::dimension}; │ │ │ │ -372 friend class _B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s; │ │ │ │ -373public: │ │ │ │ -374 │ │ │ │ -377 typedef LocalFiniteElementTraits, │ │ │ │ -378 _B_S_p_l_i_n_e_L_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s_<_d_i_m_>, │ │ │ │ -_3_7_9 _B_S_p_l_i_n_e_L_o_c_a_l_I_n_t_e_r_p_o_l_a_t_i_o_n_<_d_i_m_,_B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s_<_G_V_,_R_> > > _T_r_a_i_t_s; │ │ │ │ -380 │ │ │ │ -_3_8_3 _B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t(const _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_<_G_V_>& preBasis) │ │ │ │ -384 : _p_r_e_B_a_s_i_s__(preBasis), │ │ │ │ -385 _l_o_c_a_l_B_a_s_i_s__(preBasis,*this) │ │ │ │ -386 {} │ │ │ │ +358 // Historic node interface │ │ │ │ +359 │ │ │ │ +360 using ChildType [[deprecated]] = T; │ │ │ │ +361 │ │ │ │ +_3_6_2 static const bool _i_s_L_e_a_f [[deprecated]] = false; │ │ │ │ +_3_6_3 static const bool _i_s_P_o_w_e_r [[deprecated]] = true; │ │ │ │ +_3_6_4 static const bool _i_s_C_o_m_p_o_s_i_t_e [[deprecated]] = false; │ │ │ │ +365#ifdef HAVE_DUNE_TYPETREE │ │ │ │ +366 using NodeTag [[deprecated]] = Dune::TypeTree::DynamicPowerNodeTag; │ │ │ │ +367#endif │ │ │ │ +368 │ │ │ │ +369 // End of node interface │ │ │ │ +370 │ │ │ │ +_3_7_1 using _E_l_e_m_e_n_t = typename T::Element; │ │ │ │ +372 │ │ │ │ +_3_7_3 _D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e (std::size_t children) │ │ │ │ +374 : children_(children) │ │ │ │ +375 {} │ │ │ │ +376 │ │ │ │ +_3_7_7 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ +378 { │ │ │ │ +379 return _c_h_i_l_d(Dune::Indices::_0).element(); │ │ │ │ +380 } │ │ │ │ +381 │ │ │ │ +382 template │ │ │ │ +_3_8_3 void _s_e_t_C_h_i_l_d(Index i, TT&& t) │ │ │ │ +384 { │ │ │ │ +385 children_[i].emplace(std::forward(t)); │ │ │ │ +386 } │ │ │ │ 387 │ │ │ │ -_3_9_0 _B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t(const _B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t& other) │ │ │ │ -391 : _p_r_e_B_a_s_i_s__(other._p_r_e_B_a_s_i_s__), │ │ │ │ -392 _l_o_c_a_l_B_a_s_i_s__(_p_r_e_B_a_s_i_s__,*this) │ │ │ │ -393 {} │ │ │ │ -394 │ │ │ │ -_4_0_1 void _b_i_n_d(const std::array& elementIdx) │ │ │ │ -402 { │ │ │ │ -403 /* \todo In the long run we need to precompute a table for this */ │ │ │ │ -404 for (size_t i=0; i> children_; │ │ │ │ +390 }; │ │ │ │ +391 │ │ │ │ +392 │ │ │ │ +393 template │ │ │ │ +_3_9_4 class _C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e : │ │ │ │ +395 public _I_n_n_e_r_B_a_s_i_s_N_o_d_e_M_i_x_i_n, typename │ │ │ │ +TypeListEntry_t<0, TypeList>::Element>, │ │ │ │ +396 public Impl::ChildAccessMixIn> │ │ │ │ +397 { │ │ │ │ +398 public: │ │ │ │ +399 │ │ │ │ +400 // Begin of node interface │ │ │ │ +401 │ │ │ │ +_4_0_2 static constexpr auto _d_e_g_r_e_e() │ │ │ │ +403 { │ │ │ │ +404 return Dune::index_constant{}; │ │ │ │ +405 } │ │ │ │ +406 │ │ │ │ +407 template │ │ │ │ +_4_0_8 const auto& _c_h_i_l_d(Dune::index_constant ii) const │ │ │ │ +409 { │ │ │ │ +410 return children_[ii].value(); │ │ │ │ +411 } │ │ │ │ +412 │ │ │ │ +413 template │ │ │ │ +_4_1_4 auto& _c_h_i_l_d(Dune::index_constant ii) │ │ │ │ +415 { │ │ │ │ +416 return children_[ii].value(); │ │ │ │ +417 } │ │ │ │ +418 │ │ │ │ +419 using Impl::ChildAccessMixIn<_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e>_:_:_c_h_i_l_d; │ │ │ │ 420 │ │ │ │ -421 // Compute the geometric transformation from knotspan-local to global │ │ │ │ -coordinates │ │ │ │ -422 _l_o_c_a_l_B_a_s_i_s__.offset_[i] = _p_r_e_B_a_s_i_s__.knotVectors_[i][_c_u_r_r_e_n_t_K_n_o_t_S_p_a_n__[i]]; │ │ │ │ -423 _l_o_c_a_l_B_a_s_i_s__.scaling_[i][i] = _p_r_e_B_a_s_i_s__.knotVectors_[i][_c_u_r_r_e_n_t_K_n_o_t_S_p_a_n__ │ │ │ │ -[i]+1] - _p_r_e_B_a_s_i_s__.knotVectors_[i][_c_u_r_r_e_n_t_K_n_o_t_S_p_a_n__[i]]; │ │ │ │ -424 } │ │ │ │ -425 │ │ │ │ -426 // Set up the LocalCoefficients object │ │ │ │ -427 std::array sizes; │ │ │ │ -428 for (size_t i=0; i& _l_o_c_a_l_B_a_s_i_s() const │ │ │ │ -435 { │ │ │ │ -436 return _l_o_c_a_l_B_a_s_i_s__; │ │ │ │ -437 } │ │ │ │ +421 // Historic node interface │ │ │ │ +422 │ │ │ │ +423 using ChildTypes [[deprecated]] = std::tuple; │ │ │ │ +424 │ │ │ │ +_4_2_5 static const bool _i_s_L_e_a_f [[deprecated]] = false; │ │ │ │ +_4_2_6 static const bool _i_s_P_o_w_e_r [[deprecated]] = false; │ │ │ │ +_4_2_7 static const bool _i_s_C_o_m_p_o_s_i_t_e [[deprecated]] = true; │ │ │ │ +428#ifdef HAVE_DUNE_TYPETREE │ │ │ │ +429 using NodeTag [[deprecated]] = Dune::TypeTree::CompositeNodeTag; │ │ │ │ +430#endif │ │ │ │ +431 │ │ │ │ +432 template │ │ │ │ +_4_3_3 struct [[deprecated]] _C_h_i_l_d { │ │ │ │ +434 static_assert((k < _d_e_g_r_e_e()), "child index out of range"); │ │ │ │ +435 │ │ │ │ +_4_3_7 using _T_y_p_e = typename std::tuple_element_t>; │ │ │ │ 438 │ │ │ │ -_4_4_0 const _B_S_p_l_i_n_e_L_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s_<_d_i_m_>& _l_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s() const │ │ │ │ -441 { │ │ │ │ -442 return _l_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s__; │ │ │ │ -443 } │ │ │ │ -444 │ │ │ │ -_4_4_6 const _B_S_p_l_i_n_e_L_o_c_a_l_I_n_t_e_r_p_o_l_a_t_i_o_n_<_d_i_m_,_B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s_<_G_V_,_R_> >& │ │ │ │ -_l_o_c_a_l_I_n_t_e_r_p_o_l_a_t_i_o_n() const │ │ │ │ -447 { │ │ │ │ -448 return _l_o_c_a_l_I_n_t_e_r_p_o_l_a_t_i_o_n__; │ │ │ │ -449 } │ │ │ │ -450 │ │ │ │ -_4_5_2 unsigned _s_i_z_e () const │ │ │ │ +_4_3_9 using _t_y_p_e = _T_y_p_e; │ │ │ │ +440 }; │ │ │ │ +441 │ │ │ │ +442 // End of node interface │ │ │ │ +443 │ │ │ │ +_4_4_4 using _E_l_e_m_e_n_t = typename std::tuple_element_t<0, std::tuple>_:_: │ │ │ │ +_E_l_e_m_e_n_t; │ │ │ │ +445 │ │ │ │ +_4_4_6 _C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e() = default; │ │ │ │ +447 │ │ │ │ +_4_4_8 explicit _C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e(const T&... children) : │ │ │ │ +449 children_(children...) │ │ │ │ +450 {} │ │ │ │ +451 │ │ │ │ +_4_5_2 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ 453 { │ │ │ │ -454 std::size_t r = 1; │ │ │ │ -455 for (int i=0; i │ │ │ │ +_4_5_8 void _s_e_t_C_h_i_l_d (TT&& t, Dune::index_constant ii = {}) │ │ │ │ +459 { │ │ │ │ +460 children_[ii].emplace(std::forward(t)); │ │ │ │ +461 } │ │ │ │ +462 │ │ │ │ +463 private: │ │ │ │ +464 Dune::TupleVector...> children_; │ │ │ │ +465 }; │ │ │ │ 466 │ │ │ │ -467//private: │ │ │ │ -468 │ │ │ │ -_4_7_0 unsigned int _s_i_z_e(int i) const │ │ │ │ -471 { │ │ │ │ -472 const auto& order = _p_r_e_B_a_s_i_s__.order_; │ │ │ │ -473 unsigned int r = order[i]+1; // The 'normal' value │ │ │ │ -474 if (_c_u_r_r_e_n_t_K_n_o_t_S_p_a_n__[i] (_p_r_e_B_a_s_i_s__.knotVectors_[i].size() - _c_u_r_r_e_n_t_K_n_o_t_S_p_a_n__[i] - │ │ │ │ -2) ) │ │ │ │ -477 r -= order[i] - (_p_r_e_B_a_s_i_s__.knotVectors_[i].size() - _c_u_r_r_e_n_t_K_n_o_t_S_p_a_n__[i] - │ │ │ │ -2); │ │ │ │ -478 return r; │ │ │ │ -479 } │ │ │ │ -480 │ │ │ │ -_4_8_1 const _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_<_G_V_>& _p_r_e_B_a_s_i_s__; │ │ │ │ -482 │ │ │ │ -_4_8_3 _B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s_<_G_V_,_R_> _l_o_c_a_l_B_a_s_i_s__; │ │ │ │ -_4_8_4 _B_S_p_l_i_n_e_L_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s_<_d_i_m_> _l_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s__; │ │ │ │ -_4_8_5 _B_S_p_l_i_n_e_L_o_c_a_l_I_n_t_e_r_p_o_l_a_t_i_o_n_<_d_i_m_,_B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s_<_G_V_,_R_> > │ │ │ │ -_l_o_c_a_l_I_n_t_e_r_p_o_l_a_t_i_o_n__; │ │ │ │ +467 │ │ │ │ +468 template │ │ │ │ +_4_6_9 void _b_i_n_d_T_r_e_e(Tree& tree, const Entity& entity, std::size_t offset = 0) │ │ │ │ +470 { │ │ │ │ +471 Impl::BasisNodeSetupHelper::setOffset(tree, offset); │ │ │ │ +472 tree.bind(entity); │ │ │ │ +473 } │ │ │ │ +474 │ │ │ │ +475 template │ │ │ │ +_4_7_6 void _i_n_i_t_i_a_l_i_z_e_T_r_e_e(Tree& tree, std::size_t treeIndexOffset = 0) │ │ │ │ +477 { │ │ │ │ +478 Dune::TypeTree::forEachNode(tree, [&](auto& node, const auto& treePath) { │ │ │ │ +479 Impl::BasisNodeSetupHelper::setTreeIndex(node, treeIndexOffset); │ │ │ │ +480 ++treeIndexOffset; │ │ │ │ +481 }); │ │ │ │ +482 } │ │ │ │ +483 │ │ │ │ +484 │ │ │ │ +485 } // namespace Functions │ │ │ │ 486 │ │ │ │ -487 // The knot span we are bound to │ │ │ │ -_4_8_8 std::array _c_u_r_r_e_n_t_K_n_o_t_S_p_a_n__; │ │ │ │ -489}; │ │ │ │ -490 │ │ │ │ -491 │ │ │ │ -492template │ │ │ │ -493class _B_S_p_l_i_n_e_N_o_d_e; │ │ │ │ -494 │ │ │ │ -504template │ │ │ │ -_5_0_5class _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s : │ │ │ │ -506 public _L_e_a_f_P_r_e_B_a_s_i_s_M_i_x_i_n< BSplinePreBasis > │ │ │ │ -507{ │ │ │ │ -508 using Base = _L_e_a_f_P_r_e_B_a_s_i_s_M_i_x_i_n_<_ _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_<_G_V_> >; │ │ │ │ -509 │ │ │ │ -510 static const int dim = GV::dimension; │ │ │ │ -511 │ │ │ │ -513 class MultiDigitCounter │ │ │ │ -514 { │ │ │ │ -515 public: │ │ │ │ -516 │ │ │ │ -520 MultiDigitCounter(const std::array& limits) │ │ │ │ -521 : limits_(limits) │ │ │ │ -522 { │ │ │ │ -523 std::fill(counter_.begin(), counter_.end(), 0); │ │ │ │ -524 } │ │ │ │ -525 │ │ │ │ -527 MultiDigitCounter& operator++() │ │ │ │ -528 { │ │ │ │ -529 for (int i=0; i limits_; │ │ │ │ -561 │ │ │ │ -563 std::array counter_; │ │ │ │ -564 │ │ │ │ -565 }; │ │ │ │ -566 │ │ │ │ -567public: │ │ │ │ -568 │ │ │ │ -_5_7_0 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ -_5_7_1 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ -572 │ │ │ │ -_5_7_3 using _N_o_d_e = _B_S_p_l_i_n_e_N_o_d_e_<_G_V_>; │ │ │ │ -574 │ │ │ │ -575 // Type used for function values │ │ │ │ -_5_7_6 using _R = double; │ │ │ │ -577 │ │ │ │ -_5_9_7 _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s(const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w, │ │ │ │ -598 const std::vector& knotVector, │ │ │ │ -599 unsigned int order, │ │ │ │ -600 bool makeOpen = true) │ │ │ │ -601 : _g_r_i_d_V_i_e_w__(_g_r_i_d_V_i_e_w) │ │ │ │ -602 { │ │ │ │ -603 // \todo Detection of duplicate knots │ │ │ │ -604 std::fill(_e_l_e_m_e_n_t_s__.begin(), _e_l_e_m_e_n_t_s__.end(), knotVector.size()-1); │ │ │ │ -605 │ │ │ │ -606 // Mediocre sanity check: we don't know the number of grid elements in each │ │ │ │ -direction. │ │ │ │ -607 // but at least we know the total number of elements. │ │ │ │ -608 assert( std::accumulate(_e_l_e_m_e_n_t_s__.begin(), _e_l_e_m_e_n_t_s__.end(), 1, std:: │ │ │ │ -multiplies()) == _g_r_i_d_V_i_e_w__.size(0) ); │ │ │ │ -609 │ │ │ │ -610 for (int i=0; i& lowerLeft, │ │ │ │ -651 const FieldVector& upperRight, │ │ │ │ -652 const std::array& elements, │ │ │ │ -653 unsigned int order, │ │ │ │ -654 bool makeOpen = true) │ │ │ │ -655 : _e_l_e_m_e_n_t_s__(elements), │ │ │ │ -656 _g_r_i_d_V_i_e_w__(_g_r_i_d_V_i_e_w) │ │ │ │ -657 { │ │ │ │ -658 // Mediocre sanity check: we don't know the number of grid elements in each │ │ │ │ -direction. │ │ │ │ -659 // but at least we know the total number of elements. │ │ │ │ -660 assert( std::accumulate(_e_l_e_m_e_n_t_s__.begin(), _e_l_e_m_e_n_t_s__.end(), 1, std:: │ │ │ │ -multiplies()) == _g_r_i_d_V_i_e_w__.size(0) ); │ │ │ │ -661 │ │ │ │ -662 for (int i=0; i │ │ │ │ -_7_1_7 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ -718 { │ │ │ │ -719 // Local degrees of freedom are arranged in a lattice. │ │ │ │ -720 // We need the lattice dimensions to be able to compute lattice coordinates │ │ │ │ -from a local index │ │ │ │ -721 std::array localSizes; │ │ │ │ -722 for (int i=0; i localIJK = _g_e_t_I_J_K(i, localSizes); │ │ │ │ -727 │ │ │ │ -728 const auto currentKnotSpan = node._f_i_n_i_t_e_E_l_e_m_e_n_t()._c_u_r_r_e_n_t_K_n_o_t_S_p_a_n__; │ │ │ │ -729 const auto order = _o_r_d_e_r__; │ │ │ │ -730 │ │ │ │ -731 std::array globalIJK; │ │ │ │ -732 for (int i=0; i=0; i--) │ │ │ │ -739 globalIdx = globalIdx * _s_i_z_e(i) + globalIJK[i]; │ │ │ │ -740 │ │ │ │ -741 *it = {{globalIdx}}; │ │ │ │ -742 } │ │ │ │ -743 return it; │ │ │ │ -744 } │ │ │ │ -745 │ │ │ │ -_7_4_7 unsigned int _d_i_m_e_n_s_i_o_n () const │ │ │ │ -748 { │ │ │ │ -749 unsigned int result = 1; │ │ │ │ -750 for (size_t i=0; i& in, │ │ │ │ -766 std::vector >& out, │ │ │ │ -767 const std::array& currentKnotSpan) const │ │ │ │ -768 { │ │ │ │ -769 // Evaluate │ │ │ │ -770 std::array, dim> oneDValues; │ │ │ │ -771 │ │ │ │ -772 for (size_t i=0; i limits; │ │ │ │ -776 for (int i=0; i& in, │ │ │ │ -797 std::vector >& out, │ │ │ │ -798 const std::array& currentKnotSpan) const │ │ │ │ -799 { │ │ │ │ -800 // How many shape functions to we have in each coordinate direction? │ │ │ │ -801 std::array limits; │ │ │ │ -802 for (int i=0; i (_k_n_o_t_V_e_c_t_o_r_s__[i]._s_i_z_e() - currentKnotSpan[i] - 2) ) │ │ │ │ -808 limits[i] -= _o_r_d_e_r__[i] - (_k_n_o_t_V_e_c_t_o_r_s__[i].size() - currentKnotSpan[i] - 2); │ │ │ │ -809 } │ │ │ │ -810 │ │ │ │ -811 // The lowest knot spans that we need values from │ │ │ │ -812 std::array offset; │ │ │ │ -813 for (int i=0; i, dim> oneDValues; │ │ │ │ -818 │ │ │ │ -819 // Evaluate 1d function values of one order lower (needed for the │ │ │ │ -derivative formula) │ │ │ │ -820 std::array, dim> lowOrderOneDValues; │ │ │ │ -821 │ │ │ │ -822 std::array, dim> values; │ │ │ │ -823 │ │ │ │ -824 for (size_t i=0; i, dim> oneDDerivatives; │ │ │ │ -842 for (size_t i=0; i, dim> oneDValuesShort; │ │ │ │ -867 │ │ │ │ -868 for (int i=0; i │ │ │ │ -_8_9_7 void _e_v_a_l_u_a_t_e(const typename std::array& directions, │ │ │ │ -898 const FieldVector& in, │ │ │ │ -899 std::vector >& out, │ │ │ │ -900 const std::array& currentKnotSpan) const │ │ │ │ -901 { │ │ │ │ -902 if (k != 1 && k != 2) │ │ │ │ -903 DUNE_THROW(RangeError, "Differentiation order greater than 2 is not │ │ │ │ -supported!"); │ │ │ │ -904 │ │ │ │ -905 // Evaluate 1d function values (needed for the product rule) │ │ │ │ -906 std::array, dim> oneDValues; │ │ │ │ -907 std::array, dim> oneDDerivatives; │ │ │ │ -908 std::array, dim> oneDSecondDerivatives; │ │ │ │ -909 │ │ │ │ -910 // Evaluate 1d function derivatives │ │ │ │ -911 if (k==1) │ │ │ │ -912 for (size_t i=0; i offset; │ │ │ │ -920 for (int i=0; i limits; │ │ │ │ -925 for (int i=0; i (_k_n_o_t_V_e_c_t_o_r_s__[i]._s_i_z_e() - currentKnotSpan[i] - 2) ) │ │ │ │ -933 limits[i] -= _o_r_d_e_r__[i] - (_k_n_o_t_V_e_c_t_o_r_s__[i].size() - currentKnotSpan[i] - 2); │ │ │ │ -934 } │ │ │ │ -935 │ │ │ │ -936 // Working towards computing only the parts that we really need: │ │ │ │ -937 // Let's copy them out into a separate array │ │ │ │ -938 std::array, dim> oneDValuesShort; │ │ │ │ -939 │ │ │ │ -940 for (int i=0; i _g_e_t_I_J_K(typename GridView::IndexSet:: │ │ │ │ -IndexType idx, std::array elements) │ │ │ │ -994 { │ │ │ │ -995 std::array result; │ │ │ │ -996 for (int i=0; i& out, │ │ │ │ -1013 const std::vector& knotVector, │ │ │ │ -1014 unsigned int order, │ │ │ │ -1015 unsigned int currentKnotSpan) │ │ │ │ -1016 { │ │ │ │ -1017 std::size_t outSize = order+1; // The 'standard' value away from the │ │ │ │ -boundaries of the knot vector │ │ │ │ -1018 if (currentKnotSpan (knotVector.size() - currentKnotSpan - 2) ) │ │ │ │ -1021 outSize -= order - (knotVector.size() - currentKnotSpan - 2); │ │ │ │ -1022 out.resize(outSize); │ │ │ │ -1023 │ │ │ │ -1024 // It's not really a matrix that is needed here, a plain 2d array would do │ │ │ │ -1025 DynamicMatrix N(order+1, knotVector.size()-1); │ │ │ │ -1026 │ │ │ │ -1027 // The text books on splines use the following geometric condition here to │ │ │ │ -fill the array N │ │ │ │ -1028 // (see for example Cottrell, Hughes, Bazilevs, Formula (2.1). However, │ │ │ │ -this condition │ │ │ │ -1029 // only works if splines are never evaluated exactly on the knots. │ │ │ │ -1030 // │ │ │ │ -1031 // for (size_t i=0; i 1e-10) │ │ │ │ -1040 ? (in - knotVector[i]) / (knotVector[i+r] - knotVector[i]) │ │ │ │ -1041 : 0; │ │ │ │ -1042 _R factor2 = ((knotVector[i+r+1] - knotVector[i+1]) > 1e-10) │ │ │ │ -1043 ? (knotVector[i+r+1] - in) / (knotVector[i+r+1] - knotVector[i+1]) │ │ │ │ -1044 : 0; │ │ │ │ -1045 N[r][i] = factor1 * N[r-1][i] + factor2 * N[r-1][i+1]; │ │ │ │ -1046 } │ │ │ │ -1047 │ │ │ │ -1052 for (size_t i=0; i& out, │ │ │ │ -1071 const std::vector& knotVector, │ │ │ │ -1072 unsigned int order, │ │ │ │ -1073 unsigned int currentKnotSpan) │ │ │ │ -1074 { │ │ │ │ -1075 // It's not really a matrix that is needed here, a plain 2d array would do │ │ │ │ -1076 DynamicMatrix& N = out; │ │ │ │ -1077 │ │ │ │ -1078 N.resize(order+1, knotVector.size()-1); │ │ │ │ -1079 │ │ │ │ -1080 // The text books on splines use the following geometric condition here to │ │ │ │ -fill the array N │ │ │ │ -1081 // (see for example Cottrell, Hughes, Bazilevs, Formula (2.1). However, │ │ │ │ -this condition │ │ │ │ -1082 // only works if splines are never evaluated exactly on the knots. │ │ │ │ -1083 // │ │ │ │ -1084 // for (size_t i=0; i 1e-10) │ │ │ │ -1093 ? (in - knotVector[i]) / (knotVector[i+r] - knotVector[i]) │ │ │ │ -1094 : 0; │ │ │ │ -1095 _R factor2 = ((knotVector[i+r+1] - knotVector[i+1]) > 1e-10) │ │ │ │ -1096 ? (knotVector[i+r+1] - in) / (knotVector[i+r+1] - knotVector[i+1]) │ │ │ │ -1097 : 0; │ │ │ │ -1098 N[r][i] = factor1 * N[r-1][i] + factor2 * N[r-1][i+1]; │ │ │ │ -1099 } │ │ │ │ -1100 } │ │ │ │ -1101 │ │ │ │ -1102 │ │ │ │ -1110 │ │ │ │ -_1_1_1_1 static void _e_v_a_l_u_a_t_e_A_l_l(const typename GV::ctype& in, │ │ │ │ -1112 std::vector& out, │ │ │ │ -1113 bool _e_v_a_l_u_a_t_e_J_a_c_o_b_i_a_n, std::vector& outJac, │ │ │ │ -1114 bool evaluateHessian, std::vector& outHess, │ │ │ │ -1115 const std::vector& knotVector, │ │ │ │ -1116 unsigned int order, │ │ │ │ -1117 unsigned int currentKnotSpan) │ │ │ │ -1118 { │ │ │ │ -1119 // How many shape functions to we have in each coordinate direction? │ │ │ │ -1120 unsigned int limit; │ │ │ │ -1121 limit = order+1; // The 'standard' value away from the boundaries of the │ │ │ │ -knot vector │ │ │ │ -1122 if (currentKnotSpan (knotVector.size() - currentKnotSpan - 2) ) │ │ │ │ -1125 limit -= order - (knotVector.size() - currentKnotSpan - 2); │ │ │ │ -1126 │ │ │ │ -1127 // The lowest knot spans that we need values from │ │ │ │ -1128 unsigned int offset; │ │ │ │ -1129 offset = std::max((int)(currentKnotSpan - order),0); │ │ │ │ -1130 │ │ │ │ -1131 // Evaluate 1d function values (needed for the product rule) │ │ │ │ -1132 DynamicMatrix values; │ │ │ │ -1133 │ │ │ │ -1134 _e_v_a_l_u_a_t_e_F_u_n_c_t_i_o_n_F_u_l_l(in, values, knotVector, order, currentKnotSpan); │ │ │ │ -1135 │ │ │ │ -1136 out.resize(knotVector.size()-order-1); │ │ │ │ -1137 for (size_t j=0; j lowOrderOneDValues; │ │ │ │ -1142 │ │ │ │ -1143 if (order!=0) │ │ │ │ -1144 { │ │ │ │ -1145 lowOrderOneDValues.resize(knotVector.size()-(order-1)-1); │ │ │ │ -1146 for (size_t j=0; j lowOrderTwoDValues; │ │ │ │ -1152 │ │ │ │ -1153 if (order>1 && evaluateHessian) │ │ │ │ -1154 { │ │ │ │ -1155 lowOrderTwoDValues.resize(knotVector.size()-(order-2)-1); │ │ │ │ -1156 for (size_t j=0; j _o_r_d_e_r__; │ │ │ │ -1218 │ │ │ │ -_1_2_2_0 std::array, dim> _k_n_o_t_V_e_c_t_o_r_s__; │ │ │ │ -1221 │ │ │ │ -_1_2_2_3 std::array _e_l_e_m_e_n_t_s__; │ │ │ │ -1224 │ │ │ │ -_1_2_2_5 _G_r_i_d_V_i_e_w _g_r_i_d_V_i_e_w__; │ │ │ │ -1226}; │ │ │ │ -1227 │ │ │ │ -1228 │ │ │ │ -1229 │ │ │ │ -1230template │ │ │ │ -_1_2_3_1class _B_S_p_l_i_n_e_N_o_d_e : │ │ │ │ -1232 public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ -1233{ │ │ │ │ -1234 static const int dim = GV::dimension; │ │ │ │ -1235 │ │ │ │ -1236public: │ │ │ │ -1237 │ │ │ │ -_1_2_3_8 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ -_1_2_3_9 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ -_1_2_4_0 using _F_i_n_i_t_e_E_l_e_m_e_n_t = _B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_G_V_,_d_o_u_b_l_e_>; │ │ │ │ -1241 │ │ │ │ -_1_2_4_2 _B_S_p_l_i_n_e_N_o_d_e(const _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_<_G_V_>* preBasis) : │ │ │ │ -1243 _p_r_e_B_a_s_i_s__(preBasis), │ │ │ │ -1244 _f_i_n_i_t_e_E_l_e_m_e_n_t__(*preBasis) │ │ │ │ -1245 {} │ │ │ │ -1246 │ │ │ │ -_1_2_4_8 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ -1249 { │ │ │ │ -1250 return _e_l_e_m_e_n_t__; │ │ │ │ -1251 } │ │ │ │ -1252 │ │ │ │ -_1_2_5_7 const _F_i_n_i_t_e_E_l_e_m_e_n_t& _f_i_n_i_t_e_E_l_e_m_e_n_t() const │ │ │ │ -1258 { │ │ │ │ -1259 return _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ -1260 } │ │ │ │ -1261 │ │ │ │ -_1_2_6_3 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ -1264 { │ │ │ │ -1265 _e_l_e_m_e_n_t__ = e; │ │ │ │ -1266 auto elementIndex = _p_r_e_B_a_s_i_s__->gridView().indexSet().index(e); │ │ │ │ -1267 _f_i_n_i_t_e_E_l_e_m_e_n_t__.bind(_p_r_e_B_a_s_i_s__->getIJK(elementIndex,_p_r_e_B_a_s_i_s__->elements_)); │ │ │ │ -1268 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__.size()); │ │ │ │ -1269 } │ │ │ │ -1270 │ │ │ │ -1271protected: │ │ │ │ -1272 │ │ │ │ -_1_2_7_3 const _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_<_G_V_>* _p_r_e_B_a_s_i_s__; │ │ │ │ -1274 │ │ │ │ -_1_2_7_5 _F_i_n_i_t_e_E_l_e_m_e_n_t _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ -_1_2_7_6 _E_l_e_m_e_n_t _e_l_e_m_e_n_t__; │ │ │ │ -1277}; │ │ │ │ -1278 │ │ │ │ -1279 │ │ │ │ -1280 │ │ │ │ -1281namespace _B_a_s_i_s_F_a_c_t_o_r_y { │ │ │ │ -1282 │ │ │ │ -_1_2_8_9inline auto _b_S_p_l_i_n_e(const std::vector& knotVector, │ │ │ │ -1290 unsigned int order, │ │ │ │ -1291 bool makeOpen = true) │ │ │ │ -1292{ │ │ │ │ -1293 return [&knotVector, order, makeOpen](const auto& gridView) { │ │ │ │ -1294 return _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s>(gridView, │ │ │ │ -knotVector, order, makeOpen); │ │ │ │ -1295 }; │ │ │ │ -1296} │ │ │ │ -1297 │ │ │ │ -1298} // end namespace BasisFactory │ │ │ │ -1299 │ │ │ │ -1300/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -1301// This is the actual global basis implementation based on the reusable │ │ │ │ -parts. │ │ │ │ -1302/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -1303 │ │ │ │ -1310template │ │ │ │ -_1_3_1_1using _B_S_p_l_i_n_e_B_a_s_i_s = _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_<_G_V_> >; │ │ │ │ -1312 │ │ │ │ -1313 │ │ │ │ -1314} // namespace Functions │ │ │ │ -1315 │ │ │ │ -1316} // namespace Dune │ │ │ │ -1317 │ │ │ │ -1318#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BSPLINEBASIS_HH │ │ │ │ -_n_o_d_e_s_._h_h │ │ │ │ -_l_e_a_f_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h │ │ │ │ -_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_b_S_p_l_i_n_e │ │ │ │ -auto bSpline(const std::vector< double > &knotVector, unsigned int order, bool │ │ │ │ -makeOpen=true) │ │ │ │ -Create a pre-basis factory that can create a B-spline pre-basis. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:1289 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_B_a_s_i_s │ │ │ │ -DefaultGlobalBasis< BSplinePreBasis< GV > > BSplineBasis │ │ │ │ -A global B-spline basis. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:1311 │ │ │ │ +487} // namespace Dune │ │ │ │ +488 │ │ │ │ +489#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:926 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ -LocalFiniteElement in the sense of dune-localfunctions, for the B-spline basis │ │ │ │ -on tensor-product grid... │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:369 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ -BSplineLocalFiniteElement(const BSplineLocalFiniteElement &other) │ │ │ │ -Copy constructor. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:390 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_ _G_V_,_ _d_o_u_b_l_e_ _>_:_:_p_r_e_B_a_s_i_s__ │ │ │ │ -const BSplinePreBasis< GV > & preBasis_ │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:481 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_:_:_l_o_c_a_l_I_n_t_e_r_p_o_l_a_t_i_o_n │ │ │ │ -const BSplineLocalInterpolation< dim, BSplineLocalBasis< GV, R > > & │ │ │ │ -localInterpolation() const │ │ │ │ -Hand out a LocalInterpolation object. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:446 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_:_:_T_r_a_i_t_s │ │ │ │ -LocalFiniteElementTraits< BSplineLocalBasis< GV, R >, BSplineLocalCoefficients< │ │ │ │ -dim >, BSplineLocalInterpolation< dim, BSplineLocalBasis< GV, R > > > Traits │ │ │ │ -Export various types related to this LocalFiniteElement. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:379 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_ _G_V_,_ _d_o_u_b_l_e_ _>_:_:_c_u_r_r_e_n_t_K_n_o_t_S_p_a_n__ │ │ │ │ -std::array< unsigned, dim > currentKnotSpan_ │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:488 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ -BSplineLocalFiniteElement(const BSplinePreBasis< GV > &preBasis) │ │ │ │ -Constructor with a given B-spline basis. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:383 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_:_:_l_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s │ │ │ │ -const BSplineLocalCoefficients< dim > & localCoefficients() const │ │ │ │ -Hand out a LocalCoefficients object. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:440 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_:_:_b_i_n_d │ │ │ │ -void bind(const std::array< unsigned, dim > &elementIdx) │ │ │ │ -Bind LocalFiniteElement to a specific knot span of the spline patch. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:401 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_ _G_V_,_ _d_o_u_b_l_e_ _>_:_:_l_o_c_a_l_I_n_t_e_r_p_o_l_a_t_i_o_n__ │ │ │ │ -BSplineLocalInterpolation< dim, BSplineLocalBasis< GV, double > > │ │ │ │ -localInterpolation_ │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:485 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_:_:_t_y_p_e │ │ │ │ -GeometryType type() const │ │ │ │ -Return the reference element that the local finite element is defined on (here, │ │ │ │ -a hypercube). │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:462 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_:_:_s_i_z_e │ │ │ │ -unsigned size() const │ │ │ │ -Number of shape functions in this finite element. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:452 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_ _G_V_,_ _d_o_u_b_l_e_ _>_:_:_l_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s__ │ │ │ │ -BSplineLocalCoefficients< dim > localCoefficients_ │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:484 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_:_:_s_i_z_e │ │ │ │ -unsigned int size(int i) const │ │ │ │ -Number of degrees of freedom for one coordinate direction. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:470 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_ _G_V_,_ _d_o_u_b_l_e_ _>_:_:_l_o_c_a_l_B_a_s_i_s__ │ │ │ │ -BSplineLocalBasis< GV, double > localBasis_ │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:483 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_:_:_l_o_c_a_l_B_a_s_i_s │ │ │ │ -const BSplineLocalBasis< GV, R > & localBasis() const │ │ │ │ -Hand out a LocalBasis object. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:434 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s │ │ │ │ -Pre-basis for B-spline basis. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:507 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_e_l_e_m_e_n_t_s__ │ │ │ │ -std::array< unsigned, dim > elements_ │ │ │ │ -Number of grid elements in the different coordinate directions. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:1223 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_g_r_i_d_V_i_e_w__ │ │ │ │ -GridView gridView_ │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:1225 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_R │ │ │ │ -double R │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:576 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_e_v_a_l_u_a_t_e_F_u_n_c_t_i_o_n_F_u_l_l │ │ │ │ -static void evaluateFunctionFull(const typename GV::ctype &in, DynamicMatrix< R │ │ │ │ -> &out, const std::vector< R > &knotVector, unsigned int order, unsigned int │ │ │ │ -currentKnotSpan) │ │ │ │ -Evaluate all one-dimensional B-spline functions for a given coordinate │ │ │ │ -direction. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:1069 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_e_v_a_l_u_a_t_e_F_u_n_c_t_i_o_n │ │ │ │ -void evaluateFunction(const FieldVector< typename GV::ctype, dim > &in, std:: │ │ │ │ -vector< FieldVector< R, 1 > > &out, const std::array< unsigned, dim > │ │ │ │ -¤tKnotSpan) const │ │ │ │ -Evaluate all B-spline basis functions at a given point. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:765 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_o_r_d_e_r__ │ │ │ │ -std::array< unsigned int, dim > order_ │ │ │ │ -Order of the B-spline for each space dimension. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:1217 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_e_v_a_l_u_a_t_e_A_l_l │ │ │ │ -static void evaluateAll(const typename GV::ctype &in, std::vector< R > &out, │ │ │ │ -bool evaluateJacobian, std::vector< R > &outJac, bool evaluateHessian, std:: │ │ │ │ -vector< R > &outHess, const std::vector< R > &knotVector, unsigned int order, │ │ │ │ -unsigned int currentKnotSpan) │ │ │ │ -Evaluate the second derivatives of all one-dimensional B-spline functions for a │ │ │ │ -given coordinate dire... │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:1111 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_e_v_a_l_u_a_t_e_F_u_n_c_t_i_o_n │ │ │ │ -static void evaluateFunction(const typename GV::ctype &in, std::vector< R > │ │ │ │ -&out, const std::vector< R > &knotVector, unsigned int order, unsigned int │ │ │ │ -currentKnotSpan) │ │ │ │ -Evaluate all one-dimensional B-spline functions for a given coordinate │ │ │ │ -direction. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:1012 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ -unsigned int size(size_t d) const │ │ │ │ -Number of shape functions in one direction. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:756 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ -GV GridView │ │ │ │ -The grid view that the FE space is defined on. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:570 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_i_n_d_i_c_e_s │ │ │ │ -It indices(const Node &node, It it) const │ │ │ │ -Maps from subtree index set [0..size-1] to a globally unique multi index in │ │ │ │ -global basis. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:717 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_e_v_a_l_u_a_t_e │ │ │ │ -void evaluate(const typename std::array< int, k > &directions, const │ │ │ │ -FieldVector< typename GV::ctype, dim > &in, std::vector< FieldVector< R, 1 > > │ │ │ │ -&out, const std::array< unsigned, dim > ¤tKnotSpan) const │ │ │ │ -Evaluate Derivatives of all B-spline basis functions. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:897 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:571 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_u_p_d_a_t_e │ │ │ │ -void update(const GridView &gv) │ │ │ │ -Update the stored grid view, to be called if the grid has changed. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:693 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ -unsigned int dimension() const │ │ │ │ -Total number of B-spline basis functions. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:747 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ -void initializeIndices() │ │ │ │ -Initialize the global indices. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:683 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_N_o_d_e │ │ │ │ -BSplineNode< GV > Node │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:573 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_g_r_i_d_V_i_e_w │ │ │ │ -const GridView & gridView() const │ │ │ │ -Obtain the grid view that the basis is defined on. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:687 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_g_e_t_I_J_K │ │ │ │ -static std::array< unsigned int, dim > getIJK(typename GridView::IndexSet:: │ │ │ │ -IndexType idx, std::array< unsigned int, dim > elements) │ │ │ │ -Compute integer element coordinates from the element index. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:993 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_m_a_k_e_N_o_d_e │ │ │ │ -Node makeNode() const │ │ │ │ -Create tree node. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:701 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s │ │ │ │ -BSplinePreBasis(const GridView &gridView, const std::vector< double > │ │ │ │ -&knotVector, unsigned int order, bool makeOpen=true) │ │ │ │ -Construct a B-spline basis for a given grid view and set of knot vectors. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:597 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_e_v_a_l_u_a_t_e_J_a_c_o_b_i_a_n │ │ │ │ -void evaluateJacobian(const FieldVector< typename GV::ctype, dim > &in, std:: │ │ │ │ -vector< FieldMatrix< R, 1, dim > > &out, const std::array< unsigned, dim > │ │ │ │ -¤tKnotSpan) const │ │ │ │ -Evaluate Jacobian of all B-spline basis functions. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:796 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_k_n_o_t_V_e_c_t_o_r_s__ │ │ │ │ -std::array< std::vector< double >, dim > knotVectors_ │ │ │ │ -The knot vectors, one for each space dimension. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:1220 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ -size_type size() const │ │ │ │ -Get the total dimension of the space spanned by this basis. │ │ │ │ -DDeeffiinniittiioonn leafprebasismixin.hh:60 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_m_a_x_N_o_d_e_S_i_z_e │ │ │ │ -size_type maxNodeSize() const │ │ │ │ -Get the maximal number of DOFs associated to node for any element. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:707 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_:_:_B_S_p_l_i_n_e_P_r_e_B_a_s_i_s │ │ │ │ -BSplinePreBasis(const GridView &gridView, const FieldVector< double, dim > │ │ │ │ -&lowerLeft, const FieldVector< double, dim > &upperRight, const std::array< │ │ │ │ -unsigned int, dim > &elements, unsigned int order, bool makeOpen=true) │ │ │ │ -Construct a B-spline basis for a given grid view with uniform knot vectors. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:649 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s │ │ │ │ -LocalBasis class in the sense of dune-localfunctions, presenting the │ │ │ │ -restriction of a B-spline patch ... │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:51 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s_:_:_T_r_a_i_t_s │ │ │ │ -LocalBasisTraits< D, dim, FieldVector< D, dim >, R, 1, FieldVector< R, 1 >, │ │ │ │ -FieldMatrix< R, 1, dim > > Traits │ │ │ │ -export type traits for function signature │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:60 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s_:_:_o_r_d_e_r │ │ │ │ -unsigned int order() const │ │ │ │ -Polynomial order of the shape functions. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:147 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ -std::size_t size() const │ │ │ │ -Return the number of basis functions on the current knot span. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:154 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s_:_:_e_v_a_l_u_a_t_e │ │ │ │ -void evaluate(const typename std::array< int, k > &directions, const typename │ │ │ │ -Traits::DomainType &in, std::vector< typename Traits::RangeType > &out) const │ │ │ │ -Evaluate all shape functions and derivatives of any order. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:104 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s_:_:_e_v_a_l_u_a_t_e_F_u_n_c_t_i_o_n │ │ │ │ -void evaluateFunction(const FieldVector< D, dim > &in, std::vector< │ │ │ │ -FieldVector< R, 1 > > &out) const │ │ │ │ -Evaluate all shape functions. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:76 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s_:_:_e_v_a_l_u_a_t_e_J_a_c_o_b_i_a_n │ │ │ │ -void evaluateJacobian(const FieldVector< D, dim > &in, std::vector< │ │ │ │ -FieldMatrix< D, 1, dim > > &out) const │ │ │ │ -Evaluate Jacobian of all shape functions. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:89 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s │ │ │ │ -BSplineLocalBasis(const BSplinePreBasis< GV > &preBasis, const │ │ │ │ -BSplineLocalFiniteElement< GV, R > &lFE) │ │ │ │ -Constructor with a given B-spline patch. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:66 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s │ │ │ │ -Attaches a shape function to an entity. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:185 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s_:_:_l_o_c_a_l_K_e_y │ │ │ │ -const LocalKey & localKey(std::size_t i) const │ │ │ │ -get i'th index │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:328 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s_:_:_i_n_i_t │ │ │ │ -void init(const std::array< unsigned, dim > &sizes) │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:263 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s_:_:_s_i_z_e │ │ │ │ -std::size_t size() const │ │ │ │ -number of coefficients │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:322 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_I_n_t_e_r_p_o_l_a_t_i_o_n │ │ │ │ -Local interpolation in the sense of dune-localfunctions, for the B-spline basis │ │ │ │ -on tensor-product gri... │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:347 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_L_o_c_a_l_I_n_t_e_r_p_o_l_a_t_i_o_n_:_:_i_n_t_e_r_p_o_l_a_t_e │ │ │ │ -void interpolate(const F &f, std::vector< C > &out) const │ │ │ │ -Local interpolation of a function. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:351 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_N_o_d_e │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:1233 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ -const FiniteElement & finiteElement() const │ │ │ │ -Return the LocalFiniteElement for the element we are bound to. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:1257 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_N_o_d_e_:_:_E_l_e_m_e_n_t │ │ │ │ -typename GV::template Codim< 0 >::Entity Element │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:1239 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_N_o_d_e_:_:_p_r_e_B_a_s_i_s__ │ │ │ │ -const BSplinePreBasis< GV > * preBasis_ │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:1273 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_N_o_d_e_:_:_F_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ -BSplineLocalFiniteElement< GV, double > FiniteElement │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:1240 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_N_o_d_e_:_:_e_l_e_m_e_n_t__ │ │ │ │ -Element element_ │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:1276 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_N_o_d_e_:_:_b_i_n_d │ │ │ │ -void bind(const Element &e) │ │ │ │ -Bind to element. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:1263 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_N_o_d_e_:_:_B_S_p_l_i_n_e_N_o_d_e │ │ │ │ -BSplineNode(const BSplinePreBasis< GV > *preBasis) │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:1242 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_N_o_d_e_:_:_e_l_e_m_e_n_t │ │ │ │ -const Element & element() const │ │ │ │ -Return current element, throw if unbound. │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:1248 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t__ │ │ │ │ -FiniteElement finiteElement_ │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:1275 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_S_p_l_i_n_e_N_o_d_e_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:1238 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ -Global basis for given pre-basis. │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:53 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_i_x_i_n │ │ │ │ -A generic MixIn class for PreBasis. │ │ │ │ -DDeeffiinniittiioonn leafprebasismixin.hh:36 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_i_x_i_n_<_ _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s_<_ _G_V_ _>_ _>_:_:_s_i_z_e │ │ │ │ -size_type size() const │ │ │ │ -DDeeffiinniittiioonn leafprebasismixin.hh:60 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_b_i_n_d_T_r_e_e │ │ │ │ +void bindTree(Tree &tree, const Entity &entity, std::size_t offset=0) │ │ │ │ +DDeeffiinniittiioonn nodes.hh:469 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_i_n_i_t_i_a_l_i_z_e_T_r_e_e │ │ │ │ +void initializeTree(Tree &tree, std::size_t treeIndexOffset=0) │ │ │ │ +DDeeffiinniittiioonn nodes.hh:476 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_t_r_e_e_I_n_d_e_x │ │ │ │ +size_type treeIndex() const │ │ │ │ +DDeeffiinniittiioonn nodes.hh:180 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_l_o_c_a_l_I_n_d_e_x │ │ │ │ +size_type localIndex(size_type i) const │ │ │ │ +DDeeffiinniittiioonn nodes.hh:149 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_o_f_f_s_e_t │ │ │ │ +size_type offset() const │ │ │ │ +DDeeffiinniittiioonn nodes.hh:187 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_e_m_p_t_y │ │ │ │ +bool empty() const │ │ │ │ +Check if the node is empty. │ │ │ │ +DDeeffiinniittiioonn nodes.hh:175 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_i_z_e │ │ │ │ size_type size() const │ │ │ │ Obtain the number of basis function in the local node. │ │ │ │ DDeeffiinniittiioonn nodes.hh:162 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_e_t_O_f_f_s_e_t │ │ │ │ +void setOffset(const size_type offset) │ │ │ │ +DDeeffiinniittiioonn nodes.hh:192 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_i_z_e___t_y_p_e │ │ │ │ +std::size_t size_type │ │ │ │ +DDeeffiinniittiioonn nodes.hh:141 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n │ │ │ │ +BasisNodeMixin() │ │ │ │ +DDeeffiinniittiioonn nodes.hh:143 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_e_t_S_i_z_e │ │ │ │ void setSize(const size_type size) │ │ │ │ DDeeffiinniittiioonn nodes.hh:197 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_e_t_T_r_e_e_I_n_d_e_x │ │ │ │ +void setTreeIndex(size_type treeIndex) │ │ │ │ +DDeeffiinniittiioonn nodes.hh:202 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ DDeeffiinniittiioonn nodes.hh:218 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_B_a_s_i_s_N_o_d_e_:_:_i_s_L_e_a_f │ │ │ │ +static const bool isLeaf │ │ │ │ +DDeeffiinniittiioonn nodes.hh:230 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_B_a_s_i_s_N_o_d_e_:_:_i_s_C_o_m_p_o_s_i_t_e │ │ │ │ +static const bool isComposite │ │ │ │ +DDeeffiinniittiioonn nodes.hh:232 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_B_a_s_i_s_N_o_d_e_:_:_i_s_P_o_w_e_r │ │ │ │ +static const bool isPower │ │ │ │ +DDeeffiinniittiioonn nodes.hh:231 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_B_a_s_i_s_N_o_d_e_:_:_d_e_g_r_e_e │ │ │ │ +static constexpr auto degree() │ │ │ │ +DDeeffiinniittiioonn nodes.hh:223 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_n_n_e_r_B_a_s_i_s_N_o_d_e_M_i_x_i_n │ │ │ │ +DDeeffiinniittiioonn nodes.hh:246 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_n_n_e_r_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_b_i_n_d │ │ │ │ +void bind(const Element &entity) │ │ │ │ +DDeeffiinniittiioonn nodes.hh:249 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e │ │ │ │ +DDeeffiinniittiioonn nodes.hh:268 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ +auto & child(Index i) │ │ │ │ +DDeeffiinniittiioonn nodes.hh:287 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_ _t_y_p_e_n_a_m_e_ _S_u_b_P_r_e_B_a_s_i_s_:_:_N_o_d_e_,_ _C_ _>_:_:_i_s_L_e_a_f │ │ │ │ +static const bool isLeaf │ │ │ │ +DDeeffiinniittiioonn nodes.hh:298 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e_:_:_e_l_e_m_e_n_t │ │ │ │ +const Element & element() const │ │ │ │ +DDeeffiinniittiioonn nodes.hh:311 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e_:_:_E_l_e_m_e_n_t │ │ │ │ +typename T::Element Element │ │ │ │ +DDeeffiinniittiioonn nodes.hh:307 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ +const auto & child(Index i) const │ │ │ │ +DDeeffiinniittiioonn nodes.hh:280 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e_:_:_d_e_g_r_e_e │ │ │ │ +static constexpr auto degree() │ │ │ │ +DDeeffiinniittiioonn nodes.hh:273 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e │ │ │ │ +PowerBasisNode()=default │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_ _t_y_p_e_n_a_m_e_ _S_u_b_P_r_e_B_a_s_i_s_:_:_N_o_d_e_,_ _C_ _>_:_:_i_s_P_o_w_e_r │ │ │ │ +static const bool isPower │ │ │ │ +DDeeffiinniittiioonn nodes.hh:299 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_ _t_y_p_e_n_a_m_e_ _S_u_b_P_r_e_B_a_s_i_s_:_:_N_o_d_e_,_ _C_ _>_:_:_i_s_C_o_m_p_o_s_i_t_e │ │ │ │ +static const bool isComposite │ │ │ │ +DDeeffiinniittiioonn nodes.hh:300 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ +void setChild(Index i, TT &&t) │ │ │ │ +DDeeffiinniittiioonn nodes.hh:317 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e │ │ │ │ +DDeeffiinniittiioonn nodes.hh:332 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e_:_:_e_l_e_m_e_n_t │ │ │ │ +const Element & element() const │ │ │ │ +DDeeffiinniittiioonn nodes.hh:377 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_ _t_y_p_e_n_a_m_e_ _S_u_b_P_r_e_B_a_s_i_s_:_:_N_o_d_e_ _>_:_:_i_s_L_e_a_f │ │ │ │ +static const bool isLeaf │ │ │ │ +DDeeffiinniittiioonn nodes.hh:362 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ +void setChild(Index i, TT &&t) │ │ │ │ +DDeeffiinniittiioonn nodes.hh:383 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ +const auto & child(Index i) const │ │ │ │ +DDeeffiinniittiioonn nodes.hh:344 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_ _t_y_p_e_n_a_m_e_ _S_u_b_P_r_e_B_a_s_i_s_:_:_N_o_d_e_ _>_:_:_i_s_P_o_w_e_r │ │ │ │ +static const bool isPower │ │ │ │ +DDeeffiinniittiioonn nodes.hh:363 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e │ │ │ │ +DynamicPowerBasisNode(std::size_t children) │ │ │ │ +DDeeffiinniittiioonn nodes.hh:373 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ +auto & child(Index i) │ │ │ │ +DDeeffiinniittiioonn nodes.hh:351 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_ _t_y_p_e_n_a_m_e_ _S_u_b_P_r_e_B_a_s_i_s_:_:_N_o_d_e_ _>_:_: │ │ │ │ +_i_s_C_o_m_p_o_s_i_t_e │ │ │ │ +static const bool isComposite │ │ │ │ +DDeeffiinniittiioonn nodes.hh:364 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e_:_:_d_e_g_r_e_e │ │ │ │ +std::size_t degree() const │ │ │ │ +DDeeffiinniittiioonn nodes.hh:337 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_ _t_y_p_e_n_a_m_e_ _S_u_b_P_r_e_B_a_s_i_s_:_:_N_o_d_e_ _>_:_:_E_l_e_m_e_n_t │ │ │ │ +typename typename SubPreBasis::Node::Element Element │ │ │ │ +DDeeffiinniittiioonn nodes.hh:371 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e │ │ │ │ +DDeeffiinniittiioonn nodes.hh:397 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e │ │ │ │ +CompositeBasisNode()=default │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_:_:_d_e_g_r_e_e │ │ │ │ +static constexpr auto degree() │ │ │ │ +DDeeffiinniittiioonn nodes.hh:402 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_<_ _t_y_p_e_n_a_m_e_ _S_P_B_:_:_N_o_d_e_._._._ _>_:_:_i_s_L_e_a_f │ │ │ │ +static const bool isLeaf │ │ │ │ +DDeeffiinniittiioonn nodes.hh:425 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ +auto & child(Dune::index_constant< i > ii) │ │ │ │ +DDeeffiinniittiioonn nodes.hh:414 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_<_ _t_y_p_e_n_a_m_e_ _S_P_B_:_:_N_o_d_e_._._._ _>_:_:_i_s_P_o_w_e_r │ │ │ │ +static const bool isPower │ │ │ │ +DDeeffiinniittiioonn nodes.hh:426 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_<_ _t_y_p_e_n_a_m_e_ _S_P_B_:_:_N_o_d_e_._._._ _>_:_:_E_l_e_m_e_n_t │ │ │ │ +typename std::tuple_element_t< 0, std::tuple< T... > >::Element Element │ │ │ │ +DDeeffiinniittiioonn nodes.hh:444 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_:_:_e_l_e_m_e_n_t │ │ │ │ +const Element & element() const │ │ │ │ +DDeeffiinniittiioonn nodes.hh:452 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ +const auto & child(Dune::index_constant< i > ii) const │ │ │ │ +DDeeffiinniittiioonn nodes.hh:408 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_<_ _t_y_p_e_n_a_m_e_ _S_P_B_:_:_N_o_d_e_._._._ _>_:_:_i_s_C_o_m_p_o_s_i_t_e │ │ │ │ +static const bool isComposite │ │ │ │ +DDeeffiinniittiioonn nodes.hh:427 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ +void setChild(TT &&t, Dune::index_constant< i > ii={}) │ │ │ │ +DDeeffiinniittiioonn nodes.hh:458 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e │ │ │ │ +CompositeBasisNode(const T &... children) │ │ │ │ +DDeeffiinniittiioonn nodes.hh:448 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_:_:_C_h_i_l_d │ │ │ │ +DDeeffiinniittiioonn nodes.hh:433 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_:_:_C_h_i_l_d_:_:_T_y_p_e │ │ │ │ +typename std::tuple_element_t< k, std::tuple< T... > > Type │ │ │ │ +The type of the child. │ │ │ │ +DDeeffiinniittiioonn nodes.hh:437 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_:_:_C_h_i_l_d_:_:_t_y_p_e │ │ │ │ +Type type │ │ │ │ +DDeeffiinniittiioonn nodes.hh:439 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _b_s_p_l_i_n_e_b_a_s_i_s_._h_h │ │ │ │ + * _n_o_d_e_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00182.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: brezzidouglasmarinibasis.hh File Reference │ │ │ +Dune-Functions: taylorhoodbasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,69 +88,62 @@ │ │ │
No Matches
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
brezzidouglasmarinibasis.hh File Reference
│ │ │ +
taylorhoodbasis.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <array>
│ │ │ -#include <dune/common/exceptions.hh>
│ │ │ -#include <dune/geometry/referenceelements.hh>
│ │ │ -#include <dune/localfunctions/common/virtualinterface.hh>
│ │ │ -#include <dune/localfunctions/common/virtualwrappers.hh>
│ │ │ -#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini1cube2d.hh>
│ │ │ -#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini1cube3d.hh>
│ │ │ -#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini1simplex2d.hh>
│ │ │ -#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini2cube2d.hh>
│ │ │ -#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini2simplex2d.hh>
│ │ │ -#include <dune/functions/functionspacebases/globalvaluedlocalfiniteelement.hh>
│ │ │ -#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ -#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │ -#include <dune/functions/functionspacebases/leafprebasismappermixin.hh>
│ │ │ +
#include <dune/common/exceptions.hh>
│ │ │ +#include <dune/common/reservedvector.hh>
│ │ │ +#include <dune/common/indices.hh>
│ │ │ +#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ +#include <dune/functions/functionspacebases/lagrangebasis.hh>
│ │ │ +#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::BrezziDouglasMariniPreBasis< GV, k >
class  Dune::Functions::BrezziDouglasMariniNode< GV, k >
class  Dune::Functions::TaylorHoodPreBasis< GV, HI >
 Pre-basis for lowest order Taylor-Hood basis. More...
class  Dune::Functions::TaylorHoodVelocityTree< GV >
class  Dune::Functions::TaylorHoodBasisTree< GV >
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::BasisFactory
│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Typedefs

template<typename GV, int k>
using Dune::Functions::BrezziDouglasMariniBasis = DefaultGlobalBasis<BrezziDouglasMariniPreBasis<GV, k> >
 Basis of a scalar k-th-order BDM finite element space on simplex and cube grids.
template<typename GV>
using Dune::Functions::TaylorHoodBasis = DefaultGlobalBasis<TaylorHoodPreBasis<GV> >
 Nodal basis for a lowest order Taylor-Hood Lagrangean finite element space.
│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │

│ │ │ Functions

template<std::size_t k>
auto Dune::Functions::BasisFactory::brezziDouglasMarini ()
 Create a pre-basis factory that can create a Brezzi-Douglas-Marini pre-basis.
auto Dune::Functions::BasisFactory::taylorHood ()
 Create a pre-basis factory that can create a Taylor-Hood pre-basis.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,48 +1,35 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -brezzidouglasmarinibasis.hh File Reference │ │ │ │ -#include │ │ │ │ +taylorhoodbasis.hh File Reference │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_g_l_o_b_a_l_v_a_l_u_e_d_l_o_c_a_l_f_i_n_i_t_e_e_l_e_m_e_n_t_._h_h> │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ #include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_a_g_r_a_n_g_e_b_a_s_i_s_._h_h> │ │ │ │ #include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_P_r_e_B_a_s_i_s_<_ _G_V_,_ _k_ _> │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_N_o_d_e_<_ _G_V_,_ _k_ _> │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_<_ _G_V_,_ _H_I_ _> │ │ │ │ +  Pre-basis for lowest order Taylor-Hood basis. _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_V_e_l_o_c_i_t_y_T_r_e_e_<_ _G_V_ _> │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_B_a_s_i_s_T_r_e_e_<_ _G_V_ _> │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ TTyyppeeddeeffss │ │ │ │ -template │ │ │ │ -using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_B_a_s_i_s = │ │ │ │ - _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s<_B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_P_r_e_B_a_s_i_s > │ │ │ │ -  Basis of a scalar k-th-order BDM finite element space on simplex and │ │ │ │ - cube grids. │ │ │ │ +template │ │ │ │ +using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_B_a_s_i_s = │ │ │ │ + _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s<_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s > │ │ │ │ +  Nodal basis for a lowest order Taylor-Hood Lagrangean finite element │ │ │ │ + space. │ │ │ │ FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_b_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i () │ │ │ │ -  Create a pre-basis factory that can create a Brezzi-Douglas-Marini pre- │ │ │ │ - basis. │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_t_a_y_l_o_r_H_o_o_d () │ │ │ │ +  Create a pre-basis factory that can create a Taylor-Hood pre-basis. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _b_r_e_z_z_i_d_o_u_g_l_a_s_m_a_r_i_n_i_b_a_s_i_s_._h_h │ │ │ │ + * _t_a_y_l_o_r_h_o_o_d_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00182.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,6 +1,6 @@ │ │ │ │ var a00182 = [ │ │ │ │ - ["Dune::Functions::BrezziDouglasMariniPreBasis< GV, k >", "a01674.html", "a01674"], │ │ │ │ - ["Dune::Functions::BrezziDouglasMariniNode< GV, k >", "a01670.html", "a01670"], │ │ │ │ - ["Dune::Functions::BrezziDouglasMariniBasis", "a00318.html#ae2a779cf5ab7b35346c6950e4a1e3979", null], │ │ │ │ - ["Dune::Functions::BasisFactory::brezziDouglasMarini", "a00312.html#ga72847f418332ba3d5444a7f153776610", null] │ │ │ │ + ["Dune::Functions::TaylorHoodVelocityTree< GV >", "a02150.html", "a02150"], │ │ │ │ + ["Dune::Functions::TaylorHoodBasisTree< GV >", "a02154.html", "a02154"], │ │ │ │ + ["Dune::Functions::TaylorHoodBasis", "a00312.html#ga4a58d555b1cadb5e780c43099c6b1f30", null], │ │ │ │ + ["Dune::Functions::BasisFactory::taylorHood", "a00312.html#ga2384fc6a8ee2005fb29adb7221609ce3", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00182_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: brezzidouglasmarinibasis.hh Source File │ │ │ +Dune-Functions: taylorhoodbasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,366 +88,414 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
brezzidouglasmarinibasis.hh
│ │ │ +
taylorhoodbasis.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BREZZIDOUGLASMARINIBASIS_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BREZZIDOUGLASMARINIBASIS_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH
│ │ │ +
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH
│ │ │
9
│ │ │ -
10#include <array>
│ │ │ -
11#include <dune/common/exceptions.hh>
│ │ │ -
12#include <dune/geometry/referenceelements.hh>
│ │ │ +
10#include <dune/common/exceptions.hh>
│ │ │ +
11#include <dune/common/reservedvector.hh>
│ │ │ +
12#include <dune/common/indices.hh>
│ │ │
13
│ │ │ -
14#include <dune/localfunctions/common/virtualinterface.hh>
│ │ │ -
15#include <dune/localfunctions/common/virtualwrappers.hh>
│ │ │ -
16
│ │ │ -
17#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini1cube2d.hh>
│ │ │ -
18#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini1cube3d.hh>
│ │ │ -
19#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini1simplex2d.hh>
│ │ │ -
20#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini2cube2d.hh>
│ │ │ -
21#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini2simplex2d.hh>
│ │ │ -
22
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
27
│ │ │ -
28namespace Dune {
│ │ │ -
29namespace Functions {
│ │ │ -
30
│ │ │ -
31namespace Impl {
│ │ │ -
32
│ │ │ -
33 template<int dim, typename D, typename R, std::size_t k>
│ │ │ -
34 struct BDMSimplexLocalInfo
│ │ │ -
35 {
│ │ │ -
36 static_assert((AlwaysFalse<D>::value),"The requested type of BDM element is not implemented, sorry!");
│ │ │ -
37 };
│ │ │ -
38
│ │ │ -
39 template<typename D, typename R>
│ │ │ -
40 struct BDMSimplexLocalInfo<2,D,R,1>
│ │ │ -
41 {
│ │ │ -
42 using FiniteElement = BDM1Simplex2DLocalFiniteElement<D,R>;
│ │ │ -
43 static const std::size_t Variants = 8;
│ │ │ -
44 };
│ │ │ -
45
│ │ │ -
46 template<typename D, typename R>
│ │ │ -
47 struct BDMSimplexLocalInfo<2,D,R,2>
│ │ │ -
48 {
│ │ │ -
49 using FiniteElement = BDM2Simplex2DLocalFiniteElement<D,R>;
│ │ │ -
50 static const std::size_t Variants = 8;
│ │ │ -
51 };
│ │ │ -
52
│ │ │ -
53 template<int dim, typename D, typename R, std::size_t k>
│ │ │ -
54 struct BDMCubeLocalInfo
│ │ │ -
55 {
│ │ │ -
56 static_assert((AlwaysFalse<D>::value),"The requested type of BDM element is not implemented, sorry!");
│ │ │ -
57 };
│ │ │ -
58
│ │ │ -
59 template<typename D, typename R>
│ │ │ -
60 struct BDMCubeLocalInfo<2,D,R,1>
│ │ │ -
61 {
│ │ │ -
62 using FiniteElement = BDM1Cube2DLocalFiniteElement<D,R>;
│ │ │ -
63 static const std::size_t Variants = 16;
│ │ │ -
64 };
│ │ │ + │ │ │ + │ │ │ + │ │ │ +
17
│ │ │ +
18namespace Dune {
│ │ │ +
19namespace Functions {
│ │ │ +
20
│ │ │ +
21
│ │ │ +
22// *****************************************************************************
│ │ │ +
23// This is the reusable part of the basis. It contains
│ │ │ +
24//
│ │ │ +
25// TaylorHoodPreBasis
│ │ │ +
26// TaylorHoodBasisTree
│ │ │ +
27// TaylorHoodVelocityTree
│ │ │ +
28//
│ │ │ +
29// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ +
30// state. These components do _not_ depend on the global basis and local view
│ │ │ +
31// and can be used without a global basis.
│ │ │ +
32// *****************************************************************************
│ │ │ +
33
│ │ │ +
34template<typename GV>
│ │ │ + │ │ │ +
36
│ │ │ +
37template<typename GV>
│ │ │ + │ │ │ +
39
│ │ │ +
59template<typename GV, bool HI=false>
│ │ │ +
│ │ │ + │ │ │ +
61{
│ │ │ +
62 static const bool useHybridIndices = HI;
│ │ │ +
63
│ │ │ +
64 static const int dim = GV::dimension;
│ │ │
65
│ │ │ -
66 template<typename D, typename R>
│ │ │ -
67 struct BDMCubeLocalInfo<2,D,R,2>
│ │ │ -
68 {
│ │ │ -
69 using FiniteElement = BDM2Cube2DLocalFiniteElement<D,R>;
│ │ │ -
70 static const std::size_t Variants = 16;
│ │ │ -
71 };
│ │ │ -
72
│ │ │ -
73 template<typename D, typename R>
│ │ │ -
74 struct BDMCubeLocalInfo<3,D,R,1>
│ │ │ -
75 {
│ │ │ -
76 using FiniteElement = BDM1Cube3DLocalFiniteElement<D,R>;
│ │ │ -
77 static const std::size_t Variants = 64;
│ │ │ -
78 };
│ │ │ -
79
│ │ │ -
80 template<typename GV, typename R, std::size_t k>
│ │ │ -
81 class BDMLocalFiniteElementMap
│ │ │ -
82 {
│ │ │ -
83 using D = typename GV::ctype;
│ │ │ -
84 constexpr static auto dim = GV::dimension;
│ │ │ -
85 using CubeFiniteElement = typename BDMCubeLocalInfo<dim, D, R, k>::FiniteElement;
│ │ │ -
86 using SimplexFiniteElement = typename BDMSimplexLocalInfo<dim, D, R, k>::FiniteElement;
│ │ │ -
87
│ │ │ -
88 public:
│ │ │ -
89
│ │ │ -
90 using T = LocalBasisTraits<D, dim, FieldVector<D,dim>, R, dim, FieldVector<R,dim>, FieldMatrix<D,dim,dim> >;
│ │ │ -
91 using FiniteElement = LocalFiniteElementVirtualInterface<T>;
│ │ │ -
92
│ │ │ -
93 BDMLocalFiniteElementMap(const GV& gv)
│ │ │ -
94 : is_(&(gv.indexSet())), orient_(gv.size(0))
│ │ │ -
95 {
│ │ │ -
96 update(gv);
│ │ │ -
97 }
│ │ │ -
98
│ │ │ -
99 void update(const GV& gv)
│ │ │ -
100 {
│ │ │ -
101 is_ = &(gv.indexSet());
│ │ │ -
102 orient_.resize(gv.size(0));
│ │ │ -
103
│ │ │ -
104 cubeVariant_.resize(BDMCubeLocalInfo<dim, D, R, k>::Variants);
│ │ │ -
105 simplexVariant_.resize(BDMSimplexLocalInfo<dim, D, R, k>::Variants);
│ │ │ -
106
│ │ │ -
107 // create all variants
│ │ │ -
108 for (size_t i = 0; i < cubeVariant_.size(); i++)
│ │ │ -
109 cubeVariant_[i] = std::make_shared<LocalFiniteElementVirtualImp<CubeFiniteElement> >(CubeFiniteElement(i));
│ │ │ -
110
│ │ │ -
111 for (size_t i = 0; i < simplexVariant_.size(); i++)
│ │ │ -
112 simplexVariant_[i] = std::make_shared<LocalFiniteElementVirtualImp<SimplexFiniteElement> >(SimplexFiniteElement(i));
│ │ │ -
113
│ │ │ -
114 // compute orientation for all elements
│ │ │ -
115 // loop once over the grid
│ │ │ -
116 for(const auto& cell : elements(gv))
│ │ │ -
117 {
│ │ │ -
118 unsigned int myId = is_->index(cell);
│ │ │ -
119 orient_[myId] = 0;
│ │ │ -
120
│ │ │ -
121 for (const auto& intersection : intersections(gv,cell))
│ │ │ -
122 {
│ │ │ -
123 if (intersection.neighbor() && (is_->index(intersection.outside()) > myId))
│ │ │ -
124 orient_[myId] |= (1 << intersection.indexInInside());
│ │ │ -
125 }
│ │ │ -
126 }
│ │ │ -
127 }
│ │ │ +
66public:
│ │ │ +
67
│ │ │ +
69 using GridView = GV;
│ │ │ +
70
│ │ │ +
72 using size_type = std::size_t;
│ │ │ +
73
│ │ │ + │ │ │ +
76
│ │ │ +
77 static constexpr size_type maxMultiIndexSize = useHybridIndices ? 3 : 2;
│ │ │ +
78 static constexpr size_type minMultiIndexSize = 2;
│ │ │ + │ │ │ +
80
│ │ │ +
81private:
│ │ │ +
82
│ │ │ +
83 using PQ1PreBasis = LagrangePreBasis<GV,1>;
│ │ │ +
84 using PQ2PreBasis = LagrangePreBasis<GV,2>;
│ │ │ +
85
│ │ │ +
86public:
│ │ │ +
87
│ │ │ +
│ │ │ + │ │ │ +
90 gridView_(gv),
│ │ │ +
91 pq1PreBasis_(gv),
│ │ │ +
92 pq2PreBasis_(gv)
│ │ │ +
93 {}
│ │ │ +
│ │ │ +
94
│ │ │ +
│ │ │ + │ │ │ +
97 {
│ │ │ +
98 pq1PreBasis_.initializeIndices();
│ │ │ +
99 pq2PreBasis_.initializeIndices();
│ │ │ +
100 }
│ │ │ +
│ │ │ +
101
│ │ │ +
│ │ │ +
103 const GridView& gridView() const
│ │ │ +
104 {
│ │ │ +
105 return gridView_;
│ │ │ +
106 }
│ │ │ +
│ │ │ +
107
│ │ │ +
│ │ │ +
109 void update (const GridView& gv)
│ │ │ +
110 {
│ │ │ +
111 pq1PreBasis_.update(gv);
│ │ │ +
112 pq2PreBasis_.update(gv);
│ │ │ +
113 }
│ │ │ +
│ │ │ +
114
│ │ │ +
│ │ │ + │ │ │ +
119 {
│ │ │ +
120 return Node{};
│ │ │ +
121 }
│ │ │ +
│ │ │ +
122
│ │ │ +
│ │ │ + │ │ │ +
125 {
│ │ │ +
126 return 2;
│ │ │ +
127 }
│ │ │ +
│ │ │
128
│ │ │ -
130 template<class EntityType>
│ │ │ -
131 const FiniteElement& find(const EntityType& e) const
│ │ │ -
132 {
│ │ │ -
133 if (e.type().isCube())
│ │ │ -
134 return *cubeVariant_[orient_[is_->index(e)]];
│ │ │ -
135 else
│ │ │ -
136 return *simplexVariant_[orient_[is_->index(e)]];
│ │ │ -
137 }
│ │ │ -
138
│ │ │ -
139 private:
│ │ │ -
140 std::vector<std::shared_ptr<LocalFiniteElementVirtualImp<CubeFiniteElement> > > cubeVariant_;
│ │ │ -
141 std::vector<std::shared_ptr<LocalFiniteElementVirtualImp<SimplexFiniteElement> > > simplexVariant_;
│ │ │ -
142 const typename GV::IndexSet* is_;
│ │ │ -
143 std::vector<unsigned char> orient_;
│ │ │ -
144 };
│ │ │ -
145
│ │ │ -
146
│ │ │ -
147} // namespace Impl
│ │ │ -
148
│ │ │ -
149
│ │ │ -
150// *****************************************************************************
│ │ │ -
151// This is the reusable part of the basis. It contains
│ │ │ -
152//
│ │ │ -
153// BrezziDouglasMariniPreBasis
│ │ │ -
154// BrezziDouglasMariniNode
│ │ │ -
155//
│ │ │ -
156// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ -
157// state. These components do _not_ depend on the global basis and local view
│ │ │ -
158// and can be used without a global basis.
│ │ │ -
159// *****************************************************************************
│ │ │ -
160
│ │ │ -
161template<typename GV, int k>
│ │ │ - │ │ │ -
163
│ │ │ -
164template<typename GV, int k>
│ │ │ -
│ │ │ - │ │ │ -
166 public LeafPreBasisMapperMixin<GV>
│ │ │ -
167{
│ │ │ -
168 using Base = LeafPreBasisMapperMixin<GV>;
│ │ │ -
169 static const int dim = GV::dimension;
│ │ │ -
170
│ │ │ -
171 // Degrees of freedom per subentity
│ │ │ -
172 static MCMGLayout dofLayout()
│ │ │ -
173 {
│ │ │ -
174 return [](GeometryType gt, size_t gridDim) -> size_t {
│ │ │ -
175 if (gt.dim() == gridDim)
│ │ │ -
176 return dim*(k-1)*3;
│ │ │ -
177 if (gt.dim() == gridDim-1)
│ │ │ -
178 return dim+(k-1);
│ │ │ -
179 return 0;
│ │ │ -
180 };
│ │ │ -
181 }
│ │ │ -
182
│ │ │ -
183 using FiniteElementMap = typename Impl::BDMLocalFiniteElementMap<GV, double, k>;
│ │ │ -
184
│ │ │ -
185public:
│ │ │ +
130 template<class SizePrefix>
│ │ │ +
│ │ │ +
131 size_type size(const SizePrefix& prefix) const
│ │ │ +
132 {
│ │ │ +
133 return sizeImp<useHybridIndices>(prefix);
│ │ │ +
134 }
│ │ │ +
│ │ │ +
135
│ │ │ +
136private:
│ │ │ +
137
│ │ │ +
138 template<bool hi, class SizePrefix,
│ │ │ +
139 std::enable_if_t<not hi,int> = 0>
│ │ │ +
140 size_type sizeImp(const SizePrefix& prefix) const
│ │ │ +
141 {
│ │ │ +
142 if (prefix.size() == 0)
│ │ │ +
143 return 2;
│ │ │ +
144 if (prefix.size() == 1)
│ │ │ +
145 {
│ │ │ +
146 if (prefix[0] == 0)
│ │ │ +
147 return dim * pq2PreBasis_.size();
│ │ │ +
148 if (prefix[0] == 1)
│ │ │ +
149 return pq1PreBasis_.size();
│ │ │ +
150 }
│ │ │ +
151 assert(prefix.size() == 2);
│ │ │ +
152 return 0;
│ │ │ +
153 }
│ │ │ +
154
│ │ │ +
155 template<bool hi, class SizePrefix,
│ │ │ +
156 std::enable_if_t<hi,int> = 0>
│ │ │ +
157 size_type sizeImp(const SizePrefix& prefix) const
│ │ │ +
158 {
│ │ │ +
159 if (prefix.size() == 0)
│ │ │ +
160 return 2;
│ │ │ +
161 if (prefix.size() == 1)
│ │ │ +
162 {
│ │ │ +
163 if (prefix[0] == 0)
│ │ │ +
164 return pq2PreBasis_.size();
│ │ │ +
165 if (prefix[0] == 1)
│ │ │ +
166 return pq1PreBasis_.size();
│ │ │ +
167 }
│ │ │ +
168 if (prefix.size() == 2)
│ │ │ +
169 {
│ │ │ +
170 if (prefix[0] == 0)
│ │ │ +
171 return dim;
│ │ │ +
172 if (prefix[0] == 1)
│ │ │ +
173 return 0;
│ │ │ +
174 }
│ │ │ +
175 assert(prefix.size() == 3);
│ │ │ +
176 return 0;
│ │ │ +
177 }
│ │ │ +
178
│ │ │ +
179public:
│ │ │ +
180
│ │ │ +
│ │ │ + │ │ │ +
183 {
│ │ │ +
184 return dim * pq2PreBasis_.size() + pq1PreBasis_.size();
│ │ │ +
185 }
│ │ │ +
│ │ │
186
│ │ │ -
188 using GridView = GV;
│ │ │ -
189 using size_type = std::size_t;
│ │ │ -
190
│ │ │ - │ │ │ -
192
│ │ │ -
│ │ │ - │ │ │ -
195 Base(gv, dofLayout()),
│ │ │ - │ │ │ -
197 {
│ │ │ -
198 // There is no inherent reason why the basis shouldn't work for grids with more than one
│ │ │ -
199 // element types. Somebody simply has to sit down and implement the missing bits.
│ │ │ -
200 if (gv.indexSet().types(0).size() > 1)
│ │ │ -
201 DUNE_THROW(Dune::NotImplemented, "Brezzi-Douglas-Marini basis is only implemented for grids with a single element type");
│ │ │ -
202 }
│ │ │ -
│ │ │ -
203
│ │ │ -
204 /* \brief Update the stored grid view, to be called if the grid has changed */
│ │ │ -
│ │ │ -
205 void update (const GridView& gv)
│ │ │ -
206 {
│ │ │ -
207 Base::update(gv);
│ │ │ -
208 finiteElementMap_.update(gv);
│ │ │ -
209 }
│ │ │ -
│ │ │ -
210
│ │ │ -
│ │ │ - │ │ │ -
215 {
│ │ │ -
216 return Node{&finiteElementMap_};
│ │ │ -
217 }
│ │ │ -
│ │ │ -
218
│ │ │ -
219protected:
│ │ │ -
220 FiniteElementMap finiteElementMap_;
│ │ │ -
221};
│ │ │ -
│ │ │ -
222
│ │ │ -
223
│ │ │ -
224
│ │ │ -
225template<typename GV, int k>
│ │ │ -
│ │ │ - │ │ │ -
227 public LeafBasisNode
│ │ │ -
228{
│ │ │ -
229public:
│ │ │ -
230
│ │ │ -
231 using size_type = std::size_t;
│ │ │ -
232 using Element = typename GV::template Codim<0>::Entity;
│ │ │ -
233 using FiniteElementMap = typename Impl::BDMLocalFiniteElementMap<GV, double, k>;
│ │ │ -
234 using FiniteElement = Impl::GlobalValuedLocalFiniteElement<Impl::ContravariantPiolaTransformator,
│ │ │ -
235 typename FiniteElementMap::FiniteElement,
│ │ │ -
236 Element>;
│ │ │ -
237
│ │ │ -
│ │ │ -
238 BrezziDouglasMariniNode(const FiniteElementMap* finiteElementMap) :
│ │ │ -
239 element_(nullptr),
│ │ │ -
240 finiteElementMap_(finiteElementMap)
│ │ │ -
241 {}
│ │ │ -
│ │ │ -
242
│ │ │ -
│ │ │ -
244 const Element& element() const
│ │ │ -
245 {
│ │ │ -
246 return *element_;
│ │ │ -
247 }
│ │ │ -
│ │ │ -
248
│ │ │ -
│ │ │ - │ │ │ -
254 {
│ │ │ -
255 return finiteElement_;
│ │ │ -
256 }
│ │ │ -
│ │ │ -
257
│ │ │ -
│ │ │ -
259 void bind(const Element& e)
│ │ │ -
260 {
│ │ │ -
261 element_ = &e;
│ │ │ -
262 finiteElement_.bind((finiteElementMap_->find(*element_)), e);
│ │ │ -
263 this->setSize(finiteElement_.size());
│ │ │ -
264 }
│ │ │ -
│ │ │ -
265
│ │ │ -
266protected:
│ │ │ -
267
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
271};
│ │ │ -
│ │ │ -
272
│ │ │ -
273
│ │ │ -
274
│ │ │ -
275namespace BasisFactory {
│ │ │ -
276
│ │ │ -
284template<std::size_t k>
│ │ │ -
│ │ │ - │ │ │ -
286{
│ │ │ -
287 return [](const auto& gridView) {
│ │ │ -
288 return BrezziDouglasMariniPreBasis<std::decay_t<decltype(gridView)>, k>(gridView);
│ │ │ -
289 };
│ │ │ -
290}
│ │ │ +
│ │ │ + │ │ │ +
189 {
│ │ │ +
190 return dim * pq2PreBasis_.maxNodeSize() + pq1PreBasis_.maxNodeSize();
│ │ │ +
191 }
│ │ │
│ │ │ +
192
│ │ │ +
193 template<typename It>
│ │ │ +
│ │ │ +
194 It indices(const Node& node, It it) const
│ │ │ +
195 {
│ │ │ +
196 return indicesImp<useHybridIndices>(node, it);
│ │ │ +
197 }
│ │ │ +
│ │ │ +
198
│ │ │ +
│ │ │ + │ │ │ +
205 {
│ │ │ + │ │ │ +
207 if constexpr(HI)
│ │ │ +
208 return CD::makeDescriptor(
│ │ │ +
209 CD::makeUniformDescriptor(pq2PreBasis_.size(),
│ │ │ +
210 CD::FlatArray<GV::dimension>{}),
│ │ │ +
211 CD::FlatVector{pq1PreBasis_.size()});
│ │ │ +
212 else
│ │ │ +
213 return CD::Array<CD::FlatVector,2>{
│ │ │ +
214 CD::FlatVector{GV::dimension * pq2PreBasis_.size()},
│ │ │ +
215 CD::FlatVector{pq1PreBasis_.size()} };
│ │ │ +
216 }
│ │ │ +
│ │ │ +
217
│ │ │ +
218protected:
│ │ │ +
219
│ │ │ +
220 template<class MultiIndex>
│ │ │ +
│ │ │ +
221 static const void multiIndexPushFront(MultiIndex& M, size_type M0)
│ │ │ +
222 {
│ │ │ +
223 M.resize(M.size()+1);
│ │ │ +
224 for(std::size_t i=M.size()-1; i>0; --i)
│ │ │ +
225 M[i] = M[i-1];
│ │ │ +
226 M[0] = M0;
│ │ │ +
227 }
│ │ │ +
│ │ │ +
228
│ │ │ +
229 template<bool hi, class It,
│ │ │ +
230 std::enable_if_t<not hi,int> = 0>
│ │ │ +
│ │ │ +
231 It indicesImp(const Node& node, It multiIndices) const
│ │ │ +
232 {
│ │ │ +
233 using namespace Dune::Indices;
│ │ │ +
234 for(std::size_t child=0; child<dim; ++child)
│ │ │ +
235 {
│ │ │ +
236 size_type subTreeSize = node.child(_0, 0).size();
│ │ │ +
237 pq2PreBasis_.indices(node.child(_0, 0), multiIndices);
│ │ │ +
238 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ +
239 {
│ │ │ +
240 multiIndexPushFront(multiIndices[i], 0);
│ │ │ +
241 multiIndices[i][1] = multiIndices[i][1]*dim + child;
│ │ │ +
242 }
│ │ │ +
243 multiIndices += subTreeSize;
│ │ │ +
244 }
│ │ │ +
245 size_type subTreeSize = node.child(_1).size();
│ │ │ +
246 pq1PreBasis_.indices(node.child(_1), multiIndices);
│ │ │ +
247 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ +
248 multiIndexPushFront(multiIndices[i], 1);
│ │ │ +
249 multiIndices += subTreeSize;
│ │ │ +
250 return multiIndices;
│ │ │ +
251 }
│ │ │ +
│ │ │ +
252
│ │ │ +
253 template<bool hi, class It,
│ │ │ +
254 std::enable_if_t<hi,int> = 0>
│ │ │ +
│ │ │ +
255 It indicesImp(const Node& node, It multiIndices) const
│ │ │ +
256 {
│ │ │ +
257 using namespace Dune::Indices;
│ │ │ +
258 for(std::size_t child=0; child<dim; ++child)
│ │ │ +
259 {
│ │ │ +
260 size_type subTreeSize = node.child(_0, 0).size();
│ │ │ +
261 pq2PreBasis_.indices(node.child(_0, 0), multiIndices);
│ │ │ +
262 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ +
263 {
│ │ │ +
264 multiIndexPushFront(multiIndices[i], 0);
│ │ │ +
265 multiIndices[i].push_back(i);
│ │ │ +
266 }
│ │ │ +
267 multiIndices += subTreeSize;
│ │ │ +
268 }
│ │ │ +
269 size_type subTreeSize = node.child(_1).size();
│ │ │ +
270 pq1PreBasis_.indices(node.child(_1), multiIndices);
│ │ │ +
271 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ +
272 multiIndexPushFront(multiIndices[i], 1);
│ │ │ +
273 multiIndices += subTreeSize;
│ │ │ +
274 return multiIndices;
│ │ │ +
275 }
│ │ │ +
│ │ │ +
276
│ │ │ + │ │ │ +
278
│ │ │ +
279 PQ1PreBasis pq1PreBasis_;
│ │ │ +
280 PQ2PreBasis pq2PreBasis_;
│ │ │ +
281};
│ │ │ +
│ │ │ +
282
│ │ │ +
283
│ │ │ +
284
│ │ │ +
285template<typename GV>
│ │ │ +
│ │ │ + │ │ │ +
287 public PowerBasisNode<LagrangeNode<GV,2>, GV::dimension>
│ │ │ +
288{
│ │ │ +
289 using PQ2Node = LagrangeNode<GV,2>;
│ │ │ + │ │ │
291
│ │ │ -
292} // end namespace BasisFactory
│ │ │ -
293
│ │ │ -
294
│ │ │ -
295
│ │ │ -
296// *****************************************************************************
│ │ │ -
297// This is the actual global basis implementation based on the reusable parts.
│ │ │ -
298// *****************************************************************************
│ │ │ -
299
│ │ │ -
307template<typename GV, int k>
│ │ │ - │ │ │ +
292public:
│ │ │ +
│ │ │ + │ │ │ +
294 {
│ │ │ +
295 for(int i=0; i<GV::dimension; ++i)
│ │ │ +
296 this->setChild(i, PQ2Node());
│ │ │ +
297 }
│ │ │ +
│ │ │ +
298};
│ │ │ +
│ │ │ +
299
│ │ │ +
300template<typename GV>
│ │ │ +
│ │ │ + │ │ │ +
302 public CompositeBasisNode<
│ │ │ +
303 TaylorHoodVelocityTree<GV>,
│ │ │ +
304 LagrangeNode<GV,1>
│ │ │ +
305 >
│ │ │ +
306{
│ │ │ +
307 using VelocityNode=TaylorHoodVelocityTree<GV>;
│ │ │ +
308 using PressureNode=LagrangeNode<GV,1>;
│ │ │
309
│ │ │ -
310} // end namespace Functions
│ │ │ -
311} // end namespace Dune
│ │ │ -
312
│ │ │ -
313
│ │ │ -
314#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BREZZIDOUGLASMARINIBASIS_HH
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
auto brezziDouglasMarini()
Create a pre-basis factory that can create a Brezzi-Douglas-Marini pre-basis.
Definition brezzidouglasmarinibasis.hh:285
│ │ │ -
auto elements(const SubDomainGridView< HostGridView > &subDomainGridView)
ADL findable access to element range for a SubDomainGridView.
Definition subdomain.hh:487
│ │ │ -
auto intersections(const SubDomainGridView< HostGridView > &subDomainGridView, const Element &element)
ADL findable access to intersection range for an element of a SubDomainGridView.
Definition subdomain.hh:510
│ │ │ + │ │ │ +
311
│ │ │ +
312public:
│ │ │ +
│ │ │ + │ │ │ +
314 {
│ │ │ +
315 this->template setChild<0>(VelocityNode());
│ │ │ +
316 this->template setChild<1>(PressureNode());
│ │ │ +
317 }
│ │ │ +
│ │ │ +
318};
│ │ │ +
│ │ │ +
319
│ │ │ +
320
│ │ │ +
321
│ │ │ +
322namespace BasisFactory {
│ │ │ +
323
│ │ │ +
│ │ │ +
330inline auto taylorHood()
│ │ │ +
331{
│ │ │ +
332 return [](const auto& gridView) {
│ │ │ +
333 return TaylorHoodPreBasis<std::decay_t<decltype(gridView)>>(gridView);
│ │ │ +
334 };
│ │ │ +
335}
│ │ │ +
│ │ │ +
336
│ │ │ +
337} // end namespace BasisFactory
│ │ │ +
338
│ │ │ +
339// *****************************************************************************
│ │ │ +
340// This is the actual global basis implementation based on the reusable parts.
│ │ │ +
341// *****************************************************************************
│ │ │ +
342
│ │ │ +
364template<typename GV>
│ │ │ + │ │ │ +
366
│ │ │ +
367
│ │ │ +
368
│ │ │ +
369} // end namespace Functions
│ │ │ +
370} // end namespace Dune
│ │ │ +
371
│ │ │ +
372
│ │ │ +
373#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH
│ │ │ + │ │ │ + │ │ │ + │ │ │ +
auto taylorHood()
Create a pre-basis factory that can create a Taylor-Hood pre-basis.
Definition taylorhoodbasis.hh:330
│ │ │ +
DefaultGlobalBasis< TaylorHoodPreBasis< GV > > TaylorHoodBasis
Nodal basis for a lowest order Taylor-Hood Lagrangean finite element space.
Definition taylorhoodbasis.hh:365
│ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
DefaultGlobalBasis< BrezziDouglasMariniPreBasis< GV, k > > BrezziDouglasMariniBasis
Basis of a scalar k-th-order BDM finite element space on simplex and cube grids.
Definition brezzidouglasmarinibasis.hh:308
│ │ │ -
Definition argyrisbasis.hh:926
│ │ │ -
Definition brezzidouglasmarinibasis.hh:228
│ │ │ -
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition brezzidouglasmarinibasis.hh:253
│ │ │ -
typename Impl::BDMLocalFiniteElementMap< GV, double, k > FiniteElementMap
Definition brezzidouglasmarinibasis.hh:233
│ │ │ -
typename GV::template Codim< 0 >::Entity Element
Definition brezzidouglasmarinibasis.hh:232
│ │ │ -
Impl::GlobalValuedLocalFiniteElement< Impl::ContravariantPiolaTransformator, typename FiniteElementMap::FiniteElement, Element > FiniteElement
Definition brezzidouglasmarinibasis.hh:234
│ │ │ -
const FiniteElementMap * finiteElementMap_
Definition brezzidouglasmarinibasis.hh:270
│ │ │ -
std::size_t size_type
Definition brezzidouglasmarinibasis.hh:231
│ │ │ -
FiniteElement finiteElement_
Definition brezzidouglasmarinibasis.hh:268
│ │ │ -
const Element * element_
Definition brezzidouglasmarinibasis.hh:269
│ │ │ -
void bind(const Element &e)
Bind to element.
Definition brezzidouglasmarinibasis.hh:259
│ │ │ -
BrezziDouglasMariniNode(const FiniteElementMap *finiteElementMap)
Definition brezzidouglasmarinibasis.hh:238
│ │ │ -
const Element & element() const
Return current element, throw if unbound.
Definition brezzidouglasmarinibasis.hh:244
│ │ │ -
Definition brezzidouglasmarinibasis.hh:167
│ │ │ -
std::size_t size_type
Definition brezzidouglasmarinibasis.hh:189
│ │ │ -
BrezziDouglasMariniNode< GV, k > Node
Definition brezzidouglasmarinibasis.hh:191
│ │ │ -
Node makeNode() const
Create tree node.
Definition brezzidouglasmarinibasis.hh:214
│ │ │ -
GV GridView
The grid view that the FE space is defined on.
Definition brezzidouglasmarinibasis.hh:188
│ │ │ -
BrezziDouglasMariniPreBasis(const GridView &gv)
Constructor for a given grid view object.
Definition brezzidouglasmarinibasis.hh:194
│ │ │ -
FiniteElementMap finiteElementMap_
Definition brezzidouglasmarinibasis.hh:220
│ │ │ -
void update(const GridView &gv)
Definition brezzidouglasmarinibasis.hh:205
│ │ │ +
Definition containerfactory.hh:20
│ │ │
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:53
│ │ │ -
void update(const GridView &gv)
Update the stored GridView.
Definition leafprebasismappermixin.hh:101
│ │ │ -
LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout)
Construct from GridView and local DOF layout.
Definition leafprebasismappermixin.hh:74
│ │ │ -
void setSize(const size_type size)
Definition nodes.hh:197
│ │ │ -
Definition nodes.hh:218
│ │ │ +
Definition lagrangebasis.hh:379
│ │ │ +
A pre-basis for a PQ-lagrange bases with given order.
Definition lagrangebasis.hh:65
│ │ │ +
size_type size(const SizePrefix &prefix) const
Definition leafprebasismixin.hh:53
│ │ │ + │ │ │ + │ │ │ + │ │ │ +
const auto & child(Dune::index_constant< i > ii) const
Definition nodes.hh:408
│ │ │ +
void setChild(TT &&t, Dune::index_constant< i > ii={})
Definition nodes.hh:458
│ │ │ +
Definition taylorhoodbasis.hh:288
│ │ │ +
TaylorHoodVelocityTree()
Definition taylorhoodbasis.hh:293
│ │ │ +
Definition taylorhoodbasis.hh:306
│ │ │ +
TaylorHoodBasisTree()
Definition taylorhoodbasis.hh:313
│ │ │ +
Pre-basis for lowest order Taylor-Hood basis.
Definition taylorhoodbasis.hh:61
│ │ │ +
TaylorHoodPreBasis(const GridView &gv)
Constructor for a given grid view object.
Definition taylorhoodbasis.hh:89
│ │ │ +
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition taylorhoodbasis.hh:103
│ │ │ +
static constexpr size_type minMultiIndexSize
Definition taylorhoodbasis.hh:78
│ │ │ +
size_type size(const SizePrefix &prefix) const
Return number of possible values for next position in multi index.
Definition taylorhoodbasis.hh:131
│ │ │ +
GridView gridView_
Definition taylorhoodbasis.hh:277
│ │ │ +
GV GridView
The grid view that the FE basis is defined on.
Definition taylorhoodbasis.hh:69
│ │ │ +
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition taylorhoodbasis.hh:109
│ │ │ +
auto containerDescriptor() const
Return an container descriptor depending on the flag HI. Either return a Tuple if hybrid indices shou...
Definition taylorhoodbasis.hh:204
│ │ │ +
TaylorHoodBasisTree< GV > Node
Template mapping root tree path to type of created tree node.
Definition taylorhoodbasis.hh:75
│ │ │ +
PQ2PreBasis pq2PreBasis_
Definition taylorhoodbasis.hh:280
│ │ │ +
size_type size() const
Same as size(prefix) with empty prefix.
Definition taylorhoodbasis.hh:124
│ │ │ +
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition taylorhoodbasis.hh:182
│ │ │ +
PQ1PreBasis pq1PreBasis_
Definition taylorhoodbasis.hh:279
│ │ │ +
static const void multiIndexPushFront(MultiIndex &M, size_type M0)
Definition taylorhoodbasis.hh:221
│ │ │ +
static constexpr size_type maxMultiIndexSize
Definition taylorhoodbasis.hh:77
│ │ │ +
Node makeNode() const
Create tree node.
Definition taylorhoodbasis.hh:118
│ │ │ +
It indices(const Node &node, It it) const
Definition taylorhoodbasis.hh:194
│ │ │ +
static constexpr size_type multiIndexBufferSize
Definition taylorhoodbasis.hh:79
│ │ │ +
void initializeIndices()
Initialize the global indices.
Definition taylorhoodbasis.hh:96
│ │ │ +
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition taylorhoodbasis.hh:188
│ │ │ +
std::size_t size_type
Type used for indices and size information.
Definition taylorhoodbasis.hh:72
│ │ │ +
It indicesImp(const Node &node, It multiIndices) const
Definition taylorhoodbasis.hh:231
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,446 +1,465 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -brezzidouglasmarinibasis.hh │ │ │ │ +taylorhoodbasis.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BREZZIDOUGLASMARINIBASIS_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BREZZIDOUGLASMARINIBASIS_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH │ │ │ │ +8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ -12#include │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ +12#include │ │ │ │ 13 │ │ │ │ -14#include │ │ │ │ -15#include │ │ │ │ -16 │ │ │ │ -17#include │ │ │ │ -18#include │ │ │ │ -19#include │ │ │ │ -20#include │ │ │ │ -21#include │ │ │ │ -22 │ │ │ │ -23#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/ │ │ │ │ -_g_l_o_b_a_l_v_a_l_u_e_d_l_o_c_a_l_f_i_n_i_t_e_e_l_e_m_e_n_t_._h_h> │ │ │ │ -24#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -25#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ -26#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h> │ │ │ │ -27 │ │ │ │ -28namespace _D_u_n_e { │ │ │ │ -29namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -30 │ │ │ │ -31namespace Impl { │ │ │ │ -32 │ │ │ │ -33 template │ │ │ │ -34 struct BDMSimplexLocalInfo │ │ │ │ -35 { │ │ │ │ -36 static_assert((AlwaysFalse::value),"The requested type of BDM element is │ │ │ │ -not implemented, sorry!"); │ │ │ │ -37 }; │ │ │ │ -38 │ │ │ │ -39 template │ │ │ │ -40 struct BDMSimplexLocalInfo<2,D,R,1> │ │ │ │ -41 { │ │ │ │ -42 using FiniteElement = BDM1Simplex2DLocalFiniteElement; │ │ │ │ -43 static const std::size_t Variants = 8; │ │ │ │ -44 }; │ │ │ │ -45 │ │ │ │ -46 template │ │ │ │ -47 struct BDMSimplexLocalInfo<2,D,R,2> │ │ │ │ -48 { │ │ │ │ -49 using FiniteElement = BDM2Simplex2DLocalFiniteElement; │ │ │ │ -50 static const std::size_t Variants = 8; │ │ │ │ -51 }; │ │ │ │ -52 │ │ │ │ -53 template │ │ │ │ -54 struct BDMCubeLocalInfo │ │ │ │ -55 { │ │ │ │ -56 static_assert((AlwaysFalse::value),"The requested type of BDM element is │ │ │ │ -not implemented, sorry!"); │ │ │ │ -57 }; │ │ │ │ -58 │ │ │ │ -59 template │ │ │ │ -60 struct BDMCubeLocalInfo<2,D,R,1> │ │ │ │ -61 { │ │ │ │ -62 using FiniteElement = BDM1Cube2DLocalFiniteElement; │ │ │ │ -63 static const std::size_t Variants = 16; │ │ │ │ -64 }; │ │ │ │ +14#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ +15#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_a_g_r_a_n_g_e_b_a_s_i_s_._h_h> │ │ │ │ +16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ +17 │ │ │ │ +18namespace _D_u_n_e { │ │ │ │ +19namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +20 │ │ │ │ +21 │ │ │ │ +22/ │ │ │ │ +/ ***************************************************************************** │ │ │ │ +23// This is the reusable part of the basis. It contains │ │ │ │ +24// │ │ │ │ +25// TaylorHoodPreBasis │ │ │ │ +26// TaylorHoodBasisTree │ │ │ │ +27// TaylorHoodVelocityTree │ │ │ │ +28// │ │ │ │ +29// The pre-basis allows to create the others and is the owner of possible │ │ │ │ +shared │ │ │ │ +30// state. These components do _not_ depend on the global basis and local view │ │ │ │ +31// and can be used without a global basis. │ │ │ │ +32/ │ │ │ │ +/ ***************************************************************************** │ │ │ │ +33 │ │ │ │ +34template │ │ │ │ +35class _T_a_y_l_o_r_H_o_o_d_V_e_l_o_c_i_t_y_T_r_e_e; │ │ │ │ +36 │ │ │ │ +37template │ │ │ │ +38class _T_a_y_l_o_r_H_o_o_d_B_a_s_i_s_T_r_e_e; │ │ │ │ +39 │ │ │ │ +59template │ │ │ │ +_6_0class _T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s │ │ │ │ +61{ │ │ │ │ +62 static const bool useHybridIndices = HI; │ │ │ │ +63 │ │ │ │ +64 static const int dim = GV::dimension; │ │ │ │ 65 │ │ │ │ -66 template │ │ │ │ -67 struct BDMCubeLocalInfo<2,D,R,2> │ │ │ │ -68 { │ │ │ │ -69 using FiniteElement = BDM2Cube2DLocalFiniteElement; │ │ │ │ -70 static const std::size_t Variants = 16; │ │ │ │ -71 }; │ │ │ │ -72 │ │ │ │ -73 template │ │ │ │ -74 struct BDMCubeLocalInfo<3,D,R,1> │ │ │ │ -75 { │ │ │ │ -76 using FiniteElement = BDM1Cube3DLocalFiniteElement; │ │ │ │ -77 static const std::size_t Variants = 64; │ │ │ │ -78 }; │ │ │ │ -79 │ │ │ │ -80 template │ │ │ │ -81 class BDMLocalFiniteElementMap │ │ │ │ -82 { │ │ │ │ -83 using D = typename GV::ctype; │ │ │ │ -84 constexpr static auto dim = GV::dimension; │ │ │ │ -85 using CubeFiniteElement = typename BDMCubeLocalInfo:: │ │ │ │ -FiniteElement; │ │ │ │ -86 using SimplexFiniteElement = typename BDMSimplexLocalInfo:: │ │ │ │ -FiniteElement; │ │ │ │ +66public: │ │ │ │ +67 │ │ │ │ +_6_9 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ +70 │ │ │ │ +_7_2 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ +73 │ │ │ │ +_7_5 using _N_o_d_e = _T_a_y_l_o_r_H_o_o_d_B_a_s_i_s_T_r_e_e_<_G_V_>; │ │ │ │ +76 │ │ │ │ +_7_7 static constexpr _s_i_z_e___t_y_p_e _m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e = useHybridIndices ? 3 : 2; │ │ │ │ +_7_8 static constexpr _s_i_z_e___t_y_p_e _m_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e = 2; │ │ │ │ +_7_9 static constexpr _s_i_z_e___t_y_p_e _m_u_l_t_i_I_n_d_e_x_B_u_f_f_e_r_S_i_z_e = _m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e; │ │ │ │ +80 │ │ │ │ +81private: │ │ │ │ +82 │ │ │ │ +83 using PQ1PreBasis = _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_G_V_,_1_>; │ │ │ │ +84 using PQ2PreBasis = _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_G_V_,_2_>; │ │ │ │ +85 │ │ │ │ +86public: │ │ │ │ 87 │ │ │ │ -88 public: │ │ │ │ -89 │ │ │ │ -90 using T = LocalBasisTraits, R, dim, │ │ │ │ -FieldVector, FieldMatrix >; │ │ │ │ -91 using FiniteElement = LocalFiniteElementVirtualInterface; │ │ │ │ -92 │ │ │ │ -93 BDMLocalFiniteElementMap(const GV& gv) │ │ │ │ -94 : is_(&(gv.indexSet())), orient_(gv.size(0)) │ │ │ │ -95 { │ │ │ │ -96 update(gv); │ │ │ │ -97 } │ │ │ │ -98 │ │ │ │ -99 void update(const GV& gv) │ │ │ │ -100 { │ │ │ │ -101 is_ = &(gv.indexSet()); │ │ │ │ -102 orient_.resize(gv.size(0)); │ │ │ │ -103 │ │ │ │ -104 cubeVariant_.resize(BDMCubeLocalInfo::Variants); │ │ │ │ -105 simplexVariant_.resize(BDMSimplexLocalInfo::Variants); │ │ │ │ -106 │ │ │ │ -107 // create all variants │ │ │ │ -108 for (size_t i = 0; i < cubeVariant_.size(); i++) │ │ │ │ -109 cubeVariant_[i] = std:: │ │ │ │ -make_shared >(CubeFiniteElement │ │ │ │ -(i)); │ │ │ │ -110 │ │ │ │ -111 for (size_t i = 0; i < simplexVariant_.size(); i++) │ │ │ │ -112 simplexVariant_[i] = std:: │ │ │ │ -make_shared > │ │ │ │ -(SimplexFiniteElement(i)); │ │ │ │ -113 │ │ │ │ -114 // compute orientation for all elements │ │ │ │ -115 // loop once over the grid │ │ │ │ -116 for(const auto& cell : _e_l_e_m_e_n_t_s(gv)) │ │ │ │ -117 { │ │ │ │ -118 unsigned int myId = is_->index(cell); │ │ │ │ -119 orient_[myId] = 0; │ │ │ │ -120 │ │ │ │ -121 for (const auto& intersection : _i_n_t_e_r_s_e_c_t_i_o_n_s(gv,cell)) │ │ │ │ -122 { │ │ │ │ -123 if (intersection.neighbor() && (is_->index(intersection.outside()) > myId)) │ │ │ │ -124 orient_[myId] |= (1 << intersection.indexInInside()); │ │ │ │ -125 } │ │ │ │ -126 } │ │ │ │ +_8_9 _T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s(const _G_r_i_d_V_i_e_w& gv) : │ │ │ │ +90 _g_r_i_d_V_i_e_w__(gv), │ │ │ │ +91 _p_q_1_P_r_e_B_a_s_i_s__(gv), │ │ │ │ +92 _p_q_2_P_r_e_B_a_s_i_s__(gv) │ │ │ │ +93 {} │ │ │ │ +94 │ │ │ │ +_9_6 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ +97 { │ │ │ │ +98 _p_q_1_P_r_e_B_a_s_i_s__.initializeIndices(); │ │ │ │ +99 _p_q_2_P_r_e_B_a_s_i_s__.initializeIndices(); │ │ │ │ +100 } │ │ │ │ +101 │ │ │ │ +_1_0_3 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ +104 { │ │ │ │ +105 return _g_r_i_d_V_i_e_w__; │ │ │ │ +106 } │ │ │ │ +107 │ │ │ │ +_1_0_9 void _u_p_d_a_t_e (const _G_r_i_d_V_i_e_w& gv) │ │ │ │ +110 { │ │ │ │ +111 _p_q_1_P_r_e_B_a_s_i_s__.update(gv); │ │ │ │ +112 _p_q_2_P_r_e_B_a_s_i_s__.update(gv); │ │ │ │ +113 } │ │ │ │ +114 │ │ │ │ +_1_1_8 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ +119 { │ │ │ │ +120 return _N_o_d_e{}; │ │ │ │ +121 } │ │ │ │ +122 │ │ │ │ +_1_2_4 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ +125 { │ │ │ │ +126 return 2; │ │ │ │ 127 } │ │ │ │ 128 │ │ │ │ -130 template │ │ │ │ -131 const FiniteElement& find(const EntityType& e) const │ │ │ │ +130 template │ │ │ │ +_1_3_1 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix) const │ │ │ │ 132 { │ │ │ │ -133 if (e.type().isCube()) │ │ │ │ -134 return *cubeVariant_[orient_[is_->index(e)]]; │ │ │ │ -135 else │ │ │ │ -136 return *simplexVariant_[orient_[is_->index(e)]]; │ │ │ │ -137 } │ │ │ │ -138 │ │ │ │ -139 private: │ │ │ │ -140 std::vector │ │ │ │ -> > cubeVariant_; │ │ │ │ -141 std::vector > > │ │ │ │ -simplexVariant_; │ │ │ │ -142 const typename GV::IndexSet* is_; │ │ │ │ -143 std::vector orient_; │ │ │ │ -144 }; │ │ │ │ -145 │ │ │ │ -146 │ │ │ │ -147} // namespace Impl │ │ │ │ -148 │ │ │ │ -149 │ │ │ │ -150/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -151// This is the reusable part of the basis. It contains │ │ │ │ -152// │ │ │ │ -153// BrezziDouglasMariniPreBasis │ │ │ │ -154// BrezziDouglasMariniNode │ │ │ │ -155// │ │ │ │ -156// The pre-basis allows to create the others and is the owner of possible │ │ │ │ -shared │ │ │ │ -157// state. These components do _not_ depend on the global basis and local │ │ │ │ -view │ │ │ │ -158// and can be used without a global basis. │ │ │ │ -159/ │ │ │ │ -/ ***************************************************************************** │ │ │ │ -160 │ │ │ │ -161template │ │ │ │ -162class _B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_N_o_d_e; │ │ │ │ -163 │ │ │ │ -164template │ │ │ │ -_1_6_5class _B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_P_r_e_B_a_s_i_s : │ │ │ │ -166 public _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n │ │ │ │ -167{ │ │ │ │ -168 using Base = _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_<_G_V_>; │ │ │ │ -169 static const int dim = GV::dimension; │ │ │ │ -170 │ │ │ │ -171 // Degrees of freedom per subentity │ │ │ │ -172 static MCMGLayout dofLayout() │ │ │ │ -173 { │ │ │ │ -174 return [](GeometryType gt, size_t gridDim) -> size_t { │ │ │ │ -175 if (gt.dim() == gridDim) │ │ │ │ -176 return dim*(k-1)*3; │ │ │ │ -177 if (gt.dim() == gridDim-1) │ │ │ │ -178 return dim+(k-1); │ │ │ │ -179 return 0; │ │ │ │ -180 }; │ │ │ │ -181 } │ │ │ │ -182 │ │ │ │ -183 using FiniteElementMap = typename Impl::BDMLocalFiniteElementMap; │ │ │ │ -184 │ │ │ │ -185public: │ │ │ │ +133 return sizeImp(prefix); │ │ │ │ +134 } │ │ │ │ +135 │ │ │ │ +136private: │ │ │ │ +137 │ │ │ │ +138 template = 0> │ │ │ │ +140 _s_i_z_e___t_y_p_e sizeImp(const SizePrefix& prefix) const │ │ │ │ +141 { │ │ │ │ +142 if (prefix.size() == 0) │ │ │ │ +143 return 2; │ │ │ │ +144 if (prefix.size() == 1) │ │ │ │ +145 { │ │ │ │ +146 if (prefix[0] == 0) │ │ │ │ +147 return dim * _p_q_2_P_r_e_B_a_s_i_s__._s_i_z_e(); │ │ │ │ +148 if (prefix[0] == 1) │ │ │ │ +149 return _p_q_1_P_r_e_B_a_s_i_s__._s_i_z_e(); │ │ │ │ +150 } │ │ │ │ +151 assert(prefix.size() == 2); │ │ │ │ +152 return 0; │ │ │ │ +153 } │ │ │ │ +154 │ │ │ │ +155 template = 0> │ │ │ │ +157 _s_i_z_e___t_y_p_e sizeImp(const SizePrefix& prefix) const │ │ │ │ +158 { │ │ │ │ +159 if (prefix.size() == 0) │ │ │ │ +160 return 2; │ │ │ │ +161 if (prefix.size() == 1) │ │ │ │ +162 { │ │ │ │ +163 if (prefix[0] == 0) │ │ │ │ +164 return _p_q_2_P_r_e_B_a_s_i_s__._s_i_z_e(); │ │ │ │ +165 if (prefix[0] == 1) │ │ │ │ +166 return _p_q_1_P_r_e_B_a_s_i_s__._s_i_z_e(); │ │ │ │ +167 } │ │ │ │ +168 if (prefix.size() == 2) │ │ │ │ +169 { │ │ │ │ +170 if (prefix[0] == 0) │ │ │ │ +171 return dim; │ │ │ │ +172 if (prefix[0] == 1) │ │ │ │ +173 return 0; │ │ │ │ +174 } │ │ │ │ +175 assert(prefix.size() == 3); │ │ │ │ +176 return 0; │ │ │ │ +177 } │ │ │ │ +178 │ │ │ │ +179public: │ │ │ │ +180 │ │ │ │ +_1_8_2 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ +183 { │ │ │ │ +184 return dim * _p_q_2_P_r_e_B_a_s_i_s__.size() + _p_q_1_P_r_e_B_a_s_i_s__.size(); │ │ │ │ +185 } │ │ │ │ 186 │ │ │ │ -_1_8_8 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ -_1_8_9 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ -190 │ │ │ │ -_1_9_1 using _N_o_d_e = _B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_N_o_d_e_<_G_V_,_ _k_>; │ │ │ │ +_1_8_8 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ +189 { │ │ │ │ +190 return dim * _p_q_2_P_r_e_B_a_s_i_s__.maxNodeSize() + _p_q_1_P_r_e_B_a_s_i_s__.maxNodeSize(); │ │ │ │ +191 } │ │ │ │ 192 │ │ │ │ -_1_9_4 _B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_P_r_e_B_a_s_i_s(const _G_r_i_d_V_i_e_w& gv) : │ │ │ │ -195 Base(gv, dofLayout()), │ │ │ │ -196 _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__(gv) │ │ │ │ -197 { │ │ │ │ -198 // There is no inherent reason why the basis shouldn't work for grids with │ │ │ │ -more than one │ │ │ │ -199 // element types. Somebody simply has to sit down and implement the missing │ │ │ │ -bits. │ │ │ │ -200 if (gv.indexSet().types(0).size() > 1) │ │ │ │ -201 DUNE_THROW(Dune::NotImplemented, "Brezzi-Douglas-Marini basis is only │ │ │ │ -implemented for grids with a single element type"); │ │ │ │ -202 } │ │ │ │ -203 │ │ │ │ -204 /* \brief Update the stored grid view, to be called if the grid has changed │ │ │ │ -*/ │ │ │ │ -_2_0_5 void _u_p_d_a_t_e (const _G_r_i_d_V_i_e_w& gv) │ │ │ │ -206 { │ │ │ │ -207 _B_a_s_e_:_:_u_p_d_a_t_e(gv); │ │ │ │ -208 _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__.update(gv); │ │ │ │ -209 } │ │ │ │ -210 │ │ │ │ -_2_1_4 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ -215 { │ │ │ │ -216 return _N_o_d_e{&_f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__}; │ │ │ │ -217 } │ │ │ │ -218 │ │ │ │ -219protected: │ │ │ │ -_2_2_0 FiniteElementMap _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__; │ │ │ │ -221}; │ │ │ │ -222 │ │ │ │ -223 │ │ │ │ -224 │ │ │ │ -225template │ │ │ │ -_2_2_6class _B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_N_o_d_e : │ │ │ │ -227 public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ -228{ │ │ │ │ -229public: │ │ │ │ -230 │ │ │ │ -_2_3_1 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ -_2_3_2 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ -_2_3_3 using _F_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p = typename Impl::BDMLocalFiniteElementMap; │ │ │ │ -_2_3_4 using _F_i_n_i_t_e_E_l_e_m_e_n_t = Impl::GlobalValuedLocalFiniteElement; │ │ │ │ -237 │ │ │ │ -_2_3_8 _B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_N_o_d_e(const _F_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p* finiteElementMap) : │ │ │ │ -239 _e_l_e_m_e_n_t__(nullptr), │ │ │ │ -240 _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__(finiteElementMap) │ │ │ │ -241 {} │ │ │ │ -242 │ │ │ │ -_2_4_4 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ -245 { │ │ │ │ -246 return *_e_l_e_m_e_n_t__; │ │ │ │ -247 } │ │ │ │ -248 │ │ │ │ -_2_5_3 const _F_i_n_i_t_e_E_l_e_m_e_n_t& _f_i_n_i_t_e_E_l_e_m_e_n_t() const │ │ │ │ -254 { │ │ │ │ -255 return _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ -256 } │ │ │ │ -257 │ │ │ │ -_2_5_9 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ -260 { │ │ │ │ -261 _e_l_e_m_e_n_t__ = &e; │ │ │ │ -262 _f_i_n_i_t_e_E_l_e_m_e_n_t__.bind((_f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__->find(*_e_l_e_m_e_n_t__)), e); │ │ │ │ -263 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__.size()); │ │ │ │ -264 } │ │ │ │ -265 │ │ │ │ -266protected: │ │ │ │ -267 │ │ │ │ -_2_6_8 _F_i_n_i_t_e_E_l_e_m_e_n_t _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ -_2_6_9 const _E_l_e_m_e_n_t* _e_l_e_m_e_n_t__; │ │ │ │ -_2_7_0 const _F_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p* _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__; │ │ │ │ -271}; │ │ │ │ -272 │ │ │ │ -273 │ │ │ │ -274 │ │ │ │ -275namespace _B_a_s_i_s_F_a_c_t_o_r_y { │ │ │ │ +193 template │ │ │ │ +_1_9_4 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ +195 { │ │ │ │ +196 return _i_n_d_i_c_e_s_I_m_p_<_u_s_e_H_y_b_r_i_d_I_n_d_i_c_e_s_>(node, it); │ │ │ │ +197 } │ │ │ │ +198 │ │ │ │ +_2_0_4 auto _c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r() const │ │ │ │ +205 { │ │ │ │ +206 namespace CD = _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s; │ │ │ │ +207 if constexpr(HI) │ │ │ │ +208 return CD::makeDescriptor( │ │ │ │ +209 CD::makeUniformDescriptor(_p_q_2_P_r_e_B_a_s_i_s__.size(), │ │ │ │ +210 CD::FlatArray{}), │ │ │ │ +211 CD::FlatVector{pq1PreBasis_.size()}); │ │ │ │ +212 else │ │ │ │ +213 return CD::Array{ │ │ │ │ +214 CD::FlatVector{GV::dimension * _p_q_2_P_r_e_B_a_s_i_s__.size()}, │ │ │ │ +215 CD::FlatVector{_p_q_1_P_r_e_B_a_s_i_s__.size()} }; │ │ │ │ +216 } │ │ │ │ +217 │ │ │ │ +218protected: │ │ │ │ +219 │ │ │ │ +220 template │ │ │ │ +_2_2_1 static const void _m_u_l_t_i_I_n_d_e_x_P_u_s_h_F_r_o_n_t(MultiIndex& M, _s_i_z_e___t_y_p_e M0) │ │ │ │ +222 { │ │ │ │ +223 M.resize(M.size()+1); │ │ │ │ +224 for(std::size_t i=M.size()-1; i>0; --i) │ │ │ │ +225 M[i] = M[i-1]; │ │ │ │ +226 M[0] = M0; │ │ │ │ +227 } │ │ │ │ +228 │ │ │ │ +229 template = 0> │ │ │ │ +_2_3_1 It _i_n_d_i_c_e_s_I_m_p(const _N_o_d_e& node, It multiIndices) const │ │ │ │ +232 { │ │ │ │ +233 using namespace Dune::Indices; │ │ │ │ +234 for(std::size_t child=0; child = 0> │ │ │ │ +_2_5_5 It _i_n_d_i_c_e_s_I_m_p(const _N_o_d_e& node, It multiIndices) const │ │ │ │ +256 { │ │ │ │ +257 using namespace Dune::Indices; │ │ │ │ +258 for(std::size_t child=0; child │ │ │ │ -_2_8_5auto _b_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i() │ │ │ │ -286{ │ │ │ │ -287 return [](const auto& gridView) { │ │ │ │ -288 return _B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_P_r_e_B_a_s_i_s, k> │ │ │ │ -(gridView); │ │ │ │ -289 }; │ │ │ │ -290} │ │ │ │ +_2_7_7 _G_r_i_d_V_i_e_w _g_r_i_d_V_i_e_w__; │ │ │ │ +278 │ │ │ │ +_2_7_9 PQ1PreBasis _p_q_1_P_r_e_B_a_s_i_s__; │ │ │ │ +_2_8_0 PQ2PreBasis _p_q_2_P_r_e_B_a_s_i_s__; │ │ │ │ +281}; │ │ │ │ +282 │ │ │ │ +283 │ │ │ │ +284 │ │ │ │ +285template │ │ │ │ +_2_8_6class _T_a_y_l_o_r_H_o_o_d_V_e_l_o_c_i_t_y_T_r_e_e : │ │ │ │ +287 public _P_o_w_e_r_B_a_s_i_s_N_o_d_e, GV::dimension> │ │ │ │ +288{ │ │ │ │ +289 using PQ2Node = _L_a_g_r_a_n_g_e_N_o_d_e_<_G_V_,_2_>; │ │ │ │ +290 using Base = _P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_P_Q_2_N_o_d_e_,_ _G_V_:_:_d_i_m_e_n_s_i_o_n_>; │ │ │ │ 291 │ │ │ │ -292} // end namespace BasisFactory │ │ │ │ -293 │ │ │ │ -294 │ │ │ │ -295 │ │ │ │ -296/ │ │ │ │ +292public: │ │ │ │ +_2_9_3 _T_a_y_l_o_r_H_o_o_d_V_e_l_o_c_i_t_y_T_r_e_e() │ │ │ │ +294 { │ │ │ │ +295 for(int i=0; i_s_e_t_C_h_i_l_d(i, PQ2Node()); │ │ │ │ +297 } │ │ │ │ +298}; │ │ │ │ +299 │ │ │ │ +300template │ │ │ │ +_3_0_1class _T_a_y_l_o_r_H_o_o_d_B_a_s_i_s_T_r_e_e : │ │ │ │ +302 public _C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e< │ │ │ │ +303 TaylorHoodVelocityTree, │ │ │ │ +304 LagrangeNode │ │ │ │ +305 > │ │ │ │ +306{ │ │ │ │ +307 using VelocityNode=_T_a_y_l_o_r_H_o_o_d_V_e_l_o_c_i_t_y_T_r_e_e_<_G_V_>; │ │ │ │ +308 using PressureNode=_L_a_g_r_a_n_g_e_N_o_d_e_<_G_V_,_1_>; │ │ │ │ +309 │ │ │ │ +310 using Base=_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_<_V_e_l_o_c_i_t_y_N_o_d_e_,_ _P_r_e_s_s_u_r_e_N_o_d_e_>; │ │ │ │ +311 │ │ │ │ +312public: │ │ │ │ +_3_1_3 _T_a_y_l_o_r_H_o_o_d_B_a_s_i_s_T_r_e_e() │ │ │ │ +314 { │ │ │ │ +315 this->template _s_e_t_C_h_i_l_d_<_0_>(VelocityNode()); │ │ │ │ +316 this->template _s_e_t_C_h_i_l_d_<_1_>(PressureNode()); │ │ │ │ +317 } │ │ │ │ +318}; │ │ │ │ +319 │ │ │ │ +320 │ │ │ │ +321 │ │ │ │ +322namespace BasisFactory { │ │ │ │ +323 │ │ │ │ +_3_3_0inline auto _t_a_y_l_o_r_H_o_o_d() │ │ │ │ +331{ │ │ │ │ +332 return [](const auto& gridView) { │ │ │ │ +333 return _T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s>(gridView); │ │ │ │ +334 }; │ │ │ │ +335} │ │ │ │ +336 │ │ │ │ +337} // end namespace BasisFactory │ │ │ │ +338 │ │ │ │ +339/ │ │ │ │ / ***************************************************************************** │ │ │ │ -297// This is the actual global basis implementation based on the reusable │ │ │ │ +340// This is the actual global basis implementation based on the reusable │ │ │ │ parts. │ │ │ │ -298/ │ │ │ │ +341/ │ │ │ │ / ***************************************************************************** │ │ │ │ -299 │ │ │ │ -307template │ │ │ │ -_3_0_8using _B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_B_a_s_i_s = │ │ │ │ -_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_P_r_e_B_a_s_i_s_<_G_V_,_ _k_> >; │ │ │ │ -309 │ │ │ │ -310} // end namespace Functions │ │ │ │ -311} // end namespace Dune │ │ │ │ -312 │ │ │ │ -313 │ │ │ │ -314#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BREZZIDOUGLASMARINIBASIS_HH │ │ │ │ +342 │ │ │ │ +364template │ │ │ │ +_3_6_5using _T_a_y_l_o_r_H_o_o_d_B_a_s_i_s = _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_<_G_V_> >; │ │ │ │ +366 │ │ │ │ +367 │ │ │ │ +368 │ │ │ │ +369} // end namespace Functions │ │ │ │ +370} // end namespace Dune │ │ │ │ +371 │ │ │ │ +372 │ │ │ │ +373#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH │ │ │ │ _n_o_d_e_s_._h_h │ │ │ │ -_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h │ │ │ │ -_g_l_o_b_a_l_v_a_l_u_e_d_l_o_c_a_l_f_i_n_i_t_e_e_l_e_m_e_n_t_._h_h │ │ │ │ +_l_a_g_r_a_n_g_e_b_a_s_i_s_._h_h │ │ │ │ _d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_b_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i │ │ │ │ -auto brezziDouglasMarini() │ │ │ │ -Create a pre-basis factory that can create a Brezzi-Douglas-Marini pre-basis. │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:285 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_e_l_e_m_e_n_t_s │ │ │ │ -auto elements(const SubDomainGridView< HostGridView > &subDomainGridView) │ │ │ │ -ADL findable access to element range for a SubDomainGridView. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:487 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_i_n_t_e_r_s_e_c_t_i_o_n_s │ │ │ │ -auto intersections(const SubDomainGridView< HostGridView > &subDomainGridView, │ │ │ │ -const Element &element) │ │ │ │ -ADL findable access to intersection range for an element of a │ │ │ │ -SubDomainGridView. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:510 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_t_a_y_l_o_r_H_o_o_d │ │ │ │ +auto taylorHood() │ │ │ │ +Create a pre-basis factory that can create a Taylor-Hood pre-basis. │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:330 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_B_a_s_i_s │ │ │ │ +DefaultGlobalBasis< TaylorHoodPreBasis< GV > > TaylorHoodBasis │ │ │ │ +Nodal basis for a lowest order Taylor-Hood Lagrangean finite element space. │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:365 │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_B_a_s_i_s │ │ │ │ -DefaultGlobalBasis< BrezziDouglasMariniPreBasis< GV, k > > │ │ │ │ -BrezziDouglasMariniBasis │ │ │ │ -Basis of a scalar k-th-order BDM finite element space on simplex and cube │ │ │ │ -grids. │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:308 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:926 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_N_o_d_e │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:228 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ -const FiniteElement & finiteElement() const │ │ │ │ -Return the LocalFiniteElement for the element we are bound to. │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:253 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_N_o_d_e_:_:_F_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p │ │ │ │ -typename Impl::BDMLocalFiniteElementMap< GV, double, k > FiniteElementMap │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:233 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_N_o_d_e_:_:_E_l_e_m_e_n_t │ │ │ │ -typename GV::template Codim< 0 >::Entity Element │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:232 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_N_o_d_e_:_:_F_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ -Impl::GlobalValuedLocalFiniteElement< Impl::ContravariantPiolaTransformator, │ │ │ │ -typename FiniteElementMap::FiniteElement, Element > FiniteElement │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:234 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__ │ │ │ │ -const FiniteElementMap * finiteElementMap_ │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:270 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_N_o_d_e_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:231 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t__ │ │ │ │ -FiniteElement finiteElement_ │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:268 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_N_o_d_e_:_:_e_l_e_m_e_n_t__ │ │ │ │ -const Element * element_ │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:269 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_N_o_d_e_:_:_b_i_n_d │ │ │ │ -void bind(const Element &e) │ │ │ │ -Bind to element. │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:259 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_N_o_d_e_:_:_B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_N_o_d_e │ │ │ │ -BrezziDouglasMariniNode(const FiniteElementMap *finiteElementMap) │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:238 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_N_o_d_e_:_:_e_l_e_m_e_n_t │ │ │ │ -const Element & element() const │ │ │ │ -Return current element, throw if unbound. │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:244 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_P_r_e_B_a_s_i_s │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:167 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_P_r_e_B_a_s_i_s_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:189 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_P_r_e_B_a_s_i_s_:_:_N_o_d_e │ │ │ │ -BrezziDouglasMariniNode< GV, k > Node │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:191 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_P_r_e_B_a_s_i_s_:_:_m_a_k_e_N_o_d_e │ │ │ │ -Node makeNode() const │ │ │ │ -Create tree node. │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:214 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ -GV GridView │ │ │ │ -The grid view that the FE space is defined on. │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:188 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_P_r_e_B_a_s_i_s_:_:_B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_P_r_e_B_a_s_i_s │ │ │ │ -BrezziDouglasMariniPreBasis(const GridView &gv) │ │ │ │ -Constructor for a given grid view object. │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:194 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_P_r_e_B_a_s_i_s_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__ │ │ │ │ -FiniteElementMap finiteElementMap_ │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:220 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_P_r_e_B_a_s_i_s_:_:_u_p_d_a_t_e │ │ │ │ -void update(const GridView &gv) │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:205 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s │ │ │ │ +DDeeffiinniittiioonn containerfactory.hh:20 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ Global basis for given pre-basis. │ │ │ │ DDeeffiinniittiioonn defaultglobalbasis.hh:53 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_u_p_d_a_t_e │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:379 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s │ │ │ │ +A pre-basis for a PQ-lagrange bases with given order. │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:65 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_i_x_i_n_<_ _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _k_,_ _R_ _>_ _>_:_:_s_i_z_e │ │ │ │ +size_type size(const SizePrefix &prefix) const │ │ │ │ +DDeeffiinniittiioonn leafprebasismixin.hh:53 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_ _L_a_g_r_a_n_g_e_N_o_d_e_<_ _G_V_,_ _2_ _>_,_ _G_V_:_:_d_i_m_e_n_s_i_o_n_ _>_:_: │ │ │ │ +_P_o_w_e_r_B_a_s_i_s_N_o_d_e │ │ │ │ +PowerBasisNode()=default │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_ _L_a_g_r_a_n_g_e_N_o_d_e_<_ _G_V_,_ _2_ _>_,_ _G_V_:_:_d_i_m_e_n_s_i_o_n_ _>_:_: │ │ │ │ +_s_e_t_C_h_i_l_d │ │ │ │ +void setChild(Index i, TT &&t) │ │ │ │ +DDeeffiinniittiioonn nodes.hh:317 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_<_ _T_a_y_l_o_r_H_o_o_d_V_e_l_o_c_i_t_y_T_r_e_e_<_ _G_V_ _>_, │ │ │ │ +_L_a_g_r_a_n_g_e_N_o_d_e_<_ _G_V_,_ _1_ _>_ _>_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e │ │ │ │ +CompositeBasisNode()=default │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ +const auto & child(Dune::index_constant< i > ii) const │ │ │ │ +DDeeffiinniittiioonn nodes.hh:408 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_<_ _T_a_y_l_o_r_H_o_o_d_V_e_l_o_c_i_t_y_T_r_e_e_<_ _G_V_ _>_, │ │ │ │ +_L_a_g_r_a_n_g_e_N_o_d_e_<_ _G_V_,_ _1_ _>_ _>_:_:_s_e_t_C_h_i_l_d │ │ │ │ +void setChild(TT &&t, Dune::index_constant< i > ii={}) │ │ │ │ +DDeeffiinniittiioonn nodes.hh:458 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_V_e_l_o_c_i_t_y_T_r_e_e │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:288 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_V_e_l_o_c_i_t_y_T_r_e_e_:_:_T_a_y_l_o_r_H_o_o_d_V_e_l_o_c_i_t_y_T_r_e_e │ │ │ │ +TaylorHoodVelocityTree() │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:293 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_B_a_s_i_s_T_r_e_e │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:306 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_B_a_s_i_s_T_r_e_e_:_:_T_a_y_l_o_r_H_o_o_d_B_a_s_i_s_T_r_e_e │ │ │ │ +TaylorHoodBasisTree() │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:313 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s │ │ │ │ +Pre-basis for lowest order Taylor-Hood basis. │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:61 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s │ │ │ │ +TaylorHoodPreBasis(const GridView &gv) │ │ │ │ +Constructor for a given grid view object. │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:89 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_g_r_i_d_V_i_e_w │ │ │ │ +const GridView & gridView() const │ │ │ │ +Obtain the grid view that the basis is defined on. │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:103 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_m_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ +static constexpr size_type minMultiIndexSize │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:78 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ +size_type size(const SizePrefix &prefix) const │ │ │ │ +Return number of possible values for next position in multi index. │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:131 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_g_r_i_d_V_i_e_w__ │ │ │ │ +GridView gridView_ │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:277 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ +GV GridView │ │ │ │ +The grid view that the FE basis is defined on. │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:69 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_u_p_d_a_t_e │ │ │ │ void update(const GridView &gv) │ │ │ │ -Update the stored GridView. │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:101 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n │ │ │ │ -LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout) │ │ │ │ -Construct from GridView and local DOF layout. │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:74 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_e_t_S_i_z_e │ │ │ │ -void setSize(const size_type size) │ │ │ │ -DDeeffiinniittiioonn nodes.hh:197 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ -DDeeffiinniittiioonn nodes.hh:218 │ │ │ │ +Update the stored grid view, to be called if the grid has changed. │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:109 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r │ │ │ │ +auto containerDescriptor() const │ │ │ │ +Return an container descriptor depending on the flag HI. Either return a Tuple │ │ │ │ +if hybrid indices shou... │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:204 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_N_o_d_e │ │ │ │ +TaylorHoodBasisTree< GV > Node │ │ │ │ +Template mapping root tree path to type of created tree node. │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:75 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_p_q_2_P_r_e_B_a_s_i_s__ │ │ │ │ +PQ2PreBasis pq2PreBasis_ │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:280 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ +size_type size() const │ │ │ │ +Same as size(prefix) with empty prefix. │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:124 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ +size_type dimension() const │ │ │ │ +Get the total dimension of the space spanned by this basis. │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:182 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_p_q_1_P_r_e_B_a_s_i_s__ │ │ │ │ +PQ1PreBasis pq1PreBasis_ │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:279 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_m_u_l_t_i_I_n_d_e_x_P_u_s_h_F_r_o_n_t │ │ │ │ +static const void multiIndexPushFront(MultiIndex &M, size_type M0) │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:221 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ +static constexpr size_type maxMultiIndexSize │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:77 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_m_a_k_e_N_o_d_e │ │ │ │ +Node makeNode() const │ │ │ │ +Create tree node. │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:118 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_i_n_d_i_c_e_s │ │ │ │ +It indices(const Node &node, It it) const │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:194 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_m_u_l_t_i_I_n_d_e_x_B_u_f_f_e_r_S_i_z_e │ │ │ │ +static constexpr size_type multiIndexBufferSize │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:79 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ +void initializeIndices() │ │ │ │ +Initialize the global indices. │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:96 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_m_a_x_N_o_d_e_S_i_z_e │ │ │ │ +size_type maxNodeSize() const │ │ │ │ +Get the maximal number of DOFs associated to node for any element. │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:188 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_s_i_z_e___t_y_p_e │ │ │ │ +std::size_t size_type │ │ │ │ +Type used for indices and size information. │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:72 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s_:_:_i_n_d_i_c_e_s_I_m_p │ │ │ │ +It indicesImp(const Node &node, It multiIndices) const │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:231 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _b_r_e_z_z_i_d_o_u_g_l_a_s_m_a_r_i_n_i_b_a_s_i_s_._h_h │ │ │ │ + * _t_a_y_l_o_r_h_o_o_d_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00185.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: boundarydofs.hh File Reference │ │ │ +Dune-Functions: powerbasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,51 +88,64 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
boundarydofs.hh File Reference
│ │ │ +
powerbasis.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <utility>
│ │ │ -#include <dune/functions/functionspacebases/subentitydofs.hh>
│ │ │ +
#include <dune/common/reservedvector.hh>
│ │ │ +#include <dune/common/typeutilities.hh>
│ │ │ +#include <dune/common/indices.hh>
│ │ │ +#include <dune/common/typetree/nodeconcepts.hh>
│ │ │ +#include <dune/functions/common/utility.hh>
│ │ │ +#include <dune/functions/common/type_traits.hh>
│ │ │ +#include <dune/functions/functionspacebases/basistags.hh>
│ │ │ +#include <dune/functions/functionspacebases/dynamicpowerbasis.hh>
│ │ │ +#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ +#include <dune/functions/functionspacebases/concepts.hh>
│ │ │ +#include <dune/functions/functionspacebases/containerdescriptors.hh>
│ │ │ +#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ + │ │ │ + │ │ │ + │ │ │ +

│ │ │ +Classes

class  Dune::Functions::PowerPreBasis< IMS, SPB, C >
 A pre-basis for power bases. More...
│ │ │ │ │ │ │ │ │ │ │ │ + │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::BasisFactory
│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Functions

template<class Basis, class F, decltype(std::declval< std::decay_t< F > >()(0, std::declval< typename Basis::LocalView >(), std::declval< typename Basis::GridView::Intersection >()), 0) = 0>
void Dune::Functions::forEachBoundaryDOF (const Basis &basis, F &&f)
 Loop over all DOFs on the boundary.
template<class Basis, class F, decltype(std::declval< std::decay_t< F > >()(0, std::declval< typename Basis::LocalView >()), 0) = 0>
void Dune::Functions::forEachBoundaryDOF (const Basis &basis, F &&f)
 Loop over all DOFs on the boundary.
template<class Basis, class F, decltype(std::declval< std::decay_t< F > >()(std::declval< typename Basis::MultiIndex >()), 0) = 0>
void Dune::Functions::forEachBoundaryDOF (const Basis &basis, F &&f)
 Loop over all DOFs on the boundary.
template<std::size_t k, class ChildPreBasisFactory, class IndexMergingStrategy>
auto Dune::Functions::BasisFactory::power (ChildPreBasisFactory &&childPreBasisFactory, const IndexMergingStrategy &)
 Create a pre-basis factory that can build a PowerPreBasis.
template<std::size_t k, class ChildPreBasisFactory>
auto Dune::Functions::BasisFactory::power (ChildPreBasisFactory &&childPreBasisFactory)
 Create a factory builder that can build a PowerPreBasis.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,30 +1,40 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -boundarydofs.hh File Reference │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_s_u_b_e_n_t_i_t_y_d_o_f_s_._h_h> │ │ │ │ +powerbasis.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_b_a_s_i_s_t_a_g_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_y_n_a_m_i_c_p_o_w_e_r_b_a_s_i_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ +CCllaasssseess │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_P_r_e_B_a_s_i_s_<_ _I_M_S_,_ _S_P_B_,_ _C_ _> │ │ │ │ +  A pre-basis for power bases. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ +namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ FFuunnccttiioonnss │ │ │ │ -template >()(0, │ │ │ │ -std::declval< typename Basis::LocalView >(), std::declval< typename Basis:: │ │ │ │ -GridView::Intersection >()), 0) = 0> │ │ │ │ -void  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_o_r_E_a_c_h_B_o_u_n_d_a_r_y_D_O_F (const Basis &basis, F &&f) │ │ │ │ -  Loop over all DOFs on the boundary. │ │ │ │ -template >()(0, │ │ │ │ -std::declval< typename Basis::LocalView >()), 0) = 0> │ │ │ │ -void  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_o_r_E_a_c_h_B_o_u_n_d_a_r_y_D_O_F (const Basis &basis, F &&f) │ │ │ │ -  Loop over all DOFs on the boundary. │ │ │ │ -template >() │ │ │ │ -(std::declval< typename Basis::MultiIndex >()), 0) = 0> │ │ │ │ -void  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_o_r_E_a_c_h_B_o_u_n_d_a_r_y_D_O_F (const Basis &basis, F &&f) │ │ │ │ -  Loop over all DOFs on the boundary. │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_p_o_w_e_r (ChildPreBasisFactory │ │ │ │ + &&childPreBasisFactory, const _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y &) │ │ │ │ +  Create a pre-basis factory that can build a _P_o_w_e_r_P_r_e_B_a_s_i_s. │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_p_o_w_e_r (ChildPreBasisFactory │ │ │ │ + &&childPreBasisFactory) │ │ │ │ +  Create a factory builder that can build a _P_o_w_e_r_P_r_e_B_a_s_i_s. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _b_o_u_n_d_a_r_y_d_o_f_s_._h_h │ │ │ │ + * _p_o_w_e_r_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00185.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,5 +1,5 @@ │ │ │ │ var a00185 = [ │ │ │ │ - ["Dune::Functions::forEachBoundaryDOF", "a00318.html#gaa60b94e3da01aa62a555f6955a7f09e5", null], │ │ │ │ - ["Dune::Functions::forEachBoundaryDOF", "a00318.html#gaa60b94e3da01aa62a555f6955a7f09e5", null], │ │ │ │ - ["Dune::Functions::forEachBoundaryDOF", "a00313.html#gaa60b94e3da01aa62a555f6955a7f09e5", null] │ │ │ │ + ["Dune::Functions::PowerPreBasis< IMS, SPB, C >", "a02042.html", "a02042"], │ │ │ │ + ["Dune::Functions::BasisFactory::power", "a00312.html#gab84b622cf7be16d0373640b6f0478eb0", null], │ │ │ │ + ["Dune::Functions::BasisFactory::power", "a00312.html#ga0d8eb549af76bc2563ab189e63668ee5", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00185_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: boundarydofs.hh Source File │ │ │ +Dune-Functions: powerbasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,115 +88,205 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
boundarydofs.hh
│ │ │ +
powerbasis.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH
│ │ │ +
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH
│ │ │
9
│ │ │ -
10#include <utility>
│ │ │ -
11
│ │ │ - │ │ │ +
10#include <dune/common/reservedvector.hh>
│ │ │ +
11#include <dune/common/typeutilities.hh>
│ │ │ +
12#include <dune/common/indices.hh>
│ │ │
13
│ │ │ -
14namespace Dune {
│ │ │ -
15namespace Functions {
│ │ │ -
16
│ │ │ -
17
│ │ │ -
18
│ │ │ -
38template<class Basis, class F,
│ │ │ -
39 decltype(std::declval<std::decay_t<F>>()(0, std::declval<typename Basis::LocalView>(),std::declval<typename Basis::GridView::Intersection>()), 0) = 0>
│ │ │ -
│ │ │ -
40void forEachBoundaryDOF(const Basis& basis, F&& f)
│ │ │ -
41{
│ │ │ -
42 auto localView = basis.localView();
│ │ │ -
43 auto seDOFs = subEntityDOFs(basis);
│ │ │ -
44 const auto& gridView = basis.gridView();
│ │ │ -
45 for(auto&& element : elements(gridView))
│ │ │ -
46 if (element.hasBoundaryIntersections())
│ │ │ -
47 {
│ │ │ -
48 localView.bind(element);
│ │ │ -
49 for(const auto& intersection: intersections(gridView, element))
│ │ │ -
50 if (intersection.boundary())
│ │ │ -
51 for(auto localIndex: seDOFs.bind(localView,intersection))
│ │ │ -
52 f(localIndex, localView, intersection);
│ │ │ -
53 }
│ │ │ -
54}
│ │ │ -
│ │ │ -
55
│ │ │ +
14#include <dune/common/typetree/nodeconcepts.hh>
│ │ │ +
15
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
24
│ │ │ +
25
│ │ │ +
26
│ │ │ +
27namespace Dune {
│ │ │ +
28namespace Functions {
│ │ │ +
29
│ │ │ +
30
│ │ │ +
31// *****************************************************************************
│ │ │ +
32// This is the reusable part of the power bases. It contains
│ │ │ +
33//
│ │ │ +
34// PowerPreBasis
│ │ │ +
35//
│ │ │ +
36// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ +
37// state. These components do _not_ depend on the global basis and local view
│ │ │ +
38// and can be used without a global basis.
│ │ │ +
39// *****************************************************************************
│ │ │ +
40
│ │ │ +
51template<class IMS, class SPB, std::size_t C>
│ │ │ +
│ │ │ + │ │ │ +
53 public DynamicPowerPreBasis<IMS,SPB>
│ │ │ +
54{
│ │ │ + │ │ │
56
│ │ │ -
57
│ │ │ -
75template<class Basis, class F,
│ │ │ -
76 decltype(std::declval<std::decay_t<F>>()(0, std::declval<typename Basis::LocalView>()),0) = 0>
│ │ │ -
│ │ │ -
77void forEachBoundaryDOF(const Basis& basis, F&& f)
│ │ │ -
78{
│ │ │ -
79 auto localView = basis.localView();
│ │ │ -
80 auto seDOFs = subEntityDOFs(basis);
│ │ │ -
81 const auto& gridView = basis.gridView();
│ │ │ -
82 for(auto&& element : elements(gridView))
│ │ │ -
83 if (element.hasBoundaryIntersections())
│ │ │ -
84 {
│ │ │ -
85 localView.bind(element);
│ │ │ -
86 for(const auto& intersection: intersections(gridView, element))
│ │ │ -
87 if (intersection.boundary())
│ │ │ -
88 for(auto localIndex: seDOFs.bind(localView,intersection))
│ │ │ -
89 f(localIndex, localView);
│ │ │ -
90 }
│ │ │ -
91}
│ │ │ -
│ │ │ -
92
│ │ │ -
93
│ │ │ -
94
│ │ │ -
111template<class Basis, class F,
│ │ │ -
112 decltype(std::declval<std::decay_t<F>>()(std::declval<typename Basis::MultiIndex>()),0) = 0>
│ │ │ +
57public:
│ │ │ +
58
│ │ │ +
60 using SubPreBasis = SPB;
│ │ │ +
61
│ │ │ + │ │ │ +
64
│ │ │ +
66 using size_type = typename Base::size_type;
│ │ │ +
67
│ │ │ + │ │ │ +
70
│ │ │ +
72 inline static constexpr std::integral_constant<std::size_t,C> children = {};
│ │ │ +
73
│ │ │ +
79 template<class... SFArgs,
│ │ │ +
80 disableCopyMove<PowerPreBasis, SFArgs...> = 0,
│ │ │ +
81 enableIfConstructible<SubPreBasis, SFArgs...> = 0>
│ │ │ +
│ │ │ +
82 explicit PowerPreBasis(SFArgs&&... sfArgs) :
│ │ │ +
83 Base(std::size_t(C), std::forward<SFArgs>(sfArgs)...)
│ │ │ +
84 {}
│ │ │ +
│ │ │ +
85
│ │ │ +
│ │ │ +
89 Node makeNode() const
│ │ │ +
90 {
│ │ │ +
91 Node node{};
│ │ │ +
92 for (std::size_t i=0; i<children(); ++i)
│ │ │ +
93 node.setChild(i, Base::subPreBasis_.makeNode());
│ │ │ +
94 return node;
│ │ │ +
95 }
│ │ │ +
│ │ │ +
96
│ │ │ +
│ │ │ + │ │ │ +
99 {
│ │ │ +
100 return size(Dune::ReservedVector<size_type, Base::multiIndexBufferSize>{});
│ │ │ +
101 }
│ │ │ +
│ │ │ +
102
│ │ │ +
104 template<class SizePrefix>
│ │ │ +
│ │ │ +
105 size_type size(const SizePrefix& prefix) const
│ │ │ +
106 {
│ │ │ + │ │ │ +
108 }
│ │ │ +
│ │ │ +
109
│ │ │ +
111 template<class NodeType, typename It>
│ │ │ +
112 requires Dune::TypeTree::Concept::UniformInnerTreeNode<NodeType>
│ │ │
│ │ │ -
113void forEachBoundaryDOF(const Basis& basis, F&& f)
│ │ │ -
114{
│ │ │ -
115 auto localView = basis.localView();
│ │ │ -
116 auto seDOFs = subEntityDOFs(basis);
│ │ │ -
117 const auto& gridView = basis.gridView();
│ │ │ -
118 for(auto&& element : elements(gridView))
│ │ │ -
119 if (element.hasBoundaryIntersections())
│ │ │ -
120 {
│ │ │ -
121 localView.bind(element);
│ │ │ -
122 for(const auto& intersection: intersections(gridView, element))
│ │ │ -
123 if (intersection.boundary())
│ │ │ -
124 for(auto localIndex: seDOFs.bind(localView,intersection))
│ │ │ -
125 f(localView.index(localIndex));
│ │ │ -
126 }
│ │ │ -
127}
│ │ │ -
│ │ │ -
128
│ │ │ -
129
│ │ │ -
130
│ │ │ -
131} // namespace Functions
│ │ │ -
132} // namespace Dune
│ │ │ -
133
│ │ │ -
134#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH
│ │ │ - │ │ │ -
auto subEntityDOFs(const T &)
Create SubEntityDOFs object.
Definition subentitydofs.hh:167
│ │ │ -
void forEachBoundaryDOF(const Basis &basis, F &&f)
Loop over all DOFs on the boundary.
Definition boundarydofs.hh:40
│ │ │ +
113 It indices(const NodeType& node, It it) const
│ │ │ +
114 {
│ │ │ + │ │ │ +
116 }
│ │ │ +
│ │ │ +
117
│ │ │ +
│ │ │ + │ │ │ +
120 {
│ │ │ + │ │ │ +
122 }
│ │ │ +
│ │ │ +
123};
│ │ │ +
│ │ │ +
124
│ │ │ +
125
│ │ │ +
126
│ │ │ +
127namespace BasisFactory {
│ │ │ +
128
│ │ │ +
140template<std::size_t k, class ChildPreBasisFactory, class IndexMergingStrategy>
│ │ │ +
│ │ │ +
141auto power(ChildPreBasisFactory&& childPreBasisFactory, const IndexMergingStrategy&)
│ │ │ +
142{
│ │ │ +
143 return [childPreBasisFactory](const auto& gridView) {
│ │ │ +
144 auto childPreBasis = childPreBasisFactory(gridView);
│ │ │ + │ │ │ +
146 };
│ │ │ +
147}
│ │ │ +
│ │ │ +
148
│ │ │ +
159template<std::size_t k, class ChildPreBasisFactory>
│ │ │ +
160[[deprecated("Using the method `power` without an explicit index merging strategy"
│ │ │ +
161 " will change its meaning after the release of dune-functions 2.11."
│ │ │ +
162 " Previously, the default merging strategy was `BlockedInterleaved`,"
│ │ │ +
163 " but this will change to `FlatInterleaved`."
│ │ │ +
164 " Change the call to `power(..., blockedInterleaved())` to retain the old behavior.")]]
│ │ │ +
│ │ │ +
165auto power(ChildPreBasisFactory&& childPreBasisFactory)
│ │ │ +
166{
│ │ │ +
167 return [childPreBasisFactory](const auto& gridView) {
│ │ │ +
168 auto childPreBasis = childPreBasisFactory(gridView);
│ │ │ + │ │ │ +
170 };
│ │ │ +
171}
│ │ │ +
│ │ │ +
172
│ │ │ +
173} // end namespace BasisFactory
│ │ │ +
174
│ │ │ +
175
│ │ │ +
176} // end namespace Functions
│ │ │ +
177} // end namespace Dune
│ │ │ +
178
│ │ │ +
179
│ │ │ +
180#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
Lightweight representation of (hierarchical) size and block structure extracted from a basis to descr...
│ │ │ + │ │ │ +
auto power(ChildPreBasisFactory &&childPreBasisFactory, std::size_t k, const IndexMergingStrategy &)
Create a pre-basis factory that can build a PowerPreBasis.
Definition dynamicpowerbasis.hh:410
│ │ │ +
std::enable_if_t< std::is_constructible_v< T, Args... >, int > enableIfConstructible
Helper to constrain forwarding constructors.
Definition type_traits.hh:30
│ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ +
Base class for index merging strategies to simplify detection.
Definition basistags.hh:48
│ │ │ +
std::size_t size_type
Type used for indices and size information.
Definition dynamicpowerbasis.hh:62
│ │ │ +
DynamicPowerPreBasis(std::size_t c, SFArgs &&... sfArgs)
Constructor for given child pre-basis objects.
Definition dynamicpowerbasis.hh:82
│ │ │ +
auto containerDescriptorImpl(Children children) const
Definition dynamicpowerbasis.hh:374
│ │ │ +
size_type sizeImpl(SizePrefix prefix, Children children, BasisFactory::FlatInterleaved) const
Definition dynamicpowerbasis.hh:139
│ │ │ +
SubPreBasis subPreBasis_
Definition dynamicpowerbasis.hh:391
│ │ │ +
It indicesImpl(const NodeType &node, It multiIndices, Children children, BasisFactory::FlatInterleaved) const
Definition dynamicpowerbasis.hh:264
│ │ │ +
Definition nodes.hh:268
│ │ │ +
void setChild(Index i, TT &&t)
Definition nodes.hh:317
│ │ │ +
A pre-basis for power bases.
Definition powerbasis.hh:54
│ │ │ +
IMS IndexMergingStrategy
Strategy used to merge the global indices of the child factories.
Definition powerbasis.hh:69
│ │ │ +
typename Base::size_type size_type
Type used for indices and size information.
Definition powerbasis.hh:66
│ │ │ +
SPB SubPreBasis
The child pre-basis.
Definition powerbasis.hh:60
│ │ │ +
auto containerDescriptor() const
Return the associated container descriptor.
Definition powerbasis.hh:119
│ │ │ +
PowerBasisNode< typename SubPreBasis::Node, C > Node
Template mapping root tree path to type of created tree node.
Definition powerbasis.hh:63
│ │ │ +
PowerPreBasis(SFArgs &&... sfArgs)
Constructor for given child pre-basis objects for static size of the power-basis.
Definition powerbasis.hh:82
│ │ │ +
size_type size() const
Same as size(prefix) with empty prefix.
Definition powerbasis.hh:98
│ │ │ +
Node makeNode() const
Create tree node.
Definition powerbasis.hh:89
│ │ │ +
static constexpr std::integral_constant< std::size_t, C > children
Number of children provided as an integral constant.
Definition powerbasis.hh:72
│ │ │ +
It indices(const NodeType &node, It it) const
Maps from subtree index set [0..size-1] to a globally unique multi index in global basis.
Definition powerbasis.hh:113
│ │ │ +
size_type size(const SizePrefix &prefix) const
Return number of possible values for next position in multi index.
Definition powerbasis.hh:105
│ │ │ + │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,111 +1,257 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -boundarydofs.hh │ │ │ │ +powerbasis.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH │ │ │ │ +8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11 │ │ │ │ -12#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_s_u_b_e_n_t_i_t_y_d_o_f_s_._h_h> │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ +12#include │ │ │ │ 13 │ │ │ │ -14namespace _D_u_n_e { │ │ │ │ -15namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -16 │ │ │ │ -17 │ │ │ │ -18 │ │ │ │ -38template>()(0, std::declval(),std::declval()), 0) = 0> │ │ │ │ -_4_0void _f_o_r_E_a_c_h_B_o_u_n_d_a_r_y_D_O_F(const Basis& basis, F&& f) │ │ │ │ -41{ │ │ │ │ -42 auto localView = basis.localView(); │ │ │ │ -43 auto seDOFs = _s_u_b_E_n_t_i_t_y_D_O_F_s(basis); │ │ │ │ -44 const auto& gridView = basis.gridView(); │ │ │ │ -45 for(auto&& element : elements(gridView)) │ │ │ │ -46 if (element.hasBoundaryIntersections()) │ │ │ │ -47 { │ │ │ │ -48 localView.bind(element); │ │ │ │ -49 for(const auto& intersection: intersections(gridView, element)) │ │ │ │ -50 if (intersection.boundary()) │ │ │ │ -51 for(auto localIndex: seDOFs.bind(localView,intersection)) │ │ │ │ -52 f(localIndex, localView, intersection); │ │ │ │ -53 } │ │ │ │ -54} │ │ │ │ -55 │ │ │ │ +14#include │ │ │ │ +15 │ │ │ │ +16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ +17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ +18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_b_a_s_i_s_t_a_g_s_._h_h> │ │ │ │ +19#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_y_n_a_m_i_c_p_o_w_e_r_b_a_s_i_s_._h_h> │ │ │ │ +20#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ +21#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +22#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h> │ │ │ │ +23#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ +24 │ │ │ │ +25 │ │ │ │ +26 │ │ │ │ +27namespace _D_u_n_e { │ │ │ │ +28namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +29 │ │ │ │ +30 │ │ │ │ +31/ │ │ │ │ +/ ***************************************************************************** │ │ │ │ +32// This is the reusable part of the power bases. It contains │ │ │ │ +33// │ │ │ │ +34// PowerPreBasis │ │ │ │ +35// │ │ │ │ +36// The pre-basis allows to create the others and is the owner of possible │ │ │ │ +shared │ │ │ │ +37// state. These components do _not_ depend on the global basis and local view │ │ │ │ +38// and can be used without a global basis. │ │ │ │ +39/ │ │ │ │ +/ ***************************************************************************** │ │ │ │ +40 │ │ │ │ +51template │ │ │ │ +_5_2class _P_o_w_e_r_P_r_e_B_a_s_i_s : │ │ │ │ +53 public _D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s │ │ │ │ +54{ │ │ │ │ +55 using Base = _D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_<_I_M_S_,_S_P_B_>; │ │ │ │ 56 │ │ │ │ -57 │ │ │ │ -75template>()(0, std::declval()),0) = 0> │ │ │ │ -_7_7void _f_o_r_E_a_c_h_B_o_u_n_d_a_r_y_D_O_F(const Basis& basis, F&& f) │ │ │ │ -78{ │ │ │ │ -79 auto localView = basis.localView(); │ │ │ │ -80 auto seDOFs = _s_u_b_E_n_t_i_t_y_D_O_F_s(basis); │ │ │ │ -81 const auto& gridView = basis.gridView(); │ │ │ │ -82 for(auto&& element : elements(gridView)) │ │ │ │ -83 if (element.hasBoundaryIntersections()) │ │ │ │ -84 { │ │ │ │ -85 localView.bind(element); │ │ │ │ -86 for(const auto& intersection: intersections(gridView, element)) │ │ │ │ -87 if (intersection.boundary()) │ │ │ │ -88 for(auto localIndex: seDOFs.bind(localView,intersection)) │ │ │ │ -89 f(localIndex, localView); │ │ │ │ -90 } │ │ │ │ -91} │ │ │ │ -92 │ │ │ │ -93 │ │ │ │ -94 │ │ │ │ -111template>()(std::declval()),0) = 0> │ │ │ │ -_1_1_3void _f_o_r_E_a_c_h_B_o_u_n_d_a_r_y_D_O_F(const Basis& basis, F&& f) │ │ │ │ -114{ │ │ │ │ -115 auto localView = basis.localView(); │ │ │ │ -116 auto seDOFs = _s_u_b_E_n_t_i_t_y_D_O_F_s(basis); │ │ │ │ -117 const auto& gridView = basis.gridView(); │ │ │ │ -118 for(auto&& element : elements(gridView)) │ │ │ │ -119 if (element.hasBoundaryIntersections()) │ │ │ │ +57public: │ │ │ │ +58 │ │ │ │ +_6_0 using _S_u_b_P_r_e_B_a_s_i_s = SPB; │ │ │ │ +61 │ │ │ │ +_6_3 using _N_o_d_e = _P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_t_y_p_e_n_a_m_e_ _S_u_b_P_r_e_B_a_s_i_s_:_:_N_o_d_e_,_ _C_>; │ │ │ │ +64 │ │ │ │ +_6_6 using _s_i_z_e___t_y_p_e = typename _B_a_s_e_:_:_s_i_z_e___t_y_p_e; │ │ │ │ +67 │ │ │ │ +_6_9 using _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y = IMS; │ │ │ │ +70 │ │ │ │ +_7_2 inline static constexpr std::integral_constant _c_h_i_l_d_r_e_n = {}; │ │ │ │ +73 │ │ │ │ +79 template = 0, │ │ │ │ +81 _e_n_a_b_l_e_I_f_C_o_n_s_t_r_u_c_t_i_b_l_e<_S_u_b_P_r_e_B_a_s_i_s, SFArgs...> = 0> │ │ │ │ +_8_2 explicit _P_o_w_e_r_P_r_e_B_a_s_i_s(SFArgs&&... sfArgs) : │ │ │ │ +83 Base(std::size_t(C), std::forward(sfArgs)...) │ │ │ │ +84 {} │ │ │ │ +85 │ │ │ │ +_8_9 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ +90 { │ │ │ │ +91 _N_o_d_e node{}; │ │ │ │ +92 for (std::size_t i=0; i<_c_h_i_l_d_r_e_n(); ++i) │ │ │ │ +93 node._s_e_t_C_h_i_l_d(i, _B_a_s_e_:_:_s_u_b_P_r_e_B_a_s_i_s__.makeNode()); │ │ │ │ +94 return node; │ │ │ │ +95 } │ │ │ │ +96 │ │ │ │ +_9_8 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ +99 { │ │ │ │ +100 return _s_i_z_e(Dune::ReservedVector{}); │ │ │ │ +101 } │ │ │ │ +102 │ │ │ │ +104 template │ │ │ │ +_1_0_5 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix) const │ │ │ │ +106 { │ │ │ │ +107 return _B_a_s_e_:_:_s_i_z_e_I_m_p_l(prefix, _c_h_i_l_d_r_e_n, _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y{}); │ │ │ │ +108 } │ │ │ │ +109 │ │ │ │ +111 template │ │ │ │ +112 requires Dune::TypeTree::Concept::UniformInnerTreeNode │ │ │ │ +_1_1_3 It _i_n_d_i_c_e_s(const NodeType& node, It it) const │ │ │ │ +114 { │ │ │ │ +115 return _B_a_s_e_:_:_i_n_d_i_c_e_s_I_m_p_l(node, it, _c_h_i_l_d_r_e_n, _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y{}); │ │ │ │ +116 } │ │ │ │ +117 │ │ │ │ +_1_1_9 auto _c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r() const │ │ │ │ 120 { │ │ │ │ -121 localView.bind(element); │ │ │ │ -122 for(const auto& intersection: intersections(gridView, element)) │ │ │ │ -123 if (intersection.boundary()) │ │ │ │ -124 for(auto localIndex: seDOFs.bind(localView,intersection)) │ │ │ │ -125 f(localView.index(localIndex)); │ │ │ │ -126 } │ │ │ │ -127} │ │ │ │ +121 return _B_a_s_e_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_I_m_p_l(_c_h_i_l_d_r_e_n); │ │ │ │ +122 } │ │ │ │ +123}; │ │ │ │ +124 │ │ │ │ +125 │ │ │ │ +126 │ │ │ │ +127namespace BasisFactory { │ │ │ │ 128 │ │ │ │ -129 │ │ │ │ -130 │ │ │ │ -131} // namespace Functions │ │ │ │ -132} // namespace Dune │ │ │ │ -133 │ │ │ │ -134#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH │ │ │ │ -_s_u_b_e_n_t_i_t_y_d_o_f_s_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_s_u_b_E_n_t_i_t_y_D_O_F_s │ │ │ │ -auto subEntityDOFs(const T &) │ │ │ │ -Create SubEntityDOFs object. │ │ │ │ -DDeeffiinniittiioonn subentitydofs.hh:167 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_o_r_E_a_c_h_B_o_u_n_d_a_r_y_D_O_F │ │ │ │ -void forEachBoundaryDOF(const Basis &basis, F &&f) │ │ │ │ -Loop over all DOFs on the boundary. │ │ │ │ -DDeeffiinniittiioonn boundarydofs.hh:40 │ │ │ │ +140template │ │ │ │ +_1_4_1auto _p_o_w_e_r(ChildPreBasisFactory&& childPreBasisFactory, const │ │ │ │ +_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y&) │ │ │ │ +142{ │ │ │ │ +143 return [childPreBasisFactory](const auto& gridView) { │ │ │ │ +144 auto childPreBasis = childPreBasisFactory(gridView); │ │ │ │ +145 return _P_o_w_e_r_P_r_e_B_a_s_i_s_<_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y_,_ _d_e_c_l_t_y_p_e_(_c_h_i_l_d_P_r_e_B_a_s_i_s_)_,_ _k_> │ │ │ │ +(std::move(childPreBasis)); │ │ │ │ +146 }; │ │ │ │ +147} │ │ │ │ +148 │ │ │ │ +159template │ │ │ │ +160[[deprecated("Using the method `power` without an explicit index merging │ │ │ │ +strategy" │ │ │ │ +161 " will change its meaning after the release of dune-functions 2.11." │ │ │ │ +162 " Previously, the default merging strategy was `BlockedInterleaved`," │ │ │ │ +163 " but this will change to `FlatInterleaved`." │ │ │ │ +164 " Change the call to `power(..., blockedInterleaved())` to retain the old │ │ │ │ +behavior.")]] │ │ │ │ +_1_6_5auto _p_o_w_e_r(ChildPreBasisFactory&& childPreBasisFactory) │ │ │ │ +166{ │ │ │ │ +167 return [childPreBasisFactory](const auto& gridView) { │ │ │ │ +168 auto childPreBasis = childPreBasisFactory(gridView); │ │ │ │ +169 return _P_o_w_e_r_P_r_e_B_a_s_i_s_<_B_l_o_c_k_e_d_I_n_t_e_r_l_e_a_v_e_d_,_ _d_e_c_l_t_y_p_e_(_c_h_i_l_d_P_r_e_B_a_s_i_s_)_,_ _k_>(std:: │ │ │ │ +move(childPreBasis)); │ │ │ │ +170 }; │ │ │ │ +171} │ │ │ │ +172 │ │ │ │ +173} // end namespace BasisFactory │ │ │ │ +174 │ │ │ │ +175 │ │ │ │ +176} // end namespace Functions │ │ │ │ +177} // end namespace Dune │ │ │ │ +178 │ │ │ │ +179 │ │ │ │ +180#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH │ │ │ │ +_u_t_i_l_i_t_y_._h_h │ │ │ │ +_t_y_p_e___t_r_a_i_t_s_._h_h │ │ │ │ +_n_o_d_e_s_._h_h │ │ │ │ +_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ +_b_a_s_i_s_t_a_g_s_._h_h │ │ │ │ +_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h │ │ │ │ +Lightweight representation of (hierarchical) size and block structure extracted │ │ │ │ +from a basis to descr... │ │ │ │ +_d_y_n_a_m_i_c_p_o_w_e_r_b_a_s_i_s_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_p_o_w_e_r │ │ │ │ +auto power(ChildPreBasisFactory &&childPreBasisFactory, std::size_t k, const │ │ │ │ +IndexMergingStrategy &) │ │ │ │ +Create a pre-basis factory that can build a PowerPreBasis. │ │ │ │ +DDeeffiinniittiioonn dynamicpowerbasis.hh:410 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_e_n_a_b_l_e_I_f_C_o_n_s_t_r_u_c_t_i_b_l_e │ │ │ │ +std::enable_if_t< std::is_constructible_v< T, Args... >, int > │ │ │ │ +enableIfConstructible │ │ │ │ +Helper to constrain forwarding constructors. │ │ │ │ +DDeeffiinniittiioonn type_traits.hh:30 │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ +Base class for index merging strategies to simplify detection. │ │ │ │ +DDeeffiinniittiioonn basistags.hh:48 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_s_i_z_e___t_y_p_e │ │ │ │ +std::size_t size_type │ │ │ │ +Type used for indices and size information. │ │ │ │ +DDeeffiinniittiioonn dynamicpowerbasis.hh:62 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s │ │ │ │ +DynamicPowerPreBasis(std::size_t c, SFArgs &&... sfArgs) │ │ │ │ +Constructor for given child pre-basis objects. │ │ │ │ +DDeeffiinniittiioonn dynamicpowerbasis.hh:82 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_I_m_p_l │ │ │ │ +auto containerDescriptorImpl(Children children) const │ │ │ │ +DDeeffiinniittiioonn dynamicpowerbasis.hh:374 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_s_i_z_e_I_m_p_l │ │ │ │ +size_type sizeImpl(SizePrefix prefix, Children children, BasisFactory:: │ │ │ │ +FlatInterleaved) const │ │ │ │ +DDeeffiinniittiioonn dynamicpowerbasis.hh:139 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_s_u_b_P_r_e_B_a_s_i_s__ │ │ │ │ +SubPreBasis subPreBasis_ │ │ │ │ +DDeeffiinniittiioonn dynamicpowerbasis.hh:391 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_y_n_a_m_i_c_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_i_n_d_i_c_e_s_I_m_p_l │ │ │ │ +It indicesImpl(const NodeType &node, It multiIndices, Children children, │ │ │ │ +BasisFactory::FlatInterleaved) const │ │ │ │ +DDeeffiinniittiioonn dynamicpowerbasis.hh:264 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e │ │ │ │ +DDeeffiinniittiioonn nodes.hh:268 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_B_a_s_i_s_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ +void setChild(Index i, TT &&t) │ │ │ │ +DDeeffiinniittiioonn nodes.hh:317 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_P_r_e_B_a_s_i_s │ │ │ │ +A pre-basis for power bases. │ │ │ │ +DDeeffiinniittiioonn powerbasis.hh:54 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ +IMS IndexMergingStrategy │ │ │ │ +Strategy used to merge the global indices of the child factories. │ │ │ │ +DDeeffiinniittiioonn powerbasis.hh:69 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_s_i_z_e___t_y_p_e │ │ │ │ +typename Base::size_type size_type │ │ │ │ +Type used for indices and size information. │ │ │ │ +DDeeffiinniittiioonn powerbasis.hh:66 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_S_u_b_P_r_e_B_a_s_i_s │ │ │ │ +SPB SubPreBasis │ │ │ │ +The child pre-basis. │ │ │ │ +DDeeffiinniittiioonn powerbasis.hh:60 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r │ │ │ │ +auto containerDescriptor() const │ │ │ │ +Return the associated container descriptor. │ │ │ │ +DDeeffiinniittiioonn powerbasis.hh:119 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_N_o_d_e │ │ │ │ +PowerBasisNode< typename SubPreBasis::Node, C > Node │ │ │ │ +Template mapping root tree path to type of created tree node. │ │ │ │ +DDeeffiinniittiioonn powerbasis.hh:63 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_P_o_w_e_r_P_r_e_B_a_s_i_s │ │ │ │ +PowerPreBasis(SFArgs &&... sfArgs) │ │ │ │ +Constructor for given child pre-basis objects for static size of the power- │ │ │ │ +basis. │ │ │ │ +DDeeffiinniittiioonn powerbasis.hh:82 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ +size_type size() const │ │ │ │ +Same as size(prefix) with empty prefix. │ │ │ │ +DDeeffiinniittiioonn powerbasis.hh:98 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_m_a_k_e_N_o_d_e │ │ │ │ +Node makeNode() const │ │ │ │ +Create tree node. │ │ │ │ +DDeeffiinniittiioonn powerbasis.hh:89 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_c_h_i_l_d_r_e_n │ │ │ │ +static constexpr std::integral_constant< std::size_t, C > children │ │ │ │ +Number of children provided as an integral constant. │ │ │ │ +DDeeffiinniittiioonn powerbasis.hh:72 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_i_n_d_i_c_e_s │ │ │ │ +It indices(const NodeType &node, It it) const │ │ │ │ +Maps from subtree index set [0..size-1] to a globally unique multi index in │ │ │ │ +global basis. │ │ │ │ +DDeeffiinniittiioonn powerbasis.hh:113 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_w_e_r_P_r_e_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ +size_type size(const SizePrefix &prefix) const │ │ │ │ +Return number of possible values for next position in multi index. │ │ │ │ +DDeeffiinniittiioonn powerbasis.hh:105 │ │ │ │ +_c_o_n_c_e_p_t_s_._h_h │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _b_o_u_n_d_a_r_y_d_o_f_s_._h_h │ │ │ │ + * _p_o_w_e_r_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00188.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: basistags.hh File Reference │ │ │ +Dune-Functions: nedelecbasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,71 +88,65 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
basistags.hh File Reference
│ │ │ +
nedelecbasis.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <type_traits>
│ │ │ -#include <dune/common/concept.hh>
│ │ │ +
#include <array>
│ │ │ +#include <dune/common/exceptions.hh>
│ │ │ +#include <dune/grid/common/capabilities.hh>
│ │ │ +#include <dune/grid/common/mcmgmapper.hh>
│ │ │ +#include <dune/localfunctions/common/localfiniteelementvariant.hh>
│ │ │ +#include <dune/localfunctions/nedelec.hh>
│ │ │ +#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │ +#include <dune/functions/functionspacebases/globalvaluedlocalfiniteelement.hh>
│ │ │ +#include <dune/functions/functionspacebases/leafprebasismappermixin.hh>
│ │ │ +#include <dune/functions/functionspacebases/nodes.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

struct  Dune::Functions::Concept::IndexMergingStrategy
struct  Dune::Functions::BasisFactory::IndexMergingStrategy
 Base class for index merging strategies to simplify detection. More...
struct  Dune::Functions::BasisFactory::FlatLexicographic
 Lexicographic merging of direct children without blocking. More...
struct  Dune::Functions::BasisFactory::FlatInterleaved
 Interleaved merging of direct children without blocking. More...
struct  Dune::Functions::BasisFactory::BlockedLexicographic
 Lexicographic merging of direct children with blocking (i.e. creating one block per direct child). More...
struct  Dune::Functions::BasisFactory::BlockedInterleaved
 Interleaved merging of direct children with blocking (i.e. creating blocks at the leaves containing one leaf per child each). More...
class  Dune::Functions::NedelecPreBasis< GV, Range, kind, order >
class  Dune::Functions::NedelecNode< GV, Range, kind, order >
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::Concept
namespace  Dune::Functions::BasisFactory
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +

│ │ │ +Typedefs

template<typename GV, std::size_t kind, std::size_t order, typename Range = double>
using Dune::Functions::NedelecBasis = DefaultGlobalBasis<NedelecPreBasis<GV, Range, kind, order > >
 Basis of a k-th-order Nédélec finite element space.
│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Functions

template<typename T>
static constexpr bool Dune::Functions::Concept::isIndexMergingStrategy ()
template<typename T>
static constexpr bool Dune::Functions::Concept::isIndexMergingStrategy (T &&t)
void Dune::Functions::BasisFactory::registerIndexMergingStrategy (IndexMergingStrategy)
constexpr FlatLexicographic Dune::Functions::BasisFactory::flatLexicographic ()
 Creates a lexicographic merging of direct children without blocking.
constexpr FlatInterleaved Dune::Functions::BasisFactory::flatInterleaved ()
 Creates an interleaved merging of direct children without blocking.
constexpr BlockedLexicographic Dune::Functions::BasisFactory::blockedLexicographic ()
 Creates a lexicographic merging of direct children with blocking (i.e. creating one block per direct child).
constexpr BlockedInterleaved Dune::Functions::BasisFactory::blockedInterleaved ()
 Creates an interleaved merging of direct children with blocking (i.e. creating blocks at the leaves containing one leaf per child each).
template<std::size_t kind, std::size_t order, typename Range = double>
auto Dune::Functions::BasisFactory::nedelec ()
 Create a pre-basis factory that can create a Nédélec pre-basis.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── encoding │ │ │ │ @@ -1 +1 @@ │ │ │ │ -us-ascii │ │ │ │ +utf-8 │ │ │ ├── html2text {} │ │ │ │ @@ -1,60 +1,38 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -basistags.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ +nedelecbasis.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_g_l_o_b_a_l_v_a_l_u_e_d_l_o_c_a_l_f_i_n_i_t_e_e_l_e_m_e_n_t_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ -  Base class for index merging strategies to simplify detection. _M_o_r_e_._._. │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_F_l_a_t_L_e_x_i_c_o_g_r_a_p_h_i_c │ │ │ │ -  Lexicographic merging of direct children without blocking. _M_o_r_e_._._. │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_F_l_a_t_I_n_t_e_r_l_e_a_v_e_d │ │ │ │ -  Interleaved merging of direct children without blocking. _M_o_r_e_._._. │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_B_l_o_c_k_e_d_L_e_x_i_c_o_g_r_a_p_h_i_c │ │ │ │ -  Lexicographic merging of direct children with blocking (i.e. creating │ │ │ │ - one block per direct child). _M_o_r_e_._._. │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_B_l_o_c_k_e_d_I_n_t_e_r_l_e_a_v_e_d │ │ │ │ -  Interleaved merging of direct children with blocking (i.e. creating │ │ │ │ - blocks at the leaves containing one leaf per child each). _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_P_r_e_B_a_s_i_s_<_ _G_V_,_ _R_a_n_g_e_,_ _k_i_n_d_,_ _o_r_d_e_r_ _> │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_N_o_d_e_<_ _G_V_,_ _R_a_n_g_e_,_ _k_i_n_d_,_ _o_r_d_e_r_ _> │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ +TTyyppeeddeeffss │ │ │ │ +template │ │ │ │ +using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_B_a_s_i_s = _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s<_N_e_d_e_l_e_c_P_r_e_B_a_s_i_s > │ │ │ │ +  Basis of a k-th-order Nédélec finite element space. │ │ │ │ FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ - static constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_: │ │ │ │ - _i_s_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y () │ │ │ │ -template │ │ │ │ - static constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_: │ │ │ │ - _i_s_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y (T &&t) │ │ │ │ - void  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_: │ │ │ │ - _r_e_g_i_s_t_e_r_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ - (_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y) │ │ │ │ - constexpr _F_l_a_t_L_e_x_i_c_o_g_r_a_p_h_i_c  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_: │ │ │ │ - _f_l_a_t_L_e_x_i_c_o_g_r_a_p_h_i_c () │ │ │ │ -  Creates a lexicographic merging of direct │ │ │ │ - children without blocking. │ │ │ │ - constexpr _F_l_a_t_I_n_t_e_r_l_e_a_v_e_d  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_f_l_a_t_I_n_t_e_r_l_e_a_v_e_d │ │ │ │ - () │ │ │ │ -  Creates an interleaved merging of direct │ │ │ │ - children without blocking. │ │ │ │ -constexpr _B_l_o_c_k_e_d_L_e_x_i_c_o_g_r_a_p_h_i_c  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_: │ │ │ │ - _b_l_o_c_k_e_d_L_e_x_i_c_o_g_r_a_p_h_i_c () │ │ │ │ - Creates a lexicographic merging of direct │ │ │ │ -  children with blocking (i.e. creating one block │ │ │ │ - per direct child). │ │ │ │ - constexpr _B_l_o_c_k_e_d_I_n_t_e_r_l_e_a_v_e_d  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_: │ │ │ │ - _b_l_o_c_k_e_d_I_n_t_e_r_l_e_a_v_e_d () │ │ │ │ - Creates an interleaved merging of direct │ │ │ │ -  children with blocking (i.e. creating blocks at │ │ │ │ - the leaves containing one leaf per child each). │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_n_e_d_e_l_e_c () │ │ │ │ +  Create a pre-basis factory that can create a Nédélec pre-basis. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _b_a_s_i_s_t_a_g_s_._h_h │ │ │ │ + * _n_e_d_e_l_e_c_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00188.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,10 +1,6 @@ │ │ │ │ var a00188 = [ │ │ │ │ - ["Dune::Functions::Concept::IndexMergingStrategy", "a01614.html", "a01614"], │ │ │ │ - ["Dune::Functions::BasisFactory::blockedInterleaved", "a00313.html#ga649b67336300e9f05e38b5479ca21a24", null], │ │ │ │ - ["Dune::Functions::BasisFactory::blockedLexicographic", "a00313.html#gadd59442e0e62464ee27af6f2741b4494", null], │ │ │ │ - ["Dune::Functions::BasisFactory::flatInterleaved", "a00313.html#ga67995074ba44e2e28647170584f54bec", null], │ │ │ │ - ["Dune::Functions::BasisFactory::flatLexicographic", "a00313.html#ga611fb3c6cb312fb95e83dd1a62da13bc", null], │ │ │ │ - ["Dune::Functions::Concept::isIndexMergingStrategy", "a00320.html#a067e42f1ca7d6c4131518e5eb269da35", null], │ │ │ │ - ["Dune::Functions::Concept::isIndexMergingStrategy", "a00320.html#a4c80c069c722824168167f5ac1bc3474", null], │ │ │ │ - ["Dune::Functions::BasisFactory::registerIndexMergingStrategy", "a00327.html#ad515867ac194016a6f9e4463d1c67a24", null] │ │ │ │ + ["Dune::Functions::NedelecPreBasis< GV, Range, kind, order >", "a01990.html", "a01990"], │ │ │ │ + ["Dune::Functions::NedelecNode< GV, Range, kind, order >", "a01986.html", "a01986"], │ │ │ │ + ["Dune::Functions::NedelecBasis", "a00318.html#aee3286ae752a21e0a52405022a6bd906", null], │ │ │ │ + ["Dune::Functions::BasisFactory::nedelec", "a00312.html#gafe0fe439067c288f197101b8686223e8", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00188_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: basistags.hh Source File │ │ │ +Dune-Functions: nedelecbasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,146 +88,351 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
basistags.hh
│ │ │ +
nedelecbasis.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH
│ │ │ -
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH
│ │ │ +
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH
│ │ │
9
│ │ │ -
10#include <type_traits>
│ │ │ -
11#include <dune/common/concept.hh>
│ │ │ +
10#include <array>
│ │ │ +
11#include <dune/common/exceptions.hh>
│ │ │
12
│ │ │ -
13namespace Dune {
│ │ │ -
14namespace Functions {
│ │ │ +
13#include <dune/grid/common/capabilities.hh>
│ │ │ +
14#include <dune/grid/common/mcmgmapper.hh>
│ │ │
15
│ │ │ -
16 namespace Concept {
│ │ │ -
17
│ │ │ -
│ │ │ - │ │ │ -
19 {
│ │ │ -
20 template<typename T>
│ │ │ -
21 auto require(T&& t) -> decltype(
│ │ │ -
22 registerIndexMergingStrategy(t)
│ │ │ -
23 );
│ │ │ -
24 };
│ │ │ -
│ │ │ -
25
│ │ │ -
26 template<typename T>
│ │ │ -
│ │ │ -
27 static constexpr bool isIndexMergingStrategy()
│ │ │ -
28 {
│ │ │ -
29 return models<Concept::IndexMergingStrategy,T>();
│ │ │ -
30 }
│ │ │ -
│ │ │ -
31
│ │ │ -
32 template<typename T>
│ │ │ -
│ │ │ -
33 static constexpr bool isIndexMergingStrategy(T&& t)
│ │ │ -
34 {
│ │ │ -
35 return models<Concept::IndexMergingStrategy,std::decay_t<T>>();
│ │ │ -
36 }
│ │ │ -
│ │ │ +
16#include <dune/localfunctions/common/localfiniteelementvariant.hh>
│ │ │ +
17#include <dune/localfunctions/nedelec.hh>
│ │ │ +
18
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
23
│ │ │ +
24namespace Dune::Functions
│ │ │ +
25{
│ │ │ +
26
│ │ │ +
27namespace Impl
│ │ │ +
28{
│ │ │ +
29 template<typename GV, int dim, typename R, std::size_t order>
│ │ │ +
30 class Nedelec1stKindLocalFiniteElementMap
│ │ │ +
31 {
│ │ │ +
32 using D = typename GV::ctype;
│ │ │ +
33 constexpr static bool hasFixedElementType = Capabilities::hasSingleGeometryType<typename GV::Grid>::v;
│ │ │ +
34
│ │ │ +
35 using CubeFiniteElement = Nedelec1stKindCubeLocalFiniteElement<D,R,dim,order>;
│ │ │ +
36 using SimplexFiniteElement = Nedelec1stKindSimplexLocalFiniteElement<D,R,dim,order>;
│ │ │
37
│ │ │ -
38 } // namespace Concept
│ │ │ +
38 public:
│ │ │
39
│ │ │ -
40
│ │ │ -
41namespace BasisFactory {
│ │ │ -
42
│ │ │ - │ │ │ -
49
│ │ │ - │ │ │ -
51
│ │ │ -
│ │ │ - │ │ │ - │ │ │ -
84 {};
│ │ │ -
│ │ │ -
85
│ │ │ -
│ │ │ - │ │ │ -
117 : public IndexMergingStrategy
│ │ │ -
118 {};
│ │ │ -
│ │ │ -
119
│ │ │ -
│ │ │ - │ │ │ -
151 : public IndexMergingStrategy
│ │ │ -
152 {};
│ │ │ -
│ │ │ -
153
│ │ │ - │ │ │ -
185
│ │ │ -
186
│ │ │ -
│ │ │ - │ │ │ -
193 {
│ │ │ -
194 return {};
│ │ │ -
195 }
│ │ │ -
│ │ │ -
196
│ │ │ -
│ │ │ - │ │ │ -
203 {
│ │ │ -
204 return {};
│ │ │ -
205 }
│ │ │ -
│ │ │ -
206
│ │ │ -
│ │ │ - │ │ │ -
213 {
│ │ │ -
214 return {};
│ │ │ -
215 }
│ │ │ -
│ │ │ -
216
│ │ │ -
│ │ │ - │ │ │ -
223 {
│ │ │ -
224 return {};
│ │ │ -
225 }
│ │ │ -
│ │ │ -
226
│ │ │ -
227} // end namespace BasisFactory
│ │ │ -
228
│ │ │ -
229} // end namespace Functions
│ │ │ -
230} // end namespace Dune
│ │ │ -
231
│ │ │ -
232
│ │ │ -
233#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH
│ │ │ -
constexpr FlatLexicographic flatLexicographic()
Creates a lexicographic merging of direct children without blocking.
Definition basistags.hh:192
│ │ │ -
constexpr BlockedInterleaved blockedInterleaved()
Creates an interleaved merging of direct children with blocking (i.e. creating blocks at the leaves c...
Definition basistags.hh:222
│ │ │ -
constexpr FlatInterleaved flatInterleaved()
Creates an interleaved merging of direct children without blocking.
Definition basistags.hh:202
│ │ │ -
constexpr BlockedLexicographic blockedLexicographic()
Creates a lexicographic merging of direct children with blocking (i.e. creating one block per direct ...
Definition basistags.hh:212
│ │ │ -
Definition monomialset.hh:19
│ │ │ +
40 using T = LocalBasisTraits<D, dim, FieldVector<D,dim>, R, dim, FieldVector<R,dim>, FieldMatrix<D,dim,dim> >;
│ │ │ +
41
│ │ │ +
42 constexpr static unsigned int topologyId = Capabilities::hasSingleGeometryType<typename GV::Grid>::topologyId; // meaningless if hasFixedElementType is false
│ │ │ +
43 constexpr static GeometryType type = GeometryType(topologyId, GV::dimension);
│ │ │ +
44
│ │ │ +
45 using FiniteElement = std::conditional_t<hasFixedElementType,
│ │ │ +
46 std::conditional_t<type.isCube(),CubeFiniteElement,SimplexFiniteElement>,
│ │ │ +
47 LocalFiniteElementVariant<CubeFiniteElement, SimplexFiniteElement> >;
│ │ │ +
48
│ │ │ +
49 static std::size_t numVariants(GeometryType type)
│ │ │ +
50 {
│ │ │ +
51 if (order!=1) // I am not sure whether the formula below is correct for all orders.
│ │ │ +
52 DUNE_THROW(NotImplemented, "Only Nedelec elements of order 1 are implemented!");
│ │ │ +
53
│ │ │ +
54 auto numEdges = referenceElement<D,dim>(type).size(dim-1);
│ │ │ +
55 return power(2,numEdges);
│ │ │ +
56 }
│ │ │ +
57
│ │ │ +
58 Nedelec1stKindLocalFiniteElementMap(const GV& gv)
│ │ │ +
59 : elementMapper_(gv, mcmgElementLayout()),
│ │ │ +
60 orientation_(gv.size(0))
│ │ │ +
61 {
│ │ │ +
62 update(gv);
│ │ │ +
63 }
│ │ │ +
64
│ │ │ +
65 void update(const GV& gv)
│ │ │ +
66 {
│ │ │ +
67 elementMapper_.update(gv);
│ │ │ +
68 orientation_.resize(gv.size(0));
│ │ │ +
69
│ │ │ +
70 // create all variants
│ │ │ +
71 if constexpr (hasFixedElementType)
│ │ │ +
72 {
│ │ │ +
73 variants_.resize(numVariants(type));
│ │ │ +
74 for (size_t i = 0; i < numVariants(type); i++)
│ │ │ +
75 variants_[i] = FiniteElement(i);
│ │ │ +
76 }
│ │ │ +
77 else
│ │ │ +
78 {
│ │ │ +
79 // for mixed grids add offset for cubes
│ │ │ +
80 variants_.resize(numVariants(GeometryTypes::simplex(dim)) + numVariants(GeometryTypes::cube(dim)));
│ │ │ +
81 for (size_t i = 0; i < numVariants(GeometryTypes::simplex(dim)); i++)
│ │ │ +
82 variants_[i] = SimplexFiniteElement(i);
│ │ │ +
83 for (size_t i = 0; i < numVariants(GeometryTypes::cube(dim)); i++)
│ │ │ +
84 variants_[i + numVariants(GeometryTypes::simplex(dim))] = CubeFiniteElement(i);
│ │ │ +
85 }
│ │ │ +
86
│ │ │ +
87
│ │ │ +
88 // compute orientation for all elements
│ │ │ +
89 const auto& indexSet = gv.indexSet();
│ │ │ +
90
│ │ │ +
91 for(const auto& element : elements(gv))
│ │ │ +
92 {
│ │ │ +
93 const auto& refElement = referenceElement(element);
│ │ │ +
94 auto elementIndex = elementMapper_.index(element);
│ │ │ +
95 orientation_[elementIndex] = 0;
│ │ │ +
96
│ │ │ +
97 for (std::size_t i=0; i<element.subEntities(dim-1); i++)
│ │ │ +
98 {
│ │ │ +
99 // Local vertex indices within the element
│ │ │ +
100 auto localV0 = refElement.subEntity(i,dim-1, 0,dim);
│ │ │ +
101 auto localV1 = refElement.subEntity(i,dim-1, 1,dim);
│ │ │ +
102
│ │ │ +
103 // Global vertex indices within the grid
│ │ │ +
104 auto globalV0 = indexSet.subIndex(element,localV0,dim);
│ │ │ +
105 auto globalV1 = indexSet.subIndex(element,localV1,dim);
│ │ │ +
106
│ │ │ +
107 if ( (localV0<localV1 && globalV0>globalV1) || (localV0>localV1 && globalV0<globalV1) )
│ │ │ +
108 orientation_[elementIndex] |= (1 << i);
│ │ │ +
109 }
│ │ │ +
110 // for mixed grids add offset for cubes
│ │ │ +
111 if constexpr (!hasFixedElementType)
│ │ │ +
112 if (element.type().isCube())
│ │ │ +
113 orientation_[elementIndex] += numVariants(GeometryTypes::simplex(dim));
│ │ │ +
114 }
│ │ │ +
115 }
│ │ │ +
116
│ │ │ +
117 template<class Element>
│ │ │ +
118 const auto& find(const Element& element) const
│ │ │ +
119 {
│ │ │ +
120 return variants_[orientation_[elementMapper_.index(element)]];
│ │ │ +
121 }
│ │ │ +
122
│ │ │ +
123 private:
│ │ │ +
124 std::vector<FiniteElement> variants_;
│ │ │ +
125 Dune::MultipleCodimMultipleGeomTypeMapper<GV> elementMapper_;
│ │ │ +
126 std::vector<unsigned short> orientation_;
│ │ │ +
127 };
│ │ │ +
128
│ │ │ +
129
│ │ │ +
130} // namespace Impl
│ │ │ +
131
│ │ │ +
132
│ │ │ +
133// *****************************************************************************
│ │ │ +
134// This is the reusable part of the basis. It contains
│ │ │ +
135//
│ │ │ +
136// NedelecPreBasis
│ │ │ +
137// NedelecNode
│ │ │ +
138//
│ │ │ +
139// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ +
140// state. These components do _not_ depend on the global basis and local view
│ │ │ +
141// and can be used without a global basis.
│ │ │ +
142// *****************************************************************************
│ │ │ +
143
│ │ │ +
144template<typename GV, typename Range, std::size_t kind, int order>
│ │ │ +
145class NedelecNode;
│ │ │ +
146
│ │ │ +
147template<typename GV, typename Range, std::size_t kind, int order>
│ │ │ +
│ │ │ + │ │ │ +
149 public LeafPreBasisMapperMixin<GV>
│ │ │ +
150{
│ │ │ +
151 static const int dim = GV::dimension;
│ │ │ +
152 static_assert(kind==1, "Only the Nedelec basis of the first kind is currently implemented!");
│ │ │ +
153 using FiniteElementMap = typename Impl::Nedelec1stKindLocalFiniteElementMap<GV, dim, Range, order>;
│ │ │ +
154
│ │ │ +
155 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper<GV>;
│ │ │ +
156public:
│ │ │ +
157
│ │ │ +
159 using GridView = GV;
│ │ │ +
160 using size_type = std::size_t;
│ │ │ +
161
│ │ │ + │ │ │ +
163
│ │ │ +
│ │ │ + │ │ │ +
166 : LeafPreBasisMapperMixin<GV>(gv, mcmgLayout(Dim<1>{}))
│ │ │ + │ │ │ +
168 {
│ │ │ +
169 if (kind!=1)
│ │ │ +
170 DUNE_THROW(NotImplemented, "Only Nedelec elements of the first kind are implemented!");
│ │ │ +
171
│ │ │ +
172 // There is no inherent reason why the basis shouldn't work for grids with more than two
│ │ │ +
173 // element types. Somebody simply has to sit down and implement the missing bits.
│ │ │ +
174 if (gv.indexSet().types(0).size() > 2)
│ │ │ +
175 DUNE_THROW(NotImplemented, "Nédélec basis is only implemented for grids with simplex and cube elements");
│ │ │ +
176
│ │ │ +
177 for(auto type : gv.indexSet().types(0))
│ │ │ +
178 if (!type.isSimplex() && !type.isCube())
│ │ │ +
179 DUNE_THROW(NotImplemented, "Nédélec basis is only implemented for grids with simplex or cube elements.");
│ │ │ +
180
│ │ │ +
181 if (order>1)
│ │ │ +
182 DUNE_THROW(NotImplemented, "Only first-order elements are implemented");
│ │ │ +
183
│ │ │ +
184 if (dim!=2 && dim!=3)
│ │ │ +
185 DUNE_THROW(NotImplemented, "Only 2d and 3d Nédélec elements are implemented");
│ │ │ +
186 }
│ │ │ +
│ │ │ +
187
│ │ │ +
│ │ │ +
189 void update (const GridView& gv)
│ │ │ +
190 {
│ │ │ + │ │ │ +
192 finiteElementMap_.update(gv);
│ │ │ +
193 }
│ │ │ +
│ │ │ +
194
│ │ │ +
│ │ │ + │ │ │ +
199 {
│ │ │ +
200 return Node{&finiteElementMap_};
│ │ │ +
201 }
│ │ │ +
│ │ │ +
202
│ │ │ +
203protected:
│ │ │ +
204 FiniteElementMap finiteElementMap_;
│ │ │ +
205};
│ │ │ +
│ │ │ +
206
│ │ │ +
207
│ │ │ +
208
│ │ │ +
209template<typename GV, typename Range, size_t kind, int order>
│ │ │ +
│ │ │ + │ │ │ +
211 public LeafBasisNode
│ │ │ +
212{
│ │ │ +
213 static const int dim = GV::dimension;
│ │ │ +
214
│ │ │ +
215public:
│ │ │ +
216
│ │ │ +
217 using size_type = std::size_t;
│ │ │ +
218 using Element = typename GV::template Codim<0>::Entity;
│ │ │ +
219 static_assert(kind==1, "Only Nedelec elements of the first kind are implemented!");
│ │ │ +
220 using FiniteElementMap = typename Impl::Nedelec1stKindLocalFiniteElementMap<GV, dim, Range, order>;
│ │ │ +
221 using FiniteElement = Impl::GlobalValuedLocalFiniteElement<Impl::CovariantPiolaTransformator,
│ │ │ +
222 typename FiniteElementMap::FiniteElement,
│ │ │ +
223 Element>;
│ │ │ +
224
│ │ │ +
│ │ │ +
225 NedelecNode(const FiniteElementMap* finiteElementMap) :
│ │ │ +
226 element_(nullptr),
│ │ │ +
227 finiteElementMap_(finiteElementMap)
│ │ │ +
228 { }
│ │ │ +
│ │ │ +
229
│ │ │ +
│ │ │ +
231 const Element& element() const
│ │ │ +
232 {
│ │ │ +
233 return *element_;
│ │ │ +
234 }
│ │ │ +
│ │ │ +
235
│ │ │ +
│ │ │ + │ │ │ +
241 {
│ │ │ +
242 return finiteElement_;
│ │ │ +
243 }
│ │ │ +
│ │ │ +
244
│ │ │ +
│ │ │ +
246 void bind(const Element& e)
│ │ │ +
247 {
│ │ │ +
248 element_ = &e;
│ │ │ +
249 finiteElement_.bind((finiteElementMap_->find(*element_)), e);
│ │ │ +
250 this->setSize(finiteElement_.size());
│ │ │ +
251 }
│ │ │ +
│ │ │ +
252
│ │ │ +
253protected:
│ │ │ +
254
│ │ │ + │ │ │ + │ │ │ + │ │ │ +
258};
│ │ │ +
│ │ │ +
259
│ │ │ +
260
│ │ │ +
261
│ │ │ +
262namespace BasisFactory {
│ │ │ +
263
│ │ │ +
273template<std::size_t kind, std::size_t order, typename Range=double>
│ │ │ +
│ │ │ + │ │ │ +
275{
│ │ │ +
276 return [](const auto& gridView) {
│ │ │ +
277 return NedelecPreBasis<std::decay_t<decltype(gridView)>, Range, kind, order>(gridView);
│ │ │ +
278 };
│ │ │ +
279}
│ │ │ +
│ │ │ +
280
│ │ │ +
281} // end namespace BasisFactory
│ │ │ +
282
│ │ │ +
283
│ │ │ +
284
│ │ │ +
285// *****************************************************************************
│ │ │ +
286// This is the actual global basis implementation based on the reusable parts.
│ │ │ +
287// *****************************************************************************
│ │ │ +
288
│ │ │ +
296template<typename GV, std::size_t kind, std::size_t order, typename Range=double>
│ │ │ + │ │ │ +
298
│ │ │ +
299} // end namespace Dune::Functions
│ │ │ +
300
│ │ │ +
301
│ │ │ +
302#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
auto power(ChildPreBasisFactory &&childPreBasisFactory, std::size_t k, const IndexMergingStrategy &)
Create a pre-basis factory that can build a PowerPreBasis.
Definition dynamicpowerbasis.hh:410
│ │ │ +
auto nedelec()
Create a pre-basis factory that can create a Nédélec pre-basis.
Definition nedelecbasis.hh:274
│ │ │ +
auto elements(const SubDomainGridView< HostGridView > &subDomainGridView)
ADL findable access to element range for a SubDomainGridView.
Definition subdomain.hh:487
│ │ │
Definition monomialset.hh:19
│ │ │ -
Definition backends/concepts.hh:17
│ │ │ -
static constexpr bool isIndexMergingStrategy()
Definition basistags.hh:27
│ │ │ -
void registerIndexMergingStrategy(IndexMergingStrategy)
│ │ │ - │ │ │ -
auto require(T &&t) -> decltype(registerIndexMergingStrategy(t))
│ │ │ -
Base class for index merging strategies to simplify detection.
Definition basistags.hh:48
│ │ │ -
Lexicographic merging of direct children without blocking.
Definition basistags.hh:84
│ │ │ -
Interleaved merging of direct children without blocking.
Definition basistags.hh:118
│ │ │ -
Lexicographic merging of direct children with blocking (i.e. creating one block per direct child).
Definition basistags.hh:152
│ │ │ -
Interleaved merging of direct children with blocking (i.e. creating blocks at the leaves containing o...
Definition basistags.hh:184
│ │ │ +
DefaultGlobalBasis< NedelecPreBasis< GV, Range, kind, order > > NedelecBasis
Basis of a k-th-order Nédélec finite element space.
Definition nedelecbasis.hh:297
│ │ │ +
Definition argyrisbasis.hh:926
│ │ │ +
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:53
│ │ │ +
void update(const GridView &gv)
Update the stored GridView.
Definition leafprebasismappermixin.hh:101
│ │ │ +
LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout)
Construct from GridView and local DOF layout.
Definition leafprebasismappermixin.hh:74
│ │ │ +
Definition nedelecbasis.hh:212
│ │ │ +
const FiniteElementMap * finiteElementMap_
Definition nedelecbasis.hh:257
│ │ │ +
FiniteElement finiteElement_
Definition nedelecbasis.hh:255
│ │ │ +
Impl::GlobalValuedLocalFiniteElement< Impl::CovariantPiolaTransformator, typename FiniteElementMap::FiniteElement, Element > FiniteElement
Definition nedelecbasis.hh:221
│ │ │ +
void bind(const Element &e)
Bind to element.
Definition nedelecbasis.hh:246
│ │ │ +
const Element & element() const
Return current element, throw if unbound.
Definition nedelecbasis.hh:231
│ │ │ +
typename GV::template Codim< 0 >::Entity Element
Definition nedelecbasis.hh:218
│ │ │ +
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition nedelecbasis.hh:240
│ │ │ +
NedelecNode(const FiniteElementMap *finiteElementMap)
Definition nedelecbasis.hh:225
│ │ │ +
typename Impl::Nedelec1stKindLocalFiniteElementMap< GV, dim, Range, order > FiniteElementMap
Definition nedelecbasis.hh:220
│ │ │ +
const Element * element_
Definition nedelecbasis.hh:256
│ │ │ +
std::size_t size_type
Definition nedelecbasis.hh:217
│ │ │ +
Definition nedelecbasis.hh:150
│ │ │ +
std::size_t size_type
Definition nedelecbasis.hh:160
│ │ │ +
NedelecPreBasis(const GridView &gv)
Constructor for a given grid view object.
Definition nedelecbasis.hh:165
│ │ │ +
GV GridView
The grid view that the FE space is defined on.
Definition nedelecbasis.hh:159
│ │ │ +
FiniteElementMap finiteElementMap_
Definition nedelecbasis.hh:204
│ │ │ +
NedelecNode< GV, Range, kind, order > Node
Definition nedelecbasis.hh:162
│ │ │ +
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition nedelecbasis.hh:189
│ │ │ +
Node makeNode() const
Create tree node.
Definition nedelecbasis.hh:198
│ │ │ +
void setSize(const size_type size)
Definition nodes.hh:197
│ │ │ +
Definition nodes.hh:218
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,151 +1,429 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -basistags.hh │ │ │ │ +nedelecbasis.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH │ │ │ │ -8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH │ │ │ │ +8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ 12 │ │ │ │ -13namespace _D_u_n_e { │ │ │ │ -14namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +13#include │ │ │ │ +14#include │ │ │ │ 15 │ │ │ │ -16 namespace _C_o_n_c_e_p_t { │ │ │ │ -17 │ │ │ │ -_1_8 struct _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ -19 { │ │ │ │ -20 template │ │ │ │ -_2_1 auto _r_e_q_u_i_r_e(T&& t) -> decltype( │ │ │ │ -22 registerIndexMergingStrategy(t) │ │ │ │ -23 ); │ │ │ │ -24 }; │ │ │ │ -25 │ │ │ │ -26 template │ │ │ │ -_2_7 static constexpr bool _i_s_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y() │ │ │ │ -28 { │ │ │ │ -29 return models(); │ │ │ │ -30 } │ │ │ │ -31 │ │ │ │ -32 template │ │ │ │ -_3_3 static constexpr bool _i_s_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y(T&& t) │ │ │ │ -34 { │ │ │ │ -35 return models>(); │ │ │ │ -36 } │ │ │ │ +16#include │ │ │ │ +17#include │ │ │ │ +18 │ │ │ │ +19#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ +20#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/ │ │ │ │ +_g_l_o_b_a_l_v_a_l_u_e_d_l_o_c_a_l_f_i_n_i_t_e_e_l_e_m_e_n_t_._h_h> │ │ │ │ +21#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h> │ │ │ │ +22#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ +23 │ │ │ │ +24namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ +25{ │ │ │ │ +26 │ │ │ │ +27namespace Impl │ │ │ │ +28{ │ │ │ │ +29 template │ │ │ │ +30 class Nedelec1stKindLocalFiniteElementMap │ │ │ │ +31 { │ │ │ │ +32 using D = typename GV::ctype; │ │ │ │ +33 constexpr static bool hasFixedElementType = Capabilities:: │ │ │ │ +hasSingleGeometryType::v; │ │ │ │ +34 │ │ │ │ +35 using CubeFiniteElement = │ │ │ │ +Nedelec1stKindCubeLocalFiniteElement; │ │ │ │ +36 using SimplexFiniteElement = │ │ │ │ +Nedelec1stKindSimplexLocalFiniteElement; │ │ │ │ 37 │ │ │ │ -38 } // namespace Concept │ │ │ │ +38 public: │ │ │ │ 39 │ │ │ │ -40 │ │ │ │ -41namespace BasisFactory { │ │ │ │ -42 │ │ │ │ -_4_8 struct _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y {}; │ │ │ │ -49 │ │ │ │ -_5_0 void _r_e_g_i_s_t_e_r_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y(_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y); │ │ │ │ -51 │ │ │ │ -_8_2 struct _F_l_a_t_L_e_x_i_c_o_g_r_a_p_h_i_c │ │ │ │ -83 : public _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ -84 {}; │ │ │ │ -85 │ │ │ │ -_1_1_6 struct _F_l_a_t_I_n_t_e_r_l_e_a_v_e_d │ │ │ │ -117 : public _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ -118 {}; │ │ │ │ -119 │ │ │ │ -_1_5_0 struct _B_l_o_c_k_e_d_L_e_x_i_c_o_g_r_a_p_h_i_c │ │ │ │ -151 : public _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ -152 {}; │ │ │ │ -153 │ │ │ │ -_1_8_4 struct _B_l_o_c_k_e_d_I_n_t_e_r_l_e_a_v_e_d : public _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y {}; │ │ │ │ -185 │ │ │ │ -186 │ │ │ │ -_1_9_2 constexpr _F_l_a_t_L_e_x_i_c_o_g_r_a_p_h_i_c _f_l_a_t_L_e_x_i_c_o_g_r_a_p_h_i_c() │ │ │ │ -193 { │ │ │ │ -194 return {}; │ │ │ │ -195 } │ │ │ │ -196 │ │ │ │ -_2_0_2 constexpr _F_l_a_t_I_n_t_e_r_l_e_a_v_e_d _f_l_a_t_I_n_t_e_r_l_e_a_v_e_d() │ │ │ │ -203 { │ │ │ │ -204 return {}; │ │ │ │ -205 } │ │ │ │ +40 using T = LocalBasisTraits, R, dim, │ │ │ │ +FieldVector, FieldMatrix >; │ │ │ │ +41 │ │ │ │ +42 constexpr static unsigned int topologyId = Capabilities:: │ │ │ │ +hasSingleGeometryType::topologyId; // meaningless if │ │ │ │ +hasFixedElementType is false │ │ │ │ +43 constexpr static GeometryType type = GeometryType(topologyId, GV:: │ │ │ │ +dimension); │ │ │ │ +44 │ │ │ │ +45 using FiniteElement = std::conditional_t, │ │ │ │ +47 LocalFiniteElementVariant >; │ │ │ │ +48 │ │ │ │ +49 static std::size_t numVariants(GeometryType type) │ │ │ │ +50 { │ │ │ │ +51 if (order!=1) // I am not sure whether the formula below is correct for all │ │ │ │ +orders. │ │ │ │ +52 DUNE_THROW(NotImplemented, "Only Nedelec elements of order 1 are │ │ │ │ +implemented!"); │ │ │ │ +53 │ │ │ │ +54 auto numEdges = referenceElement(type).size(dim-1); │ │ │ │ +55 return _p_o_w_e_r(2,numEdges); │ │ │ │ +56 } │ │ │ │ +57 │ │ │ │ +58 Nedelec1stKindLocalFiniteElementMap(const GV& gv) │ │ │ │ +59 : elementMapper_(gv, mcmgElementLayout()), │ │ │ │ +60 orientation_(gv.size(0)) │ │ │ │ +61 { │ │ │ │ +62 update(gv); │ │ │ │ +63 } │ │ │ │ +64 │ │ │ │ +65 void update(const GV& gv) │ │ │ │ +66 { │ │ │ │ +67 elementMapper_.update(gv); │ │ │ │ +68 orientation_.resize(gv.size(0)); │ │ │ │ +69 │ │ │ │ +70 // create all variants │ │ │ │ +71 if constexpr (hasFixedElementType) │ │ │ │ +72 { │ │ │ │ +73 variants_.resize(numVariants(type)); │ │ │ │ +74 for (size_t i = 0; i < numVariants(type); i++) │ │ │ │ +75 variants_[i] = FiniteElement(i); │ │ │ │ +76 } │ │ │ │ +77 else │ │ │ │ +78 { │ │ │ │ +79 // for mixed grids add offset for cubes │ │ │ │ +80 variants_.resize(numVariants(GeometryTypes::simplex(dim)) + numVariants │ │ │ │ +(GeometryTypes::cube(dim))); │ │ │ │ +81 for (size_t i = 0; i < numVariants(GeometryTypes::simplex(dim)); i++) │ │ │ │ +82 variants_[i] = SimplexFiniteElement(i); │ │ │ │ +83 for (size_t i = 0; i < numVariants(GeometryTypes::cube(dim)); i++) │ │ │ │ +84 variants_[i + numVariants(GeometryTypes::simplex(dim))] = CubeFiniteElement │ │ │ │ +(i); │ │ │ │ +85 } │ │ │ │ +86 │ │ │ │ +87 │ │ │ │ +88 // compute orientation for all elements │ │ │ │ +89 const auto& indexSet = gv.indexSet(); │ │ │ │ +90 │ │ │ │ +91 for(const auto& element : _e_l_e_m_e_n_t_s(gv)) │ │ │ │ +92 { │ │ │ │ +93 const auto& refElement = referenceElement(element); │ │ │ │ +94 auto elementIndex = elementMapper_.index(element); │ │ │ │ +95 orientation_[elementIndex] = 0; │ │ │ │ +96 │ │ │ │ +97 for (std::size_t i=0; iglobalV1) || (localV0>localV1 && │ │ │ │ +globalV0 │ │ │ │ +118 const auto& find(const Element& element) const │ │ │ │ +119 { │ │ │ │ +120 return variants_[orientation_[elementMapper_.index(element)]]; │ │ │ │ +121 } │ │ │ │ +122 │ │ │ │ +123 private: │ │ │ │ +124 std::vector variants_; │ │ │ │ +125 Dune::MultipleCodimMultipleGeomTypeMapper elementMapper_; │ │ │ │ +126 std::vector orientation_; │ │ │ │ +127 }; │ │ │ │ +128 │ │ │ │ +129 │ │ │ │ +130} // namespace Impl │ │ │ │ +131 │ │ │ │ +132 │ │ │ │ +133/ │ │ │ │ +/ ***************************************************************************** │ │ │ │ +134// This is the reusable part of the basis. It contains │ │ │ │ +135// │ │ │ │ +136// NedelecPreBasis │ │ │ │ +137// NedelecNode │ │ │ │ +138// │ │ │ │ +139// The pre-basis allows to create the others and is the owner of possible │ │ │ │ +shared │ │ │ │ +140// state. These components do _not_ depend on the global basis and local │ │ │ │ +view │ │ │ │ +141// and can be used without a global basis. │ │ │ │ +142/ │ │ │ │ +/ ***************************************************************************** │ │ │ │ +143 │ │ │ │ +144template │ │ │ │ +145class _N_e_d_e_l_e_c_N_o_d_e; │ │ │ │ +146 │ │ │ │ +147template │ │ │ │ +_1_4_8class _N_e_d_e_l_e_c_P_r_e_B_a_s_i_s : │ │ │ │ +149 public _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n │ │ │ │ +150{ │ │ │ │ +151 static const int dim = GV::dimension; │ │ │ │ +152 static_assert(kind==1, "Only the Nedelec basis of the first kind is │ │ │ │ +currently implemented!"); │ │ │ │ +153 using FiniteElementMap = typename Impl:: │ │ │ │ +Nedelec1stKindLocalFiniteElementMap; │ │ │ │ +154 │ │ │ │ +155 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper; │ │ │ │ +156public: │ │ │ │ +157 │ │ │ │ +_1_5_9 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ +_1_6_0 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ +161 │ │ │ │ +_1_6_2 using _N_o_d_e = _N_e_d_e_l_e_c_N_o_d_e_<_G_V_,_ _R_a_n_g_e_,_ _k_i_n_d_,_ _o_r_d_e_r_>; │ │ │ │ +163 │ │ │ │ +_1_6_5 _N_e_d_e_l_e_c_P_r_e_B_a_s_i_s(const _G_r_i_d_V_i_e_w& gv) │ │ │ │ +166 : _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n(gv, mcmgLayout(Dim<1>{})) │ │ │ │ +167 , _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__(gv) │ │ │ │ +168 { │ │ │ │ +169 if (kind!=1) │ │ │ │ +170 DUNE_THROW(NotImplemented, "Only Nedelec elements of the first kind are │ │ │ │ +implemented!"); │ │ │ │ +171 │ │ │ │ +172 // There is no inherent reason why the basis shouldn't work for grids with │ │ │ │ +more than two │ │ │ │ +173 // element types. Somebody simply has to sit down and implement the missing │ │ │ │ +bits. │ │ │ │ +174 if (gv.indexSet().types(0).size() > 2) │ │ │ │ +175 DUNE_THROW(NotImplemented, "Nédélec basis is only implemented for grids │ │ │ │ +with simplex and cube elements"); │ │ │ │ +176 │ │ │ │ +177 for(auto type : gv.indexSet().types(0)) │ │ │ │ +178 if (!type.isSimplex() && !type.isCube()) │ │ │ │ +179 DUNE_THROW(NotImplemented, "Nédélec basis is only implemented for grids │ │ │ │ +with simplex or cube elements."); │ │ │ │ +180 │ │ │ │ +181 if (order>1) │ │ │ │ +182 DUNE_THROW(NotImplemented, "Only first-order elements are implemented"); │ │ │ │ +183 │ │ │ │ +184 if (dim!=2 && dim!=3) │ │ │ │ +185 DUNE_THROW(NotImplemented, "Only 2d and 3d Nédélec elements are │ │ │ │ +implemented"); │ │ │ │ +186 } │ │ │ │ +187 │ │ │ │ +_1_8_9 void _u_p_d_a_t_e (const _G_r_i_d_V_i_e_w& gv) │ │ │ │ +190 { │ │ │ │ +191 _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_<_G_V_>_:_:_u_p_d_a_t_e(gv); │ │ │ │ +192 _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__.update(gv); │ │ │ │ +193 } │ │ │ │ +194 │ │ │ │ +_1_9_8 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ +199 { │ │ │ │ +200 return _N_o_d_e{&_f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__}; │ │ │ │ +201 } │ │ │ │ +202 │ │ │ │ +203protected: │ │ │ │ +_2_0_4 FiniteElementMap _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__; │ │ │ │ +205}; │ │ │ │ 206 │ │ │ │ -_2_1_2 constexpr _B_l_o_c_k_e_d_L_e_x_i_c_o_g_r_a_p_h_i_c _b_l_o_c_k_e_d_L_e_x_i_c_o_g_r_a_p_h_i_c() │ │ │ │ -213 { │ │ │ │ -214 return {}; │ │ │ │ -215 } │ │ │ │ +207 │ │ │ │ +208 │ │ │ │ +209template │ │ │ │ +_2_1_0class _N_e_d_e_l_e_c_N_o_d_e : │ │ │ │ +211 public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ +212{ │ │ │ │ +213 static const int dim = GV::dimension; │ │ │ │ +214 │ │ │ │ +215public: │ │ │ │ 216 │ │ │ │ -_2_2_2 constexpr _B_l_o_c_k_e_d_I_n_t_e_r_l_e_a_v_e_d _b_l_o_c_k_e_d_I_n_t_e_r_l_e_a_v_e_d() │ │ │ │ -223 { │ │ │ │ -224 return {}; │ │ │ │ -225 } │ │ │ │ -226 │ │ │ │ -227} // end namespace BasisFactory │ │ │ │ -228 │ │ │ │ -229} // end namespace Functions │ │ │ │ -230} // end namespace Dune │ │ │ │ -231 │ │ │ │ -232 │ │ │ │ -233#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_f_l_a_t_L_e_x_i_c_o_g_r_a_p_h_i_c │ │ │ │ -constexpr FlatLexicographic flatLexicographic() │ │ │ │ -Creates a lexicographic merging of direct children without blocking. │ │ │ │ -DDeeffiinniittiioonn basistags.hh:192 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_b_l_o_c_k_e_d_I_n_t_e_r_l_e_a_v_e_d │ │ │ │ -constexpr BlockedInterleaved blockedInterleaved() │ │ │ │ -Creates an interleaved merging of direct children with blocking (i.e. creating │ │ │ │ -blocks at the leaves c... │ │ │ │ -DDeeffiinniittiioonn basistags.hh:222 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_f_l_a_t_I_n_t_e_r_l_e_a_v_e_d │ │ │ │ -constexpr FlatInterleaved flatInterleaved() │ │ │ │ -Creates an interleaved merging of direct children without blocking. │ │ │ │ -DDeeffiinniittiioonn basistags.hh:202 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_b_l_o_c_k_e_d_L_e_x_i_c_o_g_r_a_p_h_i_c │ │ │ │ -constexpr BlockedLexicographic blockedLexicographic() │ │ │ │ -Creates a lexicographic merging of direct children with blocking (i.e. creating │ │ │ │ -one block per direct ... │ │ │ │ -DDeeffiinniittiioonn basistags.hh:212 │ │ │ │ -_D_u_n_e │ │ │ │ -DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ +_2_1_7 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ +_2_1_8 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ +219 static_assert(kind==1, "Only Nedelec elements of the first kind are │ │ │ │ +implemented!"); │ │ │ │ +_2_2_0 using _F_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p = typename Impl:: │ │ │ │ +Nedelec1stKindLocalFiniteElementMap; │ │ │ │ +_2_2_1 using _F_i_n_i_t_e_E_l_e_m_e_n_t = Impl::GlobalValuedLocalFiniteElement; │ │ │ │ +224 │ │ │ │ +_2_2_5 _N_e_d_e_l_e_c_N_o_d_e(const _F_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p* finiteElementMap) : │ │ │ │ +226 _e_l_e_m_e_n_t__(nullptr), │ │ │ │ +227 _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__(finiteElementMap) │ │ │ │ +228 { } │ │ │ │ +229 │ │ │ │ +_2_3_1 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ +232 { │ │ │ │ +233 return *_e_l_e_m_e_n_t__; │ │ │ │ +234 } │ │ │ │ +235 │ │ │ │ +_2_4_0 const _F_i_n_i_t_e_E_l_e_m_e_n_t& _f_i_n_i_t_e_E_l_e_m_e_n_t() const │ │ │ │ +241 { │ │ │ │ +242 return _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ +243 } │ │ │ │ +244 │ │ │ │ +_2_4_6 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ +247 { │ │ │ │ +248 _e_l_e_m_e_n_t__ = &e; │ │ │ │ +249 _f_i_n_i_t_e_E_l_e_m_e_n_t__.bind((_f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__->find(*_e_l_e_m_e_n_t__)), e); │ │ │ │ +250 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__.size()); │ │ │ │ +251 } │ │ │ │ +252 │ │ │ │ +253protected: │ │ │ │ +254 │ │ │ │ +_2_5_5 _F_i_n_i_t_e_E_l_e_m_e_n_t _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ +_2_5_6 const _E_l_e_m_e_n_t* _e_l_e_m_e_n_t__; │ │ │ │ +_2_5_7 const _F_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p* _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__; │ │ │ │ +258}; │ │ │ │ +259 │ │ │ │ +260 │ │ │ │ +261 │ │ │ │ +262namespace _B_a_s_i_s_F_a_c_t_o_r_y { │ │ │ │ +263 │ │ │ │ +273template │ │ │ │ +_2_7_4auto _n_e_d_e_l_e_c() │ │ │ │ +275{ │ │ │ │ +276 return [](const auto& gridView) { │ │ │ │ +277 return _N_e_d_e_l_e_c_P_r_e_B_a_s_i_s, Range, kind, │ │ │ │ +order>(gridView); │ │ │ │ +278 }; │ │ │ │ +279} │ │ │ │ +280 │ │ │ │ +281} // end namespace BasisFactory │ │ │ │ +282 │ │ │ │ +283 │ │ │ │ +284 │ │ │ │ +285/ │ │ │ │ +/ ***************************************************************************** │ │ │ │ +286// This is the actual global basis implementation based on the reusable │ │ │ │ +parts. │ │ │ │ +287/ │ │ │ │ +/ ***************************************************************************** │ │ │ │ +288 │ │ │ │ +296template │ │ │ │ +_2_9_7using _N_e_d_e_l_e_c_B_a_s_i_s = _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_N_e_d_e_l_e_c_P_r_e_B_a_s_i_s_<_G_V_,_ _R_a_n_g_e_,_ _k_i_n_d_, │ │ │ │ +_o_r_d_e_r_ _> >; │ │ │ │ +298 │ │ │ │ +299} // end namespace Dune::Functions │ │ │ │ +300 │ │ │ │ +301 │ │ │ │ +302#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH │ │ │ │ +_g_l_o_b_a_l_v_a_l_u_e_d_l_o_c_a_l_f_i_n_i_t_e_e_l_e_m_e_n_t_._h_h │ │ │ │ +_n_o_d_e_s_._h_h │ │ │ │ +_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ +_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_p_o_w_e_r │ │ │ │ +auto power(ChildPreBasisFactory &&childPreBasisFactory, std::size_t k, const │ │ │ │ +IndexMergingStrategy &) │ │ │ │ +Create a pre-basis factory that can build a PowerPreBasis. │ │ │ │ +DDeeffiinniittiioonn dynamicpowerbasis.hh:410 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_n_e_d_e_l_e_c │ │ │ │ +auto nedelec() │ │ │ │ +Create a pre-basis factory that can create a Nédélec pre-basis. │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:274 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_e_l_e_m_e_n_t_s │ │ │ │ +auto elements(const SubDomainGridView< HostGridView > &subDomainGridView) │ │ │ │ +ADL findable access to element range for a SubDomainGridView. │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:487 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t │ │ │ │ -DDeeffiinniittiioonn backends/concepts.hh:17 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ -static constexpr bool isIndexMergingStrategy() │ │ │ │ -DDeeffiinniittiioonn basistags.hh:27 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_r_e_g_i_s_t_e_r_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ -void registerIndexMergingStrategy(IndexMergingStrategy) │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ -DDeeffiinniittiioonn basistags.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y_:_:_r_e_q_u_i_r_e │ │ │ │ -auto require(T &&t) -> decltype(registerIndexMergingStrategy(t)) │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ -Base class for index merging strategies to simplify detection. │ │ │ │ -DDeeffiinniittiioonn basistags.hh:48 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_F_l_a_t_L_e_x_i_c_o_g_r_a_p_h_i_c │ │ │ │ -Lexicographic merging of direct children without blocking. │ │ │ │ -DDeeffiinniittiioonn basistags.hh:84 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_F_l_a_t_I_n_t_e_r_l_e_a_v_e_d │ │ │ │ -Interleaved merging of direct children without blocking. │ │ │ │ -DDeeffiinniittiioonn basistags.hh:118 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_B_l_o_c_k_e_d_L_e_x_i_c_o_g_r_a_p_h_i_c │ │ │ │ -Lexicographic merging of direct children with blocking (i.e. creating one block │ │ │ │ -per direct child). │ │ │ │ -DDeeffiinniittiioonn basistags.hh:152 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_B_l_o_c_k_e_d_I_n_t_e_r_l_e_a_v_e_d │ │ │ │ -Interleaved merging of direct children with blocking (i.e. creating blocks at │ │ │ │ -the leaves containing o... │ │ │ │ -DDeeffiinniittiioonn basistags.hh:184 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_B_a_s_i_s │ │ │ │ +DefaultGlobalBasis< NedelecPreBasis< GV, Range, kind, order > > NedelecBasis │ │ │ │ +Basis of a k-th-order Nédélec finite element space. │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:297 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ +DDeeffiinniittiioonn argyrisbasis.hh:926 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ +Global basis for given pre-basis. │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:53 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_u_p_d_a_t_e │ │ │ │ +void update(const GridView &gv) │ │ │ │ +Update the stored GridView. │ │ │ │ +DDeeffiinniittiioonn leafprebasismappermixin.hh:101 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n │ │ │ │ +LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout) │ │ │ │ +Construct from GridView and local DOF layout. │ │ │ │ +DDeeffiinniittiioonn leafprebasismappermixin.hh:74 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_N_o_d_e │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:212 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__ │ │ │ │ +const FiniteElementMap * finiteElementMap_ │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:257 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t__ │ │ │ │ +FiniteElement finiteElement_ │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:255 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_N_o_d_e_:_:_F_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ +Impl::GlobalValuedLocalFiniteElement< Impl::CovariantPiolaTransformator, │ │ │ │ +typename FiniteElementMap::FiniteElement, Element > FiniteElement │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:221 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_N_o_d_e_:_:_b_i_n_d │ │ │ │ +void bind(const Element &e) │ │ │ │ +Bind to element. │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:246 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_N_o_d_e_:_:_e_l_e_m_e_n_t │ │ │ │ +const Element & element() const │ │ │ │ +Return current element, throw if unbound. │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:231 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_N_o_d_e_:_:_E_l_e_m_e_n_t │ │ │ │ +typename GV::template Codim< 0 >::Entity Element │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:218 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ +const FiniteElement & finiteElement() const │ │ │ │ +Return the LocalFiniteElement for the element we are bound to. │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:240 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_N_o_d_e_:_:_N_e_d_e_l_e_c_N_o_d_e │ │ │ │ +NedelecNode(const FiniteElementMap *finiteElementMap) │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:225 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_N_o_d_e_:_:_F_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p │ │ │ │ +typename Impl::Nedelec1stKindLocalFiniteElementMap< GV, dim, Range, order > │ │ │ │ +FiniteElementMap │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:220 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_N_o_d_e_:_:_e_l_e_m_e_n_t__ │ │ │ │ +const Element * element_ │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:256 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_N_o_d_e_:_:_s_i_z_e___t_y_p_e │ │ │ │ +std::size_t size_type │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:217 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_P_r_e_B_a_s_i_s │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:150 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_P_r_e_B_a_s_i_s_:_:_s_i_z_e___t_y_p_e │ │ │ │ +std::size_t size_type │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:160 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_P_r_e_B_a_s_i_s_:_:_N_e_d_e_l_e_c_P_r_e_B_a_s_i_s │ │ │ │ +NedelecPreBasis(const GridView &gv) │ │ │ │ +Constructor for a given grid view object. │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:165 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ +GV GridView │ │ │ │ +The grid view that the FE space is defined on. │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:159 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_P_r_e_B_a_s_i_s_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__ │ │ │ │ +FiniteElementMap finiteElementMap_ │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:204 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_P_r_e_B_a_s_i_s_:_:_N_o_d_e │ │ │ │ +NedelecNode< GV, Range, kind, order > Node │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:162 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_P_r_e_B_a_s_i_s_:_:_u_p_d_a_t_e │ │ │ │ +void update(const GridView &gv) │ │ │ │ +Update the stored grid view, to be called if the grid has changed. │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:189 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_N_e_d_e_l_e_c_P_r_e_B_a_s_i_s_:_:_m_a_k_e_N_o_d_e │ │ │ │ +Node makeNode() const │ │ │ │ +Create tree node. │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:198 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_e_t_S_i_z_e │ │ │ │ +void setSize(const size_type size) │ │ │ │ +DDeeffiinniittiioonn nodes.hh:197 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ +DDeeffiinniittiioonn nodes.hh:218 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _b_a_s_i_s_t_a_g_s_._h_h │ │ │ │ + * _n_e_d_e_l_e_c_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00191.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: argyrisbasis.hh File Reference │ │ │ +Dune-Functions: interpolate.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,80 +88,61 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
argyrisbasis.hh File Reference
│ │ │ +
interpolate.hh File Reference
│ │ │
│ │ │
│ │ │ - │ │ │ -

This file provides an implementation of the cubic Argyris finite element. │ │ │ -More...

│ │ │ -
#include <algorithm>
│ │ │ -#include <array>
│ │ │ +
#include <memory>
│ │ │ +#include <vector>
│ │ │ #include <dune/common/exceptions.hh>
│ │ │ -#include <dune/common/fmatrix.hh>
│ │ │ -#include <dune/common/fvector.hh>
│ │ │ -#include <dune/common/rangeutilities.hh>
│ │ │ -#include <dune/grid/common/mcmgmapper.hh>
│ │ │ -#include <dune/localfunctions/common/localbasis.hh>
│ │ │ -#include <dune/localfunctions/common/localfiniteelementtraits.hh>
│ │ │ -#include <dune/localfunctions/common/localkey.hh>
│ │ │ -#include <dune/functions/analyticfunctions/monomialset.hh>
│ │ │ -#include <dune/functions/common/mapperutilities.hh>
│ │ │ -#include <dune/functions/functionspacebases/cubichermitebasis.hh>
│ │ │ -#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │ -#include <dune/functions/functionspacebases/functionaldescriptor.hh>
│ │ │ -#include <dune/functions/functionspacebases/leafprebasismappermixin.hh>
│ │ │ -#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ -#include <dune/functions/functionspacebases/transformedfiniteelementmixin.hh>
│ │ │ +#include <dune/common/bitsetvector.hh>
│ │ │ +#include <dune/common/referencehelper.hh>
│ │ │ +#include <dune/common/typetree/traversal.hh>
│ │ │ +#include <dune/functions/gridfunctions/gridviewfunction.hh>
│ │ │ +#include <dune/functions/common/functionconcepts.hh>
│ │ │ +#include <dune/functions/backends/concepts.hh>
│ │ │ +#include <dune/functions/backends/istlvectorbackend.hh>
│ │ │ +#include <dune/functions/functionspacebases/flatvectorview.hh>
│ │ │ +#include <dune/functions/functionspacebases/hierarchicnodetorangemap.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -

│ │ │ -Classes

class  Dune::Functions::ArgyrisNode< GV, R >
class  Dune::Functions::ArgyrisPreBasis< GV, R >
 A pre-basis for a Argyrisbasis. More...
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::BasisFactory
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ -Typedefs

template<class GV, class R = double>
using Dune::Functions::ArgyrisBasis = DefaultGlobalBasis<ArgyrisPreBasis<GV, R> >
 Nodal basis of a scalar cubic Argyris finite element space.

│ │ │ +Functions

template<class B, class C, class F, class BV, class NTRE>
void Dune::Functions::interpolate (const B &basis, C &&coeff, const F &f, const BV &bv, const NTRE &nodeToRangeEntry)
 Interpolate given function in discrete function space.
template<class B, class C, class F, class BV>
void Dune::Functions::interpolate (const B &basis, C &&coeff, const F &f, const BV &bitVector)
 Interpolate given function in discrete function space.
template<class B, class C, class F>
void Dune::Functions::interpolate (const B &basis, C &&coeff, const F &f)
 Interpolate given function in discrete function space.
│ │ │ -

Detailed Description

│ │ │ -

This file provides an implementation of the cubic Argyris finite element.

│ │ │ -

For reference, see[Ciarlet, The Finite Element Method for Elliptic Problems, 2002]. It contains in the following order:

    │ │ │ -
  • A GlobalBasis typedef ArgyrisBasis
  • │ │ │ -
  • A template ArgyrisLocalFiniteElement providing an implementation of the LocalFiniteElement interface, along with its subparts (Impl namespace)
  • │ │ │ -
  • A template ArgyrisNode
  • │ │ │ -
  • A template ArgyrisPreBasis
  • │ │ │ -
  • A Factory argyris() in the BasisFactory namespace
  • │ │ │ -
│ │ │ -
│ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,54 +1,38 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -argyrisbasis.hh File Reference │ │ │ │ -This file provides an implementation of the cubic Argyris finite element. │ │ │ │ -_M_o_r_e_._._. │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ +interpolate.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_a_n_a_l_y_t_i_c_f_u_n_c_t_i_o_n_s_/_m_o_n_o_m_i_a_l_s_e_t_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_m_a_p_p_e_r_u_t_i_l_i_t_i_e_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_u_b_i_c_h_e_r_m_i_t_e_b_a_s_i_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_f_u_n_c_t_i_o_n_a_l_d_e_s_c_r_i_p_t_o_r_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_t_r_a_n_s_f_o_r_m_e_d_f_i_n_i_t_e_e_l_e_m_e_n_t_m_i_x_i_n_._h_h> │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_b_a_c_k_e_n_d_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_b_a_c_k_e_n_d_s_/_i_s_t_l_v_e_c_t_o_r_b_a_c_k_e_n_d_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_f_l_a_t_v_e_c_t_o_r_v_i_e_w_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_h_i_e_r_a_r_c_h_i_c_n_o_d_e_t_o_r_a_n_g_e_m_a_p_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ -CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_N_o_d_e_<_ _G_V_,_ _R_ _> │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_<_ _G_V_,_ _R_ _> │ │ │ │ -  A pre-basis for a Argyrisbasis. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -TTyyppeeddeeffss │ │ │ │ -template │ │ │ │ -using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_B_a_s_i_s = _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s<_A_r_g_y_r_i_s_P_r_e_B_a_s_i_s > │ │ │ │ -  Nodal basis of a scalar cubic Argyris finite element space. │ │ │ │ -********** DDeettaaiilleedd DDeessccrriippttiioonn ********** │ │ │ │ -This file provides an implementation of the cubic Argyris finite element. │ │ │ │ -For reference, see[Ciarlet, The Finite Element Method for Elliptic Problems, │ │ │ │ -2002]. It contains in the following order: │ │ │ │ - * A GlobalBasis typedef ArgyrisBasis │ │ │ │ - * A template ArgyrisLocalFiniteElement providing an implementation of the │ │ │ │ - LocalFiniteElement interface, along with its subparts (Impl namespace) │ │ │ │ - * A template ArgyrisNode │ │ │ │ - * A template ArgyrisPreBasis │ │ │ │ - * A Factory argyris() in the BasisFactory namespace │ │ │ │ +FFuunnccttiioonnss │ │ │ │ +template │ │ │ │ +void  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_i_n_t_e_r_p_o_l_a_t_e (const B &basis, C &&coeff, const F &f, │ │ │ │ + const BV &bv, const NTRE &nodeToRangeEntry) │ │ │ │ +  Interpolate given function in discrete function space. │ │ │ │ +template │ │ │ │ +void  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_i_n_t_e_r_p_o_l_a_t_e (const B &basis, C &&coeff, const F &f, │ │ │ │ + const BV &bitVector) │ │ │ │ +  Interpolate given function in discrete function space. │ │ │ │ +template │ │ │ │ +void  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_i_n_t_e_r_p_o_l_a_t_e (const B &basis, C &&coeff, const F &f) │ │ │ │ +  Interpolate given function in discrete function space. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _a_r_g_y_r_i_s_b_a_s_i_s_._h_h │ │ │ │ + * _i_n_t_e_r_p_o_l_a_t_e_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00191.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,4 +1,5 @@ │ │ │ │ var a00191 = [ │ │ │ │ - ["Dune::Functions::ArgyrisNode< GV, R >", "a01610.html", "a01610"], │ │ │ │ - ["Dune::Functions::ArgyrisBasis", "a00312.html#ga1513dcdd2f0920f872f31c32e8ddbb5b", null] │ │ │ │ + ["Dune::Functions::interpolate", "a00318.html#a2e34859322800ae26a292903910ef9f7", null], │ │ │ │ + ["Dune::Functions::interpolate", "a00318.html#ae167dc7b5ace0ff9617a3205b05744b5", null], │ │ │ │ + ["Dune::Functions::interpolate", "a00318.html#a13b0c6bf02d744e7b2078d1a535b5211", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00191_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: argyrisbasis.hh Source File │ │ │ +Dune-Functions: interpolate.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,882 +88,303 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
argyrisbasis.hh
│ │ │ +
interpolate.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │ -
6#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_ARGYRISBASIS_HH
│ │ │ -
7#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_ARGYRISBASIS_HH
│ │ │ -
8
│ │ │ -
9#include <algorithm>
│ │ │ -
10#include <array>
│ │ │ -
11
│ │ │ -
12#include <dune/common/exceptions.hh>
│ │ │ -
13#include <dune/common/fmatrix.hh>
│ │ │ -
14#include <dune/common/fvector.hh>
│ │ │ -
15#include <dune/common/rangeutilities.hh>
│ │ │ +
6
│ │ │ +
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH
│ │ │ +
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH
│ │ │ +
9
│ │ │ +
10#include <memory>
│ │ │ +
11#include <vector>
│ │ │ +
12
│ │ │ +
13#include <dune/common/exceptions.hh>
│ │ │ +
14#include <dune/common/bitsetvector.hh>
│ │ │ +
15#include <dune/common/referencehelper.hh>
│ │ │
16
│ │ │ -
17#include <dune/grid/common/mcmgmapper.hh>
│ │ │ +
17#include <dune/common/typetree/traversal.hh>
│ │ │
18
│ │ │ -
19#include <dune/localfunctions/common/localbasis.hh>
│ │ │ -
20#include <dune/localfunctions/common/localfiniteelementtraits.hh>
│ │ │ -
21#include <dune/localfunctions/common/localkey.hh>
│ │ │ -
22
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
31
│ │ │ -
45namespace Dune::Functions
│ │ │ -
46{
│ │ │ -
47
│ │ │ -
48 template<class GV, class R>
│ │ │ -
49 class ArgyrisPreBasis;
│ │ │ -
50
│ │ │ -
68 template<class GV, class R = double>
│ │ │ - │ │ │ + │ │ │ + │ │ │ +
21
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
26
│ │ │ +
27namespace Dune {
│ │ │ +
28namespace Functions {
│ │ │ +
29
│ │ │ +
30namespace Imp {
│ │ │ +
31
│ │ │ +
32struct AllTrueBitSetVector
│ │ │ +
33{
│ │ │ +
34 struct AllTrueBitSet
│ │ │ +
35 {
│ │ │ +
36 bool test(int) const { return true; }
│ │ │ +
37 } allTrue_;
│ │ │ +
38
│ │ │ +
39 operator bool() const
│ │ │ +
40 {
│ │ │ +
41 return true;
│ │ │ +
42 }
│ │ │ +
43
│ │ │ +
44 template<class I>
│ │ │ +
45 const AllTrueBitSetVector& operator[](const I&) const
│ │ │ +
46 {
│ │ │ +
47 return *this;
│ │ │ +
48 }
│ │ │ +
49
│ │ │ +
50 template<class SP>
│ │ │ +
51 void resize(const SP&) const
│ │ │ +
52 {}
│ │ │ +
53
│ │ │ +
54};
│ │ │ +
55
│ │ │ +
56
│ │ │ +
57
│ │ │ +
58// This helper function implements the restriction of some given function of type F.
│ │ │ +
59// The restriction is a simple callback that is applied to the values of the
│ │ │ +
60// function and the values of its derivative.
│ │ │ +
61template<class F, class Restriction>
│ │ │ +
62class ComponentFunction
│ │ │ +
63{
│ │ │ +
64public:
│ │ │ +
65
│ │ │ +
66 ComponentFunction(F f, Restriction restriction) :
│ │ │ +
67 f_(std::move(f)),
│ │ │ +
68 restriction_(std::move(restriction))
│ │ │ +
69 {}
│ │ │
70
│ │ │ -
71 namespace Impl
│ │ │ -
72 {
│ │ │ -
73
│ │ │ -
76 class ArgyrisLocalCoefficients
│ │ │ -
77 {
│ │ │ -
78 public:
│ │ │ -
79 using size_type = std::size_t;
│ │ │ -
80 static constexpr int dim = 2;
│ │ │ -
81
│ │ │ -
82 ArgyrisLocalCoefficients()
│ │ │ -
83 {
│ │ │ -
84 for (unsigned int i = 0; i < 3; i++) // subentities: three vertices
│ │ │ -
85 for (unsigned int k = 0; k < 6; k++) // 6 basis functions per vertex
│ │ │ -
86 localKeys_[6 * i + k]
│ │ │ -
87 = LocalKey(i, dim, k); //(subentity, codim, number of dof for this subentity)
│ │ │ -
88 for (unsigned int i = 0; i < 3; ++i) // subentities: three edges
│ │ │ -
89 localKeys_[18 + i] = LocalKey(i, dim - 1, 0); // one node per edge
│ │ │ -
90 }
│ │ │ -
91
│ │ │ -
94 static constexpr size_type size()
│ │ │ -
95 {
│ │ │ -
96 return 21;
│ │ │ -
97 }
│ │ │ -
98
│ │ │ -
101 LocalKey const &localKey(size_type i) const
│ │ │ -
102 {
│ │ │ -
103 return localKeys_[i];
│ │ │ -
104 }
│ │ │ -
105
│ │ │ -
106 private:
│ │ │ -
107 std::array<Dune::LocalKey, 21> localKeys_;
│ │ │ -
108 };
│ │ │ -
109
│ │ │ -
110
│ │ │ -
116 template<class D, class R>
│ │ │ -
117 class ArgyrisReferenceLocalBasis
│ │ │ -
118 {
│ │ │ -
119 static constexpr int dim = 2;
│ │ │ -
120 public:
│ │ │ -
121 using Traits = H2LocalBasisTraits<D, dim, FieldVector<D, dim>, R, 1, FieldVector<R, 1>,
│ │ │ -
122 FieldMatrix<R, 1, dim>, FieldMatrix<R, dim, dim> >;
│ │ │ -
123 private:
│ │ │ -
124
│ │ │ -
139 static constexpr auto getArgyrisCoefficients()
│ │ │ -
140 {
│ │ │ -
141 // Define std::sqrt(2.) manually in double precision,
│ │ │ -
142 // because std::sqrt is not constexpr before C++26.
│ │ │ -
143 D sqrt2 = -8. * 1.414213562373095;
│ │ │ -
144 return Dune::FieldMatrix<D, 21,21>{
│ │ │ -
145 // vertex functionals
│ │ │ -
146 // l_0
│ │ │ -
147 {1, /*0th order*/
│ │ │ -
148 0, 0, /*1th order*/
│ │ │ -
149 0, 0, 0, /*2th order*/
│ │ │ -
150 -10, 0, 0, -10, /*3th order*/
│ │ │ -
151 15, 0, -30, 0, 15, /*4th order*/
│ │ │ -
152 -6, 0, 30, 30, 0, -6}, /*5th order*/
│ │ │ -
153 // l_1
│ │ │ -
154 {0,
│ │ │ -
155 1, 0,
│ │ │ -
156 0, 0, 0,
│ │ │ -
157 -6, 0, -11, 0,
│ │ │ -
158 8, 0, 10, 18, 0,
│ │ │ -
159 -3, 0, 1, -10, -8, 0},
│ │ │ -
160 // l_2, l_1 mirrored
│ │ │ -
161 {
│ │ │ -
162 0,
│ │ │ -
163 0, 1,
│ │ │ -
164 0, 0, 0,
│ │ │ -
165 0, -11, 0, -6,
│ │ │ -
166 0, 18, 10, 0, 8,
│ │ │ -
167 0, -8, -10, 1, 0, -3},
│ │ │ -
168 // l_3
│ │ │ -
169 {
│ │ │ -
170 0,
│ │ │ -
171 0, 0,
│ │ │ -
172 0.5, 0, 0,
│ │ │ -
173 -1.5, 0, 0, 0,
│ │ │ -
174 1.5, 0, -1.5, 0, 0,
│ │ │ -
175 -0.5, 0, 1.5, 1, 0, 0},
│ │ │ -
176 // l_4
│ │ │ -
177 {
│ │ │ -
178 0,
│ │ │ -
179 0, 0,
│ │ │ -
180 0, 1, 0,
│ │ │ -
181 0, -4, -4, 0,
│ │ │ -
182 0, 5, 10, 5, 0,
│ │ │ -
183 0, -2, -6, -6, -2, 0},
│ │ │ -
184 // l_5, l_3 mirrored
│ │ │ -
185 {
│ │ │ -
186 0,
│ │ │ -
187 0, 0,
│ │ │ -
188 0, 0, 0.5,
│ │ │ -
189 0, 0, 0, -1.5,
│ │ │ -
190 0, 0, -1.5, 0, 1.5,
│ │ │ -
191 0, 0, 1, 1.5, 0, -0.5},
│ │ │ -
192 // l_6
│ │ │ -
193 {0,
│ │ │ -
194 0, 0,
│ │ │ -
195 0, 0, 0,
│ │ │ -
196 10, 0, 0, 0,
│ │ │ -
197 -15, 0, 15, 0, 0,
│ │ │ -
198 6, 0, -15, -15, 0, 0},
│ │ │ -
199 // l_7
│ │ │ -
200 {0,
│ │ │ -
201 0, 0,
│ │ │ -
202 0, 0, 0,
│ │ │ -
203 -4, 0, 0, 0,
│ │ │ -
204 7, 0, -3.5, 0, 0,
│ │ │ -
205 -3, 0, 3.5, 3.5, 0, 0},
│ │ │ -
206 // l_8
│ │ │ -
207 {0,
│ │ │ -
208 0, 0,
│ │ │ -
209 0, 0, 0,
│ │ │ -
210 0, -5, 0, 0,
│ │ │ -
211 0, 14, 18.5, 0, 0,
│ │ │ -
212 0, -8, -18.5, -13.5, 0, 0},
│ │ │ -
213 // l_9
│ │ │ -
214 {
│ │ │ -
215 0,
│ │ │ -
216 0, 0,
│ │ │ -
217 0, 0, 0,
│ │ │ -
218 0.5, 0, 0, 0,
│ │ │ -
219 -1, 0, 0.25, 0, 0,
│ │ │ -
220 0.5, 0, -0.25, -0.25, 0, 0},
│ │ │ -
221 // l_10
│ │ │ -
222 {
│ │ │ -
223 0,
│ │ │ -
224 0, 0,
│ │ │ -
225 0, 0, 0,
│ │ │ -
226 0, 1, 0, 0,
│ │ │ -
227 0, -3, -3.5, 0, 0,
│ │ │ -
228 0, 2, 3.5, 2.5, 0, 0},
│ │ │ -
229 // l_11
│ │ │ -
230 {
│ │ │ -
231 0,
│ │ │ -
232 0, 0,
│ │ │ -
233 0, 0, 0,
│ │ │ -
234 0, 0, 0, 0,
│ │ │ -
235 0, 0, 1.25, 0, 0,
│ │ │ -
236 0, 0, -0.75, -1.25, 0, 0},
│ │ │ -
237 // l_12 mirrors l_6
│ │ │ -
238 {
│ │ │ -
239 0,
│ │ │ -
240 0, 0,
│ │ │ -
241 0, 0, 0,
│ │ │ -
242 0, 0, 0, 10,
│ │ │ -
243 0, 0, 15, 0, -15,
│ │ │ -
244 0, 0, -15, -15, 0, 6},
│ │ │ -
245 // l_13 mirrors l_8
│ │ │ -
246 {
│ │ │ -
247 0,
│ │ │ -
248 0, 0,
│ │ │ -
249 0, 0, 0,
│ │ │ -
250 0, 0, -5, 0,
│ │ │ -
251 0, 0, 18.5, 14, 0,
│ │ │ -
252 0, 0, -13.5, -18.5, -8, 0},
│ │ │ -
253 // l_14 mirrors l_7
│ │ │ -
254 {
│ │ │ -
255 0,
│ │ │ -
256 0, 0,
│ │ │ -
257 0, 0, 0,
│ │ │ -
258 0, 0, 0, -4,
│ │ │ -
259 0, 0, -3.5, 0, 7,
│ │ │ -
260 0, 0, 3.5, 3.5, 0, -3},
│ │ │ -
261 // l_15 mirrors l_11
│ │ │ -
262 {
│ │ │ -
263 0,
│ │ │ -
264 0, 0,
│ │ │ -
265 0, 0, 0,
│ │ │ -
266 0, 0, 0, 0,
│ │ │ -
267 0, 0, 1.25, 0, 0,
│ │ │ -
268 0, 0, -1.25, -0.75, 0, 0},
│ │ │ -
269 // l_16 mirrors l_10
│ │ │ -
270 {
│ │ │ -
271 0,
│ │ │ -
272 0, 0,
│ │ │ -
273 0, 0, 0,
│ │ │ -
274 0, 0, 1, 0,
│ │ │ -
275 0, 0, -3.5, -3, 0,
│ │ │ -
276 0, 0, 2.5, 3.5, 2, 0},
│ │ │ -
277 // l_17 mirrors l_9
│ │ │ -
278 {
│ │ │ -
279 0,
│ │ │ -
280 0, 0,
│ │ │ -
281 0, 0, 0,
│ │ │ -
282 0, 0, 0, 0.5,
│ │ │ -
283 0, 0, 0.25, 0, -1,
│ │ │ -
284 0, 0, -0.25, -0.25, 0, 0.5},
│ │ │ -
285 // edge functionals
│ │ │ -
286 // l_18
│ │ │ -
287 {
│ │ │ -
288 0,
│ │ │ -
289 0, 0,
│ │ │ -
290 0, 0, 0,
│ │ │ -
291 0, 16, 0, 0,
│ │ │ -
292 0, -32, -32, 0, 0,
│ │ │ -
293 0, 16, 32, 16, 0, 0},
│ │ │ -
294 // l_19
│ │ │ -
295 {
│ │ │ -
296 0,
│ │ │ -
297 0, 0,
│ │ │ -
298 0, 0, 0,
│ │ │ -
299 0, 0, -16, 0,
│ │ │ -
300 0, 0, 32, 32, 0,
│ │ │ -
301 0, 0, -16, -32, -16, 0},
│ │ │ -
302 // l_20
│ │ │ -
303 {
│ │ │ -
304 0,
│ │ │ -
305 0, 0,
│ │ │ -
306 0, 0, 0,
│ │ │ -
307 0, 0, 0, 0,
│ │ │ -
308 0, 0, -1. * sqrt2, 0, 0,
│ │ │ -
309 0, 0, sqrt2, sqrt2, 0, 0}};
│ │ │ -
310 }
│ │ │ -
311
│ │ │ -
312
│ │ │ -
313 static constexpr auto referenceBasisCoefficients = getArgyrisCoefficients();
│ │ │ -
314 static constexpr MonomialSet<typename Traits::RangeFieldType, dim, 5> monomials = {};
│ │ │ -
315
│ │ │ -
316 public:
│ │ │ -
317
│ │ │ -
320 static constexpr unsigned int size()
│ │ │ -
321 {
│ │ │ -
322 return ArgyrisLocalCoefficients::size();
│ │ │ -
323 }
│ │ │ -
324
│ │ │ -
327 static constexpr unsigned int order()
│ │ │ -
328 {
│ │ │ -
329 return 5;
│ │ │ -
330 }
│ │ │ -
331
│ │ │ -
337 void evaluateFunction(const typename Traits::DomainType &in,
│ │ │ -
338 std::vector<typename Traits::RangeType> &out) const
│ │ │ -
339 {
│ │ │ -
340 out.resize(size());
│ │ │ -
341 auto monomialValues = monomials(in);
│ │ │ -
342 multiplyWithCoefficentMatrix(referenceBasisCoefficients, monomialValues, out);
│ │ │ -
343 }
│ │ │ -
344
│ │ │ -
350 void evaluateJacobian(const typename Traits::DomainType &in,
│ │ │ -
351 std::vector<typename Traits::JacobianType> &out) const
│ │ │ -
352 {
│ │ │ -
353 out.resize(size());
│ │ │ -
354 auto monomialValues = derivative(monomials)(in);
│ │ │ -
355 multiplyWithCoefficentMatrix(referenceBasisCoefficients, monomialValues, out);
│ │ │ -
356 }
│ │ │ -
357
│ │ │ -
363 void evaluateHessian(const typename Traits::DomainType &in,
│ │ │ -
364 std::vector<typename Traits::HessianType> &out) const
│ │ │ -
365 {
│ │ │ -
366 out.resize(size());
│ │ │ -
367 auto monomialValues = derivative(derivative(monomials))(in);
│ │ │ -
368 multiplyWithCoefficentMatrix(referenceBasisCoefficients, monomialValues, out);
│ │ │ -
369 }
│ │ │ -
370
│ │ │ -
377 void partial(std::array<unsigned int, dim> order, const typename Traits::DomainType &in,
│ │ │ -
378 std::vector<typename Traits::RangeType> &out) const
│ │ │ -
379 {
│ │ │ -
380 out.resize(size());
│ │ │ -
381 auto totalOrder = std::accumulate(order.begin(), order.end(), 0);
│ │ │ -
382 if (totalOrder == 0)
│ │ │ -
383 evaluateFunction(in, out);
│ │ │ -
384 else if (totalOrder == 1)
│ │ │ -
385 {
│ │ │ -
386 evaluateJacobian(in,jacobiansBuffer_);
│ │ │ -
387 std::size_t which = std::max_element(order.begin(), order.end()) - order.begin();
│ │ │ -
388 for (auto i : Dune::range(size()))
│ │ │ -
389 out[i] = jacobiansBuffer_[i][0][which];
│ │ │ -
390 }
│ │ │ -
391 else if (totalOrder == 2)
│ │ │ -
392 {
│ │ │ -
393 evaluateHessian(in, hessianBuffer_);
│ │ │ -
394 std::size_t first, second;
│ │ │ -
395 first = std::max_element(order.begin(), order.end()) - order.begin();
│ │ │ -
396 if (order[first] == 2)
│ │ │ -
397 second = first;
│ │ │ -
398 else
│ │ │ -
399 {
│ │ │ -
400 order[first] = 0;
│ │ │ -
401 second = std::max_element(order.begin(), order.end()) - order.begin();
│ │ │ -
402 }
│ │ │ -
403 for (auto i : Dune::range(size()))
│ │ │ -
404 out[i] = hessianBuffer_[i][first][second];
│ │ │ -
405 }
│ │ │ -
406 else
│ │ │ -
407 DUNE_THROW(RangeError, "partial() not implemented for given order");
│ │ │ -
408 }
│ │ │ -
409
│ │ │ -
410 private:
│ │ │ -
411 mutable std::vector<typename Traits::JacobianType> jacobiansBuffer_;
│ │ │ -
412 mutable std::vector<typename Traits::HessianType> hessianBuffer_;
│ │ │ -
413 };
│ │ │ -
414
│ │ │ -
415
│ │ │ -
421 template<class D>
│ │ │ -
422 class ArgyrisLocalInterpolation
│ │ │ -
423 {
│ │ │ -
424 using size_type = std::size_t;
│ │ │ -
425 static constexpr int dim = 2;
│ │ │ -
426
│ │ │ -
427 static constexpr unsigned int size()
│ │ │ -
428 {
│ │ │ -
429 return ArgyrisLocalCoefficients::size();
│ │ │ -
430 }
│ │ │ -
431
│ │ │ -
432 using FunctionalDescriptor = Dune::Functions::Impl::FunctionalDescriptor<dim>;
│ │ │ -
433
│ │ │ -
434 public:
│ │ │ -
435
│ │ │ -
436 ArgyrisLocalInterpolation()
│ │ │ -
437 {
│ │ │ -
438 // first vertex
│ │ │ -
439 // function evaluation
│ │ │ -
440 descriptors_[0] = FunctionalDescriptor();
│ │ │ -
441 // gradient evaluations
│ │ │ -
442 descriptors_[1] = FunctionalDescriptor({1,0});
│ │ │ -
443 descriptors_[2] = FunctionalDescriptor({0,1});
│ │ │ -
444 // hessian evaluations
│ │ │ -
445 descriptors_[3] = FunctionalDescriptor({2,0});
│ │ │ -
446 descriptors_[4] = FunctionalDescriptor({1,1});
│ │ │ -
447 descriptors_[5] = FunctionalDescriptor({0,2});
│ │ │ -
448 // second vertex
│ │ │ -
449 descriptors_[6] = FunctionalDescriptor();
│ │ │ -
450 descriptors_[7] = FunctionalDescriptor({1,0});
│ │ │ -
451 descriptors_[8] = FunctionalDescriptor({0,1});
│ │ │ -
452 descriptors_[9] = FunctionalDescriptor({2,0});
│ │ │ -
453 descriptors_[10] = FunctionalDescriptor({1,1});
│ │ │ -
454 descriptors_[11] = FunctionalDescriptor({0,2});
│ │ │ -
455 // third vertex
│ │ │ -
456 descriptors_[12] = FunctionalDescriptor();
│ │ │ -
457 descriptors_[13] = FunctionalDescriptor({1,0});
│ │ │ -
458 descriptors_[14] = FunctionalDescriptor({0,1});
│ │ │ -
459 descriptors_[15] = FunctionalDescriptor({2,0});
│ │ │ -
460 descriptors_[16] = FunctionalDescriptor({1,1});
│ │ │ -
461 descriptors_[17] = FunctionalDescriptor({0,2});
│ │ │ -
462 // normal derivatives at edge midpoints
│ │ │ -
463 descriptors_[18] = FunctionalDescriptor(1);
│ │ │ -
464 descriptors_[19] = FunctionalDescriptor(1);
│ │ │ -
465 descriptors_[20] = FunctionalDescriptor(1);
│ │ │ -
466 }
│ │ │ -
467
│ │ │ -
470 template<class Element>
│ │ │ -
471 void bind( Element const& element, std::array<D, 3>const& averageVertexMeshSize, std::bitset<3>const& edgeOrientation)
│ │ │ -
472 {
│ │ │ -
473 averageVertexMeshSize_ = &averageVertexMeshSize;
│ │ │ -
474
│ │ │ -
475 auto geometry = element.geometry();
│ │ │ -
476
│ │ │ -
477 // get global Normals and midpoints
│ │ │ -
478 auto refElement = Dune::referenceElement<D, 2>(geometry.type());
│ │ │ -
479 for (std::size_t i = 0; i < 3; ++i)
│ │ │ -
480 {
│ │ │ -
481 localVertices_[i] = refElement.position(i, 2);
│ │ │ -
482
│ │ │ -
483 localMidpoints_[i] = refElement.position(i, 1);
│ │ │ -
484 std::size_t lower = (i == 2) ? 1 : 0;
│ │ │ -
485 std::size_t upper = (i == 0) ? 1 : 2;
│ │ │ -
486
│ │ │ -
487 auto edge = geometry.global(refElement.position(upper, 2))
│ │ │ -
488 - geometry.global(refElement.position(lower, 2));
│ │ │ -
489 // normalize and orient
│ │ │ -
490 edge /= edge.two_norm() * (edgeOrientation[i] ? -1. : 1.);
│ │ │ -
491 // Rotation by pi/2. Note that Kirby rotates by 3*pi/2
│ │ │ -
492 globalNormals_[i] = {-edge[1], edge[0]};
│ │ │ -
493 }
│ │ │ -
494 }
│ │ │ -
495
│ │ │ -
503 template<class F, class C>
│ │ │ -
504 void interpolate(F const& f, std::vector<C>& out) const
│ │ │ -
505 {
│ │ │ -
506 out.resize(size());
│ │ │ -
507 auto&& df = derivative(f);
│ │ │ -
508 auto&& Hf = derivative(df);
│ │ │ -
509
│ │ │ -
510 int offset = 0;
│ │ │ -
511 // iterate over vertices
│ │ │ -
512 for (int i = 0; i < 3; i++, offset += 6)
│ │ │ -
513 {
│ │ │ -
514 auto&& x = localVertices_[i];
│ │ │ -
515 auto derivativeValue = squeezeTensor(df(x));
│ │ │ -
516 auto hessianValue = squeezeTensor(Hf(x));
│ │ │ -
517 auto && h = (*averageVertexMeshSize_)[i];
│ │ │ -
518
│ │ │ -
519 out[offset ] = f(x);
│ │ │ -
520
│ │ │ -
521 out[offset + 1] = derivativeValue[0] * h;
│ │ │ -
522 out[offset + 2] = derivativeValue[1] * h;
│ │ │ -
523
│ │ │ -
524 out[offset + 3] = hessianValue[0][0] * h*h;
│ │ │ -
525 out[offset + 4] = hessianValue[0][1] * h*h;
│ │ │ -
526 out[offset + 5] = hessianValue[1][1] * h*h;
│ │ │ -
527 }
│ │ │ -
528 // iterate over edges
│ │ │ -
529 for (int i = 0; i < 3; i++)
│ │ │ -
530 out[18 + i] = squeezeTensor(df(localMidpoints_[i])).dot(globalNormals_[i]);
│ │ │ -
531
│ │ │ -
532 }
│ │ │ -
533
│ │ │ -
537 const FunctionalDescriptor& functionalDescriptor(size_type i) const
│ │ │ -
538 {
│ │ │ -
539 return descriptors_[i];
│ │ │ -
540 }
│ │ │ -
541
│ │ │ -
542 protected:
│ │ │ -
543 std::array<Dune::FieldVector<D, 2>, 3> globalNormals_;
│ │ │ -
544 std::array<Dune::FieldVector<D, 2>, 3> localMidpoints_;
│ │ │ -
545 std::array<Dune::FieldVector<D, 2>, 3> localVertices_;
│ │ │ -
546 std::array<D, 3> const* averageVertexMeshSize_;
│ │ │ -
547 std::array<FunctionalDescriptor, size()> descriptors_;
│ │ │ -
548 };
│ │ │ -
549
│ │ │ -
550 // TODO: There is a copy of this further up
│ │ │ -
551 template<class D, class R>
│ │ │ -
552 struct ArgyrisLocalBasisTraits
│ │ │ -
553 : public H2LocalBasisTraits<D, 2, Dune::FieldVector<D,2>, R, 1,
│ │ │ -
554 Dune::FieldVector<R,1>, Dune::FieldMatrix<R,1,2>, Dune::FieldMatrix<R,2,2> >
│ │ │ -
555 {};
│ │ │ -
556
│ │ │ -
566 template<class D, class R>
│ │ │ -
567 class ArgyrisLocalFiniteElement
│ │ │ -
568 : public Impl::TransformedFiniteElementMixin<ArgyrisLocalFiniteElement<D,R>, ArgyrisLocalBasisTraits<D, R> >
│ │ │ -
569 {
│ │ │ -
570 using Base = Impl::TransformedFiniteElementMixin< ArgyrisLocalFiniteElement<D,R>, ArgyrisLocalBasisTraits<D, R> >;
│ │ │ -
571 friend class Impl::TransformedLocalBasis<ArgyrisLocalFiniteElement<D,R>, ArgyrisLocalBasisTraits<D, R> >;
│ │ │ -
572 static constexpr int dim = 2;
│ │ │ -
573
│ │ │ -
574 public:
│ │ │ -
577 using size_type = std::size_t;
│ │ │ -
578 using Traits = LocalFiniteElementTraits<
│ │ │ -
579 Impl::TransformedLocalBasis<ArgyrisLocalFiniteElement<D,R>, ArgyrisLocalBasisTraits<D, R> >,
│ │ │ -
580 Impl::ArgyrisLocalCoefficients,
│ │ │ -
581 Impl::ArgyrisLocalInterpolation<D> >;
│ │ │ -
582
│ │ │ -
586 const typename Traits::LocalCoefficientsType &localCoefficients() const
│ │ │ -
587 {
│ │ │ -
588 return coefficients_;
│ │ │ -
589 }
│ │ │ -
590
│ │ │ -
593 const typename Traits::LocalInterpolationType &localInterpolation() const
│ │ │ -
594 {
│ │ │ -
595 return interpolation_;
│ │ │ -
596 }
│ │ │ -
597
│ │ │ -
600 static constexpr GeometryType type()
│ │ │ -
601 {
│ │ │ -
602 return GeometryTypes::simplex(dim);
│ │ │ -
603 }
│ │ │ -
604
│ │ │ -
607 static constexpr size_type size()
│ │ │ -
608 {
│ │ │ -
609 return Impl::ArgyrisLocalCoefficients::size();
│ │ │ -
610 }
│ │ │ -
611
│ │ │ -
614 template<class VertexMapper,class ElementMapper, class Element>
│ │ │ -
615 void bind(VertexMapper const& vertexMapper, std::vector<D> const& globalAverageVertexMeshSize,
│ │ │ -
616 ElementMapper const& elementMapper, std::vector<std::bitset<3> >const& edgeOrientations, Element const &e)
│ │ │ -
617 {
│ │ │ -
618 // Cache average mesh size for each vertex
│ │ │ -
619 for (auto i : range(dim+1))
│ │ │ -
620 averageVertexMeshSize_[i] = globalAverageVertexMeshSize[vertexMapper.subIndex(e, i, dim)];
│ │ │ -
621
│ │ │ -
622 // Cache orientation for each mesh
│ │ │ -
623 edgeOrientation_ = edgeOrientations[elementMapper.index(e)];
│ │ │ -
624
│ │ │ -
625 // Bind LocalInterpolation to updated local state
│ │ │ -
626 interpolation_.bind(e, averageVertexMeshSize_, edgeOrientation_);
│ │ │ -
627
│ │ │ -
628 // Compute local transformation matrices for each vertex
│ │ │ -
629 const auto& geometry = e.geometry();
│ │ │ -
630 const auto& refElement = ReferenceElements<typename Element::Geometry::ctype, dim>::simplex();
│ │ │ -
631 for (auto i : range(dim+1))
│ │ │ -
632 {
│ │ │ -
633 vertexJacobians_[i] = geometry.jacobian(refElement.position(i, dim));
│ │ │ -
634 }
│ │ │ -
635
│ │ │ -
636 // get geometrical information
│ │ │ -
637 std::array<FieldVector<R, 2>, 3> referenceTangents;
│ │ │ -
638
│ │ │ -
639 // get local and global Tangents
│ │ │ -
640 for (std::size_t i = 0; i < 3; ++i)
│ │ │ -
641 {
│ │ │ -
642 std::size_t lower = (i == 2) ? 1 : 0;
│ │ │ -
643 std::size_t upper = (i == 0) ? 1 : 2;
│ │ │ -
644 auto edge = refElement.position(upper, 2) - refElement.position(lower, 2);
│ │ │ -
645
│ │ │ -
646 // store normalized reference Tangent vectors
│ │ │ -
647 referenceTangents[i] = edge / edge.two_norm();
│ │ │ -
648
│ │ │ -
649 auto globalEdge = geometry.global(refElement.position(upper, 2))
│ │ │ -
650 - geometry.global(refElement.position(lower, 2));
│ │ │ -
651
│ │ │ -
652 // store length of global tangents and normalized global tangent vectors
│ │ │ -
653 l[i] = globalEdge.two_norm();
│ │ │ -
654 globalTangents[i] = globalEdge / l[i];
│ │ │ -
655
│ │ │ -
656 tau[i] = FieldVector<R, 3>{
│ │ │ -
657 globalTangents[i][0] * globalTangents[i][0],
│ │ │ -
658 2. * globalTangents[i][0] * globalTangents[i][1],
│ │ │ -
659 globalTangents[i][1] * globalTangents[i][1]
│ │ │ -
660 };
│ │ │ -
661
│ │ │ -
662 // The following variables are named as in Kirby's paper
│ │ │ -
663 // two g matrices
│ │ │ -
664 auto&& referenceG = FieldMatrix<R, 2, 2>{
│ │ │ -
665 {-referenceTangents[i][1], referenceTangents[i][0]},
│ │ │ -
666 {referenceTangents[i][0], referenceTangents[i][1]}
│ │ │ -
667 };
│ │ │ -
668
│ │ │ -
669 auto&& globalG = FieldMatrix<R, 2, 2>{
│ │ │ -
670 {-globalTangents[i][1], globalTangents[i][0]},
│ │ │ -
671 {globalTangents[i][0], globalTangents[i][1]}
│ │ │ -
672 };
│ │ │ -
673
│ │ │ -
674 //
│ │ │ -
675 b[i] = globalG * geometry.jacobian(refElement.position(i, 2)) * referenceG;
│ │ │ -
676
│ │ │ -
677 theta[i][0][0] = vertexJacobians_[i][0][0] * vertexJacobians_[i][0][0];
│ │ │ -
678 theta[i][0][1] = vertexJacobians_[i][0][0] * vertexJacobians_[i][0][1];
│ │ │ -
679 theta[i][0][2] = vertexJacobians_[i][0][1] * vertexJacobians_[i][0][1];
│ │ │ -
680
│ │ │ -
681 theta[i][1][0] = 2. * vertexJacobians_[i][0][0] * vertexJacobians_[i][1][0];
│ │ │ -
682 theta[i][1][1] = vertexJacobians_[i][0][0] * vertexJacobians_[i][1][1] + vertexJacobians_[i][0][1] * vertexJacobians_[i][1][0];
│ │ │ -
683 theta[i][1][2] = 2. * vertexJacobians_[i][0][1] * vertexJacobians_[i][1][1];
│ │ │ -
684
│ │ │ -
685 theta[i][2][0] = vertexJacobians_[i][1][0] * vertexJacobians_[i][1][0];
│ │ │ -
686 theta[i][2][1] = vertexJacobians_[i][1][0] * vertexJacobians_[i][1][1];
│ │ │ -
687 theta[i][2][2] = vertexJacobians_[i][1][1] * vertexJacobians_[i][1][1];
│ │ │ -
688 }
│ │ │ -
689 }
│ │ │ -
690
│ │ │ -
691 protected:
│ │ │ -
692
│ │ │ -
695 Impl::ArgyrisReferenceLocalBasis<D, R> const& referenceLocalBasis() const
│ │ │ -
696 {
│ │ │ -
697 return basis_;
│ │ │ -
698 }
│ │ │ -
699
│ │ │ -
704 template<class InputValues, class OutputValues>
│ │ │ -
705 void transform(InputValues const &inValues, OutputValues &outValues) const
│ │ │ -
706 {
│ │ │ -
707 using std::pow;
│ │ │ -
708 assert(inValues.size() == size());
│ │ │ -
709 assert(outValues.size() == inValues.size());
│ │ │ -
710 // compatibility with sympy code below
│ │ │ -
711 auto &[b_0, b_1, b_2] = b;
│ │ │ -
712 auto &[J_0, J_1, J_2] = vertexJacobians_;
│ │ │ -
713 auto &[theta_0, theta_1, theta_2] = theta;
│ │ │ -
714 auto & h = averageVertexMeshSize_;
│ │ │ -
715 auto & o = edgeOrientation_;
│ │ │ -
716 std::array<Dune::FieldVector<R, 2>, 3> const &t = globalTangents;
│ │ │ -
717 // This code is generated with sympy.
│ │ │ -
718 // It a matrix free implementation of the matrix V in Kirbys paper.
│ │ │ -
719 outValues[0] = -15.0/8.0*b_0[1][0]*inValues[18]/l[0] - 15.0/8.0*b_1[1][0]*inValues[19]/l[1] + inValues[0];
│ │ │ -
720 outValues[1] = (J_0[0][0]*inValues[1] + J_0[0][1]*inValues[2] - 0.4375*b_0[1][0]*inValues[18]*t[0][0] - 0.4375*b_1[1][0]*inValues[19]*t[1][0])/h[0];
│ │ │ -
721 outValues[2] = (J_0[1][0]*inValues[1] + J_0[1][1]*inValues[2] - 0.4375*b_0[1][0]*inValues[18]*t[0][1] - 0.4375*b_1[1][0]*inValues[19]*t[1][1])/h[0];
│ │ │ -
722 outValues[3] = (-1.0/32.0*b_0[1][0]*inValues[18]*l[0]*tau[0][0] - 1.0/32.0*b_1[1][0]*inValues[19]*l[1]*tau[1][0] + inValues[3]*theta_0[0][0] + inValues[4]*theta_0[0][1] + inValues[5]*theta_0[0][2])/h[0] /h[0];
│ │ │ -
723 outValues[4] = (-1.0/32.0*b_0[1][0]*inValues[18]*l[0]*tau[0][1] - 1.0/32.0*b_1[1][0]*inValues[19]*l[1]*tau[1][1] + inValues[3]*theta_0[1][0] + inValues[4]*theta_0[1][1] + inValues[5]*theta_0[1][2])/h[0] /h[0];
│ │ │ -
724 outValues[5] = (-1.0/32.0*b_0[1][0]*inValues[18]*l[0]*tau[0][2] - 1.0/32.0*b_1[1][0]*inValues[19]*l[1]*tau[1][2] + inValues[3]*theta_0[2][0] + inValues[4]*theta_0[2][1] + inValues[5]*theta_0[2][2])/h[0] /h[0];
│ │ │ -
725 outValues[6] = (15.0/8.0)*b_0[1][0]*inValues[18]/l[0] - 15.0/8.0*b_2[1][0]*inValues[20]/l[2] + inValues[6];
│ │ │ -
726 outValues[7] = (J_1[0][0]*inValues[7] + J_1[0][1]*inValues[8] - 0.4375*b_0[1][0]*inValues[18]*t[0][0] - 0.4375*b_2[1][0]*inValues[20]*t[2][0])/h[1];
│ │ │ -
727 outValues[8] = (J_1[1][0]*inValues[7] + J_1[1][1]*inValues[8] - 0.4375*b_0[1][0]*inValues[18]*t[0][1] - 0.4375*b_2[1][0]*inValues[20]*t[2][1])/h[1];
│ │ │ -
728 outValues[9] = ((1.0/32.0)*b_0[1][0]*inValues[18]*l[0]*tau[0][0] - 1.0/32.0*b_2[1][0]*inValues[20]*l[2]*tau[2][0] + inValues[9]*theta_1[0][0] + inValues[10]*theta_1[0][1] + inValues[11]*theta_1[0][2])/h[1] /h[1];
│ │ │ -
729 outValues[10] = ((1.0/32.0)*b_0[1][0]*inValues[18]*l[0]*tau[0][1] - 1.0/32.0*b_2[1][0]*inValues[20]*l[2]*tau[2][1] + inValues[9]*theta_1[1][0] + inValues[10]*theta_1[1][1] + inValues[11]*theta_1[1][2])/h[1] /h[1];
│ │ │ -
730 outValues[11] = ((1.0/32.0)*b_0[1][0]*inValues[18]*l[0]*tau[0][2] - 1.0/32.0*b_2[1][0]*inValues[20]*l[2]*tau[2][2] + inValues[9]*theta_1[2][0] + inValues[10]*theta_1[2][1] + inValues[11]*theta_1[2][2])/h[1] /h[1];
│ │ │ -
731 outValues[12] = (15.0/8.0)*b_1[1][0]*inValues[19]/l[1] + (15.0/8.0)*b_2[1][0]*inValues[20]/l[2] + inValues[12];
│ │ │ -
732 outValues[13] = (J_2[0][0]*inValues[13] + J_2[0][1]*inValues[14] - 0.4375*b_1[1][0]*inValues[19]*t[1][0] - 0.4375*b_2[1][0]*inValues[20]*t[2][0])/h[2];
│ │ │ -
733 outValues[14] = (J_2[1][0]*inValues[13] + J_2[1][1]*inValues[14] - 0.4375*b_1[1][0]*inValues[19]*t[1][1] - 0.4375*b_2[1][0]*inValues[20]*t[2][1])/h[2];
│ │ │ -
734 outValues[15] = ((1.0/32.0)*b_1[1][0]*inValues[19]*l[1]*tau[1][0] + (1.0/32.0)*b_2[1][0]*inValues[20]*l[2]*tau[2][0] + inValues[15]*theta_2[0][0] + inValues[16]*theta_2[0][1] + inValues[17]*theta_2[0][2])/h[2] /h[2];
│ │ │ -
735 outValues[16] = ((1.0/32.0)*b_1[1][0]*inValues[19]*l[1]*tau[1][1] + (1.0/32.0)*b_2[1][0]*inValues[20]*l[2]*tau[2][1] + inValues[15]*theta_2[1][0] + inValues[16]*theta_2[1][1] + inValues[17]*theta_2[1][2])/h[2] /h[2];
│ │ │ -
736 outValues[17] = ((1.0/32.0)*b_1[1][0]*inValues[19]*l[1]*tau[1][2] + (1.0/32.0)*b_2[1][0]*inValues[20]*l[2]*tau[2][2] + inValues[15]*theta_2[2][0] + inValues[16]*theta_2[2][1] + inValues[17]*theta_2[2][2])/h[2] /h[2];
│ │ │ -
737 outValues[18] = b_0[0][0]*inValues[18]*(o[0] ? -1 : 1);
│ │ │ -
738 outValues[19] = b_1[0][0]*inValues[19]*(o[1] ? -1 : 1);
│ │ │ -
739 outValues[20] = b_2[0][0]*inValues[20]*(o[2] ? -1 : 1);
│ │ │ -
740 }
│ │ │ -
741
│ │ │ -
742 private:
│ │ │ -
743 typename Impl::ArgyrisReferenceLocalBasis<D, R> basis_;
│ │ │ -
744 typename Traits::LocalCoefficientsType coefficients_;
│ │ │ -
745 typename Traits::LocalInterpolationType interpolation_;
│ │ │ -
746 // the transformation to correct the lack of affine equivalence boils down to
│ │ │ -
747 // matrix without blockstructure, because the normal derivative dofs interact nontrivially
│ │ │ -
748 // with the others, for details see Kirby's paper.
│ │ │ -
749 // The following geometric information is needed
│ │ │ -
750 // the jacobians per vertex
│ │ │ -
751 std::array<Dune::FieldMatrix<R, dim, dim>, dim+1> vertexJacobians_;
│ │ │ -
752 // a three by three matrix per vertex formalizing the rotation of the hessian in voigt notation
│ │ │ -
753 std::array<FieldMatrix<R, 3, 3>, 3> theta;
│ │ │ -
754 // the edge lengths
│ │ │ -
755 FieldVector<R, 3> l;
│ │ │ -
756 // the global tangent vectors (normalized)
│ │ │ -
757 std::array<FieldVector<R, 2>, 3> globalTangents;
│ │ │ -
758 // Geometric quantities without trivial meaning
│ │ │ -
759 std::array<FieldVector<R, 3>, 3> tau;
│ │ │ -
760 std::array<FieldMatrix<R, 2, 2>, 3> b;
│ │ │ -
761 // Additionally, we collect some global information
│ │ │ -
762 // the local state, i.e. a collection of global information restricted to this element
│ │ │ -
763 std::array<D, dim+1> averageVertexMeshSize_;
│ │ │ -
764 std::bitset<3> edgeOrientation_;
│ │ │ -
765
│ │ │ -
766 };
│ │ │ -
767
│ │ │ -
768 } // end namespace Impl
│ │ │ -
769
│ │ │ -
770
│ │ │ -
771
│ │ │ -
772 // *****************************************************************************
│ │ │ -
773 // This is the reusable part of the basis. It contains
│ │ │ -
774 //
│ │ │ -
775 // ArgyrisPreBasis
│ │ │ -
776 // ArgyrisNode
│ │ │ -
777 //
│ │ │ -
778 // The pre-basis allows to create the others and is the owner of possible shared
│ │ │ -
779 // state. These components do _not_ depend on the global basis and local view
│ │ │ -
780 // and can be used without a global basis.
│ │ │ -
781 // *****************************************************************************
│ │ │ -
782
│ │ │ -
783 template<class GV, class R>
│ │ │ -
│ │ │ - │ │ │ -
785 : public LeafBasisNode
│ │ │ -
786 {
│ │ │ -
787 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper<GV>;
│ │ │ -
788
│ │ │ -
789 public:
│ │ │ -
790 using size_type = std::size_t;
│ │ │ -
791 using Element = typename GV::template Codim<0>::Entity;
│ │ │ -
792 using FiniteElement = typename Impl::ArgyrisLocalFiniteElement<typename GV::ctype, R>;
│ │ │ -
793
│ │ │ -
│ │ │ -
794 ArgyrisNode(Mapper const& vertexMapper, Mapper const& elementMapper,
│ │ │ -
795 std::vector<typename GV::ctype> const& averageVertexMeshSize,
│ │ │ -
796 std::vector<std::bitset<3> > const& edgeOrientation)
│ │ │ -
797 : element_(nullptr)
│ │ │ -
798 , vertexMapper_(&vertexMapper)
│ │ │ -
799 , elementMapper_(&elementMapper)
│ │ │ -
800 , averageVertexMeshSize_(&averageVertexMeshSize)
│ │ │ -
801 , edgeOrientation_(&edgeOrientation)
│ │ │ -
802 {}
│ │ │ -
│ │ │ -
803
│ │ │ -
│ │ │ -
805 Element const &element() const
│ │ │ -
806 {
│ │ │ -
807 return *element_;
│ │ │ -
808 }
│ │ │ -
│ │ │ -
809
│ │ │ -
│ │ │ - │ │ │ -
816 {
│ │ │ -
817 return finiteElement_;
│ │ │ -
818 }
│ │ │ -
│ │ │ -
819
│ │ │ -
│ │ │ -
821 void bind(Element const &e)
│ │ │ -
822 {
│ │ │ -
823 element_ = &e;
│ │ │ - │ │ │ - │ │ │ -
826 *element_ );
│ │ │ -
827 this->setSize(finiteElement_.size());
│ │ │ -
828
│ │ │ -
829 }
│ │ │ -
│ │ │ -
830
│ │ │ -
832 unsigned int order() const { return finiteElement_.localBasis().order(); }
│ │ │ -
833
│ │ │ -
834 protected:
│ │ │ - │ │ │ - │ │ │ -
837 Mapper const* vertexMapper_;
│ │ │ -
838 Mapper const* elementMapper_;
│ │ │ -
839 std::vector<typename GV::ctype> const* averageVertexMeshSize_;
│ │ │ -
840 std::vector<std::bitset<3> > const* edgeOrientation_;
│ │ │ -
841 };
│ │ │ -
│ │ │ -
842
│ │ │ -
843
│ │ │ -
853 template<class GV, class R>
│ │ │ -
│ │ │ - │ │ │ -
855 : public LeafPreBasisMapperMixin<GV>
│ │ │ -
856 {
│ │ │ -
857 using Base = LeafPreBasisMapperMixin<GV>;
│ │ │ -
858 using SubEntityMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GV>;
│ │ │ -
859 using Element = typename GV::template Codim<0>::Entity;
│ │ │ -
860 using D = typename GV::ctype;
│ │ │ -
861 static const std::size_t dim = GV::dimension;
│ │ │ -
862
│ │ │ -
863 // helper methods to assign each subentity the number of dofs. Used by the LeafPreBasisMapperMixin.
│ │ │ -
864 static constexpr auto ArgyrisMapperLayout(Dune::GeometryType type, int gridDim)
│ │ │ -
865 {
│ │ │ -
866 assert(gridDim == 2);
│ │ │ -
867 if (type.isVertex())
│ │ │ -
868 return 6; // one evaluation dof and two derivative dofs and three hessian dofs per vertex
│ │ │ -
869 else if (type.isLine())
│ │ │ -
870 return 1;
│ │ │ -
871 else if (type.isTriangle())
│ │ │ -
872 return 0;
│ │ │ -
873 else
│ │ │ -
874 DUNE_THROW(Dune::Exception, "Invalid Geometry type for Argyris Element!");
│ │ │ -
875
│ │ │ -
876 }
│ │ │ -
877
│ │ │ -
878 public:
│ │ │ -
880 using GridView = GV;
│ │ │ -
881
│ │ │ -
883 using size_type = std::size_t;
│ │ │ -
884
│ │ │ - │ │ │ -
887
│ │ │ -
888 public:
│ │ │ -
889
│ │ │ -
│ │ │ -
891 ArgyrisPreBasis(const GV &gv)
│ │ │ -
892 : Base(gv, ArgyrisMapperLayout)
│ │ │ -
893 , vertexMapper_({gv, mcmgVertexLayout()})
│ │ │ -
894 , elementMapper_({gv, mcmgElementLayout()})
│ │ │ -
895 {
│ │ │ -
896 averageVertexMeshSize_ = Impl::computeAverageSubEntityMeshSize<D>(vertexMapper_);
│ │ │ -
897 edgeOrientations_ = Impl::computeEdgeOrientations(elementMapper_);
│ │ │ -
898 }
│ │ │ -
│ │ │ -
899
│ │ │ -
│ │ │ -
901 void update(GridView const &gv)
│ │ │ -
902 {
│ │ │ -
903 Base::update(gv);
│ │ │ -
904 vertexMapper_.update(this->gridView());
│ │ │ -
905 elementMapper_.update(this->gridView());
│ │ │ -
906 averageVertexMeshSize_ = Impl::computeAverageSubEntityMeshSize<D>(vertexMapper_);
│ │ │ -
907 edgeOrientations_ = Impl::computeEdgeOrientations(elementMapper_);
│ │ │ -
908 }
│ │ │ -
│ │ │ -
909
│ │ │ -
│ │ │ - │ │ │ -
912 {
│ │ │ - │ │ │ -
914 }
│ │ │ -
│ │ │ -
915
│ │ │ -
916 protected:
│ │ │ -
917
│ │ │ -
918 SubEntityMapper vertexMapper_;
│ │ │ - │ │ │ -
920 SubEntityMapper elementMapper_;
│ │ │ -
921 std::vector<std::bitset<3> > edgeOrientations_;
│ │ │ -
922
│ │ │ -
923 }; // class ArgyrisPreBasis
│ │ │ -
│ │ │ -
924
│ │ │ -
│ │ │ -
925 namespace BasisFactory
│ │ │ -
926 {
│ │ │ -
927
│ │ │ -
935 template<class R = double>
│ │ │ -
936 auto argyris()
│ │ │ -
937 {
│ │ │ -
938 return [=](auto const &gridView) {
│ │ │ -
939 return ArgyrisPreBasis<std::decay_t<decltype(gridView)>, R>(gridView);
│ │ │ -
940 };
│ │ │ -
941 }
│ │ │ -
942
│ │ │ -
943 } // end namespace BasisFactory
│ │ │ -
│ │ │ -
944
│ │ │ -
945
│ │ │ -
946} // end namespace Dune::Functions
│ │ │ -
947
│ │ │ -
948#endif
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
This file provides an implementation of the cubic Hermite finite element in 1 to 3 dimensions.
│ │ │ - │ │ │ - │ │ │ +
71 template<class Domain>
│ │ │ +
72 auto operator()(const Domain& x) const
│ │ │ +
73 {
│ │ │ +
74 return restriction_(f_(x));
│ │ │ +
75 }
│ │ │ +
76
│ │ │ +
77 friend auto derivative(const ComponentFunction& cf)
│ │ │ +
78 {
│ │ │ +
79 // This provides support for capturing the derivative of the function by reference
│ │ │ +
80 // using forwardCapture for perfect forwarding capture. If the function caches its
│ │ │ +
81 // derivative, this saves a potentially costly copy.
│ │ │ +
82 auto&& df = derivative(Dune::resolveRef(cf.f_));
│ │ │ +
83 return [&, df=forwardCapture(std::forward<decltype(df)>(df))](auto&& x) {
│ │ │ +
84 return cf.restriction_(df.forward()(x));
│ │ │ +
85 };
│ │ │ +
86 }
│ │ │ +
87
│ │ │ +
88private:
│ │ │ +
89 F f_;
│ │ │ +
90 Restriction restriction_;
│ │ │ +
91};
│ │ │ +
92
│ │ │ +
93
│ │ │ +
94
│ │ │ +
95
│ │ │ +
96// This helper function implements caching of the derivative for local functions.
│ │ │ +
97// When using an algorithm that gets a LocalFunction and calls its derivative
│ │ │ +
98// on each element, this leads to a costly call of derivative(f). E.g. for a
│ │ │ +
99// DiscreteGlobalBasisFunction, this will allocate several buffer.
│ │ │ +
100// To avoid this, this helper function caches the derivative and hands
│ │ │ +
101// out the cached derivative by reference. To ensure that the handed out
│ │ │ +
102// derivative is appropriately bound, binding the function will automatically
│ │ │ +
103// bind the cached derivative.
│ │ │ +
104//
│ │ │ +
105// Notice that we cannot simply create the derivative in the constructor,
│ │ │ +
106// because this may throw for functions that do not implement the derivative.
│ │ │ +
107template<class F>
│ │ │ +
108class CachedDerivativeLocalFunction
│ │ │ +
109{
│ │ │ +
110 using Derivative = std::decay_t<decltype(derivative(Dune::resolveRef(std::declval<const F&>())))>;
│ │ │ +
111
│ │ │ +
112public:
│ │ │ +
113
│ │ │ +
114 CachedDerivativeLocalFunction(F f) :
│ │ │ +
115 f_(f)
│ │ │ +
116 {}
│ │ │ +
117
│ │ │ +
118 template<class Element>
│ │ │ +
119 void bind(const Element& element)
│ │ │ +
120 {
│ │ │ +
121 Dune::resolveRef(f_).bind(element);
│ │ │ +
122 if (derivative_)
│ │ │ +
123 derivative_.value().bind(element);
│ │ │ +
124 }
│ │ │ +
125
│ │ │ +
126 template<class X>
│ │ │ +
127 auto operator()(const X& x) const
│ │ │ +
128 {
│ │ │ +
129 return f_(x);
│ │ │ +
130 }
│ │ │ +
131
│ │ │ +
132 friend const Derivative& derivative(const CachedDerivativeLocalFunction& cdlf)
│ │ │ +
133 {
│ │ │ +
134 if (not cdlf.derivative_)
│ │ │ +
135 {
│ │ │ +
136 auto&& lf = Dune::resolveRef(cdlf.f_);
│ │ │ +
137 cdlf.derivative_ = derivative(lf);
│ │ │ +
138 if (lf.bound())
│ │ │ +
139 cdlf.derivative_.value().bind(lf.localContext());
│ │ │ +
140 }
│ │ │ +
141 return cdlf.derivative_.value();
│ │ │ +
142 }
│ │ │ +
143
│ │ │ +
144private:
│ │ │ +
145 F f_;
│ │ │ +
146 mutable std::optional<Derivative> derivative_;
│ │ │ +
147};
│ │ │ +
148
│ │ │ +
149
│ │ │ +
150
│ │ │ +
151template<class VectorBackend, class BitVectorBackend, class LocalFunction, class LocalView, class NodeToRangeEntry>
│ │ │ +
152void interpolateLocal(VectorBackend& vector, const BitVectorBackend& bitVector, const LocalFunction& localF, const LocalView& localView, const NodeToRangeEntry& nodeToRangeEntry)
│ │ │ +
153{
│ │ │ +
154 Dune::TypeTree::forEachLeafNode(localView.tree(), [&](auto&& node, auto&& treePath) {
│ │ │ +
155 if (node.empty())
│ │ │ +
156 return;
│ │ │ +
157 using Node = std::decay_t<decltype(node)>;
│ │ │ +
158 using FiniteElement = typename Node::FiniteElement;
│ │ │ +
159 using FiniteElementRangeField = typename FiniteElement::Traits::LocalBasisType::Traits::RangeFieldType;
│ │ │ +
160
│ │ │ +
161 auto interpolationCoefficients = std::vector<FiniteElementRangeField>();
│ │ │ +
162 auto&& fe = node.finiteElement();
│ │ │ +
163 auto localF_RE = ComponentFunction(std::cref(localF), [&](auto&& y) { return nodeToRangeEntry(node, treePath, y); });
│ │ │ +
164
│ │ │ +
165 fe.localInterpolation().interpolate(localF_RE, interpolationCoefficients);
│ │ │ +
166 for (size_t i=0; i<fe.localBasis().size(); ++i)
│ │ │ +
167 {
│ │ │ +
168 auto multiIndex = localView.index(node.localIndex(i));
│ │ │ +
169 if ( bitVector[multiIndex] )
│ │ │ +
170 vector[multiIndex] = interpolationCoefficients[i];
│ │ │ +
171 }
│ │ │ +
172 });
│ │ │ +
173}
│ │ │ +
174
│ │ │ +
175
│ │ │ +
176struct HasDerivative
│ │ │ +
177{
│ │ │ +
178 template<class F>
│ │ │ +
179 auto require(F&& f) -> decltype(derivative(f));
│ │ │ +
180};
│ │ │ +
181
│ │ │ +
182} // namespace Imp
│ │ │ +
183
│ │ │ +
184
│ │ │ +
185
│ │ │ +
186
│ │ │ +
204template <class B, class C, class F, class BV, class NTRE>
│ │ │ +
│ │ │ +
205void interpolate(const B& basis, C&& coeff, const F& f, const BV& bv, const NTRE& nodeToRangeEntry)
│ │ │ +
206{
│ │ │ +
207 using GridView = typename B::GridView;
│ │ │ +
208 using Element = typename GridView::template Codim<0>::Entity;
│ │ │ +
209 using GlobalDomain = typename Element::Geometry::GlobalCoordinate;
│ │ │ +
210
│ │ │ +
211 static_assert(Dune::Functions::Concept::isCallable<F, GlobalDomain>(), "Function passed to interpolate does not model the Callable<GlobalCoordinate> concept");
│ │ │ +
212
│ │ │ +
213 auto&& gridView = basis.gridView();
│ │ │ +
214
│ │ │ +
215 // Small helper functions to wrap vectors using istlVectorBackend
│ │ │ +
216 // if they do not already satisfy the VectorBackend interface.
│ │ │ +
217 auto toVectorBackend = [&](auto& v) -> decltype(auto) {
│ │ │ +
218 if constexpr (models<Concept::VectorBackend<B>, decltype(v)>()) {
│ │ │ +
219 return v;
│ │ │ +
220 } else {
│ │ │ +
221 return istlVectorBackend(v);
│ │ │ +
222 }
│ │ │ +
223 };
│ │ │ +
224
│ │ │ +
225 auto toConstVectorBackend = [&](auto& v) -> decltype(auto) {
│ │ │ +
226 if constexpr (models<Concept::ConstVectorBackend<B>, decltype(v)>()) {
│ │ │ +
227 return v;
│ │ │ +
228 } else {
│ │ │ +
229 return istlVectorBackend(v);
│ │ │ +
230 }
│ │ │ +
231 };
│ │ │ +
232
│ │ │ +
233 auto&& bitVector = toConstVectorBackend(bv);
│ │ │ +
234 auto&& vector = toVectorBackend(coeff);
│ │ │ +
235 vector.resize(basis);
│ │ │ +
236
│ │ │ +
237 // Make a grid function supporting local evaluation out of f
│ │ │ +
238 auto gf = makeGridViewFunction(f, gridView);
│ │ │ +
239
│ │ │ +
240 // Obtain a local view of f
│ │ │ +
241 // To avoid costly reconstruction of the derivative on each element,
│ │ │ +
242 // we use the CachedDerivativeLocalFunction wrapper if the function
│ │ │ +
243 // is differentiable. This wrapper will handout
│ │ │ +
244 // a reference to a single cached derivative object.
│ │ │ +
245 auto localF = [&](){
│ │ │ +
246 if constexpr (models<Imp::HasDerivative, decltype(localFunction(gf))>())
│ │ │ +
247 return Imp::CachedDerivativeLocalFunction(localFunction(gf));
│ │ │ +
248 else
│ │ │ +
249 return localFunction(gf);
│ │ │ +
250 }();
│ │ │ +
251
│ │ │ +
252 auto localView = basis.localView();
│ │ │ +
253
│ │ │ +
254 for (const auto& e : elements(gridView))
│ │ │ +
255 {
│ │ │ +
256 localView.bind(e);
│ │ │ +
257 localF.bind(e);
│ │ │ +
258 Imp::interpolateLocal(vector, bitVector, localF, localView, nodeToRangeEntry);
│ │ │ +
259 }
│ │ │ +
260}
│ │ │ +
│ │ │ +
261
│ │ │ +
278template <class B, class C, class F, class BV>
│ │ │ +
│ │ │ +
279void interpolate(const B& basis, C&& coeff, const F& f, const BV& bitVector)
│ │ │ +
280{
│ │ │ +
281 interpolate(basis, coeff, f, bitVector, HierarchicNodeToRangeMap());
│ │ │ +
282}
│ │ │ +
│ │ │ +
283
│ │ │ +
298template <class B, class C, class F>
│ │ │ +
│ │ │ +
299void interpolate(const B& basis, C&& coeff, const F& f)
│ │ │ +
300{
│ │ │ +
301 interpolate (basis, coeff, f, Imp::AllTrueBitSetVector(), HierarchicNodeToRangeMap());
│ │ │ +
302}
│ │ │ +
│ │ │ +
303
│ │ │ +
304} // namespace Functions
│ │ │ +
305} // namespace Dune
│ │ │ +
306
│ │ │ +
307#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │
TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
Obtain derivative of TrigonometricFunction function.
Definition trigonometricfunction.hh:43
│ │ │ -
DefaultGlobalBasis< ArgyrisPreBasis< GV, R > > ArgyrisBasis
Nodal basis of a scalar cubic Argyris finite element space.
Definition argyrisbasis.hh:69
│ │ │ +
auto istlVectorBackend(Vector &v)
Return a vector backend wrapping non-const ISTL like containers.
Definition istlvectorbackend.hh:350
│ │ │ +
static constexpr auto isCallable()
Check if f is callable with given argument list.
Definition functionconcepts.hh:51
│ │ │ +
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │
void interpolate(const B &basis, C &&coeff, const F &f, const BV &bv, const NTRE &nodeToRangeEntry)
Interpolate given function in discrete function space.
Definition interpolate.hh:205
│ │ │ -
Definition argyrisbasis.hh:926
│ │ │ -
Function, which evaluates all monomials up to degree maxDegree in a given coordinate.
Definition monomialset.hh:64
│ │ │ -
A pre-basis for a Argyrisbasis.
Definition argyrisbasis.hh:856
│ │ │ -
SubEntityMapper vertexMapper_
Definition argyrisbasis.hh:918
│ │ │ -
SubEntityMapper elementMapper_
Definition argyrisbasis.hh:920
│ │ │ -
std::vector< std::bitset< 3 > > edgeOrientations_
Definition argyrisbasis.hh:921
│ │ │ -
Node makeNode() const
Create tree node.
Definition argyrisbasis.hh:911
│ │ │ -
GV GridView
The grid view that the FE basis is defined on.
Definition argyrisbasis.hh:880
│ │ │ -
std::vector< D > averageVertexMeshSize_
Definition argyrisbasis.hh:919
│ │ │ -
ArgyrisNode< GridView, R > Node
Template mapping root tree path to type of created tree node.
Definition argyrisbasis.hh:886
│ │ │ -
void update(GridView const &gv)
Update the stored grid view, to be called if the grid has changed.
Definition argyrisbasis.hh:901
│ │ │ -
ArgyrisPreBasis(const GV &gv)
Constructor for a given grid view object.
Definition argyrisbasis.hh:891
│ │ │ -
std::size_t size_type
Type used for indices and size information.
Definition argyrisbasis.hh:883
│ │ │ -
Definition argyrisbasis.hh:786
│ │ │ -
std::vector< typename GridView::ctype > const * averageVertexMeshSize_
Definition argyrisbasis.hh:839
│ │ │ -
void bind(Element const &e)
Bind to element.
Definition argyrisbasis.hh:821
│ │ │ -
std::vector< std::bitset< 3 > > const * edgeOrientation_
Definition argyrisbasis.hh:840
│ │ │ -
typename Impl::ArgyrisLocalFiniteElement< typename GV::ctype, R > FiniteElement
Definition argyrisbasis.hh:792
│ │ │ -
Element const & element() const
Return current element, throw if unbound.
Definition argyrisbasis.hh:805
│ │ │ -
std::size_t size_type
Definition argyrisbasis.hh:790
│ │ │ -
FiniteElement finiteElement_
Definition argyrisbasis.hh:835
│ │ │ -
ArgyrisNode(Mapper const &vertexMapper, Mapper const &elementMapper, std::vector< typename GV::ctype > const &averageVertexMeshSize, std::vector< std::bitset< 3 > > const &edgeOrientation)
Definition argyrisbasis.hh:794
│ │ │ -
Mapper const * elementMapper_
Definition argyrisbasis.hh:838
│ │ │ -
FiniteElement const & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition argyrisbasis.hh:815
│ │ │ -
Mapper const * vertexMapper_
Definition argyrisbasis.hh:837
│ │ │ -
unsigned int order() const
The order of the local basis.
Definition argyrisbasis.hh:832
│ │ │ -
Element const * element_
Definition argyrisbasis.hh:836
│ │ │ -
typename GV::template Codim< 0 >::Entity Element
Definition argyrisbasis.hh:791
│ │ │ -
Definition cubichermitebasis.hh:84
│ │ │ -
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:53
│ │ │ -
const GridView & gridView() const
Export the stored GridView.
Definition leafprebasismappermixin.hh:95
│ │ │ -
void update(const GridView &gv)
Update the stored GridView.
Definition leafprebasismappermixin.hh:101
│ │ │ -
LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout)
Construct from GridView and local DOF layout.
Definition leafprebasismappermixin.hh:74
│ │ │ -
void setSize(const size_type size)
Definition nodes.hh:197
│ │ │ -
Definition nodes.hh:218
│ │ │ +
std::decay_t< F > makeGridViewFunction(F &&f, const GridView &gridView)
Construct a function modeling GridViewFunction from function and grid view.
Definition gridviewfunction.hh:72
│ │ │ +
auto forwardCapture(T &&t)
Create a capture object for perfect forwarding.
Definition utility.hh:380
│ │ │ +
A simple node to range map using the nested tree indices.
Definition hierarchicnodetorangemap.hh:34
│ │ │ + │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,1017 +1,331 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -argyrisbasis.hh │ │ │ │ +interpolate.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ -6#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_ARGYRISBASIS_HH │ │ │ │ -7#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_ARGYRISBASIS_HH │ │ │ │ -8 │ │ │ │ -9#include │ │ │ │ -10#include │ │ │ │ -11 │ │ │ │ -12#include │ │ │ │ -13#include │ │ │ │ -14#include │ │ │ │ -15#include │ │ │ │ +6 │ │ │ │ +7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH │ │ │ │ +8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH │ │ │ │ +9 │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ +12 │ │ │ │ +13#include │ │ │ │ +14#include │ │ │ │ +15#include │ │ │ │ 16 │ │ │ │ -17#include │ │ │ │ +17#include │ │ │ │ 18 │ │ │ │ -19#include │ │ │ │ -20#include │ │ │ │ -21#include │ │ │ │ -22 │ │ │ │ -23#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_a_n_a_l_y_t_i_c_f_u_n_c_t_i_o_n_s_/_m_o_n_o_m_i_a_l_s_e_t_._h_h> │ │ │ │ -24#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_m_a_p_p_e_r_u_t_i_l_i_t_i_e_s_._h_h> │ │ │ │ -25#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_u_b_i_c_h_e_r_m_i_t_e_b_a_s_i_s_._h_h> │ │ │ │ -26#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ -27#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_f_u_n_c_t_i_o_n_a_l_d_e_s_c_r_i_p_t_o_r_._h_h> │ │ │ │ -28#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h> │ │ │ │ -29#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ -30#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_t_r_a_n_s_f_o_r_m_e_d_f_i_n_i_t_e_e_l_e_m_e_n_t_m_i_x_i_n_._h_h> │ │ │ │ +19#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ +20#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +21 │ │ │ │ +22#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_b_a_c_k_e_n_d_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +23#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_b_a_c_k_e_n_d_s_/_i_s_t_l_v_e_c_t_o_r_b_a_c_k_e_n_d_._h_h> │ │ │ │ +24#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_f_l_a_t_v_e_c_t_o_r_v_i_e_w_._h_h> │ │ │ │ +25#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_h_i_e_r_a_r_c_h_i_c_n_o_d_e_t_o_r_a_n_g_e_m_a_p_._h_h> │ │ │ │ +26 │ │ │ │ +27namespace _D_u_n_e { │ │ │ │ +28namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +29 │ │ │ │ +30namespace Imp { │ │ │ │ 31 │ │ │ │ -45namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -46{ │ │ │ │ -47 │ │ │ │ -48 template │ │ │ │ -49 class _A_r_g_y_r_i_s_P_r_e_B_a_s_i_s; │ │ │ │ -50 │ │ │ │ -68 template │ │ │ │ -_6_9 using _A_r_g_y_r_i_s_B_a_s_i_s = _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_<_G_V_,_ _R_> >; │ │ │ │ +32struct AllTrueBitSetVector │ │ │ │ +33{ │ │ │ │ +34 struct AllTrueBitSet │ │ │ │ +35 { │ │ │ │ +36 bool test(int) const { return true; } │ │ │ │ +37 } allTrue_; │ │ │ │ +38 │ │ │ │ +39 operator bool() const │ │ │ │ +40 { │ │ │ │ +41 return true; │ │ │ │ +42 } │ │ │ │ +43 │ │ │ │ +44 template │ │ │ │ +45 const AllTrueBitSetVector& operator[](const I&) const │ │ │ │ +46 { │ │ │ │ +47 return *this; │ │ │ │ +48 } │ │ │ │ +49 │ │ │ │ +50 template │ │ │ │ +51 void resize(const SP&) const │ │ │ │ +52 {} │ │ │ │ +53 │ │ │ │ +54}; │ │ │ │ +55 │ │ │ │ +56 │ │ │ │ +57 │ │ │ │ +58// This helper function implements the restriction of some given function of │ │ │ │ +type F. │ │ │ │ +59// The restriction is a simple callback that is applied to the values of the │ │ │ │ +60// function and the values of its derivative. │ │ │ │ +61template │ │ │ │ +62class ComponentFunction │ │ │ │ +63{ │ │ │ │ +64public: │ │ │ │ +65 │ │ │ │ +66 ComponentFunction(F f, Restriction restriction) : │ │ │ │ +67 f_(std::move(f)), │ │ │ │ +68 restriction_(std::move(restriction)) │ │ │ │ +69 {} │ │ │ │ 70 │ │ │ │ -71 namespace Impl │ │ │ │ -72 { │ │ │ │ -73 │ │ │ │ -76 class ArgyrisLocalCoefficients │ │ │ │ -77 { │ │ │ │ -78 public: │ │ │ │ -79 using size_type = std::size_t; │ │ │ │ -80 static constexpr int dim = 2; │ │ │ │ -81 │ │ │ │ -82 ArgyrisLocalCoefficients() │ │ │ │ -83 { │ │ │ │ -84 for (unsigned int i = 0; i < 3; i++) // subentities: three vertices │ │ │ │ -85 for (unsigned int k = 0; k < 6; k++) // 6 basis functions per vertex │ │ │ │ -86 localKeys_[6 * i + k] │ │ │ │ -87 = LocalKey(i, dim, k); //(subentity, codim, number of dof for this │ │ │ │ -subentity) │ │ │ │ -88 for (unsigned int i = 0; i < 3; ++i) // subentities: three edges │ │ │ │ -89 localKeys_[18 + i] = LocalKey(i, dim - 1, 0); // one node per edge │ │ │ │ -90 } │ │ │ │ -91 │ │ │ │ -94 static constexpr size_type size() │ │ │ │ -95 { │ │ │ │ -96 return 21; │ │ │ │ -97 } │ │ │ │ -98 │ │ │ │ -101 LocalKey const &localKey(size_type i) const │ │ │ │ -102 { │ │ │ │ -103 return localKeys_[i]; │ │ │ │ -104 } │ │ │ │ -105 │ │ │ │ -106 private: │ │ │ │ -107 std::array localKeys_; │ │ │ │ -108 }; │ │ │ │ -109 │ │ │ │ -110 │ │ │ │ -116 template │ │ │ │ -117 class ArgyrisReferenceLocalBasis │ │ │ │ -118 { │ │ │ │ -119 static constexpr int dim = 2; │ │ │ │ -120 public: │ │ │ │ -121 using Traits = _H_2_L_o_c_a_l_B_a_s_i_s_T_r_a_i_t_s_<_D_,_ _d_i_m_,_ _F_i_e_l_d_V_e_c_t_o_r_<_D_,_ _d_i_m_>, R, 1, │ │ │ │ -FieldVector, │ │ │ │ -122 FieldMatrix, FieldMatrix >; │ │ │ │ -123 private: │ │ │ │ -124 │ │ │ │ -139 static constexpr auto getArgyrisCoefficients() │ │ │ │ -140 { │ │ │ │ -141 // Define std::sqrt(2.) manually in double precision, │ │ │ │ -142 // because std::sqrt is not constexpr before C++26. │ │ │ │ -143 D sqrt2 = -8. * 1.414213562373095; │ │ │ │ -144 return Dune::FieldMatrix{ │ │ │ │ -145 // vertex functionals │ │ │ │ -146 // l_0 │ │ │ │ -147 {1, /*0th order*/ │ │ │ │ -148 0, 0, /*1th order*/ │ │ │ │ -149 0, 0, 0, /*2th order*/ │ │ │ │ -150 -10, 0, 0, -10, /*3th order*/ │ │ │ │ -151 15, 0, -30, 0, 15, /*4th order*/ │ │ │ │ -152 -6, 0, 30, 30, 0, -6}, /*5th order*/ │ │ │ │ -153 // l_1 │ │ │ │ -154 {0, │ │ │ │ -155 1, 0, │ │ │ │ -156 0, 0, 0, │ │ │ │ -157 -6, 0, -11, 0, │ │ │ │ -158 8, 0, 10, 18, 0, │ │ │ │ -159 -3, 0, 1, -10, -8, 0}, │ │ │ │ -160 // l_2, l_1 mirrored │ │ │ │ -161 { │ │ │ │ -162 0, │ │ │ │ -163 0, 1, │ │ │ │ -164 0, 0, 0, │ │ │ │ -165 0, -11, 0, -6, │ │ │ │ -166 0, 18, 10, 0, 8, │ │ │ │ -167 0, -8, -10, 1, 0, -3}, │ │ │ │ -168 // l_3 │ │ │ │ -169 { │ │ │ │ -170 0, │ │ │ │ -171 0, 0, │ │ │ │ -172 0.5, 0, 0, │ │ │ │ -173 -1.5, 0, 0, 0, │ │ │ │ -174 1.5, 0, -1.5, 0, 0, │ │ │ │ -175 -0.5, 0, 1.5, 1, 0, 0}, │ │ │ │ -176 // l_4 │ │ │ │ -177 { │ │ │ │ -178 0, │ │ │ │ -179 0, 0, │ │ │ │ -180 0, 1, 0, │ │ │ │ -181 0, -4, -4, 0, │ │ │ │ -182 0, 5, 10, 5, 0, │ │ │ │ -183 0, -2, -6, -6, -2, 0}, │ │ │ │ -184 // l_5, l_3 mirrored │ │ │ │ -185 { │ │ │ │ -186 0, │ │ │ │ -187 0, 0, │ │ │ │ -188 0, 0, 0.5, │ │ │ │ -189 0, 0, 0, -1.5, │ │ │ │ -190 0, 0, -1.5, 0, 1.5, │ │ │ │ -191 0, 0, 1, 1.5, 0, -0.5}, │ │ │ │ -192 // l_6 │ │ │ │ -193 {0, │ │ │ │ -194 0, 0, │ │ │ │ -195 0, 0, 0, │ │ │ │ -196 10, 0, 0, 0, │ │ │ │ -197 -15, 0, 15, 0, 0, │ │ │ │ -198 6, 0, -15, -15, 0, 0}, │ │ │ │ -199 // l_7 │ │ │ │ -200 {0, │ │ │ │ -201 0, 0, │ │ │ │ -202 0, 0, 0, │ │ │ │ -203 -4, 0, 0, 0, │ │ │ │ -204 7, 0, -3.5, 0, 0, │ │ │ │ -205 -3, 0, 3.5, 3.5, 0, 0}, │ │ │ │ -206 // l_8 │ │ │ │ -207 {0, │ │ │ │ -208 0, 0, │ │ │ │ -209 0, 0, 0, │ │ │ │ -210 0, -5, 0, 0, │ │ │ │ -211 0, 14, 18.5, 0, 0, │ │ │ │ -212 0, -8, -18.5, -13.5, 0, 0}, │ │ │ │ -213 // l_9 │ │ │ │ -214 { │ │ │ │ -215 0, │ │ │ │ -216 0, 0, │ │ │ │ -217 0, 0, 0, │ │ │ │ -218 0.5, 0, 0, 0, │ │ │ │ -219 -1, 0, 0.25, 0, 0, │ │ │ │ -220 0.5, 0, -0.25, -0.25, 0, 0}, │ │ │ │ -221 // l_10 │ │ │ │ -222 { │ │ │ │ -223 0, │ │ │ │ -224 0, 0, │ │ │ │ -225 0, 0, 0, │ │ │ │ -226 0, 1, 0, 0, │ │ │ │ -227 0, -3, -3.5, 0, 0, │ │ │ │ -228 0, 2, 3.5, 2.5, 0, 0}, │ │ │ │ -229 // l_11 │ │ │ │ -230 { │ │ │ │ -231 0, │ │ │ │ -232 0, 0, │ │ │ │ -233 0, 0, 0, │ │ │ │ -234 0, 0, 0, 0, │ │ │ │ -235 0, 0, 1.25, 0, 0, │ │ │ │ -236 0, 0, -0.75, -1.25, 0, 0}, │ │ │ │ -237 // l_12 mirrors l_6 │ │ │ │ -238 { │ │ │ │ -239 0, │ │ │ │ -240 0, 0, │ │ │ │ -241 0, 0, 0, │ │ │ │ -242 0, 0, 0, 10, │ │ │ │ -243 0, 0, 15, 0, -15, │ │ │ │ -244 0, 0, -15, -15, 0, 6}, │ │ │ │ -245 // l_13 mirrors l_8 │ │ │ │ -246 { │ │ │ │ -247 0, │ │ │ │ -248 0, 0, │ │ │ │ -249 0, 0, 0, │ │ │ │ -250 0, 0, -5, 0, │ │ │ │ -251 0, 0, 18.5, 14, 0, │ │ │ │ -252 0, 0, -13.5, -18.5, -8, 0}, │ │ │ │ -253 // l_14 mirrors l_7 │ │ │ │ -254 { │ │ │ │ -255 0, │ │ │ │ -256 0, 0, │ │ │ │ -257 0, 0, 0, │ │ │ │ -258 0, 0, 0, -4, │ │ │ │ -259 0, 0, -3.5, 0, 7, │ │ │ │ -260 0, 0, 3.5, 3.5, 0, -3}, │ │ │ │ -261 // l_15 mirrors l_11 │ │ │ │ -262 { │ │ │ │ -263 0, │ │ │ │ -264 0, 0, │ │ │ │ -265 0, 0, 0, │ │ │ │ -266 0, 0, 0, 0, │ │ │ │ -267 0, 0, 1.25, 0, 0, │ │ │ │ -268 0, 0, -1.25, -0.75, 0, 0}, │ │ │ │ -269 // l_16 mirrors l_10 │ │ │ │ -270 { │ │ │ │ -271 0, │ │ │ │ -272 0, 0, │ │ │ │ -273 0, 0, 0, │ │ │ │ -274 0, 0, 1, 0, │ │ │ │ -275 0, 0, -3.5, -3, 0, │ │ │ │ -276 0, 0, 2.5, 3.5, 2, 0}, │ │ │ │ -277 // l_17 mirrors l_9 │ │ │ │ -278 { │ │ │ │ -279 0, │ │ │ │ -280 0, 0, │ │ │ │ -281 0, 0, 0, │ │ │ │ -282 0, 0, 0, 0.5, │ │ │ │ -283 0, 0, 0.25, 0, -1, │ │ │ │ -284 0, 0, -0.25, -0.25, 0, 0.5}, │ │ │ │ -285 // edge functionals │ │ │ │ -286 // l_18 │ │ │ │ -287 { │ │ │ │ -288 0, │ │ │ │ -289 0, 0, │ │ │ │ -290 0, 0, 0, │ │ │ │ -291 0, 16, 0, 0, │ │ │ │ -292 0, -32, -32, 0, 0, │ │ │ │ -293 0, 16, 32, 16, 0, 0}, │ │ │ │ -294 // l_19 │ │ │ │ -295 { │ │ │ │ -296 0, │ │ │ │ -297 0, 0, │ │ │ │ -298 0, 0, 0, │ │ │ │ -299 0, 0, -16, 0, │ │ │ │ -300 0, 0, 32, 32, 0, │ │ │ │ -301 0, 0, -16, -32, -16, 0}, │ │ │ │ -302 // l_20 │ │ │ │ -303 { │ │ │ │ -304 0, │ │ │ │ -305 0, 0, │ │ │ │ -306 0, 0, 0, │ │ │ │ -307 0, 0, 0, 0, │ │ │ │ -308 0, 0, -1. * sqrt2, 0, 0, │ │ │ │ -309 0, 0, sqrt2, sqrt2, 0, 0}}; │ │ │ │ -310 } │ │ │ │ -311 │ │ │ │ -312 │ │ │ │ -313 static constexpr auto referenceBasisCoefficients = getArgyrisCoefficients │ │ │ │ -(); │ │ │ │ -314 static constexpr _M_o_n_o_m_i_a_l_S_e_t_<_t_y_p_e_n_a_m_e_ _T_r_a_i_t_s_:_:_R_a_n_g_e_F_i_e_l_d_T_y_p_e_,_ _d_i_m_,_ _5_> │ │ │ │ -monomials = {}; │ │ │ │ -315 │ │ │ │ -316 public: │ │ │ │ -317 │ │ │ │ -320 static constexpr unsigned int size() │ │ │ │ -321 { │ │ │ │ -322 return ArgyrisLocalCoefficients::size(); │ │ │ │ -323 } │ │ │ │ -324 │ │ │ │ -327 static constexpr unsigned int order() │ │ │ │ -328 { │ │ │ │ -329 return 5; │ │ │ │ -330 } │ │ │ │ -331 │ │ │ │ -337 void evaluateFunction(const typename Traits::DomainType &in, │ │ │ │ -338 std::vector &out) const │ │ │ │ -339 { │ │ │ │ -340 out.resize(size()); │ │ │ │ -341 auto monomialValues = monomials(in); │ │ │ │ -342 multiplyWithCoefficentMatrix(referenceBasisCoefficients, monomialValues, │ │ │ │ -out); │ │ │ │ -343 } │ │ │ │ -344 │ │ │ │ -350 void evaluateJacobian(const typename Traits::DomainType &in, │ │ │ │ -351 std::vector &out) const │ │ │ │ -352 { │ │ │ │ -353 out.resize(size()); │ │ │ │ -354 auto monomialValues = _d_e_r_i_v_a_t_i_v_e(monomials)(in); │ │ │ │ -355 multiplyWithCoefficentMatrix(referenceBasisCoefficients, monomialValues, │ │ │ │ -out); │ │ │ │ -356 } │ │ │ │ -357 │ │ │ │ -363 void evaluateHessian(const typename Traits::DomainType &in, │ │ │ │ -364 std::vector &out) const │ │ │ │ -365 { │ │ │ │ -366 out.resize(size()); │ │ │ │ -367 auto monomialValues = _d_e_r_i_v_a_t_i_v_e(_d_e_r_i_v_a_t_i_v_e(monomials))(in); │ │ │ │ -368 multiplyWithCoefficentMatrix(referenceBasisCoefficients, monomialValues, │ │ │ │ -out); │ │ │ │ -369 } │ │ │ │ -370 │ │ │ │ -377 void partial(std::array order, const typename Traits:: │ │ │ │ -DomainType &in, │ │ │ │ -378 std::vector &out) const │ │ │ │ -379 { │ │ │ │ -380 out.resize(size()); │ │ │ │ -381 auto totalOrder = std::accumulate(order.begin(), order.end(), 0); │ │ │ │ -382 if (totalOrder == 0) │ │ │ │ -383 evaluateFunction(in, out); │ │ │ │ -384 else if (totalOrder == 1) │ │ │ │ -385 { │ │ │ │ -386 evaluateJacobian(in,jacobiansBuffer_); │ │ │ │ -387 std::size_t which = std::max_element(order.begin(), order.end()) - │ │ │ │ -order.begin(); │ │ │ │ -388 for (auto i : Dune::range(size())) │ │ │ │ -389 out[i] = jacobiansBuffer_[i][0][which]; │ │ │ │ -390 } │ │ │ │ -391 else if (totalOrder == 2) │ │ │ │ -392 { │ │ │ │ -393 evaluateHessian(in, hessianBuffer_); │ │ │ │ -394 std::size_t first, second; │ │ │ │ -395 first = std::max_element(order.begin(), order.end()) - order.begin(); │ │ │ │ -396 if (order[first] == 2) │ │ │ │ -397 second = first; │ │ │ │ -398 else │ │ │ │ -399 { │ │ │ │ -400 order[first] = 0; │ │ │ │ -401 second = std::max_element(order.begin(), order.end()) - order.begin(); │ │ │ │ -402 } │ │ │ │ -403 for (auto i : Dune::range(size())) │ │ │ │ -404 out[i] = hessianBuffer_[i][first][second]; │ │ │ │ -405 } │ │ │ │ -406 else │ │ │ │ -407 DUNE_THROW(RangeError, "partial() not implemented for given order"); │ │ │ │ -408 } │ │ │ │ -409 │ │ │ │ -410 private: │ │ │ │ -411 mutable std::vector jacobiansBuffer_; │ │ │ │ -412 mutable std::vector hessianBuffer_; │ │ │ │ -413 }; │ │ │ │ -414 │ │ │ │ -415 │ │ │ │ -421 template │ │ │ │ -422 class ArgyrisLocalInterpolation │ │ │ │ -423 { │ │ │ │ -424 using size_type = std::size_t; │ │ │ │ -425 static constexpr int dim = 2; │ │ │ │ -426 │ │ │ │ -427 static constexpr unsigned int size() │ │ │ │ -428 { │ │ │ │ -429 return ArgyrisLocalCoefficients::size(); │ │ │ │ -430 } │ │ │ │ -431 │ │ │ │ -432 using FunctionalDescriptor = Dune::Functions::Impl:: │ │ │ │ -FunctionalDescriptor; │ │ │ │ -433 │ │ │ │ -434 public: │ │ │ │ -435 │ │ │ │ -436 ArgyrisLocalInterpolation() │ │ │ │ -437 { │ │ │ │ -438 // first vertex │ │ │ │ -439 // function evaluation │ │ │ │ -440 descriptors_[0] = FunctionalDescriptor(); │ │ │ │ -441 // gradient evaluations │ │ │ │ -442 descriptors_[1] = FunctionalDescriptor({1,0}); │ │ │ │ -443 descriptors_[2] = FunctionalDescriptor({0,1}); │ │ │ │ -444 // hessian evaluations │ │ │ │ -445 descriptors_[3] = FunctionalDescriptor({2,0}); │ │ │ │ -446 descriptors_[4] = FunctionalDescriptor({1,1}); │ │ │ │ -447 descriptors_[5] = FunctionalDescriptor({0,2}); │ │ │ │ -448 // second vertex │ │ │ │ -449 descriptors_[6] = FunctionalDescriptor(); │ │ │ │ -450 descriptors_[7] = FunctionalDescriptor({1,0}); │ │ │ │ -451 descriptors_[8] = FunctionalDescriptor({0,1}); │ │ │ │ -452 descriptors_[9] = FunctionalDescriptor({2,0}); │ │ │ │ -453 descriptors_[10] = FunctionalDescriptor({1,1}); │ │ │ │ -454 descriptors_[11] = FunctionalDescriptor({0,2}); │ │ │ │ -455 // third vertex │ │ │ │ -456 descriptors_[12] = FunctionalDescriptor(); │ │ │ │ -457 descriptors_[13] = FunctionalDescriptor({1,0}); │ │ │ │ -458 descriptors_[14] = FunctionalDescriptor({0,1}); │ │ │ │ -459 descriptors_[15] = FunctionalDescriptor({2,0}); │ │ │ │ -460 descriptors_[16] = FunctionalDescriptor({1,1}); │ │ │ │ -461 descriptors_[17] = FunctionalDescriptor({0,2}); │ │ │ │ -462 // normal derivatives at edge midpoints │ │ │ │ -463 descriptors_[18] = FunctionalDescriptor(1); │ │ │ │ -464 descriptors_[19] = FunctionalDescriptor(1); │ │ │ │ -465 descriptors_[20] = FunctionalDescriptor(1); │ │ │ │ -466 } │ │ │ │ -467 │ │ │ │ -470 template │ │ │ │ -471 void bind( Element const& element, std::arrayconst& │ │ │ │ -averageVertexMeshSize, std::bitset<3>const& edgeOrientation) │ │ │ │ -472 { │ │ │ │ -473 averageVertexMeshSize_ = &averageVertexMeshSize; │ │ │ │ -474 │ │ │ │ -475 auto geometry = element.geometry(); │ │ │ │ -476 │ │ │ │ -477 // get global Normals and midpoints │ │ │ │ -478 auto refElement = Dune::referenceElement(geometry.type()); │ │ │ │ -479 for (std::size_t i = 0; i < 3; ++i) │ │ │ │ -480 { │ │ │ │ -481 localVertices_[i] = refElement.position(i, 2); │ │ │ │ -482 │ │ │ │ -483 localMidpoints_[i] = refElement.position(i, 1); │ │ │ │ -484 std::size_t lower = (i == 2) ? 1 : 0; │ │ │ │ -485 std::size_t upper = (i == 0) ? 1 : 2; │ │ │ │ -486 │ │ │ │ -487 auto edge = geometry.global(refElement.position(upper, 2)) │ │ │ │ -488 - geometry.global(refElement.position(lower, 2)); │ │ │ │ -489 // normalize and orient │ │ │ │ -490 edge /= edge.two_norm() * (edgeOrientation[i] ? -1. : 1.); │ │ │ │ -491 // Rotation by pi/2. Note that Kirby rotates by 3*pi/2 │ │ │ │ -492 globalNormals_[i] = {-edge[1], edge[0]}; │ │ │ │ -493 } │ │ │ │ -494 } │ │ │ │ -495 │ │ │ │ -503 template │ │ │ │ -504 void _i_n_t_e_r_p_o_l_a_t_e(F const& f, std::vector& out) const │ │ │ │ -505 { │ │ │ │ -506 out.resize(size()); │ │ │ │ -507 auto&& df = _d_e_r_i_v_a_t_i_v_e(f); │ │ │ │ -508 auto&& Hf = _d_e_r_i_v_a_t_i_v_e(df); │ │ │ │ -509 │ │ │ │ -510 int offset = 0; │ │ │ │ -511 // iterate over vertices │ │ │ │ -512 for (int i = 0; i < 3; i++, offset += 6) │ │ │ │ -513 { │ │ │ │ -514 auto&& x = localVertices_[i]; │ │ │ │ -515 auto derivativeValue = squeezeTensor(df(x)); │ │ │ │ -516 auto hessianValue = squeezeTensor(Hf(x)); │ │ │ │ -517 auto && h = (*averageVertexMeshSize_)[i]; │ │ │ │ -518 │ │ │ │ -519 out[offset ] = f(x); │ │ │ │ -520 │ │ │ │ -521 out[offset + 1] = derivativeValue[0] * h; │ │ │ │ -522 out[offset + 2] = derivativeValue[1] * h; │ │ │ │ -523 │ │ │ │ -524 out[offset + 3] = hessianValue[0][0] * h*h; │ │ │ │ -525 out[offset + 4] = hessianValue[0][1] * h*h; │ │ │ │ -526 out[offset + 5] = hessianValue[1][1] * h*h; │ │ │ │ -527 } │ │ │ │ -528 // iterate over edges │ │ │ │ -529 for (int i = 0; i < 3; i++) │ │ │ │ -530 out[18 + i] = squeezeTensor(df(localMidpoints_[i])).dot(globalNormals_[i]); │ │ │ │ -531 │ │ │ │ -532 } │ │ │ │ -533 │ │ │ │ -537 const FunctionalDescriptor& functionalDescriptor(size_type i) const │ │ │ │ -538 { │ │ │ │ -539 return descriptors_[i]; │ │ │ │ -540 } │ │ │ │ -541 │ │ │ │ -542 protected: │ │ │ │ -543 std::array, 3> globalNormals_; │ │ │ │ -544 std::array, 3> localMidpoints_; │ │ │ │ -545 std::array, 3> localVertices_; │ │ │ │ -546 std::array const* averageVertexMeshSize_; │ │ │ │ -547 std::array descriptors_; │ │ │ │ -548 }; │ │ │ │ -549 │ │ │ │ -550 // TODO: There is a copy of this further up │ │ │ │ -551 template │ │ │ │ -552 struct ArgyrisLocalBasisTraits │ │ │ │ -553 : public _H_2_L_o_c_a_l_B_a_s_i_s_T_r_a_i_t_s, R, 1, │ │ │ │ -554 Dune::FieldVector, Dune::FieldMatrix, Dune::FieldMatrix │ │ │ │ -> │ │ │ │ -555 {}; │ │ │ │ -556 │ │ │ │ -566 template │ │ │ │ -567 class ArgyrisLocalFiniteElement │ │ │ │ -568 : public Impl:: │ │ │ │ -TransformedFiniteElementMixin, │ │ │ │ -ArgyrisLocalBasisTraits > │ │ │ │ -569 { │ │ │ │ -570 using Base = Impl::TransformedFiniteElementMixin< │ │ │ │ -ArgyrisLocalFiniteElement, ArgyrisLocalBasisTraits >; │ │ │ │ -571 friend class Impl::TransformedLocalBasis, │ │ │ │ -ArgyrisLocalBasisTraits >; │ │ │ │ -572 static constexpr int dim = 2; │ │ │ │ -573 │ │ │ │ -574 public: │ │ │ │ -577 using size_type = std::size_t; │ │ │ │ -578 using Traits = LocalFiniteElementTraits< │ │ │ │ -579 Impl::TransformedLocalBasis, │ │ │ │ -ArgyrisLocalBasisTraits >, │ │ │ │ -580 Impl::ArgyrisLocalCoefficients, │ │ │ │ -581 Impl::ArgyrisLocalInterpolation >; │ │ │ │ -582 │ │ │ │ -586 const typename Traits::LocalCoefficientsType &localCoefficients() const │ │ │ │ -587 { │ │ │ │ -588 return coefficients_; │ │ │ │ -589 } │ │ │ │ -590 │ │ │ │ -593 const typename Traits::LocalInterpolationType &localInterpolation() const │ │ │ │ -594 { │ │ │ │ -595 return interpolation_; │ │ │ │ -596 } │ │ │ │ -597 │ │ │ │ -600 static constexpr GeometryType type() │ │ │ │ -601 { │ │ │ │ -602 return GeometryTypes::simplex(dim); │ │ │ │ -603 } │ │ │ │ -604 │ │ │ │ -607 static constexpr size_type size() │ │ │ │ -608 { │ │ │ │ -609 return Impl::ArgyrisLocalCoefficients::size(); │ │ │ │ -610 } │ │ │ │ -611 │ │ │ │ -614 template │ │ │ │ -615 void bind(VertexMapper const& vertexMapper, std::vector const& │ │ │ │ -globalAverageVertexMeshSize, │ │ │ │ -616 ElementMapper const& elementMapper, std::vector >const& │ │ │ │ -edgeOrientations, Element const &e) │ │ │ │ -617 { │ │ │ │ -618 // Cache average mesh size for each vertex │ │ │ │ -619 for (auto i : range(dim+1)) │ │ │ │ -620 averageVertexMeshSize_[i] = globalAverageVertexMeshSize │ │ │ │ -[vertexMapper.subIndex(e, i, dim)]; │ │ │ │ -621 │ │ │ │ -622 // Cache orientation for each mesh │ │ │ │ -623 edgeOrientation_ = edgeOrientations[elementMapper.index(e)]; │ │ │ │ -624 │ │ │ │ -625 // Bind LocalInterpolation to updated local state │ │ │ │ -626 interpolation_.bind(e, averageVertexMeshSize_, edgeOrientation_); │ │ │ │ -627 │ │ │ │ -628 // Compute local transformation matrices for each vertex │ │ │ │ -629 const auto& geometry = e.geometry(); │ │ │ │ -630 const auto& refElement = ReferenceElements::simplex(); │ │ │ │ -631 for (auto i : range(dim+1)) │ │ │ │ -632 { │ │ │ │ -633 vertexJacobians_[i] = geometry.jacobian(refElement.position(i, dim)); │ │ │ │ -634 } │ │ │ │ -635 │ │ │ │ -636 // get geometrical information │ │ │ │ -637 std::array, 3> referenceTangents; │ │ │ │ -638 │ │ │ │ -639 // get local and global Tangents │ │ │ │ -640 for (std::size_t i = 0; i < 3; ++i) │ │ │ │ -641 { │ │ │ │ -642 std::size_t lower = (i == 2) ? 1 : 0; │ │ │ │ -643 std::size_t upper = (i == 0) ? 1 : 2; │ │ │ │ -644 auto edge = refElement.position(upper, 2) - refElement.position(lower, 2); │ │ │ │ -645 │ │ │ │ -646 // store normalized reference Tangent vectors │ │ │ │ -647 referenceTangents[i] = edge / edge.two_norm(); │ │ │ │ -648 │ │ │ │ -649 auto globalEdge = geometry.global(refElement.position(upper, 2)) │ │ │ │ -650 - geometry.global(refElement.position(lower, 2)); │ │ │ │ -651 │ │ │ │ -652 // store length of global tangents and normalized global tangent vectors │ │ │ │ -653 l[i] = globalEdge.two_norm(); │ │ │ │ -654 globalTangents[i] = globalEdge / l[i]; │ │ │ │ -655 │ │ │ │ -656 tau[i] = FieldVector{ │ │ │ │ -657 globalTangents[i][0] * globalTangents[i][0], │ │ │ │ -658 2. * globalTangents[i][0] * globalTangents[i][1], │ │ │ │ -659 globalTangents[i][1] * globalTangents[i][1] │ │ │ │ -660 }; │ │ │ │ -661 │ │ │ │ -662 // The following variables are named as in Kirby's paper │ │ │ │ -663 // two g matrices │ │ │ │ -664 auto&& referenceG = FieldMatrix{ │ │ │ │ -665 {-referenceTangents[i][1], referenceTangents[i][0]}, │ │ │ │ -666 {referenceTangents[i][0], referenceTangents[i][1]} │ │ │ │ -667 }; │ │ │ │ -668 │ │ │ │ -669 auto&& globalG = FieldMatrix{ │ │ │ │ -670 {-globalTangents[i][1], globalTangents[i][0]}, │ │ │ │ -671 {globalTangents[i][0], globalTangents[i][1]} │ │ │ │ -672 }; │ │ │ │ -673 │ │ │ │ -674 // │ │ │ │ -675 b[i] = globalG * geometry.jacobian(refElement.position(i, 2)) * referenceG; │ │ │ │ -676 │ │ │ │ -677 theta[i][0][0] = vertexJacobians_[i][0][0] * vertexJacobians_[i][0][0]; │ │ │ │ -678 theta[i][0][1] = vertexJacobians_[i][0][0] * vertexJacobians_[i][0][1]; │ │ │ │ -679 theta[i][0][2] = vertexJacobians_[i][0][1] * vertexJacobians_[i][0][1]; │ │ │ │ -680 │ │ │ │ -681 theta[i][1][0] = 2. * vertexJacobians_[i][0][0] * vertexJacobians_[i][1] │ │ │ │ -[0]; │ │ │ │ -682 theta[i][1][1] = vertexJacobians_[i][0][0] * vertexJacobians_[i][1][1] + │ │ │ │ -vertexJacobians_[i][0][1] * vertexJacobians_[i][1][0]; │ │ │ │ -683 theta[i][1][2] = 2. * vertexJacobians_[i][0][1] * vertexJacobians_[i][1] │ │ │ │ -[1]; │ │ │ │ -684 │ │ │ │ -685 theta[i][2][0] = vertexJacobians_[i][1][0] * vertexJacobians_[i][1][0]; │ │ │ │ -686 theta[i][2][1] = vertexJacobians_[i][1][0] * vertexJacobians_[i][1][1]; │ │ │ │ -687 theta[i][2][2] = vertexJacobians_[i][1][1] * vertexJacobians_[i][1][1]; │ │ │ │ -688 } │ │ │ │ -689 } │ │ │ │ -690 │ │ │ │ -691 protected: │ │ │ │ -692 │ │ │ │ -695 Impl::ArgyrisReferenceLocalBasis const& referenceLocalBasis() const │ │ │ │ -696 { │ │ │ │ -697 return basis_; │ │ │ │ -698 } │ │ │ │ -699 │ │ │ │ -704 template │ │ │ │ -705 void transform(InputValues const &inValues, OutputValues &outValues) const │ │ │ │ -706 { │ │ │ │ -707 using std::pow; │ │ │ │ -708 assert(inValues.size() == size()); │ │ │ │ -709 assert(outValues.size() == inValues.size()); │ │ │ │ -710 // compatibility with sympy code below │ │ │ │ -711 auto &[b_0, b_1, b_2] = b; │ │ │ │ -712 auto &[J_0, J_1, J_2] = vertexJacobians_; │ │ │ │ -713 auto &[theta_0, theta_1, theta_2] = theta; │ │ │ │ -714 auto & h = averageVertexMeshSize_; │ │ │ │ -715 auto & o = edgeOrientation_; │ │ │ │ -716 std::array, 3> const &t = globalTangents; │ │ │ │ -717 // This code is generated with sympy. │ │ │ │ -718 // It a matrix free implementation of the matrix V in Kirbys paper. │ │ │ │ -719 outValues[0] = -15.0/8.0*b_0[1][0]*inValues[18]/l[0] - 15.0/8.0*b_1[1] │ │ │ │ -[0]*inValues[19]/l[1] + inValues[0]; │ │ │ │ -720 outValues[1] = (J_0[0][0]*inValues[1] + J_0[0][1]*inValues[2] - 0.4375*b_0 │ │ │ │ -[1][0]*inValues[18]*t[0][0] - 0.4375*b_1[1][0]*inValues[19]*t[1][0])/h[0]; │ │ │ │ -721 outValues[2] = (J_0[1][0]*inValues[1] + J_0[1][1]*inValues[2] - 0.4375*b_0 │ │ │ │ -[1][0]*inValues[18]*t[0][1] - 0.4375*b_1[1][0]*inValues[19]*t[1][1])/h[0]; │ │ │ │ -722 outValues[3] = (-1.0/32.0*b_0[1][0]*inValues[18]*l[0]*tau[0][0] - 1.0/ │ │ │ │ -32.0*b_1[1][0]*inValues[19]*l[1]*tau[1][0] + inValues[3]*theta_0[0][0] + │ │ │ │ -inValues[4]*theta_0[0][1] + inValues[5]*theta_0[0][2])/h[0] /h[0]; │ │ │ │ -723 outValues[4] = (-1.0/32.0*b_0[1][0]*inValues[18]*l[0]*tau[0][1] - 1.0/ │ │ │ │ -32.0*b_1[1][0]*inValues[19]*l[1]*tau[1][1] + inValues[3]*theta_0[1][0] + │ │ │ │ -inValues[4]*theta_0[1][1] + inValues[5]*theta_0[1][2])/h[0] /h[0]; │ │ │ │ -724 outValues[5] = (-1.0/32.0*b_0[1][0]*inValues[18]*l[0]*tau[0][2] - 1.0/ │ │ │ │ -32.0*b_1[1][0]*inValues[19]*l[1]*tau[1][2] + inValues[3]*theta_0[2][0] + │ │ │ │ -inValues[4]*theta_0[2][1] + inValues[5]*theta_0[2][2])/h[0] /h[0]; │ │ │ │ -725 outValues[6] = (15.0/8.0)*b_0[1][0]*inValues[18]/l[0] - 15.0/8.0*b_2[1] │ │ │ │ -[0]*inValues[20]/l[2] + inValues[6]; │ │ │ │ -726 outValues[7] = (J_1[0][0]*inValues[7] + J_1[0][1]*inValues[8] - 0.4375*b_0 │ │ │ │ -[1][0]*inValues[18]*t[0][0] - 0.4375*b_2[1][0]*inValues[20]*t[2][0])/h[1]; │ │ │ │ -727 outValues[8] = (J_1[1][0]*inValues[7] + J_1[1][1]*inValues[8] - 0.4375*b_0 │ │ │ │ -[1][0]*inValues[18]*t[0][1] - 0.4375*b_2[1][0]*inValues[20]*t[2][1])/h[1]; │ │ │ │ -728 outValues[9] = ((1.0/32.0)*b_0[1][0]*inValues[18]*l[0]*tau[0][0] - 1.0/ │ │ │ │ -32.0*b_2[1][0]*inValues[20]*l[2]*tau[2][0] + inValues[9]*theta_1[0][0] + │ │ │ │ -inValues[10]*theta_1[0][1] + inValues[11]*theta_1[0][2])/h[1] /h[1]; │ │ │ │ -729 outValues[10] = ((1.0/32.0)*b_0[1][0]*inValues[18]*l[0]*tau[0][1] - 1.0/ │ │ │ │ -32.0*b_2[1][0]*inValues[20]*l[2]*tau[2][1] + inValues[9]*theta_1[1][0] + │ │ │ │ -inValues[10]*theta_1[1][1] + inValues[11]*theta_1[1][2])/h[1] /h[1]; │ │ │ │ -730 outValues[11] = ((1.0/32.0)*b_0[1][0]*inValues[18]*l[0]*tau[0][2] - 1.0/ │ │ │ │ -32.0*b_2[1][0]*inValues[20]*l[2]*tau[2][2] + inValues[9]*theta_1[2][0] + │ │ │ │ -inValues[10]*theta_1[2][1] + inValues[11]*theta_1[2][2])/h[1] /h[1]; │ │ │ │ -731 outValues[12] = (15.0/8.0)*b_1[1][0]*inValues[19]/l[1] + (15.0/8.0)*b_2[1] │ │ │ │ -[0]*inValues[20]/l[2] + inValues[12]; │ │ │ │ -732 outValues[13] = (J_2[0][0]*inValues[13] + J_2[0][1]*inValues[14] - │ │ │ │ -0.4375*b_1[1][0]*inValues[19]*t[1][0] - 0.4375*b_2[1][0]*inValues[20]*t[2][0])/ │ │ │ │ -h[2]; │ │ │ │ -733 outValues[14] = (J_2[1][0]*inValues[13] + J_2[1][1]*inValues[14] - │ │ │ │ -0.4375*b_1[1][0]*inValues[19]*t[1][1] - 0.4375*b_2[1][0]*inValues[20]*t[2][1])/ │ │ │ │ -h[2]; │ │ │ │ -734 outValues[15] = ((1.0/32.0)*b_1[1][0]*inValues[19]*l[1]*tau[1][0] + (1.0/ │ │ │ │ -32.0)*b_2[1][0]*inValues[20]*l[2]*tau[2][0] + inValues[15]*theta_2[0][0] + │ │ │ │ -inValues[16]*theta_2[0][1] + inValues[17]*theta_2[0][2])/h[2] /h[2]; │ │ │ │ -735 outValues[16] = ((1.0/32.0)*b_1[1][0]*inValues[19]*l[1]*tau[1][1] + (1.0/ │ │ │ │ -32.0)*b_2[1][0]*inValues[20]*l[2]*tau[2][1] + inValues[15]*theta_2[1][0] + │ │ │ │ -inValues[16]*theta_2[1][1] + inValues[17]*theta_2[1][2])/h[2] /h[2]; │ │ │ │ -736 outValues[17] = ((1.0/32.0)*b_1[1][0]*inValues[19]*l[1]*tau[1][2] + (1.0/ │ │ │ │ -32.0)*b_2[1][0]*inValues[20]*l[2]*tau[2][2] + inValues[15]*theta_2[2][0] + │ │ │ │ -inValues[16]*theta_2[2][1] + inValues[17]*theta_2[2][2])/h[2] /h[2]; │ │ │ │ -737 outValues[18] = b_0[0][0]*inValues[18]*(o[0] ? -1 : 1); │ │ │ │ -738 outValues[19] = b_1[0][0]*inValues[19]*(o[1] ? -1 : 1); │ │ │ │ -739 outValues[20] = b_2[0][0]*inValues[20]*(o[2] ? -1 : 1); │ │ │ │ -740 } │ │ │ │ -741 │ │ │ │ -742 private: │ │ │ │ -743 typename Impl::ArgyrisReferenceLocalBasis basis_; │ │ │ │ -744 typename Traits::LocalCoefficientsType coefficients_; │ │ │ │ -745 typename Traits::LocalInterpolationType interpolation_; │ │ │ │ -746 // the transformation to correct the lack of affine equivalence boils down │ │ │ │ -to │ │ │ │ -747 // matrix without blockstructure, because the normal derivative dofs │ │ │ │ -interact nontrivially │ │ │ │ -748 // with the others, for details see Kirby's paper. │ │ │ │ -749 // The following geometric information is needed │ │ │ │ -750 // the jacobians per vertex │ │ │ │ -751 std::array, dim+1> vertexJacobians_; │ │ │ │ -752 // a three by three matrix per vertex formalizing the rotation of the │ │ │ │ -hessian in voigt notation │ │ │ │ -753 std::array, 3> theta; │ │ │ │ -754 // the edge lengths │ │ │ │ -755 FieldVector l; │ │ │ │ -756 // the global tangent vectors (normalized) │ │ │ │ -757 std::array, 3> globalTangents; │ │ │ │ -758 // Geometric quantities without trivial meaning │ │ │ │ -759 std::array, 3> tau; │ │ │ │ -760 std::array, 3> b; │ │ │ │ -761 // Additionally, we collect some global information │ │ │ │ -762 // the local state, i.e. a collection of global information restricted to │ │ │ │ -this element │ │ │ │ -763 std::array averageVertexMeshSize_; │ │ │ │ -764 std::bitset<3> edgeOrientation_; │ │ │ │ -765 │ │ │ │ -766 }; │ │ │ │ -767 │ │ │ │ -768 } // end namespace Impl │ │ │ │ -769 │ │ │ │ -770 │ │ │ │ -771 │ │ │ │ -772 / │ │ │ │ -/ ***************************************************************************** │ │ │ │ -773 // This is the reusable part of the basis. It contains │ │ │ │ -774 // │ │ │ │ -775 // ArgyrisPreBasis │ │ │ │ -776 // ArgyrisNode │ │ │ │ -777 // │ │ │ │ -778 // The pre-basis allows to create the others and is the owner of possible │ │ │ │ -shared │ │ │ │ -779 // state. These components do _not_ depend on the global basis and local │ │ │ │ -view │ │ │ │ -780 // and can be used without a global basis. │ │ │ │ -781 / │ │ │ │ -/ ***************************************************************************** │ │ │ │ -782 │ │ │ │ -783 template │ │ │ │ -_7_8_4 class _A_r_g_y_r_i_s_N_o_d_e │ │ │ │ -785 : public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ -786 { │ │ │ │ -787 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper; │ │ │ │ -788 │ │ │ │ -789 public: │ │ │ │ -_7_9_0 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ -_7_9_1 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ -_7_9_2 using _F_i_n_i_t_e_E_l_e_m_e_n_t = typename Impl::ArgyrisLocalFiniteElement; │ │ │ │ -793 │ │ │ │ -_7_9_4 _A_r_g_y_r_i_s_N_o_d_e(Mapper const& vertexMapper, Mapper const& elementMapper, │ │ │ │ -795 std::vector const& averageVertexMeshSize, │ │ │ │ -796 std::vector > const& edgeOrientation) │ │ │ │ -797 : _e_l_e_m_e_n_t__(nullptr) │ │ │ │ -798 , _v_e_r_t_e_x_M_a_p_p_e_r__(&vertexMapper) │ │ │ │ -799 , _e_l_e_m_e_n_t_M_a_p_p_e_r__(&elementMapper) │ │ │ │ -800 , _a_v_e_r_a_g_e_V_e_r_t_e_x_M_e_s_h_S_i_z_e__(&averageVertexMeshSize) │ │ │ │ -801 , _e_d_g_e_O_r_i_e_n_t_a_t_i_o_n__(&edgeOrientation) │ │ │ │ -802 {} │ │ │ │ -803 │ │ │ │ -_8_0_5 _E_l_e_m_e_n_t const &_e_l_e_m_e_n_t() const │ │ │ │ -806 { │ │ │ │ -807 return *_e_l_e_m_e_n_t__; │ │ │ │ -808 } │ │ │ │ -809 │ │ │ │ -_8_1_5 _F_i_n_i_t_e_E_l_e_m_e_n_t const &_f_i_n_i_t_e_E_l_e_m_e_n_t() const │ │ │ │ -816 { │ │ │ │ -817 return _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ -818 } │ │ │ │ -819 │ │ │ │ -_8_2_1 void _b_i_n_d(_E_l_e_m_e_n_t const &e) │ │ │ │ -822 { │ │ │ │ -823 _e_l_e_m_e_n_t__ = &e; │ │ │ │ -824 _f_i_n_i_t_e_E_l_e_m_e_n_t__.bind(*_v_e_r_t_e_x_M_a_p_p_e_r__, *_a_v_e_r_a_g_e_V_e_r_t_e_x_M_e_s_h_S_i_z_e__, │ │ │ │ -825 *_e_l_e_m_e_n_t_M_a_p_p_e_r__,* _e_d_g_e_O_r_i_e_n_t_a_t_i_o_n__, │ │ │ │ -826 *_e_l_e_m_e_n_t__ ); │ │ │ │ -827 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__.size()); │ │ │ │ -828 │ │ │ │ -829 } │ │ │ │ -830 │ │ │ │ -_8_3_2 unsigned int _o_r_d_e_r() const { return _f_i_n_i_t_e_E_l_e_m_e_n_t__.localBasis().order(); } │ │ │ │ -833 │ │ │ │ -834 protected: │ │ │ │ -_8_3_5 _F_i_n_i_t_e_E_l_e_m_e_n_t _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ -_8_3_6 _E_l_e_m_e_n_t const* _e_l_e_m_e_n_t__; │ │ │ │ -_8_3_7 Mapper const* _v_e_r_t_e_x_M_a_p_p_e_r__; │ │ │ │ -_8_3_8 Mapper const* _e_l_e_m_e_n_t_M_a_p_p_e_r__; │ │ │ │ -_8_3_9 std::vector const* _a_v_e_r_a_g_e_V_e_r_t_e_x_M_e_s_h_S_i_z_e__; │ │ │ │ -_8_4_0 std::vector > const* _e_d_g_e_O_r_i_e_n_t_a_t_i_o_n__; │ │ │ │ -841 }; │ │ │ │ -842 │ │ │ │ -843 │ │ │ │ -853 template │ │ │ │ -_8_5_4 class _A_r_g_y_r_i_s_P_r_e_B_a_s_i_s │ │ │ │ -855 : public _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n │ │ │ │ -856 { │ │ │ │ -857 using Base = _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_<_G_V_>; │ │ │ │ -858 using SubEntityMapper = Dune::MultipleCodimMultipleGeomTypeMapper; │ │ │ │ -859 using Element = typename GV::template Codim<0>::Entity; │ │ │ │ -860 using D = typename GV::ctype; │ │ │ │ -861 static const std::size_t dim = GV::dimension; │ │ │ │ -862 │ │ │ │ -863 // helper methods to assign each subentity the number of dofs. Used by the │ │ │ │ -LeafPreBasisMapperMixin. │ │ │ │ -864 static constexpr auto ArgyrisMapperLayout(Dune::GeometryType type, int │ │ │ │ -gridDim) │ │ │ │ -865 { │ │ │ │ -866 assert(gridDim == 2); │ │ │ │ -867 if (type.isVertex()) │ │ │ │ -868 return 6; // one evaluation dof and two derivative dofs and three hessian │ │ │ │ -dofs per vertex │ │ │ │ -869 else if (type.isLine()) │ │ │ │ -870 return 1; │ │ │ │ -871 else if (type.isTriangle()) │ │ │ │ -872 return 0; │ │ │ │ -873 else │ │ │ │ -874 DUNE_THROW(Dune::Exception, "Invalid Geometry type for Argyris Element!"); │ │ │ │ -875 │ │ │ │ -876 } │ │ │ │ -877 │ │ │ │ -878 public: │ │ │ │ -_8_8_0 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ -881 │ │ │ │ -_8_8_3 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ -884 │ │ │ │ -_8_8_6 using _N_o_d_e = _A_r_g_y_r_i_s_N_o_d_e_<_G_r_i_d_V_i_e_w_,_ _R_>; │ │ │ │ -887 │ │ │ │ -888 public: │ │ │ │ -889 │ │ │ │ -_8_9_1 _A_r_g_y_r_i_s_P_r_e_B_a_s_i_s(const GV &gv) │ │ │ │ -892 : Base(gv, ArgyrisMapperLayout) │ │ │ │ -893 , _v_e_r_t_e_x_M_a_p_p_e_r__({gv, mcmgVertexLayout()}) │ │ │ │ -894 , _e_l_e_m_e_n_t_M_a_p_p_e_r__({gv, mcmgElementLayout()}) │ │ │ │ -895 { │ │ │ │ -896 _a_v_e_r_a_g_e_V_e_r_t_e_x_M_e_s_h_S_i_z_e__ = Impl::computeAverageSubEntityMeshSize │ │ │ │ -(_v_e_r_t_e_x_M_a_p_p_e_r__); │ │ │ │ -897 _e_d_g_e_O_r_i_e_n_t_a_t_i_o_n_s__ = Impl::computeEdgeOrientations(_e_l_e_m_e_n_t_M_a_p_p_e_r__); │ │ │ │ -898 } │ │ │ │ -899 │ │ │ │ -_9_0_1 void _u_p_d_a_t_e(_G_r_i_d_V_i_e_w const &gv) │ │ │ │ -902 { │ │ │ │ -903 _B_a_s_e_:_:_u_p_d_a_t_e(gv); │ │ │ │ -904 _v_e_r_t_e_x_M_a_p_p_e_r__.update(this->_g_r_i_d_V_i_e_w()); │ │ │ │ -905 _e_l_e_m_e_n_t_M_a_p_p_e_r__.update(this->_g_r_i_d_V_i_e_w()); │ │ │ │ -906 _a_v_e_r_a_g_e_V_e_r_t_e_x_M_e_s_h_S_i_z_e__ = Impl::computeAverageSubEntityMeshSize │ │ │ │ -(_v_e_r_t_e_x_M_a_p_p_e_r__); │ │ │ │ -907 _e_d_g_e_O_r_i_e_n_t_a_t_i_o_n_s__ = Impl::computeEdgeOrientations(_e_l_e_m_e_n_t_M_a_p_p_e_r__); │ │ │ │ -908 } │ │ │ │ -909 │ │ │ │ -_9_1_1 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ -912 { │ │ │ │ -913 return _N_o_d_e{_v_e_r_t_e_x_M_a_p_p_e_r__, _e_l_e_m_e_n_t_M_a_p_p_e_r__, _a_v_e_r_a_g_e_V_e_r_t_e_x_M_e_s_h_S_i_z_e__, │ │ │ │ -_e_d_g_e_O_r_i_e_n_t_a_t_i_o_n_s__}; │ │ │ │ -914 } │ │ │ │ -915 │ │ │ │ -916 protected: │ │ │ │ -917 │ │ │ │ -_9_1_8 SubEntityMapper _v_e_r_t_e_x_M_a_p_p_e_r__; │ │ │ │ -_9_1_9 std::vector _a_v_e_r_a_g_e_V_e_r_t_e_x_M_e_s_h_S_i_z_e__; │ │ │ │ -_9_2_0 SubEntityMapper _e_l_e_m_e_n_t_M_a_p_p_e_r__; │ │ │ │ -_9_2_1 std::vector > _e_d_g_e_O_r_i_e_n_t_a_t_i_o_n_s__; │ │ │ │ -922 │ │ │ │ -923 }; // class ArgyrisPreBasis │ │ │ │ -924 │ │ │ │ -_9_2_5 namespace _B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -926 { │ │ │ │ -927 │ │ │ │ -935 template │ │ │ │ -936 auto argyris() │ │ │ │ -937 { │ │ │ │ -938 return [=](auto const &gridView) { │ │ │ │ -939 return _A_r_g_y_r_i_s_P_r_e_B_a_s_i_s, R>(gridView); │ │ │ │ -940 }; │ │ │ │ -941 } │ │ │ │ -942 │ │ │ │ -943 } // end namespace BasisFactory │ │ │ │ -944 │ │ │ │ -945 │ │ │ │ -946} // end namespace Dune::Functions │ │ │ │ -947 │ │ │ │ -948#endif │ │ │ │ -_t_r_a_n_s_f_o_r_m_e_d_f_i_n_i_t_e_e_l_e_m_e_n_t_m_i_x_i_n_._h_h │ │ │ │ -_n_o_d_e_s_._h_h │ │ │ │ -_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h │ │ │ │ -_f_u_n_c_t_i_o_n_a_l_d_e_s_c_r_i_p_t_o_r_._h_h │ │ │ │ -_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ -_c_u_b_i_c_h_e_r_m_i_t_e_b_a_s_i_s_._h_h │ │ │ │ -This file provides an implementation of the cubic Hermite finite element in 1 │ │ │ │ -to 3 dimensions. │ │ │ │ -_m_a_p_p_e_r_u_t_i_l_i_t_i_e_s_._h_h │ │ │ │ -_m_o_n_o_m_i_a_l_s_e_t_._h_h │ │ │ │ +71 template │ │ │ │ +72 auto operator()(const Domain& x) const │ │ │ │ +73 { │ │ │ │ +74 return restriction_(f_(x)); │ │ │ │ +75 } │ │ │ │ +76 │ │ │ │ +77 friend auto derivative(const ComponentFunction& cf) │ │ │ │ +78 { │ │ │ │ +79 // This provides support for capturing the derivative of the function by │ │ │ │ +reference │ │ │ │ +80 // using forwardCapture for perfect forwarding capture. If the function │ │ │ │ +caches its │ │ │ │ +81 // derivative, this saves a potentially costly copy. │ │ │ │ +82 auto&& df = derivative(Dune::resolveRef(cf.f_)); │ │ │ │ +83 return [&, df=_f_o_r_w_a_r_d_C_a_p_t_u_r_e(std::forward(df))](auto&& x) { │ │ │ │ +84 return cf.restriction_(df.forward()(x)); │ │ │ │ +85 }; │ │ │ │ +86 } │ │ │ │ +87 │ │ │ │ +88private: │ │ │ │ +89 F f_; │ │ │ │ +90 Restriction restriction_; │ │ │ │ +91}; │ │ │ │ +92 │ │ │ │ +93 │ │ │ │ +94 │ │ │ │ +95 │ │ │ │ +96// This helper function implements caching of the derivative for local │ │ │ │ +functions. │ │ │ │ +97// When using an algorithm that gets a LocalFunction and calls its derivative │ │ │ │ +98// on each element, this leads to a costly call of derivative(f). E.g. for a │ │ │ │ +99// DiscreteGlobalBasisFunction, this will allocate several buffer. │ │ │ │ +100// To avoid this, this helper function caches the derivative and hands │ │ │ │ +101// out the cached derivative by reference. To ensure that the handed out │ │ │ │ +102// derivative is appropriately bound, binding the function will │ │ │ │ +automatically │ │ │ │ +103// bind the cached derivative. │ │ │ │ +104// │ │ │ │ +105// Notice that we cannot simply create the derivative in the constructor, │ │ │ │ +106// because this may throw for functions that do not implement the │ │ │ │ +derivative. │ │ │ │ +107template │ │ │ │ +108class CachedDerivativeLocalFunction │ │ │ │ +109{ │ │ │ │ +110 using Derivative = std::decay_t())))>; │ │ │ │ +111 │ │ │ │ +112public: │ │ │ │ +113 │ │ │ │ +114 CachedDerivativeLocalFunction(F f) : │ │ │ │ +115 f_(f) │ │ │ │ +116 {} │ │ │ │ +117 │ │ │ │ +118 template │ │ │ │ +119 void bind(const Element& element) │ │ │ │ +120 { │ │ │ │ +121 Dune::resolveRef(f_).bind(element); │ │ │ │ +122 if (derivative_) │ │ │ │ +123 derivative_.value().bind(element); │ │ │ │ +124 } │ │ │ │ +125 │ │ │ │ +126 template │ │ │ │ +127 auto operator()(const X& x) const │ │ │ │ +128 { │ │ │ │ +129 return f_(x); │ │ │ │ +130 } │ │ │ │ +131 │ │ │ │ +132 friend const Derivative& derivative(const CachedDerivativeLocalFunction& │ │ │ │ +cdlf) │ │ │ │ +133 { │ │ │ │ +134 if (not cdlf.derivative_) │ │ │ │ +135 { │ │ │ │ +136 auto&& lf = Dune::resolveRef(cdlf.f_); │ │ │ │ +137 cdlf.derivative_ = derivative(lf); │ │ │ │ +138 if (lf.bound()) │ │ │ │ +139 cdlf.derivative_.value().bind(lf.localContext()); │ │ │ │ +140 } │ │ │ │ +141 return cdlf.derivative_.value(); │ │ │ │ +142 } │ │ │ │ +143 │ │ │ │ +144private: │ │ │ │ +145 F f_; │ │ │ │ +146 mutable std::optional derivative_; │ │ │ │ +147}; │ │ │ │ +148 │ │ │ │ +149 │ │ │ │ +150 │ │ │ │ +151template │ │ │ │ +152void interpolateLocal(VectorBackend& vector, const BitVectorBackend& │ │ │ │ +bitVector, const LocalFunction& localF, const LocalView& localView, const │ │ │ │ +NodeToRangeEntry& nodeToRangeEntry) │ │ │ │ +153{ │ │ │ │ +154 Dune::TypeTree::forEachLeafNode(localView.tree(), [&](auto&& node, auto&& │ │ │ │ +treePath) { │ │ │ │ +155 if (node.empty()) │ │ │ │ +156 return; │ │ │ │ +157 using Node = std::decay_t; │ │ │ │ +158 using FiniteElement = typename Node::FiniteElement; │ │ │ │ +159 using FiniteElementRangeField = typename FiniteElement::Traits:: │ │ │ │ +LocalBasisType::Traits::RangeFieldType; │ │ │ │ +160 │ │ │ │ +161 auto interpolationCoefficients = std::vector(); │ │ │ │ +162 auto&& fe = node.finiteElement(); │ │ │ │ +163 auto localF_RE = ComponentFunction(std::cref(localF), [&](auto&& y) │ │ │ │ +{ return nodeToRangeEntry(node, treePath, y); }); │ │ │ │ +164 │ │ │ │ +165 fe.localInterpolation().interpolate(localF_RE, interpolationCoefficients); │ │ │ │ +166 for (size_t i=0; i │ │ │ │ +179 auto require(F&& f) -> decltype(_d_e_r_i_v_a_t_i_v_e(f)); │ │ │ │ +180}; │ │ │ │ +181 │ │ │ │ +182} // namespace Imp │ │ │ │ +183 │ │ │ │ +184 │ │ │ │ +185 │ │ │ │ +186 │ │ │ │ +204template │ │ │ │ +_2_0_5void _i_n_t_e_r_p_o_l_a_t_e(const B& basis, C&& coeff, const F& f, const BV& bv, const │ │ │ │ +NTRE& nodeToRangeEntry) │ │ │ │ +206{ │ │ │ │ +207 using GridView = typename B::GridView; │ │ │ │ +208 using Element = typename GridView::template Codim<0>::Entity; │ │ │ │ +209 using GlobalDomain = typename Element::Geometry::GlobalCoordinate; │ │ │ │ +210 │ │ │ │ +211 static_assert(_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_C_a_l_l_a_b_l_e_<_F_,_ _G_l_o_b_a_l_D_o_m_a_i_n_>(), │ │ │ │ +"Function passed to interpolate does not model the Callable │ │ │ │ +concept"); │ │ │ │ +212 │ │ │ │ +213 auto&& gridView = basis.gridView(); │ │ │ │ +214 │ │ │ │ +215 // Small helper functions to wrap vectors using istlVectorBackend │ │ │ │ +216 // if they do not already satisfy the VectorBackend interface. │ │ │ │ +217 auto toVectorBackend = [&](auto& v) -> decltype(auto) { │ │ │ │ +218 if constexpr (models, decltype(v)>()) { │ │ │ │ +219 return v; │ │ │ │ +220 } else { │ │ │ │ +221 return _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(v); │ │ │ │ +222 } │ │ │ │ +223 }; │ │ │ │ +224 │ │ │ │ +225 auto toConstVectorBackend = [&](auto& v) -> decltype(auto) { │ │ │ │ +226 if constexpr (models, decltype(v)>()) { │ │ │ │ +227 return v; │ │ │ │ +228 } else { │ │ │ │ +229 return _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(v); │ │ │ │ +230 } │ │ │ │ +231 }; │ │ │ │ +232 │ │ │ │ +233 auto&& bitVector = toConstVectorBackend(bv); │ │ │ │ +234 auto&& vector = toVectorBackend(coeff); │ │ │ │ +235 vector.resize(basis); │ │ │ │ +236 │ │ │ │ +237 // Make a grid function supporting local evaluation out of f │ │ │ │ +238 auto gf = _m_a_k_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n(f, gridView); │ │ │ │ +239 │ │ │ │ +240 // Obtain a local view of f │ │ │ │ +241 // To avoid costly reconstruction of the derivative on each element, │ │ │ │ +242 // we use the CachedDerivativeLocalFunction wrapper if the function │ │ │ │ +243 // is differentiable. This wrapper will handout │ │ │ │ +244 // a reference to a single cached derivative object. │ │ │ │ +245 auto localF = [&](){ │ │ │ │ +246 if constexpr (models()) │ │ │ │ +247 return Imp::CachedDerivativeLocalFunction(localFunction(gf)); │ │ │ │ +248 else │ │ │ │ +249 return localFunction(gf); │ │ │ │ +250 }(); │ │ │ │ +251 │ │ │ │ +252 auto localView = basis.localView(); │ │ │ │ +253 │ │ │ │ +254 for (const auto& e : elements(gridView)) │ │ │ │ +255 { │ │ │ │ +256 localView.bind(e); │ │ │ │ +257 localF.bind(e); │ │ │ │ +258 Imp::interpolateLocal(vector, bitVector, localF, localView, │ │ │ │ +nodeToRangeEntry); │ │ │ │ +259 } │ │ │ │ +260} │ │ │ │ +261 │ │ │ │ +278template │ │ │ │ +_2_7_9void _i_n_t_e_r_p_o_l_a_t_e(const B& basis, C&& coeff, const F& f, const BV& bitVector) │ │ │ │ +280{ │ │ │ │ +281 _i_n_t_e_r_p_o_l_a_t_e(basis, coeff, f, bitVector, _H_i_e_r_a_r_c_h_i_c_N_o_d_e_T_o_R_a_n_g_e_M_a_p()); │ │ │ │ +282} │ │ │ │ +283 │ │ │ │ +298template │ │ │ │ +_2_9_9void _i_n_t_e_r_p_o_l_a_t_e(const B& basis, C&& coeff, const F& f) │ │ │ │ +300{ │ │ │ │ +301 _i_n_t_e_r_p_o_l_a_t_e (basis, coeff, f, Imp::AllTrueBitSetVector(), │ │ │ │ +_H_i_e_r_a_r_c_h_i_c_N_o_d_e_T_o_R_a_n_g_e_M_a_p()); │ │ │ │ +302} │ │ │ │ +303 │ │ │ │ +304} // namespace Functions │ │ │ │ +305} // namespace Dune │ │ │ │ +306 │ │ │ │ +307#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH │ │ │ │ +_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h │ │ │ │ +_i_s_t_l_v_e_c_t_o_r_b_a_c_k_e_n_d_._h_h │ │ │ │ +_g_r_i_d_v_i_e_w_f_u_n_c_t_i_o_n_._h_h │ │ │ │ +_f_l_a_t_v_e_c_t_o_r_v_i_e_w_._h_h │ │ │ │ +_h_i_e_r_a_r_c_h_i_c_n_o_d_e_t_o_r_a_n_g_e_m_a_p_._h_h │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const │ │ │ │ TrigonometricFunction< K, sinFactor, cosFactor > &f) │ │ │ │ Obtain derivative of TrigonometricFunction function. │ │ │ │ DDeeffiinniittiioonn trigonometricfunction.hh:43 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_B_a_s_i_s │ │ │ │ -DefaultGlobalBasis< ArgyrisPreBasis< GV, R > > ArgyrisBasis │ │ │ │ -Nodal basis of a scalar cubic Argyris finite element space. │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:69 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d │ │ │ │ +auto istlVectorBackend(Vector &v) │ │ │ │ +Return a vector backend wrapping non-const ISTL like containers. │ │ │ │ +DDeeffiinniittiioonn istlvectorbackend.hh:350 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_C_a_l_l_a_b_l_e │ │ │ │ +static constexpr auto isCallable() │ │ │ │ +Check if f is callable with given argument list. │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:51 │ │ │ │ +_D_u_n_e │ │ │ │ +DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_i_n_t_e_r_p_o_l_a_t_e │ │ │ │ void interpolate(const B &basis, C &&coeff, const F &f, const BV &bv, const │ │ │ │ NTRE &nodeToRangeEntry) │ │ │ │ Interpolate given function in discrete function space. │ │ │ │ DDeeffiinniittiioonn interpolate.hh:205 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:926 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_n_o_m_i_a_l_S_e_t │ │ │ │ -Function, which evaluates all monomials up to degree maxDegree in a given │ │ │ │ -coordinate. │ │ │ │ -DDeeffiinniittiioonn monomialset.hh:64 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_P_r_e_B_a_s_i_s │ │ │ │ -A pre-basis for a Argyrisbasis. │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:856 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_:_:_v_e_r_t_e_x_M_a_p_p_e_r__ │ │ │ │ -SubEntityMapper vertexMapper_ │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:918 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_:_:_e_l_e_m_e_n_t_M_a_p_p_e_r__ │ │ │ │ -SubEntityMapper elementMapper_ │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:920 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_:_:_e_d_g_e_O_r_i_e_n_t_a_t_i_o_n_s__ │ │ │ │ -std::vector< std::bitset< 3 > > edgeOrientations_ │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:921 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_:_:_m_a_k_e_N_o_d_e │ │ │ │ -Node makeNode() const │ │ │ │ -Create tree node. │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:911 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ -GV GridView │ │ │ │ -The grid view that the FE basis is defined on. │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:880 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_:_:_a_v_e_r_a_g_e_V_e_r_t_e_x_M_e_s_h_S_i_z_e__ │ │ │ │ -std::vector< D > averageVertexMeshSize_ │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:919 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_:_:_N_o_d_e │ │ │ │ -ArgyrisNode< GridView, R > Node │ │ │ │ -Template mapping root tree path to type of created tree node. │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:886 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_:_:_u_p_d_a_t_e │ │ │ │ -void update(GridView const &gv) │ │ │ │ -Update the stored grid view, to be called if the grid has changed. │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:901 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_:_:_A_r_g_y_r_i_s_P_r_e_B_a_s_i_s │ │ │ │ -ArgyrisPreBasis(const GV &gv) │ │ │ │ -Constructor for a given grid view object. │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:891 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -Type used for indices and size information. │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:883 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_N_o_d_e │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:786 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_N_o_d_e_<_ _G_r_i_d_V_i_e_w_,_ _R_ _>_:_:_a_v_e_r_a_g_e_V_e_r_t_e_x_M_e_s_h_S_i_z_e__ │ │ │ │ -std::vector< typename GridView::ctype > const * averageVertexMeshSize_ │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:839 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_N_o_d_e_:_:_b_i_n_d │ │ │ │ -void bind(Element const &e) │ │ │ │ -Bind to element. │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:821 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_N_o_d_e_<_ _G_r_i_d_V_i_e_w_,_ _R_ _>_:_:_e_d_g_e_O_r_i_e_n_t_a_t_i_o_n__ │ │ │ │ -std::vector< std::bitset< 3 > > const * edgeOrientation_ │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:840 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_N_o_d_e_:_:_F_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ -typename Impl::ArgyrisLocalFiniteElement< typename GV::ctype, R > FiniteElement │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:792 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_N_o_d_e_:_:_e_l_e_m_e_n_t │ │ │ │ -Element const & element() const │ │ │ │ -Return current element, throw if unbound. │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:805 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_N_o_d_e_:_:_s_i_z_e___t_y_p_e │ │ │ │ -std::size_t size_type │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:790 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_N_o_d_e_<_ _G_r_i_d_V_i_e_w_,_ _R_ _>_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t__ │ │ │ │ -FiniteElement finiteElement_ │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:835 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_N_o_d_e_:_:_A_r_g_y_r_i_s_N_o_d_e │ │ │ │ -ArgyrisNode(Mapper const &vertexMapper, Mapper const &elementMapper, std:: │ │ │ │ -vector< typename GV::ctype > const &averageVertexMeshSize, std::vector< std:: │ │ │ │ -bitset< 3 > > const &edgeOrientation) │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:794 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_N_o_d_e_<_ _G_r_i_d_V_i_e_w_,_ _R_ _>_:_:_e_l_e_m_e_n_t_M_a_p_p_e_r__ │ │ │ │ -Mapper const * elementMapper_ │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:838 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ -FiniteElement const & finiteElement() const │ │ │ │ -Return the LocalFiniteElement for the element we are bound to. │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:815 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_N_o_d_e_<_ _G_r_i_d_V_i_e_w_,_ _R_ _>_:_:_v_e_r_t_e_x_M_a_p_p_e_r__ │ │ │ │ -Mapper const * vertexMapper_ │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:837 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_N_o_d_e_:_:_o_r_d_e_r │ │ │ │ -unsigned int order() const │ │ │ │ -The order of the local basis. │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:832 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_N_o_d_e_<_ _G_r_i_d_V_i_e_w_,_ _R_ _>_:_:_e_l_e_m_e_n_t__ │ │ │ │ -Element const * element_ │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:836 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_N_o_d_e_:_:_E_l_e_m_e_n_t │ │ │ │ -typename GV::template Codim< 0 >::Entity Element │ │ │ │ -DDeeffiinniittiioonn argyrisbasis.hh:791 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_2_L_o_c_a_l_B_a_s_i_s_T_r_a_i_t_s │ │ │ │ -DDeeffiinniittiioonn cubichermitebasis.hh:84 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ -Global basis for given pre-basis. │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:53 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_g_r_i_d_V_i_e_w │ │ │ │ -const GridView & gridView() const │ │ │ │ -Export the stored GridView. │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:95 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_u_p_d_a_t_e │ │ │ │ -void update(const GridView &gv) │ │ │ │ -Update the stored GridView. │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:101 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n │ │ │ │ -LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout) │ │ │ │ -Construct from GridView and local DOF layout. │ │ │ │ -DDeeffiinniittiioonn leafprebasismappermixin.hh:74 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_e_t_S_i_z_e │ │ │ │ -void setSize(const size_type size) │ │ │ │ -DDeeffiinniittiioonn nodes.hh:197 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ -DDeeffiinniittiioonn nodes.hh:218 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ +std::decay_t< F > makeGridViewFunction(F &&f, const GridView &gridView) │ │ │ │ +Construct a function modeling GridViewFunction from function and grid view. │ │ │ │ +DDeeffiinniittiioonn gridviewfunction.hh:72 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_o_r_w_a_r_d_C_a_p_t_u_r_e │ │ │ │ +auto forwardCapture(T &&t) │ │ │ │ +Create a capture object for perfect forwarding. │ │ │ │ +DDeeffiinniittiioonn utility.hh:380 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_N_o_d_e_T_o_R_a_n_g_e_M_a_p │ │ │ │ +A simple node to range map using the nested tree indices. │ │ │ │ +DDeeffiinniittiioonn hierarchicnodetorangemap.hh:34 │ │ │ │ +_c_o_n_c_e_p_t_s_._h_h │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ - * _a_r_g_y_r_i_s_b_a_s_i_s_._h_h │ │ │ │ + * _i_n_t_e_r_p_o_l_a_t_e_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00194.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: utility.hh File Reference │ │ │ +Dune-Functions: lfeprebasismixin.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,86 +88,55 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
utility.hh File Reference
│ │ │ +
lfeprebasismixin.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <utility>
│ │ │ +
#include <cassert>
│ │ │ #include <type_traits>
│ │ │ -#include <dune/common/overloadset.hh>
│ │ │ -#include <dune/common/indices.hh>
│ │ │ -#include <dune/functions/common/functionconcepts.hh>
│ │ │ +#include <dune/common/exceptions.hh>
│ │ │ +#include <dune/functions/functionspacebases/leafprebasismappermixin.hh>
│ │ │ +#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ +#include <dune/grid/common/mcmgmapper.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

struct  Dune::Functions::LastType< T >
 Get last entry of type list. More...
struct  Dune::Functions::RotateTuple< T >
 Rotate type list by one, such that last entry is moved to first position. More...
class  Dune::Functions::LFEPreBasisMixin< GV, LFE >
 A pre-basis mixin class parametrized with a local finite-element and a DOF layout. More...
class  Dune::Functions::LFEPreBasisMixin< GV, LFE >::Node
 Leaf basis node that encapsulates a local finite-element given from the LFEPreBasisMixin of type LFE. More...
│ │ │ │ │ │ │ │ │ │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -

│ │ │ -Typedefs

template<template< class... > class T, class ArgTuple>
using Dune::Functions::ExpandTuple = typename Imp::ExpandTupleHelper<T, ArgTuple>::Type
 Expand tuple arguments as template arguments.
template<template< class... > class F, class... Tuples>
using Dune::Functions::TransformTuple = typename Imp::TransformTupleHelper<F, Tuples...>::Type
 Transform tuple types argument using type-functor.
template<class IntegerSequence>
using Dune::Functions::IntegerSequenceTuple = typename Imp::IntegerSequenceTupleHelper<IntegerSequence>::Type
 Transform integer_sequence<I,k...> to tuple<integral_constant<I,k>...>.
│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │

│ │ │ Functions

template<class F, class size_type, size_type firstValue, class... Args>
auto Dune::Functions::forwardAsStaticInteger (std::integer_sequence< size_type, firstValue > values, const size_type &i, F &&f, Args &&... args) -> decltype(f(std::integral_constant< size_type, firstValue >(), std::forward< Args >(args)...))
template<class F, class size_type, size_type firstValue, size_type secondValue, size_type... otherValues, class... Args>
auto Dune::Functions::forwardAsStaticInteger (std::integer_sequence< size_type, firstValue, secondValue, otherValues... > values, const size_type i, F &&f, Args &&... args) -> decltype(f(std::integral_constant< size_type, firstValue >(), std::forward< Args >(args)...))
template<std::size_t end, class F, class size_type, class... Args>
auto Dune::Functions::forwardAsStaticIndex (const size_type &i, F &&f, Args &&... args) -> decltype(f(Dune::Indices::_0, std::forward< Args >(args)...))
 Transform dynamic index to static index_constant.
template<class F, class... T>
auto Dune::Functions::transformTuple (F &&f, const std::tuple< T... > &tuple) -> decltype(Imp::transformTupleHelper(std::forward< F >(f), tuple, std::index_sequence_for< T... >{}))
 Transform tuple value using a functor.
template<class F, class... T1, class... T2>
auto Dune::Functions::transformTuple (F &&f, const std::tuple< T1... > &tuple1, const std::tuple< T2... > &tuple2) -> decltype(Imp::transformTupleHelper(std::forward< F >(f), tuple1, tuple2, std::index_sequence_for< T1... >{}))
 Transform tuple value using a binary functor.
template<class Expression>
auto Dune::Functions::callableCheck (Expression f)
 Create a predicate for checking validity of expressions.
template<class Check>
auto Dune::Functions::negatePredicate (Check check)
 Negate given predicate.
template<class T>
auto Dune::Functions::forwardCapture (T &&t)
 Create a capture object for perfect forwarding.
template<class GV, class LFE>
 Dune::Functions::LFEPreBasisMixin (const GV &, const LFE &, MCMGLayout) -> LFEPreBasisMixin< GV, LFE >
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,76 +1,31 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -utility.hh File Reference │ │ │ │ -#include │ │ │ │ +lfeprebasismixin.hh File Reference │ │ │ │ +#include │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ +#include │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_s_t_T_y_p_e_<_ _T_ _> │ │ │ │ -  Get last entry of type list. _M_o_r_e_._._. │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_o_t_a_t_e_T_u_p_l_e_<_ _T_ _> │ │ │ │ -  Rotate type list by one, such that last entry is moved to first │ │ │ │ - position. _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_<_ _G_V_,_ _L_F_E_ _> │ │ │ │ +  A pre-basis mixin class parametrized with a local finite-element and a │ │ │ │ + DOF layout. _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_<_ _G_V_,_ _L_F_E_ _>_:_:_N_o_d_e │ │ │ │ +  Leaf basis node that encapsulates a local finite-element given from the │ │ │ │ + _L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n of type LFE. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -TTyyppeeddeeffss │ │ │ │ -template class T, class ArgTuple> │ │ │ │ -using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_a_n_d_T_u_p_l_e = typename Imp::ExpandTupleHelper::Type │ │ │ │ -  Expand tuple arguments as template arguments. │ │ │ │ -template class F, class... Tuples> │ │ │ │ -using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_a_n_s_f_o_r_m_T_u_p_l_e = typename Imp::TransformTupleHelper::Type │ │ │ │ -  Transform tuple types argument using type-functor. │ │ │ │ -template │ │ │ │ -using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_n_t_e_g_e_r_S_e_q_u_e_n_c_e_T_u_p_l_e = typename Imp:: │ │ │ │ - IntegerSequenceTupleHelper::Type │ │ │ │ -  Transform integer_sequence to tuple...>. │ │ │ │ FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_o_r_w_a_r_d_A_s_S_t_a_t_i_c_I_n_t_e_g_e_r (std::integer_sequence< │ │ │ │ - size_type, firstValue > values, const size_type &i, F &&f, Args &&... │ │ │ │ - args) -> decltype(f(std::integral_constant< size_type, firstValue >(), │ │ │ │ - std::forward< Args >(args)...)) │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_o_r_w_a_r_d_A_s_S_t_a_t_i_c_I_n_t_e_g_e_r (std::integer_sequence< │ │ │ │ - size_type, firstValue, secondValue, otherValues... > values, const │ │ │ │ - size_type i, F &&f, Args &&... args) -> decltype(f(std:: │ │ │ │ - integral_constant< size_type, firstValue >(), std::forward< Args > │ │ │ │ - (args)...)) │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_o_r_w_a_r_d_A_s_S_t_a_t_i_c_I_n_d_e_x (const size_type &i, F &&f, Args │ │ │ │ - &&... args) -> decltype(f(Dune::Indices::_0, std::forward< Args > │ │ │ │ - (args)...)) │ │ │ │ -  Transform dynamic index to static index_constant. │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_t_r_a_n_s_f_o_r_m_T_u_p_l_e (F &&f, const std::tuple< T... > &tuple) │ │ │ │ - -> decltype(Imp::transformTupleHelper(std::forward< F >(f), tuple, std:: │ │ │ │ - index_sequence_for< T... >{})) │ │ │ │ -  Transform tuple value using a functor. │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_t_r_a_n_s_f_o_r_m_T_u_p_l_e (F &&f, const std::tuple< T1... > │ │ │ │ - &tuple1, const std::tuple< T2... > &tuple2) -> decltype(Imp:: │ │ │ │ - transformTupleHelper(std::forward< F >(f), tuple1, tuple2, std:: │ │ │ │ - index_sequence_for< T1... >{})) │ │ │ │ -  Transform tuple value using a binary functor. │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_a_l_l_a_b_l_e_C_h_e_c_k (Expression f) │ │ │ │ -  Create a predicate for checking validity of expressions. │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_n_e_g_a_t_e_P_r_e_d_i_c_a_t_e (Check check) │ │ │ │ -  Negate given predicate. │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_o_r_w_a_r_d_C_a_p_t_u_r_e (T &&t) │ │ │ │ -  Create a capture object for perfect forwarding. │ │ │ │ +template │ │ │ │ +  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n (const GV &, const LFE &, MCMGLayout) - │ │ │ │ + > LFEPreBasisMixin< GV, LFE > │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _u_t_i_l_i_t_y_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _l_f_e_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00194.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,13 +1,4 @@ │ │ │ │ var a00194 = [ │ │ │ │ - ["Dune::Functions::ExpandTuple", "a00314.html#gaf9c566ddbb17d4d1abfc40d9eafb3576", null], │ │ │ │ - ["Dune::Functions::IntegerSequenceTuple", "a00318.html#aec76d4de05a86d2129387dfa1c04144f", null], │ │ │ │ - ["Dune::Functions::TransformTuple", "a00314.html#gacfec4e0dd3d886f4faf60580412f5951", null], │ │ │ │ - ["Dune::Functions::callableCheck", "a00314.html#ga7d55c56e78792c4b169c18d875a60935", null], │ │ │ │ - ["Dune::Functions::forwardAsStaticIndex", "a00314.html#gac7d45de6c68fce943e6924403389d234", null], │ │ │ │ - ["Dune::Functions::forwardAsStaticInteger", "a00318.html#a84f8a9700ef8b12973e210ee4674c2b7", null], │ │ │ │ - ["Dune::Functions::forwardAsStaticInteger", "a00318.html#a4e975086fb37cbf3e33cc42a2b4ef1e2", null], │ │ │ │ - ["Dune::Functions::forwardCapture", "a00318.html#a6bb3a351c2ab1b4eb46d4ba1ec3d95a0", null], │ │ │ │ - ["Dune::Functions::negatePredicate", "a00314.html#gaed02f0c6f78e0d71e09d9bc6a29347c4", null], │ │ │ │ - ["Dune::Functions::transformTuple", "a00314.html#ga4e5fbe8e1330cdfab9eddd5962682b4c", null], │ │ │ │ - ["Dune::Functions::transformTuple", "a00314.html#gae663a5bfd683c8a0844bb974807d8f52", null] │ │ │ │ + ["Dune::Functions::LFEPreBasisMixin< GV, LFE >::Node", "a01954.html", "a01954"], │ │ │ │ + ["Dune::Functions::LFEPreBasisMixin", "a00318.html#af37105e3e3c8d996b2a3551286f01be9", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00194_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: utility.hh Source File │ │ │ +Dune-Functions: lfeprebasismixin.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,316 +88,167 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
utility.hh
│ │ │ +
lfeprebasismixin.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_COMMON_UTILITY_HH
│ │ │ -
8#define DUNE_FUNCTIONS_COMMON_UTILITY_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LFEPREBASISMIXIN_HH
│ │ │ +
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LFEPREBASISMIXIN_HH
│ │ │
9
│ │ │ -
10
│ │ │ -
11#include <utility>
│ │ │ -
12#include <type_traits>
│ │ │ -
13
│ │ │ -
14#include <dune/common/overloadset.hh>
│ │ │ -
15#include <dune/common/indices.hh>
│ │ │ -
16
│ │ │ - │ │ │ -
18
│ │ │ -
19namespace Dune {
│ │ │ -
20namespace Functions {
│ │ │ -
21
│ │ │ -
22
│ │ │ -
23template<class F, class size_type, size_type firstValue, class... Args>
│ │ │ -
24[[deprecated("This function will be removed after Dune 2.11")]]
│ │ │ -
│ │ │ -
25auto forwardAsStaticInteger(std::integer_sequence<size_type, firstValue> values, const size_type& i, F&& f, Args&&... args)
│ │ │ -
26 ->decltype(f(std::integral_constant<size_type, firstValue>(), std::forward<Args>(args)...))
│ │ │ -
27{
│ │ │ -
28 return f(std::integral_constant<size_type, firstValue>(), std::forward<Args>(args)...);
│ │ │ -
29}
│ │ │ -
│ │ │ -
30
│ │ │ -
31template<class F, class size_type, size_type firstValue, size_type secondValue, size_type... otherValues, class... Args>
│ │ │ -
32[[deprecated("This function will be removed after Dune 2.11")]]
│ │ │ -
│ │ │ -
33auto forwardAsStaticInteger(std::integer_sequence<size_type, firstValue, secondValue, otherValues...> values, const size_type i, F&& f, Args&&... args)
│ │ │ -
34 ->decltype(f(std::integral_constant<size_type, firstValue>(), std::forward<Args>(args)...))
│ │ │ -
35{
│ │ │ -
36 if (i==firstValue)
│ │ │ -
37 return f(std::integral_constant<size_type, firstValue>(), std::forward<Args>(args)...);
│ │ │ -
38 return forwardAsStaticInteger(std::integer_sequence<size_type, secondValue, otherValues...>(), i, std::forward<F>(f), std::forward<Args>(args)...);
│ │ │ -
39}
│ │ │ -
│ │ │ -
40
│ │ │ -
41
│ │ │ -
42
│ │ │ -
66template<std::size_t end, class F, class size_type, class... Args>
│ │ │ -
67[[deprecated("This function will be removed after Dune 2.11, use Dune::Hybrid::switchCases.")]]
│ │ │ -
│ │ │ -
68auto forwardAsStaticIndex(const size_type& i, F&& f, Args&&... args)
│ │ │ -
69 ->decltype(f(Dune::Indices::_0, std::forward<Args>(args)...))
│ │ │ -
70{
│ │ │ -
71 return forwardAsStaticInteger(std::make_index_sequence<end>{}, i, std::forward<F>(f), std::forward<Args>(args)...);
│ │ │ -
72}
│ │ │ -
│ │ │ -
73
│ │ │ -
74
│ │ │ -
75
│ │ │ -
76namespace Imp {
│ │ │ -
77
│ │ │ -
78 template<template<class...> class T, class List>
│ │ │ -
79 struct ExpandTupleHelper
│ │ │ -
80 {};
│ │ │ -
81
│ │ │ -
82 template<template<class...> class T, template<class...> class ListType, class... Args>
│ │ │ -
83 struct ExpandTupleHelper<T, ListType<Args...>>
│ │ │ -
84 {
│ │ │ -
85 using Type = T<Args...>;
│ │ │ -
86 };
│ │ │ -
87
│ │ │ -
88} // end namespace Imp
│ │ │ -
89
│ │ │ -
101template<template<class...> class T, class ArgTuple>
│ │ │ -
102using ExpandTuple = typename Imp::ExpandTupleHelper<T, ArgTuple>::Type;
│ │ │ -
103
│ │ │ -
104
│ │ │ +
10#include <cassert>
│ │ │ +
11#include <type_traits>
│ │ │ +
12
│ │ │ +
13#include <dune/common/exceptions.hh>
│ │ │ +
14
│ │ │ + │ │ │ + │ │ │ +
17
│ │ │ +
18#include <dune/grid/common/mcmgmapper.hh>
│ │ │ +
19
│ │ │ +
20namespace Dune::Functions {
│ │ │ +
21
│ │ │ +
54template <class GV, class LFE>
│ │ │ +
│ │ │ + │ │ │ +
56 public LeafPreBasisMapperMixin< GV >
│ │ │ +
57{
│ │ │ + │ │ │ +
59
│ │ │ +
60public:
│ │ │ +
61
│ │ │ +
63 using GridView = GV;
│ │ │ +
64
│ │ │ +
66 class Node;
│ │ │ +
67
│ │ │ +
73 template <class LFE_ = LFE,
│ │ │ +
74 std::enable_if_t<std::is_default_constructible_v<LFE_>, int> = 0>
│ │ │ +
│ │ │ +
75 LFEPreBasisMixin (const GridView& gv, MCMGLayout layout)
│ │ │ +
76 : Base(gv, layout)
│ │ │ +
77 , lfe_{}
│ │ │ +
78 {}
│ │ │ +
│ │ │ +
79
│ │ │ +
85 template <class LFE_>
│ │ │ +
│ │ │ +
86 LFEPreBasisMixin (const GridView& gv, LFE_&& lfe, MCMGLayout layout)
│ │ │ +
87 : Base(gv, layout)
│ │ │ +
88 , lfe_(std::forward<LFE_>(lfe))
│ │ │ +
89 {}
│ │ │ +
│ │ │ +
90
│ │ │ +
│ │ │ +
92 Node makeNode () const
│ │ │ +
93 {
│ │ │ +
94 return Node(lfe_);
│ │ │ +
95 }
│ │ │ +
│ │ │ +
96
│ │ │ +
97private:
│ │ │ +
98 LFE lfe_;
│ │ │ +
99};
│ │ │ +
│ │ │ +
100
│ │ │ +
101// deduction guide
│ │ │ +
102template <class GV, class LFE>
│ │ │ +
103LFEPreBasisMixin(const GV&, const LFE&, MCMGLayout)
│ │ │ + │ │ │
105
│ │ │ -
106namespace Imp {
│ │ │ -
107
│ │ │ -
108 template<template<class...> class T, class... Tuple>
│ │ │ -
109 struct TransformTupleHelper
│ │ │ -
110 {};
│ │ │ -
111
│ │ │ -
112 template<template<class...> class T, class... Args1>
│ │ │ -
113 struct TransformTupleHelper<T, typename std::tuple<Args1...>>
│ │ │ -
114 {
│ │ │ -
115 using Type = std::tuple<T<Args1>...>;
│ │ │ -
116 };
│ │ │ -
117
│ │ │ -
118 template<template<class...> class T, class... Args1, class... Args2>
│ │ │ -
119 struct TransformTupleHelper<T, typename std::tuple<Args1...>, typename std::tuple<Args2...>>
│ │ │ -
120 {
│ │ │ -
121 using Type = std::tuple<T<Args1, Args2>...>;
│ │ │ -
122 };
│ │ │ -
123
│ │ │ -
124} // end namespace Imp
│ │ │ -
125
│ │ │ -
138template<template<class...> class F, class... Tuples>
│ │ │ -
139using TransformTuple = typename Imp::TransformTupleHelper<F, Tuples...>::Type;
│ │ │ -
140
│ │ │ -
141
│ │ │ -
142
│ │ │ -
143namespace Imp {
│ │ │ -
144
│ │ │ -
145 template<class F, class... T, std::size_t... k>
│ │ │ -
146 auto transformTupleHelper(F&& f, const std::tuple<T...>& tuple, std::index_sequence<k...>)
│ │ │ -
147 -> decltype(std::make_tuple(f(std::get<k>(tuple))...))
│ │ │ -
148 {
│ │ │ -
149 return std::make_tuple(f(std::get<k>(tuple))...);
│ │ │ +
106
│ │ │ +
107
│ │ │ +
117template <class GV, class LFE>
│ │ │ +
│ │ │ +
118class LFEPreBasisMixin<GV,LFE>::Node
│ │ │ +
119 : public LeafBasisNode
│ │ │ +
120{
│ │ │ +
121 static constexpr int dim = GV::dimension;
│ │ │ +
122
│ │ │ +
123public:
│ │ │ +
124 using size_type = std::size_t;
│ │ │ +
125 using Element = typename GV::template Codim<0>::Entity;
│ │ │ +
126 using FiniteElement = LFE;
│ │ │ +
127
│ │ │ +
│ │ │ +
129 explicit Node (const LFE& lfe)
│ │ │ +
130 : lfe_{&lfe}
│ │ │ +
131 , element_{nullptr}
│ │ │ +
132 {}
│ │ │ +
│ │ │ +
133
│ │ │ +
│ │ │ +
135 const Element& element () const
│ │ │ +
136 {
│ │ │ +
137 assert(!!element_);
│ │ │ +
138 return *element_;
│ │ │ +
139 }
│ │ │ +
│ │ │ +
140
│ │ │ +
│ │ │ + │ │ │ +
147 {
│ │ │ +
148 assert(!!lfe_);
│ │ │ +
149 return *lfe_;
│ │ │
150 }
│ │ │ -
151
│ │ │ -
152 template<class F, class... T1, class...T2, std::size_t... k>
│ │ │ -
153 auto transformTupleHelper(F&& f, const std::tuple<T1...>& tuple1, const std::tuple<T2...>& tuple2, std::index_sequence<k...>)
│ │ │ -
154 -> decltype(std::make_tuple(f(std::get<k>(tuple1), std::get<k>(tuple2))...))
│ │ │ -
155 {
│ │ │ -
156 return std::make_tuple(f(std::get<k>(tuple1), std::get<k>(tuple2))...);
│ │ │ +
│ │ │ +
151
│ │ │ +
│ │ │ +
153 void bind (const Element& e)
│ │ │ +
154 {
│ │ │ +
155 element_ = &e;
│ │ │ +
156 this->setSize(lfe_->size());
│ │ │
157 }
│ │ │ +
│ │ │
158
│ │ │ -
159} // end namespace Imp
│ │ │ -
160
│ │ │ -
172template<class F, class... T>
│ │ │ -
│ │ │ -
173auto transformTuple(F&& f, const std::tuple<T...>& tuple)
│ │ │ -
174 -> decltype(Imp::transformTupleHelper(std::forward<F>(f), tuple, std::index_sequence_for<T...>{}))
│ │ │ -
175{
│ │ │ -
176 return Imp::transformTupleHelper(std::forward<F>(f), tuple, std::index_sequence_for<T...>{});
│ │ │ -
177}
│ │ │ -
│ │ │ -
178
│ │ │ -
192template<class F, class... T1, class... T2>
│ │ │ -
│ │ │ -
193auto transformTuple(F&& f, const std::tuple<T1...>& tuple1, const std::tuple<T2...>& tuple2)
│ │ │ -
194 -> decltype(Imp::transformTupleHelper(std::forward<F>(f), tuple1, tuple2, std::index_sequence_for<T1...>{}))
│ │ │ -
195{
│ │ │ -
196 return Imp::transformTupleHelper(std::forward<F>(f), tuple1, tuple2, std::index_sequence_for<T1...>{});
│ │ │ -
197}
│ │ │ -
│ │ │ -
198
│ │ │ -
199
│ │ │ -
200
│ │ │ -
201namespace Imp {
│ │ │ -
202
│ │ │ -
203 template<class IntegerSequence>
│ │ │ -
204 struct IntegerSequenceTupleHelper
│ │ │ -
205 {};
│ │ │ -
206
│ │ │ -
207 template<class I, I... k>
│ │ │ -
208 struct IntegerSequenceTupleHelper<std::integer_sequence<I, k...>>
│ │ │ -
209 {
│ │ │ -
210 using Type = std::tuple<std::integral_constant<I, k>...>;
│ │ │ -
211 };
│ │ │ -
212
│ │ │ -
213} // end namespace Imp
│ │ │ -
214
│ │ │ -
218template<class IntegerSequence>
│ │ │ -
219using IntegerSequenceTuple= typename Imp::IntegerSequenceTupleHelper<IntegerSequence>::Type;
│ │ │ -
220
│ │ │ -
221
│ │ │ -
222
│ │ │ -
228template<class... T>
│ │ │ -
│ │ │ - │ │ │ -
230{
│ │ │ -
231 using type = std::tuple_element_t<sizeof...(T)-1, std::tuple<T...>>;
│ │ │ -
232};
│ │ │ -
│ │ │ -
233
│ │ │ -
234
│ │ │ -
235
│ │ │ -
236namespace Imp {
│ │ │ -
237
│ │ │ -
238template<class T, class I>
│ │ │ -
239struct RotateHelper;
│ │ │ -
240
│ │ │ -
241template<class... T, std::size_t... I>
│ │ │ -
242struct RotateHelper<std::tuple<T...>, std::index_sequence<I...> >
│ │ │ -
243{
│ │ │ -
244 using type = typename std::tuple<typename LastType<T...>::type, std::tuple_element_t<I,std::tuple<T...>>...>;
│ │ │ -
245};
│ │ │ -
246
│ │ │ -
247} // end namespace Imp
│ │ │ -
248
│ │ │ -
249
│ │ │ -
257template<class... T>
│ │ │ -
│ │ │ - │ │ │ -
259{
│ │ │ -
260 using type = typename Imp::RotateHelper<std::tuple<T...>, std::make_index_sequence<sizeof...(T)-1>>::type;
│ │ │ -
261};
│ │ │ -
│ │ │ -
262
│ │ │ -
263
│ │ │ -
264
│ │ │ -
286template<class Expression>
│ │ │ -
│ │ │ -
287auto callableCheck(Expression f)
│ │ │ -
288{
│ │ │ -
289 return [f](auto&&... args){
│ │ │ -
290 return Functions::Concept::isCallable(f, std::forward<decltype(args)>(args)...);
│ │ │ -
291 };
│ │ │ -
292}
│ │ │ -
│ │ │ -
293
│ │ │ -
294
│ │ │ -
295
│ │ │ -
311template<class Check>
│ │ │ -
│ │ │ -
312auto negatePredicate(Check check)
│ │ │ -
313{
│ │ │ -
314 return [check](auto&&... args){
│ │ │ -
315 auto negate = overload(
│ │ │ -
316 [](std::true_type) { return std::false_type{};},
│ │ │ -
317 [](std::false_type) { return std::true_type{};},
│ │ │ -
318 [](bool v) { return not v;});
│ │ │ -
319 return negate(check(std::forward<decltype(args)>(args)...));
│ │ │ -
320 };
│ │ │ -
321}
│ │ │ -
│ │ │ -
322
│ │ │ -
323
│ │ │ -
324namespace Impl {
│ │ │ -
325
│ │ │ -
326 // Wrapper to capture values in a lambda for perfect forwarding.
│ │ │ -
327 // This captures value types by value and reference types by reference.
│ │ │ -
328 template <typename T>
│ │ │ -
329 struct ForwardCaptureWrapper;
│ │ │ -
330
│ │ │ -
331 template <typename T>
│ │ │ -
332 struct ForwardCaptureWrapper
│ │ │ -
333 {
│ │ │ -
334 template <typename TT>
│ │ │ -
335 ForwardCaptureWrapper(TT&& t) : t_{std::forward<TT>(t)} {}
│ │ │ -
336
│ │ │ -
337 auto forward() const { return std::move(t_); }
│ │ │ -
338
│ │ │ -
339 T t_;
│ │ │ -
340 };
│ │ │ -
341
│ │ │ -
342 template <typename T>
│ │ │ -
343 struct ForwardCaptureWrapper<T&>
│ │ │ -
344 {
│ │ │ -
345 ForwardCaptureWrapper(T& t) : t_{t} {}
│ │ │ -
346
│ │ │ -
347 T& forward() const { return t_; };
│ │ │ -
348
│ │ │ -
349 T& t_;
│ │ │ -
350 };
│ │ │ -
351
│ │ │ -
352 template <typename T>
│ │ │ -
353 struct ForwardCaptureWrapper<const T&>
│ │ │ -
354 {
│ │ │ -
355 ForwardCaptureWrapper(const T& t) : t_{t} {}
│ │ │ -
356
│ │ │ -
357 const T& forward() const { return t_; };
│ │ │ -
358
│ │ │ -
359 const T& t_;
│ │ │ -
360 };
│ │ │ -
361
│ │ │ -
362} // end namespace Dune::Functions::Impl
│ │ │ -
363
│ │ │ -
364
│ │ │ -
365
│ │ │ -
379template <class T>
│ │ │ -
│ │ │ -
380auto forwardCapture(T&& t)
│ │ │ -
381{
│ │ │ -
382 return Impl::ForwardCaptureWrapper<T>(std::forward<T>(t));
│ │ │ -
383}
│ │ │ -
│ │ │ -
384
│ │ │ -
385
│ │ │ -
386
│ │ │ -
387} // namespace Dune::Functions
│ │ │ -
388} // namespace Dune
│ │ │ -
389
│ │ │ -
390
│ │ │ -
391#endif // DUNE_FUNCTIONS_COMMON_UTILITY_HH
│ │ │ - │ │ │ -
static constexpr auto isCallable()
Check if f is callable with given argument list.
Definition functionconcepts.hh:51
│ │ │ -
auto transformTuple(F &&f, const std::tuple< T... > &tuple) -> decltype(Imp::transformTupleHelper(std::forward< F >(f), tuple, std::index_sequence_for< T... >{}))
Transform tuple value using a functor.
Definition utility.hh:173
│ │ │ -
auto callableCheck(Expression f)
Create a predicate for checking validity of expressions.
Definition utility.hh:287
│ │ │ -
auto forwardAsStaticIndex(const size_type &i, F &&f, Args &&... args) -> decltype(f(Dune::Indices::_0, std::forward< Args >(args)...))
Transform dynamic index to static index_constant.
Definition utility.hh:68
│ │ │ -
typename Imp::TransformTupleHelper< F, Tuples... >::Type TransformTuple
Transform tuple types argument using type-functor.
Definition utility.hh:139
│ │ │ -
auto negatePredicate(Check check)
Negate given predicate.
Definition utility.hh:312
│ │ │ -
typename Imp::ExpandTupleHelper< T, ArgTuple >::Type ExpandTuple
Expand tuple arguments as template arguments.
Definition utility.hh:102
│ │ │ -
Definition monomialset.hh:19
│ │ │ +
159protected:
│ │ │ + │ │ │ + │ │ │ +
162};
│ │ │ +
│ │ │ +
163
│ │ │ +
164
│ │ │ +
165} // end namespace Dune::Functions
│ │ │ +
166
│ │ │ +
167
│ │ │ +
168#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LFEPREBASISMIXIN_HH
│ │ │ + │ │ │ + │ │ │
Definition monomialset.hh:19
│ │ │ -
auto forwardCapture(T &&t)
Create a capture object for perfect forwarding.
Definition utility.hh:380
│ │ │ -
auto forwardAsStaticInteger(std::integer_sequence< size_type, firstValue > values, const size_type &i, F &&f, Args &&... args) -> decltype(f(std::integral_constant< size_type, firstValue >(), std::forward< Args >(args)...))
Definition utility.hh:25
│ │ │ -
typename Imp::IntegerSequenceTupleHelper< IntegerSequence >::Type IntegerSequenceTuple
Transform integer_sequence<I,k...> to tuple<integral_constant<I,k>...>.
Definition utility.hh:219
│ │ │ -
Get last entry of type list.
Definition utility.hh:230
│ │ │ -
std::tuple_element_t< sizeof...(T) -1, std::tuple< T... > > type
Definition utility.hh:231
│ │ │ -
Rotate type list by one, such that last entry is moved to first position.
Definition utility.hh:259
│ │ │ -
typename Imp::RotateHelper< std::tuple< T... >, std::make_index_sequence< sizeof...(T) -1 > >::type type
Definition utility.hh:260
│ │ │ +
LFEPreBasisMixin(const GV &, const LFE &, MCMGLayout) -> LFEPreBasisMixin< GV, LFE >
│ │ │ +
LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout)
Construct from GridView and local DOF layout.
Definition leafprebasismappermixin.hh:74
│ │ │ +
A pre-basis mixin class parametrized with a local finite-element and a DOF layout.
Definition lfeprebasismixin.hh:57
│ │ │ +
LFEPreBasisMixin(const GridView &gv, LFE_ &&lfe, MCMGLayout layout)
Constructor for a given grid view object, local finite-element and layout.
Definition lfeprebasismixin.hh:86
│ │ │ +
LFEPreBasisMixin(const GridView &gv, MCMGLayout layout)
Constructor for a given grid view object and layout.
Definition lfeprebasismixin.hh:75
│ │ │ +
Node makeNode() const
Create tree node.
Definition lfeprebasismixin.hh:92
│ │ │ + │ │ │ +
LFE FiniteElement
Definition lfeprebasismixin.hh:126
│ │ │ +
std::size_t size_type
Definition lfeprebasismixin.hh:124
│ │ │ +
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to; might raise an error if unbound.
Definition lfeprebasismixin.hh:146
│ │ │ +
const Element & element() const
Return current element; might raise an error if unbound.
Definition lfeprebasismixin.hh:135
│ │ │ +
const FiniteElement * lfe_
Definition lfeprebasismixin.hh:160
│ │ │ +
void bind(const Element &e)
Bind to element. Stores a pointer to the passed element reference.
Definition lfeprebasismixin.hh:153
│ │ │ +
Node(const LFE &lfe)
Constructor; stores a pointer to the passed local finite-element lfe.
Definition lfeprebasismixin.hh:129
│ │ │ +
typename GV::template Codim< 0 >::Entity Element
Definition lfeprebasismixin.hh:125
│ │ │ +
const Element * element_
Definition lfeprebasismixin.hh:161
│ │ │ +
void setSize(const size_type size)
Definition nodes.hh:197
│ │ │ +
Definition nodes.hh:218
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,358 +1,187 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -utility.hh │ │ │ │ +lfeprebasismixin.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_COMMON_UTILITY_HH │ │ │ │ -8#define DUNE_FUNCTIONS_COMMON_UTILITY_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LFEPREBASISMIXIN_HH │ │ │ │ +8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LFEPREBASISMIXIN_HH │ │ │ │ 9 │ │ │ │ -10 │ │ │ │ -11#include │ │ │ │ -12#include │ │ │ │ -13 │ │ │ │ -14#include │ │ │ │ -15#include │ │ │ │ -16 │ │ │ │ -17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ -18 │ │ │ │ -19namespace _D_u_n_e { │ │ │ │ -20namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ +12 │ │ │ │ +13#include │ │ │ │ +14 │ │ │ │ +15#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h> │ │ │ │ +16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ +17 │ │ │ │ +18#include │ │ │ │ +19 │ │ │ │ +20namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ 21 │ │ │ │ -22 │ │ │ │ -23template │ │ │ │ -24[[deprecated("This function will be removed after Dune 2.11")]] │ │ │ │ -_2_5auto _f_o_r_w_a_r_d_A_s_S_t_a_t_i_c_I_n_t_e_g_e_r(std::integer_sequence │ │ │ │ -values, const size_type& i, F&& f, Args&&... args) │ │ │ │ -26 ->decltype(f(std::integral_constant(), std:: │ │ │ │ -forward(args)...)) │ │ │ │ -27{ │ │ │ │ -28 return f(std::integral_constant(), std::forward │ │ │ │ -(args)...); │ │ │ │ -29} │ │ │ │ -30 │ │ │ │ -31template │ │ │ │ -32[[deprecated("This function will be removed after Dune 2.11")]] │ │ │ │ -_3_3auto _f_o_r_w_a_r_d_A_s_S_t_a_t_i_c_I_n_t_e_g_e_r(std::integer_sequence values, const size_type i, F&& f, Args&&... args) │ │ │ │ -34 ->decltype(f(std::integral_constant(), std:: │ │ │ │ -forward(args)...)) │ │ │ │ -35{ │ │ │ │ -36 if (i==firstValue) │ │ │ │ -37 return f(std::integral_constant(), std::forward │ │ │ │ -(args)...); │ │ │ │ -38 return _f_o_r_w_a_r_d_A_s_S_t_a_t_i_c_I_n_t_e_g_e_r(std::integer_sequence(), i, std::forward(f), std::forward(args)...); │ │ │ │ -39} │ │ │ │ -40 │ │ │ │ -41 │ │ │ │ -42 │ │ │ │ -66template │ │ │ │ -67[[deprecated("This function will be removed after Dune 2.11, use Dune:: │ │ │ │ -Hybrid::switchCases.")]] │ │ │ │ -_6_8auto _f_o_r_w_a_r_d_A_s_S_t_a_t_i_c_I_n_d_e_x(const size_type& i, F&& f, Args&&... args) │ │ │ │ -69 ->decltype(f(Dune::Indices::_0, std::forward(args)...)) │ │ │ │ -70{ │ │ │ │ -71 return _f_o_r_w_a_r_d_A_s_S_t_a_t_i_c_I_n_t_e_g_e_r(std::make_index_sequence{}, i, std:: │ │ │ │ -forward(f), std::forward(args)...); │ │ │ │ -72} │ │ │ │ -73 │ │ │ │ -74 │ │ │ │ -75 │ │ │ │ -76namespace Imp { │ │ │ │ -77 │ │ │ │ -78 template class T, class List> │ │ │ │ -79 struct ExpandTupleHelper │ │ │ │ -80 {}; │ │ │ │ -81 │ │ │ │ -82 template class T, template class ListType, │ │ │ │ -class... Args> │ │ │ │ -83 struct ExpandTupleHelper> │ │ │ │ -84 { │ │ │ │ -85 using Type = T; │ │ │ │ -86 }; │ │ │ │ -87 │ │ │ │ -88} // end namespace Imp │ │ │ │ -89 │ │ │ │ -101template class T, class ArgTuple> │ │ │ │ -_1_0_2using _E_x_p_a_n_d_T_u_p_l_e = typename Imp::ExpandTupleHelper::Type; │ │ │ │ -103 │ │ │ │ -104 │ │ │ │ +54template │ │ │ │ +_5_5class _L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n : │ │ │ │ +56 public _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n< GV > │ │ │ │ +57{ │ │ │ │ +58 using Base = _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_<_ _G_V_ _>; │ │ │ │ +59 │ │ │ │ +60public: │ │ │ │ +61 │ │ │ │ +_6_3 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ +64 │ │ │ │ +66 class Node; │ │ │ │ +67 │ │ │ │ +73 template , int> = 0> │ │ │ │ +_7_5 _L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n (const _G_r_i_d_V_i_e_w& gv, MCMGLayout layout) │ │ │ │ +76 : Base(gv, layout) │ │ │ │ +77 , lfe_{} │ │ │ │ +78 {} │ │ │ │ +79 │ │ │ │ +85 template │ │ │ │ +_8_6 _L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n (const _G_r_i_d_V_i_e_w& gv, LFE_&& lfe, MCMGLayout layout) │ │ │ │ +87 : Base(gv, layout) │ │ │ │ +88 , lfe_(std::forward(lfe)) │ │ │ │ +89 {} │ │ │ │ +90 │ │ │ │ +_9_2 Node _m_a_k_e_N_o_d_e () const │ │ │ │ +93 { │ │ │ │ +94 return Node(lfe_); │ │ │ │ +95 } │ │ │ │ +96 │ │ │ │ +97private: │ │ │ │ +98 LFE lfe_; │ │ │ │ +99}; │ │ │ │ +100 │ │ │ │ +101// deduction guide │ │ │ │ +102template │ │ │ │ +_1_0_3_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n(const GV&, const LFE&, MCMGLayout) │ │ │ │ +104 -> _L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_<_G_V_,_L_F_E_>; │ │ │ │ 105 │ │ │ │ -106namespace Imp { │ │ │ │ +106 │ │ │ │ 107 │ │ │ │ -108 template class T, class... Tuple> │ │ │ │ -109 struct TransformTupleHelper │ │ │ │ -110 {}; │ │ │ │ -111 │ │ │ │ -112 template class T, class... Args1> │ │ │ │ -113 struct TransformTupleHelper> │ │ │ │ -114 { │ │ │ │ -115 using Type = std::tuple...>; │ │ │ │ -116 }; │ │ │ │ -117 │ │ │ │ -118 template class T, class... Args1, class... Args2> │ │ │ │ -119 struct TransformTupleHelper, typename │ │ │ │ -std::tuple> │ │ │ │ -120 { │ │ │ │ -121 using Type = std::tuple...>; │ │ │ │ -122 }; │ │ │ │ -123 │ │ │ │ -124} // end namespace Imp │ │ │ │ -125 │ │ │ │ -138template class F, class... Tuples> │ │ │ │ -_1_3_9using _T_r_a_n_s_f_o_r_m_T_u_p_l_e = typename Imp::TransformTupleHelper:: │ │ │ │ -Type; │ │ │ │ +117template │ │ │ │ +_1_1_8class _L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n::_N_o_d_e │ │ │ │ +119 : public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ +120{ │ │ │ │ +121 static constexpr int dim = GV::dimension; │ │ │ │ +122 │ │ │ │ +123public: │ │ │ │ +_1_2_4 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ +_1_2_5 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ +_1_2_6 using _F_i_n_i_t_e_E_l_e_m_e_n_t = LFE; │ │ │ │ +127 │ │ │ │ +_1_2_9 explicit _N_o_d_e (const LFE& lfe) │ │ │ │ +130 : _l_f_e__{&lfe} │ │ │ │ +131 , _e_l_e_m_e_n_t__{nullptr} │ │ │ │ +132 {} │ │ │ │ +133 │ │ │ │ +_1_3_5 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t () const │ │ │ │ +136 { │ │ │ │ +137 assert(!!_e_l_e_m_e_n_t__); │ │ │ │ +138 return *_e_l_e_m_e_n_t__; │ │ │ │ +139 } │ │ │ │ 140 │ │ │ │ -141 │ │ │ │ -142 │ │ │ │ -143namespace Imp { │ │ │ │ -144 │ │ │ │ -145 template │ │ │ │ -146 auto transformTupleHelper(F&& f, const std::tuple& tuple, std:: │ │ │ │ -index_sequence) │ │ │ │ -147 -> decltype(std::make_tuple(f(std::get(tuple))...)) │ │ │ │ -148 { │ │ │ │ -149 return std::make_tuple(f(std::get(tuple))...); │ │ │ │ +_1_4_6 const _F_i_n_i_t_e_E_l_e_m_e_n_t& _f_i_n_i_t_e_E_l_e_m_e_n_t () const │ │ │ │ +147 { │ │ │ │ +148 assert(!!_l_f_e__); │ │ │ │ +149 return *_l_f_e__; │ │ │ │ 150 } │ │ │ │ 151 │ │ │ │ -152 template │ │ │ │ -153 auto transformTupleHelper(F&& f, const std::tuple& tuple1, const │ │ │ │ -std::tuple& tuple2, std::index_sequence) │ │ │ │ -154 -> decltype(std::make_tuple(f(std::get(tuple1), std::get │ │ │ │ -(tuple2))...)) │ │ │ │ -155 { │ │ │ │ -156 return std::make_tuple(f(std::get(tuple1), std::get(tuple2))...); │ │ │ │ +_1_5_3 void _b_i_n_d (const _E_l_e_m_e_n_t& e) │ │ │ │ +154 { │ │ │ │ +155 _e_l_e_m_e_n_t__ = &e; │ │ │ │ +156 this->_s_e_t_S_i_z_e(_l_f_e__->size()); │ │ │ │ 157 } │ │ │ │ 158 │ │ │ │ -159} // end namespace Imp │ │ │ │ -160 │ │ │ │ -172template │ │ │ │ -_1_7_3auto _t_r_a_n_s_f_o_r_m_T_u_p_l_e(F&& f, const std::tuple& tuple) │ │ │ │ -174 -> decltype(Imp::transformTupleHelper(std::forward(f), tuple, std:: │ │ │ │ -index_sequence_for{})) │ │ │ │ -175{ │ │ │ │ -176 return Imp::transformTupleHelper(std::forward(f), tuple, std:: │ │ │ │ -index_sequence_for{}); │ │ │ │ -177} │ │ │ │ -178 │ │ │ │ -192template │ │ │ │ -_1_9_3auto _t_r_a_n_s_f_o_r_m_T_u_p_l_e(F&& f, const std::tuple& tuple1, const std:: │ │ │ │ -tuple& tuple2) │ │ │ │ -194 -> decltype(Imp::transformTupleHelper(std::forward(f), tuple1, tuple2, │ │ │ │ -std::index_sequence_for{})) │ │ │ │ -195{ │ │ │ │ -196 return Imp::transformTupleHelper(std::forward(f), tuple1, tuple2, std:: │ │ │ │ -index_sequence_for{}); │ │ │ │ -197} │ │ │ │ -198 │ │ │ │ -199 │ │ │ │ -200 │ │ │ │ -201namespace Imp { │ │ │ │ -202 │ │ │ │ -203 template │ │ │ │ -204 struct IntegerSequenceTupleHelper │ │ │ │ -205 {}; │ │ │ │ -206 │ │ │ │ -207 template │ │ │ │ -208 struct IntegerSequenceTupleHelper> │ │ │ │ -209 { │ │ │ │ -210 using Type = std::tuple...>; │ │ │ │ -211 }; │ │ │ │ -212 │ │ │ │ -213} // end namespace Imp │ │ │ │ -214 │ │ │ │ -218template │ │ │ │ -_2_1_9using _I_n_t_e_g_e_r_S_e_q_u_e_n_c_e_T_u_p_l_e= typename Imp:: │ │ │ │ -IntegerSequenceTupleHelper::Type; │ │ │ │ -220 │ │ │ │ -221 │ │ │ │ -222 │ │ │ │ -228template │ │ │ │ -_2_2_9struct _L_a_s_t_T_y_p_e │ │ │ │ -230{ │ │ │ │ -_2_3_1 using _t_y_p_e = std::tuple_element_t>; │ │ │ │ -232}; │ │ │ │ -233 │ │ │ │ -234 │ │ │ │ -235 │ │ │ │ -236namespace Imp { │ │ │ │ -237 │ │ │ │ -238template │ │ │ │ -239struct RotateHelper; │ │ │ │ -240 │ │ │ │ -241template │ │ │ │ -242struct RotateHelper, std::index_sequence > │ │ │ │ -243{ │ │ │ │ -244 using type = typename std::tuple::type, std:: │ │ │ │ -tuple_element_t>...>; │ │ │ │ -245}; │ │ │ │ -246 │ │ │ │ -247} // end namespace Imp │ │ │ │ -248 │ │ │ │ -249 │ │ │ │ -257template │ │ │ │ -_2_5_8struct _R_o_t_a_t_e_T_u_p_l_e │ │ │ │ -259{ │ │ │ │ -_2_6_0 using _t_y_p_e = typename Imp::RotateHelper, std:: │ │ │ │ -make_index_sequence>_:_:_t_y_p_e; │ │ │ │ -261}; │ │ │ │ -262 │ │ │ │ -263 │ │ │ │ -264 │ │ │ │ -286template │ │ │ │ -_2_8_7auto _c_a_l_l_a_b_l_e_C_h_e_c_k(Expression f) │ │ │ │ -288{ │ │ │ │ -289 return [f](auto&&... args){ │ │ │ │ -290 return _F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_C_a_l_l_a_b_l_e(f, std::forward │ │ │ │ -(args)...); │ │ │ │ -291 }; │ │ │ │ -292} │ │ │ │ -293 │ │ │ │ -294 │ │ │ │ -295 │ │ │ │ -311template │ │ │ │ -_3_1_2auto _n_e_g_a_t_e_P_r_e_d_i_c_a_t_e(Check check) │ │ │ │ -313{ │ │ │ │ -314 return [check](auto&&... args){ │ │ │ │ -315 auto negate = overload( │ │ │ │ -316 [](std::true_type) { return std::false_type{};}, │ │ │ │ -317 [](std::false_type) { return std::true_type{};}, │ │ │ │ -318 [](bool v) { return not v;}); │ │ │ │ -319 return negate(check(std::forward(args)...)); │ │ │ │ -320 }; │ │ │ │ -321} │ │ │ │ -322 │ │ │ │ -323 │ │ │ │ -324namespace Impl { │ │ │ │ -325 │ │ │ │ -326 // Wrapper to capture values in a lambda for perfect forwarding. │ │ │ │ -327 // This captures value types by value and reference types by reference. │ │ │ │ -328 template │ │ │ │ -329 struct ForwardCaptureWrapper; │ │ │ │ -330 │ │ │ │ -331 template │ │ │ │ -332 struct ForwardCaptureWrapper │ │ │ │ -333 { │ │ │ │ -334 template │ │ │ │ -335 ForwardCaptureWrapper(TT&& t) : t_{std::forward(t)} {} │ │ │ │ -336 │ │ │ │ -337 auto forward() const { return std::move(t_); } │ │ │ │ -338 │ │ │ │ -339 T t_; │ │ │ │ -340 }; │ │ │ │ -341 │ │ │ │ -342 template │ │ │ │ -343 struct ForwardCaptureWrapper │ │ │ │ -344 { │ │ │ │ -345 ForwardCaptureWrapper(T& t) : t_{t} {} │ │ │ │ -346 │ │ │ │ -347 T& forward() const { return t_; }; │ │ │ │ -348 │ │ │ │ -349 T& t_; │ │ │ │ -350 }; │ │ │ │ -351 │ │ │ │ -352 template │ │ │ │ -353 struct ForwardCaptureWrapper │ │ │ │ -354 { │ │ │ │ -355 ForwardCaptureWrapper(const T& t) : t_{t} {} │ │ │ │ -356 │ │ │ │ -357 const T& forward() const { return t_; }; │ │ │ │ -358 │ │ │ │ -359 const T& t_; │ │ │ │ -360 }; │ │ │ │ -361 │ │ │ │ -362} // end namespace Dune::Functions::Impl │ │ │ │ -363 │ │ │ │ -364 │ │ │ │ -365 │ │ │ │ -379template │ │ │ │ -_3_8_0auto _f_o_r_w_a_r_d_C_a_p_t_u_r_e(T&& t) │ │ │ │ -381{ │ │ │ │ -382 return Impl::ForwardCaptureWrapper(std::forward(t)); │ │ │ │ -383} │ │ │ │ -384 │ │ │ │ -385 │ │ │ │ -386 │ │ │ │ -387} // namespace Dune::Functions │ │ │ │ -388} // namespace Dune │ │ │ │ -389 │ │ │ │ -390 │ │ │ │ -391#endif // DUNE_FUNCTIONS_COMMON_UTILITY_HH │ │ │ │ -_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_C_a_l_l_a_b_l_e │ │ │ │ -static constexpr auto isCallable() │ │ │ │ -Check if f is callable with given argument list. │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:51 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_t_r_a_n_s_f_o_r_m_T_u_p_l_e │ │ │ │ -auto transformTuple(F &&f, const std::tuple< T... > &tuple) -> decltype(Imp:: │ │ │ │ -transformTupleHelper(std::forward< F >(f), tuple, std::index_sequence_for< T... │ │ │ │ ->{})) │ │ │ │ -Transform tuple value using a functor. │ │ │ │ -DDeeffiinniittiioonn utility.hh:173 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_a_l_l_a_b_l_e_C_h_e_c_k │ │ │ │ -auto callableCheck(Expression f) │ │ │ │ -Create a predicate for checking validity of expressions. │ │ │ │ -DDeeffiinniittiioonn utility.hh:287 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_o_r_w_a_r_d_A_s_S_t_a_t_i_c_I_n_d_e_x │ │ │ │ -auto forwardAsStaticIndex(const size_type &i, F &&f, Args &&... args) - │ │ │ │ -> decltype(f(Dune::Indices::_0, std::forward< Args >(args)...)) │ │ │ │ -Transform dynamic index to static index_constant. │ │ │ │ -DDeeffiinniittiioonn utility.hh:68 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_a_n_s_f_o_r_m_T_u_p_l_e │ │ │ │ -typename Imp::TransformTupleHelper< F, Tuples... >::Type TransformTuple │ │ │ │ -Transform tuple types argument using type-functor. │ │ │ │ -DDeeffiinniittiioonn utility.hh:139 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_n_e_g_a_t_e_P_r_e_d_i_c_a_t_e │ │ │ │ -auto negatePredicate(Check check) │ │ │ │ -Negate given predicate. │ │ │ │ -DDeeffiinniittiioonn utility.hh:312 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_a_n_d_T_u_p_l_e │ │ │ │ -typename Imp::ExpandTupleHelper< T, ArgTuple >::Type ExpandTuple │ │ │ │ -Expand tuple arguments as template arguments. │ │ │ │ -DDeeffiinniittiioonn utility.hh:102 │ │ │ │ -_D_u_n_e │ │ │ │ -DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ +159protected: │ │ │ │ +_1_6_0 const _F_i_n_i_t_e_E_l_e_m_e_n_t* _l_f_e__; │ │ │ │ +_1_6_1 const _E_l_e_m_e_n_t* _e_l_e_m_e_n_t__; │ │ │ │ +162}; │ │ │ │ +163 │ │ │ │ +164 │ │ │ │ +165} // end namespace Dune::Functions │ │ │ │ +166 │ │ │ │ +167 │ │ │ │ +168#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LFEPREBASISMIXIN_HH │ │ │ │ +_n_o_d_e_s_._h_h │ │ │ │ +_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_o_r_w_a_r_d_C_a_p_t_u_r_e │ │ │ │ -auto forwardCapture(T &&t) │ │ │ │ -Create a capture object for perfect forwarding. │ │ │ │ -DDeeffiinniittiioonn utility.hh:380 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_o_r_w_a_r_d_A_s_S_t_a_t_i_c_I_n_t_e_g_e_r │ │ │ │ -auto forwardAsStaticInteger(std::integer_sequence< size_type, firstValue > │ │ │ │ -values, const size_type &i, F &&f, Args &&... args) -> decltype(f(std:: │ │ │ │ -integral_constant< size_type, firstValue >(), std::forward< Args >(args)...)) │ │ │ │ -DDeeffiinniittiioonn utility.hh:25 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_n_t_e_g_e_r_S_e_q_u_e_n_c_e_T_u_p_l_e │ │ │ │ -typename Imp::IntegerSequenceTupleHelper< IntegerSequence >::Type │ │ │ │ -IntegerSequenceTuple │ │ │ │ -Transform integer_sequence to tuple...>. │ │ │ │ -DDeeffiinniittiioonn utility.hh:219 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_s_t_T_y_p_e │ │ │ │ -Get last entry of type list. │ │ │ │ -DDeeffiinniittiioonn utility.hh:230 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_s_t_T_y_p_e_:_:_t_y_p_e │ │ │ │ -std::tuple_element_t< sizeof...(T) -1, std::tuple< T... > > type │ │ │ │ -DDeeffiinniittiioonn utility.hh:231 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_o_t_a_t_e_T_u_p_l_e │ │ │ │ -Rotate type list by one, such that last entry is moved to first position. │ │ │ │ -DDeeffiinniittiioonn utility.hh:259 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_o_t_a_t_e_T_u_p_l_e_:_:_t_y_p_e │ │ │ │ -typename Imp::RotateHelper< std::tuple< T... >, std::make_index_sequence< │ │ │ │ -sizeof...(T) -1 > >::type type │ │ │ │ -DDeeffiinniittiioonn utility.hh:260 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n │ │ │ │ +LFEPreBasisMixin(const GV &, const LFE &, MCMGLayout) -> LFEPreBasisMixin< GV, │ │ │ │ +LFE > │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n │ │ │ │ +LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout) │ │ │ │ +Construct from GridView and local DOF layout. │ │ │ │ +DDeeffiinniittiioonn leafprebasismappermixin.hh:74 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n │ │ │ │ +A pre-basis mixin class parametrized with a local finite-element and a DOF │ │ │ │ +layout. │ │ │ │ +DDeeffiinniittiioonn lfeprebasismixin.hh:57 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n │ │ │ │ +LFEPreBasisMixin(const GridView &gv, LFE_ &&lfe, MCMGLayout layout) │ │ │ │ +Constructor for a given grid view object, local finite-element and layout. │ │ │ │ +DDeeffiinniittiioonn lfeprebasismixin.hh:86 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n │ │ │ │ +LFEPreBasisMixin(const GridView &gv, MCMGLayout layout) │ │ │ │ +Constructor for a given grid view object and layout. │ │ │ │ +DDeeffiinniittiioonn lfeprebasismixin.hh:75 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_:_:_m_a_k_e_N_o_d_e │ │ │ │ +Node makeNode() const │ │ │ │ +Create tree node. │ │ │ │ +DDeeffiinniittiioonn lfeprebasismixin.hh:92 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_<_ _G_V_,_ _L_a_g_r_a_n_g_e_S_i_m_p_l_e_x_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_< │ │ │ │ +_t_y_p_e_n_a_m_e_ _G_V_:_:_c_t_y_p_e_,_ _R_,_ _G_V_:_:_d_i_m_e_n_s_i_o_n_,_ _1_ _>_ _>_:_:_G_r_i_d_V_i_e_w │ │ │ │ +GV GridView │ │ │ │ +DDeeffiinniittiioonn lfeprebasismixin.hh:63 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_:_:_N_o_d_e_:_:_F_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ +LFE FiniteElement │ │ │ │ +DDeeffiinniittiioonn lfeprebasismixin.hh:126 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_:_:_N_o_d_e_:_:_s_i_z_e___t_y_p_e │ │ │ │ +std::size_t size_type │ │ │ │ +DDeeffiinniittiioonn lfeprebasismixin.hh:124 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_:_:_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ +const FiniteElement & finiteElement() const │ │ │ │ +Return the LocalFiniteElement for the element we are bound to; might raise an │ │ │ │ +error if unbound. │ │ │ │ +DDeeffiinniittiioonn lfeprebasismixin.hh:146 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_:_:_N_o_d_e_:_:_e_l_e_m_e_n_t │ │ │ │ +const Element & element() const │ │ │ │ +Return current element; might raise an error if unbound. │ │ │ │ +DDeeffiinniittiioonn lfeprebasismixin.hh:135 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_:_:_N_o_d_e_:_:_l_f_e__ │ │ │ │ +const FiniteElement * lfe_ │ │ │ │ +DDeeffiinniittiioonn lfeprebasismixin.hh:160 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_:_:_N_o_d_e_:_:_b_i_n_d │ │ │ │ +void bind(const Element &e) │ │ │ │ +Bind to element. Stores a pointer to the passed element reference. │ │ │ │ +DDeeffiinniittiioonn lfeprebasismixin.hh:153 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_:_:_N_o_d_e_:_:_N_o_d_e │ │ │ │ +Node(const LFE &lfe) │ │ │ │ +Constructor; stores a pointer to the passed local finite-element lfe. │ │ │ │ +DDeeffiinniittiioonn lfeprebasismixin.hh:129 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_:_:_N_o_d_e_:_:_E_l_e_m_e_n_t │ │ │ │ +typename GV::template Codim< 0 >::Entity Element │ │ │ │ +DDeeffiinniittiioonn lfeprebasismixin.hh:125 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_:_:_N_o_d_e_:_:_e_l_e_m_e_n_t__ │ │ │ │ +const Element * element_ │ │ │ │ +DDeeffiinniittiioonn lfeprebasismixin.hh:161 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_e_t_S_i_z_e │ │ │ │ +void setSize(const size_type size) │ │ │ │ +DDeeffiinniittiioonn nodes.hh:197 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ +DDeeffiinniittiioonn nodes.hh:218 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _u_t_i_l_i_t_y_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _l_f_e_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00197.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: typeerasure.hh File Reference │ │ │ +Dune-Functions: lagrangebasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,47 +88,66 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
typeerasure.hh File Reference
│ │ │ +
lagrangebasis.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <typeinfo>
│ │ │ -#include <dune/common/typeutilities.hh>
│ │ │ -#include <dune/functions/common/type_traits.hh>
│ │ │ -#include <dune/functions/common/interfaces.hh>
│ │ │ -#include <dune/functions/common/polymorphicsmallobject.hh>
│ │ │ +
#include <type_traits>
│ │ │ +#include <dune/common/exceptions.hh>
│ │ │ +#include <dune/localfunctions/lagrange/cache.hh>
│ │ │ +#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ +#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │ +#include <dune/functions/functionspacebases/leafprebasismixin.hh>
│ │ │ +#include <dune/grid/common/capabilities.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::TypeErasureBase< Interface, Implementation, bufferSize >
 Base class for type-erased interface wrapper. More...
class  Dune::Functions::LagrangePreBasis< GV, k, R >
 A pre-basis for a PQ-lagrange bases with given order. More...
class  Dune::Functions::LagrangeNode< GV, k, R >
│ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ +

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::BasisFactory
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +

│ │ │ +Typedefs

template<typename GV, int k = -1, typename R = double>
using Dune::Functions::LagrangeBasis = DefaultGlobalBasis<LagrangePreBasis<GV, k, R> >
 Nodal basis of a scalar k-th-order Lagrangean finite element space.
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ +Functions

template<std::size_t k, typename R = double>
auto Dune::Functions::BasisFactory::lagrange ()
 Create a pre-basis factory that can create a Lagrange pre-basis.
template<typename R = double>
auto Dune::Functions::BasisFactory::lagrange (int order)
 Create a pre-basis factory that can create a Lagrange pre-basis with a run-time order.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,23 +1,39 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -typeerasure.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_i_n_t_e_r_f_a_c_e_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_p_o_l_y_m_o_r_p_h_i_c_s_m_a_l_l_o_b_j_e_c_t_._h_h> │ │ │ │ +lagrangebasis.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h> │ │ │ │ +#include │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_<_ _I_n_t_e_r_f_a_c_e_,_ _I_m_p_l_e_m_e_n_t_a_t_i_o_n_,_ _b_u_f_f_e_r_S_i_z_e │ │ │ │ - _> │ │ │ │ -  Base class for type-erased interface wrapper. _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _k_,_ _R_ _> │ │ │ │ +  A pre-basis for a PQ-lagrange bases with given order. _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_<_ _G_V_,_ _k_,_ _R_ _> │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ +namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ +TTyyppeeddeeffss │ │ │ │ +template │ │ │ │ +using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_B_a_s_i_s = _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s<_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s > │ │ │ │ +  Nodal basis of a scalar k-th-order Lagrangean finite element space. │ │ │ │ +FFuunnccttiioonnss │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_l_a_g_r_a_n_g_e () │ │ │ │ +  Create a pre-basis factory that can create a Lagrange pre-basis. │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_l_a_g_r_a_n_g_e (int order) │ │ │ │ +  Create a pre-basis factory that can create a Lagrange pre-basis with a │ │ │ │ + run-time order. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _t_y_p_e_e_r_a_s_u_r_e_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _l_a_g_r_a_n_g_e_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00197_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: typeerasure.hh Source File │ │ │ +Dune-Functions: lagrangebasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,186 +88,594 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
typeerasure.hh
│ │ │ +
lagrangebasis.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH
│ │ │ -
8#define DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH
│ │ │ +
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH
│ │ │
9
│ │ │ -
10#include <typeinfo>
│ │ │ -
11
│ │ │ -
12#include <dune/common/typeutilities.hh>
│ │ │ -
13
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
17
│ │ │ -
18namespace Dune {
│ │ │ -
19namespace Functions {
│ │ │ -
20namespace Imp {
│ │ │ -
21
│ │ │ -
22
│ │ │ -
23
│ │ │ -
37template<class Interface>
│ │ │ -
38class TypeErasureWrapperInterface :
│ │ │ -
39 public Interface,
│ │ │ -
40 public PolymorphicType<TypeErasureWrapperInterface<Interface>>
│ │ │ -
41{
│ │ │ -
42public:
│ │ │ -
43 virtual const std::type_info& target_type() const = 0;
│ │ │ -
44};
│ │ │ -
45
│ │ │ -
46
│ │ │ -
47
│ │ │ -
64template<class Interface, class T>
│ │ │ -
65class TypeErasureWrapperBase :
│ │ │ -
66 public TypeErasureWrapperInterface<Interface>
│ │ │ -
67{
│ │ │ -
68public:
│ │ │ -
69 template<class TT, disableCopyMove<TypeErasureWrapperBase, TT> = 0>
│ │ │ -
70 TypeErasureWrapperBase(TT&& t) :
│ │ │ -
71 wrapped_(std::forward<TT>(t))
│ │ │ -
72 {}
│ │ │ +
10#include <type_traits>
│ │ │ +
11#include <dune/common/exceptions.hh>
│ │ │ +
12
│ │ │ +
13#include <dune/localfunctions/lagrange/cache.hh>
│ │ │ +
14
│ │ │ + │ │ │ + │ │ │ + │ │ │ +
18
│ │ │ +
19#include <dune/grid/common/capabilities.hh>
│ │ │ +
20
│ │ │ +
21namespace Dune {
│ │ │ +
22namespace Functions {
│ │ │ +
23
│ │ │ +
24// *****************************************************************************
│ │ │ +
25// This is the reusable part of the LagrangeBasis. It contains
│ │ │ +
26//
│ │ │ +
27// LagrangePreBasis
│ │ │ +
28// LagrangeNode
│ │ │ +
29//
│ │ │ +
30// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ +
31// state. These components do _not_ depend on the global basis and local view
│ │ │ +
32// and can be used without a global basis.
│ │ │ +
33// *****************************************************************************
│ │ │ +
34
│ │ │ +
35template<typename GV, int k, typename R=double>
│ │ │ +
36class LagrangeNode;
│ │ │ +
37
│ │ │ +
38template<typename GV, int k, typename R=double>
│ │ │ + │ │ │ +
40
│ │ │ +
41
│ │ │ +
42
│ │ │ +
62template<typename GV, int k, typename R>
│ │ │ +
│ │ │ + │ │ │ +
64 public LeafPreBasisMixin< LagrangePreBasis<GV,k,R> >
│ │ │ +
65{
│ │ │ +
66 static const int dim = GV::dimension;
│ │ │ +
67 static const bool useDynamicOrder = (k<0);
│ │ │ +
68
│ │ │ +
69public:
│ │ │ +
70
│ │ │ +
72 using GridView = GV;
│ │ │
73
│ │ │ -
75 T& get()
│ │ │ -
76 {
│ │ │ -
77 return wrapped_;
│ │ │ -
78 }
│ │ │ +
75 using size_type = std::size_t;
│ │ │ +
76
│ │ │ + │ │ │
79
│ │ │ -
81 const T& get() const
│ │ │ -
82 {
│ │ │ -
83 return wrapped_;
│ │ │ -
84 }
│ │ │ -
85
│ │ │ -
86protected:
│ │ │ -
87 using Wrapped = T;
│ │ │ -
88 Wrapped wrapped_;
│ │ │ -
89};
│ │ │ -
90
│ │ │ +
│ │ │ + │ │ │ +
82 : LagrangePreBasis(gv, std::numeric_limits<unsigned int>::max())
│ │ │ +
83 {}
│ │ │ +
│ │ │ +
84
│ │ │ +
│ │ │ +
86 LagrangePreBasis(const GridView& gv, unsigned int order) :
│ │ │ + │ │ │ +
88 {
│ │ │ +
89 if (!useDynamicOrder && order!=std::numeric_limits<unsigned int>::max())
│ │ │ +
90 DUNE_THROW(RangeError, "Template argument k has to be -1 when supplying a run-time order!");
│ │ │
91
│ │ │ -
92
│ │ │ -
116template<class Interface, template<class> class Implementation, class T>
│ │ │ -
117class TypeErasureWrapperImplementation :
│ │ │ -
118 public Implementation<TypeErasureWrapperBase<Interface, T> >
│ │ │ -
119{
│ │ │ -
120public:
│ │ │ -
121
│ │ │ -
123 template<class TT, disableCopyMove<TypeErasureWrapperImplementation, T> = 0>
│ │ │ -
124 TypeErasureWrapperImplementation(TT&& t) :
│ │ │ -
125 Implementation<TypeErasureWrapperBase<Interface, T> >(std::forward<TT>(t))
│ │ │ -
126 {}
│ │ │ -
127
│ │ │ -
129 virtual TypeErasureWrapperImplementation* clone() const
│ │ │ -
130 {
│ │ │ -
131 return new TypeErasureWrapperImplementation(*this);
│ │ │ -
132 }
│ │ │ -
133
│ │ │ -
135 virtual TypeErasureWrapperImplementation* clone(void* buffer) const
│ │ │ -
136 {
│ │ │ -
137 return new (buffer) TypeErasureWrapperImplementation(*this);
│ │ │ -
138 }
│ │ │ -
139
│ │ │ -
141 virtual TypeErasureWrapperImplementation* move(void* buffer)
│ │ │ -
142 {
│ │ │ -
143 return new (buffer) TypeErasureWrapperImplementation(std::move(*this));
│ │ │ -
144 }
│ │ │ -
145
│ │ │ -
147 virtual const std::type_info& target_type() const
│ │ │ -
148 {
│ │ │ -
149 return typeid(T);
│ │ │ -
150 }
│ │ │ -
151};
│ │ │ -
152
│ │ │ -
153} // namespace Dune::Functions::Imp
│ │ │ -
154
│ │ │ -
155
│ │ │ -
156
│ │ │ -
167template<class Interface, template<class> class Implementation, size_t bufferSize = 56>
│ │ │ -
│ │ │ - │ │ │ -
169{
│ │ │ -
170public:
│ │ │ -
171
│ │ │ -
173 template<class T, disableCopyMove<TypeErasureBase, T> = 0 >
│ │ │ -
│ │ │ - │ │ │ -
175 wrapped_(Imp::TypeErasureWrapperImplementation<Interface, Implementation, std::decay_t<T>>(std::forward<T>(t)))
│ │ │ -
176 {}
│ │ │ -
│ │ │ -
177
│ │ │ -
179 TypeErasureBase() = default;
│ │ │ -
180
│ │ │ -
│ │ │ -
182 Interface& asInterface()
│ │ │ -
183 {
│ │ │ -
184 return wrapped_.get();
│ │ │ -
185 }
│ │ │ -
│ │ │ -
186
│ │ │ -
│ │ │ -
188 const Interface& asInterface() const
│ │ │ -
189 {
│ │ │ -
190 return wrapped_.get();
│ │ │ -
191 }
│ │ │ -
│ │ │ -
192
│ │ │ -
│ │ │ -
194 explicit operator bool() const noexcept
│ │ │ -
195 {
│ │ │ -
196 // Forward the query to the wrapped object
│ │ │ -
197 return static_cast<bool>(wrapped_);
│ │ │ -
198 }
│ │ │ -
│ │ │ -
199
│ │ │ -
│ │ │ -
201 const std::type_info& target_type() const
│ │ │ -
202 {
│ │ │ -
203 return wrapped_.get().target_type();
│ │ │ -
204 }
│ │ │ -
│ │ │ -
205
│ │ │ -
206protected:
│ │ │ - │ │ │ -
208};
│ │ │ -
│ │ │ -
209
│ │ │ -
210
│ │ │ -
211}} // namespace Dune::Functions
│ │ │ -
212
│ │ │ -
213
│ │ │ -
214
│ │ │ -
215#endif // DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH
│ │ │ - │ │ │ - │ │ │ - │ │ │ +
92 for (int i=0; i<=dim; i++)
│ │ │ +
93 {
│ │ │ + │ │ │ + │ │ │ +
96 }
│ │ │ + │ │ │ + │ │ │ +
99 }
│ │ │ +
│ │ │ +
100
│ │ │ +
│ │ │ + │ │ │ +
103 {
│ │ │ +
104 vertexOffset_ = 0;
│ │ │ + │ │ │ +
106
│ │ │ +
107 if (dim>=2)
│ │ │ +
108 {
│ │ │ + │ │ │ +
110
│ │ │ +
111 quadrilateralOffset_ = triangleOffset_ + dofsPerSimplex(2) * ((size_type)gridView_.size(Dune::GeometryTypes::triangle));
│ │ │ +
112 }
│ │ │ +
113
│ │ │ +
114 if (dim==3) {
│ │ │ +
115 tetrahedronOffset_ = quadrilateralOffset_ + dofsPerCube(2) * ((size_type)gridView_.size(Dune::GeometryTypes::quadrilateral));
│ │ │ +
116
│ │ │ +
117 prismOffset_ = tetrahedronOffset_ + dofsPerSimplex(3) * ((size_type)gridView_.size(Dune::GeometryTypes::tetrahedron));
│ │ │ +
118
│ │ │ +
119 hexahedronOffset_ = prismOffset_ + dofsPerPrism() * ((size_type)gridView_.size(Dune::GeometryTypes::prism));
│ │ │ +
120
│ │ │ +
121 pyramidOffset_ = hexahedronOffset_ + dofsPerCube(3) * ((size_type)gridView_.size(Dune::GeometryTypes::hexahedron));
│ │ │ +
122 }
│ │ │ +
123 }
│ │ │ +
│ │ │ +
124
│ │ │ +
│ │ │ +
126 const GridView& gridView() const
│ │ │ +
127 {
│ │ │ +
128 return gridView_;
│ │ │ +
129 }
│ │ │ +
│ │ │ +
130
│ │ │ +
│ │ │ +
132 void update (const GridView& gv)
│ │ │ +
133 {
│ │ │ +
134 gridView_ = gv;
│ │ │ +
135 }
│ │ │ +
│ │ │ +
136
│ │ │ +
│ │ │ + │ │ │ +
141 {
│ │ │ +
142 return Node{order_};
│ │ │ +
143 }
│ │ │ +
│ │ │ +
144
│ │ │ +
│ │ │ + │ │ │ +
147 {
│ │ │ +
148 switch (dim)
│ │ │ +
149 {
│ │ │ +
150 case 1:
│ │ │ +
151 return dofsPerCube(0) * ((size_type)gridView_.size(dim))
│ │ │ +
152 + dofsPerCube(1) * ((size_type)gridView_.size(dim-1));
│ │ │ +
153 case 2:
│ │ │ +
154 {
│ │ │ +
155 return dofsPerCube(0) * ((size_type)gridView_.size(dim))
│ │ │ +
156 + dofsPerCube(1) * ((size_type)gridView_.size(dim-1))
│ │ │ +
157 + dofsPerSimplex(2) * ((size_type)gridView_.size(Dune::GeometryTypes::triangle))
│ │ │ +
158 + dofsPerCube(2) * ((size_type)gridView_.size(Dune::GeometryTypes::quadrilateral));
│ │ │ +
159 }
│ │ │ +
160 case 3:
│ │ │ +
161 {
│ │ │ +
162 return dofsPerCube(0) * ((size_type)gridView_.size(dim))
│ │ │ +
163 + dofsPerCube(1) * ((size_type)gridView_.size(dim-1))
│ │ │ +
164 + dofsPerSimplex(2) * ((size_type)gridView_.size(Dune::GeometryTypes::triangle))
│ │ │ +
165 + dofsPerCube(2) * ((size_type)gridView_.size(Dune::GeometryTypes::quadrilateral))
│ │ │ +
166 + dofsPerSimplex(3) * ((size_type)gridView_.size(Dune::GeometryTypes::tetrahedron))
│ │ │ +
167 + dofsPerPyramid() * ((size_type)gridView_.size(Dune::GeometryTypes::pyramid))
│ │ │ +
168 + dofsPerPrism() * ((size_type)gridView_.size(Dune::GeometryTypes::prism))
│ │ │ +
169 + dofsPerCube(3) * ((size_type)gridView_.size(Dune::GeometryTypes::hexahedron));
│ │ │ +
170 }
│ │ │ +
171 }
│ │ │ +
172 DUNE_THROW(Dune::NotImplemented, "No size method for " << dim << "d grids available yet!");
│ │ │ +
173 }
│ │ │ +
│ │ │ +
174
│ │ │ +
│ │ │ + │ │ │ +
177 {
│ │ │ +
178 // That cast to unsigned int is necessary because GV::dimension is an enum,
│ │ │ +
179 // which is not recognized by the power method as an integer type...
│ │ │ +
180 return power(order()+1, (unsigned int)GV::dimension);
│ │ │ +
181 }
│ │ │ +
│ │ │ +
182
│ │ │ +
183 template<typename It>
│ │ │ +
│ │ │ +
184 It indices(const Node& node, It it) const
│ │ │ +
185 {
│ │ │ +
186 for (size_type i = 0, end = node.finiteElement().size() ; i < end ; ++it, ++i)
│ │ │ +
187 {
│ │ │ +
188 Dune::LocalKey localKey = node.finiteElement().localCoefficients().localKey(i);
│ │ │ +
189 const auto& gridIndexSet = gridView().indexSet();
│ │ │ +
190 const auto& element = node.element();
│ │ │ +
191
│ │ │ +
192 // The dimension of the entity that the current dof is related to
│ │ │ +
193 auto dofDim = dim - localKey.codim();
│ │ │ +
194
│ │ │ +
195 // Test for a vertex dof
│ │ │ +
196 // The test for k==1 is redundant, but having it here allows the compiler to conclude
│ │ │ +
197 // at compile-time that the dofDim==0 case is the only one that will ever happen.
│ │ │ +
198 // This leads to measurable speed-up: see
│ │ │ +
199 // https://gitlab.dune-project.org/staging/dune-functions/issues/30
│ │ │ +
200 if (k==1 || dofDim==0) {
│ │ │ +
201 *it = {{ (size_type)(gridIndexSet.subIndex(element,localKey.subEntity(),dim)) }};
│ │ │ +
202 continue;
│ │ │ +
203 }
│ │ │ +
204
│ │ │ +
205 if (dofDim==1)
│ │ │ +
206 { // edge dof
│ │ │ +
207 if (dim==1) // element dof -- any local numbering is fine
│ │ │ +
208 {
│ │ │ +
209 *it = {{ edgeOffset_
│ │ │ +
210 + dofsPerCube(1) * ((size_type)gridIndexSet.subIndex(element,0,0))
│ │ │ +
211 + localKey.index() }};
│ │ │ +
212 continue;
│ │ │ +
213 }
│ │ │ +
214 else
│ │ │ +
215 {
│ │ │ +
216 const auto refElement
│ │ │ +
217 = Dune::referenceElement<double,dim>(element.type());
│ │ │ +
218
│ │ │ +
219 // We have to reverse the numbering if the local element edge is
│ │ │ +
220 // not aligned with the global edge.
│ │ │ +
221 auto v0 = (size_type)gridIndexSet.subIndex(element,refElement.subEntity(localKey.subEntity(),localKey.codim(),0,dim),dim);
│ │ │ +
222 auto v1 = (size_type)gridIndexSet.subIndex(element,refElement.subEntity(localKey.subEntity(),localKey.codim(),1,dim),dim);
│ │ │ +
223 bool flip = (v0 > v1);
│ │ │ +
224 *it = {{ (flip)
│ │ │ + │ │ │ +
226 + dofsPerCube(1)*((size_type)gridIndexSet.subIndex(element,localKey.subEntity(),localKey.codim()))
│ │ │ +
227 + (dofsPerCube(1)-1)-localKey.index()
│ │ │ + │ │ │ +
229 + dofsPerCube(1)*((size_type)gridIndexSet.subIndex(element,localKey.subEntity(),localKey.codim()))
│ │ │ +
230 + localKey.index() }};
│ │ │ +
231 continue;
│ │ │ +
232 }
│ │ │ +
233 }
│ │ │ +
234
│ │ │ +
235 if (dofDim==2)
│ │ │ +
236 {
│ │ │ +
237 if (dim==2) // element dof -- any local numbering is fine
│ │ │ +
238 {
│ │ │ +
239 if (element.type().isTriangle())
│ │ │ +
240 {
│ │ │ +
241 *it = {{ triangleOffset_ + dofsPerSimplex(2)*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
│ │ │ +
242 continue;
│ │ │ +
243 }
│ │ │ +
244 else if (element.type().isQuadrilateral())
│ │ │ +
245 {
│ │ │ +
246 *it = {{ quadrilateralOffset_ + dofsPerCube(2)*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
│ │ │ +
247 continue;
│ │ │ +
248 }
│ │ │ +
249 else
│ │ │ +
250 DUNE_THROW(Dune::NotImplemented, "2d elements have to be triangles or quadrilaterals");
│ │ │ +
251 } else
│ │ │ +
252 {
│ │ │ +
253 const auto refElement
│ │ │ +
254 = Dune::referenceElement<double,dim>(element.type());
│ │ │ +
255
│ │ │ +
256 if (order()>3)
│ │ │ +
257 DUNE_THROW(Dune::NotImplemented, "LagrangeBasis for 3D grids is only implemented if k<=3");
│ │ │ +
258
│ │ │ +
259 if (order()==3 and !refElement.type(localKey.subEntity(), localKey.codim()).isTriangle())
│ │ │ +
260 DUNE_THROW(Dune::NotImplemented, "LagrangeBasis for 3D grids with k==3 is only implemented if the grid is a simplex grid");
│ │ │ +
261
│ │ │ +
262 *it = {{ triangleOffset_ + ((size_type)gridIndexSet.subIndex(element,localKey.subEntity(),localKey.codim())) }};
│ │ │ +
263 continue;
│ │ │ +
264 }
│ │ │ +
265 }
│ │ │ +
266
│ │ │ +
267 if (dofDim==3)
│ │ │ +
268 {
│ │ │ +
269 if (dim==3) // element dof -- any local numbering is fine
│ │ │ +
270 {
│ │ │ +
271 if (element.type().isTetrahedron())
│ │ │ +
272 {
│ │ │ +
273 *it = {{ tetrahedronOffset_ + dofsPerSimplex(3)*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
│ │ │ +
274 continue;
│ │ │ +
275 }
│ │ │ +
276 else if (element.type().isHexahedron())
│ │ │ +
277 {
│ │ │ +
278 *it = {{ hexahedronOffset_ + dofsPerCube(3)*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
│ │ │ +
279 continue;
│ │ │ +
280 }
│ │ │ +
281 else if (element.type().isPrism())
│ │ │ +
282 {
│ │ │ +
283 *it = {{ prismOffset_ + dofsPerPrism()*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
│ │ │ +
284 continue;
│ │ │ +
285 }
│ │ │ +
286 else if (element.type().isPyramid())
│ │ │ +
287 {
│ │ │ +
288 *it = {{ pyramidOffset_ + dofsPerPyramid()*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
│ │ │ +
289 continue;
│ │ │ +
290 }
│ │ │ +
291 else
│ │ │ +
292 DUNE_THROW(Dune::NotImplemented, "3d elements have to be tetrahedra, hexahedra, prisms, or pyramids");
│ │ │ +
293 } else
│ │ │ +
294 DUNE_THROW(Dune::NotImplemented, "Grids of dimension larger than 3 are no supported");
│ │ │ +
295 }
│ │ │ +
296 DUNE_THROW(Dune::NotImplemented, "Grid contains elements not supported for the LagrangeBasis");
│ │ │ +
297 }
│ │ │ +
298 return it;
│ │ │ +
299 }
│ │ │ +
│ │ │ +
300
│ │ │ +
│ │ │ +
302 unsigned int order() const
│ │ │ +
303 {
│ │ │ +
304 return (useDynamicOrder) ? order_ : k;
│ │ │ +
305 }
│ │ │ +
│ │ │ +
306
│ │ │ +
307protected:
│ │ │ + │ │ │ +
309
│ │ │ +
310 // Run-time order, only valid if k<0
│ │ │ +
311 unsigned int order_;
│ │ │ +
312
│ │ │ +
│ │ │ +
314 size_type dofsPerSimplex(std::size_t simplexDim) const
│ │ │ +
315 {
│ │ │ +
316 return useDynamicOrder ? dofsPerSimplex_[simplexDim] : computeDofsPerSimplex(simplexDim);
│ │ │ +
317 }
│ │ │ +
│ │ │ +
318
│ │ │ +
│ │ │ +
320 size_type dofsPerCube(std::size_t cubeDim) const
│ │ │ +
321 {
│ │ │ +
322 return useDynamicOrder ? dofsPerCube_[cubeDim] : computeDofsPerCube(cubeDim);
│ │ │ +
323 }
│ │ │ +
│ │ │ +
324
│ │ │ +
│ │ │ + │ │ │ +
326 {
│ │ │ +
327 return useDynamicOrder ? dofsPerPrism_ : computeDofsPerPrism();
│ │ │ +
328 }
│ │ │ +
│ │ │ +
329
│ │ │ +
│ │ │ + │ │ │ +
331 {
│ │ │ +
332 return useDynamicOrder ? dofsPerPyramid_ : computeDofsPerPyramid();
│ │ │ +
333 }
│ │ │ +
│ │ │ +
334
│ │ │ +
│ │ │ +
336 size_type computeDofsPerSimplex(std::size_t simplexDim) const
│ │ │ +
337 {
│ │ │ +
338 return order() == 0 ? (dim == simplexDim ? 1 : 0) : Dune::binomial(std::size_t(order()-1),simplexDim);
│ │ │ +
339 }
│ │ │ +
│ │ │ +
340
│ │ │ +
│ │ │ +
342 size_type computeDofsPerCube(std::size_t cubeDim) const
│ │ │ +
343 {
│ │ │ +
344 return order() == 0 ? (dim == cubeDim ? 1 : 0) : Dune::power(order()-1, cubeDim);
│ │ │ +
345 }
│ │ │ +
│ │ │ +
346
│ │ │ +
│ │ │ + │ │ │ +
348 {
│ │ │ +
349 return order() == 0 ? (dim == 3 ? 1 : 0) : (order()-1)*(order()-1)*(order()-2)/2;
│ │ │ +
350 }
│ │ │ +
│ │ │ +
351
│ │ │ +
│ │ │ + │ │ │ +
353 {
│ │ │ +
354 return order() == 0 ? (dim == 3 ? 1 : 0) : (order()-2)*(order()-1)*(2*order()-3)/6;
│ │ │ +
355 }
│ │ │ +
│ │ │ +
356
│ │ │ +
357 // When the order is given at run-time, the following numbers are pre-computed:
│ │ │ +
358 std::array<size_type,dim+1> dofsPerSimplex_;
│ │ │ +
359 std::array<size_type,dim+1> dofsPerCube_;
│ │ │ + │ │ │ + │ │ │ +
362
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
371
│ │ │ +
372};
│ │ │ +
│ │ │ +
373
│ │ │ +
374
│ │ │ +
375
│ │ │ +
376template<typename GV, int k, typename R>
│ │ │ +
│ │ │ + │ │ │ +
378 public LeafBasisNode
│ │ │ +
379{
│ │ │ +
380 static constexpr int dim = GV::dimension;
│ │ │ +
381 static constexpr bool useDynamicOrder = (k<0);
│ │ │ +
382
│ │ │ +
383 // Compute the GeometryType id in case the grid has only a single GeometryType
│ │ │ +
384 static constexpr GeometryType::Id geometryTypeId()
│ │ │ +
385 {
│ │ │ +
386 if constexpr(Dune::Capabilities::hasSingleGeometryType<typename GV::Grid>::v)
│ │ │ +
387 return GeometryType(Dune::Capabilities::hasSingleGeometryType<typename GV::Grid>::topologyId, GV::dimension);
│ │ │ +
388 else
│ │ │ +
389 return GeometryType::Id(~0u);
│ │ │ +
390 }
│ │ │ +
391
│ │ │ +
392 // Select the static LFECache if k >= 0, else the dynamic LFECache
│ │ │ +
393 using FiniteElementCache = std::conditional_t<(useDynamicOrder),
│ │ │ +
394 DynamicLagrangeLocalFiniteElementCache<typename GV::ctype,R,dim>,
│ │ │ +
395 StaticLagrangeLocalFiniteElementCache<geometryTypeId(),typename GV::ctype,R,dim,std::max(k,0)>
│ │ │ +
396 >;
│ │ │ +
397
│ │ │ +
398 // Construct the FiniteElementCache depending on whether the order is dynamic or static
│ │ │ +
399 static auto makeFiniteElementCache(unsigned int order)
│ │ │ +
400 {
│ │ │ +
401 if constexpr (useDynamicOrder)
│ │ │ +
402 return FiniteElementCache{order};
│ │ │ +
403 else
│ │ │ +
404 return FiniteElementCache{};
│ │ │ +
405 }
│ │ │ +
406
│ │ │ +
407public:
│ │ │ +
408
│ │ │ +
409 using size_type = std::size_t;
│ │ │ +
410 using Element = typename GV::template Codim<0>::Entity;
│ │ │ +
411 using FiniteElement = typename FiniteElementCache::FiniteElementType;
│ │ │ +
412
│ │ │ +
│ │ │ + │ │ │ +
415 LagrangeNode(k)
│ │ │ +
416 {}
│ │ │ +
│ │ │ +
417
│ │ │ +
│ │ │ +
419 LagrangeNode(unsigned int order) :
│ │ │ +
420 order_(order),
│ │ │ +
421 cache_(makeFiniteElementCache(order)),
│ │ │ +
422 finiteElement_(nullptr),
│ │ │ +
423 element_(nullptr)
│ │ │ +
424 {}
│ │ │ +
│ │ │ +
425
│ │ │ +
│ │ │ +
427 const Element& element() const
│ │ │ +
428 {
│ │ │ +
429 return *element_;
│ │ │ +
430 }
│ │ │ +
│ │ │ +
431
│ │ │ +
│ │ │ + │ │ │ +
437 {
│ │ │ +
438 return *finiteElement_;
│ │ │ +
439 }
│ │ │ +
│ │ │ +
440
│ │ │ +
│ │ │ +
442 void bind(const Element& e)
│ │ │ +
443 {
│ │ │ +
444 element_ = &e;
│ │ │ +
445 finiteElement_ = &(cache_.get(element_->type()));
│ │ │ +
446 this->setSize(finiteElement_->size());
│ │ │ +
447 }
│ │ │ +
│ │ │ +
448
│ │ │ +
449protected:
│ │ │ +
450
│ │ │ +
│ │ │ +
451 unsigned int order() const
│ │ │ +
452 {
│ │ │ +
453 return order_;
│ │ │ +
454 }
│ │ │ +
│ │ │ +
455
│ │ │ +
456 // Run-time order, only valid if k<0
│ │ │ +
457 unsigned int order_;
│ │ │ +
458
│ │ │ +
459 FiniteElementCache cache_;
│ │ │ + │ │ │ + │ │ │ +
462};
│ │ │ +
│ │ │ +
463
│ │ │ +
464
│ │ │ +
465
│ │ │ +
466namespace BasisFactory {
│ │ │ +
467
│ │ │ +
476template<std::size_t k, typename R=double>
│ │ │ +
│ │ │ + │ │ │ +
478{
│ │ │ +
479 return [](const auto& gridView) {
│ │ │ +
480 return LagrangePreBasis<std::decay_t<decltype(gridView)>, k, R>(gridView);
│ │ │ +
481 };
│ │ │ +
482}
│ │ │ +
│ │ │ +
483
│ │ │ +
491template<typename R=double>
│ │ │ +
│ │ │ +
492auto lagrange(int order)
│ │ │ +
493{
│ │ │ +
494 return [=](const auto& gridView) {
│ │ │ +
495 return LagrangePreBasis<std::decay_t<decltype(gridView)>, -1, R>(gridView, order);
│ │ │ +
496 };
│ │ │ +
497}
│ │ │ +
│ │ │ +
498
│ │ │ +
499} // end namespace BasisFactory
│ │ │ +
500
│ │ │ +
501
│ │ │ +
502
│ │ │ +
531template<typename GV, int k=-1, typename R=double>
│ │ │ + │ │ │ +
533
│ │ │ +
534
│ │ │ +
535
│ │ │ +
536
│ │ │ +
537
│ │ │ +
538} // end namespace Functions
│ │ │ +
539} // end namespace Dune
│ │ │ +
540
│ │ │ +
541
│ │ │ +
542#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH
│ │ │ + │ │ │ + │ │ │ + │ │ │ +
auto lagrange()
Create a pre-basis factory that can create a Lagrange pre-basis.
Definition lagrangebasis.hh:477
│ │ │ +
DefaultGlobalBasis< LagrangePreBasis< GV, k, R > > LagrangeBasis
Nodal basis of a scalar k-th-order Lagrangean finite element space.
Definition lagrangebasis.hh:532
│ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
A wrapper providing small object optimization with polymorphic types.
Definition polymorphicsmallobject.hh:51
│ │ │ -
const std::type_info & target_type() const
Get type of stored object.
Definition typeerasure.hh:201
│ │ │ -
TypeErasureBase(T &&t)
Construct wrapper from object.
Definition typeerasure.hh:174
│ │ │ -
PolymorphicSmallObject< Imp::TypeErasureWrapperInterface< typename Traits::Concept >, 56 > wrapped_
Definition typeerasure.hh:207
│ │ │ -
TypeErasureBase()=default
Default constructor.
│ │ │ -
Interface & asInterface()
Get mutable reference to wrapped object.
Definition typeerasure.hh:182
│ │ │ -
const Interface & asInterface() const
Get reference to wrapped object.
Definition typeerasure.hh:188
│ │ │ +
Definition argyrisbasis.hh:926
│ │ │ +
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:53
│ │ │ +
Definition lagrangebasis.hh:379
│ │ │ +
LagrangeNode(unsigned int order)
Constructor with a run-time order.
Definition lagrangebasis.hh:419
│ │ │ +
unsigned int order() const
Definition lagrangebasis.hh:451
│ │ │ +
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition lagrangebasis.hh:436
│ │ │ +
const Element * element_
Definition lagrangebasis.hh:461
│ │ │ +
const Element & element() const
Return current element, throw if unbound.
Definition lagrangebasis.hh:427
│ │ │ +
FiniteElementCache cache_
Definition lagrangebasis.hh:459
│ │ │ +
typename FiniteElementCache::FiniteElementType FiniteElement
Definition lagrangebasis.hh:411
│ │ │ +
void bind(const Element &e)
Bind to element.
Definition lagrangebasis.hh:442
│ │ │ +
typename GV::template Codim< 0 >::Entity Element
Definition lagrangebasis.hh:410
│ │ │ +
const FiniteElement * finiteElement_
Definition lagrangebasis.hh:460
│ │ │ +
unsigned int order_
Definition lagrangebasis.hh:457
│ │ │ +
std::size_t size_type
Definition lagrangebasis.hh:409
│ │ │ +
LagrangeNode()
Constructor without order (uses the compile-time value).
Definition lagrangebasis.hh:414
│ │ │ +
A pre-basis for a PQ-lagrange bases with given order.
Definition lagrangebasis.hh:65
│ │ │ +
size_type dofsPerPrism() const
Definition lagrangebasis.hh:325
│ │ │ +
size_type computeDofsPerCube(std::size_t cubeDim) const
Number of degrees of freedom assigned to a cube (without the ones assigned to its faces!...
Definition lagrangebasis.hh:342
│ │ │ +
size_type computeDofsPerSimplex(std::size_t simplexDim) const
Number of degrees of freedom assigned to a simplex (without the ones assigned to its faces!...
Definition lagrangebasis.hh:336
│ │ │ +
size_type computeDofsPerPrism() const
Definition lagrangebasis.hh:347
│ │ │ +
unsigned int order_
Definition lagrangebasis.hh:311
│ │ │ +
size_type edgeOffset_
Definition lagrangebasis.hh:364
│ │ │ +
LagrangeNode< GV, k, R > Node
Template mapping root tree path to type of created tree node.
Definition lagrangebasis.hh:78
│ │ │ +
std::array< size_type, dim+1 > dofsPerSimplex_
Definition lagrangebasis.hh:358
│ │ │ +
It indices(const Node &node, It it) const
Definition lagrangebasis.hh:184
│ │ │ +
size_type vertexOffset_
Definition lagrangebasis.hh:363
│ │ │ +
size_type dofsPerSimplex(std::size_t simplexDim) const
Number of degrees of freedom assigned to a simplex (without the ones assigned to its faces!...
Definition lagrangebasis.hh:314
│ │ │ +
std::size_t size_type
Type used for indices and size information.
Definition lagrangebasis.hh:75
│ │ │ +
size_type pyramidOffset_
Definition lagrangebasis.hh:368
│ │ │ +
size_type prismOffset_
Definition lagrangebasis.hh:369
│ │ │ +
size_type tetrahedronOffset_
Definition lagrangebasis.hh:367
│ │ │ +
void initializeIndices()
Initialize the global indices.
Definition lagrangebasis.hh:102
│ │ │ +
size_type computeDofsPerPyramid() const
Definition lagrangebasis.hh:352
│ │ │ +
LagrangePreBasis(const GridView &gv, unsigned int order)
Constructor for a given grid view object and run-time order.
Definition lagrangebasis.hh:86
│ │ │ +
size_type dofsPerPyramid_
Definition lagrangebasis.hh:361
│ │ │ +
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition lagrangebasis.hh:146
│ │ │ +
LagrangePreBasis(const GridView &gv)
Constructor for a given grid view object with compile-time order.
Definition lagrangebasis.hh:81
│ │ │ +
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition lagrangebasis.hh:132
│ │ │ +
GV GridView
The grid view that the FE basis is defined on.
Definition lagrangebasis.hh:72
│ │ │ +
size_type quadrilateralOffset_
Definition lagrangebasis.hh:366
│ │ │ +
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition lagrangebasis.hh:126
│ │ │ +
GridView gridView_
Definition lagrangebasis.hh:308
│ │ │ +
Node makeNode() const
Create tree node.
Definition lagrangebasis.hh:140
│ │ │ +
unsigned int order() const
Definition lagrangebasis.hh:302
│ │ │ +
std::array< size_type, dim+1 > dofsPerCube_
Definition lagrangebasis.hh:359
│ │ │ +
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition lagrangebasis.hh:176
│ │ │ +
size_type dofsPerPrism_
Definition lagrangebasis.hh:360
│ │ │ +
size_type dofsPerCube(std::size_t cubeDim) const
Number of degrees of freedom assigned to a cube (without the ones assigned to its faces!...
Definition lagrangebasis.hh:320
│ │ │ +
size_type triangleOffset_
Definition lagrangebasis.hh:365
│ │ │ +
size_type hexahedronOffset_
Definition lagrangebasis.hh:370
│ │ │ +
size_type dofsPerPyramid() const
Definition lagrangebasis.hh:330
│ │ │ +
A generic MixIn class for PreBasis.
Definition leafprebasismixin.hh:36
│ │ │ +
void setSize(const size_type size)
Definition nodes.hh:197
│ │ │ +
Definition nodes.hh:218
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,191 +1,723 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -typeerasure.hh │ │ │ │ +lagrangebasis.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH │ │ │ │ -8#define DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH │ │ │ │ +8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11 │ │ │ │ -12#include │ │ │ │ -13 │ │ │ │ -14#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ -15#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_i_n_t_e_r_f_a_c_e_s_._h_h> │ │ │ │ -16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_p_o_l_y_m_o_r_p_h_i_c_s_m_a_l_l_o_b_j_e_c_t_._h_h> │ │ │ │ -17 │ │ │ │ -18namespace _D_u_n_e { │ │ │ │ -19namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -20namespace Imp { │ │ │ │ -21 │ │ │ │ -22 │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ +12 │ │ │ │ +13#include │ │ │ │ +14 │ │ │ │ +15#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ +16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ +17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h> │ │ │ │ +18 │ │ │ │ +19#include │ │ │ │ +20 │ │ │ │ +21namespace _D_u_n_e { │ │ │ │ +22namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ 23 │ │ │ │ -37template │ │ │ │ -38class TypeErasureWrapperInterface : │ │ │ │ -39 public Interface, │ │ │ │ -40 public PolymorphicType> │ │ │ │ -41{ │ │ │ │ -42public: │ │ │ │ -43 virtual const std::type_info& target_type() const = 0; │ │ │ │ -44}; │ │ │ │ -45 │ │ │ │ -46 │ │ │ │ -47 │ │ │ │ -64template │ │ │ │ -65class TypeErasureWrapperBase : │ │ │ │ -66 public TypeErasureWrapperInterface │ │ │ │ -67{ │ │ │ │ -68public: │ │ │ │ -69 template = 0> │ │ │ │ -70 TypeErasureWrapperBase(TT&& t) : │ │ │ │ -71 wrapped_(std::forward(t)) │ │ │ │ -72 {} │ │ │ │ +24/ │ │ │ │ +/ ***************************************************************************** │ │ │ │ +25// This is the reusable part of the LagrangeBasis. It contains │ │ │ │ +26// │ │ │ │ +27// LagrangePreBasis │ │ │ │ +28// LagrangeNode │ │ │ │ +29// │ │ │ │ +30// The pre-basis allows to create the others and is the owner of possible │ │ │ │ +shared │ │ │ │ +31// state. These components do _not_ depend on the global basis and local view │ │ │ │ +32// and can be used without a global basis. │ │ │ │ +33/ │ │ │ │ +/ ***************************************************************************** │ │ │ │ +34 │ │ │ │ +35template │ │ │ │ +36class _L_a_g_r_a_n_g_e_N_o_d_e; │ │ │ │ +37 │ │ │ │ +38template │ │ │ │ +39class _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s; │ │ │ │ +40 │ │ │ │ +41 │ │ │ │ +42 │ │ │ │ +62template │ │ │ │ +_6_3class _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s : │ │ │ │ +64 public _L_e_a_f_P_r_e_B_a_s_i_s_M_i_x_i_n< LagrangePreBasis > │ │ │ │ +65{ │ │ │ │ +66 static const int dim = GV::dimension; │ │ │ │ +67 static const bool useDynamicOrder = (k<0); │ │ │ │ +68 │ │ │ │ +69public: │ │ │ │ +70 │ │ │ │ +_7_2 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ 73 │ │ │ │ -75 T& get() │ │ │ │ -76 { │ │ │ │ -77 return wrapped_; │ │ │ │ -78 } │ │ │ │ +_7_5 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ +76 │ │ │ │ +_7_8 using _N_o_d_e = _L_a_g_r_a_n_g_e_N_o_d_e_<_G_V_,_ _k_,_ _R_>; │ │ │ │ 79 │ │ │ │ -81 const T& get() const │ │ │ │ -82 { │ │ │ │ -83 return wrapped_; │ │ │ │ -84 } │ │ │ │ -85 │ │ │ │ -86protected: │ │ │ │ -87 using Wrapped = T; │ │ │ │ -88 Wrapped wrapped_; │ │ │ │ -89}; │ │ │ │ -90 │ │ │ │ +_8_1 _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s(const _G_r_i_d_V_i_e_w& gv) │ │ │ │ +82 : _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s(gv, std::numeric_limits::max()) │ │ │ │ +83 {} │ │ │ │ +84 │ │ │ │ +_8_6 _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s(const _G_r_i_d_V_i_e_w& gv, unsigned int _o_r_d_e_r) : │ │ │ │ +87 _g_r_i_d_V_i_e_w__(gv), _o_r_d_e_r__(_o_r_d_e_r) │ │ │ │ +88 { │ │ │ │ +89 if (!useDynamicOrder && _o_r_d_e_r!=std::numeric_limits::max()) │ │ │ │ +90 DUNE_THROW(RangeError, "Template argument k has to be -1 when supplying a │ │ │ │ +run-time order!"); │ │ │ │ 91 │ │ │ │ -92 │ │ │ │ -116template class Implementation, class T> │ │ │ │ -117class TypeErasureWrapperImplementation : │ │ │ │ -118 public Implementation > │ │ │ │ -119{ │ │ │ │ -120public: │ │ │ │ -121 │ │ │ │ -123 template = │ │ │ │ -0> │ │ │ │ -124 TypeErasureWrapperImplementation(TT&& t) : │ │ │ │ -125 Implementation >(std::forward(t)) │ │ │ │ -126 {} │ │ │ │ -127 │ │ │ │ -129 virtual TypeErasureWrapperImplementation* clone() const │ │ │ │ -130 { │ │ │ │ -131 return new TypeErasureWrapperImplementation(*this); │ │ │ │ -132 } │ │ │ │ -133 │ │ │ │ -135 virtual TypeErasureWrapperImplementation* clone(void* buffer) const │ │ │ │ -136 { │ │ │ │ -137 return new (buffer) TypeErasureWrapperImplementation(*this); │ │ │ │ -138 } │ │ │ │ -139 │ │ │ │ -141 virtual TypeErasureWrapperImplementation* move(void* buffer) │ │ │ │ -142 { │ │ │ │ -143 return new (buffer) TypeErasureWrapperImplementation(std::move(*this)); │ │ │ │ -144 } │ │ │ │ -145 │ │ │ │ -147 virtual const std::type_info& target_type() const │ │ │ │ -148 { │ │ │ │ -149 return typeid(T); │ │ │ │ -150 } │ │ │ │ -151}; │ │ │ │ -152 │ │ │ │ -153} // namespace Dune::Functions::Imp │ │ │ │ -154 │ │ │ │ -155 │ │ │ │ -156 │ │ │ │ -167template class Implementation, size_t │ │ │ │ -bufferSize = 56> │ │ │ │ -_1_6_8class _T_y_p_e_E_r_a_s_u_r_e_B_a_s_e │ │ │ │ -169{ │ │ │ │ -170public: │ │ │ │ -171 │ │ │ │ -173 template = 0 > │ │ │ │ -_1_7_4 _T_y_p_e_E_r_a_s_u_r_e_B_a_s_e(T&& t) : │ │ │ │ -175 _w_r_a_p_p_e_d__(Imp::TypeErasureWrapperImplementation>(std::forward(t))) │ │ │ │ -176 {} │ │ │ │ -177 │ │ │ │ -_1_7_9 _T_y_p_e_E_r_a_s_u_r_e_B_a_s_e() = default; │ │ │ │ -180 │ │ │ │ -_1_8_2 Interface& _a_s_I_n_t_e_r_f_a_c_e() │ │ │ │ -183 { │ │ │ │ -184 return _w_r_a_p_p_e_d__.get(); │ │ │ │ -185 } │ │ │ │ -186 │ │ │ │ -_1_8_8 const Interface& _a_s_I_n_t_e_r_f_a_c_e() const │ │ │ │ -189 { │ │ │ │ -190 return _w_r_a_p_p_e_d__.get(); │ │ │ │ -191 } │ │ │ │ -192 │ │ │ │ -_1_9_4 explicit operator bool() const noexcept │ │ │ │ -195 { │ │ │ │ -196 // Forward the query to the wrapped object │ │ │ │ -197 return static_cast(_w_r_a_p_p_e_d__); │ │ │ │ -198 } │ │ │ │ -199 │ │ │ │ -_2_0_1 const std::type_info& _t_a_r_g_e_t___t_y_p_e() const │ │ │ │ -202 { │ │ │ │ -203 return _w_r_a_p_p_e_d__.get().target_type(); │ │ │ │ -204 } │ │ │ │ -205 │ │ │ │ -206protected: │ │ │ │ -_2_0_7 _P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t_<_I_m_p_:_:_T_y_p_e_E_r_a_s_u_r_e_W_r_a_p_p_e_r_I_n_t_e_r_f_a_c_e_<_I_n_t_e_r_f_a_c_e_>, │ │ │ │ -bufferSize > _w_r_a_p_p_e_d__; │ │ │ │ -208}; │ │ │ │ -209 │ │ │ │ -210 │ │ │ │ -211}} // namespace Dune::Functions │ │ │ │ -212 │ │ │ │ -213 │ │ │ │ -214 │ │ │ │ -215#endif // DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH │ │ │ │ -_t_y_p_e___t_r_a_i_t_s_._h_h │ │ │ │ -_p_o_l_y_m_o_r_p_h_i_c_s_m_a_l_l_o_b_j_e_c_t_._h_h │ │ │ │ -_i_n_t_e_r_f_a_c_e_s_._h_h │ │ │ │ +92 for (int i=0; i<=dim; i++) │ │ │ │ +93 { │ │ │ │ +94 _d_o_f_s_P_e_r_C_u_b_e__[i] = _c_o_m_p_u_t_e_D_o_f_s_P_e_r_C_u_b_e(i); │ │ │ │ +95 _d_o_f_s_P_e_r_S_i_m_p_l_e_x__[i] = _c_o_m_p_u_t_e_D_o_f_s_P_e_r_S_i_m_p_l_e_x(i); │ │ │ │ +96 } │ │ │ │ +97 _d_o_f_s_P_e_r_P_r_i_s_m__ = _c_o_m_p_u_t_e_D_o_f_s_P_e_r_P_r_i_s_m(); │ │ │ │ +98 _d_o_f_s_P_e_r_P_y_r_a_m_i_d__ = _c_o_m_p_u_t_e_D_o_f_s_P_e_r_P_y_r_a_m_i_d(); │ │ │ │ +99 } │ │ │ │ +100 │ │ │ │ +_1_0_2 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ +103 { │ │ │ │ +104 _v_e_r_t_e_x_O_f_f_s_e_t__ = 0; │ │ │ │ +105 _e_d_g_e_O_f_f_s_e_t__ = _v_e_r_t_e_x_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_C_u_b_e(0) * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size │ │ │ │ +(dim)); │ │ │ │ +106 │ │ │ │ +107 if (dim>=2) │ │ │ │ +108 { │ │ │ │ +109 _t_r_i_a_n_g_l_e_O_f_f_s_e_t__ = _e_d_g_e_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_C_u_b_e(1) * ((_s_i_z_e___t_y_p_e) │ │ │ │ +_g_r_i_d_V_i_e_w__.size(dim-1)); │ │ │ │ +110 │ │ │ │ +111 _q_u_a_d_r_i_l_a_t_e_r_a_l_O_f_f_s_e_t__ = _t_r_i_a_n_g_l_e_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_S_i_m_p_l_e_x(2) * ( │ │ │ │ +(_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes::triangle)); │ │ │ │ +112 } │ │ │ │ +113 │ │ │ │ +114 if (dim==3) { │ │ │ │ +115 _t_e_t_r_a_h_e_d_r_o_n_O_f_f_s_e_t__ = _q_u_a_d_r_i_l_a_t_e_r_a_l_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_C_u_b_e(2) * ( │ │ │ │ +(_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes::quadrilateral)); │ │ │ │ +116 │ │ │ │ +117 _p_r_i_s_m_O_f_f_s_e_t__ = _t_e_t_r_a_h_e_d_r_o_n_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_S_i_m_p_l_e_x(3) * ( │ │ │ │ +(_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes::tetrahedron)); │ │ │ │ +118 │ │ │ │ +119 _h_e_x_a_h_e_d_r_o_n_O_f_f_s_e_t__ = _p_r_i_s_m_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_P_r_i_s_m() * ( │ │ │ │ +(_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes::prism)); │ │ │ │ +120 │ │ │ │ +121 _p_y_r_a_m_i_d_O_f_f_s_e_t__ = _h_e_x_a_h_e_d_r_o_n_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_C_u_b_e(3) * ( │ │ │ │ +(_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes::hexahedron)); │ │ │ │ +122 } │ │ │ │ +123 } │ │ │ │ +124 │ │ │ │ +_1_2_6 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ +127 { │ │ │ │ +128 return _g_r_i_d_V_i_e_w__; │ │ │ │ +129 } │ │ │ │ +130 │ │ │ │ +_1_3_2 void _u_p_d_a_t_e (const _G_r_i_d_V_i_e_w& gv) │ │ │ │ +133 { │ │ │ │ +134 _g_r_i_d_V_i_e_w__ = gv; │ │ │ │ +135 } │ │ │ │ +136 │ │ │ │ +_1_4_0 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ +141 { │ │ │ │ +142 return _N_o_d_e{_o_r_d_e_r__}; │ │ │ │ +143 } │ │ │ │ +144 │ │ │ │ +_1_4_6 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ +147 { │ │ │ │ +148 switch (dim) │ │ │ │ +149 { │ │ │ │ +150 case 1: │ │ │ │ +151 return _d_o_f_s_P_e_r_C_u_b_e(0) * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(dim)) │ │ │ │ +152 + _d_o_f_s_P_e_r_C_u_b_e(1) * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(dim-1)); │ │ │ │ +153 case 2: │ │ │ │ +154 { │ │ │ │ +155 return _d_o_f_s_P_e_r_C_u_b_e(0) * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(dim)) │ │ │ │ +156 + _d_o_f_s_P_e_r_C_u_b_e(1) * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(dim-1)) │ │ │ │ +157 + _d_o_f_s_P_e_r_S_i_m_p_l_e_x(2) * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes:: │ │ │ │ +triangle)) │ │ │ │ +158 + _d_o_f_s_P_e_r_C_u_b_e(2) * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes:: │ │ │ │ +quadrilateral)); │ │ │ │ +159 } │ │ │ │ +160 case 3: │ │ │ │ +161 { │ │ │ │ +162 return _d_o_f_s_P_e_r_C_u_b_e(0) * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(dim)) │ │ │ │ +163 + _d_o_f_s_P_e_r_C_u_b_e(1) * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(dim-1)) │ │ │ │ +164 + _d_o_f_s_P_e_r_S_i_m_p_l_e_x(2) * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes:: │ │ │ │ +triangle)) │ │ │ │ +165 + _d_o_f_s_P_e_r_C_u_b_e(2) * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes:: │ │ │ │ +quadrilateral)) │ │ │ │ +166 + _d_o_f_s_P_e_r_S_i_m_p_l_e_x(3) * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes:: │ │ │ │ +tetrahedron)) │ │ │ │ +167 + _d_o_f_s_P_e_r_P_y_r_a_m_i_d() * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes:: │ │ │ │ +pyramid)) │ │ │ │ +168 + _d_o_f_s_P_e_r_P_r_i_s_m() * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes::prism)) │ │ │ │ +169 + _d_o_f_s_P_e_r_C_u_b_e(3) * ((_s_i_z_e___t_y_p_e)_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes:: │ │ │ │ +hexahedron)); │ │ │ │ +170 } │ │ │ │ +171 } │ │ │ │ +172 DUNE_THROW(Dune::NotImplemented, "No size method for " << dim << "d grids │ │ │ │ +available yet!"); │ │ │ │ +173 } │ │ │ │ +174 │ │ │ │ +_1_7_6 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ +177 { │ │ │ │ +178 // That cast to unsigned int is necessary because GV::dimension is an enum, │ │ │ │ +179 // which is not recognized by the power method as an integer type... │ │ │ │ +180 return power(_o_r_d_e_r()+1, (unsigned int)GV::dimension); │ │ │ │ +181 } │ │ │ │ +182 │ │ │ │ +183 template │ │ │ │ +_1_8_4 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ +185 { │ │ │ │ +186 for (_s_i_z_e___t_y_p_e i = 0, end = node._f_i_n_i_t_e_E_l_e_m_e_n_t().size() ; i < end ; ++it, │ │ │ │ +++i) │ │ │ │ +187 { │ │ │ │ +188 Dune::LocalKey localKey = node._f_i_n_i_t_e_E_l_e_m_e_n_t().localCoefficients().localKey │ │ │ │ +(i); │ │ │ │ +189 const auto& gridIndexSet = _g_r_i_d_V_i_e_w().indexSet(); │ │ │ │ +190 const auto& element = node._e_l_e_m_e_n_t(); │ │ │ │ +191 │ │ │ │ +192 // The dimension of the entity that the current dof is related to │ │ │ │ +193 auto dofDim = dim - localKey.codim(); │ │ │ │ +194 │ │ │ │ +195 // Test for a vertex dof │ │ │ │ +196 // The test for k==1 is redundant, but having it here allows the compiler │ │ │ │ +to conclude │ │ │ │ +197 // at compile-time that the dofDim==0 case is the only one that will ever │ │ │ │ +happen. │ │ │ │ +198 // This leads to measurable speed-up: see │ │ │ │ +199 // https://gitlab.dune-project.org/staging/dune-functions/issues/30 │ │ │ │ +200 if (k==1 || dofDim==0) { │ │ │ │ +201 *it = {{ (_s_i_z_e___t_y_p_e)(gridIndexSet.subIndex(element,localKey.subEntity │ │ │ │ +(),dim)) }}; │ │ │ │ +202 continue; │ │ │ │ +203 } │ │ │ │ +204 │ │ │ │ +205 if (dofDim==1) │ │ │ │ +206 { // edge dof │ │ │ │ +207 if (dim==1) // element dof -- any local numbering is fine │ │ │ │ +208 { │ │ │ │ +209 *it = {{ _e_d_g_e_O_f_f_s_e_t__ │ │ │ │ +210 + _d_o_f_s_P_e_r_C_u_b_e(1) * ((_s_i_z_e___t_y_p_e)gridIndexSet.subIndex(element,0,0)) │ │ │ │ +211 + localKey.index() }}; │ │ │ │ +212 continue; │ │ │ │ +213 } │ │ │ │ +214 else │ │ │ │ +215 { │ │ │ │ +216 const auto refElement │ │ │ │ +217 = Dune::referenceElement(element.type()); │ │ │ │ +218 │ │ │ │ +219 // We have to reverse the numbering if the local element edge is │ │ │ │ +220 // not aligned with the global edge. │ │ │ │ +221 auto v0 = (_s_i_z_e___t_y_p_e)gridIndexSet.subIndex(element,refElement.subEntity │ │ │ │ +(localKey.subEntity(),localKey.codim(),0,dim),dim); │ │ │ │ +222 auto v1 = (_s_i_z_e___t_y_p_e)gridIndexSet.subIndex(element,refElement.subEntity │ │ │ │ +(localKey.subEntity(),localKey.codim(),1,dim),dim); │ │ │ │ +223 bool flip = (v0 > v1); │ │ │ │ +224 *it = {{ (flip) │ │ │ │ +225 ? _e_d_g_e_O_f_f_s_e_t__ │ │ │ │ +226 + _d_o_f_s_P_e_r_C_u_b_e(1)*((_s_i_z_e___t_y_p_e)gridIndexSet.subIndex │ │ │ │ +(element,localKey.subEntity(),localKey.codim())) │ │ │ │ +227 + (_d_o_f_s_P_e_r_C_u_b_e(1)-1)-localKey.index() │ │ │ │ +228 : _e_d_g_e_O_f_f_s_e_t__ │ │ │ │ +229 + _d_o_f_s_P_e_r_C_u_b_e(1)*((_s_i_z_e___t_y_p_e)gridIndexSet.subIndex │ │ │ │ +(element,localKey.subEntity(),localKey.codim())) │ │ │ │ +230 + localKey.index() }}; │ │ │ │ +231 continue; │ │ │ │ +232 } │ │ │ │ +233 } │ │ │ │ +234 │ │ │ │ +235 if (dofDim==2) │ │ │ │ +236 { │ │ │ │ +237 if (dim==2) // element dof -- any local numbering is fine │ │ │ │ +238 { │ │ │ │ +239 if (element.type().isTriangle()) │ │ │ │ +240 { │ │ │ │ +241 *it = {{ _t_r_i_a_n_g_l_e_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_S_i_m_p_l_e_x(2)*( │ │ │ │ +(_s_i_z_e___t_y_p_e)gridIndexSet.subIndex(element,0,0)) + localKey.index() }}; │ │ │ │ +242 continue; │ │ │ │ +243 } │ │ │ │ +244 else if (element.type().isQuadrilateral()) │ │ │ │ +245 { │ │ │ │ +246 *it = {{ _q_u_a_d_r_i_l_a_t_e_r_a_l_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_C_u_b_e(2)*( │ │ │ │ +(_s_i_z_e___t_y_p_e)gridIndexSet.subIndex(element,0,0)) + localKey.index() }}; │ │ │ │ +247 continue; │ │ │ │ +248 } │ │ │ │ +249 else │ │ │ │ +250 DUNE_THROW(Dune::NotImplemented, "2d elements have to be triangles or │ │ │ │ +quadrilaterals"); │ │ │ │ +251 } else │ │ │ │ +252 { │ │ │ │ +253 const auto refElement │ │ │ │ +254 = Dune::referenceElement(element.type()); │ │ │ │ +255 │ │ │ │ +256 if (_o_r_d_e_r()>3) │ │ │ │ +257 DUNE_THROW(Dune::NotImplemented, "LagrangeBasis for 3D grids is only │ │ │ │ +implemented if k<=3"); │ │ │ │ +258 │ │ │ │ +259 if (_o_r_d_e_r()==3 and !refElement.type(localKey.subEntity(), localKey.codim │ │ │ │ +()).isTriangle()) │ │ │ │ +260 DUNE_THROW(Dune::NotImplemented, "LagrangeBasis for 3D grids with k==3 is │ │ │ │ +only implemented if the grid is a simplex grid"); │ │ │ │ +261 │ │ │ │ +262 *it = {{ _t_r_i_a_n_g_l_e_O_f_f_s_e_t__ + ((_s_i_z_e___t_y_p_e)gridIndexSet.subIndex │ │ │ │ +(element,localKey.subEntity(),localKey.codim())) }}; │ │ │ │ +263 continue; │ │ │ │ +264 } │ │ │ │ +265 } │ │ │ │ +266 │ │ │ │ +267 if (dofDim==3) │ │ │ │ +268 { │ │ │ │ +269 if (dim==3) // element dof -- any local numbering is fine │ │ │ │ +270 { │ │ │ │ +271 if (element.type().isTetrahedron()) │ │ │ │ +272 { │ │ │ │ +273 *it = {{ _t_e_t_r_a_h_e_d_r_o_n_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_S_i_m_p_l_e_x(3)*( │ │ │ │ +(_s_i_z_e___t_y_p_e)gridIndexSet.subIndex(element,0,0)) + localKey.index() }}; │ │ │ │ +274 continue; │ │ │ │ +275 } │ │ │ │ +276 else if (element.type().isHexahedron()) │ │ │ │ +277 { │ │ │ │ +278 *it = {{ _h_e_x_a_h_e_d_r_o_n_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_C_u_b_e(3)*( │ │ │ │ +(_s_i_z_e___t_y_p_e)gridIndexSet.subIndex(element,0,0)) + localKey.index() }}; │ │ │ │ +279 continue; │ │ │ │ +280 } │ │ │ │ +281 else if (element.type().isPrism()) │ │ │ │ +282 { │ │ │ │ +283 *it = {{ _p_r_i_s_m_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_P_r_i_s_m()*((_s_i_z_e___t_y_p_e)gridIndexSet.subIndex │ │ │ │ +(element,0,0)) + localKey.index() }}; │ │ │ │ +284 continue; │ │ │ │ +285 } │ │ │ │ +286 else if (element.type().isPyramid()) │ │ │ │ +287 { │ │ │ │ +288 *it = {{ _p_y_r_a_m_i_d_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_P_y_r_a_m_i_d()*( │ │ │ │ +(_s_i_z_e___t_y_p_e)gridIndexSet.subIndex(element,0,0)) + localKey.index() }}; │ │ │ │ +289 continue; │ │ │ │ +290 } │ │ │ │ +291 else │ │ │ │ +292 DUNE_THROW(Dune::NotImplemented, "3d elements have to be tetrahedra, │ │ │ │ +hexahedra, prisms, or pyramids"); │ │ │ │ +293 } else │ │ │ │ +294 DUNE_THROW(Dune::NotImplemented, "Grids of dimension larger than 3 are no │ │ │ │ +supported"); │ │ │ │ +295 } │ │ │ │ +296 DUNE_THROW(Dune::NotImplemented, "Grid contains elements not supported for │ │ │ │ +the LagrangeBasis"); │ │ │ │ +297 } │ │ │ │ +298 return it; │ │ │ │ +299 } │ │ │ │ +300 │ │ │ │ +_3_0_2 unsigned int _o_r_d_e_r() const │ │ │ │ +303 { │ │ │ │ +304 return (useDynamicOrder) ? _o_r_d_e_r__ : k; │ │ │ │ +305 } │ │ │ │ +306 │ │ │ │ +307protected: │ │ │ │ +_3_0_8 _G_r_i_d_V_i_e_w _g_r_i_d_V_i_e_w__; │ │ │ │ +309 │ │ │ │ +310 // Run-time order, only valid if k<0 │ │ │ │ +_3_1_1 unsigned int _o_r_d_e_r__; │ │ │ │ +312 │ │ │ │ +_3_1_4 _s_i_z_e___t_y_p_e _d_o_f_s_P_e_r_S_i_m_p_l_e_x(std::size_t simplexDim) const │ │ │ │ +315 { │ │ │ │ +316 return useDynamicOrder ? _d_o_f_s_P_e_r_S_i_m_p_l_e_x__[simplexDim] : │ │ │ │ +_c_o_m_p_u_t_e_D_o_f_s_P_e_r_S_i_m_p_l_e_x(simplexDim); │ │ │ │ +317 } │ │ │ │ +318 │ │ │ │ +_3_2_0 _s_i_z_e___t_y_p_e _d_o_f_s_P_e_r_C_u_b_e(std::size_t cubeDim) const │ │ │ │ +321 { │ │ │ │ +322 return useDynamicOrder ? _d_o_f_s_P_e_r_C_u_b_e__[cubeDim] : _c_o_m_p_u_t_e_D_o_f_s_P_e_r_C_u_b_e │ │ │ │ +(cubeDim); │ │ │ │ +323 } │ │ │ │ +324 │ │ │ │ +_3_2_5 _s_i_z_e___t_y_p_e _d_o_f_s_P_e_r_P_r_i_s_m() const │ │ │ │ +326 { │ │ │ │ +327 return useDynamicOrder ? _d_o_f_s_P_e_r_P_r_i_s_m__ : _c_o_m_p_u_t_e_D_o_f_s_P_e_r_P_r_i_s_m(); │ │ │ │ +328 } │ │ │ │ +329 │ │ │ │ +_3_3_0 _s_i_z_e___t_y_p_e _d_o_f_s_P_e_r_P_y_r_a_m_i_d() const │ │ │ │ +331 { │ │ │ │ +332 return useDynamicOrder ? _d_o_f_s_P_e_r_P_y_r_a_m_i_d__ : _c_o_m_p_u_t_e_D_o_f_s_P_e_r_P_y_r_a_m_i_d(); │ │ │ │ +333 } │ │ │ │ +334 │ │ │ │ +_3_3_6 _s_i_z_e___t_y_p_e _c_o_m_p_u_t_e_D_o_f_s_P_e_r_S_i_m_p_l_e_x(std::size_t simplexDim) const │ │ │ │ +337 { │ │ │ │ +338 return _o_r_d_e_r() == 0 ? (dim == simplexDim ? 1 : 0) : Dune::binomial(std:: │ │ │ │ +size_t(_o_r_d_e_r()-1),simplexDim); │ │ │ │ +339 } │ │ │ │ +340 │ │ │ │ +_3_4_2 _s_i_z_e___t_y_p_e _c_o_m_p_u_t_e_D_o_f_s_P_e_r_C_u_b_e(std::size_t cubeDim) const │ │ │ │ +343 { │ │ │ │ +344 return _o_r_d_e_r() == 0 ? (dim == cubeDim ? 1 : 0) : Dune::power(_o_r_d_e_r()-1, │ │ │ │ +cubeDim); │ │ │ │ +345 } │ │ │ │ +346 │ │ │ │ +_3_4_7 _s_i_z_e___t_y_p_e _c_o_m_p_u_t_e_D_o_f_s_P_e_r_P_r_i_s_m() const │ │ │ │ +348 { │ │ │ │ +349 return _o_r_d_e_r() == 0 ? (dim == 3 ? 1 : 0) : (_o_r_d_e_r()-1)*(_o_r_d_e_r()-1)*(_o_r_d_e_r │ │ │ │ +()-2)/2; │ │ │ │ +350 } │ │ │ │ +351 │ │ │ │ +_3_5_2 _s_i_z_e___t_y_p_e _c_o_m_p_u_t_e_D_o_f_s_P_e_r_P_y_r_a_m_i_d() const │ │ │ │ +353 { │ │ │ │ +354 return _o_r_d_e_r() == 0 ? (dim == 3 ? 1 : 0) : (_o_r_d_e_r()-2)*(_o_r_d_e_r()-1)*(2*_o_r_d_e_r │ │ │ │ +()-3)/6; │ │ │ │ +355 } │ │ │ │ +356 │ │ │ │ +357 // When the order is given at run-time, the following numbers are pre- │ │ │ │ +computed: │ │ │ │ +_3_5_8 std::array _d_o_f_s_P_e_r_S_i_m_p_l_e_x__; │ │ │ │ +_3_5_9 std::array _d_o_f_s_P_e_r_C_u_b_e__; │ │ │ │ +_3_6_0 _s_i_z_e___t_y_p_e _d_o_f_s_P_e_r_P_r_i_s_m__; │ │ │ │ +_3_6_1 _s_i_z_e___t_y_p_e _d_o_f_s_P_e_r_P_y_r_a_m_i_d__; │ │ │ │ +362 │ │ │ │ +_3_6_3 _s_i_z_e___t_y_p_e _v_e_r_t_e_x_O_f_f_s_e_t__; │ │ │ │ +_3_6_4 _s_i_z_e___t_y_p_e _e_d_g_e_O_f_f_s_e_t__; │ │ │ │ +_3_6_5 _s_i_z_e___t_y_p_e _t_r_i_a_n_g_l_e_O_f_f_s_e_t__; │ │ │ │ +_3_6_6 _s_i_z_e___t_y_p_e _q_u_a_d_r_i_l_a_t_e_r_a_l_O_f_f_s_e_t__; │ │ │ │ +_3_6_7 _s_i_z_e___t_y_p_e _t_e_t_r_a_h_e_d_r_o_n_O_f_f_s_e_t__; │ │ │ │ +_3_6_8 _s_i_z_e___t_y_p_e _p_y_r_a_m_i_d_O_f_f_s_e_t__; │ │ │ │ +_3_6_9 _s_i_z_e___t_y_p_e _p_r_i_s_m_O_f_f_s_e_t__; │ │ │ │ +_3_7_0 _s_i_z_e___t_y_p_e _h_e_x_a_h_e_d_r_o_n_O_f_f_s_e_t__; │ │ │ │ +371 │ │ │ │ +372}; │ │ │ │ +373 │ │ │ │ +374 │ │ │ │ +375 │ │ │ │ +376template │ │ │ │ +_3_7_7class _L_a_g_r_a_n_g_e_N_o_d_e : │ │ │ │ +378 public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ +379{ │ │ │ │ +380 static constexpr int dim = GV::dimension; │ │ │ │ +381 static constexpr bool useDynamicOrder = (k<0); │ │ │ │ +382 │ │ │ │ +383 // Compute the GeometryType id in case the grid has only a single │ │ │ │ +GeometryType │ │ │ │ +384 static constexpr GeometryType::Id geometryTypeId() │ │ │ │ +385 { │ │ │ │ +386 if constexpr(Dune::Capabilities::hasSingleGeometryType:: │ │ │ │ +v) │ │ │ │ +387 return GeometryType(Dune::Capabilities::hasSingleGeometryType::topologyId, GV::dimension); │ │ │ │ +388 else │ │ │ │ +389 return GeometryType::Id(~0u); │ │ │ │ +390 } │ │ │ │ +391 │ │ │ │ +392 // Select the static LFECache if k >= 0, else the dynamic LFECache │ │ │ │ +393 using FiniteElementCache = std::conditional_t<(useDynamicOrder), │ │ │ │ +394 DynamicLagrangeLocalFiniteElementCache, │ │ │ │ +395 StaticLagrangeLocalFiniteElementCache │ │ │ │ +396 >; │ │ │ │ +397 │ │ │ │ +398 // Construct the FiniteElementCache depending on whether the order is │ │ │ │ +dynamic or static │ │ │ │ +399 static auto makeFiniteElementCache(unsigned int _o_r_d_e_r) │ │ │ │ +400 { │ │ │ │ +401 if constexpr (useDynamicOrder) │ │ │ │ +402 return FiniteElementCache{_o_r_d_e_r}; │ │ │ │ +403 else │ │ │ │ +404 return FiniteElementCache{}; │ │ │ │ +405 } │ │ │ │ +406 │ │ │ │ +407public: │ │ │ │ +408 │ │ │ │ +_4_0_9 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ +_4_1_0 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ +_4_1_1 using _F_i_n_i_t_e_E_l_e_m_e_n_t = typename FiniteElementCache::FiniteElementType; │ │ │ │ +412 │ │ │ │ +_4_1_4 _L_a_g_r_a_n_g_e_N_o_d_e() : │ │ │ │ +415 _L_a_g_r_a_n_g_e_N_o_d_e(k) │ │ │ │ +416 {} │ │ │ │ +417 │ │ │ │ +_4_1_9 _L_a_g_r_a_n_g_e_N_o_d_e(unsigned int _o_r_d_e_r) : │ │ │ │ +420 _o_r_d_e_r__(_o_r_d_e_r), │ │ │ │ +421 _c_a_c_h_e__(makeFiniteElementCache(_o_r_d_e_r)), │ │ │ │ +422 _f_i_n_i_t_e_E_l_e_m_e_n_t__(nullptr), │ │ │ │ +423 _e_l_e_m_e_n_t__(nullptr) │ │ │ │ +424 {} │ │ │ │ +425 │ │ │ │ +_4_2_7 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ +428 { │ │ │ │ +429 return *_e_l_e_m_e_n_t__; │ │ │ │ +430 } │ │ │ │ +431 │ │ │ │ +_4_3_6 const _F_i_n_i_t_e_E_l_e_m_e_n_t& _f_i_n_i_t_e_E_l_e_m_e_n_t() const │ │ │ │ +437 { │ │ │ │ +438 return *_f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ +439 } │ │ │ │ +440 │ │ │ │ +_4_4_2 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ +443 { │ │ │ │ +444 _e_l_e_m_e_n_t__ = &e; │ │ │ │ +445 _f_i_n_i_t_e_E_l_e_m_e_n_t__ = &(_c_a_c_h_e__.get(_e_l_e_m_e_n_t__->type())); │ │ │ │ +446 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__->size()); │ │ │ │ +447 } │ │ │ │ +448 │ │ │ │ +449protected: │ │ │ │ +450 │ │ │ │ +_4_5_1 unsigned int _o_r_d_e_r() const │ │ │ │ +452 { │ │ │ │ +453 return _o_r_d_e_r__; │ │ │ │ +454 } │ │ │ │ +455 │ │ │ │ +456 // Run-time order, only valid if k<0 │ │ │ │ +_4_5_7 unsigned int _o_r_d_e_r__; │ │ │ │ +458 │ │ │ │ +_4_5_9 FiniteElementCache _c_a_c_h_e__; │ │ │ │ +_4_6_0 const _F_i_n_i_t_e_E_l_e_m_e_n_t* _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ +_4_6_1 const _E_l_e_m_e_n_t* _e_l_e_m_e_n_t__; │ │ │ │ +462}; │ │ │ │ +463 │ │ │ │ +464 │ │ │ │ +465 │ │ │ │ +466namespace _B_a_s_i_s_F_a_c_t_o_r_y { │ │ │ │ +467 │ │ │ │ +476template │ │ │ │ +_4_7_7auto _l_a_g_r_a_n_g_e() │ │ │ │ +478{ │ │ │ │ +479 return [](const auto& gridView) { │ │ │ │ +480 return _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s, k, R>(gridView); │ │ │ │ +481 }; │ │ │ │ +482} │ │ │ │ +483 │ │ │ │ +491template │ │ │ │ +_4_9_2auto _l_a_g_r_a_n_g_e(int order) │ │ │ │ +493{ │ │ │ │ +494 return [=](const auto& gridView) { │ │ │ │ +495 return _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s, -1, R>(gridView, │ │ │ │ +order); │ │ │ │ +496 }; │ │ │ │ +497} │ │ │ │ +498 │ │ │ │ +499} // end namespace BasisFactory │ │ │ │ +500 │ │ │ │ +501 │ │ │ │ +502 │ │ │ │ +531template │ │ │ │ +_5_3_2using _L_a_g_r_a_n_g_e_B_a_s_i_s = _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_G_V_,_ _k_,_ _R_> >; │ │ │ │ +533 │ │ │ │ +534 │ │ │ │ +535 │ │ │ │ +536 │ │ │ │ +537 │ │ │ │ +538} // end namespace Functions │ │ │ │ +539} // end namespace Dune │ │ │ │ +540 │ │ │ │ +541 │ │ │ │ +542#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH │ │ │ │ +_n_o_d_e_s_._h_h │ │ │ │ +_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ +_l_e_a_f_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_l_a_g_r_a_n_g_e │ │ │ │ +auto lagrange() │ │ │ │ +Create a pre-basis factory that can create a Lagrange pre-basis. │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:477 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_B_a_s_i_s │ │ │ │ +DefaultGlobalBasis< LagrangePreBasis< GV, k, R > > LagrangeBasis │ │ │ │ +Nodal basis of a scalar k-th-order Lagrangean finite element space. │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:532 │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t │ │ │ │ -A wrapper providing small object optimization with polymorphic types. │ │ │ │ -DDeeffiinniittiioonn polymorphicsmallobject.hh:51 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_:_:_t_a_r_g_e_t___t_y_p_e │ │ │ │ -const std::type_info & target_type() const │ │ │ │ -Get type of stored object. │ │ │ │ -DDeeffiinniittiioonn typeerasure.hh:201 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e │ │ │ │ -TypeErasureBase(T &&t) │ │ │ │ -Construct wrapper from object. │ │ │ │ -DDeeffiinniittiioonn typeerasure.hh:174 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_<_ _t_y_p_e_n_a_m_e_ _T_r_a_i_t_s_:_:_C_o_n_c_e_p_t_,_ _T_r_a_i_t_s_:_:_t_e_m_p_l_a_t_e │ │ │ │ -_M_o_d_e_l_ _>_:_:_w_r_a_p_p_e_d__ │ │ │ │ -PolymorphicSmallObject< Imp::TypeErasureWrapperInterface< typename Traits:: │ │ │ │ -Concept >, 56 > wrapped_ │ │ │ │ -DDeeffiinniittiioonn typeerasure.hh:207 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e │ │ │ │ -TypeErasureBase()=default │ │ │ │ -Default constructor. │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_:_:_a_s_I_n_t_e_r_f_a_c_e │ │ │ │ -Interface & asInterface() │ │ │ │ -Get mutable reference to wrapped object. │ │ │ │ -DDeeffiinniittiioonn typeerasure.hh:182 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_:_:_a_s_I_n_t_e_r_f_a_c_e │ │ │ │ -const Interface & asInterface() const │ │ │ │ -Get reference to wrapped object. │ │ │ │ -DDeeffiinniittiioonn typeerasure.hh:188 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ +DDeeffiinniittiioonn argyrisbasis.hh:926 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ +Global basis for given pre-basis. │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:53 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:379 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_:_:_L_a_g_r_a_n_g_e_N_o_d_e │ │ │ │ +LagrangeNode(unsigned int order) │ │ │ │ +Constructor with a run-time order. │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:419 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_:_:_o_r_d_e_r │ │ │ │ +unsigned int order() const │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:451 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ +const FiniteElement & finiteElement() const │ │ │ │ +Return the LocalFiniteElement for the element we are bound to. │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:436 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_<_ _G_V_,_ _2_ _>_:_:_e_l_e_m_e_n_t__ │ │ │ │ +const Element * element_ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:461 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_:_:_e_l_e_m_e_n_t │ │ │ │ +const Element & element() const │ │ │ │ +Return current element, throw if unbound. │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:427 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_<_ _G_V_,_ _2_ _>_:_:_c_a_c_h_e__ │ │ │ │ +FiniteElementCache cache_ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:459 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_:_:_F_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ +typename FiniteElementCache::FiniteElementType FiniteElement │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:411 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_:_:_b_i_n_d │ │ │ │ +void bind(const Element &e) │ │ │ │ +Bind to element. │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:442 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_:_:_E_l_e_m_e_n_t │ │ │ │ +typename GV::template Codim< 0 >::Entity Element │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:410 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_<_ _G_V_,_ _2_ _>_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t__ │ │ │ │ +const FiniteElement * finiteElement_ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:460 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_<_ _G_V_,_ _2_ _>_:_:_o_r_d_e_r__ │ │ │ │ +unsigned int order_ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:457 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_:_:_s_i_z_e___t_y_p_e │ │ │ │ +std::size_t size_type │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:409 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_N_o_d_e_:_:_L_a_g_r_a_n_g_e_N_o_d_e │ │ │ │ +LagrangeNode() │ │ │ │ +Constructor without order (uses the compile-time value). │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:414 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s │ │ │ │ +A pre-basis for a PQ-lagrange bases with given order. │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:65 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_d_o_f_s_P_e_r_P_r_i_s_m │ │ │ │ +size_type dofsPerPrism() const │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:325 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_c_o_m_p_u_t_e_D_o_f_s_P_e_r_C_u_b_e │ │ │ │ +size_type computeDofsPerCube(std::size_t cubeDim) const │ │ │ │ +Number of degrees of freedom assigned to a cube (without the ones assigned to │ │ │ │ +its faces!... │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:342 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_c_o_m_p_u_t_e_D_o_f_s_P_e_r_S_i_m_p_l_e_x │ │ │ │ +size_type computeDofsPerSimplex(std::size_t simplexDim) const │ │ │ │ +Number of degrees of freedom assigned to a simplex (without the ones assigned │ │ │ │ +to its faces!... │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:336 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_c_o_m_p_u_t_e_D_o_f_s_P_e_r_P_r_i_s_m │ │ │ │ +size_type computeDofsPerPrism() const │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:347 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_o_r_d_e_r__ │ │ │ │ +unsigned int order_ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:311 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_e_d_g_e_O_f_f_s_e_t__ │ │ │ │ +size_type edgeOffset_ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:364 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_N_o_d_e │ │ │ │ +LagrangeNode< GV, k, R > Node │ │ │ │ +Template mapping root tree path to type of created tree node. │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:78 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_d_o_f_s_P_e_r_S_i_m_p_l_e_x__ │ │ │ │ +std::array< size_type, dim+1 > dofsPerSimplex_ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:358 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_i_n_d_i_c_e_s │ │ │ │ +It indices(const Node &node, It it) const │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:184 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_v_e_r_t_e_x_O_f_f_s_e_t__ │ │ │ │ +size_type vertexOffset_ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:363 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_d_o_f_s_P_e_r_S_i_m_p_l_e_x │ │ │ │ +size_type dofsPerSimplex(std::size_t simplexDim) const │ │ │ │ +Number of degrees of freedom assigned to a simplex (without the ones assigned │ │ │ │ +to its faces!... │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:314 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_s_i_z_e___t_y_p_e │ │ │ │ +std::size_t size_type │ │ │ │ +Type used for indices and size information. │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:75 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_p_y_r_a_m_i_d_O_f_f_s_e_t__ │ │ │ │ +size_type pyramidOffset_ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:368 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_p_r_i_s_m_O_f_f_s_e_t__ │ │ │ │ +size_type prismOffset_ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:369 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_t_e_t_r_a_h_e_d_r_o_n_O_f_f_s_e_t__ │ │ │ │ +size_type tetrahedronOffset_ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:367 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ +void initializeIndices() │ │ │ │ +Initialize the global indices. │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:102 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_c_o_m_p_u_t_e_D_o_f_s_P_e_r_P_y_r_a_m_i_d │ │ │ │ +size_type computeDofsPerPyramid() const │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:352 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s │ │ │ │ +LagrangePreBasis(const GridView &gv, unsigned int order) │ │ │ │ +Constructor for a given grid view object and run-time order. │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:86 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_d_o_f_s_P_e_r_P_y_r_a_m_i_d__ │ │ │ │ +size_type dofsPerPyramid_ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:361 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ +size_type dimension() const │ │ │ │ +Get the total dimension of the space spanned by this basis. │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:146 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s │ │ │ │ +LagrangePreBasis(const GridView &gv) │ │ │ │ +Constructor for a given grid view object with compile-time order. │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:81 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_u_p_d_a_t_e │ │ │ │ +void update(const GridView &gv) │ │ │ │ +Update the stored grid view, to be called if the grid has changed. │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:132 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ +GV GridView │ │ │ │ +The grid view that the FE basis is defined on. │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:72 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_q_u_a_d_r_i_l_a_t_e_r_a_l_O_f_f_s_e_t__ │ │ │ │ +size_type quadrilateralOffset_ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:366 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_g_r_i_d_V_i_e_w │ │ │ │ +const GridView & gridView() const │ │ │ │ +Obtain the grid view that the basis is defined on. │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:126 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_g_r_i_d_V_i_e_w__ │ │ │ │ +GridView gridView_ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:308 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_m_a_k_e_N_o_d_e │ │ │ │ +Node makeNode() const │ │ │ │ +Create tree node. │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:140 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_o_r_d_e_r │ │ │ │ +unsigned int order() const │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:302 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_d_o_f_s_P_e_r_C_u_b_e__ │ │ │ │ +std::array< size_type, dim+1 > dofsPerCube_ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:359 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_m_a_x_N_o_d_e_S_i_z_e │ │ │ │ +size_type maxNodeSize() const │ │ │ │ +Get the maximal number of DOFs associated to node for any element. │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:176 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_d_o_f_s_P_e_r_P_r_i_s_m__ │ │ │ │ +size_type dofsPerPrism_ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:360 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_d_o_f_s_P_e_r_C_u_b_e │ │ │ │ +size_type dofsPerCube(std::size_t cubeDim) const │ │ │ │ +Number of degrees of freedom assigned to a cube (without the ones assigned to │ │ │ │ +its faces!... │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:320 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_t_r_i_a_n_g_l_e_O_f_f_s_e_t__ │ │ │ │ +size_type triangleOffset_ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:365 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_ _>_:_:_h_e_x_a_h_e_d_r_o_n_O_f_f_s_e_t__ │ │ │ │ +size_type hexahedronOffset_ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:370 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_:_:_d_o_f_s_P_e_r_P_y_r_a_m_i_d │ │ │ │ +size_type dofsPerPyramid() const │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:330 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_i_x_i_n │ │ │ │ +A generic MixIn class for PreBasis. │ │ │ │ +DDeeffiinniittiioonn leafprebasismixin.hh:36 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_e_t_S_i_z_e │ │ │ │ +void setSize(const size_type size) │ │ │ │ +DDeeffiinniittiioonn nodes.hh:197 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ +DDeeffiinniittiioonn nodes.hh:218 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _t_y_p_e_e_r_a_s_u_r_e_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _l_a_g_r_a_n_g_e_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00200.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: type_traits.hh File Reference │ │ │ +Dune-Functions: hierarchicnodetorangemap.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,62 +88,47 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
type_traits.hh File Reference
│ │ │ +
hierarchicnodetorangemap.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <type_traits>
│ │ │ -#include <dune/common/hybridutilities.hh>
│ │ │ -#include <dune/common/typeutilities.hh>
│ │ │ +
#include <utility>
│ │ │ +#include <type_traits>
│ │ │ +#include <dune/common/concept.hh>
│ │ │ +#include <dune/functions/functionspacebases/concepts.hh>
│ │ │ +#include <dune/functions/common/indexaccess.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

struct  Dune::Functions::HasStaticSize< T >
 Check if type is a statically sized container. More...
struct  Dune::Functions::StaticSizeOrZero< T >
 Obtain size of statically sized container, or 0 if dynamic size. More...
struct  Dune::Functions::HierarchicNodeToRangeMap
 A simple node to range map using the nested tree indices. More...
│ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -

│ │ │ -Typedefs

template<class T, class... Args>
using Dune::Functions::enableIfConstructible
 Helper to constrain forwarding constructors.
template<class T>
using Dune::Functions::StaticSize
 Obtain size of statically sized container as integral_constant, or fail.
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │

│ │ │ -Variables

template<class T>
constexpr bool Dune::Functions::HasStaticSize_v = HasStaticSize<T>::value
 A variable template representing the value of HasStaticSize.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,34 +1,22 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -type_traits.hh File Reference │ │ │ │ +hierarchicnodetorangemap.hh File Reference │ │ │ │ +#include │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_i_n_d_e_x_a_c_c_e_s_s_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_a_s_S_t_a_t_i_c_S_i_z_e_<_ _T_ _> │ │ │ │ -  Check if type is a statically sized container. _M_o_r_e_._._. │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_S_i_z_e_O_r_Z_e_r_o_<_ _T_ _> │ │ │ │ -  Obtain size of statically sized container, or 0 if dynamic size. │ │ │ │ - _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_N_o_d_e_T_o_R_a_n_g_e_M_a_p │ │ │ │ +  A simple node to range map using the nested tree indices. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -TTyyppeeddeeffss │ │ │ │ -template │ │ │ │ -using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_e_n_a_b_l_e_I_f_C_o_n_s_t_r_u_c_t_i_b_l_e │ │ │ │ -  Helper to constrain forwarding constructors. │ │ │ │ -template │ │ │ │ -using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_S_i_z_e │ │ │ │ -  Obtain size of statically sized container as integral_constant, or fail. │ │ │ │ -VVaarriiaabblleess │ │ │ │ -template │ │ │ │ -constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_a_s_S_t_a_t_i_c_S_i_z_e___v = _H_a_s_S_t_a_t_i_c_S_i_z_e::value │ │ │ │ -  A variable template representing the value of _H_a_s_S_t_a_t_i_c_S_i_z_e. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _t_y_p_e___t_r_a_i_t_s_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _h_i_e_r_a_r_c_h_i_c_n_o_d_e_t_o_r_a_n_g_e_m_a_p_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00200.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,5 +1,3 @@ │ │ │ │ var a00200 = [ │ │ │ │ - ["Dune::Functions::enableIfConstructible", "a00314.html#gae56cc95e9c26568861b3fddae9983080", null], │ │ │ │ - ["Dune::Functions::StaticSize", "a00314.html#ga3e9a8b5a2dac8ad92d9000f0e7187ba4", null], │ │ │ │ - ["Dune::Functions::HasStaticSize_v", "a00318.html#a2af05857c767d4f5ef189624a63d5861", null] │ │ │ │ + ["Dune::Functions::HierarchicNodeToRangeMap", "a01906.html", "a01906"] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00200_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: type_traits.hh Source File │ │ │ +Dune-Functions: hierarchicnodetorangemap.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,81 +88,83 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
type_traits.hh
│ │ │ +
hierarchicnodetorangemap.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH
│ │ │ -
8#define DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH
│ │ │ +
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH
│ │ │
9
│ │ │ -
10#include <type_traits>
│ │ │ -
11
│ │ │ -
12#include <dune/common/hybridutilities.hh>
│ │ │ -
13#include <dune/common/typeutilities.hh>
│ │ │ -
14
│ │ │ -
15namespace Dune {
│ │ │ -
16namespace Functions {
│ │ │ -
17
│ │ │ -
18
│ │ │ -
29template<class T, class... Args>
│ │ │ -
30using enableIfConstructible = std::enable_if_t<
│ │ │ -
31 std::is_constructible_v<T, Args...>, int>;
│ │ │ -
32
│ │ │ -
33
│ │ │ -
34
│ │ │ -
42template<class T>
│ │ │ -
│ │ │ - │ │ │ -
44 public IsIntegralConstant<decltype(Dune::Hybrid::size(std::declval<T>()))>
│ │ │ -
45{};
│ │ │ -
│ │ │ -
46
│ │ │ -
48template<class T>
│ │ │ - │ │ │ +
10
│ │ │ +
11#include <utility>
│ │ │ +
12#include <type_traits>
│ │ │ +
13
│ │ │ +
14#include <dune/common/concept.hh>
│ │ │ +
15
│ │ │ + │ │ │ + │ │ │ +
18
│ │ │ +
19namespace Dune {
│ │ │ +
20namespace Functions {
│ │ │ +
21
│ │ │ +
22
│ │ │ +
23
│ │ │ +
│ │ │ + │ │ │ +
34{
│ │ │ +
35 template<class Node, class TreePath, class Range,
│ │ │ +
36 std::enable_if_t< models<Concept::HasIndexAccess, Range, Dune::index_constant<0>>(), int> = 0>
│ │ │ +
│ │ │ +
37 decltype(auto) operator()(const Node&, const TreePath& treePath, Range&& y) const
│ │ │ +
38 {
│ │ │ +
39 return resolveStaticMultiIndex(y, treePath);
│ │ │ +
40 }
│ │ │ +
│ │ │ +
41
│ │ │ +
42 template<class Node, class TreePath, class Range,
│ │ │ +
43 std::enable_if_t<not models<Concept::HasIndexAccess, Range, Dune::index_constant<0>>(), int> = 0>
│ │ │ +
│ │ │ +
44 decltype(auto) operator()(const Node&, const TreePath&, Range&& y) const
│ │ │ +
45 {
│ │ │ +
46 return std::forward<Range>(y);
│ │ │ +
47 }
│ │ │ +
│ │ │ +
48};
│ │ │ +
│ │ │ +
49
│ │ │
50
│ │ │ -
51
│ │ │ -
59template<class T>
│ │ │ -
│ │ │ - │ │ │ -
61 public std::conditional_t<HasStaticSize_v<T>,
│ │ │ -
62 decltype(Dune::Hybrid::size(std::declval<T>())),
│ │ │ -
63 std::integral_constant<std::size_t,0>>
│ │ │ -
64{};
│ │ │ -
│ │ │ -
65
│ │ │ -
70template<class T>
│ │ │ -
71using StaticSize = std::enable_if_t<HasStaticSize_v<T>,
│ │ │ -
72 decltype(Dune::Hybrid::size(std::declval<T>()))>;
│ │ │ -
73
│ │ │ -
74
│ │ │ -
75}} // namespace Dune::Functions
│ │ │ -
76
│ │ │ -
77#endif // DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH
│ │ │ -
std::enable_if_t< HasStaticSize_v< T >, decltype(Dune::Hybrid::size(std::declval< T >()))> StaticSize
Obtain size of statically sized container as integral_constant, or fail.
Definition type_traits.hh:71
│ │ │ -
std::enable_if_t< std::is_constructible_v< T, Args... >, int > enableIfConstructible
Helper to constrain forwarding constructors.
Definition type_traits.hh:30
│ │ │ +
51
│ │ │ +
52} // namespace Dune::Functions
│ │ │ +
53} // namespace Dune
│ │ │ +
54
│ │ │ +
55
│ │ │ +
56#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH
│ │ │ + │ │ │ +
constexpr decltype(auto) resolveStaticMultiIndex(C &&c, const MultiIndex &multiIndex)
Provide multi-index access by chaining operator[].
Definition indexaccess.hh:421
│ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
constexpr bool HasStaticSize_v
A variable template representing the value of HasStaticSize.
Definition type_traits.hh:49
│ │ │ -
Check if type is a statically sized container.
Definition type_traits.hh:45
│ │ │ -
Obtain size of statically sized container, or 0 if dynamic size.
Definition type_traits.hh:64
│ │ │ +
A simple node to range map using the nested tree indices.
Definition hierarchicnodetorangemap.hh:34
│ │ │ +
decltype(auto) operator()(const Node &, const TreePath &treePath, Range &&y) const
Definition hierarchicnodetorangemap.hh:37
│ │ │ +
decltype(auto) operator()(const Node &, const TreePath &, Range &&y) const
Definition hierarchicnodetorangemap.hh:44
│ │ │ + │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,85 +1,84 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -type_traits.hh │ │ │ │ +hierarchicnodetorangemap.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH │ │ │ │ -8#define DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH │ │ │ │ +8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11 │ │ │ │ -12#include │ │ │ │ -13#include │ │ │ │ -14 │ │ │ │ -15namespace _D_u_n_e { │ │ │ │ -16namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -17 │ │ │ │ +10 │ │ │ │ +11#include │ │ │ │ +12#include │ │ │ │ +13 │ │ │ │ +14#include │ │ │ │ +15 │ │ │ │ +16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_i_n_d_e_x_a_c_c_e_s_s_._h_h> │ │ │ │ 18 │ │ │ │ -29template │ │ │ │ -_3_0using _e_n_a_b_l_e_I_f_C_o_n_s_t_r_u_c_t_i_b_l_e = std::enable_if_t< │ │ │ │ -31 std::is_constructible_v, int>; │ │ │ │ -32 │ │ │ │ -33 │ │ │ │ -34 │ │ │ │ -42template │ │ │ │ -_4_3struct _H_a_s_S_t_a_t_i_c_S_i_z_e : │ │ │ │ -44 public IsIntegralConstant()))> │ │ │ │ -45{}; │ │ │ │ -46 │ │ │ │ -48template │ │ │ │ -_4_9inline constexpr bool _H_a_s_S_t_a_t_i_c_S_i_z_e___v = _H_a_s_S_t_a_t_i_c_S_i_z_e_<_T_>_:_:_v_a_l_u_e; │ │ │ │ +19namespace _D_u_n_e { │ │ │ │ +20namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +21 │ │ │ │ +22 │ │ │ │ +23 │ │ │ │ +_3_3struct _H_i_e_r_a_r_c_h_i_c_N_o_d_e_T_o_R_a_n_g_e_M_a_p │ │ │ │ +34{ │ │ │ │ +35 template>(), int> = 0> │ │ │ │ +_3_7 decltype(auto) _o_p_e_r_a_t_o_r_(_)(const Node&, const TreePath& treePath, Range&& y) │ │ │ │ +const │ │ │ │ +38 { │ │ │ │ +39 return _r_e_s_o_l_v_e_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x(y, treePath); │ │ │ │ +40 } │ │ │ │ +41 │ │ │ │ +42 template>(), int> = 0> │ │ │ │ +_4_4 decltype(auto) _o_p_e_r_a_t_o_r_(_)(const Node&, const TreePath&, Range&& y) const │ │ │ │ +45 { │ │ │ │ +46 return std::forward(y); │ │ │ │ +47 } │ │ │ │ +48}; │ │ │ │ +49 │ │ │ │ 50 │ │ │ │ 51 │ │ │ │ -59template │ │ │ │ -_6_0struct _S_t_a_t_i_c_S_i_z_e_O_r_Z_e_r_o : │ │ │ │ -61 public std::conditional_t, │ │ │ │ -62 decltype(Dune::Hybrid::size(std::declval())), │ │ │ │ -63 std::integral_constant> │ │ │ │ -64{}; │ │ │ │ -65 │ │ │ │ -70template │ │ │ │ -_7_1using _S_t_a_t_i_c_S_i_z_e = std::enable_if_t, │ │ │ │ -72 decltype(Dune::Hybrid::size(std::declval()))>; │ │ │ │ -73 │ │ │ │ -74 │ │ │ │ -75}} // namespace Dune::Functions │ │ │ │ -76 │ │ │ │ -77#endif // DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_S_i_z_e │ │ │ │ -std::enable_if_t< HasStaticSize_v< T >, decltype(Dune::Hybrid::size(std:: │ │ │ │ -declval< T >()))> StaticSize │ │ │ │ -Obtain size of statically sized container as integral_constant, or fail. │ │ │ │ -DDeeffiinniittiioonn type_traits.hh:71 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_e_n_a_b_l_e_I_f_C_o_n_s_t_r_u_c_t_i_b_l_e │ │ │ │ -std::enable_if_t< std::is_constructible_v< T, Args... >, int > │ │ │ │ -enableIfConstructible │ │ │ │ -Helper to constrain forwarding constructors. │ │ │ │ -DDeeffiinniittiioonn type_traits.hh:30 │ │ │ │ +52} // namespace Dune::Functions │ │ │ │ +53} // namespace Dune │ │ │ │ +54 │ │ │ │ +55 │ │ │ │ +56#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH │ │ │ │ +_i_n_d_e_x_a_c_c_e_s_s_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_r_e_s_o_l_v_e_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x │ │ │ │ +constexpr decltype(auto) resolveStaticMultiIndex(C &&c, const MultiIndex │ │ │ │ +&multiIndex) │ │ │ │ +Provide multi-index access by chaining operator[]. │ │ │ │ +DDeeffiinniittiioonn indexaccess.hh:421 │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_a_s_S_t_a_t_i_c_S_i_z_e___v │ │ │ │ -constexpr bool HasStaticSize_v │ │ │ │ -A variable template representing the value of HasStaticSize. │ │ │ │ -DDeeffiinniittiioonn type_traits.hh:49 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_a_s_S_t_a_t_i_c_S_i_z_e │ │ │ │ -Check if type is a statically sized container. │ │ │ │ -DDeeffiinniittiioonn type_traits.hh:45 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_S_i_z_e_O_r_Z_e_r_o │ │ │ │ -Obtain size of statically sized container, or 0 if dynamic size. │ │ │ │ -DDeeffiinniittiioonn type_traits.hh:64 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_N_o_d_e_T_o_R_a_n_g_e_M_a_p │ │ │ │ +A simple node to range map using the nested tree indices. │ │ │ │ +DDeeffiinniittiioonn hierarchicnodetorangemap.hh:34 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_N_o_d_e_T_o_R_a_n_g_e_M_a_p_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ +decltype(auto) operator()(const Node &, const TreePath &treePath, Range &&y) │ │ │ │ +const │ │ │ │ +DDeeffiinniittiioonn hierarchicnodetorangemap.hh:37 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_N_o_d_e_T_o_R_a_n_g_e_M_a_p_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ +decltype(auto) operator()(const Node &, const TreePath &, Range &&y) const │ │ │ │ +DDeeffiinniittiioonn hierarchicnodetorangemap.hh:44 │ │ │ │ +_c_o_n_c_e_p_t_s_._h_h │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _t_y_p_e___t_r_a_i_t_s_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _h_i_e_r_a_r_c_h_i_c_n_o_d_e_t_o_r_a_n_g_e_m_a_p_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00203.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: subdomain.hh File Reference │ │ │ +Dune-Functions: transformedfiniteelementmixin.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,84 +88,41 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
subdomain.hh File Reference
│ │ │ +
transformedfiniteelementmixin.hh File Reference
│ │ │
│ │ │
│ │ │
#include <array>
│ │ │ -#include <cstddef>
│ │ │ -#include <limits>
│ │ │ #include <type_traits>
│ │ │ #include <utility>
│ │ │ #include <vector>
│ │ │ -#include <dune/common/exceptions.hh>
│ │ │ -#include <dune/common/iteratorfacades.hh>
│ │ │ -#include <dune/common/iteratorrange.hh>
│ │ │ -#include <dune/common/rangeutilities.hh>
│ │ │ -#include <dune/geometry/type.hh>
│ │ │ -#include <dune/geometry/typeindex.hh>
│ │ │ -#include <dune/grid/common/mcmgmapper.hh>
│ │ │ -#include <dune/grid/common/partitionset.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -

│ │ │ -Classes

class  Dune::Functions::Experimental::SubDomainIndexSet< HGV >
 An IndexSet for a sub-domain. More...
struct  Dune::Functions::Experimental::SubDomainIndexSet< HGV >::Codim< codim >
 Codim specific typedefs. More...
class  Dune::Functions::Experimental::SubDomainGridView< HGV >
 A GridView for a sub-domain. More...
struct  Dune::Functions::Experimental::SubDomainGridView< HGV >::Codim< codim >
 Codim specific typedefs. More...
struct  Dune::Functions::Experimental::SubDomainGridView< HGV >::Codim< codim >::Partition< pit >
class  Dune::Functions::Experimental::SubDomain< HGV >
 Class representing a sub-domain of a GridView. More...
struct  Dune::Functions::Experimental::SubDomain< HGV >::Codim< codim >
 Codim specific typedefs. More...
class  Dune::Functions::Experimental::SubDomainInterface< SubDomainA, SubDomainB >
 Class representing the intersection between two subdomains. More...
class  Dune::Functions::Experimental::SubDomainSkeleton< SubDomain >
 Class representing the skeleton of a subdomain. More...
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ -

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::Experimental
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │

│ │ │ -Functions

template<class HostGridView>
auto Dune::Functions::Experimental::elements (const SubDomainGridView< HostGridView > &subDomainGridView)
 ADL findable access to element range for a SubDomainGridView.
template<class HostGridView, unsigned int partitions>
auto Dune::Functions::Experimental::elements (const SubDomainGridView< HostGridView > &subDomainGridView, Dune::PartitionSet< partitions > partitionSet)
 ADL findable access to element range for a SubDomainGridView.
template<class HostGridView, class Element>
auto Dune::Functions::Experimental::intersections (const SubDomainGridView< HostGridView > &subDomainGridView, const Element &element)
 ADL findable access to intersection range for an element of a SubDomainGridView.
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,66 +1,18 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -subdomain.hh File Reference │ │ │ │ +transformedfiniteelementmixin.hh File Reference │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ #include │ │ │ │ #include │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ -CCllaasssseess │ │ │ │ - class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_<_ _H_G_V_ _> │ │ │ │ -  An IndexSet for a sub-domain. _M_o_r_e_._._. │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_<_ _H_G_V_ _>_:_:_C_o_d_i_m_<_ _c_o_d_i_m │ │ │ │ - _> │ │ │ │ -  _C_o_d_i_m specific typedefs. _M_o_r_e_._._. │ │ │ │ - class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_<_ _H_G_V_ _> │ │ │ │ -  A GridView for a sub-domain. _M_o_r_e_._._. │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_<_ _H_G_V_ _>_:_:_C_o_d_i_m_<_ _c_o_d_i_m │ │ │ │ - _> │ │ │ │ -  _C_o_d_i_m specific typedefs. _M_o_r_e_._._. │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_<_ _H_G_V_ _>_:_:_C_o_d_i_m_<_ _c_o_d_i_m │ │ │ │ - _>_:_:_P_a_r_t_i_t_i_o_n_<_ _p_i_t_ _> │ │ │ │ - class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_<_ _H_G_V_ _> │ │ │ │ -  Class representing a sub-domain of a _G_r_i_d_V_i_e_w. _M_o_r_e_._._. │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_<_ _H_G_V_ _>_:_:_C_o_d_i_m_<_ _c_o_d_i_m_ _> │ │ │ │ -  _C_o_d_i_m specific typedefs. _M_o_r_e_._._. │ │ │ │ - class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_t_e_r_f_a_c_e_<_ _S_u_b_D_o_m_a_i_n_A_, │ │ │ │ - _S_u_b_D_o_m_a_i_n_B_ _> │ │ │ │ -  Class representing the intersection between two subdomains. _M_o_r_e_._._. │ │ │ │ - class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_S_k_e_l_e_t_o_n_<_ _S_u_b_D_o_m_a_i_n_ _> │ │ │ │ -  Class representing the skeleton of a subdomain. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l │ │ │ │ -FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_e_l_e_m_e_n_t_s (const _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w< │ │ │ │ - HostGridView > &subDomainGridView) │ │ │ │ -  ADL findable access to element range for a _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w. │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_e_l_e_m_e_n_t_s (const _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w< │ │ │ │ - HostGridView > &subDomainGridView, Dune::PartitionSet< partitions > │ │ │ │ - partitionSet) │ │ │ │ -  ADL findable access to element range for a _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w. │ │ │ │ -template │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_i_n_t_e_r_s_e_c_t_i_o_n_s (const _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w< │ │ │ │ - HostGridView > &subDomainGridView, const Element &element) │ │ │ │ -  ADL findable access to intersection range for an element of a │ │ │ │ - _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _s_u_b_d_o_m_a_i_n_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _t_r_a_n_s_f_o_r_m_e_d_f_i_n_i_t_e_e_l_e_m_e_n_t_m_i_x_i_n_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00203_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: subdomain.hh Source File │ │ │ +Dune-Functions: transformedfiniteelementmixin.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,806 +88,129 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
subdomain.hh
│ │ │ +
transformedfiniteelementmixin.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_COMMON_SUBDOMAIN_HH
│ │ │ -
8#define DUNE_FUNCTIONS_COMMON_SUBDOMAIN_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDFINITEELEMENTMIXIN_HH
│ │ │ +
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDFINITEELEMENTMIXIN_HH
│ │ │
9
│ │ │
10#include <array>
│ │ │ -
11#include <cstddef>
│ │ │ -
12#include <limits>
│ │ │ -
13#include <type_traits>
│ │ │ -
14#include <utility>
│ │ │ -
15#include <vector>
│ │ │ -
16
│ │ │ -
17#include <dune/common/exceptions.hh>
│ │ │ -
18#include <dune/common/iteratorfacades.hh>
│ │ │ -
19#include <dune/common/iteratorrange.hh>
│ │ │ -
20#include <dune/common/rangeutilities.hh>
│ │ │ -
21
│ │ │ -
22#include <dune/geometry/type.hh>
│ │ │ -
23#include <dune/geometry/typeindex.hh>
│ │ │ -
24
│ │ │ -
25#include <dune/grid/common/mcmgmapper.hh>
│ │ │ -
26#include <dune/grid/common/partitionset.hh>
│ │ │ -
27
│ │ │ -
│ │ │ - │ │ │ +
11#include <type_traits>
│ │ │ +
12#include <utility>
│ │ │ +
13#include <vector>
│ │ │ +
14
│ │ │ +
15namespace Dune::Functions::Impl {
│ │ │ +
16
│ │ │ +
24template<class FEImplementation, class ReferenceLocalBasisTraits>
│ │ │ +
25class TransformedLocalBasis
│ │ │ +
26{
│ │ │ +
27 public:
│ │ │ +
28 using Traits = ReferenceLocalBasisTraits;
│ │ │
29
│ │ │ -
30 namespace Impl {
│ │ │ -
31
│ │ │ -
32 template<class GridView>
│ │ │ -
33 using GlobalIntersectionIteratorTraits = Dune::DefaultIteratorTraits<
│ │ │ -
34 std::forward_iterator_tag,
│ │ │ -
35 decltype(*std::declval<typename GridView::IntersectionIterator>())>;
│ │ │ -
36
│ │ │ -
37
│ │ │ -
38 template<class GV, class ContainsCallback>
│ │ │ -
39 class GlobalIntersectionIt
│ │ │ -
40 : public Dune::IteratorFacadeForTraits<GlobalIntersectionIt<GV, ContainsCallback>, GlobalIntersectionIteratorTraits<GV>>
│ │ │ -
41 {
│ │ │ -
42 using Facade = Dune::IteratorFacadeForTraits<GlobalIntersectionIt<GV, ContainsCallback>, GlobalIntersectionIteratorTraits<GV>>;
│ │ │ -
43
│ │ │ -
44 public:
│ │ │ -
45
│ │ │ -
46 using GridView = GV;
│ │ │ -
47 using Element = typename GridView::template Codim<0>::Entity;
│ │ │ -
48 using ElementIterator = typename GridView::template Codim<0>::Iterator;
│ │ │ -
49 using IntersectionIterator = typename GridView::IntersectionIterator;
│ │ │ -
50
│ │ │ -
51 class SentinelIterator
│ │ │ -
52 {};
│ │ │ -
53
│ │ │ -
54 GlobalIntersectionIt(const GridView& gridView, const ContainsCallback& contains, ElementIterator elementIt, ElementIterator elementEnd)
│ │ │ -
55 : gridView_(gridView)
│ │ │ -
56 , contains_(contains)
│ │ │ -
57 , elementIt_(std::move(elementIt))
│ │ │ -
58 , elementEnd_(std::move(elementEnd))
│ │ │ -
59 {
│ │ │ -
60 if (elementIt_ != elementEnd_)
│ │ │ -
61 {
│ │ │ -
62 element_ = *elementIt_;
│ │ │ -
63 iIt_ = gridView_.ibegin(element_);
│ │ │ -
64 iEnd_ = gridView_.iend(element_);
│ │ │ -
65 if (not contains_(*iIt_))
│ │ │ -
66 ++(*this);
│ │ │ -
67 }
│ │ │ -
68 }
│ │ │ -
69
│ │ │ -
70 using reference = typename Facade::reference;
│ │ │ -
71
│ │ │ -
72 reference operator*() const
│ │ │ -
73 {
│ │ │ -
74 return *iIt_;
│ │ │ -
75 }
│ │ │ -
76
│ │ │ -
77 GlobalIntersectionIt& operator++()
│ │ │ -
78 {
│ │ │ -
79 while(true)
│ │ │ -
80 {
│ │ │ -
81 ++iIt_;
│ │ │ -
82 if (iIt_ == iEnd_)
│ │ │ -
83 {
│ │ │ -
84 ++elementIt_;
│ │ │ -
85 if (elementIt_ == elementEnd_)
│ │ │ -
86 return *this;
│ │ │ -
87 element_ = *elementIt_;
│ │ │ -
88 iIt_ = gridView_.ibegin(element_);
│ │ │ -
89 iIt_ = gridView_.ibegin(element_);
│ │ │ -
90 iEnd_ = gridView_.iend(element_);
│ │ │ -
91 }
│ │ │ -
92 if (contains_(*iIt_))
│ │ │ -
93 return *this;
│ │ │ -
94 }
│ │ │ -
95 return *this;
│ │ │ -
96 }
│ │ │ -
97
│ │ │ -
98 friend bool operator==(const GlobalIntersectionIt& it1, const GlobalIntersectionIt& it2)
│ │ │ -
99 {
│ │ │ -
100 if (it1.elementIt_ != it2.elementIt_)
│ │ │ -
101 return false;
│ │ │ -
102 if (it1.elementIt_ == it1.elementEnd_)
│ │ │ -
103 return true;
│ │ │ -
104 return (it1.iIt_ == it2.iIt_);
│ │ │ -
105 }
│ │ │ -
106
│ │ │ -
107 friend bool operator==(const GlobalIntersectionIt& it1, const SentinelIterator& it2)
│ │ │ -
108 {
│ │ │ -
109 return it1.elementIt_ == it1.elementEnd_;
│ │ │ -
110 }
│ │ │ -
111
│ │ │ -
112 private:
│ │ │ -
113 GridView gridView_;
│ │ │ -
114 ContainsCallback contains_;
│ │ │ -
115 ElementIterator elementIt_;
│ │ │ -
116 ElementIterator elementEnd_;
│ │ │ -
117 Element element_;
│ │ │ -
118 IntersectionIterator iIt_;
│ │ │ -
119 IntersectionIterator iEnd_;
│ │ │ -
120 };
│ │ │ -
121
│ │ │ -
122 }
│ │ │ -
123
│ │ │ -
124
│ │ │ -
125
│ │ │ -
146 template<class HGV>
│ │ │ -
│ │ │ - │ │ │ -
148 {
│ │ │ -
149 using HostGridView = HGV;
│ │ │ -
150
│ │ │ -
151 public:
│ │ │ -
152
│ │ │ -
153 using Grid = typename HostGridView::Grid;
│ │ │ -
154 using Types = std::vector<Dune::GeometryType>;
│ │ │ -
155 using IndexType = std::size_t;
│ │ │ -
156
│ │ │ -
158 template<int codim>
│ │ │ -
│ │ │ -
159 struct Codim
│ │ │ -
160 {
│ │ │ -
161 using Entity = typename Grid::template Codim<codim>::Entity;
│ │ │ -
162 using EntitySeed = typename Grid::template Codim<codim>::EntitySeed;
│ │ │ -
163 using Geometry = typename Grid::template Codim<codim>::Geometry;
│ │ │ -
164 using LocalGeometry = typename Grid::template Codim<codim>::LocalGeometry;
│ │ │ -
165 };
│ │ │ -
│ │ │ -
166
│ │ │ -
167 enum {dimension = Grid::dimension};
│ │ │ -
168
│ │ │ -
169 private:
│ │ │ -
170
│ │ │ -
171 using AllEntityMapper = Dune::MultipleCodimMultipleGeomTypeMapper<HostGridView>;
│ │ │ -
172
│ │ │ -
173 static auto allCodimLayout()
│ │ │ -
174 {
│ │ │ -
175 return [](Dune::GeometryType, int) { return true; };
│ │ │ -
176 }
│ │ │ -
177
│ │ │ -
178 static constexpr auto typeIndexSize = Dune::GlobalGeometryTypeIndex::size(dimension);
│ │ │ -
179 static constexpr auto unusesIndex = std::numeric_limits<IndexType>::max();
│ │ │ -
180
│ │ │ -
181 public:
│ │ │ -
182
│ │ │ -
│ │ │ -
184 SubDomainIndexSet(const HostGridView& hostGridView)
│ │ │ - │ │ │ -
186 , allEntityMapper_(hostGridView_, allCodimLayout())
│ │ │ -
187 {
│ │ │ -
188 clear();
│ │ │ -
189 }
│ │ │ -
│ │ │ -
190
│ │ │ -
191 // *********************************
│ │ │ -
192 // IndexSet interface methods
│ │ │ -
193 // *********************************
│ │ │ -
194
│ │ │ -
│ │ │ -
195 IndexType size(Dune::GeometryType gt) const
│ │ │ -
196 {
│ │ │ -
197 return sizePerGT_[Dune::GlobalGeometryTypeIndex::index(gt)];
│ │ │ -
198 }
│ │ │ -
│ │ │ -
199
│ │ │ -
│ │ │ -
200 IndexType size(int codim) const
│ │ │ -
201 {
│ │ │ -
202 return sizePerCodim_[codim];
│ │ │ -
203 }
│ │ │ -
│ │ │ -
204
│ │ │ -
205 template<class Entity>
│ │ │ -
│ │ │ -
206 IndexType index(const Entity& entity) const
│ │ │ -
207 {
│ │ │ -
208 auto index = indices_[allEntityMapper_.index(entity)];
│ │ │ -
209 if (index==unusesIndex)
│ │ │ -
210 DUNE_THROW(Dune::InvalidStateException, "Accessing nonexisting entry using SubDomainIndexSet::index()!");
│ │ │ -
211 return index;
│ │ │ -
212 }
│ │ │ -
│ │ │ -
213
│ │ │ -
214 template<int cc>
│ │ │ -
│ │ │ -
215 IndexType index(const typename Codim<cc>::Entity& entity) const
│ │ │ -
216 {
│ │ │ -
217 return index<typename Codim<cc>::Entity>(entity);
│ │ │ -
218 }
│ │ │ -
│ │ │ -
219
│ │ │ -
220 template<class Entity>
│ │ │ -
│ │ │ -
221 IndexType subIndex(const Entity& entity, int subEntity, unsigned int codim) const
│ │ │ -
222 {
│ │ │ -
223 auto index = indices_[allEntityMapper_.subIndex(entity, subEntity, codim)];
│ │ │ -
224 if (index==unusesIndex)
│ │ │ -
225 DUNE_THROW(Dune::InvalidStateException, "Accessing nonexisting entry using SubDomainIndexSet::subIndex()!");
│ │ │ -
226 return index;
│ │ │ -
227 }
│ │ │ -
│ │ │ -
228
│ │ │ -
229 template<int cc>
│ │ │ -
│ │ │ -
230 IndexType subIndex(const typename Codim<cc>::Entity& entity, int subEntity, unsigned int codim) const
│ │ │ -
231 {
│ │ │ -
232 return subIndex<typename Codim<cc>::Entity>(entity, subEntity, codim);
│ │ │ -
233 }
│ │ │ -
│ │ │ -
234
│ │ │ -
235 template<class Entity >
│ │ │ -
│ │ │ -
236 bool contains(const Entity& entity) const
│ │ │ -
237 {
│ │ │ -
238 return (indices_[allEntityMapper_.index(entity)] != unusesIndex);
│ │ │ -
239 }
│ │ │ -
│ │ │ -
240
│ │ │ -
│ │ │ -
241 Types types(int codim) const
│ │ │ -
242 {
│ │ │ -
243 return typesPerCodim_[codim];
│ │ │ -
244 }
│ │ │ -
│ │ │ -
245
│ │ │ -
246 // *********************************
│ │ │ -
247 // Extended methods
│ │ │ -
248 // *********************************
│ │ │ -
249
│ │ │ -
│ │ │ -
251 const HostGridView& hostGridView() const
│ │ │ -
252 {
│ │ │ -
253 return hostGridView_;
│ │ │ -
254 }
│ │ │ -
│ │ │ -
255
│ │ │ -
│ │ │ -
257 void insertElement(const typename Codim<0>::Entity& element)
│ │ │ -
258 {
│ │ │ -
259 const auto& re = referenceElement(element);
│ │ │ -
260 for (auto codim : Dune::range(0, dimension+1))
│ │ │ -
261 {
│ │ │ -
262 for (auto subEntity : Dune::range(re.size(codim)))
│ │ │ -
263 {
│ │ │ -
264 auto& index = indices_[allEntityMapper_.subIndex(element, subEntity, codim)];
│ │ │ -
265 if (index==unusesIndex)
│ │ │ -
266 {
│ │ │ -
267 const auto& type = re.type(subEntity, codim);
│ │ │ -
268 const auto typeIndex = Dune::GlobalGeometryTypeIndex::index(type);
│ │ │ -
269 index = sizePerGT_[typeIndex];
│ │ │ -
270 if (sizePerGT_[typeIndex]==0)
│ │ │ -
271 typesPerCodim_[codim].push_back(type);
│ │ │ -
272 sizePerGT_[typeIndex]++;
│ │ │ -
273 sizePerCodim_[codim]++;
│ │ │ -
274 }
│ │ │ -
275 }
│ │ │ -
276 }
│ │ │ -
277 }
│ │ │ -
│ │ │ -
278
│ │ │ -
279 protected:
│ │ │ -
280
│ │ │ -
281 // Clear all data
│ │ │ -
│ │ │ -
282 void clear()
│ │ │ -
283 {
│ │ │ -
284 for(auto& size : sizePerGT_)
│ │ │ -
285 size = 0;
│ │ │ -
286 for(auto& size : sizePerCodim_)
│ │ │ -
287 size = 0;
│ │ │ -
288 for(auto& types : typesPerCodim_)
│ │ │ -
289 types.clear();
│ │ │ -
290 indices_.clear();
│ │ │ -
291 indices_.resize(allEntityMapper_.size(), unusesIndex);
│ │ │ -
292 }
│ │ │ -
│ │ │ -
293
│ │ │ -
294 HostGridView hostGridView_;
│ │ │ -
295
│ │ │ -
296 // Global size information
│ │ │ -
297 std::array<std::size_t, typeIndexSize> sizePerGT_;
│ │ │ -
298 std::array<std::size_t, dimension+1> sizePerCodim_;
│ │ │ -
299 std::array<Types, dimension+1> typesPerCodim_;
│ │ │ -
300
│ │ │ -
301 AllEntityMapper allEntityMapper_;
│ │ │ -
302
│ │ │ -
303 // Index map
│ │ │ -
304 std::vector<IndexType> indices_;
│ │ │ -
305 };
│ │ │ -
│ │ │ -
306
│ │ │ -
307
│ │ │ -
308
│ │ │ -
321 template<class HGV>
│ │ │ -
│ │ │ - │ │ │ -
323 {
│ │ │ -
324
│ │ │ -
325 template<int codim>
│ │ │ -
326 class NonImplementedIterator
│ │ │ -
327 {
│ │ │ -
328 public:
│ │ │ -
329 NonImplementedIterator()
│ │ │ -
330 {
│ │ │ -
331 static_assert(codim==0, "SubDomainGridView::Codim::Iterator<codim> is only implemented for codim=0");
│ │ │ -
332 }
│ │ │ -
333 };
│ │ │ -
334
│ │ │ -
335 template<PartitionIteratorType pit>
│ │ │ -
336 class ElementIterator
│ │ │ -
337 {
│ │ │ -
338 using Element = typename HGV::template Codim<0>::Entity;
│ │ │ -
339 public:
│ │ │ -
340
│ │ │ -
341 using HostElementIterator = typename HGV::template Codim<0>::template Partition<pit>::Iterator;
│ │ │ -
342
│ │ │ -
343 ElementIterator(const SubDomainIndexSet<HGV>& indexSet, HostElementIterator&& it, HostElementIterator&& endIt)
│ │ │ - │ │ │ -
345 , hostIt_(std::move(it))
│ │ │ -
346 , hostEndIt_(std::move(endIt))
│ │ │ -
347 {
│ │ │ -
348 while ((hostIt_!= hostEndIt_) and (not indexSet_->contains(*hostIt_)))
│ │ │ -
349 ++hostIt_;
│ │ │ -
350 }
│ │ │ -
351
│ │ │ -
352 ElementIterator& operator++()
│ │ │ -
353 {
│ │ │ -
354 ++hostIt_;
│ │ │ -
355 while ((hostIt_!= hostEndIt_) and (not indexSet_->contains(*hostIt_)))
│ │ │ -
356 ++hostIt_;
│ │ │ -
357 return *this;
│ │ │ -
358 }
│ │ │ -
359
│ │ │ -
360 const Element& operator*() const
│ │ │ -
361 {
│ │ │ -
362 return *hostIt_;
│ │ │ -
363 }
│ │ │ -
364
│ │ │ -
365 friend bool operator==(const ElementIterator& a, const ElementIterator& b)
│ │ │ -
366 {
│ │ │ -
367 return a.hostIt_==b.hostIt_;
│ │ │ -
368 }
│ │ │ -
369
│ │ │ -
370 private:
│ │ │ -
371 HostElementIterator hostIt_;
│ │ │ -
372 HostElementIterator hostEndIt_;
│ │ │ - │ │ │ -
374 };
│ │ │ -
375
│ │ │ -
376 public:
│ │ │ -
377
│ │ │ -
378 using HostGridView = HGV;
│ │ │ -
379
│ │ │ -
380 using Grid = typename HostGridView::Grid;
│ │ │ -
381 using ctype = typename Grid::ctype;
│ │ │ - │ │ │ -
383 using Intersection = typename HostGridView::Intersection;
│ │ │ -
384 using IntersectionIterator = typename HostGridView::IntersectionIterator;
│ │ │ -
385
│ │ │ -
387 template<int codim>
│ │ │ -
│ │ │ -
388 struct Codim
│ │ │ -
389 {
│ │ │ -
390 using Entity = typename Grid::template Codim<codim>::Entity;
│ │ │ -
391 using EntitySeed = typename Grid::template Codim<codim>::EntitySeed;
│ │ │ -
392 using Geometry = typename Grid::template Codim<codim>::Geometry;
│ │ │ -
393 using LocalGeometry = typename Grid::template Codim<codim>::LocalGeometry;
│ │ │ -
394 using Iterator = std::conditional_t<codim==0, ElementIterator<All_Partition>, NonImplementedIterator<codim>>;
│ │ │ -
395
│ │ │ -
396 template<PartitionIteratorType pit>
│ │ │ -
│ │ │ - │ │ │ -
398 {
│ │ │ -
399 using Iterator = std::conditional_t<codim==0, ElementIterator<pit>, NonImplementedIterator<codim>>;
│ │ │ -
400 };
│ │ │ -
│ │ │ -
401 };
│ │ │ -
│ │ │ -
402
│ │ │ -
403 enum {dimension = Grid::dimension};
│ │ │ -
404 enum {dimensionworld = Grid::dimensionworld};
│ │ │ -
405
│ │ │ -
│ │ │ - │ │ │ - │ │ │ -
408 {}
│ │ │ -
│ │ │ -
409
│ │ │ -
410 SubDomainGridView(const SubDomainGridView& other) = default;
│ │ │ -
411
│ │ │ -
│ │ │ -
412 const Grid& grid() const
│ │ │ -
413 {
│ │ │ -
414 return indexSet_->hostGridView().grid();
│ │ │ -
415 }
│ │ │ -
│ │ │ -
416
│ │ │ -
│ │ │ -
417 const IndexSet& indexSet() const
│ │ │ -
418 {
│ │ │ -
419 return *indexSet_;
│ │ │ -
420 }
│ │ │ -
│ │ │ -
421
│ │ │ -
│ │ │ -
422 int size(int codim) const
│ │ │ -
423 {
│ │ │ -
424 return indexSet_->size(codim);
│ │ │ -
425 }
│ │ │ -
│ │ │ -
426
│ │ │ -
│ │ │ -
427 int size(Dune::GeometryType gt) const
│ │ │ -
428 {
│ │ │ -
429 return indexSet_->size(gt);
│ │ │ -
430 }
│ │ │ -
│ │ │ -
431
│ │ │ -
432 template<class Entity>
│ │ │ -
│ │ │ -
433 bool contains(const Entity& entity) const
│ │ │ -
434 {
│ │ │ -
435 return indexSet_->contains(entity);
│ │ │ -
436 }
│ │ │ -
│ │ │ -
437
│ │ │ -
439 template<int codim, PartitionIteratorType pit = All_Partition>
│ │ │ -
│ │ │ -
440 typename Codim<codim>::template Partition<pit>::Iterator begin() const
│ │ │ -
441 {
│ │ │ -
442 static_assert(codim==0, "SubDomainGridView::begin<codim> is only implemented for codim=0");
│ │ │ -
443 return {indexSet(), hostGridView().template begin<codim, pit>(), hostGridView().template end<codim, pit>()};
│ │ │ -
444 }
│ │ │ -
│ │ │ -
445
│ │ │ -
447 template<int codim, PartitionIteratorType pit = All_Partition>
│ │ │ -
│ │ │ -
448 typename Codim<codim>::template Partition<pit>::Iterator end() const
│ │ │ -
449 {
│ │ │ -
450 static_assert(codim==0, "SubDomainGridView::end<codim> is only implemented for codim=0");
│ │ │ -
451 return {indexSet(), hostGridView().template end<codim, pit>(), hostGridView().template end<codim, pit>()};
│ │ │ -
452 }
│ │ │ -
│ │ │ -
453
│ │ │ -
│ │ │ -
454 decltype(auto) comm() const
│ │ │ -
455 {
│ │ │ -
456 return hostGridView().comm();
│ │ │ -
457 }
│ │ │ -
│ │ │ -
458
│ │ │ -
│ │ │ -
459 decltype(auto) ibegin(const typename Codim<0>::Entity& element) const
│ │ │ -
460 {
│ │ │ -
461 return hostGridView().ibegin(element);
│ │ │ -
462 }
│ │ │ -
│ │ │ -
463
│ │ │ -
│ │ │ -
464 decltype(auto) iend(const typename Codim<0>::Entity& element) const
│ │ │ -
465 {
│ │ │ -
466 return hostGridView().iend(element);
│ │ │ -
467 }
│ │ │ -
│ │ │ -
468
│ │ │ -
│ │ │ - │ │ │ -
471 {
│ │ │ -
472 return indexSet_->hostGridView();
│ │ │ -
473 }
│ │ │ -
│ │ │ -
474
│ │ │ -
475 protected:
│ │ │ - │ │ │ -
477 };
│ │ │ -
│ │ │ -
478
│ │ │ -
479
│ │ │ -
480
│ │ │ -
486 template<class HostGridView>
│ │ │ -
│ │ │ -
487 auto elements(const SubDomainGridView<HostGridView>& subDomainGridView)
│ │ │ -
488 {
│ │ │ -
489 return Dune::IteratorRange(subDomainGridView.template begin<0>(), subDomainGridView.template end<0>());
│ │ │ -
490 }
│ │ │ -
│ │ │ -
491
│ │ │ -
497 template<class HostGridView, unsigned int partitions>
│ │ │ -
│ │ │ -
498 auto elements(const SubDomainGridView<HostGridView>& subDomainGridView, Dune::PartitionSet<partitions> partitionSet)
│ │ │ -
499 {
│ │ │ -
500 constexpr auto pit = partitionSet.partitionIterator();
│ │ │ -
501 return Dune::IteratorRange(subDomainGridView.template begin<0, pit>(), subDomainGridView.template end<0, pit>());
│ │ │ -
502 }
│ │ │ -
│ │ │ -
503
│ │ │ -
509 template<class HostGridView, class Element>
│ │ │ -
│ │ │ -
510 auto intersections(const SubDomainGridView<HostGridView>& subDomainGridView, const Element& element)
│ │ │ -
511 {
│ │ │ -
512 return Dune::IteratorRange(subDomainGridView.ibegin(element), subDomainGridView.iend(element));
│ │ │ -
513 }
│ │ │ -
│ │ │ -
514
│ │ │ -
515
│ │ │ -
516
│ │ │ -
532 template<class HGV>
│ │ │ -
│ │ │ - │ │ │ -
534 {
│ │ │ -
535 public:
│ │ │ -
536
│ │ │ -
537 using HostGridView = HGV;
│ │ │ -
538 using Grid = typename HostGridView::Grid;
│ │ │ - │ │ │ - │ │ │ -
541
│ │ │ -
543 template<int codim>
│ │ │ -
│ │ │ -
544 struct Codim
│ │ │ -
545 {
│ │ │ -
546 using Entity = typename Grid::template Codim<codim>::Entity;
│ │ │ -
547 using EntitySeed = typename Grid::template Codim<codim>::EntitySeed;
│ │ │ -
548 using Geometry = typename Grid::template Codim<codim>::Geometry;
│ │ │ -
549 using LocalGeometry = typename Grid::template Codim<codim>::LocalGeometry;
│ │ │ -
550 };
│ │ │ -
│ │ │ -
551
│ │ │ -
552 enum {dimension = Grid::dimension};
│ │ │ -
553
│ │ │ -
│ │ │ - │ │ │ -
556 : indexSet_(hostGridView)
│ │ │ -
557 {}
│ │ │ -
│ │ │ -
558
│ │ │ -
│ │ │ -
559 const IndexSet& indexSet() const
│ │ │ -
560 {
│ │ │ -
561 return indexSet_;
│ │ │ -
562 }
│ │ │ -
│ │ │ -
563
│ │ │ -
│ │ │ - │ │ │ -
566 {
│ │ │ -
567 return GridView(indexSet_);
│ │ │ -
568 }
│ │ │ -
│ │ │ -
569
│ │ │ -
│ │ │ - │ │ │ -
572 {
│ │ │ -
573 return indexSet_.hostGridView();
│ │ │ -
574 }
│ │ │ -
│ │ │ -
575
│ │ │ -
│ │ │ -
577 void insertElement(const typename Codim<0>::Entity& element)
│ │ │ -
578 {
│ │ │ -
579 indexSet_.insertElement(element);
│ │ │ -
580 }
│ │ │ -
│ │ │ -
581
│ │ │ -
│ │ │ -
583 bool contains(const typename Codim<0>::Entity& element) const
│ │ │ -
584 {
│ │ │ -
585 return indexSet_.contains(element);
│ │ │ -
586 }
│ │ │ -
│ │ │ -
587
│ │ │ -
588 private:
│ │ │ -
589 IndexSet indexSet_;
│ │ │ -
590 };
│ │ │ -
│ │ │ -
591
│ │ │ -
592
│ │ │ -
593
│ │ │ -
599 template<class SubDomainA, class SubDomainB>
│ │ │ -
│ │ │ - │ │ │ -
601 {
│ │ │ -
602 static_assert(
│ │ │ -
603 std::is_same_v<typename SubDomainA::GridView::Intersection, typename SubDomainB::GridView::Intersection>,
│ │ │ -
604 "SubDomainInterface requires that both SubDomain types have the same Intersection type");
│ │ │ -
605
│ │ │ -
606 public:
│ │ │ -
607
│ │ │ -
608 using Intersection = typename SubDomainA::GridView::Intersection;
│ │ │ -
609
│ │ │ -
│ │ │ -
617 SubDomainInterface(const SubDomainA& subDomainA, const SubDomainB& subDomainB)
│ │ │ -
618 : subDomainA_(subDomainA)
│ │ │ -
619 , subDomainB_(subDomainB)
│ │ │ -
620 {}
│ │ │ -
│ │ │ -
621
│ │ │ -
│ │ │ -
631 bool contains(const Intersection& is) const
│ │ │ -
632 {
│ │ │ -
633 if (is.boundary() or not(is.neighbor()))
│ │ │ -
634 return false;
│ │ │ -
635 return (subDomainA_.contains(is.inside()) && subDomainB_.contains(is.outside()))
│ │ │ -
636 || (subDomainA_.contains(is.outside()) && subDomainB_.contains(is.inside()));
│ │ │ -
637 }
│ │ │ -
│ │ │ -
638
│ │ │ -
│ │ │ -
647 bool isOriented(const Intersection& is) const
│ │ │ -
648 {
│ │ │ -
649 if (is.boundary() or not(is.neighbor()))
│ │ │ -
650 return false;
│ │ │ -
651 return (subDomainA_.contains(is.inside()) && subDomainB_.contains(is.outside()));
│ │ │ -
652 }
│ │ │ -
│ │ │ -
653
│ │ │ -
│ │ │ -
660 const auto begin() const
│ │ │ -
661 {
│ │ │ -
662 return Impl::GlobalIntersectionIt(subDomainA_.gridView(), [&](const auto& is) {
│ │ │ -
663 if (is.boundary() or not(is.neighbor()))
│ │ │ -
664 return false;
│ │ │ -
665 return subDomainB_.indexSet().contains(is.outside());
│ │ │ -
666 }, subDomainA_.gridView().template begin<0>(), subDomainA_.gridView().template end<0>());
│ │ │ -
667 }
│ │ │ -
│ │ │ -
668
│ │ │ -
│ │ │ -
670 const auto end() const
│ │ │ -
671 {
│ │ │ -
672 return typename decltype(begin())::SentinelIterator();
│ │ │ -
673 }
│ │ │ -
│ │ │ -
674
│ │ │ -
675 private:
│ │ │ -
676 const SubDomainA& subDomainA_;
│ │ │ -
677 const SubDomainB& subDomainB_;
│ │ │ -
678 };
│ │ │ -
│ │ │ -
679
│ │ │ -
680
│ │ │ -
681
│ │ │ -
687 template<class SubDomain>
│ │ │ -
│ │ │ - │ │ │ -
689 {
│ │ │ -
690 public:
│ │ │ -
691
│ │ │ - │ │ │ -
693
│ │ │ -
│ │ │ -
695 SubDomainSkeleton(const SubDomain& subDomain)
│ │ │ -
696 : subDomain_(subDomain)
│ │ │ -
697 {}
│ │ │ -
│ │ │ -
698
│ │ │ -
│ │ │ -
700 bool contains(const Intersection& is) const
│ │ │ -
701 {
│ │ │ -
702 if (is.boundary() or not(is.neighbor()))
│ │ │ -
703 return false;
│ │ │ -
704 return subDomain_.contains(is.inside()) and subDomain_.contains(is.outside());
│ │ │ -
705 }
│ │ │ -
│ │ │ -
706
│ │ │ -
707 private:
│ │ │ -
708 const SubDomain& subDomain_;
│ │ │ -
709 };
│ │ │ -
│ │ │ -
710
│ │ │ -
711
│ │ │ -
712
│ │ │ -
713} // namespace Dune::Functions::Experimental
│ │ │ -
│ │ │ -
714
│ │ │ -
715#endif// DUNE_FUNCTIONS_COMMON_SUBDOMAIN_HH
│ │ │ -
auto elements(const SubDomainGridView< HostGridView > &subDomainGridView)
ADL findable access to element range for a SubDomainGridView.
Definition subdomain.hh:487
│ │ │ -
auto intersections(const SubDomainGridView< HostGridView > &subDomainGridView, const Element &element)
ADL findable access to intersection range for an element of a SubDomainGridView.
Definition subdomain.hh:510
│ │ │ -
Definition subdomain.hh:28
│ │ │ -
An IndexSet for a sub-domain.
Definition subdomain.hh:148
│ │ │ -
SubDomainIndexSet(const HostGridView &hostGridView)
Construct SubDomainIndexSet for underlying host grid view.
Definition subdomain.hh:184
│ │ │ -
std::array< std::size_t, typeIndexSize > sizePerGT_
Definition subdomain.hh:297
│ │ │ -
std::vector< IndexType > indices_
Definition subdomain.hh:304
│ │ │ -
IndexType index(const typename Codim< cc >::Entity &entity) const
Definition subdomain.hh:215
│ │ │ - │ │ │ -
IndexType index(const Entity &entity) const
Definition subdomain.hh:206
│ │ │ -
IndexType size(int codim) const
Definition subdomain.hh:200
│ │ │ -
AllEntityMapper allEntityMapper_
Definition subdomain.hh:301
│ │ │ -
IndexType size(Dune::GeometryType gt) const
Definition subdomain.hh:195
│ │ │ -
void insertElement(const typename Codim< 0 >::Entity &element)
Insert element and all its sub-entities into SubDomainIndexSet.
Definition subdomain.hh:257
│ │ │ -
Types types(int codim) const
Definition subdomain.hh:241
│ │ │ -
std::vector< Dune::GeometryType > Types
Definition subdomain.hh:154
│ │ │ -
IndexType subIndex(const typename Codim< cc >::Entity &entity, int subEntity, unsigned int codim) const
Definition subdomain.hh:230
│ │ │ -
HostGridView hostGridView_
Definition subdomain.hh:294
│ │ │ -
std::array< std::size_t, dimension+1 > sizePerCodim_
Definition subdomain.hh:298
│ │ │ -
typename HostGridView::Grid Grid
Definition subdomain.hh:153
│ │ │ -
const HostGridView & hostGridView() const
Definition subdomain.hh:251
│ │ │ -
void clear()
Definition subdomain.hh:282
│ │ │ -
bool contains(const Entity &entity) const
Definition subdomain.hh:236
│ │ │ -
std::array< Types, dimension+1 > typesPerCodim_
Definition subdomain.hh:299
│ │ │ -
std::size_t IndexType
Definition subdomain.hh:155
│ │ │ -
IndexType subIndex(const Entity &entity, int subEntity, unsigned int codim) const
Definition subdomain.hh:221
│ │ │ -
Codim specific typedefs.
Definition subdomain.hh:160
│ │ │ -
typename Grid::template Codim< codim >::EntitySeed EntitySeed
Definition subdomain.hh:162
│ │ │ -
typename Grid::template Codim< codim >::Geometry Geometry
Definition subdomain.hh:163
│ │ │ -
typename Grid::template Codim< codim >::LocalGeometry LocalGeometry
Definition subdomain.hh:164
│ │ │ -
typename Grid::template Codim< codim >::Entity Entity
Definition subdomain.hh:161
│ │ │ -
A GridView for a sub-domain.
Definition subdomain.hh:323
│ │ │ - │ │ │ - │ │ │ -
typename HostGridView::Grid Grid
Definition subdomain.hh:380
│ │ │ -
Codim< codim >::template Partition< pit >::Iterator end() const
Create an iterator pointing to the end of the range.
Definition subdomain.hh:448
│ │ │ -
bool contains(const Entity &entity) const
Definition subdomain.hh:433
│ │ │ -
const IndexSet * indexSet_
Definition subdomain.hh:476
│ │ │ -
const IndexSet & indexSet() const
Definition subdomain.hh:417
│ │ │ -
SubDomainGridView(const SubDomainGridView &other)=default
│ │ │ -
const Grid & grid() const
Definition subdomain.hh:412
│ │ │ -
typename Grid::ctype ctype
Definition subdomain.hh:381
│ │ │ -
typename HostGridView::IntersectionIterator IntersectionIterator
Definition subdomain.hh:384
│ │ │ -
const HostGridView & hostGridView() const
Access underlying host grid view.
Definition subdomain.hh:470
│ │ │ -
SubDomainIndexSet< HostGridView > IndexSet
Definition subdomain.hh:382
│ │ │ -
typename HostGridView::Intersection Intersection
Definition subdomain.hh:383
│ │ │ -
decltype(auto) comm() const
Definition subdomain.hh:454
│ │ │ -
int size(int codim) const
Definition subdomain.hh:422
│ │ │ -
decltype(auto) ibegin(const typename Codim< 0 >::Entity &element) const
Definition subdomain.hh:459
│ │ │ -
int size(Dune::GeometryType gt) const
Definition subdomain.hh:427
│ │ │ -
decltype(auto) iend(const typename Codim< 0 >::Entity &element) const
Definition subdomain.hh:464
│ │ │ -
HGV HostGridView
Definition subdomain.hh:378
│ │ │ -
Codim< codim >::template Partition< pit >::Iterator begin() const
Create an iterator pointing to the begin of the range.
Definition subdomain.hh:440
│ │ │ -
SubDomainGridView(const IndexSet &indexSet)
Definition subdomain.hh:406
│ │ │ -
Codim specific typedefs.
Definition subdomain.hh:389
│ │ │ -
typename Grid::template Codim< codim >::Entity Entity
Definition subdomain.hh:390
│ │ │ -
typename Grid::template Codim< codim >::Geometry Geometry
Definition subdomain.hh:392
│ │ │ -
typename Grid::template Codim< codim >::LocalGeometry LocalGeometry
Definition subdomain.hh:393
│ │ │ -
typename Grid::template Codim< codim >::EntitySeed EntitySeed
Definition subdomain.hh:391
│ │ │ -
std::conditional_t< codim==0, ElementIterator< All_Partition >, NonImplementedIterator< codim > > Iterator
Definition subdomain.hh:394
│ │ │ - │ │ │ -
std::conditional_t< codim==0, ElementIterator< pit >, NonImplementedIterator< codim > > Iterator
Definition subdomain.hh:399
│ │ │ -
Class representing a sub-domain of a GridView.
Definition subdomain.hh:534
│ │ │ -
void insertElement(const typename Codim< 0 >::Entity &element)
Insert element and all its sub-entities into SubDomain.
Definition subdomain.hh:577
│ │ │ -
GridView gridView() const
Create grid view representing the SubDomain.
Definition subdomain.hh:565
│ │ │ -
const IndexSet & indexSet() const
Definition subdomain.hh:559
│ │ │ -
SubDomainGridView< HostGridView > GridView
Definition subdomain.hh:540
│ │ │ -
HostGridView hostGridView() const
Access underlying host grid view.
Definition subdomain.hh:571
│ │ │ -
SubDomain(const HostGridView &hostGridView)
Construct SubDomain for underlying host grid view.
Definition subdomain.hh:555
│ │ │ -
typename HostGridView::Grid Grid
Definition subdomain.hh:538
│ │ │ -
@ dimension
Definition subdomain.hh:552
│ │ │ -
bool contains(const typename Codim< 0 >::Entity &element) const
Check if element is contained in SubDomain.
Definition subdomain.hh:583
│ │ │ -
SubDomainIndexSet< HostGridView > IndexSet
Definition subdomain.hh:539
│ │ │ -
HGV HostGridView
Definition subdomain.hh:537
│ │ │ -
Codim specific typedefs.
Definition subdomain.hh:545
│ │ │ -
typename Grid::template Codim< codim >::Geometry Geometry
Definition subdomain.hh:548
│ │ │ -
typename Grid::template Codim< codim >::Entity Entity
Definition subdomain.hh:546
│ │ │ -
typename Grid::template Codim< codim >::LocalGeometry LocalGeometry
Definition subdomain.hh:549
│ │ │ -
typename Grid::template Codim< codim >::EntitySeed EntitySeed
Definition subdomain.hh:547
│ │ │ -
const auto end() const
End iterator (sentinel).
Definition subdomain.hh:670
│ │ │ -
bool contains(const Intersection &is) const
Check if intersection is contained in the interface between the subdomains.
Definition subdomain.hh:631
│ │ │ -
const auto begin() const
Begin iterator over all intersection between the subdomains.
Definition subdomain.hh:660
│ │ │ -
SubDomainInterface(const SubDomainA &subDomainA, const SubDomainB &subDomainB)
Create interface between two subdomains.
Definition subdomain.hh:617
│ │ │ -
bool isOriented(const Intersection &is) const
Check if intersection is oriented.
Definition subdomain.hh:647
│ │ │ -
typename SubDomainA::GridView::Intersection Intersection
Definition subdomain.hh:608
│ │ │ -
SubDomainSkeleton(const SubDomain &subDomain)
Create skeleton of a subdomain.
Definition subdomain.hh:695
│ │ │ -
bool contains(const Intersection &is) const
Check if intersection is contained in the skeleton of the subdomain.
Definition subdomain.hh:700
│ │ │ -
typename SubDomain::GridView::Intersection Intersection
Definition subdomain.hh:692
│ │ │ +
30 TransformedLocalBasis(FEImplementation const& feImpl)
│ │ │ +
31 : feImpl_(&feImpl)
│ │ │ +
32 {}
│ │ │ +
33
│ │ │ +
34 public:
│ │ │ +
39 auto size() const
│ │ │ +
40 {
│ │ │ +
41 return feImpl_->size();
│ │ │ +
42 }
│ │ │ +
43
│ │ │ +
45 void evaluateFunction(const typename Traits::DomainType &x,
│ │ │ +
46 std::vector<typename Traits::RangeType> &out) const
│ │ │ +
47 {
│ │ │ +
48 feImpl_->referenceLocalBasis().evaluateFunction(x, rangeBuffer_);
│ │ │ +
49 out.resize(size());
│ │ │ +
50 feImpl_->transform(rangeBuffer_, out);
│ │ │ +
51 }
│ │ │ +
52
│ │ │ +
59 void evaluateJacobian(const typename Traits::DomainType &x,
│ │ │ +
60 std::vector<typename Traits::JacobianType> &out) const
│ │ │ +
61 {
│ │ │ +
62 feImpl_->referenceLocalBasis().evaluateJacobian(x, jacobianBuffer_);
│ │ │ +
63 out.resize(size());
│ │ │ +
64 feImpl_->transform(jacobianBuffer_, out);
│ │ │ +
65 }
│ │ │ +
66
│ │ │ +
77 template<class TT,
│ │ │ +
78 std::enable_if_t<std::is_same_v<TT, typename Traits::HessianType>, int> = 0>
│ │ │ +
79 void evaluateHessian(const typename Traits::DomainType &x,
│ │ │ +
80 std::vector<TT> &out) const
│ │ │ +
81 {
│ │ │ +
82 feImpl_->referenceLocalBasis().evaluateHessian(x, hessianBuffer_);
│ │ │ +
83 out.resize(size());
│ │ │ +
84 feImpl_->transform(hessianBuffer_, out);
│ │ │ +
85 }
│ │ │ +
86
│ │ │ +
94 void partial(std::array<unsigned int, Traits::dimDomain> const &order,
│ │ │ +
95 const typename Traits::DomainType &x,
│ │ │ +
96 std::vector<typename Traits::RangeType> &out) const
│ │ │ +
97 {
│ │ │ +
98 feImpl_->referenceLocalBasis().partial(order, x, rangeBuffer_);
│ │ │ +
99 out.resize(size());
│ │ │ +
100 feImpl_->transform(rangeBuffer_, out);
│ │ │ +
101 }
│ │ │ +
102
│ │ │ +
104 auto order() const { return feImpl_->referenceLocalBasis().order(); }
│ │ │ +
105
│ │ │ +
106 private:
│ │ │ +
107 FEImplementation const* feImpl_;
│ │ │ +
108 mutable std::vector<typename Traits::RangeType> rangeBuffer_;
│ │ │ +
109 mutable std::vector<typename Traits::JacobianType> jacobianBuffer_;
│ │ │ +
110 mutable std::vector<typename Traits::HessianType> hessianBuffer_;
│ │ │ +
111};
│ │ │ +
112
│ │ │ +
113
│ │ │ +
114
│ │ │ +
146template<class FEImplementation, class ReferenceLocalBasisTraits>
│ │ │ +
147class TransformedFiniteElementMixin
│ │ │ +
148{
│ │ │ +
149 public:
│ │ │ +
150 TransformedFiniteElementMixin()
│ │ │ +
151 : tlb_(this->asImpl())
│ │ │ +
152 {}
│ │ │ +
153
│ │ │ +
154 TransformedFiniteElementMixin(TransformedFiniteElementMixin const& other)
│ │ │ +
155 : TransformedFiniteElementMixin()
│ │ │ +
156 {}
│ │ │ +
157
│ │ │ +
158 const FEImplementation& asImpl() const
│ │ │ +
159 {
│ │ │ +
160 return *(static_cast<FEImplementation const*>(this));
│ │ │ +
161 }
│ │ │ +
162
│ │ │ +
163 auto const& localBasis() const
│ │ │ +
164 {
│ │ │ +
165 return tlb_;
│ │ │ +
166 }
│ │ │ +
167
│ │ │ +
168 protected:
│ │ │ +
169 TransformedLocalBasis<FEImplementation, ReferenceLocalBasisTraits> tlb_;
│ │ │ +
170};
│ │ │ +
171
│ │ │ +
172} // end namespace Dune::Functions::Impl
│ │ │ +
173
│ │ │ +
174#endif
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,933 +1,120 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -subdomain.hh │ │ │ │ +transformedfiniteelementmixin.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_COMMON_SUBDOMAIN_HH │ │ │ │ -8#define DUNE_FUNCTIONS_COMMON_SUBDOMAIN_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDFINITEELEMENTMIXIN_HH │ │ │ │ +8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDFINITEELEMENTMIXIN_HH │ │ │ │ 9 │ │ │ │ 10#include │ │ │ │ -11#include │ │ │ │ -12#include │ │ │ │ -13#include │ │ │ │ -14#include │ │ │ │ -15#include │ │ │ │ +11#include │ │ │ │ +12#include │ │ │ │ +13#include │ │ │ │ +14 │ │ │ │ +15namespace Dune::Functions::Impl { │ │ │ │ 16 │ │ │ │ -17#include │ │ │ │ -18#include │ │ │ │ -19#include │ │ │ │ -20#include │ │ │ │ -21 │ │ │ │ -22#include │ │ │ │ -23#include │ │ │ │ -24 │ │ │ │ -25#include │ │ │ │ -26#include │ │ │ │ -27 │ │ │ │ -_2_8namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l { │ │ │ │ +24template │ │ │ │ +25class TransformedLocalBasis │ │ │ │ +26{ │ │ │ │ +27 public: │ │ │ │ +28 using Traits = ReferenceLocalBasisTraits; │ │ │ │ 29 │ │ │ │ -30 namespace Impl { │ │ │ │ -31 │ │ │ │ -32 template │ │ │ │ -33 using GlobalIntersectionIteratorTraits = Dune::DefaultIteratorTraits< │ │ │ │ -34 std::forward_iterator_tag, │ │ │ │ -35 decltype(*std::declval())>; │ │ │ │ -36 │ │ │ │ -37 │ │ │ │ -38 template │ │ │ │ -39 class GlobalIntersectionIt │ │ │ │ -40 : public Dune::IteratorFacadeForTraits, GlobalIntersectionIteratorTraits> │ │ │ │ -41 { │ │ │ │ -42 using Facade = Dune::IteratorFacadeForTraits, GlobalIntersectionIteratorTraits>; │ │ │ │ +30 TransformedLocalBasis(FEImplementation const& feImpl) │ │ │ │ +31 : feImpl_(&feImpl) │ │ │ │ +32 {} │ │ │ │ +33 │ │ │ │ +34 public: │ │ │ │ +39 auto size() const │ │ │ │ +40 { │ │ │ │ +41 return feImpl_->size(); │ │ │ │ +42 } │ │ │ │ 43 │ │ │ │ -44 public: │ │ │ │ -45 │ │ │ │ -46 using GridView = GV; │ │ │ │ -47 using Element = typename GridView::template Codim<0>::Entity; │ │ │ │ -48 using ElementIterator = typename GridView::template Codim<0>::Iterator; │ │ │ │ -49 using IntersectionIterator = typename GridView::IntersectionIterator; │ │ │ │ -50 │ │ │ │ -51 class SentinelIterator │ │ │ │ -52 {}; │ │ │ │ -53 │ │ │ │ -54 GlobalIntersectionIt(const GridView& gridView, const ContainsCallback& │ │ │ │ -contains, ElementIterator elementIt, ElementIterator elementEnd) │ │ │ │ -55 : gridView_(gridView) │ │ │ │ -56 , contains_(contains) │ │ │ │ -57 , elementIt_(std::move(elementIt)) │ │ │ │ -58 , elementEnd_(std::move(elementEnd)) │ │ │ │ -59 { │ │ │ │ -60 if (elementIt_ != elementEnd_) │ │ │ │ +45 void evaluateFunction(const typename Traits::DomainType &x, │ │ │ │ +46 std::vector &out) const │ │ │ │ +47 { │ │ │ │ +48 feImpl_->referenceLocalBasis().evaluateFunction(x, rangeBuffer_); │ │ │ │ +49 out.resize(size()); │ │ │ │ +50 feImpl_->transform(rangeBuffer_, out); │ │ │ │ +51 } │ │ │ │ +52 │ │ │ │ +59 void evaluateJacobian(const typename Traits::DomainType &x, │ │ │ │ +60 std::vector &out) const │ │ │ │ 61 { │ │ │ │ -62 element_ = *elementIt_; │ │ │ │ -63 iIt_ = gridView_.ibegin(element_); │ │ │ │ -64 iEnd_ = gridView_.iend(element_); │ │ │ │ -65 if (not contains_(*iIt_)) │ │ │ │ -66 ++(*this); │ │ │ │ -67 } │ │ │ │ -68 } │ │ │ │ -69 │ │ │ │ -70 using reference = typename Facade::reference; │ │ │ │ -71 │ │ │ │ -72 reference operator*() const │ │ │ │ -73 { │ │ │ │ -74 return *iIt_; │ │ │ │ -75 } │ │ │ │ -76 │ │ │ │ -77 GlobalIntersectionIt& operator++() │ │ │ │ -78 { │ │ │ │ -79 while(true) │ │ │ │ -80 { │ │ │ │ -81 ++iIt_; │ │ │ │ -82 if (iIt_ == iEnd_) │ │ │ │ -83 { │ │ │ │ -84 ++elementIt_; │ │ │ │ -85 if (elementIt_ == elementEnd_) │ │ │ │ -86 return *this; │ │ │ │ -87 element_ = *elementIt_; │ │ │ │ -88 iIt_ = gridView_.ibegin(element_); │ │ │ │ -89 iIt_ = gridView_.ibegin(element_); │ │ │ │ -90 iEnd_ = gridView_.iend(element_); │ │ │ │ -91 } │ │ │ │ -92 if (contains_(*iIt_)) │ │ │ │ -93 return *this; │ │ │ │ -94 } │ │ │ │ -95 return *this; │ │ │ │ -96 } │ │ │ │ -97 │ │ │ │ -98 friend bool operator==(const GlobalIntersectionIt& it1, const │ │ │ │ -GlobalIntersectionIt& it2) │ │ │ │ -99 { │ │ │ │ -100 if (it1.elementIt_ != it2.elementIt_) │ │ │ │ -101 return false; │ │ │ │ -102 if (it1.elementIt_ == it1.elementEnd_) │ │ │ │ -103 return true; │ │ │ │ -104 return (it1.iIt_ == it2.iIt_); │ │ │ │ -105 } │ │ │ │ -106 │ │ │ │ -107 friend bool operator==(const GlobalIntersectionIt& it1, const │ │ │ │ -SentinelIterator& it2) │ │ │ │ -108 { │ │ │ │ -109 return it1.elementIt_ == it1.elementEnd_; │ │ │ │ -110 } │ │ │ │ -111 │ │ │ │ -112 private: │ │ │ │ -113 GridView gridView_; │ │ │ │ -114 ContainsCallback contains_; │ │ │ │ -115 ElementIterator elementIt_; │ │ │ │ -116 ElementIterator elementEnd_; │ │ │ │ -117 Element element_; │ │ │ │ -118 IntersectionIterator iIt_; │ │ │ │ -119 IntersectionIterator iEnd_; │ │ │ │ -120 }; │ │ │ │ -121 │ │ │ │ -122 } │ │ │ │ -123 │ │ │ │ -124 │ │ │ │ -125 │ │ │ │ -146 template │ │ │ │ -_1_4_7 class _S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t │ │ │ │ -148 { │ │ │ │ -149 using HostGridView = HGV; │ │ │ │ -150 │ │ │ │ -151 public: │ │ │ │ -152 │ │ │ │ -_1_5_3 using _G_r_i_d = typename HostGridView::Grid; │ │ │ │ -_1_5_4 using _T_y_p_e_s = std::vector; │ │ │ │ -_1_5_5 using _I_n_d_e_x_T_y_p_e = std::size_t; │ │ │ │ -156 │ │ │ │ -158 template │ │ │ │ -_1_5_9 struct _C_o_d_i_m │ │ │ │ -160 { │ │ │ │ -_1_6_1 using _E_n_t_i_t_y = typename Grid::template _C_o_d_i_m_<_c_o_d_i_m_>_:_:_E_n_t_i_t_y; │ │ │ │ -_1_6_2 using _E_n_t_i_t_y_S_e_e_d = typename Grid::template _C_o_d_i_m_<_c_o_d_i_m_>_:_:_E_n_t_i_t_y_S_e_e_d; │ │ │ │ -_1_6_3 using _G_e_o_m_e_t_r_y = typename Grid::template _C_o_d_i_m_<_c_o_d_i_m_>_:_:_G_e_o_m_e_t_r_y; │ │ │ │ -_1_6_4 using _L_o_c_a_l_G_e_o_m_e_t_r_y = typename Grid::template _C_o_d_i_m_<_c_o_d_i_m_>_:_:_L_o_c_a_l_G_e_o_m_e_t_r_y; │ │ │ │ -165 }; │ │ │ │ -166 │ │ │ │ -_1_6_7 enum {_d_i_m_e_n_s_i_o_n = Grid::dimension}; │ │ │ │ -168 │ │ │ │ -169 private: │ │ │ │ -170 │ │ │ │ -171 using AllEntityMapper = Dune:: │ │ │ │ -MultipleCodimMultipleGeomTypeMapper; │ │ │ │ -172 │ │ │ │ -173 static auto allCodimLayout() │ │ │ │ -174 { │ │ │ │ -175 return [](Dune::GeometryType, int) { return true; }; │ │ │ │ -176 } │ │ │ │ -177 │ │ │ │ -178 static constexpr auto typeIndexSize = Dune::GlobalGeometryTypeIndex::size │ │ │ │ -(_d_i_m_e_n_s_i_o_n); │ │ │ │ -179 static constexpr auto unusesIndex = std::numeric_limits::max(); │ │ │ │ -180 │ │ │ │ -181 public: │ │ │ │ -182 │ │ │ │ -_1_8_4 _S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t(const HostGridView& _h_o_s_t_G_r_i_d_V_i_e_w) │ │ │ │ -185 : _h_o_s_t_G_r_i_d_V_i_e_w__(_h_o_s_t_G_r_i_d_V_i_e_w) │ │ │ │ -186 , _a_l_l_E_n_t_i_t_y_M_a_p_p_e_r__(_h_o_s_t_G_r_i_d_V_i_e_w__, allCodimLayout()) │ │ │ │ -187 { │ │ │ │ -188 _c_l_e_a_r(); │ │ │ │ -189 } │ │ │ │ -190 │ │ │ │ -191 // ********************************* │ │ │ │ -192 // IndexSet interface methods │ │ │ │ -193 // ********************************* │ │ │ │ -194 │ │ │ │ -_1_9_5 _I_n_d_e_x_T_y_p_e _s_i_z_e(Dune::GeometryType gt) const │ │ │ │ -196 { │ │ │ │ -197 return _s_i_z_e_P_e_r_G_T__[Dune::GlobalGeometryTypeIndex::index(gt)]; │ │ │ │ -198 } │ │ │ │ -199 │ │ │ │ -_2_0_0 _I_n_d_e_x_T_y_p_e _s_i_z_e(int codim) const │ │ │ │ -201 { │ │ │ │ -202 return _s_i_z_e_P_e_r_C_o_d_i_m__[codim]; │ │ │ │ -203 } │ │ │ │ -204 │ │ │ │ -205 template │ │ │ │ -_2_0_6 _I_n_d_e_x_T_y_p_e _i_n_d_e_x(const Entity& entity) const │ │ │ │ -207 { │ │ │ │ -208 auto _i_n_d_e_x = _i_n_d_i_c_e_s__[_a_l_l_E_n_t_i_t_y_M_a_p_p_e_r__.index(entity)]; │ │ │ │ -209 if (_i_n_d_e_x==unusesIndex) │ │ │ │ -210 DUNE_THROW(Dune::InvalidStateException, "Accessing nonexisting entry using │ │ │ │ -SubDomainIndexSet::index()!"); │ │ │ │ -211 return _i_n_d_e_x; │ │ │ │ -212 } │ │ │ │ -213 │ │ │ │ -214 template │ │ │ │ -_2_1_5 _I_n_d_e_x_T_y_p_e _i_n_d_e_x(const typename _C_o_d_i_m_<_c_c_>_:_:_E_n_t_i_t_y& entity) const │ │ │ │ -216 { │ │ │ │ -217 return _i_n_d_e_x_<_t_y_p_e_n_a_m_e_ _C_o_d_i_m_<_c_c_>_:_:_E_n_t_i_t_y>(entity); │ │ │ │ -218 } │ │ │ │ -219 │ │ │ │ -220 template │ │ │ │ -_2_2_1 _I_n_d_e_x_T_y_p_e _s_u_b_I_n_d_e_x(const Entity& entity, int subEntity, unsigned int codim) │ │ │ │ -const │ │ │ │ -222 { │ │ │ │ -223 auto _i_n_d_e_x = _i_n_d_i_c_e_s__[_a_l_l_E_n_t_i_t_y_M_a_p_p_e_r__.subIndex(entity, subEntity, codim)]; │ │ │ │ -224 if (_i_n_d_e_x==unusesIndex) │ │ │ │ -225 DUNE_THROW(Dune::InvalidStateException, "Accessing nonexisting entry using │ │ │ │ -SubDomainIndexSet::subIndex()!"); │ │ │ │ -226 return _i_n_d_e_x; │ │ │ │ -227 } │ │ │ │ -228 │ │ │ │ -229 template │ │ │ │ -_2_3_0 _I_n_d_e_x_T_y_p_e _s_u_b_I_n_d_e_x(const typename _C_o_d_i_m_<_c_c_>_:_:_E_n_t_i_t_y& entity, int subEntity, │ │ │ │ -unsigned int codim) const │ │ │ │ -231 { │ │ │ │ -232 return _s_u_b_I_n_d_e_x_<_t_y_p_e_n_a_m_e_ _C_o_d_i_m_<_c_c_>_:_:_E_n_t_i_t_y>(entity, subEntity, codim); │ │ │ │ -233 } │ │ │ │ -234 │ │ │ │ -235 template │ │ │ │ -_2_3_6 bool _c_o_n_t_a_i_n_s(const Entity& entity) const │ │ │ │ -237 { │ │ │ │ -238 return (_i_n_d_i_c_e_s__[_a_l_l_E_n_t_i_t_y_M_a_p_p_e_r__.index(entity)] != unusesIndex); │ │ │ │ -239 } │ │ │ │ -240 │ │ │ │ -_2_4_1 _T_y_p_e_s _t_y_p_e_s(int codim) const │ │ │ │ -242 { │ │ │ │ -243 return _t_y_p_e_s_P_e_r_C_o_d_i_m__[codim]; │ │ │ │ -244 } │ │ │ │ -245 │ │ │ │ -246 // ********************************* │ │ │ │ -247 // Extended methods │ │ │ │ -248 // ********************************* │ │ │ │ -249 │ │ │ │ -_2_5_1 const HostGridView& _h_o_s_t_G_r_i_d_V_i_e_w() const │ │ │ │ -252 { │ │ │ │ -253 return _h_o_s_t_G_r_i_d_V_i_e_w__; │ │ │ │ -254 } │ │ │ │ -255 │ │ │ │ -_2_5_7 void _i_n_s_e_r_t_E_l_e_m_e_n_t(const typename _C_o_d_i_m_<_0_>_:_:_E_n_t_i_t_y& element) │ │ │ │ -258 { │ │ │ │ -259 const auto& re = referenceElement(element); │ │ │ │ -260 for (auto codim : Dune::range(0, _d_i_m_e_n_s_i_o_n+1)) │ │ │ │ -261 { │ │ │ │ -262 for (auto subEntity : Dune::range(re.size(codim))) │ │ │ │ -263 { │ │ │ │ -264 auto& _i_n_d_e_x = _i_n_d_i_c_e_s__[_a_l_l_E_n_t_i_t_y_M_a_p_p_e_r__.subIndex(element, subEntity, │ │ │ │ -codim)]; │ │ │ │ -265 if (_i_n_d_e_x==unusesIndex) │ │ │ │ -266 { │ │ │ │ -267 const auto& type = re.type(subEntity, codim); │ │ │ │ -268 const auto typeIndex = Dune::GlobalGeometryTypeIndex::index(type); │ │ │ │ -269 _i_n_d_e_x = _s_i_z_e_P_e_r_G_T__[typeIndex]; │ │ │ │ -270 if (_s_i_z_e_P_e_r_G_T__[typeIndex]==0) │ │ │ │ -271 _t_y_p_e_s_P_e_r_C_o_d_i_m__[codim].push_back(type); │ │ │ │ -272 _s_i_z_e_P_e_r_G_T__[typeIndex]++; │ │ │ │ -273 _s_i_z_e_P_e_r_C_o_d_i_m__[codim]++; │ │ │ │ -274 } │ │ │ │ -275 } │ │ │ │ -276 } │ │ │ │ -277 } │ │ │ │ -278 │ │ │ │ -279 protected: │ │ │ │ -280 │ │ │ │ -281 // Clear all data │ │ │ │ -_2_8_2 void _c_l_e_a_r() │ │ │ │ -283 { │ │ │ │ -284 for(auto& _s_i_z_e : _s_i_z_e_P_e_r_G_T__) │ │ │ │ -285 _s_i_z_e = 0; │ │ │ │ -286 for(auto& _s_i_z_e : _s_i_z_e_P_e_r_C_o_d_i_m__) │ │ │ │ -287 _s_i_z_e = 0; │ │ │ │ -288 for(auto& _t_y_p_e_s : _t_y_p_e_s_P_e_r_C_o_d_i_m__) │ │ │ │ -289 _t_y_p_e_s.clear(); │ │ │ │ -290 _i_n_d_i_c_e_s__.clear(); │ │ │ │ -291 _i_n_d_i_c_e_s__.resize(_a_l_l_E_n_t_i_t_y_M_a_p_p_e_r__.size(), unusesIndex); │ │ │ │ -292 } │ │ │ │ -293 │ │ │ │ -_2_9_4 HostGridView _h_o_s_t_G_r_i_d_V_i_e_w__; │ │ │ │ -295 │ │ │ │ -296 // Global size information │ │ │ │ -_2_9_7 std::array _s_i_z_e_P_e_r_G_T__; │ │ │ │ -_2_9_8 std::array _s_i_z_e_P_e_r_C_o_d_i_m__; │ │ │ │ -_2_9_9 std::array _t_y_p_e_s_P_e_r_C_o_d_i_m__; │ │ │ │ -300 │ │ │ │ -_3_0_1 AllEntityMapper _a_l_l_E_n_t_i_t_y_M_a_p_p_e_r__; │ │ │ │ -302 │ │ │ │ -303 // Index map │ │ │ │ -_3_0_4 std::vector _i_n_d_i_c_e_s__; │ │ │ │ -305 }; │ │ │ │ -306 │ │ │ │ -307 │ │ │ │ -308 │ │ │ │ -321 template │ │ │ │ -_3_2_2 class _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w │ │ │ │ -323 { │ │ │ │ -324 │ │ │ │ -325 template │ │ │ │ -326 class NonImplementedIterator │ │ │ │ -327 { │ │ │ │ -328 public: │ │ │ │ -329 NonImplementedIterator() │ │ │ │ -330 { │ │ │ │ -331 static_assert(codim==0, "SubDomainGridView::Codim::Iterator is only │ │ │ │ -implemented for codim=0"); │ │ │ │ -332 } │ │ │ │ -333 }; │ │ │ │ -334 │ │ │ │ -335 template │ │ │ │ -336 class ElementIterator │ │ │ │ -337 { │ │ │ │ -338 using Element = typename HGV::template _C_o_d_i_m_<_0_>_:_:_E_n_t_i_t_y; │ │ │ │ -339 public: │ │ │ │ -340 │ │ │ │ -341 using HostElementIterator = typename HGV::template _C_o_d_i_m_<_0_>_:_:_t_e_m_p_l_a_t_e │ │ │ │ -Partition::Iterator; │ │ │ │ -342 │ │ │ │ -343 ElementIterator(const _S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_<_H_G_V_>& _i_n_d_e_x_S_e_t, │ │ │ │ -HostElementIterator&& it, HostElementIterator&& endIt) │ │ │ │ -344 : _i_n_d_e_x_S_e_t__(&_i_n_d_e_x_S_e_t) │ │ │ │ -345 , hostIt_(std::move(it)) │ │ │ │ -346 , hostEndIt_(std::move(endIt)) │ │ │ │ -347 { │ │ │ │ -348 while ((hostIt_!= hostEndIt_) and (not _i_n_d_e_x_S_e_t__->contains(*hostIt_))) │ │ │ │ -349 ++hostIt_; │ │ │ │ -350 } │ │ │ │ -351 │ │ │ │ -352 ElementIterator& operator++() │ │ │ │ -353 { │ │ │ │ -354 ++hostIt_; │ │ │ │ -355 while ((hostIt_!= hostEndIt_) and (not _i_n_d_e_x_S_e_t__->contains(*hostIt_))) │ │ │ │ -356 ++hostIt_; │ │ │ │ -357 return *this; │ │ │ │ -358 } │ │ │ │ -359 │ │ │ │ -360 const Element& operator*() const │ │ │ │ -361 { │ │ │ │ -362 return *hostIt_; │ │ │ │ -363 } │ │ │ │ -364 │ │ │ │ -365 friend bool operator==(const ElementIterator& a, const ElementIterator& b) │ │ │ │ -366 { │ │ │ │ -367 return a.hostIt_==b.hostIt_; │ │ │ │ -368 } │ │ │ │ -369 │ │ │ │ -370 private: │ │ │ │ -371 HostElementIterator hostIt_; │ │ │ │ -372 HostElementIterator hostEndIt_; │ │ │ │ -373 const _S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_<_H_G_V_>* _i_n_d_e_x_S_e_t__; │ │ │ │ -374 }; │ │ │ │ -375 │ │ │ │ -376 public: │ │ │ │ -377 │ │ │ │ -_3_7_8 using _H_o_s_t_G_r_i_d_V_i_e_w = HGV; │ │ │ │ -379 │ │ │ │ -_3_8_0 using _G_r_i_d = typename HostGridView::Grid; │ │ │ │ -_3_8_1 using _c_t_y_p_e = typename Grid::ctype; │ │ │ │ -_3_8_2 using _I_n_d_e_x_S_e_t = _S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_<_H_o_s_t_G_r_i_d_V_i_e_w_>; │ │ │ │ -_3_8_3 using _I_n_t_e_r_s_e_c_t_i_o_n = typename HostGridView::Intersection; │ │ │ │ -_3_8_4 using _I_n_t_e_r_s_e_c_t_i_o_n_I_t_e_r_a_t_o_r = typename HostGridView::IntersectionIterator; │ │ │ │ -385 │ │ │ │ -387 template │ │ │ │ -_3_8_8 struct _C_o_d_i_m │ │ │ │ -389 { │ │ │ │ -_3_9_0 using _E_n_t_i_t_y = typename Grid::template _C_o_d_i_m_<_c_o_d_i_m_>_:_:_E_n_t_i_t_y; │ │ │ │ -_3_9_1 using _E_n_t_i_t_y_S_e_e_d = typename Grid::template _C_o_d_i_m_<_c_o_d_i_m_>_:_:_E_n_t_i_t_y_S_e_e_d; │ │ │ │ -_3_9_2 using _G_e_o_m_e_t_r_y = typename Grid::template _C_o_d_i_m_<_c_o_d_i_m_>_:_:_G_e_o_m_e_t_r_y; │ │ │ │ -_3_9_3 using _L_o_c_a_l_G_e_o_m_e_t_r_y = typename Grid::template _C_o_d_i_m_<_c_o_d_i_m_>_:_:_L_o_c_a_l_G_e_o_m_e_t_r_y; │ │ │ │ -_3_9_4 using _I_t_e_r_a_t_o_r = std::conditional_t, NonImplementedIterator>; │ │ │ │ -395 │ │ │ │ -396 template │ │ │ │ -_3_9_7 struct _P_a_r_t_i_t_i_o_n │ │ │ │ -398 { │ │ │ │ -_3_9_9 using _I_t_e_r_a_t_o_r = std::conditional_t, │ │ │ │ -NonImplementedIterator>; │ │ │ │ -400 }; │ │ │ │ -401 }; │ │ │ │ -402 │ │ │ │ -_4_0_3 enum {_d_i_m_e_n_s_i_o_n = Grid::dimension}; │ │ │ │ -_4_0_4 enum {_d_i_m_e_n_s_i_o_n_w_o_r_l_d = Grid::dimensionworld}; │ │ │ │ -405 │ │ │ │ -_4_0_6 _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w(const _I_n_d_e_x_S_e_t& _i_n_d_e_x_S_e_t) │ │ │ │ -407 : _i_n_d_e_x_S_e_t__(&_i_n_d_e_x_S_e_t) │ │ │ │ -408 {} │ │ │ │ -409 │ │ │ │ -_4_1_0 _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w(const _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w& other) = default; │ │ │ │ -411 │ │ │ │ -_4_1_2 const _G_r_i_d& _g_r_i_d() const │ │ │ │ -413 { │ │ │ │ -414 return _i_n_d_e_x_S_e_t__->hostGridView().grid(); │ │ │ │ -415 } │ │ │ │ -416 │ │ │ │ -_4_1_7 const _I_n_d_e_x_S_e_t& _i_n_d_e_x_S_e_t() const │ │ │ │ -418 { │ │ │ │ -419 return *_i_n_d_e_x_S_e_t__; │ │ │ │ -420 } │ │ │ │ -421 │ │ │ │ -_4_2_2 int _s_i_z_e(int codim) const │ │ │ │ -423 { │ │ │ │ -424 return _i_n_d_e_x_S_e_t__->size(codim); │ │ │ │ -425 } │ │ │ │ -426 │ │ │ │ -_4_2_7 int _s_i_z_e(Dune::GeometryType gt) const │ │ │ │ -428 { │ │ │ │ -429 return _i_n_d_e_x_S_e_t__->size(gt); │ │ │ │ -430 } │ │ │ │ -431 │ │ │ │ -432 template │ │ │ │ -_4_3_3 bool _c_o_n_t_a_i_n_s(const Entity& entity) const │ │ │ │ -434 { │ │ │ │ -435 return _i_n_d_e_x_S_e_t__->contains(entity); │ │ │ │ -436 } │ │ │ │ -437 │ │ │ │ -439 template │ │ │ │ -_4_4_0 typename Codim::template Partition::Iterator _b_e_g_i_n() const │ │ │ │ -441 { │ │ │ │ -442 static_assert(codim==0, "SubDomainGridView::begin is only │ │ │ │ -implemented for codim=0"); │ │ │ │ -443 return {_i_n_d_e_x_S_e_t(), _h_o_s_t_G_r_i_d_V_i_e_w().template _b_e_g_i_n_<_c_o_d_i_m_,_ _p_i_t_>(), │ │ │ │ -_h_o_s_t_G_r_i_d_V_i_e_w().template _e_n_d_<_c_o_d_i_m_,_ _p_i_t_>()}; │ │ │ │ -444 } │ │ │ │ -445 │ │ │ │ -447 template │ │ │ │ -_4_4_8 typename Codim::template Partition::Iterator _e_n_d() const │ │ │ │ -449 { │ │ │ │ -450 static_assert(codim==0, "SubDomainGridView::end is only implemented │ │ │ │ -for codim=0"); │ │ │ │ -451 return {_i_n_d_e_x_S_e_t(), _h_o_s_t_G_r_i_d_V_i_e_w().template _e_n_d_<_c_o_d_i_m_,_ _p_i_t_>(), _h_o_s_t_G_r_i_d_V_i_e_w │ │ │ │ -().template _e_n_d_<_c_o_d_i_m_,_ _p_i_t_>()}; │ │ │ │ -452 } │ │ │ │ -453 │ │ │ │ -_4_5_4 decltype(auto) _c_o_m_m() const │ │ │ │ -455 { │ │ │ │ -456 return _h_o_s_t_G_r_i_d_V_i_e_w().comm(); │ │ │ │ -457 } │ │ │ │ -458 │ │ │ │ -_4_5_9 decltype(auto) _i_b_e_g_i_n(const typename _C_o_d_i_m_<_0_>_:_:_E_n_t_i_t_y& element) const │ │ │ │ -460 { │ │ │ │ -461 return _h_o_s_t_G_r_i_d_V_i_e_w().ibegin(element); │ │ │ │ -462 } │ │ │ │ -463 │ │ │ │ -_4_6_4 decltype(auto) _i_e_n_d(const typename _C_o_d_i_m_<_0_>_:_:_E_n_t_i_t_y& element) const │ │ │ │ -465 { │ │ │ │ -466 return _h_o_s_t_G_r_i_d_V_i_e_w().iend(element); │ │ │ │ -467 } │ │ │ │ -468 │ │ │ │ -_4_7_0 const _H_o_s_t_G_r_i_d_V_i_e_w& _h_o_s_t_G_r_i_d_V_i_e_w() const │ │ │ │ -471 { │ │ │ │ -472 return _i_n_d_e_x_S_e_t__->hostGridView(); │ │ │ │ -473 } │ │ │ │ -474 │ │ │ │ -475 protected: │ │ │ │ -_4_7_6 const _I_n_d_e_x_S_e_t* _i_n_d_e_x_S_e_t__; │ │ │ │ -477 }; │ │ │ │ -478 │ │ │ │ -479 │ │ │ │ -480 │ │ │ │ -486 template │ │ │ │ -_4_8_7 auto _e_l_e_m_e_n_t_s(const _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_<_H_o_s_t_G_r_i_d_V_i_e_w_>& subDomainGridView) │ │ │ │ -488 { │ │ │ │ -489 return Dune::IteratorRange(subDomainGridView.template begin<0>(), │ │ │ │ -subDomainGridView.template end<0>()); │ │ │ │ -490 } │ │ │ │ -491 │ │ │ │ -497 template │ │ │ │ -_4_9_8 auto _e_l_e_m_e_n_t_s(const _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_<_H_o_s_t_G_r_i_d_V_i_e_w_>& subDomainGridView, │ │ │ │ -Dune::PartitionSet partitionSet) │ │ │ │ -499 { │ │ │ │ -500 constexpr auto pit = partitionSet.partitionIterator(); │ │ │ │ -501 return Dune::IteratorRange(subDomainGridView.template begin<0, pit>(), │ │ │ │ -subDomainGridView.template end<0, pit>()); │ │ │ │ -502 } │ │ │ │ -503 │ │ │ │ -509 template │ │ │ │ -_5_1_0 auto _i_n_t_e_r_s_e_c_t_i_o_n_s(const _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_<_H_o_s_t_G_r_i_d_V_i_e_w_>& │ │ │ │ -subDomainGridView, const Element& element) │ │ │ │ -511 { │ │ │ │ -512 return Dune::IteratorRange(subDomainGridView._i_b_e_g_i_n(element), │ │ │ │ -subDomainGridView._i_e_n_d(element)); │ │ │ │ -513 } │ │ │ │ -514 │ │ │ │ -515 │ │ │ │ -516 │ │ │ │ -532 template │ │ │ │ -_5_3_3 class _S_u_b_D_o_m_a_i_n │ │ │ │ -534 { │ │ │ │ -535 public: │ │ │ │ -536 │ │ │ │ -_5_3_7 using _H_o_s_t_G_r_i_d_V_i_e_w = HGV; │ │ │ │ -_5_3_8 using _G_r_i_d = typename HostGridView::Grid; │ │ │ │ -_5_3_9 using _I_n_d_e_x_S_e_t = _S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_<_H_o_s_t_G_r_i_d_V_i_e_w_>; │ │ │ │ -_5_4_0 using _G_r_i_d_V_i_e_w = _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_<_H_o_s_t_G_r_i_d_V_i_e_w_>; │ │ │ │ -541 │ │ │ │ -543 template │ │ │ │ -_5_4_4 struct _C_o_d_i_m │ │ │ │ -545 { │ │ │ │ -_5_4_6 using _E_n_t_i_t_y = typename Grid::template _C_o_d_i_m_<_c_o_d_i_m_>_:_:_E_n_t_i_t_y; │ │ │ │ -_5_4_7 using _E_n_t_i_t_y_S_e_e_d = typename Grid::template _C_o_d_i_m_<_c_o_d_i_m_>_:_:_E_n_t_i_t_y_S_e_e_d; │ │ │ │ -_5_4_8 using _G_e_o_m_e_t_r_y = typename Grid::template _C_o_d_i_m_<_c_o_d_i_m_>_:_:_G_e_o_m_e_t_r_y; │ │ │ │ -_5_4_9 using _L_o_c_a_l_G_e_o_m_e_t_r_y = typename Grid::template _C_o_d_i_m_<_c_o_d_i_m_>_:_:_L_o_c_a_l_G_e_o_m_e_t_r_y; │ │ │ │ -550 }; │ │ │ │ -551 │ │ │ │ -_5_5_2 enum {_d_i_m_e_n_s_i_o_n = Grid::dimension}; │ │ │ │ -553 │ │ │ │ -_5_5_5 _S_u_b_D_o_m_a_i_n(const _H_o_s_t_G_r_i_d_V_i_e_w& _h_o_s_t_G_r_i_d_V_i_e_w) │ │ │ │ -556 : indexSet_(_h_o_s_t_G_r_i_d_V_i_e_w) │ │ │ │ -557 {} │ │ │ │ -558 │ │ │ │ -_5_5_9 const _I_n_d_e_x_S_e_t& _i_n_d_e_x_S_e_t() const │ │ │ │ -560 { │ │ │ │ -561 return indexSet_; │ │ │ │ -562 } │ │ │ │ -563 │ │ │ │ -_5_6_5 _G_r_i_d_V_i_e_w _g_r_i_d_V_i_e_w() const │ │ │ │ -566 { │ │ │ │ -567 return _G_r_i_d_V_i_e_w(indexSet_); │ │ │ │ -568 } │ │ │ │ -569 │ │ │ │ -_5_7_1 _H_o_s_t_G_r_i_d_V_i_e_w _h_o_s_t_G_r_i_d_V_i_e_w() const │ │ │ │ -572 { │ │ │ │ -573 return indexSet_.hostGridView(); │ │ │ │ -574 } │ │ │ │ -575 │ │ │ │ -_5_7_7 void _i_n_s_e_r_t_E_l_e_m_e_n_t(const typename _C_o_d_i_m_<_0_>_:_:_E_n_t_i_t_y& element) │ │ │ │ -578 { │ │ │ │ -579 indexSet_.insertElement(element); │ │ │ │ -580 } │ │ │ │ -581 │ │ │ │ -_5_8_3 bool _c_o_n_t_a_i_n_s(const typename _C_o_d_i_m_<_0_>_:_:_E_n_t_i_t_y& element) const │ │ │ │ -584 { │ │ │ │ -585 return indexSet_.contains(element); │ │ │ │ -586 } │ │ │ │ -587 │ │ │ │ -588 private: │ │ │ │ -589 _I_n_d_e_x_S_e_t indexSet_; │ │ │ │ -590 }; │ │ │ │ -591 │ │ │ │ -592 │ │ │ │ -593 │ │ │ │ -599 template │ │ │ │ -_6_0_0 class _S_u_b_D_o_m_a_i_n_I_n_t_e_r_f_a_c_e │ │ │ │ -601 { │ │ │ │ -602 static_assert( │ │ │ │ -603 std::is_same_v, │ │ │ │ -604 "SubDomainInterface requires that both SubDomain types have the same │ │ │ │ -Intersection type"); │ │ │ │ -605 │ │ │ │ -606 public: │ │ │ │ -607 │ │ │ │ -_6_0_8 using _I_n_t_e_r_s_e_c_t_i_o_n = typename SubDomainA::GridView::Intersection; │ │ │ │ -609 │ │ │ │ -_6_1_7 _S_u_b_D_o_m_a_i_n_I_n_t_e_r_f_a_c_e(const SubDomainA& subDomainA, const SubDomainB& │ │ │ │ -subDomainB) │ │ │ │ -618 : subDomainA_(subDomainA) │ │ │ │ -619 , subDomainB_(subDomainB) │ │ │ │ -620 {} │ │ │ │ -621 │ │ │ │ -_6_3_1 bool _c_o_n_t_a_i_n_s(const _I_n_t_e_r_s_e_c_t_i_o_n& is) const │ │ │ │ -632 { │ │ │ │ -633 if (is.boundary() or not(is.neighbor())) │ │ │ │ -634 return false; │ │ │ │ -635 return (subDomainA_.contains(is.inside()) && subDomainB_.contains │ │ │ │ -(is.outside())) │ │ │ │ -636 || (subDomainA_.contains(is.outside()) && subDomainB_.contains(is.inside │ │ │ │ -())); │ │ │ │ -637 } │ │ │ │ -638 │ │ │ │ -_6_4_7 bool _i_s_O_r_i_e_n_t_e_d(const _I_n_t_e_r_s_e_c_t_i_o_n& is) const │ │ │ │ -648 { │ │ │ │ -649 if (is.boundary() or not(is.neighbor())) │ │ │ │ -650 return false; │ │ │ │ -651 return (subDomainA_.contains(is.inside()) && subDomainB_.contains │ │ │ │ -(is.outside())); │ │ │ │ -652 } │ │ │ │ -653 │ │ │ │ -_6_6_0 const auto _b_e_g_i_n() const │ │ │ │ -661 { │ │ │ │ -662 return Impl::GlobalIntersectionIt(subDomainA_.gridView(), [&](const auto& │ │ │ │ -is) { │ │ │ │ -663 if (is.boundary() or not(is.neighbor())) │ │ │ │ -664 return false; │ │ │ │ -665 return subDomainB_.indexSet().contains(is.outside()); │ │ │ │ -666 }, subDomainA_.gridView().template _b_e_g_i_n_<_0_>(), subDomainA_.gridView │ │ │ │ -().template _e_n_d_<_0_>()); │ │ │ │ -667 } │ │ │ │ -668 │ │ │ │ -_6_7_0 const auto _e_n_d() const │ │ │ │ -671 { │ │ │ │ -672 return typename decltype(_b_e_g_i_n())::SentinelIterator(); │ │ │ │ -673 } │ │ │ │ -674 │ │ │ │ -675 private: │ │ │ │ -676 const SubDomainA& subDomainA_; │ │ │ │ -677 const SubDomainB& subDomainB_; │ │ │ │ -678 }; │ │ │ │ -679 │ │ │ │ -680 │ │ │ │ -681 │ │ │ │ -687 template │ │ │ │ -_6_8_8 class _S_u_b_D_o_m_a_i_n_S_k_e_l_e_t_o_n │ │ │ │ -689 { │ │ │ │ -690 public: │ │ │ │ -691 │ │ │ │ -_6_9_2 using _I_n_t_e_r_s_e_c_t_i_o_n = typename _S_u_b_D_o_m_a_i_n_:_:_G_r_i_d_V_i_e_w_:_:_I_n_t_e_r_s_e_c_t_i_o_n; │ │ │ │ -693 │ │ │ │ -_6_9_5 _S_u_b_D_o_m_a_i_n_S_k_e_l_e_t_o_n(const _S_u_b_D_o_m_a_i_n& subDomain) │ │ │ │ -696 : subDomain_(subDomain) │ │ │ │ -697 {} │ │ │ │ -698 │ │ │ │ -_7_0_0 bool _c_o_n_t_a_i_n_s(const _I_n_t_e_r_s_e_c_t_i_o_n& is) const │ │ │ │ -701 { │ │ │ │ -702 if (is.boundary() or not(is.neighbor())) │ │ │ │ -703 return false; │ │ │ │ -704 return subDomain_.contains(is.inside()) and subDomain_.contains(is.outside │ │ │ │ -()); │ │ │ │ -705 } │ │ │ │ -706 │ │ │ │ -707 private: │ │ │ │ -708 const _S_u_b_D_o_m_a_i_n& subDomain_; │ │ │ │ -709 }; │ │ │ │ -710 │ │ │ │ -711 │ │ │ │ -712 │ │ │ │ -713} // namespace Dune::Functions::Experimental │ │ │ │ -714 │ │ │ │ -715#endif// DUNE_FUNCTIONS_COMMON_SUBDOMAIN_HH │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_e_l_e_m_e_n_t_s │ │ │ │ -auto elements(const SubDomainGridView< HostGridView > &subDomainGridView) │ │ │ │ -ADL findable access to element range for a SubDomainGridView. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:487 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_i_n_t_e_r_s_e_c_t_i_o_n_s │ │ │ │ -auto intersections(const SubDomainGridView< HostGridView > &subDomainGridView, │ │ │ │ -const Element &element) │ │ │ │ -ADL findable access to intersection range for an element of a │ │ │ │ -SubDomainGridView. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:510 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:28 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t │ │ │ │ -An IndexSet for a sub-domain. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:148 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t │ │ │ │ -SubDomainIndexSet(const HostGridView &hostGridView) │ │ │ │ -Construct SubDomainIndexSet for underlying host grid view. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:184 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_<_ _H_o_s_t_G_r_i_d_V_i_e_w_ _>_:_:_s_i_z_e_P_e_r_G_T__ │ │ │ │ -std::array< std::size_t, typeIndexSize > sizePerGT_ │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:297 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_<_ _H_o_s_t_G_r_i_d_V_i_e_w_ _>_:_:_i_n_d_i_c_e_s__ │ │ │ │ -std::vector< IndexType > indices_ │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:304 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_i_n_d_e_x │ │ │ │ -IndexType index(const typename Codim< cc >::Entity &entity) const │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:215 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_<_ _H_o_s_t_G_r_i_d_V_i_e_w_ _>_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ -@ dimension │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:167 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_i_n_d_e_x │ │ │ │ -IndexType index(const Entity &entity) const │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:206 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_s_i_z_e │ │ │ │ -IndexType size(int codim) const │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:200 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_<_ _H_o_s_t_G_r_i_d_V_i_e_w_ _>_:_: │ │ │ │ -_a_l_l_E_n_t_i_t_y_M_a_p_p_e_r__ │ │ │ │ -AllEntityMapper allEntityMapper_ │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:301 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_s_i_z_e │ │ │ │ -IndexType size(Dune::GeometryType gt) const │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:195 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_i_n_s_e_r_t_E_l_e_m_e_n_t │ │ │ │ -void insertElement(const typename Codim< 0 >::Entity &element) │ │ │ │ -Insert element and all its sub-entities into SubDomainIndexSet. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:257 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_t_y_p_e_s │ │ │ │ -Types types(int codim) const │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:241 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_T_y_p_e_s │ │ │ │ -std::vector< Dune::GeometryType > Types │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:154 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_s_u_b_I_n_d_e_x │ │ │ │ -IndexType subIndex(const typename Codim< cc >::Entity &entity, int subEntity, │ │ │ │ -unsigned int codim) const │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:230 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_<_ _H_o_s_t_G_r_i_d_V_i_e_w_ _>_:_:_h_o_s_t_G_r_i_d_V_i_e_w__ │ │ │ │ -HostGridView hostGridView_ │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:294 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_<_ _H_o_s_t_G_r_i_d_V_i_e_w_ _>_:_:_s_i_z_e_P_e_r_C_o_d_i_m__ │ │ │ │ -std::array< std::size_t, dimension+1 > sizePerCodim_ │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:298 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_G_r_i_d │ │ │ │ -typename HostGridView::Grid Grid │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:153 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_<_ _H_o_s_t_G_r_i_d_V_i_e_w_ _>_:_:_h_o_s_t_G_r_i_d_V_i_e_w │ │ │ │ -const HostGridView & hostGridView() const │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:251 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_c_l_e_a_r │ │ │ │ -void clear() │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:282 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_c_o_n_t_a_i_n_s │ │ │ │ -bool contains(const Entity &entity) const │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:236 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_<_ _H_o_s_t_G_r_i_d_V_i_e_w_ _>_:_: │ │ │ │ -_t_y_p_e_s_P_e_r_C_o_d_i_m__ │ │ │ │ -std::array< Types, dimension+1 > typesPerCodim_ │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:299 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_I_n_d_e_x_T_y_p_e │ │ │ │ -std::size_t IndexType │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:155 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_s_u_b_I_n_d_e_x │ │ │ │ -IndexType subIndex(const Entity &entity, int subEntity, unsigned int codim) │ │ │ │ -const │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:221 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_C_o_d_i_m │ │ │ │ -Codim specific typedefs. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:160 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_C_o_d_i_m_:_:_E_n_t_i_t_y_S_e_e_d │ │ │ │ -typename Grid::template Codim< codim >::EntitySeed EntitySeed │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:162 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_C_o_d_i_m_:_:_G_e_o_m_e_t_r_y │ │ │ │ -typename Grid::template Codim< codim >::Geometry Geometry │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:163 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_C_o_d_i_m_:_:_L_o_c_a_l_G_e_o_m_e_t_r_y │ │ │ │ -typename Grid::template Codim< codim >::LocalGeometry LocalGeometry │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:164 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_d_e_x_S_e_t_:_:_C_o_d_i_m_:_:_E_n_t_i_t_y │ │ │ │ -typename Grid::template Codim< codim >::Entity Entity │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:161 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w │ │ │ │ -A GridView for a sub-domain. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:323 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_<_ _H_o_s_t_G_r_i_d_V_i_e_w_ _>_:_: │ │ │ │ -_d_i_m_e_n_s_i_o_n_w_o_r_l_d │ │ │ │ -@ dimensionworld │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:404 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_<_ _H_o_s_t_G_r_i_d_V_i_e_w_ _>_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ -@ dimension │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:403 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_G_r_i_d │ │ │ │ -typename HostGridView::Grid Grid │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:380 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_e_n_d │ │ │ │ -Codim< codim >::template Partition< pit >::Iterator end() const │ │ │ │ -Create an iterator pointing to the end of the range. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:448 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_c_o_n_t_a_i_n_s │ │ │ │ -bool contains(const Entity &entity) const │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:433 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_i_n_d_e_x_S_e_t__ │ │ │ │ -const IndexSet * indexSet_ │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:476 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_i_n_d_e_x_S_e_t │ │ │ │ -const IndexSet & indexSet() const │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:417 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w │ │ │ │ -SubDomainGridView(const SubDomainGridView &other)=default │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_g_r_i_d │ │ │ │ -const Grid & grid() const │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:412 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_c_t_y_p_e │ │ │ │ -typename Grid::ctype ctype │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:381 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_I_n_t_e_r_s_e_c_t_i_o_n_I_t_e_r_a_t_o_r │ │ │ │ -typename HostGridView::IntersectionIterator IntersectionIterator │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:384 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_h_o_s_t_G_r_i_d_V_i_e_w │ │ │ │ -const HostGridView & hostGridView() const │ │ │ │ -Access underlying host grid view. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:470 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_I_n_d_e_x_S_e_t │ │ │ │ -SubDomainIndexSet< HostGridView > IndexSet │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:382 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_I_n_t_e_r_s_e_c_t_i_o_n │ │ │ │ -typename HostGridView::Intersection Intersection │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:383 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_c_o_m_m │ │ │ │ -decltype(auto) comm() const │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:454 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_s_i_z_e │ │ │ │ -int size(int codim) const │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:422 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_i_b_e_g_i_n │ │ │ │ -decltype(auto) ibegin(const typename Codim< 0 >::Entity &element) const │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:459 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_s_i_z_e │ │ │ │ -int size(Dune::GeometryType gt) const │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:427 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_i_e_n_d │ │ │ │ -decltype(auto) iend(const typename Codim< 0 >::Entity &element) const │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:464 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_H_o_s_t_G_r_i_d_V_i_e_w │ │ │ │ -HGV HostGridView │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:378 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_b_e_g_i_n │ │ │ │ -Codim< codim >::template Partition< pit >::Iterator begin() const │ │ │ │ -Create an iterator pointing to the begin of the range. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:440 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w │ │ │ │ -SubDomainGridView(const IndexSet &indexSet) │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:406 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_C_o_d_i_m │ │ │ │ -Codim specific typedefs. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:389 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_C_o_d_i_m_:_:_E_n_t_i_t_y │ │ │ │ -typename Grid::template Codim< codim >::Entity Entity │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:390 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_C_o_d_i_m_:_:_G_e_o_m_e_t_r_y │ │ │ │ -typename Grid::template Codim< codim >::Geometry Geometry │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:392 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_C_o_d_i_m_:_:_L_o_c_a_l_G_e_o_m_e_t_r_y │ │ │ │ -typename Grid::template Codim< codim >::LocalGeometry LocalGeometry │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:393 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_C_o_d_i_m_:_:_E_n_t_i_t_y_S_e_e_d │ │ │ │ -typename Grid::template Codim< codim >::EntitySeed EntitySeed │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:391 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_C_o_d_i_m_:_:_I_t_e_r_a_t_o_r │ │ │ │ -std::conditional_t< codim==0, ElementIterator< All_Partition >, │ │ │ │ -NonImplementedIterator< codim > > Iterator │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:394 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_C_o_d_i_m_:_:_P_a_r_t_i_t_i_o_n │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:398 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w_:_:_C_o_d_i_m_:_:_P_a_r_t_i_t_i_o_n_:_:_I_t_e_r_a_t_o_r │ │ │ │ -std::conditional_t< codim==0, ElementIterator< pit >, NonImplementedIterator< │ │ │ │ -codim > > Iterator │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:399 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n │ │ │ │ -Class representing a sub-domain of a GridView. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:534 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_i_n_s_e_r_t_E_l_e_m_e_n_t │ │ │ │ -void insertElement(const typename Codim< 0 >::Entity &element) │ │ │ │ -Insert element and all its sub-entities into SubDomain. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:577 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_g_r_i_d_V_i_e_w │ │ │ │ -GridView gridView() const │ │ │ │ -Create grid view representing the SubDomain. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:565 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_i_n_d_e_x_S_e_t │ │ │ │ -const IndexSet & indexSet() const │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:559 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_G_r_i_d_V_i_e_w │ │ │ │ -SubDomainGridView< HostGridView > GridView │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:540 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_h_o_s_t_G_r_i_d_V_i_e_w │ │ │ │ -HostGridView hostGridView() const │ │ │ │ -Access underlying host grid view. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:571 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_S_u_b_D_o_m_a_i_n │ │ │ │ -SubDomain(const HostGridView &hostGridView) │ │ │ │ -Construct SubDomain for underlying host grid view. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:555 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_G_r_i_d │ │ │ │ -typename HostGridView::Grid Grid │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:538 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ -@ dimension │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:552 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_c_o_n_t_a_i_n_s │ │ │ │ -bool contains(const typename Codim< 0 >::Entity &element) const │ │ │ │ -Check if element is contained in SubDomain. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:583 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_I_n_d_e_x_S_e_t │ │ │ │ -SubDomainIndexSet< HostGridView > IndexSet │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:539 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_H_o_s_t_G_r_i_d_V_i_e_w │ │ │ │ -HGV HostGridView │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:537 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_C_o_d_i_m │ │ │ │ -Codim specific typedefs. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:545 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_C_o_d_i_m_:_:_G_e_o_m_e_t_r_y │ │ │ │ -typename Grid::template Codim< codim >::Geometry Geometry │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:548 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_C_o_d_i_m_:_:_E_n_t_i_t_y │ │ │ │ -typename Grid::template Codim< codim >::Entity Entity │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:546 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_C_o_d_i_m_:_:_L_o_c_a_l_G_e_o_m_e_t_r_y │ │ │ │ -typename Grid::template Codim< codim >::LocalGeometry LocalGeometry │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:549 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_C_o_d_i_m_:_:_E_n_t_i_t_y_S_e_e_d │ │ │ │ -typename Grid::template Codim< codim >::EntitySeed EntitySeed │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:547 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_t_e_r_f_a_c_e_:_:_e_n_d │ │ │ │ -const auto end() const │ │ │ │ -End iterator (sentinel). │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:670 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_t_e_r_f_a_c_e_:_:_c_o_n_t_a_i_n_s │ │ │ │ -bool contains(const Intersection &is) const │ │ │ │ -Check if intersection is contained in the interface between the subdomains. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:631 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_t_e_r_f_a_c_e_:_:_b_e_g_i_n │ │ │ │ -const auto begin() const │ │ │ │ -Begin iterator over all intersection between the subdomains. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:660 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_t_e_r_f_a_c_e_:_:_S_u_b_D_o_m_a_i_n_I_n_t_e_r_f_a_c_e │ │ │ │ -SubDomainInterface(const SubDomainA &subDomainA, const SubDomainB &subDomainB) │ │ │ │ -Create interface between two subdomains. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:617 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_t_e_r_f_a_c_e_:_:_i_s_O_r_i_e_n_t_e_d │ │ │ │ -bool isOriented(const Intersection &is) const │ │ │ │ -Check if intersection is oriented. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:647 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_I_n_t_e_r_f_a_c_e_:_:_I_n_t_e_r_s_e_c_t_i_o_n │ │ │ │ -typename SubDomainA::GridView::Intersection Intersection │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:608 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_S_k_e_l_e_t_o_n_:_:_S_u_b_D_o_m_a_i_n_S_k_e_l_e_t_o_n │ │ │ │ -SubDomainSkeleton(const SubDomain &subDomain) │ │ │ │ -Create skeleton of a subdomain. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:695 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_S_k_e_l_e_t_o_n_:_:_c_o_n_t_a_i_n_s │ │ │ │ -bool contains(const Intersection &is) const │ │ │ │ -Check if intersection is contained in the skeleton of the subdomain. │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:700 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_S_k_e_l_e_t_o_n_:_:_I_n_t_e_r_s_e_c_t_i_o_n │ │ │ │ -typename SubDomain::GridView::Intersection Intersection │ │ │ │ -DDeeffiinniittiioonn subdomain.hh:692 │ │ │ │ +62 feImpl_->referenceLocalBasis().evaluateJacobian(x, jacobianBuffer_); │ │ │ │ +63 out.resize(size()); │ │ │ │ +64 feImpl_->transform(jacobianBuffer_, out); │ │ │ │ +65 } │ │ │ │ +66 │ │ │ │ +77 template, int> = 0> │ │ │ │ +79 void evaluateHessian(const typename Traits::DomainType &x, │ │ │ │ +80 std::vector &out) const │ │ │ │ +81 { │ │ │ │ +82 feImpl_->referenceLocalBasis().evaluateHessian(x, hessianBuffer_); │ │ │ │ +83 out.resize(size()); │ │ │ │ +84 feImpl_->transform(hessianBuffer_, out); │ │ │ │ +85 } │ │ │ │ +86 │ │ │ │ +94 void partial(std::array const &order, │ │ │ │ +95 const typename Traits::DomainType &x, │ │ │ │ +96 std::vector &out) const │ │ │ │ +97 { │ │ │ │ +98 feImpl_->referenceLocalBasis().partial(order, x, rangeBuffer_); │ │ │ │ +99 out.resize(size()); │ │ │ │ +100 feImpl_->transform(rangeBuffer_, out); │ │ │ │ +101 } │ │ │ │ +102 │ │ │ │ +104 auto order() const { return feImpl_->referenceLocalBasis().order(); } │ │ │ │ +105 │ │ │ │ +106 private: │ │ │ │ +107 FEImplementation const* feImpl_; │ │ │ │ +108 mutable std::vector rangeBuffer_; │ │ │ │ +109 mutable std::vector jacobianBuffer_; │ │ │ │ +110 mutable std::vector hessianBuffer_; │ │ │ │ +111}; │ │ │ │ +112 │ │ │ │ +113 │ │ │ │ +114 │ │ │ │ +146template │ │ │ │ +147class TransformedFiniteElementMixin │ │ │ │ +148{ │ │ │ │ +149 public: │ │ │ │ +150 TransformedFiniteElementMixin() │ │ │ │ +151 : tlb_(this->asImpl()) │ │ │ │ +152 {} │ │ │ │ +153 │ │ │ │ +154 TransformedFiniteElementMixin(TransformedFiniteElementMixin const& other) │ │ │ │ +155 : TransformedFiniteElementMixin() │ │ │ │ +156 {} │ │ │ │ +157 │ │ │ │ +158 const FEImplementation& asImpl() const │ │ │ │ +159 { │ │ │ │ +160 return *(static_cast(this)); │ │ │ │ +161 } │ │ │ │ +162 │ │ │ │ +163 auto const& localBasis() const │ │ │ │ +164 { │ │ │ │ +165 return tlb_; │ │ │ │ +166 } │ │ │ │ +167 │ │ │ │ +168 protected: │ │ │ │ +169 TransformedLocalBasis tlb_; │ │ │ │ +170}; │ │ │ │ +171 │ │ │ │ +172} // end namespace Dune::Functions::Impl │ │ │ │ +173 │ │ │ │ +174#endif │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _s_u_b_d_o_m_a_i_n_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _t_r_a_n_s_f_o_r_m_e_d_f_i_n_i_t_e_e_l_e_m_e_n_t_m_i_x_i_n_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00206.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: staticforloop.hh File Reference │ │ │ +Dune-Functions: restrictedbasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,46 +88,56 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
staticforloop.hh File Reference
│ │ │ +
restrictedbasis.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <dune/common/concept.hh>
│ │ │ -#include <dune/functions/common/type_traits.hh>
│ │ │ -#include <dune/functions/functionspacebases/concepts.hh>
│ │ │ +
#include <cstddef>
│ │ │ +#include <utility>
│ │ │ +#include <dune/common/typetree/traversal.hh>
│ │ │ +#include <dune/functions/functionspacebases/nodes.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +

│ │ │ +Classes

class  Dune::Functions::Experimental::RestrictedPreBasis< GV, SDPB, SD >
 A pre-basis restricted to a sub-domain. More...
class  Dune::Functions::Experimental::RestrictedPreBasis< GV, SDPB, SD >::Node
 Template mapping root tree path to type of created tree node. More...
│ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ + │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::Experimental
namespace  Dune::Functions::Experimental::BasisFactory
│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Functions

template<std::size_t begin_t, std::size_t end_t, class F, class... Args>
void Dune::Functions::staticFindInRange (F &&f, Args &&... args)
 Static find loop.
template<class SubDomainBasisFactory, class SubDomain>
auto Dune::Functions::Experimental::BasisFactory::restrict (SubDomainBasisFactory &&subPreBasisFactory, const SubDomain &subDomain)
 Create a RestrictedPreBasisFactory.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,21 +1,30 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -staticforloop.hh File Reference │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +restrictedbasis.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ +CCllaasssseess │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_<_ _G_V_,_ _S_D_P_B_,_ _S_D_ _> │ │ │ │ +  A pre-basis restricted to a sub-domain. _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_<_ _G_V_,_ _S_D_P_B_,_ _S_D_ _>_:_:_N_o_d_e │ │ │ │ +  Template mapping root tree path to type of created tree node. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ +namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l │ │ │ │ +namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -void  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_s_t_a_t_i_c_F_i_n_d_I_n_R_a_n_g_e (F &&f, Args &&... args) │ │ │ │ -  Static find loop. │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_r_e_s_t_r_i_c_t │ │ │ │ + (SubDomainBasisFactory &&subPreBasisFactory, const _S_u_b_D_o_m_a_i_n &subDomain) │ │ │ │ +  Create a RestrictedPreBasisFactory. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _s_t_a_t_i_c_f_o_r_l_o_o_p_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _r_e_s_t_r_i_c_t_e_d_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00206.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,3 +1,4 @@ │ │ │ │ var a00206 = [ │ │ │ │ - ["Dune::Functions::staticFindInRange", "a00314.html#gaa625ea93bc3285b8a09c9267302386ec", null] │ │ │ │ + ["Dune::Functions::Experimental::RestrictedPreBasis< GV, SDPB, SD >::Node", "a02134.html", "a02134"], │ │ │ │ + ["Dune::Functions::Experimental::BasisFactory::restrict", "a00312.html#gac8fb8e934e9b092c8da8de6b22e69e82", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00206_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: staticforloop.hh Source File │ │ │ +Dune-Functions: restrictedbasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,87 +88,274 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
staticforloop.hh
│ │ │ +
restrictedbasis.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH
│ │ │ -
8#define DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RESTRICTEDBASIS_HH
│ │ │ +
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RESTRICTEDBASIS_HH
│ │ │
9
│ │ │ -
10
│ │ │ -
11#include <dune/common/concept.hh>
│ │ │ +
10#include <cstddef>
│ │ │ +
11#include <utility>
│ │ │
12
│ │ │ - │ │ │ - │ │ │ -
15
│ │ │ +
13#include <dune/common/typetree/traversal.hh>
│ │ │ +
14
│ │ │ + │ │ │
16
│ │ │ -
17namespace Dune {
│ │ │ -
18namespace Functions {
│ │ │ +
17
│ │ │ + │ │ │
19
│ │ │ -
20namespace Imp {
│ │ │ -
21
│ │ │ -
22template<class ST, ST begin, ST end>
│ │ │ -
23struct StaticFindInRange
│ │ │ -
24{
│ │ │ -
25 template<class F, class...Args>
│ │ │ -
26 static void apply(F&& f, Args&&... args)
│ │ │ -
27 {
│ │ │ -
28 if (f(std::integral_constant<ST, begin>(), std::forward<Args>(args)...))
│ │ │ -
29 return;
│ │ │ -
30 StaticFindInRange<ST, begin+1, end>::apply(std::forward<F>(f), std::forward<Args>(args)...);
│ │ │ -
31 }
│ │ │ -
32};
│ │ │ -
33
│ │ │ -
34template<class ST, ST end>
│ │ │ -
35struct StaticFindInRange<ST, end, end>
│ │ │ -
36{
│ │ │ -
37 template<class F, class...Args>
│ │ │ -
38 static void apply(F&& f, Args&&...)
│ │ │ -
39 {}
│ │ │ -
40};
│ │ │ -
41
│ │ │ -
42} //end namespace Imp
│ │ │ -
43
│ │ │ -
44
│ │ │ -
45
│ │ │ -
59template<std::size_t begin_t, std::size_t end_t, class F, class... Args>
│ │ │ -
│ │ │ -
60void staticFindInRange(F&& f, Args&&... args)
│ │ │ -
61{
│ │ │ -
62 Imp::StaticFindInRange<std::size_t, begin_t, end_t>::apply(std::forward<F>(f), std::forward<Args>(args)...);
│ │ │ -
63}
│ │ │ -
│ │ │ -
64
│ │ │ +
20
│ │ │ +
21
│ │ │ +
42template<class GV, class SDPB, class SD>
│ │ │ +
│ │ │ + │ │ │ +
44{
│ │ │ + │ │ │ +
46
│ │ │ +
47public:
│ │ │ +
48
│ │ │ +
49 using SubDomain = SD;
│ │ │ +
50 using SubDomainPreBasis = SDPB;
│ │ │ +
51 using SubDomainGridView = typename SubDomainPreBasis::GridView;
│ │ │ +
52
│ │ │ +
54 using GridView = GV;
│ │ │ +
55
│ │ │ +
57 using size_type = std::size_t;
│ │ │ +
58
│ │ │ +
│ │ │ +
60 class Node
│ │ │ +
61 : public SubDomainPreBasis::Node
│ │ │ +
62 {
│ │ │ +
63 using Base = typename SubDomainPreBasis::Node;
│ │ │ +
64 public:
│ │ │
65
│ │ │ -
66} // namespace Dune::Functions
│ │ │ -
67} // namespace Dune
│ │ │ -
68
│ │ │ -
69
│ │ │ -
70
│ │ │ -
71#endif //DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH
│ │ │ - │ │ │ -
void staticFindInRange(F &&f, Args &&... args)
Static find loop.
Definition staticforloop.hh:60
│ │ │ -
Definition monomialset.hh:19
│ │ │ -
Definition monomialset.hh:19
│ │ │ - │ │ │ +
66 using Element = typename Base::Element;
│ │ │ +
67
│ │ │ +
│ │ │ +
68 Node(Base&& base, const SubDomainGridView& subDomainGridView, const SubDomain& subDomain)
│ │ │ +
69 : Base(base)
│ │ │ +
70 , subDomainGridView_(subDomainGridView)
│ │ │ +
71 , subDomain_(subDomain)
│ │ │ +
72 {}
│ │ │ +
│ │ │ +
73
│ │ │ +
│ │ │ +
74 void bind(const Element& element)
│ │ │ +
75 {
│ │ │ +
76 if (subDomainGridView_.contains(element))
│ │ │ +
77 Base::bind(element);
│ │ │ +
78 else
│ │ │ +
79 {
│ │ │ +
80 Dune::TypeTree::forEachNode(static_cast<Base&>(*this) , [&](auto& node, const auto& treePath) {
│ │ │ +
81 Dune::Functions::Impl::BasisNodeSetupHelper::setOffset(node, this->offset());
│ │ │ +
82 Dune::Functions::Impl::BasisNodeSetupHelper::setSize(node, 0);
│ │ │ +
83 });
│ │ │ +
84 }
│ │ │ +
85 }
│ │ │ +
│ │ │ +
86
│ │ │ +
│ │ │ +
87 const SubDomain& subDomain() const
│ │ │ +
88 {
│ │ │ +
89 return subDomain_;
│ │ │ +
90 }
│ │ │ +
│ │ │ +
91
│ │ │ +
92 private:
│ │ │ +
93 const SubDomainGridView& subDomainGridView_;
│ │ │ +
94 const SubDomain& subDomain_;
│ │ │ +
95 };
│ │ │ +
│ │ │ +
96
│ │ │ +
97 static constexpr size_type maxMultiIndexSize = SubDomainPreBasis::maxMultiIndexSize;
│ │ │ +
98 static constexpr size_type minMultiIndexSize = SubDomainPreBasis::minMultiIndexSize;
│ │ │ +
99 static constexpr size_type multiIndexBufferSize = SubDomainPreBasis::multiIndexBufferSize;
│ │ │ +
100
│ │ │ +
│ │ │ + │ │ │ + │ │ │ + │ │ │ +
110 , subDomainPtr_(&subDomain)
│ │ │ +
111 {}
│ │ │ +
│ │ │ +
112
│ │ │ +
│ │ │ + │ │ │ +
115 {
│ │ │ +
116 subDomainPreBasis_.initializeIndices();
│ │ │ +
117 }
│ │ │ +
│ │ │ +
118
│ │ │ +
│ │ │ +
120 const GridView& gridView() const
│ │ │ +
121 {
│ │ │ +
122 return gridView_;
│ │ │ +
123 }
│ │ │ +
│ │ │ +
124
│ │ │ +
│ │ │ +
133 void update(const GridView& gv)
│ │ │ +
134 {
│ │ │ +
135 gridView_ = gv;
│ │ │ +
136 subDomainPreBasis_.update(subDomainPtr_->gridView());
│ │ │ +
137 }
│ │ │ +
│ │ │ +
138
│ │ │ +
│ │ │ + │ │ │ +
143 {
│ │ │ +
144 return Node(subDomainPreBasis_.makeNode(), subDomainPreBasis_.gridView(), *subDomainPtr_);
│ │ │ +
145 }
│ │ │ +
│ │ │ +
146
│ │ │ +
│ │ │ + │ │ │ +
149 {
│ │ │ +
150 return subDomainPreBasis_.size();
│ │ │ +
151 }
│ │ │ +
│ │ │ +
152
│ │ │ +
154 template<class SizePrefix>
│ │ │ +
│ │ │ +
155 size_type size(const SizePrefix& prefix) const
│ │ │ +
156 {
│ │ │ +
157 return subDomainPreBasis_.size(prefix);
│ │ │ +
158 }
│ │ │ +
│ │ │ +
159
│ │ │ +
│ │ │ + │ │ │ +
162 {
│ │ │ +
163 return subDomainPreBasis_.containerDescriptor();
│ │ │ +
164 }
│ │ │ +
│ │ │ +
165
│ │ │ +
│ │ │ + │ │ │ +
168 {
│ │ │ +
169 return subDomainPreBasis_.dimension();
│ │ │ +
170 }
│ │ │ +
│ │ │ +
171
│ │ │ +
│ │ │ + │ │ │ +
174 {
│ │ │ +
175 return subDomainPreBasis_.maxNodeSize();
│ │ │ +
176 }
│ │ │ +
│ │ │ +
177
│ │ │ +
│ │ │ + │ │ │ +
179 {
│ │ │ +
180 return subDomainPreBasis_;
│ │ │ +
181 }
│ │ │ +
│ │ │ +
182
│ │ │ +
│ │ │ + │ │ │ +
184 {
│ │ │ +
185 return subDomainPreBasis_;
│ │ │ +
186 }
│ │ │ +
│ │ │ +
187
│ │ │ +
188 template<typename It>
│ │ │ +
│ │ │ +
189 It indices(const Node& node, It it) const
│ │ │ +
190 {
│ │ │ +
191 if (node.size() == 0)
│ │ │ +
192 return it;
│ │ │ +
193 else
│ │ │ +
194 return subDomainPreBasis_.indices(node, it);
│ │ │ +
195 }
│ │ │ +
│ │ │ +
196
│ │ │ +
197protected:
│ │ │ + │ │ │ + │ │ │ + │ │ │ +
201};
│ │ │ +
│ │ │ +
202
│ │ │ +
203
│ │ │ +
204
│ │ │ +
│ │ │ +
205namespace BasisFactory {
│ │ │ +
206
│ │ │ +
224template<class SubDomainBasisFactory, class SubDomain>
│ │ │ +
│ │ │ +
225auto restrict(SubDomainBasisFactory&& subPreBasisFactory, const SubDomain& subDomain)
│ │ │ +
226{
│ │ │ +
227 return [
│ │ │ +
228 subPreBasisFactory=std::forward<SubDomainBasisFactory>(subPreBasisFactory),
│ │ │ +
229 &subDomain
│ │ │ +
230 ](const auto& gridView) {
│ │ │ +
231 return Dune::Functions::Experimental::RestrictedPreBasis(gridView, subPreBasisFactory(subDomain.gridView()), subDomain);
│ │ │ +
232 };
│ │ │ +
233}
│ │ │ +
│ │ │ +
234
│ │ │ +
235
│ │ │ +
236} // end namespace BasisFactory
│ │ │ +
│ │ │ +
237} // end namespace Dune::Functions::Experimental
│ │ │ +
238
│ │ │ +
239
│ │ │ +
240#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RESTRICTEDBASIS_HH
│ │ │ + │ │ │ +
auto restrict(SubDomainBasisFactory &&subPreBasisFactory, const SubDomain &subDomain)
Create a RestrictedPreBasisFactory.
Definition restrictedbasis.hh:225
│ │ │ +
Definition subdomain.hh:28
│ │ │ +
Definition restrictedbasis.hh:205
│ │ │ +
Class representing a sub-domain of a GridView.
Definition subdomain.hh:534
│ │ │ +
GridView gridView() const
Create grid view representing the SubDomain.
Definition subdomain.hh:565
│ │ │ +
A pre-basis restricted to a sub-domain.
Definition restrictedbasis.hh:44
│ │ │ +
std::size_t size_type
Type used for indices and size information.
Definition restrictedbasis.hh:57
│ │ │ +
RestrictedPreBasis(const GridView &gridView, SubDomainPreBasis &&subDomainPreBasis, const SubDomain &subDomain)
Constructor for given sub-domain pre-basis.
Definition restrictedbasis.hh:107
│ │ │ +
void initializeIndices()
Initialize the global indices.
Definition restrictedbasis.hh:114
│ │ │ +
const SubDomainPreBasis & subDomainPreBasis() const
Definition restrictedbasis.hh:178
│ │ │ +
SDPB SubDomainPreBasis
Definition restrictedbasis.hh:50
│ │ │ +
static constexpr size_type minMultiIndexSize
Definition restrictedbasis.hh:98
│ │ │ +
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition restrictedbasis.hh:167
│ │ │ +
SubDomainPreBasis subDomainPreBasis_
Definition restrictedbasis.hh:199
│ │ │ +
SubDomainPreBasis & subDomainPreBasis()
Definition restrictedbasis.hh:183
│ │ │ +
GV GridView
The grid view that the FE basis is defined on.
Definition restrictedbasis.hh:54
│ │ │ +
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition restrictedbasis.hh:173
│ │ │ +
SD SubDomain
Definition restrictedbasis.hh:49
│ │ │ +
size_type size() const
Same as size(prefix) with empty prefix.
Definition restrictedbasis.hh:148
│ │ │ +
const SubDomain * subDomainPtr_
Definition restrictedbasis.hh:200
│ │ │ +
size_type size(const SizePrefix &prefix) const
Return number of possible values for next position in multi index.
Definition restrictedbasis.hh:155
│ │ │ +
typename SubDomainPreBasis::GridView SubDomainGridView
Definition restrictedbasis.hh:51
│ │ │ +
static constexpr size_type multiIndexBufferSize
Definition restrictedbasis.hh:99
│ │ │ +
GridView gridView_
Definition restrictedbasis.hh:198
│ │ │ +
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition restrictedbasis.hh:120
│ │ │ +
It indices(const Node &node, It it) const
Definition restrictedbasis.hh:189
│ │ │ +
auto containerDescriptor() const
Return the container descriptor of the pre-basis.
Definition restrictedbasis.hh:161
│ │ │ +
Node makeNode() const
Create tree node.
Definition restrictedbasis.hh:142
│ │ │ +
static constexpr size_type maxMultiIndexSize
Definition restrictedbasis.hh:97
│ │ │ +
void update(const GridView &gv)
Update the stored grid view, to be called.
Definition restrictedbasis.hh:133
│ │ │ +
Template mapping root tree path to type of created tree node.
Definition restrictedbasis.hh:62
│ │ │ +
typename Base::Element Element
Definition restrictedbasis.hh:66
│ │ │ +
void bind(const Element &element)
Definition restrictedbasis.hh:74
│ │ │ +
const SubDomain & subDomain() const
Definition restrictedbasis.hh:87
│ │ │ +
Node(Base &&base, const SubDomainGridView &subDomainGridView, const SubDomain &subDomain)
Definition restrictedbasis.hh:68
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,83 +1,320 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -staticforloop.hh │ │ │ │ +restrictedbasis.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH │ │ │ │ -8#define DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RESTRICTEDBASIS_HH │ │ │ │ +8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RESTRICTEDBASIS_HH │ │ │ │ 9 │ │ │ │ -10 │ │ │ │ -11#include │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ 12 │ │ │ │ -13#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ -14#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ -15 │ │ │ │ +13#include │ │ │ │ +14 │ │ │ │ +15#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ 16 │ │ │ │ -17namespace _D_u_n_e { │ │ │ │ -18namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +17 │ │ │ │ +18namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l { │ │ │ │ 19 │ │ │ │ -20namespace Imp { │ │ │ │ +20 │ │ │ │ 21 │ │ │ │ -22template │ │ │ │ -23struct StaticFindInRange │ │ │ │ -24{ │ │ │ │ -25 template │ │ │ │ -26 static void apply(F&& f, Args&&... args) │ │ │ │ -27 { │ │ │ │ -28 if (f(std::integral_constant(), std::forward(args)...)) │ │ │ │ -29 return; │ │ │ │ -30 StaticFindInRange::apply(std::forward(f), std:: │ │ │ │ -forward(args)...); │ │ │ │ -31 } │ │ │ │ -32}; │ │ │ │ -33 │ │ │ │ -34template │ │ │ │ -35struct StaticFindInRange │ │ │ │ -36{ │ │ │ │ -37 template │ │ │ │ -38 static void apply(F&& f, Args&&...) │ │ │ │ -39 {} │ │ │ │ -40}; │ │ │ │ -41 │ │ │ │ -42} //end namespace Imp │ │ │ │ -43 │ │ │ │ -44 │ │ │ │ -45 │ │ │ │ -59template │ │ │ │ -_6_0void _s_t_a_t_i_c_F_i_n_d_I_n_R_a_n_g_e(F&& f, Args&&... args) │ │ │ │ -61{ │ │ │ │ -62 Imp::StaticFindInRange::apply(std::forward │ │ │ │ -(f), std::forward(args)...); │ │ │ │ -63} │ │ │ │ -64 │ │ │ │ +42template │ │ │ │ +_4_3class _R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s │ │ │ │ +44{ │ │ │ │ +45 using This = _R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_<_G_V_,_ _S_D_P_B_,_ _S_D_>; │ │ │ │ +46 │ │ │ │ +47public: │ │ │ │ +48 │ │ │ │ +_4_9 using _S_u_b_D_o_m_a_i_n = SD; │ │ │ │ +_5_0 using _S_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s = SDPB; │ │ │ │ +_5_1 using _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w = typename SubDomainPreBasis::GridView; │ │ │ │ +52 │ │ │ │ +_5_4 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ +55 │ │ │ │ +_5_7 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ +58 │ │ │ │ +_6_0 class _N_o_d_e │ │ │ │ +61 : public SubDomainPreBasis::Node │ │ │ │ +62 { │ │ │ │ +63 using Base = typename SubDomainPreBasis::Node; │ │ │ │ +64 public: │ │ │ │ 65 │ │ │ │ -66} // namespace Dune::Functions │ │ │ │ -67} // namespace Dune │ │ │ │ -68 │ │ │ │ -69 │ │ │ │ -70 │ │ │ │ -71#endif //DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH │ │ │ │ -_t_y_p_e___t_r_a_i_t_s_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_s_t_a_t_i_c_F_i_n_d_I_n_R_a_n_g_e │ │ │ │ -void staticFindInRange(F &&f, Args &&... args) │ │ │ │ -Static find loop. │ │ │ │ -DDeeffiinniittiioonn staticforloop.hh:60 │ │ │ │ -_D_u_n_e │ │ │ │ -DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_c_o_n_c_e_p_t_s_._h_h │ │ │ │ +_6_6 using _E_l_e_m_e_n_t = typename Base::Element; │ │ │ │ +67 │ │ │ │ +_6_8 _N_o_d_e(Base&& base, const _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w& subDomainGridView, const │ │ │ │ +_S_u_b_D_o_m_a_i_n& _s_u_b_D_o_m_a_i_n) │ │ │ │ +69 : Base(base) │ │ │ │ +70 , subDomainGridView_(subDomainGridView) │ │ │ │ +71 , subDomain_(_s_u_b_D_o_m_a_i_n) │ │ │ │ +72 {} │ │ │ │ +73 │ │ │ │ +_7_4 void _b_i_n_d(const _E_l_e_m_e_n_t& element) │ │ │ │ +75 { │ │ │ │ +76 if (subDomainGridView_.contains(element)) │ │ │ │ +77 Base::bind(element); │ │ │ │ +78 else │ │ │ │ +79 { │ │ │ │ +80 Dune::TypeTree::forEachNode(static_cast(*this) , [&](auto& node, │ │ │ │ +const auto& treePath) { │ │ │ │ +81 Dune::Functions::Impl::BasisNodeSetupHelper::setOffset(node, this->offset │ │ │ │ +()); │ │ │ │ +82 Dune::Functions::Impl::BasisNodeSetupHelper::setSize(node, 0); │ │ │ │ +83 }); │ │ │ │ +84 } │ │ │ │ +85 } │ │ │ │ +86 │ │ │ │ +_8_7 const _S_u_b_D_o_m_a_i_n& _s_u_b_D_o_m_a_i_n() const │ │ │ │ +88 { │ │ │ │ +89 return subDomain_; │ │ │ │ +90 } │ │ │ │ +91 │ │ │ │ +92 private: │ │ │ │ +93 const _S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w& subDomainGridView_; │ │ │ │ +94 const _S_u_b_D_o_m_a_i_n& subDomain_; │ │ │ │ +95 }; │ │ │ │ +96 │ │ │ │ +_9_7 static constexpr _s_i_z_e___t_y_p_e _m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e = SubDomainPreBasis:: │ │ │ │ +maxMultiIndexSize; │ │ │ │ +_9_8 static constexpr _s_i_z_e___t_y_p_e _m_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e = SubDomainPreBasis:: │ │ │ │ +minMultiIndexSize; │ │ │ │ +_9_9 static constexpr _s_i_z_e___t_y_p_e _m_u_l_t_i_I_n_d_e_x_B_u_f_f_e_r_S_i_z_e = SubDomainPreBasis:: │ │ │ │ +multiIndexBufferSize; │ │ │ │ +100 │ │ │ │ +_1_0_7 _R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s(const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w, _S_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s&& │ │ │ │ +_s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s, const _S_u_b_D_o_m_a_i_n& subDomain) │ │ │ │ +108 : _g_r_i_d_V_i_e_w__(_g_r_i_d_V_i_e_w) │ │ │ │ +109 , _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__(std::move(_s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s)) │ │ │ │ +110 , _s_u_b_D_o_m_a_i_n_P_t_r__(&subDomain) │ │ │ │ +111 {} │ │ │ │ +112 │ │ │ │ +_1_1_4 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ +115 { │ │ │ │ +116 _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__.initializeIndices(); │ │ │ │ +117 } │ │ │ │ +118 │ │ │ │ +_1_2_0 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ +121 { │ │ │ │ +122 return _g_r_i_d_V_i_e_w__; │ │ │ │ +123 } │ │ │ │ +124 │ │ │ │ +_1_3_3 void _u_p_d_a_t_e(const _G_r_i_d_V_i_e_w& gv) │ │ │ │ +134 { │ │ │ │ +135 _g_r_i_d_V_i_e_w__ = gv; │ │ │ │ +136 _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__.update(_s_u_b_D_o_m_a_i_n_P_t_r__->gridView()); │ │ │ │ +137 } │ │ │ │ +138 │ │ │ │ +_1_4_2 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ +143 { │ │ │ │ +144 return _N_o_d_e(_s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__.makeNode(), _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__.gridView(), │ │ │ │ +*_s_u_b_D_o_m_a_i_n_P_t_r__); │ │ │ │ +145 } │ │ │ │ +146 │ │ │ │ +_1_4_8 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ +149 { │ │ │ │ +150 return _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__.size(); │ │ │ │ +151 } │ │ │ │ +152 │ │ │ │ +154 template │ │ │ │ +_1_5_5 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix) const │ │ │ │ +156 { │ │ │ │ +157 return _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__.size(prefix); │ │ │ │ +158 } │ │ │ │ +159 │ │ │ │ +_1_6_1 auto _c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r() const │ │ │ │ +162 { │ │ │ │ +163 return _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__.containerDescriptor(); │ │ │ │ +164 } │ │ │ │ +165 │ │ │ │ +_1_6_7 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ +168 { │ │ │ │ +169 return _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__.dimension(); │ │ │ │ +170 } │ │ │ │ +171 │ │ │ │ +_1_7_3 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ +174 { │ │ │ │ +175 return _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__.maxNodeSize(); │ │ │ │ +176 } │ │ │ │ +177 │ │ │ │ +_1_7_8 const _S_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s& _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s() const │ │ │ │ +179 { │ │ │ │ +180 return _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__; │ │ │ │ +181 } │ │ │ │ +182 │ │ │ │ +_1_8_3 _S_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s& _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s() │ │ │ │ +184 { │ │ │ │ +185 return _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__; │ │ │ │ +186 } │ │ │ │ +187 │ │ │ │ +188 template │ │ │ │ +_1_8_9 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ +190 { │ │ │ │ +191 if (node.size() == 0) │ │ │ │ +192 return it; │ │ │ │ +193 else │ │ │ │ +194 return _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__.indices(node, it); │ │ │ │ +195 } │ │ │ │ +196 │ │ │ │ +197protected: │ │ │ │ +_1_9_8 _G_r_i_d_V_i_e_w _g_r_i_d_V_i_e_w__; │ │ │ │ +_1_9_9 _S_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s _s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__; │ │ │ │ +_2_0_0 const _S_u_b_D_o_m_a_i_n* _s_u_b_D_o_m_a_i_n_P_t_r__; │ │ │ │ +201}; │ │ │ │ +202 │ │ │ │ +203 │ │ │ │ +204 │ │ │ │ +_2_0_5namespace _B_a_s_i_s_F_a_c_t_o_r_y { │ │ │ │ +206 │ │ │ │ +224template │ │ │ │ +_2_2_5auto _r_e_s_t_r_i_c_t(SubDomainBasisFactory&& subPreBasisFactory, const _S_u_b_D_o_m_a_i_n& │ │ │ │ +subDomain) │ │ │ │ +226{ │ │ │ │ +227 return [ │ │ │ │ +228 subPreBasisFactory=std::forward(subPreBasisFactory), │ │ │ │ +229 &subDomain │ │ │ │ +230 ](const auto& gridView) { │ │ │ │ +231 return _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s(gridView, │ │ │ │ +subPreBasisFactory(subDomain._g_r_i_d_V_i_e_w()), subDomain); │ │ │ │ +232 }; │ │ │ │ +233} │ │ │ │ +234 │ │ │ │ +235 │ │ │ │ +236} // end namespace BasisFactory │ │ │ │ +237} // end namespace Dune::Functions::Experimental │ │ │ │ +238 │ │ │ │ +239 │ │ │ │ +240#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RESTRICTEDBASIS_HH │ │ │ │ +_n_o_d_e_s_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_r_e_s_t_r_i_c_t │ │ │ │ +auto restrict(SubDomainBasisFactory &&subPreBasisFactory, const SubDomain │ │ │ │ +&subDomain) │ │ │ │ +Create a RestrictedPreBasisFactory. │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:225 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:28 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:205 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n │ │ │ │ +Class representing a sub-domain of a GridView. │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:534 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_S_u_b_D_o_m_a_i_n_:_:_g_r_i_d_V_i_e_w │ │ │ │ +GridView gridView() const │ │ │ │ +Create grid view representing the SubDomain. │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:565 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s │ │ │ │ +A pre-basis restricted to a sub-domain. │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:44 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_s_i_z_e___t_y_p_e │ │ │ │ +std::size_t size_type │ │ │ │ +Type used for indices and size information. │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:57 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s │ │ │ │ +RestrictedPreBasis(const GridView &gridView, SubDomainPreBasis │ │ │ │ +&&subDomainPreBasis, const SubDomain &subDomain) │ │ │ │ +Constructor for given sub-domain pre-basis. │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:107 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ +void initializeIndices() │ │ │ │ +Initialize the global indices. │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:114 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s │ │ │ │ +const SubDomainPreBasis & subDomainPreBasis() const │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:178 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_S_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s │ │ │ │ +SDPB SubDomainPreBasis │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:50 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_m_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ +static constexpr size_type minMultiIndexSize │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:98 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ +size_type dimension() const │ │ │ │ +Get the total dimension of the space spanned by this basis. │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:167 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s__ │ │ │ │ +SubDomainPreBasis subDomainPreBasis_ │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:199 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_s_u_b_D_o_m_a_i_n_P_r_e_B_a_s_i_s │ │ │ │ +SubDomainPreBasis & subDomainPreBasis() │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:183 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ +GV GridView │ │ │ │ +The grid view that the FE basis is defined on. │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:54 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_m_a_x_N_o_d_e_S_i_z_e │ │ │ │ +size_type maxNodeSize() const │ │ │ │ +Get the maximal number of DOFs associated to node for any element. │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:173 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_S_u_b_D_o_m_a_i_n │ │ │ │ +SD SubDomain │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:49 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ +size_type size() const │ │ │ │ +Same as size(prefix) with empty prefix. │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:148 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_s_u_b_D_o_m_a_i_n_P_t_r__ │ │ │ │ +const SubDomain * subDomainPtr_ │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:200 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ +size_type size(const SizePrefix &prefix) const │ │ │ │ +Return number of possible values for next position in multi index. │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:155 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_S_u_b_D_o_m_a_i_n_G_r_i_d_V_i_e_w │ │ │ │ +typename SubDomainPreBasis::GridView SubDomainGridView │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:51 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_m_u_l_t_i_I_n_d_e_x_B_u_f_f_e_r_S_i_z_e │ │ │ │ +static constexpr size_type multiIndexBufferSize │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:99 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_g_r_i_d_V_i_e_w__ │ │ │ │ +GridView gridView_ │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:198 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_g_r_i_d_V_i_e_w │ │ │ │ +const GridView & gridView() const │ │ │ │ +Obtain the grid view that the basis is defined on. │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:120 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_i_n_d_i_c_e_s │ │ │ │ +It indices(const Node &node, It it) const │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:189 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r │ │ │ │ +auto containerDescriptor() const │ │ │ │ +Return the container descriptor of the pre-basis. │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:161 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_m_a_k_e_N_o_d_e │ │ │ │ +Node makeNode() const │ │ │ │ +Create tree node. │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:142 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ +static constexpr size_type maxMultiIndexSize │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:97 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_u_p_d_a_t_e │ │ │ │ +void update(const GridView &gv) │ │ │ │ +Update the stored grid view, to be called. │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:133 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_N_o_d_e │ │ │ │ +Template mapping root tree path to type of created tree node. │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:62 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_N_o_d_e_:_:_E_l_e_m_e_n_t │ │ │ │ +typename Base::Element Element │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:66 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_N_o_d_e_:_:_b_i_n_d │ │ │ │ +void bind(const Element &element) │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:74 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_N_o_d_e_:_:_s_u_b_D_o_m_a_i_n │ │ │ │ +const SubDomain & subDomain() const │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:87 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_R_e_s_t_r_i_c_t_e_d_P_r_e_B_a_s_i_s_:_:_N_o_d_e_:_:_N_o_d_e │ │ │ │ +Node(Base &&base, const SubDomainGridView &subDomainGridView, const SubDomain │ │ │ │ +&subDomain) │ │ │ │ +DDeeffiinniittiioonn restrictedbasis.hh:68 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _s_t_a_t_i_c_f_o_r_l_o_o_p_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _r_e_s_t_r_i_c_t_e_d_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00209.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: squeezetensor.hh File Reference │ │ │ +Dune-Functions: defaultlocalview.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,22 +88,33 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
squeezetensor.hh File Reference
│ │ │ +
defaultlocalview.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <dune/common/fvector.hh>
│ │ │ -#include <dune/common/fmatrix.hh>
│ │ │ +
#include <tuple>
│ │ │ +#include <optional>
│ │ │ +#include <dune/common/concept.hh>
│ │ │ +#include <dune/common/hybridutilities.hh>
│ │ │ +#include <dune/common/reservedvector.hh>
│ │ │ +#include <dune/functions/common/overflowarray.hh>
│ │ │ +#include <dune/functions/common/multiindex.hh>
│ │ │ +#include <dune/functions/functionspacebases/concepts.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ + │ │ │ + │ │ │ + │ │ │ +

│ │ │ +Classes

class  Dune::Functions::DefaultLocalView< GB >
 The restriction of a finite element basis to a single element. More...
│ │ │ │ │ │ │ │ │ │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
│ │ │
│ │ │
│ │ │ @@ -114,13 +125,13 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,16 +1,25 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -squeezetensor.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ +defaultlocalview.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_o_v_e_r_f_l_o_w_a_r_r_a_y_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_m_u_l_t_i_i_n_d_e_x_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ +CCllaasssseess │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _G_B_ _> │ │ │ │ +  The restriction of a finite element basis to a single element. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _s_q_u_e_e_z_e_t_e_n_s_o_r_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _d_e_f_a_u_l_t_l_o_c_a_l_v_i_e_w_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00209_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: squeezetensor.hh Source File │ │ │ +Dune-Functions: defaultlocalview.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,83 +88,231 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
squeezetensor.hh
│ │ │ +
defaultlocalview.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │ -
6#ifndef DUNE_FUNCTIONS_COMMON_SQUEEZETENSOR_HH
│ │ │ -
7#define DUNE_FUNCTIONS_COMMON_SQUEEZETENSOR_HH
│ │ │ -
8
│ │ │ -
9#include <dune/common/fvector.hh>
│ │ │ -
10#include <dune/common/fmatrix.hh>
│ │ │ -
11
│ │ │ -
12namespace Dune::Functions
│ │ │ -
13{
│ │ │ -
14 namespace Impl
│ │ │ -
15 {
│ │ │ -
20 template<class Object>
│ │ │ -
21 constexpr Object& squeezeTensor(Object& o){
│ │ │ -
22 return o;
│ │ │ -
23 }
│ │ │ -
24
│ │ │ -
29 template<class Object>
│ │ │ -
30 constexpr Object const& squeezeTensor(Object const& o){
│ │ │ -
31 return o;
│ │ │ -
32 }
│ │ │ -
33
│ │ │ -
38 template<class K>
│ │ │ -
39 constexpr K const& squeezeTensor(Dune::FieldVector<K,1> const& v){
│ │ │ -
40 return v[0];
│ │ │ -
41 }
│ │ │ -
42
│ │ │ -
45 template<class K>
│ │ │ -
46 constexpr K& squeezeTensor(Dune::FieldVector<K,1>& v){
│ │ │ -
47 return v[0];
│ │ │ -
48 }
│ │ │ -
49
│ │ │ -
52 template<class K, int N>
│ │ │ -
53 constexpr Dune::FieldVector<K, N> const& squeezeTensor(Dune::FieldMatrix<K,1,N> const& m){
│ │ │ -
54 return m[0];
│ │ │ -
55 }
│ │ │ -
56
│ │ │ -
59 template<class K, int N>
│ │ │ -
60 constexpr Dune::FieldVector<K, N>& squeezeTensor(Dune::FieldMatrix<K,1,N>& m){
│ │ │ -
61 return m[0];
│ │ │ -
62 }
│ │ │ +
6
│ │ │ +
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH
│ │ │ +
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH
│ │ │ +
9
│ │ │ +
10
│ │ │ +
11#include <tuple>
│ │ │ +
12#include <optional>
│ │ │ +
13
│ │ │ +
14#include <dune/common/concept.hh>
│ │ │ +
15#include <dune/common/hybridutilities.hh>
│ │ │ +
16#include <dune/common/reservedvector.hh>
│ │ │ +
17
│ │ │ + │ │ │ + │ │ │ + │ │ │ +
21
│ │ │ +
22
│ │ │ +
23
│ │ │ +
24namespace Dune {
│ │ │ +
25namespace Functions {
│ │ │ +
26
│ │ │ +
27
│ │ │ +
28
│ │ │ +
30template<class GB>
│ │ │ +
│ │ │ + │ │ │ +
32{
│ │ │ +
33public:
│ │ │ +
34
│ │ │ +
36 using GlobalBasis = GB;
│ │ │ +
37
│ │ │ + │ │ │ +
40
│ │ │ +
42 using Element = typename GridView::template Codim<0>::Entity;
│ │ │ +
43
│ │ │ +
45 using size_type = std::size_t;
│ │ │ +
46
│ │ │ +
48 using Tree = typename GlobalBasis::PreBasis::Node;
│ │ │ +
49
│ │ │ +
50protected:
│ │ │ +
51
│ │ │ + │ │ │ +
53
│ │ │ +
54 // Type used to store the multi indices of the basis vectors.
│ │ │ +
55 // In contrast to MultiIndex this always has dynamic size.
│ │ │ +
56 // It's guaranteed, that you can always cast it to MultiIndex
│ │ │ + │ │ │ +
58 std::conditional_t<(PreBasis::minMultiIndexSize == PreBasis::maxMultiIndexSize),
│ │ │ + │ │ │ +
60 Dune::ReservedVector<size_type, PreBasis::multiIndexBufferSize>>;
│ │ │ +
61
│ │ │ +
62public:
│ │ │
63
│ │ │ -
66 template<class K, int N, int M>
│ │ │ -
67 constexpr Dune::FieldMatrix<K, N, M> const& squeezeTensor(std::array<Dune::FieldMatrix<K,N,M>, 1> const& m){
│ │ │ -
68 return m[0];
│ │ │ -
69 }
│ │ │ +
65 using MultiIndex =
│ │ │ +
66 std::conditional_t<(PreBasis::minMultiIndexSize == PreBasis::maxMultiIndexSize),
│ │ │ + │ │ │ +
68 Dune::ReservedVector<size_type, PreBasis::multiIndexBufferSize>>;
│ │ │ +
69
│ │ │
70
│ │ │ -
73 template<class K, int N, int M>
│ │ │ -
74 constexpr Dune::FieldMatrix<K, N, M>& squeezeTensor(std::array<Dune::FieldMatrix<K,N,M>, 1>& m){
│ │ │ -
75 return m[0];
│ │ │ -
76 }
│ │ │ -
77
│ │ │ -
78 } // namespace Impl
│ │ │ -
79
│ │ │ -
80} // namespace Dune::Functions
│ │ │ -
81
│ │ │ -
82#endif // DUNE_FUNCTIONS_COMMON_SQUEEZETENSOR_HH
│ │ │ +
│ │ │ + │ │ │ + │ │ │ +
74 tree_(globalBasis_->preBasis().makeNode())
│ │ │ +
75 {
│ │ │ +
76 static_assert(models<Concept::BasisTree<GridView>, Tree>(), "Tree type passed to DefaultLocalView does not model the BasisNode concept.");
│ │ │ + │ │ │ +
78 }
│ │ │ +
│ │ │ +
79
│ │ │ +
│ │ │ + │ │ │ + │ │ │ +
83 tree_(globalBasis_->preBasis().makeNode())
│ │ │ +
84 {
│ │ │ + │ │ │ +
86 if (other.bound())
│ │ │ +
87 bind(other.element());
│ │ │ +
88 }
│ │ │ +
│ │ │ +
89
│ │ │ +
│ │ │ +
95 void bind(const Element& e)
│ │ │ +
96 {
│ │ │ +
97 element_ = e;
│ │ │ + │ │ │ +
99 indices_.resize(size());
│ │ │ +
100 globalBasis_->preBasis().indices(tree_, indices_.begin());
│ │ │ +
101 }
│ │ │ +
│ │ │ +
102
│ │ │ +
│ │ │ +
105 bool bound() const
│ │ │ +
106 {
│ │ │ +
107 return static_cast<bool>(element_);
│ │ │ +
108 }
│ │ │ +
│ │ │ +
109
│ │ │ +
│ │ │ +
114 const Element& element() const
│ │ │ +
115 {
│ │ │ +
116 return *element_;
│ │ │ +
117 }
│ │ │ +
│ │ │ +
118
│ │ │ +
│ │ │ +
123 void unbind()
│ │ │ +
124 {
│ │ │ +
125 element_.reset();
│ │ │ +
126 }
│ │ │ +
│ │ │ +
127
│ │ │ +
│ │ │ +
132 const Tree& tree() const
│ │ │ +
133 {
│ │ │ +
134 return tree_;
│ │ │ +
135 }
│ │ │ +
│ │ │ +
136
│ │ │ +
│ │ │ + │ │ │ +
140 {
│ │ │ +
141 return tree_.size();
│ │ │ +
142 }
│ │ │ +
│ │ │ +
143
│ │ │ +
│ │ │ + │ │ │ +
151 {
│ │ │ +
152 return globalBasis_->preBasis().maxNodeSize();
│ │ │ +
153 }
│ │ │ +
│ │ │ +
154
│ │ │ +
│ │ │ +
156 const MultiIndex& index(size_type i) const
│ │ │ +
157 {
│ │ │ +
158 return indices_[i];
│ │ │ +
159 }
│ │ │ +
│ │ │ +
160
│ │ │ +
│ │ │ + │ │ │ +
164 {
│ │ │ +
165 return *globalBasis_;
│ │ │ +
166 }
│ │ │ +
│ │ │ +
167
│ │ │ +
│ │ │ + │ │ │ +
169 {
│ │ │ +
170 return *this;
│ │ │ +
171 }
│ │ │ +
│ │ │ +
172
│ │ │ +
173protected:
│ │ │ + │ │ │ +
175 std::optional<Element> element_;
│ │ │ + │ │ │ +
177 std::vector<MultiIndexStorage> indices_;
│ │ │ +
178};
│ │ │ +
│ │ │ +
179
│ │ │ +
180
│ │ │ +
181
│ │ │ +
182} // end namespace Functions
│ │ │ +
183} // end namespace Dune
│ │ │ +
184
│ │ │ +
185
│ │ │ +
186
│ │ │ +
187#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH
│ │ │ + │ │ │ + │ │ │ +
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ +
void bindTree(Tree &tree, const Entity &entity, std::size_t offset=0)
Definition nodes.hh:469
│ │ │ +
void initializeTree(Tree &tree, std::size_t treeIndexOffset=0)
Definition nodes.hh:476
│ │ │ +
A statically sized MultiIndex type.
Definition multiindex.hh:30
│ │ │ +
A dynamically sized array-like class with overflow.
Definition overflowarray.hh:49
│ │ │ +
typename PreBasis::GridView GridView
The grid view that the FE space is defined on.
Definition defaultglobalbasis.hh:64
│ │ │ +
PB PreBasis
Pre-basis providing the implementation details.
Definition defaultglobalbasis.hh:58
│ │ │ +
typename GlobalBasis::PreBasis PreBasis
Definition defaultlocalview.hh:52
│ │ │ +
void unbind()
Unbind from the current element.
Definition defaultlocalview.hh:123
│ │ │ +
bool bound() const
Return if the view is bound to a grid element.
Definition defaultlocalview.hh:105
│ │ │ +
typename GlobalBasis::GridView GridView
Definition defaultlocalview.hh:39
│ │ │ +
const MultiIndex & index(size_type i) const
Maps from subtree index set [0..size-1] to a globally unique multi index in global basis.
Definition defaultlocalview.hh:156
│ │ │ +
DefaultLocalView(const DefaultLocalView &other)
Deep copy of the local view.
Definition defaultlocalview.hh:81
│ │ │ +
std::optional< Element > element_
Definition defaultlocalview.hh:175
│ │ │ +
typename GridView::template Codim< 0 >::Entity Element
Definition defaultlocalview.hh:42
│ │ │ +
const Tree & tree() const
Return the local ansatz tree associated to the bound entity.
Definition defaultlocalview.hh:132
│ │ │ +
std::conditional_t<(PreBasis::minMultiIndexSize==PreBasis::maxMultiIndexSize), StaticMultiIndex< size_type, PreBasis::maxMultiIndexSize >, Dune::ReservedVector< size_type, PreBasis::multiIndexBufferSize > > MultiIndex
Definition defaultlocalview.hh:65
│ │ │ +
void bind(const Element &e)
Bind the view to a grid element.
Definition defaultlocalview.hh:95
│ │ │ +
const Element & element() const
Return the grid element that the view is bound to.
Definition defaultlocalview.hh:114
│ │ │ +
size_type size() const
Total number of degrees of freedom on this element.
Definition defaultlocalview.hh:139
│ │ │ +
DefaultGlobalBasis< PreBasis > GlobalBasis
Definition defaultlocalview.hh:36
│ │ │ + │ │ │ +
size_type maxSize() const
Maximum local size for any element on the GridView.
Definition defaultlocalview.hh:150
│ │ │ +
std::size_t size_type
Definition defaultlocalview.hh:45
│ │ │ +
const DefaultLocalView & rootLocalView() const
Definition defaultlocalview.hh:168
│ │ │ +
std::conditional_t<(PreBasis::minMultiIndexSize==PreBasis::maxMultiIndexSize), OverflowArray< StaticMultiIndex< size_type, PreBasis::maxMultiIndexSize >, PreBasis::multiIndexBufferSize >, Dune::ReservedVector< size_type, PreBasis::multiIndexBufferSize > > MultiIndexStorage
Definition defaultlocalview.hh:57
│ │ │ +
std::vector< MultiIndexStorage > indices_
Definition defaultlocalview.hh:177
│ │ │ +
typename GlobalBasis::PreBasis::Node Tree
Definition defaultlocalview.hh:48
│ │ │ +
DefaultLocalView(const GlobalBasis &globalBasis)
Construct local view for a given global finite element basis.
Definition defaultlocalview.hh:72
│ │ │ +
const GlobalBasis * globalBasis_
Definition defaultlocalview.hh:174
│ │ │ +
const GlobalBasis & globalBasis() const
Definition defaultlocalview.hh:163
│ │ │ + │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,79 +1,284 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -squeezetensor.hh │ │ │ │ +defaultlocalview.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ -6#ifndef DUNE_FUNCTIONS_COMMON_SQUEEZETENSOR_HH │ │ │ │ -7#define DUNE_FUNCTIONS_COMMON_SQUEEZETENSOR_HH │ │ │ │ -8 │ │ │ │ -9#include │ │ │ │ -10#include │ │ │ │ -11 │ │ │ │ -12namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -13{ │ │ │ │ -14 namespace Impl │ │ │ │ -15 { │ │ │ │ -20 template │ │ │ │ -21 constexpr Object& squeezeTensor(Object& o){ │ │ │ │ -22 return o; │ │ │ │ -23 } │ │ │ │ -24 │ │ │ │ -29 template │ │ │ │ -30 constexpr Object const& squeezeTensor(Object const& o){ │ │ │ │ -31 return o; │ │ │ │ -32 } │ │ │ │ -33 │ │ │ │ -38 template │ │ │ │ -39 constexpr K const& squeezeTensor(Dune::FieldVector const& v){ │ │ │ │ -40 return v[0]; │ │ │ │ -41 } │ │ │ │ -42 │ │ │ │ -45 template │ │ │ │ -46 constexpr K& squeezeTensor(Dune::FieldVector& v){ │ │ │ │ -47 return v[0]; │ │ │ │ -48 } │ │ │ │ +6 │ │ │ │ +7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH │ │ │ │ +8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH │ │ │ │ +9 │ │ │ │ +10 │ │ │ │ +11#include │ │ │ │ +12#include │ │ │ │ +13 │ │ │ │ +14#include │ │ │ │ +15#include │ │ │ │ +16#include │ │ │ │ +17 │ │ │ │ +18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_o_v_e_r_f_l_o_w_a_r_r_a_y_._h_h> │ │ │ │ +19#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_m_u_l_t_i_i_n_d_e_x_._h_h> │ │ │ │ +20#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +21 │ │ │ │ +22 │ │ │ │ +23 │ │ │ │ +24namespace _D_u_n_e { │ │ │ │ +25namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +26 │ │ │ │ +27 │ │ │ │ +28 │ │ │ │ +30template │ │ │ │ +_3_1class _D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w │ │ │ │ +32{ │ │ │ │ +33public: │ │ │ │ +34 │ │ │ │ +_3_6 using _G_l_o_b_a_l_B_a_s_i_s = GB; │ │ │ │ +37 │ │ │ │ +_3_9 using _G_r_i_d_V_i_e_w = typename _G_l_o_b_a_l_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w; │ │ │ │ +40 │ │ │ │ +_4_2 using _E_l_e_m_e_n_t = typename GridView::template Codim<0>::Entity; │ │ │ │ +43 │ │ │ │ +_4_5 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ +46 │ │ │ │ +_4_8 using _T_r_e_e = typename GlobalBasis::PreBasis::Node; │ │ │ │ 49 │ │ │ │ -52 template │ │ │ │ -53 constexpr Dune::FieldVector const& squeezeTensor(Dune:: │ │ │ │ -FieldMatrix const& m){ │ │ │ │ -54 return m[0]; │ │ │ │ -55 } │ │ │ │ -56 │ │ │ │ -59 template │ │ │ │ -60 constexpr Dune::FieldVector& squeezeTensor(Dune::FieldMatrix& │ │ │ │ -m){ │ │ │ │ -61 return m[0]; │ │ │ │ -62 } │ │ │ │ +50protected: │ │ │ │ +51 │ │ │ │ +_5_2 using _P_r_e_B_a_s_i_s = typename _G_l_o_b_a_l_B_a_s_i_s_:_:_P_r_e_B_a_s_i_s; │ │ │ │ +53 │ │ │ │ +54 // Type used to store the multi indices of the basis vectors. │ │ │ │ +55 // In contrast to MultiIndex this always has dynamic size. │ │ │ │ +56 // It's guaranteed, that you can always cast it to MultiIndex │ │ │ │ +_5_7 using _M_u_l_t_i_I_n_d_e_x_S_t_o_r_a_g_e = │ │ │ │ +58 std::conditional_t<(PreBasis::minMultiIndexSize == PreBasis:: │ │ │ │ +maxMultiIndexSize), │ │ │ │ +59 _O_v_e_r_f_l_o_w_A_r_r_a_y<_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x_<_s_i_z_e___t_y_p_e_,_ _P_r_e_B_a_s_i_s_:_:_m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e_>, │ │ │ │ +PreBasis::multiIndexBufferSize>, │ │ │ │ +60 Dune::ReservedVector>; │ │ │ │ +61 │ │ │ │ +62public: │ │ │ │ 63 │ │ │ │ -66 template │ │ │ │ -67 constexpr Dune::FieldMatrix const& squeezeTensor(std::array, 1> const& m){ │ │ │ │ -68 return m[0]; │ │ │ │ -69 } │ │ │ │ +_6_5 using _M_u_l_t_i_I_n_d_e_x = │ │ │ │ +66 std::conditional_t<(PreBasis::minMultiIndexSize == PreBasis:: │ │ │ │ +maxMultiIndexSize), │ │ │ │ +67 _S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x_<_s_i_z_e___t_y_p_e_,_ _P_r_e_B_a_s_i_s_:_:_m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e_>, │ │ │ │ +68 Dune::ReservedVector>; │ │ │ │ +69 │ │ │ │ 70 │ │ │ │ -73 template │ │ │ │ -74 constexpr Dune::FieldMatrix& squeezeTensor(std::array, 1>& m){ │ │ │ │ -75 return m[0]; │ │ │ │ -76 } │ │ │ │ -77 │ │ │ │ -78 } // namespace Impl │ │ │ │ +_7_2 _D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w(const _G_l_o_b_a_l_B_a_s_i_s& _g_l_o_b_a_l_B_a_s_i_s) : │ │ │ │ +73 _g_l_o_b_a_l_B_a_s_i_s__(&_g_l_o_b_a_l_B_a_s_i_s), │ │ │ │ +74 _t_r_e_e__(_g_l_o_b_a_l_B_a_s_i_s__->preBasis().makeNode()) │ │ │ │ +75 { │ │ │ │ +76 static_assert(models, _T_r_e_e>(), "Tree type │ │ │ │ +passed to DefaultLocalView does not model the BasisNode concept."); │ │ │ │ +77 _i_n_i_t_i_a_l_i_z_e_T_r_e_e(_t_r_e_e__); │ │ │ │ +78 } │ │ │ │ 79 │ │ │ │ -80} // namespace Dune::Functions │ │ │ │ -81 │ │ │ │ -82#endif // DUNE_FUNCTIONS_COMMON_SQUEEZETENSOR_HH │ │ │ │ +_8_1 _D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w(const _D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w& other) : │ │ │ │ +82 _g_l_o_b_a_l_B_a_s_i_s__(other._g_l_o_b_a_l_B_a_s_i_s__), │ │ │ │ +83 _t_r_e_e__(_g_l_o_b_a_l_B_a_s_i_s__->preBasis().makeNode()) │ │ │ │ +84 { │ │ │ │ +85 _i_n_i_t_i_a_l_i_z_e_T_r_e_e(_t_r_e_e__); │ │ │ │ +86 if (other._b_o_u_n_d()) │ │ │ │ +87 _b_i_n_d(other._e_l_e_m_e_n_t()); │ │ │ │ +88 } │ │ │ │ +89 │ │ │ │ +_9_5 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ +96 { │ │ │ │ +97 _e_l_e_m_e_n_t__ = e; │ │ │ │ +98 _b_i_n_d_T_r_e_e(_t_r_e_e__, *_e_l_e_m_e_n_t__); │ │ │ │ +99 _i_n_d_i_c_e_s__.resize(_s_i_z_e()); │ │ │ │ +100 _g_l_o_b_a_l_B_a_s_i_s__->preBasis().indices(_t_r_e_e__, _i_n_d_i_c_e_s__.begin()); │ │ │ │ +101 } │ │ │ │ +102 │ │ │ │ +_1_0_5 bool _b_o_u_n_d() const │ │ │ │ +106 { │ │ │ │ +107 return static_cast(_e_l_e_m_e_n_t__); │ │ │ │ +108 } │ │ │ │ +109 │ │ │ │ +_1_1_4 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ +115 { │ │ │ │ +116 return *_e_l_e_m_e_n_t__; │ │ │ │ +117 } │ │ │ │ +118 │ │ │ │ +_1_2_3 void _u_n_b_i_n_d() │ │ │ │ +124 { │ │ │ │ +125 _e_l_e_m_e_n_t__.reset(); │ │ │ │ +126 } │ │ │ │ +127 │ │ │ │ +_1_3_2 const _T_r_e_e& _t_r_e_e() const │ │ │ │ +133 { │ │ │ │ +134 return _t_r_e_e__; │ │ │ │ +135 } │ │ │ │ +136 │ │ │ │ +_1_3_9 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ +140 { │ │ │ │ +141 return _t_r_e_e__.size(); │ │ │ │ +142 } │ │ │ │ +143 │ │ │ │ +_1_5_0 _s_i_z_e___t_y_p_e _m_a_x_S_i_z_e() const │ │ │ │ +151 { │ │ │ │ +152 return _g_l_o_b_a_l_B_a_s_i_s__->preBasis().maxNodeSize(); │ │ │ │ +153 } │ │ │ │ +154 │ │ │ │ +_1_5_6 const _M_u_l_t_i_I_n_d_e_x& _i_n_d_e_x(_s_i_z_e___t_y_p_e i) const │ │ │ │ +157 { │ │ │ │ +158 return _i_n_d_i_c_e_s__[i]; │ │ │ │ +159 } │ │ │ │ +160 │ │ │ │ +_1_6_3 const _G_l_o_b_a_l_B_a_s_i_s& _g_l_o_b_a_l_B_a_s_i_s() const │ │ │ │ +164 { │ │ │ │ +165 return *_g_l_o_b_a_l_B_a_s_i_s__; │ │ │ │ +166 } │ │ │ │ +167 │ │ │ │ +_1_6_8 const _D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w& _r_o_o_t_L_o_c_a_l_V_i_e_w() const │ │ │ │ +169 { │ │ │ │ +170 return *this; │ │ │ │ +171 } │ │ │ │ +172 │ │ │ │ +173protected: │ │ │ │ +_1_7_4 const _G_l_o_b_a_l_B_a_s_i_s* _g_l_o_b_a_l_B_a_s_i_s__; │ │ │ │ +_1_7_5 std::optional _e_l_e_m_e_n_t__; │ │ │ │ +_1_7_6 _T_r_e_e _t_r_e_e__; │ │ │ │ +_1_7_7 std::vector _i_n_d_i_c_e_s__; │ │ │ │ +178}; │ │ │ │ +179 │ │ │ │ +180 │ │ │ │ +181 │ │ │ │ +182} // end namespace Functions │ │ │ │ +183} // end namespace Dune │ │ │ │ +184 │ │ │ │ +185 │ │ │ │ +186 │ │ │ │ +187#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH │ │ │ │ +_o_v_e_r_f_l_o_w_a_r_r_a_y_._h_h │ │ │ │ +_m_u_l_t_i_i_n_d_e_x_._h_h │ │ │ │ +_D_u_n_e │ │ │ │ +DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_b_i_n_d_T_r_e_e │ │ │ │ +void bindTree(Tree &tree, const Entity &entity, std::size_t offset=0) │ │ │ │ +DDeeffiinniittiioonn nodes.hh:469 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_i_n_i_t_i_a_l_i_z_e_T_r_e_e │ │ │ │ +void initializeTree(Tree &tree, std::size_t treeIndexOffset=0) │ │ │ │ +DDeeffiinniittiioonn nodes.hh:476 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x │ │ │ │ +A statically sized MultiIndex type. │ │ │ │ +DDeeffiinniittiioonn multiindex.hh:30 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y │ │ │ │ +A dynamically sized array-like class with overflow. │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:49 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ +typename PreBasis::GridView GridView │ │ │ │ +The grid view that the FE space is defined on. │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:64 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_:_:_P_r_e_B_a_s_i_s │ │ │ │ +PB PreBasis │ │ │ │ +Pre-basis providing the implementation details. │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:58 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_r_e_B_a_s_i_s_ _>_ _>_:_:_P_r_e_B_a_s_i_s │ │ │ │ +typename GlobalBasis::PreBasis PreBasis │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:52 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_:_:_u_n_b_i_n_d │ │ │ │ +void unbind() │ │ │ │ +Unbind from the current element. │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:123 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_:_:_b_o_u_n_d │ │ │ │ +bool bound() const │ │ │ │ +Return if the view is bound to a grid element. │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:105 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_r_e_B_a_s_i_s_ _>_ _>_:_:_G_r_i_d_V_i_e_w │ │ │ │ +typename GlobalBasis::GridView GridView │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:39 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_:_:_i_n_d_e_x │ │ │ │ +const MultiIndex & index(size_type i) const │ │ │ │ +Maps from subtree index set [0..size-1] to a globally unique multi index in │ │ │ │ +global basis. │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:156 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w │ │ │ │ +DefaultLocalView(const DefaultLocalView &other) │ │ │ │ +Deep copy of the local view. │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:81 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_r_e_B_a_s_i_s_ _>_ _>_:_:_e_l_e_m_e_n_t__ │ │ │ │ +std::optional< Element > element_ │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:175 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_r_e_B_a_s_i_s_ _>_ _>_:_:_E_l_e_m_e_n_t │ │ │ │ +typename GridView::template Codim< 0 >::Entity Element │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:42 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_:_:_t_r_e_e │ │ │ │ +const Tree & tree() const │ │ │ │ +Return the local ansatz tree associated to the bound entity. │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:132 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_r_e_B_a_s_i_s_ _>_ _>_:_:_M_u_l_t_i_I_n_d_e_x │ │ │ │ +std::conditional_t<(PreBasis::minMultiIndexSize==PreBasis::maxMultiIndexSize), │ │ │ │ +StaticMultiIndex< size_type, PreBasis::maxMultiIndexSize >, Dune:: │ │ │ │ +ReservedVector< size_type, PreBasis::multiIndexBufferSize > > MultiIndex │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:65 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_:_:_b_i_n_d │ │ │ │ +void bind(const Element &e) │ │ │ │ +Bind the view to a grid element. │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:95 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_:_:_e_l_e_m_e_n_t │ │ │ │ +const Element & element() const │ │ │ │ +Return the grid element that the view is bound to. │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:114 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_:_:_s_i_z_e │ │ │ │ +size_type size() const │ │ │ │ +Total number of degrees of freedom on this element. │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:139 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_r_e_B_a_s_i_s_ _>_ _>_:_: │ │ │ │ +_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ +DefaultGlobalBasis< PreBasis > GlobalBasis │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:36 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_r_e_B_a_s_i_s_ _>_ _>_:_:_t_r_e_e__ │ │ │ │ +Tree tree_ │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:176 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_:_:_m_a_x_S_i_z_e │ │ │ │ +size_type maxSize() const │ │ │ │ +Maximum local size for any element on the GridView. │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:150 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_r_e_B_a_s_i_s_ _>_ _>_:_:_s_i_z_e___t_y_p_e │ │ │ │ +std::size_t size_type │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:45 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_:_:_r_o_o_t_L_o_c_a_l_V_i_e_w │ │ │ │ +const DefaultLocalView & rootLocalView() const │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:168 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_r_e_B_a_s_i_s_ _>_ _>_:_: │ │ │ │ +_M_u_l_t_i_I_n_d_e_x_S_t_o_r_a_g_e │ │ │ │ +std::conditional_t<(PreBasis::minMultiIndexSize==PreBasis::maxMultiIndexSize), │ │ │ │ +OverflowArray< StaticMultiIndex< size_type, PreBasis::maxMultiIndexSize >, │ │ │ │ +PreBasis::multiIndexBufferSize >, Dune::ReservedVector< size_type, PreBasis:: │ │ │ │ +multiIndexBufferSize > > MultiIndexStorage │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:57 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_r_e_B_a_s_i_s_ _>_ _>_:_:_i_n_d_i_c_e_s__ │ │ │ │ +std::vector< MultiIndexStorage > indices_ │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:177 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_r_e_B_a_s_i_s_ _>_ _>_:_:_T_r_e_e │ │ │ │ +typename GlobalBasis::PreBasis::Node Tree │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:48 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w │ │ │ │ +DefaultLocalView(const GlobalBasis &globalBasis) │ │ │ │ +Construct local view for a given global finite element basis. │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:72 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_r_e_B_a_s_i_s_ _>_ _>_:_: │ │ │ │ +_g_l_o_b_a_l_B_a_s_i_s__ │ │ │ │ +const GlobalBasis * globalBasis_ │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:174 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_r_e_B_a_s_i_s_ _>_ _>_:_: │ │ │ │ +_g_l_o_b_a_l_B_a_s_i_s │ │ │ │ +const GlobalBasis & globalBasis() const │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:163 │ │ │ │ +_c_o_n_c_e_p_t_s_._h_h │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _s_q_u_e_e_z_e_t_e_n_s_o_r_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _d_e_f_a_u_l_t_l_o_c_a_l_v_i_e_w_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00212.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: signature.hh File Reference │ │ │ +Dune-Functions: cubichermitebasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,56 +88,85 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
signature.hh File Reference
│ │ │ +
cubichermitebasis.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <type_traits>
│ │ │ -#include <tuple>
│ │ │ -#include <dune/functions/common/defaultderivativetraits.hh>
│ │ │ + │ │ │ +

This file provides an implementation of the cubic Hermite finite element in 1 to 3 dimensions. │ │ │ +More...

│ │ │ +
#include <algorithm>
│ │ │ +#include <array>
│ │ │ +#include <numeric>
│ │ │ +#include <type_traits>
│ │ │ +#include <vector>
│ │ │ +#include <dune/common/exceptions.hh>
│ │ │ +#include <dune/common/fmatrix.hh>
│ │ │ +#include <dune/common/fvector.hh>
│ │ │ +#include <dune/common/rangeutilities.hh>
│ │ │ +#include <dune/grid/common/mcmgmapper.hh>
│ │ │ +#include <dune/localfunctions/common/localbasis.hh>
│ │ │ +#include <dune/localfunctions/common/localfiniteelementtraits.hh>
│ │ │ +#include <dune/localfunctions/common/localkey.hh>
│ │ │ +#include <dune/functions/common/mapperutilities.hh>
│ │ │ +#include <dune/functions/common/squeezetensor.hh>
│ │ │ +#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │ +#include <dune/functions/functionspacebases/functionaldescriptor.hh>
│ │ │ +#include <dune/functions/functionspacebases/leafprebasismappermixin.hh>
│ │ │ +#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ +#include <dune/functions/functionspacebases/transformedfiniteelementmixin.hh>
│ │ │ +#include <dune/functions/analyticfunctions/monomialset.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

struct  Dune::Functions::SignatureTraits< Signature, isCallable >
 Helper class to deduce the signature of a callable. More...
struct  Dune::Functions::SignatureTag< Range(Domain), DerivativeTraitsT >
 Tag-class to encapsulate signature information. More...
struct  Dune::Functions::H2LocalBasisTraits< DF, n, D, RF, m, R, J, H >
class  Dune::Functions::CubicHermiteNode< GV, R, reduced >
class  Dune::Functions::CubicHermitePreBasis< GV, R, reduced >
 A pre-basis for a Hermitebasis. More...
│ │ │ │ │ │ │ │ │ │ │ │ + │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::BasisFactory
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ -Functions

template<class Range, class Domain, template< class > class DerivativeTraits>
auto Dune::Functions::derivativeSignatureTag (SignatureTag< Range(Domain), DerivativeTraits > tag)
 Construct SignatureTag for derivative.
template<std::size_t maxOrder, class Signature, template< class > class DerivativeTraits>
auto Dune::Functions::derivativeSignatureTags (Dune::Functions::SignatureTag< Signature, DerivativeTraits > tag)
 Construct SignatureTags for derivatives.

│ │ │ +Typedefs

template<class GV, bool reduced = false, class R = double>
using Dune::Functions::CubicHermiteBasis = DefaultGlobalBasis<CubicHermitePreBasis<GV, R, reduced> >
 Nodal basis of a scalar cubic Hermite finite element space.
│ │ │ -
│ │ │ +

Detailed Description

│ │ │ +

This file provides an implementation of the cubic Hermite finite element in 1 to 3 dimensions.

│ │ │ +

For reference, see[Ciarlet, The Finite Element Method for Elliptic Problems, 2002]. It contains in the following order:

    │ │ │ +
  • A GlobalBasis typedef CubicHermiteBasis
  • │ │ │ +
  • A template H2LocalBasisTraits, extending the dune-localfunctions LocalBasisTraits by an exported Hessiantype
  • │ │ │ +
  • A template CubicHermiteLocalFiniteElement providing an implementation of the LocalFiniteElement interface, along with its subparts (Impl namespace)
  • │ │ │ +
  • A template CubicHermiteNode
  • │ │ │ +
  • A template CubicHermitePreBasis
  • │ │ │ +
  • Two factories hermite() and reducedHermite() in the BasisFactory namespace
  • │ │ │ +
│ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,32 +1,63 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -signature.hh File Reference │ │ │ │ +cubichermitebasis.hh File Reference │ │ │ │ +This file provides an implementation of the cubic Hermite finite element in 1 │ │ │ │ +to 3 dimensions. _M_o_r_e_._._. │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_m_a_p_p_e_r_u_t_i_l_i_t_i_e_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_s_q_u_e_e_z_e_t_e_n_s_o_r_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_f_u_n_c_t_i_o_n_a_l_d_e_s_c_r_i_p_t_o_r_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_t_r_a_n_s_f_o_r_m_e_d_f_i_n_i_t_e_e_l_e_m_e_n_t_m_i_x_i_n_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_a_n_a_l_y_t_i_c_f_u_n_c_t_i_o_n_s_/_m_o_n_o_m_i_a_l_s_e_t_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_g_n_a_t_u_r_e_T_r_a_i_t_s_<_ _S_i_g_n_a_t_u_r_e_,_ _i_s_C_a_l_l_a_b_l_e_ _> │ │ │ │ -  Helper class to deduce the signature of a callable. _M_o_r_e_._._. │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_g_n_a_t_u_r_e_T_a_g_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_T_ _> │ │ │ │ -  Tag-class to encapsulate signature information. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_2_L_o_c_a_l_B_a_s_i_s_T_r_a_i_t_s_<_ _D_F_,_ _n_,_ _D_,_ _R_F_,_ _m_,_ _R_,_ _J_,_ _H_ _> │ │ │ │ + class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e_<_ _G_V_,_ _R_,_ _r_e_d_u_c_e_d_ _> │ │ │ │ + class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _R_,_ _r_e_d_u_c_e_d_ _> │ │ │ │ +  A pre-basis for a Hermitebasis. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -FFuunnccttiioonnss │ │ │ │ -template class DerivativeTraits> │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_d_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e_T_a_g (_S_i_g_n_a_t_u_r_e_T_a_g< Range(Domain), │ │ │ │ - DerivativeTraits > tag) │ │ │ │ -  Construct _S_i_g_n_a_t_u_r_e_T_a_g for derivative. │ │ │ │ -template class │ │ │ │ -DerivativeTraits> │ │ │ │ -auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_d_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e_T_a_g_s (_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_g_n_a_t_u_r_e_T_a_g< │ │ │ │ - Signature, DerivativeTraits > tag) │ │ │ │ -  Construct SignatureTags for derivatives. │ │ │ │ +namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ +TTyyppeeddeeffss │ │ │ │ +template │ │ │ │ +using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_B_a_s_i_s = │ │ │ │ + _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s<_C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s > │ │ │ │ +  Nodal basis of a scalar cubic Hermite finite element space. │ │ │ │ +********** DDeettaaiilleedd DDeessccrriippttiioonn ********** │ │ │ │ +This file provides an implementation of the cubic Hermite finite element in 1 │ │ │ │ +to 3 dimensions. │ │ │ │ +For reference, see[Ciarlet, The Finite Element Method for Elliptic Problems, │ │ │ │ +2002]. It contains in the following order: │ │ │ │ + * A GlobalBasis typedef CubicHermiteBasis │ │ │ │ + * A template H2LocalBasisTraits, extending the dune-localfunctions │ │ │ │ + LocalBasisTraits by an exported Hessiantype │ │ │ │ + * A template CubicHermiteLocalFiniteElement providing an implementation of │ │ │ │ + the LocalFiniteElement interface, along with its subparts (Impl │ │ │ │ + namespace) │ │ │ │ + * A template CubicHermiteNode │ │ │ │ + * A template CubicHermitePreBasis │ │ │ │ + * Two factories hermite() and reducedHermite() in the BasisFactory │ │ │ │ + namespace │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _s_i_g_n_a_t_u_r_e_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _c_u_b_i_c_h_e_r_m_i_t_e_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00212.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,4 +1,5 @@ │ │ │ │ var a00212 = [ │ │ │ │ - ["Dune::Functions::derivativeSignatureTag", "a00309.html#ga18b2a675f9153814c422d33878daebb2", null], │ │ │ │ - ["Dune::Functions::derivativeSignatureTags", "a00309.html#ga95d38d90c6b8ee6d3a2a0202cb80b56d", null] │ │ │ │ + ["Dune::Functions::H2LocalBasisTraits< DF, n, D, RF, m, R, J, H >", "a01790.html", "a01790"], │ │ │ │ + ["Dune::Functions::CubicHermiteNode< GV, R, reduced >", "a01814.html", "a01814"], │ │ │ │ + ["Dune::Functions::CubicHermiteBasis", "a00312.html#gac2b7a96bb915768e99b49446480615ec", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00212_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: signature.hh Source File │ │ │ +Dune-Functions: cubichermitebasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,175 +88,732 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
signature.hh
│ │ │ +
cubichermitebasis.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │ -
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_COMMON_SIGNATURE_HH
│ │ │ -
8#define DUNE_FUNCTIONS_COMMON_SIGNATURE_HH
│ │ │ -
9
│ │ │ -
10#include <type_traits>
│ │ │ -
11#include <tuple>
│ │ │ -
12
│ │ │ - │ │ │ +
6#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CUBICHERMITEBASIS_HH
│ │ │ +
7#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CUBICHERMITEBASIS_HH
│ │ │ +
8
│ │ │ +
9#include <algorithm>
│ │ │ +
10#include <array>
│ │ │ +
11#include <numeric>
│ │ │ +
12#include <type_traits>
│ │ │ +
13#include <vector>
│ │ │
14
│ │ │ -
15namespace Dune {
│ │ │ -
16namespace Functions {
│ │ │ -
17
│ │ │ -
23template<typename F>
│ │ │ - │ │ │ +
15#include <dune/common/exceptions.hh>
│ │ │ +
16#include <dune/common/fmatrix.hh>
│ │ │ +
17#include <dune/common/fvector.hh>
│ │ │ +
18#include <dune/common/rangeutilities.hh>
│ │ │ +
19
│ │ │ +
20#include <dune/grid/common/mcmgmapper.hh>
│ │ │ +
21
│ │ │ +
22#include <dune/localfunctions/common/localbasis.hh>
│ │ │ +
23#include <dune/localfunctions/common/localfiniteelementtraits.hh>
│ │ │ +
24#include <dune/localfunctions/common/localkey.hh>
│ │ │
25
│ │ │ -
26#ifndef DOXYGEN
│ │ │ -
27template<typename F>
│ │ │ -
28struct IsCallable
│ │ │ -
29{
│ │ │ -
30 struct yes { std::size_t dummy[2]; };
│ │ │ -
31 struct no { std::size_t dummy[1]; };
│ │ │ -
32
│ │ │ -
33 template<typename C>
│ │ │ -
34 static yes test(const decltype(&C::operator()) *);
│ │ │ -
35 template<typename C>
│ │ │ -
36 static no test(...);
│ │ │ -
37
│ │ │ -
38 enum { value = (sizeof(test<F>(0)) == sizeof(yes)) };
│ │ │ -
39};
│ │ │ -
40
│ │ │ -
41template<typename R, typename D>
│ │ │ -
42struct IsCallable<R(D)>
│ │ │ -
43{
│ │ │ -
44 enum { value = true };
│ │ │ -
45};
│ │ │ -
46
│ │ │ -
47template<typename R, typename D>
│ │ │ -
48struct IsCallable<R(*)(D)>
│ │ │ -
49{
│ │ │ -
50 enum { value = true };
│ │ │ -
51};
│ │ │ -
52#endif
│ │ │ -
53
│ │ │ -
59template<class Signature, bool isCallable = IsCallable<Signature>::value >
│ │ │ - │ │ │ -
61
│ │ │ -
62#ifndef DOXYGEN
│ │ │ -
64template<class T>
│ │ │ -
65struct SignatureTraits<T, true>
│ │ │ -
66 : public SignatureTraits<decltype(&T::operator()), true>
│ │ │ -
67{};
│ │ │ -
68
│ │ │ -
70template <typename C, typename R, typename D>
│ │ │ -
71struct SignatureTraits<R(C::*)(D) const, true>
│ │ │ -
72 : public SignatureTraits<R(D), true>
│ │ │ -
73{};
│ │ │ -
74
│ │ │ -
76template <typename C, typename R, typename D>
│ │ │ -
77struct SignatureTraits<R(C::*)(D), true>
│ │ │ -
78 : public SignatureTraits<R(D), true>
│ │ │ -
79{};
│ │ │ -
80
│ │ │ -
82template <typename R, typename D>
│ │ │ -
83struct SignatureTraits<R(*)(D), true>
│ │ │ -
84 : public SignatureTraits<R(D), true>
│ │ │ -
85{};
│ │ │ -
86
│ │ │ -
88template<class R, class D>
│ │ │ -
89struct SignatureTraits<R(D), true>
│ │ │ -
90{
│ │ │ -
91 using Range = R;
│ │ │ -
92 using Domain = D;
│ │ │ -
93
│ │ │ -
94 using RawRange = std::decay_t<Range>;
│ │ │ -
95 using RawDomain = std::decay_t<Domain>;
│ │ │ -
96
│ │ │ -
97 using RawSignature = RawRange(RawDomain);
│ │ │ -
98
│ │ │ -
99 template<template<class> class DerivativeTraits=DefaultDerivativeTraits>
│ │ │ -
100 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(Domain);
│ │ │ -
101};
│ │ │ -
102#endif
│ │ │ -
103
│ │ │ -
104
│ │ │ -
105template<class Signature, template<class> class DerivativeTraits=DefaultDerivativeTraits>
│ │ │ - │ │ │ -
107
│ │ │ -
117template<class Range, class Domain, template<class> class DerivativeTraitsT>
│ │ │ -
│ │ │ -
118struct SignatureTag<Range(Domain), DerivativeTraitsT>
│ │ │ -
119{
│ │ │ -
120 using Signature = Range(Domain);
│ │ │ -
121
│ │ │ -
122 template<class T>
│ │ │ -
123 using DerivativeTraits = DerivativeTraitsT<T>;
│ │ │ -
124};
│ │ │ -
│ │ │ -
125
│ │ │ -
126
│ │ │ -
127
│ │ │ -
136template<class Range, class Domain, template<class> class DerivativeTraits>
│ │ │ -
│ │ │ -
137auto derivativeSignatureTag(SignatureTag<Range(Domain), DerivativeTraits> tag)
│ │ │ -
138{
│ │ │ -
139 using DerivativeRange = typename DerivativeTraits<Range(Domain)>::Range;
│ │ │ - │ │ │ -
141}
│ │ │ -
│ │ │ -
142
│ │ │ -
143
│ │ │ -
144
│ │ │ -
158template<std::size_t maxOrder, class Signature, template<class> class DerivativeTraits>
│ │ │ -
│ │ │ - │ │ │ -
160{
│ │ │ -
161 if constexpr (maxOrder==0) {
│ │ │ -
162 // If maxOrder== 0 we just need the given SignatureTag
│ │ │ -
163 return std::make_tuple(tag);
│ │ │ -
164 } else {
│ │ │ -
165 // else we first construct the tail tuple with SignatureTags for derivatives
│ │ │ -
166 // of order 1 to maxOrder
│ │ │ -
167 auto tailTagsTuple = derivativeSignatureTags<std::size_t(maxOrder-1)>(derivativeSignatureTag(tag));
│ │ │ -
168 // and prepend this with the given SignatureTag.
│ │ │ -
169 // This is done by unpacking the tail tuple with apply().
│ │ │ -
170 return std::apply([&](auto&&... tailTags){
│ │ │ -
171 return std::make_tuple(tag, tailTags...);
│ │ │ -
172 }, tailTagsTuple);
│ │ │ -
173 }
│ │ │ -
174}
│ │ │ -
│ │ │ -
175
│ │ │ -
176
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
33
│ │ │ +
34
│ │ │ +
35
│ │ │ + │ │ │ +
37
│ │ │ +
53namespace Dune::Functions
│ │ │ +
54{
│ │ │ +
55
│ │ │ +
56 template<class GV, class R, bool reduced>
│ │ │ + │ │ │ +
58
│ │ │ +
78 template<class GV,bool reduced = false, class R = double>
│ │ │ + │ │ │ +
80
│ │ │ +
81 template<class DF, int n, class D, class RF, int m, class R, class J, class H>
│ │ │ +
│ │ │ + │ │ │ +
83 : public LocalBasisTraits<DF, n, D, RF, m, R, J>
│ │ │ +
84 {
│ │ │ +
90 using HessianType = H;
│ │ │ +
91 };
│ │ │ +
│ │ │ +
92
│ │ │ +
93 namespace Impl
│ │ │ +
94 {
│ │ │ +
95
│ │ │ +
96 // *****************************************************************************
│ │ │ +
97 // * Some helper functions for building polynomial bases from monomials
│ │ │ +
98 // *****************************************************************************
│ │ │ +
99
│ │ │ +
109 template<class KCoeff, int sizePolynom, int sizeMonom, class In, class Out>
│ │ │ +
110 void multiplyWithCoefficentMatrix(Dune::FieldMatrix<KCoeff, sizePolynom, sizeMonom> const& coefficients,
│ │ │ +
111 In const& monomialValues,
│ │ │ +
112 Out& polynomialValues)
│ │ │ +
113 {
│ │ │ +
114 for (int i = 0; i < sizePolynom; ++i)
│ │ │ +
115 {
│ │ │ +
116 squeezeTensor(polynomialValues[i]) = 0;
│ │ │ +
117 for (int j = 0; j < sizeMonom; ++j)
│ │ │ +
118 squeezeTensor(polynomialValues[i]) += coefficients[i][j]*monomialValues[j];
│ │ │ +
119 }
│ │ │ +
120 }
│ │ │ +
121
│ │ │ +
127 template<int dim, bool reduced>
│ │ │ +
128 class CubicHermiteLocalCoefficients
│ │ │ +
129 {
│ │ │ +
130 public:
│ │ │ +
131 using size_type = std::size_t;
│ │ │ +
132
│ │ │ +
133 CubicHermiteLocalCoefficients()
│ │ │ +
134 : localKeys_(size())
│ │ │ +
135 {
│ │ │ +
136 static_assert((dim > 0) and (dim <= 3), "CubicHermiteLocalCoefficients only implemented for dim=1,2,3");
│ │ │ +
137 static_assert((not reduced) or (dim == 2), "Reduced version of CubicHermiteLocalCoefficients only implemented for dim=2");
│ │ │ +
138 for (size_type i = 0; i < (dim +1); ++i)
│ │ │ +
139 {
│ │ │ +
140 // dim derivatives + 1 evaluation dofs per vertex
│ │ │ +
141 for (size_type k = 0; k < (dim +1); ++k)
│ │ │ +
142 localKeys_[(dim +1) * i + k] = LocalKey(i, dim, k);
│ │ │ +
143 }
│ │ │ +
144 if constexpr (not reduced)
│ │ │ +
145 {
│ │ │ +
146 // 1 evaluation per element (2d) / facets (3d)
│ │ │ +
147 for (size_type i = 0; i < (dim - 1) * (dim - 1); ++i)
│ │ │ +
148 localKeys_[(dim +1) * (dim +1) + i] = LocalKey(i, (dim == 2) ? 0 : 1, 0); // inner dofs
│ │ │ +
149 }
│ │ │ +
150 }
│ │ │ +
151
│ │ │ +
154 static constexpr size_type size()
│ │ │ +
155 {
│ │ │ +
156 if constexpr (dim==1)
│ │ │ +
157 return 4;
│ │ │ +
158 if constexpr ((dim==2) and (reduced))
│ │ │ +
159 return 9;
│ │ │ +
160 if constexpr ((dim==2) and (not reduced))
│ │ │ +
161 return 10;
│ │ │ +
162 if constexpr (dim==3)
│ │ │ +
163 return 20;
│ │ │ +
164 return 0;
│ │ │ +
165 }
│ │ │ +
166
│ │ │ +
169 LocalKey const &localKey(size_type i) const
│ │ │ +
170 {
│ │ │ +
171 return localKeys_[i];
│ │ │ +
172 }
│ │ │ +
173
│ │ │ +
174 private:
│ │ │ +
175 std::vector<LocalKey> localKeys_;
│ │ │ +
176 };
│ │ │
177
│ │ │ -
178} // namespace Functions
│ │ │ -
179} // namespace Dune
│ │ │ -
180
│ │ │ -
181#endif // DUNE_FUNCTIONS_COMMON_SIGNATURE_HH
│ │ │ - │ │ │ -
auto derivativeSignatureTag(SignatureTag< Range(Domain), DerivativeTraits > tag)
Construct SignatureTag for derivative.
Definition signature.hh:137
│ │ │ -
auto derivativeSignatureTags(Dune::Functions::SignatureTag< Signature, DerivativeTraits > tag)
Construct SignatureTags for derivatives.
Definition signature.hh:159
│ │ │ -
Definition monomialset.hh:19
│ │ │ +
178
│ │ │ +
184 template<class D, class R, int dim, bool reduced>
│ │ │ +
185 class CubicHermiteReferenceLocalBasis
│ │ │ +
186 {
│ │ │ +
187 public:
│ │ │ +
188 using Traits = H2LocalBasisTraits<D, dim, FieldVector<D, dim>, R, 1, FieldVector<R, 1>,
│ │ │ +
189 FieldMatrix<R, 1, dim>, FieldMatrix<R, dim, dim>>;
│ │ │ +
190
│ │ │ +
191 private:
│ │ │ +
192
│ │ │ +
205 static constexpr auto getCubicHermiteCoefficients()
│ │ │ +
206 {
│ │ │ +
207 if constexpr (dim == 1)
│ │ │ +
208 return Dune::FieldMatrix<D, 4, 4>({{1, 0, -3, 2}, {0, 1, -2, 1}, {0, 0, 3, -2}, {0, 0, -1, 1}});
│ │ │ +
209 else if constexpr (dim == 2)
│ │ │ +
210 {
│ │ │ +
211 if constexpr (reduced) {
│ │ │ +
212 auto w = std::array<D, 9>{1. / 3, 1. / 18, 1. / 18, 1. / 3, -1. / 9,
│ │ │ +
213 1. / 18, 1. / 3, 1. / 18, -1. / 9};
│ │ │ +
214 return Dune::FieldMatrix<D, 9, 10>({
│ │ │ +
215 {1, 0, 0, -3, -13 + w[0] * 27, -3, 2, 13 - w[0] * 27, 13 - w[0] * 27, 2},
│ │ │ +
216 {0, 1, 0, -2, -3 + w[1] * 27, 0, 1, 3 - w[1] * 27, 2 - w[1] * 27, 0},
│ │ │ +
217 {0, 0, 1, 0, -3 + w[2] * 27, -2, 0, 2 - w[2] * 27, 3 - w[2] * 27, 1},
│ │ │ +
218 {0, 0, 0, 3, -7 + w[3] * 27, 0, -2, 7 - w[3] * 27, 7 - w[3] * 27, 0},
│ │ │ +
219 {0, 0, 0, -1, 2 + w[4] * 27, 0, 1, -2 - w[4] * 27, -2 - w[4] * 27, 0},
│ │ │ +
220 {0, 0, 0, 0, -1 + w[5] * 27, 0, 0, 2 - w[5] * 27, 1 - w[5] * 27, 0},
│ │ │ +
221 {0, 0, 0, 0, -7 + w[6] * 27, 3, 0, 7 - w[6] * 27, 7 - w[6] * 27, -2},
│ │ │ +
222 {0, 0, 0, 0, -1 + w[7] * 27, 0, 0, 1 - w[7] * 27, 2 - w[7] * 27, 0},
│ │ │ +
223 {0, 0, 0, 0, 2 + w[8] * 27, -1, 0, -2 - w[8] * 27, -2 - w[8] * 27, 1},
│ │ │ +
224 });
│ │ │ +
225 }
│ │ │ +
226 else
│ │ │ +
227 return Dune::FieldMatrix<D, 10,10>({
│ │ │ +
228 {1, 0, 0, -3, -13, -3, 2, 13, 13, 2},
│ │ │ +
229 {0, 1, 0, -2, -3, 0, 1, 3, 2, 0},
│ │ │ +
230 {0, 0, 1, 0, -3, -2, 0, 2, 3, 1}, // l_2
│ │ │ +
231 {0, 0, 0, 3, -7, 0, -2, 7, 7, 0},
│ │ │ +
232 {0, 0, 0, -1, 2, 0, 1, -2, -2, 0},
│ │ │ +
233 {0, 0, 0, 0, -1, 0, 0, 2, 1, 0},
│ │ │ +
234 {0, 0, 0, 0, -7, 3, 0, 7, 7, -2}, // l_6
│ │ │ +
235 {0, 0, 0, 0, -1, 0, 0, 1, 2, 0},
│ │ │ +
236 {0, 0, 0, 0, 2, -1, 0, -2, -2, 1},
│ │ │ +
237 {0, 0, 0, 0, 27, 0, 0, -27, -27, 0}}); // l_9, inner dof
│ │ │ +
238 }
│ │ │ +
239 else if constexpr (dim == 3)
│ │ │ +
240 {
│ │ │ +
241 return Dune::FieldMatrix<D, 20,20>({{1, 0, 0, 0, -3, -13, -3, -13, -13, -3, // deg 0 to 2
│ │ │ +
242 2, 13, 13, 2, 13, 33, 13, 13, 13, 2}, // deg 3
│ │ │ +
243 {0, 1, 0, 0,/*xx*/ -2, /*xy*/-3,/*yy*/ 0,/*xz*/ -3,/*yz*/ 0,/*zz*/ 0, 1, 3, 2, 0, 3, 4, 0, 2, 0, 0},
│ │ │ +
244 {0, 0, 1, 0, 0, -3, -2, 0, -3, 0, 0, 2, 3, 1, 0, 4, 3, 0, 2, 0},
│ │ │ +
245 {0, 0, 0, 1, 0, 0, 0, -3, -3, -2, 0, 0, 0, 0, 2, 4, 2, 3, 3, 1},
│ │ │ +
246 {0, 0, 0, 0, 3, -7, 0, -7, 0, 0, // l_4
│ │ │ +
247 -2, 7, 7, 0, 7, 7, 0, 7, 0, 0},
│ │ │ +
248 {0, 0, 0, 0, -1, 2, 0, 2, 0, 0, 1, -2, -2, 0, -2, -2, 0, -2, 0, 0},
│ │ │ +
249 {0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0},
│ │ │ +
250 {0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 1, 0, 0},
│ │ │ +
251 {0, 0, 0, 0, 0, -7, 3, 0, -7, 0, // l_8
│ │ │ +
252 0, 7, 7, -2, 0, 7, 7, 0, 7, 0},
│ │ │ +
253 {0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0},
│ │ │ +
254 {0, 0, 0, 0, 0, 2, -1, 0, 2, 0, 0, -2, -2, 1, 0, -2, -2, 0, -2, 0},
│ │ │ +
255 {0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0},
│ │ │ +
256 {0, 0, 0, 0, 0, 0, 0, -7, -7, 3, // l_12
│ │ │ +
257 0, 0, 0, 0, 7, 7, 7, 7, 7, -2},
│ │ │ +
258 {0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0},
│ │ │ +
259 {0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0},
│ │ │ +
260 {0, 0, 0, 0, 0, 0, 0, 2, 2, -1, 0, 0, 0, 0, -2, -2, -2, -2, -2, 1},
│ │ │ +
261 // l_16, from here on inner dofs
│ │ │ +
262 {0, 0, 0, 0, 0, 27, 0, 0, 0, 0, // bottom
│ │ │ +
263 0, -27, -27, 0, 0, -27, 0, 0, 0, 0},
│ │ │ +
264 {0, 0, 0, 0, 0, 0, 0, 27, 0, 0, // front
│ │ │ +
265 0, 0, 0, 0, -27, -27, 0, -27, 0, 0},
│ │ │ +
266 {0, 0, 0, 0, 0, 0, 0, 0, 27, 0, // left
│ │ │ +
267 0, 0, 0, 0, 0, -27, -27, 0, -27, 0},
│ │ │ +
268 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // right
│ │ │ +
269 0, 0, 0, 0, 0, 27, 0, 0, 0, 0}});
│ │ │ +
270 }
│ │ │ +
271 }
│ │ │ +
272
│ │ │ +
273 static constexpr auto referenceBasisCoefficients = getCubicHermiteCoefficients();
│ │ │ +
274 static constexpr MonomialSet<typename Traits::RangeFieldType, dim, 3> monomials = {};
│ │ │ +
275
│ │ │ +
276 public:
│ │ │ +
277
│ │ │ +
278 CubicHermiteReferenceLocalBasis()
│ │ │ +
279 {
│ │ │ +
280 static_assert((dim > 0) and (dim <= 3), "CubicHermiteReferenceLocalBasis only implemented for dim=1,2,3");
│ │ │ +
281 static_assert((not reduced) or (dim == 2), "Reduced version of CubicHermiteReferenceLocalBasis only implemented for dim=2");
│ │ │ +
282 }
│ │ │ +
283
│ │ │ +
286 static constexpr unsigned int size()
│ │ │ +
287 {
│ │ │ +
288 return CubicHermiteLocalCoefficients<dim,reduced>::size();
│ │ │ +
289 }
│ │ │ +
290
│ │ │ +
293 unsigned int order() const
│ │ │ +
294 {
│ │ │ +
295 return 3;
│ │ │ +
296 }
│ │ │ +
297
│ │ │ +
303 void evaluateFunction(const typename Traits::DomainType &in,
│ │ │ +
304 std::vector<typename Traits::RangeType> &out) const
│ │ │ +
305 {
│ │ │ +
306 out.resize(size());
│ │ │ +
307 auto monomialValues = monomials(in);
│ │ │ +
308 multiplyWithCoefficentMatrix(referenceBasisCoefficients, monomialValues, out);
│ │ │ +
309 }
│ │ │ +
310
│ │ │ +
316 void evaluateJacobian(const typename Traits::DomainType &in,
│ │ │ +
317 std::vector<typename Traits::JacobianType> &out) const
│ │ │ +
318 {
│ │ │ +
319 out.resize(size());
│ │ │ +
320 auto monomialValues = derivative(monomials)(in);
│ │ │ +
321 multiplyWithCoefficentMatrix(referenceBasisCoefficients, monomialValues, out);
│ │ │ +
322 }
│ │ │ +
323
│ │ │ +
329 void evaluateHessian(const typename Traits::DomainType &in,
│ │ │ +
330 std::vector<typename Traits::HessianType> &out) const
│ │ │ +
331 {
│ │ │ +
332 out.resize(size());
│ │ │ +
333 auto monomialValues = derivative(derivative(monomials))(in);
│ │ │ +
334 multiplyWithCoefficentMatrix(referenceBasisCoefficients, monomialValues, out);
│ │ │ +
335 }
│ │ │ +
336
│ │ │ +
343 void partial(std::array<unsigned int, dim> order, const typename Traits::DomainType &in,
│ │ │ +
344 std::vector<typename Traits::RangeType> &out) const
│ │ │ +
345 {
│ │ │ +
346 out.resize(size());
│ │ │ +
347 auto totalOrder = std::accumulate(order.begin(), order.end(), 0);
│ │ │ +
348 if (totalOrder == 0)
│ │ │ +
349 evaluateFunction(in, out);
│ │ │ +
350 else if (totalOrder == 1)
│ │ │ +
351 {
│ │ │ +
352 evaluateJacobian(in,jacobiansBuffer_);
│ │ │ +
353 std::size_t which = std::max_element(order.begin(), order.end()) - order.begin();
│ │ │ +
354 for (auto i : Dune::range(size()))
│ │ │ +
355 out[i] = jacobiansBuffer_[i][0][which];
│ │ │ +
356 }
│ │ │ +
357 else if (totalOrder == 2)
│ │ │ +
358 {
│ │ │ +
359 evaluateHessian(in, hessianBuffer_);
│ │ │ +
360 std::size_t first, second;
│ │ │ +
361 first = std::max_element(order.begin(), order.end()) - order.begin();
│ │ │ +
362 if (order[first] == 2)
│ │ │ +
363 second = first;
│ │ │ +
364 else
│ │ │ +
365 {
│ │ │ +
366 order[first] = 0;
│ │ │ +
367 second = std::max_element(order.begin(), order.end()) - order.begin();
│ │ │ +
368 }
│ │ │ +
369 for (auto i : Dune::range(size()))
│ │ │ +
370 out[i] = hessianBuffer_[i][first][second];
│ │ │ +
371 }
│ │ │ +
372 else
│ │ │ +
373 DUNE_THROW(RangeError, "partial() not implemented for given order");
│ │ │ +
374 }
│ │ │ +
375
│ │ │ +
376 private:
│ │ │ +
377 mutable std::vector<typename Traits::JacobianType> jacobiansBuffer_;
│ │ │ +
378 mutable std::vector<typename Traits::HessianType> hessianBuffer_;
│ │ │ +
379 };
│ │ │ +
380
│ │ │ +
381
│ │ │ +
387 template<class D, int dim, bool reduced = false>
│ │ │ +
388 class CubicHermiteLocalInterpolation
│ │ │ +
389 {
│ │ │ +
390 using size_type = std::size_t;
│ │ │ +
391
│ │ │ +
392 static constexpr unsigned int size()
│ │ │ +
393 {
│ │ │ +
394 return CubicHermiteLocalCoefficients<dim,reduced>::size();
│ │ │ +
395 }
│ │ │ +
396
│ │ │ +
397 using FunctionalDescriptor = Dune::Functions::Impl::FunctionalDescriptor<dim>;
│ │ │ +
398
│ │ │ +
399 public:
│ │ │ +
400
│ │ │ +
401 CubicHermiteLocalInterpolation()
│ │ │ +
402 {
│ │ │ +
403 static_assert((dim > 0) and (dim <= 3), "CubicHermiteLocalInterpolation only implemented for dim=1,2,3");
│ │ │ +
404 static_assert((not reduced) or (dim == 2), "Reduced version of CubicHermiteLocalInterpolation only implemented for dim=2");
│ │ │ +
405 if constexpr (dim==1)
│ │ │ +
406 {
│ │ │ +
407 descriptors_[0] = FunctionalDescriptor();
│ │ │ +
408 descriptors_[1] = FunctionalDescriptor({1});
│ │ │ +
409 descriptors_[2] = FunctionalDescriptor();
│ │ │ +
410 descriptors_[3] = FunctionalDescriptor({1});
│ │ │ +
411 }
│ │ │ +
412 if constexpr (dim==2)
│ │ │ +
413 {
│ │ │ +
414 descriptors_[0] = FunctionalDescriptor();
│ │ │ +
415 descriptors_[1] = FunctionalDescriptor({1,0});
│ │ │ +
416 descriptors_[2] = FunctionalDescriptor({0,1});
│ │ │ +
417 descriptors_[3] = FunctionalDescriptor();
│ │ │ +
418 descriptors_[4] = FunctionalDescriptor({1,0});
│ │ │ +
419 descriptors_[5] = FunctionalDescriptor({0,1});
│ │ │ +
420 descriptors_[6] = FunctionalDescriptor();
│ │ │ +
421 descriptors_[7] = FunctionalDescriptor({1,0});
│ │ │ +
422 descriptors_[8] = FunctionalDescriptor({0,1});
│ │ │ +
423 if (not reduced)
│ │ │ +
424 descriptors_[9] = FunctionalDescriptor();
│ │ │ +
425 }
│ │ │ +
426 if constexpr (dim==3)
│ │ │ +
427 {
│ │ │ +
428 descriptors_[0] = FunctionalDescriptor();
│ │ │ +
429 descriptors_[1] = FunctionalDescriptor({1,0,0});
│ │ │ +
430 descriptors_[2] = FunctionalDescriptor({0,1,0});
│ │ │ +
431 descriptors_[3] = FunctionalDescriptor({0,0,1});
│ │ │ +
432 descriptors_[4] = FunctionalDescriptor();
│ │ │ +
433 descriptors_[5] = FunctionalDescriptor({1,0,0});
│ │ │ +
434 descriptors_[6] = FunctionalDescriptor({0,1,0});
│ │ │ +
435 descriptors_[7] = FunctionalDescriptor({0,0,1});
│ │ │ +
436 descriptors_[8] = FunctionalDescriptor();
│ │ │ +
437 descriptors_[9] = FunctionalDescriptor({1,0,0});
│ │ │ +
438 descriptors_[10] = FunctionalDescriptor({0,1,0});
│ │ │ +
439 descriptors_[11] = FunctionalDescriptor({0,0,1});
│ │ │ +
440 descriptors_[12] = FunctionalDescriptor();
│ │ │ +
441 descriptors_[13] = FunctionalDescriptor({1,0,0});
│ │ │ +
442 descriptors_[14] = FunctionalDescriptor({0,1,0});
│ │ │ +
443 descriptors_[15] = FunctionalDescriptor({0,0,1});
│ │ │ +
444 descriptors_[16] = FunctionalDescriptor();
│ │ │ +
445 descriptors_[17] = FunctionalDescriptor();
│ │ │ +
446 descriptors_[18] = FunctionalDescriptor();
│ │ │ +
447 descriptors_[19] = FunctionalDescriptor();
│ │ │ +
448 }
│ │ │ +
449 }
│ │ │ +
450
│ │ │ +
453 template<class Element>
│ │ │ +
454 void bind( Element const &element, std::array<D, dim+1>const& averageVertexMeshSize)
│ │ │ +
455 {
│ │ │ +
456 averageVertexMeshSize_ = &averageVertexMeshSize;
│ │ │ +
457 }
│ │ │ +
458
│ │ │ +
466 template<class F, class C>
│ │ │ +
467 void interpolate(const F &f, std::vector<C> &out) const
│ │ │ +
468 {
│ │ │ +
469 out.resize(size());
│ │ │ +
470 auto df = derivative(f);
│ │ │ +
471 auto const &refElement = Dune::ReferenceElements<D, dim>::simplex();
│ │ │ +
472
│ │ │ +
473 // Iterate over vertices, dim derivative +1 evaluation dofs per vertex
│ │ │ +
474 for (int i = 0; i < (dim+1); ++i)
│ │ │ +
475 {
│ │ │ +
476 auto x = refElement.position(i, dim);
│ │ │ +
477 auto&& derivativeValue = df(x);
│ │ │ +
478 out[i * (dim +1)] = f(x);
│ │ │ +
479 for (int d = 0; d < dim; ++d)
│ │ │ +
480 out[i * (dim+1) + d + 1] = squeezeTensor(derivativeValue)[d] * (*averageVertexMeshSize_)[i];
│ │ │ +
481 }
│ │ │ +
482
│ │ │ +
483 if constexpr (not reduced)
│ │ │ +
484 {
│ │ │ +
485 for (size_type i = 0; i < (dim - 1) * (dim - 1); ++i)
│ │ │ +
486 out[(dim +1) * (dim +1) + i] = f(refElement.position(i, (dim == 2) ? 0 : 1));
│ │ │ +
487 }
│ │ │ +
488 }
│ │ │ +
489
│ │ │ +
493 const FunctionalDescriptor& functionalDescriptor(size_type i) const
│ │ │ +
494 {
│ │ │ +
495 return descriptors_[i];
│ │ │ +
496 }
│ │ │ +
497
│ │ │ +
498 protected:
│ │ │ +
499 std::array<D, dim+1> const* averageVertexMeshSize_;
│ │ │ +
500 std::array<FunctionalDescriptor, size()> descriptors_;
│ │ │ +
501 };
│ │ │ +
502
│ │ │ +
503 template<class D, class R, int dim , bool reduced>
│ │ │ +
504 struct CubicHermiteLocalBasisTraits
│ │ │ +
505 : public H2LocalBasisTraits<D, dim, Dune::FieldVector<D,dim>, R, 1,
│ │ │ +
506 Dune::FieldVector<R,1>, Dune::FieldMatrix<R,1,dim>, Dune::FieldMatrix<R,dim,dim>>
│ │ │ +
507 {};
│ │ │ +
508
│ │ │ +
517 template<class D, class R, int dim, bool reduced = false>
│ │ │ +
518 class CubicHermiteLocalFiniteElement
│ │ │ +
519 : public Impl::TransformedFiniteElementMixin<CubicHermiteLocalFiniteElement<D,R,dim,reduced>, CubicHermiteLocalBasisTraits<D, R, dim, reduced>>
│ │ │ +
520 {
│ │ │ +
521 using Base = Impl::TransformedFiniteElementMixin< CubicHermiteLocalFiniteElement<D,R,dim,reduced>, CubicHermiteLocalBasisTraits<D, R, dim, reduced>>;
│ │ │ +
522 friend class Impl::TransformedLocalBasis<CubicHermiteLocalFiniteElement<D,R,dim,reduced>, CubicHermiteLocalBasisTraits<D, R, dim, reduced>>;
│ │ │ +
523
│ │ │ +
524 public:
│ │ │ +
525
│ │ │ +
526 CubicHermiteLocalFiniteElement()
│ │ │ +
527 : Base()
│ │ │ +
528 {
│ │ │ +
529 static_assert((dim > 0) and (dim <= 3), "CubicHermiteLocalFiniteElement only implemented for dim=1,2,3");
│ │ │ +
530 static_assert((not reduced) or (dim == 2), "Reduced version of CubicHermiteLocalFiniteElement only implemented for dim=2");
│ │ │ +
531 }
│ │ │ +
532
│ │ │ +
535 using size_type = std::size_t;
│ │ │ +
536 using Traits = LocalFiniteElementTraits<
│ │ │ +
537 Impl::TransformedLocalBasis<CubicHermiteLocalFiniteElement<D,R,dim,reduced>, CubicHermiteLocalBasisTraits<D, R, dim, reduced>>,
│ │ │ +
538 Impl::CubicHermiteLocalCoefficients<dim, reduced>,
│ │ │ +
539 Impl::CubicHermiteLocalInterpolation<D, dim, reduced>>;
│ │ │ +
540
│ │ │ +
544 const typename Traits::LocalCoefficientsType &localCoefficients() const
│ │ │ +
545 {
│ │ │ +
546 return coefficients_;
│ │ │ +
547 }
│ │ │ +
548
│ │ │ +
551 const typename Traits::LocalInterpolationType &localInterpolation() const
│ │ │ +
552 {
│ │ │ +
553 return interpolation_;
│ │ │ +
554 }
│ │ │ +
555
│ │ │ +
558 static constexpr GeometryType type()
│ │ │ +
559 {
│ │ │ +
560 return GeometryTypes::simplex(dim);
│ │ │ +
561 }
│ │ │ +
562
│ │ │ +
565 static constexpr size_type size()
│ │ │ +
566 {
│ │ │ +
567 return Impl::CubicHermiteLocalCoefficients<dim,reduced>::size();
│ │ │ +
568 }
│ │ │ +
569
│ │ │ +
572 template<class Mapper, class Element>
│ │ │ +
573 void bind(Mapper const& vertexMapper, std::vector<D> const& globalAverageVertexMeshSize, Element const &e)
│ │ │ +
574 {
│ │ │ +
575 // Cache average mesh size for each vertex
│ │ │ +
576 for (auto i : range(dim+1))
│ │ │ +
577 averageVertexMeshSize_[i] = globalAverageVertexMeshSize[vertexMapper.subIndex(e, i, dim)];
│ │ │ +
578
│ │ │ +
579 // Bind LocalInterpolation to updated local state
│ │ │ +
580 interpolation_.bind(e, averageVertexMeshSize_);
│ │ │ +
581
│ │ │ +
582 // Compute local transformation matrices for each vertex
│ │ │ +
583 const auto& geometry = e.geometry();
│ │ │ +
584 const auto& refElement = Dune::ReferenceElements<typename Element::Geometry::ctype, dim>::simplex();
│ │ │ +
585 for (auto i : range(dim+1))
│ │ │ +
586 {
│ │ │ +
587 scaledVertexJacobians_[i] = geometry.jacobian(refElement.position(i, dim));
│ │ │ +
588 scaledVertexJacobians_[i] /= averageVertexMeshSize_[i];
│ │ │ +
589 }
│ │ │ +
590 }
│ │ │ +
591
│ │ │ +
592 protected:
│ │ │ +
593
│ │ │ +
596 Impl::CubicHermiteReferenceLocalBasis<D, R, dim, reduced> const& referenceLocalBasis() const
│ │ │ +
597 {
│ │ │ +
598 return basis_;
│ │ │ +
599 }
│ │ │ +
600
│ │ │ +
605 template<class InputValues, class OutputValues>
│ │ │ +
606 void transform(InputValues const &inValues, OutputValues &outValues) const
│ │ │ +
607 {
│ │ │ +
608 assert(inValues.size() == size());
│ │ │ +
609 assert(outValues.size() == inValues.size());
│ │ │ +
610 auto inIt = inValues.begin();
│ │ │ +
611 auto outIt = outValues.begin();
│ │ │ +
612
│ │ │ +
613 for (auto vertex : Dune::range((dim +1)))
│ │ │ +
614 {
│ │ │ +
615 *outIt = *inIt; // value dof is not transformed
│ │ │ +
616 outIt++, inIt++;
│ │ │ +
617 // transform the gradient dofs together
│ │ │ +
618 for (auto &&[row_i, i] : sparseRange(scaledVertexJacobians_[vertex]))
│ │ │ +
619 {
│ │ │ +
620 outIt[i] = 0.;
│ │ │ +
621 for (auto &&[val_i_j, j] : sparseRange(row_i))
│ │ │ +
622 outIt[i] += val_i_j * inIt[j];
│ │ │ +
623 }
│ │ │ +
624 // increase pointer by size of gradient = dim
│ │ │ +
625 outIt += dim, inIt += dim;
│ │ │ +
626 }
│ │ │ +
627
│ │ │ +
628 // For the non-reduced case: Copy all remaining inner dofs
│ │ │ +
629 if constexpr (dim > 1 and (not reduced))
│ │ │ +
630 std::copy(inIt, inValues.end(), outIt);
│ │ │ +
631 }
│ │ │ +
632
│ │ │ +
633 private:
│ │ │ +
634
│ │ │ +
635 typename Impl::CubicHermiteReferenceLocalBasis<D, R, dim, reduced> basis_;
│ │ │ +
636 typename Traits::LocalCoefficientsType coefficients_;
│ │ │ +
637 typename Traits::LocalInterpolationType interpolation_;
│ │ │ +
638 // the transformation to correct the lack of affine equivalence boils down to
│ │ │ +
639 // one transformation matrix per vertex
│ │ │ +
640 std::array<Dune::FieldMatrix<R, dim, dim>, dim+1> scaledVertexJacobians_;
│ │ │ +
641 // the local state, i.e. a collection of global information restricted to this element
│ │ │ +
642 std::array<D, dim+1> averageVertexMeshSize_;
│ │ │ +
643
│ │ │ +
644 };
│ │ │ +
645
│ │ │ +
646 } // end namespace Impl
│ │ │ +
647
│ │ │ +
648
│ │ │ +
649
│ │ │ +
650 // *****************************************************************************
│ │ │ +
651 // This is the reusable part of the basis. It contains
│ │ │ +
652 //
│ │ │ +
653 // CubicHermitePreBasis
│ │ │ +
654 // CubicHermiteNode
│ │ │ +
655 //
│ │ │ +
656 // The pre-basis allows to create the others and is the owner of possible shared
│ │ │ +
657 // state. These components do _not_ depend on the global basis and local view
│ │ │ +
658 // and can be used without a global basis.
│ │ │ +
659 // *****************************************************************************
│ │ │ +
660
│ │ │ +
661 template<class GV, class R, bool reduced>
│ │ │ +
│ │ │ + │ │ │ +
663 : public LeafBasisNode
│ │ │ +
664 {
│ │ │ +
665 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper<GV>;
│ │ │ +
666
│ │ │ +
667 public:
│ │ │ +
668 using size_type = std::size_t;
│ │ │ +
669 using Element = typename GV::template Codim<0>::Entity;
│ │ │ +
670 using FiniteElement = typename Impl::CubicHermiteLocalFiniteElement<typename GV::ctype, R, GV::dimension, reduced>;
│ │ │ +
671
│ │ │ +
│ │ │ +
672 CubicHermiteNode(Mapper const& m, std::vector<typename GV::ctype> const& averageVertexMeshSize)
│ │ │ +
673 : element_(nullptr)
│ │ │ +
674 , vertexMapper_(&m)
│ │ │ +
675 , averageVertexMeshSize_(&averageVertexMeshSize)
│ │ │ +
676 {}
│ │ │ +
│ │ │ +
677
│ │ │ +
│ │ │ +
679 Element const &element() const
│ │ │ +
680 {
│ │ │ +
681 return *element_;
│ │ │ +
682 }
│ │ │ +
│ │ │ +
683
│ │ │ +
│ │ │ + │ │ │ +
690 {
│ │ │ +
691 return finiteElement_;
│ │ │ +
692 }
│ │ │ +
│ │ │ +
693
│ │ │ +
│ │ │ +
695 void bind(Element const &e)
│ │ │ +
696 {
│ │ │ +
697 element_ = &e;
│ │ │ + │ │ │ +
699 this->setSize(finiteElement_.size());
│ │ │ +
700 }
│ │ │ +
│ │ │ +
701
│ │ │ +
703 unsigned int order() const { return finiteElement_.localBasis().order(); }
│ │ │ +
704
│ │ │ +
705 protected:
│ │ │ + │ │ │ + │ │ │ +
708 Mapper const* vertexMapper_;
│ │ │ +
709 std::vector<typename GV::ctype> const* averageVertexMeshSize_;
│ │ │ +
710 };
│ │ │ +
│ │ │ +
711
│ │ │ +
712
│ │ │ +
722 template<class GV, class R, bool reduced = false>
│ │ │ +
│ │ │ + │ │ │ +
724 : public LeafPreBasisMapperMixin<GV>
│ │ │ +
725 {
│ │ │ +
726 using Base = LeafPreBasisMapperMixin<GV>;
│ │ │ +
727 using SubEntityMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GV>;
│ │ │ +
728 using Element = typename GV::template Codim<0>::Entity;
│ │ │ +
729 using D = typename GV::ctype;
│ │ │ +
730 static const std::size_t dim = GV::dimension;
│ │ │ +
731
│ │ │ +
732 // helper methods to assign each subentity the number of dofs. Used by the LeafPreBasisMapperMixin.
│ │ │ +
733 static constexpr auto cubicHermiteMapperLayout(Dune::GeometryType type, int gridDim)
│ │ │ +
734 {
│ │ │ +
735 if (type.isVertex())
│ │ │ +
736 return 1 + gridDim; // one evaluation dof and gridDim derivative dofs per vertex
│ │ │ +
737 if (gridDim == 1) // in 1d there are no other dofs
│ │ │ +
738 return 0;
│ │ │ +
739 // in 2d we have one inner dof (i.e. on the triangle) or non for the reduced case
│ │ │ +
740 // and in 3d we have one dof on each face (i.e. on each triangle)
│ │ │ +
741 if ((type.isTriangle()) and (not reduced))
│ │ │ +
742 return 1;
│ │ │ +
743 else
│ │ │ +
744 return 0; // this case is only entered for the interior of the 3d element. There are no dofs.
│ │ │ +
745 }
│ │ │ +
746
│ │ │ +
747 public:
│ │ │ +
749 using GridView = GV;
│ │ │ +
750
│ │ │ +
752 using size_type = std::size_t;
│ │ │ +
753
│ │ │ + │ │ │ +
756
│ │ │ +
757 public:
│ │ │ +
758
│ │ │ +
│ │ │ + │ │ │ +
761 : Base(gv, cubicHermiteMapperLayout)
│ │ │ +
762 , vertexMapper_({gv, mcmgVertexLayout()})
│ │ │ +
763 {
│ │ │ +
764 static_assert((dim > 0) and (dim <= 3), "CubicHermitePreBasis only implemented for dim=1,2,3");
│ │ │ +
765 static_assert((not reduced) or (dim == 2), "Reduced version of CubicHermitePreBasis only implemented for dim=2");
│ │ │ +
766 averageVertexMeshSize_ = Impl::computeAverageSubEntityMeshSize<D>(vertexMapper_);
│ │ │ +
767 }
│ │ │ +
│ │ │ +
768
│ │ │ +
│ │ │ +
770 void update(GridView const &gv)
│ │ │ +
771 {
│ │ │ +
772 Base::update(gv);
│ │ │ +
773 vertexMapper_.update(this->gridView());
│ │ │ +
774 averageVertexMeshSize_ = Impl::computeAverageSubEntityMeshSize<D>(vertexMapper_);
│ │ │ +
775 }
│ │ │ +
│ │ │ +
776
│ │ │ +
│ │ │ + │ │ │ +
781 {
│ │ │ + │ │ │ +
783 }
│ │ │ +
│ │ │ +
784
│ │ │ +
785 protected:
│ │ │ +
786
│ │ │ +
787 SubEntityMapper vertexMapper_;
│ │ │ + │ │ │ +
789
│ │ │ +
790 }; // class CubicHermitePreBasis
│ │ │ +
│ │ │ +
791
│ │ │ +
792 namespace BasisFactory
│ │ │ +
793 {
│ │ │ +
794
│ │ │ +
802 template<class R = double>
│ │ │ +
803 auto cubicHermite()
│ │ │ +
804 {
│ │ │ +
805 return [=](auto const &gridView) {
│ │ │ +
806 return CubicHermitePreBasis<std::decay_t<decltype(gridView)>, R>(gridView);
│ │ │ +
807 };
│ │ │ +
808 }
│ │ │ +
809
│ │ │ +
817 template<class R = double>
│ │ │ +
818 auto reducedCubicHermite()
│ │ │ +
819 {
│ │ │ +
820 return [=](auto const &gridView) {
│ │ │ +
821 return CubicHermitePreBasis<std::decay_t<decltype(gridView)>, R, true>(gridView);
│ │ │ +
822 };
│ │ │ +
823 }
│ │ │ +
824
│ │ │ +
825 } // end namespace BasisFactory
│ │ │ +
826
│ │ │ +
827
│ │ │ +
828} // end namespace Dune::Functions
│ │ │ +
829
│ │ │ +
830#endif
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
Obtain derivative of TrigonometricFunction function.
Definition trigonometricfunction.hh:43
│ │ │ +
DefaultGlobalBasis< CubicHermitePreBasis< GV, R, reduced > > CubicHermiteBasis
Nodal basis of a scalar cubic Hermite finite element space.
Definition cubichermitebasis.hh:79
│ │ │
Definition monomialset.hh:19
│ │ │ -
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:41
│ │ │ -
Helper class to check that F is callable.
Definition signature.hh:24
│ │ │ -
Helper class to deduce the signature of a callable.
Definition signature.hh:60
│ │ │ -
Definition signature.hh:106
│ │ │ -
DerivativeTraitsT< T > DerivativeTraits
Definition signature.hh:123
│ │ │ - │ │ │ +
Definition argyrisbasis.hh:926
│ │ │ +
A pre-basis for a Hermitebasis.
Definition cubichermitebasis.hh:725
│ │ │ +
std::vector< D > averageVertexMeshSize_
Definition cubichermitebasis.hh:788
│ │ │ +
Node makeNode() const
Create tree node.
Definition cubichermitebasis.hh:780
│ │ │ +
CubicHermiteNode< GridView, R, reduced > Node
Template mapping root tree path to type of created tree node.
Definition cubichermitebasis.hh:755
│ │ │ +
GV GridView
The grid view that the FE basis is defined on.
Definition cubichermitebasis.hh:749
│ │ │ +
std::size_t size_type
Type used for indices and size information.
Definition cubichermitebasis.hh:752
│ │ │ +
SubEntityMapper vertexMapper_
Definition cubichermitebasis.hh:787
│ │ │ +
void update(GridView const &gv)
Update the stored grid view, to be called if the grid has changed.
Definition cubichermitebasis.hh:770
│ │ │ +
CubicHermitePreBasis(const GV &gv)
Constructor for a given grid view object.
Definition cubichermitebasis.hh:760
│ │ │ +
Definition cubichermitebasis.hh:84
│ │ │ + │ │ │ +
Definition cubichermitebasis.hh:664
│ │ │ +
std::size_t size_type
Definition cubichermitebasis.hh:668
│ │ │ +
typename Impl::CubicHermiteLocalFiniteElement< typename GV::ctype, R, GV::dimension, reduced > FiniteElement
Definition cubichermitebasis.hh:670
│ │ │ +
FiniteElement finiteElement_
Definition cubichermitebasis.hh:706
│ │ │ +
FiniteElement const & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition cubichermitebasis.hh:689
│ │ │ +
Element const & element() const
Return current element, throw if unbound.
Definition cubichermitebasis.hh:679
│ │ │ +
Element const * element_
Definition cubichermitebasis.hh:707
│ │ │ +
void bind(Element const &e)
Bind to element.
Definition cubichermitebasis.hh:695
│ │ │ +
unsigned int order() const
The order of the local basis.
Definition cubichermitebasis.hh:703
│ │ │ +
typename GV::template Codim< 0 >::Entity Element
Definition cubichermitebasis.hh:669
│ │ │ +
Mapper const * vertexMapper_
Definition cubichermitebasis.hh:708
│ │ │ +
std::vector< typename GridView::ctype > const * averageVertexMeshSize_
Definition cubichermitebasis.hh:709
│ │ │ +
CubicHermiteNode(Mapper const &m, std::vector< typename GV::ctype > const &averageVertexMeshSize)
Definition cubichermitebasis.hh:672
│ │ │ +
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:53
│ │ │ +
const GridView & gridView() const
Export the stored GridView.
Definition leafprebasismappermixin.hh:95
│ │ │ +
void update(const GridView &gv)
Update the stored GridView.
Definition leafprebasismappermixin.hh:101
│ │ │ +
LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout)
Construct from GridView and local DOF layout.
Definition leafprebasismappermixin.hh:74
│ │ │ +
void setSize(const size_type size)
Definition nodes.hh:197
│ │ │ +
Definition nodes.hh:218
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,189 +1,847 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -signature.hh │ │ │ │ +cubichermitebasis.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ -6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_COMMON_SIGNATURE_HH │ │ │ │ -8#define DUNE_FUNCTIONS_COMMON_SIGNATURE_HH │ │ │ │ -9 │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ -12 │ │ │ │ -13#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ +6#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CUBICHERMITEBASIS_HH │ │ │ │ +7#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CUBICHERMITEBASIS_HH │ │ │ │ +8 │ │ │ │ +9#include │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ +12#include │ │ │ │ +13#include │ │ │ │ 14 │ │ │ │ -15namespace _D_u_n_e { │ │ │ │ -16namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -17 │ │ │ │ -23template │ │ │ │ -_2_4struct _I_s_C_a_l_l_a_b_l_e; │ │ │ │ +15#include │ │ │ │ +16#include │ │ │ │ +17#include │ │ │ │ +18#include │ │ │ │ +19 │ │ │ │ +20#include │ │ │ │ +21 │ │ │ │ +22#include │ │ │ │ +23#include │ │ │ │ +24#include │ │ │ │ 25 │ │ │ │ -26#ifndef DOXYGEN │ │ │ │ -27template │ │ │ │ -28struct _I_s_C_a_l_l_a_b_l_e │ │ │ │ -29{ │ │ │ │ -30 struct yes { std::size_t dummy[2]; }; │ │ │ │ -31 struct no { std::size_t dummy[1]; }; │ │ │ │ -32 │ │ │ │ -33 template │ │ │ │ -34 static yes test(const decltype(&C::operator()) *); │ │ │ │ -35 template │ │ │ │ -36 static no test(...); │ │ │ │ +26#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_m_a_p_p_e_r_u_t_i_l_i_t_i_e_s_._h_h> │ │ │ │ +27#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_s_q_u_e_e_z_e_t_e_n_s_o_r_._h_h> │ │ │ │ +28#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ +29#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_f_u_n_c_t_i_o_n_a_l_d_e_s_c_r_i_p_t_o_r_._h_h> │ │ │ │ +30#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h> │ │ │ │ +31#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ +32#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_t_r_a_n_s_f_o_r_m_e_d_f_i_n_i_t_e_e_l_e_m_e_n_t_m_i_x_i_n_._h_h> │ │ │ │ +33 │ │ │ │ +34 │ │ │ │ +35 │ │ │ │ +36#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_a_n_a_l_y_t_i_c_f_u_n_c_t_i_o_n_s_/_m_o_n_o_m_i_a_l_s_e_t_._h_h> │ │ │ │ 37 │ │ │ │ -38 enum { value = (sizeof(test(0)) == sizeof(yes)) }; │ │ │ │ -39}; │ │ │ │ -40 │ │ │ │ -41template │ │ │ │ -42struct _I_s_C_a_l_l_a_b_l_e │ │ │ │ -43{ │ │ │ │ -44 enum { value = true }; │ │ │ │ -45}; │ │ │ │ -46 │ │ │ │ -47template │ │ │ │ -48struct _I_s_C_a_l_l_a_b_l_e │ │ │ │ -49{ │ │ │ │ -50 enum { value = true }; │ │ │ │ -51}; │ │ │ │ -52#endif │ │ │ │ -53 │ │ │ │ -59template::value > │ │ │ │ -_6_0struct _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s {}; │ │ │ │ -61 │ │ │ │ -62#ifndef DOXYGEN │ │ │ │ -64template │ │ │ │ -65struct _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s │ │ │ │ -66 : public _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s │ │ │ │ -67{}; │ │ │ │ -68 │ │ │ │ -70template │ │ │ │ -71struct SignatureTraits │ │ │ │ -72 : public SignatureTraits │ │ │ │ -73{}; │ │ │ │ -74 │ │ │ │ -76template │ │ │ │ -77struct SignatureTraits │ │ │ │ -78 : public SignatureTraits │ │ │ │ -79{}; │ │ │ │ +53namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ +54{ │ │ │ │ +55 │ │ │ │ +56 template │ │ │ │ +57 class _C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s; │ │ │ │ +58 │ │ │ │ +78 template │ │ │ │ +_7_9 using _C_u_b_i_c_H_e_r_m_i_t_e_B_a_s_i_s = _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s_<_G_V_,_ _R_, │ │ │ │ +_r_e_d_u_c_e_d_> >; │ │ │ │ 80 │ │ │ │ -82template │ │ │ │ -83struct _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s │ │ │ │ -84 : public _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s │ │ │ │ -85{}; │ │ │ │ -86 │ │ │ │ -88template │ │ │ │ -89struct _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s │ │ │ │ -90{ │ │ │ │ -91 using Range = R; │ │ │ │ -92 using Domain = D; │ │ │ │ -93 │ │ │ │ -94 using RawRange = std::decay_t; │ │ │ │ -95 using RawDomain = std::decay_t; │ │ │ │ -96 │ │ │ │ -97 using RawSignature = RawRange(RawDomain); │ │ │ │ -98 │ │ │ │ -99 template class DerivativeTraits=DefaultDerivativeTraits> │ │ │ │ -100 using DerivativeSignature = typename DerivativeTraits::Range │ │ │ │ -(Domain); │ │ │ │ -101}; │ │ │ │ -102#endif │ │ │ │ -103 │ │ │ │ -104 │ │ │ │ -105template class │ │ │ │ -DerivativeTraits=_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s> │ │ │ │ -_1_0_6struct _S_i_g_n_a_t_u_r_e_T_a_g; │ │ │ │ -107 │ │ │ │ -117template class DerivativeTraitsT> │ │ │ │ -_1_1_8struct _S_i_g_n_a_t_u_r_e_T_a_g │ │ │ │ -119{ │ │ │ │ -_1_2_0 using _S_i_g_n_a_t_u_r_e = Range(Domain); │ │ │ │ +81 template │ │ │ │ +_8_2 struct _H_2_L_o_c_a_l_B_a_s_i_s_T_r_a_i_t_s │ │ │ │ +83 : public LocalBasisTraits │ │ │ │ +84 { │ │ │ │ +_9_0 using _H_e_s_s_i_a_n_T_y_p_e = H; │ │ │ │ +91 }; │ │ │ │ +92 │ │ │ │ +93 namespace Impl │ │ │ │ +94 { │ │ │ │ +95 │ │ │ │ +96 / │ │ │ │ +/ ***************************************************************************** │ │ │ │ +97 // * Some helper functions for building polynomial bases from monomials │ │ │ │ +98 / │ │ │ │ +/ ***************************************************************************** │ │ │ │ +99 │ │ │ │ +109 template │ │ │ │ +110 void multiplyWithCoefficentMatrix(Dune::FieldMatrix const& coefficients, │ │ │ │ +111 In const& monomialValues, │ │ │ │ +112 Out& polynomialValues) │ │ │ │ +113 { │ │ │ │ +114 for (int i = 0; i < sizePolynom; ++i) │ │ │ │ +115 { │ │ │ │ +116 squeezeTensor(polynomialValues[i]) = 0; │ │ │ │ +117 for (int j = 0; j < sizeMonom; ++j) │ │ │ │ +118 squeezeTensor(polynomialValues[i]) += coefficients[i][j]*monomialValues[j]; │ │ │ │ +119 } │ │ │ │ +120 } │ │ │ │ 121 │ │ │ │ -122 template │ │ │ │ -_1_2_3 using _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s = DerivativeTraitsT; │ │ │ │ -124}; │ │ │ │ -125 │ │ │ │ -126 │ │ │ │ -127 │ │ │ │ -136template class DerivativeTraits> │ │ │ │ -_1_3_7auto _d_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e_T_a_g(_S_i_g_n_a_t_u_r_e_T_a_g │ │ │ │ -tag) │ │ │ │ -138{ │ │ │ │ -139 using DerivativeRange = typename DerivativeTraits::Range; │ │ │ │ -140 return _S_i_g_n_a_t_u_r_e_T_a_g_<_D_e_r_i_v_a_t_i_v_e_R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_>(); │ │ │ │ -141} │ │ │ │ -142 │ │ │ │ -143 │ │ │ │ -144 │ │ │ │ -158template class │ │ │ │ -DerivativeTraits> │ │ │ │ -_1_5_9auto _d_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e_T_a_g_s(_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_g_n_a_t_u_r_e_T_a_g_<_S_i_g_n_a_t_u_r_e_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_> tag) │ │ │ │ -160{ │ │ │ │ -161 if constexpr (maxOrder==0) { │ │ │ │ -162 // If maxOrder== 0 we just need the given SignatureTag │ │ │ │ -163 return std::make_tuple(tag); │ │ │ │ -164 } else { │ │ │ │ -165 // else we first construct the tail tuple with SignatureTags for │ │ │ │ -derivatives │ │ │ │ -166 // of order 1 to maxOrder │ │ │ │ -167 auto tailTagsTuple = _d_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e_T_a_g_s │ │ │ │ -(_d_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e_T_a_g(tag)); │ │ │ │ -168 // and prepend this with the given SignatureTag. │ │ │ │ -169 // This is done by unpacking the tail tuple with apply(). │ │ │ │ -170 return std::apply([&](auto&&... tailTags){ │ │ │ │ -171 return std::make_tuple(tag, tailTags...); │ │ │ │ -172 }, tailTagsTuple); │ │ │ │ -173 } │ │ │ │ -174} │ │ │ │ -175 │ │ │ │ -176 │ │ │ │ +127 template │ │ │ │ +128 class CubicHermiteLocalCoefficients │ │ │ │ +129 { │ │ │ │ +130 public: │ │ │ │ +131 using size_type = std::size_t; │ │ │ │ +132 │ │ │ │ +133 CubicHermiteLocalCoefficients() │ │ │ │ +134 : localKeys_(size()) │ │ │ │ +135 { │ │ │ │ +136 static_assert((dim > 0) and (dim <= 3), "CubicHermiteLocalCoefficients only │ │ │ │ +implemented for dim=1,2,3"); │ │ │ │ +137 static_assert((not reduced) or (dim == 2), "Reduced version of │ │ │ │ +CubicHermiteLocalCoefficients only implemented for dim=2"); │ │ │ │ +138 for (size_type i = 0; i < (dim +1); ++i) │ │ │ │ +139 { │ │ │ │ +140 // dim derivatives + 1 evaluation dofs per vertex │ │ │ │ +141 for (size_type k = 0; k < (dim +1); ++k) │ │ │ │ +142 localKeys_[(dim +1) * i + k] = LocalKey(i, dim, k); │ │ │ │ +143 } │ │ │ │ +144 if constexpr (not reduced) │ │ │ │ +145 { │ │ │ │ +146 // 1 evaluation per element (2d) / facets (3d) │ │ │ │ +147 for (size_type i = 0; i < (dim - 1) * (dim - 1); ++i) │ │ │ │ +148 localKeys_[(dim +1) * (dim +1) + i] = LocalKey(i, (dim == 2) ? 0 : 1, 0); / │ │ │ │ +/ inner dofs │ │ │ │ +149 } │ │ │ │ +150 } │ │ │ │ +151 │ │ │ │ +154 static constexpr size_type size() │ │ │ │ +155 { │ │ │ │ +156 if constexpr (dim==1) │ │ │ │ +157 return 4; │ │ │ │ +158 if constexpr ((dim==2) and (reduced)) │ │ │ │ +159 return 9; │ │ │ │ +160 if constexpr ((dim==2) and (not reduced)) │ │ │ │ +161 return 10; │ │ │ │ +162 if constexpr (dim==3) │ │ │ │ +163 return 20; │ │ │ │ +164 return 0; │ │ │ │ +165 } │ │ │ │ +166 │ │ │ │ +169 LocalKey const &localKey(size_type i) const │ │ │ │ +170 { │ │ │ │ +171 return localKeys_[i]; │ │ │ │ +172 } │ │ │ │ +173 │ │ │ │ +174 private: │ │ │ │ +175 std::vector localKeys_; │ │ │ │ +176 }; │ │ │ │ 177 │ │ │ │ -178} // namespace Functions │ │ │ │ -179} // namespace Dune │ │ │ │ -180 │ │ │ │ -181#endif // DUNE_FUNCTIONS_COMMON_SIGNATURE_HH │ │ │ │ -_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_d_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e_T_a_g │ │ │ │ -auto derivativeSignatureTag(SignatureTag< Range(Domain), DerivativeTraits > │ │ │ │ -tag) │ │ │ │ -Construct SignatureTag for derivative. │ │ │ │ -DDeeffiinniittiioonn signature.hh:137 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_d_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e_T_a_g_s │ │ │ │ -auto derivativeSignatureTags(Dune::Functions::SignatureTag< Signature, │ │ │ │ -DerivativeTraits > tag) │ │ │ │ -Construct SignatureTags for derivatives. │ │ │ │ -DDeeffiinniittiioonn signature.hh:159 │ │ │ │ -_D_u_n_e │ │ │ │ -DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ +178 │ │ │ │ +184 template │ │ │ │ +185 class CubicHermiteReferenceLocalBasis │ │ │ │ +186 { │ │ │ │ +187 public: │ │ │ │ +188 using Traits = H2LocalBasisTraits, R, 1, │ │ │ │ +FieldVector, │ │ │ │ +189 FieldMatrix, FieldMatrix>; │ │ │ │ +190 │ │ │ │ +191 private: │ │ │ │ +192 │ │ │ │ +205 static constexpr auto getCubicHermiteCoefficients() │ │ │ │ +206 { │ │ │ │ +207 if constexpr (dim == 1) │ │ │ │ +208 return Dune::FieldMatrix({{1, 0, -3, 2}, {0, 1, -2, 1}, {0, 0, 3, │ │ │ │ +-2}, {0, 0, -1, 1}}); │ │ │ │ +209 else if constexpr (dim == 2) │ │ │ │ +210 { │ │ │ │ +211 if constexpr (reduced) { │ │ │ │ +212 auto w = std::array{1. / 3, 1. / 18, 1. / 18, 1. / 3, -1. / 9, │ │ │ │ +213 1. / 18, 1. / 3, 1. / 18, -1. / 9}; │ │ │ │ +214 return Dune::FieldMatrix({ │ │ │ │ +215 {1, 0, 0, -3, -13 + w[0] * 27, -3, 2, 13 - w[0] * 27, 13 - w[0] * 27, 2}, │ │ │ │ +216 {0, 1, 0, -2, -3 + w[1] * 27, 0, 1, 3 - w[1] * 27, 2 - w[1] * 27, 0}, │ │ │ │ +217 {0, 0, 1, 0, -3 + w[2] * 27, -2, 0, 2 - w[2] * 27, 3 - w[2] * 27, 1}, │ │ │ │ +218 {0, 0, 0, 3, -7 + w[3] * 27, 0, -2, 7 - w[3] * 27, 7 - w[3] * 27, 0}, │ │ │ │ +219 {0, 0, 0, -1, 2 + w[4] * 27, 0, 1, -2 - w[4] * 27, -2 - w[4] * 27, 0}, │ │ │ │ +220 {0, 0, 0, 0, -1 + w[5] * 27, 0, 0, 2 - w[5] * 27, 1 - w[5] * 27, 0}, │ │ │ │ +221 {0, 0, 0, 0, -7 + w[6] * 27, 3, 0, 7 - w[6] * 27, 7 - w[6] * 27, -2}, │ │ │ │ +222 {0, 0, 0, 0, -1 + w[7] * 27, 0, 0, 1 - w[7] * 27, 2 - w[7] * 27, 0}, │ │ │ │ +223 {0, 0, 0, 0, 2 + w[8] * 27, -1, 0, -2 - w[8] * 27, -2 - w[8] * 27, 1}, │ │ │ │ +224 }); │ │ │ │ +225 } │ │ │ │ +226 else │ │ │ │ +227 return Dune::FieldMatrix({ │ │ │ │ +228 {1, 0, 0, -3, -13, -3, 2, 13, 13, 2}, │ │ │ │ +229 {0, 1, 0, -2, -3, 0, 1, 3, 2, 0}, │ │ │ │ +230 {0, 0, 1, 0, -3, -2, 0, 2, 3, 1}, // l_2 │ │ │ │ +231 {0, 0, 0, 3, -7, 0, -2, 7, 7, 0}, │ │ │ │ +232 {0, 0, 0, -1, 2, 0, 1, -2, -2, 0}, │ │ │ │ +233 {0, 0, 0, 0, -1, 0, 0, 2, 1, 0}, │ │ │ │ +234 {0, 0, 0, 0, -7, 3, 0, 7, 7, -2}, // l_6 │ │ │ │ +235 {0, 0, 0, 0, -1, 0, 0, 1, 2, 0}, │ │ │ │ +236 {0, 0, 0, 0, 2, -1, 0, -2, -2, 1}, │ │ │ │ +237 {0, 0, 0, 0, 27, 0, 0, -27, -27, 0}}); // l_9, inner dof │ │ │ │ +238 } │ │ │ │ +239 else if constexpr (dim == 3) │ │ │ │ +240 { │ │ │ │ +241 return Dune::FieldMatrix({{1, 0, 0, 0, -3, -13, -3, -13, -13, -3, │ │ │ │ +// deg 0 to 2 │ │ │ │ +242 2, 13, 13, 2, 13, 33, 13, 13, 13, 2}, // deg 3 │ │ │ │ +243 {0, 1, 0, 0,/*xx*/ -2, /*xy*/-3,/*yy*/ 0,/*xz*/ -3,/*yz*/ 0,/*zz*/ 0, 1, 3, │ │ │ │ +2, 0, 3, 4, 0, 2, 0, 0}, │ │ │ │ +244 {0, 0, 1, 0, 0, -3, -2, 0, -3, 0, 0, 2, 3, 1, 0, 4, 3, 0, 2, 0}, │ │ │ │ +245 {0, 0, 0, 1, 0, 0, 0, -3, -3, -2, 0, 0, 0, 0, 2, 4, 2, 3, 3, 1}, │ │ │ │ +246 {0, 0, 0, 0, 3, -7, 0, -7, 0, 0, // l_4 │ │ │ │ +247 -2, 7, 7, 0, 7, 7, 0, 7, 0, 0}, │ │ │ │ +248 {0, 0, 0, 0, -1, 2, 0, 2, 0, 0, 1, -2, -2, 0, -2, -2, 0, -2, 0, 0}, │ │ │ │ +249 {0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0}, │ │ │ │ +250 {0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 1, 0, 0}, │ │ │ │ +251 {0, 0, 0, 0, 0, -7, 3, 0, -7, 0, // l_8 │ │ │ │ +252 0, 7, 7, -2, 0, 7, 7, 0, 7, 0}, │ │ │ │ +253 {0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0}, │ │ │ │ +254 {0, 0, 0, 0, 0, 2, -1, 0, 2, 0, 0, -2, -2, 1, 0, -2, -2, 0, -2, 0}, │ │ │ │ +255 {0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0}, │ │ │ │ +256 {0, 0, 0, 0, 0, 0, 0, -7, -7, 3, // l_12 │ │ │ │ +257 0, 0, 0, 0, 7, 7, 7, 7, 7, -2}, │ │ │ │ +258 {0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0}, │ │ │ │ +259 {0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0}, │ │ │ │ +260 {0, 0, 0, 0, 0, 0, 0, 2, 2, -1, 0, 0, 0, 0, -2, -2, -2, -2, -2, 1}, │ │ │ │ +261 // l_16, from here on inner dofs │ │ │ │ +262 {0, 0, 0, 0, 0, 27, 0, 0, 0, 0, // bottom │ │ │ │ +263 0, -27, -27, 0, 0, -27, 0, 0, 0, 0}, │ │ │ │ +264 {0, 0, 0, 0, 0, 0, 0, 27, 0, 0, // front │ │ │ │ +265 0, 0, 0, 0, -27, -27, 0, -27, 0, 0}, │ │ │ │ +266 {0, 0, 0, 0, 0, 0, 0, 0, 27, 0, // left │ │ │ │ +267 0, 0, 0, 0, 0, -27, -27, 0, -27, 0}, │ │ │ │ +268 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // right │ │ │ │ +269 0, 0, 0, 0, 0, 27, 0, 0, 0, 0}}); │ │ │ │ +270 } │ │ │ │ +271 } │ │ │ │ +272 │ │ │ │ +273 static constexpr auto referenceBasisCoefficients = │ │ │ │ +getCubicHermiteCoefficients(); │ │ │ │ +274 static constexpr MonomialSet │ │ │ │ +monomials = {}; │ │ │ │ +275 │ │ │ │ +276 public: │ │ │ │ +277 │ │ │ │ +278 CubicHermiteReferenceLocalBasis() │ │ │ │ +279 { │ │ │ │ +280 static_assert((dim > 0) and (dim <= 3), "CubicHermiteReferenceLocalBasis │ │ │ │ +only implemented for dim=1,2,3"); │ │ │ │ +281 static_assert((not reduced) or (dim == 2), "Reduced version of │ │ │ │ +CubicHermiteReferenceLocalBasis only implemented for dim=2"); │ │ │ │ +282 } │ │ │ │ +283 │ │ │ │ +286 static constexpr unsigned int size() │ │ │ │ +287 { │ │ │ │ +288 return CubicHermiteLocalCoefficients::size(); │ │ │ │ +289 } │ │ │ │ +290 │ │ │ │ +293 unsigned int order() const │ │ │ │ +294 { │ │ │ │ +295 return 3; │ │ │ │ +296 } │ │ │ │ +297 │ │ │ │ +303 void evaluateFunction(const typename Traits::DomainType &in, │ │ │ │ +304 std::vector &out) const │ │ │ │ +305 { │ │ │ │ +306 out.resize(size()); │ │ │ │ +307 auto monomialValues = monomials(in); │ │ │ │ +308 multiplyWithCoefficentMatrix(referenceBasisCoefficients, monomialValues, │ │ │ │ +out); │ │ │ │ +309 } │ │ │ │ +310 │ │ │ │ +316 void evaluateJacobian(const typename Traits::DomainType &in, │ │ │ │ +317 std::vector &out) const │ │ │ │ +318 { │ │ │ │ +319 out.resize(size()); │ │ │ │ +320 auto monomialValues = _d_e_r_i_v_a_t_i_v_e(monomials)(in); │ │ │ │ +321 multiplyWithCoefficentMatrix(referenceBasisCoefficients, monomialValues, │ │ │ │ +out); │ │ │ │ +322 } │ │ │ │ +323 │ │ │ │ +329 void evaluateHessian(const typename Traits::DomainType &in, │ │ │ │ +330 std::vector &out) const │ │ │ │ +331 { │ │ │ │ +332 out.resize(size()); │ │ │ │ +333 auto monomialValues = _d_e_r_i_v_a_t_i_v_e(_d_e_r_i_v_a_t_i_v_e(monomials))(in); │ │ │ │ +334 multiplyWithCoefficentMatrix(referenceBasisCoefficients, monomialValues, │ │ │ │ +out); │ │ │ │ +335 } │ │ │ │ +336 │ │ │ │ +343 void partial(std::array order, const typename Traits:: │ │ │ │ +DomainType &in, │ │ │ │ +344 std::vector &out) const │ │ │ │ +345 { │ │ │ │ +346 out.resize(size()); │ │ │ │ +347 auto totalOrder = std::accumulate(order.begin(), order.end(), 0); │ │ │ │ +348 if (totalOrder == 0) │ │ │ │ +349 evaluateFunction(in, out); │ │ │ │ +350 else if (totalOrder == 1) │ │ │ │ +351 { │ │ │ │ +352 evaluateJacobian(in,jacobiansBuffer_); │ │ │ │ +353 std::size_t which = std::max_element(order.begin(), order.end()) - │ │ │ │ +order.begin(); │ │ │ │ +354 for (auto i : Dune::range(size())) │ │ │ │ +355 out[i] = jacobiansBuffer_[i][0][which]; │ │ │ │ +356 } │ │ │ │ +357 else if (totalOrder == 2) │ │ │ │ +358 { │ │ │ │ +359 evaluateHessian(in, hessianBuffer_); │ │ │ │ +360 std::size_t first, second; │ │ │ │ +361 first = std::max_element(order.begin(), order.end()) - order.begin(); │ │ │ │ +362 if (order[first] == 2) │ │ │ │ +363 second = first; │ │ │ │ +364 else │ │ │ │ +365 { │ │ │ │ +366 order[first] = 0; │ │ │ │ +367 second = std::max_element(order.begin(), order.end()) - order.begin(); │ │ │ │ +368 } │ │ │ │ +369 for (auto i : Dune::range(size())) │ │ │ │ +370 out[i] = hessianBuffer_[i][first][second]; │ │ │ │ +371 } │ │ │ │ +372 else │ │ │ │ +373 DUNE_THROW(RangeError, "partial() not implemented for given order"); │ │ │ │ +374 } │ │ │ │ +375 │ │ │ │ +376 private: │ │ │ │ +377 mutable std::vector jacobiansBuffer_; │ │ │ │ +378 mutable std::vector hessianBuffer_; │ │ │ │ +379 }; │ │ │ │ +380 │ │ │ │ +381 │ │ │ │ +387 template │ │ │ │ +388 class CubicHermiteLocalInterpolation │ │ │ │ +389 { │ │ │ │ +390 using size_type = std::size_t; │ │ │ │ +391 │ │ │ │ +392 static constexpr unsigned int size() │ │ │ │ +393 { │ │ │ │ +394 return CubicHermiteLocalCoefficients::size(); │ │ │ │ +395 } │ │ │ │ +396 │ │ │ │ +397 using FunctionalDescriptor = Dune::Functions::Impl:: │ │ │ │ +FunctionalDescriptor; │ │ │ │ +398 │ │ │ │ +399 public: │ │ │ │ +400 │ │ │ │ +401 CubicHermiteLocalInterpolation() │ │ │ │ +402 { │ │ │ │ +403 static_assert((dim > 0) and (dim <= 3), "CubicHermiteLocalInterpolation │ │ │ │ +only implemented for dim=1,2,3"); │ │ │ │ +404 static_assert((not reduced) or (dim == 2), "Reduced version of │ │ │ │ +CubicHermiteLocalInterpolation only implemented for dim=2"); │ │ │ │ +405 if constexpr (dim==1) │ │ │ │ +406 { │ │ │ │ +407 descriptors_[0] = FunctionalDescriptor(); │ │ │ │ +408 descriptors_[1] = FunctionalDescriptor({1}); │ │ │ │ +409 descriptors_[2] = FunctionalDescriptor(); │ │ │ │ +410 descriptors_[3] = FunctionalDescriptor({1}); │ │ │ │ +411 } │ │ │ │ +412 if constexpr (dim==2) │ │ │ │ +413 { │ │ │ │ +414 descriptors_[0] = FunctionalDescriptor(); │ │ │ │ +415 descriptors_[1] = FunctionalDescriptor({1,0}); │ │ │ │ +416 descriptors_[2] = FunctionalDescriptor({0,1}); │ │ │ │ +417 descriptors_[3] = FunctionalDescriptor(); │ │ │ │ +418 descriptors_[4] = FunctionalDescriptor({1,0}); │ │ │ │ +419 descriptors_[5] = FunctionalDescriptor({0,1}); │ │ │ │ +420 descriptors_[6] = FunctionalDescriptor(); │ │ │ │ +421 descriptors_[7] = FunctionalDescriptor({1,0}); │ │ │ │ +422 descriptors_[8] = FunctionalDescriptor({0,1}); │ │ │ │ +423 if (not reduced) │ │ │ │ +424 descriptors_[9] = FunctionalDescriptor(); │ │ │ │ +425 } │ │ │ │ +426 if constexpr (dim==3) │ │ │ │ +427 { │ │ │ │ +428 descriptors_[0] = FunctionalDescriptor(); │ │ │ │ +429 descriptors_[1] = FunctionalDescriptor({1,0,0}); │ │ │ │ +430 descriptors_[2] = FunctionalDescriptor({0,1,0}); │ │ │ │ +431 descriptors_[3] = FunctionalDescriptor({0,0,1}); │ │ │ │ +432 descriptors_[4] = FunctionalDescriptor(); │ │ │ │ +433 descriptors_[5] = FunctionalDescriptor({1,0,0}); │ │ │ │ +434 descriptors_[6] = FunctionalDescriptor({0,1,0}); │ │ │ │ +435 descriptors_[7] = FunctionalDescriptor({0,0,1}); │ │ │ │ +436 descriptors_[8] = FunctionalDescriptor(); │ │ │ │ +437 descriptors_[9] = FunctionalDescriptor({1,0,0}); │ │ │ │ +438 descriptors_[10] = FunctionalDescriptor({0,1,0}); │ │ │ │ +439 descriptors_[11] = FunctionalDescriptor({0,0,1}); │ │ │ │ +440 descriptors_[12] = FunctionalDescriptor(); │ │ │ │ +441 descriptors_[13] = FunctionalDescriptor({1,0,0}); │ │ │ │ +442 descriptors_[14] = FunctionalDescriptor({0,1,0}); │ │ │ │ +443 descriptors_[15] = FunctionalDescriptor({0,0,1}); │ │ │ │ +444 descriptors_[16] = FunctionalDescriptor(); │ │ │ │ +445 descriptors_[17] = FunctionalDescriptor(); │ │ │ │ +446 descriptors_[18] = FunctionalDescriptor(); │ │ │ │ +447 descriptors_[19] = FunctionalDescriptor(); │ │ │ │ +448 } │ │ │ │ +449 } │ │ │ │ +450 │ │ │ │ +453 template │ │ │ │ +454 void bind( Element const &element, std::arrayconst& │ │ │ │ +averageVertexMeshSize) │ │ │ │ +455 { │ │ │ │ +456 averageVertexMeshSize_ = &averageVertexMeshSize; │ │ │ │ +457 } │ │ │ │ +458 │ │ │ │ +466 template │ │ │ │ +467 void interpolate(const F &f, std::vector &out) const │ │ │ │ +468 { │ │ │ │ +469 out.resize(size()); │ │ │ │ +470 auto df = _d_e_r_i_v_a_t_i_v_e(f); │ │ │ │ +471 auto const &refElement = Dune::ReferenceElements::simplex(); │ │ │ │ +472 │ │ │ │ +473 // Iterate over vertices, dim derivative +1 evaluation dofs per vertex │ │ │ │ +474 for (int i = 0; i < (dim+1); ++i) │ │ │ │ +475 { │ │ │ │ +476 auto x = refElement.position(i, dim); │ │ │ │ +477 auto&& derivativeValue = df(x); │ │ │ │ +478 out[i * (dim +1)] = f(x); │ │ │ │ +479 for (int d = 0; d < dim; ++d) │ │ │ │ +480 out[i * (dim+1) + d + 1] = squeezeTensor(derivativeValue)[d] * │ │ │ │ +(*averageVertexMeshSize_)[i]; │ │ │ │ +481 } │ │ │ │ +482 │ │ │ │ +483 if constexpr (not reduced) │ │ │ │ +484 { │ │ │ │ +485 for (size_type i = 0; i < (dim - 1) * (dim - 1); ++i) │ │ │ │ +486 out[(dim +1) * (dim +1) + i] = f(refElement.position(i, (dim == 2) ? 0 : │ │ │ │ +1)); │ │ │ │ +487 } │ │ │ │ +488 } │ │ │ │ +489 │ │ │ │ +493 const FunctionalDescriptor& functionalDescriptor(size_type i) const │ │ │ │ +494 { │ │ │ │ +495 return descriptors_[i]; │ │ │ │ +496 } │ │ │ │ +497 │ │ │ │ +498 protected: │ │ │ │ +499 std::array const* averageVertexMeshSize_; │ │ │ │ +500 std::array descriptors_; │ │ │ │ +501 }; │ │ │ │ +502 │ │ │ │ +503 template │ │ │ │ +504 struct CubicHermiteLocalBasisTraits │ │ │ │ +505 : public H2LocalBasisTraits, R, 1, │ │ │ │ +506 Dune::FieldVector, Dune::FieldMatrix, Dune:: │ │ │ │ +FieldMatrix> │ │ │ │ +507 {}; │ │ │ │ +508 │ │ │ │ +517 template │ │ │ │ +518 class CubicHermiteLocalFiniteElement │ │ │ │ +519 : public Impl:: │ │ │ │ +TransformedFiniteElementMixin, │ │ │ │ +CubicHermiteLocalBasisTraits> │ │ │ │ +520 { │ │ │ │ +521 using Base = Impl::TransformedFiniteElementMixin< │ │ │ │ +CubicHermiteLocalFiniteElement, │ │ │ │ +CubicHermiteLocalBasisTraits>; │ │ │ │ +522 friend class Impl:: │ │ │ │ +TransformedLocalBasis, │ │ │ │ +CubicHermiteLocalBasisTraits>; │ │ │ │ +523 │ │ │ │ +524 public: │ │ │ │ +525 │ │ │ │ +526 CubicHermiteLocalFiniteElement() │ │ │ │ +527 : Base() │ │ │ │ +528 { │ │ │ │ +529 static_assert((dim > 0) and (dim <= 3), "CubicHermiteLocalFiniteElement │ │ │ │ +only implemented for dim=1,2,3"); │ │ │ │ +530 static_assert((not reduced) or (dim == 2), "Reduced version of │ │ │ │ +CubicHermiteLocalFiniteElement only implemented for dim=2"); │ │ │ │ +531 } │ │ │ │ +532 │ │ │ │ +535 using size_type = std::size_t; │ │ │ │ +536 using Traits = LocalFiniteElementTraits< │ │ │ │ +537 Impl:: │ │ │ │ +TransformedLocalBasis, │ │ │ │ +CubicHermiteLocalBasisTraits>, │ │ │ │ +538 Impl::CubicHermiteLocalCoefficients, │ │ │ │ +539 Impl::CubicHermiteLocalInterpolation>; │ │ │ │ +540 │ │ │ │ +544 const typename Traits::LocalCoefficientsType &localCoefficients() const │ │ │ │ +545 { │ │ │ │ +546 return coefficients_; │ │ │ │ +547 } │ │ │ │ +548 │ │ │ │ +551 const typename Traits::LocalInterpolationType &localInterpolation() const │ │ │ │ +552 { │ │ │ │ +553 return interpolation_; │ │ │ │ +554 } │ │ │ │ +555 │ │ │ │ +558 static constexpr GeometryType type() │ │ │ │ +559 { │ │ │ │ +560 return GeometryTypes::simplex(dim); │ │ │ │ +561 } │ │ │ │ +562 │ │ │ │ +565 static constexpr size_type size() │ │ │ │ +566 { │ │ │ │ +567 return Impl::CubicHermiteLocalCoefficients::size(); │ │ │ │ +568 } │ │ │ │ +569 │ │ │ │ +572 template │ │ │ │ +573 void bind(Mapper const& vertexMapper, std::vector const& │ │ │ │ +globalAverageVertexMeshSize, Element const &e) │ │ │ │ +574 { │ │ │ │ +575 // Cache average mesh size for each vertex │ │ │ │ +576 for (auto i : range(dim+1)) │ │ │ │ +577 averageVertexMeshSize_[i] = globalAverageVertexMeshSize │ │ │ │ +[vertexMapper.subIndex(e, i, dim)]; │ │ │ │ +578 │ │ │ │ +579 // Bind LocalInterpolation to updated local state │ │ │ │ +580 interpolation_.bind(e, averageVertexMeshSize_); │ │ │ │ +581 │ │ │ │ +582 // Compute local transformation matrices for each vertex │ │ │ │ +583 const auto& geometry = e.geometry(); │ │ │ │ +584 const auto& refElement = Dune::ReferenceElements::simplex(); │ │ │ │ +585 for (auto i : range(dim+1)) │ │ │ │ +586 { │ │ │ │ +587 scaledVertexJacobians_[i] = geometry.jacobian(refElement.position(i, dim)); │ │ │ │ +588 scaledVertexJacobians_[i] /= averageVertexMeshSize_[i]; │ │ │ │ +589 } │ │ │ │ +590 } │ │ │ │ +591 │ │ │ │ +592 protected: │ │ │ │ +593 │ │ │ │ +596 Impl::CubicHermiteReferenceLocalBasis const& │ │ │ │ +referenceLocalBasis() const │ │ │ │ +597 { │ │ │ │ +598 return basis_; │ │ │ │ +599 } │ │ │ │ +600 │ │ │ │ +605 template │ │ │ │ +606 void transform(InputValues const &inValues, OutputValues &outValues) const │ │ │ │ +607 { │ │ │ │ +608 assert(inValues.size() == size()); │ │ │ │ +609 assert(outValues.size() == inValues.size()); │ │ │ │ +610 auto inIt = inValues.begin(); │ │ │ │ +611 auto outIt = outValues.begin(); │ │ │ │ +612 │ │ │ │ +613 for (auto vertex : Dune::range((dim +1))) │ │ │ │ +614 { │ │ │ │ +615 *outIt = *inIt; // value dof is not transformed │ │ │ │ +616 outIt++, inIt++; │ │ │ │ +617 // transform the gradient dofs together │ │ │ │ +618 for (auto &&[row_i, i] : sparseRange(scaledVertexJacobians_[vertex])) │ │ │ │ +619 { │ │ │ │ +620 outIt[i] = 0.; │ │ │ │ +621 for (auto &&[val_i_j, j] : sparseRange(row_i)) │ │ │ │ +622 outIt[i] += val_i_j * inIt[j]; │ │ │ │ +623 } │ │ │ │ +624 // increase pointer by size of gradient = dim │ │ │ │ +625 outIt += dim, inIt += dim; │ │ │ │ +626 } │ │ │ │ +627 │ │ │ │ +628 // For the non-reduced case: Copy all remaining inner dofs │ │ │ │ +629 if constexpr (dim > 1 and (not reduced)) │ │ │ │ +630 std::copy(inIt, inValues.end(), outIt); │ │ │ │ +631 } │ │ │ │ +632 │ │ │ │ +633 private: │ │ │ │ +634 │ │ │ │ +635 typename Impl::CubicHermiteReferenceLocalBasis basis_; │ │ │ │ +636 typename Traits::LocalCoefficientsType coefficients_; │ │ │ │ +637 typename Traits::LocalInterpolationType interpolation_; │ │ │ │ +638 // the transformation to correct the lack of affine equivalence boils down │ │ │ │ +to │ │ │ │ +639 // one transformation matrix per vertex │ │ │ │ +640 std::array, dim+1> scaledVertexJacobians_; │ │ │ │ +641 // the local state, i.e. a collection of global information restricted to │ │ │ │ +this element │ │ │ │ +642 std::array averageVertexMeshSize_; │ │ │ │ +643 │ │ │ │ +644 }; │ │ │ │ +645 │ │ │ │ +646 } // end namespace Impl │ │ │ │ +647 │ │ │ │ +648 │ │ │ │ +649 │ │ │ │ +650 / │ │ │ │ +/ ***************************************************************************** │ │ │ │ +651 // This is the reusable part of the basis. It contains │ │ │ │ +652 // │ │ │ │ +653 // CubicHermitePreBasis │ │ │ │ +654 // CubicHermiteNode │ │ │ │ +655 // │ │ │ │ +656 // The pre-basis allows to create the others and is the owner of possible │ │ │ │ +shared │ │ │ │ +657 // state. These components do _not_ depend on the global basis and local │ │ │ │ +view │ │ │ │ +658 // and can be used without a global basis. │ │ │ │ +659 / │ │ │ │ +/ ***************************************************************************** │ │ │ │ +660 │ │ │ │ +661 template │ │ │ │ +_6_6_2 class _C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e │ │ │ │ +663 : public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ +664 { │ │ │ │ +665 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper; │ │ │ │ +666 │ │ │ │ +667 public: │ │ │ │ +_6_6_8 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ +_6_6_9 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ +_6_7_0 using _F_i_n_i_t_e_E_l_e_m_e_n_t = typename Impl:: │ │ │ │ +CubicHermiteLocalFiniteElement; │ │ │ │ +671 │ │ │ │ +_6_7_2 _C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e(Mapper const& m, std::vector const& │ │ │ │ +averageVertexMeshSize) │ │ │ │ +673 : _e_l_e_m_e_n_t__(nullptr) │ │ │ │ +674 , _v_e_r_t_e_x_M_a_p_p_e_r__(&m) │ │ │ │ +675 , _a_v_e_r_a_g_e_V_e_r_t_e_x_M_e_s_h_S_i_z_e__(&averageVertexMeshSize) │ │ │ │ +676 {} │ │ │ │ +677 │ │ │ │ +_6_7_9 _E_l_e_m_e_n_t const &_e_l_e_m_e_n_t() const │ │ │ │ +680 { │ │ │ │ +681 return *_e_l_e_m_e_n_t__; │ │ │ │ +682 } │ │ │ │ +683 │ │ │ │ +_6_8_9 _F_i_n_i_t_e_E_l_e_m_e_n_t const &_f_i_n_i_t_e_E_l_e_m_e_n_t() const │ │ │ │ +690 { │ │ │ │ +691 return _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ +692 } │ │ │ │ +693 │ │ │ │ +_6_9_5 void _b_i_n_d(_E_l_e_m_e_n_t const &e) │ │ │ │ +696 { │ │ │ │ +697 _e_l_e_m_e_n_t__ = &e; │ │ │ │ +698 _f_i_n_i_t_e_E_l_e_m_e_n_t__.bind(*_v_e_r_t_e_x_M_a_p_p_e_r__, *_a_v_e_r_a_g_e_V_e_r_t_e_x_M_e_s_h_S_i_z_e__, *_e_l_e_m_e_n_t__); │ │ │ │ +699 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__.size()); │ │ │ │ +700 } │ │ │ │ +701 │ │ │ │ +_7_0_3 unsigned int _o_r_d_e_r() const { return _f_i_n_i_t_e_E_l_e_m_e_n_t__.localBasis().order(); } │ │ │ │ +704 │ │ │ │ +705 protected: │ │ │ │ +_7_0_6 _F_i_n_i_t_e_E_l_e_m_e_n_t _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ +_7_0_7 _E_l_e_m_e_n_t const* _e_l_e_m_e_n_t__; │ │ │ │ +_7_0_8 Mapper const* _v_e_r_t_e_x_M_a_p_p_e_r__; │ │ │ │ +_7_0_9 std::vector const* _a_v_e_r_a_g_e_V_e_r_t_e_x_M_e_s_h_S_i_z_e__; │ │ │ │ +710 }; │ │ │ │ +711 │ │ │ │ +712 │ │ │ │ +722 template │ │ │ │ +_7_2_3 class _C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s │ │ │ │ +724 : public _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n │ │ │ │ +725 { │ │ │ │ +726 using Base = _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_<_G_V_>; │ │ │ │ +727 using SubEntityMapper = Dune::MultipleCodimMultipleGeomTypeMapper; │ │ │ │ +728 using Element = typename GV::template Codim<0>::Entity; │ │ │ │ +729 using D = typename GV::ctype; │ │ │ │ +730 static const std::size_t dim = GV::dimension; │ │ │ │ +731 │ │ │ │ +732 // helper methods to assign each subentity the number of dofs. Used by the │ │ │ │ +LeafPreBasisMapperMixin. │ │ │ │ +733 static constexpr auto cubicHermiteMapperLayout(Dune::GeometryType type, int │ │ │ │ +gridDim) │ │ │ │ +734 { │ │ │ │ +735 if (type.isVertex()) │ │ │ │ +736 return 1 + gridDim; // one evaluation dof and gridDim derivative dofs per │ │ │ │ +vertex │ │ │ │ +737 if (gridDim == 1) // in 1d there are no other dofs │ │ │ │ +738 return 0; │ │ │ │ +739 // in 2d we have one inner dof (i.e. on the triangle) or non for the │ │ │ │ +reduced case │ │ │ │ +740 // and in 3d we have one dof on each face (i.e. on each triangle) │ │ │ │ +741 if ((type.isTriangle()) and (not reduced)) │ │ │ │ +742 return 1; │ │ │ │ +743 else │ │ │ │ +744 return 0; // this case is only entered for the interior of the 3d element. │ │ │ │ +There are no dofs. │ │ │ │ +745 } │ │ │ │ +746 │ │ │ │ +747 public: │ │ │ │ +_7_4_9 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ +750 │ │ │ │ +_7_5_2 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ +753 │ │ │ │ +_7_5_5 using _N_o_d_e = _C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e_<_G_r_i_d_V_i_e_w_,_ _R_,_r_e_d_u_c_e_d_>; │ │ │ │ +756 │ │ │ │ +757 public: │ │ │ │ +758 │ │ │ │ +_7_6_0 _C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s(const GV &gv) │ │ │ │ +761 : Base(gv, cubicHermiteMapperLayout) │ │ │ │ +762 , _v_e_r_t_e_x_M_a_p_p_e_r__({gv, mcmgVertexLayout()}) │ │ │ │ +763 { │ │ │ │ +764 static_assert((dim > 0) and (dim <= 3), "CubicHermitePreBasis only │ │ │ │ +implemented for dim=1,2,3"); │ │ │ │ +765 static_assert((not reduced) or (dim == 2), "Reduced version of │ │ │ │ +CubicHermitePreBasis only implemented for dim=2"); │ │ │ │ +766 _a_v_e_r_a_g_e_V_e_r_t_e_x_M_e_s_h_S_i_z_e__ = Impl::computeAverageSubEntityMeshSize │ │ │ │ +(_v_e_r_t_e_x_M_a_p_p_e_r__); │ │ │ │ +767 } │ │ │ │ +768 │ │ │ │ +_7_7_0 void _u_p_d_a_t_e(_G_r_i_d_V_i_e_w const &gv) │ │ │ │ +771 { │ │ │ │ +772 _B_a_s_e_:_:_u_p_d_a_t_e(gv); │ │ │ │ +773 _v_e_r_t_e_x_M_a_p_p_e_r__.update(this->_g_r_i_d_V_i_e_w()); │ │ │ │ +774 _a_v_e_r_a_g_e_V_e_r_t_e_x_M_e_s_h_S_i_z_e__ = Impl::computeAverageSubEntityMeshSize │ │ │ │ +(_v_e_r_t_e_x_M_a_p_p_e_r__); │ │ │ │ +775 } │ │ │ │ +776 │ │ │ │ +_7_8_0 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ +781 { │ │ │ │ +782 return _N_o_d_e{_v_e_r_t_e_x_M_a_p_p_e_r__, _a_v_e_r_a_g_e_V_e_r_t_e_x_M_e_s_h_S_i_z_e__}; │ │ │ │ +783 } │ │ │ │ +784 │ │ │ │ +785 protected: │ │ │ │ +786 │ │ │ │ +_7_8_7 SubEntityMapper _v_e_r_t_e_x_M_a_p_p_e_r__; │ │ │ │ +_7_8_8 std::vector _a_v_e_r_a_g_e_V_e_r_t_e_x_M_e_s_h_S_i_z_e__; │ │ │ │ +789 │ │ │ │ +790 }; // class CubicHermitePreBasis │ │ │ │ +791 │ │ │ │ +792 namespace _B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ +793 { │ │ │ │ +794 │ │ │ │ +802 template │ │ │ │ +803 auto cubicHermite() │ │ │ │ +804 { │ │ │ │ +805 return [=](auto const &gridView) { │ │ │ │ +806 return _C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s, R>(gridView); │ │ │ │ +807 }; │ │ │ │ +808 } │ │ │ │ +809 │ │ │ │ +817 template │ │ │ │ +818 auto reducedCubicHermite() │ │ │ │ +819 { │ │ │ │ +820 return [=](auto const &gridView) { │ │ │ │ +821 return CubicHermitePreBasis, R, true> │ │ │ │ +(gridView); │ │ │ │ +822 }; │ │ │ │ +823 } │ │ │ │ +824 │ │ │ │ +825 } // end namespace BasisFactory │ │ │ │ +826 │ │ │ │ +827 │ │ │ │ +828} // end namespace Dune::Functions │ │ │ │ +829 │ │ │ │ +830#endif │ │ │ │ +_s_q_u_e_e_z_e_t_e_n_s_o_r_._h_h │ │ │ │ +_m_a_p_p_e_r_u_t_i_l_i_t_i_e_s_._h_h │ │ │ │ +_m_o_n_o_m_i_a_l_s_e_t_._h_h │ │ │ │ +_n_o_d_e_s_._h_h │ │ │ │ +_t_r_a_n_s_f_o_r_m_e_d_f_i_n_i_t_e_e_l_e_m_e_n_t_m_i_x_i_n_._h_h │ │ │ │ +_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ +_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h │ │ │ │ +_f_u_n_c_t_i_o_n_a_l_d_e_s_c_r_i_p_t_o_r_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ +TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const │ │ │ │ +TrigonometricFunction< K, sinFactor, cosFactor > &f) │ │ │ │ +Obtain derivative of TrigonometricFunction function. │ │ │ │ +DDeeffiinniittiioonn trigonometricfunction.hh:43 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_B_a_s_i_s │ │ │ │ +DefaultGlobalBasis< CubicHermitePreBasis< GV, R, reduced > > CubicHermiteBasis │ │ │ │ +Nodal basis of a scalar cubic Hermite finite element space. │ │ │ │ +DDeeffiinniittiioonn cubichermitebasis.hh:79 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ -Default implementation for derivative traits. │ │ │ │ -DDeeffiinniittiioonn defaultderivativetraits.hh:41 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_s_C_a_l_l_a_b_l_e │ │ │ │ -Helper class to check that F is callable. │ │ │ │ -DDeeffiinniittiioonn signature.hh:24 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_g_n_a_t_u_r_e_T_r_a_i_t_s │ │ │ │ -Helper class to deduce the signature of a callable. │ │ │ │ -DDeeffiinniittiioonn signature.hh:60 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_g_n_a_t_u_r_e_T_a_g │ │ │ │ -DDeeffiinniittiioonn signature.hh:106 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_g_n_a_t_u_r_e_T_a_g_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_T_ _>_:_: │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ -DerivativeTraitsT< T > DerivativeTraits │ │ │ │ -DDeeffiinniittiioonn signature.hh:123 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_g_n_a_t_u_r_e_T_a_g_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_T_ _>_:_:_S_i_g_n_a_t_u_r_e │ │ │ │ -Range(Domain) Signature │ │ │ │ -DDeeffiinniittiioonn signature.hh:120 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ +DDeeffiinniittiioonn argyrisbasis.hh:926 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s │ │ │ │ +A pre-basis for a Hermitebasis. │ │ │ │ +DDeeffiinniittiioonn cubichermitebasis.hh:725 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s_:_:_a_v_e_r_a_g_e_V_e_r_t_e_x_M_e_s_h_S_i_z_e__ │ │ │ │ +std::vector< D > averageVertexMeshSize_ │ │ │ │ +DDeeffiinniittiioonn cubichermitebasis.hh:788 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s_:_:_m_a_k_e_N_o_d_e │ │ │ │ +Node makeNode() const │ │ │ │ +Create tree node. │ │ │ │ +DDeeffiinniittiioonn cubichermitebasis.hh:780 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s_:_:_N_o_d_e │ │ │ │ +CubicHermiteNode< GridView, R, reduced > Node │ │ │ │ +Template mapping root tree path to type of created tree node. │ │ │ │ +DDeeffiinniittiioonn cubichermitebasis.hh:755 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ +GV GridView │ │ │ │ +The grid view that the FE basis is defined on. │ │ │ │ +DDeeffiinniittiioonn cubichermitebasis.hh:749 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s_:_:_s_i_z_e___t_y_p_e │ │ │ │ +std::size_t size_type │ │ │ │ +Type used for indices and size information. │ │ │ │ +DDeeffiinniittiioonn cubichermitebasis.hh:752 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s_:_:_v_e_r_t_e_x_M_a_p_p_e_r__ │ │ │ │ +SubEntityMapper vertexMapper_ │ │ │ │ +DDeeffiinniittiioonn cubichermitebasis.hh:787 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s_:_:_u_p_d_a_t_e │ │ │ │ +void update(GridView const &gv) │ │ │ │ +Update the stored grid view, to be called if the grid has changed. │ │ │ │ +DDeeffiinniittiioonn cubichermitebasis.hh:770 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_P_r_e_B_a_s_i_s │ │ │ │ +CubicHermitePreBasis(const GV &gv) │ │ │ │ +Constructor for a given grid view object. │ │ │ │ +DDeeffiinniittiioonn cubichermitebasis.hh:760 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_2_L_o_c_a_l_B_a_s_i_s_T_r_a_i_t_s │ │ │ │ +DDeeffiinniittiioonn cubichermitebasis.hh:84 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_2_L_o_c_a_l_B_a_s_i_s_T_r_a_i_t_s_<_ _D_,_ _d_i_m_,_ _F_i_e_l_d_V_e_c_t_o_r_<_ _D_,_ _d_i_m_ _>_,_ _R_,_ _1_, │ │ │ │ +_F_i_e_l_d_V_e_c_t_o_r_<_ _R_,_ _1_ _>_,_ _F_i_e_l_d_M_a_t_r_i_x_<_ _R_,_ _1_,_ _d_i_m_ _>_,_ _F_i_e_l_d_M_a_t_r_i_x_<_ _R_,_ _d_i_m_,_ _d_i_m_ _>_ _>_:_: │ │ │ │ +_H_e_s_s_i_a_n_T_y_p_e │ │ │ │ +FieldMatrix< R, dim, dim > HessianType │ │ │ │ +DDeeffiinniittiioonn cubichermitebasis.hh:90 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e │ │ │ │ +DDeeffiinniittiioonn cubichermitebasis.hh:664 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e_:_:_s_i_z_e___t_y_p_e │ │ │ │ +std::size_t size_type │ │ │ │ +DDeeffiinniittiioonn cubichermitebasis.hh:668 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e_:_:_F_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ +typename Impl::CubicHermiteLocalFiniteElement< typename GV::ctype, R, GV:: │ │ │ │ +dimension, reduced > FiniteElement │ │ │ │ +DDeeffiinniittiioonn cubichermitebasis.hh:670 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e_<_ _G_r_i_d_V_i_e_w_,_ _R_,_ _r_e_d_u_c_e_d_ _>_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t__ │ │ │ │ +FiniteElement finiteElement_ │ │ │ │ +DDeeffiinniittiioonn cubichermitebasis.hh:706 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ +FiniteElement const & finiteElement() const │ │ │ │ +Return the LocalFiniteElement for the element we are bound to. │ │ │ │ +DDeeffiinniittiioonn cubichermitebasis.hh:689 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e_:_:_e_l_e_m_e_n_t │ │ │ │ +Element const & element() const │ │ │ │ +Return current element, throw if unbound. │ │ │ │ +DDeeffiinniittiioonn cubichermitebasis.hh:679 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e_<_ _G_r_i_d_V_i_e_w_,_ _R_,_ _r_e_d_u_c_e_d_ _>_:_:_e_l_e_m_e_n_t__ │ │ │ │ +Element const * element_ │ │ │ │ +DDeeffiinniittiioonn cubichermitebasis.hh:707 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e_:_:_b_i_n_d │ │ │ │ +void bind(Element const &e) │ │ │ │ +Bind to element. │ │ │ │ +DDeeffiinniittiioonn cubichermitebasis.hh:695 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e_:_:_o_r_d_e_r │ │ │ │ +unsigned int order() const │ │ │ │ +The order of the local basis. │ │ │ │ +DDeeffiinniittiioonn cubichermitebasis.hh:703 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e_:_:_E_l_e_m_e_n_t │ │ │ │ +typename GV::template Codim< 0 >::Entity Element │ │ │ │ +DDeeffiinniittiioonn cubichermitebasis.hh:669 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e_<_ _G_r_i_d_V_i_e_w_,_ _R_,_ _r_e_d_u_c_e_d_ _>_:_:_v_e_r_t_e_x_M_a_p_p_e_r__ │ │ │ │ +Mapper const * vertexMapper_ │ │ │ │ +DDeeffiinniittiioonn cubichermitebasis.hh:708 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e_<_ _G_r_i_d_V_i_e_w_,_ _R_,_ _r_e_d_u_c_e_d_ _>_:_: │ │ │ │ +_a_v_e_r_a_g_e_V_e_r_t_e_x_M_e_s_h_S_i_z_e__ │ │ │ │ +std::vector< typename GridView::ctype > const * averageVertexMeshSize_ │ │ │ │ +DDeeffiinniittiioonn cubichermitebasis.hh:709 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e_:_:_C_u_b_i_c_H_e_r_m_i_t_e_N_o_d_e │ │ │ │ +CubicHermiteNode(Mapper const &m, std::vector< typename GV::ctype > const │ │ │ │ +&averageVertexMeshSize) │ │ │ │ +DDeeffiinniittiioonn cubichermitebasis.hh:672 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ +Global basis for given pre-basis. │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:53 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_g_r_i_d_V_i_e_w │ │ │ │ +const GridView & gridView() const │ │ │ │ +Export the stored GridView. │ │ │ │ +DDeeffiinniittiioonn leafprebasismappermixin.hh:95 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_u_p_d_a_t_e │ │ │ │ +void update(const GridView &gv) │ │ │ │ +Update the stored GridView. │ │ │ │ +DDeeffiinniittiioonn leafprebasismappermixin.hh:101 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n │ │ │ │ +LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout) │ │ │ │ +Construct from GridView and local DOF layout. │ │ │ │ +DDeeffiinniittiioonn leafprebasismappermixin.hh:74 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_e_t_S_i_z_e │ │ │ │ +void setSize(const size_type size) │ │ │ │ +DDeeffiinniittiioonn nodes.hh:197 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ +DDeeffiinniittiioonn nodes.hh:218 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _s_i_g_n_a_t_u_r_e_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _c_u_b_i_c_h_e_r_m_i_t_e_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00215.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: reserveddeque.hh File Reference │ │ │ +Dune-Functions: subentitydofs.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,75 +88,57 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
reserveddeque.hh File Reference
│ │ │ +
subentitydofs.hh File Reference
│ │ │
│ │ │
│ │ │ - │ │ │ -

An stl-compliant double-ended queue which stores everything on the stack. │ │ │ -More...

│ │ │ -
#include <algorithm>
│ │ │ -#include <iostream>
│ │ │ -#include <cstddef>
│ │ │ -#include <initializer_list>
│ │ │ -#include <dune/common/genericiterator.hh>
│ │ │ +
#include <vector>
│ │ │ +#include <dune/geometry/referenceelements.hh>
│ │ │ +#include <dune/common/typetree/traversal.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::ReservedDeque< T, n >
 A double-ended queue (deque) class with statically reserved memory. More...
class  Dune::Functions::SubEntityDOFs< GridView >
 Range of DOFs associated to sub-entity. More...
│ │ │ │ │ │ │ │ │ │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
│ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ -Macros

#define CHECKSIZE(X)

│ │ │ +Functions

template<class T>
auto Dune::Functions::subEntityDOFs (const T &)
 Create SubEntityDOFs object.
template<class LocalView>
auto Dune::Functions::subEntityDOFs (const LocalView &localView, std::size_t subEntityIndex, std::size_t subEntityCodim)
 Create bound SubEntityDOFs object.
template<class LocalView, class Intersection>
auto Dune::Functions::subEntityDOFs (const LocalView &localView, const Intersection &intersection)
 Create bound SubEntityDOFs object.
│ │ │ -

Detailed Description

│ │ │ -

An stl-compliant double-ended queue which stores everything on the stack.

│ │ │ -

Macro Definition Documentation

│ │ │ - │ │ │ -

◆ CHECKSIZE

│ │ │ - │ │ │ -
│ │ │ -
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
#define CHECKSIZE( X)
│ │ │ -
│ │ │ -Value:
{}
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,34 +1,32 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -reserveddeque.hh File Reference │ │ │ │ -An stl-compliant double-ended queue which stores everything on the stack. │ │ │ │ -_M_o_r_e_._._. │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ +subentitydofs.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_<_ _T_,_ _n_ _> │ │ │ │ -  A double-ended queue (deque) class with statically reserved memory. │ │ │ │ - _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_E_n_t_i_t_y_D_O_F_s_<_ _G_r_i_d_V_i_e_w_ _> │ │ │ │ +  Range of DOFs associated to sub-entity. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -MMaaccrrooss │ │ │ │ -#define  _C_H_E_C_K_S_I_Z_E(X) │ │ │ │ -********** DDeettaaiilleedd DDeessccrriippttiioonn ********** │ │ │ │ -An stl-compliant double-ended queue which stores everything on the stack. │ │ │ │ -********** MMaaccrroo DDeeffiinniittiioonn DDooccuummeennttaattiioonn ********** │ │ │ │ -********** _?◆_? CCHHEECCKKSSIIZZEE ********** │ │ │ │ -#define CHECKSIZE ( XX ) │ │ │ │ -VVaalluuee:: │ │ │ │ -{} │ │ │ │ +FFuunnccttiioonnss │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_s_u_b_E_n_t_i_t_y_D_O_F_s (const T &) │ │ │ │ +  Create _S_u_b_E_n_t_i_t_y_D_O_F_s object. │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_s_u_b_E_n_t_i_t_y_D_O_F_s (const LocalView &localView, std::size_t │ │ │ │ + subEntityIndex, std::size_t subEntityCodim) │ │ │ │ +  Create bound _S_u_b_E_n_t_i_t_y_D_O_F_s object. │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_s_u_b_E_n_t_i_t_y_D_O_F_s (const LocalView &localView, const │ │ │ │ + Intersection &intersection) │ │ │ │ +  Create bound _S_u_b_E_n_t_i_t_y_D_O_F_s object. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _r_e_s_e_r_v_e_d_d_e_q_u_e_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _s_u_b_e_n_t_i_t_y_d_o_f_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00215.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,3 +1,5 @@ │ │ │ │ var a00215 = [ │ │ │ │ - ["CHECKSIZE", "a00215.html#a65543e75bc949ecdb95a25b1f4e11675", null] │ │ │ │ + ["Dune::Functions::subEntityDOFs", "a00313.html#ga09ad7987f85909bfcf269a0de9c652d8", null], │ │ │ │ + ["Dune::Functions::subEntityDOFs", "a00313.html#ga5803226b1ed4bf848a9532181c952244", null], │ │ │ │ + ["Dune::Functions::subEntityDOFs", "a00313.html#ga0b9da94fff21e98877d0e3fe1c1554c7", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00215_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: reserveddeque.hh Source File │ │ │ +Dune-Functions: subentitydofs.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,294 +88,183 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
reserveddeque.hh
│ │ │ +
subentitydofs.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH
│ │ │ -
8#define DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH
│ │ │ -
9
│ │ │ +
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH
│ │ │ +
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH
│ │ │ +
9
│ │ │ +
10#include <vector>
│ │ │ +
11
│ │ │ +
12#include <dune/geometry/referenceelements.hh>
│ │ │
13
│ │ │ -
14#include <algorithm>
│ │ │ -
15#include <iostream>
│ │ │ -
16#include <cstddef>
│ │ │ -
17#include <initializer_list>
│ │ │ -
18
│ │ │ -
19#include <dune/common/genericiterator.hh>
│ │ │ +
14#include <dune/common/typetree/traversal.hh>
│ │ │ +
15
│ │ │ +
16
│ │ │ +
17
│ │ │ +
18namespace Dune {
│ │ │ +
19namespace Functions {
│ │ │
20
│ │ │ -
21#ifdef CHECK_RESERVEDDEQUE
│ │ │ -
22#define CHECKSIZE(X) assert(X)
│ │ │ -
23#else
│ │ │ -
24#define CHECKSIZE(X) {}
│ │ │ -
25#endif
│ │ │ -
26
│ │ │ -
27namespace Dune {
│ │ │ -
28namespace Functions {
│ │ │ -
29
│ │ │ -
47 template<class T, int n>
│ │ │ -
│ │ │ - │ │ │ -
49 {
│ │ │ -
50 public:
│ │ │ +
21
│ │ │ +
22
│ │ │ +
45template<class GridView>
│ │ │ +
│ │ │ + │ │ │ +
47{
│ │ │ +
48 static const int dim = GridView::dimension;
│ │ │ +
49
│ │ │ +
50public:
│ │ │
51
│ │ │ -
53
│ │ │ -
55 typedef T value_type;
│ │ │ -
57 typedef T* pointer;
│ │ │ -
59 typedef T& reference;
│ │ │ -
61 typedef const T& const_reference;
│ │ │ -
63 typedef size_t size_type;
│ │ │ -
65 typedef std::ptrdiff_t difference_type;
│ │ │ -
67 typedef Dune::GenericIterator<ReservedDeque, value_type> iterator;
│ │ │ -
69 typedef Dune::GenericIterator<const ReservedDeque, const value_type> const_iterator;
│ │ │ -
70
│ │ │ -
72
│ │ │ -
74
│ │ │ -
│ │ │ - │ │ │ -
77 size_(0),
│ │ │ -
78 first_(0)
│ │ │ -
79 {}
│ │ │ -
│ │ │ -
80
│ │ │ -
│ │ │ -
81 ReservedDeque(std::initializer_list<T> const &l)
│ │ │ -
82 {
│ │ │ -
83 assert(l.size() <= n);// Actually, this is not needed any more!
│ │ │ -
84 size_ = l.size();
│ │ │ -
85 std::copy_n(l.begin(), size_, data_);
│ │ │ -
86 }
│ │ │ -
│ │ │ -
87
│ │ │ -
89
│ │ │ -
91
│ │ │ -
│ │ │ -
93 void clear()
│ │ │ -
94 {
│ │ │ -
95 first_ = 0;
│ │ │ -
96 size_ = 0;
│ │ │ -
97 }
│ │ │ -
│ │ │ -
98
│ │ │ -
│ │ │ -
100 void resize(size_t s)
│ │ │ -
101 {
│ │ │ -
102 CHECKSIZE(s<=n);
│ │ │ -
103 size_ = s;
│ │ │ -
104 }
│ │ │ -
│ │ │ -
105
│ │ │ -
│ │ │ -
107 void push_back(const T& t)
│ │ │ -
108 {
│ │ │ -
109 CHECKSIZE(size_<n);
│ │ │ -
110 data_[size_++ % n] = t;
│ │ │ -
111 }
│ │ │ -
│ │ │ -
112
│ │ │ -
│ │ │ -
114 void push_front(const T& t)
│ │ │ -
115 {
│ │ │ -
116 CHECKSIZE(size_<n);
│ │ │ -
117 ++size_;
│ │ │ -
118 first_ = (first_+(n-1)) % n;
│ │ │ -
119 data_[first_] = t;
│ │ │ -
120 }
│ │ │ +
68 template<class LocalView>
│ │ │ +
│ │ │ +
69 SubEntityDOFs& bind(const LocalView& localView, std::size_t subEntityIndex, std::size_t subEntityCodim)
│ │ │ +
70 {
│ │ │ +
71 // fill vector with local indices of all DOFs contained in subentity
│ │ │ +
72 containedDOFs_.clear();
│ │ │ +
73 dofIsContained_.assign(localView.size(), false);
│ │ │ +
74
│ │ │ +
75 auto re = Dune::referenceElement<double,dim>(localView.element().type());
│ │ │ +
76
│ │ │ +
77 Dune::TypeTree::forEachLeafNode(localView.tree(), [&](auto&& node, auto&& /*treePath*/) {
│ │ │ +
78 if (node.empty())
│ │ │ +
79 return;
│ │ │ +
80 const auto& localCoefficients = node.finiteElement().localCoefficients();
│ │ │ +
81 std::size_t localSize = localCoefficients.size();
│ │ │ +
82 for(std::size_t i=0; i<localSize; ++i)
│ │ │ +
83 {
│ │ │ +
84 auto localKey = localCoefficients.localKey(i);
│ │ │ +
85 if (re.subEntities(subEntityIndex, subEntityCodim, localKey.codim()).contains(localKey.subEntity()))
│ │ │ +
86 {
│ │ │ +
87 containedDOFs_.push_back(node.localIndex(i));
│ │ │ +
88 dofIsContained_[node.localIndex(i)] = true;
│ │ │ +
89 }
│ │ │ +
90 }
│ │ │ +
91 });
│ │ │ +
92 return *this;
│ │ │ +
93 }
│ │ │ +
│ │ │ +
94
│ │ │ +
110 template<class LocalView, class Intersection>
│ │ │ +
│ │ │ +
111 SubEntityDOFs& bind(const LocalView& localView, const Intersection& intersection)
│ │ │ +
112 {
│ │ │ +
113 return bind(localView, intersection.indexInInside(), 1);
│ │ │ +
114 }
│ │ │ +
│ │ │ +
115
│ │ │ +
│ │ │ +
117 auto begin() const
│ │ │ +
118 {
│ │ │ +
119 return containedDOFs_.cbegin();
│ │ │ +
120 }
│ │ │
│ │ │
121
│ │ │
│ │ │ -
123 void pop_back()
│ │ │ -
124 {
│ │ │ -
125 if (! empty())
│ │ │ -
126 size_--;
│ │ │ -
127 }
│ │ │ -
│ │ │ -
128
│ │ │ -
│ │ │ - │ │ │ -
131 {
│ │ │ -
132 if (! empty())
│ │ │ -
133 {
│ │ │ -
134 size_--;
│ │ │ -
135 first_ = (++first_) % n;
│ │ │ -
136 }
│ │ │ -
137 }
│ │ │ -
│ │ │ -
138
│ │ │ -
│ │ │ - │ │ │ -
141 return iterator(*this, 0);
│ │ │ -
142 }
│ │ │ -
│ │ │ -
143
│ │ │ -
│ │ │ - │ │ │ -
146 return const_iterator(*this, 0);
│ │ │ -
147 }
│ │ │ -
│ │ │ -
148
│ │ │ -
│ │ │ - │ │ │ -
151 return iterator(*this, size_);
│ │ │ -
152 }
│ │ │ +
123 auto end() const
│ │ │ +
124 {
│ │ │ +
125 return containedDOFs_.cend();
│ │ │ +
126 }
│ │ │ +
│ │ │ +
127
│ │ │ +
│ │ │ +
129 auto size() const
│ │ │ +
130 {
│ │ │ +
131 return containedDOFs_.size();
│ │ │ +
132 }
│ │ │ +
│ │ │ +
133
│ │ │ +
│ │ │ +
135 decltype(auto) operator[](std::size_t i) const
│ │ │ +
136 {
│ │ │ +
137 return containedDOFs_[i];
│ │ │ +
138 }
│ │ │ +
│ │ │ +
139
│ │ │ +
│ │ │ +
141 bool contains(std::size_t localIndex) const
│ │ │ +
142 {
│ │ │ +
143 return dofIsContained_[localIndex];
│ │ │ +
144 }
│ │ │ +
│ │ │ +
145
│ │ │ +
146private:
│ │ │ +
147
│ │ │ +
148 std::vector<std::size_t> containedDOFs_;
│ │ │ +
149 std::vector<bool> dofIsContained_;
│ │ │ +
150};
│ │ │
│ │ │ +
151
│ │ │ +
152
│ │ │
153
│ │ │ -
│ │ │ - │ │ │ -
156 return const_iterator(*this, size_);
│ │ │ -
157 }
│ │ │ -
│ │ │ -
158
│ │ │ -
│ │ │ - │ │ │ -
161 {
│ │ │ -
162 CHECKSIZE(size_>i);
│ │ │ -
163 return data_[(first_ + i) % n];
│ │ │ -
164 }
│ │ │ -
│ │ │ -
165
│ │ │ +
166template<class T>
│ │ │
│ │ │ - │ │ │ -
168 {
│ │ │ -
169 CHECKSIZE(size_>i);
│ │ │ -
170 return data_[(first_ + i) % n];
│ │ │ -
171 }
│ │ │ -
│ │ │ -
172
│ │ │ -
│ │ │ - │ │ │ -
175 {
│ │ │ -
176 CHECKSIZE(size_>0);
│ │ │ -
177 return data_[first_];
│ │ │ -
178 }
│ │ │ -
│ │ │ -
179
│ │ │ -
│ │ │ - │ │ │ -
182 {
│ │ │ -
183 CHECKSIZE(size_>0);
│ │ │ -
184 return data_[first_];
│ │ │ -
185 }
│ │ │ -
│ │ │ -
186
│ │ │ -
│ │ │ - │ │ │ -
189 {
│ │ │ -
190 CHECKSIZE(size_>0);
│ │ │ -
191 return data_[(first_ + size_-1) % n];
│ │ │ -
192 }
│ │ │ -
│ │ │ -
193
│ │ │ -
│ │ │ - │ │ │ -
196 {
│ │ │ -
197 CHECKSIZE(size_>0);
│ │ │ -
198 return data_[(first_ + size_-1) % n];
│ │ │ -
199 }
│ │ │ -
│ │ │ -
200
│ │ │ -
202
│ │ │ -
204
│ │ │ -
│ │ │ - │ │ │ -
207 {
│ │ │ -
208 return size_;
│ │ │ -
209 }
│ │ │ -
│ │ │ -
210
│ │ │ -
│ │ │ -
212 bool empty() const
│ │ │ -
213 {
│ │ │ -
214 return size_==0;
│ │ │ -
215 }
│ │ │ -
│ │ │ -
216
│ │ │ -
│ │ │ -
218 static constexpr size_type capacity()
│ │ │ -
219 {
│ │ │ -
220 return n;
│ │ │ -
221 }
│ │ │ -
│ │ │ -
222
│ │ │ -
│ │ │ -
224 static constexpr size_type max_size()
│ │ │ -
225 {
│ │ │ -
226 return n;
│ │ │ -
227 }
│ │ │ -
│ │ │ -
228
│ │ │ -
230
│ │ │ -
│ │ │ -
232 friend std::ostream& operator<< (std::ostream& s, const ReservedDeque& v)
│ │ │ -
233 {
│ │ │ -
234 for (size_t i=0; i<v.size(); i++)
│ │ │ -
235 s << v[i] << " ";
│ │ │ -
236 return s;
│ │ │ -
237 }
│ │ │ -
│ │ │ -
238
│ │ │ -
239 private:
│ │ │ -
240 T data_[n];
│ │ │ -
241 size_type first_;
│ │ │ -
242 size_type size_;
│ │ │ -
243 };
│ │ │ -
│ │ │ -
244
│ │ │ -
245} // end namespace Functions
│ │ │ -
246} // end namespace Dune
│ │ │ -
247
│ │ │ -
248#undef CHECKSIZE
│ │ │ -
249
│ │ │ -
250#endif // DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH
│ │ │ -
#define CHECKSIZE(X)
Definition reserveddeque.hh:24
│ │ │ +
167auto subEntityDOFs(const T&)
│ │ │ +
168{
│ │ │ + │ │ │ +
170}
│ │ │ +
│ │ │ +
171
│ │ │ +
172
│ │ │ +
173
│ │ │ +
193template<class LocalView>
│ │ │ +
│ │ │ +
194auto subEntityDOFs(const LocalView& localView, std::size_t subEntityIndex, std::size_t subEntityCodim)
│ │ │ +
195{
│ │ │ +
196 using GridView = typename LocalView::GridView;
│ │ │ + │ │ │ +
198 subEntityDOFs.bind(localView, subEntityIndex, subEntityCodim);
│ │ │ +
199 return subEntityDOFs;
│ │ │ +
200}
│ │ │ +
│ │ │ +
201
│ │ │ +
202
│ │ │ +
203
│ │ │ +
222template<class LocalView, class Intersection>
│ │ │ +
│ │ │ +
223auto subEntityDOFs(const LocalView& localView, const Intersection& intersection)
│ │ │ +
224{
│ │ │ +
225 using GridView = typename LocalView::GridView;
│ │ │ + │ │ │ +
227 subEntityDOFs.bind(localView, intersection);
│ │ │ +
228 return subEntityDOFs;
│ │ │ +
229}
│ │ │ +
│ │ │ +
230
│ │ │ +
231
│ │ │ +
232
│ │ │ +
233} // namespace Functions
│ │ │ +
234} // namespace Dune
│ │ │ +
235
│ │ │ +
236#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH
│ │ │ +
auto subEntityDOFs(const T &)
Create SubEntityDOFs object.
Definition subentitydofs.hh:167
│ │ │
Definition monomialset.hh:19
│ │ │ -
void pop_front()
Erases the first element of the vector, O(1) time.
Definition reserveddeque.hh:130
│ │ │ -
static constexpr size_type capacity()
Returns current capacity (allocated memory) of the vector.
Definition reserveddeque.hh:218
│ │ │ -
void clear()
Erases all elements.
Definition reserveddeque.hh:93
│ │ │ -
Dune::GenericIterator< ReservedDeque, value_type > iterator
Iterator used to iterate through a vector.
Definition reserveddeque.hh:67
│ │ │ -
T value_type
The type of object, T, stored in the vector.
Definition reserveddeque.hh:55
│ │ │ -
ReservedDeque()
Constructor.
Definition reserveddeque.hh:76
│ │ │ -
bool empty() const
Returns true if vector has no elements.
Definition reserveddeque.hh:212
│ │ │ -
const_reference back() const
Returns const reference to last element of vector.
Definition reserveddeque.hh:195
│ │ │ -
friend std::ostream & operator<<(std::ostream &s, const ReservedDeque &v)
Send ReservedDeque to an output stream.
Definition reserveddeque.hh:232
│ │ │ -
void push_front(const T &t)
Prepends an element to the begin of a deque if size<capacity, O(1) time.
Definition reserveddeque.hh:114
│ │ │ -
reference operator[](size_type i)
Returns reference to the i'th element.
Definition reserveddeque.hh:160
│ │ │ -
reference front()
Returns reference to first element of vector.
Definition reserveddeque.hh:174
│ │ │ -
T * pointer
Pointer to T.
Definition reserveddeque.hh:57
│ │ │ -
const_reference front() const
Returns const reference to first element of vector.
Definition reserveddeque.hh:181
│ │ │ -
iterator end()
Returns an iterator pointing to the end of the vector.
Definition reserveddeque.hh:150
│ │ │ -
reference back()
Returns reference to last element of vector.
Definition reserveddeque.hh:188
│ │ │ -
void pop_back()
Erases the last element of the vector, O(1) time.
Definition reserveddeque.hh:123
│ │ │ -
const T & const_reference
Const reference to T.
Definition reserveddeque.hh:61
│ │ │ -
static constexpr size_type max_size()
Returns the maximum length of the vector.
Definition reserveddeque.hh:224
│ │ │ -
std::ptrdiff_t difference_type
A signed integral type.
Definition reserveddeque.hh:65
│ │ │ -
T & reference
Reference to T.
Definition reserveddeque.hh:59
│ │ │ -
Dune::GenericIterator< const ReservedDeque, const value_type > const_iterator
Const iterator used to iterate through a vector.
Definition reserveddeque.hh:69
│ │ │ -
size_type size() const
Returns number of elements in the vector.
Definition reserveddeque.hh:206
│ │ │ -
const_iterator end() const
Returns a const_iterator pointing to the end of the vector.
Definition reserveddeque.hh:155
│ │ │ -
void resize(size_t s)
Specifies a new size for the vector.
Definition reserveddeque.hh:100
│ │ │ -
iterator begin()
Returns a iterator pointing to the beginning of the vector.
Definition reserveddeque.hh:140
│ │ │ -
const_iterator begin() const
Returns a const_iterator pointing to the beginning of the vector.
Definition reserveddeque.hh:145
│ │ │ -
ReservedDeque(std::initializer_list< T > const &l)
Definition reserveddeque.hh:81
│ │ │ -
size_t size_type
An unsigned integral type.
Definition reserveddeque.hh:63
│ │ │ -
void push_back(const T &t)
Appends an element to the end of a vector, up to the maximum size n, O(1) time.
Definition reserveddeque.hh:107
│ │ │ +
Definition monomialset.hh:19
│ │ │ +
Range of DOFs associated to sub-entity.
Definition subentitydofs.hh:47
│ │ │ +
auto begin() const
Create begin iterator for access to range of contained local indices.
Definition subentitydofs.hh:117
│ │ │ +
auto size() const
Return number of contained DOFs.
Definition subentitydofs.hh:129
│ │ │ +
SubEntityDOFs & bind(const LocalView &localView, const Intersection &intersection)
Bind SubEntityDOFs object to LocalView and sub-entity.
Definition subentitydofs.hh:111
│ │ │ +
bool contains(std::size_t localIndex) const
Check if given local index is contained in this range of DOFs.
Definition subentitydofs.hh:141
│ │ │ +
auto end() const
Create end iterator for access to range of contained local indices.
Definition subentitydofs.hh:123
│ │ │ +
SubEntityDOFs & bind(const LocalView &localView, std::size_t subEntityIndex, std::size_t subEntityCodim)
Bind SubEntityDOFs object to LocalView and sub-entity.
Definition subentitydofs.hh:69
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,330 +1,185 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -reserveddeque.hh │ │ │ │ +subentitydofs.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH │ │ │ │ -8#define DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH │ │ │ │ +8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH │ │ │ │ 9 │ │ │ │ +10#include │ │ │ │ +11 │ │ │ │ +12#include │ │ │ │ 13 │ │ │ │ -14#include │ │ │ │ -15#include │ │ │ │ -16#include │ │ │ │ -17#include │ │ │ │ -18 │ │ │ │ -19#include │ │ │ │ +14#include │ │ │ │ +15 │ │ │ │ +16 │ │ │ │ +17 │ │ │ │ +18namespace _D_u_n_e { │ │ │ │ +19namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ 20 │ │ │ │ -21#ifdef CHECK_RESERVEDDEQUE │ │ │ │ -22#define CHECKSIZE(X) assert(X) │ │ │ │ -23#else │ │ │ │ -_2_4#define CHECKSIZE(X) {} │ │ │ │ -25#endif │ │ │ │ -26 │ │ │ │ -27namespace _D_u_n_e { │ │ │ │ -28namespace Functions { │ │ │ │ -29 │ │ │ │ -47 template │ │ │ │ -_4_8 class _R_e_s_e_r_v_e_d_D_e_q_u_e │ │ │ │ -49 { │ │ │ │ -50 public: │ │ │ │ +21 │ │ │ │ +22 │ │ │ │ +45template │ │ │ │ +_4_6class _S_u_b_E_n_t_i_t_y_D_O_F_s │ │ │ │ +47{ │ │ │ │ +48 static const int dim = GridView::dimension; │ │ │ │ +49 │ │ │ │ +50public: │ │ │ │ 51 │ │ │ │ -53 │ │ │ │ -_5_5 typedef T _v_a_l_u_e___t_y_p_e; │ │ │ │ -_5_7 typedef T* _p_o_i_n_t_e_r; │ │ │ │ -_5_9 typedef T& _r_e_f_e_r_e_n_c_e; │ │ │ │ -_6_1 typedef const T& _c_o_n_s_t___r_e_f_e_r_e_n_c_e; │ │ │ │ -_6_3 typedef size_t _s_i_z_e___t_y_p_e; │ │ │ │ -_6_5 typedef std::ptrdiff_t _d_i_f_f_e_r_e_n_c_e___t_y_p_e; │ │ │ │ -_6_7 typedef Dune::GenericIterator _i_t_e_r_a_t_o_r; │ │ │ │ -_6_9 typedef Dune::GenericIterator │ │ │ │ -_c_o_n_s_t___i_t_e_r_a_t_o_r; │ │ │ │ -70 │ │ │ │ -72 │ │ │ │ +68 template │ │ │ │ +_6_9 _S_u_b_E_n_t_i_t_y_D_O_F_s& _b_i_n_d(const LocalView& localView, std::size_t subEntityIndex, │ │ │ │ +std::size_t subEntityCodim) │ │ │ │ +70 { │ │ │ │ +71 // fill vector with local indices of all DOFs contained in subentity │ │ │ │ +72 containedDOFs_.clear(); │ │ │ │ +73 dofIsContained_.assign(localView.size(), false); │ │ │ │ 74 │ │ │ │ -_7_6 _R_e_s_e_r_v_e_d_D_e_q_u_e() : │ │ │ │ -77 size_(0), │ │ │ │ -78 first_(0) │ │ │ │ -79 {} │ │ │ │ -80 │ │ │ │ -_8_1 _R_e_s_e_r_v_e_d_D_e_q_u_e(std::initializer_list const &l) │ │ │ │ -82 { │ │ │ │ -83 assert(l.size() <= n);// Actually, this is not needed any more! │ │ │ │ -84 size_ = l.size(); │ │ │ │ -85 std::copy_n(l.begin(), size_, data_); │ │ │ │ -86 } │ │ │ │ -87 │ │ │ │ -89 │ │ │ │ -91 │ │ │ │ -_9_3 void _c_l_e_a_r() │ │ │ │ -94 { │ │ │ │ -95 first_ = 0; │ │ │ │ -96 size_ = 0; │ │ │ │ -97 } │ │ │ │ -98 │ │ │ │ -_1_0_0 void _r_e_s_i_z_e(size_t s) │ │ │ │ -101 { │ │ │ │ -102 _C_H_E_C_K_S_I_Z_E(s<=n); │ │ │ │ -103 size_ = s; │ │ │ │ -104 } │ │ │ │ -105 │ │ │ │ -_1_0_7 void _p_u_s_h___b_a_c_k(const T& t) │ │ │ │ -108 { │ │ │ │ -109 _C_H_E_C_K_S_I_Z_E(size_(localView.element().type()); │ │ │ │ +76 │ │ │ │ +77 Dune::TypeTree::forEachLeafNode(localView.tree(), [&](auto&& node, auto&& / │ │ │ │ +*treePath*/) { │ │ │ │ +78 if (node.empty()) │ │ │ │ +79 return; │ │ │ │ +80 const auto& localCoefficients = node.finiteElement().localCoefficients(); │ │ │ │ +81 std::size_t localSize = localCoefficients.size(); │ │ │ │ +82 for(std::size_t i=0; i │ │ │ │ +_1_1_1 _S_u_b_E_n_t_i_t_y_D_O_F_s& _b_i_n_d(const LocalView& localView, const Intersection& │ │ │ │ +intersection) │ │ │ │ +112 { │ │ │ │ +113 return _b_i_n_d(localView, intersection.indexInInside(), 1); │ │ │ │ +114 } │ │ │ │ +115 │ │ │ │ +_1_1_7 auto _b_e_g_i_n() const │ │ │ │ +118 { │ │ │ │ +119 return containedDOFs_.cbegin(); │ │ │ │ 120 } │ │ │ │ 121 │ │ │ │ -_1_2_3 void _p_o_p___b_a_c_k() │ │ │ │ +_1_2_3 auto _e_n_d() const │ │ │ │ 124 { │ │ │ │ -125 if (! _e_m_p_t_y()) │ │ │ │ -126 size_--; │ │ │ │ -127 } │ │ │ │ -128 │ │ │ │ -_1_3_0 void _p_o_p___f_r_o_n_t() │ │ │ │ -131 { │ │ │ │ -132 if (! _e_m_p_t_y()) │ │ │ │ -133 { │ │ │ │ -134 size_--; │ │ │ │ -135 first_ = (++first_) % n; │ │ │ │ -136 } │ │ │ │ -137 } │ │ │ │ -138 │ │ │ │ -_1_4_0 _i_t_e_r_a_t_o_r _b_e_g_i_n(){ │ │ │ │ -141 return _i_t_e_r_a_t_o_r(*this, 0); │ │ │ │ -142 } │ │ │ │ -143 │ │ │ │ -_1_4_5 _c_o_n_s_t___i_t_e_r_a_t_o_r _b_e_g_i_n() const { │ │ │ │ -146 return _c_o_n_s_t___i_t_e_r_a_t_o_r(*this, 0); │ │ │ │ -147 } │ │ │ │ -148 │ │ │ │ -_1_5_0 _i_t_e_r_a_t_o_r _e_n_d(){ │ │ │ │ -151 return _i_t_e_r_a_t_o_r(*this, size_); │ │ │ │ -152 } │ │ │ │ +125 return containedDOFs_.cend(); │ │ │ │ +126 } │ │ │ │ +127 │ │ │ │ +_1_2_9 auto _s_i_z_e() const │ │ │ │ +130 { │ │ │ │ +131 return containedDOFs_.size(); │ │ │ │ +132 } │ │ │ │ +133 │ │ │ │ +_1_3_5 decltype(auto) operator[](std::size_t i) const │ │ │ │ +136 { │ │ │ │ +137 return containedDOFs_[i]; │ │ │ │ +138 } │ │ │ │ +139 │ │ │ │ +_1_4_1 bool _c_o_n_t_a_i_n_s(std::size_t localIndex) const │ │ │ │ +142 { │ │ │ │ +143 return dofIsContained_[localIndex]; │ │ │ │ +144 } │ │ │ │ +145 │ │ │ │ +146private: │ │ │ │ +147 │ │ │ │ +148 std::vector containedDOFs_; │ │ │ │ +149 std::vector dofIsContained_; │ │ │ │ +150}; │ │ │ │ +151 │ │ │ │ +152 │ │ │ │ 153 │ │ │ │ -_1_5_5 _c_o_n_s_t___i_t_e_r_a_t_o_r _e_n_d() const { │ │ │ │ -156 return _c_o_n_s_t___i_t_e_r_a_t_o_r(*this, size_); │ │ │ │ -157 } │ │ │ │ -158 │ │ │ │ -_1_6_0 _r_e_f_e_r_e_n_c_e _o_p_e_r_a_t_o_r_[_]_ (_s_i_z_e___t_y_p_e i) │ │ │ │ -161 { │ │ │ │ -162 _C_H_E_C_K_S_I_Z_E(size_>i); │ │ │ │ -163 return data_[(first_ + i) % n]; │ │ │ │ -164 } │ │ │ │ -165 │ │ │ │ -_1_6_7 _c_o_n_s_t___r_e_f_e_r_e_n_c_e _o_p_e_r_a_t_o_r_[_]_ (_s_i_z_e___t_y_p_e i) const │ │ │ │ -168 { │ │ │ │ -169 _C_H_E_C_K_S_I_Z_E(size_>i); │ │ │ │ -170 return data_[(first_ + i) % n]; │ │ │ │ -171 } │ │ │ │ +166template │ │ │ │ +_1_6_7auto _s_u_b_E_n_t_i_t_y_D_O_F_s(const T&) │ │ │ │ +168{ │ │ │ │ +169 return _S_u_b_E_n_t_i_t_y_D_O_F_s_<_t_y_p_e_n_a_m_e_ _T_:_:_G_r_i_d_V_i_e_w_>{}; │ │ │ │ +170} │ │ │ │ +171 │ │ │ │ 172 │ │ │ │ -_1_7_4 _r_e_f_e_r_e_n_c_e _f_r_o_n_t() │ │ │ │ -175 { │ │ │ │ -176 _C_H_E_C_K_S_I_Z_E(size_>0); │ │ │ │ -177 return data_[first_]; │ │ │ │ -178 } │ │ │ │ -179 │ │ │ │ -_1_8_1 _c_o_n_s_t___r_e_f_e_r_e_n_c_e _f_r_o_n_t() const │ │ │ │ -182 { │ │ │ │ -183 _C_H_E_C_K_S_I_Z_E(size_>0); │ │ │ │ -184 return data_[first_]; │ │ │ │ -185 } │ │ │ │ -186 │ │ │ │ -_1_8_8 _r_e_f_e_r_e_n_c_e _b_a_c_k() │ │ │ │ -189 { │ │ │ │ -190 _C_H_E_C_K_S_I_Z_E(size_>0); │ │ │ │ -191 return data_[(first_ + size_-1) % n]; │ │ │ │ -192 } │ │ │ │ -193 │ │ │ │ -_1_9_5 _c_o_n_s_t___r_e_f_e_r_e_n_c_e _b_a_c_k() const │ │ │ │ -196 { │ │ │ │ -197 _C_H_E_C_K_S_I_Z_E(size_>0); │ │ │ │ -198 return data_[(first_ + size_-1) % n]; │ │ │ │ -199 } │ │ │ │ -200 │ │ │ │ +173 │ │ │ │ +193template │ │ │ │ +_1_9_4auto _s_u_b_E_n_t_i_t_y_D_O_F_s(const LocalView& localView, std::size_t subEntityIndex, │ │ │ │ +std::size_t subEntityCodim) │ │ │ │ +195{ │ │ │ │ +196 using GridView = typename LocalView::GridView; │ │ │ │ +197 _S_u_b_E_n_t_i_t_y_D_O_F_s_<_G_r_i_d_V_i_e_w_> _s_u_b_E_n_t_i_t_y_D_O_F_s; │ │ │ │ +198 _s_u_b_E_n_t_i_t_y_D_O_F_s.bind(localView, subEntityIndex, subEntityCodim); │ │ │ │ +199 return _s_u_b_E_n_t_i_t_y_D_O_F_s; │ │ │ │ +200} │ │ │ │ +201 │ │ │ │ 202 │ │ │ │ -204 │ │ │ │ -_2_0_6 _s_i_z_e___t_y_p_e _s_i_z_e () const │ │ │ │ -207 { │ │ │ │ -208 return size_; │ │ │ │ -209 } │ │ │ │ -210 │ │ │ │ -_2_1_2 bool _e_m_p_t_y() const │ │ │ │ -213 { │ │ │ │ -214 return size_==0; │ │ │ │ -215 } │ │ │ │ -216 │ │ │ │ -_2_1_8 static constexpr _s_i_z_e___t_y_p_e _c_a_p_a_c_i_t_y() │ │ │ │ -219 { │ │ │ │ -220 return n; │ │ │ │ -221 } │ │ │ │ -222 │ │ │ │ -_2_2_4 static constexpr _s_i_z_e___t_y_p_e _m_a_x___s_i_z_e() │ │ │ │ -225 { │ │ │ │ -226 return n; │ │ │ │ -227 } │ │ │ │ -228 │ │ │ │ +203 │ │ │ │ +222template │ │ │ │ +_2_2_3auto _s_u_b_E_n_t_i_t_y_D_O_F_s(const LocalView& localView, const Intersection& │ │ │ │ +intersection) │ │ │ │ +224{ │ │ │ │ +225 using GridView = typename LocalView::GridView; │ │ │ │ +226 _S_u_b_E_n_t_i_t_y_D_O_F_s_<_G_r_i_d_V_i_e_w_> _s_u_b_E_n_t_i_t_y_D_O_F_s; │ │ │ │ +227 _s_u_b_E_n_t_i_t_y_D_O_F_s.bind(localView, intersection); │ │ │ │ +228 return _s_u_b_E_n_t_i_t_y_D_O_F_s; │ │ │ │ +229} │ │ │ │ 230 │ │ │ │ -_2_3_2 friend std::ostream& _o_p_e_r_a_t_o_r_<_<_ (std::ostream& s, const _R_e_s_e_r_v_e_d_D_e_q_u_e& v) │ │ │ │ -233 { │ │ │ │ -234 for (size_t i=0; i iterator │ │ │ │ -Iterator used to iterate through a vector. │ │ │ │ -DDeeffiinniittiioonn reserveddeque.hh:67 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_v_a_l_u_e___t_y_p_e │ │ │ │ -T value_type │ │ │ │ -The type of object, T, stored in the vector. │ │ │ │ -DDeeffiinniittiioonn reserveddeque.hh:55 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e │ │ │ │ -ReservedDeque() │ │ │ │ -Constructor. │ │ │ │ -DDeeffiinniittiioonn reserveddeque.hh:76 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_e_m_p_t_y │ │ │ │ -bool empty() const │ │ │ │ -Returns true if vector has no elements. │ │ │ │ -DDeeffiinniittiioonn reserveddeque.hh:212 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_b_a_c_k │ │ │ │ -const_reference back() const │ │ │ │ -Returns const reference to last element of vector. │ │ │ │ -DDeeffiinniittiioonn reserveddeque.hh:195 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_o_p_e_r_a_t_o_r_<_< │ │ │ │ -friend std::ostream & operator<<(std::ostream &s, const ReservedDeque &v) │ │ │ │ -Send ReservedDeque to an output stream. │ │ │ │ -DDeeffiinniittiioonn reserveddeque.hh:232 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_p_u_s_h___f_r_o_n_t │ │ │ │ -void push_front(const T &t) │ │ │ │ -Prepends an element to the begin of a deque if size const_iterator │ │ │ │ -Const iterator used to iterate through a vector. │ │ │ │ -DDeeffiinniittiioonn reserveddeque.hh:69 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_s_i_z_e │ │ │ │ -size_type size() const │ │ │ │ -Returns number of elements in the vector. │ │ │ │ -DDeeffiinniittiioonn reserveddeque.hh:206 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_e_n_d │ │ │ │ -const_iterator end() const │ │ │ │ -Returns a const_iterator pointing to the end of the vector. │ │ │ │ -DDeeffiinniittiioonn reserveddeque.hh:155 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_r_e_s_i_z_e │ │ │ │ -void resize(size_t s) │ │ │ │ -Specifies a new size for the vector. │ │ │ │ -DDeeffiinniittiioonn reserveddeque.hh:100 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_b_e_g_i_n │ │ │ │ -iterator begin() │ │ │ │ -Returns a iterator pointing to the beginning of the vector. │ │ │ │ -DDeeffiinniittiioonn reserveddeque.hh:140 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_b_e_g_i_n │ │ │ │ -const_iterator begin() const │ │ │ │ -Returns a const_iterator pointing to the beginning of the vector. │ │ │ │ -DDeeffiinniittiioonn reserveddeque.hh:145 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e │ │ │ │ -ReservedDeque(std::initializer_list< T > const &l) │ │ │ │ -DDeeffiinniittiioonn reserveddeque.hh:81 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_s_i_z_e___t_y_p_e │ │ │ │ -size_t size_type │ │ │ │ -An unsigned integral type. │ │ │ │ -DDeeffiinniittiioonn reserveddeque.hh:63 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_e_r_v_e_d_D_e_q_u_e_:_:_p_u_s_h___b_a_c_k │ │ │ │ -void push_back(const T &t) │ │ │ │ -Appends an element to the end of a vector, up to the maximum size n, O(1) time. │ │ │ │ -DDeeffiinniittiioonn reserveddeque.hh:107 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ +DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_E_n_t_i_t_y_D_O_F_s │ │ │ │ +Range of DOFs associated to sub-entity. │ │ │ │ +DDeeffiinniittiioonn subentitydofs.hh:47 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_E_n_t_i_t_y_D_O_F_s_:_:_b_e_g_i_n │ │ │ │ +auto begin() const │ │ │ │ +Create begin iterator for access to range of contained local indices. │ │ │ │ +DDeeffiinniittiioonn subentitydofs.hh:117 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_E_n_t_i_t_y_D_O_F_s_:_:_s_i_z_e │ │ │ │ +auto size() const │ │ │ │ +Return number of contained DOFs. │ │ │ │ +DDeeffiinniittiioonn subentitydofs.hh:129 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_E_n_t_i_t_y_D_O_F_s_:_:_b_i_n_d │ │ │ │ +SubEntityDOFs & bind(const LocalView &localView, const Intersection │ │ │ │ +&intersection) │ │ │ │ +Bind SubEntityDOFs object to LocalView and sub-entity. │ │ │ │ +DDeeffiinniittiioonn subentitydofs.hh:111 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_E_n_t_i_t_y_D_O_F_s_:_:_c_o_n_t_a_i_n_s │ │ │ │ +bool contains(std::size_t localIndex) const │ │ │ │ +Check if given local index is contained in this range of DOFs. │ │ │ │ +DDeeffiinniittiioonn subentitydofs.hh:141 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_E_n_t_i_t_y_D_O_F_s_:_:_e_n_d │ │ │ │ +auto end() const │ │ │ │ +Create end iterator for access to range of contained local indices. │ │ │ │ +DDeeffiinniittiioonn subentitydofs.hh:123 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_E_n_t_i_t_y_D_O_F_s_:_:_b_i_n_d │ │ │ │ +SubEntityDOFs & bind(const LocalView &localView, std::size_t subEntityIndex, │ │ │ │ +std::size_t subEntityCodim) │ │ │ │ +Bind SubEntityDOFs object to LocalView and sub-entity. │ │ │ │ +DDeeffiinniittiioonn subentitydofs.hh:69 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _r_e_s_e_r_v_e_d_d_e_q_u_e_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _s_u_b_e_n_t_i_t_y_d_o_f_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00218.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: polymorphicsmallobject.hh File Reference │ │ │ +Dune-Functions: transformedindexbasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,46 +88,73 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
polymorphicsmallobject.hh File Reference
│ │ │ +
transformedindexbasis.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <cstddef>
│ │ │ +
#include <tuple>
│ │ │ #include <utility>
│ │ │ -#include <type_traits>
│ │ │ -#include <algorithm>
│ │ │ +#include <dune/common/hybridutilities.hh>
│ │ │ +#include <dune/common/reservedvector.hh>
│ │ │ +#include <dune/common/typeutilities.hh>
│ │ │ +#include <dune/functions/common/staticforloop.hh>
│ │ │ +#include <dune/functions/common/type_traits.hh>
│ │ │ +#include <dune/functions/common/utility.hh>
│ │ │ +#include <dune/functions/functionspacebases/basistags.hh>
│ │ │ +#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ +#include <dune/functions/functionspacebases/concepts.hh>
│ │ │ +#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::PolymorphicSmallObject< Base, bufferSize >
 A wrapper providing small object optimization with polymorphic types. More...
class  Dune::Functions::Experimental::TransformedIndexPreBasis< RPB, T >
 A pre-basis transforming multi-indices. More...
class  Dune::Functions::BasisFactory::Experimental::GenericIndexingTransformation< IndexTransformation, SizeImplementation, ContainerDescriptorImplementation, minIS, maxIS >
 A generic implementation of a transformation. More...
│ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ + │ │ │ + │ │ │ +

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::Experimental
namespace  Dune::Functions::BasisFactory
namespace  Dune::Functions::BasisFactory::Experimental
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ +Functions

template<class RPB, class T>
 Dune::Functions::Experimental::TransformedIndexPreBasis (RPB &&, T &&) -> TransformedIndexPreBasis< std::decay_t< RPB >, std::decay_t< T > >
template<class RawPreBasisFactory, class Transformation>
auto Dune::Functions::BasisFactory::Experimental::transformIndices (RawPreBasisFactory &&preBasisFactory, Transformation &&transformation)
 Create a TransformedIndexPreBasisFactory.
template<class IndexTransformation, class SizeImplementation, class ContainerDescriptorImplementation, std::size_t minIndexSize, std::size_t maxIndexSize>
auto Dune::Functions::BasisFactory::Experimental::indexTransformation (IndexTransformation &&indexTransformation, SizeImplementation &&sizeImplementation, ContainerDescriptorImplementation &&containerDescriptorImplementation, Dune::index_constant< minIndexSize >, Dune::index_constant< maxIndexSize >)
 A generic implementation of a transformation.
template<class IndexTransformation, class SizeImplementation, std::size_t minIndexSize, std::size_t maxIndexSize>
auto Dune::Functions::BasisFactory::Experimental::indexTransformation (IndexTransformation &&indexTrafo, SizeImplementation &&sizeImpl, Dune::index_constant< minIndexSize > minSize, Dune::index_constant< maxIndexSize > maxSize)
 Fallback implementation if no container descriptor argument is given.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,22 +1,60 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -polymorphicsmallobject.hh File Reference │ │ │ │ -#include │ │ │ │ +transformedindexbasis.hh File Reference │ │ │ │ +#include │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_s_t_a_t_i_c_f_o_r_l_o_o_p_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_b_a_s_i_s_t_a_g_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t_<_ _B_a_s_e_,_ _b_u_f_f_e_r_S_i_z_e_ _> │ │ │ │ -  A wrapper providing small object optimization with polymorphic types. │ │ │ │ - _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_<_ _R_P_B_,_ _T_ _> │ │ │ │ +  A pre-basis transforming multi-indices. _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_: │ │ │ │ + _G_e_n_e_r_i_c_I_n_d_e_x_i_n_g_T_r_a_n_s_f_o_r_m_a_t_i_o_n_<_ _I_n_d_e_x_T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _S_i_z_e_I_m_p_l_e_m_e_n_t_a_t_i_o_n_, │ │ │ │ + _C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_I_m_p_l_e_m_e_n_t_a_t_i_o_n_,_ _m_i_n_I_S_,_ _m_a_x_I_S_ _> │ │ │ │ +  A generic implementation of a transformation. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ +namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l │ │ │ │ +namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ +namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l │ │ │ │ +FFuunnccttiioonnss │ │ │ │ +template │ │ │ │ +   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s (RPB &&, T &&) - │ │ │ │ + > TransformedIndexPreBasis< std::decay_t< RPB >, std::decay_t< T > > │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_t_r_a_n_s_f_o_r_m_I_n_d_i_c_e_s │ │ │ │ + (RawPreBasisFactory &&preBasisFactory, Transformation &&transformation) │ │ │ │ +  Create a TransformedIndexPreBasisFactory. │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_i_n_d_e_x_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ + (IndexTransformation &&indexTransformation, SizeImplementation │ │ │ │ + &&sizeImplementation, ContainerDescriptorImplementation │ │ │ │ + &&containerDescriptorImplementation, Dune::index_constant< minIndexSize │ │ │ │ + >, Dune::index_constant< maxIndexSize >) │ │ │ │ +  A generic implementation of a transformation. │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_i_n_d_e_x_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ + (IndexTransformation &&indexTrafo, SizeImplementation &&sizeImpl, Dune:: │ │ │ │ + index_constant< minIndexSize > minSize, Dune::index_constant< │ │ │ │ + maxIndexSize > maxSize) │ │ │ │ +  Fallback implementation if no container descriptor argument is given. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _p_o_l_y_m_o_r_p_h_i_c_s_m_a_l_l_o_b_j_e_c_t_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _t_r_a_n_s_f_o_r_m_e_d_i_n_d_e_x_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00218_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: polymorphicsmallobject.hh Source File │ │ │ +Dune-Functions: transformedindexbasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,208 +88,364 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
polymorphicsmallobject.hh
│ │ │ +
transformedindexbasis.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH
│ │ │ -
8#define DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH
│ │ │ +
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH
│ │ │
9
│ │ │ -
10#include <cstddef>
│ │ │ +
10#include <tuple>
│ │ │
11#include <utility>
│ │ │ -
12#include <type_traits>
│ │ │ -
13#include <algorithm>
│ │ │ -
14
│ │ │ -
15namespace Dune {
│ │ │ -
16namespace Functions {
│ │ │ +
12
│ │ │ +
13#include <dune/common/hybridutilities.hh>
│ │ │ +
14#include <dune/common/reservedvector.hh>
│ │ │ +
15#include <dune/common/typeutilities.hh>
│ │ │ +
16#include <dune/common/hybridutilities.hh>
│ │ │
17
│ │ │ -
18
│ │ │ -
49template<class Base, size_t bufferSize>
│ │ │ -
│ │ │ - │ │ │ -
51{
│ │ │ -
52 // Actual buffer size must be > 0
│ │ │ -
53 static constexpr std::size_t actualBufferSize = std::max(sizeof(std::byte), bufferSize);
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
25
│ │ │ +
26
│ │ │ +
27namespace Dune {
│ │ │ +
28namespace Functions {
│ │ │ +
29namespace Experimental {
│ │ │ +
30
│ │ │ +
31// *****************************************************************************
│ │ │ +
32// *****************************************************************************
│ │ │ +
33
│ │ │ +
50template<class RPB, class T>
│ │ │ +
│ │ │ + │ │ │ +
52{
│ │ │ +
53 using Transformation = T;
│ │ │
54
│ │ │ -
55 // Alignment requirement for the buffer. The `Derived` type must have
│ │ │ -
56 // an alignment requirement that is a divisor of `bufferAlignment`
│ │ │ -
57 static constexpr std::size_t bufferAlignment = alignof(std::max_align_t);
│ │ │ + │ │ │ +
56
│ │ │ +
57public:
│ │ │
58
│ │ │ -
59public:
│ │ │ +
59 using RawPreBasis = RPB;
│ │ │
60
│ │ │ -
│ │ │ - │ │ │ -
63 p_(nullptr)
│ │ │ -
64 {}
│ │ │ -
│ │ │ -
65
│ │ │ -
72 template<class Derived,
│ │ │ -
73 std::enable_if_t<std::is_base_of_v<Base, std::remove_cv_t<
│ │ │ -
74 std::remove_reference_t<Derived>>>, int> = 0>
│ │ │ -
│ │ │ -
75 PolymorphicSmallObject(Derived&& derived)
│ │ │ -
76 {
│ │ │ -
77 constexpr bool useBuffer = (sizeof(Derived) <= bufferSize)
│ │ │ -
78 && (bufferAlignment % alignof(Derived) == 0);
│ │ │ -
79
│ │ │ -
80 if constexpr (useBuffer) {
│ │ │ -
81 p_ = new (&buffer_) Derived(std::forward<Derived>(derived));
│ │ │ -
82 } else {
│ │ │ -
83 p_ = new Derived(std::forward<Derived>(derived));
│ │ │ -
84 }
│ │ │ -
85 }
│ │ │ -
│ │ │ -
86
│ │ │ -
│ │ │ - │ │ │ -
89 {
│ │ │ -
90 moveToWrappedObject(std::move(other));
│ │ │ -
91 }
│ │ │ -
│ │ │ -
92
│ │ │ -
│ │ │ - │ │ │ -
95 {
│ │ │ -
96 copyToWrappedObject(other);
│ │ │ -
97 }
│ │ │ -
│ │ │ -
98
│ │ │ -
│ │ │ - │ │ │ -
101 {
│ │ │ -
102 destroyWrappedObject();
│ │ │ -
103 }
│ │ │ +
62 using GridView = typename RawPreBasis::GridView;
│ │ │ +
63
│ │ │ +
65 using size_type = std::size_t;
│ │ │ +
66
│ │ │ +
68 using Node = typename RawPreBasis::Node;
│ │ │ +
69
│ │ │ +
70 static constexpr size_type maxMultiIndexSize = Transformation::maxIndexSize;
│ │ │ +
71 static constexpr size_type minMultiIndexSize = Transformation::minIndexSize;
│ │ │ +
72 static constexpr size_type multiIndexBufferSize = std::max(RawPreBasis::multiIndexBufferSize, maxMultiIndexSize);
│ │ │ +
73
│ │ │ +
79 template<class RPB_R, class T_R>
│ │ │ +
│ │ │ +
80 TransformedIndexPreBasis(RPB_R&& rawPreBasis, T_R&& transformation) :
│ │ │ +
81 rawPreBasis_(std::forward<RPB_R>(rawPreBasis)),
│ │ │ +
82 transformation_(std::forward<T_R>(transformation))
│ │ │ +
83 {}
│ │ │ +
│ │ │ +
84
│ │ │ +
│ │ │ + │ │ │ +
87 {
│ │ │ +
88 rawPreBasis_.initializeIndices();
│ │ │ +
89 }
│ │ │ +
│ │ │ +
90
│ │ │ +
│ │ │ +
92 const GridView& gridView() const
│ │ │ +
93 {
│ │ │ +
94 return rawPreBasis_.gridView();
│ │ │ +
95 }
│ │ │ +
│ │ │ +
96
│ │ │ +
│ │ │ +
98 void update(const GridView& gv)
│ │ │ +
99 {
│ │ │ +
100 rawPreBasis_.update(gv);
│ │ │ +
101 }
│ │ │
│ │ │ -
104
│ │ │ +
102
│ │ │
│ │ │ - │ │ │ -
107 {
│ │ │ -
108 if (&other!=this)
│ │ │ -
109 {
│ │ │ -
110 destroyWrappedObject();
│ │ │ -
111 copyToWrappedObject(other);
│ │ │ -
112 }
│ │ │ -
113 return *this;
│ │ │ -
114 }
│ │ │ -
│ │ │ -
115
│ │ │ -
│ │ │ - │ │ │ -
118 {
│ │ │ -
119 destroyWrappedObject();
│ │ │ -
120 moveToWrappedObject(std::move(other));
│ │ │ -
121 return *this;
│ │ │ + │ │ │ +
107 {
│ │ │ +
108 return rawPreBasis_.makeNode();
│ │ │ +
109 }
│ │ │ +
│ │ │ +
110
│ │ │ +
│ │ │ + │ │ │ +
113 {
│ │ │ +
114 return size(Dune::ReservedVector<size_type, multiIndexBufferSize>{});
│ │ │ +
115 }
│ │ │ +
│ │ │ +
116
│ │ │ +
118 template<class SizePrefix>
│ │ │ +
│ │ │ +
119 size_type size(const SizePrefix& prefix) const
│ │ │ +
120 {
│ │ │ +
121 return transformation_.size(prefix, rawPreBasis_);
│ │ │
122 }
│ │ │
│ │ │
123
│ │ │
│ │ │ -
125 explicit operator bool() const
│ │ │ + │ │ │
126 {
│ │ │ -
127 return p_;
│ │ │ +
127 return transformation_.containerDescriptor(rawPreBasis_);
│ │ │
128 }
│ │ │
│ │ │
129
│ │ │
│ │ │ -
131 bool bufferUsed() const
│ │ │ + │ │ │
132 {
│ │ │ -
133 return ((void*) (p_) == (void*)(&buffer_));
│ │ │ +
133 return transformation_.dimension(rawPreBasis_);
│ │ │
134 }
│ │ │
│ │ │
135
│ │ │
│ │ │ -
137 const Base& get() const
│ │ │ + │ │ │
138 {
│ │ │ -
139 return *p_;
│ │ │ +
139 return rawPreBasis_.maxNodeSize();
│ │ │
140 }
│ │ │
│ │ │ -
141
│ │ │ -
│ │ │ -
143 Base& get()
│ │ │ -
144 {
│ │ │ -
145 return *p_;
│ │ │ -
146 }
│ │ │ -
│ │ │ -
147
│ │ │ -
148private:
│ │ │ -
149
│ │ │ -
150 void destroyWrappedObject() noexcept
│ │ │ -
151 {
│ │ │ -
152 if (operator bool())
│ │ │ -
153 {
│ │ │ -
154 if (bufferUsed())
│ │ │ -
155 p_->~Base();
│ │ │ -
156 else
│ │ │ -
157 delete p_;
│ │ │ -
158 }
│ │ │ -
159 }
│ │ │ -
160
│ │ │ -
161 void moveToWrappedObject(PolymorphicSmallObject&& other) noexcept
│ │ │ -
162 {
│ │ │ -
163 if (other.bufferUsed())
│ │ │ -
164 p_ = other.p_->move(&buffer_);
│ │ │ -
165 else
│ │ │ -
166 {
│ │ │ -
167 // We don't need to check for &other_!=this, because you can't
│ │ │ -
168 // have an rvalue to *this and call it's assignment/constructor
│ │ │ -
169 // at the same time. (Despite trying to shoot yourself in the foot
│ │ │ -
170 // with std::move explicitly.)
│ │ │ -
171
│ │ │ -
172 // Take ownership of allocated object
│ │ │ -
173 p_ = other.p_;
│ │ │ +
141
│ │ │ +
│ │ │ + │ │ │ +
143 {
│ │ │ +
144 return rawPreBasis_;
│ │ │ +
145 }
│ │ │ +
│ │ │ +
146
│ │ │ +
│ │ │ + │ │ │ +
148 {
│ │ │ +
149 return rawPreBasis_;
│ │ │ +
150 }
│ │ │ +
│ │ │ +
151
│ │ │ +
152 template<class MultiIndex>
│ │ │ +
│ │ │ +
153 void transformIndex(MultiIndex& multiIndex) const
│ │ │ +
154 {
│ │ │ +
155 transformation_.transformIndex(multiIndex, rawPreBasis_);
│ │ │ +
156 }
│ │ │ +
│ │ │ +
157
│ │ │ +
158 template<typename It>
│ │ │ +
│ │ │ +
159 It indices(const Node& node, It it) const
│ │ │ +
160 {
│ │ │ +
161 rawPreBasis().indices(node, it);
│ │ │ +
162 for(std::size_t i=0; i<node.size(); ++i)
│ │ │ +
163 {
│ │ │ +
164 transformIndex(*it);
│ │ │ +
165 ++it;
│ │ │ +
166 }
│ │ │ +
167 return it;
│ │ │ +
168 }
│ │ │ +
│ │ │ +
169
│ │ │ +
170protected:
│ │ │ + │ │ │ +
172 Transformation transformation_;
│ │ │ +
173};
│ │ │ +
│ │ │
174
│ │ │ -
175 // Leave pointer in a clean state to avoid double freeing it.
│ │ │ -
176 other.p_ = 0;
│ │ │ -
177 }
│ │ │ -
178 }
│ │ │ -
179
│ │ │ -
180 void copyToWrappedObject(const PolymorphicSmallObject& other)
│ │ │ -
181 {
│ │ │ -
182 if (other.bufferUsed())
│ │ │ -
183 p_ = other.p_->clone(&buffer_);
│ │ │ -
184 else
│ │ │ -
185 p_ = other.p_->clone();
│ │ │ -
186 }
│ │ │ -
187
│ │ │ -
188 alignas(bufferAlignment) std::byte buffer_[actualBufferSize];
│ │ │ -
189 Base* p_;
│ │ │ -
190};
│ │ │ -
│ │ │ -
191
│ │ │ -
192
│ │ │ -
193} // namespace Functions
│ │ │ -
194} // namespace Dune
│ │ │ -
195
│ │ │ -
196#endif // DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH
│ │ │ +
175template<class RPB, class T>
│ │ │ + │ │ │ +
177
│ │ │ +
178
│ │ │ +
179} // end namespace Experimental
│ │ │ +
180
│ │ │ +
181
│ │ │ +
182namespace BasisFactory {
│ │ │ +
183namespace Experimental {
│ │ │ +
184
│ │ │ +
196template<class RawPreBasisFactory, class Transformation>
│ │ │ +
│ │ │ + │ │ │ +
198 RawPreBasisFactory&& preBasisFactory,
│ │ │ +
199 Transformation&& transformation)
│ │ │ +
200{
│ │ │ +
201 return [
│ │ │ +
202 preBasisFactory=std::forward<RawPreBasisFactory>(preBasisFactory),
│ │ │ +
203 transformation =std::forward<Transformation>(transformation)
│ │ │ +
204 ](const auto& gridView) {
│ │ │ +
205 return Dune::Functions::Experimental::TransformedIndexPreBasis(preBasisFactory(gridView), std::move(transformation));
│ │ │ +
206 };
│ │ │ +
207}
│ │ │ +
│ │ │ +
208
│ │ │ +
209
│ │ │ +
210
│ │ │ +
229template<class IndexTransformation, class SizeImplementation, class ContainerDescriptorImplementation, std::size_t minIS, std::size_t maxIS>
│ │ │ +
│ │ │ + │ │ │ +
231{
│ │ │ +
232public:
│ │ │ +
233
│ │ │ +
234 static constexpr std::size_t minIndexSize = minIS;
│ │ │ +
235 static constexpr std::size_t maxIndexSize = maxIS;
│ │ │ +
236
│ │ │ +
237 template<class IT_R, class SI_R, class CD_R>
│ │ │ +
│ │ │ +
238 GenericIndexingTransformation(IT_R&& indexTransformation, SI_R&& sizeImplementation, CD_R&& containerDescriptorImplementation) :
│ │ │ +
239 indexTransformation_(std::forward<IT_R>(indexTransformation)),
│ │ │ +
240 sizeImplementation_(std::forward<SI_R>(sizeImplementation)),
│ │ │ +
241 containerDescriptorImplementation_(std::forward<CD_R>(containerDescriptorImplementation))
│ │ │ +
242 {}
│ │ │ +
│ │ │ +
243
│ │ │ +
244 template<class MultiIndex, class PreBasis>
│ │ │ +
│ │ │ +
245 void transformIndex(MultiIndex& multiIndex, const PreBasis& preBasis) const
│ │ │ +
246 {
│ │ │ +
247 indexTransformation_(multiIndex, preBasis);
│ │ │ +
248 }
│ │ │ +
│ │ │ +
249
│ │ │ +
250 template<class Prefix, class PreBasis>
│ │ │ +
│ │ │ +
251 auto size(const Prefix& prefix, const PreBasis& preBasis) const
│ │ │ +
252 {
│ │ │ +
253 return sizeImplementation_(prefix, preBasis);
│ │ │ +
254 }
│ │ │ +
│ │ │ +
255
│ │ │ +
256 template<class PreBasis>
│ │ │ +
│ │ │ +
257 auto dimension(const PreBasis& preBasis) const
│ │ │ +
258 {
│ │ │ +
259 return preBasis.dimension();
│ │ │ +
260 }
│ │ │ +
│ │ │ +
261
│ │ │ +
262 template<class PreBasis>
│ │ │ +
│ │ │ +
263 auto containerDescriptor(const PreBasis& preBasis) const
│ │ │ +
264 {
│ │ │ +
265 return containerDescriptorImplementation_(preBasis);
│ │ │ +
266 }
│ │ │ +
│ │ │ +
267
│ │ │ +
268private:
│ │ │ +
269 IndexTransformation indexTransformation_;
│ │ │ +
270 SizeImplementation sizeImplementation_;
│ │ │ +
271 ContainerDescriptorImplementation containerDescriptorImplementation_;
│ │ │ +
272};
│ │ │ +
│ │ │ +
273
│ │ │ +
274
│ │ │ +
275
│ │ │ +
295template<class IndexTransformation, class SizeImplementation, class ContainerDescriptorImplementation, std::size_t minIndexSize, std::size_t maxIndexSize>
│ │ │ +
│ │ │ +
296auto indexTransformation(IndexTransformation&& indexTransformation,
│ │ │ +
297 SizeImplementation&& sizeImplementation,
│ │ │ +
298 ContainerDescriptorImplementation&& containerDescriptorImplementation,
│ │ │ +
299 Dune::index_constant<minIndexSize>,
│ │ │ +
300 Dune::index_constant<maxIndexSize>)
│ │ │ +
301{
│ │ │ + │ │ │ +
303 std::decay_t<IndexTransformation>,
│ │ │ +
304 std::decay_t<SizeImplementation>,
│ │ │ +
305 std::decay_t<ContainerDescriptorImplementation>,
│ │ │ +
306 minIndexSize, maxIndexSize>(
│ │ │ +
307 std::forward<IndexTransformation>(indexTransformation),
│ │ │ +
308 std::forward<SizeImplementation>(sizeImplementation),
│ │ │ +
309 std::forward<ContainerDescriptorImplementation>(containerDescriptorImplementation));
│ │ │ +
310}
│ │ │ +
│ │ │ +
311
│ │ │ +
313template<class IndexTransformation, class SizeImplementation,
│ │ │ +
314 std::size_t minIndexSize, std::size_t maxIndexSize>
│ │ │ +
│ │ │ +
315auto indexTransformation(IndexTransformation&& indexTrafo,
│ │ │ +
316 SizeImplementation&& sizeImpl,
│ │ │ +
317 Dune::index_constant<minIndexSize> minSize,
│ │ │ +
318 Dune::index_constant<maxIndexSize> maxSize)
│ │ │ +
319{
│ │ │ +
320 return indexTransformation(indexTrafo, sizeImpl,
│ │ │ +
321 [](auto&&) { return Dune::Functions::ContainerDescriptors::Unknown{}; },
│ │ │ +
322 minSize, maxSize);
│ │ │ +
323}
│ │ │ +
│ │ │ +
324
│ │ │ +
325} // end namespace Experimental
│ │ │ +
326} // end namespace BasisFactory
│ │ │ +
327} // end namespace Functions
│ │ │ +
328} // end namespace Dune
│ │ │ +
329
│ │ │ +
330
│ │ │ +
331#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
const Base & get() const
Obtain reference to stored object.
Definition polymorphicsmallobject.hh:137
│ │ │ -
bool bufferUsed() const
Check if object is stored in internal stack buffer.
Definition polymorphicsmallobject.hh:131
│ │ │ -
PolymorphicSmallObject(Derived &&derived)
Construct from object.
Definition polymorphicsmallobject.hh:75
│ │ │ -
PolymorphicSmallObject(PolymorphicSmallObject &&other) noexcept
Move constructor from other PolymorphicSmallObject.
Definition polymorphicsmallobject.hh:88
│ │ │ -
PolymorphicSmallObject & operator=(const PolymorphicSmallObject &other)
Copy assignment from other PolymorphicSmallObject.
Definition polymorphicsmallobject.hh:106
│ │ │ -
PolymorphicSmallObject & operator=(PolymorphicSmallObject &&other) noexcept
Move assignment from other PolymorphicSmallObject.
Definition polymorphicsmallobject.hh:117
│ │ │ -
PolymorphicSmallObject(const PolymorphicSmallObject &other)
Copy constructor from other PolymorphicSmallObject.
Definition polymorphicsmallobject.hh:94
│ │ │ -
~PolymorphicSmallObject()
Destructor.
Definition polymorphicsmallobject.hh:100
│ │ │ -
PolymorphicSmallObject()
Default constructor.
Definition polymorphicsmallobject.hh:62
│ │ │ -
Base & get()
Obtain mutable reference to stored object.
Definition polymorphicsmallobject.hh:143
│ │ │ +
Definition subdomain.hh:28
│ │ │ +
TransformedIndexPreBasis(RPB &&, T &&) -> TransformedIndexPreBasis< std::decay_t< RPB >, std::decay_t< T > >
│ │ │ +
Definition argyrisbasis.hh:926
│ │ │ +
auto indexTransformation(IndexTransformation &&indexTransformation, SizeImplementation &&sizeImplementation, ContainerDescriptorImplementation &&containerDescriptorImplementation, Dune::index_constant< minIndexSize >, Dune::index_constant< maxIndexSize >)
A generic implementation of a transformation.
Definition transformedindexbasis.hh:296
│ │ │ +
auto transformIndices(RawPreBasisFactory &&preBasisFactory, Transformation &&transformation)
Create a TransformedIndexPreBasisFactory.
Definition transformedindexbasis.hh:197
│ │ │ +
Fallback container descriptor if nothing else fits.
Definition containerdescriptors.hh:52
│ │ │ +
A pre-basis transforming multi-indices.
Definition transformedindexbasis.hh:52
│ │ │ +
It indices(const Node &node, It it) const
Definition transformedindexbasis.hh:159
│ │ │ +
Transformation transformation_
Definition transformedindexbasis.hh:172
│ │ │ +
void initializeIndices()
Initialize the global indices.
Definition transformedindexbasis.hh:86
│ │ │ +
typename RawPreBasis::GridView GridView
The grid view that the FE basis is defined on.
Definition transformedindexbasis.hh:62
│ │ │ +
void transformIndex(MultiIndex &multiIndex) const
Definition transformedindexbasis.hh:153
│ │ │ +
RawPreBasis rawPreBasis_
Definition transformedindexbasis.hh:171
│ │ │ +
typename RawPreBasis::Node Node
Template mapping root tree path to type of created tree node.
Definition transformedindexbasis.hh:68
│ │ │ +
TransformedIndexPreBasis(RPB_R &&rawPreBasis, T_R &&transformation)
Constructor for given child pre-basis objects.
Definition transformedindexbasis.hh:80
│ │ │ +
RawPreBasis & rawPreBasis()
Definition transformedindexbasis.hh:147
│ │ │ +
static constexpr size_type maxMultiIndexSize
Definition transformedindexbasis.hh:70
│ │ │ +
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition transformedindexbasis.hh:98
│ │ │ +
Node makeNode() const
Create tree node.
Definition transformedindexbasis.hh:106
│ │ │ +
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition transformedindexbasis.hh:92
│ │ │ +
size_type size(const SizePrefix &prefix) const
Return number of possible values for next position in multi index.
Definition transformedindexbasis.hh:119
│ │ │ +
RPB RawPreBasis
Definition transformedindexbasis.hh:59
│ │ │ +
size_type size() const
Same as size(prefix) with empty prefix.
Definition transformedindexbasis.hh:112
│ │ │ +
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition transformedindexbasis.hh:137
│ │ │ +
std::size_t size_type
Type used for indices and size information.
Definition transformedindexbasis.hh:65
│ │ │ +
static constexpr size_type multiIndexBufferSize
Definition transformedindexbasis.hh:72
│ │ │ +
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition transformedindexbasis.hh:131
│ │ │ +
const RawPreBasis & rawPreBasis() const
Definition transformedindexbasis.hh:142
│ │ │ +
static constexpr size_type minMultiIndexSize
Definition transformedindexbasis.hh:71
│ │ │ +
auto containerDescriptor() const
Return the container descriptor of the transformed pre-basis.
Definition transformedindexbasis.hh:125
│ │ │ +
A generic implementation of a transformation.
Definition transformedindexbasis.hh:231
│ │ │ +
GenericIndexingTransformation(IT_R &&indexTransformation, SI_R &&sizeImplementation, CD_R &&containerDescriptorImplementation)
Definition transformedindexbasis.hh:238
│ │ │ +
static constexpr std::size_t maxIndexSize
Definition transformedindexbasis.hh:235
│ │ │ +
auto containerDescriptor(const PreBasis &preBasis) const
Definition transformedindexbasis.hh:263
│ │ │ +
auto dimension(const PreBasis &preBasis) const
Definition transformedindexbasis.hh:257
│ │ │ +
auto size(const Prefix &prefix, const PreBasis &preBasis) const
Definition transformedindexbasis.hh:251
│ │ │ +
static constexpr std::size_t minIndexSize
Definition transformedindexbasis.hh:234
│ │ │ +
void transformIndex(MultiIndex &multiIndex, const PreBasis &preBasis) const
Definition transformedindexbasis.hh:245
│ │ │ + │ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,208 +1,422 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -polymorphicsmallobject.hh │ │ │ │ +transformedindexbasis.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH │ │ │ │ -8#define DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH │ │ │ │ +8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ +10#include │ │ │ │ 11#include │ │ │ │ -12#include │ │ │ │ -13#include │ │ │ │ -14 │ │ │ │ -15namespace _D_u_n_e { │ │ │ │ -16namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +12 │ │ │ │ +13#include │ │ │ │ +14#include │ │ │ │ +15#include │ │ │ │ +16#include │ │ │ │ 17 │ │ │ │ -18 │ │ │ │ -49template │ │ │ │ -_5_0class _P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t │ │ │ │ -51{ │ │ │ │ -52 // Actual buffer size must be > 0 │ │ │ │ -53 static constexpr std::size_t actualBufferSize = std::max(sizeof(std::byte), │ │ │ │ -bufferSize); │ │ │ │ +18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_s_t_a_t_i_c_f_o_r_l_o_o_p_._h_h> │ │ │ │ +19#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ +20#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ +21#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_b_a_s_i_s_t_a_g_s_._h_h> │ │ │ │ +22#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ +23#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +24#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ +25 │ │ │ │ +26 │ │ │ │ +27namespace _D_u_n_e { │ │ │ │ +28namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +29namespace _E_x_p_e_r_i_m_e_n_t_a_l { │ │ │ │ +30 │ │ │ │ +31/ │ │ │ │ +/ ***************************************************************************** │ │ │ │ +32/ │ │ │ │ +/ ***************************************************************************** │ │ │ │ +33 │ │ │ │ +50template │ │ │ │ +_5_1class _T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s │ │ │ │ +52{ │ │ │ │ +53 using Transformation = T; │ │ │ │ 54 │ │ │ │ -55 // Alignment requirement for the buffer. The `Derived` type must have │ │ │ │ -56 // an alignment requirement that is a divisor of `bufferAlignment` │ │ │ │ -57 static constexpr std::size_t bufferAlignment = alignof(std::max_align_t); │ │ │ │ +55 using This = _T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_<_R_P_B_,_ _T_>; │ │ │ │ +56 │ │ │ │ +57public: │ │ │ │ 58 │ │ │ │ -59public: │ │ │ │ +_5_9 using _R_a_w_P_r_e_B_a_s_i_s = RPB; │ │ │ │ 60 │ │ │ │ -_6_2 _P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t() : │ │ │ │ -63 p_(nullptr) │ │ │ │ -64 {} │ │ │ │ -65 │ │ │ │ -72 template>>, int> = 0> │ │ │ │ -_7_5 _P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t(Derived&& derived) │ │ │ │ -76 { │ │ │ │ -77 constexpr bool useBuffer = (sizeof(Derived) <= bufferSize) │ │ │ │ -78 && (bufferAlignment % alignof(Derived) == 0); │ │ │ │ -79 │ │ │ │ -80 if constexpr (useBuffer) { │ │ │ │ -81 p_ = new (&buffer_) Derived(std::forward(derived)); │ │ │ │ -82 } else { │ │ │ │ -83 p_ = new Derived(std::forward(derived)); │ │ │ │ -84 } │ │ │ │ -85 } │ │ │ │ -86 │ │ │ │ -_8_8 _P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t(_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t&& other) noexcept │ │ │ │ -89 { │ │ │ │ -90 moveToWrappedObject(std::move(other)); │ │ │ │ -91 } │ │ │ │ -92 │ │ │ │ -_9_4 _P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t(const _P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t& other) │ │ │ │ -95 { │ │ │ │ -96 copyToWrappedObject(other); │ │ │ │ -97 } │ │ │ │ -98 │ │ │ │ -_1_0_0 _~_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t() │ │ │ │ -101 { │ │ │ │ -102 destroyWrappedObject(); │ │ │ │ -103 } │ │ │ │ -104 │ │ │ │ -_1_0_6 _P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t& _o_p_e_r_a_t_o_r_=(const _P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t& other) │ │ │ │ +_6_2 using _G_r_i_d_V_i_e_w = typename RawPreBasis::GridView; │ │ │ │ +63 │ │ │ │ +_6_5 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ +66 │ │ │ │ +_6_8 using _N_o_d_e = typename RawPreBasis::Node; │ │ │ │ +69 │ │ │ │ +_7_0 static constexpr _s_i_z_e___t_y_p_e _m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e = Transformation::maxIndexSize; │ │ │ │ +_7_1 static constexpr _s_i_z_e___t_y_p_e _m_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e = Transformation::minIndexSize; │ │ │ │ +_7_2 static constexpr _s_i_z_e___t_y_p_e _m_u_l_t_i_I_n_d_e_x_B_u_f_f_e_r_S_i_z_e = std::max(RawPreBasis:: │ │ │ │ +multiIndexBufferSize, _m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e); │ │ │ │ +73 │ │ │ │ +79 template │ │ │ │ +_8_0 _T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s(RPB_R&& _r_a_w_P_r_e_B_a_s_i_s, T_R&& transformation) : │ │ │ │ +81 _r_a_w_P_r_e_B_a_s_i_s__(std::forward(_r_a_w_P_r_e_B_a_s_i_s)), │ │ │ │ +82 _t_r_a_n_s_f_o_r_m_a_t_i_o_n__(std::forward(transformation)) │ │ │ │ +83 {} │ │ │ │ +84 │ │ │ │ +_8_6 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ +87 { │ │ │ │ +88 _r_a_w_P_r_e_B_a_s_i_s__.initializeIndices(); │ │ │ │ +89 } │ │ │ │ +90 │ │ │ │ +_9_2 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ +93 { │ │ │ │ +94 return _r_a_w_P_r_e_B_a_s_i_s__.gridView(); │ │ │ │ +95 } │ │ │ │ +96 │ │ │ │ +_9_8 void _u_p_d_a_t_e(const _G_r_i_d_V_i_e_w& gv) │ │ │ │ +99 { │ │ │ │ +100 _r_a_w_P_r_e_B_a_s_i_s__.update(gv); │ │ │ │ +101 } │ │ │ │ +102 │ │ │ │ +_1_0_6 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ 107 { │ │ │ │ -108 if (&other!=this) │ │ │ │ -109 { │ │ │ │ -110 destroyWrappedObject(); │ │ │ │ -111 copyToWrappedObject(other); │ │ │ │ -112 } │ │ │ │ -113 return *this; │ │ │ │ -114 } │ │ │ │ -115 │ │ │ │ -_1_1_7 _P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t& _o_p_e_r_a_t_o_r_=(_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t&& other) noexcept │ │ │ │ -118 { │ │ │ │ -119 destroyWrappedObject(); │ │ │ │ -120 moveToWrappedObject(std::move(other)); │ │ │ │ -121 return *this; │ │ │ │ +108 return _r_a_w_P_r_e_B_a_s_i_s__.makeNode(); │ │ │ │ +109 } │ │ │ │ +110 │ │ │ │ +_1_1_2 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ +113 { │ │ │ │ +114 return _s_i_z_e(Dune::ReservedVector{}); │ │ │ │ +115 } │ │ │ │ +116 │ │ │ │ +118 template │ │ │ │ +_1_1_9 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix) const │ │ │ │ +120 { │ │ │ │ +121 return _t_r_a_n_s_f_o_r_m_a_t_i_o_n__.size(prefix, _r_a_w_P_r_e_B_a_s_i_s__); │ │ │ │ 122 } │ │ │ │ 123 │ │ │ │ -_1_2_5 explicit operator bool() const │ │ │ │ +_1_2_5 auto _c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r() const │ │ │ │ 126 { │ │ │ │ -127 return p_; │ │ │ │ +127 return _t_r_a_n_s_f_o_r_m_a_t_i_o_n__.containerDescriptor(_r_a_w_P_r_e_B_a_s_i_s__); │ │ │ │ 128 } │ │ │ │ 129 │ │ │ │ -_1_3_1 bool _b_u_f_f_e_r_U_s_e_d() const │ │ │ │ +_1_3_1 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ 132 { │ │ │ │ -133 return ((void*) (p_) == (void*)(&buffer_)); │ │ │ │ +133 return _t_r_a_n_s_f_o_r_m_a_t_i_o_n__.dimension(_r_a_w_P_r_e_B_a_s_i_s__); │ │ │ │ 134 } │ │ │ │ 135 │ │ │ │ -_1_3_7 const Base& _g_e_t() const │ │ │ │ +_1_3_7 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ 138 { │ │ │ │ -139 return *p_; │ │ │ │ +139 return _r_a_w_P_r_e_B_a_s_i_s__.maxNodeSize(); │ │ │ │ 140 } │ │ │ │ 141 │ │ │ │ -_1_4_3 Base& _g_e_t() │ │ │ │ -144 { │ │ │ │ -145 return *p_; │ │ │ │ -146 } │ │ │ │ -147 │ │ │ │ -148private: │ │ │ │ -149 │ │ │ │ -150 void destroyWrappedObject() noexcept │ │ │ │ -151 { │ │ │ │ -152 if (operator bool()) │ │ │ │ -153 { │ │ │ │ -154 if (_b_u_f_f_e_r_U_s_e_d()) │ │ │ │ -155 p_->~Base(); │ │ │ │ -156 else │ │ │ │ -157 delete p_; │ │ │ │ -158 } │ │ │ │ -159 } │ │ │ │ -160 │ │ │ │ -161 void moveToWrappedObject(_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t&& other) noexcept │ │ │ │ -162 { │ │ │ │ -163 if (other.bufferUsed()) │ │ │ │ -164 p_ = other.p_->move(&buffer_); │ │ │ │ -165 else │ │ │ │ -166 { │ │ │ │ -167 // We don't need to check for &other_!=this, because you can't │ │ │ │ -168 // have an rvalue to *this and call it's assignment/constructor │ │ │ │ -169 // at the same time. (Despite trying to shoot yourself in the foot │ │ │ │ -170 // with std::move explicitly.) │ │ │ │ -171 │ │ │ │ -172 // Take ownership of allocated object │ │ │ │ -173 p_ = other.p_; │ │ │ │ +_1_4_2 const _R_a_w_P_r_e_B_a_s_i_s& _r_a_w_P_r_e_B_a_s_i_s() const │ │ │ │ +143 { │ │ │ │ +144 return _r_a_w_P_r_e_B_a_s_i_s__; │ │ │ │ +145 } │ │ │ │ +146 │ │ │ │ +_1_4_7 _R_a_w_P_r_e_B_a_s_i_s& _r_a_w_P_r_e_B_a_s_i_s() │ │ │ │ +148 { │ │ │ │ +149 return _r_a_w_P_r_e_B_a_s_i_s__; │ │ │ │ +150 } │ │ │ │ +151 │ │ │ │ +152 template │ │ │ │ +_1_5_3 void _t_r_a_n_s_f_o_r_m_I_n_d_e_x(MultiIndex& multiIndex) const │ │ │ │ +154 { │ │ │ │ +155 _t_r_a_n_s_f_o_r_m_a_t_i_o_n__.transformIndex(multiIndex, _r_a_w_P_r_e_B_a_s_i_s__); │ │ │ │ +156 } │ │ │ │ +157 │ │ │ │ +158 template │ │ │ │ +_1_5_9 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ +160 { │ │ │ │ +161 _r_a_w_P_r_e_B_a_s_i_s().indices(node, it); │ │ │ │ +162 for(std::size_t i=0; iclone(&buffer_); │ │ │ │ -184 else │ │ │ │ -185 p_ = other.p_->clone(); │ │ │ │ -186 } │ │ │ │ -187 │ │ │ │ -188 alignas(bufferAlignment) std::byte buffer_[actualBufferSize]; │ │ │ │ -189 Base* p_; │ │ │ │ -190}; │ │ │ │ -191 │ │ │ │ -192 │ │ │ │ -193} // namespace Functions │ │ │ │ -194} // namespace Dune │ │ │ │ -195 │ │ │ │ -196#endif // DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH │ │ │ │ +175template │ │ │ │ +_1_7_6_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s(RPB&&, T&&) -> _T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_<_s_t_d_:_: │ │ │ │ +_d_e_c_a_y___t_<_R_P_B_>, std::decay_t>; │ │ │ │ +177 │ │ │ │ +178 │ │ │ │ +179} // end namespace Experimental │ │ │ │ +180 │ │ │ │ +181 │ │ │ │ +182namespace _B_a_s_i_s_F_a_c_t_o_r_y { │ │ │ │ +183namespace _E_x_p_e_r_i_m_e_n_t_a_l { │ │ │ │ +184 │ │ │ │ +196template │ │ │ │ +_1_9_7auto _t_r_a_n_s_f_o_r_m_I_n_d_i_c_e_s( │ │ │ │ +198 RawPreBasisFactory&& preBasisFactory, │ │ │ │ +199 Transformation&& transformation) │ │ │ │ +200{ │ │ │ │ +201 return [ │ │ │ │ +202 preBasisFactory=std::forward(preBasisFactory), │ │ │ │ +203 transformation =std::forward(transformation) │ │ │ │ +204 ](const auto& gridView) { │ │ │ │ +205 return _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s │ │ │ │ +(preBasisFactory(gridView), std::move(transformation)); │ │ │ │ +206 }; │ │ │ │ +207} │ │ │ │ +208 │ │ │ │ +209 │ │ │ │ +210 │ │ │ │ +229template │ │ │ │ +_2_3_0class _G_e_n_e_r_i_c_I_n_d_e_x_i_n_g_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ +231{ │ │ │ │ +232public: │ │ │ │ +233 │ │ │ │ +_2_3_4 static constexpr std::size_t _m_i_n_I_n_d_e_x_S_i_z_e = minIS; │ │ │ │ +_2_3_5 static constexpr std::size_t _m_a_x_I_n_d_e_x_S_i_z_e = maxIS; │ │ │ │ +236 │ │ │ │ +237 template │ │ │ │ +_2_3_8 _G_e_n_e_r_i_c_I_n_d_e_x_i_n_g_T_r_a_n_s_f_o_r_m_a_t_i_o_n(IT_R&& _i_n_d_e_x_T_r_a_n_s_f_o_r_m_a_t_i_o_n, SI_R&& │ │ │ │ +sizeImplementation, CD_R&& containerDescriptorImplementation) : │ │ │ │ +239 indexTransformation_(std::forward(_i_n_d_e_x_T_r_a_n_s_f_o_r_m_a_t_i_o_n)), │ │ │ │ +240 sizeImplementation_(std::forward(sizeImplementation)), │ │ │ │ +241 containerDescriptorImplementation_(std::forward │ │ │ │ +(containerDescriptorImplementation)) │ │ │ │ +242 {} │ │ │ │ +243 │ │ │ │ +244 template │ │ │ │ +_2_4_5 void _t_r_a_n_s_f_o_r_m_I_n_d_e_x(MultiIndex& multiIndex, const PreBasis& preBasis) const │ │ │ │ +246 { │ │ │ │ +247 indexTransformation_(multiIndex, preBasis); │ │ │ │ +248 } │ │ │ │ +249 │ │ │ │ +250 template │ │ │ │ +_2_5_1 auto _s_i_z_e(const Prefix& prefix, const PreBasis& preBasis) const │ │ │ │ +252 { │ │ │ │ +253 return sizeImplementation_(prefix, preBasis); │ │ │ │ +254 } │ │ │ │ +255 │ │ │ │ +256 template │ │ │ │ +_2_5_7 auto _d_i_m_e_n_s_i_o_n(const PreBasis& preBasis) const │ │ │ │ +258 { │ │ │ │ +259 return preBasis.dimension(); │ │ │ │ +260 } │ │ │ │ +261 │ │ │ │ +262 template │ │ │ │ +_2_6_3 auto _c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r(const PreBasis& preBasis) const │ │ │ │ +264 { │ │ │ │ +265 return containerDescriptorImplementation_(preBasis); │ │ │ │ +266 } │ │ │ │ +267 │ │ │ │ +268private: │ │ │ │ +269 IndexTransformation indexTransformation_; │ │ │ │ +270 SizeImplementation sizeImplementation_; │ │ │ │ +271 ContainerDescriptorImplementation containerDescriptorImplementation_; │ │ │ │ +272}; │ │ │ │ +273 │ │ │ │ +274 │ │ │ │ +275 │ │ │ │ +295template │ │ │ │ +_2_9_6auto _i_n_d_e_x_T_r_a_n_s_f_o_r_m_a_t_i_o_n(IndexTransformation&& _i_n_d_e_x_T_r_a_n_s_f_o_r_m_a_t_i_o_n, │ │ │ │ +297 SizeImplementation&& sizeImplementation, │ │ │ │ +298 ContainerDescriptorImplementation&& containerDescriptorImplementation, │ │ │ │ +299 Dune::index_constant, │ │ │ │ +300 Dune::index_constant) │ │ │ │ +301{ │ │ │ │ +302 return _G_e_n_e_r_i_c_I_n_d_e_x_i_n_g_T_r_a_n_s_f_o_r_m_a_t_i_o_n< │ │ │ │ +303 std::decay_t, │ │ │ │ +304 std::decay_t, │ │ │ │ +305 std::decay_t, │ │ │ │ +306 minIndexSize, maxIndexSize>( │ │ │ │ +307 std::forward(_i_n_d_e_x_T_r_a_n_s_f_o_r_m_a_t_i_o_n), │ │ │ │ +308 std::forward(sizeImplementation), │ │ │ │ +309 std::forward │ │ │ │ +(containerDescriptorImplementation)); │ │ │ │ +310} │ │ │ │ +311 │ │ │ │ +313template │ │ │ │ +_3_1_5auto _i_n_d_e_x_T_r_a_n_s_f_o_r_m_a_t_i_o_n(IndexTransformation&& indexTrafo, │ │ │ │ +316 SizeImplementation&& sizeImpl, │ │ │ │ +317 Dune::index_constant minSize, │ │ │ │ +318 Dune::index_constant maxSize) │ │ │ │ +319{ │ │ │ │ +320 return _i_n_d_e_x_T_r_a_n_s_f_o_r_m_a_t_i_o_n(indexTrafo, sizeImpl, │ │ │ │ +321 [](auto&&) { return _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_k_n_o_w_n{}; }, │ │ │ │ +322 minSize, maxSize); │ │ │ │ +323} │ │ │ │ +324 │ │ │ │ +325} // end namespace Experimental │ │ │ │ +326} // end namespace BasisFactory │ │ │ │ +327} // end namespace Functions │ │ │ │ +328} // end namespace Dune │ │ │ │ +329 │ │ │ │ +330 │ │ │ │ +331#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH │ │ │ │ +_u_t_i_l_i_t_y_._h_h │ │ │ │ +_t_y_p_e___t_r_a_i_t_s_._h_h │ │ │ │ +_s_t_a_t_i_c_f_o_r_l_o_o_p_._h_h │ │ │ │ +_n_o_d_e_s_._h_h │ │ │ │ +_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ +_b_a_s_i_s_t_a_g_s_._h_h │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t_:_:_g_e_t │ │ │ │ -const Base & get() const │ │ │ │ -Obtain reference to stored object. │ │ │ │ -DDeeffiinniittiioonn polymorphicsmallobject.hh:137 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t_:_:_b_u_f_f_e_r_U_s_e_d │ │ │ │ -bool bufferUsed() const │ │ │ │ -Check if object is stored in internal stack buffer. │ │ │ │ -DDeeffiinniittiioonn polymorphicsmallobject.hh:131 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t │ │ │ │ -PolymorphicSmallObject(Derived &&derived) │ │ │ │ -Construct from object. │ │ │ │ -DDeeffiinniittiioonn polymorphicsmallobject.hh:75 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t │ │ │ │ -PolymorphicSmallObject(PolymorphicSmallObject &&other) noexcept │ │ │ │ -Move constructor from other PolymorphicSmallObject. │ │ │ │ -DDeeffiinniittiioonn polymorphicsmallobject.hh:88 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t_:_:_o_p_e_r_a_t_o_r_= │ │ │ │ -PolymorphicSmallObject & operator=(const PolymorphicSmallObject &other) │ │ │ │ -Copy assignment from other PolymorphicSmallObject. │ │ │ │ -DDeeffiinniittiioonn polymorphicsmallobject.hh:106 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t_:_:_o_p_e_r_a_t_o_r_= │ │ │ │ -PolymorphicSmallObject & operator=(PolymorphicSmallObject &&other) noexcept │ │ │ │ -Move assignment from other PolymorphicSmallObject. │ │ │ │ -DDeeffiinniittiioonn polymorphicsmallobject.hh:117 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t │ │ │ │ -PolymorphicSmallObject(const PolymorphicSmallObject &other) │ │ │ │ -Copy constructor from other PolymorphicSmallObject. │ │ │ │ -DDeeffiinniittiioonn polymorphicsmallobject.hh:94 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t_:_:_~_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t │ │ │ │ -~PolymorphicSmallObject() │ │ │ │ -Destructor. │ │ │ │ -DDeeffiinniittiioonn polymorphicsmallobject.hh:100 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t │ │ │ │ -PolymorphicSmallObject() │ │ │ │ -Default constructor. │ │ │ │ -DDeeffiinniittiioonn polymorphicsmallobject.hh:62 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t_:_:_g_e_t │ │ │ │ -Base & get() │ │ │ │ -Obtain mutable reference to stored object. │ │ │ │ -DDeeffiinniittiioonn polymorphicsmallobject.hh:143 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:28 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s │ │ │ │ +TransformedIndexPreBasis(RPB &&, T &&) -> TransformedIndexPreBasis< std:: │ │ │ │ +decay_t< RPB >, std::decay_t< T > > │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ +DDeeffiinniittiioonn argyrisbasis.hh:926 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_i_n_d_e_x_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ +auto indexTransformation(IndexTransformation &&indexTransformation, │ │ │ │ +SizeImplementation &&sizeImplementation, ContainerDescriptorImplementation │ │ │ │ +&&containerDescriptorImplementation, Dune::index_constant< minIndexSize >, │ │ │ │ +Dune::index_constant< maxIndexSize >) │ │ │ │ +A generic implementation of a transformation. │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:296 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_t_r_a_n_s_f_o_r_m_I_n_d_i_c_e_s │ │ │ │ +auto transformIndices(RawPreBasisFactory &&preBasisFactory, Transformation │ │ │ │ +&&transformation) │ │ │ │ +Create a TransformedIndexPreBasisFactory. │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:197 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_k_n_o_w_n │ │ │ │ +Fallback container descriptor if nothing else fits. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:52 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s │ │ │ │ +A pre-basis transforming multi-indices. │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:52 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_i_n_d_i_c_e_s │ │ │ │ +It indices(const Node &node, It it) const │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:159 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_t_r_a_n_s_f_o_r_m_a_t_i_o_n__ │ │ │ │ +Transformation transformation_ │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:172 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ +void initializeIndices() │ │ │ │ +Initialize the global indices. │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:86 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ +typename RawPreBasis::GridView GridView │ │ │ │ +The grid view that the FE basis is defined on. │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:62 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_t_r_a_n_s_f_o_r_m_I_n_d_e_x │ │ │ │ +void transformIndex(MultiIndex &multiIndex) const │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:153 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_r_a_w_P_r_e_B_a_s_i_s__ │ │ │ │ +RawPreBasis rawPreBasis_ │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:171 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_N_o_d_e │ │ │ │ +typename RawPreBasis::Node Node │ │ │ │ +Template mapping root tree path to type of created tree node. │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:68 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_: │ │ │ │ +_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s │ │ │ │ +TransformedIndexPreBasis(RPB_R &&rawPreBasis, T_R &&transformation) │ │ │ │ +Constructor for given child pre-basis objects. │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:80 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_r_a_w_P_r_e_B_a_s_i_s │ │ │ │ +RawPreBasis & rawPreBasis() │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:147 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ +static constexpr size_type maxMultiIndexSize │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:70 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_u_p_d_a_t_e │ │ │ │ +void update(const GridView &gv) │ │ │ │ +Update the stored grid view, to be called if the grid has changed. │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:98 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_m_a_k_e_N_o_d_e │ │ │ │ +Node makeNode() const │ │ │ │ +Create tree node. │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:106 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_g_r_i_d_V_i_e_w │ │ │ │ +const GridView & gridView() const │ │ │ │ +Obtain the grid view that the basis is defined on. │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:92 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ +size_type size(const SizePrefix &prefix) const │ │ │ │ +Return number of possible values for next position in multi index. │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:119 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_R_a_w_P_r_e_B_a_s_i_s │ │ │ │ +RPB RawPreBasis │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:59 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ +size_type size() const │ │ │ │ +Same as size(prefix) with empty prefix. │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:112 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_m_a_x_N_o_d_e_S_i_z_e │ │ │ │ +size_type maxNodeSize() const │ │ │ │ +Get the maximal number of DOFs associated to node for any element. │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:137 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_s_i_z_e___t_y_p_e │ │ │ │ +std::size_t size_type │ │ │ │ +Type used for indices and size information. │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:65 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_m_u_l_t_i_I_n_d_e_x_B_u_f_f_e_r_S_i_z_e │ │ │ │ +static constexpr size_type multiIndexBufferSize │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:72 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ +size_type dimension() const │ │ │ │ +Get the total dimension of the space spanned by this basis. │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:131 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_r_a_w_P_r_e_B_a_s_i_s │ │ │ │ +const RawPreBasis & rawPreBasis() const │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:142 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_m_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ +static constexpr size_type minMultiIndexSize │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:71 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_T_r_a_n_s_f_o_r_m_e_d_I_n_d_e_x_P_r_e_B_a_s_i_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r │ │ │ │ +auto containerDescriptor() const │ │ │ │ +Return the container descriptor of the transformed pre-basis. │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:125 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_G_e_n_e_r_i_c_I_n_d_e_x_i_n_g_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ +A generic implementation of a transformation. │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:231 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_G_e_n_e_r_i_c_I_n_d_e_x_i_n_g_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_: │ │ │ │ +_G_e_n_e_r_i_c_I_n_d_e_x_i_n_g_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ +GenericIndexingTransformation(IT_R &&indexTransformation, SI_R │ │ │ │ +&&sizeImplementation, CD_R &&containerDescriptorImplementation) │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:238 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_G_e_n_e_r_i_c_I_n_d_e_x_i_n_g_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_: │ │ │ │ +_m_a_x_I_n_d_e_x_S_i_z_e │ │ │ │ +static constexpr std::size_t maxIndexSize │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:235 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_G_e_n_e_r_i_c_I_n_d_e_x_i_n_g_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_: │ │ │ │ +_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r │ │ │ │ +auto containerDescriptor(const PreBasis &preBasis) const │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:263 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_G_e_n_e_r_i_c_I_n_d_e_x_i_n_g_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_: │ │ │ │ +_d_i_m_e_n_s_i_o_n │ │ │ │ +auto dimension(const PreBasis &preBasis) const │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:257 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_G_e_n_e_r_i_c_I_n_d_e_x_i_n_g_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_: │ │ │ │ +_s_i_z_e │ │ │ │ +auto size(const Prefix &prefix, const PreBasis &preBasis) const │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:251 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_G_e_n_e_r_i_c_I_n_d_e_x_i_n_g_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_: │ │ │ │ +_m_i_n_I_n_d_e_x_S_i_z_e │ │ │ │ +static constexpr std::size_t minIndexSize │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:234 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_G_e_n_e_r_i_c_I_n_d_e_x_i_n_g_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_: │ │ │ │ +_t_r_a_n_s_f_o_r_m_I_n_d_e_x │ │ │ │ +void transformIndex(MultiIndex &multiIndex, const PreBasis &preBasis) const │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:245 │ │ │ │ +_c_o_n_c_e_p_t_s_._h_h │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _p_o_l_y_m_o_r_p_h_i_c_s_m_a_l_l_o_b_j_e_c_t_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _t_r_a_n_s_f_o_r_m_e_d_i_n_d_e_x_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00221.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: overflowarray.hh File Reference │ │ │ +Dune-Functions: rannacherturekbasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,48 +88,64 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
overflowarray.hh File Reference
│ │ │ +
rannacherturekbasis.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <algorithm>
│ │ │ -#include <iostream>
│ │ │ -#include <cstddef>
│ │ │ -#include <array>
│ │ │ -#include <initializer_list>
│ │ │ -#include <dune/common/genericiterator.hh>
│ │ │ +
#include <dune/common/exceptions.hh>
│ │ │ +#include <dune/grid/common/capabilities.hh>
│ │ │ +#include <dune/localfunctions/common/localfiniteelementvariant.hh>
│ │ │ +#include <dune/localfunctions/rannacherturek.hh>
│ │ │ +#include <dune/localfunctions/crouzeixraviart.hh>
│ │ │ +#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ +#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │ +#include <dune/functions/functionspacebases/leafprebasismixin.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::OverflowArray< BA, maxSize >
 A dynamically sized array-like class with overflow. More...
class  Dune::Functions::RannacherTurekPreBasis< GV >
 Pre-basis for a Rannacher-Turek basis. More...
class  Dune::Functions::RannacherTurekNode< GV >
│ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ +

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::BasisFactory
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +

│ │ │ +Typedefs

template<typename GV>
using Dune::Functions::RannacherTurekBasis = DefaultGlobalBasis<RannacherTurekPreBasis<GV> >
 Rannacher-Turek basis.
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ +Functions

template<class Dummy = void>
auto Dune::Functions::BasisFactory::rannacherTurek ()
 Create a pre-basis factory that can create a Rannacher-Turek pre-basis.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,23 +1,36 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -overflowarray.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ +rannacherturekbasis.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_<_ _B_A_,_ _m_a_x_S_i_z_e_ _> │ │ │ │ -  A dynamically sized array-like class with overflow. _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s_<_ _G_V_ _> │ │ │ │ +  Pre-basis for a Rannacher-Turek basis. _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e_<_ _G_V_ _> │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ +namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ +TTyyppeeddeeffss │ │ │ │ +template │ │ │ │ +using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_B_a_s_i_s = │ │ │ │ + _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s<_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s > │ │ │ │ +  Rannacher-Turek basis. │ │ │ │ +FFuunnccttiioonnss │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_r_a_n_n_a_c_h_e_r_T_u_r_e_k () │ │ │ │ +  Create a pre-basis factory that can create a Rannacher-Turek pre-basis. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _o_v_e_r_f_l_o_w_a_r_r_a_y_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _r_a_n_n_a_c_h_e_r_t_u_r_e_k_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00221.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,3 +1,5 @@ │ │ │ │ var a00221 = [ │ │ │ │ - ["Dune::Functions::OverflowArray< BA, maxSize >", "a01418.html", "a01418"] │ │ │ │ + ["Dune::Functions::RannacherTurekNode< GV >", "a02046.html", "a02046"], │ │ │ │ + ["Dune::Functions::RannacherTurekBasis", "a00312.html#ga39599d1e02b6e64c057e402fe1686532", null], │ │ │ │ + ["Dune::Functions::BasisFactory::rannacherTurek", "a00312.html#ga366449c1a41fc29ff55fed0c1485f60b", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00221_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: overflowarray.hh Source File │ │ │ +Dune-Functions: rannacherturekbasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,286 +88,277 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
overflowarray.hh
│ │ │ +
rannacherturekbasis.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH
│ │ │ -
8#define DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH
│ │ │ +
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH
│ │ │
9
│ │ │ -
10#include <algorithm>
│ │ │ -
11#include <iostream>
│ │ │ -
12#include <cstddef>
│ │ │ -
13#include <array>
│ │ │ -
14#include <initializer_list>
│ │ │ -
15
│ │ │ -
16#include <dune/common/genericiterator.hh>
│ │ │ +
10#include <dune/common/exceptions.hh>
│ │ │ +
11
│ │ │ +
12#include <dune/grid/common/capabilities.hh>
│ │ │ +
13
│ │ │ +
14#include <dune/localfunctions/common/localfiniteelementvariant.hh>
│ │ │ +
15#include <dune/localfunctions/rannacherturek.hh>
│ │ │ +
16#include <dune/localfunctions/crouzeixraviart.hh>
│ │ │
17
│ │ │ -
18
│ │ │ -
19
│ │ │ -
20namespace Dune::Functions {
│ │ │ + │ │ │ + │ │ │ + │ │ │
21
│ │ │ -
22
│ │ │ -
46template<class BA, std::size_t maxSize = std::tuple_size_v<BA>>
│ │ │ -
│ │ │ - │ │ │ -
48 public BA
│ │ │ -
49{
│ │ │ -
50 static constexpr std::size_t baseSize = std::tuple_size_v<BA>;
│ │ │ -
51
│ │ │ -
52public:
│ │ │ -
53 using BaseArray = BA;
│ │ │ -
54
│ │ │ -
55 using value_type = typename BaseArray::value_type;
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
59 using difference_type = std::ptrdiff_t;
│ │ │ -
60 using size_type = std::size_t;
│ │ │ -
61 using iterator = Dune::GenericIterator<OverflowArray, value_type>;
│ │ │ -
62 using const_iterator = Dune::GenericIterator<const OverflowArray, const value_type>;
│ │ │ -
63
│ │ │ -
64private:
│ │ │ -
65 using OverflowBuffer = std::array<value_type, maxSize-baseSize>;
│ │ │ -
66
│ │ │ -
67public:
│ │ │ -
68
│ │ │ -
69 OverflowArray() = default;
│ │ │ -
70
│ │ │ -
│ │ │ -
71 OverflowArray(const std::initializer_list<value_type>& l) {
│ │ │ -
72 assert(l.size() <= capacity());
│ │ │ -
73 size_ = l.size();
│ │ │ -
74 std::copy_n(l.begin(), size_, begin());
│ │ │ -
75 }
│ │ │ -
│ │ │ -
76
│ │ │ -
│ │ │ -
77 bool operator == (const OverflowArray& other) const {
│ │ │ -
78 if (size() != other.size())
│ │ │ -
79 return false;
│ │ │ -
80 for (size_type i=0; i<size(); ++i)
│ │ │ -
81 if ((*this)[i] != other[i])
│ │ │ -
82 return false;
│ │ │ -
83 return true;
│ │ │ -
84 }
│ │ │ -
│ │ │ -
85
│ │ │ -
│ │ │ -
87 void clear() {
│ │ │ -
88 size_ = 0;
│ │ │ +
22
│ │ │ +
23namespace Dune {
│ │ │ +
24namespace Functions {
│ │ │ +
25
│ │ │ +
26// *****************************************************************************
│ │ │ +
27// This is the reusable part of the basis. It contains
│ │ │ +
28//
│ │ │ +
29// RannacherTurekPreBasis
│ │ │ +
30// RannacherTurekNode
│ │ │ +
31//
│ │ │ +
32// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ +
33// state. These components do _not_ depend on the global basis and local view
│ │ │ +
34// and can be used without a global basis.
│ │ │ +
35// *****************************************************************************
│ │ │ +
36
│ │ │ +
37template<typename GV>
│ │ │ + │ │ │ +
39
│ │ │ +
40template<typename GV>
│ │ │ + │ │ │ +
42
│ │ │ +
55template<typename GV>
│ │ │ +
│ │ │ + │ │ │ +
57 public LeafPreBasisMixin< RannacherTurekPreBasis<GV> >
│ │ │ +
58{
│ │ │ +
59 static const int dim = GV::dimension;
│ │ │ +
60
│ │ │ +
61public:
│ │ │ +
62
│ │ │ +
64 using GridView = GV;
│ │ │ +
65
│ │ │ +
67 using size_type = std::size_t;
│ │ │ +
68
│ │ │ + │ │ │ +
71
│ │ │ +
│ │ │ + │ │ │ +
74 gridView_(gv)
│ │ │ +
75 {
│ │ │ +
76 for(auto type : gv.indexSet().types(0))
│ │ │ +
77 if (!type.isSimplex() && !type.isCube())
│ │ │ +
78 DUNE_THROW(Dune::NotImplemented, "Rannacher-Turek or Crouzeix-Raviart elements are only implemented for grids with simplex or cube elements.");
│ │ │ +
79 }
│ │ │ +
│ │ │ +
80
│ │ │ +
│ │ │ + │ │ │ +
83 {}
│ │ │ +
│ │ │ +
84
│ │ │ +
│ │ │ +
86 const GridView& gridView() const
│ │ │ +
87 {
│ │ │ +
88 return gridView_;
│ │ │
89 }
│ │ │
│ │ │
90
│ │ │ -
│ │ │ -
97 void resize(size_type n) {
│ │ │ -
98 assert(n <= capacity());
│ │ │ -
99 size_ = n;
│ │ │ -
100 }
│ │ │ -
│ │ │ -
101
│ │ │ -
│ │ │ -
108 void push_back(const value_type& t) {
│ │ │ -
109 assert(size() < capacity());
│ │ │ -
110 (*this)[size_++] = t;
│ │ │ -
111 }
│ │ │ -
│ │ │ -
112
│ │ │ -
│ │ │ -
114 void pop_back() {
│ │ │ -
115 assert(size() > 0);
│ │ │ -
116 if (! empty())
│ │ │ -
117 size_--;
│ │ │ -
118 }
│ │ │ -
│ │ │ -
119
│ │ │ -
│ │ │ -
126 void push_front(const value_type& t) {
│ │ │ -
127 assert(size() < capacity());
│ │ │ -
128 for (size_type i=0; i<size(); i++)
│ │ │ -
129 (*this)[i+1] = (*this)[i];
│ │ │ -
130 (*this)[0] = t;
│ │ │ -
131 }
│ │ │ -
│ │ │ -
132
│ │ │ -
│ │ │ - │ │ │ -
135 return iterator(*this, 0);
│ │ │ -
136 }
│ │ │ -
│ │ │ -
137
│ │ │ -
│ │ │ - │ │ │ -
140 return const_iterator(*this, 0);
│ │ │ -
141 }
│ │ │ -
│ │ │ -
142
│ │ │ -
│ │ │ - │ │ │ -
145 return iterator(*this, size());
│ │ │ -
146 }
│ │ │ -
│ │ │ -
147
│ │ │ -
│ │ │ - │ │ │ -
150 return const_iterator(*this, size());
│ │ │ -
151 }
│ │ │ -
│ │ │ -
152
│ │ │ -
│ │ │ - │ │ │ -
155 assert(i < size());
│ │ │ -
156 // If there's no padding between the base class and the overflow_ member,
│ │ │ -
157 // the compiler should be able to optimize this to
│ │ │ -
158 // return *(&BaseArray::operator[](0) + i);
│ │ │ -
159 if (i<baseSize)
│ │ │ -
160 return BaseArray::operator[](i);
│ │ │ -
161 return overflow_[i-baseSize];
│ │ │ -
162 }
│ │ │ -
│ │ │ -
163
│ │ │ -
│ │ │ - │ │ │ -
166 assert(i < size());
│ │ │ -
167 // If there's no padding between the base class and the overflow_ member,
│ │ │ -
168 // the compiler should be able to optimize this to
│ │ │ -
169 // return *(&BaseArray::operator[](0) + i);
│ │ │ -
170 if (i<baseSize)
│ │ │ -
171 return BaseArray::operator[](i);
│ │ │ -
172 return overflow_[i-baseSize];
│ │ │ -
173 }
│ │ │ -
│ │ │ -
174
│ │ │ -
│ │ │ - │ │ │ -
177 assert(size() > 0);
│ │ │ -
178 return (*this)[0];
│ │ │ -
179 }
│ │ │ -
│ │ │ -
180
│ │ │ -
│ │ │ - │ │ │ -
183 assert(size() > 0);
│ │ │ -
184 return (*this)[0];
│ │ │ -
185 }
│ │ │ -
│ │ │ -
186
│ │ │ -
│ │ │ - │ │ │ -
189 assert(size() > 0);
│ │ │ -
190 return (*this)[size()-1];
│ │ │ -
191 }
│ │ │ -
│ │ │ -
192
│ │ │ -
│ │ │ - │ │ │ -
195 assert(size() > 0);
│ │ │ -
196 return (*this)[size()-1];
│ │ │ -
197 }
│ │ │ -
│ │ │ -
198
│ │ │ -
│ │ │ -
200 size_type size () const {
│ │ │ -
201 return size_;
│ │ │ -
202 }
│ │ │ -
│ │ │ -
203
│ │ │ -
│ │ │ -
205 bool empty() const {
│ │ │ -
206 return size() == 0;
│ │ │ -
207 }
│ │ │ -
│ │ │ -
208
│ │ │ -
│ │ │ -
210 static constexpr size_type capacity() {
│ │ │ -
211 return maxSize;
│ │ │ -
212 }
│ │ │ -
│ │ │ -
213
│ │ │ -
│ │ │ -
215 static constexpr size_type max_size() {
│ │ │ -
216 return maxSize;
│ │ │ -
217 }
│ │ │ -
│ │ │ -
218
│ │ │ -
│ │ │ -
220 inline friend std::size_t hash_value(const OverflowArray& v) noexcept {
│ │ │ -
221 return hash_range(v.begin(), v.end());
│ │ │ -
222 }
│ │ │ -
│ │ │ -
223
│ │ │ -
│ │ │ -
225 friend std::ostream& operator<< (std::ostream& s, const OverflowArray& c) {
│ │ │ -
226 for (const auto& ci : c)
│ │ │ -
227 s << ci << " ";
│ │ │ -
228 return s;
│ │ │ -
229 }
│ │ │ -
│ │ │ -
230
│ │ │ -
231private:
│ │ │ -
232 OverflowBuffer overflow_;
│ │ │ -
233 size_type size_ = 0;
│ │ │ -
234};
│ │ │ -
│ │ │ -
235
│ │ │ -
236
│ │ │ -
237
│ │ │ -
238} // namespace Dune::Functions
│ │ │ -
239
│ │ │ -
240
│ │ │ -
241
│ │ │ -
242#endif // DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH
│ │ │ +
│ │ │ +
92 void update (const GridView& gv)
│ │ │ +
93 {
│ │ │ +
94 gridView_ = gv;
│ │ │ +
95 }
│ │ │ +
│ │ │ +
96
│ │ │ +
│ │ │ + │ │ │ +
101 {
│ │ │ +
102 return Node{};
│ │ │ +
103 }
│ │ │ +
│ │ │ +
104
│ │ │ +
│ │ │ + │ │ │ +
107 {
│ │ │ +
108 return (size_type)(gridView_.size(1));
│ │ │ +
109 }
│ │ │ +
│ │ │ +
110
│ │ │ +
│ │ │ + │ │ │ +
113 {
│ │ │ +
114 return 2*GV::dimension;
│ │ │ +
115 }
│ │ │ +
│ │ │ +
116
│ │ │ +
117 template<typename It>
│ │ │ +
│ │ │ +
118 It indices(const Node& node, It it) const
│ │ │ +
119 {
│ │ │ +
120 for (size_type i = 0, end = node.size() ; i < end ; ++i, ++it)
│ │ │ +
121 {
│ │ │ +
122 Dune::LocalKey localKey = node.finiteElement().localCoefficients().localKey(i);
│ │ │ +
123 const auto& gridIndexSet = gridView().indexSet();
│ │ │ +
124 const auto& element = node.element();
│ │ │ +
125
│ │ │ +
126 *it = {{ (size_type)(gridIndexSet.subIndex(element,localKey.subEntity(),1)) }};
│ │ │ +
127 }
│ │ │ +
128 return it;
│ │ │ +
129 }
│ │ │ +
│ │ │ +
130
│ │ │ +
131protected:
│ │ │ + │ │ │ +
133};
│ │ │ +
│ │ │ +
134
│ │ │ +
135
│ │ │ +
136
│ │ │ +
137template<typename GV>
│ │ │ +
│ │ │ + │ │ │ +
139 public LeafBasisNode
│ │ │ +
140{
│ │ │ +
141 static const int dim = GV::dimension;
│ │ │ +
142 static const int maxSize = 2*dim;
│ │ │ +
143
│ │ │ +
144 constexpr static bool hasFixedElementType = Capabilities::hasSingleGeometryType<typename GV::Grid>::v;
│ │ │ +
145
│ │ │ +
146 using CubeFiniteElement = RannacherTurekLocalFiniteElement<typename GV::ctype,double,dim>;
│ │ │ +
147 using SimplexFiniteElement = CrouzeixRaviartLocalFiniteElement<typename GV::ctype,double,dim>;
│ │ │ +
148
│ │ │ +
149 constexpr static unsigned int topologyId = Capabilities::hasSingleGeometryType<typename GV::Grid>::topologyId; // meaningless if hasFixedElementType is false
│ │ │ +
150 constexpr static GeometryType type = GeometryType(topologyId, GV::dimension);
│ │ │ +
151
│ │ │ +
152public:
│ │ │ +
153
│ │ │ +
154 using size_type = std::size_t;
│ │ │ +
155 using Element = typename GV::template Codim<0>::Entity;
│ │ │ +
156 using FiniteElement = std::conditional_t<hasFixedElementType,
│ │ │ +
157 std::conditional_t<type.isCube(),CubeFiniteElement,SimplexFiniteElement>,
│ │ │ +
158 LocalFiniteElementVariant<CubeFiniteElement, SimplexFiniteElement> >;
│ │ │ +
159
│ │ │ +
│ │ │ + │ │ │ + │ │ │ +
162 element_(nullptr)
│ │ │ +
163 {}
│ │ │ +
│ │ │ +
164
│ │ │ +
│ │ │ +
166 const Element& element() const
│ │ │ +
167 {
│ │ │ +
168 return *element_;
│ │ │ +
169 }
│ │ │ +
│ │ │ +
170
│ │ │ +
│ │ │ + │ │ │ +
176 {
│ │ │ +
177 return finiteElement_;
│ │ │ +
178 }
│ │ │ +
│ │ │ +
179
│ │ │ +
│ │ │ +
181 void bind(const Element& e)
│ │ │ +
182 {
│ │ │ +
183 element_ = &e;
│ │ │ +
184 if constexpr (!hasFixedElementType)
│ │ │ +
185 finiteElement_ = e.type().isCube() ? static_cast<FiniteElement>(CubeFiniteElement())
│ │ │ +
186 : static_cast<FiniteElement>(SimplexFiniteElement()) ;
│ │ │ +
187 this->setSize(finiteElement_.size());
│ │ │ +
188 }
│ │ │ +
│ │ │ +
189
│ │ │ +
190protected:
│ │ │ +
191
│ │ │ + │ │ │ + │ │ │ +
194};
│ │ │ +
│ │ │ +
195
│ │ │ +
196
│ │ │ +
197
│ │ │ +
198namespace BasisFactory {
│ │ │ +
199
│ │ │ +
205template<class Dummy=void>
│ │ │ +
│ │ │ + │ │ │ +
207{
│ │ │ +
208 return [](const auto& gridView) {
│ │ │ +
209 return RannacherTurekPreBasis<std::decay_t<decltype(gridView)>>(gridView);
│ │ │ +
210 };
│ │ │ +
211}
│ │ │ +
│ │ │ +
212
│ │ │ +
213} // end namespace BasisFactory
│ │ │ +
214
│ │ │ +
215
│ │ │ +
216
│ │ │ +
217
│ │ │ +
229template<typename GV>
│ │ │ + │ │ │ +
231
│ │ │ +
232} // end namespace Functions
│ │ │ +
233} // end namespace Dune
│ │ │ +
234
│ │ │ +
235#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH
│ │ │ + │ │ │ + │ │ │ + │ │ │ +
auto rannacherTurek()
Create a pre-basis factory that can create a Rannacher-Turek pre-basis.
Definition rannacherturekbasis.hh:206
│ │ │ +
DefaultGlobalBasis< RannacherTurekPreBasis< GV > > RannacherTurekBasis
Rannacher-Turek basis.
Definition rannacherturekbasis.hh:230
│ │ │ +
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
const value_type & const_reference
Definition overflowarray.hh:57
│ │ │ -
value_type & reference
Definition overflowarray.hh:56
│ │ │ -
const_iterator end() const
Returns a const_iterator pointing to the end of the OverflowArray.
Definition overflowarray.hh:149
│ │ │ -
bool operator==(const OverflowArray &other) const
Definition overflowarray.hh:77
│ │ │ -
friend std::size_t hash_value(const OverflowArray &v) noexcept
Compute hash value.
Definition overflowarray.hh:220
│ │ │ -
void push_back(const value_type &t)
Appends an element to the end of the OverflowArray,.
Definition overflowarray.hh:108
│ │ │ -
friend std::ostream & operator<<(std::ostream &s, const OverflowArray &c)
Write container to an output stream.
Definition overflowarray.hh:225
│ │ │ -
iterator begin()
Returns a iterator pointing to the beginning of the OverflowArray.
Definition overflowarray.hh:134
│ │ │ -
bool empty() const
Returns true if OverflowArray has no elements.
Definition overflowarray.hh:205
│ │ │ -
size_type size() const
Returns number of elements in the OverflowArray.
Definition overflowarray.hh:200
│ │ │ -
typename BaseArray::value_type value_type
Definition overflowarray.hh:55
│ │ │ -
void pop_back()
Erases the last element of the OverflowArray, O(1) time.
Definition overflowarray.hh:114
│ │ │ -
Dune::GenericIterator< OverflowArray, value_type > iterator
Definition overflowarray.hh:61
│ │ │ -
const_iterator begin() const
Returns a const_iterator pointing to the beginning of the OverflowArray.
Definition overflowarray.hh:139
│ │ │ -
std::ptrdiff_t difference_type
Definition overflowarray.hh:59
│ │ │ - │ │ │ -
BA BaseArray
Definition overflowarray.hh:53
│ │ │ -
static constexpr size_type capacity()
Returns the capacity of the OverflowArray.
Definition overflowarray.hh:210
│ │ │ -
static constexpr size_type max_size()
Returns the maximum length of the OverflowArray.
Definition overflowarray.hh:215
│ │ │ -
const_reference front() const
Returns const reference to first element of OverflowArray.
Definition overflowarray.hh:182
│ │ │ -
void clear()
Erases all elements.
Definition overflowarray.hh:87
│ │ │ -
iterator end()
Returns an iterator pointing to the end of the OverflowArray.
Definition overflowarray.hh:144
│ │ │ -
std::size_t size_type
Definition overflowarray.hh:60
│ │ │ -
void resize(size_type n)
Specifies a new size for the OverflowArray.
Definition overflowarray.hh:97
│ │ │ -
value_type * pointer
Definition overflowarray.hh:58
│ │ │ -
Dune::GenericIterator< const OverflowArray, const value_type > const_iterator
Definition overflowarray.hh:62
│ │ │ -
const_reference back() const
Returns const reference to last element of OverflowArray.
Definition overflowarray.hh:194
│ │ │ -
OverflowArray(const std::initializer_list< value_type > &l)
Definition overflowarray.hh:71
│ │ │ -
reference back()
Returns reference to last element of OverflowArray.
Definition overflowarray.hh:188
│ │ │ -
void push_front(const value_type &t)
Inserts an element to the begin of the OverflowArray,.
Definition overflowarray.hh:126
│ │ │ -
reference front()
Returns reference to first element of OverflowArray.
Definition overflowarray.hh:176
│ │ │ -
reference operator[](size_type i)
Returns reference to the i'th element.
Definition overflowarray.hh:154
│ │ │ +
Definition argyrisbasis.hh:926
│ │ │ +
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:53
│ │ │ +
A generic MixIn class for PreBasis.
Definition leafprebasismixin.hh:36
│ │ │ +
size_type size() const
Obtain the number of basis function in the local node.
Definition nodes.hh:162
│ │ │ +
void setSize(const size_type size)
Definition nodes.hh:197
│ │ │ +
Definition nodes.hh:218
│ │ │ +
Definition rannacherturekbasis.hh:140
│ │ │ +
void bind(const Element &e)
Bind to element.
Definition rannacherturekbasis.hh:181
│ │ │ +
std::conditional_t< hasFixedElementType, std::conditional_t< type.isCube(), CubeFiniteElement, SimplexFiniteElement >, LocalFiniteElementVariant< CubeFiniteElement, SimplexFiniteElement > > FiniteElement
Definition rannacherturekbasis.hh:156
│ │ │ +
FiniteElement finiteElement_
Definition rannacherturekbasis.hh:192
│ │ │ +
std::size_t size_type
Definition rannacherturekbasis.hh:154
│ │ │ +
typename GV::template Codim< 0 >::Entity Element
Definition rannacherturekbasis.hh:155
│ │ │ +
RannacherTurekNode()
Definition rannacherturekbasis.hh:160
│ │ │ +
const Element * element_
Definition rannacherturekbasis.hh:193
│ │ │ +
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition rannacherturekbasis.hh:175
│ │ │ +
const Element & element() const
Return current element, throw if unbound.
Definition rannacherturekbasis.hh:166
│ │ │ +
Pre-basis for a Rannacher-Turek basis.
Definition rannacherturekbasis.hh:58
│ │ │ +
void initializeIndices()
Initialize the global indices.
Definition rannacherturekbasis.hh:82
│ │ │ +
std::size_t size_type
Type used for indices and size information.
Definition rannacherturekbasis.hh:67
│ │ │ +
Node makeNode() const
Create tree node.
Definition rannacherturekbasis.hh:100
│ │ │ +
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition rannacherturekbasis.hh:92
│ │ │ +
It indices(const Node &node, It it) const
Definition rannacherturekbasis.hh:118
│ │ │ +
GV GridView
The grid view that the FE basis is defined on.
Definition rannacherturekbasis.hh:64
│ │ │ +
size_type dimension() const
Same as size(prefix) with empty prefix.
Definition rannacherturekbasis.hh:106
│ │ │ +
RannacherTurekPreBasis(const GridView &gv)
Constructor for a given grid view object.
Definition rannacherturekbasis.hh:73
│ │ │ +
RannacherTurekNode< GV > Node
Template mapping root tree path to type of created tree node.
Definition rannacherturekbasis.hh:70
│ │ │ +
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition rannacherturekbasis.hh:86
│ │ │ +
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition rannacherturekbasis.hh:112
│ │ │ +
GridView gridView_
Definition rannacherturekbasis.hh:132
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,314 +1,330 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -overflowarray.hh │ │ │ │ +rannacherturekbasis.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH │ │ │ │ -8#define DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH │ │ │ │ +8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ -12#include │ │ │ │ -13#include │ │ │ │ -14#include │ │ │ │ -15 │ │ │ │ -16#include │ │ │ │ +10#include │ │ │ │ +11 │ │ │ │ +12#include │ │ │ │ +13 │ │ │ │ +14#include │ │ │ │ +15#include │ │ │ │ +16#include │ │ │ │ 17 │ │ │ │ -18 │ │ │ │ -19 │ │ │ │ -20namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ +18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ +19#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ +20#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h> │ │ │ │ 21 │ │ │ │ 22 │ │ │ │ -46template> │ │ │ │ -_4_7class _O_v_e_r_f_l_o_w_A_r_r_a_y : │ │ │ │ -48 public BA │ │ │ │ -49{ │ │ │ │ -50 static constexpr std::size_t baseSize = std::tuple_size_v; │ │ │ │ -51 │ │ │ │ -52public: │ │ │ │ -_5_3 using _B_a_s_e_A_r_r_a_y = BA; │ │ │ │ -54 │ │ │ │ -_5_5 using _v_a_l_u_e___t_y_p_e = typename BaseArray::value_type; │ │ │ │ -_5_6 using _r_e_f_e_r_e_n_c_e = _v_a_l_u_e___t_y_p_e&; │ │ │ │ -_5_7 using _c_o_n_s_t___r_e_f_e_r_e_n_c_e = const _v_a_l_u_e___t_y_p_e&; │ │ │ │ -_5_8 using _p_o_i_n_t_e_r = _v_a_l_u_e___t_y_p_e*; │ │ │ │ -_5_9 using _d_i_f_f_e_r_e_n_c_e___t_y_p_e = std::ptrdiff_t; │ │ │ │ -_6_0 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ -_6_1 using _i_t_e_r_a_t_o_r = Dune::GenericIterator; │ │ │ │ -_6_2 using _c_o_n_s_t___i_t_e_r_a_t_o_r = Dune::GenericIterator; │ │ │ │ -63 │ │ │ │ -64private: │ │ │ │ -65 using OverflowBuffer = std::array<_v_a_l_u_e___t_y_p_e, maxSize-baseSize>; │ │ │ │ -66 │ │ │ │ -67public: │ │ │ │ +23namespace _D_u_n_e { │ │ │ │ +24namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +25 │ │ │ │ +26/ │ │ │ │ +/ ***************************************************************************** │ │ │ │ +27// This is the reusable part of the basis. It contains │ │ │ │ +28// │ │ │ │ +29// RannacherTurekPreBasis │ │ │ │ +30// RannacherTurekNode │ │ │ │ +31// │ │ │ │ +32// The pre-basis allows to create the others and is the owner of possible │ │ │ │ +shared │ │ │ │ +33// state. These components do _not_ depend on the global basis and local view │ │ │ │ +34// and can be used without a global basis. │ │ │ │ +35/ │ │ │ │ +/ ***************************************************************************** │ │ │ │ +36 │ │ │ │ +37template │ │ │ │ +38class _R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e; │ │ │ │ +39 │ │ │ │ +40template │ │ │ │ +41class _R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s; │ │ │ │ +42 │ │ │ │ +55template │ │ │ │ +_5_6class _R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s : │ │ │ │ +57 public _L_e_a_f_P_r_e_B_a_s_i_s_M_i_x_i_n< RannacherTurekPreBasis > │ │ │ │ +58{ │ │ │ │ +59 static const int dim = GV::dimension; │ │ │ │ +60 │ │ │ │ +61public: │ │ │ │ +62 │ │ │ │ +_6_4 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ +65 │ │ │ │ +_6_7 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ 68 │ │ │ │ -_6_9 _O_v_e_r_f_l_o_w_A_r_r_a_y() = default; │ │ │ │ -70 │ │ │ │ -_7_1 _O_v_e_r_f_l_o_w_A_r_r_a_y(const std::initializer_list& l) { │ │ │ │ -72 assert(l.size() <= _c_a_p_a_c_i_t_y()); │ │ │ │ -73 size_ = l.size(); │ │ │ │ -74 std::copy_n(l.begin(), size_, _b_e_g_i_n()); │ │ │ │ -75 } │ │ │ │ -76 │ │ │ │ -_7_7 bool _o_p_e_r_a_t_o_r_ _=_=_ (const _O_v_e_r_f_l_o_w_A_r_r_a_y& other) const { │ │ │ │ -78 if (_s_i_z_e() != other._s_i_z_e()) │ │ │ │ -79 return false; │ │ │ │ -80 for (_s_i_z_e___t_y_p_e i=0; i<_s_i_z_e(); ++i) │ │ │ │ -81 if ((*this)[i] != other[i]) │ │ │ │ -82 return false; │ │ │ │ -83 return true; │ │ │ │ -84 } │ │ │ │ -85 │ │ │ │ -_8_7 void _c_l_e_a_r() { │ │ │ │ -88 size_ = 0; │ │ │ │ +_7_0 using _N_o_d_e = _R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e_<_G_V_>; │ │ │ │ +71 │ │ │ │ +_7_3 _R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s(const _G_r_i_d_V_i_e_w& gv) : │ │ │ │ +74 _g_r_i_d_V_i_e_w__(gv) │ │ │ │ +75 { │ │ │ │ +76 for(auto type : gv.indexSet().types(0)) │ │ │ │ +77 if (!type.isSimplex() && !type.isCube()) │ │ │ │ +78 DUNE_THROW(Dune::NotImplemented, "Rannacher-Turek or Crouzeix-Raviart │ │ │ │ +elements are only implemented for grids with simplex or cube elements."); │ │ │ │ +79 } │ │ │ │ +80 │ │ │ │ +_8_2 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ +83 {} │ │ │ │ +84 │ │ │ │ +_8_6 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ +87 { │ │ │ │ +88 return _g_r_i_d_V_i_e_w__; │ │ │ │ 89 } │ │ │ │ 90 │ │ │ │ -_9_7 void _r_e_s_i_z_e(_s_i_z_e___t_y_p_e n) { │ │ │ │ -98 assert(n <= _c_a_p_a_c_i_t_y()); │ │ │ │ -99 size_ = n; │ │ │ │ -100 } │ │ │ │ -101 │ │ │ │ -_1_0_8 void _p_u_s_h___b_a_c_k(const _v_a_l_u_e___t_y_p_e& t) { │ │ │ │ -109 assert(_s_i_z_e() < _c_a_p_a_c_i_t_y()); │ │ │ │ -110 (*this)[size_++] = t; │ │ │ │ -111 } │ │ │ │ -112 │ │ │ │ -_1_1_4 void _p_o_p___b_a_c_k() { │ │ │ │ -115 assert(_s_i_z_e() > 0); │ │ │ │ -116 if (! _e_m_p_t_y()) │ │ │ │ -117 size_--; │ │ │ │ -118 } │ │ │ │ -119 │ │ │ │ -_1_2_6 void _p_u_s_h___f_r_o_n_t(const _v_a_l_u_e___t_y_p_e& t) { │ │ │ │ -127 assert(_s_i_z_e() < _c_a_p_a_c_i_t_y()); │ │ │ │ -128 for (_s_i_z_e___t_y_p_e i=0; i<_s_i_z_e(); i++) │ │ │ │ -129 (*this)[i+1] = (*this)[i]; │ │ │ │ -130 (*this)[0] = t; │ │ │ │ -131 } │ │ │ │ -132 │ │ │ │ -_1_3_4 _i_t_e_r_a_t_o_r _b_e_g_i_n() { │ │ │ │ -135 return _i_t_e_r_a_t_o_r(*this, 0); │ │ │ │ -136 } │ │ │ │ -137 │ │ │ │ -_1_3_9 _c_o_n_s_t___i_t_e_r_a_t_o_r _b_e_g_i_n() const { │ │ │ │ -140 return _c_o_n_s_t___i_t_e_r_a_t_o_r(*this, 0); │ │ │ │ -141 } │ │ │ │ -142 │ │ │ │ -_1_4_4 _i_t_e_r_a_t_o_r _e_n_d() { │ │ │ │ -145 return _i_t_e_r_a_t_o_r(*this, _s_i_z_e()); │ │ │ │ -146 } │ │ │ │ -147 │ │ │ │ -_1_4_9 _c_o_n_s_t___i_t_e_r_a_t_o_r _e_n_d() const { │ │ │ │ -150 return _c_o_n_s_t___i_t_e_r_a_t_o_r(*this, _s_i_z_e()); │ │ │ │ -151 } │ │ │ │ -152 │ │ │ │ -_1_5_4 _r_e_f_e_r_e_n_c_e _o_p_e_r_a_t_o_r_[_]_ (_s_i_z_e___t_y_p_e i) { │ │ │ │ -155 assert(i < _s_i_z_e()); │ │ │ │ -156 // If there's no padding between the base class and the overflow_ member, │ │ │ │ -157 // the compiler should be able to optimize this to │ │ │ │ -158 // return *(&BaseArray::operator[](0) + i); │ │ │ │ -159 if (i 0); │ │ │ │ -178 return (*this)[0]; │ │ │ │ -179 } │ │ │ │ -180 │ │ │ │ -_1_8_2 _c_o_n_s_t___r_e_f_e_r_e_n_c_e _f_r_o_n_t() const { │ │ │ │ -183 assert(_s_i_z_e() > 0); │ │ │ │ -184 return (*this)[0]; │ │ │ │ -185 } │ │ │ │ -186 │ │ │ │ -_1_8_8 _r_e_f_e_r_e_n_c_e _b_a_c_k() { │ │ │ │ -189 assert(_s_i_z_e() > 0); │ │ │ │ -190 return (*this)[_s_i_z_e()-1]; │ │ │ │ -191 } │ │ │ │ -192 │ │ │ │ -_1_9_4 _c_o_n_s_t___r_e_f_e_r_e_n_c_e _b_a_c_k() const { │ │ │ │ -195 assert(_s_i_z_e() > 0); │ │ │ │ -196 return (*this)[_s_i_z_e()-1]; │ │ │ │ -197 } │ │ │ │ -198 │ │ │ │ -_2_0_0 _s_i_z_e___t_y_p_e _s_i_z_e () const { │ │ │ │ -201 return size_; │ │ │ │ -202 } │ │ │ │ -203 │ │ │ │ -_2_0_5 bool _e_m_p_t_y() const { │ │ │ │ -206 return _s_i_z_e() == 0; │ │ │ │ -207 } │ │ │ │ -208 │ │ │ │ -_2_1_0 static constexpr _s_i_z_e___t_y_p_e _c_a_p_a_c_i_t_y() { │ │ │ │ -211 return maxSize; │ │ │ │ -212 } │ │ │ │ -213 │ │ │ │ -_2_1_5 static constexpr _s_i_z_e___t_y_p_e _m_a_x___s_i_z_e() { │ │ │ │ -216 return maxSize; │ │ │ │ -217 } │ │ │ │ -218 │ │ │ │ -_2_2_0 inline friend std::size_t _h_a_s_h___v_a_l_u_e(const _O_v_e_r_f_l_o_w_A_r_r_a_y& v) noexcept { │ │ │ │ -221 return hash_range(v.begin(), v.end()); │ │ │ │ -222 } │ │ │ │ -223 │ │ │ │ -_2_2_5 friend std::ostream& _o_p_e_r_a_t_o_r_<_<_ (std::ostream& s, const _O_v_e_r_f_l_o_w_A_r_r_a_y& c) { │ │ │ │ -226 for (const auto& ci : c) │ │ │ │ -227 s << ci << " "; │ │ │ │ -228 return s; │ │ │ │ -229 } │ │ │ │ -230 │ │ │ │ -231private: │ │ │ │ -232 OverflowBuffer overflow_; │ │ │ │ -233 _s_i_z_e___t_y_p_e size_ = 0; │ │ │ │ -234}; │ │ │ │ -235 │ │ │ │ -236 │ │ │ │ -237 │ │ │ │ -238} // namespace Dune::Functions │ │ │ │ -239 │ │ │ │ -240 │ │ │ │ -241 │ │ │ │ -242#endif // DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH │ │ │ │ +_9_2 void _u_p_d_a_t_e (const _G_r_i_d_V_i_e_w& gv) │ │ │ │ +93 { │ │ │ │ +94 _g_r_i_d_V_i_e_w__ = gv; │ │ │ │ +95 } │ │ │ │ +96 │ │ │ │ +_1_0_0 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ +101 { │ │ │ │ +102 return _N_o_d_e{}; │ │ │ │ +103 } │ │ │ │ +104 │ │ │ │ +_1_0_6 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ +107 { │ │ │ │ +108 return (_s_i_z_e___t_y_p_e)(_g_r_i_d_V_i_e_w__.size(1)); │ │ │ │ +109 } │ │ │ │ +110 │ │ │ │ +_1_1_2 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ +113 { │ │ │ │ +114 return 2*GV::dimension; │ │ │ │ +115 } │ │ │ │ +116 │ │ │ │ +117 template │ │ │ │ +_1_1_8 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ +119 { │ │ │ │ +120 for (_s_i_z_e___t_y_p_e i = 0, end = node._s_i_z_e() ; i < end ; ++i, ++it) │ │ │ │ +121 { │ │ │ │ +122 Dune::LocalKey localKey = node._f_i_n_i_t_e_E_l_e_m_e_n_t().localCoefficients().localKey │ │ │ │ +(i); │ │ │ │ +123 const auto& gridIndexSet = _g_r_i_d_V_i_e_w().indexSet(); │ │ │ │ +124 const auto& element = node._e_l_e_m_e_n_t(); │ │ │ │ +125 │ │ │ │ +126 *it = {{ (_s_i_z_e___t_y_p_e)(gridIndexSet.subIndex(element,localKey.subEntity(),1)) │ │ │ │ +}}; │ │ │ │ +127 } │ │ │ │ +128 return it; │ │ │ │ +129 } │ │ │ │ +130 │ │ │ │ +131protected: │ │ │ │ +_1_3_2 _G_r_i_d_V_i_e_w _g_r_i_d_V_i_e_w__; │ │ │ │ +133}; │ │ │ │ +134 │ │ │ │ +135 │ │ │ │ +136 │ │ │ │ +137template │ │ │ │ +_1_3_8class _R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e : │ │ │ │ +139 public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ +140{ │ │ │ │ +141 static const int dim = GV::dimension; │ │ │ │ +142 static const int maxSize = 2*dim; │ │ │ │ +143 │ │ │ │ +144 constexpr static bool hasFixedElementType = Capabilities:: │ │ │ │ +hasSingleGeometryType::v; │ │ │ │ +145 │ │ │ │ +146 using CubeFiniteElement = RannacherTurekLocalFiniteElement; │ │ │ │ +147 using SimplexFiniteElement = CrouzeixRaviartLocalFiniteElement; │ │ │ │ +148 │ │ │ │ +149 constexpr static unsigned int topologyId = Capabilities:: │ │ │ │ +hasSingleGeometryType::topologyId; // meaningless if │ │ │ │ +hasFixedElementType is false │ │ │ │ +150 constexpr static GeometryType type = GeometryType(topologyId, GV:: │ │ │ │ +dimension); │ │ │ │ +151 │ │ │ │ +152public: │ │ │ │ +153 │ │ │ │ +_1_5_4 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ +_1_5_5 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ +_1_5_6 using _F_i_n_i_t_e_E_l_e_m_e_n_t = std::conditional_t, │ │ │ │ +158 LocalFiniteElementVariant >; │ │ │ │ +159 │ │ │ │ +_1_6_0 _R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e() : │ │ │ │ +161 _f_i_n_i_t_e_E_l_e_m_e_n_t__(), │ │ │ │ +162 _e_l_e_m_e_n_t__(nullptr) │ │ │ │ +163 {} │ │ │ │ +164 │ │ │ │ +_1_6_6 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ +167 { │ │ │ │ +168 return *_e_l_e_m_e_n_t__; │ │ │ │ +169 } │ │ │ │ +170 │ │ │ │ +_1_7_5 const _F_i_n_i_t_e_E_l_e_m_e_n_t& _f_i_n_i_t_e_E_l_e_m_e_n_t() const │ │ │ │ +176 { │ │ │ │ +177 return _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ +178 } │ │ │ │ +179 │ │ │ │ +_1_8_1 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ +182 { │ │ │ │ +183 _e_l_e_m_e_n_t__ = &e; │ │ │ │ +184 if constexpr (!hasFixedElementType) │ │ │ │ +185 _f_i_n_i_t_e_E_l_e_m_e_n_t__ = e.type().isCube() ? static_cast<_F_i_n_i_t_e_E_l_e_m_e_n_t> │ │ │ │ +(CubeFiniteElement()) │ │ │ │ +186 : static_cast<_F_i_n_i_t_e_E_l_e_m_e_n_t>(SimplexFiniteElement()) ; │ │ │ │ +187 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__.size()); │ │ │ │ +188 } │ │ │ │ +189 │ │ │ │ +190protected: │ │ │ │ +191 │ │ │ │ +_1_9_2 _F_i_n_i_t_e_E_l_e_m_e_n_t _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ +_1_9_3 const _E_l_e_m_e_n_t* _e_l_e_m_e_n_t__; │ │ │ │ +194}; │ │ │ │ +195 │ │ │ │ +196 │ │ │ │ +197 │ │ │ │ +198namespace _B_a_s_i_s_F_a_c_t_o_r_y { │ │ │ │ +199 │ │ │ │ +205template │ │ │ │ +_2_0_6auto _r_a_n_n_a_c_h_e_r_T_u_r_e_k() │ │ │ │ +207{ │ │ │ │ +208 return [](const auto& gridView) { │ │ │ │ +209 return _R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s>(gridView); │ │ │ │ +210 }; │ │ │ │ +211} │ │ │ │ +212 │ │ │ │ +213} // end namespace BasisFactory │ │ │ │ +214 │ │ │ │ +215 │ │ │ │ +216 │ │ │ │ +217 │ │ │ │ +229template │ │ │ │ +_2_3_0using _R_a_n_n_a_c_h_e_r_T_u_r_e_k_B_a_s_i_s = _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s_<_G_V_> >; │ │ │ │ +231 │ │ │ │ +232} // end namespace Functions │ │ │ │ +233} // end namespace Dune │ │ │ │ +234 │ │ │ │ +235#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH │ │ │ │ +_n_o_d_e_s_._h_h │ │ │ │ +_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ +_l_e_a_f_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_r_a_n_n_a_c_h_e_r_T_u_r_e_k │ │ │ │ +auto rannacherTurek() │ │ │ │ +Create a pre-basis factory that can create a Rannacher-Turek pre-basis. │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:206 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_B_a_s_i_s │ │ │ │ +DefaultGlobalBasis< RannacherTurekPreBasis< GV > > RannacherTurekBasis │ │ │ │ +Rannacher-Turek basis. │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:230 │ │ │ │ +_D_u_n_e │ │ │ │ +DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_c_o_n_s_t___r_e_f_e_r_e_n_c_e │ │ │ │ -const value_type & const_reference │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:57 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_r_e_f_e_r_e_n_c_e │ │ │ │ -value_type & reference │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:56 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_e_n_d │ │ │ │ -const_iterator end() const │ │ │ │ -Returns a const_iterator pointing to the end of the OverflowArray. │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:149 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_o_p_e_r_a_t_o_r_=_= │ │ │ │ -bool operator==(const OverflowArray &other) const │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:77 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_h_a_s_h___v_a_l_u_e │ │ │ │ -friend std::size_t hash_value(const OverflowArray &v) noexcept │ │ │ │ -Compute hash value. │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:220 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_p_u_s_h___b_a_c_k │ │ │ │ -void push_back(const value_type &t) │ │ │ │ -Appends an element to the end of the OverflowArray,. │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:108 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_o_p_e_r_a_t_o_r_<_< │ │ │ │ -friend std::ostream & operator<<(std::ostream &s, const OverflowArray &c) │ │ │ │ -Write container to an output stream. │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:225 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_b_e_g_i_n │ │ │ │ -iterator begin() │ │ │ │ -Returns a iterator pointing to the beginning of the OverflowArray. │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:134 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_e_m_p_t_y │ │ │ │ -bool empty() const │ │ │ │ -Returns true if OverflowArray has no elements. │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:205 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_s_i_z_e │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ +DDeeffiinniittiioonn argyrisbasis.hh:926 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ +Global basis for given pre-basis. │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:53 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_i_x_i_n │ │ │ │ +A generic MixIn class for PreBasis. │ │ │ │ +DDeeffiinniittiioonn leafprebasismixin.hh:36 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_i_z_e │ │ │ │ size_type size() const │ │ │ │ -Returns number of elements in the OverflowArray. │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:200 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_v_a_l_u_e___t_y_p_e │ │ │ │ -typename BaseArray::value_type value_type │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:55 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_p_o_p___b_a_c_k │ │ │ │ -void pop_back() │ │ │ │ -Erases the last element of the OverflowArray, O(1) time. │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:114 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_i_t_e_r_a_t_o_r │ │ │ │ -Dune::GenericIterator< OverflowArray, value_type > iterator │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:61 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_b_e_g_i_n │ │ │ │ -const_iterator begin() const │ │ │ │ -Returns a const_iterator pointing to the beginning of the OverflowArray. │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:139 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_d_i_f_f_e_r_e_n_c_e___t_y_p_e │ │ │ │ -std::ptrdiff_t difference_type │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:59 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y │ │ │ │ -OverflowArray()=default │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_B_a_s_e_A_r_r_a_y │ │ │ │ -BA BaseArray │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:53 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_c_a_p_a_c_i_t_y │ │ │ │ -static constexpr size_type capacity() │ │ │ │ -Returns the capacity of the OverflowArray. │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:210 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_m_a_x___s_i_z_e │ │ │ │ -static constexpr size_type max_size() │ │ │ │ -Returns the maximum length of the OverflowArray. │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:215 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_f_r_o_n_t │ │ │ │ -const_reference front() const │ │ │ │ -Returns const reference to first element of OverflowArray. │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:182 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_c_l_e_a_r │ │ │ │ -void clear() │ │ │ │ -Erases all elements. │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:87 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_e_n_d │ │ │ │ -iterator end() │ │ │ │ -Returns an iterator pointing to the end of the OverflowArray. │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:144 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_s_i_z_e___t_y_p_e │ │ │ │ +Obtain the number of basis function in the local node. │ │ │ │ +DDeeffiinniittiioonn nodes.hh:162 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_e_t_S_i_z_e │ │ │ │ +void setSize(const size_type size) │ │ │ │ +DDeeffiinniittiioonn nodes.hh:197 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ +DDeeffiinniittiioonn nodes.hh:218 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:140 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e_:_:_b_i_n_d │ │ │ │ +void bind(const Element &e) │ │ │ │ +Bind to element. │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:181 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e_:_:_F_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ +std::conditional_t< hasFixedElementType, std::conditional_t< type.isCube(), │ │ │ │ +CubeFiniteElement, SimplexFiniteElement >, LocalFiniteElementVariant< │ │ │ │ +CubeFiniteElement, SimplexFiniteElement > > FiniteElement │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:156 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t__ │ │ │ │ +FiniteElement finiteElement_ │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:192 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e_:_:_s_i_z_e___t_y_p_e │ │ │ │ +std::size_t size_type │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:154 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e_:_:_E_l_e_m_e_n_t │ │ │ │ +typename GV::template Codim< 0 >::Entity Element │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:155 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e │ │ │ │ +RannacherTurekNode() │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:160 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e_:_:_e_l_e_m_e_n_t__ │ │ │ │ +const Element * element_ │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:193 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ +const FiniteElement & finiteElement() const │ │ │ │ +Return the LocalFiniteElement for the element we are bound to. │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:175 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e_:_:_e_l_e_m_e_n_t │ │ │ │ +const Element & element() const │ │ │ │ +Return current element, throw if unbound. │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:166 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s │ │ │ │ +Pre-basis for a Rannacher-Turek basis. │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:58 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s_:_:_i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ +void initializeIndices() │ │ │ │ +Initialize the global indices. │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:82 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s_:_:_s_i_z_e___t_y_p_e │ │ │ │ std::size_t size_type │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:60 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_r_e_s_i_z_e │ │ │ │ -void resize(size_type n) │ │ │ │ -Specifies a new size for the OverflowArray. │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:97 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_p_o_i_n_t_e_r │ │ │ │ -value_type * pointer │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:58 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_c_o_n_s_t___i_t_e_r_a_t_o_r │ │ │ │ -Dune::GenericIterator< const OverflowArray, const value_type > const_iterator │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:62 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_b_a_c_k │ │ │ │ -const_reference back() const │ │ │ │ -Returns const reference to last element of OverflowArray. │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:194 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y │ │ │ │ -OverflowArray(const std::initializer_list< value_type > &l) │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:71 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_b_a_c_k │ │ │ │ -reference back() │ │ │ │ -Returns reference to last element of OverflowArray. │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:188 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_p_u_s_h___f_r_o_n_t │ │ │ │ -void push_front(const value_type &t) │ │ │ │ -Inserts an element to the begin of the OverflowArray,. │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:126 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_f_r_o_n_t │ │ │ │ -reference front() │ │ │ │ -Returns reference to first element of OverflowArray. │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:176 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_O_v_e_r_f_l_o_w_A_r_r_a_y_:_:_o_p_e_r_a_t_o_r_[_] │ │ │ │ -reference operator[](size_type i) │ │ │ │ -Returns reference to the i'th element. │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:154 │ │ │ │ +Type used for indices and size information. │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:67 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s_:_:_m_a_k_e_N_o_d_e │ │ │ │ +Node makeNode() const │ │ │ │ +Create tree node. │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:100 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s_:_:_u_p_d_a_t_e │ │ │ │ +void update(const GridView &gv) │ │ │ │ +Update the stored grid view, to be called if the grid has changed. │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:92 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s_:_:_i_n_d_i_c_e_s │ │ │ │ +It indices(const Node &node, It it) const │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:118 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ +GV GridView │ │ │ │ +The grid view that the FE basis is defined on. │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:64 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ +size_type dimension() const │ │ │ │ +Same as size(prefix) with empty prefix. │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:106 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s │ │ │ │ +RannacherTurekPreBasis(const GridView &gv) │ │ │ │ +Constructor for a given grid view object. │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:73 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s_:_:_N_o_d_e │ │ │ │ +RannacherTurekNode< GV > Node │ │ │ │ +Template mapping root tree path to type of created tree node. │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:70 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s_:_:_g_r_i_d_V_i_e_w │ │ │ │ +const GridView & gridView() const │ │ │ │ +Obtain the grid view that the basis is defined on. │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:86 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s_:_:_m_a_x_N_o_d_e_S_i_z_e │ │ │ │ +size_type maxNodeSize() const │ │ │ │ +Get the maximal number of DOFs associated to node for any element. │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:112 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s_:_:_g_r_i_d_V_i_e_w__ │ │ │ │ +GridView gridView_ │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:132 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _o_v_e_r_f_l_o_w_a_r_r_a_y_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _r_a_n_n_a_c_h_e_r_t_u_r_e_k_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00224.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: multiindex.hh File Reference │ │ │ +Dune-Functions: defaultglobalbasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,55 +88,63 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
multiindex.hh File Reference
│ │ │ +
defaultglobalbasis.hh File Reference
│ │ │
│ │ │
│ │ │
#include <cstddef>
│ │ │ -#include <array>
│ │ │ -#include <iostream>
│ │ │ -#include <ostream>
│ │ │ -#include <dune/common/hash.hh>
│ │ │ +#include <type_traits>
│ │ │ +#include <utility>
│ │ │ +#include <dune/common/reservedvector.hh>
│ │ │ +#include <dune/common/typeutilities.hh>
│ │ │ +#include <dune/common/concept.hh>
│ │ │ +#include <dune/common/typetree/treepath.hh>
│ │ │ +#include <dune/functions/common/type_traits.hh>
│ │ │ +#include <dune/functions/functionspacebases/defaultlocalview.hh>
│ │ │ +#include <dune/functions/functionspacebases/concepts.hh>
│ │ │ +#include <dune/functions/functionspacebases/containerdescriptors.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::StaticMultiIndex< size_type, n >
 A statically sized MultiIndex type. More...
class  Dune::Functions::StaticMultiIndex< size_type, 1 >
 A statically sized MultiIndex type. More...
struct  std::tuple_size< Dune::Functions::StaticMultiIndex< size_type, n > >
class  Dune::Functions::DefaultGlobalBasis< PB >
 Global basis for given pre-basis. More...
│ │ │ │ │ │ │ │ │ │ │ │ + │ │ │

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::BasisFactory
│ │ │ │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Functions

template<class size_type, std::size_t n>
std::ostream & Dune::Functions::operator<< (std::ostream &stream, const StaticMultiIndex< size_type, n > &c)
template<class PreBasis>
 Dune::Functions::DefaultGlobalBasis (PreBasis &&) -> DefaultGlobalBasis< std::decay_t< PreBasis > >
template<class GridView, class PreBasisFactory>
 Dune::Functions::DefaultGlobalBasis (const GridView &gv, PreBasisFactory &&f) -> DefaultGlobalBasis< std::decay_t< decltype(f(gv))> >
template<class GridView, class PreBasisFactory>
auto Dune::Functions::BasisFactory::makeBasis (const GridView &gridView, PreBasisFactory &&preBasisFactory)
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,29 +1,39 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -multiindex.hh File Reference │ │ │ │ +defaultglobalbasis.hh File Reference │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_l_o_c_a_l_v_i_e_w_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ - class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x_<_ _s_i_z_e___t_y_p_e_,_ _n_ _> │ │ │ │ -  A statically sized MultiIndex type. _M_o_r_e_._._. │ │ │ │ - class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x_<_ _s_i_z_e___t_y_p_e_,_ _1_ _> │ │ │ │ -  A statically sized MultiIndex type. _M_o_r_e_._._. │ │ │ │ -struct   _s_t_d_:_:_t_u_p_l_e___s_i_z_e_<_ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x_<_ _s_i_z_e___t_y_p_e_,_ _n_ _>_ _> │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_B_ _> │ │ │ │ +  Global basis for given pre-basis. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ +namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -std::ostream &  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_o_p_e_r_a_t_o_r_<_< (std::ostream &stream, const │ │ │ │ - _S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x< size_type, n > &c) │ │ │ │ +template │ │ │ │ +   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s (PreBasis &&) -> DefaultGlobalBasis< │ │ │ │ + std::decay_t< PreBasis > > │ │ │ │ +template │ │ │ │ +   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s (const GridView &gv, PreBasisFactory │ │ │ │ + &&f) -> DefaultGlobalBasis< std::decay_t< decltype(f(gv))> > │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_m_a_k_e_B_a_s_i_s (const GridView &gridView, │ │ │ │ + PreBasisFactory &&preBasisFactory) │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _m_u_l_t_i_i_n_d_e_x_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00224.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,6 +1,6 @@ │ │ │ │ var a00224 = [ │ │ │ │ - ["Dune::Functions::StaticMultiIndex< size_type, n >", "a01406.html", "a01406"], │ │ │ │ - ["Dune::Functions::StaticMultiIndex< size_type, 1 >", "a01410.html", "a01410"], │ │ │ │ - ["std::tuple_size< Dune::Functions::StaticMultiIndex< size_type, n > >", "a01414.html", null], │ │ │ │ - ["Dune::Functions::operator<<", "a00318.html#a6f484615f50c48002eaf30ed99750d64", null] │ │ │ │ + ["Dune::Functions::DefaultGlobalBasis< PB >", "a01818.html", "a01818"], │ │ │ │ + ["Dune::Functions::DefaultGlobalBasis", "a00318.html#a57d2c8b66fd384768b94af95e4ce5d78", null], │ │ │ │ + ["Dune::Functions::DefaultGlobalBasis", "a00318.html#a060058e4e3c070530978192cb7c99d39", null], │ │ │ │ + ["Dune::Functions::BasisFactory::makeBasis", "a00327.html#a1f0dc55c03c3a9862c76456d5574abe2", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00224_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: multiindex.hh Source File │ │ │ +Dune-Functions: defaultglobalbasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,129 +88,252 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
multiindex.hh
│ │ │ +
defaultglobalbasis.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH
│ │ │ -
8#define DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH
│ │ │ +
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH
│ │ │
9
│ │ │
10#include <cstddef>
│ │ │ -
11#include <array>
│ │ │ -
12#include <iostream>
│ │ │ -
13#include <ostream>
│ │ │ -
14
│ │ │ -
15#include <dune/common/hash.hh>
│ │ │ -
16
│ │ │ +
11#include <type_traits>
│ │ │ +
12#include <utility>
│ │ │ +
13
│ │ │ +
14#include <dune/common/reservedvector.hh>
│ │ │ +
15#include <dune/common/typeutilities.hh>
│ │ │ +
16#include <dune/common/concept.hh>
│ │ │
17
│ │ │ -
18namespace Dune::Functions {
│ │ │ +
18#include <dune/common/typetree/treepath.hh>
│ │ │
19
│ │ │ -
20
│ │ │ -
21
│ │ │ -
27template<class size_type, std::size_t n>
│ │ │ -
│ │ │ - │ │ │ -
29 public std::array<size_type, n>
│ │ │ -
30{
│ │ │ -
31public:
│ │ │ -
32 static constexpr std::size_t size() { return n; }
│ │ │ -
33 static constexpr std::size_t max_size() { return n; }
│ │ │ -
34
│ │ │ -
│ │ │ -
35 inline friend std::size_t hash_value(const StaticMultiIndex& v) noexcept {
│ │ │ -
36 return hash_range(v.begin(), v.end());
│ │ │ -
37 }
│ │ │ -
│ │ │ -
38
│ │ │ -
39};
│ │ │ -
│ │ │ -
40
│ │ │ -
41
│ │ │ -
42
│ │ │ -
52template<class size_type>
│ │ │ -
│ │ │ -
53class StaticMultiIndex<size_type,1> :
│ │ │ -
54 public std::array<size_type, 1>
│ │ │ -
55{
│ │ │ -
56public:
│ │ │ -
57
│ │ │ -
58 static constexpr std::size_t size() { return 1; }
│ │ │ -
59 static constexpr std::size_t max_size() { return 1; }
│ │ │ -
60
│ │ │ -
61
│ │ │ -
│ │ │ -
62 operator const size_type& () const {
│ │ │ -
63 return (*this)[0];
│ │ │ -
64 }
│ │ │ -
│ │ │ -
65
│ │ │ -
│ │ │ -
66 inline friend std::size_t hash_value(const StaticMultiIndex& v) noexcept {
│ │ │ -
67 return hash_range(v.begin(), v.end());
│ │ │ -
68 }
│ │ │ -
│ │ │ -
69
│ │ │ -
│ │ │ -
70 operator size_type& () {
│ │ │ -
71 return (*this)[0];
│ │ │ -
72 }
│ │ │ -
│ │ │ -
73
│ │ │ -
74};
│ │ │ -
│ │ │ -
75
│ │ │ -
76
│ │ │ -
77
│ │ │ -
78template<class size_type, std::size_t n>
│ │ │ -
│ │ │ -
79inline std::ostream& operator<<(std::ostream& stream, const StaticMultiIndex<size_type,n>& c) {
│ │ │ -
80 for (const auto& ci : c)
│ │ │ -
81 stream << ci << " ";
│ │ │ -
82 return stream;
│ │ │ -
83}
│ │ │ -
│ │ │ -
84
│ │ │ -
85
│ │ │ -
86
│ │ │ -
87} // namespace Dune::Functions
│ │ │ -
88
│ │ │ -
89template<class size_type, std::size_t n>
│ │ │ -
│ │ │ -
90struct std::tuple_size< Dune::Functions::StaticMultiIndex<size_type,n> >
│ │ │ -
91 : std::integral_constant<std::size_t, n> { };
│ │ │ -
│ │ │ -
92
│ │ │ -
93DUNE_DEFINE_HASH(DUNE_HASH_TEMPLATE_ARGS(typename size_type, std::size_t n),DUNE_HASH_TYPE(Dune::Functions::StaticMultiIndex<size_type,n>))
│ │ │ -
94
│ │ │ -
95#endif // DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
24
│ │ │ +
25
│ │ │ +
26
│ │ │ +
27namespace Dune {
│ │ │ +
28namespace Functions {
│ │ │ +
29
│ │ │ +
30
│ │ │ +
31
│ │ │ +
51template<class PB>
│ │ │ +
│ │ │ + │ │ │ +
53{
│ │ │ +
54
│ │ │ +
55public:
│ │ │ +
56
│ │ │ +
58 using PreBasis = PB;
│ │ │ +
59
│ │ │ +
61 using PrefixPath = TypeTree::TreePath<>;
│ │ │ +
62
│ │ │ +
64 using GridView = typename PreBasis::GridView;
│ │ │ +
65
│ │ │ +
67 using size_type = std::size_t;
│ │ │ +
68
│ │ │ + │ │ │ +
71
│ │ │ + │ │ │ +
74
│ │ │ +
76 using SizePrefix = Dune::ReservedVector<std::size_t, PreBasis::multiIndexBufferSize>;
│ │ │ +
77
│ │ │ +
86 template<class... T,
│ │ │ +
87 disableCopyMove<DefaultGlobalBasis, T...> = 0,
│ │ │ + │ │ │ +
│ │ │ + │ │ │ +
90 preBasis_(std::forward<T>(t)...),
│ │ │ + │ │ │ +
92 {
│ │ │ +
93 static_assert(models<Concept::PreBasis<GridView>, PreBasis>(), "Type passed to DefaultGlobalBasis does not model the PreBasis concept.");
│ │ │ +
94 preBasis_.initializeIndices();
│ │ │ +
95 }
│ │ │ +
│ │ │ +
96
│ │ │ +
103 template<class PreBasisFactory,
│ │ │ +
104 std::enable_if_t<Dune::IsCallable<PreBasisFactory(GridView), PreBasis>::value, int> = 0>
│ │ │ +
│ │ │ +
105 DefaultGlobalBasis(const GridView& gridView, PreBasisFactory&& factory) :
│ │ │ +
106 preBasis_(factory(gridView)),
│ │ │ + │ │ │ +
108 {
│ │ │ +
109 static_assert(models<Concept::PreBasis<GridView>, PreBasis>(), "Type passed to DefaultGlobalBasis does not model the PreBasis concept.");
│ │ │ +
110 preBasis_.initializeIndices();
│ │ │ +
111 }
│ │ │ +
│ │ │ +
112
│ │ │ +
│ │ │ +
114 const GridView& gridView() const
│ │ │ +
115 {
│ │ │ +
116 return preBasis_.gridView();
│ │ │ +
117 }
│ │ │ +
│ │ │ +
118
│ │ │ +
│ │ │ +
120 const PreBasis& preBasis() const
│ │ │ +
121 {
│ │ │ +
122 return preBasis_;
│ │ │ +
123 }
│ │ │ +
│ │ │ +
124
│ │ │ +
│ │ │ + │ │ │ +
127 {
│ │ │ +
128 return preBasis_;
│ │ │ +
129 }
│ │ │ +
│ │ │ +
130
│ │ │ +
│ │ │ +
137 void update(const GridView & gv)
│ │ │ +
138 {
│ │ │ +
139 preBasis_.update(gv);
│ │ │ +
140 preBasis_.initializeIndices();
│ │ │ +
141 }
│ │ │ +
│ │ │ +
142
│ │ │ +
│ │ │ + │ │ │ +
145 {
│ │ │ +
146 return preBasis_.dimension();
│ │ │ +
147 }
│ │ │ +
│ │ │ +
148
│ │ │ +
│ │ │ + │ │ │ +
151 {
│ │ │ +
152 return preBasis_.size();
│ │ │ +
153 }
│ │ │ +
│ │ │ +
154
│ │ │ +
│ │ │ +
156 size_type size(const SizePrefix& prefix) const
│ │ │ +
157 {
│ │ │ +
158 return preBasis_.size(prefix);
│ │ │ +
159 }
│ │ │ +
│ │ │ +
160
│ │ │ +
│ │ │ + │ │ │ +
163 {
│ │ │ +
164 return LocalView(*this);
│ │ │ +
165 }
│ │ │ +
│ │ │ +
166
│ │ │ +
│ │ │ + │ │ │ +
169 {
│ │ │ +
170 return *this;
│ │ │ +
171 }
│ │ │ +
│ │ │ +
172
│ │ │ +
│ │ │ +
174 const PrefixPath& prefixPath() const
│ │ │ +
175 {
│ │ │ +
176 return prefixPath_;
│ │ │ +
177 }
│ │ │ +
│ │ │ +
178
│ │ │ +
│ │ │ + │ │ │ +
181 {
│ │ │ +
182 if constexpr (requires(PreBasis pb){ pb.containerDescriptor(); })
│ │ │ +
183 return preBasis_.containerDescriptor();
│ │ │ +
184 else
│ │ │ + │ │ │ +
186 }
│ │ │ +
│ │ │ +
187
│ │ │ +
188protected:
│ │ │ + │ │ │ + │ │ │ +
191};
│ │ │ +
│ │ │ +
192
│ │ │ +
193
│ │ │ +
194
│ │ │ +
195template<class PreBasis>
│ │ │ + │ │ │ +
197
│ │ │ +
198template<class GridView, class PreBasisFactory>
│ │ │ +
199DefaultGlobalBasis(const GridView& gv, PreBasisFactory&& f) -> DefaultGlobalBasis<std::decay_t<decltype(f(gv))>>;
│ │ │ +
200
│ │ │ +
201
│ │ │ +
202
│ │ │ +
203namespace BasisFactory {
│ │ │ +
204
│ │ │ +
205template<class GridView, class PreBasisFactory>
│ │ │ +
│ │ │ +
206auto makeBasis(const GridView& gridView, PreBasisFactory&& preBasisFactory)
│ │ │ +
207{
│ │ │ +
208 return DefaultGlobalBasis(preBasisFactory(gridView));
│ │ │ +
209}
│ │ │ +
│ │ │ +
210
│ │ │ +
211} // end namespace BasisFactory
│ │ │ +
212
│ │ │ +
213
│ │ │ +
214} // end namespace Functions
│ │ │ +
215} // end namespace Dune
│ │ │ +
216
│ │ │ +
217
│ │ │ +
218
│ │ │ +
219#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH
│ │ │ + │ │ │ + │ │ │ +
Lightweight representation of (hierarchical) size and block structure extracted from a basis to descr...
│ │ │ +
std::enable_if_t< std::is_constructible_v< T, Args... >, int > enableIfConstructible
Helper to constrain forwarding constructors.
Definition type_traits.hh:30
│ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
std::ostream & operator<<(std::ostream &stream, const StaticMultiIndex< size_type, n > &c)
Definition multiindex.hh:79
│ │ │ -
A statically sized MultiIndex type.
Definition multiindex.hh:30
│ │ │ -
static constexpr std::size_t size()
Definition multiindex.hh:32
│ │ │ -
friend std::size_t hash_value(const StaticMultiIndex &v) noexcept
Definition multiindex.hh:35
│ │ │ -
static constexpr std::size_t max_size()
Definition multiindex.hh:33
│ │ │ -
static constexpr std::size_t max_size()
Definition multiindex.hh:59
│ │ │ -
static constexpr std::size_t size()
Definition multiindex.hh:58
│ │ │ -
friend std::size_t hash_value(const StaticMultiIndex &v) noexcept
Definition multiindex.hh:66
│ │ │ +
DefaultGlobalBasis(PreBasis &&) -> DefaultGlobalBasis< std::decay_t< PreBasis > >
│ │ │ +
Definition argyrisbasis.hh:926
│ │ │ +
auto makeBasis(const GridView &gridView, PreBasisFactory &&preBasisFactory)
Definition defaultglobalbasis.hh:206
│ │ │ +
GV GridView
The grid view that the FE basis is defined on.
Definition argyrisbasis.hh:880
│ │ │ +
Fallback container descriptor if nothing else fits.
Definition containerdescriptors.hh:52
│ │ │ +
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:53
│ │ │ +
Dune::ReservedVector< std::size_t, PreBasis::multiIndexBufferSize > SizePrefix
Definition defaultglobalbasis.hh:76
│ │ │ +
std::size_t size_type
Definition defaultglobalbasis.hh:67
│ │ │ +
typename PreBasis::GridView GridView
Definition defaultglobalbasis.hh:64
│ │ │ +
TypeTree::TreePath<> PrefixPath
Definition defaultglobalbasis.hh:61
│ │ │ +
const GridView & gridView() const
Definition defaultglobalbasis.hh:114
│ │ │ +
ArgyrisPreBasis< GV, R > PreBasis
Definition defaultglobalbasis.hh:58
│ │ │ +
DefaultLocalView< DefaultGlobalBasis< PreBasis > > LocalView
Definition defaultglobalbasis.hh:70
│ │ │ +
PreBasis & preBasis()
Obtain the pre-basis providing the implementation details.
Definition defaultglobalbasis.hh:126
│ │ │ +
void update(const GridView &gv)
Update the stored grid view.
Definition defaultglobalbasis.hh:137
│ │ │ +
typename LocalView::MultiIndex MultiIndex
Definition defaultglobalbasis.hh:73
│ │ │ +
size_type size(const SizePrefix &prefix) const
Return number of possible values for next position in multi index.
Definition defaultglobalbasis.hh:156
│ │ │ +
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition defaultglobalbasis.hh:144
│ │ │ +
PreBasis preBasis_
Definition defaultglobalbasis.hh:189
│ │ │ +
LocalView localView() const
Return local view for basis.
Definition defaultglobalbasis.hh:162
│ │ │ +
DefaultGlobalBasis(T &&... t)
Constructor.
Definition defaultglobalbasis.hh:89
│ │ │ +
DefaultGlobalBasis(const GridView &gridView, PreBasisFactory &&factory)
Constructor from a PreBasis factory.
Definition defaultglobalbasis.hh:105
│ │ │ +
size_type size() const
Return number of possible values for next position in empty multi index.
Definition defaultglobalbasis.hh:150
│ │ │ +
const PreBasis & preBasis() const
Obtain the pre-basis providing the implementation details.
Definition defaultglobalbasis.hh:120
│ │ │ +
PrefixPath prefixPath_
Definition defaultglobalbasis.hh:190
│ │ │ +
auto containerDescriptor() const
Return the associated container descriptor.
Definition defaultglobalbasis.hh:180
│ │ │ +
const DefaultGlobalBasis & rootBasis() const
Return *this because we are not embedded in a larger basis.
Definition defaultglobalbasis.hh:168
│ │ │ +
const PrefixPath & prefixPath() const
Return empty path, because this is the root in the local ansatz tree.
Definition defaultglobalbasis.hh:174
│ │ │ +
The restriction of a finite element basis to a single element.
Definition defaultlocalview.hh:32
│ │ │ +
std::conditional_t<(PreBasis::minMultiIndexSize==PreBasis::maxMultiIndexSize), StaticMultiIndex< size_type, PreBasis::maxMultiIndexSize >, Dune::ReservedVector< size_type, PreBasis::multiIndexBufferSize > > MultiIndex
Definition defaultlocalview.hh:65
│ │ │ + │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,125 +1,301 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -multiindex.hh │ │ │ │ +defaultglobalbasis.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH │ │ │ │ -8#define DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH │ │ │ │ +8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH │ │ │ │ 9 │ │ │ │ 10#include │ │ │ │ -11#include │ │ │ │ -12#include │ │ │ │ -13#include │ │ │ │ -14 │ │ │ │ -15#include │ │ │ │ -16 │ │ │ │ +11#include │ │ │ │ +12#include │ │ │ │ +13 │ │ │ │ +14#include │ │ │ │ +15#include │ │ │ │ +16#include │ │ │ │ 17 │ │ │ │ -18namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ +18#include │ │ │ │ 19 │ │ │ │ -20 │ │ │ │ -21 │ │ │ │ -27template │ │ │ │ -_2_8class _S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x : │ │ │ │ -29 public std::array │ │ │ │ -30{ │ │ │ │ -31public: │ │ │ │ -_3_2 static constexpr std::size_t _s_i_z_e() { return n; } │ │ │ │ -_3_3 static constexpr std::size_t _m_a_x___s_i_z_e() { return n; } │ │ │ │ -34 │ │ │ │ -_3_5 inline friend std::size_t _h_a_s_h___v_a_l_u_e(const _S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x& v) noexcept { │ │ │ │ -36 return hash_range(v.begin(), v.end()); │ │ │ │ -37 } │ │ │ │ -38 │ │ │ │ -39}; │ │ │ │ -40 │ │ │ │ -41 │ │ │ │ -42 │ │ │ │ -52template │ │ │ │ -_5_3class _S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x : │ │ │ │ -54 public std::array │ │ │ │ -55{ │ │ │ │ -56public: │ │ │ │ -57 │ │ │ │ -_5_8 static constexpr std::size_t _s_i_z_e() { return 1; } │ │ │ │ -_5_9 static constexpr std::size_t _m_a_x___s_i_z_e() { return 1; } │ │ │ │ -60 │ │ │ │ -61 │ │ │ │ -_6_2 operator const size_type& () const { │ │ │ │ -63 return (*this)[0]; │ │ │ │ -64 } │ │ │ │ +20#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ +21#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_l_o_c_a_l_v_i_e_w_._h_h> │ │ │ │ +22#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +23#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h> │ │ │ │ +24 │ │ │ │ +25 │ │ │ │ +26 │ │ │ │ +27namespace _D_u_n_e { │ │ │ │ +28namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +29 │ │ │ │ +30 │ │ │ │ +31 │ │ │ │ +51template │ │ │ │ +_5_2class _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ +53{ │ │ │ │ +54 │ │ │ │ +55public: │ │ │ │ +56 │ │ │ │ +_5_8 using _P_r_e_B_a_s_i_s = PB; │ │ │ │ +59 │ │ │ │ +_6_1 using _P_r_e_f_i_x_P_a_t_h = TypeTree::TreePath<>; │ │ │ │ +62 │ │ │ │ +_6_4 using _G_r_i_d_V_i_e_w = typename _P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w; │ │ │ │ 65 │ │ │ │ -_6_6 inline friend std::size_t _h_a_s_h___v_a_l_u_e(const _S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x& v) noexcept { │ │ │ │ -67 return hash_range(v.begin(), v.end()); │ │ │ │ -68 } │ │ │ │ -69 │ │ │ │ -_7_0 operator size_type& () { │ │ │ │ -71 return (*this)[0]; │ │ │ │ -72 } │ │ │ │ -73 │ │ │ │ -74}; │ │ │ │ -75 │ │ │ │ -76 │ │ │ │ +_6_7 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ +68 │ │ │ │ +_7_0 using _L_o_c_a_l_V_i_e_w = _D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_P_r_e_B_a_s_i_s_>>; │ │ │ │ +71 │ │ │ │ +_7_3 using _M_u_l_t_i_I_n_d_e_x = typename _L_o_c_a_l_V_i_e_w_:_:_M_u_l_t_i_I_n_d_e_x; │ │ │ │ +74 │ │ │ │ +_7_6 using _S_i_z_e_P_r_e_f_i_x = Dune::ReservedVector; │ │ │ │ 77 │ │ │ │ -78template │ │ │ │ -_7_9inline std::ostream& _o_p_e_r_a_t_o_r_<_<(std::ostream& stream, const │ │ │ │ -_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x_<_s_i_z_e___t_y_p_e_,_n_>& c) { │ │ │ │ -80 for (const auto& ci : c) │ │ │ │ -81 stream << ci << " "; │ │ │ │ -82 return stream; │ │ │ │ -83} │ │ │ │ -84 │ │ │ │ -85 │ │ │ │ -86 │ │ │ │ -87} // namespace Dune::Functions │ │ │ │ -88 │ │ │ │ -89template │ │ │ │ -_9_0struct std::tuple_size< _D_u_n_e::Functions::StaticMultiIndex > │ │ │ │ -91 : std::integral_constant { }; │ │ │ │ -92 │ │ │ │ -93DUNE_DEFINE_HASH(DUNE_HASH_TEMPLATE_ARGS(typename size_type, std::size_t │ │ │ │ -n),DUNE_HASH_TYPE(_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x_<_s_i_z_e___t_y_p_e_,_n_>)) │ │ │ │ -94 │ │ │ │ -95#endif // DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH │ │ │ │ +86 template = 0, │ │ │ │ +88 _e_n_a_b_l_e_I_f_C_o_n_s_t_r_u_c_t_i_b_l_e<_P_r_e_B_a_s_i_s, T...> = 0> │ │ │ │ +_8_9 _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s(T&&... t) : │ │ │ │ +90 _p_r_e_B_a_s_i_s__(std::forward(t)...), │ │ │ │ +91 _p_r_e_f_i_x_P_a_t_h__() │ │ │ │ +92 { │ │ │ │ +93 static_assert(models, _P_r_e_B_a_s_i_s>(), "Type passed │ │ │ │ +to DefaultGlobalBasis does not model the PreBasis concept."); │ │ │ │ +94 _p_r_e_B_a_s_i_s__.initializeIndices(); │ │ │ │ +95 } │ │ │ │ +96 │ │ │ │ +103 template:: │ │ │ │ +value, int> = 0> │ │ │ │ +_1_0_5 _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s(const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w, PreBasisFactory&& factory) : │ │ │ │ +106 _p_r_e_B_a_s_i_s__(factory(_g_r_i_d_V_i_e_w)), │ │ │ │ +107 _p_r_e_f_i_x_P_a_t_h__() │ │ │ │ +108 { │ │ │ │ +109 static_assert(models, _P_r_e_B_a_s_i_s>(), "Type passed │ │ │ │ +to DefaultGlobalBasis does not model the PreBasis concept."); │ │ │ │ +110 _p_r_e_B_a_s_i_s__.initializeIndices(); │ │ │ │ +111 } │ │ │ │ +112 │ │ │ │ +_1_1_4 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ +115 { │ │ │ │ +116 return _p_r_e_B_a_s_i_s__.gridView(); │ │ │ │ +117 } │ │ │ │ +118 │ │ │ │ +_1_2_0 const _P_r_e_B_a_s_i_s& _p_r_e_B_a_s_i_s() const │ │ │ │ +121 { │ │ │ │ +122 return _p_r_e_B_a_s_i_s__; │ │ │ │ +123 } │ │ │ │ +124 │ │ │ │ +_1_2_6 _P_r_e_B_a_s_i_s& _p_r_e_B_a_s_i_s() │ │ │ │ +127 { │ │ │ │ +128 return _p_r_e_B_a_s_i_s__; │ │ │ │ +129 } │ │ │ │ +130 │ │ │ │ +_1_3_7 void _u_p_d_a_t_e(const _G_r_i_d_V_i_e_w & gv) │ │ │ │ +138 { │ │ │ │ +139 _p_r_e_B_a_s_i_s__.update(gv); │ │ │ │ +140 _p_r_e_B_a_s_i_s__.initializeIndices(); │ │ │ │ +141 } │ │ │ │ +142 │ │ │ │ +_1_4_4 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ +145 { │ │ │ │ +146 return _p_r_e_B_a_s_i_s__.dimension(); │ │ │ │ +147 } │ │ │ │ +148 │ │ │ │ +_1_5_0 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ +151 { │ │ │ │ +152 return _p_r_e_B_a_s_i_s__.size(); │ │ │ │ +153 } │ │ │ │ +154 │ │ │ │ +_1_5_6 _s_i_z_e___t_y_p_e _s_i_z_e(const _S_i_z_e_P_r_e_f_i_x& prefix) const │ │ │ │ +157 { │ │ │ │ +158 return _p_r_e_B_a_s_i_s__.size(prefix); │ │ │ │ +159 } │ │ │ │ +160 │ │ │ │ +_1_6_2 _L_o_c_a_l_V_i_e_w _l_o_c_a_l_V_i_e_w() const │ │ │ │ +163 { │ │ │ │ +164 return _L_o_c_a_l_V_i_e_w(*this); │ │ │ │ +165 } │ │ │ │ +166 │ │ │ │ +_1_6_8 const _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s& _r_o_o_t_B_a_s_i_s() const │ │ │ │ +169 { │ │ │ │ +170 return *this; │ │ │ │ +171 } │ │ │ │ +172 │ │ │ │ +_1_7_4 const _P_r_e_f_i_x_P_a_t_h& _p_r_e_f_i_x_P_a_t_h() const │ │ │ │ +175 { │ │ │ │ +176 return _p_r_e_f_i_x_P_a_t_h__; │ │ │ │ +177 } │ │ │ │ +178 │ │ │ │ +_1_8_0 auto _c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r() const │ │ │ │ +181 { │ │ │ │ +182 if constexpr (requires(_P_r_e_B_a_s_i_s pb){ pb.containerDescriptor(); }) │ │ │ │ +183 return _p_r_e_B_a_s_i_s__.containerDescriptor(); │ │ │ │ +184 else │ │ │ │ +185 return _C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_k_n_o_w_n{}; │ │ │ │ +186 } │ │ │ │ +187 │ │ │ │ +188protected: │ │ │ │ +_1_8_9 _P_r_e_B_a_s_i_s _p_r_e_B_a_s_i_s__; │ │ │ │ +_1_9_0 _P_r_e_f_i_x_P_a_t_h _p_r_e_f_i_x_P_a_t_h__; │ │ │ │ +191}; │ │ │ │ +192 │ │ │ │ +193 │ │ │ │ +194 │ │ │ │ +195template │ │ │ │ +_1_9_6_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s(PreBasis&&) -> _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_s_t_d_:_: │ │ │ │ +_d_e_c_a_y___t_<_P_r_e_B_a_s_i_s_>>; │ │ │ │ +197 │ │ │ │ +198template │ │ │ │ +_1_9_9_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s(const GridView& gv, PreBasisFactory&& f) - │ │ │ │ +> _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s>; │ │ │ │ +200 │ │ │ │ +201 │ │ │ │ +202 │ │ │ │ +203namespace _B_a_s_i_s_F_a_c_t_o_r_y { │ │ │ │ +204 │ │ │ │ +205template │ │ │ │ +_2_0_6auto _m_a_k_e_B_a_s_i_s(const GridView& gridView, PreBasisFactory&& preBasisFactory) │ │ │ │ +207{ │ │ │ │ +208 return _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s(preBasisFactory(gridView)); │ │ │ │ +209} │ │ │ │ +210 │ │ │ │ +211} // end namespace BasisFactory │ │ │ │ +212 │ │ │ │ +213 │ │ │ │ +214} // end namespace Functions │ │ │ │ +215} // end namespace Dune │ │ │ │ +216 │ │ │ │ +217 │ │ │ │ +218 │ │ │ │ +219#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH │ │ │ │ +_t_y_p_e___t_r_a_i_t_s_._h_h │ │ │ │ +_d_e_f_a_u_l_t_l_o_c_a_l_v_i_e_w_._h_h │ │ │ │ +_c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h │ │ │ │ +Lightweight representation of (hierarchical) size and block structure extracted │ │ │ │ +from a basis to descr... │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_e_n_a_b_l_e_I_f_C_o_n_s_t_r_u_c_t_i_b_l_e │ │ │ │ +std::enable_if_t< std::is_constructible_v< T, Args... >, int > │ │ │ │ +enableIfConstructible │ │ │ │ +Helper to constrain forwarding constructors. │ │ │ │ +DDeeffiinniittiioonn type_traits.hh:30 │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_o_p_e_r_a_t_o_r_<_< │ │ │ │ -std::ostream & operator<<(std::ostream &stream, const StaticMultiIndex< │ │ │ │ -size_type, n > &c) │ │ │ │ -DDeeffiinniittiioonn multiindex.hh:79 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x │ │ │ │ -A statically sized MultiIndex type. │ │ │ │ -DDeeffiinniittiioonn multiindex.hh:30 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x_:_:_s_i_z_e │ │ │ │ -static constexpr std::size_t size() │ │ │ │ -DDeeffiinniittiioonn multiindex.hh:32 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x_:_:_h_a_s_h___v_a_l_u_e │ │ │ │ -friend std::size_t hash_value(const StaticMultiIndex &v) noexcept │ │ │ │ -DDeeffiinniittiioonn multiindex.hh:35 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x_:_:_m_a_x___s_i_z_e │ │ │ │ -static constexpr std::size_t max_size() │ │ │ │ -DDeeffiinniittiioonn multiindex.hh:33 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x_<_ _s_i_z_e___t_y_p_e_,_ _1_ _>_:_:_m_a_x___s_i_z_e │ │ │ │ -static constexpr std::size_t max_size() │ │ │ │ -DDeeffiinniittiioonn multiindex.hh:59 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x_<_ _s_i_z_e___t_y_p_e_,_ _1_ _>_:_:_s_i_z_e │ │ │ │ -static constexpr std::size_t size() │ │ │ │ -DDeeffiinniittiioonn multiindex.hh:58 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x_<_ _s_i_z_e___t_y_p_e_,_ _1_ _>_:_:_h_a_s_h___v_a_l_u_e │ │ │ │ -friend std::size_t hash_value(const StaticMultiIndex &v) noexcept │ │ │ │ -DDeeffiinniittiioonn multiindex.hh:66 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ +DefaultGlobalBasis(PreBasis &&) -> DefaultGlobalBasis< std::decay_t< PreBasis > │ │ │ │ +> │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ +DDeeffiinniittiioonn argyrisbasis.hh:926 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_m_a_k_e_B_a_s_i_s │ │ │ │ +auto makeBasis(const GridView &gridView, PreBasisFactory &&preBasisFactory) │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:206 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ +GV GridView │ │ │ │ +The grid view that the FE basis is defined on. │ │ │ │ +DDeeffiinniittiioonn argyrisbasis.hh:880 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_k_n_o_w_n │ │ │ │ +Fallback container descriptor if nothing else fits. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:52 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ +Global basis for given pre-basis. │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:53 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_<_ _G_V_,_ _R_ _>_ _>_:_:_S_i_z_e_P_r_e_f_i_x │ │ │ │ +Dune::ReservedVector< std::size_t, PreBasis::multiIndexBufferSize > SizePrefix │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:76 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_<_ _G_V_,_ _R_ _>_ _>_:_:_s_i_z_e___t_y_p_e │ │ │ │ +std::size_t size_type │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:67 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_<_ _G_V_,_ _R_ _>_ _>_:_:_G_r_i_d_V_i_e_w │ │ │ │ +typename PreBasis::GridView GridView │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:64 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_<_ _G_V_,_ _R_ _>_ _>_:_:_P_r_e_f_i_x_P_a_t_h │ │ │ │ +TypeTree::TreePath<> PrefixPath │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:61 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_<_ _G_V_,_ _R_ _>_ _>_:_:_g_r_i_d_V_i_e_w │ │ │ │ +const GridView & gridView() const │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:114 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_<_ _G_V_,_ _R_ _>_ _>_:_:_P_r_e_B_a_s_i_s │ │ │ │ +ArgyrisPreBasis< GV, R > PreBasis │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:58 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_<_ _G_V_,_ _R_ _>_ _>_:_:_L_o_c_a_l_V_i_e_w │ │ │ │ +DefaultLocalView< DefaultGlobalBasis< PreBasis > > LocalView │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:70 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_:_:_p_r_e_B_a_s_i_s │ │ │ │ +PreBasis & preBasis() │ │ │ │ +Obtain the pre-basis providing the implementation details. │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:126 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_:_:_u_p_d_a_t_e │ │ │ │ +void update(const GridView &gv) │ │ │ │ +Update the stored grid view. │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:137 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_<_ _G_V_,_ _R_ _>_ _>_:_:_M_u_l_t_i_I_n_d_e_x │ │ │ │ +typename LocalView::MultiIndex MultiIndex │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:73 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ +size_type size(const SizePrefix &prefix) const │ │ │ │ +Return number of possible values for next position in multi index. │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:156 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ +size_type dimension() const │ │ │ │ +Get the total dimension of the space spanned by this basis. │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:144 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_<_ _G_V_,_ _R_ _>_ _>_:_:_p_r_e_B_a_s_i_s__ │ │ │ │ +PreBasis preBasis_ │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:189 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_:_:_l_o_c_a_l_V_i_e_w │ │ │ │ +LocalView localView() const │ │ │ │ +Return local view for basis. │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:162 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ +DefaultGlobalBasis(T &&... t) │ │ │ │ +Constructor. │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:89 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ +DefaultGlobalBasis(const GridView &gridView, PreBasisFactory &&factory) │ │ │ │ +Constructor from a PreBasis factory. │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:105 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_:_:_s_i_z_e │ │ │ │ +size_type size() const │ │ │ │ +Return number of possible values for next position in empty multi index. │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:150 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_:_:_p_r_e_B_a_s_i_s │ │ │ │ +const PreBasis & preBasis() const │ │ │ │ +Obtain the pre-basis providing the implementation details. │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:120 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _A_r_g_y_r_i_s_P_r_e_B_a_s_i_s_<_ _G_V_,_ _R_ _>_ _>_:_:_p_r_e_f_i_x_P_a_t_h__ │ │ │ │ +PrefixPath prefixPath_ │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:190 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r │ │ │ │ +auto containerDescriptor() const │ │ │ │ +Return the associated container descriptor. │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:180 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_:_:_r_o_o_t_B_a_s_i_s │ │ │ │ +const DefaultGlobalBasis & rootBasis() const │ │ │ │ +Return *this because we are not embedded in a larger basis. │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:168 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_:_:_p_r_e_f_i_x_P_a_t_h │ │ │ │ +const PrefixPath & prefixPath() const │ │ │ │ +Return empty path, because this is the root in the local ansatz tree. │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:174 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w │ │ │ │ +The restriction of a finite element basis to a single element. │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:32 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w_<_ _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_ _P_r_e_B_a_s_i_s_ _>_ _>_:_:_M_u_l_t_i_I_n_d_e_x │ │ │ │ +std::conditional_t<(PreBasis::minMultiIndexSize==PreBasis::maxMultiIndexSize), │ │ │ │ +StaticMultiIndex< size_type, PreBasis::maxMultiIndexSize >, Dune:: │ │ │ │ +ReservedVector< size_type, PreBasis::multiIndexBufferSize > > MultiIndex │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:65 │ │ │ │ +_c_o_n_c_e_p_t_s_._h_h │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _m_u_l_t_i_i_n_d_e_x_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00227.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: mapperutilities.hh File Reference │ │ │ +Dune-Functions: raviartthomasbasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,42 +88,73 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
mapperutilities.hh File Reference
│ │ │ +
raviartthomasbasis.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <vector>
│ │ │ -#include <bitset>
│ │ │ -#include <dune/common/rangeutilities.hh>
│ │ │ -#include <dune/grid/common/rangegenerators.hh>
│ │ │ +
#include <array>
│ │ │ +#include <dune/common/exceptions.hh>
│ │ │ +#include <dune/grid/common/capabilities.hh>
│ │ │ #include <dune/grid/common/mcmgmapper.hh>
│ │ │ +#include <dune/localfunctions/common/localfiniteelementvariant.hh>
│ │ │ +#include <dune/localfunctions/raviartthomas.hh>
│ │ │ +#include <dune/localfunctions/raviartthomas/raviartthomas0cube2d.hh>
│ │ │ +#include <dune/localfunctions/raviartthomas/raviartthomas0cube3d.hh>
│ │ │ +#include <dune/localfunctions/raviartthomas/raviartthomas02d.hh>
│ │ │ +#include <dune/localfunctions/raviartthomas/raviartthomas03d.hh>
│ │ │ +#include <dune/localfunctions/raviartthomas/raviartthomas1cube2d.hh>
│ │ │ +#include <dune/localfunctions/raviartthomas/raviartthomas1cube3d.hh>
│ │ │ +#include <dune/localfunctions/raviartthomas/raviartthomas12d.hh>
│ │ │ +#include <dune/localfunctions/raviartthomas/raviartthomas2cube2d.hh>
│ │ │ +#include <dune/functions/functionspacebases/globalvaluedlocalfiniteelement.hh>
│ │ │ +#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ +#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │ +#include <dune/functions/functionspacebases/leafprebasismappermixin.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ + │ │ │ + │ │ │ + │ │ │ +

│ │ │ +Classes

class  Dune::Functions::RaviartThomasPreBasis< GV, k >
class  Dune::Functions::RaviartThomasNode< GV, k >
│ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ +

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::BasisFactory
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +

│ │ │ +Typedefs

template<typename GV, int k>
using Dune::Functions::RaviartThomasBasis = DefaultGlobalBasis<RaviartThomasPreBasis<GV, k> >
 Basis of a k-th-order Raviart Thomas finite element space.
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ +Functions

template<std::size_t k>
auto Dune::Functions::BasisFactory::raviartThomas ()
 Create a pre-basis factory that can create a Raviart-Thomas pre-basis.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,19 +1,45 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -mapperutilities.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ +raviartthomasbasis.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ #include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_g_l_o_b_a_l_v_a_l_u_e_d_l_o_c_a_l_f_i_n_i_t_e_e_l_e_m_e_n_t_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ +CCllaasssseess │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s_<_ _G_V_,_ _k_ _> │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e_<_ _G_V_,_ _k_ _> │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ +namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ +TTyyppeeddeeffss │ │ │ │ +template │ │ │ │ +using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_B_a_s_i_s = │ │ │ │ + _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s<_R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s > │ │ │ │ +  Basis of a k-th-order Raviart Thomas finite element space. │ │ │ │ +FFuunnccttiioonnss │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_r_a_v_i_a_r_t_T_h_o_m_a_s () │ │ │ │ +  Create a pre-basis factory that can create a Raviart-Thomas pre-basis. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _m_a_p_p_e_r_u_t_i_l_i_t_i_e_s_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _r_a_v_i_a_r_t_t_h_o_m_a_s_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00227_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: mapperutilities.hh Source File │ │ │ +Dune-Functions: raviartthomasbasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,183 +88,468 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
mapperutilities.hh
│ │ │ +
raviartthomasbasis.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_COMMON_MAPPERUTILITIES_HH
│ │ │ -
8#define DUNE_FUNCTIONS_COMMON_MAPPERUTILITIES_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH
│ │ │ +
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH
│ │ │
9
│ │ │ -
10#include <vector>
│ │ │ -
11#include <bitset>
│ │ │ +
10#include <array>
│ │ │ +
11#include <dune/common/exceptions.hh>
│ │ │
12
│ │ │ -
13#include <dune/common/rangeutilities.hh>
│ │ │ -
14
│ │ │ -
15#include <dune/grid/common/rangegenerators.hh>
│ │ │ -
16#include <dune/grid/common/mcmgmapper.hh>
│ │ │ -
17
│ │ │ -
18namespace Dune::Functions {
│ │ │ -
19
│ │ │ -
20// All utilities are in Impl:: and thus considered implementation
│ │ │ -
21// details for now. However, one may want to think about making
│ │ │ -
22// them public. Then they could also be put into dune-grid,
│ │ │ -
23// since there's nothing dune-function specific about them.
│ │ │ -
24namespace Impl {
│ │ │ -
25
│ │ │ +
13#include <dune/grid/common/capabilities.hh>
│ │ │ +
14#include <dune/grid/common/mcmgmapper.hh>
│ │ │ +
15
│ │ │ +
16#include <dune/localfunctions/common/localfiniteelementvariant.hh>
│ │ │ +
17#include <dune/localfunctions/raviartthomas.hh>
│ │ │ +
18#include <dune/localfunctions/raviartthomas/raviartthomas0cube2d.hh>
│ │ │ +
19#include <dune/localfunctions/raviartthomas/raviartthomas0cube3d.hh>
│ │ │ +
20#include <dune/localfunctions/raviartthomas/raviartthomas02d.hh>
│ │ │ +
21#include <dune/localfunctions/raviartthomas/raviartthomas03d.hh>
│ │ │ +
22#include <dune/localfunctions/raviartthomas/raviartthomas1cube2d.hh>
│ │ │ +
23#include <dune/localfunctions/raviartthomas/raviartthomas1cube3d.hh>
│ │ │ +
24#include <dune/localfunctions/raviartthomas/raviartthomas12d.hh>
│ │ │ +
25#include <dune/localfunctions/raviartthomas/raviartthomas2cube2d.hh>
│ │ │
26
│ │ │ -
27
│ │ │ -
28 // Helper class providing an unordered range
│ │ │ -
29 // of global indices associated to the element
│ │ │ -
30 // within a MultipleCodimMultipleGeomTypeMapper.
│ │ │ -
31 // This has to be bound to an element, before
│ │ │ -
32 // it can be used.
│ │ │ -
33 template<class GV>
│ │ │ -
34 class MapperElementSubIndices
│ │ │ -
35 {
│ │ │ -
36 using IndexContainer = std::vector<typename Dune::MultipleCodimMultipleGeomTypeMapper<GV>::Index>;
│ │ │ -
37 public:
│ │ │ -
38 using GridView = GV;
│ │ │ -
39 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView>;
│ │ │ -
40 using Index = typename Mapper::Index;
│ │ │ -
41 using Element = typename GridView::template Codim<0>::Entity;
│ │ │ -
42
│ │ │ -
43 MapperElementSubIndices(const Mapper& mapper)
│ │ │ -
44 : mapper_(mapper)
│ │ │ -
45 {}
│ │ │ -
46
│ │ │ -
47 // Bind to given element and precompute all indices.
│ │ │ -
48 void bind(const Element& element)
│ │ │ -
49 {
│ │ │ -
50 constexpr auto dimension = GridView::dimension;
│ │ │ -
51 indices_.clear();
│ │ │ -
52 auto referenceElement = Dune::referenceElement<double, dimension>(element.type());
│ │ │ -
53 for (auto codim : Dune::range(dimension + 1)) {
│ │ │ -
54 for (auto subEntity : Dune::range(referenceElement.size(codim))) {
│ │ │ -
55 std::size_t c = mapper_.layout()(referenceElement.type(subEntity, codim), dimension);
│ │ │ -
56 if (c > 0) {
│ │ │ -
57 std::size_t firstIndex = mapper_.subIndex(element, subEntity, codim);
│ │ │ -
58 for (auto j : Dune::range(firstIndex, firstIndex + c)) {
│ │ │ -
59 indices_.push_back(j);
│ │ │ -
60 }
│ │ │ -
61 }
│ │ │ -
62 }
│ │ │ -
63 }
│ │ │ -
64 }
│ │ │ -
65
│ │ │ -
66 auto begin() const
│ │ │ -
67 {
│ │ │ -
68 return indices_.begin();
│ │ │ -
69 }
│ │ │ -
70
│ │ │ -
71 auto end() const
│ │ │ -
72 {
│ │ │ -
73 return indices_.end();
│ │ │ -
74 }
│ │ │ -
75
│ │ │ -
76 private:
│ │ │ -
77 const Mapper mapper_;
│ │ │ -
78 IndexContainer indices_;
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
31
│ │ │ +
32namespace Dune {
│ │ │ +
33namespace Functions {
│ │ │ +
34
│ │ │ +
35namespace Impl {
│ │ │ +
36
│ │ │ +
37 template<int dim, typename D, typename R, std::size_t k>
│ │ │ +
38 struct RaviartThomasSimplexLocalInfo
│ │ │ +
39 {
│ │ │ +
40 // Dummy type, must be something that we can have a std::unique_ptr to
│ │ │ +
41 using FiniteElement = void*;
│ │ │ +
42 };
│ │ │ +
43
│ │ │ +
44 template<typename D, typename R>
│ │ │ +
45 struct RaviartThomasSimplexLocalInfo<2,D,R,0>
│ │ │ +
46 {
│ │ │ +
47 using FiniteElement = RT02DLocalFiniteElement<D,R>;
│ │ │ +
48 };
│ │ │ +
49
│ │ │ +
50 template<typename D, typename R>
│ │ │ +
51 struct RaviartThomasSimplexLocalInfo<2,D,R,1>
│ │ │ +
52 {
│ │ │ +
53 using FiniteElement = RT12DLocalFiniteElement<D,R>;
│ │ │ +
54 };
│ │ │ +
55
│ │ │ +
56 template<typename D, typename R>
│ │ │ +
57 struct RaviartThomasSimplexLocalInfo<3,D,R,0>
│ │ │ +
58 {
│ │ │ +
59 using FiniteElement = RT03DLocalFiniteElement<D,R>;
│ │ │ +
60 };
│ │ │ +
61
│ │ │ +
62 template<int dim, typename D, typename R, std::size_t k>
│ │ │ +
63 struct RaviartThomasCubeLocalInfo
│ │ │ +
64 {
│ │ │ +
65 // Dummy type, must be something that we can have a std::unique_ptr to
│ │ │ +
66 using FiniteElement = void*;
│ │ │ +
67 };
│ │ │ +
68
│ │ │ +
69 template<typename D, typename R>
│ │ │ +
70 struct RaviartThomasCubeLocalInfo<2,D,R,0>
│ │ │ +
71 {
│ │ │ +
72 using FiniteElement = RT0Cube2DLocalFiniteElement<D,R>;
│ │ │ +
73 };
│ │ │ +
74
│ │ │ +
75 template<typename D, typename R>
│ │ │ +
76 struct RaviartThomasCubeLocalInfo<2,D,R,1>
│ │ │ +
77 {
│ │ │ +
78 using FiniteElement = RT1Cube2DLocalFiniteElement<D,R>;
│ │ │
79 };
│ │ │
80
│ │ │ -
81
│ │ │ -
82
│ │ │ -
83 // Helper function computing an average mesh size per subentity
│ │ │ -
84 // by averaging over the adjacent elements. This only considers
│ │ │ -
85 // the subentities handled by the given mapper and returns a
│ │ │ -
86 // std::vector<FieldType> of mesh sizes indexed according to the mapper.
│ │ │ -
87 //
│ │ │ -
88 // The average is determined by first computing the average volume
│ │ │ -
89 // of adjacent elements and then taking the d-th root for a d-dimensional
│ │ │ -
90 // grid.
│ │ │ -
91 //
│ │ │ -
92 // This operation has O(n) runtime (with n=mapper.size()),
│ │ │ -
93 // allocates O(n) memory for the returned vector and additional
│ │ │ -
94 // O(n) temporary memory.
│ │ │ -
95 template<class FieldType = double, class Mapper>
│ │ │ -
96 auto computeAverageSubEntityMeshSize(const Mapper& mapper)
│ │ │ -
97 {
│ │ │ -
98 constexpr auto dimension = Mapper::GridView::dimension;
│ │ │ -
99 std::vector<unsigned int> adjacentElements(mapper.size(), 0);
│ │ │ -
100 std::vector<FieldType> subEntityMeshSize(mapper.size(), 0.0);
│ │ │ -
101 auto subIndices = Impl::MapperElementSubIndices(mapper);
│ │ │ -
102 for(const auto& element : Dune::elements(mapper.gridView()))
│ │ │ -
103 {
│ │ │ -
104 auto A = element.geometry().volume();
│ │ │ -
105 subIndices.bind(element);
│ │ │ -
106 for(auto i : subIndices)
│ │ │ -
107 {
│ │ │ -
108 subEntityMeshSize[i] += A;
│ │ │ -
109 ++(adjacentElements[i]);
│ │ │ -
110 }
│ │ │ -
111 }
│ │ │ -
112 for(auto i : Dune::range(mapper.size()))
│ │ │ -
113 subEntityMeshSize[i] = std::pow(subEntityMeshSize[i]/adjacentElements[i], 1./dimension);
│ │ │ -
114 return subEntityMeshSize;
│ │ │ -
115 }
│ │ │ -
116
│ │ │ -
128 template<class ElementMapper>
│ │ │ -
129 std::vector<std::bitset<3>> computeEdgeOrientations(ElementMapper mapper)
│ │ │ -
130 {
│ │ │ -
131 constexpr int dim = 2;
│ │ │ -
132 static_assert(dim == ElementMapper::GridView::dimension);
│ │ │ -
133
│ │ │ -
134 auto const& gridView = mapper.gridView();
│ │ │ -
135 std::vector<std::bitset<3>> orientations;
│ │ │ -
136 orientations.resize(gridView.size(0));
│ │ │ -
137 // compute orientation for all elements
│ │ │ -
138 auto const& idSet = gridView.grid().globalIdSet();
│ │ │ +
81 template<typename D, typename R>
│ │ │ +
82 struct RaviartThomasCubeLocalInfo<2,D,R,2>
│ │ │ +
83 {
│ │ │ +
84 using FiniteElement = RT2Cube2DLocalFiniteElement<D,R>;
│ │ │ +
85 };
│ │ │ +
86
│ │ │ +
87 template<typename D, typename R>
│ │ │ +
88 struct RaviartThomasCubeLocalInfo<3,D,R,0>
│ │ │ +
89 {
│ │ │ +
90 using FiniteElement = RT0Cube3DLocalFiniteElement<D,R>;
│ │ │ +
91 };
│ │ │ +
92
│ │ │ +
93 template<typename D, typename R>
│ │ │ +
94 struct RaviartThomasCubeLocalInfo<3,D,R,1>
│ │ │ +
95 {
│ │ │ +
96 using FiniteElement = RT1Cube3DLocalFiniteElement<D,R>;
│ │ │ +
97 };
│ │ │ +
98
│ │ │ +
99 template<int dim, typename D, typename R, std::size_t k>
│ │ │ +
100 struct RaviartThomasPyramidLocalInfo
│ │ │ +
101 {
│ │ │ +
102 // Dummy type, must be something that we can have a std::unique_ptr to
│ │ │ +
103 using FiniteElement = void*;
│ │ │ +
104 };
│ │ │ +
105
│ │ │ +
106 template<typename D, typename R>
│ │ │ +
107 struct RaviartThomasPyramidLocalInfo<3,D,R,0>
│ │ │ +
108 {
│ │ │ +
109 using FiniteElement = RT0PyramidLocalFiniteElement<D,R>;
│ │ │ +
110 };
│ │ │ +
111
│ │ │ +
112 template<int dim, typename D, typename R, std::size_t k>
│ │ │ +
113 struct RaviartThomasPrismLocalInfo
│ │ │ +
114 {
│ │ │ +
115 // Dummy type, must be something that we can have a std::unique_ptr to
│ │ │ +
116 using FiniteElement = void*;
│ │ │ +
117 };
│ │ │ +
118
│ │ │ +
119 template<typename D, typename R>
│ │ │ +
120 struct RaviartThomasPrismLocalInfo<3,D,R,0>
│ │ │ +
121 {
│ │ │ +
122 using FiniteElement = RT0PrismLocalFiniteElement<D,R>;
│ │ │ +
123 };
│ │ │ +
124
│ │ │ +
125 template<typename GV, int dim, typename R, std::size_t k>
│ │ │ +
126 class RaviartThomasLocalFiniteElementMap
│ │ │ +
127 {
│ │ │ +
128 using D = typename GV::ctype;
│ │ │ +
129 constexpr static bool hasFixedElementType = Capabilities::hasSingleGeometryType<typename GV::Grid>::v;
│ │ │ +
130
│ │ │ +
131 using CubeFiniteElement = typename RaviartThomasCubeLocalInfo<dim, D, R, k>::FiniteElement;
│ │ │ +
132 using SimplexFiniteElement = typename RaviartThomasSimplexLocalInfo<dim, D, R, k>::FiniteElement;
│ │ │ +
133 using PyramidFiniteElement = typename RaviartThomasPyramidLocalInfo<dim, D, R, k>::FiniteElement;
│ │ │ +
134 using PrismFiniteElement = typename RaviartThomasPrismLocalInfo<dim, D, R, k>::FiniteElement;
│ │ │ +
135
│ │ │ +
136 public:
│ │ │ +
137
│ │ │ +
138 using T = LocalBasisTraits<D, dim, FieldVector<D,dim>, R, dim, FieldVector<R,dim>, FieldMatrix<D,dim,dim> >;
│ │ │
139
│ │ │ -
140 for (const auto &element : elements(gridView))
│ │ │ -
141 {
│ │ │ -
142 const auto &refElement = referenceElement(element);
│ │ │ -
143 auto elementIndex = mapper.index(element);
│ │ │ -
144
│ │ │ -
145 std::bitset<3>& orientation = orientations[elementIndex];
│ │ │ -
146
│ │ │ -
147
│ │ │ -
148 for (std::size_t i = 0; i < element.subEntities(dim - 1); i++)
│ │ │ -
149 {
│ │ │ -
150 // Local vertex indices within the element are ordered, localV0 < localV1
│ │ │ -
151 auto localV0 = refElement.subEntity(i, dim - 1, 0, dim);
│ │ │ -
152 auto localV1 = refElement.subEntity(i, dim - 1, 1, dim);
│ │ │ -
153
│ │ │ -
154 // Global vertex indices within the grid
│ │ │ -
155 auto globalV0 = idSet.subId(element, localV0, dim);
│ │ │ -
156 auto globalV1 = idSet.subId(element, localV1, dim);
│ │ │ -
157
│ │ │ -
158 // The edge is flipped if the local ordering disagrees with global ordering
│ │ │ -
159 orientation[i] = globalV0 > globalV1;
│ │ │ -
160 }
│ │ │ +
140 constexpr static unsigned int topologyId = Capabilities::hasSingleGeometryType<typename GV::Grid>::topologyId; // meaningless if hasFixedElementType is false
│ │ │ +
141 constexpr static GeometryType type = GeometryType(topologyId, GV::dimension);
│ │ │ +
142
│ │ │ +
143 using FiniteElement = std::conditional_t<hasFixedElementType,
│ │ │ +
144 std::conditional_t<type.isCube(), CubeFiniteElement, SimplexFiniteElement>,
│ │ │ +
145 std::conditional_t<dim == 3,
│ │ │ +
146 LocalFiniteElementVariant<CubeFiniteElement, SimplexFiniteElement, PyramidFiniteElement, PrismFiniteElement>,
│ │ │ +
147 LocalFiniteElementVariant<CubeFiniteElement, SimplexFiniteElement> > >;
│ │ │ +
148
│ │ │ +
149 // Each element facet can have its orientation reversed, hence there are
│ │ │ +
150 // 2^#facets different variants.
│ │ │ +
151 static std::size_t numVariants(GeometryType type)
│ │ │ +
152 {
│ │ │ +
153 auto numFacets = referenceElement<D,dim>(type).size(1);
│ │ │ +
154 return power(2,numFacets);
│ │ │ +
155 }
│ │ │ +
156
│ │ │ +
157 RaviartThomasLocalFiniteElementMap(const GV& gv)
│ │ │ +
158 : elementMapper_(gv, mcmgElementLayout())
│ │ │ +
159 {
│ │ │ +
160 update(gv);
│ │ │
161 }
│ │ │ -
162 return orientations;
│ │ │ -
163 }
│ │ │ -
164
│ │ │ -
165} // end namespace Impl
│ │ │ -
166
│ │ │ -
167} // end namespace Dune::Functions
│ │ │ -
168
│ │ │ -
169
│ │ │ -
170#endif // end namespace DUNE_FUNCTIONS_COMMON_MAPPERUTILITIES_HH
│ │ │ +
162
│ │ │ +
163 void update (const GV& gv)
│ │ │ +
164 {
│ │ │ +
165 elementMapper_.update(gv);
│ │ │ +
166 if constexpr (hasFixedElementType)
│ │ │ +
167 {
│ │ │ +
168 variants_.resize(numVariants(type));
│ │ │ +
169 for (size_t i = 0; i < numVariants(type); i++)
│ │ │ +
170 variants_[i] = FiniteElement(i);
│ │ │ +
171 }
│ │ │ +
172 else
│ │ │ +
173 {
│ │ │ +
174 // for mixed grids add offset for cubes
│ │ │ +
175 size_t numVariantsSimplex = numVariants(GeometryTypes::simplex(dim));
│ │ │ +
176 size_t numVariantsCube = numVariants(GeometryTypes::cube(dim));
│ │ │ +
177
│ │ │ +
178 variants_.resize(numVariantsSimplex + numVariantsCube);
│ │ │ +
179 for (size_t i = 0; i < numVariantsSimplex; i++)
│ │ │ +
180 variants_[i] = SimplexFiniteElement(i);
│ │ │ +
181 for (size_t i = 0; i < numVariantsCube; i++)
│ │ │ +
182 variants_[i + numVariantsSimplex] = CubeFiniteElement(i);
│ │ │ +
183 if constexpr (dim == 3)
│ │ │ +
184 {
│ │ │ +
185 size_t numVariantsPyramid = numVariants(GeometryTypes::pyramid);
│ │ │ +
186 size_t numVariantsPrism = numVariants(GeometryTypes::prism);
│ │ │ +
187
│ │ │ +
188 variants_.resize(numVariantsSimplex + numVariantsCube + numVariantsPyramid + numVariantsPrism );
│ │ │ +
189
│ │ │ +
190 for (size_t i = 0; i < numVariantsPyramid; i++)
│ │ │ +
191 variants_[i + numVariantsSimplex + numVariantsCube] = PyramidFiniteElement(i);
│ │ │ +
192 for (size_t i = 0; i < numVariantsPrism; i++)
│ │ │ +
193 variants_[i + numVariantsSimplex + numVariantsCube + numVariantsPyramid] = PrismFiniteElement(i);
│ │ │ +
194 }
│ │ │ +
195 }
│ │ │ +
196
│ │ │ +
197 orient_.resize(gv.size(0));
│ │ │ +
198 for(const auto& cell : elements(gv))
│ │ │ +
199 {
│ │ │ +
200 unsigned int myId = elementMapper_.index(cell);
│ │ │ +
201 orient_[myId] = 0;
│ │ │ +
202
│ │ │ +
203 for (const auto& intersection : intersections(gv,cell))
│ │ │ +
204 {
│ │ │ +
205 if (intersection.neighbor() && (gv.contains(intersection.outside())) && (elementMapper_.index(intersection.outside()) > myId))
│ │ │ +
206 orient_[myId] |= (1 << intersection.indexInInside());
│ │ │ +
207 }
│ │ │ +
208
│ │ │ +
209 // for mixed grids add offset for cubes and pyramids
│ │ │ +
210 if constexpr (!hasFixedElementType)
│ │ │ +
211 {
│ │ │ +
212 size_t numVariantsSimplex = numVariants(GeometryTypes::simplex(dim));
│ │ │ +
213 size_t numVariantsCube = numVariants(GeometryTypes::cube(dim));
│ │ │ +
214
│ │ │ +
215 if (cell.type().isCube())
│ │ │ +
216 orient_[myId] += numVariantsSimplex;
│ │ │ +
217 if constexpr (dim == 3)
│ │ │ +
218 {
│ │ │ +
219 size_t numVariantsPyramid = numVariants(GeometryTypes::pyramid);
│ │ │ +
220
│ │ │ +
221 if (cell.type().isPyramid())
│ │ │ +
222 orient_[myId] += numVariantsSimplex + numVariantsCube;
│ │ │ +
223 if (cell.type().isPrism())
│ │ │ +
224 orient_[myId] += numVariantsSimplex + numVariantsCube + numVariantsPyramid;
│ │ │ +
225 }
│ │ │ +
226 }
│ │ │ +
227 }
│ │ │ +
228 }
│ │ │ +
229
│ │ │ +
230 template<class EntityType>
│ │ │ +
231 const FiniteElement& find(const EntityType& e) const
│ │ │ +
232 {
│ │ │ +
233 return variants_[orient_[elementMapper_.index(e)]];
│ │ │ +
234 }
│ │ │ +
235
│ │ │ +
236 private:
│ │ │ +
237 std::vector<FiniteElement> variants_;
│ │ │ +
238 Dune::MultipleCodimMultipleGeomTypeMapper<GV> elementMapper_;
│ │ │ +
239 std::vector<unsigned char> orient_;
│ │ │ +
240 };
│ │ │ +
241
│ │ │ +
242
│ │ │ +
243} // namespace Impl
│ │ │ +
244
│ │ │ +
245
│ │ │ +
246// *****************************************************************************
│ │ │ +
247// This is the reusable part of the basis. It contains
│ │ │ +
248//
│ │ │ +
249// RaviartThomasPreBasis
│ │ │ +
250// RaviartThomasNode
│ │ │ +
251//
│ │ │ +
252// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ +
253// state. These components do _not_ depend on the global basis and local view
│ │ │ +
254// and can be used without a global basis.
│ │ │ +
255// *****************************************************************************
│ │ │ +
256
│ │ │ +
257template<typename GV, int k>
│ │ │ + │ │ │ +
259
│ │ │ +
260template<typename GV, int k>
│ │ │ +
│ │ │ + │ │ │ +
262 public LeafPreBasisMapperMixin<GV>
│ │ │ +
263{
│ │ │ +
264 using Base = LeafPreBasisMapperMixin<GV>;
│ │ │ +
265
│ │ │ +
266 // the layout is defined in terms of a MCMGLayout specialized for k == 0 or 1
│ │ │ +
267 static MCMGLayout dofLayout()
│ │ │ +
268 {
│ │ │ +
269 return [](GeometryType gt, size_t gridDim) -> size_t {
│ │ │ +
270 if ((gt.isPyramid()) and (k==0))
│ │ │ +
271 return 1;
│ │ │ +
272 if (gt.dim() == gridDim)
│ │ │ +
273 return gt.isCube() ? ((dim == 2) ? k*(k+1)*dim : k*(k+1)*(k+1)*dim) : k*dim;
│ │ │ +
274 if (gt.dim() == gridDim-1)
│ │ │ +
275 return gt.isCube() ? (dim-2)*2*k+k+1 : (dim-1)*k+1 ;
│ │ │ +
276 return 0;
│ │ │ +
277 };
│ │ │ +
278 }
│ │ │ +
279
│ │ │ +
280 static const int dim = GV::dimension;
│ │ │ +
281 using FiniteElementMap = typename Impl::RaviartThomasLocalFiniteElementMap<GV, dim, double, k>;
│ │ │ +
282
│ │ │ +
283public:
│ │ │ +
284
│ │ │ +
286 using GridView = GV;
│ │ │ +
287 using size_type = std::size_t;
│ │ │ +
288
│ │ │ + │ │ │ +
290
│ │ │ +
│ │ │ + │ │ │ +
293 Base(gv, dofLayout()),
│ │ │ + │ │ │ +
295 {
│ │ │ +
296 // Currently there are some unresolved bugs with hybrid grids and higher order Raviart-Thomas elements
│ │ │ +
297 if (gv.indexSet().types(0).size() > 1 and k>0)
│ │ │ +
298 DUNE_THROW(Dune::NotImplemented, "Raviart-Thomas basis with index k>0 is only implemented for grids with a single element type");
│ │ │ +
299
│ │ │ +
300 for(auto type : gv.indexSet().types(0))
│ │ │ +
301 if (!type.isSimplex() && !type.isCube() && !type.isPyramid() && !type.isPrism())
│ │ │ +
302 DUNE_THROW(Dune::NotImplemented, "Raviart-Thomas elements are only implemented for grids with simplex, cube, pyramid or prism elements.");
│ │ │ +
303 }
│ │ │ +
│ │ │ +
304
│ │ │ +
│ │ │ +
306 void update(const GridView& gv)
│ │ │ +
307 {
│ │ │ +
308 Base::update(gv);
│ │ │ +
309 finiteElementMap_.update(gv);
│ │ │ +
310 }
│ │ │ +
│ │ │ +
311
│ │ │ +
│ │ │ + │ │ │ +
316 {
│ │ │ +
317 return Node{&finiteElementMap_};
│ │ │ +
318 }
│ │ │ +
│ │ │ +
319
│ │ │ +
320protected:
│ │ │ +
321 FiniteElementMap finiteElementMap_;
│ │ │ +
322};
│ │ │ +
│ │ │ +
323
│ │ │ +
324
│ │ │ +
325
│ │ │ +
326template<typename GV, int k>
│ │ │ +
│ │ │ + │ │ │ +
328 public LeafBasisNode
│ │ │ +
329{
│ │ │ +
330 static const int dim = GV::dimension;
│ │ │ +
331
│ │ │ +
332public:
│ │ │ +
333
│ │ │ +
334 using size_type = std::size_t;
│ │ │ +
335 using Element = typename GV::template Codim<0>::Entity;
│ │ │ +
336 using FiniteElementMap = typename Impl::RaviartThomasLocalFiniteElementMap<GV, dim, double, k>;
│ │ │ +
337 using FiniteElement = Impl::GlobalValuedLocalFiniteElement<Impl::ContravariantPiolaTransformator,
│ │ │ +
338 typename FiniteElementMap::FiniteElement,
│ │ │ +
339 Element>;
│ │ │ +
340
│ │ │ +
│ │ │ +
341 RaviartThomasNode(const FiniteElementMap* finiteElementMap) :
│ │ │ +
342 element_(nullptr),
│ │ │ +
343 finiteElementMap_(finiteElementMap)
│ │ │ +
344 { }
│ │ │ +
│ │ │ +
345
│ │ │ +
│ │ │ +
347 const Element& element() const
│ │ │ +
348 {
│ │ │ +
349 return *element_;
│ │ │ +
350 }
│ │ │ +
│ │ │ +
351
│ │ │ +
│ │ │ + │ │ │ +
357 {
│ │ │ +
358 return finiteElement_;
│ │ │ +
359 }
│ │ │ +
│ │ │ +
360
│ │ │ +
│ │ │ +
362 void bind(const Element& e)
│ │ │ +
363 {
│ │ │ +
364 element_ = &e;
│ │ │ +
365 finiteElement_.bind((finiteElementMap_->find(*element_)), e);
│ │ │ +
366 this->setSize(finiteElement_.size());
│ │ │ +
367 }
│ │ │ +
│ │ │ +
368
│ │ │ +
369protected:
│ │ │ +
370
│ │ │ + │ │ │ + │ │ │ + │ │ │ +
374};
│ │ │ +
│ │ │ +
375
│ │ │ +
376namespace BasisFactory {
│ │ │ +
377
│ │ │ +
385template<std::size_t k>
│ │ │ +
│ │ │ + │ │ │ +
387{
│ │ │ +
388 return [](const auto& gridView) {
│ │ │ +
389 return RaviartThomasPreBasis<std::decay_t<decltype(gridView)>, k>(gridView);
│ │ │ +
390 };
│ │ │ +
391}
│ │ │ +
│ │ │ +
392
│ │ │ +
393} // end namespace BasisFactory
│ │ │ +
394
│ │ │ +
395
│ │ │ +
396
│ │ │ +
397// *****************************************************************************
│ │ │ +
398// This is the actual global basis implementation based on the reusable parts.
│ │ │ +
399// *****************************************************************************
│ │ │ +
400
│ │ │ +
408template<typename GV, int k>
│ │ │ + │ │ │ +
410
│ │ │ +
411} // end namespace Functions
│ │ │ +
412} // end namespace Dune
│ │ │ +
413
│ │ │ +
414
│ │ │ +
415#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
auto raviartThomas()
Create a pre-basis factory that can create a Raviart-Thomas pre-basis.
Definition raviartthomasbasis.hh:386
│ │ │ +
auto power(ChildPreBasisFactory &&childPreBasisFactory, std::size_t k, const IndexMergingStrategy &)
Create a pre-basis factory that can build a PowerPreBasis.
Definition dynamicpowerbasis.hh:410
│ │ │
auto elements(const SubDomainGridView< HostGridView > &subDomainGridView)
ADL findable access to element range for a SubDomainGridView.
Definition subdomain.hh:487
│ │ │ +
auto intersections(const SubDomainGridView< HostGridView > &subDomainGridView, const Element &element)
ADL findable access to intersection range for an element of a SubDomainGridView.
Definition subdomain.hh:510
│ │ │ +
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ +
DefaultGlobalBasis< RaviartThomasPreBasis< GV, k > > RaviartThomasBasis
Basis of a k-th-order Raviart Thomas finite element space.
Definition raviartthomasbasis.hh:409
│ │ │ +
Definition argyrisbasis.hh:926
│ │ │ +
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:53
│ │ │ +
void update(const GridView &gv)
Update the stored GridView.
Definition leafprebasismappermixin.hh:101
│ │ │ +
LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout)
Construct from GridView and local DOF layout.
Definition leafprebasismappermixin.hh:74
│ │ │ +
void setSize(const size_type size)
Definition nodes.hh:197
│ │ │ +
Definition nodes.hh:218
│ │ │ +
Definition raviartthomasbasis.hh:329
│ │ │ +
typename Impl::RaviartThomasLocalFiniteElementMap< GV, dim, double, k > FiniteElementMap
Definition raviartthomasbasis.hh:336
│ │ │ +
void bind(const Element &e)
Bind to element.
Definition raviartthomasbasis.hh:362
│ │ │ +
typename GV::template Codim< 0 >::Entity Element
Definition raviartthomasbasis.hh:335
│ │ │ +
const Element * element_
Definition raviartthomasbasis.hh:372
│ │ │ +
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition raviartthomasbasis.hh:356
│ │ │ +
std::size_t size_type
Definition raviartthomasbasis.hh:334
│ │ │ +
Impl::GlobalValuedLocalFiniteElement< Impl::ContravariantPiolaTransformator, typename FiniteElementMap::FiniteElement, Element > FiniteElement
Definition raviartthomasbasis.hh:337
│ │ │ +
RaviartThomasNode(const FiniteElementMap *finiteElementMap)
Definition raviartthomasbasis.hh:341
│ │ │ +
const Element & element() const
Return current element, throw if unbound.
Definition raviartthomasbasis.hh:347
│ │ │ +
FiniteElement finiteElement_
Definition raviartthomasbasis.hh:371
│ │ │ +
const FiniteElementMap * finiteElementMap_
Definition raviartthomasbasis.hh:373
│ │ │ +
Definition raviartthomasbasis.hh:263
│ │ │ +
Node makeNode() const
Create tree node.
Definition raviartthomasbasis.hh:315
│ │ │ +
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition raviartthomasbasis.hh:306
│ │ │ +
RaviartThomasPreBasis(const GridView &gv)
Constructor for a given grid view object.
Definition raviartthomasbasis.hh:292
│ │ │ +
std::size_t size_type
Definition raviartthomasbasis.hh:287
│ │ │ +
FiniteElementMap finiteElementMap_
Definition raviartthomasbasis.hh:321
│ │ │ +
RaviartThomasNode< GV, k > Node
Definition raviartthomasbasis.hh:289
│ │ │ +
GV GridView
The grid view that the FE space is defined on.
Definition raviartthomasbasis.hh:286
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,182 +1,551 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -mapperutilities.hh │ │ │ │ +raviartthomasbasis.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_COMMON_MAPPERUTILITIES_HH │ │ │ │ -8#define DUNE_FUNCTIONS_COMMON_MAPPERUTILITIES_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH │ │ │ │ +8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ 12 │ │ │ │ -13#include │ │ │ │ -14 │ │ │ │ -15#include │ │ │ │ -16#include │ │ │ │ -17 │ │ │ │ -18namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ -19 │ │ │ │ -20// All utilities are in Impl:: and thus considered implementation │ │ │ │ -21// details for now. However, one may want to think about making │ │ │ │ -22// them public. Then they could also be put into dune-grid, │ │ │ │ -23// since there's nothing dune-function specific about them. │ │ │ │ -24namespace Impl { │ │ │ │ -25 │ │ │ │ +13#include │ │ │ │ +14#include │ │ │ │ +15 │ │ │ │ +16#include │ │ │ │ +17#include │ │ │ │ +18#include │ │ │ │ +19#include │ │ │ │ +20#include │ │ │ │ +21#include │ │ │ │ +22#include │ │ │ │ +23#include │ │ │ │ +24#include │ │ │ │ +25#include │ │ │ │ 26 │ │ │ │ -27 │ │ │ │ -28 // Helper class providing an unordered range │ │ │ │ -29 // of global indices associated to the element │ │ │ │ -30 // within a MultipleCodimMultipleGeomTypeMapper. │ │ │ │ -31 // This has to be bound to an element, before │ │ │ │ -32 // it can be used. │ │ │ │ -33 template │ │ │ │ -34 class MapperElementSubIndices │ │ │ │ -35 { │ │ │ │ -36 using IndexContainer = std::vector::Index>; │ │ │ │ -37 public: │ │ │ │ -38 using GridView = GV; │ │ │ │ -39 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper; │ │ │ │ -40 using Index = typename Mapper::Index; │ │ │ │ -41 using Element = typename GridView::template Codim<0>::Entity; │ │ │ │ -42 │ │ │ │ -43 MapperElementSubIndices(const Mapper& mapper) │ │ │ │ -44 : mapper_(mapper) │ │ │ │ -45 {} │ │ │ │ -46 │ │ │ │ -47 // Bind to given element and precompute all indices. │ │ │ │ -48 void bind(const Element& element) │ │ │ │ -49 { │ │ │ │ -50 constexpr auto dimension = GridView::dimension; │ │ │ │ -51 indices_.clear(); │ │ │ │ -52 auto referenceElement = Dune::referenceElement │ │ │ │ -(element.type()); │ │ │ │ -53 for (auto codim : Dune::range(dimension + 1)) { │ │ │ │ -54 for (auto subEntity : Dune::range(referenceElement.size(codim))) { │ │ │ │ -55 std::size_t c = mapper_.layout()(referenceElement.type(subEntity, codim), │ │ │ │ -dimension); │ │ │ │ -56 if (c > 0) { │ │ │ │ -57 std::size_t firstIndex = mapper_.subIndex(element, subEntity, codim); │ │ │ │ -58 for (auto j : Dune::range(firstIndex, firstIndex + c)) { │ │ │ │ -59 indices_.push_back(j); │ │ │ │ -60 } │ │ │ │ -61 } │ │ │ │ -62 } │ │ │ │ -63 } │ │ │ │ -64 } │ │ │ │ -65 │ │ │ │ -66 auto begin() const │ │ │ │ -67 { │ │ │ │ -68 return indices_.begin(); │ │ │ │ -69 } │ │ │ │ -70 │ │ │ │ -71 auto end() const │ │ │ │ -72 { │ │ │ │ -73 return indices_.end(); │ │ │ │ -74 } │ │ │ │ -75 │ │ │ │ -76 private: │ │ │ │ -77 const Mapper mapper_; │ │ │ │ -78 IndexContainer indices_; │ │ │ │ +27#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/ │ │ │ │ +_g_l_o_b_a_l_v_a_l_u_e_d_l_o_c_a_l_f_i_n_i_t_e_e_l_e_m_e_n_t_._h_h> │ │ │ │ +28#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ +29#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ +30#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h> │ │ │ │ +31 │ │ │ │ +32namespace _D_u_n_e { │ │ │ │ +33namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +34 │ │ │ │ +35namespace Impl { │ │ │ │ +36 │ │ │ │ +37 template │ │ │ │ +38 struct RaviartThomasSimplexLocalInfo │ │ │ │ +39 { │ │ │ │ +40 // Dummy type, must be something that we can have a std::unique_ptr to │ │ │ │ +41 using FiniteElement = void*; │ │ │ │ +42 }; │ │ │ │ +43 │ │ │ │ +44 template │ │ │ │ +45 struct RaviartThomasSimplexLocalInfo<2,D,R,0> │ │ │ │ +46 { │ │ │ │ +47 using FiniteElement = RT02DLocalFiniteElement; │ │ │ │ +48 }; │ │ │ │ +49 │ │ │ │ +50 template │ │ │ │ +51 struct RaviartThomasSimplexLocalInfo<2,D,R,1> │ │ │ │ +52 { │ │ │ │ +53 using FiniteElement = RT12DLocalFiniteElement; │ │ │ │ +54 }; │ │ │ │ +55 │ │ │ │ +56 template │ │ │ │ +57 struct RaviartThomasSimplexLocalInfo<3,D,R,0> │ │ │ │ +58 { │ │ │ │ +59 using FiniteElement = RT03DLocalFiniteElement; │ │ │ │ +60 }; │ │ │ │ +61 │ │ │ │ +62 template │ │ │ │ +63 struct RaviartThomasCubeLocalInfo │ │ │ │ +64 { │ │ │ │ +65 // Dummy type, must be something that we can have a std::unique_ptr to │ │ │ │ +66 using FiniteElement = void*; │ │ │ │ +67 }; │ │ │ │ +68 │ │ │ │ +69 template │ │ │ │ +70 struct RaviartThomasCubeLocalInfo<2,D,R,0> │ │ │ │ +71 { │ │ │ │ +72 using FiniteElement = RT0Cube2DLocalFiniteElement; │ │ │ │ +73 }; │ │ │ │ +74 │ │ │ │ +75 template │ │ │ │ +76 struct RaviartThomasCubeLocalInfo<2,D,R,1> │ │ │ │ +77 { │ │ │ │ +78 using FiniteElement = RT1Cube2DLocalFiniteElement; │ │ │ │ 79 }; │ │ │ │ 80 │ │ │ │ -81 │ │ │ │ -82 │ │ │ │ -83 // Helper function computing an average mesh size per subentity │ │ │ │ -84 // by averaging over the adjacent elements. This only considers │ │ │ │ -85 // the subentities handled by the given mapper and returns a │ │ │ │ -86 // std::vector of mesh sizes indexed according to the mapper. │ │ │ │ -87 // │ │ │ │ -88 // The average is determined by first computing the average volume │ │ │ │ -89 // of adjacent elements and then taking the d-th root for a d-dimensional │ │ │ │ -90 // grid. │ │ │ │ -91 // │ │ │ │ -92 // This operation has O(n) runtime (with n=mapper.size()), │ │ │ │ -93 // allocates O(n) memory for the returned vector and additional │ │ │ │ -94 // O(n) temporary memory. │ │ │ │ -95 template │ │ │ │ -96 auto computeAverageSubEntityMeshSize(const Mapper& mapper) │ │ │ │ -97 { │ │ │ │ -98 constexpr auto dimension = Mapper::GridView::dimension; │ │ │ │ -99 std::vector adjacentElements(mapper.size(), 0); │ │ │ │ -100 std::vector subEntityMeshSize(mapper.size(), 0.0); │ │ │ │ -101 auto subIndices = Impl::MapperElementSubIndices(mapper); │ │ │ │ -102 for(const auto& element : Dune::elements(mapper.gridView())) │ │ │ │ -103 { │ │ │ │ -104 auto A = element.geometry().volume(); │ │ │ │ -105 subIndices.bind(element); │ │ │ │ -106 for(auto i : subIndices) │ │ │ │ -107 { │ │ │ │ -108 subEntityMeshSize[i] += A; │ │ │ │ -109 ++(adjacentElements[i]); │ │ │ │ -110 } │ │ │ │ -111 } │ │ │ │ -112 for(auto i : Dune::range(mapper.size())) │ │ │ │ -113 subEntityMeshSize[i] = std::pow(subEntityMeshSize[i]/adjacentElements[i], │ │ │ │ -1./dimension); │ │ │ │ -114 return subEntityMeshSize; │ │ │ │ -115 } │ │ │ │ -116 │ │ │ │ -128 template │ │ │ │ -129 std::vector> computeEdgeOrientations(ElementMapper mapper) │ │ │ │ -130 { │ │ │ │ -131 constexpr int dim = 2; │ │ │ │ -132 static_assert(dim == ElementMapper::GridView::dimension); │ │ │ │ -133 │ │ │ │ -134 auto const& gridView = mapper.gridView(); │ │ │ │ -135 std::vector> orientations; │ │ │ │ -136 orientations.resize(gridView.size(0)); │ │ │ │ -137 // compute orientation for all elements │ │ │ │ -138 auto const& idSet = gridView.grid().globalIdSet(); │ │ │ │ +81 template │ │ │ │ +82 struct RaviartThomasCubeLocalInfo<2,D,R,2> │ │ │ │ +83 { │ │ │ │ +84 using FiniteElement = RT2Cube2DLocalFiniteElement; │ │ │ │ +85 }; │ │ │ │ +86 │ │ │ │ +87 template │ │ │ │ +88 struct RaviartThomasCubeLocalInfo<3,D,R,0> │ │ │ │ +89 { │ │ │ │ +90 using FiniteElement = RT0Cube3DLocalFiniteElement; │ │ │ │ +91 }; │ │ │ │ +92 │ │ │ │ +93 template │ │ │ │ +94 struct RaviartThomasCubeLocalInfo<3,D,R,1> │ │ │ │ +95 { │ │ │ │ +96 using FiniteElement = RT1Cube3DLocalFiniteElement; │ │ │ │ +97 }; │ │ │ │ +98 │ │ │ │ +99 template │ │ │ │ +100 struct RaviartThomasPyramidLocalInfo │ │ │ │ +101 { │ │ │ │ +102 // Dummy type, must be something that we can have a std::unique_ptr to │ │ │ │ +103 using FiniteElement = void*; │ │ │ │ +104 }; │ │ │ │ +105 │ │ │ │ +106 template │ │ │ │ +107 struct RaviartThomasPyramidLocalInfo<3,D,R,0> │ │ │ │ +108 { │ │ │ │ +109 using FiniteElement = RT0PyramidLocalFiniteElement; │ │ │ │ +110 }; │ │ │ │ +111 │ │ │ │ +112 template │ │ │ │ +113 struct RaviartThomasPrismLocalInfo │ │ │ │ +114 { │ │ │ │ +115 // Dummy type, must be something that we can have a std::unique_ptr to │ │ │ │ +116 using FiniteElement = void*; │ │ │ │ +117 }; │ │ │ │ +118 │ │ │ │ +119 template │ │ │ │ +120 struct RaviartThomasPrismLocalInfo<3,D,R,0> │ │ │ │ +121 { │ │ │ │ +122 using FiniteElement = RT0PrismLocalFiniteElement; │ │ │ │ +123 }; │ │ │ │ +124 │ │ │ │ +125 template │ │ │ │ +126 class RaviartThomasLocalFiniteElementMap │ │ │ │ +127 { │ │ │ │ +128 using D = typename GV::ctype; │ │ │ │ +129 constexpr static bool hasFixedElementType = Capabilities:: │ │ │ │ +hasSingleGeometryType::v; │ │ │ │ +130 │ │ │ │ +131 using CubeFiniteElement = typename RaviartThomasCubeLocalInfo::FiniteElement; │ │ │ │ +132 using SimplexFiniteElement = typename RaviartThomasSimplexLocalInfo::FiniteElement; │ │ │ │ +133 using PyramidFiniteElement = typename RaviartThomasPyramidLocalInfo::FiniteElement; │ │ │ │ +134 using PrismFiniteElement = typename RaviartThomasPrismLocalInfo::FiniteElement; │ │ │ │ +135 │ │ │ │ +136 public: │ │ │ │ +137 │ │ │ │ +138 using T = LocalBasisTraits, R, dim, │ │ │ │ +FieldVector, FieldMatrix >; │ │ │ │ 139 │ │ │ │ -140 for (const auto &element : _e_l_e_m_e_n_t_s(gridView)) │ │ │ │ -141 { │ │ │ │ -142 const auto &refElement = referenceElement(element); │ │ │ │ -143 auto elementIndex = mapper.index(element); │ │ │ │ -144 │ │ │ │ -145 std::bitset<3>& orientation = orientations[elementIndex]; │ │ │ │ -146 │ │ │ │ -147 │ │ │ │ -148 for (std::size_t i = 0; i < element.subEntities(dim - 1); i++) │ │ │ │ -149 { │ │ │ │ -150 // Local vertex indices within the element are ordered, localV0 < localV1 │ │ │ │ -151 auto localV0 = refElement.subEntity(i, dim - 1, 0, dim); │ │ │ │ -152 auto localV1 = refElement.subEntity(i, dim - 1, 1, dim); │ │ │ │ -153 │ │ │ │ -154 // Global vertex indices within the grid │ │ │ │ -155 auto globalV0 = idSet.subId(element, localV0, dim); │ │ │ │ -156 auto globalV1 = idSet.subId(element, localV1, dim); │ │ │ │ -157 │ │ │ │ -158 // The edge is flipped if the local ordering disagrees with global ordering │ │ │ │ -159 orientation[i] = globalV0 > globalV1; │ │ │ │ -160 } │ │ │ │ +140 constexpr static unsigned int topologyId = Capabilities:: │ │ │ │ +hasSingleGeometryType::topologyId; // meaningless if │ │ │ │ +hasFixedElementType is false │ │ │ │ +141 constexpr static GeometryType type = GeometryType(topologyId, GV:: │ │ │ │ +dimension); │ │ │ │ +142 │ │ │ │ +143 using FiniteElement = std::conditional_t, │ │ │ │ +145 std::conditional_t, │ │ │ │ +147 LocalFiniteElementVariant > >; │ │ │ │ +148 │ │ │ │ +149 // Each element facet can have its orientation reversed, hence there are │ │ │ │ +150 // 2^#facets different variants. │ │ │ │ +151 static std::size_t numVariants(GeometryType type) │ │ │ │ +152 { │ │ │ │ +153 auto numFacets = referenceElement(type).size(1); │ │ │ │ +154 return _p_o_w_e_r(2,numFacets); │ │ │ │ +155 } │ │ │ │ +156 │ │ │ │ +157 RaviartThomasLocalFiniteElementMap(const GV& gv) │ │ │ │ +158 : elementMapper_(gv, mcmgElementLayout()) │ │ │ │ +159 { │ │ │ │ +160 update(gv); │ │ │ │ 161 } │ │ │ │ -162 return orientations; │ │ │ │ -163 } │ │ │ │ -164 │ │ │ │ -165} // end namespace Impl │ │ │ │ -166 │ │ │ │ -167} // end namespace Dune::Functions │ │ │ │ -168 │ │ │ │ -169 │ │ │ │ -170#endif // end namespace DUNE_FUNCTIONS_COMMON_MAPPERUTILITIES_HH │ │ │ │ +162 │ │ │ │ +163 void update (const GV& gv) │ │ │ │ +164 { │ │ │ │ +165 elementMapper_.update(gv); │ │ │ │ +166 if constexpr (hasFixedElementType) │ │ │ │ +167 { │ │ │ │ +168 variants_.resize(numVariants(type)); │ │ │ │ +169 for (size_t i = 0; i < numVariants(type); i++) │ │ │ │ +170 variants_[i] = FiniteElement(i); │ │ │ │ +171 } │ │ │ │ +172 else │ │ │ │ +173 { │ │ │ │ +174 // for mixed grids add offset for cubes │ │ │ │ +175 size_t numVariantsSimplex = numVariants(GeometryTypes::simplex(dim)); │ │ │ │ +176 size_t numVariantsCube = numVariants(GeometryTypes::cube(dim)); │ │ │ │ +177 │ │ │ │ +178 variants_.resize(numVariantsSimplex + numVariantsCube); │ │ │ │ +179 for (size_t i = 0; i < numVariantsSimplex; i++) │ │ │ │ +180 variants_[i] = SimplexFiniteElement(i); │ │ │ │ +181 for (size_t i = 0; i < numVariantsCube; i++) │ │ │ │ +182 variants_[i + numVariantsSimplex] = CubeFiniteElement(i); │ │ │ │ +183 if constexpr (dim == 3) │ │ │ │ +184 { │ │ │ │ +185 size_t numVariantsPyramid = numVariants(GeometryTypes::pyramid); │ │ │ │ +186 size_t numVariantsPrism = numVariants(GeometryTypes::prism); │ │ │ │ +187 │ │ │ │ +188 variants_.resize(numVariantsSimplex + numVariantsCube + numVariantsPyramid │ │ │ │ ++ numVariantsPrism ); │ │ │ │ +189 │ │ │ │ +190 for (size_t i = 0; i < numVariantsPyramid; i++) │ │ │ │ +191 variants_[i + numVariantsSimplex + numVariantsCube] = PyramidFiniteElement │ │ │ │ +(i); │ │ │ │ +192 for (size_t i = 0; i < numVariantsPrism; i++) │ │ │ │ +193 variants_[i + numVariantsSimplex + numVariantsCube + numVariantsPyramid] = │ │ │ │ +PrismFiniteElement(i); │ │ │ │ +194 } │ │ │ │ +195 } │ │ │ │ +196 │ │ │ │ +197 orient_.resize(gv.size(0)); │ │ │ │ +198 for(const auto& cell : _e_l_e_m_e_n_t_s(gv)) │ │ │ │ +199 { │ │ │ │ +200 unsigned int myId = elementMapper_.index(cell); │ │ │ │ +201 orient_[myId] = 0; │ │ │ │ +202 │ │ │ │ +203 for (const auto& intersection : _i_n_t_e_r_s_e_c_t_i_o_n_s(gv,cell)) │ │ │ │ +204 { │ │ │ │ +205 if (intersection.neighbor() && (gv.contains(intersection.outside())) && │ │ │ │ +(elementMapper_.index(intersection.outside()) > myId)) │ │ │ │ +206 orient_[myId] |= (1 << intersection.indexInInside()); │ │ │ │ +207 } │ │ │ │ +208 │ │ │ │ +209 // for mixed grids add offset for cubes and pyramids │ │ │ │ +210 if constexpr (!hasFixedElementType) │ │ │ │ +211 { │ │ │ │ +212 size_t numVariantsSimplex = numVariants(GeometryTypes::simplex(dim)); │ │ │ │ +213 size_t numVariantsCube = numVariants(GeometryTypes::cube(dim)); │ │ │ │ +214 │ │ │ │ +215 if (cell.type().isCube()) │ │ │ │ +216 orient_[myId] += numVariantsSimplex; │ │ │ │ +217 if constexpr (dim == 3) │ │ │ │ +218 { │ │ │ │ +219 size_t numVariantsPyramid = numVariants(GeometryTypes::pyramid); │ │ │ │ +220 │ │ │ │ +221 if (cell.type().isPyramid()) │ │ │ │ +222 orient_[myId] += numVariantsSimplex + numVariantsCube; │ │ │ │ +223 if (cell.type().isPrism()) │ │ │ │ +224 orient_[myId] += numVariantsSimplex + numVariantsCube + numVariantsPyramid; │ │ │ │ +225 } │ │ │ │ +226 } │ │ │ │ +227 } │ │ │ │ +228 } │ │ │ │ +229 │ │ │ │ +230 template │ │ │ │ +231 const FiniteElement& find(const EntityType& e) const │ │ │ │ +232 { │ │ │ │ +233 return variants_[orient_[elementMapper_.index(e)]]; │ │ │ │ +234 } │ │ │ │ +235 │ │ │ │ +236 private: │ │ │ │ +237 std::vector variants_; │ │ │ │ +238 Dune::MultipleCodimMultipleGeomTypeMapper elementMapper_; │ │ │ │ +239 std::vector orient_; │ │ │ │ +240 }; │ │ │ │ +241 │ │ │ │ +242 │ │ │ │ +243} // namespace Impl │ │ │ │ +244 │ │ │ │ +245 │ │ │ │ +246/ │ │ │ │ +/ ***************************************************************************** │ │ │ │ +247// This is the reusable part of the basis. It contains │ │ │ │ +248// │ │ │ │ +249// RaviartThomasPreBasis │ │ │ │ +250// RaviartThomasNode │ │ │ │ +251// │ │ │ │ +252// The pre-basis allows to create the others and is the owner of possible │ │ │ │ +shared │ │ │ │ +253// state. These components do _not_ depend on the global basis and local │ │ │ │ +view │ │ │ │ +254// and can be used without a global basis. │ │ │ │ +255/ │ │ │ │ +/ ***************************************************************************** │ │ │ │ +256 │ │ │ │ +257template │ │ │ │ +258class _R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e; │ │ │ │ +259 │ │ │ │ +260template │ │ │ │ +_2_6_1class _R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s : │ │ │ │ +262 public _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n │ │ │ │ +263{ │ │ │ │ +264 using Base = _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_<_G_V_>; │ │ │ │ +265 │ │ │ │ +266 // the layout is defined in terms of a MCMGLayout specialized for k == 0 or │ │ │ │ +1 │ │ │ │ +267 static MCMGLayout dofLayout() │ │ │ │ +268 { │ │ │ │ +269 return [](GeometryType gt, size_t gridDim) -> size_t { │ │ │ │ +270 if ((gt.isPyramid()) and (k==0)) │ │ │ │ +271 return 1; │ │ │ │ +272 if (gt.dim() == gridDim) │ │ │ │ +273 return gt.isCube() ? ((dim == 2) ? k*(k+1)*dim : k*(k+1)*(k+1)*dim) : │ │ │ │ +k*dim; │ │ │ │ +274 if (gt.dim() == gridDim-1) │ │ │ │ +275 return gt.isCube() ? (dim-2)*2*k+k+1 : (dim-1)*k+1 ; │ │ │ │ +276 return 0; │ │ │ │ +277 }; │ │ │ │ +278 } │ │ │ │ +279 │ │ │ │ +280 static const int dim = GV::dimension; │ │ │ │ +281 using FiniteElementMap = typename Impl:: │ │ │ │ +RaviartThomasLocalFiniteElementMap; │ │ │ │ +282 │ │ │ │ +283public: │ │ │ │ +284 │ │ │ │ +_2_8_6 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ +_2_8_7 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ +288 │ │ │ │ +_2_8_9 using _N_o_d_e = _R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e_<_G_V_,_ _k_>; │ │ │ │ +290 │ │ │ │ +_2_9_2 _R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s(const _G_r_i_d_V_i_e_w& gv) : │ │ │ │ +293 Base(gv, dofLayout()), │ │ │ │ +294 _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__(gv) │ │ │ │ +295 { │ │ │ │ +296 // Currently there are some unresolved bugs with hybrid grids and higher │ │ │ │ +order Raviart-Thomas elements │ │ │ │ +297 if (gv.indexSet().types(0).size() > 1 and k>0) │ │ │ │ +298 DUNE_THROW(Dune::NotImplemented, "Raviart-Thomas basis with index k>0 is │ │ │ │ +only implemented for grids with a single element type"); │ │ │ │ +299 │ │ │ │ +300 for(auto type : gv.indexSet().types(0)) │ │ │ │ +301 if (!type.isSimplex() && !type.isCube() && !type.isPyramid() && │ │ │ │ +!type.isPrism()) │ │ │ │ +302 DUNE_THROW(Dune::NotImplemented, "Raviart-Thomas elements are only │ │ │ │ +implemented for grids with simplex, cube, pyramid or prism elements."); │ │ │ │ +303 } │ │ │ │ +304 │ │ │ │ +_3_0_6 void _u_p_d_a_t_e(const _G_r_i_d_V_i_e_w& gv) │ │ │ │ +307 { │ │ │ │ +308 _B_a_s_e_:_:_u_p_d_a_t_e(gv); │ │ │ │ +309 _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__.update(gv); │ │ │ │ +310 } │ │ │ │ +311 │ │ │ │ +_3_1_5 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ +316 { │ │ │ │ +317 return _N_o_d_e{&_f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__}; │ │ │ │ +318 } │ │ │ │ +319 │ │ │ │ +320protected: │ │ │ │ +_3_2_1 FiniteElementMap _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__; │ │ │ │ +322}; │ │ │ │ +323 │ │ │ │ +324 │ │ │ │ +325 │ │ │ │ +326template │ │ │ │ +_3_2_7class _R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e : │ │ │ │ +328 public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ +329{ │ │ │ │ +330 static const int dim = GV::dimension; │ │ │ │ +331 │ │ │ │ +332public: │ │ │ │ +333 │ │ │ │ +_3_3_4 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ +_3_3_5 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ +_3_3_6 using _F_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p = typename Impl:: │ │ │ │ +RaviartThomasLocalFiniteElementMap; │ │ │ │ +_3_3_7 using _F_i_n_i_t_e_E_l_e_m_e_n_t = Impl::GlobalValuedLocalFiniteElement; │ │ │ │ +340 │ │ │ │ +_3_4_1 _R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e(const _F_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p* finiteElementMap) : │ │ │ │ +342 _e_l_e_m_e_n_t__(nullptr), │ │ │ │ +343 _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__(finiteElementMap) │ │ │ │ +344 { } │ │ │ │ +345 │ │ │ │ +_3_4_7 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ +348 { │ │ │ │ +349 return *_e_l_e_m_e_n_t__; │ │ │ │ +350 } │ │ │ │ +351 │ │ │ │ +_3_5_6 const _F_i_n_i_t_e_E_l_e_m_e_n_t& _f_i_n_i_t_e_E_l_e_m_e_n_t() const │ │ │ │ +357 { │ │ │ │ +358 return _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ +359 } │ │ │ │ +360 │ │ │ │ +_3_6_2 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ +363 { │ │ │ │ +364 _e_l_e_m_e_n_t__ = &e; │ │ │ │ +365 _f_i_n_i_t_e_E_l_e_m_e_n_t__.bind((_f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__->find(*_e_l_e_m_e_n_t__)), e); │ │ │ │ +366 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__.size()); │ │ │ │ +367 } │ │ │ │ +368 │ │ │ │ +369protected: │ │ │ │ +370 │ │ │ │ +_3_7_1 _F_i_n_i_t_e_E_l_e_m_e_n_t _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ +_3_7_2 const _E_l_e_m_e_n_t* _e_l_e_m_e_n_t__; │ │ │ │ +_3_7_3 const _F_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p* _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__; │ │ │ │ +374}; │ │ │ │ +375 │ │ │ │ +376namespace _B_a_s_i_s_F_a_c_t_o_r_y { │ │ │ │ +377 │ │ │ │ +385template │ │ │ │ +_3_8_6auto _r_a_v_i_a_r_t_T_h_o_m_a_s() │ │ │ │ +387{ │ │ │ │ +388 return [](const auto& gridView) { │ │ │ │ +389 return _R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s, k> │ │ │ │ +(gridView); │ │ │ │ +390 }; │ │ │ │ +391} │ │ │ │ +392 │ │ │ │ +393} // end namespace BasisFactory │ │ │ │ +394 │ │ │ │ +395 │ │ │ │ +396 │ │ │ │ +397/ │ │ │ │ +/ ***************************************************************************** │ │ │ │ +398// This is the actual global basis implementation based on the reusable │ │ │ │ +parts. │ │ │ │ +399/ │ │ │ │ +/ ***************************************************************************** │ │ │ │ +400 │ │ │ │ +408template │ │ │ │ +_4_0_9using _R_a_v_i_a_r_t_T_h_o_m_a_s_B_a_s_i_s = _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s_<_G_V_,_ _k_> │ │ │ │ +>; │ │ │ │ +410 │ │ │ │ +411} // end namespace Functions │ │ │ │ +412} // end namespace Dune │ │ │ │ +413 │ │ │ │ +414 │ │ │ │ +415#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH │ │ │ │ +_g_l_o_b_a_l_v_a_l_u_e_d_l_o_c_a_l_f_i_n_i_t_e_e_l_e_m_e_n_t_._h_h │ │ │ │ +_n_o_d_e_s_._h_h │ │ │ │ +_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ +_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_r_a_v_i_a_r_t_T_h_o_m_a_s │ │ │ │ +auto raviartThomas() │ │ │ │ +Create a pre-basis factory that can create a Raviart-Thomas pre-basis. │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:386 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_p_o_w_e_r │ │ │ │ +auto power(ChildPreBasisFactory &&childPreBasisFactory, std::size_t k, const │ │ │ │ +IndexMergingStrategy &) │ │ │ │ +Create a pre-basis factory that can build a PowerPreBasis. │ │ │ │ +DDeeffiinniittiioonn dynamicpowerbasis.hh:410 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_e_l_e_m_e_n_t_s │ │ │ │ auto elements(const SubDomainGridView< HostGridView > &subDomainGridView) │ │ │ │ ADL findable access to element range for a SubDomainGridView. │ │ │ │ DDeeffiinniittiioonn subdomain.hh:487 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_i_n_t_e_r_s_e_c_t_i_o_n_s │ │ │ │ +auto intersections(const SubDomainGridView< HostGridView > &subDomainGridView, │ │ │ │ +const Element &element) │ │ │ │ +ADL findable access to intersection range for an element of a │ │ │ │ +SubDomainGridView. │ │ │ │ +DDeeffiinniittiioonn subdomain.hh:510 │ │ │ │ +_D_u_n_e │ │ │ │ +DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_B_a_s_i_s │ │ │ │ +DefaultGlobalBasis< RaviartThomasPreBasis< GV, k > > RaviartThomasBasis │ │ │ │ +Basis of a k-th-order Raviart Thomas finite element space. │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:409 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ +DDeeffiinniittiioonn argyrisbasis.hh:926 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ +Global basis for given pre-basis. │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:53 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_u_p_d_a_t_e │ │ │ │ +void update(const GridView &gv) │ │ │ │ +Update the stored GridView. │ │ │ │ +DDeeffiinniittiioonn leafprebasismappermixin.hh:101 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n │ │ │ │ +LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout) │ │ │ │ +Construct from GridView and local DOF layout. │ │ │ │ +DDeeffiinniittiioonn leafprebasismappermixin.hh:74 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_N_o_d_e_M_i_x_i_n_:_:_s_e_t_S_i_z_e │ │ │ │ +void setSize(const size_type size) │ │ │ │ +DDeeffiinniittiioonn nodes.hh:197 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ +DDeeffiinniittiioonn nodes.hh:218 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:329 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e_:_:_F_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p │ │ │ │ +typename Impl::RaviartThomasLocalFiniteElementMap< GV, dim, double, k > │ │ │ │ +FiniteElementMap │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:336 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e_:_:_b_i_n_d │ │ │ │ +void bind(const Element &e) │ │ │ │ +Bind to element. │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:362 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e_:_:_E_l_e_m_e_n_t │ │ │ │ +typename GV::template Codim< 0 >::Entity Element │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:335 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e_:_:_e_l_e_m_e_n_t__ │ │ │ │ +const Element * element_ │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:372 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ +const FiniteElement & finiteElement() const │ │ │ │ +Return the LocalFiniteElement for the element we are bound to. │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:356 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e_:_:_s_i_z_e___t_y_p_e │ │ │ │ +std::size_t size_type │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:334 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e_:_:_F_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ +Impl::GlobalValuedLocalFiniteElement< Impl::ContravariantPiolaTransformator, │ │ │ │ +typename FiniteElementMap::FiniteElement, Element > FiniteElement │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:337 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e │ │ │ │ +RaviartThomasNode(const FiniteElementMap *finiteElementMap) │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:341 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e_:_:_e_l_e_m_e_n_t │ │ │ │ +const Element & element() const │ │ │ │ +Return current element, throw if unbound. │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:347 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t__ │ │ │ │ +FiniteElement finiteElement_ │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:371 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__ │ │ │ │ +const FiniteElementMap * finiteElementMap_ │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:373 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:263 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s_:_:_m_a_k_e_N_o_d_e │ │ │ │ +Node makeNode() const │ │ │ │ +Create tree node. │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:315 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s_:_:_u_p_d_a_t_e │ │ │ │ +void update(const GridView &gv) │ │ │ │ +Update the stored grid view, to be called if the grid has changed. │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:306 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s │ │ │ │ +RaviartThomasPreBasis(const GridView &gv) │ │ │ │ +Constructor for a given grid view object. │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:292 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s_:_:_s_i_z_e___t_y_p_e │ │ │ │ +std::size_t size_type │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:287 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__ │ │ │ │ +FiniteElementMap finiteElementMap_ │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:321 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s_:_:_N_o_d_e │ │ │ │ +RaviartThomasNode< GV, k > Node │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:289 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w │ │ │ │ +GV GridView │ │ │ │ +The grid view that the FE space is defined on. │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:286 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _m_a_p_p_e_r_u_t_i_l_i_t_i_e_s_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _r_a_v_i_a_r_t_t_h_o_m_a_s_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00230.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: localfunction_imp.hh File Reference │ │ │ +Dune-Functions: basistags.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,39 +88,71 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
localfunction_imp.hh File Reference
│ │ │ +
basistags.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <dune/functions/common/type_traits.hh>
│ │ │ -#include <dune/functions/common/differentiablefunction_imp.hh>
│ │ │ +
#include <type_traits>
│ │ │ +#include <dune/common/concept.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +

│ │ │ +Classes

struct  Dune::Functions::Concept::IndexMergingStrategy
struct  Dune::Functions::BasisFactory::IndexMergingStrategy
 Base class for index merging strategies to simplify detection. More...
struct  Dune::Functions::BasisFactory::FlatLexicographic
 Lexicographic merging of direct children without blocking. More...
struct  Dune::Functions::BasisFactory::FlatInterleaved
 Interleaved merging of direct children without blocking. More...
struct  Dune::Functions::BasisFactory::BlockedLexicographic
 Lexicographic merging of direct children with blocking (i.e. creating one block per direct child). More...
struct  Dune::Functions::BasisFactory::BlockedInterleaved
 Interleaved merging of direct children with blocking (i.e. creating blocks at the leaves containing one leaf per child each). More...
│ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ + │ │ │ +

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::Concept
namespace  Dune::Functions::BasisFactory
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ +Functions

template<typename T>
static constexpr bool Dune::Functions::Concept::isIndexMergingStrategy ()
template<typename T>
static constexpr bool Dune::Functions::Concept::isIndexMergingStrategy (T &&t)
void Dune::Functions::BasisFactory::registerIndexMergingStrategy (IndexMergingStrategy)
constexpr FlatLexicographic Dune::Functions::BasisFactory::flatLexicographic ()
 Creates a lexicographic merging of direct children without blocking.
constexpr FlatInterleaved Dune::Functions::BasisFactory::flatInterleaved ()
 Creates an interleaved merging of direct children without blocking.
constexpr BlockedLexicographic Dune::Functions::BasisFactory::blockedLexicographic ()
 Creates a lexicographic merging of direct children with blocking (i.e. creating one block per direct child).
constexpr BlockedInterleaved Dune::Functions::BasisFactory::blockedInterleaved ()
 Creates an interleaved merging of direct children with blocking (i.e. creating blocks at the leaves containing one leaf per child each).
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,16 +1,60 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -localfunction_imp.hh File Reference │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n___i_m_p_._h_h> │ │ │ │ +basistags.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ +CCllaasssseess │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ +  Base class for index merging strategies to simplify detection. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_F_l_a_t_L_e_x_i_c_o_g_r_a_p_h_i_c │ │ │ │ +  Lexicographic merging of direct children without blocking. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_F_l_a_t_I_n_t_e_r_l_e_a_v_e_d │ │ │ │ +  Interleaved merging of direct children without blocking. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_B_l_o_c_k_e_d_L_e_x_i_c_o_g_r_a_p_h_i_c │ │ │ │ +  Lexicographic merging of direct children with blocking (i.e. creating │ │ │ │ + one block per direct child). _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_B_l_o_c_k_e_d_I_n_t_e_r_l_e_a_v_e_d │ │ │ │ +  Interleaved merging of direct children with blocking (i.e. creating │ │ │ │ + blocks at the leaves containing one leaf per child each). _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ +namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t │ │ │ │ +namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ +FFuunnccttiioonnss │ │ │ │ +template │ │ │ │ + static constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_: │ │ │ │ + _i_s_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y () │ │ │ │ +template │ │ │ │ + static constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_: │ │ │ │ + _i_s_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y (T &&t) │ │ │ │ + void  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_: │ │ │ │ + _r_e_g_i_s_t_e_r_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ + (_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y) │ │ │ │ + constexpr _F_l_a_t_L_e_x_i_c_o_g_r_a_p_h_i_c  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_: │ │ │ │ + _f_l_a_t_L_e_x_i_c_o_g_r_a_p_h_i_c () │ │ │ │ +  Creates a lexicographic merging of direct │ │ │ │ + children without blocking. │ │ │ │ + constexpr _F_l_a_t_I_n_t_e_r_l_e_a_v_e_d  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_f_l_a_t_I_n_t_e_r_l_e_a_v_e_d │ │ │ │ + () │ │ │ │ +  Creates an interleaved merging of direct │ │ │ │ + children without blocking. │ │ │ │ +constexpr _B_l_o_c_k_e_d_L_e_x_i_c_o_g_r_a_p_h_i_c  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_: │ │ │ │ + _b_l_o_c_k_e_d_L_e_x_i_c_o_g_r_a_p_h_i_c () │ │ │ │ + Creates a lexicographic merging of direct │ │ │ │ +  children with blocking (i.e. creating one block │ │ │ │ + per direct child). │ │ │ │ + constexpr _B_l_o_c_k_e_d_I_n_t_e_r_l_e_a_v_e_d  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_: │ │ │ │ + _b_l_o_c_k_e_d_I_n_t_e_r_l_e_a_v_e_d () │ │ │ │ + Creates an interleaved merging of direct │ │ │ │ +  children with blocking (i.e. creating blocks at │ │ │ │ + the leaves containing one leaf per child each). │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _l_o_c_a_l_f_u_n_c_t_i_o_n___i_m_p_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _b_a_s_i_s_t_a_g_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00230_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: localfunction_imp.hh Source File │ │ │ +Dune-Functions: basistags.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,98 +88,146 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
localfunction_imp.hh
│ │ │ +
basistags.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_COMMON_LOCALFUNCTION_FUNCTION_IMP_HH
│ │ │ -
8#define DUNE_FUNCTIONS_COMMON_LOCALFUNCTION_FUNCTION_IMP_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH
│ │ │ +
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH
│ │ │
9
│ │ │ - │ │ │ - │ │ │ +
10#include <type_traits>
│ │ │ +
11#include <dune/common/concept.hh>
│ │ │
12
│ │ │ -
13
│ │ │ -
14
│ │ │ -
15namespace Dune {
│ │ │ -
16namespace Functions {
│ │ │ -
17namespace Imp {
│ │ │ -
18
│ │ │ -
19// Interface of type erasure wrapper
│ │ │ -
20//
│ │ │ -
21// Notice that the basic interface of polymorphic classes (destructor, clone, ...)
│ │ │ -
22// will be added by the type erasure foundation classes.
│ │ │ -
23template<class Signature, class DerivativeInterface, class LocalContext>
│ │ │ -
24class LocalFunctionWrapperInterface :
│ │ │ -
25 public DifferentiableFunctionWrapperInterface<Signature, DerivativeInterface>
│ │ │ -
26{
│ │ │ -
27public:
│ │ │ -
28 virtual void bind(const LocalContext&) = 0;
│ │ │ -
29
│ │ │ -
30 virtual void unbind() = 0;
│ │ │ +
13namespace Dune {
│ │ │ +
14namespace Functions {
│ │ │ +
15
│ │ │ +
16 namespace Concept {
│ │ │ +
17
│ │ │ +
│ │ │ + │ │ │ +
19 {
│ │ │ +
20 template<typename T>
│ │ │ +
21 auto require(T&& t) -> decltype(
│ │ │ +
22 registerIndexMergingStrategy(t)
│ │ │ +
23 );
│ │ │ +
24 };
│ │ │ +
│ │ │ +
25
│ │ │ +
26 template<typename T>
│ │ │ +
│ │ │ +
27 static constexpr bool isIndexMergingStrategy()
│ │ │ +
28 {
│ │ │ +
29 return models<Concept::IndexMergingStrategy,T>();
│ │ │ +
30 }
│ │ │ +
│ │ │
31
│ │ │ -
32 virtual bool bound() const = 0;
│ │ │ -
33
│ │ │ -
34 virtual const LocalContext& localContext() const = 0;
│ │ │ -
35};
│ │ │ -
36
│ │ │ +
32 template<typename T>
│ │ │ +
│ │ │ +
33 static constexpr bool isIndexMergingStrategy(T&& t)
│ │ │ +
34 {
│ │ │ +
35 return models<Concept::IndexMergingStrategy,std::decay_t<T>>();
│ │ │ +
36 }
│ │ │ +
│ │ │
37
│ │ │ -
38// Implementation of type erasure wrapper
│ │ │ -
39template<class Signature, class DerivativeInterface, class LocalContext, class B>
│ │ │ -
40class LocalFunctionWrapperImplementation :
│ │ │ -
41 public DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>
│ │ │ -
42{
│ │ │ -
43 using Base = DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>;
│ │ │ -
44public:
│ │ │ -
45 using Base::Base;
│ │ │ -
46
│ │ │ -
47 virtual void bind(const LocalContext& context)
│ │ │ -
48 {
│ │ │ -
49 this->get().bind(context);
│ │ │ -
50 }
│ │ │ -
51
│ │ │ -
52 virtual void unbind()
│ │ │ -
53 {
│ │ │ -
54 this->get().unbind();
│ │ │ -
55 }
│ │ │ -
56
│ │ │ -
57 virtual bool bound() const
│ │ │ -
58 {
│ │ │ -
59 return this->get().bound();
│ │ │ -
60 }
│ │ │ -
61
│ │ │ -
62 virtual const LocalContext& localContext() const
│ │ │ -
63 {
│ │ │ -
64 return this->get().localContext();
│ │ │ -
65 }
│ │ │ -
66};
│ │ │ -
67
│ │ │ -
68}}} // namespace Dune::Functions::Imp
│ │ │ -
69
│ │ │ -
70
│ │ │ -
71
│ │ │ -
72#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH
│ │ │ - │ │ │ - │ │ │ +
38 } // namespace Concept
│ │ │ +
39
│ │ │ +
40
│ │ │ +
41namespace BasisFactory {
│ │ │ +
42
│ │ │ + │ │ │ +
49
│ │ │ + │ │ │ +
51
│ │ │ +
│ │ │ + │ │ │ + │ │ │ +
84 {};
│ │ │ +
│ │ │ +
85
│ │ │ +
│ │ │ + │ │ │ +
117 : public IndexMergingStrategy
│ │ │ +
118 {};
│ │ │ +
│ │ │ +
119
│ │ │ +
│ │ │ + │ │ │ +
151 : public IndexMergingStrategy
│ │ │ +
152 {};
│ │ │ +
│ │ │ +
153
│ │ │ + │ │ │ +
185
│ │ │ +
186
│ │ │ +
│ │ │ + │ │ │ +
193 {
│ │ │ +
194 return {};
│ │ │ +
195 }
│ │ │ +
│ │ │ +
196
│ │ │ +
│ │ │ + │ │ │ +
203 {
│ │ │ +
204 return {};
│ │ │ +
205 }
│ │ │ +
│ │ │ +
206
│ │ │ +
│ │ │ + │ │ │ +
213 {
│ │ │ +
214 return {};
│ │ │ +
215 }
│ │ │ +
│ │ │ +
216
│ │ │ +
│ │ │ + │ │ │ +
223 {
│ │ │ +
224 return {};
│ │ │ +
225 }
│ │ │ +
│ │ │ +
226
│ │ │ +
227} // end namespace BasisFactory
│ │ │ +
228
│ │ │ +
229} // end namespace Functions
│ │ │ +
230} // end namespace Dune
│ │ │ +
231
│ │ │ +
232
│ │ │ +
233#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH
│ │ │ +
constexpr FlatLexicographic flatLexicographic()
Creates a lexicographic merging of direct children without blocking.
Definition basistags.hh:192
│ │ │ +
constexpr BlockedInterleaved blockedInterleaved()
Creates an interleaved merging of direct children with blocking (i.e. creating blocks at the leaves c...
Definition basistags.hh:222
│ │ │ +
constexpr FlatInterleaved flatInterleaved()
Creates an interleaved merging of direct children without blocking.
Definition basistags.hh:202
│ │ │ +
constexpr BlockedLexicographic blockedLexicographic()
Creates a lexicographic merging of direct children with blocking (i.e. creating one block per direct ...
Definition basistags.hh:212
│ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ +
Definition backends/concepts.hh:17
│ │ │ +
static constexpr bool isIndexMergingStrategy()
Definition basistags.hh:27
│ │ │ +
void registerIndexMergingStrategy(IndexMergingStrategy)
│ │ │ + │ │ │ +
auto require(T &&t) -> decltype(registerIndexMergingStrategy(t))
│ │ │ +
Base class for index merging strategies to simplify detection.
Definition basistags.hh:48
│ │ │ +
Lexicographic merging of direct children without blocking.
Definition basistags.hh:84
│ │ │ +
Interleaved merging of direct children without blocking.
Definition basistags.hh:118
│ │ │ +
Lexicographic merging of direct children with blocking (i.e. creating one block per direct child).
Definition basistags.hh:152
│ │ │ +
Interleaved merging of direct children with blocking (i.e. creating blocks at the leaves containing o...
Definition basistags.hh:184
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,96 +1,151 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -localfunction_imp.hh │ │ │ │ +basistags.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_COMMON_LOCALFUNCTION_FUNCTION_IMP_HH │ │ │ │ -8#define DUNE_FUNCTIONS_COMMON_LOCALFUNCTION_FUNCTION_IMP_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH │ │ │ │ +8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH │ │ │ │ 9 │ │ │ │ -10#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ -11#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n___i_m_p_._h_h> │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ 12 │ │ │ │ -13 │ │ │ │ -14 │ │ │ │ -15namespace _D_u_n_e { │ │ │ │ -16namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -17namespace Imp { │ │ │ │ -18 │ │ │ │ -19// Interface of type erasure wrapper │ │ │ │ -20// │ │ │ │ -21// Notice that the basic interface of polymorphic classes (destructor, clone, │ │ │ │ -...) │ │ │ │ -22// will be added by the type erasure foundation classes. │ │ │ │ -23template │ │ │ │ -24class LocalFunctionWrapperInterface : │ │ │ │ -25 public DifferentiableFunctionWrapperInterface │ │ │ │ -26{ │ │ │ │ -27public: │ │ │ │ -28 virtual void bind(const LocalContext&) = 0; │ │ │ │ -29 │ │ │ │ -30 virtual void unbind() = 0; │ │ │ │ +13namespace _D_u_n_e { │ │ │ │ +14namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +15 │ │ │ │ +16 namespace _C_o_n_c_e_p_t { │ │ │ │ +17 │ │ │ │ +_1_8 struct _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ +19 { │ │ │ │ +20 template │ │ │ │ +_2_1 auto _r_e_q_u_i_r_e(T&& t) -> decltype( │ │ │ │ +22 registerIndexMergingStrategy(t) │ │ │ │ +23 ); │ │ │ │ +24 }; │ │ │ │ +25 │ │ │ │ +26 template │ │ │ │ +_2_7 static constexpr bool _i_s_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y() │ │ │ │ +28 { │ │ │ │ +29 return models(); │ │ │ │ +30 } │ │ │ │ 31 │ │ │ │ -32 virtual bool bound() const = 0; │ │ │ │ -33 │ │ │ │ -34 virtual const LocalContext& localContext() const = 0; │ │ │ │ -35}; │ │ │ │ -36 │ │ │ │ +32 template │ │ │ │ +_3_3 static constexpr bool _i_s_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y(T&& t) │ │ │ │ +34 { │ │ │ │ +35 return models>(); │ │ │ │ +36 } │ │ │ │ 37 │ │ │ │ -38// Implementation of type erasure wrapper │ │ │ │ -39template │ │ │ │ -40class LocalFunctionWrapperImplementation : │ │ │ │ -41 public DifferentiableFunctionWrapperImplementation │ │ │ │ -42{ │ │ │ │ -43 using Base = DifferentiableFunctionWrapperImplementation; │ │ │ │ -44public: │ │ │ │ -45 using Base::Base; │ │ │ │ -46 │ │ │ │ -47 virtual void bind(const LocalContext& context) │ │ │ │ -48 { │ │ │ │ -49 this->get().bind(context); │ │ │ │ -50 } │ │ │ │ +38 } // namespace Concept │ │ │ │ +39 │ │ │ │ +40 │ │ │ │ +41namespace BasisFactory { │ │ │ │ +42 │ │ │ │ +_4_8 struct _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y {}; │ │ │ │ +49 │ │ │ │ +_5_0 void _r_e_g_i_s_t_e_r_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y(_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y); │ │ │ │ 51 │ │ │ │ -52 virtual void unbind() │ │ │ │ -53 { │ │ │ │ -54 this->get().unbind(); │ │ │ │ -55 } │ │ │ │ -56 │ │ │ │ -57 virtual bool bound() const │ │ │ │ -58 { │ │ │ │ -59 return this->get().bound(); │ │ │ │ -60 } │ │ │ │ -61 │ │ │ │ -62 virtual const LocalContext& localContext() const │ │ │ │ -63 { │ │ │ │ -64 return this->get().localContext(); │ │ │ │ -65 } │ │ │ │ -66}; │ │ │ │ -67 │ │ │ │ -68}}} // namespace Dune::Functions::Imp │ │ │ │ -69 │ │ │ │ -70 │ │ │ │ -71 │ │ │ │ -72#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH │ │ │ │ -_t_y_p_e___t_r_a_i_t_s_._h_h │ │ │ │ -_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n___i_m_p_._h_h │ │ │ │ +_8_2 struct _F_l_a_t_L_e_x_i_c_o_g_r_a_p_h_i_c │ │ │ │ +83 : public _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ +84 {}; │ │ │ │ +85 │ │ │ │ +_1_1_6 struct _F_l_a_t_I_n_t_e_r_l_e_a_v_e_d │ │ │ │ +117 : public _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ +118 {}; │ │ │ │ +119 │ │ │ │ +_1_5_0 struct _B_l_o_c_k_e_d_L_e_x_i_c_o_g_r_a_p_h_i_c │ │ │ │ +151 : public _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ +152 {}; │ │ │ │ +153 │ │ │ │ +_1_8_4 struct _B_l_o_c_k_e_d_I_n_t_e_r_l_e_a_v_e_d : public _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y {}; │ │ │ │ +185 │ │ │ │ +186 │ │ │ │ +_1_9_2 constexpr _F_l_a_t_L_e_x_i_c_o_g_r_a_p_h_i_c _f_l_a_t_L_e_x_i_c_o_g_r_a_p_h_i_c() │ │ │ │ +193 { │ │ │ │ +194 return {}; │ │ │ │ +195 } │ │ │ │ +196 │ │ │ │ +_2_0_2 constexpr _F_l_a_t_I_n_t_e_r_l_e_a_v_e_d _f_l_a_t_I_n_t_e_r_l_e_a_v_e_d() │ │ │ │ +203 { │ │ │ │ +204 return {}; │ │ │ │ +205 } │ │ │ │ +206 │ │ │ │ +_2_1_2 constexpr _B_l_o_c_k_e_d_L_e_x_i_c_o_g_r_a_p_h_i_c _b_l_o_c_k_e_d_L_e_x_i_c_o_g_r_a_p_h_i_c() │ │ │ │ +213 { │ │ │ │ +214 return {}; │ │ │ │ +215 } │ │ │ │ +216 │ │ │ │ +_2_2_2 constexpr _B_l_o_c_k_e_d_I_n_t_e_r_l_e_a_v_e_d _b_l_o_c_k_e_d_I_n_t_e_r_l_e_a_v_e_d() │ │ │ │ +223 { │ │ │ │ +224 return {}; │ │ │ │ +225 } │ │ │ │ +226 │ │ │ │ +227} // end namespace BasisFactory │ │ │ │ +228 │ │ │ │ +229} // end namespace Functions │ │ │ │ +230} // end namespace Dune │ │ │ │ +231 │ │ │ │ +232 │ │ │ │ +233#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_f_l_a_t_L_e_x_i_c_o_g_r_a_p_h_i_c │ │ │ │ +constexpr FlatLexicographic flatLexicographic() │ │ │ │ +Creates a lexicographic merging of direct children without blocking. │ │ │ │ +DDeeffiinniittiioonn basistags.hh:192 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_b_l_o_c_k_e_d_I_n_t_e_r_l_e_a_v_e_d │ │ │ │ +constexpr BlockedInterleaved blockedInterleaved() │ │ │ │ +Creates an interleaved merging of direct children with blocking (i.e. creating │ │ │ │ +blocks at the leaves c... │ │ │ │ +DDeeffiinniittiioonn basistags.hh:222 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_f_l_a_t_I_n_t_e_r_l_e_a_v_e_d │ │ │ │ +constexpr FlatInterleaved flatInterleaved() │ │ │ │ +Creates an interleaved merging of direct children without blocking. │ │ │ │ +DDeeffiinniittiioonn basistags.hh:202 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_b_l_o_c_k_e_d_L_e_x_i_c_o_g_r_a_p_h_i_c │ │ │ │ +constexpr BlockedLexicographic blockedLexicographic() │ │ │ │ +Creates a lexicographic merging of direct children with blocking (i.e. creating │ │ │ │ +one block per direct ... │ │ │ │ +DDeeffiinniittiioonn basistags.hh:212 │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t │ │ │ │ +DDeeffiinniittiioonn backends/concepts.hh:17 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ +static constexpr bool isIndexMergingStrategy() │ │ │ │ +DDeeffiinniittiioonn basistags.hh:27 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_r_e_g_i_s_t_e_r_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ +void registerIndexMergingStrategy(IndexMergingStrategy) │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ +DDeeffiinniittiioonn basistags.hh:19 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y_:_:_r_e_q_u_i_r_e │ │ │ │ +auto require(T &&t) -> decltype(registerIndexMergingStrategy(t)) │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ +Base class for index merging strategies to simplify detection. │ │ │ │ +DDeeffiinniittiioonn basistags.hh:48 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_F_l_a_t_L_e_x_i_c_o_g_r_a_p_h_i_c │ │ │ │ +Lexicographic merging of direct children without blocking. │ │ │ │ +DDeeffiinniittiioonn basistags.hh:84 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_F_l_a_t_I_n_t_e_r_l_e_a_v_e_d │ │ │ │ +Interleaved merging of direct children without blocking. │ │ │ │ +DDeeffiinniittiioonn basistags.hh:118 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_B_l_o_c_k_e_d_L_e_x_i_c_o_g_r_a_p_h_i_c │ │ │ │ +Lexicographic merging of direct children with blocking (i.e. creating one block │ │ │ │ +per direct child). │ │ │ │ +DDeeffiinniittiioonn basistags.hh:152 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_B_l_o_c_k_e_d_I_n_t_e_r_l_e_a_v_e_d │ │ │ │ +Interleaved merging of direct children with blocking (i.e. creating blocks at │ │ │ │ +the leaves containing o... │ │ │ │ +DDeeffiinniittiioonn basistags.hh:184 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _l_o_c_a_l_f_u_n_c_t_i_o_n___i_m_p_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _b_a_s_i_s_t_a_g_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00233.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: localfunction.hh File Reference │ │ │ +Dune-Functions: leafprebasismappermixin.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,50 +88,51 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
localfunction.hh File Reference
│ │ │ +
leafprebasismappermixin.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <type_traits>
│ │ │ -#include <dune/common/typeutilities.hh>
│ │ │ -#include <dune/functions/common/defaultderivativetraits.hh>
│ │ │ -#include <dune/functions/common/differentiablefunction.hh>
│ │ │ -#include <dune/functions/common/localfunction_imp.hh>
│ │ │ -#include <dune/functions/common/typeerasure.hh>
│ │ │ -#include <dune/functions/common/functionconcepts.hh>
│ │ │ +
#include <dune/common/rangeutilities.hh>
│ │ │ +#include <dune/functions/functionspacebases/leafprebasismixin.hh>
│ │ │ +#include <dune/geometry/referenceelements.hh>
│ │ │ +#include <dune/grid/common/mcmgmapper.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::LocalFunction< Signature, LocalContext, DerivativeTraits, bufferSize >
class  Dune::Functions::LocalFunction< Range(Domain), LocalContext, DerivativeTraits, bufferSize >
 Class storing local functions using type erasure. More...
class  Dune::Functions::LeafPreBasisMapperMixin< GV >
 A generic MixIn class for PreBasis with flat indices computed from a mapper. More...
│ │ │ │ │ │ │ │ │ │ │ │ +

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
│ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ +Functions

template<class GridView, class LocalCoefficients>
auto Dune::Functions::subIndexRange (const Dune::MultipleCodimMultipleGeomTypeMapper< GridView > &mapper, const typename GridView::template Codim< 0 >::Entity &element, const LocalCoefficients &localCoefficients)
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,27 +1,28 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -localfunction.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_l_o_c_a_l_f_u_n_c_t_i_o_n___i_m_p_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e_e_r_a_s_u_r_e_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +leafprebasismappermixin.hh File Reference │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h> │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_<_ _S_i_g_n_a_t_u_r_e_,_ _L_o_c_a_l_C_o_n_t_e_x_t_, │ │ │ │ - _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_ _> │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _L_o_c_a_l_C_o_n_t_e_x_t_, │ │ │ │ - _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_ _> │ │ │ │ -  Class storing local functions using type erasure. _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_<_ _G_V_ _> │ │ │ │ +  A generic MixIn class for PreBasis with flat indices computed from a │ │ │ │ + mapper. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ +FFuunnccttiioonnss │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_s_u_b_I_n_d_e_x_R_a_n_g_e (const Dune:: │ │ │ │ + MultipleCodimMultipleGeomTypeMapper< GridView > &mapper, const typename │ │ │ │ + GridView::template Codim< 0 >::Entity &element, const LocalCoefficients │ │ │ │ + &localCoefficients) │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _l_o_c_a_l_f_u_n_c_t_i_o_n_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00233.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,3 +1,4 @@ │ │ │ │ var a00233 = [ │ │ │ │ - ["Dune::Functions::LocalFunction< Signature, LocalContext, DerivativeTraits, bufferSize >", "a01382.html", null] │ │ │ │ + ["Dune::Functions::LeafPreBasisMapperMixin< GV >", "a01942.html", "a01942"], │ │ │ │ + ["Dune::Functions::subIndexRange", "a00318.html#a0d9958433ba2e4925d415823112ba9fc", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00233_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: localfunction.hh Source File │ │ │ +Dune-Functions: leafprebasismappermixin.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,184 +88,172 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
localfunction.hh
│ │ │ +
leafprebasismappermixin.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH
│ │ │ -
8#define DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LEAFPREBASISMAPPERMIXIN_HH
│ │ │ +
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LEAFPREBASISMAPPERMIXIN_HH
│ │ │
9
│ │ │ -
10#include <type_traits>
│ │ │ +
10#include <dune/common/rangeutilities.hh>
│ │ │
11
│ │ │ -
12#include <dune/common/typeutilities.hh>
│ │ │ + │ │ │
13
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ +
14#include <dune/geometry/referenceelements.hh>
│ │ │ +
15
│ │ │ +
16#include <dune/grid/common/mcmgmapper.hh>
│ │ │ +
17
│ │ │ +
18
│ │ │
19
│ │ │ -
20
│ │ │ +
20namespace Dune::Functions {
│ │ │
21
│ │ │ -
22namespace Dune {
│ │ │ -
23namespace Functions {
│ │ │ -
24
│ │ │ -
25
│ │ │ -
26
│ │ │ -
27/*
│ │ │ -
28 * Default implementation is empty
│ │ │ -
29 * The actual implementation is only given if Signature is an type
│ │ │ -
30 * describing a function signature as Range(Domain).
│ │ │ -
31 */
│ │ │ -
32template<class Signature, class LocalContext, template<class> class DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>
│ │ │ -
│ │ │ - │ │ │ -
34{};
│ │ │ -
│ │ │ -
35
│ │ │ -
36
│ │ │ -
37
│ │ │ -
38namespace Imp
│ │ │ -
39{
│ │ │ -
40
│ │ │ -
42 template<class S, class L, template<class> class DerivativeTraits, size_t bufferSize>
│ │ │ -
43 struct LocalFunctionTraits :
│ │ │ -
44 DifferentiableFunctionTraits<S, DerivativeTraits, bufferSize>
│ │ │ -
45 {
│ │ │ -
46 protected:
│ │ │ -
47 using Base=DifferentiableFunctionTraits<S, DerivativeTraits, bufferSize>;
│ │ │ -
48
│ │ │ -
49 public:
│ │ │ -
51 using LocalContext = L;
│ │ │ -
52
│ │ │ -
54 using DerivativeSignature = typename Base::DerivativeSignature;
│ │ │ -
55
│ │ │ - │ │ │ -
58
│ │ │ -
60 using Concept = LocalFunctionWrapperInterface<S, DerivativeInterface, L>;
│ │ │ -
61
│ │ │ -
63 template<class B>
│ │ │ -
64 using Model = LocalFunctionWrapperImplementation<S, DerivativeInterface, L, B>;
│ │ │ -
65 };
│ │ │ -
66}
│ │ │ -
67
│ │ │ -
68
│ │ │ +
22
│ │ │ +
23
│ │ │ +
24// Helper function returning a random access range
│ │ │ +
25// of global indices associated to the element. The ordering
│ │ │ +
26// is derived from the LocalCoefficients object.
│ │ │ +
27// Having this as a member of MCMGMapper would be nice.
│ │ │ +
28// But this would introduce the LocalCoefficient in dune-grid.
│ │ │ +
29// This would introduce at least a weak 'conceptual' dependency problem.
│ │ │ +
30template<class GridView, class LocalCoefficients>
│ │ │ +
│ │ │ +
31auto subIndexRange(const Dune::MultipleCodimMultipleGeomTypeMapper<GridView>& mapper, const typename GridView::template Codim<0>::Entity& element, const LocalCoefficients& localCoefficients)
│ │ │ +
32{
│ │ │ +
33 // Here we make use of the 'hidden' (poorly documented) MCMGMapper feature to support
│ │ │ +
34 // multiple DOFs per subentity. However, we do not take care for any reordering.
│ │ │ +
35 return Dune::transformedRangeView(Dune::range(localCoefficients.size()), [&](auto localIndex) {
│ │ │ +
36 auto localKey = localCoefficients.localKey(localIndex);
│ │ │ +
37 return mapper.subIndex(element, localKey.subEntity(), localKey.codim()) + localKey.index();
│ │ │ +
38 });
│ │ │ +
39}
│ │ │ +
│ │ │ +
40
│ │ │ +
41
│ │ │ +
42
│ │ │ +
59template<typename GV>
│ │ │ +
│ │ │ + │ │ │ +
61 : public LeafPreBasisMixin<LeafPreBasisMapperMixin<GV>>
│ │ │ +
62{
│ │ │ +
63 static const int gridDim = GV::dimension;
│ │ │ +
64
│ │ │ +
65public:
│ │ │ +
66
│ │ │ +
68 using GridView = GV;
│ │ │
69
│ │ │ -
90template<class Range, class Domain, class LocalContext, template<class> class DerivativeTraits, size_t bufferSize>
│ │ │ -
│ │ │ -
91class LocalFunction< Range(Domain), LocalContext, DerivativeTraits, bufferSize> :
│ │ │ -
92 public TypeErasureBase<
│ │ │ -
93 typename Imp::LocalFunctionTraits<Range(Domain), LocalContext, DerivativeTraits, bufferSize>::Concept,
│ │ │ -
94 Imp::LocalFunctionTraits<Range(Domain), LocalContext, DerivativeTraits, bufferSize>::template Model>
│ │ │ -
95{
│ │ │ -
96 using Traits = Imp::LocalFunctionTraits<Range(Domain), LocalContext, DerivativeTraits, bufferSize>;
│ │ │ -
97
│ │ │ - │ │ │ -
99
│ │ │ -
100 using DerivativeInterface = typename Traits::DerivativeInterface;
│ │ │ -
101
│ │ │ -
102public:
│ │ │ -
103
│ │ │ -
115 template<class F, disableCopyMove<LocalFunction, F> = 0 >
│ │ │ -
│ │ │ - │ │ │ -
117 Base(std::forward<F>(f))
│ │ │ -
118 {
│ │ │ -
119 static_assert(Dune::Functions::Concept::isLocalFunction<F, Range(Domain), LocalContext>(), "Trying to construct a LocalFunction from type that does not model the LocalFunction concept");
│ │ │ -
120 }
│ │ │ -
│ │ │ -
121
│ │ │ -
122 LocalFunction() = default;
│ │ │ -
123
│ │ │ -
│ │ │ -
127 Range operator() (const Domain& x) const
│ │ │ -
128 {
│ │ │ -
129 return this->asInterface().operator()(x);
│ │ │ -
130 }
│ │ │ -
│ │ │ -
131
│ │ │ -
│ │ │ -
139 friend DerivativeInterface derivative(const LocalFunction& t)
│ │ │ -
140 {
│ │ │ -
141 return t.asInterface().derivative();
│ │ │ -
142 }
│ │ │ -
│ │ │ -
143
│ │ │ -
│ │ │ -
150 void bind(const LocalContext& context)
│ │ │ -
151 {
│ │ │ -
152 this->asInterface().bind(context);
│ │ │ -
153 }
│ │ │ -
│ │ │ -
154
│ │ │ -
│ │ │ -
158 void unbind()
│ │ │ -
159 {
│ │ │ -
160 this->asInterface().unbind();
│ │ │ -
161 }
│ │ │ -
│ │ │ -
162
│ │ │ -
│ │ │ -
165 bool bound() const
│ │ │ -
166 {
│ │ │ -
167 return this->asInterface().bound();
│ │ │ -
168 }
│ │ │ -
│ │ │ -
169
│ │ │ -
│ │ │ -
173 const LocalContext& localContext() const
│ │ │ -
174 {
│ │ │ -
175 return this->asInterface().localContext();
│ │ │ -
176 }
│ │ │ -
│ │ │ -
177};
│ │ │ -
│ │ │ -
178
│ │ │ -
179
│ │ │ -
180
│ │ │ -
181}} // namespace Dune::Functions
│ │ │ -
182
│ │ │ -
183
│ │ │ -
184
│ │ │ -
185#endif // DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
static constexpr bool isLocalFunction()
Check if F models the LocalFunction concept with given signature and local context.
Definition functionconcepts.hh:170
│ │ │ -
friend DerivativeInterface derivative(const LocalFunction &t)
Get derivative of wrapped function.
Definition localfunction.hh:139
│ │ │ -
Definition monomialset.hh:19
│ │ │ +
71 using size_type = std::size_t;
│ │ │ +
72
│ │ │ +
│ │ │ +
74 LeafPreBasisMapperMixin(const GridView& gv, Dune::MCMGLayout layout) :
│ │ │ +
75 gridView_(gv),
│ │ │ +
76 mapper_(gridView_, std::move(layout))
│ │ │ +
77 {}
│ │ │ +
│ │ │ +
78
│ │ │ +
│ │ │ + │ │ │ +
81 {
│ │ │ +
82 // Determine upper bound for node size by traversing
│ │ │ +
83 // the layout for all element types in the grid
│ │ │ +
84 maxNodeSize_ = 0;
│ │ │ +
85 for(const GeometryType& elementType : gridView_.indexSet().types(0))
│ │ │ +
86 {
│ │ │ +
87 auto referenceElement = Dune::referenceElement<double, gridDim>(elementType);
│ │ │ +
88 for(auto codim : Dune::range(gridDim+1))
│ │ │ +
89 for(auto i : Dune::range(referenceElement.size(codim)))
│ │ │ +
90 maxNodeSize_ += mapper_.layout()(referenceElement.type(i, codim), gridDim);
│ │ │ +
91 }
│ │ │ +
92 }
│ │ │ +
│ │ │ +
93
│ │ │ +
│ │ │ +
95 const GridView& gridView() const
│ │ │ +
96 {
│ │ │ +
97 return gridView_;
│ │ │ +
98 }
│ │ │ +
│ │ │ +
99
│ │ │ +
│ │ │ +
101 void update(const GridView& gv)
│ │ │ +
102 {
│ │ │ +
103 gridView_ = gv;
│ │ │ +
104 mapper_.update(gridView_);
│ │ │ +
105 }
│ │ │ +
│ │ │ +
106
│ │ │ +
│ │ │ + │ │ │ +
109 {
│ │ │ +
110 return mapper_.size();
│ │ │ +
111 }
│ │ │ +
│ │ │ +
112
│ │ │ +
│ │ │ + │ │ │ +
115 {
│ │ │ +
116 return maxNodeSize_;
│ │ │ +
117 }
│ │ │ +
│ │ │ +
118
│ │ │ +
120 template<class Node, class It>
│ │ │ +
│ │ │ +
121 It indices(const Node& node, It it) const
│ │ │ +
122 {
│ │ │ +
123 for(const auto& globalIndex : subIndexRange(mapper_, node.element(), node.finiteElement().localCoefficients()))
│ │ │ +
124 {
│ │ │ +
125 *it = {{ (size_type)globalIndex }};
│ │ │ +
126 ++it;
│ │ │ +
127 }
│ │ │ +
128 return it;
│ │ │ +
129 }
│ │ │ +
│ │ │ +
130
│ │ │ +
131protected:
│ │ │ + │ │ │ +
133 Dune::MultipleCodimMultipleGeomTypeMapper<GridView> mapper_;
│ │ │ +
134 std::size_t maxNodeSize_;
│ │ │ +
135};
│ │ │ +
│ │ │ +
136
│ │ │ +
137
│ │ │ +
138
│ │ │ +
139} // end namespace Dune::Functions
│ │ │ +
140
│ │ │ +
141#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LEAFPREBASISMAPPERMIXIN_HH
│ │ │ + │ │ │
Definition monomialset.hh:19
│ │ │ -
Definition backends/concepts.hh:17
│ │ │ -
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:41
│ │ │ -
Definition localfunction.hh:34
│ │ │ -
const LocalContext & localContext() const
Obtain local context this LocalFunction is bound to.
Definition localfunction.hh:173
│ │ │ -
LocalFunction(F &&f)
Construct from function.
Definition localfunction.hh:116
│ │ │ -
void unbind()
Unbind from local context.
Definition localfunction.hh:158
│ │ │ -
bool bound() const
Return if the local function is bound to a grid element.
Definition localfunction.hh:165
│ │ │ -
void bind(const LocalContext &context)
Bind function to a local context.
Definition localfunction.hh:150
│ │ │ - │ │ │ - │ │ │ - │ │ │ +
auto subIndexRange(const Dune::MultipleCodimMultipleGeomTypeMapper< GridView > &mapper, const typename GridView::template Codim< 0 >::Entity &element, const LocalCoefficients &localCoefficients)
Definition leafprebasismappermixin.hh:31
│ │ │ +
const GridView & gridView() const
Export the stored GridView.
Definition leafprebasismappermixin.hh:95
│ │ │ +
size_type dimension() const
Return total number of basis functions.
Definition leafprebasismappermixin.hh:108
│ │ │ +
std::size_t maxNodeSize_
Definition leafprebasismappermixin.hh:134
│ │ │ +
Dune::MultipleCodimMultipleGeomTypeMapper< GridView > mapper_
Definition leafprebasismappermixin.hh:133
│ │ │ +
std::size_t size_type
Type used for index digits.
Definition leafprebasismappermixin.hh:71
│ │ │ +
void update(const GridView &gv)
Update the stored GridView.
Definition leafprebasismappermixin.hh:101
│ │ │ +
LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout)
Construct from GridView and local DOF layout.
Definition leafprebasismappermixin.hh:74
│ │ │ +
GV GridView
Type of the associated GridView.
Definition leafprebasismappermixin.hh:68
│ │ │ +
size_type maxNodeSize() const
Return maximal number of basis functions per element.
Definition leafprebasismappermixin.hh:114
│ │ │ +
GridView gridView_
Definition leafprebasismappermixin.hh:132
│ │ │ +
void initializeIndices()
Initialize the global index information.
Definition leafprebasismappermixin.hh:80
│ │ │ +
It indices(const Node &node, It it) const
Fill cache with global indices of DOFs associated to the given bound node.
Definition leafprebasismappermixin.hh:121
│ │ │ +
A generic MixIn class for PreBasis.
Definition leafprebasismixin.hh:36
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,216 +1,193 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -localfunction.hh │ │ │ │ +leafprebasismappermixin.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH │ │ │ │ -8#define DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LEAFPREBASISMAPPERMIXIN_HH │ │ │ │ +8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LEAFPREBASISMAPPERMIXIN_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ +10#include │ │ │ │ 11 │ │ │ │ -12#include │ │ │ │ +12#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h> │ │ │ │ 13 │ │ │ │ -14#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ -15#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ -16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_l_o_c_a_l_f_u_n_c_t_i_o_n___i_m_p_._h_h> │ │ │ │ -17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e_e_r_a_s_u_r_e_._h_h> │ │ │ │ -18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +14#include │ │ │ │ +15 │ │ │ │ +16#include │ │ │ │ +17 │ │ │ │ +18 │ │ │ │ 19 │ │ │ │ -20 │ │ │ │ +20namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ 21 │ │ │ │ -22namespace _D_u_n_e { │ │ │ │ -23namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -24 │ │ │ │ -25 │ │ │ │ -26 │ │ │ │ -27/* │ │ │ │ -28 * Default implementation is empty │ │ │ │ -29 * The actual implementation is only given if Signature is an type │ │ │ │ -30 * describing a function signature as Range(Domain). │ │ │ │ -31 */ │ │ │ │ -32template class │ │ │ │ -DerivativeTraits=_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s, size_t bufferSize=56> │ │ │ │ -_3_3class _L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -34{}; │ │ │ │ -35 │ │ │ │ -36 │ │ │ │ -37 │ │ │ │ -38namespace Imp │ │ │ │ -39{ │ │ │ │ +22 │ │ │ │ +23 │ │ │ │ +24// Helper function returning a random access range │ │ │ │ +25// of global indices associated to the element. The ordering │ │ │ │ +26// is derived from the LocalCoefficients object. │ │ │ │ +27// Having this as a member of MCMGMapper would be nice. │ │ │ │ +28// But this would introduce the LocalCoefficient in dune-grid. │ │ │ │ +29// This would introduce at least a weak 'conceptual' dependency problem. │ │ │ │ +30template │ │ │ │ +_3_1auto _s_u_b_I_n_d_e_x_R_a_n_g_e(const Dune::MultipleCodimMultipleGeomTypeMapper& │ │ │ │ +mapper, const typename GridView::template Codim<0>::Entity& element, const │ │ │ │ +LocalCoefficients& localCoefficients) │ │ │ │ +32{ │ │ │ │ +33 // Here we make use of the 'hidden' (poorly documented) MCMGMapper feature │ │ │ │ +to support │ │ │ │ +34 // multiple DOFs per subentity. However, we do not take care for any │ │ │ │ +reordering. │ │ │ │ +35 return Dune::transformedRangeView(Dune::range(localCoefficients.size()), [&] │ │ │ │ +(auto localIndex) { │ │ │ │ +36 auto localKey = localCoefficients.localKey(localIndex); │ │ │ │ +37 return mapper.subIndex(element, localKey.subEntity(), localKey.codim()) + │ │ │ │ +localKey.index(); │ │ │ │ +38 }); │ │ │ │ +39} │ │ │ │ 40 │ │ │ │ -42 template class DerivativeTraits, size_t │ │ │ │ -bufferSize> │ │ │ │ -43 struct LocalFunctionTraits : │ │ │ │ -44 DifferentiableFunctionTraits │ │ │ │ -45 { │ │ │ │ -46 protected: │ │ │ │ -47 using Base=DifferentiableFunctionTraits; │ │ │ │ -48 │ │ │ │ -49 public: │ │ │ │ -51 using LocalContext = L; │ │ │ │ -52 │ │ │ │ -54 using DerivativeSignature = typename Base::DerivativeSignature; │ │ │ │ -55 │ │ │ │ -57 using DerivativeInterface = _L_o_c_a_l_F_u_n_c_t_i_o_n_<_D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e_,_ _L_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_>; │ │ │ │ -58 │ │ │ │ -60 using _C_o_n_c_e_p_t = LocalFunctionWrapperInterface; │ │ │ │ -61 │ │ │ │ -63 template │ │ │ │ -64 using Model = LocalFunctionWrapperImplementation; │ │ │ │ -65 }; │ │ │ │ -66} │ │ │ │ -67 │ │ │ │ -68 │ │ │ │ +41 │ │ │ │ +42 │ │ │ │ +59template │ │ │ │ +_6_0class _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n │ │ │ │ +61 : public _L_e_a_f_P_r_e_B_a_s_i_s_M_i_x_i_n> │ │ │ │ +62{ │ │ │ │ +63 static const int gridDim = GV::dimension; │ │ │ │ +64 │ │ │ │ +65public: │ │ │ │ +66 │ │ │ │ +_6_8 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ 69 │ │ │ │ -90template class │ │ │ │ -DerivativeTraits, size_t bufferSize> │ │ │ │ -_9_1class _L_o_c_a_l_F_u_n_c_t_i_o_n< Range(Domain), LocalContext, DerivativeTraits, │ │ │ │ -bufferSize> : │ │ │ │ -92 public _T_y_p_e_E_r_a_s_u_r_e_B_a_s_e< │ │ │ │ -93 typename Imp::LocalFunctionTraits::Concept, │ │ │ │ -94 Imp::LocalFunctionTraits::template Model> │ │ │ │ -95{ │ │ │ │ -96 using Traits = Imp::LocalFunctionTraits; │ │ │ │ -97 │ │ │ │ -98 using Base = _T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_<_t_y_p_e_n_a_m_e_ _T_r_a_i_t_s_:_:_C_o_n_c_e_p_t_,_ _T_r_a_i_t_s_:_:_t_e_m_p_l_a_t_e │ │ │ │ -_M_o_d_e_l_>; │ │ │ │ +_7_1 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ +72 │ │ │ │ +_7_4 _L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n(const _G_r_i_d_V_i_e_w& gv, Dune::MCMGLayout layout) : │ │ │ │ +75 _g_r_i_d_V_i_e_w__(gv), │ │ │ │ +76 _m_a_p_p_e_r__(_g_r_i_d_V_i_e_w__, std::move(layout)) │ │ │ │ +77 {} │ │ │ │ +78 │ │ │ │ +_8_0 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ +81 { │ │ │ │ +82 // Determine upper bound for node size by traversing │ │ │ │ +83 // the layout for all element types in the grid │ │ │ │ +84 _m_a_x_N_o_d_e_S_i_z_e__ = 0; │ │ │ │ +85 for(const GeometryType& elementType : _g_r_i_d_V_i_e_w__.indexSet().types(0)) │ │ │ │ +86 { │ │ │ │ +87 auto referenceElement = Dune::referenceElement │ │ │ │ +(elementType); │ │ │ │ +88 for(auto codim : Dune::range(gridDim+1)) │ │ │ │ +89 for(auto i : Dune::range(referenceElement.size(codim))) │ │ │ │ +90 _m_a_x_N_o_d_e_S_i_z_e__ += _m_a_p_p_e_r__.layout()(referenceElement.type(i, codim), gridDim); │ │ │ │ +91 } │ │ │ │ +92 } │ │ │ │ +93 │ │ │ │ +_9_5 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ +96 { │ │ │ │ +97 return _g_r_i_d_V_i_e_w__; │ │ │ │ +98 } │ │ │ │ 99 │ │ │ │ -100 using DerivativeInterface = typename Traits::DerivativeInterface; │ │ │ │ -101 │ │ │ │ -102public: │ │ │ │ -103 │ │ │ │ -115 template = 0 > │ │ │ │ -_1_1_6 _L_o_c_a_l_F_u_n_c_t_i_o_n(F&& f) : │ │ │ │ -117 Base(std::forward(f)) │ │ │ │ -118 { │ │ │ │ -119 static_assert(_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_L_o_c_a_l_F_u_n_c_t_i_o_n_<_F_,_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ -_L_o_c_a_l_C_o_n_t_e_x_t_>(), "Trying to construct a LocalFunction from type that does not │ │ │ │ -model the LocalFunction concept"); │ │ │ │ -120 } │ │ │ │ -121 │ │ │ │ -_1_2_2 _L_o_c_a_l_F_u_n_c_t_i_o_n() = default; │ │ │ │ -123 │ │ │ │ -_1_2_7 Range operator() (const Domain& x) const │ │ │ │ -128 { │ │ │ │ -129 return this->_a_s_I_n_t_e_r_f_a_c_e().operator()(x); │ │ │ │ -130 } │ │ │ │ -131 │ │ │ │ -_1_3_9 friend DerivativeInterface _d_e_r_i_v_a_t_i_v_e(const _L_o_c_a_l_F_u_n_c_t_i_o_n& t) │ │ │ │ -140 { │ │ │ │ -141 return t.asInterface().derivative(); │ │ │ │ -142 } │ │ │ │ -143 │ │ │ │ -_1_5_0 void _b_i_n_d(const LocalContext& context) │ │ │ │ -151 { │ │ │ │ -152 this->_a_s_I_n_t_e_r_f_a_c_e().bind(context); │ │ │ │ -153 } │ │ │ │ -154 │ │ │ │ -_1_5_8 void _u_n_b_i_n_d() │ │ │ │ -159 { │ │ │ │ -160 this->_a_s_I_n_t_e_r_f_a_c_e().unbind(); │ │ │ │ -161 } │ │ │ │ -162 │ │ │ │ -_1_6_5 bool _b_o_u_n_d() const │ │ │ │ -166 { │ │ │ │ -167 return this->_a_s_I_n_t_e_r_f_a_c_e().bound(); │ │ │ │ -168 } │ │ │ │ -169 │ │ │ │ -_1_7_3 const LocalContext& _l_o_c_a_l_C_o_n_t_e_x_t() const │ │ │ │ -174 { │ │ │ │ -175 return this->_a_s_I_n_t_e_r_f_a_c_e().localContext(); │ │ │ │ -176 } │ │ │ │ -177}; │ │ │ │ -178 │ │ │ │ -179 │ │ │ │ -180 │ │ │ │ -181}} // namespace Dune::Functions │ │ │ │ -182 │ │ │ │ -183 │ │ │ │ -184 │ │ │ │ -185#endif // DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH │ │ │ │ -_t_y_p_e_e_r_a_s_u_r_e_._h_h │ │ │ │ -_l_o_c_a_l_f_u_n_c_t_i_o_n___i_m_p_._h_h │ │ │ │ -_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h │ │ │ │ -_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h │ │ │ │ -_d_e_f_a_u_l_t_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -static constexpr bool isLocalFunction() │ │ │ │ -Check if F models the LocalFunction concept with given signature and local │ │ │ │ -context. │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:170 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _L_o_c_a_l_C_o_n_t_e_x_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_, │ │ │ │ -_b_u_f_f_e_r_S_i_z_e_ _>_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ -friend DerivativeInterface derivative(const LocalFunction &t) │ │ │ │ -Get derivative of wrapped function. │ │ │ │ -DDeeffiinniittiioonn localfunction.hh:139 │ │ │ │ -_D_u_n_e │ │ │ │ -DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ +_1_0_1 void _u_p_d_a_t_e(const _G_r_i_d_V_i_e_w& gv) │ │ │ │ +102 { │ │ │ │ +103 _g_r_i_d_V_i_e_w__ = gv; │ │ │ │ +104 _m_a_p_p_e_r__.update(_g_r_i_d_V_i_e_w__); │ │ │ │ +105 } │ │ │ │ +106 │ │ │ │ +_1_0_8 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ +109 { │ │ │ │ +110 return _m_a_p_p_e_r__.size(); │ │ │ │ +111 } │ │ │ │ +112 │ │ │ │ +_1_1_4 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ +115 { │ │ │ │ +116 return _m_a_x_N_o_d_e_S_i_z_e__; │ │ │ │ +117 } │ │ │ │ +118 │ │ │ │ +120 template │ │ │ │ +_1_2_1 It _i_n_d_i_c_e_s(const Node& node, It it) const │ │ │ │ +122 { │ │ │ │ +123 for(const auto& globalIndex : _s_u_b_I_n_d_e_x_R_a_n_g_e(_m_a_p_p_e_r__, node.element(), │ │ │ │ +node.finiteElement().localCoefficients())) │ │ │ │ +124 { │ │ │ │ +125 *it = {{ (_s_i_z_e___t_y_p_e)globalIndex }}; │ │ │ │ +126 ++it; │ │ │ │ +127 } │ │ │ │ +128 return it; │ │ │ │ +129 } │ │ │ │ +130 │ │ │ │ +131protected: │ │ │ │ +_1_3_2 _G_r_i_d_V_i_e_w _g_r_i_d_V_i_e_w__; │ │ │ │ +_1_3_3 Dune::MultipleCodimMultipleGeomTypeMapper _m_a_p_p_e_r__; │ │ │ │ +_1_3_4 std::size_t _m_a_x_N_o_d_e_S_i_z_e__; │ │ │ │ +135}; │ │ │ │ +136 │ │ │ │ +137 │ │ │ │ +138 │ │ │ │ +139} // end namespace Dune::Functions │ │ │ │ +140 │ │ │ │ +141#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LEAFPREBASISMAPPERMIXIN_HH │ │ │ │ +_l_e_a_f_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t │ │ │ │ -DDeeffiinniittiioonn backends/concepts.hh:17 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ -Default implementation for derivative traits. │ │ │ │ -DDeeffiinniittiioonn defaultderivativetraits.hh:41 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -DDeeffiinniittiioonn localfunction.hh:34 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _L_o_c_a_l_C_o_n_t_e_x_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_, │ │ │ │ -_b_u_f_f_e_r_S_i_z_e_ _>_:_:_l_o_c_a_l_C_o_n_t_e_x_t │ │ │ │ -const LocalContext & localContext() const │ │ │ │ -Obtain local context this LocalFunction is bound to. │ │ │ │ -DDeeffiinniittiioonn localfunction.hh:173 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _L_o_c_a_l_C_o_n_t_e_x_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_, │ │ │ │ -_b_u_f_f_e_r_S_i_z_e_ _>_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -LocalFunction(F &&f) │ │ │ │ -Construct from function. │ │ │ │ -DDeeffiinniittiioonn localfunction.hh:116 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _L_o_c_a_l_C_o_n_t_e_x_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_, │ │ │ │ -_b_u_f_f_e_r_S_i_z_e_ _>_:_:_u_n_b_i_n_d │ │ │ │ -void unbind() │ │ │ │ -Unbind from local context. │ │ │ │ -DDeeffiinniittiioonn localfunction.hh:158 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _L_o_c_a_l_C_o_n_t_e_x_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_, │ │ │ │ -_b_u_f_f_e_r_S_i_z_e_ _>_:_:_b_o_u_n_d │ │ │ │ -bool bound() const │ │ │ │ -Return if the local function is bound to a grid element. │ │ │ │ -DDeeffiinniittiioonn localfunction.hh:165 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _L_o_c_a_l_C_o_n_t_e_x_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_, │ │ │ │ -_b_u_f_f_e_r_S_i_z_e_ _>_:_:_b_i_n_d │ │ │ │ -void bind(const LocalContext &context) │ │ │ │ -Bind function to a local context. │ │ │ │ -DDeeffiinniittiioonn localfunction.hh:150 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _L_o_c_a_l_C_o_n_t_e_x_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_, │ │ │ │ -_b_u_f_f_e_r_S_i_z_e_ _>_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -LocalFunction()=default │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_<_ _I_m_p_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_T_r_a_i_t_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ -_L_o_c_a_l_C_o_n_t_e_x_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_ _>_:_:_C_o_n_c_e_p_t_,_ _I_m_p_:_: │ │ │ │ -_L_o_c_a_l_F_u_n_c_t_i_o_n_T_r_a_i_t_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _L_o_c_a_l_C_o_n_t_e_x_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e │ │ │ │ -_>_:_:_t_e_m_p_l_a_t_e_ _M_o_d_e_l_ _>_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e │ │ │ │ -TypeErasureBase(T &&t) │ │ │ │ -DDeeffiinniittiioonn typeerasure.hh:174 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_y_p_e_E_r_a_s_u_r_e_B_a_s_e_<_ _I_m_p_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_T_r_a_i_t_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ -_L_o_c_a_l_C_o_n_t_e_x_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e_ _>_:_:_C_o_n_c_e_p_t_,_ _I_m_p_:_: │ │ │ │ -_L_o_c_a_l_F_u_n_c_t_i_o_n_T_r_a_i_t_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _L_o_c_a_l_C_o_n_t_e_x_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _b_u_f_f_e_r_S_i_z_e │ │ │ │ -_>_:_:_t_e_m_p_l_a_t_e_ _M_o_d_e_l_ _>_:_:_a_s_I_n_t_e_r_f_a_c_e │ │ │ │ -Imp::LocalFunctionTraits< Range(Domain), LocalContext, DerivativeTraits, │ │ │ │ -bufferSize >::Concept & asInterface() │ │ │ │ -DDeeffiinniittiioonn typeerasure.hh:182 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_s_u_b_I_n_d_e_x_R_a_n_g_e │ │ │ │ +auto subIndexRange(const Dune::MultipleCodimMultipleGeomTypeMapper< GridView > │ │ │ │ +&mapper, const typename GridView::template Codim< 0 >::Entity &element, const │ │ │ │ +LocalCoefficients &localCoefficients) │ │ │ │ +DDeeffiinniittiioonn leafprebasismappermixin.hh:31 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_g_r_i_d_V_i_e_w │ │ │ │ +const GridView & gridView() const │ │ │ │ +Export the stored GridView. │ │ │ │ +DDeeffiinniittiioonn leafprebasismappermixin.hh:95 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ +size_type dimension() const │ │ │ │ +Return total number of basis functions. │ │ │ │ +DDeeffiinniittiioonn leafprebasismappermixin.hh:108 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_m_a_x_N_o_d_e_S_i_z_e__ │ │ │ │ +std::size_t maxNodeSize_ │ │ │ │ +DDeeffiinniittiioonn leafprebasismappermixin.hh:134 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_m_a_p_p_e_r__ │ │ │ │ +Dune::MultipleCodimMultipleGeomTypeMapper< GridView > mapper_ │ │ │ │ +DDeeffiinniittiioonn leafprebasismappermixin.hh:133 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_s_i_z_e___t_y_p_e │ │ │ │ +std::size_t size_type │ │ │ │ +Type used for index digits. │ │ │ │ +DDeeffiinniittiioonn leafprebasismappermixin.hh:71 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_u_p_d_a_t_e │ │ │ │ +void update(const GridView &gv) │ │ │ │ +Update the stored GridView. │ │ │ │ +DDeeffiinniittiioonn leafprebasismappermixin.hh:101 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n │ │ │ │ +LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout) │ │ │ │ +Construct from GridView and local DOF layout. │ │ │ │ +DDeeffiinniittiioonn leafprebasismappermixin.hh:74 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_G_r_i_d_V_i_e_w │ │ │ │ +GV GridView │ │ │ │ +Type of the associated GridView. │ │ │ │ +DDeeffiinniittiioonn leafprebasismappermixin.hh:68 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_m_a_x_N_o_d_e_S_i_z_e │ │ │ │ +size_type maxNodeSize() const │ │ │ │ +Return maximal number of basis functions per element. │ │ │ │ +DDeeffiinniittiioonn leafprebasismappermixin.hh:114 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_g_r_i_d_V_i_e_w__ │ │ │ │ +GridView gridView_ │ │ │ │ +DDeeffiinniittiioonn leafprebasismappermixin.hh:132 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ +void initializeIndices() │ │ │ │ +Initialize the global index information. │ │ │ │ +DDeeffiinniittiioonn leafprebasismappermixin.hh:80 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_a_p_p_e_r_M_i_x_i_n_:_:_i_n_d_i_c_e_s │ │ │ │ +It indices(const Node &node, It it) const │ │ │ │ +Fill cache with global indices of DOFs associated to the given bound node. │ │ │ │ +DDeeffiinniittiioonn leafprebasismappermixin.hh:121 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_e_a_f_P_r_e_B_a_s_i_s_M_i_x_i_n │ │ │ │ +A generic MixIn class for PreBasis. │ │ │ │ +DDeeffiinniittiioonn leafprebasismixin.hh:36 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _l_o_c_a_l_f_u_n_c_t_i_o_n_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00236.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: interfaces.hh File Reference │ │ │ +Dune-Functions: boundarydofs.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,43 +88,51 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
interfaces.hh File Reference
│ │ │ +
boundarydofs.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <type_traits>
│ │ │ +
#include <utility>
│ │ │ +#include <dune/functions/functionspacebases/subentitydofs.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ -

│ │ │ -Classes

class  Dune::Functions::PolymorphicType< Interface >
 Base class with polymorphic type boiler plate code. More...
│ │ │ │ │ │ │ │ │ │ │ │ +

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ +Functions

template<class Basis, class F, decltype(std::declval< std::decay_t< F > >()(0, std::declval< typename Basis::LocalView >(), std::declval< typename Basis::GridView::Intersection >()), 0) = 0>
void Dune::Functions::forEachBoundaryDOF (const Basis &basis, F &&f)
 Loop over all DOFs on the boundary.
template<class Basis, class F, decltype(std::declval< std::decay_t< F > >()(0, std::declval< typename Basis::LocalView >()), 0) = 0>
void Dune::Functions::forEachBoundaryDOF (const Basis &basis, F &&f)
 Loop over all DOFs on the boundary.
template<class Basis, class F, decltype(std::declval< std::decay_t< F > >()(std::declval< typename Basis::MultiIndex >()), 0) = 0>
void Dune::Functions::forEachBoundaryDOF (const Basis &basis, F &&f)
 Loop over all DOFs on the boundary.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,18 +1,30 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -interfaces.hh File Reference │ │ │ │ -#include │ │ │ │ +boundarydofs.hh File Reference │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_s_u_b_e_n_t_i_t_y_d_o_f_s_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ -CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_T_y_p_e_<_ _I_n_t_e_r_f_a_c_e_ _> │ │ │ │ -  Base class with polymorphic type boiler plate code. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ +FFuunnccttiioonnss │ │ │ │ +template >()(0, │ │ │ │ +std::declval< typename Basis::LocalView >(), std::declval< typename Basis:: │ │ │ │ +GridView::Intersection >()), 0) = 0> │ │ │ │ +void  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_o_r_E_a_c_h_B_o_u_n_d_a_r_y_D_O_F (const Basis &basis, F &&f) │ │ │ │ +  Loop over all DOFs on the boundary. │ │ │ │ +template >()(0, │ │ │ │ +std::declval< typename Basis::LocalView >()), 0) = 0> │ │ │ │ +void  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_o_r_E_a_c_h_B_o_u_n_d_a_r_y_D_O_F (const Basis &basis, F &&f) │ │ │ │ +  Loop over all DOFs on the boundary. │ │ │ │ +template >() │ │ │ │ +(std::declval< typename Basis::MultiIndex >()), 0) = 0> │ │ │ │ +void  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_o_r_E_a_c_h_B_o_u_n_d_a_r_y_D_O_F (const Basis &basis, F &&f) │ │ │ │ +  Loop over all DOFs on the boundary. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _i_n_t_e_r_f_a_c_e_s_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _b_o_u_n_d_a_r_y_d_o_f_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00236_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: interfaces.hh Source File │ │ │ +Dune-Functions: boundarydofs.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,70 +88,115 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
interfaces.hh
│ │ │ +
boundarydofs.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_COMMON_INTERFACES_HH
│ │ │ -
8#define DUNE_FUNCTIONS_COMMON_INTERFACES_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH
│ │ │ +
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH
│ │ │
9
│ │ │ -
10#include <type_traits>
│ │ │ +
10#include <utility>
│ │ │
11
│ │ │ -
12
│ │ │ -
13namespace Dune {
│ │ │ -
14namespace Functions {
│ │ │ -
15
│ │ │ + │ │ │ +
13
│ │ │ +
14namespace Dune {
│ │ │ +
15namespace Functions {
│ │ │
16
│ │ │ -
17
│ │ │ -
27template<class Interface>
│ │ │ -
│ │ │ - │ │ │ -
29{
│ │ │ -
30public:
│ │ │ -
31
│ │ │ -
│ │ │ - │ │ │ -
34 {}
│ │ │ -
│ │ │ -
35
│ │ │ -
44 virtual Interface* clone() const = 0;
│ │ │ -
45
│ │ │ -
55 virtual Interface* clone(void* buffer) const = 0;
│ │ │ -
56
│ │ │ -
66 virtual Interface* move(void* buffer) = 0;
│ │ │ -
67};
│ │ │ -
│ │ │ -
68
│ │ │ -
69
│ │ │ -
70
│ │ │ -
71}} // namespace Dune::Functions
│ │ │ -
72
│ │ │ -
73#endif // DUNE_FUNCTIONS_COMMON_EXTENDED_CLONEABLE_HH
│ │ │ +
17
│ │ │ +
18
│ │ │ +
38template<class Basis, class F,
│ │ │ +
39 decltype(std::declval<std::decay_t<F>>()(0, std::declval<typename Basis::LocalView>(),std::declval<typename Basis::GridView::Intersection>()), 0) = 0>
│ │ │ +
│ │ │ +
40void forEachBoundaryDOF(const Basis& basis, F&& f)
│ │ │ +
41{
│ │ │ +
42 auto localView = basis.localView();
│ │ │ +
43 auto seDOFs = subEntityDOFs(basis);
│ │ │ +
44 const auto& gridView = basis.gridView();
│ │ │ +
45 for(auto&& element : elements(gridView))
│ │ │ +
46 if (element.hasBoundaryIntersections())
│ │ │ +
47 {
│ │ │ +
48 localView.bind(element);
│ │ │ +
49 for(const auto& intersection: intersections(gridView, element))
│ │ │ +
50 if (intersection.boundary())
│ │ │ +
51 for(auto localIndex: seDOFs.bind(localView,intersection))
│ │ │ +
52 f(localIndex, localView, intersection);
│ │ │ +
53 }
│ │ │ +
54}
│ │ │ +
│ │ │ +
55
│ │ │ +
56
│ │ │ +
57
│ │ │ +
75template<class Basis, class F,
│ │ │ +
76 decltype(std::declval<std::decay_t<F>>()(0, std::declval<typename Basis::LocalView>()),0) = 0>
│ │ │ +
│ │ │ +
77void forEachBoundaryDOF(const Basis& basis, F&& f)
│ │ │ +
78{
│ │ │ +
79 auto localView = basis.localView();
│ │ │ +
80 auto seDOFs = subEntityDOFs(basis);
│ │ │ +
81 const auto& gridView = basis.gridView();
│ │ │ +
82 for(auto&& element : elements(gridView))
│ │ │ +
83 if (element.hasBoundaryIntersections())
│ │ │ +
84 {
│ │ │ +
85 localView.bind(element);
│ │ │ +
86 for(const auto& intersection: intersections(gridView, element))
│ │ │ +
87 if (intersection.boundary())
│ │ │ +
88 for(auto localIndex: seDOFs.bind(localView,intersection))
│ │ │ +
89 f(localIndex, localView);
│ │ │ +
90 }
│ │ │ +
91}
│ │ │ +
│ │ │ +
92
│ │ │ +
93
│ │ │ +
94
│ │ │ +
111template<class Basis, class F,
│ │ │ +
112 decltype(std::declval<std::decay_t<F>>()(std::declval<typename Basis::MultiIndex>()),0) = 0>
│ │ │ +
│ │ │ +
113void forEachBoundaryDOF(const Basis& basis, F&& f)
│ │ │ +
114{
│ │ │ +
115 auto localView = basis.localView();
│ │ │ +
116 auto seDOFs = subEntityDOFs(basis);
│ │ │ +
117 const auto& gridView = basis.gridView();
│ │ │ +
118 for(auto&& element : elements(gridView))
│ │ │ +
119 if (element.hasBoundaryIntersections())
│ │ │ +
120 {
│ │ │ +
121 localView.bind(element);
│ │ │ +
122 for(const auto& intersection: intersections(gridView, element))
│ │ │ +
123 if (intersection.boundary())
│ │ │ +
124 for(auto localIndex: seDOFs.bind(localView,intersection))
│ │ │ +
125 f(localView.index(localIndex));
│ │ │ +
126 }
│ │ │ +
127}
│ │ │ +
│ │ │ +
128
│ │ │ +
129
│ │ │ +
130
│ │ │ +
131} // namespace Functions
│ │ │ +
132} // namespace Dune
│ │ │ +
133
│ │ │ +
134#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH
│ │ │ + │ │ │ +
auto subEntityDOFs(const T &)
Create SubEntityDOFs object.
Definition subentitydofs.hh:167
│ │ │ +
void forEachBoundaryDOF(const Basis &basis, F &&f)
Loop over all DOFs on the boundary.
Definition boundarydofs.hh:40
│ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
Base class with polymorphic type boiler plate code.
Definition interfaces.hh:29
│ │ │ -
virtual Interface * clone(void *buffer) const =0
Clones the object into buffer.
│ │ │ -
virtual Interface * clone() const =0
Clones the object.
│ │ │ -
virtual Interface * move(void *buffer)=0
Move object into buffer.
│ │ │ -
virtual ~PolymorphicType()
Destructor.
Definition interfaces.hh:33
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,70 +1,111 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -interfaces.hh │ │ │ │ +boundarydofs.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_COMMON_INTERFACES_HH │ │ │ │ -8#define DUNE_FUNCTIONS_COMMON_INTERFACES_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH │ │ │ │ +8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ +10#include │ │ │ │ 11 │ │ │ │ -12 │ │ │ │ -13namespace _D_u_n_e { │ │ │ │ -14namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -15 │ │ │ │ +12#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_s_u_b_e_n_t_i_t_y_d_o_f_s_._h_h> │ │ │ │ +13 │ │ │ │ +14namespace _D_u_n_e { │ │ │ │ +15namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ 16 │ │ │ │ 17 │ │ │ │ -27template │ │ │ │ -_2_8class _P_o_l_y_m_o_r_p_h_i_c_T_y_p_e │ │ │ │ -29{ │ │ │ │ -30public: │ │ │ │ -31 │ │ │ │ -_3_3 virtual _~_P_o_l_y_m_o_r_p_h_i_c_T_y_p_e() │ │ │ │ -34 {} │ │ │ │ -35 │ │ │ │ -_4_4 virtual Interface* _c_l_o_n_e() const = 0; │ │ │ │ -45 │ │ │ │ -_5_5 virtual Interface* _c_l_o_n_e(void* buffer) const = 0; │ │ │ │ +18 │ │ │ │ +38template>()(0, std::declval(),std::declval()), 0) = 0> │ │ │ │ +_4_0void _f_o_r_E_a_c_h_B_o_u_n_d_a_r_y_D_O_F(const Basis& basis, F&& f) │ │ │ │ +41{ │ │ │ │ +42 auto localView = basis.localView(); │ │ │ │ +43 auto seDOFs = _s_u_b_E_n_t_i_t_y_D_O_F_s(basis); │ │ │ │ +44 const auto& gridView = basis.gridView(); │ │ │ │ +45 for(auto&& element : elements(gridView)) │ │ │ │ +46 if (element.hasBoundaryIntersections()) │ │ │ │ +47 { │ │ │ │ +48 localView.bind(element); │ │ │ │ +49 for(const auto& intersection: intersections(gridView, element)) │ │ │ │ +50 if (intersection.boundary()) │ │ │ │ +51 for(auto localIndex: seDOFs.bind(localView,intersection)) │ │ │ │ +52 f(localIndex, localView, intersection); │ │ │ │ +53 } │ │ │ │ +54} │ │ │ │ +55 │ │ │ │ 56 │ │ │ │ -_6_6 virtual Interface* _m_o_v_e(void* buffer) = 0; │ │ │ │ -67}; │ │ │ │ -68 │ │ │ │ -69 │ │ │ │ -70 │ │ │ │ -71}} // namespace Dune::Functions │ │ │ │ -72 │ │ │ │ -73#endif // DUNE_FUNCTIONS_COMMON_EXTENDED_CLONEABLE_HH │ │ │ │ +57 │ │ │ │ +75template>()(0, std::declval()),0) = 0> │ │ │ │ +_7_7void _f_o_r_E_a_c_h_B_o_u_n_d_a_r_y_D_O_F(const Basis& basis, F&& f) │ │ │ │ +78{ │ │ │ │ +79 auto localView = basis.localView(); │ │ │ │ +80 auto seDOFs = _s_u_b_E_n_t_i_t_y_D_O_F_s(basis); │ │ │ │ +81 const auto& gridView = basis.gridView(); │ │ │ │ +82 for(auto&& element : elements(gridView)) │ │ │ │ +83 if (element.hasBoundaryIntersections()) │ │ │ │ +84 { │ │ │ │ +85 localView.bind(element); │ │ │ │ +86 for(const auto& intersection: intersections(gridView, element)) │ │ │ │ +87 if (intersection.boundary()) │ │ │ │ +88 for(auto localIndex: seDOFs.bind(localView,intersection)) │ │ │ │ +89 f(localIndex, localView); │ │ │ │ +90 } │ │ │ │ +91} │ │ │ │ +92 │ │ │ │ +93 │ │ │ │ +94 │ │ │ │ +111template>()(std::declval()),0) = 0> │ │ │ │ +_1_1_3void _f_o_r_E_a_c_h_B_o_u_n_d_a_r_y_D_O_F(const Basis& basis, F&& f) │ │ │ │ +114{ │ │ │ │ +115 auto localView = basis.localView(); │ │ │ │ +116 auto seDOFs = _s_u_b_E_n_t_i_t_y_D_O_F_s(basis); │ │ │ │ +117 const auto& gridView = basis.gridView(); │ │ │ │ +118 for(auto&& element : elements(gridView)) │ │ │ │ +119 if (element.hasBoundaryIntersections()) │ │ │ │ +120 { │ │ │ │ +121 localView.bind(element); │ │ │ │ +122 for(const auto& intersection: intersections(gridView, element)) │ │ │ │ +123 if (intersection.boundary()) │ │ │ │ +124 for(auto localIndex: seDOFs.bind(localView,intersection)) │ │ │ │ +125 f(localView.index(localIndex)); │ │ │ │ +126 } │ │ │ │ +127} │ │ │ │ +128 │ │ │ │ +129 │ │ │ │ +130 │ │ │ │ +131} // namespace Functions │ │ │ │ +132} // namespace Dune │ │ │ │ +133 │ │ │ │ +134#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH │ │ │ │ +_s_u_b_e_n_t_i_t_y_d_o_f_s_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_s_u_b_E_n_t_i_t_y_D_O_F_s │ │ │ │ +auto subEntityDOFs(const T &) │ │ │ │ +Create SubEntityDOFs object. │ │ │ │ +DDeeffiinniittiioonn subentitydofs.hh:167 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_o_r_E_a_c_h_B_o_u_n_d_a_r_y_D_O_F │ │ │ │ +void forEachBoundaryDOF(const Basis &basis, F &&f) │ │ │ │ +Loop over all DOFs on the boundary. │ │ │ │ +DDeeffiinniittiioonn boundarydofs.hh:40 │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_T_y_p_e │ │ │ │ -Base class with polymorphic type boiler plate code. │ │ │ │ -DDeeffiinniittiioonn interfaces.hh:29 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_T_y_p_e_:_:_c_l_o_n_e │ │ │ │ -virtual Interface * clone(void *buffer) const =0 │ │ │ │ -Clones the object into buffer. │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_T_y_p_e_:_:_c_l_o_n_e │ │ │ │ -virtual Interface * clone() const =0 │ │ │ │ -Clones the object. │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_T_y_p_e_:_:_m_o_v_e │ │ │ │ -virtual Interface * move(void *buffer)=0 │ │ │ │ -Move object into buffer. │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_m_o_r_p_h_i_c_T_y_p_e_:_:_~_P_o_l_y_m_o_r_p_h_i_c_T_y_p_e │ │ │ │ -virtual ~PolymorphicType() │ │ │ │ -Destructor. │ │ │ │ -DDeeffiinniittiioonn interfaces.hh:33 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _i_n_t_e_r_f_a_c_e_s_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _b_o_u_n_d_a_r_y_d_o_f_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00239.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: indexaccess.hh File Reference │ │ │ +Dune-Functions: subspacelocalview.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,64 +88,46 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
indexaccess.hh File Reference
│ │ │ +
subspacelocalview.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <utility>
│ │ │ -#include <type_traits>
│ │ │ -#include <dune/common/typetraits.hh>
│ │ │ +
#include <tuple>
│ │ │ #include <dune/common/concept.hh>
│ │ │ -#include <dune/common/hybridutilities.hh>
│ │ │ -#include <dune/functions/common/utility.hh>
│ │ │ +#include <dune/common/typetree/childaccess.hh>
│ │ │ +#include <dune/functions/functionspacebases/concepts.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ + │ │ │ + │ │ │ + │ │ │ +

│ │ │ +Classes

class  Dune::Functions::SubspaceLocalView< RLV, PP >
 The restriction of a finite element basis to a single element. More...
│ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │

│ │ │ -Functions

template<class C, class I, class F, std::enable_if_t< Dune::models< Imp::Concept::HasDynamicIndexAccess< I >, C >(), int > = 0>
auto Dune::Functions::hybridIndexAccess (C &&c, const I &i, F &&f) -> decltype(f(c[i]))
 Provide operator[] index-access for containers.
template<class C, class I, class F, std::enable_if_t< not Dune::models< Imp::Concept::HasDynamicIndexAccess< I >, C >(), int > = 0>
decltype(auto) Dune::Functions::hybridIndexAccess (C &&c, const I &i, F &&f)
 Provide operator[] index-access for containers.
template<class Result, class C, class MultiIndex>
Result Dune::Functions::hybridMultiIndexAccess (C &&c, const MultiIndex &index)
 Provide multi-index access by chaining operator[].
template<class C, class MultiIndex, class IsFinal>
constexpr decltype(auto) Dune::Functions::resolveDynamicMultiIndex (C &&c, const MultiIndex &multiIndex, const IsFinal &isFinal)
 Provide multi-index access by chaining operator[].
template<class C, class MultiIndex>
constexpr decltype(auto) Dune::Functions::resolveDynamicMultiIndex (C &&c, const MultiIndex &multiIndex)
 Provide multi-index access by chaining operator[].
template<class C, class MultiIndex>
constexpr decltype(auto) Dune::Functions::resolveStaticMultiIndex (C &&c, const MultiIndex &multiIndex)
 Provide multi-index access by chaining operator[].
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,47 +1,21 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -indexaccess.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ +subspacelocalview.hh File Reference │ │ │ │ +#include │ │ │ │ #include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ +CCllaasssseess │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_<_ _R_L_V_,_ _P_P_ _> │ │ │ │ +  The restriction of a finite element basis to a single element. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -FFuunnccttiioonnss │ │ │ │ -template, C >(), int > = 0> │ │ │ │ - auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_h_y_b_r_i_d_I_n_d_e_x_A_c_c_e_s_s (C &&c, const I │ │ │ │ - &i, F &&f) -> decltype(f(c[i])) │ │ │ │ -  Provide operator[] index-access for containers. │ │ │ │ -template, C >(), int > = 0> │ │ │ │ - decltype(auto)  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_h_y_b_r_i_d_I_n_d_e_x_A_c_c_e_s_s (C &&c, const I │ │ │ │ - &i, F &&f) │ │ │ │ -  Provide operator[] index-access for containers. │ │ │ │ -template │ │ │ │ - Result  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_h_y_b_r_i_d_M_u_l_t_i_I_n_d_e_x_A_c_c_e_s_s (C &&c, const │ │ │ │ - MultiIndex &index) │ │ │ │ -  Provide multi-index access by chaining operator[]. │ │ │ │ -template │ │ │ │ -constexpr decltype(auto)  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_r_e_s_o_l_v_e_D_y_n_a_m_i_c_M_u_l_t_i_I_n_d_e_x (C &&c, │ │ │ │ - const MultiIndex &multiIndex, const IsFinal &isFinal) │ │ │ │ -  Provide multi-index access by chaining operator[]. │ │ │ │ -template │ │ │ │ -constexpr decltype(auto)  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_r_e_s_o_l_v_e_D_y_n_a_m_i_c_M_u_l_t_i_I_n_d_e_x (C &&c, │ │ │ │ - const MultiIndex &multiIndex) │ │ │ │ -  Provide multi-index access by chaining operator[]. │ │ │ │ -template │ │ │ │ -constexpr decltype(auto)  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_r_e_s_o_l_v_e_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x (C &&c, │ │ │ │ - const MultiIndex &multiIndex) │ │ │ │ -  Provide multi-index access by chaining operator[]. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _i_n_d_e_x_a_c_c_e_s_s_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _s_u_b_s_p_a_c_e_l_o_c_a_l_v_i_e_w_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00239.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,8 +1,3 @@ │ │ │ │ var a00239 = [ │ │ │ │ - ["Dune::Functions::hybridIndexAccess", "a00314.html#gaf9258d92263effe55f9201af1ba2532e", null], │ │ │ │ - ["Dune::Functions::hybridIndexAccess", "a00314.html#ga2226fe3a86eb176df27c9801a98a10ae", null], │ │ │ │ - ["Dune::Functions::hybridMultiIndexAccess", "a00314.html#gabd5106817636cc5542dc4e9a1817551b", null], │ │ │ │ - ["Dune::Functions::resolveDynamicMultiIndex", "a00314.html#ga89fbdd009241b14e86b4fff7ba208a04", null], │ │ │ │ - ["Dune::Functions::resolveDynamicMultiIndex", "a00314.html#ga9aaec884c080483fea267d1098f81590", null], │ │ │ │ - ["Dune::Functions::resolveStaticMultiIndex", "a00314.html#ga4cc6af2842348271c242c048e0411637", null] │ │ │ │ + ["Dune::Functions::SubspaceLocalView< RLV, PP >", "a02146.html", "a02146"] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00239_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: indexaccess.hh Source File │ │ │ +Dune-Functions: subspacelocalview.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,345 +88,195 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
indexaccess.hh
│ │ │ +
subspacelocalview.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH
│ │ │ -
8#define DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH
│ │ │ +
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH
│ │ │
9
│ │ │
10
│ │ │ -
11#include <utility>
│ │ │ -
12#include <type_traits>
│ │ │ -
13
│ │ │ -
14#include <dune/common/typetraits.hh>
│ │ │ -
15#include <dune/common/concept.hh>
│ │ │ -
16#include <dune/common/hybridutilities.hh>
│ │ │ -
17
│ │ │ - │ │ │ +
11#include <tuple>
│ │ │ +
12
│ │ │ +
13#include <dune/common/concept.hh>
│ │ │ +
14
│ │ │ +
15#include <dune/common/typetree/childaccess.hh>
│ │ │ +
16
│ │ │ + │ │ │ +
18
│ │ │
19
│ │ │
20
│ │ │ -
21
│ │ │ -
22namespace Dune {
│ │ │ -
23namespace Functions {
│ │ │ +
21namespace Dune {
│ │ │ +
22namespace Functions {
│ │ │ +
23
│ │ │
24
│ │ │
25
│ │ │ -
26namespace Imp {
│ │ │ -
27
│ │ │ -
28namespace Concept {
│ │ │ +
26template<class RB, class PP>
│ │ │ +
27class SubspaceBasis;
│ │ │ +
28
│ │ │
29
│ │ │ -
30template<class size_type>
│ │ │ -
31struct HasDynamicIndexAccess
│ │ │ -
32{
│ │ │ -
33 template<class C>
│ │ │ -
34 auto require(C&& c) -> decltype(
│ │ │ -
35 c[std::declval<size_type>()]
│ │ │ -
36 );
│ │ │ -
37};
│ │ │ +
30
│ │ │ +
32template<class RLV, class PP>
│ │ │ +
│ │ │ + │ │ │ +
34{
│ │ │ +
35 using PrefixPath = PP;
│ │ │ +
36
│ │ │ +
37public:
│ │ │
38
│ │ │ -
39struct HasStaticIndexAccess
│ │ │ -
40{
│ │ │ -
41 template<class C>
│ │ │ -
42 auto require(C&& c) -> decltype(
│ │ │ -
43 c[Dune::Indices::_0]
│ │ │ -
44 );
│ │ │ -
45};
│ │ │ -
46
│ │ │ -
47} // namespace Concept
│ │ │ -
48
│ │ │ -
49} // namespace Imp
│ │ │ -
50
│ │ │ -
51
│ │ │ +
39 using RootLocalView = RLV;
│ │ │ +
40
│ │ │ + │ │ │ +
43
│ │ │ + │ │ │ +
46
│ │ │ +
48 using Element = typename GridView::template Codim<0>::Entity;
│ │ │ +
49
│ │ │ +
51 using size_type = std::size_t;
│ │ │
52
│ │ │ -
65template<class C, class I, class F,
│ │ │ -
66 std::enable_if_t< Dune::models<Imp::Concept::HasDynamicIndexAccess<I>, C>(), int> = 0>
│ │ │ -
│ │ │ -
67auto hybridIndexAccess(C&& c, const I& i, F&& f)
│ │ │ -
68 -> decltype(f(c[i]))
│ │ │ -
69{
│ │ │ -
70 return f(c[i]);
│ │ │ -
71}
│ │ │ -
│ │ │ -
72
│ │ │ -
90template<class C, class I, class F,
│ │ │ -
91 std::enable_if_t< not Dune::models<Imp::Concept::HasDynamicIndexAccess<I>, C>(), int> = 0>
│ │ │ -
│ │ │ -
92decltype(auto) hybridIndexAccess(C&& c, const I& i, F&& f)
│ │ │ -
93{
│ │ │ -
94 using Size = decltype(Hybrid::size(c));
│ │ │ -
95 return Hybrid::switchCases(std::make_index_sequence<Size::value>(), i,
│ │ │ -
96 [&](const auto& ii) -> decltype(auto){
│ │ │ -
97 return f(c[ii]);
│ │ │ -
98 }, [&]() -> decltype(auto){
│ │ │ -
99 return f(c[Dune::Indices::_0]);
│ │ │ -
100 });
│ │ │ -
101}
│ │ │ -
│ │ │ -
102
│ │ │ -
103
│ │ │ -
104namespace Imp {
│ │ │ -
105
│ │ │ -
119 template<class Index, std::size_t offset=1>
│ │ │ -
120 class ShiftedDynamicMultiIndex
│ │ │ -
121 {
│ │ │ -
122 public:
│ │ │ -
123 ShiftedDynamicMultiIndex(const Index& index) :
│ │ │ -
124 index_(index)
│ │ │ -
125 {}
│ │ │ -
126
│ │ │ -
127 std::size_t operator[](std::size_t position) const
│ │ │ -
128 {
│ │ │ -
129 if (position<size())
│ │ │ -
130 return index_[position+offset];
│ │ │ -
131 else
│ │ │ -
132 return 0;
│ │ │ -
133 }
│ │ │ -
134
│ │ │ -
138 ShiftedDynamicMultiIndex<Index, offset+1> pop() const
│ │ │ -
139 {
│ │ │ -
140 return {index_};
│ │ │ -
141 }
│ │ │ -
142
│ │ │ -
143 std::size_t size() const
│ │ │ -
144 {
│ │ │ -
145 if (offset < index_.size())
│ │ │ -
146 return index_.size() - offset;
│ │ │ -
147 else
│ │ │ -
148 return 0;
│ │ │ -
149 }
│ │ │ -
150
│ │ │ -
151 const Index& originalIndex() const
│ │ │ -
152 {
│ │ │ -
153 return index_;
│ │ │ -
154 }
│ │ │ +
54 using RootTree = typename RootLocalView::Tree;
│ │ │ +
55
│ │ │ +
57 using Tree = typename TypeTree::ChildForTreePath<RootTree, PrefixPath>;
│ │ │ +
58
│ │ │ +
60 using MultiIndex = typename RootLocalView::MultiIndex;
│ │ │ +
61
│ │ │ +
│ │ │ +
63 SubspaceLocalView(const GlobalBasis& globalBasis, const PrefixPath& /*prefixPath*/) :
│ │ │ + │ │ │ +
65 rootLocalView_(globalBasis.rootBasis().localView())
│ │ │ +
66 {
│ │ │ +
67// static_assert(models<Concept::BasisTree<GridView>, Tree>(), "Tree type passed to SubspaceLocalView does not model the BasisNode concept.");
│ │ │ +
68 }
│ │ │ +
│ │ │ +
69
│ │ │ +
│ │ │ +
75 void bind(const Element& e)
│ │ │ +
76 {
│ │ │ +
77 rootLocalView_.bind(e);
│ │ │ +
78 }
│ │ │ +
│ │ │ +
79
│ │ │ +
│ │ │ +
84 const Element& element() const
│ │ │ +
85 {
│ │ │ +
86 return rootLocalView_.element();
│ │ │ +
87 }
│ │ │ +
│ │ │ +
88
│ │ │ +
│ │ │ +
93 void unbind()
│ │ │ +
94 {
│ │ │ +
95 rootLocalView_.unbind();
│ │ │ +
96 }
│ │ │ +
│ │ │ +
97
│ │ │ +
│ │ │ +
100 bool bound() const
│ │ │ +
101 {
│ │ │ +
102 return rootLocalView_.bound();
│ │ │ +
103 }
│ │ │ +
│ │ │ +
104
│ │ │ +
│ │ │ +
109 const Tree& tree() const
│ │ │ +
110 {
│ │ │ +
111 return TypeTree::child(rootLocalView_.tree(), globalBasis_->prefixPath());
│ │ │ +
112 }
│ │ │ +
│ │ │ +
113
│ │ │ +
│ │ │ + │ │ │ +
117 {
│ │ │ +
118 return rootLocalView_.size();
│ │ │ +
119 }
│ │ │ +
│ │ │ +
120
│ │ │ +
│ │ │ + │ │ │ +
128 {
│ │ │ +
129 return rootLocalView_.maxSize();
│ │ │ +
130 }
│ │ │ +
│ │ │ +
131
│ │ │ +
│ │ │ + │ │ │ +
134 {
│ │ │ +
135 return rootLocalView_.index(i);
│ │ │ +
136 }
│ │ │ +
│ │ │ +
137
│ │ │ +
│ │ │ + │ │ │ +
141 {
│ │ │ +
142 return *globalBasis_;
│ │ │ +
143 }
│ │ │ +
│ │ │ +
144
│ │ │ +
│ │ │ + │ │ │ +
146 {
│ │ │ +
147 return rootLocalView_;
│ │ │ +
148 }
│ │ │ +
│ │ │ +
149
│ │ │ +
150protected:
│ │ │ + │ │ │ + │ │ │ +
153};
│ │ │ +
│ │ │ +
154
│ │ │
155
│ │ │ -
156 private:
│ │ │ -
157 const Index& index_;
│ │ │ -
158 };
│ │ │ +
156
│ │ │ +
157} // end namespace Functions
│ │ │ +
158} // end namespace Dune
│ │ │
159
│ │ │ -
160 template<class Index, std::size_t offset=1>
│ │ │ -
161 class ShiftedStaticMultiIndex
│ │ │ -
162 {
│ │ │ -
163 public:
│ │ │ -
164 ShiftedStaticMultiIndex(const Index& index) :
│ │ │ -
165 index_(index)
│ │ │ -
166 {}
│ │ │ -
167
│ │ │ -
168 template<std::size_t i>
│ │ │ -
169 auto operator[](Dune::index_constant<i>) const
│ │ │ -
170 {
│ │ │ -
171 if constexpr (i<size()) {
│ │ │ -
172 return index_[Dune::index_constant<i+offset>{}];
│ │ │ -
173 } else {
│ │ │ -
174 return Dune::index_constant<0>{};
│ │ │ -
175 }
│ │ │ -
176 }
│ │ │ -
177
│ │ │ -
181 ShiftedStaticMultiIndex<Index, offset+1> pop() const
│ │ │ -
182 {
│ │ │ -
183 return {index_};
│ │ │ -
184 }
│ │ │ -
185
│ │ │ -
186 static constexpr std::size_t size()
│ │ │ -
187 {
│ │ │ -
188 auto fullSize = decltype(Hybrid::size(std::declval<Index>()))::value;
│ │ │ -
189 if (offset < fullSize)
│ │ │ -
190 return fullSize - offset;
│ │ │ -
191 else
│ │ │ -
192 return 0;
│ │ │ -
193 }
│ │ │ -
194
│ │ │ -
195 private:
│ │ │ -
196 const Index& index_;
│ │ │ -
197 };
│ │ │ -
198
│ │ │ -
204 template<std::size_t offset, class Index>
│ │ │ -
205 ShiftedDynamicMultiIndex<Index, offset> shiftedDynamicMultiIndex(const Index& index)
│ │ │ -
206 {
│ │ │ -
207 return {index};
│ │ │ -
208 }
│ │ │ -
209
│ │ │ -
218 template<std::size_t offset, class Index, std::size_t oldOffset>
│ │ │ -
219 ShiftedDynamicMultiIndex<Index, offset+oldOffset> shiftedDynamicMultiIndex(const ShiftedDynamicMultiIndex<Index, oldOffset>& index)
│ │ │ -
220 {
│ │ │ -
221 return {index.originalIndex()};
│ │ │ -
222 }
│ │ │ -
223
│ │ │ -
224 template<std::size_t offset, class Index>
│ │ │ -
225 ShiftedStaticMultiIndex<Index, offset> shiftedStaticMultiIndex(const Index& index)
│ │ │ -
226 {
│ │ │ -
227 return {index};
│ │ │ -
228 }
│ │ │ -
229
│ │ │ -
230} // namespace Imp
│ │ │ -
231
│ │ │ -
232
│ │ │ -
233
│ │ │ -
234
│ │ │ -
235namespace Imp {
│ │ │ -
236
│ │ │ -
237template<class Result, class Index>
│ │ │ -
238struct MultiIndexResolver
│ │ │ -
239{
│ │ │ -
240 MultiIndexResolver(const Index& index) :
│ │ │ -
241 index_(index)
│ │ │ -
242 {}
│ │ │ -
243
│ │ │ -
244 template<class C,
│ │ │ -
245 std::enable_if_t<not std::is_convertible_v<C&, Result>, int> = 0>
│ │ │ -
246 Result operator()(C&& c)
│ │ │ -
247 {
│ │ │ -
248 auto&& subIndex = Imp::shiftedDynamicMultiIndex<1>(index_);
│ │ │ -
249 auto&& subIndexResolver = MultiIndexResolver<Result, decltype(subIndex)>(subIndex);
│ │ │ -
250 return (Result)(hybridIndexAccess(c, index_[Dune::Indices::_0], subIndexResolver));
│ │ │ -
251 }
│ │ │ -
252
│ │ │ -
253 template<class C,
│ │ │ -
254 std::enable_if_t<std::is_convertible_v<C&, Result>, int> = 0>
│ │ │ -
255 Result operator()(C&& c)
│ │ │ -
256 {
│ │ │ -
257 return (Result)(std::forward<C>(c));
│ │ │ -
258 }
│ │ │ -
259
│ │ │ -
260 const Index& index_;
│ │ │ -
261};
│ │ │ -
262
│ │ │ -
263} // namespace Imp
│ │ │ -
264
│ │ │ -
265
│ │ │ -
266
│ │ │ -
285template<class Result, class C, class MultiIndex>
│ │ │ -
│ │ │ -
286Result hybridMultiIndexAccess(C&& c, const MultiIndex& index)
│ │ │ -
287{
│ │ │ -
288
│ │ │ -
289 Imp::MultiIndexResolver<Result, MultiIndex> multiIndexResolver(index);
│ │ │ -
290 return multiIndexResolver(c);
│ │ │ -
291}
│ │ │ -
│ │ │ -
292
│ │ │ -
293
│ │ │ -
294
│ │ │ -
295
│ │ │ -
296
│ │ │ -
297
│ │ │ -
298namespace Imp {
│ │ │ -
299
│ │ │ -
300 template<class C, class MultiIndex, class IsFinal>
│ │ │ -
301 constexpr decltype(auto) resolveDynamicMultiIndex(C&& c, const MultiIndex& multiIndex, const IsFinal& isFinal)
│ │ │ -
302 {
│ │ │ -
303 // If c is already considered final simply return it,
│ │ │ -
304 // else resolve the next multiIndex entry.
│ │ │ -
305 return Hybrid::ifElse(isFinal(c), [&, c = forwardCapture(std::forward<C>(c))](auto) -> decltype(auto) {
│ │ │ -
306 assert(multiIndex.size() == 0);
│ │ │ -
307 return c.forward();
│ │ │ -
308 }, [&](auto) -> decltype(auto) {
│ │ │ -
309 auto hasDynamicAccess = callableCheck([](auto&& cc) -> std::void_t<decltype(cc[0])> {});
│ │ │ -
310
│ │ │ -
311 // Split multiIndex into first entry and remaining ones.
│ │ │ -
312 auto i = multiIndex[0];
│ │ │ -
313 auto tail = multiIndex.pop();
│ │ │ -
314
│ │ │ -
315 // Resolve first multiIndex entry by c[multiIndex[0]] and
│ │ │ -
316 // continue resolving with the remaining remaining ones.
│ │ │ -
317 // If c has a dynamic operator[] this is straight forward.
│ │ │ -
318 // Else the dynamic multiIndex[0] has to be translated into
│ │ │ -
319 // a static one using hybridIndexAccess.
│ │ │ -
320 return Hybrid::ifElse(hasDynamicAccess(c), [&](auto id) -> decltype(auto) {
│ │ │ -
321 return Imp::resolveDynamicMultiIndex(id(c)[i], tail, isFinal);
│ │ │ -
322 }, [&](auto id) -> decltype(auto) {
│ │ │ -
323 // auto indexRange = range(Hybrid::size(id(c)));
│ │ │ -
324 auto indexRange = typename decltype(range(Hybrid::size(id(c))))::integer_sequence();
│ │ │ -
325 return Hybrid::switchCases(indexRange, i, [&](auto static_i) -> decltype(auto){
│ │ │ -
326 // Do rescursion with static version of i
│ │ │ -
327 return Imp::resolveDynamicMultiIndex(id(c)[static_i], tail, isFinal);
│ │ │ -
328 }, [&]() -> decltype(auto){
│ │ │ -
329 // As fallback we use c[0] this is needed, because there must be one branch that matches.
│ │ │ -
330 return Imp::resolveDynamicMultiIndex(id(c)[Dune::Indices::_0], tail, isFinal);
│ │ │ -
331 });
│ │ │ -
332 });
│ │ │ -
333 });
│ │ │ -
334 }
│ │ │ -
335
│ │ │ -
336 template<class C, class MultiIndex>
│ │ │ -
337 constexpr decltype(auto) resolveStaticMultiIndex(C&& c, const MultiIndex& multiIndex)
│ │ │ -
338 {
│ │ │ -
339 auto isExhausted = Hybrid::equal_to(Hybrid::size(multiIndex), Dune::Indices::_0);
│ │ │ -
340 return Hybrid::ifElse(isExhausted, [&, c = forwardCapture(std::forward<C>(c))](auto) -> decltype(auto) {
│ │ │ -
341 return c.forward();
│ │ │ -
342 }, [&](auto id) -> decltype(auto) {
│ │ │ -
343 auto head = multiIndex[Dune::Indices::_0];
│ │ │ -
344 auto tail = multiIndex.pop();
│ │ │ -
345
│ │ │ -
346 return Imp::resolveStaticMultiIndex(id(c)[head], tail);
│ │ │ -
347 });
│ │ │ -
348 }
│ │ │ -
349
│ │ │ -
350} // namespace Imp
│ │ │ -
351
│ │ │ -
352
│ │ │ -
353
│ │ │ -
376template<class C, class MultiIndex, class IsFinal>
│ │ │ -
│ │ │ -
377constexpr decltype(auto) resolveDynamicMultiIndex(C&& c, const MultiIndex& multiIndex, const IsFinal& isFinal)
│ │ │ -
378{
│ │ │ -
379 return Imp::resolveDynamicMultiIndex(std::forward<C>(c), Imp::shiftedDynamicMultiIndex<0>(multiIndex), isFinal);
│ │ │ -
380}
│ │ │ -
│ │ │ -
381
│ │ │ -
398template<class C, class MultiIndex>
│ │ │ -
│ │ │ -
399constexpr decltype(auto) resolveDynamicMultiIndex(C&& c, const MultiIndex& multiIndex)
│ │ │ -
400{
│ │ │ -
401 auto hasNoIndexAccess = negatePredicate(callableCheck([](auto&& cc) -> std::void_t<decltype(cc[Dune::Indices::_0])> {}));
│ │ │ -
402 return Imp::resolveDynamicMultiIndex(std::forward<C>(c), Imp::shiftedDynamicMultiIndex<0>(multiIndex), hasNoIndexAccess);
│ │ │ -
403}
│ │ │ -
│ │ │ -
404
│ │ │ -
420template<class C, class MultiIndex>
│ │ │ -
│ │ │ -
421constexpr decltype(auto) resolveStaticMultiIndex(C&& c, const MultiIndex& multiIndex)
│ │ │ -
422{
│ │ │ -
423 return Imp::resolveStaticMultiIndex(std::forward<C>(c), Imp::shiftedStaticMultiIndex<0>(multiIndex));
│ │ │ -
424}
│ │ │ -
│ │ │ -
425
│ │ │ -
426
│ │ │ -
427
│ │ │ -
428} // namespace Dune::Functions
│ │ │ -
429} // namespace Dune
│ │ │ -
430
│ │ │ -
431
│ │ │ -
432
│ │ │ -
433#endif // DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH
│ │ │ - │ │ │ -
auto hybridIndexAccess(C &&c, const I &i, F &&f) -> decltype(f(c[i]))
Provide operator[] index-access for containers.
Definition indexaccess.hh:67
│ │ │ -
constexpr decltype(auto) resolveStaticMultiIndex(C &&c, const MultiIndex &multiIndex)
Provide multi-index access by chaining operator[].
Definition indexaccess.hh:421
│ │ │ -
auto callableCheck(Expression f)
Create a predicate for checking validity of expressions.
Definition utility.hh:287
│ │ │ -
constexpr decltype(auto) resolveDynamicMultiIndex(C &&c, const MultiIndex &multiIndex, const IsFinal &isFinal)
Provide multi-index access by chaining operator[].
Definition indexaccess.hh:377
│ │ │ -
Result hybridMultiIndexAccess(C &&c, const MultiIndex &index)
Provide multi-index access by chaining operator[].
Definition indexaccess.hh:286
│ │ │ -
auto negatePredicate(Check check)
Negate given predicate.
Definition utility.hh:312
│ │ │ +
160
│ │ │ +
161
│ │ │ +
162#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH
│ │ │
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
auto forwardCapture(T &&t)
Create a capture object for perfect forwarding.
Definition utility.hh:380
│ │ │ +
Definition subspacebasis.hh:29
│ │ │ +
typename RootBasis::GridView GridView
Definition subspacebasis.hh:39
│ │ │ +
typename TypeTree::ChildForTreePath< RootTree, PrefixPath > Tree
Definition subspacelocalview.hh:57
│ │ │ +
void unbind()
Unbind from the current element.
Definition subspacelocalview.hh:93
│ │ │ +
const Element & element() const
Return the grid element that the view is bound to.
Definition subspacelocalview.hh:84
│ │ │ +
const GlobalBasis * globalBasis_
Definition subspacelocalview.hh:151
│ │ │ +
bool bound() const
Return if the view is bound to a grid element.
Definition subspacelocalview.hh:100
│ │ │ +
typename RootLocalView::MultiIndex MultiIndex
Definition subspacelocalview.hh:60
│ │ │ +
SubspaceBasis< typename RootLocalView::GlobalBasis, PrefixPath > GlobalBasis
Definition subspacelocalview.hh:42
│ │ │ +
size_type size() const
Total number of degrees of freedom on this element.
Definition subspacelocalview.hh:116
│ │ │ +
RootLocalView rootLocalView_
Definition subspacelocalview.hh:152
│ │ │ +
void bind(const Element &e)
Bind the view to a grid element.
Definition subspacelocalview.hh:75
│ │ │ +
typename GlobalBasis::GridView GridView
Definition subspacelocalview.hh:45
│ │ │ +
SubspaceLocalView(const GlobalBasis &globalBasis, const PrefixPath &)
Construct local view for a given global finite element basis.
Definition subspacelocalview.hh:63
│ │ │ +
RootLocalView RootLocalView
Definition subspacelocalview.hh:39
│ │ │ +
const RootLocalView & rootLocalView() const
Definition subspacelocalview.hh:145
│ │ │ +
std::size_t size_type
Definition subspacelocalview.hh:51
│ │ │ +
typename GridView::template Codim< 0 >::Entity Element
Definition subspacelocalview.hh:48
│ │ │ +
const GlobalBasis & globalBasis() const
Definition subspacelocalview.hh:140
│ │ │ +
size_type maxSize() const
Maximum local size for any element on the GridView.
Definition subspacelocalview.hh:127
│ │ │ +
const Tree & tree() const
Return the local ansatz tree associated to the bound entity.
Definition subspacelocalview.hh:109
│ │ │ +
MultiIndex index(size_type i) const
Maps from subtree index set [0..size-1] to a globally unique multi index in global basis.
Definition subspacelocalview.hh:133
│ │ │ +
typename RootLocalView::Tree RootTree
Definition subspacelocalview.hh:54
│ │ │ + │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,373 +1,223 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -indexaccess.hh │ │ │ │ +subspacelocalview.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH │ │ │ │ -8#define DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH │ │ │ │ +8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH │ │ │ │ 9 │ │ │ │ 10 │ │ │ │ -11#include │ │ │ │ -12#include │ │ │ │ -13 │ │ │ │ -14#include │ │ │ │ -15#include │ │ │ │ -16#include │ │ │ │ -17 │ │ │ │ -18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ +11#include │ │ │ │ +12 │ │ │ │ +13#include │ │ │ │ +14 │ │ │ │ +15#include │ │ │ │ +16 │ │ │ │ +17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +18 │ │ │ │ 19 │ │ │ │ 20 │ │ │ │ -21 │ │ │ │ -22namespace _D_u_n_e { │ │ │ │ -23namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +21namespace _D_u_n_e { │ │ │ │ +22namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +23 │ │ │ │ 24 │ │ │ │ 25 │ │ │ │ -26namespace Imp { │ │ │ │ -27 │ │ │ │ -28namespace Concept { │ │ │ │ +26template │ │ │ │ +27class _S_u_b_s_p_a_c_e_B_a_s_i_s; │ │ │ │ +28 │ │ │ │ 29 │ │ │ │ -30template │ │ │ │ -31struct HasDynamicIndexAccess │ │ │ │ -32{ │ │ │ │ -33 template │ │ │ │ -34 auto require(C&& c) -> decltype( │ │ │ │ -35 c[std::declval()] │ │ │ │ -36 ); │ │ │ │ -37}; │ │ │ │ +30 │ │ │ │ +32template │ │ │ │ +_3_3class _S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w │ │ │ │ +34{ │ │ │ │ +35 using PrefixPath = PP; │ │ │ │ +36 │ │ │ │ +37public: │ │ │ │ 38 │ │ │ │ -39struct HasStaticIndexAccess │ │ │ │ -40{ │ │ │ │ -41 template │ │ │ │ -42 auto require(C&& c) -> decltype( │ │ │ │ -43 c[Dune::Indices::_0] │ │ │ │ -44 ); │ │ │ │ -45}; │ │ │ │ +_3_9 using _R_o_o_t_L_o_c_a_l_V_i_e_w = RLV; │ │ │ │ +40 │ │ │ │ +_4_2 using _G_l_o_b_a_l_B_a_s_i_s = _S_u_b_s_p_a_c_e_B_a_s_i_s_<_t_y_p_e_n_a_m_e_ _R_o_o_t_L_o_c_a_l_V_i_e_w_:_:_G_l_o_b_a_l_B_a_s_i_s_, │ │ │ │ +_P_r_e_f_i_x_P_a_t_h_>; │ │ │ │ +43 │ │ │ │ +_4_5 using _G_r_i_d_V_i_e_w = typename _G_l_o_b_a_l_B_a_s_i_s_:_:_G_r_i_d_V_i_e_w; │ │ │ │ 46 │ │ │ │ -47} // namespace Concept │ │ │ │ -48 │ │ │ │ -49} // namespace Imp │ │ │ │ -50 │ │ │ │ -51 │ │ │ │ +_4_8 using _E_l_e_m_e_n_t = typename GridView::template Codim<0>::Entity; │ │ │ │ +49 │ │ │ │ +_5_1 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ 52 │ │ │ │ -65template, C>(), │ │ │ │ -int> = 0> │ │ │ │ -_6_7auto _h_y_b_r_i_d_I_n_d_e_x_A_c_c_e_s_s(C&& c, const I& i, F&& f) │ │ │ │ -68 -> decltype(f(c[i])) │ │ │ │ -69{ │ │ │ │ -70 return f(c[i]); │ │ │ │ -71} │ │ │ │ -72 │ │ │ │ -90template, │ │ │ │ -C>(), int> = 0> │ │ │ │ -_9_2decltype(auto) _h_y_b_r_i_d_I_n_d_e_x_A_c_c_e_s_s(C&& c, const I& i, F&& f) │ │ │ │ -93{ │ │ │ │ -94 using Size = decltype(Hybrid::size(c)); │ │ │ │ -95 return Hybrid::switchCases(std::make_index_sequence(), i, │ │ │ │ -96 [&](const auto& ii) -> decltype(auto){ │ │ │ │ -97 return f(c[ii]); │ │ │ │ -98 }, [&]() -> decltype(auto){ │ │ │ │ -99 return f(c[Dune::Indices::_0]); │ │ │ │ -100 }); │ │ │ │ -101} │ │ │ │ -102 │ │ │ │ -103 │ │ │ │ -104namespace Imp { │ │ │ │ -105 │ │ │ │ -119 template │ │ │ │ -120 class ShiftedDynamicMultiIndex │ │ │ │ -121 { │ │ │ │ -122 public: │ │ │ │ -123 ShiftedDynamicMultiIndex(const Index& index) : │ │ │ │ -124 index_(index) │ │ │ │ -125 {} │ │ │ │ -126 │ │ │ │ -127 std::size_t operator[](std::size_t position) const │ │ │ │ +_5_4 using _R_o_o_t_T_r_e_e = typename RootLocalView::Tree; │ │ │ │ +55 │ │ │ │ +_5_7 using _T_r_e_e = typename TypeTree::ChildForTreePath; │ │ │ │ +58 │ │ │ │ +_6_0 using _M_u_l_t_i_I_n_d_e_x = typename RootLocalView::MultiIndex; │ │ │ │ +61 │ │ │ │ +_6_3 _S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w(const _G_l_o_b_a_l_B_a_s_i_s& _g_l_o_b_a_l_B_a_s_i_s, const PrefixPath& / │ │ │ │ +*prefixPath*/) : │ │ │ │ +64 _g_l_o_b_a_l_B_a_s_i_s__(&_g_l_o_b_a_l_B_a_s_i_s), │ │ │ │ +65 _r_o_o_t_L_o_c_a_l_V_i_e_w__(_g_l_o_b_a_l_B_a_s_i_s.rootBasis().localView()) │ │ │ │ +66 { │ │ │ │ +67// static_assert(models, Tree>(), "Tree type │ │ │ │ +passed to SubspaceLocalView does not model the BasisNode concept."); │ │ │ │ +68 } │ │ │ │ +69 │ │ │ │ +_7_5 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ +76 { │ │ │ │ +77 _r_o_o_t_L_o_c_a_l_V_i_e_w__.bind(e); │ │ │ │ +78 } │ │ │ │ +79 │ │ │ │ +_8_4 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ +85 { │ │ │ │ +86 return _r_o_o_t_L_o_c_a_l_V_i_e_w__.element(); │ │ │ │ +87 } │ │ │ │ +88 │ │ │ │ +_9_3 void _u_n_b_i_n_d() │ │ │ │ +94 { │ │ │ │ +95 _r_o_o_t_L_o_c_a_l_V_i_e_w__.unbind(); │ │ │ │ +96 } │ │ │ │ +97 │ │ │ │ +_1_0_0 bool _b_o_u_n_d() const │ │ │ │ +101 { │ │ │ │ +102 return _r_o_o_t_L_o_c_a_l_V_i_e_w__.bound(); │ │ │ │ +103 } │ │ │ │ +104 │ │ │ │ +_1_0_9 const _T_r_e_e& _t_r_e_e() const │ │ │ │ +110 { │ │ │ │ +111 return TypeTree::child(_r_o_o_t_L_o_c_a_l_V_i_e_w__.tree(), _g_l_o_b_a_l_B_a_s_i_s__->prefixPath()); │ │ │ │ +112 } │ │ │ │ +113 │ │ │ │ +_1_1_6 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ +117 { │ │ │ │ +118 return _r_o_o_t_L_o_c_a_l_V_i_e_w__.size(); │ │ │ │ +119 } │ │ │ │ +120 │ │ │ │ +_1_2_7 _s_i_z_e___t_y_p_e _m_a_x_S_i_z_e() const │ │ │ │ 128 { │ │ │ │ -129 if (position pop() const │ │ │ │ -139 { │ │ │ │ -140 return {index_}; │ │ │ │ -141 } │ │ │ │ -142 │ │ │ │ -143 std::size_t size() const │ │ │ │ -144 { │ │ │ │ -145 if (offset < index_.size()) │ │ │ │ -146 return index_.size() - offset; │ │ │ │ -147 else │ │ │ │ -148 return 0; │ │ │ │ -149 } │ │ │ │ -150 │ │ │ │ -151 const Index& originalIndex() const │ │ │ │ -152 { │ │ │ │ -153 return index_; │ │ │ │ -154 } │ │ │ │ +129 return _r_o_o_t_L_o_c_a_l_V_i_e_w__.maxSize(); │ │ │ │ +130 } │ │ │ │ +131 │ │ │ │ +_1_3_3 _M_u_l_t_i_I_n_d_e_x _i_n_d_e_x(_s_i_z_e___t_y_p_e i) const │ │ │ │ +134 { │ │ │ │ +135 return _r_o_o_t_L_o_c_a_l_V_i_e_w__.index(i); │ │ │ │ +136 } │ │ │ │ +137 │ │ │ │ +_1_4_0 const _G_l_o_b_a_l_B_a_s_i_s& _g_l_o_b_a_l_B_a_s_i_s() const │ │ │ │ +141 { │ │ │ │ +142 return *_g_l_o_b_a_l_B_a_s_i_s__; │ │ │ │ +143 } │ │ │ │ +144 │ │ │ │ +_1_4_5 const _R_o_o_t_L_o_c_a_l_V_i_e_w& _r_o_o_t_L_o_c_a_l_V_i_e_w() const │ │ │ │ +146 { │ │ │ │ +147 return _r_o_o_t_L_o_c_a_l_V_i_e_w__; │ │ │ │ +148 } │ │ │ │ +149 │ │ │ │ +150protected: │ │ │ │ +_1_5_1 const _G_l_o_b_a_l_B_a_s_i_s* _g_l_o_b_a_l_B_a_s_i_s__; │ │ │ │ +_1_5_2 _R_o_o_t_L_o_c_a_l_V_i_e_w _r_o_o_t_L_o_c_a_l_V_i_e_w__; │ │ │ │ +153}; │ │ │ │ +154 │ │ │ │ 155 │ │ │ │ -156 private: │ │ │ │ -157 const Index& index_; │ │ │ │ -158 }; │ │ │ │ +156 │ │ │ │ +157} // end namespace Functions │ │ │ │ +158} // end namespace Dune │ │ │ │ 159 │ │ │ │ -160 template │ │ │ │ -161 class ShiftedStaticMultiIndex │ │ │ │ -162 { │ │ │ │ -163 public: │ │ │ │ -164 ShiftedStaticMultiIndex(const Index& index) : │ │ │ │ -165 index_(index) │ │ │ │ -166 {} │ │ │ │ -167 │ │ │ │ -168 template │ │ │ │ -169 auto operator[](Dune::index_constant) const │ │ │ │ -170 { │ │ │ │ -171 if constexpr (i{}]; │ │ │ │ -173 } else { │ │ │ │ -174 return Dune::index_constant<0>{}; │ │ │ │ -175 } │ │ │ │ -176 } │ │ │ │ -177 │ │ │ │ -181 ShiftedStaticMultiIndex pop() const │ │ │ │ -182 { │ │ │ │ -183 return {index_}; │ │ │ │ -184 } │ │ │ │ -185 │ │ │ │ -186 static constexpr std::size_t size() │ │ │ │ -187 { │ │ │ │ -188 auto fullSize = decltype(Hybrid::size(std::declval()))::value; │ │ │ │ -189 if (offset < fullSize) │ │ │ │ -190 return fullSize - offset; │ │ │ │ -191 else │ │ │ │ -192 return 0; │ │ │ │ -193 } │ │ │ │ -194 │ │ │ │ -195 private: │ │ │ │ -196 const Index& index_; │ │ │ │ -197 }; │ │ │ │ -198 │ │ │ │ -204 template │ │ │ │ -205 ShiftedDynamicMultiIndex shiftedDynamicMultiIndex(const │ │ │ │ -Index& index) │ │ │ │ -206 { │ │ │ │ -207 return {index}; │ │ │ │ -208 } │ │ │ │ -209 │ │ │ │ -218 template │ │ │ │ -219 ShiftedDynamicMultiIndex shiftedDynamicMultiIndex │ │ │ │ -(const ShiftedDynamicMultiIndex& index) │ │ │ │ -220 { │ │ │ │ -221 return {index.originalIndex()}; │ │ │ │ -222 } │ │ │ │ -223 │ │ │ │ -224 template │ │ │ │ -225 ShiftedStaticMultiIndex shiftedStaticMultiIndex(const Index& │ │ │ │ -index) │ │ │ │ -226 { │ │ │ │ -227 return {index}; │ │ │ │ -228 } │ │ │ │ -229 │ │ │ │ -230} // namespace Imp │ │ │ │ -231 │ │ │ │ -232 │ │ │ │ -233 │ │ │ │ -234 │ │ │ │ -235namespace Imp { │ │ │ │ -236 │ │ │ │ -237template │ │ │ │ -238struct MultiIndexResolver │ │ │ │ -239{ │ │ │ │ -240 MultiIndexResolver(const Index& index) : │ │ │ │ -241 index_(index) │ │ │ │ -242 {} │ │ │ │ -243 │ │ │ │ -244 template, int> = 0> │ │ │ │ -246 Result operator()(C&& c) │ │ │ │ -247 { │ │ │ │ -248 auto&& subIndex = Imp::shiftedDynamicMultiIndex<1>(index_); │ │ │ │ -249 auto&& subIndexResolver = MultiIndexResolver │ │ │ │ -(subIndex); │ │ │ │ -250 return (Result)(_h_y_b_r_i_d_I_n_d_e_x_A_c_c_e_s_s(c, index_[Dune::Indices::_0], │ │ │ │ -subIndexResolver)); │ │ │ │ -251 } │ │ │ │ -252 │ │ │ │ -253 template, int> = 0> │ │ │ │ -255 Result operator()(C&& c) │ │ │ │ -256 { │ │ │ │ -257 return (Result)(std::forward(c)); │ │ │ │ -258 } │ │ │ │ -259 │ │ │ │ -260 const Index& index_; │ │ │ │ -261}; │ │ │ │ -262 │ │ │ │ -263} // namespace Imp │ │ │ │ -264 │ │ │ │ -265 │ │ │ │ -266 │ │ │ │ -285template │ │ │ │ -_2_8_6Result _h_y_b_r_i_d_M_u_l_t_i_I_n_d_e_x_A_c_c_e_s_s(C&& c, const MultiIndex& index) │ │ │ │ -287{ │ │ │ │ -288 │ │ │ │ -289 Imp::MultiIndexResolver multiIndexResolver(index); │ │ │ │ -290 return multiIndexResolver(c); │ │ │ │ -291} │ │ │ │ -292 │ │ │ │ -293 │ │ │ │ -294 │ │ │ │ -295 │ │ │ │ -296 │ │ │ │ -297 │ │ │ │ -298namespace Imp { │ │ │ │ -299 │ │ │ │ -300 template │ │ │ │ -301 constexpr decltype(auto) resolveDynamicMultiIndex(C&& c, const MultiIndex& │ │ │ │ -multiIndex, const IsFinal& isFinal) │ │ │ │ -302 { │ │ │ │ -303 // If c is already considered final simply return it, │ │ │ │ -304 // else resolve the next multiIndex entry. │ │ │ │ -305 return Hybrid::ifElse(isFinal(c), [&, c = _f_o_r_w_a_r_d_C_a_p_t_u_r_e(std::forward │ │ │ │ -(c))](auto) -> decltype(auto) { │ │ │ │ -306 assert(multiIndex.size() == 0); │ │ │ │ -307 return c.forward(); │ │ │ │ -308 }, [&](auto) -> decltype(auto) { │ │ │ │ -309 auto hasDynamicAccess = _c_a_l_l_a_b_l_e_C_h_e_c_k([](auto&& cc) -> std::void_t {}); │ │ │ │ -310 │ │ │ │ -311 // Split multiIndex into first entry and remaining ones. │ │ │ │ -312 auto i = multiIndex[0]; │ │ │ │ -313 auto tail = multiIndex.pop(); │ │ │ │ -314 │ │ │ │ -315 // Resolve first multiIndex entry by c[multiIndex[0]] and │ │ │ │ -316 // continue resolving with the remaining remaining ones. │ │ │ │ -317 // If c has a dynamic operator[] this is straight forward. │ │ │ │ -318 // Else the dynamic multiIndex[0] has to be translated into │ │ │ │ -319 // a static one using hybridIndexAccess. │ │ │ │ -320 return Hybrid::ifElse(hasDynamicAccess(c), [&](auto id) -> decltype(auto) { │ │ │ │ -321 return Imp::resolveDynamicMultiIndex(id(c)[i], tail, isFinal); │ │ │ │ -322 }, [&](auto id) -> decltype(auto) { │ │ │ │ -323 // auto indexRange = range(Hybrid::size(id(c))); │ │ │ │ -324 auto indexRange = typename decltype(range(Hybrid::size(id(c)))):: │ │ │ │ -integer_sequence(); │ │ │ │ -325 return Hybrid::switchCases(indexRange, i, [&](auto static_i) -> decltype │ │ │ │ -(auto){ │ │ │ │ -326 // Do rescursion with static version of i │ │ │ │ -327 return Imp::resolveDynamicMultiIndex(id(c)[static_i], tail, isFinal); │ │ │ │ -328 }, [&]() -> decltype(auto){ │ │ │ │ -329 // As fallback we use c[0] this is needed, because there must be one branch │ │ │ │ -that matches. │ │ │ │ -330 return Imp::resolveDynamicMultiIndex(id(c)[Dune::Indices::_0], tail, │ │ │ │ -isFinal); │ │ │ │ -331 }); │ │ │ │ -332 }); │ │ │ │ -333 }); │ │ │ │ -334 } │ │ │ │ -335 │ │ │ │ -336 template │ │ │ │ -337 constexpr decltype(auto) resolveStaticMultiIndex(C&& c, const MultiIndex& │ │ │ │ -multiIndex) │ │ │ │ -338 { │ │ │ │ -339 auto isExhausted = Hybrid::equal_to(Hybrid::size(multiIndex), Dune:: │ │ │ │ -Indices::_0); │ │ │ │ -340 return Hybrid::ifElse(isExhausted, [&, c = _f_o_r_w_a_r_d_C_a_p_t_u_r_e(std::forward │ │ │ │ -(c))](auto) -> decltype(auto) { │ │ │ │ -341 return c.forward(); │ │ │ │ -342 }, [&](auto id) -> decltype(auto) { │ │ │ │ -343 auto head = multiIndex[Dune::Indices::_0]; │ │ │ │ -344 auto tail = multiIndex.pop(); │ │ │ │ -345 │ │ │ │ -346 return Imp::resolveStaticMultiIndex(id(c)[head], tail); │ │ │ │ -347 }); │ │ │ │ -348 } │ │ │ │ -349 │ │ │ │ -350} // namespace Imp │ │ │ │ -351 │ │ │ │ -352 │ │ │ │ -353 │ │ │ │ -376template │ │ │ │ -_3_7_7constexpr decltype(auto) _r_e_s_o_l_v_e_D_y_n_a_m_i_c_M_u_l_t_i_I_n_d_e_x(C&& c, const MultiIndex& │ │ │ │ -multiIndex, const IsFinal& isFinal) │ │ │ │ -378{ │ │ │ │ -379 return Imp::resolveDynamicMultiIndex(std::forward(c), Imp:: │ │ │ │ -shiftedDynamicMultiIndex<0>(multiIndex), isFinal); │ │ │ │ -380} │ │ │ │ -381 │ │ │ │ -398template │ │ │ │ -_3_9_9constexpr decltype(auto) _r_e_s_o_l_v_e_D_y_n_a_m_i_c_M_u_l_t_i_I_n_d_e_x(C&& c, const MultiIndex& │ │ │ │ -multiIndex) │ │ │ │ -400{ │ │ │ │ -401 auto hasNoIndexAccess = _n_e_g_a_t_e_P_r_e_d_i_c_a_t_e(_c_a_l_l_a_b_l_e_C_h_e_c_k([](auto&& cc) - │ │ │ │ -> std::void_t {})); │ │ │ │ -402 return Imp::resolveDynamicMultiIndex(std::forward(c), Imp:: │ │ │ │ -shiftedDynamicMultiIndex<0>(multiIndex), hasNoIndexAccess); │ │ │ │ -403} │ │ │ │ -404 │ │ │ │ -420template │ │ │ │ -_4_2_1constexpr decltype(auto) _r_e_s_o_l_v_e_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x(C&& c, const MultiIndex& │ │ │ │ -multiIndex) │ │ │ │ -422{ │ │ │ │ -423 return Imp::resolveStaticMultiIndex(std::forward(c), Imp:: │ │ │ │ -shiftedStaticMultiIndex<0>(multiIndex)); │ │ │ │ -424} │ │ │ │ -425 │ │ │ │ -426 │ │ │ │ -427 │ │ │ │ -428} // namespace Dune::Functions │ │ │ │ -429} // namespace Dune │ │ │ │ -430 │ │ │ │ -431 │ │ │ │ -432 │ │ │ │ -433#endif // DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH │ │ │ │ -_u_t_i_l_i_t_y_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_h_y_b_r_i_d_I_n_d_e_x_A_c_c_e_s_s │ │ │ │ -auto hybridIndexAccess(C &&c, const I &i, F &&f) -> decltype(f(c[i])) │ │ │ │ -Provide operator[] index-access for containers. │ │ │ │ -DDeeffiinniittiioonn indexaccess.hh:67 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_r_e_s_o_l_v_e_S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x │ │ │ │ -constexpr decltype(auto) resolveStaticMultiIndex(C &&c, const MultiIndex │ │ │ │ -&multiIndex) │ │ │ │ -Provide multi-index access by chaining operator[]. │ │ │ │ -DDeeffiinniittiioonn indexaccess.hh:421 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_a_l_l_a_b_l_e_C_h_e_c_k │ │ │ │ -auto callableCheck(Expression f) │ │ │ │ -Create a predicate for checking validity of expressions. │ │ │ │ -DDeeffiinniittiioonn utility.hh:287 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_r_e_s_o_l_v_e_D_y_n_a_m_i_c_M_u_l_t_i_I_n_d_e_x │ │ │ │ -constexpr decltype(auto) resolveDynamicMultiIndex(C &&c, const MultiIndex │ │ │ │ -&multiIndex, const IsFinal &isFinal) │ │ │ │ -Provide multi-index access by chaining operator[]. │ │ │ │ -DDeeffiinniittiioonn indexaccess.hh:377 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_h_y_b_r_i_d_M_u_l_t_i_I_n_d_e_x_A_c_c_e_s_s │ │ │ │ -Result hybridMultiIndexAccess(C &&c, const MultiIndex &index) │ │ │ │ -Provide multi-index access by chaining operator[]. │ │ │ │ -DDeeffiinniittiioonn indexaccess.hh:286 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_n_e_g_a_t_e_P_r_e_d_i_c_a_t_e │ │ │ │ -auto negatePredicate(Check check) │ │ │ │ -Negate given predicate. │ │ │ │ -DDeeffiinniittiioonn utility.hh:312 │ │ │ │ +160 │ │ │ │ +161 │ │ │ │ +162#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH │ │ │ │ _D_u_n_e │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_f_o_r_w_a_r_d_C_a_p_t_u_r_e │ │ │ │ -auto forwardCapture(T &&t) │ │ │ │ -Create a capture object for perfect forwarding. │ │ │ │ -DDeeffiinniittiioonn utility.hh:380 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s │ │ │ │ +DDeeffiinniittiioonn subspacebasis.hh:29 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s_<_ _t_y_p_e_n_a_m_e_ _R_o_o_t_L_o_c_a_l_V_i_e_w_:_:_G_l_o_b_a_l_B_a_s_i_s_,_ _P_r_e_f_i_x_P_a_t_h │ │ │ │ +_>_:_:_G_r_i_d_V_i_e_w │ │ │ │ +typename RootBasis::GridView GridView │ │ │ │ +DDeeffiinniittiioonn subspacebasis.hh:39 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_<_ _R_o_o_t_L_o_c_a_l_V_i_e_w_,_ _P_r_e_f_i_x_P_a_t_h_ _>_:_:_T_r_e_e │ │ │ │ +typename TypeTree::ChildForTreePath< RootTree, PrefixPath > Tree │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:57 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_:_:_u_n_b_i_n_d │ │ │ │ +void unbind() │ │ │ │ +Unbind from the current element. │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:93 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_:_:_e_l_e_m_e_n_t │ │ │ │ +const Element & element() const │ │ │ │ +Return the grid element that the view is bound to. │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:84 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_<_ _R_o_o_t_L_o_c_a_l_V_i_e_w_,_ _P_r_e_f_i_x_P_a_t_h_ _>_:_:_g_l_o_b_a_l_B_a_s_i_s__ │ │ │ │ +const GlobalBasis * globalBasis_ │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:151 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_:_:_b_o_u_n_d │ │ │ │ +bool bound() const │ │ │ │ +Return if the view is bound to a grid element. │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:100 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_<_ _R_o_o_t_L_o_c_a_l_V_i_e_w_,_ _P_r_e_f_i_x_P_a_t_h_ _>_:_:_M_u_l_t_i_I_n_d_e_x │ │ │ │ +typename RootLocalView::MultiIndex MultiIndex │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:60 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_<_ _R_o_o_t_L_o_c_a_l_V_i_e_w_,_ _P_r_e_f_i_x_P_a_t_h_ _>_:_:_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ +SubspaceBasis< typename RootLocalView::GlobalBasis, PrefixPath > GlobalBasis │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:42 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_:_:_s_i_z_e │ │ │ │ +size_type size() const │ │ │ │ +Total number of degrees of freedom on this element. │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:116 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_<_ _R_o_o_t_L_o_c_a_l_V_i_e_w_,_ _P_r_e_f_i_x_P_a_t_h_ _>_:_:_r_o_o_t_L_o_c_a_l_V_i_e_w__ │ │ │ │ +RootLocalView rootLocalView_ │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:152 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_:_:_b_i_n_d │ │ │ │ +void bind(const Element &e) │ │ │ │ +Bind the view to a grid element. │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:75 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_<_ _R_o_o_t_L_o_c_a_l_V_i_e_w_,_ _P_r_e_f_i_x_P_a_t_h_ _>_:_:_G_r_i_d_V_i_e_w │ │ │ │ +typename GlobalBasis::GridView GridView │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:45 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w │ │ │ │ +SubspaceLocalView(const GlobalBasis &globalBasis, const PrefixPath &) │ │ │ │ +Construct local view for a given global finite element basis. │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:63 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_<_ _R_o_o_t_L_o_c_a_l_V_i_e_w_,_ _P_r_e_f_i_x_P_a_t_h_ _>_:_:_R_o_o_t_L_o_c_a_l_V_i_e_w │ │ │ │ +RootLocalView RootLocalView │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:39 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_:_:_r_o_o_t_L_o_c_a_l_V_i_e_w │ │ │ │ +const RootLocalView & rootLocalView() const │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:145 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_<_ _R_o_o_t_L_o_c_a_l_V_i_e_w_,_ _P_r_e_f_i_x_P_a_t_h_ _>_:_:_s_i_z_e___t_y_p_e │ │ │ │ +std::size_t size_type │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:51 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_<_ _R_o_o_t_L_o_c_a_l_V_i_e_w_,_ _P_r_e_f_i_x_P_a_t_h_ _>_:_:_E_l_e_m_e_n_t │ │ │ │ +typename GridView::template Codim< 0 >::Entity Element │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:48 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_<_ _R_o_o_t_L_o_c_a_l_V_i_e_w_,_ _P_r_e_f_i_x_P_a_t_h_ _>_:_:_g_l_o_b_a_l_B_a_s_i_s │ │ │ │ +const GlobalBasis & globalBasis() const │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:140 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_:_:_m_a_x_S_i_z_e │ │ │ │ +size_type maxSize() const │ │ │ │ +Maximum local size for any element on the GridView. │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:127 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_:_:_t_r_e_e │ │ │ │ +const Tree & tree() const │ │ │ │ +Return the local ansatz tree associated to the bound entity. │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:109 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_:_:_i_n_d_e_x │ │ │ │ +MultiIndex index(size_type i) const │ │ │ │ +Maps from subtree index set [0..size-1] to a globally unique multi index in │ │ │ │ +global basis. │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:133 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w_<_ _R_o_o_t_L_o_c_a_l_V_i_e_w_,_ _P_r_e_f_i_x_P_a_t_h_ _>_:_:_R_o_o_t_T_r_e_e │ │ │ │ +typename RootLocalView::Tree RootTree │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:54 │ │ │ │ +_c_o_n_c_e_p_t_s_._h_h │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _i_n_d_e_x_a_c_c_e_s_s_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _s_u_b_s_p_a_c_e_l_o_c_a_l_v_i_e_w_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00242.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: geometryinancestor.hh File Reference │ │ │ +Dune-Functions: hierarchicallagrangebasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,44 +88,62 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
geometryinancestor.hh File Reference
│ │ │ +
hierarchicallagrangebasis.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <vector>
│ │ │ -#include <dune/common/iteratorrange.hh>
│ │ │ +
#include <type_traits>
│ │ │ +#include <dune/common/exceptions.hh>
│ │ │ +#include <dune/localfunctions/hierarchical/hierarchicalp2.hh>
│ │ │ +#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ +#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │ +#include <dune/functions/functionspacebases/lfeprebasismixin.hh>
│ │ │ +#include <dune/geometry/type.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::GeometryInAncestor< Element >
 A geometry embedding a descendent element into an ancestor. More...
class  Dune::Functions::HierarchicalLagrangePreBasis< GV, 1, R >
class  Dune::Functions::HierarchicalLagrangePreBasis< GV, 2, R >
│ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ +

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::BasisFactory
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +

│ │ │ +Typedefs

template<typename GV, int k, typename R = double>
using Dune::Functions::HierarchicalLagrangeBasis = DefaultGlobalBasis<HierarchicalLagrangePreBasis<GV, k, R> >
 Basis of a scalar Hierarchical Lagrange finite element space.
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ +Functions

template<int k, typename R = double>
auto Dune::Functions::BasisFactory::hierarchicalLagrange ()
 A factory that can create a HierarchicalLagrange pre-basis.
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,19 +1,34 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -geometryinancestor.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ +hierarchicallagrangebasis.hh File Reference │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_f_e_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h> │ │ │ │ +#include │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_<_ _E_l_e_m_e_n_t_ _> │ │ │ │ -  A geometry embedding a descendent element into an ancestor. _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_,_ _R_ _> │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _2_,_ _R_ _> │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ +namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ +TTyyppeeddeeffss │ │ │ │ +template │ │ │ │ +using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_B_a_s_i_s = │ │ │ │ + _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s<_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s > │ │ │ │ +  Basis of a scalar Hierarchical Lagrange finite element space. │ │ │ │ +FFuunnccttiioonnss │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_h_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e () │ │ │ │ +  A factory that can create a HierarchicalLagrange pre-basis. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _g_e_o_m_e_t_r_y_i_n_a_n_c_e_s_t_o_r_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _h_i_e_r_a_r_c_h_i_c_a_l_l_a_g_r_a_n_g_e_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00242_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: geometryinancestor.hh Source File │ │ │ +Dune-Functions: hierarchicallagrangebasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,186 +88,136 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
geometryinancestor.hh
│ │ │ +
hierarchicallagrangebasis.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_COMMON_GEOMETRYINANCESTOR_HH
│ │ │ -
8#define DUNE_FUNCTIONS_COMMON_GEOMETRYINANCESTOR_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH
│ │ │ +
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH
│ │ │
9
│ │ │ -
10#include <vector>
│ │ │ +
10#include <type_traits>
│ │ │
11
│ │ │ -
12#include <dune/common/iteratorrange.hh>
│ │ │ +
12#include <dune/common/exceptions.hh>
│ │ │
13
│ │ │ -
14namespace Dune::Functions {
│ │ │ +
14#include <dune/localfunctions/hierarchical/hierarchicalp2.hh>
│ │ │
15
│ │ │ -
16
│ │ │ -
17
│ │ │ -
37template<class Element>
│ │ │ -
│ │ │ - │ │ │ -
39{
│ │ │ -
40 using GeometryInFather = typename Element::LocalGeometry;
│ │ │ -
41
│ │ │ -
42 template<class V>
│ │ │ -
43 static auto reverse_view(V&& v)
│ │ │ -
44 {
│ │ │ -
45 return Dune::IteratorRange(v.rbegin(), v.rend());
│ │ │ -
46 }
│ │ │ -
47
│ │ │ -
48public:
│ │ │ -
49
│ │ │ -
51 using LocalCoordinate = typename Element::Geometry::LocalCoordinate;
│ │ │ -
52 //
│ │ │ -
54 using GlobalCoordinate = typename Element::Geometry::LocalCoordinate;
│ │ │ -
55
│ │ │ -
56 GeometryInAncestor() = default;
│ │ │ - │ │ │ -
58
│ │ │ -
│ │ │ - │ │ │ -
67 : storedFineElement_(other.storedFineElement_)
│ │ │ -
68 , storedCoarseElement_(other.storedCoarseElement_)
│ │ │ -
69 , fineElementPtr_(&storedFineElement_)
│ │ │ -
70 , coarseElementPtr_(&storedFineElement_)
│ │ │ -
71 , geometryInFathersVector_(other.geometryInFathersVector_)
│ │ │ -
72 {
│ │ │ -
73 // If other points to external fine element,
│ │ │ -
74 // we point to the same one.
│ │ │ -
75 if (other.fineElementPtr_ != & other.storedFineElement_)
│ │ │ -
76 fineElementPtr_ = other.fineElementPtr_;
│ │ │ -
77 // If the other coarse element is not the stored one,
│ │ │ -
78 // then it's the fine one.
│ │ │ -
79 if (other.coarseElementPtr_ != & other.storedCoarseElement_)
│ │ │ -
80 coarseElementPtr_ = fineElementPtr_;
│ │ │ -
81 }
│ │ │ -
│ │ │ + │ │ │ + │ │ │ + │ │ │ +
19
│ │ │ +
20#include <dune/geometry/type.hh>
│ │ │ +
21
│ │ │ +
22namespace Dune {
│ │ │ +
23 namespace Functions {
│ │ │ +
24
│ │ │ +
25 // *****************************************************************************
│ │ │ +
26 // Implementation for Hierarchical Lagrange Basis
│ │ │ +
27 //
│ │ │ +
28 // - only orders k=1,2 are implemented up to now
│ │ │ +
29 // - order k=1 is identical to the standard Lagrange basis
│ │ │ +
30 // - implementation is restricted to simplex grids
│ │ │ +
31 //
│ │ │ +
32 // *****************************************************************************
│ │ │ +
33
│ │ │ +
43 template<typename GV, int k, typename R = double>
│ │ │ + │ │ │ +
45
│ │ │ +
46 template<typename GV, typename R>
│ │ │ +
│ │ │ + │ │ │ +
48 : public LFEPreBasisMixin<GV, LagrangeSimplexLocalFiniteElement<typename GV::ctype,R,GV::dimension,1>>
│ │ │ +
49 {
│ │ │ + │ │ │ +
51 public:
│ │ │ +
│ │ │ + │ │ │ +
53 Base(gridView, [](GeometryType gt, int) -> std::size_t { return gt.isVertex() ? 1 : 0; })
│ │ │ +
54 {
│ │ │ +
55 for (auto gt : gridView.indexSet().types(0)) {
│ │ │ +
56 if (!gt.isSimplex())
│ │ │ +
57 DUNE_THROW(Dune::NotImplemented,
│ │ │ +
58 "Hierarchical Lagrange basis only implemented for simplex grids.");
│ │ │ +
59 }
│ │ │ +
60 }
│ │ │ +
│ │ │ +
61 };
│ │ │ +
│ │ │ +
62
│ │ │ +
63 template<typename GV, typename R>
│ │ │ +
│ │ │ + │ │ │ +
65 : public LFEPreBasisMixin<GV, HierarchicalP2LocalFiniteElement<typename GV::ctype,R,GV::dimension>>
│ │ │ +
66 {
│ │ │ + │ │ │ +
68 public:
│ │ │ +
│ │ │ + │ │ │ +
70 Base(gridView, [](GeometryType gt, int) -> std::size_t { return (gt.isVertex() || gt.isLine()) ? 1 : 0; })
│ │ │ +
71 {
│ │ │ +
72 for (auto gt : gridView.indexSet().types(0)) {
│ │ │ +
73 if (!gt.isSimplex())
│ │ │ +
74 DUNE_THROW(Dune::NotImplemented,
│ │ │ +
75 "Hierarchical Lagrange basis only implemented for simplex grids.");
│ │ │ +
76 }
│ │ │ +
77 }
│ │ │ +
│ │ │ +
78 };
│ │ │ +
│ │ │ +
79
│ │ │ +
80
│ │ │ +
81 namespace BasisFactory {
│ │ │
82
│ │ │ -
│ │ │ - │ │ │ -
90 : storedFineElement_(other.storedFineElement_)
│ │ │ -
91 , storedCoarseElement_(other.storedCoarseElement_)
│ │ │ -
92 , fineElementPtr_(&fineElement)
│ │ │ -
93 , coarseElementPtr_(&storedFineElement_)
│ │ │ -
94 , geometryInFathersVector_(other.geometryInFathersVector_)
│ │ │ -
95 {
│ │ │ -
96 // If the other coarse element is not the stored one,
│ │ │ -
97 // then it's the fine one.
│ │ │ -
98 if (other.coarseElementPtr_ != & other.storedCoarseElement_)
│ │ │ -
99 coarseElementPtr_ = fineElementPtr_;
│ │ │ -
100 }
│ │ │ +
91 template<int k, typename R=double>
│ │ │ +
│ │ │ + │ │ │ +
93 {
│ │ │ +
94 static_assert(0 < k && k <= 2);
│ │ │ +
95 return [](const auto& gridView) {
│ │ │ +
96 return HierarchicalLagrangePreBasis<std::decay_t<decltype(gridView)>, k, R>(gridView);
│ │ │ +
97 };
│ │ │ +
98 }
│ │ │
│ │ │ +
99
│ │ │ +
100 } // end namespace BasisFactory
│ │ │
101
│ │ │ -
117 template<class F>
│ │ │ -
118 requires (std::is_invocable_r_v<bool,F,Element>)
│ │ │ -
│ │ │ -
119 const Element& bind(const Element& fineElement, F&& includeFather)
│ │ │ -
120 {
│ │ │ -
121 fineElementPtr_ = &fineElement;
│ │ │ -
122 geometryInFathersVector_.clear();
│ │ │ -
123 coarseElementPtr_ = fineElementPtr_;
│ │ │ -
124 while (includeFather(*coarseElementPtr_))
│ │ │ -
125 {
│ │ │ -
126 geometryInFathersVector_.push_back(coarseElementPtr_->geometryInFather());
│ │ │ -
127 storedCoarseElement_ = coarseElementPtr_->father();
│ │ │ -
128 coarseElementPtr_ = &storedCoarseElement_;
│ │ │ -
129 }
│ │ │ -
130 return coarseElement();
│ │ │ -
131 }
│ │ │ -
│ │ │ -
132
│ │ │ -
148 template<class F>
│ │ │ -
149 requires (std::is_invocable_r_v<bool,F,Element>)
│ │ │ -
│ │ │ -
150 const Element& bind(Element&& fineElement, F&& includeFather)
│ │ │ -
151 {
│ │ │ -
152 storedFineElement_ = fineElement;
│ │ │ -
153 bind(storedFineElement_, includeFather);
│ │ │ -
154 }
│ │ │ -
│ │ │ -
155
│ │ │ -
│ │ │ -
157 const Element& fineElement() const
│ │ │ -
158 {
│ │ │ -
159 return *fineElementPtr_;
│ │ │ -
160 }
│ │ │ -
│ │ │ -
161
│ │ │ -
│ │ │ -
163 const Element& coarseElement() const
│ │ │ -
164 {
│ │ │ -
165 return *coarseElementPtr_;
│ │ │ -
166 }
│ │ │ -
│ │ │ -
167
│ │ │ -
│ │ │ - │ │ │ -
170 {
│ │ │ -
171 for (const auto& g : geometryInFathersVector_)
│ │ │ -
172 x = g.global(x);
│ │ │ -
173 return x;
│ │ │ -
174 }
│ │ │ -
│ │ │ -
175
│ │ │ -
│ │ │ - │ │ │ -
178 {
│ │ │ -
179 // Here we can be instead use std::ranges::reverse_view once
│ │ │ -
180 // all supported compilers provide this (gcc>=10, clang>=16).
│ │ │ -
181 for (const auto& g : reverse_view(geometryInFathersVector_))
│ │ │ -
182 x = g.local(x);
│ │ │ -
183 return x;
│ │ │ -
184 }
│ │ │ -
│ │ │ -
185
│ │ │ -
186private:
│ │ │ -
187 Element storedFineElement_;
│ │ │ -
188 Element storedCoarseElement_;
│ │ │ -
189 const Element* fineElementPtr_ = nullptr;
│ │ │ -
190 const Element* coarseElementPtr_ = nullptr;
│ │ │ -
191 std::vector<GeometryInFather> geometryInFathersVector_;
│ │ │ -
192};
│ │ │ -
│ │ │ -
193
│ │ │ -
194
│ │ │ -
195
│ │ │ -
196} // namespace Dune::Functions
│ │ │ -
197
│ │ │ -
198
│ │ │ -
199
│ │ │ -
200
│ │ │ -
201#endif // DUNE_FUNCTIONS_COMMON_GEOMETRYINANCESTOR_HH
│ │ │ +
112 template<typename GV, int k, typename R=double>
│ │ │ + │ │ │ +
114
│ │ │ +
115 } // end namespace Functions
│ │ │ +
116} // end namespace Dune
│ │ │ +
117
│ │ │ +
118#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH
│ │ │ + │ │ │ + │ │ │ + │ │ │ +
DefaultGlobalBasis< HierarchicalLagrangePreBasis< GV, k, R > > HierarchicalLagrangeBasis
Basis of a scalar Hierarchical Lagrange finite element space.
Definition hierarchicallagrangebasis.hh:113
│ │ │ +
auto hierarchicalLagrange()
A factory that can create a HierarchicalLagrange pre-basis.
Definition hierarchicallagrangebasis.hh:92
│ │ │ +
Definition monomialset.hh:19
│ │ │
Definition monomialset.hh:19
│ │ │ -
GeometryInAncestor(const GeometryInAncestor &other, const Element &fineElement)
Copy construction setting an external fine element.
Definition geometryinancestor.hh:89
│ │ │ -
GeometryInAncestor(GeometryInAncestor &&)=delete
│ │ │ -
const Element & fineElement() const
Return the fine element.
Definition geometryinancestor.hh:157
│ │ │ -
GlobalCoordinate global(LocalCoordinate x) const
Map local coordinate in fine element into coarse element.
Definition geometryinancestor.hh:169
│ │ │ -
const Element & bind(const Element &fineElement, F &&includeFather)
Bind this GeometryInAncestor to a fine element and search coarse element.
Definition geometryinancestor.hh:119
│ │ │ -
const Element & coarseElement() const
Return the coarse element.
Definition geometryinancestor.hh:163
│ │ │ - │ │ │ -
GeometryInAncestor(const GeometryInAncestor &other)
Copy constructor.
Definition geometryinancestor.hh:66
│ │ │ -
LocalCoordinate local(GlobalCoordinate x) const
Map local coordinate in coarse element into fine element.
Definition geometryinancestor.hh:177
│ │ │ -
typename Element::Geometry::LocalCoordinate LocalCoordinate
Type of local coordinate (local within fine element).
Definition geometryinancestor.hh:51
│ │ │ -
typename Element::Geometry::LocalCoordinate GlobalCoordinate
Type of global coordinate (local within coarse element).
Definition geometryinancestor.hh:54
│ │ │ -
const Element & bind(Element &&fineElement, F &&includeFather)
Bind this GeometryInAncestor to a fine element and search coarse element.
Definition geometryinancestor.hh:150
│ │ │ +
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:53
│ │ │ +
A pre-basis for a hierarchical Lagrange basis.
Definition hierarchicallagrangebasis.hh:44
│ │ │ +
HierarchicalLagrangePreBasis(const GV &gridView)
Definition hierarchicallagrangebasis.hh:52
│ │ │ +
HierarchicalLagrangePreBasis(const GV &gridView)
Definition hierarchicallagrangebasis.hh:69
│ │ │ + │ │ │ +
LFEPreBasisMixin(const GridView &gv, MCMGLayout layout)
Definition lfeprebasismixin.hh:75
│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,193 +1,152 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -geometryinancestor.hh │ │ │ │ +hierarchicallagrangebasis.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_COMMON_GEOMETRYINANCESTOR_HH │ │ │ │ -8#define DUNE_FUNCTIONS_COMMON_GEOMETRYINANCESTOR_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH │ │ │ │ +8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ +10#include │ │ │ │ 11 │ │ │ │ -12#include │ │ │ │ +12#include │ │ │ │ 13 │ │ │ │ -14namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ +14#include │ │ │ │ 15 │ │ │ │ -16 │ │ │ │ -17 │ │ │ │ -37template │ │ │ │ -_3_8class _G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r │ │ │ │ -39{ │ │ │ │ -40 using GeometryInFather = typename Element::LocalGeometry; │ │ │ │ -41 │ │ │ │ -42 template │ │ │ │ -43 static auto reverse_view(V&& v) │ │ │ │ -44 { │ │ │ │ -45 return Dune::IteratorRange(v.rbegin(), v.rend()); │ │ │ │ -46 } │ │ │ │ -47 │ │ │ │ -48public: │ │ │ │ -49 │ │ │ │ -_5_1 using _L_o_c_a_l_C_o_o_r_d_i_n_a_t_e = typename Element::Geometry::LocalCoordinate; │ │ │ │ -52 // │ │ │ │ -_5_4 using _G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e = typename Element::Geometry::LocalCoordinate; │ │ │ │ -55 │ │ │ │ -_5_6 _G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r() = default; │ │ │ │ -_5_7 _G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r(_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r&&) = delete; │ │ │ │ -58 │ │ │ │ -_6_6 _G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r(const _G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r& other) │ │ │ │ -67 : storedFineElement_(other.storedFineElement_) │ │ │ │ -68 , storedCoarseElement_(other.storedCoarseElement_) │ │ │ │ -69 , fineElementPtr_(&storedFineElement_) │ │ │ │ -70 , coarseElementPtr_(&storedFineElement_) │ │ │ │ -71 , geometryInFathersVector_(other.geometryInFathersVector_) │ │ │ │ -72 { │ │ │ │ -73 // If other points to external fine element, │ │ │ │ -74 // we point to the same one. │ │ │ │ -75 if (other.fineElementPtr_ != & other.storedFineElement_) │ │ │ │ -76 fineElementPtr_ = other.fineElementPtr_; │ │ │ │ -77 // If the other coarse element is not the stored one, │ │ │ │ -78 // then it's the fine one. │ │ │ │ -79 if (other.coarseElementPtr_ != & other.storedCoarseElement_) │ │ │ │ -80 coarseElementPtr_ = fineElementPtr_; │ │ │ │ -81 } │ │ │ │ +16#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ +17#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ +18#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_f_e_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h> │ │ │ │ +19 │ │ │ │ +20#include │ │ │ │ +21 │ │ │ │ +22namespace _D_u_n_e { │ │ │ │ +23 namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ +24 │ │ │ │ +25 / │ │ │ │ +/ ***************************************************************************** │ │ │ │ +26 // Implementation for Hierarchical Lagrange Basis │ │ │ │ +27 // │ │ │ │ +28 // - only orders k=1,2 are implemented up to now │ │ │ │ +29 // - order k=1 is identical to the standard Lagrange basis │ │ │ │ +30 // - implementation is restricted to simplex grids │ │ │ │ +31 // │ │ │ │ +32 / │ │ │ │ +/ ***************************************************************************** │ │ │ │ +33 │ │ │ │ +43 template │ │ │ │ +_4_4 class _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s; │ │ │ │ +45 │ │ │ │ +46 template │ │ │ │ +_4_7 class _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s │ │ │ │ +48 : public _L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n> │ │ │ │ +49 { │ │ │ │ +50 using Base = _L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_<_G_V_,_ _L_a_g_r_a_n_g_e_S_i_m_p_l_e_x_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_t_y_p_e_n_a_m_e │ │ │ │ +_G_V_:_:_c_t_y_p_e_,_R_,_G_V_:_:_d_i_m_e_n_s_i_o_n_,_1_>>; │ │ │ │ +51 public: │ │ │ │ +_5_2 _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s (const GV& _g_r_i_d_V_i_e_w) : │ │ │ │ +53 Base(_g_r_i_d_V_i_e_w, [](GeometryType gt, int) -> std::size_t { return gt.isVertex │ │ │ │ +() ? 1 : 0; }) │ │ │ │ +54 { │ │ │ │ +55 for (auto gt : gridView.indexSet().types(0)) { │ │ │ │ +56 if (!gt.isSimplex()) │ │ │ │ +57 DUNE_THROW(Dune::NotImplemented, │ │ │ │ +58 "Hierarchical Lagrange basis only implemented for simplex grids."); │ │ │ │ +59 } │ │ │ │ +60 } │ │ │ │ +61 }; │ │ │ │ +62 │ │ │ │ +63 template │ │ │ │ +_6_4 class _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s │ │ │ │ +65 : public _L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n> │ │ │ │ +66 { │ │ │ │ +67 using Base = _L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_<_G_V_,_ _H_i_e_r_a_r_c_h_i_c_a_l_P_2_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_t_y_p_e_n_a_m_e │ │ │ │ +_G_V_:_:_c_t_y_p_e_,_R_,_G_V_:_:_d_i_m_e_n_s_i_o_n_>>; │ │ │ │ +68 public: │ │ │ │ +_6_9 _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s (const GV& _g_r_i_d_V_i_e_w) : │ │ │ │ +70 Base(_g_r_i_d_V_i_e_w, [](GeometryType gt, int) -> std::size_t { return (gt.isVertex │ │ │ │ +() || gt.isLine()) ? 1 : 0; }) │ │ │ │ +71 { │ │ │ │ +72 for (auto gt : gridView.indexSet().types(0)) { │ │ │ │ +73 if (!gt.isSimplex()) │ │ │ │ +74 DUNE_THROW(Dune::NotImplemented, │ │ │ │ +75 "Hierarchical Lagrange basis only implemented for simplex grids."); │ │ │ │ +76 } │ │ │ │ +77 } │ │ │ │ +78 }; │ │ │ │ +79 │ │ │ │ +80 │ │ │ │ +81 namespace BasisFactory { │ │ │ │ 82 │ │ │ │ -_8_9 _G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r(const _G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r& other, const Element& │ │ │ │ -_f_i_n_e_E_l_e_m_e_n_t) │ │ │ │ -90 : storedFineElement_(other.storedFineElement_) │ │ │ │ -91 , storedCoarseElement_(other.storedCoarseElement_) │ │ │ │ -92 , fineElementPtr_(&_f_i_n_e_E_l_e_m_e_n_t) │ │ │ │ -93 , coarseElementPtr_(&storedFineElement_) │ │ │ │ -94 , geometryInFathersVector_(other.geometryInFathersVector_) │ │ │ │ -95 { │ │ │ │ -96 // If the other coarse element is not the stored one, │ │ │ │ -97 // then it's the fine one. │ │ │ │ -98 if (other.coarseElementPtr_ != & other.storedCoarseElement_) │ │ │ │ -99 coarseElementPtr_ = fineElementPtr_; │ │ │ │ -100 } │ │ │ │ +91 template │ │ │ │ +_9_2 auto _h_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e() │ │ │ │ +93 { │ │ │ │ +94 static_assert(0 < k && k <= 2); │ │ │ │ +95 return [](const auto& gridView) { │ │ │ │ +96 return _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s, k, R> │ │ │ │ +(gridView); │ │ │ │ +97 }; │ │ │ │ +98 } │ │ │ │ +99 │ │ │ │ +100 } // end namespace BasisFactory │ │ │ │ 101 │ │ │ │ -117 template │ │ │ │ -118 requires (std::is_invocable_r_v) │ │ │ │ -_1_1_9 const Element& _b_i_n_d(const Element& _f_i_n_e_E_l_e_m_e_n_t, F&& includeFather) │ │ │ │ -120 { │ │ │ │ -121 fineElementPtr_ = &_f_i_n_e_E_l_e_m_e_n_t; │ │ │ │ -122 geometryInFathersVector_.clear(); │ │ │ │ -123 coarseElementPtr_ = fineElementPtr_; │ │ │ │ -124 while (includeFather(*coarseElementPtr_)) │ │ │ │ -125 { │ │ │ │ -126 geometryInFathersVector_.push_back(coarseElementPtr_->geometryInFather()); │ │ │ │ -127 storedCoarseElement_ = coarseElementPtr_->father(); │ │ │ │ -128 coarseElementPtr_ = &storedCoarseElement_; │ │ │ │ -129 } │ │ │ │ -130 return _c_o_a_r_s_e_E_l_e_m_e_n_t(); │ │ │ │ -131 } │ │ │ │ -132 │ │ │ │ -148 template │ │ │ │ -149 requires (std::is_invocable_r_v) │ │ │ │ -_1_5_0 const Element& _b_i_n_d(Element&& _f_i_n_e_E_l_e_m_e_n_t, F&& includeFather) │ │ │ │ -151 { │ │ │ │ -152 storedFineElement_ = _f_i_n_e_E_l_e_m_e_n_t; │ │ │ │ -153 _b_i_n_d(storedFineElement_, includeFather); │ │ │ │ -154 } │ │ │ │ -155 │ │ │ │ -_1_5_7 const Element& _f_i_n_e_E_l_e_m_e_n_t() const │ │ │ │ -158 { │ │ │ │ -159 return *fineElementPtr_; │ │ │ │ -160 } │ │ │ │ -161 │ │ │ │ -_1_6_3 const Element& _c_o_a_r_s_e_E_l_e_m_e_n_t() const │ │ │ │ -164 { │ │ │ │ -165 return *coarseElementPtr_; │ │ │ │ -166 } │ │ │ │ -167 │ │ │ │ -_1_6_9 _G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e _g_l_o_b_a_l(_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e x) const │ │ │ │ -170 { │ │ │ │ -171 for (const auto& g : geometryInFathersVector_) │ │ │ │ -172 x = g.global(x); │ │ │ │ -173 return x; │ │ │ │ -174 } │ │ │ │ -175 │ │ │ │ -_1_7_7 _L_o_c_a_l_C_o_o_r_d_i_n_a_t_e _l_o_c_a_l(_G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e x) const │ │ │ │ -178 { │ │ │ │ -179 // Here we can be instead use std::ranges::reverse_view once │ │ │ │ -180 // all supported compilers provide this (gcc>=10, clang>=16). │ │ │ │ -181 for (const auto& g : reverse_view(geometryInFathersVector_)) │ │ │ │ -182 x = g.local(x); │ │ │ │ -183 return x; │ │ │ │ -184 } │ │ │ │ -185 │ │ │ │ -186private: │ │ │ │ -187 Element storedFineElement_; │ │ │ │ -188 Element storedCoarseElement_; │ │ │ │ -189 const Element* fineElementPtr_ = nullptr; │ │ │ │ -190 const Element* coarseElementPtr_ = nullptr; │ │ │ │ -191 std::vector geometryInFathersVector_; │ │ │ │ -192}; │ │ │ │ -193 │ │ │ │ -194 │ │ │ │ -195 │ │ │ │ -196} // namespace Dune::Functions │ │ │ │ -197 │ │ │ │ -198 │ │ │ │ -199 │ │ │ │ -200 │ │ │ │ -201#endif // DUNE_FUNCTIONS_COMMON_GEOMETRYINANCESTOR_HH │ │ │ │ +112 template │ │ │ │ +_1_1_3 using _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_B_a_s_i_s = │ │ │ │ +_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s_<_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_G_V_,_ _k_,_ _R_> >; │ │ │ │ +114 │ │ │ │ +115 } // end namespace Functions │ │ │ │ +116} // end namespace Dune │ │ │ │ +117 │ │ │ │ +118#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH │ │ │ │ +_n_o_d_e_s_._h_h │ │ │ │ +_l_f_e_p_r_e_b_a_s_i_s_m_i_x_i_n_._h_h │ │ │ │ +_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_B_a_s_i_s │ │ │ │ +DefaultGlobalBasis< HierarchicalLagrangePreBasis< GV, k, R > > │ │ │ │ +HierarchicalLagrangeBasis │ │ │ │ +Basis of a scalar Hierarchical Lagrange finite element space. │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:113 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_h_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e │ │ │ │ +auto hierarchicalLagrange() │ │ │ │ +A factory that can create a HierarchicalLagrange pre-basis. │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:92 │ │ │ │ +_D_u_n_e │ │ │ │ +DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r │ │ │ │ -GeometryInAncestor(const GeometryInAncestor &other, const Element &fineElement) │ │ │ │ -Copy construction setting an external fine element. │ │ │ │ -DDeeffiinniittiioonn geometryinancestor.hh:89 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r │ │ │ │ -GeometryInAncestor(GeometryInAncestor &&)=delete │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_f_i_n_e_E_l_e_m_e_n_t │ │ │ │ -const Element & fineElement() const │ │ │ │ -Return the fine element. │ │ │ │ -DDeeffiinniittiioonn geometryinancestor.hh:157 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_g_l_o_b_a_l │ │ │ │ -GlobalCoordinate global(LocalCoordinate x) const │ │ │ │ -Map local coordinate in fine element into coarse element. │ │ │ │ -DDeeffiinniittiioonn geometryinancestor.hh:169 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_b_i_n_d │ │ │ │ -const Element & bind(const Element &fineElement, F &&includeFather) │ │ │ │ -Bind this GeometryInAncestor to a fine element and search coarse element. │ │ │ │ -DDeeffiinniittiioonn geometryinancestor.hh:119 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_c_o_a_r_s_e_E_l_e_m_e_n_t │ │ │ │ -const Element & coarseElement() const │ │ │ │ -Return the coarse element. │ │ │ │ -DDeeffiinniittiioonn geometryinancestor.hh:163 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r │ │ │ │ -GeometryInAncestor()=default │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r │ │ │ │ -GeometryInAncestor(const GeometryInAncestor &other) │ │ │ │ -Copy constructor. │ │ │ │ -DDeeffiinniittiioonn geometryinancestor.hh:66 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_l_o_c_a_l │ │ │ │ -LocalCoordinate local(GlobalCoordinate x) const │ │ │ │ -Map local coordinate in coarse element into fine element. │ │ │ │ -DDeeffiinniittiioonn geometryinancestor.hh:177 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ -typename Element::Geometry::LocalCoordinate LocalCoordinate │ │ │ │ -Type of local coordinate (local within fine element). │ │ │ │ -DDeeffiinniittiioonn geometryinancestor.hh:51 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ -typename Element::Geometry::LocalCoordinate GlobalCoordinate │ │ │ │ -Type of global coordinate (local within coarse element). │ │ │ │ -DDeeffiinniittiioonn geometryinancestor.hh:54 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_G_e_o_m_e_t_r_y_I_n_A_n_c_e_s_t_o_r_:_:_b_i_n_d │ │ │ │ -const Element & bind(Element &&fineElement, F &&includeFather) │ │ │ │ -Bind this GeometryInAncestor to a fine element and search coarse element. │ │ │ │ -DDeeffiinniittiioonn geometryinancestor.hh:150 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ +Global basis for given pre-basis. │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:53 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s │ │ │ │ +A pre-basis for a hierarchical Lagrange basis. │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:44 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _1_,_ _R_ _>_:_: │ │ │ │ +_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s │ │ │ │ +HierarchicalLagrangePreBasis(const GV &gridView) │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:52 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_ _G_V_,_ _2_,_ _R_ _>_:_: │ │ │ │ +_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s │ │ │ │ +HierarchicalLagrangePreBasis(const GV &gridView) │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:69 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_<_ _G_V_,_ _L_a_g_r_a_n_g_e_S_i_m_p_l_e_x_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_ _G_V_:_: │ │ │ │ +_c_t_y_p_e_,_ _R_,_ _G_V_:_:_d_i_m_e_n_s_i_o_n_,_ _1_ _>_ _>_:_:_g_r_i_d_V_i_e_w │ │ │ │ +const GridView & gridView() const │ │ │ │ +DDeeffiinniittiioonn leafprebasismappermixin.hh:95 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n_<_ _G_V_,_ _L_a_g_r_a_n_g_e_S_i_m_p_l_e_x_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t_<_ _G_V_:_: │ │ │ │ +_c_t_y_p_e_,_ _R_,_ _G_V_:_:_d_i_m_e_n_s_i_o_n_,_ _1_ _>_ _>_:_:_L_F_E_P_r_e_B_a_s_i_s_M_i_x_i_n │ │ │ │ +LFEPreBasisMixin(const GridView &gv, MCMGLayout layout) │ │ │ │ +DDeeffiinniittiioonn lfeprebasismixin.hh:75 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _g_e_o_m_e_t_r_y_i_n_a_n_c_e_s_t_o_r_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _h_i_e_r_a_r_c_h_i_c_a_l_l_a_g_r_a_n_g_e_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00245.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: functionconcepts.hh File Reference │ │ │ +Dune-Functions: containerdescriptors.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,108 +88,107 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
functionconcepts.hh File Reference
│ │ │ +
containerdescriptors.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <dune/common/typelist.hh>
│ │ │ -#include <dune/common/concept.hh>
│ │ │ -#include <dune/functions/common/signature.hh>
│ │ │ -#include <dune/functions/gridfunctions/localderivativetraits.hh>
│ │ │ -#include <dune/functions/gridfunctions/gridviewentityset.hh>
│ │ │ + │ │ │ +

Lightweight representation of (hierarchical) size and block structure extracted from a basis to describe data structures like containers that can be accessed by multi-indices provided by the basis. │ │ │ +More...

│ │ │ +
#include <array>
│ │ │ +#include <cassert>
│ │ │ +#include <functional>
│ │ │ +#include <type_traits>
│ │ │ +#include <vector>
│ │ │ +#include <dune/common/filledarray.hh>
│ │ │ +#include <dune/common/tuplevector.hh>
│ │ │ +#include <dune/common/typeutilities.hh>
│ │ │ +#include <dune/common/hybridutilities.hh>
│ │ │ +#include <dune/common/rangeutilities.hh>
│ │ │ +#include <dune/functions/common/type_traits.hh>
│ │ │ +#include <dune/functions/functionspacebases/basistags.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

struct  Dune::Functions::Concept::Callable< Args >
 Concept objects that can be called with given argument list. More...
struct  Dune::Functions::Concept::Function< Range(Domain)>
 Concept for a function mapping Domain to Range. More...
struct  Dune::Functions::Concept::DifferentiableFunction< Range(Domain), DerivativeTraits >
 Concept for a differentiable function mapping Domain to Range. More...
struct  Dune::Functions::Concept::LocalFunction< Range(Domain), LocalContext >
 Concept for a local function mapping Domain to Range. More...
struct  Dune::Functions::Concept::DifferentiableLocalFunction< Range(Domain), LocalContext, DerivativeTraits >
 Concept for a differentiable local function mapping Domain to Range. More...
struct  Dune::Functions::Concept::EntitySet
 Concept for an entity set for a Concept::GridFunction<Range(Domain), EntitySet, DerivativeTraits>. More...
struct  Dune::Functions::Concept::GridFunction< Range(Domain), EntitySet >
 Concept for a grid function mapping Domain to Range. More...
struct  Dune::Functions::Concept::DifferentiableGridFunction< Range(Domain), EntitySet, DerivativeTraits >
 Concept for a differentiable grid function mapping Domain to Range. More...
struct  Dune::Functions::Concept::GridViewFunction< Range(Domain), GridView >
 Concept for a grid view function mapping Domain to Range. More...
struct  Dune::Functions::Concept::DifferentiableGridViewFunction< Range(Domain), GridView, DerivativeTraits >
 Concept for a differentiable grid view function mapping Domain to Range. More...
struct  Dune::Functions::ContainerDescriptors::Unknown
 Fallback container descriptor if nothing else fits. More...
struct  Dune::Functions::ContainerDescriptors::Value
 The node in the descriptor tree representing a value placeholder. More...
struct  Dune::Functions::ContainerDescriptors::UniformArray< Child, n >
 Descriptor for arrays with all children identical and the number of children a static size. More...
struct  Dune::Functions::ContainerDescriptors::UniformVector< Child >
 Uniform descriptor with dynamic size. More...
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ + │ │ │ +

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::Concept
namespace  Dune::Functions::ContainerDescriptors
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ +Typedefs

template<class... Children>
using Dune::Functions::ContainerDescriptors::Tuple = Dune::TupleVector<Children...>
 Descriptor with all children of possibly different type.
template<class Child, std::size_t n>
using Dune::Functions::ContainerDescriptors::Array = std::array<Child, n>
 Descriptor for arrays with all children of the same type and static size.
template<class Child>
using Dune::Functions::ContainerDescriptors::Vector = std::vector<Child>
 Descriptor for vectors with all children of the same type and dynamic size.
template<std::size_t n>
using Dune::Functions::ContainerDescriptors::FlatArray = UniformArray<Value,n>
 Alias for a uniform array storing value placeholders.
using Dune::Functions::ContainerDescriptors::FlatVector = UniformVector<Value>
 Alias for a uniform vector storing value placeholders.
│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Functions

template<class F, class... Args>
static constexpr auto Dune::Functions::Concept::isCallable ()
 Check if f is callable with given argument list.
template<class F, class... Args>
static constexpr auto Dune::Functions::Concept::isCallable (F &&, Args &&...)
 Check if f is callable with given argument list.
template<class F, class Signature>
static constexpr bool Dune::Functions::Concept::isFunction ()
 Check if F models the Function concept with given signature.
template<class F, class Signature, template< class > class DerivativeTraits>
static constexpr bool Dune::Functions::Concept::isFunction (F &&f, SignatureTag< Signature, DerivativeTraits >)
 Check if f models the Function concept with given signature.
template<class F, class Signature, template< class > class DerivativeTraits = DefaultDerivativeTraits>
static constexpr bool Dune::Functions::Concept::isDifferentiableFunction ()
 Check if F models the DifferentiableFunction concept with given signature.
template<class F, class Signature, template< class > class DerivativeTraits>
static constexpr bool Dune::Functions::Concept::isDifferentiableFunction (F &&f, SignatureTag< Signature, DerivativeTraits >)
 Check if f models the DifferentiableFunction concept with given signature.
template<class F, class Signature, class LocalContext>
static constexpr bool Dune::Functions::Concept::isLocalFunction ()
 Check if F models the LocalFunction concept with given signature and local context.
template<class F, class Signature, class LocalContext, template< class > class DerivativeTraits = DefaultDerivativeTraits>
static constexpr bool Dune::Functions::Concept::isDifferentiableLocalFunction ()
 Check if F models the DifferentiableLocalFunction concept with given signature and local context.
template<class E>
static constexpr bool Dune::Functions::Concept::isEntitySet ()
 Check if F models the GridFunction concept with given signature and entity set.
template<class F, class Signature, class EntitySet>
static constexpr bool Dune::Functions::Concept::isGridFunction ()
 Check if F models the GridFunction concept with given signature and entity set.
template<class F, class Signature, class EntitySet, template< class > class DerivativeTraits = DefaultDerivativeTraits>
static constexpr bool Dune::Functions::Concept::isDifferentiableGridFunction ()
 Check if F models the DifferentiableGridFunction concept with given signature and entity set.
template<class F, class Signature, class GridView>
static constexpr bool Dune::Functions::Concept::isGridViewFunction ()
 Check if F models the GridViewFunction concept with given signature.
template<class F, class Signature, class GridView, template< class > class DerivativeTraits = DefaultDerivativeTraits>
static constexpr bool Dune::Functions::Concept::isDifferentiableGridViewFunction ()
 Check if F models the DifferentiableGridViewFunction concept with given signature.
template<class PreBasis>
auto Dune::Functions::containerDescriptor (const PreBasis &preBasis)
 Return the container descriptor of the pre-basis, if defined, otherwise ContainerDescriptor::Unknown.
template<class Child0, class... Children, std::enable_if_t<(std::is_same_v< Child0, Children > &&...), int > = 0>
auto Dune::Functions::ContainerDescriptors::makeDescriptor (Child0 child, Children... children)
 Generate a descriptor in case the children are all of the same type.
template<class Child, std::size_t n>
auto Dune::Functions::ContainerDescriptors::makeUniformDescriptor (std::integral_constant< std::size_t, n >, Child child)
 Generate a uniform descriptor in case the size is a static constant.
template<class Child>
auto Dune::Functions::ContainerDescriptors::makeUniformDescriptor (std::size_t n, Child child)
 Generate a uniform descriptor in case the size is a dynamic value.
│ │ │ -
│ │ │ +

Detailed Description

│ │ │ +

Lightweight representation of (hierarchical) size and block structure extracted from a basis to describe data structures like containers that can be accessed by multi-indices provided by the basis.

│ │ │ +

The structure of a container-descriptor is a reduced container interface:

struct [Container]Descriptor
│ │ │ +
{
│ │ │ +
template<class Index>
│ │ │ +
[SubContainerDescriptor] operator[](Index i) const; // return the i-th sub-container-descriptor
│ │ │ +
│ │ │ +
[static constexpr] std::size_t size() [const]; // return the number of children
│ │ │ +
};
│ │ │ +

With the operator[] you can access the children. The Index type is either an integral value or an integral_constant for tuple nodes.

│ │ │ +

Size is either a static property, or a runtime value.

│ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,109 +1,92 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -functionconcepts.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_s_i_g_n_a_t_u_r_e_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_l_o_c_a_l_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h> │ │ │ │ +containerdescriptors.hh File Reference │ │ │ │ +Lightweight representation of (hierarchical) size and block structure extracted │ │ │ │ +from a basis to describe data structures like containers that can be accessed │ │ │ │ +by multi-indices provided by the basis. _M_o_r_e_._._. │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_b_a_s_i_s_t_a_g_s_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_C_a_l_l_a_b_l_e_<_ _A_r_g_s_ _> │ │ │ │ -  _C_o_n_c_e_p_t objects that can be called with given argument list. _M_o_r_e_._._. │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_> │ │ │ │ -  _C_o_n_c_e_p_t for a function mapping Domain to Range. _M_o_r_e_._._. │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ - _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _> │ │ │ │ -  _C_o_n_c_e_p_t for a differentiable function mapping Domain to Range. _M_o_r_e_._._. │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _L_o_c_a_l_C_o_n_t_e_x_t_ _> │ │ │ │ -  _C_o_n_c_e_p_t for a local function mapping Domain to Range. _M_o_r_e_._._. │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_L_o_c_a_l_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ - _L_o_c_a_l_C_o_n_t_e_x_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _> │ │ │ │ -  _C_o_n_c_e_p_t for a differentiable local function mapping Domain to Range. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_k_n_o_w_n │ │ │ │ +  Fallback container descriptor if nothing else fits. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_V_a_l_u_e │ │ │ │ +  The node in the descriptor tree representing a value placeholder. │ │ │ │ _M_o_r_e_._._. │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_E_n_t_i_t_y_S_e_t │ │ │ │ -  _C_o_n_c_e_p_t for an entity set for a _C_o_n_c_e_p_t_:_:_G_r_i_d_F_u_n_c_t_i_o_n_<_R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ - _E_n_t_i_t_y_S_e_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_>. _M_o_r_e_._._. │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_n_t_i_t_y_S_e_t_ _> │ │ │ │ -  _C_o_n_c_e_p_t for a grid function mapping Domain to Range. _M_o_r_e_._._. │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ - _E_n_t_i_t_y_S_e_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _> │ │ │ │ -  _C_o_n_c_e_p_t for a differentiable grid function mapping Domain to Range. │ │ │ │ - _M_o_r_e_._._. │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_r_i_d_V_i_e_w_ _> │ │ │ │ -  _C_o_n_c_e_p_t for a grid view function mapping Domain to Range. _M_o_r_e_._._. │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e │ │ │ │ - _(_D_o_m_a_i_n_)_,_ _G_r_i_d_V_i_e_w_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _> │ │ │ │ -  _C_o_n_c_e_p_t for a differentiable grid view function mapping Domain to │ │ │ │ - Range. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_i_f_o_r_m_A_r_r_a_y_<_ _C_h_i_l_d_,_ _n_ _> │ │ │ │ +  Descriptor for arrays with all children identical and the number of │ │ │ │ + children a static size. _M_o_r_e_._._. │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_i_f_o_r_m_V_e_c_t_o_r_<_ _C_h_i_l_d_ _> │ │ │ │ +  Uniform descriptor with dynamic size. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t │ │ │ │ +namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s │ │ │ │ +TTyyppeeddeeffss │ │ │ │ +template │ │ │ │ +using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_T_u_p_l_e = Dune:: │ │ │ │ + TupleVector │ │ │ │ +  Descriptor with all children of possibly different type. │ │ │ │ +template │ │ │ │ +using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_A_r_r_a_y = std::array │ │ │ │ +  Descriptor for arrays with all children of the same type and static │ │ │ │ + size. │ │ │ │ +template │ │ │ │ +using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_V_e_c_t_o_r = std::vector │ │ │ │ +  Descriptor for vectors with all children of the same type and dynamic │ │ │ │ + size. │ │ │ │ +template │ │ │ │ +using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_F_l_a_t_A_r_r_a_y = _U_n_i_f_o_r_m_A_r_r_a_y<_V_a_l_u_e,n> │ │ │ │ +  Alias for a uniform array storing value placeholders. │ │ │ │ +using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_F_l_a_t_V_e_c_t_o_r = _U_n_i_f_o_r_m_V_e_c_t_o_r<_V_a_l_u_e> │ │ │ │ +  Alias for a uniform vector storing value placeholders. │ │ │ │ FFuunnccttiioonnss │ │ │ │ -template │ │ │ │ -static constexpr auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_C_a_l_l_a_b_l_e () │ │ │ │ -  Check if f is callable with given argument list. │ │ │ │ -template │ │ │ │ -static constexpr auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_C_a_l_l_a_b_l_e (F &&, Args &&...) │ │ │ │ -  Check if f is callable with given argument list. │ │ │ │ -template │ │ │ │ -static constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_F_u_n_c_t_i_o_n () │ │ │ │ -  Check if F models the _F_u_n_c_t_i_o_n concept with given │ │ │ │ - signature. │ │ │ │ -template class DerivativeTraits> │ │ │ │ -static constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_F_u_n_c_t_i_o_n (F &&f, │ │ │ │ - _S_i_g_n_a_t_u_r_e_T_a_g< Signature, DerivativeTraits >) │ │ │ │ -  Check if f models the _F_u_n_c_t_i_o_n concept with given │ │ │ │ - signature. │ │ │ │ -template class DerivativeTraits = │ │ │ │ -DefaultDerivativeTraits> │ │ │ │ -static constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n () │ │ │ │ -  Check if F models the _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n concept │ │ │ │ - with given signature. │ │ │ │ -template class DerivativeTraits> │ │ │ │ -static constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n (F │ │ │ │ - &&f, _S_i_g_n_a_t_u_r_e_T_a_g< Signature, DerivativeTraits >) │ │ │ │ -  Check if f models the _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n concept │ │ │ │ - with given signature. │ │ │ │ -template │ │ │ │ -static constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_L_o_c_a_l_F_u_n_c_t_i_o_n () │ │ │ │ -  Check if F models the _L_o_c_a_l_F_u_n_c_t_i_o_n concept with given │ │ │ │ - signature and local context. │ │ │ │ -template class │ │ │ │ -DerivativeTraits = DefaultDerivativeTraits> │ │ │ │ -static constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_D_i_f_f_e_r_e_n_t_i_a_b_l_e_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ - () │ │ │ │ -  Check if F models the _D_i_f_f_e_r_e_n_t_i_a_b_l_e_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ - concept with given signature and local context. │ │ │ │ -template │ │ │ │ -static constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_E_n_t_i_t_y_S_e_t () │ │ │ │ -  Check if F models the _G_r_i_d_F_u_n_c_t_i_o_n concept with given │ │ │ │ - signature and entity set. │ │ │ │ -template │ │ │ │ -static constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_G_r_i_d_F_u_n_c_t_i_o_n () │ │ │ │ -  Check if F models the _G_r_i_d_F_u_n_c_t_i_o_n concept with given │ │ │ │ - signature and entity set. │ │ │ │ -template class │ │ │ │ -DerivativeTraits = DefaultDerivativeTraits> │ │ │ │ -static constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ - () │ │ │ │ -  Check if F models the _D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_F_u_n_c_t_i_o_n concept │ │ │ │ - with given signature and entity set. │ │ │ │ -template │ │ │ │ -static constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n () │ │ │ │ -  Check if F models the _G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n concept with │ │ │ │ - given signature. │ │ │ │ -template class │ │ │ │ -DerivativeTraits = DefaultDerivativeTraits> │ │ │ │ -static constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_: │ │ │ │ - _i_s_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n () │ │ │ │ -  Check if F models the _D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ - concept with given signature. │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r (const PreBasis &preBasis) │ │ │ │ +  Return the container descriptor of the pre-basis, if defined, otherwise │ │ │ │ + ContainerDescriptor::Unknown. │ │ │ │ +template &&...), int > = 0> │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_m_a_k_e_D_e_s_c_r_i_p_t_o_r (Child0 child, │ │ │ │ + Children... children) │ │ │ │ +  Generate a descriptor in case the children are all of the same type. │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_m_a_k_e_U_n_i_f_o_r_m_D_e_s_c_r_i_p_t_o_r (std:: │ │ │ │ + integral_constant< std::size_t, n >, Child child) │ │ │ │ +  Generate a uniform descriptor in case the size is a static constant. │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_m_a_k_e_U_n_i_f_o_r_m_D_e_s_c_r_i_p_t_o_r (std::size_t │ │ │ │ + n, Child child) │ │ │ │ +  Generate a uniform descriptor in case the size is a dynamic value. │ │ │ │ +********** DDeettaaiilleedd DDeessccrriippttiioonn ********** │ │ │ │ +Lightweight representation of (hierarchical) size and block structure extracted │ │ │ │ +from a basis to describe data structures like containers that can be accessed │ │ │ │ +by multi-indices provided by the basis. │ │ │ │ +The structure of a container-descriptor is a reduced container interface: │ │ │ │ +struct [Container]Descriptor │ │ │ │ +{ │ │ │ │ +template │ │ │ │ +[SubContainerDescriptor] operator[](Index i) const; // return the i-th sub- │ │ │ │ +container-descriptor │ │ │ │ +[static constexpr] std::size_t size() [const]; // return the number of children │ │ │ │ +}; │ │ │ │ +With the operator[] you can access the children. The Index type is either an │ │ │ │ +integral value or an integral_constant for tuple nodes. │ │ │ │ +Size is either a static property, or a runtime value. │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00245.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ var a00245 = [ │ │ │ │ - ["Dune::Functions::Concept::isCallable", "a00314.html#ga2bc5056bab5babdfa8a82409665f5a26", null], │ │ │ │ - ["Dune::Functions::Concept::isCallable", "a00314.html#ga5d8c4be87961f1cff0cb71fc7c7f4c61", null], │ │ │ │ - ["Dune::Functions::Concept::isDifferentiableFunction", "a00306.html#ga6c75551b9678848113181d29678ec81e", null], │ │ │ │ - ["Dune::Functions::Concept::isDifferentiableFunction", "a00306.html#ga2ce66508daac0e7fab4ea581865b13c3", null], │ │ │ │ - ["Dune::Functions::Concept::isDifferentiableGridFunction", "a00306.html#gab53d12b97e04f88eec30f4192944e85a", null], │ │ │ │ - ["Dune::Functions::Concept::isDifferentiableGridViewFunction", "a00306.html#ga5fe279401b9387533b85b085d6d521cc", null], │ │ │ │ - ["Dune::Functions::Concept::isDifferentiableLocalFunction", "a00306.html#ga2a244aa61f5d2c3f5d0dfb125b0436d5", null], │ │ │ │ - ["Dune::Functions::Concept::isEntitySet", "a00306.html#gaa59c2062e5469a358cd00ce5bb90fe4d", null], │ │ │ │ - ["Dune::Functions::Concept::isFunction", "a00306.html#ga44de2338acc7d9c49fbc12452545c7fc", null], │ │ │ │ - ["Dune::Functions::Concept::isFunction", "a00306.html#gaf3604a4b809f49bb590440c0f06ededa", null], │ │ │ │ - ["Dune::Functions::Concept::isGridFunction", "a00306.html#ga1691be3e84b0405cc8a7ebcd598bd861", null], │ │ │ │ - ["Dune::Functions::Concept::isGridViewFunction", "a00306.html#ga8510d4e3f9e774bd9a3f434e3de659c9", null], │ │ │ │ - ["Dune::Functions::Concept::isLocalFunction", "a00306.html#gae2c89a3c7780ff790a8b066bbb5f9687", null] │ │ │ │ + ["Dune::Functions::ContainerDescriptors::Unknown", "a01766.html", null], │ │ │ │ + ["Dune::Functions::ContainerDescriptors::Value", "a01770.html", "a01770"], │ │ │ │ + ["Dune::Functions::ContainerDescriptors::UniformArray< Child, n >", "a01774.html", "a01774"], │ │ │ │ + ["Dune::Functions::ContainerDescriptors::UniformVector< Child >", "a01778.html", "a01778"], │ │ │ │ + ["Dune::Functions::ContainerDescriptors::Array", "a00321.html#a7fd69d40ddb645de01687b67cc377e13", null], │ │ │ │ + ["Dune::Functions::ContainerDescriptors::FlatArray", "a00321.html#a016f06509d4ca71b569d25b8c8cedf10", null], │ │ │ │ + ["Dune::Functions::ContainerDescriptors::FlatVector", "a00321.html#a253fdb1e81571ea944bd6bb21bf4a06e", null], │ │ │ │ + ["Dune::Functions::ContainerDescriptors::Tuple", "a00321.html#a3658e9613f94667b90b8692ec47a0242", null], │ │ │ │ + ["Dune::Functions::ContainerDescriptors::Vector", "a00321.html#a7692987ba816965c1c2df93c39d50ca8", null], │ │ │ │ + ["Dune::Functions::containerDescriptor", "a00318.html#a5aa100c5225a3709fbb096dc9c73d63f", null], │ │ │ │ + ["Dune::Functions::ContainerDescriptors::makeDescriptor", "a00321.html#a92f91149b73e70dbdf2f5270f967a539", null], │ │ │ │ + ["Dune::Functions::ContainerDescriptors::makeUniformDescriptor", "a00321.html#a1cc8d924fe714e87c0318540d14ca61d", null], │ │ │ │ + ["Dune::Functions::ContainerDescriptors::makeUniformDescriptor", "a00321.html#af5f9aa0c6bf206da1efb563cc39f477f", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00245_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: functionconcepts.hh Source File │ │ │ +Dune-Functions: containerdescriptors.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,377 +88,429 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
functionconcepts.hh
│ │ │ +
containerdescriptors.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH
│ │ │ -
8#define DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH
│ │ │ +
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CONTAINERDESCRIPTORS_HH
│ │ │ +
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CONTAINERDESCRIPTORS_HH
│ │ │
9
│ │ │ -
10#include <dune/common/typelist.hh>
│ │ │ -
11#include <dune/common/concept.hh>
│ │ │ -
12
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
16
│ │ │ -
17namespace Dune {
│ │ │ -
18namespace Functions {
│ │ │ -
19namespace Concept {
│ │ │ -
20
│ │ │ -
21using namespace Dune::Concept;
│ │ │ -
22
│ │ │ -
23
│ │ │ -
24
│ │ │ -
25// Callable concept ############################################################
│ │ │ -
26
│ │ │ -
27
│ │ │ -
35template<class... Args>
│ │ │ -
│ │ │ - │ │ │ -
37{
│ │ │ -
38 template<class F>
│ │ │ -
39 auto require(F&& f) -> decltype(
│ │ │ -
40 f(std::declval<Args>()...)
│ │ │ -
41 );
│ │ │ -
42};
│ │ │ -
│ │ │ -
43
│ │ │ -
50template<class F, class... Args>
│ │ │ -
│ │ │ -
51static constexpr auto isCallable()
│ │ │ -
52{ return models<Concept::Callable<Args...>, F>(); }
│ │ │ -
│ │ │ -
53
│ │ │ -
60template<class F, class... Args>
│ │ │ -
│ │ │ -
61static constexpr auto isCallable(F&&, Args&&...)
│ │ │ -
62{
│ │ │ -
63 return models<Concept::Callable<Args&&...>, F>();
│ │ │ +
10#include <array>
│ │ │ +
11#include <cassert>
│ │ │ +
12#include <functional>
│ │ │ +
13#include <type_traits>
│ │ │ +
14#include <vector>
│ │ │ +
15
│ │ │ +
16#include <dune/common/filledarray.hh>
│ │ │ +
17#include <dune/common/tuplevector.hh>
│ │ │ +
18#include <dune/common/typeutilities.hh>
│ │ │ +
19#include <dune/common/hybridutilities.hh>
│ │ │ +
20#include <dune/common/rangeutilities.hh>
│ │ │ +
21
│ │ │ + │ │ │ + │ │ │ +
24
│ │ │ +
47
│ │ │ +
48namespace Dune::Functions {
│ │ │ +
49namespace ContainerDescriptors {
│ │ │ +
50
│ │ │ +
52struct Unknown {};
│ │ │ +
53
│ │ │ +
54} // end namespace ContainerDescriptors
│ │ │ +
55
│ │ │ +
57template<class PreBasis>
│ │ │ +
│ │ │ +
58auto containerDescriptor(const PreBasis& preBasis)
│ │ │ +
59{
│ │ │ +
60 if constexpr (requires{ preBasis.containerDescriptor(); })
│ │ │ +
61 return preBasis.containerDescriptor();
│ │ │ +
62 else
│ │ │ + │ │ │
64}
│ │ │
│ │ │
65
│ │ │
66
│ │ │ -
67
│ │ │ -
68// Function concept ############################################################
│ │ │ -
69template<class Signature>
│ │ │ -
70struct Function;
│ │ │ -
71
│ │ │ -
80template<class Range, class Domain>
│ │ │ -
│ │ │ -
81struct Function<Range(Domain)> : Refines<Callable<Domain> >
│ │ │ -
82{
│ │ │ -
83 template<class F>
│ │ │ -
84 auto require(F&& f) -> decltype(
│ │ │ -
85 // F models Function<Range(Domain)> if the result of F(Domain) is implicitly convertible to Range
│ │ │ -
86 requireConvertible<Range>(f(std::declval<Domain>()))
│ │ │ -
87 );
│ │ │ -
88};
│ │ │ -
│ │ │ -
89
│ │ │ -
91template<class F, class Signature>
│ │ │ -
│ │ │ -
92static constexpr bool isFunction()
│ │ │ -
93{ return models<Concept::Function<Signature>, F>(); }
│ │ │ -
│ │ │ -
94
│ │ │ -
96template<class F, class Signature, template<class> class DerivativeTraits>
│ │ │ -
│ │ │ - │ │ │ -
98{ return models<Concept::Function<Signature>, F>(); }
│ │ │ -
│ │ │ -
99
│ │ │ -
100
│ │ │ -
101
│ │ │ -
102// DifferentiableFunction concept ##############################################
│ │ │ -
103template<class Signature, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ - │ │ │ -
105
│ │ │ -
117template<class Range, class Domain, template<class> class DerivativeTraits>
│ │ │ -
│ │ │ -
118struct DifferentiableFunction<Range(Domain), DerivativeTraits> : Refines<Dune::Functions::Concept::Function<Range(Domain)> >
│ │ │ -
119{
│ │ │ - │ │ │ -
121
│ │ │ -
122 template<class F>
│ │ │ -
123 auto require(F&& f) -> decltype(
│ │ │ -
124 derivative(f),
│ │ │ -
125 requireConcept<Function<DerivativeSignature>>(derivative(f))
│ │ │ -
126 );
│ │ │ -
127};
│ │ │ -
│ │ │ -
128
│ │ │ -
130template<class F, class Signature, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ -
│ │ │ -
131static constexpr bool isDifferentiableFunction()
│ │ │ -
132{ return models<Concept::DifferentiableFunction<Signature, DerivativeTraits>, F>(); }
│ │ │ -
│ │ │ +
67namespace ContainerDescriptors {
│ │ │ +
68
│ │ │ +
│ │ │ +
70struct Value
│ │ │ +
71{
│ │ │ +
73 template<class Index>
│ │ │ +
74 Value operator[] (const Index&) const { return {}; }
│ │ │ +
75
│ │ │ +
77 static constexpr std::size_t size () { return 0; }
│ │ │ +
78};
│ │ │ +
│ │ │ +
79
│ │ │ +
81template<class... Children>
│ │ │ +
82using Tuple = Dune::TupleVector<Children...>;
│ │ │ +
83
│ │ │ +
86template<class Child0, class... Children,
│ │ │ +
87 std::enable_if_t<(sizeof...(Children) > 0), int> = 0,
│ │ │ +
88 std::enable_if_t<(...|| (not std::is_same_v<Child0, Children>)), int> = 0>
│ │ │ +
89auto makeDescriptor (Child0 child0, Children... children)
│ │ │ +
90{
│ │ │ +
91 using Descriptor = Tuple<Child0,Children...>;
│ │ │ +
92 return Descriptor{std::move(child0),std::move(children)...};
│ │ │ +
93}
│ │ │ +
94
│ │ │ +
95
│ │ │ +
97template<class Child, std::size_t n>
│ │ │ +
98using Array = std::array<Child, n>;
│ │ │ +
99
│ │ │ +
101template<class Child0, class... Children,
│ │ │ +
102 std::enable_if_t<(std::is_same_v<Child0, Children> &&...), int> = 0>
│ │ │ +
│ │ │ +
103auto makeDescriptor (Child0 child, Children... children)
│ │ │ +
104{
│ │ │ +
105 using Descriptor = Array<Child0,1+sizeof...(Children)>;
│ │ │ +
106 return Descriptor{std::move(child),std::move(children)...};
│ │ │ +
107}
│ │ │ +
│ │ │ +
108
│ │ │ +
109
│ │ │ +
111template<class Child>
│ │ │ +
112using Vector = std::vector<Child>;
│ │ │ +
113
│ │ │ +
115template<class Child, std::size_t n>
│ │ │ +
│ │ │ + │ │ │ +
117{
│ │ │ +
119 template<class C = Child,
│ │ │ +
120 std::enable_if_t<std::is_default_constructible_v<C>, int> = 0>
│ │ │ +
│ │ │ + │ │ │ +
122 : child_{}
│ │ │ +
123 {}
│ │ │ +
│ │ │ +
124
│ │ │ +
│ │ │ +
126 explicit UniformArray (Child child)
│ │ │ +
127 : child_{std::move(child)}
│ │ │ +
128 {}
│ │ │ +
│ │ │ +
129
│ │ │ +
131 template<class Index>
│ │ │ +
132 const Child& operator[] (const Index& /*i*/) const { return child_; }
│ │ │
133
│ │ │ -
135template<class F, class Signature, template<class> class DerivativeTraits>
│ │ │ -
│ │ │ - │ │ │ -
137{ return models<Concept::DifferentiableFunction<Signature, DerivativeTraits>, F>(); }
│ │ │ -
│ │ │ -
138
│ │ │ -
139
│ │ │ -
140
│ │ │ -
141// LocalFunction concept ##############################################
│ │ │ -
142template<class Signature, class LocalContext>
│ │ │ - │ │ │ +
135 static constexpr std::size_t size () { return n; }
│ │ │ +
136
│ │ │ +
137private:
│ │ │ +
138 Child child_;
│ │ │ +
139};
│ │ │ +
│ │ │ +
140
│ │ │ +
142template<std::size_t n>
│ │ │ + │ │ │
144
│ │ │ -
154template<class Range, class Domain, class LocalContext>
│ │ │ +
146template<class Child, std::size_t n>
│ │ │ +
│ │ │ +
147auto makeUniformDescriptor (std::integral_constant<std::size_t,n>, Child child)
│ │ │ +
148{
│ │ │ +
149 return UniformArray<Child,n>{std::move(child)};
│ │ │ +
150}
│ │ │ +
│ │ │ +
151
│ │ │ +
152
│ │ │ +
154template<class Child>
│ │ │
│ │ │ -
155struct LocalFunction<Range(Domain), LocalContext> :
│ │ │ -
156 Refines<Dune::Functions::Concept::Function<Range(Domain)> >
│ │ │ -
157{
│ │ │ -
158 template<class F>
│ │ │ -
159 auto require(F&& f) -> decltype(
│ │ │ -
160 f.bind(std::declval<LocalContext>()),
│ │ │ -
161 f.unbind(),
│ │ │ -
162 requireConvertible<bool>(f.bound()),
│ │ │ -
163 f.localContext(),
│ │ │ -
164 requireConvertible<LocalContext>(f.localContext())
│ │ │ -
165 );
│ │ │ -
166};
│ │ │ -
│ │ │ -
167
│ │ │ -
169template<class F, class Signature, class LocalContext>
│ │ │ -
│ │ │ -
170static constexpr bool isLocalFunction()
│ │ │ -
171{ return models<Concept::LocalFunction<Signature, LocalContext>, F>(); }
│ │ │ -
│ │ │ -
172
│ │ │ -
173
│ │ │ -
174// DifferentiableLocalFunction concept ##############################################
│ │ │ -
175template<class Signature, class LocalContext, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ - │ │ │ -
177
│ │ │ -
190template<class Range, class Domain, class LocalContext, template<class> class DerivativeTraits>
│ │ │ -
│ │ │ -
191struct DifferentiableLocalFunction<Range(Domain), LocalContext, DerivativeTraits> :
│ │ │ -
192 Refines<
│ │ │ -
193 Dune::Functions::Concept::DifferentiableFunction<Range(Domain), DerivativeTraits>,
│ │ │ -
194 Dune::Functions::Concept::LocalFunction<Range(Domain),LocalContext>
│ │ │ -
195 >
│ │ │ -
196{
│ │ │ -
197 template<class F>
│ │ │ -
198 auto require(F&& f) -> decltype(
│ │ │ -
199 f.bind(std::declval<LocalContext>()),
│ │ │ -
200 f.unbind(),
│ │ │ -
201 f.localContext(),
│ │ │ -
202 requireConvertible<LocalContext>(f.localContext())
│ │ │ -
203 );
│ │ │ -
204};
│ │ │ -
│ │ │ -
205
│ │ │ -
207template<class F, class Signature, class LocalContext, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ -
│ │ │ -
208static constexpr bool isDifferentiableLocalFunction()
│ │ │ -
209{ return models<Concept::DifferentiableLocalFunction<Signature, LocalContext, DerivativeTraits>, F>(); }
│ │ │ -
│ │ │ -
210
│ │ │ -
211
│ │ │ -
212// EntitySet concept ##############################################
│ │ │ -
213
│ │ │ -
│ │ │ - │ │ │ -
224{
│ │ │ -
225 template<class E>
│ │ │ -
226 auto require(E&& f) -> decltype(
│ │ │ -
227 requireType<typename E::Element>(),
│ │ │ -
228 requireType<typename E::LocalCoordinate>(),
│ │ │ -
229 requireType<typename E::GlobalCoordinate>()
│ │ │ -
230 );
│ │ │ -
231};
│ │ │ -
│ │ │ -
232
│ │ │ -
234template<class E>
│ │ │ -
│ │ │ -
235static constexpr bool isEntitySet()
│ │ │ -
236{ return models<Concept::EntitySet, E>(); }
│ │ │ -
│ │ │ -
237
│ │ │ -
238
│ │ │ + │ │ │ +
156{
│ │ │ +
158 template<class C = Child,
│ │ │ +
159 std::enable_if_t<std::is_default_constructible_v<C>, int> = 0>
│ │ │ +
│ │ │ +
160 explicit UniformVector (std::size_t size)
│ │ │ +
161 : size_{size}
│ │ │ +
162 , child_{}
│ │ │ +
163 {}
│ │ │ +
│ │ │ +
164
│ │ │ +
│ │ │ +
166 UniformVector (std::size_t size, Child child)
│ │ │ +
167 : size_{size}
│ │ │ +
168 , child_{std::move(child)}
│ │ │ +
169 {}
│ │ │ +
│ │ │ +
170
│ │ │ +
172 template<class Index>
│ │ │ +
173 const Child& operator[] (const Index& /*i*/) const { return child_; }
│ │ │ +
174
│ │ │ +
176 std::size_t size () const { return size_; }
│ │ │ +
177
│ │ │ +
178private:
│ │ │ +
179 std::size_t size_;
│ │ │ +
180 Child child_;
│ │ │ +
181};
│ │ │ +
│ │ │ +
182
│ │ │ + │ │ │ +
185
│ │ │ +
187template<class Child>
│ │ │ +
│ │ │ +
188auto makeUniformDescriptor (std::size_t n, Child child)
│ │ │ +
189{
│ │ │ +
190 return UniformVector<Child>{n,std::move(child)};
│ │ │ +
191}
│ │ │ +
│ │ │ +
192
│ │ │ +
193namespace Impl {
│ │ │ +
194
│ │ │ +
195template<class InnerFunc, class LeafFunc>
│ │ │ +
196struct TreeTransform
│ │ │ +
197{
│ │ │ +
198 TreeTransform (const InnerFunc& innerFunc, const LeafFunc& leafFunc)
│ │ │ +
199 : innerFunc_(innerFunc)
│ │ │ +
200 , leafFunc_(leafFunc)
│ │ │ +
201 {}
│ │ │ +
202
│ │ │ +
203 Unknown operator() (const Unknown& tree) const
│ │ │ +
204 {
│ │ │ +
205 return tree;
│ │ │ +
206 }
│ │ │ +
207
│ │ │ +
208 auto operator() (const Value& tree) const
│ │ │ +
209 {
│ │ │ +
210 return leafFunc_(tree);
│ │ │ +
211 }
│ │ │ +
212
│ │ │ +
213 template<class... V>
│ │ │ +
214 auto operator() (const Tuple<V...>& tree) const
│ │ │ +
215 {
│ │ │ +
216 return unpackIntegerSequence([&](auto... ii) {
│ │ │ +
217 return makeDescriptor(innerFunc_(tree[ii])...);
│ │ │ +
218 }, std::make_index_sequence<sizeof...(V)>());
│ │ │ +
219 }
│ │ │ +
220
│ │ │ +
221 template<class V, std::size_t n>
│ │ │ +
222 auto operator() (const Array<V,n>& tree) const
│ │ │ +
223 {
│ │ │ +
224 return unpackIntegerSequence([&](auto... ii) {
│ │ │ +
225 return makeDescriptor(innerFunc_(tree[ii])...);
│ │ │ +
226 }, std::make_index_sequence<n>());
│ │ │ +
227 }
│ │ │ +
228
│ │ │ +
229 template<class V>
│ │ │ +
230 auto operator() (const Vector<V>& tree) const
│ │ │ +
231 {
│ │ │ +
232 using W = decltype(innerFunc_(tree[0]));
│ │ │ +
233 Vector<W> result;
│ │ │ +
234 result.reserve(tree.size());
│ │ │ +
235 for (std::size_t i = 0; i < tree.size(); ++i)
│ │ │ +
236 result.emplace_back(innerFunc_(tree[i]));
│ │ │ +
237 return result;
│ │ │ +
238 }
│ │ │
239
│ │ │ -
240// GridFunction concept ##############################################
│ │ │ -
241template<class Signature, class EntitySet>
│ │ │ - │ │ │ -
243
│ │ │ -
253template<class Range, class Domain, class EntitySet>
│ │ │ -
│ │ │ -
254struct GridFunction<Range(Domain), EntitySet> :
│ │ │ -
255 Refines<Dune::Functions::Concept::Function<Range(Domain)> >
│ │ │ -
256{
│ │ │ -
257 using LocalSignature = Range(typename EntitySet::LocalCoordinate);
│ │ │ -
258 using LocalContext = typename EntitySet::Element;
│ │ │ -
259
│ │ │ -
260 template<class F>
│ │ │ -
261 auto require(F&& f) -> decltype(
│ │ │ -
262 localFunction(f),
│ │ │ -
263 f.entitySet(),
│ │ │ -
264 requireConcept<LocalFunction<LocalSignature, LocalContext>>(localFunction(f)),
│ │ │ -
265 requireConcept<Concept::EntitySet, EntitySet>(),
│ │ │ -
266 requireConvertible<EntitySet>(f.entitySet()),
│ │ │ -
267 requireConvertible<typename EntitySet::GlobalCoordinate, Domain>()
│ │ │ -
268 );
│ │ │ -
269};
│ │ │ -
│ │ │ -
270
│ │ │ -
272template<class F, class Signature, class EntitySet>
│ │ │ -
│ │ │ -
273static constexpr bool isGridFunction()
│ │ │ -
274{ return models<Concept::GridFunction<Signature, EntitySet>, F>(); }
│ │ │ -
│ │ │ -
275
│ │ │ -
276
│ │ │ -
277// DifferentiableGridFunction concept ##############################################
│ │ │ -
278template<class Signature, class EntitySet, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ - │ │ │ -
280
│ │ │ -
293template<class Range, class Domain, class EntitySet, template<class> class DerivativeTraits>
│ │ │ -
│ │ │ -
294struct DifferentiableGridFunction<Range(Domain), EntitySet, DerivativeTraits> :
│ │ │ -
295 Refines<
│ │ │ -
296 Dune::Functions::Concept::DifferentiableFunction<Range(Domain), DerivativeTraits>,
│ │ │ -
297 Dune::Functions::Concept::GridFunction<Range(Domain),EntitySet>
│ │ │ -
298 >
│ │ │ -
299{
│ │ │ -
300 using LocalSignature = Range(typename EntitySet::LocalCoordinate);
│ │ │ -
301 using LocalContext = typename EntitySet::Element;
│ │ │ -
302
│ │ │ -
303 template<class R>
│ │ │ - │ │ │ -
305
│ │ │ -
306 template<class F>
│ │ │ -
307 auto require(F&& f) -> decltype(
│ │ │ -
308 requireConcept<DifferentiableLocalFunction<LocalSignature, LocalContext, LocalDerivativeTraits>>(localFunction(f))
│ │ │ -
309 );
│ │ │ -
310};
│ │ │ -
│ │ │ -
311
│ │ │ -
313template<class F, class Signature, class EntitySet, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ -
│ │ │ -
314static constexpr bool isDifferentiableGridFunction()
│ │ │ -
315{ return models<Concept::DifferentiableGridFunction<Signature, EntitySet, DerivativeTraits>, F>(); }
│ │ │ -
│ │ │ -
316
│ │ │ -
317
│ │ │ -
318
│ │ │ -
319// GridViewFunction concept ##############################################
│ │ │ -
320template<class Signature, class GridView>
│ │ │ - │ │ │ +
240 template<class V, std::size_t n>
│ │ │ +
241 auto operator() (const UniformArray<V,n>& tree) const
│ │ │ +
242 {
│ │ │ +
243 return makeUniformDescriptor(Dune::index_constant<n>{}, innerFunc_(tree[0]));
│ │ │ +
244 }
│ │ │ +
245
│ │ │ +
246 template<class V>
│ │ │ +
247 auto operator() (const UniformVector<V>& tree) const
│ │ │ +
248 {
│ │ │ +
249 return makeUniformDescriptor(tree.size(), innerFunc_(tree[0]));
│ │ │ +
250 }
│ │ │ +
251
│ │ │ +
252private:
│ │ │ +
253 InnerFunc innerFunc_;
│ │ │ +
254 LeafFunc leafFunc_;
│ │ │ +
255};
│ │ │ +
256
│ │ │ +
257
│ │ │ +
268template<class Size, class T>
│ │ │ +
269auto appendToTree (Size s, const T& tree)
│ │ │ +
270{
│ │ │ +
271 auto transform = TreeTransform(
│ │ │ +
272 [s](auto&& node) { return appendToTree(s, node); },
│ │ │ +
273 [s](auto&& node) { return makeUniformDescriptor(s, node); });
│ │ │ +
274 return transform(tree);
│ │ │ +
275}
│ │ │ +
276
│ │ │ +
278template<class... Child>
│ │ │ +
279auto flatLexicographic (Child... child)
│ │ │ +
280{
│ │ │ +
281 if constexpr ((std::is_same_v<Child, FlatVector> && ...))
│ │ │ +
282 return FlatVector((child.size() + ...));
│ │ │ +
283 else
│ │ │ +
284 return Unknown{};
│ │ │ +
285}
│ │ │ +
286
│ │ │ +
288template<class N, class Child>
│ │ │ +
289auto flatLexicographicN (N n, Child child)
│ │ │ +
290{
│ │ │ +
291 return Unknown{};
│ │ │ +
292}
│ │ │ +
293
│ │ │ +
295template<class N, class GrandChild>
│ │ │ +
296auto flatLexicographicN (N n, UniformVector<GrandChild> child)
│ │ │ +
297{
│ │ │ +
298 return UniformVector<GrandChild>{child.size()*n, child[0]};
│ │ │ +
299}
│ │ │ +
300
│ │ │ +
302template<class N, class GrandChild, std::size_t m>
│ │ │ +
303auto flatLexicographicN (N n, UniformArray<GrandChild, m> child)
│ │ │ +
304{
│ │ │ +
305 if constexpr (std::is_same_v<N, std::size_t>)
│ │ │ +
306 return UniformVector<GrandChild>{n*m, child[0]};
│ │ │ +
307 else
│ │ │ +
308 return UniformArray<GrandChild, N::value*m>{child[0]};
│ │ │ +
309}
│ │ │ +
310
│ │ │ +
312template<class N, class GrandChild>
│ │ │ +
313auto flatLexicographicN (N n, Vector<GrandChild> child)
│ │ │ +
314{
│ │ │ +
315 auto result = Vector<GrandChild>{};
│ │ │ +
316 result.reserve(child.size()*n);
│ │ │ +
317 for (auto j : Dune::range(n))
│ │ │ +
318 for (auto i : Dune::range(child.size()))
│ │ │ +
319 result.emplace_back(child[i]);
│ │ │ +
320 return result;
│ │ │ +
321}
│ │ │
322
│ │ │ -
335template<class Range, class Domain, class GridView>
│ │ │ -
│ │ │ -
336struct GridViewFunction<Range(Domain), GridView> :
│ │ │ -
337 Refines<Dune::Functions::Concept::GridFunction<Range(Domain), GridViewEntitySet<GridView,0>>>
│ │ │ -
338{
│ │ │ -
339 template<class F>
│ │ │ -
340 auto require(F&& f) -> decltype(
│ │ │ -
341 0 // We don't need to check any further expressions, because a GridViewFunction is just a GridFunction with a special EntitySet
│ │ │ -
342 );
│ │ │ -
343};
│ │ │ -
│ │ │ -
344
│ │ │ -
346template<class F, class Signature, class GridView>
│ │ │ -
│ │ │ -
347static constexpr bool isGridViewFunction()
│ │ │ -
348{ return models<Concept::GridViewFunction<Signature, GridView>, F>(); }
│ │ │ -
│ │ │ -
349
│ │ │ -
350
│ │ │ -
351// DifferentiableGridViewFunction concept ##############################################
│ │ │ -
352template<class Signature, class GridView, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ - │ │ │ -
354
│ │ │ -
368template<class Range, class Domain, class GridView, template<class> class DerivativeTraits>
│ │ │ -
│ │ │ -
369struct DifferentiableGridViewFunction<Range(Domain), GridView, DerivativeTraits> :
│ │ │ -
370 Refines<Dune::Functions::Concept::DifferentiableGridFunction<Range(Domain), GridViewEntitySet<GridView,0>, DerivativeTraits>>
│ │ │ -
371{
│ │ │ -
372 template<class F>
│ │ │ -
373 auto require(F&& f) -> decltype(
│ │ │ -
374 0 // We don't need to check any further expressions, because a GridViewFunction is just a GridFunction with a special EntitySet
│ │ │ -
375 );
│ │ │ -
376};
│ │ │ -
│ │ │ -
377
│ │ │ -
379template<class F, class Signature, class GridView, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ -
│ │ │ -
380static constexpr bool isDifferentiableGridViewFunction()
│ │ │ -
381{ return models<Concept::DifferentiableGridViewFunction<Signature, GridView, DerivativeTraits>, F>(); }
│ │ │ -
│ │ │ -
382
│ │ │ -
383
│ │ │ -
384
│ │ │ -
385}}} // namespace Dune::Functions::Concept
│ │ │ -
386
│ │ │ -
387#endif // DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
static constexpr bool isGridFunction()
Check if F models the GridFunction concept with given signature and entity set.
Definition functionconcepts.hh:273
│ │ │ -
static constexpr bool isDifferentiableLocalFunction()
Check if F models the DifferentiableLocalFunction concept with given signature and local context.
Definition functionconcepts.hh:208
│ │ │ -
static constexpr bool isFunction()
Check if F models the Function concept with given signature.
Definition functionconcepts.hh:92
│ │ │ -
static constexpr bool isDifferentiableGridViewFunction()
Check if F models the DifferentiableGridViewFunction concept with given signature.
Definition functionconcepts.hh:380
│ │ │ -
static constexpr bool isDifferentiableFunction()
Check if F models the DifferentiableFunction concept with given signature.
Definition functionconcepts.hh:131
│ │ │ -
static constexpr bool isGridViewFunction()
Check if F models the GridViewFunction concept with given signature.
Definition functionconcepts.hh:347
│ │ │ -
static constexpr bool isEntitySet()
Check if F models the GridFunction concept with given signature and entity set.
Definition functionconcepts.hh:235
│ │ │ -
static constexpr bool isDifferentiableGridFunction()
Check if F models the DifferentiableGridFunction concept with given signature and entity set.
Definition functionconcepts.hh:314
│ │ │ -
static constexpr bool isLocalFunction()
Check if F models the LocalFunction concept with given signature and local context.
Definition functionconcepts.hh:170
│ │ │ -
TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
Obtain derivative of TrigonometricFunction function.
Definition trigonometricfunction.hh:43
│ │ │ -
static constexpr auto isCallable()
Check if f is callable with given argument list.
Definition functionconcepts.hh:51
│ │ │ -
Definition monomialset.hh:19
│ │ │ +
324template<class N, class GrandChild, std::size_t m>
│ │ │ +
325auto flatLexicographicN (N n, Array<GrandChild, m> child)
│ │ │ +
326{
│ │ │ +
327 if constexpr (std::is_same_v<N, std::size_t>)
│ │ │ +
328 {
│ │ │ +
329 auto result = Vector<GrandChild>{};
│ │ │ +
330 result.reserve(child.size()*n);
│ │ │ +
331 for (auto j : Dune::range(n))
│ │ │ +
332 for (auto i : Dune::range(child.size()))
│ │ │ +
333 result.emplace_back(child[i]);
│ │ │ +
334 return result;
│ │ │ +
335 }
│ │ │ +
336 else
│ │ │ +
337 {
│ │ │ +
338 auto result = Array<GrandChild, N::value*m>{};
│ │ │ +
339 for (auto j : Dune::range(n))
│ │ │ +
340 for (auto i : Dune::range(child.size()))
│ │ │ +
341 result.emplace_back(child[i]);
│ │ │ +
342 return result;
│ │ │ +
343 }
│ │ │ +
344}
│ │ │ +
345
│ │ │ +
347template<class N, class... GrandChild>
│ │ │ +
348auto flatLexicographicN (N n, Tuple<GrandChild...> child)
│ │ │ +
349{
│ │ │ +
350 constexpr std::size_t m = sizeof...(GrandChild);
│ │ │ +
351 return Dune::unpackIntegerSequence([&](auto... i) {
│ │ │ +
352 return makeDescriptor(std::get<i%m>(child)...);
│ │ │ +
353 }, std::make_index_sequence<n*m>{});
│ │ │ +
354}
│ │ │ +
355
│ │ │ +
357template<class N, class Child>
│ │ │ +
358auto flatInterleavedN (N n, Child child)
│ │ │ +
359{
│ │ │ +
360 return Unknown{};
│ │ │ +
361}
│ │ │ +
362
│ │ │ +
364template<class N, class GrandChild>
│ │ │ +
365auto flatInterleavedN (N n, UniformVector<GrandChild> child)
│ │ │ +
366{
│ │ │ +
367 return UniformVector<GrandChild>{child.size()*n, child[0]};
│ │ │ +
368}
│ │ │ +
369
│ │ │ +
371template<class N, class GrandChild, std::size_t m>
│ │ │ +
372auto flatInterleavedN (N n, UniformArray<GrandChild, m> child)
│ │ │ +
373{
│ │ │ +
374 if constexpr (std::is_integral_v<N>)
│ │ │ +
375 return UniformVector<GrandChild>{n*m, child[0]};
│ │ │ +
376 else
│ │ │ +
377 return UniformArray<GrandChild, N::value*m>{child[0]};
│ │ │ +
378}
│ │ │ +
379
│ │ │ +
381template<class N, class GrandChild>
│ │ │ +
382auto flatInterleavedN (N n, Vector<GrandChild> child)
│ │ │ +
383{
│ │ │ +
384 auto result = Vector<GrandChild>{};
│ │ │ +
385 result.reserve(child.size()*n);
│ │ │ +
386 for (auto i : Dune::range(child.size()))
│ │ │ +
387 for (auto j : Dune::range(n))
│ │ │ +
388 result.emplace_back(child[i]);
│ │ │ +
389 return result;
│ │ │ +
390}
│ │ │ +
391
│ │ │ +
393template<class N, class GrandChild, std::size_t m>
│ │ │ +
394auto flatInterleavedN (N n, Array<GrandChild, m> child)
│ │ │ +
395{
│ │ │ +
396 if constexpr (std::is_integral_v<N>)
│ │ │ +
397 {
│ │ │ +
398 auto result = Vector<GrandChild>{};
│ │ │ +
399 result.reserve(child.size()*n);
│ │ │ +
400 for (auto i : Dune::range(child.size()))
│ │ │ +
401 for (auto j : Dune::range(n))
│ │ │ +
402 result.emplace_back(child[i]);
│ │ │ +
403 return result;
│ │ │ +
404 }
│ │ │ +
405 else
│ │ │ +
406 {
│ │ │ +
407 auto result = Array<GrandChild, N::value*m>{};
│ │ │ +
408 for (auto i : Dune::range(child.size()))
│ │ │ +
409 for (auto j : Dune::range(n))
│ │ │ +
410 result.emplace_back(child[i]);
│ │ │ +
411 return result;
│ │ │ +
412 }
│ │ │ +
413}
│ │ │ +
414
│ │ │ +
416template<class N, class... GrandChild>
│ │ │ +
417auto flatInterleavedN (N n, Tuple<GrandChild...> child)
│ │ │ +
418{
│ │ │ +
419 constexpr std::size_t m = sizeof...(GrandChild);
│ │ │ +
420 return Dune::unpackIntegerSequence([&](auto... i) {
│ │ │ +
421 return makeDescriptor(std::get<i/n>(child)...);
│ │ │ +
422 }, std::make_index_sequence<n*m>{});
│ │ │ +
423}
│ │ │ +
424
│ │ │ +
425} // end namespace Impl
│ │ │ +
426} // end namespace ContainerDescriptors
│ │ │ +
427} // end namespace Dune::Functions
│ │ │ +
428
│ │ │ +
429#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CONTAINERDESCRIPTORS_HH
│ │ │ + │ │ │ + │ │ │
Definition monomialset.hh:19
│ │ │ -
Definition backends/concepts.hh:17
│ │ │ -
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:41
│ │ │ -
Concept objects that can be called with given argument list.
Definition functionconcepts.hh:37
│ │ │ -
auto require(F &&f) -> decltype(f(std::declval< Args >()...))
│ │ │ -
Definition functionconcepts.hh:70
│ │ │ -
auto require(F &&f) -> decltype(requireConvertible< Range >(f(std::declval< Domain >())))
│ │ │ -
Definition functionconcepts.hh:104
│ │ │ -
typename SignatureTraits< Range(Domain)>::template DerivativeSignature< DerivativeTraits > DerivativeSignature
Definition functionconcepts.hh:120
│ │ │ -
auto require(F &&f) -> decltype(derivative(f), requireConcept< Function< DerivativeSignature > >(derivative(f)))
│ │ │ -
Definition functionconcepts.hh:143
│ │ │ -
auto require(F &&f) -> decltype(f.bind(std::declval< LocalContext >()), f.unbind(), requireConvertible< bool >(f.bound()), f.localContext(), requireConvertible< LocalContext >(f.localContext()))
│ │ │ - │ │ │ -
auto require(F &&f) -> decltype(f.bind(std::declval< LocalContext >()), f.unbind(), f.localContext(), requireConvertible< LocalContext >(f.localContext()))
│ │ │ -
Concept for an entity set for a Concept::GridFunction<Range(Domain), EntitySet, DerivativeTraits>.
Definition functionconcepts.hh:224
│ │ │ -
auto require(E &&f) -> decltype(requireType< typename E::Element >(), requireType< typename E::LocalCoordinate >(), requireType< typename E::GlobalCoordinate >())
│ │ │ -
Definition functionconcepts.hh:242
│ │ │ -
typename EntitySet::Element LocalContext
Definition functionconcepts.hh:258
│ │ │ -
Range(typename EntitySet::LocalCoordinate) LocalSignature
Definition functionconcepts.hh:257
│ │ │ -
auto require(F &&f) -> decltype(localFunction(f), f.entitySet(), requireConcept< LocalFunction< LocalSignature, LocalContext > >(localFunction(f)), requireConcept< Concept::EntitySet, EntitySet >(), requireConvertible< EntitySet >(f.entitySet()), requireConvertible< typename EntitySet::GlobalCoordinate, Domain >())
│ │ │ - │ │ │ -
typename Dune::Functions::LocalDerivativeTraits< EntitySet, DerivativeTraits >::template Traits< R > LocalDerivativeTraits
Definition functionconcepts.hh:304
│ │ │ -
auto require(F &&f) -> decltype(requireConcept< DifferentiableLocalFunction< LocalSignature, LocalContext, LocalDerivativeTraits > >(localFunction(f)))
│ │ │ -
Range(typename EntitySet::LocalCoordinate) LocalSignature
Definition functionconcepts.hh:300
│ │ │ - │ │ │ -
Definition functionconcepts.hh:321
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
Helper class to deduce the signature of a callable.
Definition signature.hh:60
│ │ │ -
Definition signature.hh:106
│ │ │ -
Derivative traits for local functions.
Definition localderivativetraits.hh:32
│ │ │ +
auto containerDescriptor(const PreBasis &preBasis)
Return the container descriptor of the pre-basis, if defined, otherwise ContainerDescriptor::Unknown.
Definition containerdescriptors.hh:58
│ │ │ +
Definition containerfactory.hh:20
│ │ │ +
UniformArray< Value, n > FlatArray
Alias for a uniform array storing value placeholders.
Definition containerdescriptors.hh:143
│ │ │ +
auto makeUniformDescriptor(std::integral_constant< std::size_t, n >, Child child)
Generate a uniform descriptor in case the size is a static constant.
Definition containerdescriptors.hh:147
│ │ │ +
UniformVector< Value > FlatVector
Alias for a uniform vector storing value placeholders.
Definition containerdescriptors.hh:184
│ │ │ +
Dune::TupleVector< Children... > Tuple
Descriptor with all children of possibly different type.
Definition containerdescriptors.hh:82
│ │ │ +
std::vector< Child > Vector
Descriptor for vectors with all children of the same type and dynamic size.
Definition containerdescriptors.hh:112
│ │ │ +
std::array< Child, n > Array
Descriptor for arrays with all children of the same type and static size.
Definition containerdescriptors.hh:98
│ │ │ +
auto makeDescriptor(Child0 child, Children... children)
Generate a descriptor in case the children are all of the same type.
Definition containerdescriptors.hh:103
│ │ │ +
Fallback container descriptor if nothing else fits.
Definition containerdescriptors.hh:52
│ │ │ +
The node in the descriptor tree representing a value placeholder.
Definition containerdescriptors.hh:71
│ │ │ +
static constexpr std::size_t size()
A value placeholder does not have any sub-descriptors, thus its size is zero.
Definition containerdescriptors.hh:77
│ │ │ +
Value operator[](const Index &) const
The child access method is only available for the interface, but should not be called.
Definition containerdescriptors.hh:74
│ │ │ +
Descriptor for arrays with all children identical and the number of children a static size.
Definition containerdescriptors.hh:117
│ │ │ +
static constexpr std::size_t size()
The static size information, i.e., number of children.
Definition containerdescriptors.hh:135
│ │ │ +
UniformArray()
Default constructor. Is enable if the child-type is default constructible.
Definition containerdescriptors.hh:121
│ │ │ +
UniformArray(Child child)
Constructor that stores a single child only.
Definition containerdescriptors.hh:126
│ │ │ +
const Child & operator[](const Index &) const
Access the i'th child that is always the same, i.e., child_.
Definition containerdescriptors.hh:132
│ │ │ +
Uniform descriptor with dynamic size.
Definition containerdescriptors.hh:156
│ │ │ +
UniformVector(std::size_t size, Child child)
Constructor that stores the size and a single child only.
Definition containerdescriptors.hh:166
│ │ │ +
std::size_t size() const
Definition containerdescriptors.hh:176
│ │ │ +
UniformVector(std::size_t size)
Default constructor with size. Is enable if the child-type is default constructible.
Definition containerdescriptors.hh:160
│ │ │ +
const Child & operator[](const Index &) const
Access the i'th child that is always the same, i.e., child_.
Definition containerdescriptors.hh:173
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,469 +1,468 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -functionconcepts.hh │ │ │ │ +containerdescriptors.hh │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ 3 │ │ │ │ 4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file │ │ │ │ AUTHORS.md │ │ │ │ 5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR │ │ │ │ LGPL-3.0-or-later │ │ │ │ 6 │ │ │ │ -7#ifndef DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH │ │ │ │ -8#define DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH │ │ │ │ +7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CONTAINERDESCRIPTORS_HH │ │ │ │ +8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CONTAINERDESCRIPTORS_HH │ │ │ │ 9 │ │ │ │ -10#include │ │ │ │ -11#include │ │ │ │ -12 │ │ │ │ -13#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_s_i_g_n_a_t_u_r_e_._h_h> │ │ │ │ -14#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_l_o_c_a_l_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ -15#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_g_r_i_d_f_u_n_c_t_i_o_n_s_/_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h> │ │ │ │ -16 │ │ │ │ -17namespace _D_u_n_e { │ │ │ │ -18namespace _F_u_n_c_t_i_o_n_s { │ │ │ │ -19namespace _C_o_n_c_e_p_t { │ │ │ │ -20 │ │ │ │ -21using namespace Dune::Concept; │ │ │ │ -22 │ │ │ │ -23 │ │ │ │ +10#include │ │ │ │ +11#include │ │ │ │ +12#include │ │ │ │ +13#include │ │ │ │ +14#include │ │ │ │ +15 │ │ │ │ +16#include │ │ │ │ +17#include │ │ │ │ +18#include │ │ │ │ +19#include │ │ │ │ +20#include │ │ │ │ +21 │ │ │ │ +22#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_t_y_p_e___t_r_a_i_t_s_._h_h> │ │ │ │ +23#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_b_a_s_i_s_t_a_g_s_._h_h> │ │ │ │ 24 │ │ │ │ -25// Callable concept │ │ │ │ -############################################################ │ │ │ │ -26 │ │ │ │ -27 │ │ │ │ -35template │ │ │ │ -_3_6struct _C_a_l_l_a_b_l_e │ │ │ │ -37{ │ │ │ │ -38 template │ │ │ │ -_3_9 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ -40 f(std::declval()...) │ │ │ │ -41 ); │ │ │ │ -42}; │ │ │ │ -43 │ │ │ │ -50template │ │ │ │ -_5_1static constexpr auto _i_s_C_a_l_l_a_b_l_e() │ │ │ │ -52{ return models<_C_o_n_c_e_p_t_:_:_C_a_l_l_a_b_l_e, F>(); } │ │ │ │ +47 │ │ │ │ +48namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ +49namespace _C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s { │ │ │ │ +50 │ │ │ │ +_5_2struct _U_n_k_n_o_w_n {}; │ │ │ │ 53 │ │ │ │ -60template │ │ │ │ -_6_1static constexpr auto _i_s_C_a_l_l_a_b_l_e(F&&, Args&&...) │ │ │ │ -62{ │ │ │ │ -63 return models<_C_o_n_c_e_p_t_:_:_C_a_l_l_a_b_l_e, F>(); │ │ │ │ +54} // end namespace ContainerDescriptors │ │ │ │ +55 │ │ │ │ +57template │ │ │ │ +_5_8auto _c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r(const PreBasis& preBasis) │ │ │ │ +59{ │ │ │ │ +60 if constexpr (requires{ preBasis.containerDescriptor(); }) │ │ │ │ +61 return preBasis.containerDescriptor(); │ │ │ │ +62 else │ │ │ │ +63 return _C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_k_n_o_w_n{}; │ │ │ │ 64} │ │ │ │ 65 │ │ │ │ 66 │ │ │ │ -67 │ │ │ │ -68// Function concept │ │ │ │ -############################################################ │ │ │ │ -69template │ │ │ │ -_7_0struct _F_u_n_c_t_i_o_n; │ │ │ │ -71 │ │ │ │ -80template │ │ │ │ -_8_1struct _F_u_n_c_t_i_o_n : Refines > │ │ │ │ -82{ │ │ │ │ -83 template │ │ │ │ -_8_4 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ -85 // F models Function if the result of F(Domain) is implicitly │ │ │ │ -convertible to Range │ │ │ │ -86 requireConvertible(f(std::declval())) │ │ │ │ -87 ); │ │ │ │ -88}; │ │ │ │ -89 │ │ │ │ -91template │ │ │ │ -_9_2static constexpr bool _i_s_F_u_n_c_t_i_o_n() │ │ │ │ -93{ return models, F>(); } │ │ │ │ +67namespace ContainerDescriptors { │ │ │ │ +68 │ │ │ │ +_7_0struct _V_a_l_u_e │ │ │ │ +71{ │ │ │ │ +73 template │ │ │ │ +_7_4 _V_a_l_u_e _o_p_e_r_a_t_o_r_[_]_ (const Index&) const { return {}; } │ │ │ │ +75 │ │ │ │ +_7_7 static constexpr std::size_t _s_i_z_e () { return 0; } │ │ │ │ +78}; │ │ │ │ +79 │ │ │ │ +81template │ │ │ │ +_8_2using _T_u_p_l_e = Dune::TupleVector; │ │ │ │ +83 │ │ │ │ +86template 0), int> = 0, │ │ │ │ +88 std::enable_if_t<(...|| (not std::is_same_v)), int> = 0> │ │ │ │ +89auto _m_a_k_e_D_e_s_c_r_i_p_t_o_r (Child0 child0, Children... children) │ │ │ │ +90{ │ │ │ │ +91 using Descriptor = _T_u_p_l_e; │ │ │ │ +92 return Descriptor{std::move(child0),std::move(children)...}; │ │ │ │ +93} │ │ │ │ 94 │ │ │ │ -96template class DerivativeTraits> │ │ │ │ -_9_7static constexpr bool _i_s_F_u_n_c_t_i_o_n(F&& f, _S_i_g_n_a_t_u_r_e_T_a_g_<_S_i_g_n_a_t_u_r_e_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_>) │ │ │ │ -98{ return models, F>(); } │ │ │ │ +95 │ │ │ │ +97template │ │ │ │ +_9_8using _A_r_r_a_y = std::array; │ │ │ │ 99 │ │ │ │ -100 │ │ │ │ -101 │ │ │ │ -102// DifferentiableFunction concept │ │ │ │ -############################################## │ │ │ │ -103template class DerivativeTraits = │ │ │ │ -_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s> │ │ │ │ -_1_0_4struct _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n; │ │ │ │ -105 │ │ │ │ -117template class DerivativeTraits> │ │ │ │ -_1_1_8struct _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n : │ │ │ │ -Refines > │ │ │ │ -119{ │ │ │ │ -_1_2_0 using _D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e = typename _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s:: │ │ │ │ -template _D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e_<_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_>; │ │ │ │ -121 │ │ │ │ -122 template │ │ │ │ -_1_2_3 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ -124 _d_e_r_i_v_a_t_i_v_e(f), │ │ │ │ -125 requireConcept>(_d_e_r_i_v_a_t_i_v_e(f)) │ │ │ │ -126 ); │ │ │ │ -127}; │ │ │ │ -128 │ │ │ │ -130template class DerivativeTraits = │ │ │ │ -_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s> │ │ │ │ -_1_3_1static constexpr bool _i_s_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n() │ │ │ │ -132{ return models, F>(); } │ │ │ │ +101template &&...), int> = 0> │ │ │ │ +_1_0_3auto _m_a_k_e_D_e_s_c_r_i_p_t_o_r (Child0 child, Children... children) │ │ │ │ +104{ │ │ │ │ +105 using Descriptor = _A_r_r_a_y; │ │ │ │ +106 return Descriptor{std::move(child),std::move(children)...}; │ │ │ │ +107} │ │ │ │ +108 │ │ │ │ +109 │ │ │ │ +111template │ │ │ │ +_1_1_2using _V_e_c_t_o_r = std::vector; │ │ │ │ +113 │ │ │ │ +115template │ │ │ │ +_1_1_6struct _U_n_i_f_o_r_m_A_r_r_a_y │ │ │ │ +117{ │ │ │ │ +119 template, int> = 0> │ │ │ │ +_1_2_1 _U_n_i_f_o_r_m_A_r_r_a_y () │ │ │ │ +122 : child_{} │ │ │ │ +123 {} │ │ │ │ +124 │ │ │ │ +_1_2_6 explicit _U_n_i_f_o_r_m_A_r_r_a_y (Child child) │ │ │ │ +127 : child_{std::move(child)} │ │ │ │ +128 {} │ │ │ │ +129 │ │ │ │ +131 template │ │ │ │ +_1_3_2 const Child& _o_p_e_r_a_t_o_r_[_]_ (const Index& /*i*/) const { return child_; } │ │ │ │ 133 │ │ │ │ -135template class DerivativeTraits> │ │ │ │ -_1_3_6static constexpr bool _i_s_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n(F&& f, │ │ │ │ -_S_i_g_n_a_t_u_r_e_T_a_g_<_S_i_g_n_a_t_u_r_e_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_>) │ │ │ │ -137{ return models, F>(); } │ │ │ │ -138 │ │ │ │ -139 │ │ │ │ +_1_3_5 static constexpr std::size_t _s_i_z_e () { return n; } │ │ │ │ +136 │ │ │ │ +137private: │ │ │ │ +138 Child child_; │ │ │ │ +139}; │ │ │ │ 140 │ │ │ │ -141// LocalFunction concept ############################################## │ │ │ │ -142template │ │ │ │ -_1_4_3struct _L_o_c_a_l_F_u_n_c_t_i_o_n; │ │ │ │ +142template │ │ │ │ +_1_4_3using _F_l_a_t_A_r_r_a_y = _U_n_i_f_o_r_m_A_r_r_a_y_<_V_a_l_u_e_,_n_>; │ │ │ │ 144 │ │ │ │ -154template │ │ │ │ -_1_5_5struct _L_o_c_a_l_F_u_n_c_t_i_o_n : │ │ │ │ -156 Refines > │ │ │ │ -157{ │ │ │ │ -158 template │ │ │ │ -_1_5_9 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ -160 f.bind(std::declval()), │ │ │ │ -161 f.unbind(), │ │ │ │ -162 requireConvertible(f.bound()), │ │ │ │ -163 f.localContext(), │ │ │ │ -164 requireConvertible(f.localContext()) │ │ │ │ -165 ); │ │ │ │ -166}; │ │ │ │ -167 │ │ │ │ -169template │ │ │ │ -_1_7_0static constexpr bool _i_s_L_o_c_a_l_F_u_n_c_t_i_o_n() │ │ │ │ -171{ return models, F>(); } │ │ │ │ -172 │ │ │ │ -173 │ │ │ │ -174// DifferentiableLocalFunction concept │ │ │ │ -############################################## │ │ │ │ -175template class │ │ │ │ -DerivativeTraits = _D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s> │ │ │ │ -_1_7_6struct _D_i_f_f_e_r_e_n_t_i_a_b_l_e_L_o_c_a_l_F_u_n_c_t_i_o_n; │ │ │ │ +146template │ │ │ │ +_1_4_7auto _m_a_k_e_U_n_i_f_o_r_m_D_e_s_c_r_i_p_t_o_r (std::integral_constant, Child │ │ │ │ +child) │ │ │ │ +148{ │ │ │ │ +149 return _U_n_i_f_o_r_m_A_r_r_a_y_<_C_h_i_l_d_,_n_>{std::move(child)}; │ │ │ │ +150} │ │ │ │ +151 │ │ │ │ +152 │ │ │ │ +154template │ │ │ │ +_1_5_5struct _U_n_i_f_o_r_m_V_e_c_t_o_r │ │ │ │ +156{ │ │ │ │ +158 template, int> = 0> │ │ │ │ +_1_6_0 explicit _U_n_i_f_o_r_m_V_e_c_t_o_r (std::size_t _s_i_z_e) │ │ │ │ +161 : size_{_s_i_z_e} │ │ │ │ +162 , child_{} │ │ │ │ +163 {} │ │ │ │ +164 │ │ │ │ +_1_6_6 _U_n_i_f_o_r_m_V_e_c_t_o_r (std::size_t _s_i_z_e, Child child) │ │ │ │ +167 : size_{_s_i_z_e} │ │ │ │ +168 , child_{std::move(child)} │ │ │ │ +169 {} │ │ │ │ +170 │ │ │ │ +172 template │ │ │ │ +_1_7_3 const Child& _o_p_e_r_a_t_o_r_[_]_ (const Index& /*i*/) const { return child_; } │ │ │ │ +174 │ │ │ │ +_1_7_6 std::size_t _s_i_z_e () const { return size_; } │ │ │ │ 177 │ │ │ │ -190template │ │ │ │ -class DerivativeTraits> │ │ │ │ -_1_9_1struct _D_i_f_f_e_r_e_n_t_i_a_b_l_e_L_o_c_a_l_F_u_n_c_t_i_o_n : │ │ │ │ -192 Refines< │ │ │ │ -193 Dune::Functions::Concept::DifferentiableFunction, │ │ │ │ -194 Dune::Functions::Concept::LocalFunction │ │ │ │ -195 > │ │ │ │ -196{ │ │ │ │ -197 template │ │ │ │ -_1_9_8 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ -199 f.bind(std::declval()), │ │ │ │ -200 f.unbind(), │ │ │ │ -201 f.localContext(), │ │ │ │ -202 requireConvertible(f.localContext()) │ │ │ │ -203 ); │ │ │ │ -204}; │ │ │ │ -205 │ │ │ │ -207template class │ │ │ │ -DerivativeTraits = _D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s> │ │ │ │ -_2_0_8static constexpr bool _i_s_D_i_f_f_e_r_e_n_t_i_a_b_l_e_L_o_c_a_l_F_u_n_c_t_i_o_n() │ │ │ │ -209{ return models, F>(); } │ │ │ │ -210 │ │ │ │ -211 │ │ │ │ -212// EntitySet concept ############################################## │ │ │ │ -213 │ │ │ │ -_2_2_3struct _E_n_t_i_t_y_S_e_t │ │ │ │ -224{ │ │ │ │ -225 template │ │ │ │ -_2_2_6 auto _r_e_q_u_i_r_e(E&& f) -> decltype( │ │ │ │ -227 requireType(), │ │ │ │ -228 requireType(), │ │ │ │ -229 requireType() │ │ │ │ -230 ); │ │ │ │ -231}; │ │ │ │ -232 │ │ │ │ -234template │ │ │ │ -_2_3_5static constexpr bool _i_s_E_n_t_i_t_y_S_e_t() │ │ │ │ -236{ return models(); } │ │ │ │ -237 │ │ │ │ -238 │ │ │ │ +178private: │ │ │ │ +179 std::size_t size_; │ │ │ │ +180 Child child_; │ │ │ │ +181}; │ │ │ │ +182 │ │ │ │ +_1_8_4using _F_l_a_t_V_e_c_t_o_r = _U_n_i_f_o_r_m_V_e_c_t_o_r_<_V_a_l_u_e_>; │ │ │ │ +185 │ │ │ │ +187template │ │ │ │ +_1_8_8auto _m_a_k_e_U_n_i_f_o_r_m_D_e_s_c_r_i_p_t_o_r (std::size_t n, Child child) │ │ │ │ +189{ │ │ │ │ +190 return _U_n_i_f_o_r_m_V_e_c_t_o_r_<_C_h_i_l_d_>{n,std::move(child)}; │ │ │ │ +191} │ │ │ │ +192 │ │ │ │ +193namespace Impl { │ │ │ │ +194 │ │ │ │ +195template │ │ │ │ +196struct TreeTransform │ │ │ │ +197{ │ │ │ │ +198 TreeTransform (const InnerFunc& innerFunc, const LeafFunc& leafFunc) │ │ │ │ +199 : innerFunc_(innerFunc) │ │ │ │ +200 , leafFunc_(leafFunc) │ │ │ │ +201 {} │ │ │ │ +202 │ │ │ │ +203 Unknown operator() (const Unknown& tree) const │ │ │ │ +204 { │ │ │ │ +205 return tree; │ │ │ │ +206 } │ │ │ │ +207 │ │ │ │ +208 auto operator() (const Value& tree) const │ │ │ │ +209 { │ │ │ │ +210 return leafFunc_(tree); │ │ │ │ +211 } │ │ │ │ +212 │ │ │ │ +213 template │ │ │ │ +214 auto operator() (const _T_u_p_l_e_<_V_._._._>& tree) const │ │ │ │ +215 { │ │ │ │ +216 return unpackIntegerSequence([&](auto... ii) { │ │ │ │ +217 return _m_a_k_e_D_e_s_c_r_i_p_t_o_r(innerFunc_(tree[ii])...); │ │ │ │ +218 }, std::make_index_sequence()); │ │ │ │ +219 } │ │ │ │ +220 │ │ │ │ +221 template │ │ │ │ +222 auto operator() (const _A_r_r_a_y_<_V_,_n_>& tree) const │ │ │ │ +223 { │ │ │ │ +224 return unpackIntegerSequence([&](auto... ii) { │ │ │ │ +225 return _m_a_k_e_D_e_s_c_r_i_p_t_o_r(innerFunc_(tree[ii])...); │ │ │ │ +226 }, std::make_index_sequence()); │ │ │ │ +227 } │ │ │ │ +228 │ │ │ │ +229 template │ │ │ │ +230 auto operator() (const _V_e_c_t_o_r_<_V_>& tree) const │ │ │ │ +231 { │ │ │ │ +232 using W = decltype(innerFunc_(tree[0])); │ │ │ │ +233 _V_e_c_t_o_r_<_W_> result; │ │ │ │ +234 result.reserve(tree.size()); │ │ │ │ +235 for (std::size_t i = 0; i < tree.size(); ++i) │ │ │ │ +236 result.emplace_back(innerFunc_(tree[i])); │ │ │ │ +237 return result; │ │ │ │ +238 } │ │ │ │ 239 │ │ │ │ -240// GridFunction concept ############################################## │ │ │ │ -241template │ │ │ │ -_2_4_2struct _G_r_i_d_F_u_n_c_t_i_o_n; │ │ │ │ -243 │ │ │ │ -253template │ │ │ │ -_2_5_4struct _G_r_i_d_F_u_n_c_t_i_o_n : │ │ │ │ -255 Refines > │ │ │ │ -256{ │ │ │ │ -_2_5_7 using _L_o_c_a_l_S_i_g_n_a_t_u_r_e = Range(typename EntitySet::LocalCoordinate); │ │ │ │ -_2_5_8 using _L_o_c_a_l_C_o_n_t_e_x_t = typename EntitySet::Element; │ │ │ │ -259 │ │ │ │ -260 template │ │ │ │ -_2_6_1 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ -262 localFunction(f), │ │ │ │ -263 f.entitySet(), │ │ │ │ -264 requireConcept>(localFunction │ │ │ │ -(f)), │ │ │ │ -265 requireConcept(), │ │ │ │ -266 requireConvertible(f.entitySet()), │ │ │ │ -267 requireConvertible() │ │ │ │ -268 ); │ │ │ │ -269}; │ │ │ │ -270 │ │ │ │ -272template │ │ │ │ -_2_7_3static constexpr bool _i_s_G_r_i_d_F_u_n_c_t_i_o_n() │ │ │ │ -274{ return models, F>(); } │ │ │ │ -275 │ │ │ │ +240 template │ │ │ │ +241 auto operator() (const UniformArray& tree) const │ │ │ │ +242 { │ │ │ │ +243 return _m_a_k_e_U_n_i_f_o_r_m_D_e_s_c_r_i_p_t_o_r(Dune::index_constant{}, innerFunc_(tree │ │ │ │ +[0])); │ │ │ │ +244 } │ │ │ │ +245 │ │ │ │ +246 template │ │ │ │ +247 auto operator() (const UniformVector& tree) const │ │ │ │ +248 { │ │ │ │ +249 return _m_a_k_e_U_n_i_f_o_r_m_D_e_s_c_r_i_p_t_o_r(tree.size(), innerFunc_(tree[0])); │ │ │ │ +250 } │ │ │ │ +251 │ │ │ │ +252private: │ │ │ │ +253 InnerFunc innerFunc_; │ │ │ │ +254 LeafFunc leafFunc_; │ │ │ │ +255}; │ │ │ │ +256 │ │ │ │ +257 │ │ │ │ +268template │ │ │ │ +269auto appendToTree (Size s, const T& tree) │ │ │ │ +270{ │ │ │ │ +271 auto transform = TreeTransform( │ │ │ │ +272 [s](auto&& node) { return appendToTree(s, node); }, │ │ │ │ +273 [s](auto&& node) { return _m_a_k_e_U_n_i_f_o_r_m_D_e_s_c_r_i_p_t_o_r(s, node); }); │ │ │ │ +274 return transform(tree); │ │ │ │ +275} │ │ │ │ 276 │ │ │ │ -277// DifferentiableGridFunction concept │ │ │ │ -############################################## │ │ │ │ -278template class │ │ │ │ -DerivativeTraits = _D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s> │ │ │ │ -_2_7_9struct _D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_F_u_n_c_t_i_o_n; │ │ │ │ -280 │ │ │ │ -293template class │ │ │ │ -DerivativeTraits> │ │ │ │ -_2_9_4struct _D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_F_u_n_c_t_i_o_n : │ │ │ │ -295 Refines< │ │ │ │ -296 Dune::Functions::Concept::DifferentiableFunction, │ │ │ │ -297 Dune::Functions::Concept::GridFunction │ │ │ │ -298 > │ │ │ │ -299{ │ │ │ │ -_3_0_0 using _L_o_c_a_l_S_i_g_n_a_t_u_r_e = Range(typename EntitySet::LocalCoordinate); │ │ │ │ -_3_0_1 using _L_o_c_a_l_C_o_n_t_e_x_t = typename EntitySet::Element; │ │ │ │ -302 │ │ │ │ -303 template │ │ │ │ -_3_0_4 using _L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s = typename _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_: │ │ │ │ -_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_<_E_n_t_i_t_y_S_e_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_>_:_:_t_e_m_p_l_a_t_e Traits; │ │ │ │ -305 │ │ │ │ -306 template │ │ │ │ -_3_0_7 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ -308 requireConcept>(localFunction(f)) │ │ │ │ -309 ); │ │ │ │ -310}; │ │ │ │ -311 │ │ │ │ -313template class │ │ │ │ -DerivativeTraits = _D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s> │ │ │ │ -_3_1_4static constexpr bool _i_s_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_F_u_n_c_t_i_o_n() │ │ │ │ -315{ return models, F>(); } │ │ │ │ -316 │ │ │ │ -317 │ │ │ │ -318 │ │ │ │ -319// GridViewFunction concept ############################################## │ │ │ │ -320template │ │ │ │ -_3_2_1struct _G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n; │ │ │ │ +278template │ │ │ │ +279auto flatLexicographic (Child... child) │ │ │ │ +280{ │ │ │ │ +281 if constexpr ((std::is_same_v && ...)) │ │ │ │ +282 return _F_l_a_t_V_e_c_t_o_r((child.size() + ...)); │ │ │ │ +283 else │ │ │ │ +284 return Unknown{}; │ │ │ │ +285} │ │ │ │ +286 │ │ │ │ +288template │ │ │ │ +289auto flatLexicographicN (N n, Child child) │ │ │ │ +290{ │ │ │ │ +291 return Unknown{}; │ │ │ │ +292} │ │ │ │ +293 │ │ │ │ +295template │ │ │ │ +296auto flatLexicographicN (N n, UniformVector child) │ │ │ │ +297{ │ │ │ │ +298 return UniformVector{child.size()*n, child[0]}; │ │ │ │ +299} │ │ │ │ +300 │ │ │ │ +302template │ │ │ │ +303auto flatLexicographicN (N n, UniformArray child) │ │ │ │ +304{ │ │ │ │ +305 if constexpr (std::is_same_v) │ │ │ │ +306 return UniformVector{n*m, child[0]}; │ │ │ │ +307 else │ │ │ │ +308 return UniformArray{child[0]}; │ │ │ │ +309} │ │ │ │ +310 │ │ │ │ +312template │ │ │ │ +313auto flatLexicographicN (N n, _V_e_c_t_o_r_<_G_r_a_n_d_C_h_i_l_d_> child) │ │ │ │ +314{ │ │ │ │ +315 auto result = _V_e_c_t_o_r_<_G_r_a_n_d_C_h_i_l_d_>{}; │ │ │ │ +316 result.reserve(child.size()*n); │ │ │ │ +317 for (auto j : Dune::range(n)) │ │ │ │ +318 for (auto i : Dune::range(child.size())) │ │ │ │ +319 result.emplace_back(child[i]); │ │ │ │ +320 return result; │ │ │ │ +321} │ │ │ │ 322 │ │ │ │ -335template │ │ │ │ -_3_3_6struct _G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n : │ │ │ │ -337 Refines>> │ │ │ │ -338{ │ │ │ │ -339 template │ │ │ │ -_3_4_0 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ -341 0 // We don't need to check any further expressions, because a │ │ │ │ -GridViewFunction is just a GridFunction with a special EntitySet │ │ │ │ -342 ); │ │ │ │ -343}; │ │ │ │ -344 │ │ │ │ -346template │ │ │ │ -_3_4_7static constexpr bool _i_s_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n() │ │ │ │ -348{ return models, F>(); } │ │ │ │ -349 │ │ │ │ -350 │ │ │ │ -351// DifferentiableGridViewFunction concept │ │ │ │ -############################################## │ │ │ │ -352template class │ │ │ │ -DerivativeTraits = _D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s> │ │ │ │ -_3_5_3struct _D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n; │ │ │ │ -354 │ │ │ │ -368template class │ │ │ │ -DerivativeTraits> │ │ │ │ -_3_6_9struct _D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n : │ │ │ │ -370 Refines, DerivativeTraits>> │ │ │ │ -371{ │ │ │ │ -372 template │ │ │ │ -_3_7_3 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ -374 0 // We don't need to check any further expressions, because a │ │ │ │ -GridViewFunction is just a GridFunction with a special EntitySet │ │ │ │ -375 ); │ │ │ │ -376}; │ │ │ │ -377 │ │ │ │ -379template class │ │ │ │ -DerivativeTraits = _D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s> │ │ │ │ -_3_8_0static constexpr bool _i_s_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n() │ │ │ │ -381{ return models, F>(); } │ │ │ │ -382 │ │ │ │ -383 │ │ │ │ -384 │ │ │ │ -385}}} // namespace Dune::Functions::Concept │ │ │ │ -386 │ │ │ │ -387#endif // DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH │ │ │ │ -_l_o_c_a_l_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h │ │ │ │ -_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._h_h │ │ │ │ -_s_i_g_n_a_t_u_r_e_._h_h │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ -static constexpr bool isGridFunction() │ │ │ │ -Check if F models the GridFunction concept with given signature and entity set. │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:273 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_D_i_f_f_e_r_e_n_t_i_a_b_l_e_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -static constexpr bool isDifferentiableLocalFunction() │ │ │ │ -Check if F models the DifferentiableLocalFunction concept with given signature │ │ │ │ -and local context. │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:208 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_F_u_n_c_t_i_o_n │ │ │ │ -static constexpr bool isFunction() │ │ │ │ -Check if F models the Function concept with given signature. │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:92 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ -static constexpr bool isDifferentiableGridViewFunction() │ │ │ │ -Check if F models the DifferentiableGridViewFunction concept with given │ │ │ │ -signature. │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:380 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n │ │ │ │ -static constexpr bool isDifferentiableFunction() │ │ │ │ -Check if F models the DifferentiableFunction concept with given signature. │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:131 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ -static constexpr bool isGridViewFunction() │ │ │ │ -Check if F models the GridViewFunction concept with given signature. │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:347 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_E_n_t_i_t_y_S_e_t │ │ │ │ -static constexpr bool isEntitySet() │ │ │ │ -Check if F models the GridFunction concept with given signature and entity set. │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:235 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ -static constexpr bool isDifferentiableGridFunction() │ │ │ │ -Check if F models the DifferentiableGridFunction concept with given signature │ │ │ │ -and entity set. │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:314 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -static constexpr bool isLocalFunction() │ │ │ │ -Check if F models the LocalFunction concept with given signature and local │ │ │ │ -context. │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:170 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_d_e_r_i_v_a_t_i_v_e │ │ │ │ -TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const │ │ │ │ -TrigonometricFunction< K, sinFactor, cosFactor > &f) │ │ │ │ -Obtain derivative of TrigonometricFunction function. │ │ │ │ -DDeeffiinniittiioonn trigonometricfunction.hh:43 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_i_s_C_a_l_l_a_b_l_e │ │ │ │ -static constexpr auto isCallable() │ │ │ │ -Check if f is callable with given argument list. │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:51 │ │ │ │ -_D_u_n_e │ │ │ │ -DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ +324template │ │ │ │ +325auto flatLexicographicN (N n, _A_r_r_a_y_<_G_r_a_n_d_C_h_i_l_d_,_ _m_> child) │ │ │ │ +326{ │ │ │ │ +327 if constexpr (std::is_same_v) │ │ │ │ +328 { │ │ │ │ +329 auto result = _V_e_c_t_o_r_<_G_r_a_n_d_C_h_i_l_d_>{}; │ │ │ │ +330 result.reserve(child.size()*n); │ │ │ │ +331 for (auto j : Dune::range(n)) │ │ │ │ +332 for (auto i : Dune::range(child.size())) │ │ │ │ +333 result.emplace_back(child[i]); │ │ │ │ +334 return result; │ │ │ │ +335 } │ │ │ │ +336 else │ │ │ │ +337 { │ │ │ │ +338 auto result = _A_r_r_a_y_<_G_r_a_n_d_C_h_i_l_d_,_ _N_:_:_v_a_l_u_e_*_m_>{}; │ │ │ │ +339 for (auto j : Dune::range(n)) │ │ │ │ +340 for (auto i : Dune::range(child.size())) │ │ │ │ +341 result.emplace_back(child[i]); │ │ │ │ +342 return result; │ │ │ │ +343 } │ │ │ │ +344} │ │ │ │ +345 │ │ │ │ +347template │ │ │ │ +348auto flatLexicographicN (N n, _T_u_p_l_e_<_G_r_a_n_d_C_h_i_l_d_._._._> child) │ │ │ │ +349{ │ │ │ │ +350 constexpr std::size_t m = sizeof...(GrandChild); │ │ │ │ +351 return Dune::unpackIntegerSequence([&](auto... i) { │ │ │ │ +352 return _m_a_k_e_D_e_s_c_r_i_p_t_o_r(std::get(child)...); │ │ │ │ +353 }, std::make_index_sequence{}); │ │ │ │ +354} │ │ │ │ +355 │ │ │ │ +357template │ │ │ │ +358auto flatInterleavedN (N n, Child child) │ │ │ │ +359{ │ │ │ │ +360 return Unknown{}; │ │ │ │ +361} │ │ │ │ +362 │ │ │ │ +364template │ │ │ │ +365auto flatInterleavedN (N n, UniformVector child) │ │ │ │ +366{ │ │ │ │ +367 return UniformVector{child.size()*n, child[0]}; │ │ │ │ +368} │ │ │ │ +369 │ │ │ │ +371template │ │ │ │ +372auto flatInterleavedN (N n, UniformArray child) │ │ │ │ +373{ │ │ │ │ +374 if constexpr (std::is_integral_v) │ │ │ │ +375 return UniformVector{n*m, child[0]}; │ │ │ │ +376 else │ │ │ │ +377 return UniformArray{child[0]}; │ │ │ │ +378} │ │ │ │ +379 │ │ │ │ +381template │ │ │ │ +382auto flatInterleavedN (N n, _V_e_c_t_o_r_<_G_r_a_n_d_C_h_i_l_d_> child) │ │ │ │ +383{ │ │ │ │ +384 auto result = _V_e_c_t_o_r_<_G_r_a_n_d_C_h_i_l_d_>{}; │ │ │ │ +385 result.reserve(child.size()*n); │ │ │ │ +386 for (auto i : Dune::range(child.size())) │ │ │ │ +387 for (auto j : Dune::range(n)) │ │ │ │ +388 result.emplace_back(child[i]); │ │ │ │ +389 return result; │ │ │ │ +390} │ │ │ │ +391 │ │ │ │ +393template │ │ │ │ +394auto flatInterleavedN (N n, _A_r_r_a_y_<_G_r_a_n_d_C_h_i_l_d_,_ _m_> child) │ │ │ │ +395{ │ │ │ │ +396 if constexpr (std::is_integral_v) │ │ │ │ +397 { │ │ │ │ +398 auto result = _V_e_c_t_o_r_<_G_r_a_n_d_C_h_i_l_d_>{}; │ │ │ │ +399 result.reserve(child.size()*n); │ │ │ │ +400 for (auto i : Dune::range(child.size())) │ │ │ │ +401 for (auto j : Dune::range(n)) │ │ │ │ +402 result.emplace_back(child[i]); │ │ │ │ +403 return result; │ │ │ │ +404 } │ │ │ │ +405 else │ │ │ │ +406 { │ │ │ │ +407 auto result = _A_r_r_a_y_<_G_r_a_n_d_C_h_i_l_d_,_ _N_:_:_v_a_l_u_e_*_m_>{}; │ │ │ │ +408 for (auto i : Dune::range(child.size())) │ │ │ │ +409 for (auto j : Dune::range(n)) │ │ │ │ +410 result.emplace_back(child[i]); │ │ │ │ +411 return result; │ │ │ │ +412 } │ │ │ │ +413} │ │ │ │ +414 │ │ │ │ +416template │ │ │ │ +417auto flatInterleavedN (N n, _T_u_p_l_e_<_G_r_a_n_d_C_h_i_l_d_._._._> child) │ │ │ │ +418{ │ │ │ │ +419 constexpr std::size_t m = sizeof...(GrandChild); │ │ │ │ +420 return Dune::unpackIntegerSequence([&](auto... i) { │ │ │ │ +421 return _m_a_k_e_D_e_s_c_r_i_p_t_o_r(std::get(child)...); │ │ │ │ +422 }, std::make_index_sequence{}); │ │ │ │ +423} │ │ │ │ +424 │ │ │ │ +425} // end namespace Impl │ │ │ │ +426} // end namespace ContainerDescriptors │ │ │ │ +427} // end namespace Dune::Functions │ │ │ │ +428 │ │ │ │ +429#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CONTAINERDESCRIPTORS_HH │ │ │ │ +_t_y_p_e___t_r_a_i_t_s_._h_h │ │ │ │ +_b_a_s_i_s_t_a_g_s_._h_h │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ DDeeffiinniittiioonn monomialset.hh:19 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t │ │ │ │ -DDeeffiinniittiioonn backends/concepts.hh:17 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ -Default implementation for derivative traits. │ │ │ │ -DDeeffiinniittiioonn defaultderivativetraits.hh:41 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_C_a_l_l_a_b_l_e │ │ │ │ -Concept objects that can be called with given argument list. │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:37 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_C_a_l_l_a_b_l_e_:_:_r_e_q_u_i_r_e │ │ │ │ -auto require(F &&f) -> decltype(f(std::declval< Args >()...)) │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_F_u_n_c_t_i_o_n │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:70 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_>_:_:_r_e_q_u_i_r_e │ │ │ │ -auto require(F &&f) -> decltype(requireConvertible< Range >(f(std::declval< │ │ │ │ -Domain >()))) │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:104 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e │ │ │ │ -typename SignatureTraits< Range(Domain)>::template DerivativeSignature< │ │ │ │ -DerivativeTraits > DerivativeSignature │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:120 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_r_e_q_u_i_r_e │ │ │ │ -auto require(F &&f) -> decltype(derivative(f), requireConcept< Function< │ │ │ │ -DerivativeSignature > >(derivative(f))) │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:143 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _L_o_c_a_l_C_o_n_t_e_x_t_ _>_:_:_r_e_q_u_i_r_e │ │ │ │ -auto require(F &&f) -> decltype(f.bind(std::declval< LocalContext >()), │ │ │ │ -f.unbind(), requireConvertible< bool >(f.bound()), f.localContext(), │ │ │ │ -requireConvertible< LocalContext >(f.localContext())) │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:176 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_L_o_c_a_l_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ -_L_o_c_a_l_C_o_n_t_e_x_t_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_r_e_q_u_i_r_e │ │ │ │ -auto require(F &&f) -> decltype(f.bind(std::declval< LocalContext >()), │ │ │ │ -f.unbind(), f.localContext(), requireConvertible< LocalContext >(f.localContext │ │ │ │ -())) │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_E_n_t_i_t_y_S_e_t │ │ │ │ -Concept for an entity set for a Concept::GridFunction. │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:224 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_E_n_t_i_t_y_S_e_t_:_:_r_e_q_u_i_r_e │ │ │ │ -auto require(E &&f) -> decltype(requireType< typename E::Element >(), │ │ │ │ -requireType< typename E::LocalCoordinate >(), requireType< typename E:: │ │ │ │ -GlobalCoordinate >()) │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:242 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_n_t_i_t_y_S_e_t_ _>_:_: │ │ │ │ -_L_o_c_a_l_C_o_n_t_e_x_t │ │ │ │ -typename EntitySet::Element LocalContext │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:258 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_n_t_i_t_y_S_e_t_ _>_:_: │ │ │ │ -_L_o_c_a_l_S_i_g_n_a_t_u_r_e │ │ │ │ -Range(typename EntitySet::LocalCoordinate) LocalSignature │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:257 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_n_t_i_t_y_S_e_t_ _>_:_:_r_e_q_u_i_r_e │ │ │ │ -auto require(F &&f) -> decltype(localFunction(f), f.entitySet(), │ │ │ │ -requireConcept< LocalFunction< LocalSignature, LocalContext > >(localFunction │ │ │ │ -(f)), requireConcept< Concept::EntitySet, EntitySet >(), requireConvertible< │ │ │ │ -EntitySet >(f.entitySet()), requireConvertible< typename EntitySet:: │ │ │ │ -GlobalCoordinate, Domain >()) │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:279 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_n_t_i_t_y_S_e_t_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ -typename Dune::Functions::LocalDerivativeTraits< EntitySet, DerivativeTraits │ │ │ │ ->::template Traits< R > LocalDerivativeTraits │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:304 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_n_t_i_t_y_S_e_t_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_r_e_q_u_i_r_e │ │ │ │ -auto require(F &&f) -> decltype(requireConcept< DifferentiableLocalFunction< │ │ │ │ -LocalSignature, LocalContext, LocalDerivativeTraits > >(localFunction(f))) │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_n_t_i_t_y_S_e_t_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_L_o_c_a_l_S_i_g_n_a_t_u_r_e │ │ │ │ -Range(typename EntitySet::LocalCoordinate) LocalSignature │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:300 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _E_n_t_i_t_y_S_e_t_, │ │ │ │ -_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_L_o_c_a_l_C_o_n_t_e_x_t │ │ │ │ -typename EntitySet::Element LocalContext │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:301 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:321 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _G_r_i_d_V_i_e_w_ _>_:_:_r_e_q_u_i_r_e │ │ │ │ -auto require(F &&f) -> decltype(0) │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:353 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ -_G_r_i_d_V_i_e_w_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_ _>_:_:_r_e_q_u_i_r_e │ │ │ │ -auto require(F &&f) -> decltype(0) │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_g_n_a_t_u_r_e_T_r_a_i_t_s │ │ │ │ -Helper class to deduce the signature of a callable. │ │ │ │ -DDeeffiinniittiioonn signature.hh:60 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_g_n_a_t_u_r_e_T_a_g │ │ │ │ -DDeeffiinniittiioonn signature.hh:106 │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ -Derivative traits for local functions. │ │ │ │ -DDeeffiinniittiioonn localderivativetraits.hh:32 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r │ │ │ │ +auto containerDescriptor(const PreBasis &preBasis) │ │ │ │ +Return the container descriptor of the pre-basis, if defined, otherwise │ │ │ │ +ContainerDescriptor::Unknown. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:58 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s │ │ │ │ +DDeeffiinniittiioonn containerfactory.hh:20 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_F_l_a_t_A_r_r_a_y │ │ │ │ +UniformArray< Value, n > FlatArray │ │ │ │ +Alias for a uniform array storing value placeholders. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:143 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_m_a_k_e_U_n_i_f_o_r_m_D_e_s_c_r_i_p_t_o_r │ │ │ │ +auto makeUniformDescriptor(std::integral_constant< std::size_t, n >, Child │ │ │ │ +child) │ │ │ │ +Generate a uniform descriptor in case the size is a static constant. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:147 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_F_l_a_t_V_e_c_t_o_r │ │ │ │ +UniformVector< Value > FlatVector │ │ │ │ +Alias for a uniform vector storing value placeholders. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:184 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_T_u_p_l_e │ │ │ │ +Dune::TupleVector< Children... > Tuple │ │ │ │ +Descriptor with all children of possibly different type. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:82 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_V_e_c_t_o_r │ │ │ │ +std::vector< Child > Vector │ │ │ │ +Descriptor for vectors with all children of the same type and dynamic size. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:112 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_A_r_r_a_y │ │ │ │ +std::array< Child, n > Array │ │ │ │ +Descriptor for arrays with all children of the same type and static size. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:98 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_m_a_k_e_D_e_s_c_r_i_p_t_o_r │ │ │ │ +auto makeDescriptor(Child0 child, Children... children) │ │ │ │ +Generate a descriptor in case the children are all of the same type. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:103 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_k_n_o_w_n │ │ │ │ +Fallback container descriptor if nothing else fits. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:52 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_V_a_l_u_e │ │ │ │ +The node in the descriptor tree representing a value placeholder. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:71 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_V_a_l_u_e_:_:_s_i_z_e │ │ │ │ +static constexpr std::size_t size() │ │ │ │ +A value placeholder does not have any sub-descriptors, thus its size is zero. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:77 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_V_a_l_u_e_:_:_o_p_e_r_a_t_o_r_[_] │ │ │ │ +Value operator[](const Index &) const │ │ │ │ +The child access method is only available for the interface, but should not be │ │ │ │ +called. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:74 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_i_f_o_r_m_A_r_r_a_y │ │ │ │ +Descriptor for arrays with all children identical and the number of children a │ │ │ │ +static size. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:117 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_i_f_o_r_m_A_r_r_a_y_:_:_s_i_z_e │ │ │ │ +static constexpr std::size_t size() │ │ │ │ +The static size information, i.e., number of children. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:135 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_i_f_o_r_m_A_r_r_a_y_:_:_U_n_i_f_o_r_m_A_r_r_a_y │ │ │ │ +UniformArray() │ │ │ │ +Default constructor. Is enable if the child-type is default constructible. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:121 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_i_f_o_r_m_A_r_r_a_y_:_:_U_n_i_f_o_r_m_A_r_r_a_y │ │ │ │ +UniformArray(Child child) │ │ │ │ +Constructor that stores a single child only. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:126 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_i_f_o_r_m_A_r_r_a_y_:_:_o_p_e_r_a_t_o_r_[_] │ │ │ │ +const Child & operator[](const Index &) const │ │ │ │ +Access the i'th child that is always the same, i.e., child_. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:132 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_i_f_o_r_m_V_e_c_t_o_r │ │ │ │ +Uniform descriptor with dynamic size. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:156 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_i_f_o_r_m_V_e_c_t_o_r_:_:_U_n_i_f_o_r_m_V_e_c_t_o_r │ │ │ │ +UniformVector(std::size_t size, Child child) │ │ │ │ +Constructor that stores the size and a single child only. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:166 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_i_f_o_r_m_V_e_c_t_o_r_<_ _V_a_l_u_e_ _>_:_:_s_i_z_e │ │ │ │ +std::size_t size() const │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:176 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_i_f_o_r_m_V_e_c_t_o_r_:_:_U_n_i_f_o_r_m_V_e_c_t_o_r │ │ │ │ +UniformVector(std::size_t size) │ │ │ │ +Default constructor with size. Is enable if the child-type is default │ │ │ │ +constructible. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:160 │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_t_a_i_n_e_r_D_e_s_c_r_i_p_t_o_r_s_:_:_U_n_i_f_o_r_m_V_e_c_t_o_r_:_:_o_p_e_r_a_t_o_r_[_] │ │ │ │ +const Child & operator[](const Index &) const │ │ │ │ +Access the i'th child that is always the same, i.e., child_. │ │ │ │ +DDeeffiinniittiioonn containerdescriptors.hh:173 │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _c_o_n_t_a_i_n_e_r_d_e_s_c_r_i_p_t_o_r_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00248.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: differentiablefunctionfromcallables.hh File Reference │ │ │ +Dune-Functions: morleybasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,55 +88,91 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
differentiablefunctionfromcallables.hh File Reference
│ │ │ +
morleybasis.hh File Reference
│ │ │
│ │ │
│ │ │ -
#include <dune/common/typeutilities.hh>
│ │ │ -#include <dune/common/hybridutilities.hh>
│ │ │ -#include <dune/functions/common/signature.hh>
│ │ │ -#include <dune/functions/common/differentiablefunction.hh>
│ │ │ -#include <dune/functions/common/functionconcepts.hh>
│ │ │ + │ │ │ +

This file provides an implementation of the quadratic Morley finite element in 1 to 3 dimensions. │ │ │ +More...

│ │ │ +
#include <algorithm>
│ │ │ +#include <type_traits>
│ │ │ +#include <vector>
│ │ │ +#include <array>
│ │ │ +#include <bitset>
│ │ │ +#include <dune/common/boundschecking.hh>
│ │ │ +#include <dune/common/exceptions.hh>
│ │ │ +#include <dune/common/fvector.hh>
│ │ │ +#include <dune/grid/common/mcmgmapper.hh>
│ │ │ +#include <dune/grid/common/rangegenerators.hh>
│ │ │ +#include <dune/localfunctions/common/localbasis.hh>
│ │ │ +#include <dune/localfunctions/common/localfiniteelementtraits.hh>
│ │ │ +#include <dune/localfunctions/common/localkey.hh>
│ │ │ +#include <dune/functions/analyticfunctions/monomialset.hh>
│ │ │ +#include <dune/functions/common/densevectorview.hh>
│ │ │ +#include <dune/functions/common/squeezetensor.hh>
│ │ │ +#include <dune/functions/functionspacebases/cubichermitebasis.hh>
│ │ │ +#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │ +#include <dune/functions/functionspacebases/functionaldescriptor.hh>
│ │ │ +#include <dune/functions/functionspacebases/leafprebasismappermixin.hh>
│ │ │ +#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ +#include <dune/functions/functionspacebases/transformedfiniteelementmixin.hh>
│ │ │
│ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Classes

class  Dune::Functions::DifferentiableFunctionFromCallables< Range(Domain), DerivativeTraits, F >
 Wrap a list of callable objects as derivative sequence modelling Concept::DifferentiableFunction<Range(Domain), DerivativeTraits>. More...
class  Dune::Functions::DifferentiableFunctionFromCallables< Range(Domain), DerivativeTraits, F, DF, Derivatives... >
 Wrap a list of callable objects as derivative sequence modelling Concept::DifferentiableFunction<Range(Domain), DerivativeTraits>. More...
class  Dune::Functions::MorleyNode< GV, R >
class  Dune::Functions::MorleyPreBasis< GV, R >
 A pre-basis for a Morleybasis. More...
│ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ +

│ │ │ Namespaces

namespace  Dune
namespace  Dune::Functions
namespace  Dune::Functions::BasisFactory
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ +Typedefs

template<class GV, class R = double>
using Dune::Functions::MorleyBasis = DefaultGlobalBasis<MorleyPreBasis<GV, R> >
 Nodal basis of a scalar quadratic Morley finite element space.
│ │ │ │ │ │ - │ │ │ - │ │ │ - │ │ │ + │ │ │ + │ │ │ + │ │ │

│ │ │ Functions

template<class Signature, template< class > class DerivativeTraits, class... F>
DifferentiableFunctionFromCallables< Signature, DerivativeTraits, F... > Dune::Functions::makeDifferentiableFunctionFromCallables (const SignatureTag< Signature, DerivativeTraits > &signatureTag, F &&... f)
 Create a DifferentiableFunction from callables.
template<class R = double>
auto Dune::Functions::BasisFactory::morley ()
 construct a PreBasisFactory for the Morley Finite Element
│ │ │ -
│ │ │ +

Detailed Description

│ │ │ +

This file provides an implementation of the quadratic Morley finite element in 1 to 3 dimensions.

│ │ │ +

The implementation is based on [Robert Kirby, A general approach to transforming finite elements, 2018]. It contains in the following order:

    │ │ │ +
  • A GlobalBasis typedef MorleyBasis
  • │ │ │ +
  • A template H2LocalBasisTraits, extending the dune-localfunctions LocalBasisTraits by an exported Hessiantype
  • │ │ │ +
  • A template MorleyLocalFiniteElement providing an implementation of the LocalFiniteElement interface, along with its subparts (Impl namespace)
  • │ │ │ +
  • A template MorleyNode
  • │ │ │ +
  • A template MorleyPreBasis
  • │ │ │ +
  • A factory morley() in the BasisFactory namespace
  • │ │ │ +
│ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -1,40 +1,65 @@ │ │ │ │ [Logo] Dune-Functions 2.11 │ │ │ │ Loading... │ │ │ │ Searching... │ │ │ │ No Matches │ │ │ │ -differentiablefunctionfromcallables.hh File Reference │ │ │ │ -#include │ │ │ │ -#include │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_s_i_g_n_a_t_u_r_e_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ -#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ +morleybasis.hh File Reference │ │ │ │ +This file provides an implementation of the quadratic Morley finite element in │ │ │ │ +1 to 3 dimensions. _M_o_r_e_._._. │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_a_n_a_l_y_t_i_c_f_u_n_c_t_i_o_n_s_/_m_o_n_o_m_i_a_l_s_e_t_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_d_e_n_s_e_v_e_c_t_o_r_v_i_e_w_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_c_o_m_m_o_n_/_s_q_u_e_e_z_e_t_e_n_s_o_r_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_c_u_b_i_c_h_e_r_m_i_t_e_b_a_s_i_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_f_u_n_c_t_i_o_n_a_l_d_e_s_c_r_i_p_t_o_r_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_l_e_a_f_p_r_e_b_a_s_i_s_m_a_p_p_e_r_m_i_x_i_n_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_n_o_d_e_s_._h_h> │ │ │ │ +#include <_d_u_n_e_/_f_u_n_c_t_i_o_n_s_/_f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s_/_t_r_a_n_s_f_o_r_m_e_d_f_i_n_i_t_e_e_l_e_m_e_n_t_m_i_x_i_n_._h_h> │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ CCllaasssseess │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ - _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _F_ _> │ │ │ │ - Wrap a list of callable objects as derivative sequence modelling │ │ │ │ -  _C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_<_R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_>. │ │ │ │ - _M_o_r_e_._._. │ │ │ │ -class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_, │ │ │ │ - _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_,_ _F_,_ _D_F_,_ _D_e_r_i_v_a_t_i_v_e_s_._._._ _> │ │ │ │ - Wrap a list of callable objects as derivative sequence modelling │ │ │ │ -  _C_o_n_c_e_p_t_:_:_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_<_R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s_>. │ │ │ │ - _M_o_r_e_._._. │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_N_o_d_e_<_ _G_V_,_ _R_ _> │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_P_r_e_B_a_s_i_s_<_ _G_V_,_ _R_ _> │ │ │ │ +  A pre-basis for a Morleybasis. _M_o_r_e_._._. │ │ │ │ NNaammeessppaacceess │ │ │ │ namespace   _D_u_n_e │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ +namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y │ │ │ │ +TTyyppeeddeeffss │ │ │ │ +template │ │ │ │ +using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_M_o_r_l_e_y_B_a_s_i_s = _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s<_M_o_r_l_e_y_P_r_e_B_a_s_i_s │ │ │ │ + > │ │ │ │ +  Nodal basis of a scalar quadratic Morley finite element space. │ │ │ │ FFuunnccttiioonnss │ │ │ │ -template class DerivativeTraits, class... │ │ │ │ -F> │ │ │ │ -_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s< _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_: │ │ │ │ -Signature, DerivativeTraits, F... >  _m_a_k_e_D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_s │ │ │ │ - (const _S_i_g_n_a_t_u_r_e_T_a_g< Signature, │ │ │ │ - DerivativeTraits > &signatureTag, F &&... │ │ │ │ - f) │ │ │ │ -  Create a _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n from │ │ │ │ - callables. │ │ │ │ +template │ │ │ │ +auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_F_a_c_t_o_r_y_:_:_m_o_r_l_e_y () │ │ │ │ +  construct a PreBasisFactory for the Morley Finite Element │ │ │ │ +********** DDeettaaiilleedd DDeessccrriippttiioonn ********** │ │ │ │ +This file provides an implementation of the quadratic Morley finite element in │ │ │ │ +1 to 3 dimensions. │ │ │ │ +The implementation is based on [Robert Kirby, A general approach to │ │ │ │ +transforming finite elements, 2018]. It contains in the following order: │ │ │ │ + * A GlobalBasis typedef MorleyBasis │ │ │ │ + * A template H2LocalBasisTraits, extending the dune-localfunctions │ │ │ │ + LocalBasisTraits by an exported Hessiantype │ │ │ │ + * A template MorleyLocalFiniteElement providing an implementation of the │ │ │ │ + LocalFiniteElement interface, along with its subparts (Impl namespace) │ │ │ │ + * A template MorleyNode │ │ │ │ + * A template MorleyPreBasis │ │ │ │ + * A factory morley() in the BasisFactory namespace │ │ │ │ * _d_u_n_e │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ - * _d_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_f_r_o_m_c_a_l_l_a_b_l_e_s_._h_h │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ + * _m_o_r_l_e_y_b_a_s_i_s_._h_h │ │ │ │ * Generated by _[_d_o_x_y_g_e_n_]1.15.0 │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00248.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -1,3 +1,5 @@ │ │ │ │ var a00248 = [ │ │ │ │ - ["Dune::Functions::makeDifferentiableFunctionFromCallables", "a00308.html#gad3bb1b3fe74c7f750a3980f4c0ce0449", null] │ │ │ │ + ["Dune::Functions::MorleyNode< GV, R >", "a01978.html", "a01978"], │ │ │ │ + ["Dune::Functions::MorleyBasis", "a00312.html#ga8088b673016b66bd019e80f15bd324c5", null], │ │ │ │ + ["Dune::Functions::BasisFactory::morley", "a00327.html#aa2b9ac2be3ebf37e0efd09731c4f1bca", null] │ │ │ │ ]; │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00248_source.html │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Dune-Functions: differentiablefunctionfromcallables.hh Source File │ │ │ +Dune-Functions: morleybasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -88,171 +88,609 @@ │ │ │
No Matches
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ -
differentiablefunctionfromcallables.hh
│ │ │ +
morleybasis.hh
│ │ │
│ │ │
│ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │
3
│ │ │
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
│ │ │
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
│ │ │ -
6
│ │ │ -
7#ifndef DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH
│ │ │ -
8#define DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH
│ │ │ -
9
│ │ │ -
10
│ │ │ -
11#include <dune/common/typeutilities.hh>
│ │ │ -
12#include <dune/common/hybridutilities.hh>
│ │ │ -
13
│ │ │ - │ │ │ -
15
│ │ │ - │ │ │ - │ │ │ +
6#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_MORLEYBASIS_HH
│ │ │ +
7#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_MORLEYBASIS_HH
│ │ │ +
8
│ │ │ +
9#include <algorithm>
│ │ │ +
10#include <type_traits>
│ │ │ +
11#include <vector>
│ │ │ +
12#include <array>
│ │ │ +
13#include <bitset>
│ │ │ +
14
│ │ │ +
15#include <dune/common/boundschecking.hh>
│ │ │ +
16#include <dune/common/exceptions.hh>
│ │ │ +
17#include <dune/common/fvector.hh>
│ │ │
18
│ │ │ -
19
│ │ │ -
20
│ │ │ -
21namespace Dune {
│ │ │ -
22namespace Functions {
│ │ │ -
23
│ │ │ -
24
│ │ │ +
19#include <dune/grid/common/mcmgmapper.hh>
│ │ │ +
20#include <dune/grid/common/rangegenerators.hh>
│ │ │ +
21
│ │ │ +
22#include <dune/localfunctions/common/localbasis.hh>
│ │ │ +
23#include <dune/localfunctions/common/localfiniteelementtraits.hh>
│ │ │ +
24#include <dune/localfunctions/common/localkey.hh>
│ │ │
25
│ │ │ -
26template<class Signature, template<class> class DerivativeTraits, class... Callables>
│ │ │ - │ │ │ -
28
│ │ │ -
29
│ │ │ -
30
│ │ │ -
47template<class Range, class Domain, template<class> class DerivativeTraits, class F>
│ │ │ -
│ │ │ -
48class DifferentiableFunctionFromCallables<Range(Domain), DerivativeTraits, F>
│ │ │ -
49{
│ │ │ -
50public:
│ │ │ -
51
│ │ │ -
53 using Signature = Range(Domain);
│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
35
│ │ │ +
52namespace Dune::Functions
│ │ │ +
53{
│ │ │
54
│ │ │ - │ │ │ -
56
│ │ │ -
58 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(Domain);
│ │ │ -
59
│ │ │ - │ │ │ -
62
│ │ │ -
64 template<class FF, disableCopyMove<DifferentiableFunctionFromCallables, FF> = 0>
│ │ │ -
│ │ │ - │ │ │ -
66 f_(std::forward<FF>(f))
│ │ │ -
67 {}
│ │ │ -
│ │ │ -
68
│ │ │ -
│ │ │ -
70 Range operator() (const Domain& x) const
│ │ │ -
71 {
│ │ │ -
72 return f_(x);
│ │ │ -
73 }
│ │ │ -
│ │ │ -
74
│ │ │ -
│ │ │ - │ │ │ -
81 {
│ │ │ -
82 DUNE_THROW(Dune::NotImplemented, "Derivative not implemented");
│ │ │ -
83 }
│ │ │ -
│ │ │ -
84
│ │ │ -
85private:
│ │ │ -
86 F f_;
│ │ │ -
87};
│ │ │ -
│ │ │ -
88
│ │ │ -
89
│ │ │ -
90
│ │ │ -
107template<class Range, class Domain, template<class> class DerivativeTraits, class F, class DF, class... Derivatives>
│ │ │ -
│ │ │ -
108class DifferentiableFunctionFromCallables<Range(Domain), DerivativeTraits, F, DF, Derivatives...>
│ │ │ -
109{
│ │ │ -
110public:
│ │ │ -
111
│ │ │ -
112 using Signature = Range(Domain);
│ │ │ - │ │ │ -
114 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(Domain);
│ │ │ +
55 template<class GV, class R>
│ │ │ +
56 class MorleyPreBasis;
│ │ │ +
57
│ │ │ +
75 template<class GV, class R = double>
│ │ │ + │ │ │ +
77
│ │ │ +
78
│ │ │ +
79 namespace Impl
│ │ │ +
80 {
│ │ │ +
81
│ │ │ +
88 template<class D, class R>
│ │ │ +
89 class MorleyReferenceLocalBasis
│ │ │ +
90 {
│ │ │ +
91 public:
│ │ │ +
92 static constexpr int dim = 2;
│ │ │ +
93 using Traits = H2LocalBasisTraits<D, dim, FieldVector<D, dim>, R, 1, FieldVector<R, 1>,
│ │ │ +
94 FieldMatrix<R, 1, dim>, FieldMatrix<R, dim, dim>>;
│ │ │ +
95
│ │ │ +
96 private:
│ │ │ +
97
│ │ │ +
110 static constexpr auto getMorleyCoefficients()
│ │ │ +
111 {
│ │ │ +
112 // Define std::sqrt(2.) manually in double precision,
│ │ │ +
113 // because std::sqrt is not constexpr before C++26.
│ │ │ +
114 D sqrt2 = 0.5 * 1.414213562373095;
│ │ │
115
│ │ │ -
116 using Derivative = DifferentiableFunctionFromCallables<DerivativeSignature, DerivativeTraits, DF, Derivatives...>;
│ │ │ -
117
│ │ │ -
124 template<class FF, class DFF, class... DDFF>
│ │ │ -
│ │ │ -
125 DifferentiableFunctionFromCallables(FF&& f, DFF&& df, DDFF&&... ddf) :
│ │ │ -
126 f_(std::forward<FF>(f)),
│ │ │ -
127 df_(std::forward<DFF>(df), std::forward<DDFF>(ddf)...)
│ │ │ -
128 {}
│ │ │ -
│ │ │ -
129
│ │ │ -
│ │ │ -
131 Range operator() (const Domain& x) const
│ │ │ -
132 {
│ │ │ -
133 return f_(x);
│ │ │ -
134 }
│ │ │ -
│ │ │ +
116 return Dune::FieldMatrix<D, 6,6>({{1, -1, -1, 0, 2, 0},
│ │ │ +
117 {0, 0.5, 0.5, 0.5, -1, -0.5},
│ │ │ +
118 {0, 0.5, 0.5, -0.5, -1, 0.5},
│ │ │ +
119 {0, 0, 1, 0, 0, -1},
│ │ │ +
120 {0, -1., 0, 1., 0, 0},
│ │ │ +
121 {0, sqrt2, sqrt2, -sqrt2, -2. * sqrt2, -sqrt2}});
│ │ │ +
122 }
│ │ │ +
123
│ │ │ +
124 static constexpr auto referenceBasisCoefficients = getMorleyCoefficients();
│ │ │ + │ │ │ +
126
│ │ │ +
127 public:
│ │ │ +
128
│ │ │ +
131 static constexpr unsigned int size()
│ │ │ +
132 {
│ │ │ +
133 return 6;
│ │ │ +
134 }
│ │ │
135
│ │ │ -
│ │ │ - │ │ │ -
142 {
│ │ │ -
143 return t.df_;
│ │ │ -
144 }
│ │ │ -
│ │ │ -
145
│ │ │ -
146private:
│ │ │ -
147 F f_;
│ │ │ -
148 Derivative df_;
│ │ │ -
149};
│ │ │ -
│ │ │ -
150
│ │ │ -
151
│ │ │ -
166template<class Signature, template<class> class DerivativeTraits, class... F>
│ │ │ -
167DifferentiableFunctionFromCallables<Signature, DerivativeTraits, F...>
│ │ │ -
│ │ │ - │ │ │ -
169{
│ │ │ -
170 return DifferentiableFunctionFromCallables<Signature, DerivativeTraits, F...>(f...);
│ │ │ -
171}
│ │ │ -
│ │ │ -
172
│ │ │ -
173
│ │ │ -
174
│ │ │ -
175} // namespace Functions
│ │ │ -
176} // namespace Dune
│ │ │ -
177
│ │ │ -
178#endif //DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH
│ │ │ - │ │ │ - │ │ │ - │ │ │ -
friend Derivative derivative(const DifferentiableFunctionFromCallables &t)
Get derivative of DifferentiableFunctionFromCallables.
Definition differentiablefunctionfromcallables.hh:80
│ │ │ -
DifferentiableFunctionFromCallables< Signature, DerivativeTraits, F... > makeDifferentiableFunctionFromCallables(const SignatureTag< Signature, DerivativeTraits > &signatureTag, F &&... f)
Create a DifferentiableFunction from callables.
Definition differentiablefunctionfromcallables.hh:168
│ │ │ -
Definition monomialset.hh:19
│ │ │ +
138 static constexpr unsigned int order()
│ │ │ +
139 {
│ │ │ +
140 return 2;
│ │ │ +
141 }
│ │ │ +
142
│ │ │ +
148 void evaluateFunction(const typename Traits::DomainType &in,
│ │ │ +
149 std::vector<typename Traits::RangeType> &out) const
│ │ │ +
150 {
│ │ │ +
151 out.resize(size());
│ │ │ +
152 auto monomialValues = monomials(in);
│ │ │ +
153 multiplyWithCoefficentMatrix(referenceBasisCoefficients, monomialValues, out);
│ │ │ +
154 }
│ │ │ +
155
│ │ │ +
161 void evaluateJacobian(const typename Traits::DomainType &in,
│ │ │ +
162 std::vector<typename Traits::JacobianType> &out) const
│ │ │ +
163 {
│ │ │ +
164 out.resize(size());
│ │ │ +
165 auto monomialValues = derivative(monomials)(in);
│ │ │ +
166 multiplyWithCoefficentMatrix(referenceBasisCoefficients, monomialValues, out);
│ │ │ +
167 }
│ │ │ +
168
│ │ │ +
174 void evaluateHessian(const typename Traits::DomainType &in,
│ │ │ +
175 std::vector<typename Traits::HessianType> &out) const
│ │ │ +
176 {
│ │ │ +
177 out.resize(size());
│ │ │ +
178 auto monomialValues = derivative(derivative(monomials))(in);
│ │ │ +
179 multiplyWithCoefficentMatrix(referenceBasisCoefficients, monomialValues, out);
│ │ │ +
180 }
│ │ │ +
181
│ │ │ +
188 void partial(std::array<unsigned int, dim> order, const typename Traits::DomainType &in,
│ │ │ +
189 std::vector<typename Traits::RangeType> &out) const
│ │ │ +
190 {
│ │ │ +
191 out.resize(size());
│ │ │ +
192 auto totalOrder = std::accumulate(order.begin(), order.end(), 0);
│ │ │ +
193 if (totalOrder == 0)
│ │ │ +
194 evaluateFunction(in, out);
│ │ │ +
195 else if (totalOrder == 1)
│ │ │ +
196 {
│ │ │ +
197 evaluateJacobian(in,jacobiansBuffer_);
│ │ │ +
198 std::size_t which = std::max_element(order.begin(), order.end()) - order.begin();
│ │ │ +
199 for (auto i : Dune::range(size()))
│ │ │ +
200 out[i] = jacobiansBuffer_[i][0][which];
│ │ │ +
201 }
│ │ │ +
202 else if (totalOrder == 2)
│ │ │ +
203 {
│ │ │ +
204 evaluateHessian(in, hessianBuffer_);
│ │ │ +
205 std::size_t first, second;
│ │ │ +
206 first = std::max_element(order.begin(), order.end()) - order.begin();
│ │ │ +
207 if (order[first] == 2)
│ │ │ +
208 second = first;
│ │ │ +
209 else
│ │ │ +
210 {
│ │ │ +
211 order[first] = 0;
│ │ │ +
212 second = std::max_element(order.begin(), order.end()) - order.begin();
│ │ │ +
213 }
│ │ │ +
214 for (auto i : Dune::range(size()))
│ │ │ +
215 out[i] = hessianBuffer_[i][first][second];
│ │ │ +
216 }
│ │ │ +
217 else
│ │ │ +
218 DUNE_THROW(RangeError, "partial() not implemented for given order");
│ │ │ +
219 }
│ │ │ +
220
│ │ │ +
221 private:
│ │ │ +
222 mutable std::vector<typename Traits::JacobianType> jacobiansBuffer_;
│ │ │ +
223 mutable std::vector<typename Traits::HessianType> hessianBuffer_;
│ │ │ +
224 };
│ │ │ +
225
│ │ │ +
226
│ │ │ +
230 class MorleyLocalCoefficients
│ │ │ +
231 {
│ │ │ +
232 public:
│ │ │ +
233 using size_type = std::size_t;
│ │ │ +
234
│ │ │ +
235 MorleyLocalCoefficients()
│ │ │ +
236 {
│ │ │ +
237 for (size_type i = 0; i < 3; ++i)
│ │ │ +
238 {
│ │ │ +
239 localKeys_[i] = LocalKey(i, 2, 0); // vertex dofs
│ │ │ +
240 localKeys_[3 + i] = LocalKey(i, 1, 0); // edge dofs
│ │ │ +
241 }
│ │ │ +
242 }
│ │ │ +
243
│ │ │ +
246 static constexpr size_type size()
│ │ │ +
247 {
│ │ │ +
248 return 6;
│ │ │ +
249 }
│ │ │ +
250
│ │ │ +
253 constexpr LocalKey const &localKey(size_type i) const
│ │ │ +
254 {
│ │ │ +
255 return localKeys_[i];
│ │ │ +
256 }
│ │ │ +
257
│ │ │ +
258 private:
│ │ │ +
259 std::array<LocalKey, 6> localKeys_;
│ │ │ +
260 };
│ │ │ +
261
│ │ │ +
262
│ │ │ +
268 template<class D>
│ │ │ +
269 class MorleyLocalInterpolation
│ │ │ +
270 {
│ │ │ +
271 using size_type = std::size_t;
│ │ │ +
272 using FunctionalDescriptor = Dune::Functions::Impl::FunctionalDescriptor<2>;
│ │ │ +
273
│ │ │ +
274 public:
│ │ │ +
275
│ │ │ +
276 MorleyLocalInterpolation()
│ │ │ +
277 {
│ │ │ +
278 descriptors_[0] = FunctionalDescriptor();
│ │ │ +
279 descriptors_[1] = FunctionalDescriptor();
│ │ │ +
280 descriptors_[2] = FunctionalDescriptor();
│ │ │ +
281 descriptors_[3] = FunctionalDescriptor(1);
│ │ │ +
282 descriptors_[4] = FunctionalDescriptor(1);
│ │ │ +
283 descriptors_[5] = FunctionalDescriptor(1);
│ │ │ +
284 }
│ │ │ +
285
│ │ │ +
288 template <class Element>
│ │ │ +
289 void bind(const Element &element, const std::bitset<3> &edgeOrientation)
│ │ │ +
290 {
│ │ │ +
291 auto geometry = element.geometry();
│ │ │ +
292
│ │ │ +
293 // get global Normals and midpoints
│ │ │ +
294 auto refElement = Dune::referenceElement<double, 2>(geometry.type());
│ │ │ +
295 for (std::size_t i = 0; i < 3; ++i)
│ │ │ +
296 {
│ │ │ +
297 localVertices_[i] = refElement.position(i, 2);
│ │ │ +
298
│ │ │ +
299 localMidpoints_[i] = refElement.position(i, 1);
│ │ │ +
300 std::size_t lower = (i == 2) ? 1 : 0;
│ │ │ +
301 std::size_t upper = (i == 0) ? 1 : 2;
│ │ │ +
302
│ │ │ +
303 auto edge = geometry.global(refElement.position(upper, 2))
│ │ │ +
304 - geometry.global(refElement.position(lower, 2));
│ │ │ +
305 // normalize and orient
│ │ │ +
306 edge /= edge.two_norm() * (edgeOrientation[i] ? -1. : 1.);
│ │ │ +
307 // Rotation by pi/2. Note that Kirby rotates by 3*pi/2
│ │ │ +
308 globalNormals_[i] = {-edge[1], edge[0]};
│ │ │ +
309 }
│ │ │ +
310 }
│ │ │ +
311
│ │ │ +
319 template <class F, class C>
│ │ │ +
320 void interpolate(const F &f, std::vector<C> &out) const
│ │ │ +
321 {
│ │ │ +
322 out.resize(6);
│ │ │ +
323 auto&& df = derivative(f);
│ │ │ +
324 for (size_type i = 0; i < 3; ++i)
│ │ │ +
325 {
│ │ │ +
326 out[i] = f(localVertices_[i]);
│ │ │ +
327 out[3 + i] = squeezeTensor(df(localMidpoints_[i])).dot(globalNormals_[i]);
│ │ │ +
328 }
│ │ │ +
329 }
│ │ │ +
330
│ │ │ +
331 const FunctionalDescriptor& functionalDescriptor(size_type i) const
│ │ │ +
332 {
│ │ │ +
333 return descriptors_[i];
│ │ │ +
334 }
│ │ │ +
335
│ │ │ +
336 protected:
│ │ │ +
337 std::array<Dune::FieldVector<D, 2>, 3> globalNormals_;
│ │ │ +
338 std::array<Dune::FieldVector<D, 2>, 3> localMidpoints_;
│ │ │ +
339 std::array<Dune::FieldVector<D, 2>, 3> localVertices_;
│ │ │ +
340 std::array<FunctionalDescriptor, 6> descriptors_;
│ │ │ +
341
│ │ │ +
342 };
│ │ │ +
343
│ │ │ +
344 template<class D, class R>
│ │ │ +
345 using MorleyLocalBasisTraits = typename Impl::MorleyReferenceLocalBasis<D, R>::Traits;
│ │ │ +
346
│ │ │ +
355 template<class D, class R>
│ │ │ +
356 class MorleyLocalFiniteElement
│ │ │ +
357 : public Impl::TransformedFiniteElementMixin<MorleyLocalFiniteElement<D,R>, MorleyLocalBasisTraits<D, R>>
│ │ │ +
358 {
│ │ │ +
359 using Base = Impl::TransformedFiniteElementMixin< MorleyLocalFiniteElement<D,R>, MorleyLocalBasisTraits<D, R>>;
│ │ │ +
360 friend class Impl::TransformedLocalBasis<MorleyLocalFiniteElement<D,R>, MorleyLocalBasisTraits<D, R>>;
│ │ │ +
361 static constexpr int dim = 2;
│ │ │ +
362 public:
│ │ │ +
363
│ │ │ +
366 using size_type = std::size_t;
│ │ │ +
367 using Traits = LocalFiniteElementTraits<
│ │ │ +
368 Impl::TransformedLocalBasis<MorleyLocalFiniteElement<D,R>, MorleyLocalBasisTraits<D, R>>,
│ │ │ +
369 Impl::MorleyLocalCoefficients,
│ │ │ +
370 Impl::MorleyLocalInterpolation<D>>;
│ │ │ +
371
│ │ │ +
375 const typename Traits::LocalCoefficientsType &localCoefficients() const
│ │ │ +
376 {
│ │ │ +
377 return coefficients_;
│ │ │ +
378 }
│ │ │ +
379
│ │ │ +
382 const typename Traits::LocalInterpolationType &localInterpolation() const
│ │ │ +
383 {
│ │ │ +
384 return interpolation_;
│ │ │ +
385 }
│ │ │ +
386
│ │ │ +
389 static constexpr GeometryType type()
│ │ │ +
390 {
│ │ │ +
391 return GeometryTypes::simplex(dim);
│ │ │ +
392 }
│ │ │ +
393
│ │ │ +
396 static constexpr size_type size()
│ │ │ +
397 {
│ │ │ +
398 return 6;
│ │ │ +
399 }
│ │ │ +
400
│ │ │ +
403 template<class Element>
│ │ │ +
404 void bind(std::bitset<3> const& data, Element const &e)
│ │ │ +
405 {
│ │ │ +
406 edgeOrientation_ = data;
│ │ │ +
407
│ │ │ +
408 fillMatrix(e.geometry());
│ │ │ +
409 interpolation_.bind(e, edgeOrientation_);
│ │ │ +
410 }
│ │ │ +
411
│ │ │ +
412 protected:
│ │ │ +
413
│ │ │ +
416 Impl::MorleyReferenceLocalBasis<D, R> const& referenceLocalBasis() const
│ │ │ +
417 {
│ │ │ +
418 return basis_;
│ │ │ +
419 }
│ │ │ +
420
│ │ │ +
426 template<class InputValues, class OutputValues>
│ │ │ +
427 void transform(InputValues const& inValues, OutputValues& outValues) const
│ │ │ +
428 {
│ │ │ +
429 // Here we cannot directly use
│ │ │ +
430 // mat_.mv(inValues, outValues);
│ │ │ +
431 // because mv expects the DenseVector interface.
│ │ │ +
432 auto inValuesDenseVector = Impl::DenseVectorView(inValues);
│ │ │ +
433 auto outValuesDenseVector = Impl::DenseVectorView(outValues);
│ │ │ +
434 mat_.mv(inValuesDenseVector, outValuesDenseVector);
│ │ │ +
435 }
│ │ │ +
436
│ │ │ +
437 private:
│ │ │ +
438
│ │ │ +
445 template<class Geometry>
│ │ │ +
446 void fillMatrix(Geometry const &geometry)
│ │ │ +
447 {
│ │ │ +
448 std::array<R, 3> B_11;
│ │ │ +
449 std::array<R, 3> B_12;
│ │ │ +
450 std::array<R, 3> l_inv;
│ │ │ +
451
│ │ │ +
452 std::array<Dune::FieldVector<R, 2>, 3> referenceTangents;
│ │ │ +
453 std::array<Dune::FieldVector<R, 2>, 3> globalTangents;
│ │ │ +
454
│ │ │ +
455 // By default, edges point from the vertex with the smaller index
│ │ │ +
456 // to the vertex with the larger index.
│ │ │ +
457
│ │ │ +
458 // get local and global Tangents
│ │ │ +
459 auto refElement = Dune::referenceElement<double, 2>(geometry.type());
│ │ │ +
460 auto x = refElement.position(0,0);
│ │ │ +
461 for (std::size_t i = 0; i < 3; ++i)
│ │ │ +
462 {
│ │ │ +
463 std::size_t lower = (i == 2) ? 1 : 0;
│ │ │ +
464 std::size_t upper = (i == 0) ? 1 : 2;
│ │ │ +
465 auto edge = refElement.position(upper, 2) - refElement.position(lower, 2);
│ │ │ +
466
│ │ │ +
467 referenceTangents[i] = edge / edge.two_norm();
│ │ │ +
468
│ │ │ +
469 auto globalEdge = geometry.global(refElement.position(upper, 2))
│ │ │ +
470 - geometry.global(refElement.position(lower, 2));
│ │ │ +
471
│ │ │ +
472 l_inv[i] = 1. / globalEdge.two_norm();
│ │ │ +
473 globalTangents[i] = globalEdge * l_inv[i];
│ │ │ +
474 }
│ │ │ +
475
│ │ │ +
476 auto jacobianTransposed = geometry.jacobianTransposed(x);
│ │ │ +
477 for (std::size_t i = 0; i < 3; ++i)
│ │ │ +
478 {
│ │ │ +
479 B_11[i] = -referenceTangents[i][1]
│ │ │ +
480 *(-globalTangents[i][1] * jacobianTransposed[0][0]
│ │ │ +
481 + globalTangents[i][0] * jacobianTransposed[0][1])
│ │ │ +
482 + referenceTangents[i][0]
│ │ │ +
483 *(-globalTangents[i][1] * jacobianTransposed[1][0]
│ │ │ +
484 + globalTangents[i][0] * jacobianTransposed[1][1]);
│ │ │ +
485 B_12[i] = -referenceTangents[i][1]
│ │ │ +
486 *(globalTangents[i][0] * jacobianTransposed[0][0]
│ │ │ +
487 + globalTangents[i][1] * jacobianTransposed[0][1])
│ │ │ +
488 + referenceTangents[i][0]
│ │ │ +
489 *(globalTangents[i][0] * jacobianTransposed[1][0]
│ │ │ +
490 + globalTangents[i][1] * jacobianTransposed[1][1]);
│ │ │ +
491 }
│ │ │ +
492
│ │ │ +
493 // Actually setup matrix
│ │ │ +
494 int sign = -1;
│ │ │ +
495 for (std::size_t i = 0; i < 3; ++i)
│ │ │ +
496 {
│ │ │ +
497 mat_[i][i] = 1.;
│ │ │ +
498 for (std::size_t j = 0; j < 3; ++j)
│ │ │ +
499 {
│ │ │ +
500 if (j != (2 - i)) // dune specific edge order
│ │ │ +
501 {
│ │ │ +
502 mat_[j][3 + i] = sign * B_12[i] * l_inv[i];
│ │ │ +
503 sign *= -1;
│ │ │ +
504 }
│ │ │ +
505 }
│ │ │ +
506 mat_[3 + i][3 + i] = (edgeOrientation_[i] ? -1. : 1.) * B_11[i];
│ │ │ +
507 }
│ │ │ +
508 }
│ │ │ +
509
│ │ │ +
510 // a finite element consists of a basis, coeffiecents and an interpolation
│ │ │ +
511 typename Impl::MorleyReferenceLocalBasis<D, R> basis_;
│ │ │ +
512 typename Traits::LocalCoefficientsType coefficients_;
│ │ │ +
513 typename Traits::LocalInterpolationType interpolation_;
│ │ │ +
514 // This is the matrix M in Kirbys paper
│ │ │ +
515 Dune::FieldMatrix<R, 6, 6>mat_;
│ │ │ +
516 // the local state, i.e. a collection of global information restricted to this element
│ │ │ +
517 std::bitset<3> edgeOrientation_;
│ │ │ +
518
│ │ │ +
519 };
│ │ │ +
520
│ │ │ +
521 } // end namespace Impl
│ │ │ +
522
│ │ │ +
523
│ │ │ +
524
│ │ │ +
525 // *****************************************************************************
│ │ │ +
526 // This is the reusable part of the basis. It contains
│ │ │ +
527 //
│ │ │ +
528 // MorleyPreBasis
│ │ │ +
529 // MorleyNode
│ │ │ +
530 //
│ │ │ +
531 // The pre-basis allows to create the others and is the owner of possible shared
│ │ │ +
532 // state. These components do _not_ depend on the global basis and local view
│ │ │ +
533 // and can be used without a global basis.
│ │ │ +
534 // *****************************************************************************
│ │ │ +
535
│ │ │ +
536 template<class GV, class R>
│ │ │ +
│ │ │ + │ │ │ +
538 : public LeafBasisNode
│ │ │ +
539 {
│ │ │ +
540 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper<GV>;
│ │ │ +
541 public:
│ │ │ +
542 using size_type = std::size_t;
│ │ │ +
543 using Element = typename GV::template Codim<0>::Entity;
│ │ │ +
544 using FiniteElement = typename Impl::MorleyLocalFiniteElement<typename GV::ctype, R>;
│ │ │ +
545
│ │ │ +
546
│ │ │ +
│ │ │ +
547 MorleyNode(Mapper const& m, std::vector<std::bitset<3>> const& data)
│ │ │ +
548 : mapper_(&m), data_(&data)
│ │ │ +
549 {}
│ │ │ +
│ │ │ +
550
│ │ │ +
│ │ │ +
552 Element const &element() const
│ │ │ +
553 {
│ │ │ +
554 return *element_;
│ │ │ +
555 }
│ │ │ +
│ │ │ +
556
│ │ │ +
│ │ │ + │ │ │ +
563 {
│ │ │ +
564 return finiteElement_;
│ │ │ +
565 }
│ │ │ +
│ │ │ +
566
│ │ │ +
│ │ │ +
568 void bind(Element const &e)
│ │ │ +
569 {
│ │ │ +
570 element_ = &e;
│ │ │ +
571 finiteElement_.bind((*data_)[mapper_->index(e)], *element_);
│ │ │ +
572 this->setSize(finiteElement_.size());
│ │ │ +
573 }
│ │ │ +
│ │ │ +
574
│ │ │ +
│ │ │ +
576 unsigned int order() const
│ │ │ +
577 {
│ │ │ +
578 return finiteElement_.localBasis().order();
│ │ │ +
579 }
│ │ │ +
│ │ │ +
580
│ │ │ +
581 protected:
│ │ │ + │ │ │ + │ │ │ +
584 Mapper const* mapper_;
│ │ │ +
585 std::vector<std::bitset<3>> const* data_;
│ │ │ +
586 };
│ │ │ +
│ │ │ +
587
│ │ │ +
588
│ │ │ +
598 template<class GV, class R>
│ │ │ +
│ │ │ + │ │ │ +
600 : public LeafPreBasisMapperMixin<GV>
│ │ │ +
601 {
│ │ │ +
602 using Base = LeafPreBasisMapperMixin<GV>;
│ │ │ +
603 using SubEntityMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GV>;
│ │ │ +
604 using Element = typename GV::template Codim<0>::Entity;
│ │ │ +
605 using D = typename GV::ctype;
│ │ │ +
606 static const std::size_t dim = GV::dimension;
│ │ │ +
607
│ │ │ +
608 // helper methods to assign each subentity the number of dofs. Used by the LeafPreBasisMapperMixin.
│ │ │ +
609 static constexpr auto morleyMapperLayout(Dune::GeometryType type, int gridDim)
│ │ │ +
610 {
│ │ │ +
611 assert(gridDim == 2);
│ │ │ +
612 if (type.isVertex())
│ │ │ +
613 return 1; // one evaluation dof per vertex
│ │ │ +
614 if (type.isLine())
│ │ │ +
615 return 1;
│ │ │ +
616 if ((type.isTriangle()) )
│ │ │ +
617 return 0;
│ │ │ +
618 else
│ │ │ +
619 return 0;
│ │ │ +
620 }
│ │ │ +
621
│ │ │ +
622 public:
│ │ │ +
624 using GridView = GV;
│ │ │ +
625
│ │ │ +
627 using size_type = std::size_t;
│ │ │ +
628
│ │ │ + │ │ │ +
631
│ │ │ +
│ │ │ +
633 MorleyPreBasis(const GV &gv)
│ │ │ +
634 : Base(gv, morleyMapperLayout)
│ │ │ +
635 , mapper_({gv, mcmgElementLayout()})
│ │ │ +
636 {
│ │ │ +
637 data_ = Impl::computeEdgeOrientations(mapper_);
│ │ │ +
638 }
│ │ │ +
│ │ │ +
639
│ │ │ +
│ │ │ +
641 void update(GridView const &gv)
│ │ │ +
642 {
│ │ │ +