--- /srv/reproducible-results/rbuild-debian/r-b-build.pUK9XPWD/b1/dune-functions_2.9.0-2_amd64.changes +++ /srv/reproducible-results/rbuild-debian/r-b-build.pUK9XPWD/b2/dune-functions_2.9.0-2_amd64.changes ├── Files │ @@ -1,3 +1,3 @@ │ │ 87ef3cb1cc8038994cb0a9839b5a0db7 83208 libdevel optional libdune-functions-dev_2.9.0-2_amd64.deb │ - 356de9fa70ad2f07d43a4674e3cf0bd4 2102220 doc optional libdune-functions-doc_2.9.0-2_all.deb │ + f106da976d78b7973e10d374616468ea 2103860 doc optional libdune-functions-doc_2.9.0-2_all.deb ├── libdune-functions-doc_2.9.0-2_all.deb │ ├── file list │ │ @@ -1,3 +1,3 @@ │ │ -rw-r--r-- 0 0 0 4 2023-01-12 22:26:33.000000 debian-binary │ │ --rw-r--r-- 0 0 0 13232 2023-01-12 22:26:33.000000 control.tar.xz │ │ --rw-r--r-- 0 0 0 2088796 2023-01-12 22:26:33.000000 data.tar.xz │ │ +-rw-r--r-- 0 0 0 13280 2023-01-12 22:26:33.000000 control.tar.xz │ │ +-rw-r--r-- 0 0 0 2090388 2023-01-12 22:26:33.000000 data.tar.xz │ ├── control.tar.xz │ │ ├── control.tar │ │ │ ├── ./md5sums │ │ │ │ ├── ./md5sums │ │ │ │ │┄ Files differ │ │ │ │ ├── line order │ │ │ │ │ @@ -3,14 +3,16 @@ │ │ │ │ │ usr/share/doc/libdune-functions-doc/copyright │ │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00002.html │ │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00002_source.html │ │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00005.html │ │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00005_source.html │ │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00008.html │ │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00008_source.html │ │ │ │ │ +usr/share/doc/libdune-functions-doc/doxygen/a00011.html │ │ │ │ │ +usr/share/doc/libdune-functions-doc/doxygen/a00011_source.html │ │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00014.html │ │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00014_source.html │ │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00017.html │ │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00017_source.html │ │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00020.html │ │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00020_source.html │ │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00023.html │ │ │ │ │ @@ -101,16 +103,14 @@ │ │ │ │ │ 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_source.html │ │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00155.html │ │ │ │ │ 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_source.html │ │ │ │ │ -usr/share/doc/libdune-functions-doc/doxygen/a00161.html │ │ │ │ │ -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_source.html │ │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00167.html │ │ │ │ │ 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_source.html │ │ │ │ │ usr/share/doc/libdune-functions-doc/doxygen/a00173.html │ ├── data.tar.xz │ │ ├── data.tar │ │ │ ├── file list │ │ │ │ @@ -3,140 +3,140 @@ │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2023-01-12 22:26:33.000000 ./usr/share/ │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2023-01-12 22:26:33.000000 ./usr/share/doc/ │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/ │ │ │ │ -rw-r--r-- 0 root (0) root (0) 810 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/changelog.Debian.gz │ │ │ │ -rw-r--r-- 0 root (0) root (0) 4118 2022-11-16 12:11:40.000000 ./usr/share/doc/libdune-functions-doc/changelog.gz │ │ │ │ -rw-r--r-- 0 root (0) root (0) 3331 2023-01-12 15:07:37.000000 ./usr/share/doc/libdune-functions-doc/copyright │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6395 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00002.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10801 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00002_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5151 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00005.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 21332 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00005_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10835 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00008.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 58829 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00008_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8388 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00014.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 53182 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00014_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8656 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00017.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 69065 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00017_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8968 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00020.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 77912 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00020_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6568 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00023.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 73885 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00023_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10801 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00026.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 226272 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00026_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5462 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00029.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 12949 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00029_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7324 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00032.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 24460 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00032_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5703 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00035.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 17040 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00035_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5025 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00038.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 49850 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00038_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8523 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00041.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 74873 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00041_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8830 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00044.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 39644 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00044_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5909 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00047.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 17233 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00047_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8180 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00050.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 49233 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00050_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9166 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00053.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 85827 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00053_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8493 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00056.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 59683 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00056_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8380 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00059.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 57098 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00059_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9255 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00062.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 121650 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00062_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6982 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00065.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 80007 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00065_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5546 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00068.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7889 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00068_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7187 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00071.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 30973 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00071_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13369 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00074.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 23327 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00074_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8081 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00077.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 26801 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00077_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7293 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00080.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 32938 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00080_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8418 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00083.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 46970 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00083_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5700 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00086.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 42366 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00086_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8698 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00089.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 43949 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00089_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5364 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00092.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 35754 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00092_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8252 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00095.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 53028 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00095_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6685 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00098.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 16541 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00098_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5658 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00101.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 12235 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00101_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6897 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00104.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 48169 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00104_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7400 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00107.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11624 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00107_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5079 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00110.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10602 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00110_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6962 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00113.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 18541 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00113_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 15791 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00116.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 50003 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00116_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10273 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00119.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 50957 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00119_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7143 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00122.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 15826 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00122_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6929 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00125.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 50447 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00125_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5334 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00128.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 51665 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00128_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7849 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00131.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 16030 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00131_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7755 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00134.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 29314 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00134_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6161 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00137.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 27531 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00137_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7866 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00140.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 27805 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00140_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 23372 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00143.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 70814 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00143_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6291 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00146.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 22868 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00146_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5272 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00149.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13252 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00149_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5526 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00152.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 26680 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00152_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5179 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00155.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 29257 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00155_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 4586 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00158.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13991 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00158_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 4593 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00161.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 18426 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00161_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8255 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00164.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 53468 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00164_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8266 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00167.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 17376 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00167_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7438 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00170.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 47656 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00170_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5104 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00173.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 22582 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00173_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10071 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00176.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 134397 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00176_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5921 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00179.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 12738 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00179_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6407 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00182.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 28928 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00182_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6840 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00185.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 38315 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00185_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5684 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00188.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 36641 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00188_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 4707 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00191.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13985 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00191_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5684 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00002.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 36641 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00002_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6840 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00005.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 38315 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00005_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6407 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00008.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 28928 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00008_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 4707 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00011.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13985 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00011_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5921 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00014.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 12738 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00014_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7438 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00017.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 47656 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00017_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10071 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00020.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 134397 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00020_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8266 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00023.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 17376 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00023_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5104 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00026.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 22582 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00026_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6291 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00029.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 22868 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00029_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7400 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00032.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11624 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00032_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5658 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00035.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 12235 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00035_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15791 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00038.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 50003 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00038_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7866 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00041.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 27805 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00041_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6685 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00044.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 16541 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00044_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7755 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00047.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 29314 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00047_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 4586 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00050.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13991 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00050_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7143 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00053.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15826 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00053_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7849 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00056.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 16030 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00056_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5526 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00059.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 26680 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00059_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5179 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00062.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 29257 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00062_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 4593 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00065.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 18426 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00065_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6897 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00068.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 48169 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00068_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5079 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00071.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10602 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00071_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6929 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00074.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 50447 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00074_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6161 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00077.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 27531 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00077_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6962 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00080.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 18541 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00080_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5334 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00083.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 51665 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00083_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5272 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00086.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13252 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00086_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10273 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00089.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 50957 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00089_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 23372 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00092.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 70814 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00092_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6568 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00095.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 73885 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00095_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6982 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00098.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 80007 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00098_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8656 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00101.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 69065 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00101_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9255 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00104.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 121650 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00104_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5364 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00107.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 35754 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00107_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5703 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00110.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 17040 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00110_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7187 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00113.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 30973 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00113_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5025 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00116.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 49850 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00116_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8252 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00119.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 53028 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00119_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8380 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00122.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 57098 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00122_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8698 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00125.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 43949 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00125_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13369 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00128.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 23327 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00128_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8968 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00131.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 77912 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00131_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5700 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00134.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 42366 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00134_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8418 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00137.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 46970 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00137_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5546 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00140.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7889 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00140_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9166 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00143.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 85827 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00143_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10835 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00146.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 58829 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00146_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10801 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00149.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 226272 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00149_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8081 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00152.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 26801 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00152_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8180 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00155.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 49233 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00155_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7324 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00158.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 24460 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00158_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5462 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00164.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 12949 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00164_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8523 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00167.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 74873 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00167_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8388 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00170.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 53182 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00170_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5909 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00173.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 17233 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00173_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7293 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00176.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 32938 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00176_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8493 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00179.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 59683 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00179_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8830 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00182.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 39644 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00182_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8255 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00185.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 53468 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00185_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5151 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00188.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 21332 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00188_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6395 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00191.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10801 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00191_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 3041 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00194.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 3049 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00197.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 3047 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00200.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 4095 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00203.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 6640 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00204.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 6408 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00206.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 13117 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00206.png │ │ │ │ @@ -512,15 +512,15 @@ │ │ │ │ -rw-r--r-- 0 root (0) root (0) 9960 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/dir_a2250aba7ee066a4c694d7c3cf43d078_dep.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 8549 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/dir_a5545368301c4029d7054f90c0ed45fc.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 25711 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/dir_a5545368301c4029d7054f90c0ed45fc_dep.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 4884 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/dir_e22f2c69b2799e923164d7b2e4fa3f8c.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 2989 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/dir_e22f2c69b2799e923164d7b2e4fa3f8c_dep.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 3675 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/dir_e68e8157741866f444e17edd764ebbae.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 45631 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/doxygen.css │ │ │ │ --rw-r--r-- 0 root (0) root (0) 50080 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/dune-functions.tag.gz │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 50078 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/dune-functions.tag.gz │ │ │ │ -rw-r--r-- 0 root (0) root (0) 7704 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/dynsections.js │ │ │ │ -rw-r--r-- 0 root (0) root (0) 25110 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/files.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 4096 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/functions.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 9243 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/functions_b.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 7961 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/functions_c.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 16093 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/functions_d.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 12774 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/functions_e.html │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00002.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: trigonometricfunction.hh File Reference │ │ │ │ +dune-functions: facenormalgridfunction.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,48 +65,47 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces | │ │ │ │ -Functions
│ │ │ │ -
trigonometricfunction.hh File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
facenormalgridfunction.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <cmath>
│ │ │ │ +
#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>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::Functions::TrigonometricFunction< K, sinFactor, cosFactor >
 A linear combination of trigonomic functions. More...
class  Dune::Functions::FaceNormalGridFunction< GV >
 Grid function implementing the piecewise element face normal. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ │ Namespaces

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

│ │ │ │ -Functions

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.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,30 +1,29 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _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 │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -trigonometricfunction.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ +facenormalgridfunction.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_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_:_:_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_._._. │ │ │ │ │ +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 │ │ │ │ │   │ │ │ │ │ -FFuunnccttiioonnss │ │ │ │ │ -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. │ │ │ │ │ -  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00002_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: trigonometricfunction.hh Source File │ │ │ │ +dune-functions: facenormalgridfunction.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,67 +70,209 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
trigonometricfunction.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#ifndef DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH
│ │ │ │
5
│ │ │ │ -
6#include <cmath>
│ │ │ │ -
7
│ │ │ │ -
8namespace Dune {
│ │ │ │ -
9namespace Functions {
│ │ │ │ -
10
│ │ │ │ -
11
│ │ │ │ -
12
│ │ │ │ -
25template<class K, int sinFactor, int cosFactor>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
27{
│ │ │ │ -
28public:
│ │ │ │ -
│ │ │ │ -
30 K operator () (const K& x) const
│ │ │ │ -
31 {
│ │ │ │ -
32 return sinFactor * std::sin(x) + cosFactor * std::cos(x);
│ │ │ │ -
33 }
│ │ │ │ -
│ │ │ │ -
34};
│ │ │ │ -
│ │ │ │ -
35
│ │ │ │ -
36
│ │ │ │ -
38template<class K, int sinFactor, int cosFactor>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
40{
│ │ │ │ -
41 return TrigonometricFunction<K, -cosFactor, sinFactor>();
│ │ │ │ -
42}
│ │ │ │ -
│ │ │ │ -
43
│ │ │ │ -
44
│ │ │ │ -
45
│ │ │ │ -
46}} // namespace Dune::Functions
│ │ │ │ -
47
│ │ │ │ +
6#include <type_traits>
│ │ │ │ +
7#include <optional>
│ │ │ │ +
8
│ │ │ │ +
9#include <dune/common/exceptions.hh>
│ │ │ │ +
10#include <dune/common/typeutilities.hh>
│ │ │ │ +
11#include <dune/common/rangeutilities.hh>
│ │ │ │ +
12#include <dune/geometry/referenceelements.hh>
│ │ │ │ +
13
│ │ │ │ + │ │ │ │ + │ │ │ │ +
16
│ │ │ │ +
17
│ │ │ │ +
18namespace Dune::Functions {
│ │ │ │ +
19
│ │ │ │ +
20namespace Impl {
│ │ │ │ +
21
│ │ │ │ +
22// Compute closest face to point
│ │ │ │ +
23template<class ReferenceElement, class Coordinate>
│ │ │ │ +
24auto closestFaceIndex(const ReferenceElement& re, const Coordinate& x)
│ │ │ │ +
25{
│ │ │ │ +
26 auto closestFaceIndex = decltype(re.subEntity(0,1,0,1)){};
│ │ │ │ +
27 double closestFaceDistance = std::numeric_limits<double>::max();
│ │ │ │ +
28 for(auto&& faceIndex : Dune::range(re.size(1)))
│ │ │ │ +
29 {
│ │ │ │ +
30 // For a face unit outer normal consider the orthogonal projection
│ │ │ │ +
31 // Px = x + <c-x,n>*n into the face. Then the distance to the face
│ │ │ │ +
32 // is given by |x-Px| = |<c-x,n>||n| = <c-x,n>.
│ │ │ │ +
33 auto normal = re.integrationOuterNormal(faceIndex);
│ │ │ │ +
34 normal /= normal.two_norm();
│ │ │ │ +
35 auto c = re.position(faceIndex,1);
│ │ │ │ +
36 c -= x;
│ │ │ │ +
37 auto faceDistance = (c*normal);
│ │ │ │ +
38 if (faceDistance<closestFaceDistance)
│ │ │ │ +
39 {
│ │ │ │ +
40 closestFaceDistance = faceDistance;
│ │ │ │ +
41 closestFaceIndex = faceIndex;
│ │ │ │ +
42 }
│ │ │ │ +
43 }
│ │ │ │ +
44 return closestFaceIndex;
│ │ │ │ +
45}
│ │ │ │ +
46
│ │ │ │ +
47} // end namespace Impl
│ │ │ │
48
│ │ │ │
49
│ │ │ │ -
50#endif // DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
│ │ │ │ +
50
│ │ │ │ +
51
│ │ │ │ +
64template<class GV>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
66{
│ │ │ │ +
67public:
│ │ │ │ +
68 using GridView = GV;
│ │ │ │ + │ │ │ │ +
70 using Element = typename EntitySet::Element;
│ │ │ │ +
71
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
75
│ │ │ │ +
76private:
│ │ │ │ +
77
│ │ │ │ +
78 using Traits = Imp::GridFunctionTraits<Range(Domain), EntitySet, DefaultDerivativeTraits, 16>;
│ │ │ │ +
79
│ │ │ │ +
80 class LocalFunction
│ │ │ │ +
81 {
│ │ │ │ +
82 using Geometry = typename Element::Geometry;
│ │ │ │ +
83 static const int dimension = GV::dimension;
│ │ │ │ +
84 public:
│ │ │ │ +
85
│ │ │ │ +
97 void bind(const Element& element)
│ │ │ │ +
98 {
│ │ │ │ +
99 element_ = element;
│ │ │ │ +
100 geometry_.emplace(element_.geometry());
│ │ │ │ +
101 }
│ │ │ │ +
102
│ │ │ │ +
103 void unbind()
│ │ │ │ +
104 {
│ │ │ │ +
105 geometry_.reset();
│ │ │ │ +
106 }
│ │ │ │ +
107
│ │ │ │ +
110 bool bound() const
│ │ │ │ +
111 {
│ │ │ │ +
112 return static_cast<bool>(geometry_);
│ │ │ │ +
113 }
│ │ │ │ +
114
│ │ │ │ +
124 Range operator()(const LocalDomain& x) const
│ │ │ │ +
125 {
│ │ │ │ +
126 auto&& re = Dune::referenceElement(*geometry_);
│ │ │ │ +
127 // Compute reference normal of closest face to given point
│ │ │ │ +
128 auto face = Impl::closestFaceIndex(re, x);
│ │ │ │ +
129 auto localNormal = re.integrationOuterNormal(face);
│ │ │ │ +
130
│ │ │ │ +
131 // Transform reference normal into global unit outer normal using
│ │ │ │ +
132 // covariant Piola transformation
│ │ │ │ +
133 auto normal = Range{};
│ │ │ │ +
134 geometry_->jacobianInverseTransposed(x).mv(localNormal, normal);
│ │ │ │ +
135 normal /= normal.two_norm();
│ │ │ │ +
136 return normal;
│ │ │ │ +
137 }
│ │ │ │ +
138
│ │ │ │ +
140 const Element& localContext() const
│ │ │ │ +
141 {
│ │ │ │ +
142 return element_;
│ │ │ │ +
143 }
│ │ │ │ +
144
│ │ │ │ +
146 friend typename Traits::LocalFunctionTraits::DerivativeInterface derivative(const LocalFunction& t)
│ │ │ │ +
147 {
│ │ │ │ +
148 DUNE_THROW(NotImplemented,"not implemented");
│ │ │ │ +
149 }
│ │ │ │ +
150
│ │ │ │ +
151 private:
│ │ │ │ +
152 std::optional<Geometry> geometry_;
│ │ │ │ +
153 Element element_;
│ │ │ │ +
154 };
│ │ │ │ +
155
│ │ │ │ +
156public:
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
159 entitySet_(gridView)
│ │ │ │ +
160 {}
│ │ │ │ +
│ │ │ │ +
161
│ │ │ │ +
│ │ │ │ +
163 Range operator()(const Domain& x) const
│ │ │ │ +
164 {
│ │ │ │ +
165 DUNE_THROW(NotImplemented,"not implemented");
│ │ │ │ +
166 }
│ │ │ │ +
│ │ │ │ +
167
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
170 {
│ │ │ │ +
171 DUNE_THROW(NotImplemented,"not implemented");
│ │ │ │ +
172 }
│ │ │ │ +
│ │ │ │ +
173
│ │ │ │ +
│ │ │ │ +
175 friend LocalFunction localFunction(const FaceNormalGridFunction& t)
│ │ │ │ +
176 {
│ │ │ │ +
177 return LocalFunction{};
│ │ │ │ +
178 }
│ │ │ │ +
│ │ │ │ +
179
│ │ │ │ +
│ │ │ │ +
181 const EntitySet& entitySet() const
│ │ │ │ +
182 {
│ │ │ │ +
183 return entitySet_;
│ │ │ │ +
184 }
│ │ │ │ +
│ │ │ │ +
185
│ │ │ │ +
186private:
│ │ │ │ +
187 EntitySet entitySet_;
│ │ │ │ +
188};
│ │ │ │ +
│ │ │ │ +
189
│ │ │ │ +
190
│ │ │ │ +
191
│ │ │ │ +
192} // namespace Dune::Functions
│ │ │ │ +
193
│ │ │ │ +
194#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH
│ │ │ │ + │ │ │ │ + │ │ │ │
TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
Obtain derivative of TrigonometricFunction function.
Definition trigonometricfunction.hh:39
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
A linear combination of trigonomic functions.
Definition trigonometricfunction.hh:27
│ │ │ │ -
K operator()(const K &x) const
Evaluate function.
Definition trigonometricfunction.hh:30
│ │ │ │ +
Definition polynomial.hh:11
│ │ │ │ +
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:37
│ │ │ │ +
Grid function implementing the piecewise element face normal.
Definition facenormalgridfunction.hh:66
│ │ │ │ +
GridViewEntitySet< GridView, 0 > EntitySet
Definition facenormalgridfunction.hh:69
│ │ │ │ +
typename EntitySet::LocalCoordinate LocalDomain
Definition facenormalgridfunction.hh:72
│ │ │ │ +
typename EntitySet::GlobalCoordinate Domain
Definition facenormalgridfunction.hh:73
│ │ │ │ +
typename EntitySet::GlobalCoordinate Range
Definition facenormalgridfunction.hh:74
│ │ │ │ +
const EntitySet & entitySet() const
Return the stored GridViewEntitySet.
Definition facenormalgridfunction.hh:181
│ │ │ │ +
friend Traits::DerivativeInterface derivative(const FaceNormalGridFunction &t)
Not implemented.
Definition facenormalgridfunction.hh:169
│ │ │ │ +
GV GridView
Definition facenormalgridfunction.hh:68
│ │ │ │ +
friend LocalFunction localFunction(const FaceNormalGridFunction &t)
Return a local-function associated to FaceNormalGridFunction.
Definition facenormalgridfunction.hh:175
│ │ │ │ +
FaceNormalGridFunction(const GridView &gridView)
Construct the FaceNormalGridFunction.
Definition facenormalgridfunction.hh:158
│ │ │ │ +
typename EntitySet::Element Element
Definition facenormalgridfunction.hh:70
│ │ │ │ +
Range operator()(const Domain &x) const
Not implemented.
Definition facenormalgridfunction.hh:163
│ │ │ │ +
Definition gridfunction.hh:32
│ │ │ │ + │ │ │ │ +
GridView::template Codim< codim >::Entity Element
Type of Elements contained in this EntitySet.
Definition gridviewentityset.hh:32
│ │ │ │ +
Element::Geometry::LocalCoordinate LocalCoordinate
Type of local coordinates with respect to the Element.
Definition gridviewentityset.hh:35
│ │ │ │ +
Element::Geometry::GlobalCoordinate GlobalCoordinate
Definition gridviewentityset.hh:36
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,62 +1,236 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _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 │ │ │ │ │ -trigonometricfunction.hh │ │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7 │ │ │ │ │ -8namespace _D_u_n_e { │ │ │ │ │ -9namespace Functions { │ │ │ │ │ -10 │ │ │ │ │ -11 │ │ │ │ │ -12 │ │ │ │ │ -25template │ │ │ │ │ -_2_6class _T_r_i_g_o_n_o_m_e_t_r_i_c_F_u_n_c_t_i_o_n │ │ │ │ │ -27{ │ │ │ │ │ -28public: │ │ │ │ │ -_3_0 K _o_p_e_r_a_t_o_r_ _(_)_ (const K& x) const │ │ │ │ │ -31 { │ │ │ │ │ -32 return sinFactor * std::sin(x) + cosFactor * std::cos(x); │ │ │ │ │ -33 } │ │ │ │ │ -34}; │ │ │ │ │ -35 │ │ │ │ │ -36 │ │ │ │ │ -38template │ │ │ │ │ -_3_9_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) │ │ │ │ │ -40{ │ │ │ │ │ -41 return _T_r_i_g_o_n_o_m_e_t_r_i_c_F_u_n_c_t_i_o_n(); │ │ │ │ │ -42} │ │ │ │ │ -43 │ │ │ │ │ -44 │ │ │ │ │ -45 │ │ │ │ │ -46}} // namespace Dune::Functions │ │ │ │ │ -47 │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ +8 │ │ │ │ │ +9#include │ │ │ │ │ +10#include │ │ │ │ │ +11#include │ │ │ │ │ +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 │ │ │ │ │ +17 │ │ │ │ │ +18namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ │ +19 │ │ │ │ │ +20namespace Impl { │ │ │ │ │ +21 │ │ │ │ │ +22// Compute closest face to point │ │ │ │ │ +23template │ │ │ │ │ +24auto closestFaceIndex(const ReferenceElement& re, const Coordinate& x) │ │ │ │ │ +25{ │ │ │ │ │ +26 auto closestFaceIndex = decltype(re.subEntity(0,1,0,1)){}; │ │ │ │ │ +27 double closestFaceDistance = std::numeric_limits::max(); │ │ │ │ │ +28 for(auto&& faceIndex : _D_u_n_e::range(re.size(1))) │ │ │ │ │ +29 { │ │ │ │ │ +30 // For a face unit outer normal consider the orthogonal projection │ │ │ │ │ +31 // Px = x + *n into the face. Then the distance to the face │ │ │ │ │ +32 // is given by |x-Px| = |||n| = . │ │ │ │ │ +33 auto normal = re.integrationOuterNormal(faceIndex); │ │ │ │ │ +34 normal /= normal.two_norm(); │ │ │ │ │ +35 auto c = re.position(faceIndex,1); │ │ │ │ │ +36 c -= x; │ │ │ │ │ +37 auto faceDistance = (c*normal); │ │ │ │ │ +38 if (faceDistance │ │ │ │ │ +_6_5class _F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ │ +66{ │ │ │ │ │ +67public: │ │ │ │ │ +_6_8 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ │ +_6_9 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_0 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; │ │ │ │ │ +71 │ │ │ │ │ +_7_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; │ │ │ │ │ +_7_3 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_4 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; │ │ │ │ │ +75 │ │ │ │ │ +76private: │ │ │ │ │ +77 │ │ │ │ │ +78 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>; │ │ │ │ │ +79 │ │ │ │ │ +80 class LocalFunction │ │ │ │ │ +81 { │ │ │ │ │ +82 using Geometry = typename Element::Geometry; │ │ │ │ │ +83 static const int dimension = GV::dimension; │ │ │ │ │ +84 public: │ │ │ │ │ +85 │ │ │ │ │ +97 void bind(const _E_l_e_m_e_n_t& element) │ │ │ │ │ +98 { │ │ │ │ │ +99 element_ = element; │ │ │ │ │ +100 geometry_.emplace(element_.geometry()); │ │ │ │ │ +101 } │ │ │ │ │ +102 │ │ │ │ │ +103 void unbind() │ │ │ │ │ +104 { │ │ │ │ │ +105 geometry_.reset(); │ │ │ │ │ +106 } │ │ │ │ │ +107 │ │ │ │ │ +110 bool bound() const │ │ │ │ │ +111 { │ │ │ │ │ +112 return static_cast(geometry_); │ │ │ │ │ +113 } │ │ │ │ │ +114 │ │ │ │ │ +124 _R_a_n_g_e operator()(const _L_o_c_a_l_D_o_m_a_i_n& x) const │ │ │ │ │ +125 { │ │ │ │ │ +126 auto&& re = Dune::referenceElement(*geometry_); │ │ │ │ │ +127 // Compute reference normal of closest face to given point │ │ │ │ │ +128 auto face = Impl::closestFaceIndex(re, x); │ │ │ │ │ +129 auto localNormal = re.integrationOuterNormal(face); │ │ │ │ │ +130 │ │ │ │ │ +131 // Transform reference normal into global unit outer normal using │ │ │ │ │ +132 // covariant Piola transformation │ │ │ │ │ +133 auto normal = _R_a_n_g_e{}; │ │ │ │ │ +134 geometry_->jacobianInverseTransposed(x).mv(localNormal, normal); │ │ │ │ │ +135 normal /= normal.two_norm(); │ │ │ │ │ +136 return normal; │ │ │ │ │ +137 } │ │ │ │ │ +138 │ │ │ │ │ +140 const _E_l_e_m_e_n_t& localContext() const │ │ │ │ │ +141 { │ │ │ │ │ +142 return element_; │ │ │ │ │ +143 } │ │ │ │ │ +144 │ │ │ │ │ +146 friend typename _T_r_a_i_t_s_:_:_L_o_c_a_l_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 _d_e_r_i_v_a_t_i_v_e │ │ │ │ │ +(const LocalFunction& t) │ │ │ │ │ +147 { │ │ │ │ │ +148 DUNE_THROW(NotImplemented,"not implemented"); │ │ │ │ │ +149 } │ │ │ │ │ +150 │ │ │ │ │ +151 private: │ │ │ │ │ +152 std::optional geometry_; │ │ │ │ │ +153 _E_l_e_m_e_n_t element_; │ │ │ │ │ +154 }; │ │ │ │ │ +155 │ │ │ │ │ +156public: │ │ │ │ │ +_1_5_8 _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) : │ │ │ │ │ +159 entitySet_(gridView) │ │ │ │ │ +160 {} │ │ │ │ │ +161 │ │ │ │ │ +_1_6_3 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(const _D_o_m_a_i_n& x) const │ │ │ │ │ +164 { │ │ │ │ │ +165 DUNE_THROW(NotImplemented,"not implemented"); │ │ │ │ │ +166 } │ │ │ │ │ +167 │ │ │ │ │ +_1_6_9 friend typename _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 _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) │ │ │ │ │ +170 { │ │ │ │ │ +171 DUNE_THROW(NotImplemented,"not implemented"); │ │ │ │ │ +172 } │ │ │ │ │ +173 │ │ │ │ │ +_1_7_5 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) │ │ │ │ │ +176 { │ │ │ │ │ +177 return LocalFunction{}; │ │ │ │ │ +178 } │ │ │ │ │ +179 │ │ │ │ │ +_1_8_1 const _E_n_t_i_t_y_S_e_t& _e_n_t_i_t_y_S_e_t() const │ │ │ │ │ +182 { │ │ │ │ │ +183 return entitySet_; │ │ │ │ │ +184 } │ │ │ │ │ +185 │ │ │ │ │ +186private: │ │ │ │ │ +187 _E_n_t_i_t_y_S_e_t entitySet_; │ │ │ │ │ +188}; │ │ │ │ │ +189 │ │ │ │ │ +190 │ │ │ │ │ +191 │ │ │ │ │ +192} // namespace Dune::Functions │ │ │ │ │ +193 │ │ │ │ │ +194#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_:_:_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:39 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:27 │ │ │ │ │ -_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:30 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ │ +DDeeffiinniittiioonn polynomial.hh:11 │ │ │ │ │ +_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:37 │ │ │ │ │ +_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 │ │ │ │ │ +Grid function implementing the piecewise element face normal. │ │ │ │ │ +DDeeffiinniittiioonn facenormalgridfunction.hh:66 │ │ │ │ │ +_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:69 │ │ │ │ │ +_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: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_:_:_D_o_m_a_i_n │ │ │ │ │ +typename EntitySet::GlobalCoordinate Domain │ │ │ │ │ +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_:_:_R_a_n_g_e │ │ │ │ │ +typename EntitySet::GlobalCoordinate Range │ │ │ │ │ +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_:_:_e_n_t_i_t_y_S_e_t │ │ │ │ │ +const EntitySet & entitySet() const │ │ │ │ │ +Return the stored GridViewEntitySet. │ │ │ │ │ +DDeeffiinniittiioonn facenormalgridfunction.hh:181 │ │ │ │ │ +_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:169 │ │ │ │ │ +_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:68 │ │ │ │ │ +_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:175 │ │ │ │ │ +_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:158 │ │ │ │ │ +_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:70 │ │ │ │ │ +_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:163 │ │ │ │ │ +_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: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_ _> │ │ │ │ │ +_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 │ │ │ │ │ +Type of Elements contained in this EntitySet. │ │ │ │ │ +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_ _>_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ │ +Element::Geometry::LocalCoordinate LocalCoordinate │ │ │ │ │ +Type of local coordinates with respect to the Element. │ │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:35 │ │ │ │ │ +_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:36 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00005.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: polynomial.hh File Reference │ │ │ │ +dune-functions: composedgridfunction.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,42 +65,54 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces
│ │ │ │ -
polynomial.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Functions
│ │ │ │ +
composedgridfunction.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <cmath>
│ │ │ │ -#include <initializer_list>
│ │ │ │ -#include <vector>
│ │ │ │ +
#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

class  Dune::Functions::Polynomial< K >
 A scalar polynomial implementation. 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>
auto Dune::Functions::makeComposedGridFunction (OF &&outerFunction, IF &&... innerFunction)
 Create a ComposedGridFunction that composes grid-functions with another function.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,24 +1,35 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _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 │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -polynomial.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +composedgridfunction.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_/_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 │ │ │ │ │ -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_ _> │ │ │ │ │ -  A scalar polynomial implementation. _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 │ │ │ │ │ +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. │ │ │ │ │ +  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00005_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: polynomial.hh Source File │ │ │ │ +dune-functions: composedgridfunction.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,124 +70,216 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
polynomial.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#ifndef DUNE_FUNCTIONS_ANALYTICFUNCTIONS_POLYNOMIAL_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_ANALYTICFUNCTIONS_POLYNOMIAL_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_HH
│ │ │ │
5
│ │ │ │ -
6#include <cmath>
│ │ │ │ -
7#include <initializer_list>
│ │ │ │ -
8#include <vector>
│ │ │ │ -
9
│ │ │ │ -
│ │ │ │ -
10namespace Dune {
│ │ │ │ -
│ │ │ │ -
11namespace Functions {
│ │ │ │ -
12
│ │ │ │ -
13
│ │ │ │ -
24template<class K>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
26{
│ │ │ │ -
27public:
│ │ │ │ -
28
│ │ │ │ -
30 Polynomial() = default;
│ │ │ │ -
31
│ │ │ │ -
33 Polynomial(const Polynomial& other) = default;
│ │ │ │ -
34
│ │ │ │ -
36 Polynomial(Polynomial&& other) = default;
│ │ │ │ -
37
│ │ │ │ -
39 Polynomial& operator=(const Polynomial& other) = default;
│ │ │ │ -
40
│ │ │ │ -
42 Polynomial& operator=(Polynomial&& other) = default;
│ │ │ │ -
43
│ │ │ │ -
│ │ │ │ -
50 Polynomial(std::initializer_list<K> coefficients) :
│ │ │ │ -
51 coefficients_(coefficients)
│ │ │ │ -
52 {}
│ │ │ │ -
│ │ │ │ -
53
│ │ │ │ -
│ │ │ │ -
61 Polynomial(std::vector<K>&& coefficients) :
│ │ │ │ -
62 coefficients_(std::move(coefficients))
│ │ │ │ -
63 {}
│ │ │ │ -
│ │ │ │ +
6#include <type_traits>
│ │ │ │ +
7#include <tuple>
│ │ │ │ +
8
│ │ │ │ +
9#include <dune/common/referencehelper.hh>
│ │ │ │ +
10#include <dune/common/typeutilities.hh>
│ │ │ │ +
11
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
15
│ │ │ │ +
16
│ │ │ │ +
17namespace Dune {
│ │ │ │ +
18namespace Functions {
│ │ │ │ +
19
│ │ │ │ +
20
│ │ │ │ +
21
│ │ │ │ +
40template<class OF, class... IF>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
42{
│ │ │ │ +
43 using InnerFunctions = std::tuple<IF...>;
│ │ │ │ +
44 using InnerLocalFunctions = std::tuple<decltype(localFunction(resolveRef(std::declval<const IF&>())))...>;
│ │ │ │ +
45
│ │ │ │ +
46 template<std::size_t i>
│ │ │ │ +
47 using InnerFunction = std::decay_t<ResolveRef_t<std::tuple_element_t<i, InnerFunctions>>>;
│ │ │ │ +
48
│ │ │ │ +
49 using OuterFunction = OF;
│ │ │ │ +
50
│ │ │ │ +
51public:
│ │ │ │ +
52
│ │ │ │ +
53 using EntitySet = typename InnerFunction<0>::EntitySet;
│ │ │ │ +
54 using Element = typename EntitySet::Element;
│ │ │ │ +
55
│ │ │ │ +
56 using Domain = typename EntitySet::GlobalCoordinate;
│ │ │ │ +
57 using LocalDomain = typename EntitySet::LocalCoordinate;
│ │ │ │ +
58
│ │ │ │ +
59 using Range = decltype(std::declval<OF>()(std::declval<IF>()(std::declval<Domain>())...));
│ │ │ │ +
60
│ │ │ │ +
61private:
│ │ │ │ +
62
│ │ │ │ +
63 using Traits = Imp::GridFunctionTraits<Range(Domain), EntitySet, DefaultDerivativeTraits, 16>;
│ │ │ │
64
│ │ │ │ -
│ │ │ │ -
72 Polynomial(const std::vector<K>& coefficients) :
│ │ │ │ -
73 coefficients_(coefficients)
│ │ │ │ -
74 {}
│ │ │ │ -
│ │ │ │ -
75
│ │ │ │ -
│ │ │ │ -
77 K operator() (const K& x) const
│ │ │ │ -
78 {
│ │ │ │ -
79 auto y = K(0);
│ │ │ │ -
80 for (size_t i=0; i<coefficients_.size(); ++i)
│ │ │ │ -
81 y += coefficients_[i] * std::pow(x, i);
│ │ │ │ -
82 return y;
│ │ │ │ -
83 }
│ │ │ │ -
│ │ │ │ -
84
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
95 {
│ │ │ │ -
96 std::vector<K> dpCoefficients(p.coefficients().size()-1);
│ │ │ │ -
97 for (size_t i=1; i<p.coefficients_.size(); ++i)
│ │ │ │ -
98 dpCoefficients[i-1] = p.coefficients()[i]*i;
│ │ │ │ -
99 return Polynomial(std::move(dpCoefficients));
│ │ │ │ -
100 }
│ │ │ │ -
│ │ │ │ -
101
│ │ │ │ -
│ │ │ │ -
103 const std::vector<K>& coefficients() const
│ │ │ │ -
104 {
│ │ │ │ -
105 return coefficients_;
│ │ │ │ -
106 }
│ │ │ │ -
│ │ │ │ -
107
│ │ │ │ -
108private:
│ │ │ │ -
109 std::vector<K> coefficients_;
│ │ │ │ -
110};
│ │ │ │ -
│ │ │ │ +
65 class LocalFunction
│ │ │ │ +
66 {
│ │ │ │ +
67 public:
│ │ │ │ +
74 LocalFunction(const ComposedGridFunction& globalFunction) :
│ │ │ │ +
75 globalFunction_(globalFunction),
│ │ │ │ +
76 innerLocalFunctions_(globalFunction.innerLocalFunctions())
│ │ │ │ +
77 {}
│ │ │ │ +
78
│ │ │ │ +
88 void bind(const Element& element)
│ │ │ │ +
89 {
│ │ │ │ +
90 std::apply([&](auto&... innerFunction) {
│ │ │ │ +
91 (innerFunction.bind(element),...);
│ │ │ │ +
92 }, innerLocalFunctions_);
│ │ │ │ +
93 }
│ │ │ │ +
94
│ │ │ │ +
96 void unbind()
│ │ │ │ +
97 {
│ │ │ │ +
98 std::apply([&](auto&... innerFunction) {
│ │ │ │ +
99 (innerFunction.unbind(),...);
│ │ │ │ +
100 }, innerLocalFunctions_);
│ │ │ │ +
101 }
│ │ │ │ +
102
│ │ │ │ +
105 bool bound() const
│ │ │ │ +
106 {
│ │ │ │ +
107 return std::apply([](const auto&... innerFunction) {
│ │ │ │ +
108 return (innerFunction.bound() && ...);
│ │ │ │ +
109 }, innerLocalFunctions_);
│ │ │ │ +
110 }
│ │ │ │
111
│ │ │ │ -
112
│ │ │ │ -
113
│ │ │ │ -
114}} // namespace Dune::Functions
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
115
│ │ │ │ -
116
│ │ │ │ -
117
│ │ │ │ -
118#endif // DUNE_FUNCTIONS_ANALYTICFUNCTIONS_POLYNOMIAL_HH
│ │ │ │ -
friend Polynomial derivative(const Polynomial &p)
Obtain derivative of Polynomial function.
Definition polynomial.hh:94
│ │ │ │ +
121 Range operator()(const LocalDomain& x) const
│ │ │ │ +
122 {
│ │ │ │ +
123 return std::apply([&](const auto&... innerFunction) {
│ │ │ │ +
124 return globalFunction_.outerFunction_(innerFunction(x)...);
│ │ │ │ +
125 }, innerLocalFunctions_);
│ │ │ │ +
126 }
│ │ │ │ +
127
│ │ │ │ +
137 const Element& localContext() const
│ │ │ │ +
138 {
│ │ │ │ +
139 return std::get<0>(innerLocalFunctions_).localContext();
│ │ │ │ +
140 }
│ │ │ │ +
141
│ │ │ │ +
143 friend typename Traits::LocalFunctionTraits::DerivativeInterface derivative(const LocalFunction& t)
│ │ │ │ +
144 {
│ │ │ │ +
145 DUNE_THROW(NotImplemented,"not implemented");
│ │ │ │ +
146 }
│ │ │ │ +
147
│ │ │ │ +
148 private:
│ │ │ │ +
149 const ComposedGridFunction& globalFunction_;
│ │ │ │ +
150 InnerLocalFunctions innerLocalFunctions_;
│ │ │ │ +
151 };
│ │ │ │ +
152
│ │ │ │ +
153public:
│ │ │ │ +
154
│ │ │ │ +
164 template<class OFT, class... IFT,
│ │ │ │ +
165 disableCopyMove<ComposedGridFunction, OFT> = 0,
│ │ │ │ +
166 std::enable_if_t<(sizeof...(IFT) > 0), int> = 0>
│ │ │ │ +
│ │ │ │ +
167 ComposedGridFunction(OFT&& outerFunction, IFT&&... innerFunctions) :
│ │ │ │ +
168 outerFunction_(std::forward<OFT>(outerFunction)),
│ │ │ │ +
169 innerFunctions_(std::forward<IFT>(innerFunctions)...)
│ │ │ │ +
170 {}
│ │ │ │ +
│ │ │ │ +
171
│ │ │ │ +
│ │ │ │ +
173 Range operator()(const Domain& x) const
│ │ │ │ +
174 {
│ │ │ │ +
175 DUNE_THROW(NotImplemented,"not implemented");
│ │ │ │ +
176 }
│ │ │ │ +
│ │ │ │ +
177
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
180 {
│ │ │ │ +
181 DUNE_THROW(NotImplemented,"not implemented");
│ │ │ │ +
182 }
│ │ │ │ +
│ │ │ │ +
183
│ │ │ │ +
│ │ │ │ +
190 friend LocalFunction localFunction(const ComposedGridFunction& cgf)
│ │ │ │ +
191 {
│ │ │ │ +
192 return LocalFunction(cgf);
│ │ │ │ +
193 }
│ │ │ │ +
│ │ │ │ +
194
│ │ │ │ +
│ │ │ │ +
205 const EntitySet& entitySet() const
│ │ │ │ +
206 {
│ │ │ │ +
207 return resolveRef(std::get<0>(innerFunctions_)).entitySet();
│ │ │ │ +
208 }
│ │ │ │ +
│ │ │ │ +
209
│ │ │ │ +
210protected:
│ │ │ │ +
211
│ │ │ │ +
│ │ │ │ +
212 InnerLocalFunctions innerLocalFunctions() const
│ │ │ │ +
213 {
│ │ │ │ +
214 return std::apply([&](const auto&... innerFunction) {
│ │ │ │ +
215 return std::make_tuple(localFunction(resolveRef(innerFunction))...);
│ │ │ │ +
216 }, innerFunctions_);
│ │ │ │ +
217 }
│ │ │ │ +
│ │ │ │ +
218
│ │ │ │ +
219 OuterFunction outerFunction_;
│ │ │ │ +
220 InnerFunctions innerFunctions_;
│ │ │ │ +
221};
│ │ │ │ +
│ │ │ │ +
222
│ │ │ │ +
223
│ │ │ │ +
224
│ │ │ │ +
247template<class OF, class... IF>
│ │ │ │ +
│ │ │ │ +
248auto makeComposedGridFunction(OF&& outerFunction, IF&&... innerFunction)
│ │ │ │ +
249{
│ │ │ │ +
250 using ComposedGridFunctionType = ComposedGridFunction<std::decay_t<OF>, std::decay_t<IF>...>;
│ │ │ │ +
251 return ComposedGridFunctionType(std::forward<OF>(outerFunction), std::forward<IF>(innerFunction)...);
│ │ │ │ +
252}
│ │ │ │ +
│ │ │ │ +
253
│ │ │ │ +
254
│ │ │ │ +
255
│ │ │ │ +
256}} // namespace Dune::Functions
│ │ │ │ +
257
│ │ │ │ +
258
│ │ │ │ +
259
│ │ │ │ +
260#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
Obtain derivative of TrigonometricFunction function.
Definition trigonometricfunction.hh:39
│ │ │ │ +
auto makeComposedGridFunction(OF &&outerFunction, IF &&... innerFunction)
Create a ComposedGridFunction that composes grid-functions with another function.
Definition composedgridfunction.hh:248
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
A scalar polynomial implementation.
Definition polynomial.hh:26
│ │ │ │ -
Polynomial()=default
Default constructor.
│ │ │ │ -
const std::vector< K > & coefficients() const
Obtain reference to coefficient vector.
Definition polynomial.hh:103
│ │ │ │ -
Polynomial & operator=(const Polynomial &other)=default
Copy-assignment operator.
│ │ │ │ -
Polynomial & operator=(Polynomial &&other)=default
Move-assignment operator.
│ │ │ │ -
Polynomial(std::initializer_list< K > coefficients)
Create from list of coefficients.
Definition polynomial.hh:50
│ │ │ │ -
K operator()(const K &x) const
Evaluate polynomial.
Definition polynomial.hh:77
│ │ │ │ -
Polynomial(const Polynomial &other)=default
Copy constructor.
│ │ │ │ -
Polynomial(Polynomial &&other)=default
Move constructor.
│ │ │ │ -
Polynomial(const std::vector< K > &coefficients)
Create from list of coefficients.
Definition polynomial.hh:72
│ │ │ │ -
Polynomial(std::vector< K > &&coefficients)
Create from list of coefficients.
Definition polynomial.hh:61
│ │ │ │ +
decltype(auto) resolveRef(T &&t)
This is an alias for Dune::resolveRef.
Definition referencehelper.hh:37
│ │ │ │ +
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:37
│ │ │ │ +
Composition of grid functions with another function.
Definition composedgridfunction.hh:42
│ │ │ │ +
OuterFunction outerFunction_
Definition composedgridfunction.hh:219
│ │ │ │ +
InnerFunctions innerFunctions_
Definition composedgridfunction.hh:220
│ │ │ │ +
ComposedGridFunction(OFT &&outerFunction, IFT &&... innerFunctions)
Create ComposedGridFunction.
Definition composedgridfunction.hh:167
│ │ │ │ +
const EntitySet & entitySet() const
Return the EntitySet associated to this composed grid-function.
Definition composedgridfunction.hh:205
│ │ │ │ +
typename InnerFunction< 0 >::EntitySet EntitySet
Definition composedgridfunction.hh:53
│ │ │ │ +
typename EntitySet::LocalCoordinate LocalDomain
Definition composedgridfunction.hh:57
│ │ │ │ +
typename EntitySet::Element Element
Definition composedgridfunction.hh:54
│ │ │ │ +
InnerLocalFunctions innerLocalFunctions() const
Definition composedgridfunction.hh:212
│ │ │ │ +
friend LocalFunction localFunction(const ComposedGridFunction &cgf)
Create a local-function of this composed grid-function.
Definition composedgridfunction.hh:190
│ │ │ │ +
decltype(std::declval< OF >()(std::declval< IF >()(std::declval< Domain >())...)) Range
Definition composedgridfunction.hh:59
│ │ │ │ +
typename EntitySet::GlobalCoordinate Domain
Definition composedgridfunction.hh:56
│ │ │ │ +
Range operator()(const Domain &x) const
Evaluation of the composed grid function in coordinates x
Definition composedgridfunction.hh:173
│ │ │ │ +
friend Traits::DerivativeInterface derivative(const ComposedGridFunction &t)
Not implemented.
Definition composedgridfunction.hh:179
│ │ │ │ +
Definition gridfunction.hh:32
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,127 +1,247 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _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 │ │ │ │ │ -polynomial.hh │ │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_ANALYTICFUNCTIONS_POLYNOMIAL_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_ANALYTICFUNCTIONS_POLYNOMIAL_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ -8#include │ │ │ │ │ -9 │ │ │ │ │ -_1_0namespace _D_u_n_e { │ │ │ │ │ -_1_1namespace Functions { │ │ │ │ │ -12 │ │ │ │ │ -13 │ │ │ │ │ -24template │ │ │ │ │ -_2_5class _P_o_l_y_n_o_m_i_a_l │ │ │ │ │ -26{ │ │ │ │ │ -27public: │ │ │ │ │ -28 │ │ │ │ │ -_3_0 _P_o_l_y_n_o_m_i_a_l() = default; │ │ │ │ │ -31 │ │ │ │ │ -_3_3 _P_o_l_y_n_o_m_i_a_l(const _P_o_l_y_n_o_m_i_a_l& other) = default; │ │ │ │ │ -34 │ │ │ │ │ -_3_6 _P_o_l_y_n_o_m_i_a_l(_P_o_l_y_n_o_m_i_a_l&& other) = default; │ │ │ │ │ -37 │ │ │ │ │ -_3_9 _P_o_l_y_n_o_m_i_a_l& _o_p_e_r_a_t_o_r_=(const _P_o_l_y_n_o_m_i_a_l& other) = default; │ │ │ │ │ -40 │ │ │ │ │ -_4_2 _P_o_l_y_n_o_m_i_a_l& _o_p_e_r_a_t_o_r_=(_P_o_l_y_n_o_m_i_a_l&& other) = default; │ │ │ │ │ -43 │ │ │ │ │ -_5_0 _P_o_l_y_n_o_m_i_a_l(std::initializer_list _c_o_e_f_f_i_c_i_e_n_t_s) : │ │ │ │ │ -51 coefficients_(_c_o_e_f_f_i_c_i_e_n_t_s) │ │ │ │ │ -52 {} │ │ │ │ │ -53 │ │ │ │ │ -_6_1 _P_o_l_y_n_o_m_i_a_l(std::vector&& _c_o_e_f_f_i_c_i_e_n_t_s) : │ │ │ │ │ -62 coefficients_(std::move(_c_o_e_f_f_i_c_i_e_n_t_s)) │ │ │ │ │ -63 {} │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ +8 │ │ │ │ │ +9#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_/_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> │ │ │ │ │ +13#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> │ │ │ │ │ +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 │ │ │ │ │ +16 │ │ │ │ │ +17namespace _D_u_n_e { │ │ │ │ │ +18namespace Functions { │ │ │ │ │ +19 │ │ │ │ │ +20 │ │ │ │ │ +21 │ │ │ │ │ +40template │ │ │ │ │ +_4_1class _C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ │ +42{ │ │ │ │ │ +43 using InnerFunctions = std::tuple; │ │ │ │ │ +44 using InnerLocalFunctions = std::tuple())))...>; │ │ │ │ │ +45 │ │ │ │ │ +46 template │ │ │ │ │ +47 using InnerFunction = std::decay_t>>; │ │ │ │ │ +48 │ │ │ │ │ +49 using OuterFunction = OF; │ │ │ │ │ +50 │ │ │ │ │ +51public: │ │ │ │ │ +52 │ │ │ │ │ +_5_3 using _E_n_t_i_t_y_S_e_t = typename InnerFunction<0>::EntitySet; │ │ │ │ │ +_5_4 using _E_l_e_m_e_n_t = typename EntitySet::Element; │ │ │ │ │ +55 │ │ │ │ │ +_5_6 using _D_o_m_a_i_n = typename EntitySet::GlobalCoordinate; │ │ │ │ │ +_5_7 using _L_o_c_a_l_D_o_m_a_i_n = typename EntitySet::LocalCoordinate; │ │ │ │ │ +58 │ │ │ │ │ +_5_9 using _R_a_n_g_e = decltype(std::declval()(std::declval()(std:: │ │ │ │ │ +declval())...)); │ │ │ │ │ +60 │ │ │ │ │ +61private: │ │ │ │ │ +62 │ │ │ │ │ +63 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>; │ │ │ │ │ 64 │ │ │ │ │ -_7_2 _P_o_l_y_n_o_m_i_a_l(const std::vector& _c_o_e_f_f_i_c_i_e_n_t_s) : │ │ │ │ │ -73 coefficients_(_c_o_e_f_f_i_c_i_e_n_t_s) │ │ │ │ │ -74 {} │ │ │ │ │ -75 │ │ │ │ │ -_7_7 K _o_p_e_r_a_t_o_r_(_)_ (const K& x) const │ │ │ │ │ -78 { │ │ │ │ │ -79 auto y = K(0); │ │ │ │ │ -80 for (size_t i=0; i dpCoefficients(p._c_o_e_f_f_i_c_i_e_n_t_s().size()-1); │ │ │ │ │ -97 for (size_t i=1; i& _c_o_e_f_f_i_c_i_e_n_t_s() const │ │ │ │ │ -104 { │ │ │ │ │ -105 return coefficients_; │ │ │ │ │ -106 } │ │ │ │ │ -107 │ │ │ │ │ -108private: │ │ │ │ │ -109 std::vector coefficients_; │ │ │ │ │ -110}; │ │ │ │ │ +65 class LocalFunction │ │ │ │ │ +66 { │ │ │ │ │ +67 public: │ │ │ │ │ +74 LocalFunction(const _C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n& globalFunction) : │ │ │ │ │ +75 globalFunction_(globalFunction), │ │ │ │ │ +76 innerLocalFunctions_(globalFunction._i_n_n_e_r_L_o_c_a_l_F_u_n_c_t_i_o_n_s()) │ │ │ │ │ +77 {} │ │ │ │ │ +78 │ │ │ │ │ +88 void bind(const _E_l_e_m_e_n_t& element) │ │ │ │ │ +89 { │ │ │ │ │ +90 std::apply([&](auto&... innerFunction) { │ │ │ │ │ +91 (innerFunction.bind(element),...); │ │ │ │ │ +92 }, innerLocalFunctions_); │ │ │ │ │ +93 } │ │ │ │ │ +94 │ │ │ │ │ +96 void unbind() │ │ │ │ │ +97 { │ │ │ │ │ +98 std::apply([&](auto&... innerFunction) { │ │ │ │ │ +99 (innerFunction.unbind(),...); │ │ │ │ │ +100 }, innerLocalFunctions_); │ │ │ │ │ +101 } │ │ │ │ │ +102 │ │ │ │ │ +105 bool bound() const │ │ │ │ │ +106 { │ │ │ │ │ +107 return std::apply([](const auto&... innerFunction) { │ │ │ │ │ +108 return (innerFunction.bound() && ...); │ │ │ │ │ +109 }, innerLocalFunctions_); │ │ │ │ │ +110 } │ │ │ │ │ 111 │ │ │ │ │ -112 │ │ │ │ │ -113 │ │ │ │ │ -114}} // namespace Dune::Functions │ │ │ │ │ -115 │ │ │ │ │ -116 │ │ │ │ │ -117 │ │ │ │ │ -118#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 Polynomial derivative(const Polynomial &p) │ │ │ │ │ -Obtain derivative of Polynomial function. │ │ │ │ │ -DDeeffiinniittiioonn polynomial.hh:94 │ │ │ │ │ +121 _R_a_n_g_e operator()(const _L_o_c_a_l_D_o_m_a_i_n& x) const │ │ │ │ │ +122 { │ │ │ │ │ +123 return std::apply([&](const auto&... innerFunction) { │ │ │ │ │ +124 return globalFunction_.outerFunction_(innerFunction(x)...); │ │ │ │ │ +125 }, innerLocalFunctions_); │ │ │ │ │ +126 } │ │ │ │ │ +127 │ │ │ │ │ +137 const _E_l_e_m_e_n_t& localContext() const │ │ │ │ │ +138 { │ │ │ │ │ +139 return std::get<0>(innerLocalFunctions_).localContext(); │ │ │ │ │ +140 } │ │ │ │ │ +141 │ │ │ │ │ +143 friend typename _T_r_a_i_t_s_:_:_L_o_c_a_l_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 _d_e_r_i_v_a_t_i_v_e │ │ │ │ │ +(const LocalFunction& t) │ │ │ │ │ +144 { │ │ │ │ │ +145 DUNE_THROW(NotImplemented,"not implemented"); │ │ │ │ │ +146 } │ │ │ │ │ +147 │ │ │ │ │ +148 private: │ │ │ │ │ +149 const _C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n& globalFunction_; │ │ │ │ │ +150 InnerLocalFunctions innerLocalFunctions_; │ │ │ │ │ +151 }; │ │ │ │ │ +152 │ │ │ │ │ +153public: │ │ │ │ │ +154 │ │ │ │ │ +164 template = 0, │ │ │ │ │ +166 std::enable_if_t<(sizeof...(IFT) > 0), int> = 0> │ │ │ │ │ +_1_6_7 _C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n(OFT&& outerFunction, IFT&&... innerFunctions) : │ │ │ │ │ +168 _o_u_t_e_r_F_u_n_c_t_i_o_n__(std::forward(outerFunction)), │ │ │ │ │ +169 _i_n_n_e_r_F_u_n_c_t_i_o_n_s__(std::forward(innerFunctions)...) │ │ │ │ │ +170 {} │ │ │ │ │ +171 │ │ │ │ │ +_1_7_3 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(const _D_o_m_a_i_n& x) const │ │ │ │ │ +174 { │ │ │ │ │ +175 DUNE_THROW(NotImplemented,"not implemented"); │ │ │ │ │ +176 } │ │ │ │ │ +177 │ │ │ │ │ +_1_7_9 friend typename _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 _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) │ │ │ │ │ +180 { │ │ │ │ │ +181 DUNE_THROW(NotImplemented,"not implemented"); │ │ │ │ │ +182 } │ │ │ │ │ +183 │ │ │ │ │ +_1_9_0 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) │ │ │ │ │ +191 { │ │ │ │ │ +192 return LocalFunction(cgf); │ │ │ │ │ +193 } │ │ │ │ │ +194 │ │ │ │ │ +_2_0_5 const _E_n_t_i_t_y_S_e_t& _e_n_t_i_t_y_S_e_t() const │ │ │ │ │ +206 { │ │ │ │ │ +207 return _r_e_s_o_l_v_e_R_e_f(std::get<0>(_i_n_n_e_r_F_u_n_c_t_i_o_n_s__)).entitySet(); │ │ │ │ │ +208 } │ │ │ │ │ +209 │ │ │ │ │ +210protected: │ │ │ │ │ +211 │ │ │ │ │ +_2_1_2 InnerLocalFunctions _i_n_n_e_r_L_o_c_a_l_F_u_n_c_t_i_o_n_s() const │ │ │ │ │ +213 { │ │ │ │ │ +214 return std::apply([&](const auto&... innerFunction) { │ │ │ │ │ +215 return std::make_tuple(_l_o_c_a_l_F_u_n_c_t_i_o_n(_r_e_s_o_l_v_e_R_e_f(innerFunction))...); │ │ │ │ │ +216 }, _i_n_n_e_r_F_u_n_c_t_i_o_n_s__); │ │ │ │ │ +217 } │ │ │ │ │ +218 │ │ │ │ │ +_2_1_9 OuterFunction _o_u_t_e_r_F_u_n_c_t_i_o_n__; │ │ │ │ │ +_2_2_0 InnerFunctions _i_n_n_e_r_F_u_n_c_t_i_o_n_s__; │ │ │ │ │ +221}; │ │ │ │ │ +222 │ │ │ │ │ +223 │ │ │ │ │ +224 │ │ │ │ │ +247template │ │ │ │ │ +_2_4_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) │ │ │ │ │ +249{ │ │ │ │ │ +250 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...>; │ │ │ │ │ +251 return ComposedGridFunctionType(std::forward(outerFunction), std:: │ │ │ │ │ +forward(innerFunction)...); │ │ │ │ │ +252} │ │ │ │ │ +253 │ │ │ │ │ +254 │ │ │ │ │ +255 │ │ │ │ │ +256}} // namespace Dune::Functions │ │ │ │ │ +257 │ │ │ │ │ +258 │ │ │ │ │ +259 │ │ │ │ │ +260#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 │ │ │ │ │ +_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:39 │ │ │ │ │ +_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:248 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_n_o_m_i_a_l │ │ │ │ │ -A scalar polynomial implementation. │ │ │ │ │ -DDeeffiinniittiioonn polynomial.hh:26 │ │ │ │ │ -_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_:_:_c_o_e_f_f_i_c_i_e_n_t_s │ │ │ │ │ -const std::vector< K > & coefficients() const │ │ │ │ │ -Obtain reference to coefficient vector. │ │ │ │ │ -DDeeffiinniittiioonn polynomial.hh:103 │ │ │ │ │ -_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_= │ │ │ │ │ -Polynomial & operator=(const Polynomial &other)=default │ │ │ │ │ -Copy-assignment operator. │ │ │ │ │ -_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_= │ │ │ │ │ -Polynomial & operator=(Polynomial &&other)=default │ │ │ │ │ -Move-assignment operator. │ │ │ │ │ -_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(std::initializer_list< K > coefficients) │ │ │ │ │ -Create from list of coefficients. │ │ │ │ │ -DDeeffiinniittiioonn polynomial.hh:50 │ │ │ │ │ -_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. │ │ │ │ │ -DDeeffiinniittiioonn polynomial.hh:77 │ │ │ │ │ -_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(const Polynomial &other)=default │ │ │ │ │ -Copy constructor. │ │ │ │ │ -_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(Polynomial &&other)=default │ │ │ │ │ -Move constructor. │ │ │ │ │ -_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(const std::vector< K > &coefficients) │ │ │ │ │ -Create from list of coefficients. │ │ │ │ │ -DDeeffiinniittiioonn polynomial.hh:72 │ │ │ │ │ -_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(std::vector< K > &&coefficients) │ │ │ │ │ -Create from list of coefficients. │ │ │ │ │ -DDeeffiinniittiioonn polynomial.hh:61 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_r_e_s_o_l_v_e_R_e_f │ │ │ │ │ +decltype(auto) resolveRef(T &&t) │ │ │ │ │ +This is an alias for Dune::resolveRef. │ │ │ │ │ +DDeeffiinniittiioonn referencehelper.hh:37 │ │ │ │ │ +_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:37 │ │ │ │ │ +_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:42 │ │ │ │ │ +_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:219 │ │ │ │ │ +_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:220 │ │ │ │ │ +_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:167 │ │ │ │ │ +_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:205 │ │ │ │ │ +_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:53 │ │ │ │ │ +_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: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_:_:_E_l_e_m_e_n_t │ │ │ │ │ +typename EntitySet::Element Element │ │ │ │ │ +DDeeffiinniittiioonn composedgridfunction.hh:54 │ │ │ │ │ +_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:212 │ │ │ │ │ +_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:190 │ │ │ │ │ +_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 >()(std::declval< IF >()(std::declval< Domain > │ │ │ │ │ +())...)) Range │ │ │ │ │ +DDeeffiinniittiioonn composedgridfunction.hh:59 │ │ │ │ │ +_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:56 │ │ │ │ │ +_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:173 │ │ │ │ │ +_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:179 │ │ │ │ │ +_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:32 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00008.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: transformedindexbasis.hh File Reference │ │ │ │ +dune-functions: gridfunction.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,78 +65,50 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces | │ │ │ │ -Functions
│ │ │ │ -
transformedindexbasis.hh File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
gridfunction.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <tuple>
│ │ │ │ -#include <utility>
│ │ │ │ -#include <dune/common/std/apply.hh>
│ │ │ │ -#include <dune/common/hybridutilities.hh>
│ │ │ │ -#include <dune/common/reservedvector.hh>
│ │ │ │ +
#include <type_traits>
│ │ │ │ #include <dune/common/typeutilities.hh>
│ │ │ │ -#include <dune/typetree/compositenode.hh>
│ │ │ │ -#include <dune/typetree/utility.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 <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::Experimental::TransformedIndexPreBasis< RPB, T >
 A pre-basis transforming multi-indices. More...
class  Dune::Functions::GridFunction< Signature, EntitySet, DerivativeTraits, bufferSize >
 
class  Dune::Functions::BasisFactory::Experimental::GenericIndexingTransformation< IndexTransformation, SizeImplementation, minIS, maxIS >
 A generic implementation of a transformation. More...
class  Dune::Functions::GridFunction< Range(Domain), ES, DerivativeTraits, bufferSize >
 Wrapper class for functions defined on a Grid. 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 , std::size_t minIndexSize, std::size_t maxIndexSize>
auto Dune::Functions::BasisFactory::Experimental::indexTransformation (IndexTransformation &&indexTransformation, SizeImplementation &&sizeImplementation, Dune::index_constant< minIndexSize >, Dune::index_constant< maxIndexSize >)
 A generic implementation of a transformation.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,65 +1,34 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -transformedindexbasis.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ +gridfunction.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_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> │ │ │ │ │ +#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_:_:_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_:_:_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_:_:_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_, │ │ │ │ │ - _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_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 │ │ │ │ │   │ │ │ │ │ -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 &&) - │ │ │ │ │ - > _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::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, Dune::index_constant< minIndexSize >, Dune:: │ │ │ │ │ - index_constant< maxIndexSize >) │ │ │ │ │ -  A generic implementation of a transformation. │ │ │ │ │ -  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00008_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: transformedindexbasis.hh Source File │ │ │ │ +dune-functions: gridfunction.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,322 +70,179 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
transformedindexbasis.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH
│ │ │ │
5
│ │ │ │ -
6#include <tuple>
│ │ │ │ -
7#include <utility>
│ │ │ │ -
8
│ │ │ │ -
9#include <dune/common/std/apply.hh>
│ │ │ │ -
10#include <dune/common/hybridutilities.hh>
│ │ │ │ -
11#include <dune/common/reservedvector.hh>
│ │ │ │ -
12#include <dune/common/typeutilities.hh>
│ │ │ │ -
13#include <dune/common/hybridutilities.hh>
│ │ │ │ -
14
│ │ │ │ -
15#include <dune/typetree/compositenode.hh>
│ │ │ │ -
16#include <dune/typetree/utility.hh>
│ │ │ │ +
6#include <type_traits>
│ │ │ │ +
7
│ │ │ │ +
8#include <dune/common/typeutilities.hh>
│ │ │ │ +
9
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
17
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
25
│ │ │ │ -
26
│ │ │ │ -
27namespace Dune {
│ │ │ │ -
28namespace Functions {
│ │ │ │ -
│ │ │ │ -
29namespace Experimental {
│ │ │ │ -
30
│ │ │ │ -
31// *****************************************************************************
│ │ │ │ -
32// *****************************************************************************
│ │ │ │ +
18
│ │ │ │ +
19
│ │ │ │ +
20namespace Dune {
│ │ │ │ +
21namespace Functions {
│ │ │ │ +
22
│ │ │ │ +
23
│ │ │ │ +
24
│ │ │ │ +
25/*
│ │ │ │ +
26 * Default implementation is empty
│ │ │ │ +
27 * The actual implementation is only given if Signature is an type
│ │ │ │ +
28 * describing a function signature as Range(Domain).
│ │ │ │ +
29 */
│ │ │ │ +
30template<class Signature, class EntitySet, template<class> class DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
32{};
│ │ │ │ +
│ │ │ │
33
│ │ │ │ -
50template<class RPB, class T>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
52{
│ │ │ │ -
53 using Transformation = T;
│ │ │ │ -
54
│ │ │ │ - │ │ │ │ +
34
│ │ │ │ +
35
│ │ │ │ +
36namespace Imp
│ │ │ │ +
37{
│ │ │ │ +
38
│ │ │ │ +
40 template<class S, class ES, template<class> class DerivativeTraits, size_t bufferSize>
│ │ │ │ +
41 struct GridFunctionTraits :
│ │ │ │ +
42 DifferentiableFunctionTraits<S, DerivativeTraits, bufferSize>
│ │ │ │ +
43 {
│ │ │ │ +
44 protected:
│ │ │ │ +
45 using Base=DifferentiableFunctionTraits<S, DerivativeTraits, bufferSize>;
│ │ │ │ +
46
│ │ │ │ +
47 public:
│ │ │ │ +
49 using EntitySet = ES;
│ │ │ │ +
50
│ │ │ │ +
52 using Element = typename EntitySet::Element;
│ │ │ │ +
53
│ │ │ │ +
55 using DerivativeSignature = typename Base::DerivativeSignature;
│ │ │ │
56
│ │ │ │ -
57public:
│ │ │ │ -
58
│ │ │ │ -
59 using RawPreBasis = RPB;
│ │ │ │ -
60
│ │ │ │ -
62 using GridView = typename RawPreBasis::GridView;
│ │ │ │ -
63
│ │ │ │ -
65 using size_type = std::size_t;
│ │ │ │ + │ │ │ │ +
59
│ │ │ │ +
61 using LocalSignature = typename Base::Range(typename EntitySet::LocalCoordinate);
│ │ │ │ +
62
│ │ │ │ +
64 template<class R>
│ │ │ │ + │ │ │ │
66
│ │ │ │ -
68 using Node = typename RawPreBasis::Node;
│ │ │ │ +
68 using LocalFunctionTraits = typename Dune::Functions::Imp::LocalFunctionTraits<LocalSignature, Element, LocalDerivativeTraits, bufferSize>;
│ │ │ │
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 }
│ │ │ │ -
│ │ │ │ + │ │ │ │ +
72
│ │ │ │ +
74 using Concept = GridFunctionWrapperInterface<S, DerivativeInterface, LocalFunctionInterface, ES>;
│ │ │ │ +
75
│ │ │ │ +
77 template<class B>
│ │ │ │ +
78 using Model = GridFunctionWrapperImplementation<S, DerivativeInterface, LocalFunctionInterface, ES, B>;
│ │ │ │ +
79 };
│ │ │ │ +
80}
│ │ │ │ +
81
│ │ │ │ +
82
│ │ │ │ +
83
│ │ │ │ +
95template<class Range, class Domain, class ES, template<class> class DerivativeTraits, size_t bufferSize>
│ │ │ │ +
│ │ │ │ +
96class GridFunction<Range(Domain), ES, DerivativeTraits, bufferSize> :
│ │ │ │ +
97 public TypeErasureBase<
│ │ │ │ +
98 typename Imp::GridFunctionTraits<Range(Domain), ES, DerivativeTraits, bufferSize>::Concept,
│ │ │ │ +
99 Imp::GridFunctionTraits<Range(Domain), ES, DerivativeTraits, bufferSize>::template Model>
│ │ │ │ +
100{
│ │ │ │ +
101 using Traits = Imp::GridFunctionTraits<Range(Domain), ES, DerivativeTraits, bufferSize>;
│ │ │ │
102
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
114 {
│ │ │ │ -
115 return rawPreBasis_.makeNode();
│ │ │ │ -
116 }
│ │ │ │ -
│ │ │ │ -
117
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
120 {
│ │ │ │ -
121 return size(Dune::ReservedVector<size_type, multiIndexBufferSize>{});
│ │ │ │ -
122 }
│ │ │ │ -
│ │ │ │ -
123
│ │ │ │ -
125 template<class SizePrefix>
│ │ │ │ -
│ │ │ │ -
126 size_type size(const SizePrefix& prefix) const
│ │ │ │ -
127 {
│ │ │ │ -
128 return transformation_.size(prefix, rawPreBasis_);
│ │ │ │ + │ │ │ │ +
104
│ │ │ │ +
105 using DerivativeInterface = typename Traits::DerivativeInterface;
│ │ │ │ +
106
│ │ │ │ +
107 using LocalFunctionInterface = typename Traits::LocalFunctionInterface;
│ │ │ │ +
108
│ │ │ │ +
109 using EntitySet = typename Traits::EntitySet;
│ │ │ │ +
110
│ │ │ │ +
111public:
│ │ │ │ +
112
│ │ │ │ +
124 template<class F, disableCopyMove<GridFunction, F> = 0 >
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
126 Base(std::forward<F>(f))
│ │ │ │ +
127 {
│ │ │ │ +
128 static_assert(Dune::Functions::Concept::isGridFunction<F, Range(Domain), EntitySet>(), "Trying to construct a GridFunction from type that does not model the GridFunction concept");
│ │ │ │
129 }
│ │ │ │
│ │ │ │
130
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
133 {
│ │ │ │ -
134 return transformation_.dimension(rawPreBasis_);
│ │ │ │ -
135 }
│ │ │ │ -
│ │ │ │ -
136
│ │ │ │ +
131 GridFunction() = default;
│ │ │ │ +
132
│ │ │ │
│ │ │ │ - │ │ │ │ +
138 Range operator() (const Domain& x) const
│ │ │ │
139 {
│ │ │ │ -
140 return rawPreBasis_.maxNodeSize();
│ │ │ │ +
140 return this->asInterface().operator()(x);
│ │ │ │
141 }
│ │ │ │
│ │ │ │
142
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
144 {
│ │ │ │ -
145 return rawPreBasis_;
│ │ │ │ -
146 }
│ │ │ │ -
│ │ │ │ -
147
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
149 {
│ │ │ │ -
150 return rawPreBasis_;
│ │ │ │ -
151 }
│ │ │ │ -
│ │ │ │ -
152
│ │ │ │ -
153 template<class MultiIndex>
│ │ │ │ -
│ │ │ │ -
154 void transformIndex(MultiIndex& multiIndex) const
│ │ │ │ -
155 {
│ │ │ │ -
156 transformation_.transformIndex(multiIndex, rawPreBasis_);
│ │ │ │ -
157 }
│ │ │ │ -
│ │ │ │ -
158
│ │ │ │ -
159 template<typename It>
│ │ │ │ -
│ │ │ │ -
160 It indices(const Node& node, It it) const
│ │ │ │ -
161 {
│ │ │ │ -
162 rawPreBasis().indices(node, it);
│ │ │ │ -
163 for(std::size_t i=0; i<node.size(); ++i)
│ │ │ │ -
164 {
│ │ │ │ -
165 transformIndex(*it);
│ │ │ │ -
166 ++it;
│ │ │ │ -
167 }
│ │ │ │ -
168 return it;
│ │ │ │ -
169 }
│ │ │ │ -
│ │ │ │ -
170
│ │ │ │ -
171protected:
│ │ │ │ - │ │ │ │ -
173 Transformation transformation_;
│ │ │ │ -
174};
│ │ │ │ -
│ │ │ │ -
175
│ │ │ │ -
176template<class RPB, class T>
│ │ │ │ - │ │ │ │ -
178
│ │ │ │ -
179
│ │ │ │ -
180} // end namespace Experimental
│ │ │ │ +
│ │ │ │ +
151 friend DerivativeInterface derivative(const GridFunction& t)
│ │ │ │ +
152 {
│ │ │ │ +
153 return t.asInterface().derivative();
│ │ │ │ +
154 }
│ │ │ │ +
│ │ │ │ +
155
│ │ │ │ +
│ │ │ │ +
165 friend LocalFunctionInterface localFunction(const GridFunction& t)
│ │ │ │ +
166 {
│ │ │ │ +
167 return t.asInterface().wrappedLocalFunction();
│ │ │ │ +
168 }
│ │ │ │ +
│ │ │ │ +
169
│ │ │ │ +
│ │ │ │ +
176 const EntitySet& entitySet() const
│ │ │ │ +
177 {
│ │ │ │ +
178 return this->asInterface().wrappedEntitySet();
│ │ │ │ +
179 }
│ │ │ │ +
│ │ │ │ +
180};
│ │ │ │
│ │ │ │
181
│ │ │ │
182
│ │ │ │ -
183namespace BasisFactory {
│ │ │ │ -
184namespace Experimental {
│ │ │ │ +
183
│ │ │ │ +
184}} // namespace Dune::Functions
│ │ │ │
185
│ │ │ │ -
197template<class RawPreBasisFactory, class Transformation>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
199 RawPreBasisFactory&& preBasisFactory,
│ │ │ │ -
200 Transformation&& transformation)
│ │ │ │ -
201{
│ │ │ │ -
202 return [
│ │ │ │ -
203 preBasisFactory=std::forward<RawPreBasisFactory>(preBasisFactory),
│ │ │ │ -
204 transformation =std::forward<Transformation>(transformation)
│ │ │ │ -
205 ](const auto& gridView) {
│ │ │ │ -
206 return Dune::Functions::Experimental::TransformedIndexPreBasis(preBasisFactory(gridView), std::move(transformation));
│ │ │ │ -
207 };
│ │ │ │ -
208}
│ │ │ │ -
│ │ │ │ -
209
│ │ │ │ -
210
│ │ │ │ -
211
│ │ │ │ -
230template<class IndexTransformation, class SizeImplementation, std::size_t minIS, std::size_t maxIS>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
232{
│ │ │ │ -
233public:
│ │ │ │ -
234
│ │ │ │ -
235 static constexpr std::size_t minIndexSize = minIS;
│ │ │ │ -
236 static constexpr std::size_t maxIndexSize = maxIS;
│ │ │ │ -
237
│ │ │ │ -
238 template<class IT_R, class SI_R>
│ │ │ │ -
│ │ │ │ -
239 GenericIndexingTransformation(IT_R&& indexTransformation, SI_R&& sizeImplementation) :
│ │ │ │ -
240 indexTransformation_(std::forward<IT_R>(indexTransformation)),
│ │ │ │ -
241 sizeImplementation_(std::forward<SI_R>(sizeImplementation))
│ │ │ │ -
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
│ │ │ │ -
262private:
│ │ │ │ -
263 IndexTransformation indexTransformation_;
│ │ │ │ -
264 SizeImplementation sizeImplementation_;
│ │ │ │ -
265};
│ │ │ │ -
│ │ │ │ -
266
│ │ │ │ -
267
│ │ │ │ -
268
│ │ │ │ -
287template<class IndexTransformation, class SizeImplementation, std::size_t minIndexSize, std::size_t maxIndexSize>
│ │ │ │ -
│ │ │ │ -
288auto indexTransformation(IndexTransformation&& indexTransformation, SizeImplementation&& sizeImplementation, Dune::index_constant<minIndexSize>, Dune::index_constant<maxIndexSize>)
│ │ │ │ -
289{
│ │ │ │ - │ │ │ │ -
291 std::decay_t<IndexTransformation>,
│ │ │ │ -
292 std::decay_t<SizeImplementation>,
│ │ │ │ -
293 minIndexSize, maxIndexSize>(
│ │ │ │ -
294 std::forward<IndexTransformation>(indexTransformation),
│ │ │ │ -
295 std::forward<SizeImplementation>(sizeImplementation));
│ │ │ │ -
296}
│ │ │ │ -
│ │ │ │ -
297
│ │ │ │ -
298
│ │ │ │ -
299} // end namespace Experimental
│ │ │ │ -
300} // end namespace BasisFactory
│ │ │ │ -
301} // end namespace Functions
│ │ │ │ -
302} // end namespace Dune
│ │ │ │ -
303
│ │ │ │ -
304
│ │ │ │ -
305#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ +
186
│ │ │ │ +
187
│ │ │ │ +
188#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
auto transformIndices(RawPreBasisFactory &&preBasisFactory, Transformation &&transformation)
Create a TransformedIndexPreBasisFactory.
Definition transformedindexbasis.hh:198
│ │ │ │ -
auto indexTransformation(IndexTransformation &&indexTransformation, SizeImplementation &&sizeImplementation, Dune::index_constant< minIndexSize >, Dune::index_constant< maxIndexSize >)
A generic implementation of a transformation.
Definition transformedindexbasis.hh:288
│ │ │ │ -
A pre-basis transforming multi-indices.
Definition transformedindexbasis.hh:52
│ │ │ │ -
It indices(const Node &node, It it) const
Definition transformedindexbasis.hh:160
│ │ │ │ -
Transformation transformation_
Definition transformedindexbasis.hh:173
│ │ │ │ -
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:154
│ │ │ │ -
RawPreBasis rawPreBasis_
Definition transformedindexbasis.hh:172
│ │ │ │ -
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:148
│ │ │ │ -
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 with given root tree path.
Definition transformedindexbasis.hh:113
│ │ │ │ -
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:126
│ │ │ │ -
RPB RawPreBasis
Definition transformedindexbasis.hh:59
│ │ │ │ -
size_type size() const
Same as size(prefix) with empty prefix.
Definition transformedindexbasis.hh:119
│ │ │ │ -
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition transformedindexbasis.hh:138
│ │ │ │ -
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:132
│ │ │ │ -
const RawPreBasis & rawPreBasis() const
Definition transformedindexbasis.hh:143
│ │ │ │ -
static constexpr size_type minMultiIndexSize
Definition transformedindexbasis.hh:71
│ │ │ │ -
A generic implementation of a transformation.
Definition transformedindexbasis.hh:232
│ │ │ │ -
auto dimension(const PreBasis &preBasis) const
Definition transformedindexbasis.hh:257
│ │ │ │ -
GenericIndexingTransformation(IT_R &&indexTransformation, SI_R &&sizeImplementation)
Definition transformedindexbasis.hh:239
│ │ │ │ -
void transformIndex(MultiIndex &multiIndex, const PreBasis &preBasis) const
Definition transformedindexbasis.hh:245
│ │ │ │ -
static constexpr std::size_t maxIndexSize
Definition transformedindexbasis.hh:236
│ │ │ │ -
static constexpr std::size_t minIndexSize
Definition transformedindexbasis.hh:235
│ │ │ │ -
auto size(const Prefix &prefix, const PreBasis &preBasis) const
Definition transformedindexbasis.hh:251
│ │ │ │ - │ │ │ │ +
Definition localfunction.hh:30
│ │ │ │ +
Base class for type-erased interface wrapper.
Definition typeerasure.hh:165
│ │ │ │ +
Definition gridfunction.hh:32
│ │ │ │ +
friend DerivativeInterface derivative(const GridFunction &t)
Get derivative of wrapped function.
Definition gridfunction.hh:151
│ │ │ │ + │ │ │ │ +
const EntitySet & entitySet() const
Get associated EntitySet.
Definition gridfunction.hh:176
│ │ │ │ +
GridFunction(F &&f)
Construct from function.
Definition gridfunction.hh:125
│ │ │ │ +
friend LocalFunctionInterface localFunction(const GridFunction &t)
Get local function of wrapped function.
Definition gridfunction.hh:165
│ │ │ │ +
Derivative traits for local functions.
Definition localderivativetraits.hh:28
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,368 +1,197 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -transformedindexbasis.hh │ │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ -8 │ │ │ │ │ -9#include │ │ │ │ │ -10#include │ │ │ │ │ -11#include │ │ │ │ │ -12#include │ │ │ │ │ -13#include │ │ │ │ │ -14 │ │ │ │ │ -15#include │ │ │ │ │ -16#include │ │ │ │ │ +6#include │ │ │ │ │ +7 │ │ │ │ │ +8#include │ │ │ │ │ +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_e_r_a_s_u_r_e_._h_h> │ │ │ │ │ +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#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> │ │ │ │ │ +13#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> │ │ │ │ │ +14#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> │ │ │ │ │ +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_/_l_o_c_a_l_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_/_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> │ │ │ │ │ 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 Functions { │ │ │ │ │ -_2_9namespace Experimental { │ │ │ │ │ -30 │ │ │ │ │ -31/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -32/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ +18 │ │ │ │ │ +19 │ │ │ │ │ +20namespace _D_u_n_e { │ │ │ │ │ +21namespace Functions { │ │ │ │ │ +22 │ │ │ │ │ +23 │ │ │ │ │ +24 │ │ │ │ │ +25/* │ │ │ │ │ +26 * Default implementation is empty │ │ │ │ │ +27 * The actual implementation is only given if Signature is an type │ │ │ │ │ +28 * describing a function signature as Range(Domain). │ │ │ │ │ +29 */ │ │ │ │ │ +30template class │ │ │ │ │ +DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56> │ │ │ │ │ +_3_1class _G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ │ +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 _T_h_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_<_R_P_B_,_ _T_>; │ │ │ │ │ +34 │ │ │ │ │ +35 │ │ │ │ │ +36namespace Imp │ │ │ │ │ +37{ │ │ │ │ │ +38 │ │ │ │ │ +40 template class DerivativeTraits, size_t │ │ │ │ │ +bufferSize> │ │ │ │ │ +41 struct GridFunctionTraits : │ │ │ │ │ +42 DifferentiableFunctionTraits │ │ │ │ │ +43 { │ │ │ │ │ +44 protected: │ │ │ │ │ +45 using Base=DifferentiableFunctionTraits; │ │ │ │ │ +46 │ │ │ │ │ +47 public: │ │ │ │ │ +49 using EntitySet = ES; │ │ │ │ │ +50 │ │ │ │ │ +52 using Element = typename EntitySet::Element; │ │ │ │ │ +53 │ │ │ │ │ +55 using DerivativeSignature = typename Base::DerivativeSignature; │ │ │ │ │ 56 │ │ │ │ │ -57public: │ │ │ │ │ -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; │ │ │ │ │ +58 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_>; │ │ │ │ │ +59 │ │ │ │ │ +61 using LocalSignature = typename Base::Range(typename EntitySet:: │ │ │ │ │ +LocalCoordinate); │ │ │ │ │ +62 │ │ │ │ │ +64 template │ │ │ │ │ +65 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; │ │ │ │ │ 66 │ │ │ │ │ -_6_8 using _N_o_d_e = typename RawPreBasis::Node; │ │ │ │ │ +68 using LocalFunctionTraits = typename Dune::Functions::Imp:: │ │ │ │ │ +LocalFunctionTraits; │ │ │ │ │ 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 } │ │ │ │ │ +71 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_>; │ │ │ │ │ +72 │ │ │ │ │ +74 using Concept = GridFunctionWrapperInterface; │ │ │ │ │ +75 │ │ │ │ │ +77 template │ │ │ │ │ +78 using Model = GridFunctionWrapperImplementation; │ │ │ │ │ +79 }; │ │ │ │ │ +80} │ │ │ │ │ +81 │ │ │ │ │ +82 │ │ │ │ │ +83 │ │ │ │ │ +95template class │ │ │ │ │ +DerivativeTraits, size_t bufferSize> │ │ │ │ │ +_9_6class _G_r_i_d_F_u_n_c_t_i_o_n : │ │ │ │ │ +97 public _T_y_p_e_E_r_a_s_u_r_e_B_a_s_e< │ │ │ │ │ +98 typename Imp::GridFunctionTraits::Concept, │ │ │ │ │ +99 Imp::GridFunctionTraits:: │ │ │ │ │ +template Model> │ │ │ │ │ +100{ │ │ │ │ │ +101 using Traits = Imp::GridFunctionTraits; │ │ │ │ │ 102 │ │ │ │ │ -_1_1_3 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ │ -114 { │ │ │ │ │ -115 return _r_a_w_P_r_e_B_a_s_i_s__.makeNode(); │ │ │ │ │ -116 } │ │ │ │ │ -117 │ │ │ │ │ -_1_1_9 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ │ -120 { │ │ │ │ │ -121 return _s_i_z_e(Dune::ReservedVector{}); │ │ │ │ │ -122 } │ │ │ │ │ -123 │ │ │ │ │ -125 template │ │ │ │ │ -_1_2_6 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix) const │ │ │ │ │ +103 using _B_a_s_e = _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_>; │ │ │ │ │ +104 │ │ │ │ │ +105 using DerivativeInterface = typename _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; │ │ │ │ │ +106 │ │ │ │ │ +107 using LocalFunctionInterface = typename _T_r_a_i_t_s_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_I_n_t_e_r_f_a_c_e; │ │ │ │ │ +108 │ │ │ │ │ +109 using EntitySet = typename Traits::EntitySet; │ │ │ │ │ +110 │ │ │ │ │ +111public: │ │ │ │ │ +112 │ │ │ │ │ +124 template = 0 > │ │ │ │ │ +_1_2_5 _G_r_i_d_F_u_n_c_t_i_o_n(F&& f) : │ │ │ │ │ +126 _B_a_s_e(std::forward(f)) │ │ │ │ │ 127 { │ │ │ │ │ -128 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__); │ │ │ │ │ +128 static_assert(Dune::Functions::Concept::isGridFunction(), "Trying to construct a GridFunction from type that does not model │ │ │ │ │ +the GridFunction concept"); │ │ │ │ │ 129 } │ │ │ │ │ 130 │ │ │ │ │ -_1_3_2 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ │ -133 { │ │ │ │ │ -134 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__); │ │ │ │ │ -135 } │ │ │ │ │ -136 │ │ │ │ │ -_1_3_8 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ │ +_1_3_1 _G_r_i_d_F_u_n_c_t_i_o_n() = default; │ │ │ │ │ +132 │ │ │ │ │ +_1_3_8 Range operator() (const Domain& x) const │ │ │ │ │ 139 { │ │ │ │ │ -140 return _r_a_w_P_r_e_B_a_s_i_s__.maxNodeSize(); │ │ │ │ │ +140 return this->asInterface().operator()(x); │ │ │ │ │ 141 } │ │ │ │ │ 142 │ │ │ │ │ -_1_4_3 const _R_a_w_P_r_e_B_a_s_i_s& _r_a_w_P_r_e_B_a_s_i_s() const │ │ │ │ │ -144 { │ │ │ │ │ -145 return _r_a_w_P_r_e_B_a_s_i_s__; │ │ │ │ │ -146 } │ │ │ │ │ -147 │ │ │ │ │ -_1_4_8 _R_a_w_P_r_e_B_a_s_i_s& _r_a_w_P_r_e_B_a_s_i_s() │ │ │ │ │ -149 { │ │ │ │ │ -150 return _r_a_w_P_r_e_B_a_s_i_s__; │ │ │ │ │ -151 } │ │ │ │ │ -152 │ │ │ │ │ -153 template │ │ │ │ │ -_1_5_4 void _t_r_a_n_s_f_o_r_m_I_n_d_e_x(MultiIndex& multiIndex) const │ │ │ │ │ -155 { │ │ │ │ │ -156 _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__); │ │ │ │ │ -157 } │ │ │ │ │ -158 │ │ │ │ │ -159 template │ │ │ │ │ -_1_6_0 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ │ -161 { │ │ │ │ │ -162 _r_a_w_P_r_e_B_a_s_i_s().indices(node, it); │ │ │ │ │ -163 for(std::size_t i=0; i │ │ │ │ │ -_1_7_7_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>; │ │ │ │ │ -178 │ │ │ │ │ -179 │ │ │ │ │ -180} // end namespace Experimental │ │ │ │ │ +_1_5_1 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) │ │ │ │ │ +152 { │ │ │ │ │ +153 return t.asInterface().derivative(); │ │ │ │ │ +154 } │ │ │ │ │ +155 │ │ │ │ │ +_1_6_5 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) │ │ │ │ │ +166 { │ │ │ │ │ +167 return t.asInterface().wrappedLocalFunction(); │ │ │ │ │ +168 } │ │ │ │ │ +169 │ │ │ │ │ +_1_7_6 const EntitySet& _e_n_t_i_t_y_S_e_t() const │ │ │ │ │ +177 { │ │ │ │ │ +178 return this->asInterface().wrappedEntitySet(); │ │ │ │ │ +179 } │ │ │ │ │ +180}; │ │ │ │ │ 181 │ │ │ │ │ 182 │ │ │ │ │ -183namespace BasisFactory { │ │ │ │ │ -184namespace Experimental { │ │ │ │ │ +183 │ │ │ │ │ +184}} // namespace Dune::Functions │ │ │ │ │ 185 │ │ │ │ │ -197template │ │ │ │ │ -_1_9_8auto _t_r_a_n_s_f_o_r_m_I_n_d_i_c_e_s( │ │ │ │ │ -199 RawPreBasisFactory&& preBasisFactory, │ │ │ │ │ -200 Transformation&& transformation) │ │ │ │ │ -201{ │ │ │ │ │ -202 return [ │ │ │ │ │ -203 preBasisFactory=std::forward(preBasisFactory), │ │ │ │ │ -204 transformation =std::forward(transformation) │ │ │ │ │ -205 ](const auto& gridView) { │ │ │ │ │ -206 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)); │ │ │ │ │ -207 }; │ │ │ │ │ -208} │ │ │ │ │ -209 │ │ │ │ │ -210 │ │ │ │ │ -211 │ │ │ │ │ -230template │ │ │ │ │ -_2_3_1class _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 │ │ │ │ │ -232{ │ │ │ │ │ -233public: │ │ │ │ │ -234 │ │ │ │ │ -_2_3_5 static constexpr std::size_t _m_i_n_I_n_d_e_x_S_i_z_e = minIS; │ │ │ │ │ -_2_3_6 static constexpr std::size_t _m_a_x_I_n_d_e_x_S_i_z_e = maxIS; │ │ │ │ │ -237 │ │ │ │ │ -238 template │ │ │ │ │ -_2_3_9 _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) : │ │ │ │ │ -240 indexTransformation_(std::forward(_i_n_d_e_x_T_r_a_n_s_f_o_r_m_a_t_i_o_n)), │ │ │ │ │ -241 sizeImplementation_(std::forward(sizeImplementation)) │ │ │ │ │ -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 │ │ │ │ │ -262private: │ │ │ │ │ -263 IndexTransformation indexTransformation_; │ │ │ │ │ -264 SizeImplementation sizeImplementation_; │ │ │ │ │ -265}; │ │ │ │ │ -266 │ │ │ │ │ -267 │ │ │ │ │ -268 │ │ │ │ │ -287template │ │ │ │ │ -_2_8_8auto _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, │ │ │ │ │ -SizeImplementation&& sizeImplementation, Dune::index_constant, │ │ │ │ │ -Dune::index_constant) │ │ │ │ │ -289{ │ │ │ │ │ -290 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< │ │ │ │ │ -291 std::decay_t, │ │ │ │ │ -292 std::decay_t, │ │ │ │ │ -293 minIndexSize, maxIndexSize>( │ │ │ │ │ -294 std::forward(_i_n_d_e_x_T_r_a_n_s_f_o_r_m_a_t_i_o_n), │ │ │ │ │ -295 std::forward(sizeImplementation)); │ │ │ │ │ -296} │ │ │ │ │ -297 │ │ │ │ │ -298 │ │ │ │ │ -299} // end namespace Experimental │ │ │ │ │ -300} // end namespace BasisFactory │ │ │ │ │ -301} // end namespace Functions │ │ │ │ │ -302} // end namespace Dune │ │ │ │ │ -303 │ │ │ │ │ -304 │ │ │ │ │ -305#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH │ │ │ │ │ -_b_a_s_i_s_t_a_g_s_._h_h │ │ │ │ │ -_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ │ -_n_o_d_e_s_._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 │ │ │ │ │ -_u_t_i_l_i_t_y_._h_h │ │ │ │ │ +186 │ │ │ │ │ +187 │ │ │ │ │ +188#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH │ │ │ │ │ +_g_r_i_d_f_u_n_c_t_i_o_n___i_m_p_._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 │ │ │ │ │ +_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 │ │ │ │ │ +_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_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:198 │ │ │ │ │ -_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, Dune::index_constant< minIndexSize >, │ │ │ │ │ -Dune::index_constant< maxIndexSize >) │ │ │ │ │ -A generic implementation of a transformation. │ │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:288 │ │ │ │ │ -_D_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: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_:_:_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: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_:_:_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: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_:_:_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: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_:_:_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: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_:_:_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 with given root tree path. │ │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:113 │ │ │ │ │ -_D_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:126 │ │ │ │ │ -_D_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: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_:_:_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:138 │ │ │ │ │ -_D_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:132 │ │ │ │ │ -_D_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: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_:_:_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_:_:_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:232 │ │ │ │ │ -_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_:_: │ │ │ │ │ -_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) │ │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:239 │ │ │ │ │ -_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 │ │ │ │ │ -_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:236 │ │ │ │ │ -_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: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_:_: │ │ │ │ │ -_s_i_z_e │ │ │ │ │ -auto size(const Prefix &prefix, const PreBasis &preBasis) const │ │ │ │ │ -DDeeffiinniittiioonn transformedindexbasis.hh:251 │ │ │ │ │ -_c_o_n_c_e_p_t_s_._h_h │ │ │ │ │ +_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:30 │ │ │ │ │ +_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 │ │ │ │ │ +Base class for type-erased interface wrapper. │ │ │ │ │ +DDeeffiinniittiioonn typeerasure.hh:165 │ │ │ │ │ +_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: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_<_ _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:151 │ │ │ │ │ +_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:176 │ │ │ │ │ +_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:125 │ │ │ │ │ +_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:165 │ │ │ │ │ +_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:28 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00014.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: rannacherturekbasis.hh File Reference │ │ │ │ +dune-functions: localderivativetraits.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,66 +65,44 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces | │ │ │ │ -Typedefs | │ │ │ │ -Functions
│ │ │ │ -
rannacherturekbasis.hh File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
localderivativetraits.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>
│ │ │ │ + │ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::Functions::RannacherTurekPreBasis< GV >
 Pre-basis for a Rannacher-Turek basis. More...
struct  Dune::Functions::LocalDerivativeTraits< EntitySet, DerivativeTraits >
 Derivative traits for local functions. More...
 
class  Dune::Functions::RannacherTurekNode< GV >
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 >
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,43 +1,28 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -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> │ │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ +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_:_:_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_._._. │ │ │ │ │ +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_._._. │ │ │ │ │   │ │ │ │ │ -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_ _> │ │ │ │ │ +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_:_:_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< GV > > │ │ │ │ │ -  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. │ │ │ │ │ -  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00014_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: rannacherturekbasis.hh Source File │ │ │ │ +dune-functions: localderivativetraits.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,289 +70,72 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
rannacherturekbasis.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH
│ │ │ │
5
│ │ │ │ -
6#include <dune/common/exceptions.hh>
│ │ │ │ -
7
│ │ │ │ -
8#include <dune/grid/common/capabilities.hh>
│ │ │ │ +
6
│ │ │ │ + │ │ │ │ +
8
│ │ │ │
9
│ │ │ │ -
10#include <dune/localfunctions/common/localfiniteelementvariant.hh>
│ │ │ │ -
11#include <dune/localfunctions/rannacherturek.hh>
│ │ │ │ -
12#include <dune/localfunctions/crouzeixraviart.hh>
│ │ │ │ +
10namespace Dune {
│ │ │ │ +
11namespace Functions {
│ │ │ │ +
12
│ │ │ │
13
│ │ │ │ - │ │ │ │ - │ │ │ │ -
16
│ │ │ │ -
17
│ │ │ │ -
18namespace Dune {
│ │ │ │ -
19namespace Functions {
│ │ │ │ -
20
│ │ │ │ -
21// *****************************************************************************
│ │ │ │ -
22// This is the reusable part of the basis. It contains
│ │ │ │ -
23//
│ │ │ │ -
24// RannacherTurekPreBasis
│ │ │ │ -
25// RannacherTurekNode
│ │ │ │ -
26//
│ │ │ │ -
27// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ │ -
28// state. These components do _not_ depend on the global basis and local view
│ │ │ │ -
29// and can be used without a global basis.
│ │ │ │ -
30// *****************************************************************************
│ │ │ │ +
26template<class EntitySet, template<class> class DerivativeTraits=DefaultDerivativeTraits>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
28{
│ │ │ │ +
29 using LocalDomain = typename EntitySet::LocalCoordinate;
│ │ │ │ +
30 using Domain = typename EntitySet::GlobalCoordinate;
│ │ │ │
31
│ │ │ │ -
32template<typename GV>
│ │ │ │ -
33class RannacherTurekNode;
│ │ │ │ -
34
│ │ │ │ -
35template<typename GV>
│ │ │ │ -
36class RannacherTurekPreBasis;
│ │ │ │ -
37
│ │ │ │ -
50template<typename GV>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
52{
│ │ │ │ -
53 static const int dim = GV::dimension;
│ │ │ │ -
54
│ │ │ │ -
55public:
│ │ │ │ -
56
│ │ │ │ -
58 using GridView = GV;
│ │ │ │ -
59
│ │ │ │ -
61 using size_type = std::size_t;
│ │ │ │ -
62
│ │ │ │ - │ │ │ │ -
65
│ │ │ │ -
66 static constexpr size_type maxMultiIndexSize = 1;
│ │ │ │ -
67 static constexpr size_type minMultiIndexSize = 1;
│ │ │ │ -
68 static constexpr size_type multiIndexBufferSize = 1;
│ │ │ │ -
69
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
72 gridView_(gv)
│ │ │ │ -
73 {
│ │ │ │ -
74 for(auto type : gv.indexSet().types(0))
│ │ │ │ -
75 if (!type.isSimplex() && !type.isCube())
│ │ │ │ -
76 DUNE_THROW(Dune::NotImplemented, "Rannacher-Turek or Crouzeix-Raviart elements are only implemented for grids with simplex or cube elements.");
│ │ │ │ -
77 }
│ │ │ │ -
│ │ │ │ -
78
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
81 {}
│ │ │ │ -
│ │ │ │ -
82
│ │ │ │ -
│ │ │ │ -
84 const GridView& gridView() const
│ │ │ │ -
85 {
│ │ │ │ -
86 return gridView_;
│ │ │ │ -
87 }
│ │ │ │ -
│ │ │ │ -
88
│ │ │ │ -
│ │ │ │ -
90 void update (const GridView& gv)
│ │ │ │ -
91 {
│ │ │ │ -
92 gridView_ = gv;
│ │ │ │ -
93 }
│ │ │ │ -
│ │ │ │ -
94
│ │ │ │ -
│ │ │ │ -
98 Node makeNode() const
│ │ │ │ -
99 {
│ │ │ │ -
100 return Node{};
│ │ │ │ -
101 }
│ │ │ │ -
│ │ │ │ -
102
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
105 {
│ │ │ │ -
106 return (size_type)(gridView_.size(1));
│ │ │ │ -
107 }
│ │ │ │ -
│ │ │ │ -
108
│ │ │ │ -
110 template<class SizePrefix>
│ │ │ │ -
│ │ │ │ -
111 size_type size(const SizePrefix prefix) const
│ │ │ │ -
112 {
│ │ │ │ -
113 assert(prefix.size() == 0 || prefix.size() == 1);
│ │ │ │ -
114 return (prefix.size() == 0) ? size() : 0;
│ │ │ │ -
115 }
│ │ │ │ -
│ │ │ │ -
116
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
119 {
│ │ │ │ -
120 return size();
│ │ │ │ -
121 }
│ │ │ │ -
│ │ │ │ -
122
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
125 {
│ │ │ │ -
126 return 2*GV::dimension;
│ │ │ │ -
127 }
│ │ │ │ +
32 template<class Signature>
│ │ │ │ +
│ │ │ │ +
33 struct Traits
│ │ │ │ +
34 {
│ │ │ │ + │ │ │ │ +
36 };
│ │ │ │
│ │ │ │ -
128
│ │ │ │ -
129 template<typename It>
│ │ │ │ -
│ │ │ │ -
130 It indices(const Node& node, It it) const
│ │ │ │ -
131 {
│ │ │ │ -
132 for (size_type i = 0, end = node.size() ; i < end ; ++i, ++it)
│ │ │ │ -
133 {
│ │ │ │ -
134 Dune::LocalKey localKey = node.finiteElement().localCoefficients().localKey(i);
│ │ │ │ -
135 const auto& gridIndexSet = gridView().indexSet();
│ │ │ │ -
136 const auto& element = node.element();
│ │ │ │ -
137
│ │ │ │ -
138 *it = {{ (size_type)(gridIndexSet.subIndex(element,localKey.subEntity(),1)) }};
│ │ │ │ -
139 }
│ │ │ │ -
140 return it;
│ │ │ │ -
141 }
│ │ │ │ -
│ │ │ │ -
142
│ │ │ │ -
143protected:
│ │ │ │ - │ │ │ │ -
145};
│ │ │ │ -
│ │ │ │ -
146
│ │ │ │ -
147
│ │ │ │ -
148
│ │ │ │ -
149template<typename GV>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
151 public LeafBasisNode
│ │ │ │ -
152{
│ │ │ │ -
153 static const int dim = GV::dimension;
│ │ │ │ -
154 static const int maxSize = 2*dim;
│ │ │ │ -
155
│ │ │ │ -
156 constexpr static bool hasFixedElementType = Capabilities::hasSingleGeometryType<typename GV::Grid>::v;
│ │ │ │ -
157
│ │ │ │ -
158 using CubeFiniteElement = RannacherTurekLocalFiniteElement<typename GV::ctype,double,dim>;
│ │ │ │ -
159 using SimplexFiniteElement = CrouzeixRaviartLocalFiniteElement<typename GV::ctype,double,dim>;
│ │ │ │ -
160
│ │ │ │ -
161 constexpr static unsigned int topologyId = Capabilities::hasSingleGeometryType<typename GV::Grid>::topologyId; // meaningless if hasFixedElementType is false
│ │ │ │ -
162 constexpr static GeometryType type = GeometryType(topologyId, GV::dimension);
│ │ │ │ -
163
│ │ │ │ -
164public:
│ │ │ │ -
165
│ │ │ │ -
166 using size_type = std::size_t;
│ │ │ │ -
167 using Element = typename GV::template Codim<0>::Entity;
│ │ │ │ -
168 using FiniteElement = std::conditional_t<hasFixedElementType,
│ │ │ │ -
169 std::conditional_t<type.isCube(),CubeFiniteElement,SimplexFiniteElement>,
│ │ │ │ -
170 LocalFiniteElementVariant<CubeFiniteElement, SimplexFiniteElement> >;
│ │ │ │ -
171
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ -
174 element_(nullptr)
│ │ │ │ -
175 {}
│ │ │ │ -
│ │ │ │ -
176
│ │ │ │ -
│ │ │ │ -
178 const Element& element() const
│ │ │ │ -
179 {
│ │ │ │ -
180 return *element_;
│ │ │ │ -
181 }
│ │ │ │ -
│ │ │ │ -
182
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
188 {
│ │ │ │ -
189 return finiteElement_;
│ │ │ │ -
190 }
│ │ │ │ -
│ │ │ │ -
191
│ │ │ │ -
│ │ │ │ -
193 void bind(const Element& e)
│ │ │ │ -
194 {
│ │ │ │ -
195 element_ = &e;
│ │ │ │ -
196 if constexpr (!hasFixedElementType)
│ │ │ │ -
197 finiteElement_ = e.type().isCube() ? static_cast<FiniteElement>(CubeFiniteElement())
│ │ │ │ -
198 : static_cast<FiniteElement>(SimplexFiniteElement()) ;
│ │ │ │ -
199 this->setSize(finiteElement_.size());
│ │ │ │ -
200 }
│ │ │ │ -
│ │ │ │ -
201
│ │ │ │ -
202protected:
│ │ │ │ -
203
│ │ │ │ - │ │ │ │ - │ │ │ │ -
206};
│ │ │ │ -
│ │ │ │ -
207
│ │ │ │ -
208
│ │ │ │ -
209
│ │ │ │ -
210namespace BasisFactory {
│ │ │ │ -
211
│ │ │ │ -
217template<class Dummy=void>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
219{
│ │ │ │ -
220 return [](const auto& gridView) {
│ │ │ │ -
221 return RannacherTurekPreBasis<std::decay_t<decltype(gridView)>>(gridView);
│ │ │ │ -
222 };
│ │ │ │ -
223}
│ │ │ │ -
│ │ │ │ -
224
│ │ │ │ -
225} // end namespace BasisFactory
│ │ │ │ -
226
│ │ │ │ -
227
│ │ │ │ -
228
│ │ │ │ -
229
│ │ │ │ -
241template<typename GV>
│ │ │ │ - │ │ │ │ -
243
│ │ │ │ -
244} // end namespace Functions
│ │ │ │ -
245} // end namespace Dune
│ │ │ │ -
246
│ │ │ │ -
247#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ -
auto rannacherTurek()
Create a pre-basis factory that can create a Rannacher-Turek pre-basis.
Definition rannacherturekbasis.hh:218
│ │ │ │ +
37
│ │ │ │ +
38 template<class R>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
40 {
│ │ │ │ +
41 using Range = typename DerivativeTraits<R(Domain)>::Range;
│ │ │ │ +
42 };
│ │ │ │ +
│ │ │ │ +
43};
│ │ │ │ +
│ │ │ │ +
44
│ │ │ │ +
45
│ │ │ │ +
46}} // namespace Dune::Functions
│ │ │ │ +
47
│ │ │ │ +
48#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH
│ │ │ │ + │ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:46
│ │ │ │ -
size_type size() const
Definition nodes.hh:142
│ │ │ │ -
void setSize(const size_type size)
Definition nodes.hh:164
│ │ │ │ -
Definition nodes.hh:186
│ │ │ │ -
Definition rannacherturekbasis.hh:152
│ │ │ │ -
std::conditional_t< hasFixedElementType, std::conditional_t< type.isCube(), CubeFiniteElement, SimplexFiniteElement >, LocalFiniteElementVariant< CubeFiniteElement, SimplexFiniteElement > > FiniteElement
Definition rannacherturekbasis.hh:170
│ │ │ │ -
void bind(const Element &e)
Bind to element.
Definition rannacherturekbasis.hh:193
│ │ │ │ -
FiniteElement finiteElement_
Definition rannacherturekbasis.hh:204
│ │ │ │ -
std::size_t size_type
Definition rannacherturekbasis.hh:166
│ │ │ │ -
typename GV::template Codim< 0 >::Entity Element
Definition rannacherturekbasis.hh:167
│ │ │ │ -
RannacherTurekNode()
Definition rannacherturekbasis.hh:172
│ │ │ │ -
const Element * element_
Definition rannacherturekbasis.hh:205
│ │ │ │ -
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition rannacherturekbasis.hh:187
│ │ │ │ -
const Element & element() const
Return current element, throw if unbound.
Definition rannacherturekbasis.hh:178
│ │ │ │ -
Pre-basis for a Rannacher-Turek basis.
Definition rannacherturekbasis.hh:52
│ │ │ │ -
static constexpr size_type multiIndexBufferSize
Definition rannacherturekbasis.hh:68
│ │ │ │ -
void initializeIndices()
Initialize the global indices.
Definition rannacherturekbasis.hh:80
│ │ │ │ -
static constexpr size_type maxMultiIndexSize
Definition rannacherturekbasis.hh:66
│ │ │ │ -
static constexpr size_type minMultiIndexSize
Definition rannacherturekbasis.hh:67
│ │ │ │ -
size_type size(const SizePrefix prefix) const
Return number of possible values for next position in multi index.
Definition rannacherturekbasis.hh:111
│ │ │ │ -
std::size_t size_type
Type used for indices and size information.
Definition rannacherturekbasis.hh:61
│ │ │ │ -
Node makeNode() const
Create tree node.
Definition rannacherturekbasis.hh:98
│ │ │ │ -
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition rannacherturekbasis.hh:90
│ │ │ │ -
It indices(const Node &node, It it) const
Definition rannacherturekbasis.hh:130
│ │ │ │ -
GV GridView
The grid view that the FE basis is defined on.
Definition rannacherturekbasis.hh:58
│ │ │ │ -
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition rannacherturekbasis.hh:118
│ │ │ │ -
RannacherTurekPreBasis(const GridView &gv)
Constructor for a given grid view object.
Definition rannacherturekbasis.hh:71
│ │ │ │ -
size_type size() const
Same as size(prefix) with empty prefix.
Definition rannacherturekbasis.hh:104
│ │ │ │ -
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition rannacherturekbasis.hh:84
│ │ │ │ -
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition rannacherturekbasis.hh:124
│ │ │ │ -
GridView gridView_
Definition rannacherturekbasis.hh:144
│ │ │ │ +
Dummy range class to be used if no proper type is available.
Definition defaultderivativetraits.hh:23
│ │ │ │ +
Derivative traits for local functions.
Definition localderivativetraits.hh:28
│ │ │ │ +
typename EntitySet::GlobalCoordinate Domain
Definition localderivativetraits.hh:30
│ │ │ │ +
typename EntitySet::LocalCoordinate LocalDomain
Definition localderivativetraits.hh:29
│ │ │ │ +
Definition localderivativetraits.hh:34
│ │ │ │ +
InvalidRange Range
Definition localderivativetraits.hh:35
│ │ │ │ +
typename DerivativeTraits< R(Domain)>::Range Range
Definition localderivativetraits.hh:41
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,338 +1,71 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -rannacherturekbasis.hh │ │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7 │ │ │ │ │ -8#include │ │ │ │ │ +6 │ │ │ │ │ +7#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> │ │ │ │ │ +8 │ │ │ │ │ 9 │ │ │ │ │ -10#include │ │ │ │ │ -11#include │ │ │ │ │ -12#include │ │ │ │ │ +10namespace _D_u_n_e { │ │ │ │ │ +11namespace Functions { │ │ │ │ │ +12 │ │ │ │ │ 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_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ │ -16 │ │ │ │ │ -17 │ │ │ │ │ -18namespace _D_u_n_e { │ │ │ │ │ -19namespace Functions { │ │ │ │ │ -20 │ │ │ │ │ -21/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -22// This is the reusable part of the basis. It contains │ │ │ │ │ -23// │ │ │ │ │ -24// RannacherTurekPreBasis │ │ │ │ │ -25// RannacherTurekNode │ │ │ │ │ -26// │ │ │ │ │ -27// The pre-basis allows to create the others and is the owner of possible │ │ │ │ │ -shared │ │ │ │ │ -28// state. These components do _not_ depend on the global basis and local view │ │ │ │ │ -29// and can be used without a global basis. │ │ │ │ │ -30/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ +26template class │ │ │ │ │ +DerivativeTraits=DefaultDerivativeTraits> │ │ │ │ │ +_2_7struct _L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ │ +28{ │ │ │ │ │ +_2_9 using _L_o_c_a_l_D_o_m_a_i_n = typename EntitySet::LocalCoordinate; │ │ │ │ │ +_3_0 using _D_o_m_a_i_n = typename EntitySet::GlobalCoordinate; │ │ │ │ │ 31 │ │ │ │ │ -32template │ │ │ │ │ -33class RannacherTurekNode; │ │ │ │ │ -34 │ │ │ │ │ -35template │ │ │ │ │ -36class RannacherTurekPreBasis; │ │ │ │ │ +32 template │ │ │ │ │ +_3_3 struct _T_r_a_i_t_s │ │ │ │ │ +34 { │ │ │ │ │ +_3_5 typedef _I_n_v_a_l_i_d_R_a_n_g_e _R_a_n_g_e; │ │ │ │ │ +36 }; │ │ │ │ │ 37 │ │ │ │ │ -50template │ │ │ │ │ -_5_1class _R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s │ │ │ │ │ -52{ │ │ │ │ │ -53 static const int dim = GV::dimension; │ │ │ │ │ -54 │ │ │ │ │ -55public: │ │ │ │ │ -56 │ │ │ │ │ -_5_8 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ │ -59 │ │ │ │ │ -_6_1 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ -62 │ │ │ │ │ -_6_4 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_>; │ │ │ │ │ -65 │ │ │ │ │ -_6_6 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 = 1; │ │ │ │ │ -_6_7 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 = 1; │ │ │ │ │ -_6_8 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 = 1; │ │ │ │ │ -69 │ │ │ │ │ -_7_1 _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) : │ │ │ │ │ -72 _g_r_i_d_V_i_e_w__(gv) │ │ │ │ │ -73 { │ │ │ │ │ -74 for(auto type : gv.indexSet().types(0)) │ │ │ │ │ -75 if (!type.isSimplex() && !type.isCube()) │ │ │ │ │ -76 DUNE_THROW(Dune::NotImplemented, "Rannacher-Turek or Crouzeix-Raviart │ │ │ │ │ -elements are only implemented for grids with simplex or cube elements."); │ │ │ │ │ -77 } │ │ │ │ │ -78 │ │ │ │ │ -_8_0 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ │ -81 {} │ │ │ │ │ -82 │ │ │ │ │ -_8_4 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ │ -85 { │ │ │ │ │ -86 return _g_r_i_d_V_i_e_w__; │ │ │ │ │ -87 } │ │ │ │ │ -88 │ │ │ │ │ -_9_0 void _u_p_d_a_t_e (const _G_r_i_d_V_i_e_w& gv) │ │ │ │ │ -91 { │ │ │ │ │ -92 _g_r_i_d_V_i_e_w__ = gv; │ │ │ │ │ -93 } │ │ │ │ │ -94 │ │ │ │ │ -_9_8 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ │ -99 { │ │ │ │ │ -100 return _N_o_d_e{}; │ │ │ │ │ -101 } │ │ │ │ │ -102 │ │ │ │ │ -_1_0_4 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ │ -105 { │ │ │ │ │ -106 return (_s_i_z_e___t_y_p_e)(_g_r_i_d_V_i_e_w__.size(1)); │ │ │ │ │ -107 } │ │ │ │ │ -108 │ │ │ │ │ -110 template │ │ │ │ │ -_1_1_1 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix prefix) const │ │ │ │ │ -112 { │ │ │ │ │ -113 assert(prefix.size() == 0 || prefix.size() == 1); │ │ │ │ │ -114 return (prefix.size() == 0) ? _s_i_z_e() : 0; │ │ │ │ │ -115 } │ │ │ │ │ -116 │ │ │ │ │ -_1_1_8 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ │ -119 { │ │ │ │ │ -120 return _s_i_z_e(); │ │ │ │ │ -121 } │ │ │ │ │ -122 │ │ │ │ │ -_1_2_4 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ │ -125 { │ │ │ │ │ -126 return 2*GV::dimension; │ │ │ │ │ -127 } │ │ │ │ │ -128 │ │ │ │ │ -129 template │ │ │ │ │ -_1_3_0 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ │ -131 { │ │ │ │ │ -132 for (_s_i_z_e___t_y_p_e i = 0, end = node._s_i_z_e() ; i < end ; ++i, ++it) │ │ │ │ │ -133 { │ │ │ │ │ -134 Dune::LocalKey localKey = node._f_i_n_i_t_e_E_l_e_m_e_n_t().localCoefficients().localKey │ │ │ │ │ -(i); │ │ │ │ │ -135 const auto& gridIndexSet = _g_r_i_d_V_i_e_w().indexSet(); │ │ │ │ │ -136 const auto& element = node._e_l_e_m_e_n_t(); │ │ │ │ │ -137 │ │ │ │ │ -138 *it = {{ (_s_i_z_e___t_y_p_e)(gridIndexSet.subIndex(element,localKey.subEntity(),1)) │ │ │ │ │ -}}; │ │ │ │ │ -139 } │ │ │ │ │ -140 return it; │ │ │ │ │ -141 } │ │ │ │ │ -142 │ │ │ │ │ -143protected: │ │ │ │ │ -_1_4_4 _G_r_i_d_V_i_e_w _g_r_i_d_V_i_e_w__; │ │ │ │ │ -145}; │ │ │ │ │ -146 │ │ │ │ │ -147 │ │ │ │ │ -148 │ │ │ │ │ -149template │ │ │ │ │ -_1_5_0class _R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e : │ │ │ │ │ -151 public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ │ -152{ │ │ │ │ │ -153 static const int dim = GV::dimension; │ │ │ │ │ -154 static const int maxSize = 2*dim; │ │ │ │ │ -155 │ │ │ │ │ -156 constexpr static bool hasFixedElementType = Capabilities:: │ │ │ │ │ -hasSingleGeometryType::v; │ │ │ │ │ -157 │ │ │ │ │ -158 using CubeFiniteElement = RannacherTurekLocalFiniteElement; │ │ │ │ │ -159 using SimplexFiniteElement = CrouzeixRaviartLocalFiniteElement; │ │ │ │ │ -160 │ │ │ │ │ -161 constexpr static unsigned int topologyId = Capabilities:: │ │ │ │ │ -hasSingleGeometryType::topologyId; // meaningless if │ │ │ │ │ -hasFixedElementType is false │ │ │ │ │ -162 constexpr static GeometryType type = GeometryType(topologyId, GV:: │ │ │ │ │ -dimension); │ │ │ │ │ -163 │ │ │ │ │ -164public: │ │ │ │ │ -165 │ │ │ │ │ -_1_6_6 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ -_1_6_7 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ │ -_1_6_8 using _F_i_n_i_t_e_E_l_e_m_e_n_t = std::conditional_t, │ │ │ │ │ -170 LocalFiniteElementVariant >; │ │ │ │ │ -171 │ │ │ │ │ -_1_7_2 _R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e() : │ │ │ │ │ -173 _f_i_n_i_t_e_E_l_e_m_e_n_t__(), │ │ │ │ │ -174 _e_l_e_m_e_n_t__(nullptr) │ │ │ │ │ -175 {} │ │ │ │ │ -176 │ │ │ │ │ -_1_7_8 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ │ -179 { │ │ │ │ │ -180 return *_e_l_e_m_e_n_t__; │ │ │ │ │ -181 } │ │ │ │ │ -182 │ │ │ │ │ -_1_8_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 │ │ │ │ │ -188 { │ │ │ │ │ -189 return _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ │ -190 } │ │ │ │ │ -191 │ │ │ │ │ -_1_9_3 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ │ -194 { │ │ │ │ │ -195 _e_l_e_m_e_n_t__ = &e; │ │ │ │ │ -196 if constexpr (!hasFixedElementType) │ │ │ │ │ -197 _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()) │ │ │ │ │ -198 : static_cast<_F_i_n_i_t_e_E_l_e_m_e_n_t>(SimplexFiniteElement()) ; │ │ │ │ │ -199 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__.size()); │ │ │ │ │ -200 } │ │ │ │ │ -201 │ │ │ │ │ -202protected: │ │ │ │ │ -203 │ │ │ │ │ -_2_0_4 _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_0_5 const _E_l_e_m_e_n_t* _e_l_e_m_e_n_t__; │ │ │ │ │ -206}; │ │ │ │ │ -207 │ │ │ │ │ -208 │ │ │ │ │ -209 │ │ │ │ │ -210namespace BasisFactory { │ │ │ │ │ -211 │ │ │ │ │ -217template │ │ │ │ │ -_2_1_8auto _r_a_n_n_a_c_h_e_r_T_u_r_e_k() │ │ │ │ │ -219{ │ │ │ │ │ -220 return [](const auto& gridView) { │ │ │ │ │ -221 return _R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s>(gridView); │ │ │ │ │ -222 }; │ │ │ │ │ -223} │ │ │ │ │ -224 │ │ │ │ │ -225} // end namespace BasisFactory │ │ │ │ │ -226 │ │ │ │ │ -227 │ │ │ │ │ -228 │ │ │ │ │ -229 │ │ │ │ │ -241template │ │ │ │ │ -_2_4_2using _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_> >; │ │ │ │ │ -243 │ │ │ │ │ -244} // end namespace Functions │ │ │ │ │ -245} // end namespace Dune │ │ │ │ │ -246 │ │ │ │ │ -247#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH │ │ │ │ │ -_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ │ -_n_o_d_e_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:218 │ │ │ │ │ +38 template │ │ │ │ │ +_3_9 struct _T_r_a_i_t_s │ │ │ │ │ +40 { │ │ │ │ │ +_4_1 using _R_a_n_g_e = typename DerivativeTraits_:_:_R_a_n_g_e; │ │ │ │ │ +42 }; │ │ │ │ │ +43}; │ │ │ │ │ +44 │ │ │ │ │ +45 │ │ │ │ │ +46}} // namespace Dune::Functions │ │ │ │ │ +47 │ │ │ │ │ +48#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 polynomial.hh:10 │ │ │ │ │ -_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:46 │ │ │ │ │ -_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 │ │ │ │ │ -DDeeffiinniittiioonn nodes.hh:142 │ │ │ │ │ -_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:164 │ │ │ │ │ -_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:186 │ │ │ │ │ -_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:152 │ │ │ │ │ -_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:170 │ │ │ │ │ -_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: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__ │ │ │ │ │ -FiniteElement finiteElement_ │ │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:204 │ │ │ │ │ -_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: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_N_o_d_e_:_:_E_l_e_m_e_n_t │ │ │ │ │ -typename GV::template Codim< 0 >::Entity Element │ │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:167 │ │ │ │ │ -_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:172 │ │ │ │ │ -_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:205 │ │ │ │ │ -_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:187 │ │ │ │ │ -_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:178 │ │ │ │ │ -_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:52 │ │ │ │ │ -_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_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 rannacherturekbasis.hh:68 │ │ │ │ │ -_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:80 │ │ │ │ │ -_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_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ -static constexpr size_type maxMultiIndexSize │ │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:66 │ │ │ │ │ -_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_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ -static constexpr size_type minMultiIndexSize │ │ │ │ │ -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_:_:_s_i_z_e │ │ │ │ │ -size_type size(const SizePrefix prefix) const │ │ │ │ │ -Return number of possible values for next position in multi index. │ │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:111 │ │ │ │ │ -_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:61 │ │ │ │ │ -_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:98 │ │ │ │ │ -_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:90 │ │ │ │ │ -_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:130 │ │ │ │ │ -_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: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_:_:_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 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_:_:_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:71 │ │ │ │ │ -_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 │ │ │ │ │ -size_type size() const │ │ │ │ │ -Same as size(prefix) with empty prefix. │ │ │ │ │ -DDeeffiinniittiioonn rannacherturekbasis.hh:104 │ │ │ │ │ -_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:84 │ │ │ │ │ -_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:124 │ │ │ │ │ -_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:144 │ │ │ │ │ +_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:23 │ │ │ │ │ +_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:28 │ │ │ │ │ +_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:30 │ │ │ │ │ +_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:29 │ │ │ │ │ +_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: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_:_:_T_r_a_i_t_s_:_:_R_a_n_g_e │ │ │ │ │ +InvalidRange Range │ │ │ │ │ +DDeeffiinniittiioonn localderivativetraits.hh:35 │ │ │ │ │ +_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:41 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00017.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: taylorhoodbasis.hh File Reference │ │ │ │ +dune-functions: analyticgridviewfunction.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,68 +65,56 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces | │ │ │ │ -Typedefs | │ │ │ │ Functions
│ │ │ │ -
taylorhoodbasis.hh File Reference
│ │ │ │ +
analyticgridviewfunction.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <dune/common/exceptions.hh>
│ │ │ │ -#include <dune/common/reservedvector.hh>
│ │ │ │ -#include <dune/common/indices.hh>
│ │ │ │ -#include <dune/typetree/powernode.hh>
│ │ │ │ -#include <dune/typetree/compositenode.hh>
│ │ │ │ -#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ │ -#include <dune/functions/functionspacebases/lagrangebasis.hh>
│ │ │ │ -#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │ │ +
#include <type_traits>
│ │ │ │ +#include <optional>
│ │ │ │ +#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::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::AnalyticGridViewFunction< Range(Domain), GV, F, DerivativeTraits >
 Class wrapping any differentiable function as grid function. 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.
 
template<class F , class GridView >
AnalyticGridViewFunction< typename std::invoke_result< F, typename GridView::template Codim< 0 >::Geometry::GlobalCoordinate >::type(typename GridView::template Codim< 0 >::Geometry::GlobalCoordinate), GridView, typename std::decay< F >::type > Dune::Functions::makeAnalyticGridViewFunction (F &&f, const GridView &gridView)
 Create an AnalyticGridViewFunction from a function and a grid view.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,46 +1,44 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -taylorhoodbasis.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_/_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> │ │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +analyticgridviewfunction.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_/_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_:_:_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_:_:_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 │ │ │ │ │   │ │ │ │ │ -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< GV > > │ │ │ │ │ -  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. │ │ │ │ │ +template │ │ │ │ │ + _A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n< typename │ │ │ │ │ + std::invoke_result< F, typename │ │ │ │ │ + GridView::template Codim< 0 >:: │ │ │ │ │ + Geometry::GlobalCoordinate >::type │ │ │ │ │ +(typename GridView::template Codim< 0 │ │ │ │ │ + >::Geometry::GlobalCoordinate), _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_: │ │ │ │ │ + GridView, typename std::decay< F >:: _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, │ │ │ │ │ + type >  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. │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00017_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: taylorhoodbasis.hh Source File │ │ │ │ +dune-functions: analyticgridviewfunction.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,394 +70,253 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
taylorhoodbasis.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH
│ │ │ │
5
│ │ │ │ -
6#include <dune/common/exceptions.hh>
│ │ │ │ -
7#include <dune/common/reservedvector.hh>
│ │ │ │ -
8#include <dune/common/indices.hh>
│ │ │ │ -
9
│ │ │ │ -
10#include <dune/typetree/powernode.hh>
│ │ │ │ -
11#include <dune/typetree/compositenode.hh>
│ │ │ │ -
12
│ │ │ │ - │ │ │ │ -
14
│ │ │ │ - │ │ │ │ - │ │ │ │ +
6#include <type_traits>
│ │ │ │ +
7#include <optional>
│ │ │ │ +
8
│ │ │ │ +
9#include <dune/common/typeutilities.hh>
│ │ │ │ +
10
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
17
│ │ │ │ -
18namespace Dune {
│ │ │ │ -
19namespace Functions {
│ │ │ │ -
20
│ │ │ │ +
18
│ │ │ │ +
19namespace Dune {
│ │ │ │ +
20namespace Functions {
│ │ │ │
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>
│ │ │ │ -
35class TaylorHoodVelocityTree;
│ │ │ │ -
36
│ │ │ │ -
37template<typename GV>
│ │ │ │ -
38class TaylorHoodBasisTree;
│ │ │ │ -
39
│ │ │ │ -
59template<typename GV, bool HI=false>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
61{
│ │ │ │ -
62 static const bool useHybridIndices = HI;
│ │ │ │ +
22namespace Imp {
│ │ │ │ +
23
│ │ │ │ +
24template<class Signature, class GV, class FLocal, template<class> class DerivativeTraits=DefaultDerivativeTraits>
│ │ │ │ +
25class LocalAnalyticGridViewFunction;
│ │ │ │ +
26
│ │ │ │ +
27template<class Range, class LocalDomain, class GV, class F, template<class> class DerivativeTraits>
│ │ │ │ +
28class LocalAnalyticGridViewFunction<Range(LocalDomain), GV, F, DerivativeTraits>
│ │ │ │ +
29{
│ │ │ │ +
30public:
│ │ │ │ +
31 using Signature = Range(LocalDomain);
│ │ │ │ +
32 using RawSignature = typename SignatureTraits<Signature>::RawSignature;
│ │ │ │ +
33 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(LocalDomain);
│ │ │ │ +
34
│ │ │ │ +
35 using GridView = GV;
│ │ │ │ +
36 using EntitySet = GridViewEntitySet<GridView, 0>;
│ │ │ │ +
37 using Element = typename EntitySet::Element;
│ │ │ │ +
38// using Geometry = typename Element::Geometry;
│ │ │ │ +
39 using Geometry = typename std::decay<typename Element::Geometry>::type;
│ │ │ │ +
40
│ │ │ │ +
41 // Use the indirection via derivativeIfImplemented to also support
│ │ │ │ +
42 // function types F that do not implement derivative. In this case
│ │ │ │ +
43 // the interface type DifferentiableFunction is using a dummy for
│ │ │ │ +
44 // the derivative type
│ │ │ │ +
45 using DerivativeDummy = DifferentiableFunction<DerivativeSignature>;
│ │ │ │ +
46 using GlobalRawDerivative = decltype(Imp::derivativeIfImplemented<DerivativeDummy, F>(std::declval<F>()));
│ │ │ │ +
47 using LocalDerivative = LocalAnalyticGridViewFunction<DerivativeSignature, GridView, GlobalRawDerivative, DerivativeTraits>;
│ │ │ │ +
48
│ │ │ │ +
50 template<class FT, disableCopyMove<LocalAnalyticGridViewFunction, FT> = 0>
│ │ │ │ +
51 LocalAnalyticGridViewFunction(FT&& f) :
│ │ │ │ +
52 f_(std::forward<FT>(f))
│ │ │ │ +
53 {}
│ │ │ │ +
54
│ │ │ │ +
56 template<class FT>
│ │ │ │ +
57 LocalAnalyticGridViewFunction(FT&& f, const Element& element, const std::optional<Geometry>& geometry) :
│ │ │ │ +
58 f_(std::forward<FT>(f)),
│ │ │ │ +
59 element_(element),
│ │ │ │ +
60 geometry_(geometry)
│ │ │ │ +
61 {}
│ │ │ │ +
62
│ │ │ │
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
│ │ │ │ - │ │ │ │ - │ │ │ │ -
85
│ │ │ │ -
86public:
│ │ │ │ -
87
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
90 gridView_(gv),
│ │ │ │ -
91 pq1PreBasis_(gv),
│ │ │ │ -
92 pq2PreBasis_(gv)
│ │ │ │ -
93 {}
│ │ │ │ -
│ │ │ │ -
94
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
97 {
│ │ │ │ - │ │ │ │ - │ │ │ │ -
100 }
│ │ │ │ -
│ │ │ │ -
101
│ │ │ │ -
│ │ │ │ -
103 const GridView& gridView() const
│ │ │ │ -
104 {
│ │ │ │ -
105 return gridView_;
│ │ │ │ -
106 }
│ │ │ │ -
│ │ │ │ -
107
│ │ │ │ -
│ │ │ │ -
109 void update (const GridView& gv)
│ │ │ │ -
110 {
│ │ │ │ - │ │ │ │ - │ │ │ │ -
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 }
│ │ │ │ -
│ │ │ │ +
72 void bind(const Element& element)
│ │ │ │ +
73 {
│ │ │ │ +
74 element_ = element;
│ │ │ │ +
75 geometry_.emplace(element_.geometry());
│ │ │ │ +
76 }
│ │ │ │ +
77
│ │ │ │ +
79 void unbind()
│ │ │ │ +
80 {
│ │ │ │ +
81 geometry_.reset();
│ │ │ │ +
82 }
│ │ │ │ +
83
│ │ │ │ +
86 bool bound() const
│ │ │ │ +
87 {
│ │ │ │ +
88 return static_cast<bool>(geometry_);
│ │ │ │ +
89 }
│ │ │ │ +
90
│ │ │ │ +
100 Range operator()(const LocalDomain& x) const
│ │ │ │ +
101 {
│ │ │ │ +
102 assert(!!geometry_);
│ │ │ │ +
103 return f_(geometry_->global(x));
│ │ │ │ +
104 }
│ │ │ │ +
105
│ │ │ │ +
107 const Element& localContext() const
│ │ │ │ +
108 {
│ │ │ │ +
109 assert(!!geometry_);
│ │ │ │ +
110 return element_;
│ │ │ │ +
111 }
│ │ │ │ +
112
│ │ │ │ +
121 friend LocalDerivative derivative(const LocalAnalyticGridViewFunction& t)
│ │ │ │ +
122 {
│ │ │ │ +
123 return LocalDerivative(Imp::derivativeIfImplemented<DerivativeDummy, F>(t.f_), t.element_, t.geometry_);
│ │ │ │ +
124 }
│ │ │ │ +
125
│ │ │ │ +
126private:
│ │ │ │ +
127 F f_;
│ │ │ │ +
128 Element element_;
│ │ │ │ +
129 std::optional<Geometry> geometry_ = std::nullopt;
│ │ │ │ +
130};
│ │ │ │ +
131
│ │ │ │ +
132} // end namespace Imp
│ │ │ │ +
133
│ │ │ │ +
134
│ │ │ │
135
│ │ │ │ -
136private:
│ │ │ │ -
137
│ │ │ │ -
138 template<bool hi, class SizePrefix,
│ │ │ │ -
139 typename std::enable_if<not hi,int>::type = 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 typename std::enable_if<hi,int>::type = 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 {
│ │ │ │ - │ │ │ │ -
191 }
│ │ │ │ -
│ │ │ │ -
192
│ │ │ │ -
193 template<typename It>
│ │ │ │ -
│ │ │ │ -
194 It indices(const Node& node, It it) const
│ │ │ │ -
195 {
│ │ │ │ -
196 return indicesImp<useHybridIndices>(node, it);
│ │ │ │ -
197 }
│ │ │ │ +
136
│ │ │ │ +
137template<class Signature, class GV, class F, template<class> class DerivativeTraits=DefaultDerivativeTraits>
│ │ │ │ + │ │ │ │ +
139
│ │ │ │ +
140
│ │ │ │ +
146template<class Range, class Domain, class GV, class F, template<class> class DerivativeTraits>
│ │ │ │ +
│ │ │ │ +
147class AnalyticGridViewFunction<Range(Domain), GV, F, DerivativeTraits>
│ │ │ │ +
148{
│ │ │ │ +
149public:
│ │ │ │ +
150 using Signature = Range(Domain);
│ │ │ │ + │ │ │ │ +
152 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(Domain);
│ │ │ │ +
153
│ │ │ │ +
154 using GridView = GV;
│ │ │ │ + │ │ │ │ +
156 using Element = typename EntitySet::Element;
│ │ │ │ +
157 using Geometry = typename Element::Geometry;
│ │ │ │ +
158
│ │ │ │ +
159 // Use the indirection via derivativeIfImplemented to also support
│ │ │ │ +
160 // function types F that do not implement derivative. In this case
│ │ │ │ +
161 // the interface type DifferentiableFunction is used a dummy for
│ │ │ │ +
162 // the derivative type
│ │ │ │ + │ │ │ │ +
164 using GlobalRawDerivative = decltype(Imp::derivativeIfImplemented<DerivativeDummy, F>(std::declval<F>()));
│ │ │ │ + │ │ │ │ +
166
│ │ │ │ + │ │ │ │ +
168 using LocalFunction = typename Imp::LocalAnalyticGridViewFunction<Range(LocalDomain), GridView, F, LocalDerivativeTraits<EntitySet, DerivativeTraits>::template Traits>;
│ │ │ │ +
169
│ │ │ │ +
171 template<class FT>
│ │ │ │ +
│ │ │ │ +
172 AnalyticGridViewFunction(FT&& f, const GridView& gridView) :
│ │ │ │ +
173 f_(std::forward<FT>(f)),
│ │ │ │ +
174 entitySet_(gridView)
│ │ │ │ +
175 {}
│ │ │ │ +
│ │ │ │ +
176
│ │ │ │ +
│ │ │ │ +
178 Range operator()(const Domain& x) const
│ │ │ │ +
179 {
│ │ │ │ +
180 return f_(x);
│ │ │ │ +
181 }
│ │ │ │ +
│ │ │ │ +
182
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
185 {
│ │ │ │ +
186 return Derivative(Imp::derivativeIfImplemented<DerivativeDummy, F>(t.f_), t.entitySet_.gridView());
│ │ │ │ +
187 }
│ │ │ │ +
│ │ │ │ +
188
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
191 {
│ │ │ │ +
192 return LocalFunction(t.f_);
│ │ │ │ +
193 }
│ │ │ │ +
│ │ │ │ +
194
│ │ │ │ +
│ │ │ │ +
196 const EntitySet& entitySet() const
│ │ │ │ +
197 {
│ │ │ │ +
198 return entitySet_;
│ │ │ │ +
199 }
│ │ │ │
│ │ │ │ -
198
│ │ │ │ -
199protected:
│ │ │ │
200
│ │ │ │ -
201 template<class MultiIndex>
│ │ │ │ -
│ │ │ │ -
202 static const void multiIndexPushFront(MultiIndex& M, size_type M0)
│ │ │ │ -
203 {
│ │ │ │ -
204 M.resize(M.size()+1);
│ │ │ │ -
205 for(std::size_t i=M.size()-1; i>0; --i)
│ │ │ │ -
206 M[i] = M[i-1];
│ │ │ │ -
207 M[0] = M0;
│ │ │ │ -
208 }
│ │ │ │ -
│ │ │ │ -
209
│ │ │ │ -
210 template<bool hi, class It,
│ │ │ │ -
211 typename std::enable_if<not hi,int>::type = 0>
│ │ │ │ -
│ │ │ │ -
212 It indicesImp(const Node& node, It multiIndices) const
│ │ │ │ -
213 {
│ │ │ │ -
214 using namespace Dune::Indices;
│ │ │ │ -
215 for(std::size_t child=0; child<dim; ++child)
│ │ │ │ -
216 {
│ │ │ │ -
217 size_type subTreeSize = node.child(_0, 0).size();
│ │ │ │ -
218 pq2PreBasis_.indices(node.child(_0, 0), multiIndices);
│ │ │ │ -
219 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ │ -
220 {
│ │ │ │ -
221 multiIndexPushFront(multiIndices[i], 0);
│ │ │ │ -
222 multiIndices[i][1] = multiIndices[i][1]*dim + child;
│ │ │ │ -
223 }
│ │ │ │ -
224 multiIndices += subTreeSize;
│ │ │ │ -
225 }
│ │ │ │ -
226 size_type subTreeSize = node.child(_1).size();
│ │ │ │ -
227 pq1PreBasis_.indices(node.child(_1), multiIndices);
│ │ │ │ -
228 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ │ -
229 multiIndexPushFront(multiIndices[i], 1);
│ │ │ │ -
230 multiIndices += subTreeSize;
│ │ │ │ -
231 return multiIndices;
│ │ │ │ -
232 }
│ │ │ │ -
│ │ │ │ -
233
│ │ │ │ -
234 template<bool hi, class It,
│ │ │ │ -
235 typename std::enable_if<hi,int>::type = 0>
│ │ │ │ -
│ │ │ │ -
236 It indicesImp(const Node& node, It multiIndices) const
│ │ │ │ -
237 {
│ │ │ │ -
238 using namespace Dune::Indices;
│ │ │ │ -
239 for(std::size_t child=0; child<dim; ++child)
│ │ │ │ -
240 {
│ │ │ │ -
241 size_type subTreeSize = node.child(_0, 0).size();
│ │ │ │ -
242 pq2PreBasis_.indices(node.child(_0, 0), multiIndices);
│ │ │ │ -
243 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ │ -
244 {
│ │ │ │ -
245 multiIndexPushFront(multiIndices[i], 0);
│ │ │ │ -
246 multiIndices[i].push_back(i);
│ │ │ │ -
247 }
│ │ │ │ -
248 multiIndices += subTreeSize;
│ │ │ │ -
249 }
│ │ │ │ -
250 size_type subTreeSize = node.child(_1).size();
│ │ │ │ -
251 pq1PreBasis_.indices(node.child(_1), multiIndices);
│ │ │ │ -
252 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ │ -
253 multiIndexPushFront(multiIndices[i], 1);
│ │ │ │ -
254 multiIndices += subTreeSize;
│ │ │ │ -
255 return multiIndices;
│ │ │ │ -
256 }
│ │ │ │ -
│ │ │ │ -
257
│ │ │ │ - │ │ │ │ -
259
│ │ │ │ - │ │ │ │ - │ │ │ │ -
262};
│ │ │ │ -
│ │ │ │ -
263
│ │ │ │ -
264
│ │ │ │ -
265
│ │ │ │ -
266template<typename GV>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
268 public PowerBasisNode<LagrangeNode<GV,2>, GV::dimension>
│ │ │ │ -
269{
│ │ │ │ - │ │ │ │ - │ │ │ │ -
272
│ │ │ │ -
273public:
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
275 {
│ │ │ │ -
276 for(int i=0; i<GV::dimension; ++i)
│ │ │ │ -
277 this->setChild(i, std::make_shared<PQ2Node>());
│ │ │ │ -
278 }
│ │ │ │ -
│ │ │ │ -
279};
│ │ │ │ -
│ │ │ │ -
280
│ │ │ │ -
281template<typename GV>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
283 public CompositeBasisNode<
│ │ │ │ -
284 TaylorHoodVelocityTree<GV>,
│ │ │ │ -
285 LagrangeNode<GV,1>
│ │ │ │ -
286 >
│ │ │ │ -
287{
│ │ │ │ - │ │ │ │ - │ │ │ │ -
290
│ │ │ │ - │ │ │ │ -
292
│ │ │ │ -
293public:
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
295 {
│ │ │ │ -
296 this->template setChild<0>(std::make_shared<VelocityNode>());
│ │ │ │ -
297 this->template setChild<1>(std::make_shared<PressureNode>());
│ │ │ │ -
298 }
│ │ │ │ -
│ │ │ │ -
299};
│ │ │ │ -
│ │ │ │ -
300
│ │ │ │ -
301
│ │ │ │ -
302
│ │ │ │ -
303namespace BasisFactory {
│ │ │ │ -
304
│ │ │ │ -
│ │ │ │ -
311inline auto taylorHood()
│ │ │ │ -
312{
│ │ │ │ -
313 return [](const auto& gridView) {
│ │ │ │ -
314 return TaylorHoodPreBasis<std::decay_t<decltype(gridView)>>(gridView);
│ │ │ │ -
315 };
│ │ │ │ -
316}
│ │ │ │ -
│ │ │ │ -
317
│ │ │ │ -
318} // end namespace BasisFactory
│ │ │ │ -
319
│ │ │ │ -
320// *****************************************************************************
│ │ │ │ -
321// This is the actual global basis implementation based on the reusable parts.
│ │ │ │ -
322// *****************************************************************************
│ │ │ │ -
323
│ │ │ │ -
345template<typename GV>
│ │ │ │ - │ │ │ │ -
347
│ │ │ │ -
348
│ │ │ │ -
349
│ │ │ │ -
350} // end namespace Functions
│ │ │ │ -
351} // end namespace Dune
│ │ │ │ -
352
│ │ │ │ -
353
│ │ │ │ -
354#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
auto taylorHood()
Create a pre-basis factory that can create a Taylor-Hood pre-basis.
Definition taylorhoodbasis.hh:311
│ │ │ │ +
201private:
│ │ │ │ +
202 F f_;
│ │ │ │ +
203 EntitySet entitySet_;
│ │ │ │ +
204};
│ │ │ │ +
│ │ │ │ +
205
│ │ │ │ +
206
│ │ │ │ +
207
│ │ │ │ +
224template<class F, class GridView>
│ │ │ │ +
225AnalyticGridViewFunction<
│ │ │ │ +
226 typename std::invoke_result<F, typename GridView::template Codim<0>::Geometry::GlobalCoordinate>::type // Range
│ │ │ │ +
227 (typename GridView::template Codim<0>::Geometry::GlobalCoordinate), // Domain
│ │ │ │ +
228 GridView,
│ │ │ │ +
229 typename std::decay<F>::type > // Raw type of F (without & or &&)
│ │ │ │ +
│ │ │ │ +
230 makeAnalyticGridViewFunction(F&& f, const GridView& gridView)
│ │ │ │ +
231{
│ │ │ │ +
232 using Domain = typename GridView::template Codim<0>::Geometry::GlobalCoordinate;
│ │ │ │ +
233 using Range = typename std::invoke_result<F, Domain>::type;
│ │ │ │ +
234 using FRaw = typename std::decay<F>::type;
│ │ │ │ +
235
│ │ │ │ +
236 return AnalyticGridViewFunction<Range(Domain), GridView, FRaw>(std::forward<F>(f), gridView);
│ │ │ │ +
237}
│ │ │ │ +
│ │ │ │ +
238
│ │ │ │ +
239
│ │ │ │ +
240
│ │ │ │ +
241}} // namespace Dune::Functions
│ │ │ │ +
242
│ │ │ │ +
243
│ │ │ │ +
244
│ │ │ │ +
245#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:39
│ │ │ │ +
AnalyticGridViewFunction< typename std::invoke_result< F, typename GridView::template Codim< 0 >::Geometry::GlobalCoordinate >::type(typename GridView::template Codim< 0 >::Geometry::GlobalCoordinate), GridView, typename std::decay< F >::type > makeAnalyticGridViewFunction(F &&f, const GridView &gridView)
Create an AnalyticGridViewFunction from a function and a grid view.
Definition analyticgridviewfunction.hh:230
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:46
│ │ │ │ -
Definition lagrangebasis.hh:387
│ │ │ │ - │ │ │ │ -
It indices(const Node &node, It it) const
Definition lagrangebasis.hh:192
│ │ │ │ -
void initializeIndices()
Initialize the global indices.
Definition lagrangebasis.hh:96
│ │ │ │ -
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition lagrangebasis.hh:126
│ │ │ │ -
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition lagrangebasis.hh:184
│ │ │ │ -
size_type size() const
Same as size(prefix) with empty prefix.
Definition lagrangebasis.hh:140
│ │ │ │ -
size_type size() const
Definition nodes.hh:142
│ │ │ │ -
Definition nodes.hh:193
│ │ │ │ - │ │ │ │ -
Definition taylorhoodbasis.hh:269
│ │ │ │ -
TaylorHoodVelocityTree()
Definition taylorhoodbasis.hh:274
│ │ │ │ -
Definition taylorhoodbasis.hh:287
│ │ │ │ -
TaylorHoodBasisTree()
Definition taylorhoodbasis.hh:294
│ │ │ │ -
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:258
│ │ │ │ -
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
│ │ │ │ -
PQ2PreBasis pq2PreBasis_
Definition taylorhoodbasis.hh:261
│ │ │ │ -
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:260
│ │ │ │ -
static const void multiIndexPushFront(MultiIndex &M, size_type M0)
Definition taylorhoodbasis.hh:202
│ │ │ │ -
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:212
│ │ │ │ +
Definition differentiablefunction.hh:29
│ │ │ │ +
Helper class to deduce the signature of a callable.
Definition signature.hh:56
│ │ │ │ +
Definition analyticgridviewfunction.hh:138
│ │ │ │ +
Range operator()(const Domain &x) const
Evaluate the wrapped function f directly in global coordinates x.
Definition analyticgridviewfunction.hh:178
│ │ │ │ +
typename EntitySet::LocalCoordinate LocalDomain
Definition analyticgridviewfunction.hh:167
│ │ │ │ +
friend Derivative derivative(const AnalyticGridViewFunction &t)
Create a derivative grid-function by wrapping the derivative of f.
Definition analyticgridviewfunction.hh:184
│ │ │ │ +
typename Element::Geometry Geometry
Definition analyticgridviewfunction.hh:157
│ │ │ │ +
typename EntitySet::Element Element
Definition analyticgridviewfunction.hh:156
│ │ │ │ + │ │ │ │ +
decltype(Imp::derivativeIfImplemented< DerivativeDummy, F >(std::declval< F >())) GlobalRawDerivative
Definition analyticgridviewfunction.hh:164
│ │ │ │ +
Range(Domain) Signature
Definition analyticgridviewfunction.hh:150
│ │ │ │ +
AnalyticGridViewFunction(FT &&f, const GridView &gridView)
Create the grid-function by wrapping a function f and create a GridViewEntitySet.
Definition analyticgridviewfunction.hh:172
│ │ │ │ +
friend LocalFunction localFunction(const AnalyticGridViewFunction &t)
Construct the associated local-function.
Definition analyticgridviewfunction.hh:190
│ │ │ │ +
typename Imp::LocalAnalyticGridViewFunction< Range(LocalDomain), GridView, F, LocalDerivativeTraits< EntitySet, DerivativeTraits >::template Traits > LocalFunction
Definition analyticgridviewfunction.hh:168
│ │ │ │ +
typename SignatureTraits< Signature >::RawSignature RawSignature
Definition analyticgridviewfunction.hh:151
│ │ │ │ +
const EntitySet & entitySet() const
Return the set of entities this local-function can be bound to.
Definition analyticgridviewfunction.hh:196
│ │ │ │ +
typename DerivativeTraits< RawSignature >::Range(Domain) DerivativeSignature
Definition analyticgridviewfunction.hh:152
│ │ │ │ + │ │ │ │ +
GridView::template Codim< codim >::Entity Element
Type of Elements contained in this EntitySet.
Definition gridviewentityset.hh:32
│ │ │ │ +
Element::Geometry::LocalCoordinate LocalCoordinate
Type of local coordinates with respect to the Element.
Definition gridviewentityset.hh:35
│ │ │ │ +
Derivative traits for local functions.
Definition localderivativetraits.hh:28
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,436 +1,324 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -taylorhoodbasis.hh │ │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ -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 │ │ │ │ │ -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> │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ +8 │ │ │ │ │ +9#include │ │ │ │ │ +10 │ │ │ │ │ +11#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> │ │ │ │ │ +12#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> │ │ │ │ │ +13#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> │ │ │ │ │ +14#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> │ │ │ │ │ +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_/_l_o_c_a_l_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ │ 17 │ │ │ │ │ -18namespace _D_u_n_e { │ │ │ │ │ -19namespace Functions { │ │ │ │ │ -20 │ │ │ │ │ +18 │ │ │ │ │ +19namespace _D_u_n_e { │ │ │ │ │ +20namespace Functions { │ │ │ │ │ 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 TaylorHoodVelocityTree; │ │ │ │ │ -36 │ │ │ │ │ -37template │ │ │ │ │ -38class TaylorHoodBasisTree; │ │ │ │ │ -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; │ │ │ │ │ +22namespace Imp { │ │ │ │ │ +23 │ │ │ │ │ +24template class │ │ │ │ │ +DerivativeTraits=DefaultDerivativeTraits> │ │ │ │ │ +25class LocalAnalyticGridViewFunction; │ │ │ │ │ +26 │ │ │ │ │ +27template │ │ │ │ │ +class DerivativeTraits> │ │ │ │ │ +28class LocalAnalyticGridViewFunction │ │ │ │ │ +29{ │ │ │ │ │ +30public: │ │ │ │ │ +31 using Signature = Range(LocalDomain); │ │ │ │ │ +32 using RawSignature = typename SignatureTraits::RawSignature; │ │ │ │ │ +33 using DerivativeSignature = typename DerivativeTraits::Range │ │ │ │ │ +(LocalDomain); │ │ │ │ │ +34 │ │ │ │ │ +35 using GridView = GV; │ │ │ │ │ +36 using EntitySet = GridViewEntitySet; │ │ │ │ │ +37 using Element = typename EntitySet::Element; │ │ │ │ │ +38// using Geometry = typename Element::Geometry; │ │ │ │ │ +39 using Geometry = typename std::decay::type; │ │ │ │ │ +40 │ │ │ │ │ +41 // Use the indirection via derivativeIfImplemented to also support │ │ │ │ │ +42 // function types F that do not implement derivative. In this case │ │ │ │ │ +43 // the interface type DifferentiableFunction is using a dummy for │ │ │ │ │ +44 // the derivative type │ │ │ │ │ +45 using DerivativeDummy = DifferentiableFunction; │ │ │ │ │ +46 using GlobalRawDerivative = decltype(Imp:: │ │ │ │ │ +derivativeIfImplemented(std::declval())); │ │ │ │ │ +47 using LocalDerivative = LocalAnalyticGridViewFunction; │ │ │ │ │ +48 │ │ │ │ │ +50 template = 0> │ │ │ │ │ +51 LocalAnalyticGridViewFunction(FT&& f) : │ │ │ │ │ +52 f_(std::forward(f)) │ │ │ │ │ +53 {} │ │ │ │ │ +54 │ │ │ │ │ +56 template │ │ │ │ │ +57 LocalAnalyticGridViewFunction(FT&& f, const Element& element, const std:: │ │ │ │ │ +optional& geometry) : │ │ │ │ │ +58 f_(std::forward(f)), │ │ │ │ │ +59 element_(element), │ │ │ │ │ +60 geometry_(geometry) │ │ │ │ │ +61 {} │ │ │ │ │ +62 │ │ │ │ │ 63 │ │ │ │ │ -64 static const int dim = GV::dimension; │ │ │ │ │ -65 │ │ │ │ │ -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 _P_Q_1_P_r_e_B_a_s_i_s = _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_G_V_,_1_>; │ │ │ │ │ -84 using _P_Q_2_P_r_e_B_a_s_i_s = _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__._i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s(); │ │ │ │ │ -99 _p_q_2_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(); │ │ │ │ │ -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__._u_p_d_a_t_e(gv); │ │ │ │ │ -112 _p_q_2_P_r_e_B_a_s_i_s__._u_p_d_a_t_e(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 } │ │ │ │ │ +72 void bind(const Element& element) │ │ │ │ │ +73 { │ │ │ │ │ +74 element_ = element; │ │ │ │ │ +75 geometry_.emplace(element_.geometry()); │ │ │ │ │ +76 } │ │ │ │ │ +77 │ │ │ │ │ +79 void unbind() │ │ │ │ │ +80 { │ │ │ │ │ +81 geometry_.reset(); │ │ │ │ │ +82 } │ │ │ │ │ +83 │ │ │ │ │ +86 bool bound() const │ │ │ │ │ +87 { │ │ │ │ │ +88 return static_cast(geometry_); │ │ │ │ │ +89 } │ │ │ │ │ +90 │ │ │ │ │ +100 Range operator()(const LocalDomain& x) const │ │ │ │ │ +101 { │ │ │ │ │ +102 assert(!!geometry_); │ │ │ │ │ +103 return f_(geometry_->global(x)); │ │ │ │ │ +104 } │ │ │ │ │ +105 │ │ │ │ │ +107 const Element& localContext() const │ │ │ │ │ +108 { │ │ │ │ │ +109 assert(!!geometry_); │ │ │ │ │ +110 return element_; │ │ │ │ │ +111 } │ │ │ │ │ +112 │ │ │ │ │ +121 friend LocalDerivative _d_e_r_i_v_a_t_i_v_e(const LocalAnalyticGridViewFunction& t) │ │ │ │ │ +122 { │ │ │ │ │ +123 return LocalDerivative(Imp::derivativeIfImplemented │ │ │ │ │ +(t.f_), t.element_, t.geometry_); │ │ │ │ │ +124 } │ │ │ │ │ +125 │ │ │ │ │ +126private: │ │ │ │ │ +127 F f_; │ │ │ │ │ +128 Element element_; │ │ │ │ │ +129 std::optional geometry_ = std::nullopt; │ │ │ │ │ +130}; │ │ │ │ │ +131 │ │ │ │ │ +132} // end namespace Imp │ │ │ │ │ +133 │ │ │ │ │ +134 │ │ │ │ │ 135 │ │ │ │ │ -136private: │ │ │ │ │ -137 │ │ │ │ │ -138 template::type = 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::type = 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__._s_i_z_e() + _p_q_1_P_r_e_B_a_s_i_s__._s_i_z_e(); │ │ │ │ │ -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__._m_a_x_N_o_d_e_S_i_z_e() + _p_q_1_P_r_e_B_a_s_i_s__._m_a_x_N_o_d_e_S_i_z_e(); │ │ │ │ │ -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 indicesImp(node, it); │ │ │ │ │ -197 } │ │ │ │ │ -198 │ │ │ │ │ -199protected: │ │ │ │ │ +136 │ │ │ │ │ +137template class │ │ │ │ │ +DerivativeTraits=DefaultDerivativeTraits> │ │ │ │ │ +_1_3_8class _A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n; │ │ │ │ │ +139 │ │ │ │ │ +140 │ │ │ │ │ +146template class │ │ │ │ │ +DerivativeTraits> │ │ │ │ │ +_1_4_7class _A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ │ +148{ │ │ │ │ │ +149public: │ │ │ │ │ +_1_5_0 using _S_i_g_n_a_t_u_r_e = Range(Domain); │ │ │ │ │ +_1_5_1 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_2 using _D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e = typename DerivativeTraits::Range │ │ │ │ │ +(Domain); │ │ │ │ │ +153 │ │ │ │ │ +_1_5_4 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ │ +_1_5_5 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_5_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; │ │ │ │ │ +_1_5_7 using _G_e_o_m_e_t_r_y = typename Element::Geometry; │ │ │ │ │ +158 │ │ │ │ │ +159 // Use the indirection via derivativeIfImplemented to also support │ │ │ │ │ +160 // function types F that do not implement derivative. In this case │ │ │ │ │ +161 // the interface type DifferentiableFunction is used a dummy for │ │ │ │ │ +162 // the derivative type │ │ │ │ │ +_1_6_3 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_6_4 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_6_5 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_>; │ │ │ │ │ +166 │ │ │ │ │ +_1_6_7 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_6_8 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>; │ │ │ │ │ +169 │ │ │ │ │ +171 template │ │ │ │ │ +_1_7_2 _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) : │ │ │ │ │ +173 f_(std::forward(f)), │ │ │ │ │ +174 entitySet_(gridView) │ │ │ │ │ +175 {} │ │ │ │ │ +176 │ │ │ │ │ +_1_7_8 Range _o_p_e_r_a_t_o_r_(_)(const Domain& x) const │ │ │ │ │ +179 { │ │ │ │ │ +180 return f_(x); │ │ │ │ │ +181 } │ │ │ │ │ +182 │ │ │ │ │ +_1_8_4 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) │ │ │ │ │ +185 { │ │ │ │ │ +186 return _D_e_r_i_v_a_t_i_v_e(Imp::derivativeIfImplemented(t.f_), │ │ │ │ │ +t.entitySet_.gridView()); │ │ │ │ │ +187 } │ │ │ │ │ +188 │ │ │ │ │ +_1_9_0 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) │ │ │ │ │ +191 { │ │ │ │ │ +192 return _L_o_c_a_l_F_u_n_c_t_i_o_n(t.f_); │ │ │ │ │ +193 } │ │ │ │ │ +194 │ │ │ │ │ +_1_9_6 const _E_n_t_i_t_y_S_e_t& _e_n_t_i_t_y_S_e_t() const │ │ │ │ │ +197 { │ │ │ │ │ +198 return entitySet_; │ │ │ │ │ +199 } │ │ │ │ │ 200 │ │ │ │ │ -201 template │ │ │ │ │ -_2_0_2 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) │ │ │ │ │ -203 { │ │ │ │ │ -204 M.resize(M.size()+1); │ │ │ │ │ -205 for(std::size_t i=M.size()-1; i>0; --i) │ │ │ │ │ -206 M[i] = M[i-1]; │ │ │ │ │ -207 M[0] = M0; │ │ │ │ │ -208 } │ │ │ │ │ -209 │ │ │ │ │ -210 template::type = 0> │ │ │ │ │ -_2_1_2 It _i_n_d_i_c_e_s_I_m_p(const _N_o_d_e& node, It multiIndices) const │ │ │ │ │ -213 { │ │ │ │ │ -214 using namespace Dune::Indices; │ │ │ │ │ -215 for(std::size_t child=0; child::type = 0> │ │ │ │ │ -_2_3_6 It _i_n_d_i_c_e_s_I_m_p(const _N_o_d_e& node, It multiIndices) const │ │ │ │ │ -237 { │ │ │ │ │ -238 using namespace Dune::Indices; │ │ │ │ │ -239 for(std::size_t child=0; child │ │ │ │ │ -_2_6_7class _T_a_y_l_o_r_H_o_o_d_V_e_l_o_c_i_t_y_T_r_e_e : │ │ │ │ │ -268 public _P_o_w_e_r_B_a_s_i_s_N_o_d_e, GV::dimension> │ │ │ │ │ -269{ │ │ │ │ │ -270 using _P_Q_2_N_o_d_e = _L_a_g_r_a_n_g_e_N_o_d_e_<_G_V_,_2_>; │ │ │ │ │ -271 using _B_a_s_e = _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_>; │ │ │ │ │ -272 │ │ │ │ │ -273public: │ │ │ │ │ -_2_7_4 _T_a_y_l_o_r_H_o_o_d_V_e_l_o_c_i_t_y_T_r_e_e() │ │ │ │ │ -275 { │ │ │ │ │ -276 for(int i=0; isetChild(i, std::make_shared()); │ │ │ │ │ -278 } │ │ │ │ │ -279}; │ │ │ │ │ -280 │ │ │ │ │ -281template │ │ │ │ │ -_2_8_2class _T_a_y_l_o_r_H_o_o_d_B_a_s_i_s_T_r_e_e : │ │ │ │ │ -283 public _C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e< │ │ │ │ │ -284 TaylorHoodVelocityTree, │ │ │ │ │ -285 LagrangeNode │ │ │ │ │ -286 > │ │ │ │ │ -287{ │ │ │ │ │ -288 using _V_e_l_o_c_i_t_y_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_>; │ │ │ │ │ -289 using _P_r_e_s_s_u_r_e_N_o_d_e=_L_a_g_r_a_n_g_e_N_o_d_e_<_G_V_,_1_>; │ │ │ │ │ -290 │ │ │ │ │ -291 using _B_a_s_e=_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_>; │ │ │ │ │ -292 │ │ │ │ │ -293public: │ │ │ │ │ -_2_9_4 _T_a_y_l_o_r_H_o_o_d_B_a_s_i_s_T_r_e_e() │ │ │ │ │ -295 { │ │ │ │ │ -296 this->template setChild<0>(std::make_shared()); │ │ │ │ │ -297 this->template setChild<1>(std::make_shared()); │ │ │ │ │ -298 } │ │ │ │ │ -299}; │ │ │ │ │ -300 │ │ │ │ │ -301 │ │ │ │ │ -302 │ │ │ │ │ -303namespace BasisFactory { │ │ │ │ │ -304 │ │ │ │ │ -_3_1_1inline auto _t_a_y_l_o_r_H_o_o_d() │ │ │ │ │ -312{ │ │ │ │ │ -313 return [](const auto& gridView) { │ │ │ │ │ -314 return _T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s>(gridView); │ │ │ │ │ -315 }; │ │ │ │ │ -316} │ │ │ │ │ -317 │ │ │ │ │ -318} // end namespace BasisFactory │ │ │ │ │ -319 │ │ │ │ │ -320/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -321// This is the actual global basis implementation based on the reusable │ │ │ │ │ -parts. │ │ │ │ │ -322/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -323 │ │ │ │ │ -345template │ │ │ │ │ -_3_4_6using _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_> >; │ │ │ │ │ -347 │ │ │ │ │ -348 │ │ │ │ │ -349 │ │ │ │ │ -350} // end namespace Functions │ │ │ │ │ -351} // end namespace Dune │ │ │ │ │ -352 │ │ │ │ │ -353 │ │ │ │ │ -354#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH │ │ │ │ │ -_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 │ │ │ │ │ -_n_o_d_e_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:311 │ │ │ │ │ +201private: │ │ │ │ │ +202 F f_; │ │ │ │ │ +203 EntitySet entitySet_; │ │ │ │ │ +204}; │ │ │ │ │ +205 │ │ │ │ │ +206 │ │ │ │ │ +207 │ │ │ │ │ +224template │ │ │ │ │ +225AnalyticGridViewFunction< │ │ │ │ │ +226 typename std::invoke_result:: │ │ │ │ │ +Geometry::GlobalCoordinate>::type // Range │ │ │ │ │ +227 (typename GridView::template Codim<0>::Geometry::GlobalCoordinate), / │ │ │ │ │ +/ Domain │ │ │ │ │ +228 GridView, │ │ │ │ │ +229 typename std::decay::type > // Raw type of F (without & or &&) │ │ │ │ │ +_2_3_0 _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) │ │ │ │ │ +231{ │ │ │ │ │ +232 using Domain = typename GridView::template Codim<0>::Geometry:: │ │ │ │ │ +GlobalCoordinate; │ │ │ │ │ +233 using Range = typename std::invoke_result::type; │ │ │ │ │ +234 using FRaw = typename std::decay::type; │ │ │ │ │ +235 │ │ │ │ │ +236 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); │ │ │ │ │ +237} │ │ │ │ │ +238 │ │ │ │ │ +239 │ │ │ │ │ +240 │ │ │ │ │ +241}} // namespace Dune::Functions │ │ │ │ │ +242 │ │ │ │ │ +243 │ │ │ │ │ +244 │ │ │ │ │ +245#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 │ │ │ │ │ +_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 │ │ │ │ │ +_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_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:39 │ │ │ │ │ +_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 │ │ │ │ │ +AnalyticGridViewFunction< typename std::invoke_result< F, typename GridView:: │ │ │ │ │ +template Codim< 0 >::Geometry::GlobalCoordinate >::type(typename GridView:: │ │ │ │ │ +template Codim< 0 >::Geometry::GlobalCoordinate), GridView, typename std:: │ │ │ │ │ +decay< F >::type > makeAnalyticGridViewFunction(F &&f, const GridView │ │ │ │ │ +&gridView) │ │ │ │ │ +Create an AnalyticGridViewFunction from a function and a grid view. │ │ │ │ │ +DDeeffiinniittiioonn analyticgridviewfunction.hh:230 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:46 │ │ │ │ │ -_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:387 │ │ │ │ │ -_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_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:192 │ │ │ │ │ -_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:96 │ │ │ │ │ -_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: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_:_:_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: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_:_:_s_i_z_e │ │ │ │ │ -size_type size() const │ │ │ │ │ -Same as size(prefix) with empty prefix. │ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:140 │ │ │ │ │ -_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 │ │ │ │ │ -DDeeffiinniittiioonn nodes.hh:142 │ │ │ │ │ -_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:193 │ │ │ │ │ -_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:219 │ │ │ │ │ -_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:269 │ │ │ │ │ -_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:274 │ │ │ │ │ -_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:287 │ │ │ │ │ -_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:294 │ │ │ │ │ -_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:258 │ │ │ │ │ -_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 │ │ │ │ │ +_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:29 │ │ │ │ │ +_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:56 │ │ │ │ │ +_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:138 │ │ │ │ │ +_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: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_D_o_m_a_i_n │ │ │ │ │ +typename EntitySet::LocalCoordinate LocalDomain │ │ │ │ │ +DDeeffiinniittiioonn analyticgridviewfunction.hh:167 │ │ │ │ │ +_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: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_ _>_:_:_G_e_o_m_e_t_r_y │ │ │ │ │ +typename Element::Geometry Geometry │ │ │ │ │ +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_l_e_m_e_n_t │ │ │ │ │ +typename EntitySet::Element Element │ │ │ │ │ +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_ _>_:_:_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_:_:_p_q_2_P_r_e_B_a_s_i_s__ │ │ │ │ │ -PQ2PreBasis pq2PreBasis_ │ │ │ │ │ -DDeeffiinniittiioonn taylorhoodbasis.hh:261 │ │ │ │ │ -_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:260 │ │ │ │ │ -_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:202 │ │ │ │ │ -_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:212 │ │ │ │ │ +DDeeffiinniittiioonn analyticgridviewfunction.hh:154 │ │ │ │ │ +_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:164 │ │ │ │ │ +_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:150 │ │ │ │ │ +_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:172 │ │ │ │ │ +_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: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_ _>_:_:_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:168 │ │ │ │ │ +_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:151 │ │ │ │ │ +_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: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_ _>_:_:_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:152 │ │ │ │ │ +_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_ _> │ │ │ │ │ +_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 │ │ │ │ │ +Type of Elements contained in this EntitySet. │ │ │ │ │ +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_ _>_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ │ +Element::Geometry::LocalCoordinate LocalCoordinate │ │ │ │ │ +Type of local coordinates with respect to the Element. │ │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:35 │ │ │ │ │ +_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:28 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00020.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: brezzidouglasmarinibasis.hh File Reference │ │ │ │ +dune-functions: discreteglobalbasisfunction.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,71 +65,73 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces | │ │ │ │ -Typedefs | │ │ │ │ Functions
│ │ │ │ -
brezzidouglasmarinibasis.hh File Reference
│ │ │ │ +
discreteglobalbasisfunction.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 <memory>
│ │ │ │ +#include <optional>
│ │ │ │ +#include <dune/common/typetraits.hh>
│ │ │ │ +#include <dune/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::BrezziDouglasMariniPreBasis< GV, k >
class  Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >
 
class  Dune::Functions::BrezziDouglasMariniNode< GV, k >
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::BasisFactory
namespace  Dune::Functions::ImplDoc
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -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.
 
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ 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.
 
template<typename R , typename B , typename V >
auto Dune::Functions::makeDiscreteGlobalBasisFunction (B &&basis, V &&vector)
 Generate a DiscreteGlobalBasisFunction.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,55 +1,59 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -brezzidouglasmarinibasis.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_/_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> │ │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +discreteglobalbasisfunction.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_/_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_:_:_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_:_:_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 │ │ │ │ │ + _> │ │ │ │ │   │ │ │ │ │ -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_ _> │ │ │ │ │ +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_:_:_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< GV, k > > │ │ │ │ │ -  Basis of a scalar k-th-order BDM finite element space on simplex and │ │ │ │ │ - cube grids. │ │ │ │ │ +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_:_:_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. │ │ │ │ │ +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. │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00020_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: brezzidouglasmarinibasis.hh Source File │ │ │ │ +dune-functions: discreteglobalbasisfunction.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,427 +70,681 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
brezzidouglasmarinibasis.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BREZZIDOUGLASMARINIBASIS_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BREZZIDOUGLASMARINIBASIS_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH
│ │ │ │
5
│ │ │ │ -
6#include <array>
│ │ │ │ -
7#include <dune/common/exceptions.hh>
│ │ │ │ -
8#include <dune/geometry/referenceelements.hh>
│ │ │ │ -
9
│ │ │ │ -
10#include <dune/localfunctions/common/virtualinterface.hh>
│ │ │ │ -
11#include <dune/localfunctions/common/virtualwrappers.hh>
│ │ │ │ +
6#include <memory>
│ │ │ │ +
7#include <optional>
│ │ │ │ +
8
│ │ │ │ +
9#include <dune/common/typetraits.hh>
│ │ │ │ +
10
│ │ │ │ +
11#include <dune/typetree/treecontainer.hh>
│ │ │ │
12
│ │ │ │ -
13#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini1cube2d.hh>
│ │ │ │ -
14#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini1cube3d.hh>
│ │ │ │ -
15#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini1simplex2d.hh>
│ │ │ │ -
16#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini2cube2d.hh>
│ │ │ │ -
17#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini2simplex2d.hh>
│ │ │ │ -
18
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
19
│ │ │ │ +
20namespace Dune {
│ │ │ │ +
21namespace Functions {
│ │ │ │
22
│ │ │ │ -
23namespace Dune {
│ │ │ │ -
24namespace Functions {
│ │ │ │ +
23
│ │ │ │ +
│ │ │ │ +
24namespace ImplDoc {
│ │ │ │
25
│ │ │ │ -
26namespace Impl {
│ │ │ │ -
27
│ │ │ │ -
28 template<int dim, typename D, typename R, std::size_t k>
│ │ │ │ -
29 struct BDMSimplexLocalInfo
│ │ │ │ -
30 {
│ │ │ │ -
31 static_assert((AlwaysFalse<D>::value),"The requested type of BDM element is not implemented, sorry!");
│ │ │ │ -
32 };
│ │ │ │ -
33
│ │ │ │ -
34 template<typename D, typename R>
│ │ │ │ -
35 struct BDMSimplexLocalInfo<2,D,R,1>
│ │ │ │ -
36 {
│ │ │ │ -
37 using FiniteElement = BDM1Simplex2DLocalFiniteElement<D,R>;
│ │ │ │ -
38 static const std::size_t Variants = 8;
│ │ │ │ -
39 };
│ │ │ │ -
40
│ │ │ │ -
41 template<typename D, typename R>
│ │ │ │ -
42 struct BDMSimplexLocalInfo<2,D,R,2>
│ │ │ │ -
43 {
│ │ │ │ -
44 using FiniteElement = BDM2Simplex2DLocalFiniteElement<D,R>;
│ │ │ │ -
45 static const std::size_t Variants = 8;
│ │ │ │ -
46 };
│ │ │ │ -
47
│ │ │ │ -
48 template<int dim, typename D, typename R, std::size_t k>
│ │ │ │ -
49 struct BDMCubeLocalInfo
│ │ │ │ -
50 {
│ │ │ │ -
51 static_assert((AlwaysFalse<D>::value),"The requested type of BDM element is not implemented, sorry!");
│ │ │ │ -
52 };
│ │ │ │ -
53
│ │ │ │ -
54 template<typename D, typename R>
│ │ │ │ -
55 struct BDMCubeLocalInfo<2,D,R,1>
│ │ │ │ -
56 {
│ │ │ │ -
57 using FiniteElement = BDM1Cube2DLocalFiniteElement<D,R>;
│ │ │ │ -
58 static const std::size_t Variants = 16;
│ │ │ │ -
59 };
│ │ │ │ -
60
│ │ │ │ -
61 template<typename D, typename R>
│ │ │ │ -
62 struct BDMCubeLocalInfo<2,D,R,2>
│ │ │ │ -
63 {
│ │ │ │ -
64 using FiniteElement = BDM2Cube2DLocalFiniteElement<D,R>;
│ │ │ │ -
65 static const std::size_t Variants = 16;
│ │ │ │ -
66 };
│ │ │ │ -
67
│ │ │ │ -
68 template<typename D, typename R>
│ │ │ │ -
69 struct BDMCubeLocalInfo<3,D,R,1>
│ │ │ │ -
70 {
│ │ │ │ -
71 using FiniteElement = BDM1Cube3DLocalFiniteElement<D,R>;
│ │ │ │ -
72 static const std::size_t Variants = 64;
│ │ │ │ -
73 };
│ │ │ │ -
74
│ │ │ │ -
75 template<typename GV, int dim, typename R, std::size_t k>
│ │ │ │ -
76 class BDMLocalFiniteElementMap
│ │ │ │ -
77 {
│ │ │ │ -
78 using D = typename GV::ctype;
│ │ │ │ -
79 using CubeFiniteElement = typename BDMCubeLocalInfo<dim, D, R, k>::FiniteElement;
│ │ │ │ -
80 using SimplexFiniteElement = typename BDMSimplexLocalInfo<dim, D, R, k>::FiniteElement;
│ │ │ │ -
81
│ │ │ │ -
82 public:
│ │ │ │ -
83
│ │ │ │ -
84 using T = LocalBasisTraits<D, dim, FieldVector<D,dim>, R, dim, FieldVector<R,dim>, FieldMatrix<D,dim,dim> >;
│ │ │ │ -
85 using FiniteElement = LocalFiniteElementVirtualInterface<T>;
│ │ │ │ -
86
│ │ │ │ -
87 BDMLocalFiniteElementMap(const GV& gv)
│ │ │ │ -
88 : is_(&(gv.indexSet())), orient_(gv.size(0))
│ │ │ │ -
89 {
│ │ │ │ -
90 cubeVariant_.resize(BDMCubeLocalInfo<dim, D, R, k>::Variants);
│ │ │ │ -
91 simplexVariant_.resize(BDMSimplexLocalInfo<dim, D, R, k>::Variants);
│ │ │ │ +
26template<typename B, typename V, typename NTRE>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
28{
│ │ │ │ +
29public:
│ │ │ │ +
30 using Basis = B;
│ │ │ │ +
31 using Vector = V;
│ │ │ │ +
32
│ │ │ │ +
33 // In order to make the cache work for proxy-references
│ │ │ │ +
34 // we have to use AutonomousValue<T> instead of std::decay_t<T>
│ │ │ │ +
35 using Coefficient = Dune::AutonomousValue<decltype(std::declval<Vector>()[std::declval<typename Basis::MultiIndex>()])>;
│ │ │ │ +
36
│ │ │ │ +
37 using GridView = typename Basis::GridView;
│ │ │ │ + │ │ │ │ +
39 using Tree = typename Basis::LocalView::Tree;
│ │ │ │ +
40 using NodeToRangeEntry = NTRE;
│ │ │ │ +
41
│ │ │ │ + │ │ │ │ +
43
│ │ │ │ + │ │ │ │ +
45 using Element = typename EntitySet::Element;
│ │ │ │ +
46
│ │ │ │ +
47protected:
│ │ │ │ +
48
│ │ │ │ +
49 // This collects all data that is shared by all related
│ │ │ │ +
50 // global and local functions. This way we don't need to
│ │ │ │ +
51 // keep track of it individually.
│ │ │ │ +
│ │ │ │ +
52 struct Data
│ │ │ │ +
53 {
│ │ │ │ + │ │ │ │ +
55 std::shared_ptr<const Basis> basis;
│ │ │ │ +
56 std::shared_ptr<const Vector> coefficients;
│ │ │ │ +
57 std::shared_ptr<const NodeToRangeEntry> nodeToRangeEntry;
│ │ │ │ +
58 };
│ │ │ │ +
│ │ │ │ +
59
│ │ │ │ +
60public:
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
62 {
│ │ │ │ +
63 using LocalView = typename Basis::LocalView;
│ │ │ │ +
64 using size_type = typename Tree::size_type;
│ │ │ │ +
65
│ │ │ │ +
66 public:
│ │ │ │ + │ │ │ │ +
68 using Element = typename EntitySet::Element;
│ │ │ │ +
69
│ │ │ │ +
70 protected:
│ │ │ │ +
│ │ │ │ +
71 LocalFunctionBase(const std::shared_ptr<const Data>& data)
│ │ │ │ +
72 : data_(data)
│ │ │ │ +
73 , localView_(data_->basis->localView())
│ │ │ │ +
74 {
│ │ │ │ +
75 localDoFs_.reserve(localView_.maxSize());
│ │ │ │ +
76 }
│ │ │ │ +
│ │ │ │ +
77
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
85 : data_(other.data_)
│ │ │ │ +
86 , localView_(other.localView_)
│ │ │ │ +
87 {
│ │ │ │ +
88 localDoFs_.reserve(localView_.maxSize());
│ │ │ │ +
89 if (bound())
│ │ │ │ +
90 localDoFs_ = other.localDoFs_;
│ │ │ │ +
91 }
│ │ │ │ +
│ │ │ │
92
│ │ │ │ -
93 // create all variants
│ │ │ │ -
94 for (size_t i = 0; i < cubeVariant_.size(); i++)
│ │ │ │ -
95 cubeVariant_[i] = std::make_unique<LocalFiniteElementVirtualImp<CubeFiniteElement> >(CubeFiniteElement(i));
│ │ │ │ -
96
│ │ │ │ -
97 for (size_t i = 0; i < simplexVariant_.size(); i++)
│ │ │ │ -
98 simplexVariant_[i] = std::make_unique<LocalFiniteElementVirtualImp<SimplexFiniteElement> >(SimplexFiniteElement(i));
│ │ │ │ -
99
│ │ │ │ -
100 // compute orientation for all elements
│ │ │ │ -
101 // loop once over the grid
│ │ │ │ -
102 for(const auto& cell : elements(gv))
│ │ │ │ -
103 {
│ │ │ │ -
104 unsigned int myId = is_->index(cell);
│ │ │ │ -
105 orient_[myId] = 0;
│ │ │ │ -
106
│ │ │ │ -
107 for (const auto& intersection : intersections(gv,cell))
│ │ │ │ -
108 {
│ │ │ │ -
109 if (intersection.neighbor() && (is_->index(intersection.outside()) > myId))
│ │ │ │ -
110 orient_[myId] |= (1 << intersection.indexInInside());
│ │ │ │ -
111 }
│ │ │ │ -
112 }
│ │ │ │ -
113 }
│ │ │ │ -
114
│ │ │ │ -
116 template<class EntityType>
│ │ │ │ -
117 const FiniteElement& find(const EntityType& e) const
│ │ │ │ -
118 {
│ │ │ │ -
119 if (e.type().isCube())
│ │ │ │ -
120 return *cubeVariant_[orient_[is_->index(e)]];
│ │ │ │ -
121 else
│ │ │ │ -
122 return *simplexVariant_[orient_[is_->index(e)]];
│ │ │ │ -
123 }
│ │ │ │ -
124
│ │ │ │ -
125 private:
│ │ │ │ -
126 std::vector<std::unique_ptr<LocalFiniteElementVirtualImp<CubeFiniteElement> > > cubeVariant_;
│ │ │ │ -
127 std::vector<std::unique_ptr<LocalFiniteElementVirtualImp<SimplexFiniteElement> > > simplexVariant_;
│ │ │ │ -
128 const typename GV::IndexSet* is_;
│ │ │ │ -
129 std::vector<unsigned char> orient_;
│ │ │ │ -
130 };
│ │ │ │ -
131
│ │ │ │ -
132
│ │ │ │ -
133} // namespace Impl
│ │ │ │ -
134
│ │ │ │ -
135
│ │ │ │ -
136// *****************************************************************************
│ │ │ │ -
137// This is the reusable part of the basis. It contains
│ │ │ │ -
138//
│ │ │ │ -
139// BrezziDouglasMariniPreBasis
│ │ │ │ -
140// BrezziDouglasMariniNode
│ │ │ │ -
141//
│ │ │ │ -
142// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ │ -
143// state. These components do _not_ depend on the global basis and local view
│ │ │ │ -
144// and can be used without a global basis.
│ │ │ │ -
145// *****************************************************************************
│ │ │ │ -
146
│ │ │ │ -
147template<typename GV, int k>
│ │ │ │ -
148class BrezziDouglasMariniNode;
│ │ │ │ -
149
│ │ │ │ -
150template<typename GV, int k>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
152{
│ │ │ │ -
153 static const int dim = GV::dimension;
│ │ │ │ -
154 using FiniteElementMap = typename Impl::BDMLocalFiniteElementMap<GV, dim, double, k>;
│ │ │ │ -
155
│ │ │ │ -
156public:
│ │ │ │ -
157
│ │ │ │ -
159 using GridView = GV;
│ │ │ │ -
160 using size_type = std::size_t;
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
101 {
│ │ │ │ +
102 data_ = other.data_;
│ │ │ │ +
103 localView_ = other.localView_;
│ │ │ │ +
104 if (bound())
│ │ │ │ +
105 localDoFs_ = other.localDoFs_;
│ │ │ │ +
106 return *this;
│ │ │ │ +
107 }
│ │ │ │ +
│ │ │ │ +
108
│ │ │ │ +
109 public:
│ │ │ │ +
│ │ │ │ +
116 void bind(const Element& element)
│ │ │ │ +
117 {
│ │ │ │ +
118 localView_.bind(element);
│ │ │ │ +
119 // Use cache of full local view size. For a subspace basis,
│ │ │ │ +
120 // this may be larger than the number of local DOFs in the
│ │ │ │ +
121 // tree. In this case only cache entries associated to local
│ │ │ │ +
122 // DOFs in the subspace are filled. Cache entries associated
│ │ │ │ +
123 // to local DOFs which are not contained in the subspace will
│ │ │ │ +
124 // not be touched.
│ │ │ │ +
125 //
│ │ │ │ +
126 // Alternatively one could use a cache that exactly fits
│ │ │ │ +
127 // the size of the tree. However, this would require to
│ │ │ │ +
128 // subtract an offset from localIndex(i) on each cache
│ │ │ │ +
129 // access in operator().
│ │ │ │ +
130 localDoFs_.resize(localView_.size());
│ │ │ │ +
131 const auto& dofs = *data_->coefficients;
│ │ │ │ +
132 for (size_type i = 0; i < localView_.tree().size(); ++i)
│ │ │ │ +
133 {
│ │ │ │ +
134 // For a subspace basis the index-within-tree i
│ │ │ │ +
135 // is not the same as the localIndex within the
│ │ │ │ +
136 // full local view.
│ │ │ │ +
137 size_t localIndex = localView_.tree().localIndex(i);
│ │ │ │ +
138 localDoFs_[localIndex] = dofs[localView_.index(localIndex)];
│ │ │ │ +
139 }
│ │ │ │ +
140 }
│ │ │ │ +
│ │ │ │ +
141
│ │ │ │ +
│ │ │ │ +
143 void unbind()
│ │ │ │ +
144 {
│ │ │ │ +
145 localView_.unbind();
│ │ │ │ +
146 }
│ │ │ │ +
│ │ │ │ +
147
│ │ │ │ +
│ │ │ │ +
149 bool bound() const
│ │ │ │ +
150 {
│ │ │ │ +
151 return localView_.bound();
│ │ │ │ +
152 }
│ │ │ │ +
│ │ │ │ +
153
│ │ │ │ +
│ │ │ │ +
155 const Element& localContext() const
│ │ │ │ +
156 {
│ │ │ │ +
157 return localView_.element();
│ │ │ │ +
158 }
│ │ │ │ +
│ │ │ │ +
159
│ │ │ │ +
160 protected:
│ │ │ │
161
│ │ │ │ - │ │ │ │ -
163
│ │ │ │ -
164 static constexpr size_type maxMultiIndexSize = 1;
│ │ │ │ -
165 static constexpr size_type minMultiIndexSize = 1;
│ │ │ │ -
166 static constexpr size_type multiIndexBufferSize = 1;
│ │ │ │ -
167
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
170 gridView_(gv),
│ │ │ │ - │ │ │ │ -
172 {
│ │ │ │ -
173 // There is no inherent reason why the basis shouldn't work for grids with more than one
│ │ │ │ -
174 // element types. Somebody simply has to sit down and implement the missing bits.
│ │ │ │ -
175 if (gv.indexSet().types(0).size() > 1)
│ │ │ │ -
176 DUNE_THROW(Dune::NotImplemented, "Brezzi-Douglas-Marini basis is only implemented for grids with a single element type");
│ │ │ │ -
177 }
│ │ │ │ -
│ │ │ │ -
178
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
180 {
│ │ │ │ -
181 codimOffset_[0] = 0;
│ │ │ │ -
182 codimOffset_[1] = codimOffset_[0] + dofsPerCodim_[0] * gridView_.size(0);
│ │ │ │ -
183 //if (dim==3) codimOffset_[2] = codimOffset_[1] + dofsPerCodim[1] * gridView_.size(1);
│ │ │ │ -
184 }
│ │ │ │ -
│ │ │ │ -
185
│ │ │ │ -
│ │ │ │ -
188 const GridView& gridView() const
│ │ │ │ -
189 {
│ │ │ │ -
190 return gridView_;
│ │ │ │ -
191 }
│ │ │ │ -
│ │ │ │ -
192
│ │ │ │ -
193 /* \brief Update the stored grid view, to be called if the grid has changed */
│ │ │ │ -
│ │ │ │ -
194 void update (const GridView& gv)
│ │ │ │ -
195 {
│ │ │ │ -
196 gridView_ = gv;
│ │ │ │ -
197 }
│ │ │ │ -
│ │ │ │ -
198
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
203 {
│ │ │ │ -
204 return Node{&finiteElementMap_};
│ │ │ │ -
205 }
│ │ │ │ -
│ │ │ │ -
206
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
208 {
│ │ │ │ -
209 return dofsPerCodim_[0] * gridView_.size(0) + dofsPerCodim_[1] * gridView_.size(1); // only 2d
│ │ │ │ -
210 }
│ │ │ │ -
│ │ │ │ -
211
│ │ │ │ -
213 template<class SizePrefix>
│ │ │ │ -
│ │ │ │ -
214 size_type size(const SizePrefix prefix) const
│ │ │ │ -
215 {
│ │ │ │ -
216 assert(prefix.size() == 0 || prefix.size() == 1);
│ │ │ │ -
217 return (prefix.size() == 0) ? size() : 0;
│ │ │ │ -
218 }
│ │ │ │ +
162 template<class To, class From>
│ │ │ │ +
│ │ │ │ +
163 void assignWith(To& to, const From& from) const
│ │ │ │ +
164 {
│ │ │ │ +
165 auto from_flat = flatVectorView(from);
│ │ │ │ +
166 auto to_flat = flatVectorView(to);
│ │ │ │ +
167 assert(from_flat.size() == to_flat.size());
│ │ │ │ +
168 for (size_type i = 0; i < to_flat.size(); ++i)
│ │ │ │ +
169 to_flat[i] = from_flat[i];
│ │ │ │ +
170 }
│ │ │ │ +
│ │ │ │ +
171
│ │ │ │ +
172 template<class Node, class TreePath, class Range>
│ │ │ │ +
│ │ │ │ +
173 decltype(auto) nodeToRangeEntry(const Node& node, const TreePath& treePath, Range& y) const
│ │ │ │ +
174 {
│ │ │ │ +
175 return (*data_->nodeToRangeEntry)(node, treePath, y);
│ │ │ │ +
176 }
│ │ │ │ +
│ │ │ │ +
177
│ │ │ │ +
178 std::shared_ptr<const Data> data_;
│ │ │ │ +
179 LocalView localView_;
│ │ │ │ +
180 std::vector<Coefficient> localDoFs_;
│ │ │ │ +
181 };
│ │ │ │ +
│ │ │ │ +
182
│ │ │ │ +
183protected:
│ │ │ │ +
│ │ │ │ +
184 DiscreteGlobalBasisFunctionBase(const std::shared_ptr<const Data>& data)
│ │ │ │ +
185 : data_(data)
│ │ │ │ +
186 {
│ │ │ │ +
187 /* Nothing. */
│ │ │ │ +
188 }
│ │ │ │ +
│ │ │ │ +
189
│ │ │ │ +
190public:
│ │ │ │ +
191
│ │ │ │ +
│ │ │ │ +
193 const Basis& basis() const
│ │ │ │ +
194 {
│ │ │ │ +
195 return *data_->basis;
│ │ │ │ +
196 }
│ │ │ │ +
│ │ │ │ +
197
│ │ │ │ +
│ │ │ │ +
199 const Vector& dofs() const
│ │ │ │ +
200 {
│ │ │ │ +
201 return *data_->coefficients;
│ │ │ │ +
202 }
│ │ │ │ +
│ │ │ │ +
203
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
206 {
│ │ │ │ +
207 return *data_->nodeToRangeEntry;
│ │ │ │ +
208 }
│ │ │ │ +
│ │ │ │ +
209
│ │ │ │ +
│ │ │ │ +
211 const EntitySet& entitySet() const
│ │ │ │ +
212 {
│ │ │ │ +
213 return data_->entitySet;
│ │ │ │ +
214 }
│ │ │ │ +
│ │ │ │ +
215
│ │ │ │ +
216protected:
│ │ │ │ +
217 std::shared_ptr<const Data> data_;
│ │ │ │ +
218};
│ │ │ │
│ │ │ │
219
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
222 {
│ │ │ │ -
223 return size();
│ │ │ │ -
224 }
│ │ │ │ -
│ │ │ │ -
225
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
227 {
│ │ │ │ -
228 // The implementation currently only supports grids with a single element type.
│ │ │ │ -
229 // We can therefore return the actual number of dofs here.
│ │ │ │ -
230 GeometryType elementType = *(gridView_.indexSet().types(0).begin());
│ │ │ │ -
231 size_t numFaces = ReferenceElements<double,dim>::general(elementType).size(1);
│ │ │ │ -
232 return dofsPerCodim_[0] + dofsPerCodim_[1] * numFaces;
│ │ │ │ -
233 }
│ │ │ │ -
│ │ │ │ -
234
│ │ │ │ -
240 template<typename It>
│ │ │ │ -
│ │ │ │ -
241 It indices(const Node& node, It it) const
│ │ │ │ -
242 {
│ │ │ │ -
243 const auto& gridIndexSet = gridView().indexSet();
│ │ │ │ -
244 const auto& element = node.element();
│ │ │ │ -
245
│ │ │ │ -
246 // throw if element is not of predefined type
│ │ │ │ -
247 if (not(element.type().isCube()) and not(element.type().isSimplex()))
│ │ │ │ -
248 DUNE_THROW(Dune::NotImplemented, "BrezziDouglasMariniBasis only implemented for cube and simplex elements.");
│ │ │ │ -
249
│ │ │ │ -
250 for(std::size_t i=0, end=node.size(); i<end; ++i, ++it)
│ │ │ │ -
251 {
│ │ │ │ -
252 Dune::LocalKey localKey = node.finiteElement().localCoefficients().localKey(i);
│ │ │ │ -
253
│ │ │ │ -
254 // The dimension of the entity that the current dof is related to
│ │ │ │ -
255 size_t subentity = localKey.subEntity();
│ │ │ │ -
256 size_t codim = localKey.codim();
│ │ │ │ -
257
│ │ │ │ -
258 *it = { codimOffset_[codim] +
│ │ │ │ -
259 dofsPerCodim_[codim] * gridIndexSet.subIndex(element, subentity, codim) + localKey.index() };
│ │ │ │ -
260 }
│ │ │ │ -
261
│ │ │ │ -
262 return it;
│ │ │ │ -
263 }
│ │ │ │ -
│ │ │ │ -
264
│ │ │ │ -
265protected:
│ │ │ │ - │ │ │ │ -
267 std::array<size_t,dim+1> codimOffset_;
│ │ │ │ -
268 FiniteElementMap finiteElementMap_;
│ │ │ │ -
269 // Number of dofs per entity type depending on the entity's codimension and type
│ │ │ │ -
270 std::array<int,2> dofsPerCodim_ {{dim*(k-1)*3, dim+(k-1)}};
│ │ │ │ -
271};
│ │ │ │ +
220} // namespace ImplDoc
│ │ │ │
│ │ │ │ +
221
│ │ │ │ +
222
│ │ │ │ +
223
│ │ │ │ +
224template<typename DGBF>
│ │ │ │ + │ │ │ │ +
226
│ │ │ │ +
264template<typename B, typename V,
│ │ │ │ +
265 typename NTRE = HierarchicNodeToRangeMap,
│ │ │ │ +
266 typename R = typename V::value_type>
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ +
269{
│ │ │ │ + │ │ │ │ +
271 using Data = typename Base::Data;
│ │ │ │
272
│ │ │ │ -
273
│ │ │ │ -
274
│ │ │ │ -
275template<typename GV, int k>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
277 public LeafBasisNode
│ │ │ │ -
278{
│ │ │ │ -
279 static const int dim = GV::dimension;
│ │ │ │ -
280
│ │ │ │ -
281public:
│ │ │ │ -
282
│ │ │ │ -
283 using size_type = std::size_t;
│ │ │ │ -
284 using Element = typename GV::template Codim<0>::Entity;
│ │ │ │ -
285 using FiniteElementMap = typename Impl::BDMLocalFiniteElementMap<GV, dim, double, k>;
│ │ │ │ -
286 using FiniteElement = Impl::GlobalValuedLocalFiniteElement<Impl::ContravariantPiolaTransformator,
│ │ │ │ -
287 typename FiniteElementMap::FiniteElement,
│ │ │ │ -
288 Element>;
│ │ │ │ +
273public:
│ │ │ │ +
274 using Basis = typename Base::Basis;
│ │ │ │ +
275 using Vector = typename Base::Vector;
│ │ │ │ +
276
│ │ │ │ +
277 using Domain = typename Base::Domain;
│ │ │ │ +
278 using Range = R;
│ │ │ │ +
279
│ │ │ │ +
280 using Traits = Imp::GridFunctionTraits<Range(Domain), typename Base::EntitySet, DefaultDerivativeTraits, 16>;
│ │ │ │ +
281
│ │ │ │ +
282private:
│ │ │ │ +
283
│ │ │ │ +
284 template<class Node>
│ │ │ │ +
285 using LocalBasisRange = typename Node::FiniteElement::Traits::LocalBasisType::Traits::RangeType;
│ │ │ │ +
286 template<class Node>
│ │ │ │ +
287 using NodeData = typename std::vector<LocalBasisRange<Node>>;
│ │ │ │ +
288 using PerNodeEvaluationBuffer = typename TypeTree::TreeContainer<NodeData, typename Base::Tree>;
│ │ │ │
289
│ │ │ │ -
│ │ │ │ -
290 BrezziDouglasMariniNode(const FiniteElementMap* finiteElementMap) :
│ │ │ │ -
291 element_(nullptr),
│ │ │ │ -
292 finiteElementMap_(finiteElementMap)
│ │ │ │ -
293 {}
│ │ │ │ -
│ │ │ │ -
294
│ │ │ │ -
│ │ │ │ -
296 const Element& element() const
│ │ │ │ -
297 {
│ │ │ │ -
298 return *element_;
│ │ │ │ -
299 }
│ │ │ │ -
│ │ │ │ -
300
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
306 {
│ │ │ │ -
307 return finiteElement_;
│ │ │ │ -
308 }
│ │ │ │ -
│ │ │ │ -
309
│ │ │ │ -
│ │ │ │ -
311 void bind(const Element& e)
│ │ │ │ -
312 {
│ │ │ │ -
313 element_ = &e;
│ │ │ │ -
314 finiteElement_.bind((finiteElementMap_->find(*element_)), e);
│ │ │ │ -
315 this->setSize(finiteElement_.size());
│ │ │ │ -
316 }
│ │ │ │ -
│ │ │ │ -
317
│ │ │ │ -
318protected:
│ │ │ │ -
319
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
323};
│ │ │ │ -
│ │ │ │ -
324
│ │ │ │ -
325
│ │ │ │ +
290public:
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ +
293 {
│ │ │ │ +
294 using LocalBase = typename Base::LocalFunctionBase;
│ │ │ │ +
295 using size_type = typename Base::Tree::size_type;
│ │ │ │ +
296 using LocalBase::nodeToRangeEntry;
│ │ │ │ +
297
│ │ │ │ +
298 public:
│ │ │ │ +
299
│ │ │ │ + │ │ │ │ +
301 using Domain = typename LocalBase::Domain;
│ │ │ │ + │ │ │ │ +
303 using Element = typename LocalBase::Element;
│ │ │ │ +
304
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
307 : LocalBase(globalFunction.data_)
│ │ │ │ +
308 , evaluationBuffer_(this->localView_.tree())
│ │ │ │ +
309 {
│ │ │ │ +
310 /* Nothing. */
│ │ │ │ +
311 }
│ │ │ │ +
│ │ │ │ +
312
│ │ │ │ +
│ │ │ │ +
322 Range operator()(const Domain& x) const
│ │ │ │ +
323 {
│ │ │ │ +
324 Range y;
│ │ │ │ +
325 istlVectorBackend(y) = 0;
│ │ │ │
326
│ │ │ │ -
327namespace BasisFactory {
│ │ │ │ -
328
│ │ │ │ -
336template<std::size_t k>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
338{
│ │ │ │ -
339 return [](const auto& gridView) {
│ │ │ │ -
340 return BrezziDouglasMariniPreBasis<std::decay_t<decltype(gridView)>, k>(gridView);
│ │ │ │ -
341 };
│ │ │ │ -
342}
│ │ │ │ -
│ │ │ │ -
343
│ │ │ │ -
344} // end namespace BasisFactory
│ │ │ │ -
345
│ │ │ │ -
346
│ │ │ │ -
347
│ │ │ │ -
348// *****************************************************************************
│ │ │ │ -
349// This is the actual global basis implementation based on the reusable parts.
│ │ │ │ -
350// *****************************************************************************
│ │ │ │ -
351
│ │ │ │ -
359template<typename GV, int k>
│ │ │ │ - │ │ │ │ -
361
│ │ │ │ -
362} // end namespace Functions
│ │ │ │ -
363} // end namespace Dune
│ │ │ │ -
364
│ │ │ │ +
327 TypeTree::forEachLeafNode(this->localView_.tree(), [&](auto&& node, auto&& treePath) {
│ │ │ │ +
328 const auto& fe = node.finiteElement();
│ │ │ │ +
329 const auto& localBasis = fe.localBasis();
│ │ │ │ +
330 auto& shapeFunctionValues = evaluationBuffer_[treePath];
│ │ │ │ +
331
│ │ │ │ +
332 localBasis.evaluateFunction(x, shapeFunctionValues);
│ │ │ │ +
333
│ │ │ │ +
334 // Compute linear combinations of basis function jacobian.
│ │ │ │ +
335 // Non-scalar coefficients of dimension coeffDim are handled by
│ │ │ │ +
336 // processing the coeffDim linear combinations independently
│ │ │ │ +
337 // and storing them as entries of an array.
│ │ │ │ +
338 using Value = LocalBasisRange< std::decay_t<decltype(node)> >;
│ │ │ │ +
339 static constexpr auto coeffDim = decltype(flatVectorView(this->localDoFs_[node.localIndex(0)]).size())::value;
│ │ │ │ +
340 auto values = std::array<Value, coeffDim>{};
│ │ │ │ +
341 istlVectorBackend(values) = 0;
│ │ │ │ +
342 for (size_type i = 0; i < localBasis.size(); ++i)
│ │ │ │ +
343 {
│ │ │ │ +
344 auto c = flatVectorView(this->localDoFs_[node.localIndex(i)]);
│ │ │ │ +
345 for (std::size_t j = 0; j < coeffDim; ++j)
│ │ │ │ +
346 values[j].axpy(c[j], shapeFunctionValues[i]);
│ │ │ │ +
347 }
│ │ │ │ +
348
│ │ │ │ +
349 // Assign computed values to node entry of range.
│ │ │ │ +
350 // Types are matched using the lexicographic ordering provided by flatVectorView.
│ │ │ │ +
351 LocalBase::assignWith(nodeToRangeEntry(node, treePath, y), values);
│ │ │ │ +
352 });
│ │ │ │ +
353
│ │ │ │ +
354 return y;
│ │ │ │ +
355 }
│ │ │ │ +
│ │ │ │ +
356
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
359 {
│ │ │ │ + │ │ │ │ +
361 if (lf.bound())
│ │ │ │ +
362 dlf.bind(lf.localContext());
│ │ │ │ +
363 return dlf;
│ │ │ │ +
364 }
│ │ │ │ +
│ │ │ │
365
│ │ │ │ -
366#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:337
│ │ │ │ +
366 private:
│ │ │ │ +
367 mutable PerNodeEvaluationBuffer evaluationBuffer_;
│ │ │ │ +
368 };
│ │ │ │ +
│ │ │ │ +
369
│ │ │ │ +
371 template<class B_T, class V_T, class NTRE_T>
│ │ │ │ +
│ │ │ │ +
372 DiscreteGlobalBasisFunction(B_T && basis, V_T && coefficients, NTRE_T&& nodeToRangeEntry)
│ │ │ │ +
373 : 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))}))
│ │ │ │ +
374 {}
│ │ │ │ +
│ │ │ │ +
375
│ │ │ │ +
│ │ │ │ +
377 DiscreteGlobalBasisFunction(std::shared_ptr<const Basis> basis, std::shared_ptr<const V> coefficients, std::shared_ptr<const typename Base::NodeToRangeEntry> nodeToRangeEntry)
│ │ │ │ +
378 : Base(std::make_shared<Data>(Data{{basis->gridView()}, basis, coefficients, nodeToRangeEntry}))
│ │ │ │ +
379 {}
│ │ │ │ +
│ │ │ │ +
380
│ │ │ │ +
│ │ │ │ +
382 Range operator() (const Domain& x) const
│ │ │ │ +
383 {
│ │ │ │ +
384 // TODO: Implement this using hierarchic search
│ │ │ │ +
385 DUNE_THROW(NotImplemented,"not implemented");
│ │ │ │ +
386 }
│ │ │ │ +
│ │ │ │ +
387
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
390 {
│ │ │ │ + │ │ │ │ +
392 }
│ │ │ │ +
│ │ │ │ +
393
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
403 {
│ │ │ │ +
404 return LocalFunction(t);
│ │ │ │ +
405 }
│ │ │ │ +
│ │ │ │ +
406};
│ │ │ │ +
│ │ │ │ +
407
│ │ │ │ +
408
│ │ │ │ +
431template<typename R, typename B, typename V>
│ │ │ │ +
│ │ │ │ +
432auto makeDiscreteGlobalBasisFunction(B&& basis, V&& vector)
│ │ │ │ +
433{
│ │ │ │ +
434 using Basis = std::decay_t<B>;
│ │ │ │ +
435 using NTREM = HierarchicNodeToRangeMap;
│ │ │ │ +
436
│ │ │ │ +
437 // Small helper functions to wrap vectors using istlVectorBackend
│ │ │ │ +
438 // if they do not already satisfy the VectorBackend interface.
│ │ │ │ +
439 auto toConstVectorBackend = [&](auto&& v) -> decltype(auto) {
│ │ │ │ +
440 if constexpr (models<Concept::ConstVectorBackend<Basis>, decltype(v)>()) {
│ │ │ │ +
441 return std::forward<decltype(v)>(v);
│ │ │ │ +
442 } else {
│ │ │ │ +
443 return istlVectorBackend(v);
│ │ │ │ +
444 }
│ │ │ │ +
445 };
│ │ │ │ +
446
│ │ │ │ +
447 using Vector = std::decay_t<decltype(toConstVectorBackend(std::forward<V>(vector)))>;
│ │ │ │ + │ │ │ │ +
449 std::forward<B>(basis),
│ │ │ │ +
450 toConstVectorBackend(std::forward<V>(vector)),
│ │ │ │ + │ │ │ │ +
452}
│ │ │ │ +
│ │ │ │ +
453
│ │ │ │ +
454
│ │ │ │ +
469template<typename DGBF>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
471 : public ImplDoc::DiscreteGlobalBasisFunctionBase<typename DGBF::Basis, typename DGBF::Vector, typename DGBF::NodeToRangeEntry>
│ │ │ │ +
472{
│ │ │ │ + │ │ │ │ +
474 using Data = typename Base::Data;
│ │ │ │ +
475
│ │ │ │ +
476public:
│ │ │ │ + │ │ │ │ +
478
│ │ │ │ +
479 using Basis = typename Base::Basis;
│ │ │ │ +
480 using Vector = typename Base::Vector;
│ │ │ │ +
481
│ │ │ │ +
482 using Domain = typename Base::Domain;
│ │ │ │ + │ │ │ │ +
484
│ │ │ │ +
485 using Traits = Imp::GridFunctionTraits<Range(Domain), typename Base::EntitySet, DefaultDerivativeTraits, 16>;
│ │ │ │ +
486
│ │ │ │ +
487private:
│ │ │ │ +
488
│ │ │ │ +
489 template<class Node>
│ │ │ │ +
490 using LocalBasisRange = typename Node::FiniteElement::Traits::LocalBasisType::Traits::JacobianType;
│ │ │ │ +
491 template<class Node>
│ │ │ │ +
492 using NodeData = typename std::vector< LocalBasisRange<Node> >;
│ │ │ │ +
493 using PerNodeEvaluationBuffer = typename TypeTree::TreeContainer<NodeData, typename Base::Tree>;
│ │ │ │ +
494
│ │ │ │ +
495public:
│ │ │ │ +
496
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ +
506 {
│ │ │ │ +
507 using LocalBase = typename Base::LocalFunctionBase;
│ │ │ │ +
508 using size_type = typename Base::Tree::size_type;
│ │ │ │ +
509 using LocalBase::nodeToRangeEntry;
│ │ │ │ +
510
│ │ │ │ +
511 public:
│ │ │ │ + │ │ │ │ +
513 using Domain = typename LocalBase::Domain;
│ │ │ │ + │ │ │ │ +
515 using Element = typename LocalBase::Element;
│ │ │ │ +
516
│ │ │ │ +
│ │ │ │ +
518 LocalFunction(const GlobalFunction& globalFunction)
│ │ │ │ +
519 : LocalBase(globalFunction.data_)
│ │ │ │ +
520 , evaluationBuffer_(this->localView_.tree())
│ │ │ │ +
521 {
│ │ │ │ +
522 /* Nothing. */
│ │ │ │ +
523 }
│ │ │ │ +
│ │ │ │ +
524
│ │ │ │ +
│ │ │ │ +
531 void bind(const Element& element)
│ │ │ │ +
532 {
│ │ │ │ +
533 LocalBase::bind(element);
│ │ │ │ +
534 geometry_.emplace(element.geometry());
│ │ │ │ +
535 }
│ │ │ │ +
│ │ │ │ +
536
│ │ │ │ +
│ │ │ │ +
538 void unbind()
│ │ │ │ +
539 {
│ │ │ │ +
540 geometry_.reset();
│ │ │ │ +
541 LocalBase::unbind();
│ │ │ │ +
542 }
│ │ │ │ +
│ │ │ │ +
543
│ │ │ │ +
│ │ │ │ +
557 Range operator()(const Domain& x) const
│ │ │ │ +
558 {
│ │ │ │ +
559 Range y;
│ │ │ │ +
560 istlVectorBackend(y) = 0;
│ │ │ │ +
561
│ │ │ │ +
562 const auto& jacobianInverse = geometry_->jacobianInverse(x);
│ │ │ │ +
563
│ │ │ │ +
564 TypeTree::forEachLeafNode(this->localView_.tree(), [&](auto&& node, auto&& treePath) {
│ │ │ │ +
565 const auto& fe = node.finiteElement();
│ │ │ │ +
566 const auto& localBasis = fe.localBasis();
│ │ │ │ +
567 auto& shapeFunctionJacobians = evaluationBuffer_[treePath];
│ │ │ │ +
568
│ │ │ │ +
569 localBasis.evaluateJacobian(x, shapeFunctionJacobians);
│ │ │ │ +
570
│ │ │ │ +
571 // Compute linear combinations of basis function jacobian.
│ │ │ │ +
572 // Non-scalar coefficients of dimension coeffDim are handled by
│ │ │ │ +
573 // processing the coeffDim linear combinations independently
│ │ │ │ +
574 // and storing them as entries of an array.
│ │ │ │ +
575 using RefJacobian = LocalBasisRange< std::decay_t<decltype(node)> >;
│ │ │ │ +
576 static constexpr auto coeffDim = decltype(flatVectorView(this->localDoFs_[node.localIndex(0)]).size())::value;
│ │ │ │ +
577 auto refJacobians = std::array<RefJacobian, coeffDim>{};
│ │ │ │ +
578 istlVectorBackend(refJacobians) = 0;
│ │ │ │ +
579 for (size_type i = 0; i < localBasis.size(); ++i)
│ │ │ │ +
580 {
│ │ │ │ +
581 auto c = flatVectorView(this->localDoFs_[node.localIndex(i)]);
│ │ │ │ +
582 for (std::size_t j = 0; j < coeffDim; ++j)
│ │ │ │ +
583 refJacobians[j].axpy(c[j], shapeFunctionJacobians[i]);
│ │ │ │ +
584 }
│ │ │ │ +
585
│ │ │ │ +
586 // Transform Jacobians form local to global coordinates.
│ │ │ │ +
587 using Jacobian = decltype(refJacobians[0] * jacobianInverse);
│ │ │ │ +
588 auto jacobians = std::array<Jacobian, coeffDim>{};
│ │ │ │ +
589 std::transform(
│ │ │ │ +
590 refJacobians.begin(), refJacobians.end(), jacobians.begin(),
│ │ │ │ +
591 [&](const auto& refJacobian) { return refJacobian * jacobianInverse; });
│ │ │ │ +
592
│ │ │ │ +
593 // Assign computed Jacobians to node entry of range.
│ │ │ │ +
594 // Types are matched using the lexicographic ordering provided by flatVectorView.
│ │ │ │ +
595 LocalBase::assignWith(nodeToRangeEntry(node, treePath, y), jacobians);
│ │ │ │ +
596 });
│ │ │ │ +
597
│ │ │ │ +
598 return y;
│ │ │ │ +
599 }
│ │ │ │ +
│ │ │ │ +
600
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
603 {
│ │ │ │ +
604 DUNE_THROW(NotImplemented, "derivative of derivative is not implemented");
│ │ │ │ +
605 }
│ │ │ │ +
│ │ │ │ +
606
│ │ │ │ +
607 private:
│ │ │ │ +
608 mutable PerNodeEvaluationBuffer evaluationBuffer_;
│ │ │ │ +
609 std::optional<typename Element::Geometry> geometry_;
│ │ │ │ +
610 };
│ │ │ │ +
│ │ │ │ +
611
│ │ │ │ +
│ │ │ │ +
618 DiscreteGlobalBasisFunctionDerivative(const std::shared_ptr<const Data>& data)
│ │ │ │ +
619 : Base(data)
│ │ │ │ +
620 {
│ │ │ │ +
621 /* Nothing. */
│ │ │ │ +
622 }
│ │ │ │ +
│ │ │ │ +
623
│ │ │ │ +
│ │ │ │ +
625 Range operator()(const Domain& x) const
│ │ │ │ +
626 {
│ │ │ │ +
627 // TODO: Implement this using hierarchic search
│ │ │ │ +
628 DUNE_THROW(NotImplemented,"not implemented");
│ │ │ │ +
629 }
│ │ │ │ +
│ │ │ │ +
630
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
632 {
│ │ │ │ +
633 DUNE_THROW(NotImplemented, "derivative of derivative is not implemented");
│ │ │ │ +
634 }
│ │ │ │ +
│ │ │ │ +
635
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
638 {
│ │ │ │ +
639 return LocalFunction(f);
│ │ │ │ +
640 }
│ │ │ │ +
│ │ │ │ +
641};
│ │ │ │ +
│ │ │ │ +
642
│ │ │ │ +
643
│ │ │ │ +
644} // namespace Functions
│ │ │ │ +
645} // namespace Dune
│ │ │ │ +
646
│ │ │ │ +
647#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
auto makeDiscreteGlobalBasisFunction(B &&basis, V &&vector)
Generate a DiscreteGlobalBasisFunction.
Definition discreteglobalbasisfunction.hh:432
│ │ │ │ +
auto istlVectorBackend(Vector &v)
Return a vector backend wrapping non-const ISTL like containers.
Definition istlvectorbackend.hh:346
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
Definition brezzidouglasmarinibasis.hh:278
│ │ │ │ -
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition brezzidouglasmarinibasis.hh:305
│ │ │ │ -
typename GV::template Codim< 0 >::Entity Element
Definition brezzidouglasmarinibasis.hh:284
│ │ │ │ -
const FiniteElementMap * finiteElementMap_
Definition brezzidouglasmarinibasis.hh:322
│ │ │ │ -
std::size_t size_type
Definition brezzidouglasmarinibasis.hh:283
│ │ │ │ -
FiniteElement finiteElement_
Definition brezzidouglasmarinibasis.hh:320
│ │ │ │ -
typename Impl::BDMLocalFiniteElementMap< GV, dim, double, k > FiniteElementMap
Definition brezzidouglasmarinibasis.hh:285
│ │ │ │ -
const Element * element_
Definition brezzidouglasmarinibasis.hh:321
│ │ │ │ -
Impl::GlobalValuedLocalFiniteElement< Impl::ContravariantPiolaTransformator, typename FiniteElementMap::FiniteElement, Element > FiniteElement
Definition brezzidouglasmarinibasis.hh:288
│ │ │ │ -
void bind(const Element &e)
Bind to element.
Definition brezzidouglasmarinibasis.hh:311
│ │ │ │ -
BrezziDouglasMariniNode(const FiniteElementMap *finiteElementMap)
Definition brezzidouglasmarinibasis.hh:290
│ │ │ │ -
const Element & element() const
Return current element, throw if unbound.
Definition brezzidouglasmarinibasis.hh:296
│ │ │ │ -
Definition brezzidouglasmarinibasis.hh:152
│ │ │ │ -
std::size_t size_type
Definition brezzidouglasmarinibasis.hh:160
│ │ │ │ -
std::array< int, 2 > dofsPerCodim_
Definition brezzidouglasmarinibasis.hh:270
│ │ │ │ -
size_type dimension() const
Definition brezzidouglasmarinibasis.hh:221
│ │ │ │ -
static constexpr size_type minMultiIndexSize
Definition brezzidouglasmarinibasis.hh:165
│ │ │ │ -
static constexpr size_type maxMultiIndexSize
Definition brezzidouglasmarinibasis.hh:164
│ │ │ │ -
std::array< size_t, dim+1 > codimOffset_
Definition brezzidouglasmarinibasis.hh:267
│ │ │ │ -
size_type size(const SizePrefix prefix) const
Return number possible values for next position in multi index.
Definition brezzidouglasmarinibasis.hh:214
│ │ │ │ -
Node makeNode() const
Create tree node.
Definition brezzidouglasmarinibasis.hh:202
│ │ │ │ -
GV GridView
The grid view that the FE space is defined on.
Definition brezzidouglasmarinibasis.hh:159
│ │ │ │ -
BrezziDouglasMariniPreBasis(const GridView &gv)
Constructor for a given grid view object.
Definition brezzidouglasmarinibasis.hh:169
│ │ │ │ -
FiniteElementMap finiteElementMap_
Definition brezzidouglasmarinibasis.hh:268
│ │ │ │ -
void update(const GridView &gv)
Definition brezzidouglasmarinibasis.hh:194
│ │ │ │ -
void initializeIndices()
Definition brezzidouglasmarinibasis.hh:179
│ │ │ │ -
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition brezzidouglasmarinibasis.hh:188
│ │ │ │ -
size_type size() const
Definition brezzidouglasmarinibasis.hh:207
│ │ │ │ -
static constexpr size_type multiIndexBufferSize
Definition brezzidouglasmarinibasis.hh:166
│ │ │ │ -
size_type maxNodeSize() const
Definition brezzidouglasmarinibasis.hh:226
│ │ │ │ -
GridView gridView_
Definition brezzidouglasmarinibasis.hh:266
│ │ │ │ -
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 brezzidouglasmarinibasis.hh:241
│ │ │ │ -
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:46
│ │ │ │ -
size_type size() const
Definition nodes.hh:142
│ │ │ │ -
void setSize(const size_type size)
Definition nodes.hh:164
│ │ │ │ -
Definition nodes.hh:186
│ │ │ │ +
auto flatVectorView(T &t)
Create flat vector view of passed mutable container.
Definition flatvectorview.hh:179
│ │ │ │ +
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:37
│ │ │ │ +
Helper class to deduce the signature of a callable.
Definition signature.hh:56
│ │ │ │ +
A simple node to range map using the nested tree indices.
Definition hierarchicnodetorangemap.hh:30
│ │ │ │ +
Definition discreteglobalbasisfunction.hh:28
│ │ │ │ +
std::shared_ptr< const Data > data_
Definition discreteglobalbasisfunction.hh:217
│ │ │ │ +
const Vector & dofs() const
Return the coefficients of this discrete function by reference.
Definition discreteglobalbasisfunction.hh:199
│ │ │ │ +
B Basis
Definition discreteglobalbasisfunction.hh:30
│ │ │ │ +
typename Basis::LocalView::Tree Tree
Definition discreteglobalbasisfunction.hh:39
│ │ │ │ +
V Vector
Definition discreteglobalbasisfunction.hh:31
│ │ │ │ +
typename EntitySet::Element Element
Definition discreteglobalbasisfunction.hh:45
│ │ │ │ +
typename EntitySet::LocalCoordinate LocalDomain
Definition discreteglobalbasisfunction.hh:44
│ │ │ │ +
const NodeToRangeEntry & nodeToRangeEntry() const
Return the stored node-to-range map.
Definition discreteglobalbasisfunction.hh:205
│ │ │ │ +
NTRE NodeToRangeEntry
Definition discreteglobalbasisfunction.hh:40
│ │ │ │ +
DiscreteGlobalBasisFunctionBase(const std::shared_ptr< const Data > &data)
Definition discreteglobalbasisfunction.hh:184
│ │ │ │ +
typename Basis::GridView GridView
Definition discreteglobalbasisfunction.hh:37
│ │ │ │ +
const Basis & basis() const
Return a const reference to the stored basis.
Definition discreteglobalbasisfunction.hh:193
│ │ │ │ +
GridViewEntitySet< GridView, 0 > EntitySet
Definition discreteglobalbasisfunction.hh:38
│ │ │ │ +
const EntitySet & entitySet() const
Get associated set of entities the local-function can be bound to.
Definition discreteglobalbasisfunction.hh:211
│ │ │ │ +
typename EntitySet::GlobalCoordinate Domain
Definition discreteglobalbasisfunction.hh:42
│ │ │ │ +
Dune::AutonomousValue< decltype(std::declval< Vector >()[std::declval< typename Basis::MultiIndex >()])> Coefficient
Definition discreteglobalbasisfunction.hh:35
│ │ │ │ +
Definition discreteglobalbasisfunction.hh:53
│ │ │ │ +
EntitySet entitySet
Definition discreteglobalbasisfunction.hh:54
│ │ │ │ +
std::shared_ptr< const NodeToRangeEntry > nodeToRangeEntry
Definition discreteglobalbasisfunction.hh:57
│ │ │ │ +
std::shared_ptr< const Basis > basis
Definition discreteglobalbasisfunction.hh:55
│ │ │ │ +
std::shared_ptr< const Vector > coefficients
Definition discreteglobalbasisfunction.hh:56
│ │ │ │ + │ │ │ │ +
LocalFunctionBase & operator=(const LocalFunctionBase &other)
Copy-assignment of the local-function.
Definition discreteglobalbasisfunction.hh:100
│ │ │ │ +
bool bound() const
Check if LocalFunction is already bound to an element.
Definition discreteglobalbasisfunction.hh:149
│ │ │ │ +
void bind(const Element &element)
Bind LocalFunction to grid element.
Definition discreteglobalbasisfunction.hh:116
│ │ │ │ +
typename EntitySet::Element Element
Definition discreteglobalbasisfunction.hh:68
│ │ │ │ +
const Element & localContext() const
Return the element the local-function is bound to.
Definition discreteglobalbasisfunction.hh:155
│ │ │ │ +
LocalFunctionBase(const LocalFunctionBase &other)
Copy-construct the local-function.
Definition discreteglobalbasisfunction.hh:84
│ │ │ │ +
std::vector< Coefficient > localDoFs_
Definition discreteglobalbasisfunction.hh:180
│ │ │ │ +
void assignWith(To &to, const From &from) const
Definition discreteglobalbasisfunction.hh:163
│ │ │ │ +
std::shared_ptr< const Data > data_
Definition discreteglobalbasisfunction.hh:178
│ │ │ │ +
decltype(auto) nodeToRangeEntry(const Node &node, const TreePath &treePath, Range &y) const
Definition discreteglobalbasisfunction.hh:173
│ │ │ │ +
LocalView localView_
Definition discreteglobalbasisfunction.hh:179
│ │ │ │ +
void unbind()
Unbind the local-function.
Definition discreteglobalbasisfunction.hh:143
│ │ │ │ +
LocalDomain Domain
Definition discreteglobalbasisfunction.hh:67
│ │ │ │ +
LocalFunctionBase(const std::shared_ptr< const Data > &data)
Definition discreteglobalbasisfunction.hh:71
│ │ │ │ +
Derivative of a DiscreteGlobalBasisFunction
Definition discreteglobalbasisfunction.hh:472
│ │ │ │ +
typename Base::Basis Basis
Definition discreteglobalbasisfunction.hh:479
│ │ │ │ +
friend Traits::DerivativeInterface derivative(const DiscreteGlobalBasisFunctionDerivative &f)
Definition discreteglobalbasisfunction.hh:631
│ │ │ │ +
Range operator()(const Domain &x) const
Not implemented.
Definition discreteglobalbasisfunction.hh:625
│ │ │ │ +
typename SignatureTraits< typename DiscreteGlobalBasisFunction::Traits::DerivativeInterface >::Range Range
Definition discreteglobalbasisfunction.hh:483
│ │ │ │ +
friend LocalFunction localFunction(const DiscreteGlobalBasisFunctionDerivative &f)
Construct local function from a DiscreteGlobalBasisFunctionDerivative
Definition discreteglobalbasisfunction.hh:637
│ │ │ │ +
DiscreteGlobalBasisFunctionDerivative(const std::shared_ptr< const Data > &data)
create object from DiscreateGlobalBasisFunction data
Definition discreteglobalbasisfunction.hh:618
│ │ │ │ +
DGBF DiscreteGlobalBasisFunction
Definition discreteglobalbasisfunction.hh:477
│ │ │ │ +
typename Base::Vector Vector
Definition discreteglobalbasisfunction.hh:480
│ │ │ │ +
Imp::GridFunctionTraits< Range(Domain), typename Base::EntitySet, DefaultDerivativeTraits, 16 > Traits
Definition discreteglobalbasisfunction.hh:485
│ │ │ │ +
typename Base::Domain Domain
Definition discreteglobalbasisfunction.hh:482
│ │ │ │ +
A grid function induced by a global basis and a coefficient vector.
Definition discreteglobalbasisfunction.hh:269
│ │ │ │ +
friend DiscreteGlobalBasisFunctionDerivative< DiscreteGlobalBasisFunction > derivative(const DiscreteGlobalBasisFunction &f)
Derivative of the DiscreteGlobalBasisFunction
Definition discreteglobalbasisfunction.hh:389
│ │ │ │ +
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:372
│ │ │ │ +
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:377
│ │ │ │ +
friend LocalFunction localFunction(const DiscreteGlobalBasisFunction &t)
Construct local function from a DiscreteGlobalBasisFunction.
Definition discreteglobalbasisfunction.hh:402
│ │ │ │ +
typename Base::Basis Basis
Definition discreteglobalbasisfunction.hh:274
│ │ │ │ +
Imp::GridFunctionTraits< Range(Domain), typename Base::EntitySet, DefaultDerivativeTraits, 16 > Traits
Definition discreteglobalbasisfunction.hh:280
│ │ │ │ +
R Range
Definition discreteglobalbasisfunction.hh:278
│ │ │ │ +
typename Base::Vector Vector
Definition discreteglobalbasisfunction.hh:275
│ │ │ │ +
typename Base::Domain Domain
Definition discreteglobalbasisfunction.hh:277
│ │ │ │ +
Definition discreteglobalbasisfunction.hh:293
│ │ │ │ +
GlobalFunction::Range Range
Definition discreteglobalbasisfunction.hh:302
│ │ │ │ +
typename LocalBase::Domain Domain
Definition discreteglobalbasisfunction.hh:301
│ │ │ │ +
LocalFunction(const DiscreteGlobalBasisFunction &globalFunction)
Create a local-function from the associated grid-function.
Definition discreteglobalbasisfunction.hh:306
│ │ │ │ +
friend DiscreteGlobalBasisFunctionDerivative< DiscreteGlobalBasisFunction >::LocalFunction derivative(const LocalFunction &lf)
Local function of the derivative.
Definition discreteglobalbasisfunction.hh:358
│ │ │ │ +
Range operator()(const Domain &x) const
Evaluate this local-function in coordinates x in the bound element.
Definition discreteglobalbasisfunction.hh:322
│ │ │ │ +
typename LocalBase::Element Element
Definition discreteglobalbasisfunction.hh:303
│ │ │ │ +
local function evaluating the derivative in reference coordinates
Definition discreteglobalbasisfunction.hh:506
│ │ │ │ +
Range operator()(const Domain &x) const
Evaluate this local-function in coordinates x in the bound element.
Definition discreteglobalbasisfunction.hh:557
│ │ │ │ +
typename LocalBase::Domain Domain
Definition discreteglobalbasisfunction.hh:513
│ │ │ │ +
typename LocalBase::Element Element
Definition discreteglobalbasisfunction.hh:515
│ │ │ │ +
friend Traits::LocalFunctionTraits::DerivativeInterface derivative(const LocalFunction &)
Not implemented.
Definition discreteglobalbasisfunction.hh:602
│ │ │ │ +
GlobalFunction::Range Range
Definition discreteglobalbasisfunction.hh:514
│ │ │ │ +
void unbind()
Unbind the local-function.
Definition discreteglobalbasisfunction.hh:538
│ │ │ │ +
LocalFunction(const GlobalFunction &globalFunction)
Create a local function from the associated grid function.
Definition discreteglobalbasisfunction.hh:518
│ │ │ │ +
void bind(const Element &element)
Bind LocalFunction to grid element.
Definition discreteglobalbasisfunction.hh:531
│ │ │ │ +
Definition gridfunction.hh:32
│ │ │ │ + │ │ │ │ +
GridView::template Codim< codim >::Entity Element
Type of Elements contained in this EntitySet.
Definition gridviewentityset.hh:32
│ │ │ │ +
Element::Geometry::LocalCoordinate LocalCoordinate
Type of local coordinates with respect to the Element.
Definition gridviewentityset.hh:35
│ │ │ │ +
Element::Geometry::GlobalCoordinate GlobalCoordinate
Definition gridviewentityset.hh:36
│ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,509 +1,853 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -brezzidouglasmarinibasis.hh │ │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BREZZIDOUGLASMARINIBASIS_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BREZZIDOUGLASMARINIBASIS_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ -8#include │ │ │ │ │ -9 │ │ │ │ │ -10#include │ │ │ │ │ -11#include │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ +8 │ │ │ │ │ +9#include │ │ │ │ │ +10 │ │ │ │ │ +11#include │ │ │ │ │ 12 │ │ │ │ │ -13#include │ │ │ │ │ -14#include │ │ │ │ │ -15#include │ │ │ │ │ -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_/ │ │ │ │ │ -_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> │ │ │ │ │ -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_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ │ +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_/_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> │ │ │ │ │ +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_/_f_l_a_t_v_e_c_t_o_r_v_i_e_w_._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_/_g_r_i_d_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_/_b_a_c_k_e_n_d_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ │ +18#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> │ │ │ │ │ +19 │ │ │ │ │ +20namespace _D_u_n_e { │ │ │ │ │ +21namespace Functions { │ │ │ │ │ 22 │ │ │ │ │ -23namespace _D_u_n_e { │ │ │ │ │ -24namespace Functions { │ │ │ │ │ +23 │ │ │ │ │ +_2_4namespace ImplDoc { │ │ │ │ │ 25 │ │ │ │ │ -26namespace Impl { │ │ │ │ │ -27 │ │ │ │ │ -28 template │ │ │ │ │ -29 struct BDMSimplexLocalInfo │ │ │ │ │ -30 { │ │ │ │ │ -31 static_assert((AlwaysFalse::value),"The requested type of BDM element is │ │ │ │ │ -not implemented, sorry!"); │ │ │ │ │ -32 }; │ │ │ │ │ -33 │ │ │ │ │ -34 template │ │ │ │ │ -35 struct BDMSimplexLocalInfo<2,D,R,1> │ │ │ │ │ -36 { │ │ │ │ │ -37 using FiniteElement = BDM1Simplex2DLocalFiniteElement; │ │ │ │ │ -38 static const std::size_t Variants = 8; │ │ │ │ │ -39 }; │ │ │ │ │ -40 │ │ │ │ │ -41 template │ │ │ │ │ -42 struct BDMSimplexLocalInfo<2,D,R,2> │ │ │ │ │ -43 { │ │ │ │ │ -44 using FiniteElement = BDM2Simplex2DLocalFiniteElement; │ │ │ │ │ -45 static const std::size_t Variants = 8; │ │ │ │ │ -46 }; │ │ │ │ │ -47 │ │ │ │ │ -48 template │ │ │ │ │ -49 struct BDMCubeLocalInfo │ │ │ │ │ -50 { │ │ │ │ │ -51 static_assert((AlwaysFalse::value),"The requested type of BDM element is │ │ │ │ │ -not implemented, sorry!"); │ │ │ │ │ -52 }; │ │ │ │ │ -53 │ │ │ │ │ -54 template │ │ │ │ │ -55 struct BDMCubeLocalInfo<2,D,R,1> │ │ │ │ │ -56 { │ │ │ │ │ -57 using FiniteElement = BDM1Cube2DLocalFiniteElement; │ │ │ │ │ -58 static const std::size_t Variants = 16; │ │ │ │ │ -59 }; │ │ │ │ │ -60 │ │ │ │ │ -61 template │ │ │ │ │ -62 struct BDMCubeLocalInfo<2,D,R,2> │ │ │ │ │ -63 { │ │ │ │ │ -64 using FiniteElement = BDM2Cube2DLocalFiniteElement; │ │ │ │ │ -65 static const std::size_t Variants = 16; │ │ │ │ │ -66 }; │ │ │ │ │ -67 │ │ │ │ │ -68 template │ │ │ │ │ -69 struct BDMCubeLocalInfo<3,D,R,1> │ │ │ │ │ -70 { │ │ │ │ │ -71 using FiniteElement = BDM1Cube3DLocalFiniteElement; │ │ │ │ │ -72 static const std::size_t Variants = 64; │ │ │ │ │ -73 }; │ │ │ │ │ -74 │ │ │ │ │ -75 template │ │ │ │ │ -76 class BDMLocalFiniteElementMap │ │ │ │ │ -77 { │ │ │ │ │ -78 using D = typename GV::ctype; │ │ │ │ │ -79 using CubeFiniteElement = typename BDMCubeLocalInfo:: │ │ │ │ │ -FiniteElement; │ │ │ │ │ -80 using SimplexFiniteElement = typename BDMSimplexLocalInfo:: │ │ │ │ │ -FiniteElement; │ │ │ │ │ -81 │ │ │ │ │ -82 public: │ │ │ │ │ -83 │ │ │ │ │ -84 using T = LocalBasisTraits, R, dim, │ │ │ │ │ -FieldVector, FieldMatrix >; │ │ │ │ │ -85 using FiniteElement = LocalFiniteElementVirtualInterface; │ │ │ │ │ -86 │ │ │ │ │ -87 BDMLocalFiniteElementMap(const GV& gv) │ │ │ │ │ -88 : is_(&(gv.indexSet())), orient_(gv.size(0)) │ │ │ │ │ -89 { │ │ │ │ │ -90 cubeVariant_.resize(BDMCubeLocalInfo::Variants); │ │ │ │ │ -91 simplexVariant_.resize(BDMSimplexLocalInfo::Variants); │ │ │ │ │ +26template │ │ │ │ │ +_2_7class _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 │ │ │ │ │ +28{ │ │ │ │ │ +29public: │ │ │ │ │ +_3_0 using _B_a_s_i_s = B; │ │ │ │ │ +_3_1 using _V_e_c_t_o_r = V; │ │ │ │ │ +32 │ │ │ │ │ +33 // In order to make the cache work for proxy-references │ │ │ │ │ +34 // we have to use AutonomousValue instead of std::decay_t │ │ │ │ │ +_3_5 using _C_o_e_f_f_i_c_i_e_n_t = Dune::AutonomousValue() │ │ │ │ │ +[std::declval()])>; │ │ │ │ │ +36 │ │ │ │ │ +_3_7 using _G_r_i_d_V_i_e_w = typename Basis::GridView; │ │ │ │ │ +_3_8 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_>; │ │ │ │ │ +_3_9 using _T_r_e_e = typename Basis::LocalView::Tree; │ │ │ │ │ +_4_0 using _N_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y = NTRE; │ │ │ │ │ +41 │ │ │ │ │ +_4_2 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; │ │ │ │ │ +43 │ │ │ │ │ +_4_4 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; │ │ │ │ │ +_4_5 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; │ │ │ │ │ +46 │ │ │ │ │ +47protected: │ │ │ │ │ +48 │ │ │ │ │ +49 // This collects all data that is shared by all related │ │ │ │ │ +50 // global and local functions. This way we don't need to │ │ │ │ │ +51 // keep track of it individually. │ │ │ │ │ +_5_2 struct _D_a_t_a │ │ │ │ │ +53 { │ │ │ │ │ +_5_4 _E_n_t_i_t_y_S_e_t _e_n_t_i_t_y_S_e_t; │ │ │ │ │ +_5_5 std::shared_ptr _b_a_s_i_s; │ │ │ │ │ +_5_6 std::shared_ptr _c_o_e_f_f_i_c_i_e_n_t_s; │ │ │ │ │ +_5_7 std::shared_ptr _n_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y; │ │ │ │ │ +58 }; │ │ │ │ │ +59 │ │ │ │ │ +60public: │ │ │ │ │ +_6_1 class _L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e │ │ │ │ │ +62 { │ │ │ │ │ +63 using LocalView = typename Basis::LocalView; │ │ │ │ │ +64 using size_type = typename Tree::size_type; │ │ │ │ │ +65 │ │ │ │ │ +66 public: │ │ │ │ │ +_6_7 using _D_o_m_a_i_n = _L_o_c_a_l_D_o_m_a_i_n; │ │ │ │ │ +_6_8 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; │ │ │ │ │ +69 │ │ │ │ │ +70 protected: │ │ │ │ │ +_7_1 _L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e(const std::shared_ptr& data) │ │ │ │ │ +72 : _d_a_t_a__(data) │ │ │ │ │ +73 , _l_o_c_a_l_V_i_e_w__(_d_a_t_a__->_b_a_s_i_s->localView()) │ │ │ │ │ +74 { │ │ │ │ │ +75 _l_o_c_a_l_D_o_F_s__.reserve(_l_o_c_a_l_V_i_e_w__.maxSize()); │ │ │ │ │ +76 } │ │ │ │ │ +77 │ │ │ │ │ +_8_4 _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) │ │ │ │ │ +85 : _d_a_t_a__(other._d_a_t_a__) │ │ │ │ │ +86 , _l_o_c_a_l_V_i_e_w__(other._l_o_c_a_l_V_i_e_w__) │ │ │ │ │ +87 { │ │ │ │ │ +88 _l_o_c_a_l_D_o_F_s__.reserve(_l_o_c_a_l_V_i_e_w__.maxSize()); │ │ │ │ │ +89 if (_b_o_u_n_d()) │ │ │ │ │ +90 _l_o_c_a_l_D_o_F_s__ = other._l_o_c_a_l_D_o_F_s__; │ │ │ │ │ +91 } │ │ │ │ │ 92 │ │ │ │ │ -93 // create all variants │ │ │ │ │ -94 for (size_t i = 0; i < cubeVariant_.size(); i++) │ │ │ │ │ -95 cubeVariant_[i] = std:: │ │ │ │ │ -make_unique >(CubeFiniteElement │ │ │ │ │ -(i)); │ │ │ │ │ -96 │ │ │ │ │ -97 for (size_t i = 0; i < simplexVariant_.size(); i++) │ │ │ │ │ -98 simplexVariant_[i] = std:: │ │ │ │ │ -make_unique > │ │ │ │ │ -(SimplexFiniteElement(i)); │ │ │ │ │ -99 │ │ │ │ │ -100 // compute orientation for all elements │ │ │ │ │ -101 // loop once over the grid │ │ │ │ │ -102 for(const auto& cell : elements(gv)) │ │ │ │ │ -103 { │ │ │ │ │ -104 unsigned int myId = is_->index(cell); │ │ │ │ │ -105 orient_[myId] = 0; │ │ │ │ │ -106 │ │ │ │ │ -107 for (const auto& intersection : intersections(gv,cell)) │ │ │ │ │ -108 { │ │ │ │ │ -109 if (intersection.neighbor() && (is_->index(intersection.outside()) > myId)) │ │ │ │ │ -110 orient_[myId] |= (1 << intersection.indexInInside()); │ │ │ │ │ -111 } │ │ │ │ │ -112 } │ │ │ │ │ -113 } │ │ │ │ │ -114 │ │ │ │ │ -116 template │ │ │ │ │ -117 const FiniteElement& find(const EntityType& e) const │ │ │ │ │ -118 { │ │ │ │ │ -119 if (e.type().isCube()) │ │ │ │ │ -120 return *cubeVariant_[orient_[is_->index(e)]]; │ │ │ │ │ -121 else │ │ │ │ │ -122 return *simplexVariant_[orient_[is_->index(e)]]; │ │ │ │ │ -123 } │ │ │ │ │ -124 │ │ │ │ │ -125 private: │ │ │ │ │ -126 std::vector │ │ │ │ │ -> > cubeVariant_; │ │ │ │ │ -127 std::vector > > │ │ │ │ │ -simplexVariant_; │ │ │ │ │ -128 const typename GV::IndexSet* is_; │ │ │ │ │ -129 std::vector orient_; │ │ │ │ │ -130 }; │ │ │ │ │ -131 │ │ │ │ │ -132 │ │ │ │ │ -133} // namespace Impl │ │ │ │ │ -134 │ │ │ │ │ -135 │ │ │ │ │ -136/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -137// This is the reusable part of the basis. It contains │ │ │ │ │ -138// │ │ │ │ │ -139// BrezziDouglasMariniPreBasis │ │ │ │ │ -140// BrezziDouglasMariniNode │ │ │ │ │ -141// │ │ │ │ │ -142// The pre-basis allows to create the others and is the owner of possible │ │ │ │ │ -shared │ │ │ │ │ -143// state. These components do _not_ depend on the global basis and local │ │ │ │ │ -view │ │ │ │ │ -144// and can be used without a global basis. │ │ │ │ │ -145/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -146 │ │ │ │ │ -147template │ │ │ │ │ -148class BrezziDouglasMariniNode; │ │ │ │ │ -149 │ │ │ │ │ -150template │ │ │ │ │ -_1_5_1class _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 │ │ │ │ │ -152{ │ │ │ │ │ -153 static const int dim = GV::dimension; │ │ │ │ │ -154 using FiniteElementMap = typename Impl::BDMLocalFiniteElementMap; │ │ │ │ │ -155 │ │ │ │ │ -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; │ │ │ │ │ +_1_0_0 _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) │ │ │ │ │ +101 { │ │ │ │ │ +102 _d_a_t_a__ = other._d_a_t_a__; │ │ │ │ │ +103 _l_o_c_a_l_V_i_e_w__ = other._l_o_c_a_l_V_i_e_w__; │ │ │ │ │ +104 if (_b_o_u_n_d()) │ │ │ │ │ +105 _l_o_c_a_l_D_o_F_s__ = other._l_o_c_a_l_D_o_F_s__; │ │ │ │ │ +106 return *this; │ │ │ │ │ +107 } │ │ │ │ │ +108 │ │ │ │ │ +109 public: │ │ │ │ │ +_1_1_6 void _b_i_n_d(const _E_l_e_m_e_n_t& element) │ │ │ │ │ +117 { │ │ │ │ │ +118 _l_o_c_a_l_V_i_e_w__.bind(element); │ │ │ │ │ +119 // Use cache of full local view size. For a subspace basis, │ │ │ │ │ +120 // this may be larger than the number of local DOFs in the │ │ │ │ │ +121 // tree. In this case only cache entries associated to local │ │ │ │ │ +122 // DOFs in the subspace are filled. Cache entries associated │ │ │ │ │ +123 // to local DOFs which are not contained in the subspace will │ │ │ │ │ +124 // not be touched. │ │ │ │ │ +125 // │ │ │ │ │ +126 // Alternatively one could use a cache that exactly fits │ │ │ │ │ +127 // the size of the tree. However, this would require to │ │ │ │ │ +128 // subtract an offset from localIndex(i) on each cache │ │ │ │ │ +129 // access in operator(). │ │ │ │ │ +130 _l_o_c_a_l_D_o_F_s__.resize(_l_o_c_a_l_V_i_e_w__.size()); │ │ │ │ │ +131 const auto& _d_o_f_s = *_d_a_t_a__->coefficients; │ │ │ │ │ +132 for (size_type i = 0; i < _l_o_c_a_l_V_i_e_w__.tree().size(); ++i) │ │ │ │ │ +133 { │ │ │ │ │ +134 // For a subspace basis the index-within-tree i │ │ │ │ │ +135 // is not the same as the localIndex within the │ │ │ │ │ +136 // full local view. │ │ │ │ │ +137 size_t localIndex = _l_o_c_a_l_V_i_e_w__.tree().localIndex(i); │ │ │ │ │ +138 _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)]; │ │ │ │ │ +139 } │ │ │ │ │ +140 } │ │ │ │ │ +141 │ │ │ │ │ +_1_4_3 void _u_n_b_i_n_d() │ │ │ │ │ +144 { │ │ │ │ │ +145 _l_o_c_a_l_V_i_e_w__.unbind(); │ │ │ │ │ +146 } │ │ │ │ │ +147 │ │ │ │ │ +_1_4_9 bool _b_o_u_n_d() const │ │ │ │ │ +150 { │ │ │ │ │ +151 return _l_o_c_a_l_V_i_e_w__.bound(); │ │ │ │ │ +152 } │ │ │ │ │ +153 │ │ │ │ │ +_1_5_5 const _E_l_e_m_e_n_t& _l_o_c_a_l_C_o_n_t_e_x_t() const │ │ │ │ │ +156 { │ │ │ │ │ +157 return _l_o_c_a_l_V_i_e_w__.element(); │ │ │ │ │ +158 } │ │ │ │ │ +159 │ │ │ │ │ +160 protected: │ │ │ │ │ 161 │ │ │ │ │ -_1_6_2 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_>; │ │ │ │ │ -163 │ │ │ │ │ -_1_6_4 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 = 1; │ │ │ │ │ -_1_6_5 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 = 1; │ │ │ │ │ -_1_6_6 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 = 1; │ │ │ │ │ -167 │ │ │ │ │ -_1_6_9 _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) : │ │ │ │ │ -170 _g_r_i_d_V_i_e_w__(gv), │ │ │ │ │ -171 _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__(gv) │ │ │ │ │ -172 { │ │ │ │ │ -173 // There is no inherent reason why the basis shouldn't work for grids with │ │ │ │ │ -more than one │ │ │ │ │ -174 // element types. Somebody simply has to sit down and implement the missing │ │ │ │ │ -bits. │ │ │ │ │ -175 if (gv.indexSet().types(0).size() > 1) │ │ │ │ │ -176 DUNE_THROW(Dune::NotImplemented, "Brezzi-Douglas-Marini basis is only │ │ │ │ │ -implemented for grids with a single element type"); │ │ │ │ │ -177 } │ │ │ │ │ -178 │ │ │ │ │ -_1_7_9 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ │ -180 { │ │ │ │ │ -181 _c_o_d_i_m_O_f_f_s_e_t__[0] = 0; │ │ │ │ │ -182 _c_o_d_i_m_O_f_f_s_e_t__[1] = _c_o_d_i_m_O_f_f_s_e_t__[0] + _d_o_f_s_P_e_r_C_o_d_i_m__[0] * _g_r_i_d_V_i_e_w__.size(0); │ │ │ │ │ -183 //if (dim==3) codimOffset_[2] = codimOffset_[1] + dofsPerCodim[1] * │ │ │ │ │ -gridView_.size(1); │ │ │ │ │ -184 } │ │ │ │ │ -185 │ │ │ │ │ -_1_8_8 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ │ -189 { │ │ │ │ │ -190 return _g_r_i_d_V_i_e_w__; │ │ │ │ │ -191 } │ │ │ │ │ -192 │ │ │ │ │ -193 /* \brief Update the stored grid view, to be called if the grid has changed │ │ │ │ │ -*/ │ │ │ │ │ -_1_9_4 void _u_p_d_a_t_e (const _G_r_i_d_V_i_e_w& gv) │ │ │ │ │ -195 { │ │ │ │ │ -196 _g_r_i_d_V_i_e_w__ = gv; │ │ │ │ │ -197 } │ │ │ │ │ -198 │ │ │ │ │ -_2_0_2 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ │ -203 { │ │ │ │ │ -204 return _N_o_d_e{&_f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__}; │ │ │ │ │ -205 } │ │ │ │ │ -206 │ │ │ │ │ -_2_0_7 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ │ -208 { │ │ │ │ │ -209 return _d_o_f_s_P_e_r_C_o_d_i_m__[0] * _g_r_i_d_V_i_e_w__.size(0) + _d_o_f_s_P_e_r_C_o_d_i_m__[1] * │ │ │ │ │ -_g_r_i_d_V_i_e_w__.size(1); // only 2d │ │ │ │ │ -210 } │ │ │ │ │ -211 │ │ │ │ │ -213 template │ │ │ │ │ -_2_1_4 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix prefix) const │ │ │ │ │ -215 { │ │ │ │ │ -216 assert(prefix.size() == 0 || prefix.size() == 1); │ │ │ │ │ -217 return (prefix.size() == 0) ? _s_i_z_e() : 0; │ │ │ │ │ -218 } │ │ │ │ │ +162 template │ │ │ │ │ +_1_6_3 void _a_s_s_i_g_n_W_i_t_h(To& to, const From& from) const │ │ │ │ │ +164 { │ │ │ │ │ +165 auto from_flat = _f_l_a_t_V_e_c_t_o_r_V_i_e_w(from); │ │ │ │ │ +166 auto to_flat = _f_l_a_t_V_e_c_t_o_r_V_i_e_w(to); │ │ │ │ │ +167 assert(from_flat.size() == to_flat.size()); │ │ │ │ │ +168 for (size_type i = 0; i < to_flat.size(); ++i) │ │ │ │ │ +169 to_flat[i] = from_flat[i]; │ │ │ │ │ +170 } │ │ │ │ │ +171 │ │ │ │ │ +172 template │ │ │ │ │ +_1_7_3 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 │ │ │ │ │ +174 { │ │ │ │ │ +175 return (*_d_a_t_a__->nodeToRangeEntry)(node, treePath, y); │ │ │ │ │ +176 } │ │ │ │ │ +177 │ │ │ │ │ +_1_7_8 std::shared_ptr _d_a_t_a__; │ │ │ │ │ +_1_7_9 LocalView _l_o_c_a_l_V_i_e_w__; │ │ │ │ │ +_1_8_0 std::vector _l_o_c_a_l_D_o_F_s__; │ │ │ │ │ +181 }; │ │ │ │ │ +182 │ │ │ │ │ +183protected: │ │ │ │ │ +_1_8_4 _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) │ │ │ │ │ +185 : _d_a_t_a__(data) │ │ │ │ │ +186 { │ │ │ │ │ +187 /* Nothing. */ │ │ │ │ │ +188 } │ │ │ │ │ +189 │ │ │ │ │ +190public: │ │ │ │ │ +191 │ │ │ │ │ +_1_9_3 const _B_a_s_i_s& _b_a_s_i_s() const │ │ │ │ │ +194 { │ │ │ │ │ +195 return *_d_a_t_a__->basis; │ │ │ │ │ +196 } │ │ │ │ │ +197 │ │ │ │ │ +_1_9_9 const _V_e_c_t_o_r& _d_o_f_s() const │ │ │ │ │ +200 { │ │ │ │ │ +201 return *_d_a_t_a__->coefficients; │ │ │ │ │ +202 } │ │ │ │ │ +203 │ │ │ │ │ +_2_0_5 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 │ │ │ │ │ +206 { │ │ │ │ │ +207 return *_d_a_t_a__->nodeToRangeEntry; │ │ │ │ │ +208 } │ │ │ │ │ +209 │ │ │ │ │ +_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 _d_a_t_a__->entitySet; │ │ │ │ │ +214 } │ │ │ │ │ +215 │ │ │ │ │ +216protected: │ │ │ │ │ +_2_1_7 std::shared_ptr _d_a_t_a__; │ │ │ │ │ +218}; │ │ │ │ │ 219 │ │ │ │ │ -_2_2_1 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ │ -222 { │ │ │ │ │ -223 return _s_i_z_e(); │ │ │ │ │ -224 } │ │ │ │ │ -225 │ │ │ │ │ -_2_2_6 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ │ -227 { │ │ │ │ │ -228 // The implementation currently only supports grids with a single element │ │ │ │ │ -type. │ │ │ │ │ -229 // We can therefore return the actual number of dofs here. │ │ │ │ │ -230 GeometryType elementType = *(_g_r_i_d_V_i_e_w__.indexSet().types(0).begin()); │ │ │ │ │ -231 size_t numFaces = ReferenceElements::general(elementType).size │ │ │ │ │ -(1); │ │ │ │ │ -232 return _d_o_f_s_P_e_r_C_o_d_i_m__[0] + _d_o_f_s_P_e_r_C_o_d_i_m__[1] * numFaces; │ │ │ │ │ -233 } │ │ │ │ │ -234 │ │ │ │ │ -240 template │ │ │ │ │ -_2_4_1 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ │ -242 { │ │ │ │ │ -243 const auto& gridIndexSet = _g_r_i_d_V_i_e_w().indexSet(); │ │ │ │ │ -244 const auto& element = node._e_l_e_m_e_n_t(); │ │ │ │ │ -245 │ │ │ │ │ -246 // throw if element is not of predefined type │ │ │ │ │ -247 if (not(element.type().isCube()) and not(element.type().isSimplex())) │ │ │ │ │ -248 DUNE_THROW(Dune::NotImplemented, "BrezziDouglasMariniBasis only implemented │ │ │ │ │ -for cube and simplex elements."); │ │ │ │ │ -249 │ │ │ │ │ -250 for(std::size_t i=0, end=node._s_i_z_e(); i _c_o_d_i_m_O_f_f_s_e_t__; │ │ │ │ │ -_2_6_8 FiniteElementMap _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__; │ │ │ │ │ -269 // Number of dofs per entity type depending on the entity's codimension and │ │ │ │ │ -type │ │ │ │ │ -_2_7_0 std::array _d_o_f_s_P_e_r_C_o_d_i_m__ {{dim*(k-1)*3, dim+(k-1)}}; │ │ │ │ │ -271}; │ │ │ │ │ +220} // namespace ImplDoc │ │ │ │ │ +221 │ │ │ │ │ +222 │ │ │ │ │ +223 │ │ │ │ │ +224template │ │ │ │ │ +225class _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; │ │ │ │ │ +226 │ │ │ │ │ +264template │ │ │ │ │ +_2_6_7class _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 │ │ │ │ │ +268 : 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 │ │ │ │ │ +269{ │ │ │ │ │ +270 using _B_a_s_e = _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_>; │ │ │ │ │ +271 using Data = typename _B_a_s_e_:_:_D_a_t_a; │ │ │ │ │ 272 │ │ │ │ │ -273 │ │ │ │ │ -274 │ │ │ │ │ -275template │ │ │ │ │ -_2_7_6class _B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_N_o_d_e : │ │ │ │ │ -277 public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ │ -278{ │ │ │ │ │ -279 static const int dim = GV::dimension; │ │ │ │ │ -280 │ │ │ │ │ -281public: │ │ │ │ │ -282 │ │ │ │ │ -_2_8_3 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ -_2_8_4 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ │ -_2_8_5 using _F_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p = typename Impl::BDMLocalFiniteElementMap; │ │ │ │ │ -_2_8_6 using _F_i_n_i_t_e_E_l_e_m_e_n_t = Impl::GlobalValuedLocalFiniteElement; │ │ │ │ │ +273public: │ │ │ │ │ +_2_7_4 using _B_a_s_i_s = typename _B_a_s_e_:_:_B_a_s_i_s; │ │ │ │ │ +_2_7_5 using _V_e_c_t_o_r = typename _B_a_s_e_:_:_V_e_c_t_o_r; │ │ │ │ │ +276 │ │ │ │ │ +_2_7_7 using _D_o_m_a_i_n = typename _B_a_s_e_:_:_D_o_m_a_i_n; │ │ │ │ │ +_2_7_8 using _R_a_n_g_e = R; │ │ │ │ │ +279 │ │ │ │ │ +_2_8_0 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>; │ │ │ │ │ +281 │ │ │ │ │ +282private: │ │ │ │ │ +283 │ │ │ │ │ +284 template │ │ │ │ │ +285 using LocalBasisRange = typename Node::FiniteElement::Traits:: │ │ │ │ │ +LocalBasisType::Traits::RangeType; │ │ │ │ │ +286 template │ │ │ │ │ +287 using NodeData = typename std::vector>; │ │ │ │ │ +288 using PerNodeEvaluationBuffer = typename TypeTree::TreeContainer; │ │ │ │ │ 289 │ │ │ │ │ -_2_9_0 _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) : │ │ │ │ │ -291 _e_l_e_m_e_n_t__(nullptr), │ │ │ │ │ -292 _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__(finiteElementMap) │ │ │ │ │ -293 {} │ │ │ │ │ -294 │ │ │ │ │ -_2_9_6 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ │ -297 { │ │ │ │ │ -298 return *_e_l_e_m_e_n_t__; │ │ │ │ │ -299 } │ │ │ │ │ -300 │ │ │ │ │ -_3_0_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 │ │ │ │ │ -306 { │ │ │ │ │ -307 return _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ │ -308 } │ │ │ │ │ -309 │ │ │ │ │ -_3_1_1 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ │ -312 { │ │ │ │ │ -313 _e_l_e_m_e_n_t__ = &e; │ │ │ │ │ -314 _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); │ │ │ │ │ -315 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__.size()); │ │ │ │ │ -316 } │ │ │ │ │ -317 │ │ │ │ │ -318protected: │ │ │ │ │ -319 │ │ │ │ │ -_3_2_0 _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_2_1 const _E_l_e_m_e_n_t* _e_l_e_m_e_n_t__; │ │ │ │ │ -_3_2_2 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__; │ │ │ │ │ -323}; │ │ │ │ │ -324 │ │ │ │ │ -325 │ │ │ │ │ +290public: │ │ │ │ │ +_2_9_1 class _L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ │ +292 : public _B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e │ │ │ │ │ +293 { │ │ │ │ │ +294 using LocalBase = typename _B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e; │ │ │ │ │ +295 using size_type = typename Base::Tree::size_type; │ │ │ │ │ +296 using LocalBase::nodeToRangeEntry; │ │ │ │ │ +297 │ │ │ │ │ +298 public: │ │ │ │ │ +299 │ │ │ │ │ +_3_0_0 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_0_1 using _D_o_m_a_i_n = typename LocalBase::Domain; │ │ │ │ │ +_3_0_2 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_0_3 using _E_l_e_m_e_n_t = typename LocalBase::Element; │ │ │ │ │ +304 │ │ │ │ │ +_3_0_6 _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) │ │ │ │ │ +307 : LocalBase(globalFunction._d_a_t_a__) │ │ │ │ │ +308 , evaluationBuffer_(this->_l_o_c_a_l_V_i_e_w__.tree()) │ │ │ │ │ +309 { │ │ │ │ │ +310 /* Nothing. */ │ │ │ │ │ +311 } │ │ │ │ │ +312 │ │ │ │ │ +_3_2_2 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(const _D_o_m_a_i_n& x) const │ │ │ │ │ +323 { │ │ │ │ │ +324 _R_a_n_g_e y; │ │ │ │ │ +325 _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(y) = 0; │ │ │ │ │ 326 │ │ │ │ │ -327namespace BasisFactory { │ │ │ │ │ -328 │ │ │ │ │ -336template │ │ │ │ │ -_3_3_7auto _b_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i() │ │ │ │ │ -338{ │ │ │ │ │ -339 return [](const auto& gridView) { │ │ │ │ │ -340 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); │ │ │ │ │ -341 }; │ │ │ │ │ -342} │ │ │ │ │ -343 │ │ │ │ │ -344} // end namespace BasisFactory │ │ │ │ │ -345 │ │ │ │ │ -346 │ │ │ │ │ -347 │ │ │ │ │ -348/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -349// This is the actual global basis implementation based on the reusable │ │ │ │ │ -parts. │ │ │ │ │ -350/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -351 │ │ │ │ │ -359template │ │ │ │ │ -_3_6_0using _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_> >; │ │ │ │ │ -361 │ │ │ │ │ -362} // end namespace Functions │ │ │ │ │ -363} // end namespace Dune │ │ │ │ │ -364 │ │ │ │ │ +327 TypeTree::forEachLeafNode(this->_l_o_c_a_l_V_i_e_w__.tree(), [&](auto&& node, auto&& │ │ │ │ │ +treePath) { │ │ │ │ │ +328 const auto& fe = node.finiteElement(); │ │ │ │ │ +329 const auto& localBasis = fe.localBasis(); │ │ │ │ │ +330 auto& shapeFunctionValues = evaluationBuffer_[treePath]; │ │ │ │ │ +331 │ │ │ │ │ +332 localBasis.evaluateFunction(x, shapeFunctionValues); │ │ │ │ │ +333 │ │ │ │ │ +334 // Compute linear combinations of basis function jacobian. │ │ │ │ │ +335 // Non-scalar coefficients of dimension coeffDim are handled by │ │ │ │ │ +336 // processing the coeffDim linear combinations independently │ │ │ │ │ +337 // and storing them as entries of an array. │ │ │ │ │ +338 using Value = LocalBasisRange< std::decay_t >; │ │ │ │ │ +339 static constexpr auto coeffDim = decltype(flatVectorView(this->localDoFs_ │ │ │ │ │ +[node.localIndex(0)]).size())::value; │ │ │ │ │ +340 auto values = std::array{}; │ │ │ │ │ +341 _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(values) = 0; │ │ │ │ │ +342 for (size_type i = 0; i < localBasis.size(); ++i) │ │ │ │ │ +343 { │ │ │ │ │ +344 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)]); │ │ │ │ │ +345 for (std::size_t j = 0; j < coeffDim; ++j) │ │ │ │ │ +346 values[j].axpy(c[j], shapeFunctionValues[i]); │ │ │ │ │ +347 } │ │ │ │ │ +348 │ │ │ │ │ +349 // Assign computed values to node entry of range. │ │ │ │ │ +350 // Types are matched using the lexicographic ordering provided by │ │ │ │ │ +flatVectorView. │ │ │ │ │ +351 LocalBase::assignWith(_n_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y(node, treePath, y), values); │ │ │ │ │ +352 }); │ │ │ │ │ +353 │ │ │ │ │ +354 return y; │ │ │ │ │ +355 } │ │ │ │ │ +356 │ │ │ │ │ +_3_5_8 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) │ │ │ │ │ +359 { │ │ │ │ │ +360 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__)); │ │ │ │ │ +361 if (lf._b_o_u_n_d()) │ │ │ │ │ +362 dlf.bind(lf._l_o_c_a_l_C_o_n_t_e_x_t()); │ │ │ │ │ +363 return dlf; │ │ │ │ │ +364 } │ │ │ │ │ 365 │ │ │ │ │ -366#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BREZZIDOUGLASMARINIBASIS_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 │ │ │ │ │ -_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ │ -_n_o_d_e_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:337 │ │ │ │ │ +366 private: │ │ │ │ │ +367 mutable PerNodeEvaluationBuffer evaluationBuffer_; │ │ │ │ │ +368 }; │ │ │ │ │ +369 │ │ │ │ │ +371 template │ │ │ │ │ +_3_7_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_T && basis, V_T && coefficients, NTRE_T&& │ │ │ │ │ +nodeToRangeEntry) │ │ │ │ │ +373 : _B_a_s_e(std::make_shared(Data{{basis.gridView()}, wrap_or_move(std:: │ │ │ │ │ +forward(basis)), wrap_or_move(std::forward(coefficients)), │ │ │ │ │ +wrap_or_move(std::forward(nodeToRangeEntry))})) │ │ │ │ │ +374 {} │ │ │ │ │ +375 │ │ │ │ │ +_3_7_7 _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 basis, std:: │ │ │ │ │ +shared_ptr coefficients, std::shared_ptr nodeToRangeEntry) │ │ │ │ │ +378 : _B_a_s_e(std::make_shared(Data{{basis->gridView()}, basis, │ │ │ │ │ +coefficients, nodeToRangeEntry})) │ │ │ │ │ +379 {} │ │ │ │ │ +380 │ │ │ │ │ +_3_8_2 _R_a_n_g_e operator() (const _D_o_m_a_i_n& x) const │ │ │ │ │ +383 { │ │ │ │ │ +384 // TODO: Implement this using hierarchic search │ │ │ │ │ +385 DUNE_THROW(NotImplemented,"not implemented"); │ │ │ │ │ +386 } │ │ │ │ │ +387 │ │ │ │ │ +_3_8_9 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) │ │ │ │ │ +390 { │ │ │ │ │ +391 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__); │ │ │ │ │ +392 } │ │ │ │ │ +393 │ │ │ │ │ +_4_0_2 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) │ │ │ │ │ +403 { │ │ │ │ │ +404 return _L_o_c_a_l_F_u_n_c_t_i_o_n(t); │ │ │ │ │ +405 } │ │ │ │ │ +406}; │ │ │ │ │ +407 │ │ │ │ │ +408 │ │ │ │ │ +431template │ │ │ │ │ +_4_3_2auto _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) │ │ │ │ │ +433{ │ │ │ │ │ +434 using _B_a_s_i_s = std::decay_t; │ │ │ │ │ +435 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; │ │ │ │ │ +436 │ │ │ │ │ +437 // Small helper functions to wrap vectors using istlVectorBackend │ │ │ │ │ +438 // if they do not already satisfy the VectorBackend interface. │ │ │ │ │ +439 auto toConstVectorBackend = [&](auto&& v) -> decltype(auto) { │ │ │ │ │ +440 if constexpr (models, decltype(v)>()) { │ │ │ │ │ +441 return std::forward(v); │ │ │ │ │ +442 } else { │ │ │ │ │ +443 return _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(v); │ │ │ │ │ +444 } │ │ │ │ │ +445 }; │ │ │ │ │ +446 │ │ │ │ │ +447 using _V_e_c_t_o_r = std::decay_t │ │ │ │ │ +(vector)))>; │ │ │ │ │ +448 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_>( │ │ │ │ │ +449 std::forward(basis), │ │ │ │ │ +450 toConstVectorBackend(std::forward(vector)), │ │ │ │ │ +451 _H_i_e_r_a_r_c_h_i_c_N_o_d_e_T_o_R_a_n_g_e_M_a_p()); │ │ │ │ │ +452} │ │ │ │ │ +453 │ │ │ │ │ +454 │ │ │ │ │ +469template │ │ │ │ │ +_4_7_0class _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 │ │ │ │ │ +471 : 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 │ │ │ │ │ +472{ │ │ │ │ │ +473 using _B_a_s_e = _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_>; │ │ │ │ │ +474 using Data = typename _B_a_s_e_:_:_D_a_t_a; │ │ │ │ │ +475 │ │ │ │ │ +476public: │ │ │ │ │ +_4_7_7 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; │ │ │ │ │ +478 │ │ │ │ │ +_4_7_9 using _B_a_s_i_s = typename _B_a_s_e_:_:_B_a_s_i_s; │ │ │ │ │ +_4_8_0 using _V_e_c_t_o_r = typename _B_a_s_e_:_:_V_e_c_t_o_r; │ │ │ │ │ +481 │ │ │ │ │ +_4_8_2 using _D_o_m_a_i_n = typename _B_a_s_e_:_:_D_o_m_a_i_n; │ │ │ │ │ +_4_8_3 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; │ │ │ │ │ +484 │ │ │ │ │ +_4_8_5 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>; │ │ │ │ │ +486 │ │ │ │ │ +487private: │ │ │ │ │ +488 │ │ │ │ │ +489 template │ │ │ │ │ +490 using LocalBasisRange = typename Node::FiniteElement::Traits:: │ │ │ │ │ +LocalBasisType::Traits::JacobianType; │ │ │ │ │ +491 template │ │ │ │ │ +492 using NodeData = typename std::vector< LocalBasisRange >; │ │ │ │ │ +493 using PerNodeEvaluationBuffer = typename TypeTree::TreeContainer; │ │ │ │ │ +494 │ │ │ │ │ +495public: │ │ │ │ │ +496 │ │ │ │ │ +_5_0_4 class _L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ │ +505 : public _B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e │ │ │ │ │ +506 { │ │ │ │ │ +507 using LocalBase = typename _B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e; │ │ │ │ │ +508 using size_type = typename Base::Tree::size_type; │ │ │ │ │ +509 using LocalBase::nodeToRangeEntry; │ │ │ │ │ +510 │ │ │ │ │ +511 public: │ │ │ │ │ +_5_1_2 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_1_3 using _D_o_m_a_i_n = typename LocalBase::Domain; │ │ │ │ │ +_5_1_4 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_1_5 using _E_l_e_m_e_n_t = typename LocalBase::Element; │ │ │ │ │ +516 │ │ │ │ │ +_5_1_8 _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) │ │ │ │ │ +519 : LocalBase(globalFunction.data_) │ │ │ │ │ +520 , evaluationBuffer_(this->localView_.tree()) │ │ │ │ │ +521 { │ │ │ │ │ +522 /* Nothing. */ │ │ │ │ │ +523 } │ │ │ │ │ +524 │ │ │ │ │ +_5_3_1 void _b_i_n_d(const _E_l_e_m_e_n_t& element) │ │ │ │ │ +532 { │ │ │ │ │ +533 LocalBase::bind(element); │ │ │ │ │ +534 geometry_.emplace(element.geometry()); │ │ │ │ │ +535 } │ │ │ │ │ +536 │ │ │ │ │ +_5_3_8 void _u_n_b_i_n_d() │ │ │ │ │ +539 { │ │ │ │ │ +540 geometry_.reset(); │ │ │ │ │ +541 LocalBase::unbind(); │ │ │ │ │ +542 } │ │ │ │ │ +543 │ │ │ │ │ +_5_5_7 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(const _D_o_m_a_i_n& x) const │ │ │ │ │ +558 { │ │ │ │ │ +559 _R_a_n_g_e y; │ │ │ │ │ +560 _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(y) = 0; │ │ │ │ │ +561 │ │ │ │ │ +562 const auto& jacobianInverse = geometry_->jacobianInverse(x); │ │ │ │ │ +563 │ │ │ │ │ +564 TypeTree::forEachLeafNode(this->localView_.tree(), [&](auto&& node, auto&& │ │ │ │ │ +treePath) { │ │ │ │ │ +565 const auto& fe = node.finiteElement(); │ │ │ │ │ +566 const auto& localBasis = fe.localBasis(); │ │ │ │ │ +567 auto& shapeFunctionJacobians = evaluationBuffer_[treePath]; │ │ │ │ │ +568 │ │ │ │ │ +569 localBasis.evaluateJacobian(x, shapeFunctionJacobians); │ │ │ │ │ +570 │ │ │ │ │ +571 // Compute linear combinations of basis function jacobian. │ │ │ │ │ +572 // Non-scalar coefficients of dimension coeffDim are handled by │ │ │ │ │ +573 // processing the coeffDim linear combinations independently │ │ │ │ │ +574 // and storing them as entries of an array. │ │ │ │ │ +575 using RefJacobian = LocalBasisRange< std::decay_t >; │ │ │ │ │ +576 static constexpr auto coeffDim = decltype(flatVectorView(this->localDoFs_ │ │ │ │ │ +[node.localIndex(0)]).size())::value; │ │ │ │ │ +577 auto refJacobians = std::array{}; │ │ │ │ │ +578 _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(refJacobians) = 0; │ │ │ │ │ +579 for (size_type i = 0; i < localBasis.size(); ++i) │ │ │ │ │ +580 { │ │ │ │ │ +581 auto c = _f_l_a_t_V_e_c_t_o_r_V_i_e_w(this->localDoFs_[node.localIndex(i)]); │ │ │ │ │ +582 for (std::size_t j = 0; j < coeffDim; ++j) │ │ │ │ │ +583 refJacobians[j].axpy(c[j], shapeFunctionJacobians[i]); │ │ │ │ │ +584 } │ │ │ │ │ +585 │ │ │ │ │ +586 // Transform Jacobians form local to global coordinates. │ │ │ │ │ +587 using Jacobian = decltype(refJacobians[0] * jacobianInverse); │ │ │ │ │ +588 auto jacobians = std::array{}; │ │ │ │ │ +589 std::transform( │ │ │ │ │ +590 refJacobians.begin(), refJacobians.end(), jacobians.begin(), │ │ │ │ │ +591 [&](const auto& refJacobian) { return refJacobian * jacobianInverse; }); │ │ │ │ │ +592 │ │ │ │ │ +593 // Assign computed Jacobians to node entry of range. │ │ │ │ │ +594 // Types are matched using the lexicographic ordering provided by │ │ │ │ │ +flatVectorView. │ │ │ │ │ +595 LocalBase::assignWith(nodeToRangeEntry(node, treePath, y), jacobians); │ │ │ │ │ +596 }); │ │ │ │ │ +597 │ │ │ │ │ +598 return y; │ │ │ │ │ +599 } │ │ │ │ │ +600 │ │ │ │ │ +_6_0_2 friend typename _T_r_a_i_t_s_:_:_L_o_c_a_l_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 _d_e_r_i_v_a_t_i_v_e │ │ │ │ │ +(const _L_o_c_a_l_F_u_n_c_t_i_o_n&) │ │ │ │ │ +603 { │ │ │ │ │ +604 DUNE_THROW(NotImplemented, "derivative of derivative is not implemented"); │ │ │ │ │ +605 } │ │ │ │ │ +606 │ │ │ │ │ +607 private: │ │ │ │ │ +608 mutable PerNodeEvaluationBuffer evaluationBuffer_; │ │ │ │ │ +609 std::optional geometry_; │ │ │ │ │ +610 }; │ │ │ │ │ +611 │ │ │ │ │ +_6_1_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_D_e_r_i_v_a_t_i_v_e(const std::shared_ptr& │ │ │ │ │ +data) │ │ │ │ │ +619 : _B_a_s_e(data) │ │ │ │ │ +620 { │ │ │ │ │ +621 /* Nothing. */ │ │ │ │ │ +622 } │ │ │ │ │ +623 │ │ │ │ │ +_6_2_5 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(const _D_o_m_a_i_n& x) const │ │ │ │ │ +626 { │ │ │ │ │ +627 // TODO: Implement this using hierarchic search │ │ │ │ │ +628 DUNE_THROW(NotImplemented,"not implemented"); │ │ │ │ │ +629 } │ │ │ │ │ +630 │ │ │ │ │ +_6_3_1 friend typename _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 _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) │ │ │ │ │ +632 { │ │ │ │ │ +633 DUNE_THROW(NotImplemented, "derivative of derivative is not implemented"); │ │ │ │ │ +634 } │ │ │ │ │ +635 │ │ │ │ │ +_6_3_7 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) │ │ │ │ │ +638 { │ │ │ │ │ +639 return _L_o_c_a_l_F_u_n_c_t_i_o_n(f); │ │ │ │ │ +640 } │ │ │ │ │ +641}; │ │ │ │ │ +642 │ │ │ │ │ +643 │ │ │ │ │ +644} // namespace Functions │ │ │ │ │ +645} // namespace Dune │ │ │ │ │ +646 │ │ │ │ │ +647#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_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 │ │ │ │ │ +_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 │ │ │ │ │ +_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:432 │ │ │ │ │ +_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:346 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:278 │ │ │ │ │ -_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:305 │ │ │ │ │ -_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:284 │ │ │ │ │ -_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:322 │ │ │ │ │ -_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:283 │ │ │ │ │ -_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:320 │ │ │ │ │ -_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, dim, double, k > FiniteElementMap │ │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:285 │ │ │ │ │ -_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:321 │ │ │ │ │ -_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:288 │ │ │ │ │ -_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:311 │ │ │ │ │ -_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:290 │ │ │ │ │ -_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:296 │ │ │ │ │ -_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:152 │ │ │ │ │ -_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:160 │ │ │ │ │ -_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_:_:_d_o_f_s_P_e_r_C_o_d_i_m__ │ │ │ │ │ -std::array< int, 2 > dofsPerCodim_ │ │ │ │ │ -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_P_r_e_B_a_s_i_s_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ │ -size_type dimension() const │ │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:221 │ │ │ │ │ -_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_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ -static constexpr size_type minMultiIndexSize │ │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:165 │ │ │ │ │ -_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_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ -static constexpr size_type maxMultiIndexSize │ │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:164 │ │ │ │ │ -_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_:_:_c_o_d_i_m_O_f_f_s_e_t__ │ │ │ │ │ -std::array< size_t, dim+1 > codimOffset_ │ │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:267 │ │ │ │ │ -_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 │ │ │ │ │ -size_type size(const SizePrefix prefix) const │ │ │ │ │ -Return number possible values for next position in multi index. │ │ │ │ │ -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_:_:_m_a_k_e_N_o_d_e │ │ │ │ │ -Node makeNode() const │ │ │ │ │ -Create tree node. │ │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:202 │ │ │ │ │ -_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:159 │ │ │ │ │ -_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:169 │ │ │ │ │ -_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: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_P_r_e_B_a_s_i_s_:_:_u_p_d_a_t_e │ │ │ │ │ -void update(const GridView &gv) │ │ │ │ │ -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_:_:_i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ │ -void initializeIndices() │ │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:179 │ │ │ │ │ -_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 │ │ │ │ │ -const GridView & gridView() const │ │ │ │ │ -Obtain the grid view that the basis 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_:_:_s_i_z_e │ │ │ │ │ -size_type size() const │ │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:207 │ │ │ │ │ -_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_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 brezzidouglasmarinibasis.hh:166 │ │ │ │ │ -_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_x_N_o_d_e_S_i_z_e │ │ │ │ │ -size_type maxNodeSize() const │ │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:226 │ │ │ │ │ -_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__ │ │ │ │ │ -GridView gridView_ │ │ │ │ │ -DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:266 │ │ │ │ │ -_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_:_:_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 brezzidouglasmarinibasis.hh:241 │ │ │ │ │ -_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:46 │ │ │ │ │ -_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 │ │ │ │ │ -DDeeffiinniittiioonn nodes.hh:142 │ │ │ │ │ -_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:164 │ │ │ │ │ -_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:186 │ │ │ │ │ +_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:179 │ │ │ │ │ +_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:37 │ │ │ │ │ +_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:56 │ │ │ │ │ +_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:30 │ │ │ │ │ +_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:28 │ │ │ │ │ +_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__ │ │ │ │ │ +std::shared_ptr< const Data > data_ │ │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:217 │ │ │ │ │ +_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:199 │ │ │ │ │ +_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:30 │ │ │ │ │ +_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: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_:_:_V_e_c_t_o_r │ │ │ │ │ +V Vector │ │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:31 │ │ │ │ │ +_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: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_:_:_L_o_c_a_l_D_o_m_a_i_n │ │ │ │ │ +typename EntitySet::LocalCoordinate LocalDomain │ │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:44 │ │ │ │ │ +_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:205 │ │ │ │ │ +_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:40 │ │ │ │ │ +_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:184 │ │ │ │ │ +_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:37 │ │ │ │ │ +_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:193 │ │ │ │ │ +_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: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_:_:_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:211 │ │ │ │ │ +_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:42 │ │ │ │ │ +_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:35 │ │ │ │ │ +_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: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_:_:_D_a_t_a_:_:_e_n_t_i_t_y_S_e_t │ │ │ │ │ +EntitySet entitySet │ │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:54 │ │ │ │ │ +_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:57 │ │ │ │ │ +_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:55 │ │ │ │ │ +_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:56 │ │ │ │ │ +_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: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_:_:_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:100 │ │ │ │ │ +_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:149 │ │ │ │ │ +_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:116 │ │ │ │ │ +_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:68 │ │ │ │ │ +_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:155 │ │ │ │ │ +_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:84 │ │ │ │ │ +_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:180 │ │ │ │ │ +_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: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_:_: │ │ │ │ │ +_d_a_t_a__ │ │ │ │ │ +std::shared_ptr< const Data > data_ │ │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:178 │ │ │ │ │ +_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:173 │ │ │ │ │ +_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:179 │ │ │ │ │ +_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:143 │ │ │ │ │ +_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:67 │ │ │ │ │ +_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:71 │ │ │ │ │ +_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:472 │ │ │ │ │ +_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:479 │ │ │ │ │ +_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:631 │ │ │ │ │ +_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 │ │ │ │ │ +Not implemented. │ │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:625 │ │ │ │ │ +_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:483 │ │ │ │ │ +_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:637 │ │ │ │ │ +_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:618 │ │ │ │ │ +_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:477 │ │ │ │ │ +_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:480 │ │ │ │ │ +_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:485 │ │ │ │ │ +_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:482 │ │ │ │ │ +_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 │ │ │ │ │ +A grid function induced by a global basis and a coefficient vector. │ │ │ │ │ +DDeeffiinniittiioonn discreteglobalbasisfunction.hh:269 │ │ │ │ │ +_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:389 │ │ │ │ │ +_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:372 │ │ │ │ │ +_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:377 │ │ │ │ │ +_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:402 │ │ │ │ │ +_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:274 │ │ │ │ │ +_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:280 │ │ │ │ │ +_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:278 │ │ │ │ │ +_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:275 │ │ │ │ │ +_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:277 │ │ │ │ │ +_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:293 │ │ │ │ │ +_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:302 │ │ │ │ │ +_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:301 │ │ │ │ │ +_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:306 │ │ │ │ │ +_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:358 │ │ │ │ │ +_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:322 │ │ │ │ │ +_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:303 │ │ │ │ │ +_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: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_:_:_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:557 │ │ │ │ │ +_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:513 │ │ │ │ │ +_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:515 │ │ │ │ │ +_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:602 │ │ │ │ │ +_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:514 │ │ │ │ │ +_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: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_:_: │ │ │ │ │ +_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:518 │ │ │ │ │ +_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:531 │ │ │ │ │ +_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: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_ _> │ │ │ │ │ +_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 │ │ │ │ │ +Type of Elements contained in this EntitySet. │ │ │ │ │ +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_ _>_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ │ +Element::Geometry::LocalCoordinate LocalCoordinate │ │ │ │ │ +Type of local coordinates with respect to the Element. │ │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:35 │ │ │ │ │ +_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:36 │ │ │ │ │ +_c_o_n_c_e_p_t_s_._h_h │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00023.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: powerbasis.hh File Reference │ │ │ │ +dune-functions: gridviewfunction.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,52 +65,58 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces
│ │ │ │ -
powerbasis.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Functions
│ │ │ │ +
gridviewfunction.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <dune/common/reservedvector.hh>
│ │ │ │ -#include <dune/common/typeutilities.hh>
│ │ │ │ -#include <dune/common/indices.hh>
│ │ │ │ -#include <dune/functions/common/utility.hh>
│ │ │ │ -#include <dune/functions/common/type_traits.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 <memory>
│ │ │ │ +#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::PowerPreBasis< IMS, SPB, C >
 A pre-basis for power bases. More...
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
 
namespace  Dune::Functions::BasisFactory
 
namespace  Dune::Functions::BasisBuilder
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +Functions

template<class F , class GridView , typename std::enable_if< models< Imp::HasFreeLocalFunction, F >(), int >::type = 0>
std::decay< F >::type Dune::Functions::makeGridViewFunction (F &&f, const GridView &gridView)
 Construct a function modeling GridViewFunction from function and grid view.
 
template<class F , class GridView , typename std::enable_if< not(models< Imp::HasFreeLocalFunction, F >()), int >::type = 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,34 +1,47 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -powerbasis.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 <_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_/_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_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +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> │ │ │ │ │ _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_:_:_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 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 │ │ │ │ │ +FFuunnccttiioonnss │ │ │ │ │ +template(), int >::type = 0> │ │ │ │ │ +std::decay< F >::type  _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. │ │ │ │ │   │ │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_B_u_i_l_d_e_r │ │ │ │ │ +template()), int >::type = 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. │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00023_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: powerbasis.hh Source File │ │ │ │ +dune-functions: gridviewfunction.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,434 +70,103 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
powerbasis.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH
│ │ │ │
5
│ │ │ │ -
6#include <dune/common/reservedvector.hh>
│ │ │ │ -
7#include <dune/common/typeutilities.hh>
│ │ │ │ -
8#include <dune/common/indices.hh>
│ │ │ │ +
6#include <memory>
│ │ │ │ +
7
│ │ │ │ +
8#include <dune/common/concept.hh>
│ │ │ │
9
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
16
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
13
│ │ │ │ +
14
│ │ │ │ +
15namespace Dune {
│ │ │ │ +
16namespace Functions {
│ │ │ │
17
│ │ │ │
18
│ │ │ │ -
19namespace Dune {
│ │ │ │ -
20namespace Functions {
│ │ │ │ -
21
│ │ │ │ -
22
│ │ │ │ -
23// *****************************************************************************
│ │ │ │ -
24// This is the reusable part of the power bases. It contains
│ │ │ │ -
25//
│ │ │ │ -
26// PowerPreBasis
│ │ │ │ -
27//
│ │ │ │ -
28// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ │ -
29// state. These components do _not_ depend on the global basis and local view
│ │ │ │ -
30// and can be used without a global basis.
│ │ │ │ -
31// *****************************************************************************
│ │ │ │ -
32
│ │ │ │ -
43template<class IMS, class SPB, std::size_t C>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
45{
│ │ │ │ -
46 static const std::size_t children = C;
│ │ │ │ -
47 static const bool isBlocked = std::is_same_v<IMS,BasisFactory::BlockedLexicographic> or std::is_same_v<IMS,BasisFactory::BlockedInterleaved>;
│ │ │ │ -
48
│ │ │ │ -
49public:
│ │ │ │ -
50
│ │ │ │ -
52 using SubPreBasis = SPB;
│ │ │ │ -
53
│ │ │ │ -
55 using GridView = typename SPB::GridView;
│ │ │ │ -
56
│ │ │ │ -
58 using size_type = std::size_t;
│ │ │ │ -
59
│ │ │ │ - │ │ │ │ -
62
│ │ │ │ -
63 using SubNode = typename SubPreBasis::Node;
│ │ │ │ -
64
│ │ │ │ - │ │ │ │ -
67
│ │ │ │ -
68 static constexpr size_type maxMultiIndexSize = SubPreBasis::maxMultiIndexSize + isBlocked;
│ │ │ │ -
69 static constexpr size_type minMultiIndexSize = SubPreBasis::minMultiIndexSize + isBlocked;
│ │ │ │ -
70 static constexpr size_type multiIndexBufferSize = SubPreBasis::multiIndexBufferSize + isBlocked;
│ │ │ │ -
71
│ │ │ │ -
77 template<class... SFArgs,
│ │ │ │ -
78 disableCopyMove<PowerPreBasis, SFArgs...> = 0,
│ │ │ │ -
79 enableIfConstructible<SubPreBasis, SFArgs...> = 0>
│ │ │ │ -
│ │ │ │ -
80 PowerPreBasis(SFArgs&&... sfArgs) :
│ │ │ │ -
81 subPreBasis_(std::forward<SFArgs>(sfArgs)...)
│ │ │ │ -
82 {
│ │ │ │ -
83 static_assert(models<Concept::PreBasis<GridView>, SubPreBasis>(), "Subprebasis passed to PowerPreBasis does not model the PreBasis concept.");
│ │ │ │ -
84 }
│ │ │ │ -
│ │ │ │ -
85
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
88 {
│ │ │ │ -
89 subPreBasis_.initializeIndices();
│ │ │ │ -
90 }
│ │ │ │ +
19
│ │ │ │ +
20template<class Signature, class GridView, template<class> class DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
22{};
│ │ │ │ +
│ │ │ │ +
23
│ │ │ │ +
24
│ │ │ │ +
25
│ │ │ │ +
40template<class Range, class Domain, class GV, template<class> class DerivativeTraits, size_t bufferSize>
│ │ │ │ +
│ │ │ │ +
41class GridViewFunction<Range(Domain), GV, DerivativeTraits, bufferSize> :
│ │ │ │ +
42 public GridFunction<Range(Domain), GridViewEntitySet<GV, 0>, DerivativeTraits, bufferSize>
│ │ │ │ +
43{
│ │ │ │ +
44 using Base = GridFunction<Range(Domain), GridViewEntitySet<GV, 0>, DerivativeTraits, bufferSize>;
│ │ │ │ +
45public:
│ │ │ │ +
46 using GridView = GV;
│ │ │ │ +
47
│ │ │ │ +
48 using Base::Base;
│ │ │ │ +
49};
│ │ │ │
│ │ │ │ -
91
│ │ │ │ +
50
│ │ │ │ +
51
│ │ │ │ +
52
│ │ │ │ +
64template<class F, class GridView,
│ │ │ │ +
65 typename std::enable_if<
│ │ │ │ +
66 models< Imp::HasFreeLocalFunction, F>() , int>::type = 0>
│ │ │ │ +
67typename std::decay<F>::type
│ │ │ │ +
│ │ │ │ +
68 makeGridViewFunction(F&& f, const GridView& gridView)
│ │ │ │ +
69{
│ │ │ │ +
70 return std::forward<F>(f);
│ │ │ │ +
71}
│ │ │ │ +
│ │ │ │ +
72
│ │ │ │ +
73
│ │ │ │ +
74
│ │ │ │ +
90template<class F, class GridView,
│ │ │ │ +
91 typename std::enable_if<
│ │ │ │ +
92 not(models< Imp::HasFreeLocalFunction, F>()) , int>::type = 0>
│ │ │ │
│ │ │ │ -
93 const GridView& gridView() const
│ │ │ │ -
94 {
│ │ │ │ -
95 return subPreBasis_.gridView();
│ │ │ │ -
96 }
│ │ │ │ -
│ │ │ │ -
97
│ │ │ │ -
│ │ │ │ -
99 void update(const GridView& gv)
│ │ │ │ -
100 {
│ │ │ │ -
101 subPreBasis_.update(gv);
│ │ │ │ -
102 }
│ │ │ │ -
│ │ │ │ +
93auto makeGridViewFunction(F&& f, const GridView& gridView)
│ │ │ │ +
94 -> decltype(makeAnalyticGridViewFunction(std::forward<F>(f), gridView))
│ │ │ │ +
95{
│ │ │ │ +
96 return makeAnalyticGridViewFunction(std::forward<F>(f), gridView);
│ │ │ │ +
97}
│ │ │ │ +
│ │ │ │ +
98
│ │ │ │ +
99
│ │ │ │ +
100
│ │ │ │ +
101} // end of namespace Dune::Functions
│ │ │ │ +
102} // end of namespace Dune
│ │ │ │
103
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
108 {
│ │ │ │ -
109 auto node = Node{};
│ │ │ │ -
110 for (std::size_t i=0; i<children; ++i)
│ │ │ │ -
111 node.setChild(i, subPreBasis_.makeNode());
│ │ │ │ -
112 return node;
│ │ │ │ -
113 }
│ │ │ │ -
│ │ │ │ -
114
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
117 {
│ │ │ │ -
118 return size(Dune::ReservedVector<size_type, multiIndexBufferSize>{});
│ │ │ │ -
119 }
│ │ │ │ -
│ │ │ │ -
120
│ │ │ │ -
122
│ │ │ │ -
123 template<class SizePrefix>
│ │ │ │ -
│ │ │ │ -
124 size_type size(const SizePrefix& prefix) const
│ │ │ │ -
125 {
│ │ │ │ -
126 return size(prefix, IndexMergingStrategy{});
│ │ │ │ -
127 }
│ │ │ │ -
│ │ │ │ -
128
│ │ │ │ -
129private:
│ │ │ │ -
130
│ │ │ │ -
131 template<class SizePrefix>
│ │ │ │ -
132 size_type size(const SizePrefix& prefix, BasisFactory::FlatInterleaved) const
│ │ │ │ -
133 {
│ │ │ │ -
134 // The root index size is the root index size of a single subnode
│ │ │ │ -
135 // multiplied by the number of subnodes because we enumerate all
│ │ │ │ -
136 // child indices in a row.
│ │ │ │ -
137 if (prefix.size() == 0)
│ │ │ │ -
138 return children*subPreBasis_.size();
│ │ │ │ -
139
│ │ │ │ -
140 // The first prefix entry refers to one of the (root index size)
│ │ │ │ -
141 // subindex trees. Hence we have to first compute the corresponding
│ │ │ │ -
142 // prefix entry for a single subnode subnode. The we can append
│ │ │ │ -
143 // the other prefix entries unmodified, because the index tree
│ │ │ │ -
144 // looks the same after the first level.
│ │ │ │ -
145 SizePrefix subPrefix;
│ │ │ │ -
146 subPrefix.push_back(prefix[0] / children);
│ │ │ │ -
147 for(std::size_t i=1; i<prefix.size(); ++i)
│ │ │ │ -
148 subPrefix.push_back(prefix[i]);
│ │ │ │ -
149 return subPreBasis_.size(subPrefix);
│ │ │ │ -
150 }
│ │ │ │ -
151
│ │ │ │ -
152 template<class SizePrefix>
│ │ │ │ -
153 size_type size(const SizePrefix& prefix, BasisFactory::FlatLexicographic) const
│ │ │ │ -
154 {
│ │ │ │ -
155 // The size at the index tree root is the size of at the index tree
│ │ │ │ -
156 // root of a single subnode multiplied by the number of subnodes
│ │ │ │ -
157 // because we enumerate all child indices in a row.
│ │ │ │ -
158 if (prefix.size() == 0)
│ │ │ │ -
159 return children*subPreBasis_.size();
│ │ │ │ -
160
│ │ │ │ -
161 // The first prefix entry refers to one of the (root index size)
│ │ │ │ -
162 // subindex trees. Hence we have to first compute the corresponding
│ │ │ │ -
163 // prefix entry for a single subnode subnode. The we can append
│ │ │ │ -
164 // the other prefix entries unmodified, because the index tree
│ │ │ │ -
165 // looks the same after the first level.
│ │ │ │ -
166 SizePrefix subPrefix;
│ │ │ │ -
167 subPrefix.push_back(prefix[0] % children);
│ │ │ │ -
168 for(std::size_t i=1; i<prefix.size(); ++i)
│ │ │ │ -
169 subPrefix.push_back(prefix[i]);
│ │ │ │ -
170 return subPreBasis_.size(subPrefix);
│ │ │ │ -
171 }
│ │ │ │ -
172
│ │ │ │ -
173 template<class SizePrefix>
│ │ │ │ -
174 size_type size(const SizePrefix& prefix, BasisFactory::BlockedLexicographic) const
│ │ │ │ -
175 {
│ │ │ │ -
176 if (prefix.size() == 0)
│ │ │ │ -
177 return children;
│ │ │ │ -
178 SizePrefix subPrefix;
│ │ │ │ -
179 for(std::size_t i=1; i<prefix.size(); ++i)
│ │ │ │ -
180 subPrefix.push_back(prefix[i]);
│ │ │ │ -
181 return subPreBasis_.size(subPrefix);
│ │ │ │ -
182 }
│ │ │ │ -
183
│ │ │ │ -
184 template<class SizePrefix>
│ │ │ │ -
185 size_type size(const SizePrefix& prefix, BasisFactory::BlockedInterleaved) const
│ │ │ │ -
186 {
│ │ │ │ -
187 if (prefix.size() == 0)
│ │ │ │ -
188 return subPreBasis_.size();
│ │ │ │ -
189
│ │ │ │ -
190 SizePrefix subPrefix;
│ │ │ │ -
191 for(std::size_t i=0; i<prefix.size()-1; ++i)
│ │ │ │ -
192 subPrefix.push_back(prefix[i]);
│ │ │ │ -
193
│ │ │ │ -
194 size_type r = subPreBasis_.size(subPrefix);
│ │ │ │ -
195 if (r==0)
│ │ │ │ -
196 return 0;
│ │ │ │ -
197 subPrefix.push_back(prefix.back());
│ │ │ │ -
198 r = subPreBasis_.size(subPrefix);
│ │ │ │ -
199 if (r==0)
│ │ │ │ -
200 return children;
│ │ │ │ -
201 return r;
│ │ │ │ -
202 }
│ │ │ │ -
203
│ │ │ │ -
204public:
│ │ │ │ -
205
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
208 {
│ │ │ │ -
209 return subPreBasis_.dimension() * children;
│ │ │ │ -
210 }
│ │ │ │ -
│ │ │ │ -
211
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
214 {
│ │ │ │ -
215 return subPreBasis_.maxNodeSize() * children;
│ │ │ │ -
216 }
│ │ │ │ -
│ │ │ │ -
217
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
220 {
│ │ │ │ -
221 return subPreBasis_;
│ │ │ │ -
222 }
│ │ │ │ -
│ │ │ │ -
223
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
226 {
│ │ │ │ -
227 return subPreBasis_;
│ │ │ │ -
228 }
│ │ │ │ -
│ │ │ │ -
229
│ │ │ │ -
231 template<typename It>
│ │ │ │ -
│ │ │ │ -
232 It indices(const Node& node, It it) const
│ │ │ │ -
233 {
│ │ │ │ -
234 return indices(node, it, IndexMergingStrategy{});
│ │ │ │ -
235 }
│ │ │ │ -
│ │ │ │ -
236
│ │ │ │ -
237private:
│ │ │ │ -
238
│ │ │ │ -
239 template<typename It>
│ │ │ │ -
240 It indices(const Node& node, It multiIndices, BasisFactory::FlatInterleaved) const
│ │ │ │ -
241 {
│ │ │ │ -
242 using namespace Dune::Indices;
│ │ │ │ -
243 size_type subTreeSize = node.child(_0).size();
│ │ │ │ -
244 // Fill indices for first child at the beginning.
│ │ │ │ -
245 auto next = subPreBasis().indices(node.child(_0), multiIndices);
│ │ │ │ -
246 // Multiply first component of all indices for first child by
│ │ │ │ -
247 // number of children to stretch the index range for interleaving.
│ │ │ │ -
248 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ │ -
249 multiIndices[i][0] *= children;
│ │ │ │ -
250 for (std::size_t child = 1; child<children; ++child)
│ │ │ │ -
251 {
│ │ │ │ -
252 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ │ -
253 {
│ │ │ │ -
254 // Copy indices from first child for all other children
│ │ │ │ -
255 // and shift them by child index to interleave indices.
│ │ │ │ -
256 // multiIndices[child*subTreeSize+i] = multiIndices[i];
│ │ │ │ -
257 // multiIndices[child*subTreeSize+i][0] = multiIndices[i][0]+child;
│ │ │ │ -
258 (*next) = multiIndices[i];
│ │ │ │ -
259 (*next)[0] = multiIndices[i][0]+child;
│ │ │ │ -
260 ++next;
│ │ │ │ -
261 }
│ │ │ │ -
262 }
│ │ │ │ -
263 return next;
│ │ │ │ -
264 }
│ │ │ │ -
265
│ │ │ │ -
266 template<typename It>
│ │ │ │ -
267 It indices(const Node& node, It multiIndices, BasisFactory::FlatLexicographic) const
│ │ │ │ -
268 {
│ │ │ │ -
269 using namespace Dune::Indices;
│ │ │ │ -
270 size_type subTreeSize = node.child(_0).size();
│ │ │ │ -
271 size_type firstIndexEntrySize = subPreBasis().size();
│ │ │ │ -
272 // Fill indices for first child at the beginning.
│ │ │ │ -
273 auto next = subPreBasis().indices(node.child(_0), multiIndices);
│ │ │ │ -
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 suitable offset to get lexicographic indices.
│ │ │ │ -
280 // multiIndices[child*subTreeSize+i] = multiIndices[i];
│ │ │ │ -
281 // multiIndices[child*subTreeSize+i][0] += child*firstIndexEntrySize;
│ │ │ │ -
282 (*next) = multiIndices[i];
│ │ │ │ -
283 (*next)[0] += child*firstIndexEntrySize;
│ │ │ │ -
284 ++next;
│ │ │ │ -
285 }
│ │ │ │ -
286 }
│ │ │ │ -
287 return next;
│ │ │ │ -
288 }
│ │ │ │ -
289
│ │ │ │ -
290 template<class MultiIndex>
│ │ │ │ -
291 static void multiIndexPushFront(MultiIndex& M, size_type M0)
│ │ │ │ -
292 {
│ │ │ │ -
293 M.resize(M.size()+1);
│ │ │ │ -
294 for(std::size_t i=M.size()-1; i>0; --i)
│ │ │ │ -
295 M[i] = M[i-1];
│ │ │ │ -
296 M[0] = M0;
│ │ │ │ -
297 }
│ │ │ │ -
298
│ │ │ │ -
299 template<typename It>
│ │ │ │ -
300 It indices(const Node& node, It multiIndices, BasisFactory::BlockedLexicographic) const
│ │ │ │ -
301 {
│ │ │ │ -
302 using namespace Dune::Indices;
│ │ │ │ -
303 size_type subTreeSize = node.child(_0).size();
│ │ │ │ -
304 // Fill indices for first child at the beginning.
│ │ │ │ -
305 auto next = subPreBasis().indices(node.child(_0), multiIndices);
│ │ │ │ -
306 // Insert 0 before first component of all indices for first child.
│ │ │ │ -
307 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ │ -
308 multiIndexPushFront(multiIndices[i], 0);
│ │ │ │ -
309 for (std::size_t child = 1; child<children; ++child)
│ │ │ │ -
310 {
│ │ │ │ -
311 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ │ -
312 {
│ │ │ │ -
313 // Copy indices from first child for all other children and overwrite
│ │ │ │ -
314 // zero in first component as inserted above by child index.
│ │ │ │ -
315 // multiIndices[child*subTreeSize+i] = multiIndices[i];
│ │ │ │ -
316 // multiIndices[child*subTreeSize+i][0] = child;
│ │ │ │ -
317 (*next) = multiIndices[i];
│ │ │ │ -
318 (*next)[0] = child;
│ │ │ │ -
319 ++next;
│ │ │ │ -
320 }
│ │ │ │ -
321 }
│ │ │ │ -
322 return next;
│ │ │ │ -
323 }
│ │ │ │ -
324
│ │ │ │ -
325 template<typename It>
│ │ │ │ -
326 It indices(const Node& node, It multiIndices, BasisFactory::BlockedInterleaved) const
│ │ │ │ -
327 {
│ │ │ │ -
328 using namespace Dune::Indices;
│ │ │ │ -
329 size_type subTreeSize = node.child(_0).size();
│ │ │ │ -
330 // Fill indices for first child at the beginning.
│ │ │ │ -
331 auto next = subPreBasis().indices(node.child(_0), multiIndices);
│ │ │ │ -
332 // Append 0 after last component of all indices for first child.
│ │ │ │ -
333 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ │ -
334 multiIndices[i].push_back(0);
│ │ │ │ -
335 for (std::size_t child = 1; child<children; ++child)
│ │ │ │ -
336 {
│ │ │ │ -
337 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ │ -
338 {
│ │ │ │ -
339 // Copy indices from first child for all other children and overwrite
│ │ │ │ -
340 // zero in last component as appended above by child index.
│ │ │ │ -
341 (*next) = multiIndices[i];
│ │ │ │ -
342 (*next).back() = child;
│ │ │ │ -
343 ++next;
│ │ │ │ -
344 }
│ │ │ │ -
345 }
│ │ │ │ -
346 return next;
│ │ │ │ -
347 }
│ │ │ │ -
348
│ │ │ │ -
349 SubPreBasis subPreBasis_;
│ │ │ │ -
350};
│ │ │ │ -
│ │ │ │ -
351
│ │ │ │ -
352
│ │ │ │ -
353
│ │ │ │ -
354namespace BasisFactory {
│ │ │ │ -
355
│ │ │ │ -
368template<std::size_t k, class ChildPreBasisFactory, class IndexMergingStrategy>
│ │ │ │ -
369auto power(ChildPreBasisFactory&& childPreBasisFactory, const IndexMergingStrategy&)
│ │ │ │ -
370{
│ │ │ │ -
371 return [childPreBasisFactory](const auto& gridView) {
│ │ │ │ -
372 auto childPreBasis = childPreBasisFactory(gridView);
│ │ │ │ -
373 return PowerPreBasis<IndexMergingStrategy, decltype(childPreBasis), k>(std::move(childPreBasis));
│ │ │ │ -
374 };
│ │ │ │ -
375}
│ │ │ │ -
376
│ │ │ │ -
387template<std::size_t k, class ChildPreBasisFactory>
│ │ │ │ -
388auto power(ChildPreBasisFactory&& childPreBasisFactory)
│ │ │ │ -
389{
│ │ │ │ -
390 return [childPreBasisFactory](const auto& gridView) {
│ │ │ │ -
391 auto childPreBasis = childPreBasisFactory(gridView);
│ │ │ │ -
392 return PowerPreBasis<BlockedInterleaved, decltype(childPreBasis), k>(std::move(childPreBasis));
│ │ │ │ -
393 };
│ │ │ │ -
394}
│ │ │ │ -
395
│ │ │ │ -
396} // end namespace BasisFactory
│ │ │ │ -
397
│ │ │ │ -
398// Backward compatibility
│ │ │ │ -
399namespace BasisBuilder {
│ │ │ │ -
400
│ │ │ │ -
401 using namespace BasisFactory;
│ │ │ │ -
402
│ │ │ │ -
403}
│ │ │ │ -
404
│ │ │ │ -
405
│ │ │ │ -
406} // end namespace Functions
│ │ │ │ -
407} // end namespace Dune
│ │ │ │ -
408
│ │ │ │ -
409
│ │ │ │ -
410#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
typename std::enable_if< std::is_constructible< T, Args... >::value, int >::type enableIfConstructible
Helper to constrain forwarding constructors.
Definition type_traits.hh:26
│ │ │ │ +
104#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
AnalyticGridViewFunction< typename std::invoke_result< F, typename GridView::template Codim< 0 >::Geometry::GlobalCoordinate >::type(typename GridView::template Codim< 0 >::Geometry::GlobalCoordinate), GridView, typename std::decay< F >::type > makeAnalyticGridViewFunction(F &&f, const GridView &gridView)
Create an AnalyticGridViewFunction from a function and a grid view.
Definition analyticgridviewfunction.hh:230
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
Interleaved merging of direct children without blocking.
Definition basistags.hh:114
│ │ │ │ -
Definition nodes.hh:193
│ │ │ │ -
A pre-basis for power bases.
Definition powerbasis.hh:45
│ │ │ │ -
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition powerbasis.hh:207
│ │ │ │ -
std::size_t size_type
Type used for indices and size information.
Definition powerbasis.hh:58
│ │ │ │ -
IMS IndexMergingStrategy
Strategy used to merge the global indices of the child factories.
Definition powerbasis.hh:61
│ │ │ │ -
PowerBasisNode< SubNode, children > Node
Template mapping root tree path to type of created tree node.
Definition powerbasis.hh:66
│ │ │ │ -
typename SPB::GridView GridView
The grid view that the FE basis is defined on.
Definition powerbasis.hh:55
│ │ │ │ -
static constexpr size_type multiIndexBufferSize
Definition powerbasis.hh:70
│ │ │ │ -
SPB SubPreBasis
The child pre-basis.
Definition powerbasis.hh:52
│ │ │ │ -
typename SubPreBasis::Node SubNode
Definition powerbasis.hh:63
│ │ │ │ -
void initializeIndices()
Initialize the global indices.
Definition powerbasis.hh:87
│ │ │ │ -
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition powerbasis.hh:99
│ │ │ │ -
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 powerbasis.hh:232
│ │ │ │ -
PowerPreBasis(SFArgs &&... sfArgs)
Constructor for given child pre-basis objects.
Definition powerbasis.hh:80
│ │ │ │ -
size_type size() const
Same as size(prefix) with empty prefix.
Definition powerbasis.hh:116
│ │ │ │ -
SubPreBasis & subPreBasis()
Mutable access to the stored prebasis of the factor in the power space.
Definition powerbasis.hh:225
│ │ │ │ -
Node makeNode() const
Create tree node.
Definition powerbasis.hh:107
│ │ │ │ -
static constexpr size_type maxMultiIndexSize
Definition powerbasis.hh:68
│ │ │ │ -
static constexpr size_type minMultiIndexSize
Definition powerbasis.hh:69
│ │ │ │ -
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition powerbasis.hh:213
│ │ │ │ -
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition powerbasis.hh:93
│ │ │ │ -
size_type size(const SizePrefix &prefix) const
Return number of possible values for next position in multi index.
Definition powerbasis.hh:124
│ │ │ │ -
const SubPreBasis & subPreBasis() const
Const access to the stored prebasis of the factor in the power space.
Definition powerbasis.hh:219
│ │ │ │ - │ │ │ │ +
std::decay< F >::type makeGridViewFunction(F &&f, const GridView &gridView)
Construct a function modeling GridViewFunction from function and grid view.
Definition gridviewfunction.hh:68
│ │ │ │ +
Definition gridfunction.hh:32
│ │ │ │ +
An entity set for all entities of given codim in a grid view.
Definition gridviewentityset.hh:23
│ │ │ │ +
Definition gridviewfunction.hh:22
│ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,488 +1,107 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -powerbasis.hh │ │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ -8#include │ │ │ │ │ +6#include │ │ │ │ │ +7 │ │ │ │ │ +8#include │ │ │ │ │ 9 │ │ │ │ │ -10#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 <_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> │ │ │ │ │ -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_/_b_a_s_i_s_t_a_g_s_._h_h> │ │ │ │ │ -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_/_c_o_n_c_e_p_t_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_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ │ -16 │ │ │ │ │ +10#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> │ │ │ │ │ +11#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> │ │ │ │ │ +12#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> │ │ │ │ │ +13 │ │ │ │ │ +14 │ │ │ │ │ +15namespace _D_u_n_e { │ │ │ │ │ +16namespace Functions { │ │ │ │ │ 17 │ │ │ │ │ 18 │ │ │ │ │ -19namespace _D_u_n_e { │ │ │ │ │ -20namespace Functions { │ │ │ │ │ -21 │ │ │ │ │ -22 │ │ │ │ │ -23/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -24// This is the reusable part of the power bases. It contains │ │ │ │ │ -25// │ │ │ │ │ -26// PowerPreBasis │ │ │ │ │ -27// │ │ │ │ │ -28// The pre-basis allows to create the others and is the owner of possible │ │ │ │ │ -shared │ │ │ │ │ -29// state. These components do _not_ depend on the global basis and local view │ │ │ │ │ -30// and can be used without a global basis. │ │ │ │ │ -31/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -32 │ │ │ │ │ -43template │ │ │ │ │ -_4_4class _P_o_w_e_r_P_r_e_B_a_s_i_s │ │ │ │ │ -45{ │ │ │ │ │ -46 static const std::size_t children = C; │ │ │ │ │ -47 static const bool isBlocked = std::is_same_v or std::is_same_v; │ │ │ │ │ -48 │ │ │ │ │ -49public: │ │ │ │ │ +19 │ │ │ │ │ +20template class │ │ │ │ │ +DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56> │ │ │ │ │ +_2_1class _G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ │ +22{}; │ │ │ │ │ +23 │ │ │ │ │ +24 │ │ │ │ │ +25 │ │ │ │ │ +40template class │ │ │ │ │ +DerivativeTraits, size_t bufferSize> │ │ │ │ │ +_4_1class _G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n : │ │ │ │ │ +42 public _G_r_i_d_F_u_n_c_t_i_o_n, │ │ │ │ │ +DerivativeTraits, bufferSize> │ │ │ │ │ +43{ │ │ │ │ │ +44 using _B_a_s_e = _G_r_i_d_F_u_n_c_t_i_o_n, │ │ │ │ │ +DerivativeTraits, bufferSize>; │ │ │ │ │ +45public: │ │ │ │ │ +_4_6 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ │ +47 │ │ │ │ │ +48 using Base::Base; │ │ │ │ │ +49}; │ │ │ │ │ 50 │ │ │ │ │ -_5_2 using _S_u_b_P_r_e_B_a_s_i_s = SPB; │ │ │ │ │ -53 │ │ │ │ │ -_5_5 using _G_r_i_d_V_i_e_w = typename SPB::GridView; │ │ │ │ │ -56 │ │ │ │ │ -_5_8 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ -59 │ │ │ │ │ -_6_1 using _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y = IMS; │ │ │ │ │ -62 │ │ │ │ │ -_6_3 using _S_u_b_N_o_d_e = typename SubPreBasis::Node; │ │ │ │ │ -64 │ │ │ │ │ -_6_6 using _N_o_d_e = _P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_S_u_b_N_o_d_e_,_ _c_h_i_l_d_r_e_n_>; │ │ │ │ │ -67 │ │ │ │ │ -_6_8 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; │ │ │ │ │ -_6_9 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_0 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; │ │ │ │ │ -71 │ │ │ │ │ -77 template = 0, │ │ │ │ │ -79 _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_0 _P_o_w_e_r_P_r_e_B_a_s_i_s(SFArgs&&... sfArgs) : │ │ │ │ │ -81 subPreBasis_(std::forward(sfArgs)...) │ │ │ │ │ -82 { │ │ │ │ │ -83 static_assert(models, _S_u_b_P_r_e_B_a_s_i_s>(), │ │ │ │ │ -"Subprebasis passed to PowerPreBasis does not model the PreBasis concept."); │ │ │ │ │ -84 } │ │ │ │ │ -85 │ │ │ │ │ -_8_7 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ │ -88 { │ │ │ │ │ -89 subPreBasis_.initializeIndices(); │ │ │ │ │ -90 } │ │ │ │ │ -91 │ │ │ │ │ -_9_3 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ │ -94 { │ │ │ │ │ -95 return subPreBasis_.gridView(); │ │ │ │ │ -96 } │ │ │ │ │ -97 │ │ │ │ │ -_9_9 void _u_p_d_a_t_e(const _G_r_i_d_V_i_e_w& gv) │ │ │ │ │ -100 { │ │ │ │ │ -101 subPreBasis_.update(gv); │ │ │ │ │ -102 } │ │ │ │ │ +51 │ │ │ │ │ +52 │ │ │ │ │ +64template() , int>::type = 0> │ │ │ │ │ +67typename std::decay::type │ │ │ │ │ +_6_8 _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) │ │ │ │ │ +69{ │ │ │ │ │ +70 return std::forward(f); │ │ │ │ │ +71} │ │ │ │ │ +72 │ │ │ │ │ +73 │ │ │ │ │ +74 │ │ │ │ │ +90template()) , int>::type = 0> │ │ │ │ │ +_9_3auto _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) │ │ │ │ │ +94 -> 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)) │ │ │ │ │ +95{ │ │ │ │ │ +96 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); │ │ │ │ │ +97} │ │ │ │ │ +98 │ │ │ │ │ +99 │ │ │ │ │ +100 │ │ │ │ │ +101} // end of namespace Dune::Functions │ │ │ │ │ +102} // end of namespace Dune │ │ │ │ │ 103 │ │ │ │ │ -_1_0_7 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ │ -108 { │ │ │ │ │ -109 auto node = _N_o_d_e{}; │ │ │ │ │ -110 for (std::size_t i=0; i{}); │ │ │ │ │ -119 } │ │ │ │ │ -120 │ │ │ │ │ -122 │ │ │ │ │ -123 template │ │ │ │ │ -_1_2_4 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix) const │ │ │ │ │ -125 { │ │ │ │ │ -126 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{}); │ │ │ │ │ -127 } │ │ │ │ │ -128 │ │ │ │ │ -129private: │ │ │ │ │ -130 │ │ │ │ │ -131 template │ │ │ │ │ -132 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix, _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 │ │ │ │ │ -133 { │ │ │ │ │ -134 // The root index size is the root index size of a single subnode │ │ │ │ │ -135 // multiplied by the number of subnodes because we enumerate all │ │ │ │ │ -136 // child indices in a row. │ │ │ │ │ -137 if (prefix.size() == 0) │ │ │ │ │ -138 return children*subPreBasis_.size(); │ │ │ │ │ -139 │ │ │ │ │ -140 // The first prefix entry refers to one of the (root index size) │ │ │ │ │ -141 // subindex trees. Hence we have to first compute the corresponding │ │ │ │ │ -142 // prefix entry for a single subnode subnode. The we can append │ │ │ │ │ -143 // the other prefix entries unmodified, because the index tree │ │ │ │ │ -144 // looks the same after the first level. │ │ │ │ │ -145 SizePrefix subPrefix; │ │ │ │ │ -146 subPrefix.push_back(prefix[0] / children); │ │ │ │ │ -147 for(std::size_t i=1; i │ │ │ │ │ -153 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix, BasisFactory::FlatLexicographic) │ │ │ │ │ -const │ │ │ │ │ -154 { │ │ │ │ │ -155 // The size at the index tree root is the size of at the index tree │ │ │ │ │ -156 // root of a single subnode multiplied by the number of subnodes │ │ │ │ │ -157 // because we enumerate all child indices in a row. │ │ │ │ │ -158 if (prefix.size() == 0) │ │ │ │ │ -159 return children*subPreBasis_.size(); │ │ │ │ │ -160 │ │ │ │ │ -161 // The first prefix entry refers to one of the (root index size) │ │ │ │ │ -162 // subindex trees. Hence we have to first compute the corresponding │ │ │ │ │ -163 // prefix entry for a single subnode subnode. The we can append │ │ │ │ │ -164 // the other prefix entries unmodified, because the index tree │ │ │ │ │ -165 // looks the same after the first level. │ │ │ │ │ -166 SizePrefix subPrefix; │ │ │ │ │ -167 subPrefix.push_back(prefix[0] % children); │ │ │ │ │ -168 for(std::size_t i=1; i │ │ │ │ │ -174 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix, BasisFactory:: │ │ │ │ │ -BlockedLexicographic) const │ │ │ │ │ -175 { │ │ │ │ │ -176 if (prefix.size() == 0) │ │ │ │ │ -177 return children; │ │ │ │ │ -178 SizePrefix subPrefix; │ │ │ │ │ -179 for(std::size_t i=1; i │ │ │ │ │ -185 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix, BasisFactory::BlockedInterleaved) │ │ │ │ │ -const │ │ │ │ │ -186 { │ │ │ │ │ -187 if (prefix.size() == 0) │ │ │ │ │ -188 return subPreBasis_.size(); │ │ │ │ │ -189 │ │ │ │ │ -190 SizePrefix subPrefix; │ │ │ │ │ -191 for(std::size_t i=0; i │ │ │ │ │ -_2_3_2 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ │ -233 { │ │ │ │ │ -234 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{}); │ │ │ │ │ -235 } │ │ │ │ │ -236 │ │ │ │ │ -237private: │ │ │ │ │ -238 │ │ │ │ │ -239 template │ │ │ │ │ -240 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_I_n_t_e_r_l_e_a_v_e_d) const │ │ │ │ │ -241 { │ │ │ │ │ -242 using namespace Dune::Indices; │ │ │ │ │ -243 _s_i_z_e___t_y_p_e subTreeSize = node.child(_0).size(); │ │ │ │ │ -244 // Fill indices for first child at the beginning. │ │ │ │ │ -245 auto next = _s_u_b_P_r_e_B_a_s_i_s().indices(node.child(_0), multiIndices); │ │ │ │ │ -246 // Multiply first component of all indices for first child by │ │ │ │ │ -247 // number of children to stretch the index range for interleaving. │ │ │ │ │ -248 for (std::size_t i = 0; i │ │ │ │ │ -267 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It multiIndices, BasisFactory:: │ │ │ │ │ -FlatLexicographic) const │ │ │ │ │ -268 { │ │ │ │ │ -269 using namespace Dune::Indices; │ │ │ │ │ -270 _s_i_z_e___t_y_p_e subTreeSize = node.child(_0).size(); │ │ │ │ │ -271 _s_i_z_e___t_y_p_e firstIndexEntrySize = _s_u_b_P_r_e_B_a_s_i_s().size(); │ │ │ │ │ -272 // Fill indices for first child at the beginning. │ │ │ │ │ -273 auto next = _s_u_b_P_r_e_B_a_s_i_s().indices(node.child(_0), multiIndices); │ │ │ │ │ -274 for (std::size_t child = 1; child │ │ │ │ │ -291 static void multiIndexPushFront(MultiIndex& M, _s_i_z_e___t_y_p_e M0) │ │ │ │ │ -292 { │ │ │ │ │ -293 M.resize(M.size()+1); │ │ │ │ │ -294 for(std::size_t i=M.size()-1; i>0; --i) │ │ │ │ │ -295 M[i] = M[i-1]; │ │ │ │ │ -296 M[0] = M0; │ │ │ │ │ -297 } │ │ │ │ │ -298 │ │ │ │ │ -299 template │ │ │ │ │ -300 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It multiIndices, BasisFactory:: │ │ │ │ │ -BlockedLexicographic) const │ │ │ │ │ -301 { │ │ │ │ │ -302 using namespace Dune::Indices; │ │ │ │ │ -303 _s_i_z_e___t_y_p_e subTreeSize = node.child(_0).size(); │ │ │ │ │ -304 // Fill indices for first child at the beginning. │ │ │ │ │ -305 auto next = _s_u_b_P_r_e_B_a_s_i_s().indices(node.child(_0), multiIndices); │ │ │ │ │ -306 // Insert 0 before first component of all indices for first child. │ │ │ │ │ -307 for (std::size_t i = 0; i │ │ │ │ │ -326 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It multiIndices, BasisFactory:: │ │ │ │ │ -BlockedInterleaved) const │ │ │ │ │ -327 { │ │ │ │ │ -328 using namespace Dune::Indices; │ │ │ │ │ -329 _s_i_z_e___t_y_p_e subTreeSize = node.child(_0).size(); │ │ │ │ │ -330 // Fill indices for first child at the beginning. │ │ │ │ │ -331 auto next = _s_u_b_P_r_e_B_a_s_i_s().indices(node.child(_0), multiIndices); │ │ │ │ │ -332 // Append 0 after last component of all indices for first child. │ │ │ │ │ -333 for (std::size_t i = 0; i │ │ │ │ │ -369auto power(ChildPreBasisFactory&& childPreBasisFactory, const │ │ │ │ │ -IndexMergingStrategy&) │ │ │ │ │ -370{ │ │ │ │ │ -371 return [childPreBasisFactory](const auto& gridView) { │ │ │ │ │ -372 auto childPreBasis = childPreBasisFactory(gridView); │ │ │ │ │ -373 return PowerPreBasis │ │ │ │ │ -(std::move(childPreBasis)); │ │ │ │ │ -374 }; │ │ │ │ │ -375} │ │ │ │ │ -376 │ │ │ │ │ -387template │ │ │ │ │ -388auto power(ChildPreBasisFactory&& childPreBasisFactory) │ │ │ │ │ -389{ │ │ │ │ │ -390 return [childPreBasisFactory](const auto& gridView) { │ │ │ │ │ -391 auto childPreBasis = childPreBasisFactory(gridView); │ │ │ │ │ -392 return PowerPreBasis(std:: │ │ │ │ │ -move(childPreBasis)); │ │ │ │ │ -393 }; │ │ │ │ │ -394} │ │ │ │ │ -395 │ │ │ │ │ -396} // end namespace BasisFactory │ │ │ │ │ -397 │ │ │ │ │ -398// Backward compatibility │ │ │ │ │ -399namespace BasisBuilder { │ │ │ │ │ -400 │ │ │ │ │ -401 using namespace BasisFactory; │ │ │ │ │ -402 │ │ │ │ │ -403} │ │ │ │ │ -404 │ │ │ │ │ -405 │ │ │ │ │ -406} // end namespace Functions │ │ │ │ │ -407} // end namespace Dune │ │ │ │ │ -408 │ │ │ │ │ -409 │ │ │ │ │ -410#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH │ │ │ │ │ -_b_a_s_i_s_t_a_g_s_._h_h │ │ │ │ │ -_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ │ -_n_o_d_e_s_._h_h │ │ │ │ │ -_t_y_p_e___t_r_a_i_t_s_._h_h │ │ │ │ │ -_u_t_i_l_i_t_y_._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 │ │ │ │ │ -typename std::enable_if< std::is_constructible< T, Args... >::value, int >:: │ │ │ │ │ -type enableIfConstructible │ │ │ │ │ -Helper to constrain forwarding constructors. │ │ │ │ │ -DDeeffiinniittiioonn type_traits.hh:26 │ │ │ │ │ +104#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH │ │ │ │ │ +_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 │ │ │ │ │ +_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 │ │ │ │ │ +AnalyticGridViewFunction< typename std::invoke_result< F, typename GridView:: │ │ │ │ │ +template Codim< 0 >::Geometry::GlobalCoordinate >::type(typename GridView:: │ │ │ │ │ +template Codim< 0 >::Geometry::GlobalCoordinate), GridView, typename std:: │ │ │ │ │ +decay< F >::type > makeAnalyticGridViewFunction(F &&f, const GridView │ │ │ │ │ +&gridView) │ │ │ │ │ +Create an AnalyticGridViewFunction from a function and a grid view. │ │ │ │ │ +DDeeffiinniittiioonn analyticgridviewfunction.hh:230 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:114 │ │ │ │ │ -_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:193 │ │ │ │ │ -_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:45 │ │ │ │ │ -_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_:_:_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 powerbasis.hh:207 │ │ │ │ │ -_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 │ │ │ │ │ -std::size_t size_type │ │ │ │ │ -Type used for indices and size information. │ │ │ │ │ -DDeeffiinniittiioonn powerbasis.hh:58 │ │ │ │ │ -_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:61 │ │ │ │ │ -_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< SubNode, children > Node │ │ │ │ │ -Template mapping root tree path to type of created tree node. │ │ │ │ │ -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_:_:_G_r_i_d_V_i_e_w │ │ │ │ │ -typename SPB::GridView GridView │ │ │ │ │ -The grid view that the FE basis is defined on. │ │ │ │ │ -DDeeffiinniittiioonn powerbasis.hh:55 │ │ │ │ │ -_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_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 powerbasis.hh:70 │ │ │ │ │ -_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:52 │ │ │ │ │ -_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_N_o_d_e │ │ │ │ │ -typename SubPreBasis::Node SubNode │ │ │ │ │ -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_:_:_i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ │ -void initializeIndices() │ │ │ │ │ -Initialize the global indices. │ │ │ │ │ -DDeeffiinniittiioonn powerbasis.hh:87 │ │ │ │ │ -_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_:_:_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 powerbasis.hh:99 │ │ │ │ │ -_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 Node &node, It it) const │ │ │ │ │ -Maps from subtree index set [0..size-1] to a globally unique multi index in │ │ │ │ │ -global basis. │ │ │ │ │ -DDeeffiinniittiioonn powerbasis.hh:232 │ │ │ │ │ -_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. │ │ │ │ │ -DDeeffiinniittiioonn powerbasis.hh:80 │ │ │ │ │ -_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:116 │ │ │ │ │ -_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 │ │ │ │ │ -SubPreBasis & subPreBasis() │ │ │ │ │ -Mutable access to the stored prebasis of the factor in the power space. │ │ │ │ │ -DDeeffiinniittiioonn powerbasis.hh:225 │ │ │ │ │ -_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:107 │ │ │ │ │ -_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_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ -static constexpr size_type maxMultiIndexSize │ │ │ │ │ -DDeeffiinniittiioonn powerbasis.hh:68 │ │ │ │ │ -_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_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ -static constexpr size_type minMultiIndexSize │ │ │ │ │ -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_:_:_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 powerbasis.hh:213 │ │ │ │ │ -_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_:_:_g_r_i_d_V_i_e_w │ │ │ │ │ -const GridView & gridView() const │ │ │ │ │ -Obtain the grid view that the basis is defined on. │ │ │ │ │ -DDeeffiinniittiioonn powerbasis.hh:93 │ │ │ │ │ -_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:124 │ │ │ │ │ -_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 │ │ │ │ │ -const SubPreBasis & subPreBasis() const │ │ │ │ │ -Const access to the stored prebasis of the factor in the power space. │ │ │ │ │ -DDeeffiinniittiioonn powerbasis.hh:219 │ │ │ │ │ -_c_o_n_c_e_p_t_s_._h_h │ │ │ │ │ +_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< F >::type makeGridViewFunction(F &&f, const GridView &gridView) │ │ │ │ │ +Construct a function modeling GridViewFunction from function and grid view. │ │ │ │ │ +DDeeffiinniittiioonn gridviewfunction.hh:68 │ │ │ │ │ +_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: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 │ │ │ │ │ +An entity set for all entities of given codim in a grid view. │ │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:23 │ │ │ │ │ +_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:22 │ │ │ │ │ +_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:46 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00026.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: bsplinebasis.hh File Reference │ │ │ │ +dune-functions: gridviewentityset.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,86 +65,41 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces | │ │ │ │ -Typedefs | │ │ │ │ -Functions
│ │ │ │ -
bsplinebasis.hh File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
gridviewentityset.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 <memory>
│ │ │ │
│ │ │ │

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::GridViewEntitySet< GV, cd >
 An entity set for all entities of given codim in a grid view. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ 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.
 
│ │ │ │ -

Detailed Description

│ │ │ │ -

The B-spline global function space basis.

│ │ │ │ -
│ │ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,64 +1,22 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -bsplinebasis.hh File Reference │ │ │ │ │ -The B-spline global function space basis. _M_o_r_e_._._. │ │ │ │ │ -#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> │ │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ +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_:_:_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_:_:_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 │ │ │ │ │   │ │ │ │ │ -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< GV │ │ │ │ │ - > > │ │ │ │ │ -  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. │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00026_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: bsplinebasis.hh Source File │ │ │ │ +dune-functions: gridviewentityset.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,1311 +70,123 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
bsplinebasis.hh
│ │ │ │ +
gridviewentityset.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BSPLINEBASIS_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BSPLINEBASIS_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH
│ │ │ │
5
│ │ │ │ -
10#include <array>
│ │ │ │ -
11#include <numeric>
│ │ │ │ +
6#include <memory>
│ │ │ │ +
7
│ │ │ │ +
8
│ │ │ │ +
9namespace Dune {
│ │ │ │ +
10
│ │ │ │ +
11namespace Functions {
│ │ │ │
12
│ │ │ │ -
14#include <dune/common/dynmatrix.hh>
│ │ │ │ -
15
│ │ │ │ -
16#include <dune/localfunctions/common/localbasis.hh>
│ │ │ │ -
17#include <dune/common/diagonalmatrix.hh>
│ │ │ │ -
18#include <dune/localfunctions/common/localkey.hh>
│ │ │ │ -
19#include <dune/localfunctions/common/localfiniteelementtraits.hh>
│ │ │ │ -
20#include <dune/geometry/type.hh>
│ │ │ │ - │ │ │ │ - │ │ │ │ -
23
│ │ │ │ -
24namespace Dune
│ │ │ │ -
25{
│ │ │ │ -
26namespace Functions {
│ │ │ │ -
27
│ │ │ │ -
28// A maze of dependencies between the different parts of this. We need a few forward declarations
│ │ │ │ -
29template<typename GV, typename R>
│ │ │ │ - │ │ │ │ -
31
│ │ │ │ -
32template<typename GV>
│ │ │ │ -
33class BSplinePreBasis;
│ │ │ │ -
34
│ │ │ │ -
35
│ │ │ │ -
44template<class GV, class R>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
46{
│ │ │ │ -
47 friend class BSplineLocalFiniteElement<GV,R>;
│ │ │ │ -
48
│ │ │ │ -
49 typedef typename GV::ctype D;
│ │ │ │ -
50 enum {dim = GV::dimension};
│ │ │ │ -
51public:
│ │ │ │ -
52
│ │ │ │ -
54 typedef LocalBasisTraits<D,dim,FieldVector<D,dim>,R,1,FieldVector<R,1>,
│ │ │ │ -
55 FieldMatrix<R,1,dim> > Traits;
│ │ │ │ +
13
│ │ │ │ +
21template<class GV, int cd>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
23{
│ │ │ │ +
24public:
│ │ │ │ +
25
│ │ │ │ +
26 typedef GV GridView;
│ │ │ │ +
27 enum {
│ │ │ │ +
28 codim = cd
│ │ │ │ +
29 };
│ │ │ │ +
30
│ │ │ │ +
32 typedef typename GridView::template Codim<codim>::Entity Element;
│ │ │ │ +
33
│ │ │ │ +
35 typedef typename Element::Geometry::LocalCoordinate LocalCoordinate;
│ │ │ │ +
36 typedef typename Element::Geometry::GlobalCoordinate GlobalCoordinate;
│ │ │ │ +
37
│ │ │ │ + │ │ │ │ +
39
│ │ │ │ +
41 typedef typename GridView::template Codim<codim>::Iterator const_iterator;
│ │ │ │ +
42
│ │ │ │ + │ │ │ │ +
45
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
48 gv_(gv)
│ │ │ │ +
49 {}
│ │ │ │ +
│ │ │ │ +
50
│ │ │ │ +
│ │ │ │ +
52 bool contains(const Element& e) const
│ │ │ │ +
53 {
│ │ │ │ +
54 return gv_.contains(e);
│ │ │ │ +
55 }
│ │ │ │ +
│ │ │ │
56
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ -
63 : preBasis_(preBasis),
│ │ │ │ -
64 lFE_(lFE)
│ │ │ │ -
65 {}
│ │ │ │ +
│ │ │ │ +
58 size_t size() const
│ │ │ │ +
59 {
│ │ │ │ +
60 return gv_.size(codim);
│ │ │ │ +
61 }
│ │ │ │ +
│ │ │ │ +
62
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
65 {
│ │ │ │ +
66 return gv_.template begin<codim>();
│ │ │ │ +
67 }
│ │ │ │
│ │ │ │ -
66
│ │ │ │ +
68
│ │ │ │
│ │ │ │ -
70 void evaluateFunction (const FieldVector<D,dim>& in,
│ │ │ │ -
71 std::vector<FieldVector<R,1> >& out) const
│ │ │ │ -
72 {
│ │ │ │ -
73 FieldVector<D,dim> globalIn = offset_;
│ │ │ │ -
74 scaling_.umv(in,globalIn);
│ │ │ │ -
75
│ │ │ │ -
76 preBasis_.evaluateFunction(globalIn, out, lFE_.currentKnotSpan_);
│ │ │ │ -
77 }
│ │ │ │ -
│ │ │ │ -
78
│ │ │ │ -
│ │ │ │ -
82 void evaluateJacobian (const FieldVector<D,dim>& in,
│ │ │ │ -
83 std::vector<FieldMatrix<D,1,dim> >& out) const
│ │ │ │ -
84 {
│ │ │ │ -
85 FieldVector<D,dim> globalIn = offset_;
│ │ │ │ -
86 scaling_.umv(in,globalIn);
│ │ │ │ -
87
│ │ │ │ -
88 preBasis_.evaluateJacobian(globalIn, out, lFE_.currentKnotSpan_);
│ │ │ │ -
89
│ │ │ │ -
90 for (size_t i=0; i<out.size(); i++)
│ │ │ │ -
91 for (int j=0; j<dim; j++)
│ │ │ │ -
92 out[i][0][j] *= scaling_[j][j];
│ │ │ │ -
93 }
│ │ │ │ -
│ │ │ │ -
94
│ │ │ │ -
96 template<size_t k>
│ │ │ │ -
│ │ │ │ -
97 inline void evaluate (const typename std::array<int,k>& directions,
│ │ │ │ -
98 const typename Traits::DomainType& in,
│ │ │ │ -
99 std::vector<typename Traits::RangeType>& out) const
│ │ │ │ -
100 {
│ │ │ │ -
101 switch(k)
│ │ │ │ -
102 {
│ │ │ │ -
103 case 0:
│ │ │ │ -
104 evaluateFunction(in, out);
│ │ │ │ -
105 break;
│ │ │ │ -
106 case 1:
│ │ │ │ -
107 {
│ │ │ │ -
108 FieldVector<D,dim> globalIn = offset_;
│ │ │ │ -
109 scaling_.umv(in,globalIn);
│ │ │ │ -
110
│ │ │ │ -
111 preBasis_.evaluate(directions, globalIn, out, lFE_.currentKnotSpan_);
│ │ │ │ -
112
│ │ │ │ -
113 for (size_t i=0; i<out.size(); i++)
│ │ │ │ -
114 out[i][0] *= scaling_[directions[0]][directions[0]];
│ │ │ │ -
115 break;
│ │ │ │ -
116 }
│ │ │ │ -
117 case 2:
│ │ │ │ -
118 {
│ │ │ │ -
119 FieldVector<D,dim> globalIn = offset_;
│ │ │ │ -
120 scaling_.umv(in,globalIn);
│ │ │ │ -
121
│ │ │ │ -
122 preBasis_.evaluate(directions, globalIn, out, lFE_.currentKnotSpan_);
│ │ │ │ -
123
│ │ │ │ -
124 for (size_t i=0; i<out.size(); i++)
│ │ │ │ -
125 out[i][0] *= scaling_[directions[0]][directions[0]]*scaling_[directions[1]][directions[1]];
│ │ │ │ -
126 break;
│ │ │ │ -
127 }
│ │ │ │ -
128 default:
│ │ │ │ -
129 DUNE_THROW(NotImplemented, "B-Spline derivatives of order " << k << " not implemented yet!");
│ │ │ │ -
130 }
│ │ │ │ -
131 }
│ │ │ │ -
│ │ │ │ -
132
│ │ │ │ -
│ │ │ │ -
140 unsigned int order () const
│ │ │ │ -
141 {
│ │ │ │ -
142 return *std::max_element(preBasis_.order_.begin(), preBasis_.order_.end());
│ │ │ │ -
143 }
│ │ │ │ -
│ │ │ │ -
144
│ │ │ │ -
│ │ │ │ -
147 std::size_t size() const
│ │ │ │ -
148 {
│ │ │ │ -
149 return lFE_.size();
│ │ │ │ -
150 }
│ │ │ │ -
│ │ │ │ -
151
│ │ │ │ -
152private:
│ │ │ │ -
153 const BSplinePreBasis<GV>& preBasis_;
│ │ │ │ -
154
│ │ │ │ - │ │ │ │ -
156
│ │ │ │ -
157 // Coordinates in a single knot span differ from coordinates on the B-spline patch
│ │ │ │ -
158 // by an affine transformation. This transformation is stored in offset_ and scaling_.
│ │ │ │ -
159 FieldVector<D,dim> offset_;
│ │ │ │ -
160 DiagonalMatrix<D,dim> scaling_;
│ │ │ │ -
161};
│ │ │ │ -
│ │ │ │ -
162
│ │ │ │ -
176template<int dim>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
178{
│ │ │ │ -
179 // Return i as a d-digit number in the (k+1)-nary system
│ │ │ │ -
180 std::array<unsigned int,dim> multiindex (unsigned int i) const
│ │ │ │ -
181 {
│ │ │ │ -
182 std::array<unsigned int,dim> alpha;
│ │ │ │ -
183 for (int j=0; j<dim; j++)
│ │ │ │ -
184 {
│ │ │ │ -
185 alpha[j] = i % sizes_[j];
│ │ │ │ -
186 i = i/sizes_[j];
│ │ │ │ -
187 }
│ │ │ │ -
188 return alpha;
│ │ │ │ -
189 }
│ │ │ │ -
190
│ │ │ │ -
192 void setup1d(std::vector<unsigned int>& subEntity)
│ │ │ │ -
193 {
│ │ │ │ -
194 if (sizes_[0]==1)
│ │ │ │ -
195 {
│ │ │ │ -
196 subEntity[0] = 0;
│ │ │ │ -
197 return;
│ │ │ │ -
198 }
│ │ │ │ -
199
│ │ │ │ -
200 /* edge and vertex numbering
│ │ │ │ -
201 0----0----1
│ │ │ │ -
202 */
│ │ │ │ -
203 unsigned lastIndex=0;
│ │ │ │ -
204 subEntity[lastIndex++] = 0; // corner 0
│ │ │ │ -
205 for (unsigned i = 0; i < sizes_[0] - 2; ++i)
│ │ │ │ -
206 subEntity[lastIndex++] = 0; // inner dofs of element (0)
│ │ │ │ -
207
│ │ │ │ -
208 subEntity[lastIndex++] = 1; // corner 1
│ │ │ │ -
209
│ │ │ │ -
210 assert(size()==lastIndex);
│ │ │ │ -
211 }
│ │ │ │ -
212
│ │ │ │ -
213 void setup2d(std::vector<unsigned int>& subEntity)
│ │ │ │ -
214 {
│ │ │ │ -
215 unsigned lastIndex=0;
│ │ │ │ -
216
│ │ │ │ -
217 // LocalKey: entity number , entity codim, dof indices within each entity
│ │ │ │ -
218 /* edge and vertex numbering
│ │ │ │ -
219 2----3----3
│ │ │ │ -
220 | |
│ │ │ │ -
221 | |
│ │ │ │ -
222 0 1
│ │ │ │ -
223 | |
│ │ │ │ -
224 | |
│ │ │ │ -
225 0----2----1
│ │ │ │ -
226 */
│ │ │ │ -
227
│ │ │ │ -
228 // lower edge (2)
│ │ │ │ -
229 subEntity[lastIndex++] = 0; // corner 0
│ │ │ │ -
230 for (unsigned i = 0; i < sizes_[0]-2; ++i)
│ │ │ │ -
231 subEntity[lastIndex++] = 2; // inner dofs of lower edge (2)
│ │ │ │ -
232
│ │ │ │ -
233 subEntity[lastIndex++] = 1; // corner 1
│ │ │ │ -
234
│ │ │ │ -
235 // iterate from bottom to top over inner edge dofs
│ │ │ │ -
236 for (unsigned e = 0; e < sizes_[1]-2; ++e)
│ │ │ │ -
237 {
│ │ │ │ -
238 subEntity[lastIndex++] = 0; // left edge (0)
│ │ │ │ -
239 for (unsigned i = 0; i < sizes_[0]-2; ++i)
│ │ │ │ -
240 subEntity[lastIndex++] = 0; // face dofs
│ │ │ │ -
241 subEntity[lastIndex++] = 1; // right edge (1)
│ │ │ │ -
242 }
│ │ │ │ -
243
│ │ │ │ -
244 // upper edge (3)
│ │ │ │ -
245 subEntity[lastIndex++] = 2; // corner 2
│ │ │ │ -
246 for (unsigned i = 0; i < sizes_[0]-2; ++i)
│ │ │ │ -
247 subEntity[lastIndex++] = 3; // inner dofs of upper edge (3)
│ │ │ │ -
248
│ │ │ │ -
249 subEntity[lastIndex++] = 3; // corner 3
│ │ │ │ -
250
│ │ │ │ -
251 assert(size()==lastIndex);
│ │ │ │ -
252 }
│ │ │ │ -
253
│ │ │ │ -
254
│ │ │ │ -
255public:
│ │ │ │ -
│ │ │ │ -
256 void init(const std::array<unsigned,dim>& sizes)
│ │ │ │ -
257 {
│ │ │ │ -
258 sizes_ = sizes;
│ │ │ │ -
259
│ │ │ │ -
260 li_.resize(size());
│ │ │ │ -
261
│ │ │ │ -
262 // Set up array of codimension-per-dof-number
│ │ │ │ -
263 std::vector<unsigned int> codim(li_.size());
│ │ │ │ -
264
│ │ │ │ -
265 for (std::size_t i=0; i<codim.size(); i++)
│ │ │ │ -
266 {
│ │ │ │ -
267 codim[i] = 0;
│ │ │ │ -
268 // Codimension gets increased by 1 for each coordinate direction
│ │ │ │ -
269 // where dof is on boundary
│ │ │ │ -
270 std::array<unsigned int,dim> mIdx = multiindex(i);
│ │ │ │ -
271 for (int j=0; j<dim; j++)
│ │ │ │ -
272 if (mIdx[j]==0 or mIdx[j]==sizes[j]-1)
│ │ │ │ -
273 codim[i]++;
│ │ │ │ -
274 }
│ │ │ │ -
275
│ │ │ │ -
276 // Set up index vector (the index of the dof in the set of dofs of a given subentity)
│ │ │ │ -
277 // Algorithm: the 'index' has the same ordering as the dof number 'i'.
│ │ │ │ -
278 // To make it consecutive we interpret 'i' in the (k+1)-adic system, omit all digits
│ │ │ │ -
279 // that correspond to axes where the dof is on the element boundary, and transform the
│ │ │ │ -
280 // rest to the (k-1)-adic system.
│ │ │ │ -
281 std::vector<unsigned int> index(size());
│ │ │ │ -
282
│ │ │ │ -
283 for (std::size_t i=0; i<index.size(); i++)
│ │ │ │ -
284 {
│ │ │ │ -
285 index[i] = 0;
│ │ │ │ -
286
│ │ │ │ -
287 std::array<unsigned int,dim> mIdx = multiindex(i);
│ │ │ │ -
288
│ │ │ │ -
289 for (int j=dim-1; j>=0; j--)
│ │ │ │ -
290 if (mIdx[j]>0 and mIdx[j]<sizes[j]-1)
│ │ │ │ -
291 index[i] = (sizes[j]-1)*index[i] + (mIdx[j]-1);
│ │ │ │ -
292 }
│ │ │ │ -
293
│ │ │ │ -
294 // Set up entity and dof numbers for each (supported) dimension separately
│ │ │ │ -
295 std::vector<unsigned int> subEntity(li_.size());
│ │ │ │ -
296
│ │ │ │ -
297 if (subEntity.size() > 0)
│ │ │ │ -
298 {
│ │ │ │ -
299 if (dim==1) {
│ │ │ │ -
300
│ │ │ │ -
301 setup1d(subEntity);
│ │ │ │ -
302
│ │ │ │ -
303 } else if (dim==2 and sizes_[0]>1 and sizes_[1]>1) {
│ │ │ │ -
304
│ │ │ │ -
305 setup2d(subEntity);
│ │ │ │ -
306
│ │ │ │ -
307 }
│ │ │ │ -
308 }
│ │ │ │ -
309
│ │ │ │ -
310 for (size_t i=0; i<li_.size(); i++)
│ │ │ │ -
311 li_[i] = LocalKey(subEntity[i], codim[i], index[i]);
│ │ │ │ -
312 }
│ │ │ │ -
│ │ │ │ -
313
│ │ │ │ -
│ │ │ │ -
315 std::size_t size () const
│ │ │ │ -
316 {
│ │ │ │ -
317 return std::accumulate(sizes_.begin(), sizes_.end(), 1, std::multiplies<unsigned int>());
│ │ │ │ -
318 }
│ │ │ │ -
│ │ │ │ -
319
│ │ │ │ -
│ │ │ │ -
321 const LocalKey& localKey (std::size_t i) const
│ │ │ │ -
322 {
│ │ │ │ -
323 return li_[i];
│ │ │ │ -
324 }
│ │ │ │ -
│ │ │ │ -
325
│ │ │ │ -
326private:
│ │ │ │ -
327
│ │ │ │ -
328 // Number of shape functions on this element per coordinate direction
│ │ │ │ -
329 std::array<unsigned, dim> sizes_;
│ │ │ │ -
330
│ │ │ │ -
331 std::vector<LocalKey> li_;
│ │ │ │ -
332};
│ │ │ │ -
│ │ │ │ -
333
│ │ │ │ -
338template<int dim, class LB>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
340{
│ │ │ │ -
341public:
│ │ │ │ -
343 template<typename F, typename C>
│ │ │ │ -
│ │ │ │ -
344 void interpolate (const F& f, std::vector<C>& out) const
│ │ │ │ -
345 {
│ │ │ │ -
346 DUNE_THROW(NotImplemented, "BSplineLocalInterpolation::interpolate");
│ │ │ │ -
347 }
│ │ │ │ -
│ │ │ │ -
348
│ │ │ │ -
349};
│ │ │ │ -
│ │ │ │ -
350
│ │ │ │ -
360template<class GV, class R>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
362{
│ │ │ │ -
363 typedef typename GV::ctype D;
│ │ │ │ -
364 enum {dim = GV::dimension};
│ │ │ │ -
365 friend class BSplineLocalBasis<GV,R>;
│ │ │ │ -
366public:
│ │ │ │ -
367
│ │ │ │ -
370 typedef LocalFiniteElementTraits<BSplineLocalBasis<GV,R>,
│ │ │ │ - │ │ │ │ - │ │ │ │ -
373
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
377 : preBasis_(preBasis),
│ │ │ │ -
378 localBasis_(preBasis,*this)
│ │ │ │ -
379 {}
│ │ │ │ -
│ │ │ │ -
380
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
384 : preBasis_(other.preBasis_),
│ │ │ │ - │ │ │ │ -
386 {}
│ │ │ │ -
│ │ │ │ -
387
│ │ │ │ -
│ │ │ │ -
394 void bind(const std::array<unsigned,dim>& elementIdx)
│ │ │ │ -
395 {
│ │ │ │ -
396 /* \todo In the long run we need to precompute a table for this */
│ │ │ │ -
397 for (size_t i=0; i<elementIdx.size(); i++)
│ │ │ │ -
398 {
│ │ │ │ -
399 currentKnotSpan_[i] = 0;
│ │ │ │ -
400
│ │ │ │ -
401 // Skip over degenerate knot spans
│ │ │ │ -
402 while (preBasis_.knotVectors_[i][currentKnotSpan_[i]+1] < preBasis_.knotVectors_[i][currentKnotSpan_[i]]+1e-8)
│ │ │ │ -
403 currentKnotSpan_[i]++;
│ │ │ │ -
404
│ │ │ │ -
405 for (size_t j=0; j<elementIdx[i]; j++)
│ │ │ │ -
406 {
│ │ │ │ -
407 currentKnotSpan_[i]++;
│ │ │ │ -
408
│ │ │ │ -
409 // Skip over degenerate knot spans
│ │ │ │ -
410 while (preBasis_.knotVectors_[i][currentKnotSpan_[i]+1] < preBasis_.knotVectors_[i][currentKnotSpan_[i]]+1e-8)
│ │ │ │ -
411 currentKnotSpan_[i]++;
│ │ │ │ -
412 }
│ │ │ │ -
413
│ │ │ │ -
414 // Compute the geometric transformation from knotspan-local to global coordinates
│ │ │ │ -
415 localBasis_.offset_[i] = preBasis_.knotVectors_[i][currentKnotSpan_[i]];
│ │ │ │ -
416 localBasis_.scaling_[i][i] = preBasis_.knotVectors_[i][currentKnotSpan_[i]+1] - preBasis_.knotVectors_[i][currentKnotSpan_[i]];
│ │ │ │ -
417 }
│ │ │ │ -
418
│ │ │ │ -
419 // Set up the LocalCoefficients object
│ │ │ │ -
420 std::array<unsigned int, dim> sizes;
│ │ │ │ -
421 for (size_t i=0; i<dim; i++)
│ │ │ │ -
422 sizes[i] = size(i);
│ │ │ │ -
423 localCoefficients_.init(sizes);
│ │ │ │ -
424 }
│ │ │ │ -
│ │ │ │ -
425
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
428 {
│ │ │ │ -
429 return localBasis_;
│ │ │ │ -
430 }
│ │ │ │ -
│ │ │ │ -
431
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
434 {
│ │ │ │ -
435 return localCoefficients_;
│ │ │ │ -
436 }
│ │ │ │ -
│ │ │ │ -
437
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
440 {
│ │ │ │ -
441 return localInterpolation_;
│ │ │ │ -
442 }
│ │ │ │ -
│ │ │ │ -
443
│ │ │ │ -
│ │ │ │ -
445 unsigned size () const
│ │ │ │ -
446 {
│ │ │ │ -
447 std::size_t r = 1;
│ │ │ │ -
448 for (int i=0; i<dim; i++)
│ │ │ │ -
449 r *= size(i);
│ │ │ │ -
450 return r;
│ │ │ │ -
451 }
│ │ │ │ -
│ │ │ │ -
452
│ │ │ │ -
│ │ │ │ -
455 GeometryType type () const
│ │ │ │ -
456 {
│ │ │ │ -
457 return GeometryTypes::cube(dim);
│ │ │ │ -
458 }
│ │ │ │ -
│ │ │ │ -
459
│ │ │ │ -
460//private:
│ │ │ │ -
461
│ │ │ │ -
│ │ │ │ -
463 unsigned int size(int i) const
│ │ │ │ -
464 {
│ │ │ │ -
465 const auto& order = preBasis_.order_;
│ │ │ │ -
466 unsigned int r = order[i]+1; // The 'normal' value
│ │ │ │ -
467 if (currentKnotSpan_[i]<order[i]) // Less near the left end of the knot vector
│ │ │ │ -
468 r -= (order[i] - currentKnotSpan_[i]);
│ │ │ │ -
469 if ( order[i] > (preBasis_.knotVectors_[i].size() - currentKnotSpan_[i] - 2) )
│ │ │ │ -
470 r -= order[i] - (preBasis_.knotVectors_[i].size() - currentKnotSpan_[i] - 2);
│ │ │ │ -
471 return r;
│ │ │ │ -
472 }
│ │ │ │ -
│ │ │ │ -
473
│ │ │ │ - │ │ │ │ -
475
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
479
│ │ │ │ -
480 // The knot span we are bound to
│ │ │ │ -
481 std::array<unsigned,dim> currentKnotSpan_;
│ │ │ │ -
482};
│ │ │ │ -
│ │ │ │ -
483
│ │ │ │ -
484
│ │ │ │ -
485template<typename GV>
│ │ │ │ -
486class BSplineNode;
│ │ │ │ -
487
│ │ │ │ -
497template<typename GV>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
499{
│ │ │ │ -
500 static const int dim = GV::dimension;
│ │ │ │ -
501
│ │ │ │ -
503 class MultiDigitCounter
│ │ │ │ -
504 {
│ │ │ │ -
505 public:
│ │ │ │ -
506
│ │ │ │ -
510 MultiDigitCounter(const std::array<unsigned int,dim>& limits)
│ │ │ │ -
511 : limits_(limits)
│ │ │ │ -
512 {
│ │ │ │ -
513 std::fill(counter_.begin(), counter_.end(), 0);
│ │ │ │ -
514 }
│ │ │ │ -
515
│ │ │ │ -
517 MultiDigitCounter& operator++()
│ │ │ │ -
518 {
│ │ │ │ -
519 for (int i=0; i<dim; i++)
│ │ │ │ -
520 {
│ │ │ │ -
521 ++counter_[i];
│ │ │ │ -
522
│ │ │ │ -
523 // no overflow?
│ │ │ │ -
524 if (counter_[i] < limits_[i])
│ │ │ │ -
525 break;
│ │ │ │ -
526
│ │ │ │ -
527 counter_[i] = 0;
│ │ │ │ -
528 }
│ │ │ │ -
529 return *this;
│ │ │ │ -
530 }
│ │ │ │ -
531
│ │ │ │ -
533 const unsigned int& operator[](int i) const
│ │ │ │ -
534 {
│ │ │ │ -
535 return counter_[i];
│ │ │ │ -
536 }
│ │ │ │ -
537
│ │ │ │ -
539 unsigned int cycle() const
│ │ │ │ -
540 {
│ │ │ │ -
541 unsigned int r = 1;
│ │ │ │ -
542 for (int i=0; i<dim; i++)
│ │ │ │ -
543 r *= limits_[i];
│ │ │ │ -
544 return r;
│ │ │ │ -
545 }
│ │ │ │ -
546
│ │ │ │ -
547 private:
│ │ │ │ -
548
│ │ │ │ -
550 const std::array<unsigned int,dim> limits_;
│ │ │ │ -
551
│ │ │ │ -
553 std::array<unsigned int,dim> counter_;
│ │ │ │ -
554
│ │ │ │ -
555 };
│ │ │ │ -
556
│ │ │ │ -
557public:
│ │ │ │ -
558
│ │ │ │ -
560 using GridView = GV;
│ │ │ │ -
561 using size_type = std::size_t;
│ │ │ │ -
562
│ │ │ │ - │ │ │ │ -
564
│ │ │ │ -
565 static constexpr size_type maxMultiIndexSize = 1;
│ │ │ │ -
566 static constexpr size_type minMultiIndexSize = 1;
│ │ │ │ -
567 static constexpr size_type multiIndexBufferSize = 1;
│ │ │ │ -
568
│ │ │ │ -
569 // Type used for function values
│ │ │ │ -
570 using R = double;
│ │ │ │ -
571
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
591 const std::vector<double>& knotVector,
│ │ │ │ -
592 unsigned int order,
│ │ │ │ -
593 bool makeOpen = true)
│ │ │ │ - │ │ │ │ -
595 {
│ │ │ │ -
596 // \todo Detection of duplicate knots
│ │ │ │ -
597 std::fill(elements_.begin(), elements_.end(), knotVector.size()-1);
│ │ │ │ -
598
│ │ │ │ -
599 // Mediocre sanity check: we don't know the number of grid elements in each direction.
│ │ │ │ -
600 // but at least we know the total number of elements.
│ │ │ │ -
601 assert( std::accumulate(elements_.begin(), elements_.end(), 1, std::multiplies<unsigned>()) == gridView_.size(0) );
│ │ │ │ -
602
│ │ │ │ -
603 for (int i=0; i<dim; i++)
│ │ │ │ -
604 {
│ │ │ │ -
605 // Prepend the correct number of additional knots to open the knot vector
│ │ │ │ -
607 if (makeOpen)
│ │ │ │ -
608 for (unsigned int j=0; j<order; j++)
│ │ │ │ -
609 knotVectors_[i].push_back(knotVector[0]);
│ │ │ │ -
610
│ │ │ │ -
611 knotVectors_[i].insert(knotVectors_[i].end(), knotVector.begin(), knotVector.end());
│ │ │ │ -
612
│ │ │ │ -
613 if (makeOpen)
│ │ │ │ -
614 for (unsigned int j=0; j<order; j++)
│ │ │ │ -
615 knotVectors_[i].push_back(knotVector.back());
│ │ │ │ -
616 }
│ │ │ │ -
617
│ │ │ │ -
618 std::fill(order_.begin(), order_.end(), order);
│ │ │ │ -
619 }
│ │ │ │ -
│ │ │ │ -
620
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
643 const FieldVector<double,dim>& lowerLeft,
│ │ │ │ -
644 const FieldVector<double,dim>& upperRight,
│ │ │ │ -
645 const std::array<unsigned int,dim>& elements,
│ │ │ │ -
646 unsigned int order,
│ │ │ │ -
647 bool makeOpen = true)
│ │ │ │ -
648 : elements_(elements),
│ │ │ │ - │ │ │ │ -
650 {
│ │ │ │ -
651 // Mediocre sanity check: we don't know the number of grid elements in each direction.
│ │ │ │ -
652 // but at least we know the total number of elements.
│ │ │ │ -
653 assert( std::accumulate(elements_.begin(), elements_.end(), 1, std::multiplies<unsigned>()) == gridView_.size(0) );
│ │ │ │ -
654
│ │ │ │ -
655 for (int i=0; i<dim; i++)
│ │ │ │ -
656 {
│ │ │ │ -
657 // Prepend the correct number of additional knots to open the knot vector
│ │ │ │ -
659 if (makeOpen)
│ │ │ │ -
660 for (unsigned int j=0; j<order; j++)
│ │ │ │ -
661 knotVectors_[i].push_back(lowerLeft[i]);
│ │ │ │ -
662
│ │ │ │ -
663 // Construct the actual knot vector
│ │ │ │ -
664 for (size_t j=0; j<elements[i]+1; j++)
│ │ │ │ -
665 knotVectors_[i].push_back(lowerLeft[i] + j*(upperRight[i]-lowerLeft[i]) / elements[i]);
│ │ │ │ -
666
│ │ │ │ -
667 if (makeOpen)
│ │ │ │ -
668 for (unsigned int j=0; j<order; j++)
│ │ │ │ -
669 knotVectors_[i].push_back(upperRight[i]);
│ │ │ │ -
670 }
│ │ │ │ -
671
│ │ │ │ -
672 std::fill(order_.begin(), order_.end(), order);
│ │ │ │ -
673 }
│ │ │ │ -
│ │ │ │ -
674
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
677 {}
│ │ │ │ -
│ │ │ │ -
678
│ │ │ │ -
│ │ │ │ -
680 const GridView& gridView() const
│ │ │ │ -
681 {
│ │ │ │ -
682 return gridView_;
│ │ │ │ -
683 }
│ │ │ │ -
│ │ │ │ -
684
│ │ │ │ -
│ │ │ │ -
686 void update(const GridView& gv)
│ │ │ │ -
687 {
│ │ │ │ -
688 gridView_ = gv;
│ │ │ │ -
689 }
│ │ │ │ -
│ │ │ │ -
690
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
695 {
│ │ │ │ -
696 return Node{this};
│ │ │ │ -
697 }
│ │ │ │ -
│ │ │ │ -
698
│ │ │ │ -
699 // Ideally this method should be implemented as
│ │ │ │ -
700 //
│ │ │ │ -
701 // template<class SizePrefix>
│ │ │ │ -
702 // size_type size(const SizePrefix& prefix) const
│ │ │ │ -
703 //
│ │ │ │ -
704 // But leads to ambiguity with the other size method:
│ │ │ │ -
705 //
│ │ │ │ -
706 // unsigned int size (size_t d) const
│ │ │ │ -
707 //
│ │ │ │ -
708 // Once the latter is removed, this implementation should be changed.
│ │ │ │ -
709
│ │ │ │ -
711 template<class ST, int i>
│ │ │ │ -
│ │ │ │ -
712 size_type size(const Dune::ReservedVector<ST, i>& prefix) const
│ │ │ │ -
713 {
│ │ │ │ -
714 assert(prefix.size() == 0 || prefix.size() == 1);
│ │ │ │ -
715 return (prefix.size() == 0) ? size() : 0;
│ │ │ │ -
716 }
│ │ │ │ -
│ │ │ │ -
717
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
720 {
│ │ │ │ -
721 return size();
│ │ │ │ -
722 }
│ │ │ │ -
│ │ │ │ -
723
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
726 {
│ │ │ │ -
727 size_type result = 1;
│ │ │ │ -
728 for (int i=0; i<dim; i++)
│ │ │ │ -
729 result *= order_[i]+1;
│ │ │ │ -
730 return result;
│ │ │ │ -
731 }
│ │ │ │ -
│ │ │ │ -
732
│ │ │ │ -
734 template<typename It>
│ │ │ │ -
│ │ │ │ -
735 It indices(const Node& node, It it) const
│ │ │ │ -
736 {
│ │ │ │ -
737 // Local degrees of freedom are arranged in a lattice.
│ │ │ │ -
738 // We need the lattice dimensions to be able to compute lattice coordinates from a local index
│ │ │ │ -
739 std::array<unsigned int, dim> localSizes;
│ │ │ │ -
740 for (int i=0; i<dim; i++)
│ │ │ │ -
741 localSizes[i] = node.finiteElement().size(i);
│ │ │ │ -
742 for (size_type i = 0, end = node.size() ; i < end ; ++i, ++it)
│ │ │ │ -
743 {
│ │ │ │ -
744 std::array<unsigned int,dim> localIJK = getIJK(i, localSizes);
│ │ │ │ -
745
│ │ │ │ -
746 const auto currentKnotSpan = node.finiteElement().currentKnotSpan_;
│ │ │ │ -
747 const auto order = order_;
│ │ │ │ -
748
│ │ │ │ -
749 std::array<unsigned int,dim> globalIJK;
│ │ │ │ -
750 for (int i=0; i<dim; i++)
│ │ │ │ -
751 globalIJK[i] = std::max((int)currentKnotSpan[i] - (int)order[i], 0) + localIJK[i]; // needs to be a signed type!
│ │ │ │ -
752
│ │ │ │ -
753 // Make one global flat index from the globalIJK tuple
│ │ │ │ -
754 size_type globalIdx = globalIJK[dim-1];
│ │ │ │ -
755
│ │ │ │ -
756 for (int i=dim-2; i>=0; i--)
│ │ │ │ -
757 globalIdx = globalIdx * size(i) + globalIJK[i];
│ │ │ │ -
758
│ │ │ │ -
759 *it = {{globalIdx}};
│ │ │ │ -
760 }
│ │ │ │ -
761 return it;
│ │ │ │ -
762 }
│ │ │ │ -
│ │ │ │ -
763
│ │ │ │ -
│ │ │ │ -
765 unsigned int size () const
│ │ │ │ -
766 {
│ │ │ │ -
767 unsigned int result = 1;
│ │ │ │ -
768 for (size_t i=0; i<dim; i++)
│ │ │ │ -
769 result *= size(i);
│ │ │ │ -
770 return result;
│ │ │ │ -
771 }
│ │ │ │ -
│ │ │ │ -
772
│ │ │ │ -
│ │ │ │ -
774 unsigned int size (size_t d) const
│ │ │ │ -
775 {
│ │ │ │ -
776 return knotVectors_[d].size() - order_[d] - 1;
│ │ │ │ -
777 }
│ │ │ │ -
│ │ │ │ -
778
│ │ │ │ -
│ │ │ │ -
781 void evaluateFunction (const FieldVector<typename GV::ctype,dim>& in,
│ │ │ │ -
782 std::vector<FieldVector<R,1> >& out,
│ │ │ │ -
783 const std::array<unsigned,dim>& currentKnotSpan) const
│ │ │ │ -
784 {
│ │ │ │ -
785 // Evaluate
│ │ │ │ -
786 std::array<std::vector<R>, dim> oneDValues;
│ │ │ │ -
787
│ │ │ │ -
788 for (size_t i=0; i<dim; i++)
│ │ │ │ -
789 evaluateFunction(in[i], oneDValues[i], knotVectors_[i], order_[i], currentKnotSpan[i]);
│ │ │ │ -
790
│ │ │ │ -
791 std::array<unsigned int, dim> limits;
│ │ │ │ -
792 for (int i=0; i<dim; i++)
│ │ │ │ -
793 limits[i] = oneDValues[i].size();
│ │ │ │ -
794
│ │ │ │ -
795 MultiDigitCounter ijkCounter(limits);
│ │ │ │ -
796
│ │ │ │ -
797 out.resize(ijkCounter.cycle());
│ │ │ │ -
798
│ │ │ │ -
799 for (size_t i=0; i<out.size(); i++, ++ijkCounter)
│ │ │ │ -
800 {
│ │ │ │ -
801 out[i] = R(1.0);
│ │ │ │ -
802 for (size_t j=0; j<dim; j++)
│ │ │ │ -
803 out[i] *= oneDValues[j][ijkCounter[j]];
│ │ │ │ -
804 }
│ │ │ │ -
805 }
│ │ │ │ -
│ │ │ │ -
806
│ │ │ │ -
│ │ │ │ -
812 void evaluateJacobian (const FieldVector<typename GV::ctype,dim>& in,
│ │ │ │ -
813 std::vector<FieldMatrix<R,1,dim> >& out,
│ │ │ │ -
814 const std::array<unsigned,dim>& currentKnotSpan) const
│ │ │ │ -
815 {
│ │ │ │ -
816 // How many shape functions to we have in each coordinate direction?
│ │ │ │ -
817 std::array<unsigned int, dim> limits;
│ │ │ │ -
818 for (int i=0; i<dim; i++)
│ │ │ │ -
819 {
│ │ │ │ -
820 limits[i] = order_[i]+1; // The 'standard' value away from the boundaries of the knot vector
│ │ │ │ -
821 if (currentKnotSpan[i]<order_[i])
│ │ │ │ -
822 limits[i] -= (order_[i] - currentKnotSpan[i]);
│ │ │ │ -
823 if ( order_[i] > (knotVectors_[i].size() - currentKnotSpan[i] - 2) )
│ │ │ │ -
824 limits[i] -= order_[i] - (knotVectors_[i].size() - currentKnotSpan[i] - 2);
│ │ │ │ -
825 }
│ │ │ │ -
826
│ │ │ │ -
827 // The lowest knot spans that we need values from
│ │ │ │ -
828 std::array<unsigned int, dim> offset;
│ │ │ │ -
829 for (int i=0; i<dim; i++)
│ │ │ │ -
830 offset[i] = std::max((int)(currentKnotSpan[i] - order_[i]),0);
│ │ │ │ -
831
│ │ │ │ -
832 // Evaluate 1d function values (needed for the product rule)
│ │ │ │ -
833 std::array<std::vector<R>, dim> oneDValues;
│ │ │ │ -
834
│ │ │ │ -
835 // Evaluate 1d function values of one order lower (needed for the derivative formula)
│ │ │ │ -
836 std::array<std::vector<R>, dim> lowOrderOneDValues;
│ │ │ │ -
837
│ │ │ │ -
838 std::array<DynamicMatrix<R>, dim> values;
│ │ │ │ -
839
│ │ │ │ -
840 for (size_t i=0; i<dim; i++)
│ │ │ │ -
841 {
│ │ │ │ -
842 evaluateFunctionFull(in[i], values[i], knotVectors_[i], order_[i], currentKnotSpan[i]);
│ │ │ │ -
843 oneDValues[i].resize(knotVectors_[i].size()-order_[i]-1);
│ │ │ │ -
844 for (size_t j=0; j<oneDValues[i].size(); j++)
│ │ │ │ -
845 oneDValues[i][j] = values[i][order_[i]][j];
│ │ │ │ -
846
│ │ │ │ -
847 if (order_[i]!=0)
│ │ │ │ -
848 {
│ │ │ │ -
849 lowOrderOneDValues[i].resize(knotVectors_[i].size()-(order_[i]-1)-1);
│ │ │ │ -
850 for (size_t j=0; j<lowOrderOneDValues[i].size(); j++)
│ │ │ │ -
851 lowOrderOneDValues[i][j] = values[i][order_[i]-1][j];
│ │ │ │ -
852 }
│ │ │ │ -
853 }
│ │ │ │ -
854
│ │ │ │ -
855
│ │ │ │ -
856 // Evaluate 1d function derivatives
│ │ │ │ -
857 std::array<std::vector<R>, dim> oneDDerivatives;
│ │ │ │ -
858 for (size_t i=0; i<dim; i++)
│ │ │ │ -
859 {
│ │ │ │ -
860 oneDDerivatives[i].resize(limits[i]);
│ │ │ │ -
861
│ │ │ │ -
862 if (order_[i]==0) // order-zero functions are piecewise constant, hence all derivatives are zero
│ │ │ │ -
863 std::fill(oneDDerivatives[i].begin(), oneDDerivatives[i].end(), R(0.0));
│ │ │ │ -
864 else
│ │ │ │ -
865 {
│ │ │ │ -
866 for (size_t j=offset[i]; j<offset[i]+limits[i]; j++)
│ │ │ │ -
867 {
│ │ │ │ -
868 R derivativeAddend1 = lowOrderOneDValues[i][j] / (knotVectors_[i][j+order_[i]]-knotVectors_[i][j]);
│ │ │ │ -
869 R derivativeAddend2 = lowOrderOneDValues[i][j+1] / (knotVectors_[i][j+order_[i]+1]-knotVectors_[i][j+1]);
│ │ │ │ -
870 // The two previous terms may evaluate as 0/0. This is to be interpreted as 0.
│ │ │ │ -
871 if (std::isnan(derivativeAddend1))
│ │ │ │ -
872 derivativeAddend1 = 0;
│ │ │ │ -
873 if (std::isnan(derivativeAddend2))
│ │ │ │ -
874 derivativeAddend2 = 0;
│ │ │ │ -
875 oneDDerivatives[i][j-offset[i]] = order_[i] * ( derivativeAddend1 - derivativeAddend2 );
│ │ │ │ -
876 }
│ │ │ │ -
877 }
│ │ │ │ -
878 }
│ │ │ │ -
879
│ │ │ │ -
880 // Working towards computing only the parts that we really need:
│ │ │ │ -
881 // Let's copy them out into a separate array
│ │ │ │ -
882 std::array<std::vector<R>, dim> oneDValuesShort;
│ │ │ │ -
883
│ │ │ │ -
884 for (int i=0; i<dim; i++)
│ │ │ │ -
885 {
│ │ │ │ -
886 oneDValuesShort[i].resize(limits[i]);
│ │ │ │ -
887
│ │ │ │ -
888 for (size_t j=0; j<limits[i]; j++)
│ │ │ │ -
889 oneDValuesShort[i][j] = oneDValues[i][offset[i] + j];
│ │ │ │ -
890 }
│ │ │ │ -
891
│ │ │ │ -
892
│ │ │ │ -
893
│ │ │ │ -
894 // Set up a multi-index to go from consecutive indices to integer coordinates
│ │ │ │ -
895 MultiDigitCounter ijkCounter(limits);
│ │ │ │ -
896
│ │ │ │ -
897 out.resize(ijkCounter.cycle());
│ │ │ │ -
898
│ │ │ │ -
899 // Complete Jacobian is given by the product rule
│ │ │ │ -
900 for (size_t i=0; i<out.size(); i++, ++ijkCounter)
│ │ │ │ -
901 for (int j=0; j<dim; j++)
│ │ │ │ -
902 {
│ │ │ │ -
903 out[i][0][j] = 1.0;
│ │ │ │ -
904 for (int k=0; k<dim; k++)
│ │ │ │ -
905 out[i][0][j] *= (j==k) ? oneDDerivatives[k][ijkCounter[k]]
│ │ │ │ -
906 : oneDValuesShort[k][ijkCounter[k]];
│ │ │ │ -
907 }
│ │ │ │ -
908
│ │ │ │ -
909 }
│ │ │ │ -
│ │ │ │ -
910
│ │ │ │ -
912 template <size_type k>
│ │ │ │ -
│ │ │ │ -
913 void evaluate(const typename std::array<int,k>& directions,
│ │ │ │ -
914 const FieldVector<typename GV::ctype,dim>& in,
│ │ │ │ -
915 std::vector<FieldVector<R,1> >& out,
│ │ │ │ -
916 const std::array<unsigned,dim>& currentKnotSpan) const
│ │ │ │ -
917 {
│ │ │ │ -
918 if (k != 1 && k != 2)
│ │ │ │ -
919 DUNE_THROW(RangeError, "Differentiation order greater than 2 is not supported!");
│ │ │ │ -
920
│ │ │ │ -
921 // Evaluate 1d function values (needed for the product rule)
│ │ │ │ -
922 std::array<std::vector<R>, dim> oneDValues;
│ │ │ │ -
923 std::array<std::vector<R>, dim> oneDDerivatives;
│ │ │ │ -
924 std::array<std::vector<R>, dim> oneDSecondDerivatives;
│ │ │ │ -
925
│ │ │ │ -
926 // Evaluate 1d function derivatives
│ │ │ │ -
927 if (k==1)
│ │ │ │ -
928 for (size_t i=0; i<dim; i++)
│ │ │ │ -
929 evaluateAll(in[i], oneDValues[i], true, oneDDerivatives[i], false, oneDSecondDerivatives[i], knotVectors_[i], order_[i], currentKnotSpan[i]);
│ │ │ │ -
930 else
│ │ │ │ -
931 for (size_t i=0; i<dim; i++)
│ │ │ │ -
932 evaluateAll(in[i], oneDValues[i], true, oneDDerivatives[i], true, oneDSecondDerivatives[i], knotVectors_[i], order_[i], currentKnotSpan[i]);
│ │ │ │ -
933
│ │ │ │ -
934 // The lowest knot spans that we need values from
│ │ │ │ -
935 std::array<unsigned int, dim> offset;
│ │ │ │ -
936 for (int i=0; i<dim; i++)
│ │ │ │ -
937 offset[i] = std::max((int)(currentKnotSpan[i] - order_[i]),0);
│ │ │ │ -
938
│ │ │ │ -
939 // Set up a multi-index to go from consecutive indices to integer coordinates
│ │ │ │ -
940 std::array<unsigned int, dim> limits;
│ │ │ │ -
941 for (int i=0; i<dim; i++)
│ │ │ │ -
942 {
│ │ │ │ -
943 // In a proper implementation, the following line would do
│ │ │ │ -
944 //limits[i] = oneDValues[i].size();
│ │ │ │ -
945 limits[i] = order_[i]+1; // The 'standard' value away from the boundaries of the knot vector
│ │ │ │ -
946 if (currentKnotSpan[i]<order_[i])
│ │ │ │ -
947 limits[i] -= (order_[i] - currentKnotSpan[i]);
│ │ │ │ -
948 if ( order_[i] > (knotVectors_[i].size() - currentKnotSpan[i] - 2) )
│ │ │ │ -
949 limits[i] -= order_[i] - (knotVectors_[i].size() - currentKnotSpan[i] - 2);
│ │ │ │ -
950 }
│ │ │ │ -
951
│ │ │ │ -
952 // Working towards computing only the parts that we really need:
│ │ │ │ -
953 // Let's copy them out into a separate array
│ │ │ │ -
954 std::array<std::vector<R>, dim> oneDValuesShort;
│ │ │ │ -
955
│ │ │ │ -
956 for (int i=0; i<dim; i++)
│ │ │ │ -
957 {
│ │ │ │ -
958 oneDValuesShort[i].resize(limits[i]);
│ │ │ │ -
959
│ │ │ │ -
960 for (size_t j=0; j<limits[i]; j++)
│ │ │ │ -
961 oneDValuesShort[i][j] = oneDValues[i][offset[i] + j];
│ │ │ │ -
962 }
│ │ │ │ -
963
│ │ │ │ -
964
│ │ │ │ -
965 MultiDigitCounter ijkCounter(limits);
│ │ │ │ -
966
│ │ │ │ -
967 out.resize(ijkCounter.cycle());
│ │ │ │ -
968
│ │ │ │ -
969 if (k == 1)
│ │ │ │ -
970 {
│ │ │ │ -
971 // Complete Jacobian is given by the product rule
│ │ │ │ -
972 for (size_t i=0; i<out.size(); i++, ++ijkCounter)
│ │ │ │ -
973 {
│ │ │ │ -
974 out[i][0] = 1.0;
│ │ │ │ -
975 for (int l=0; l<dim; l++)
│ │ │ │ -
976 out[i][0] *= (directions[0]==l) ? oneDDerivatives[l][ijkCounter[l]]
│ │ │ │ -
977 : oneDValuesShort[l][ijkCounter[l]];
│ │ │ │ -
978 }
│ │ │ │ -
979 }
│ │ │ │ -
980
│ │ │ │ -
981 if (k == 2)
│ │ │ │ -
982 {
│ │ │ │ -
983 // Complete derivation by deriving the tensor product
│ │ │ │ -
984 for (size_t i=0; i<out.size(); i++, ++ijkCounter)
│ │ │ │ -
985 {
│ │ │ │ -
986 out[i][0] = 1.0;
│ │ │ │ -
987 for (int j=0; j<dim; j++)
│ │ │ │ -
988 {
│ │ │ │ -
989 if (directions[0] != directions[1]) //derivation in two different variables
│ │ │ │ -
990 if (directions[0] == j || directions[1] == j) //the spline has to be derived (once) in this direction
│ │ │ │ -
991 out[i][0] *= oneDDerivatives[j][ijkCounter[j]];
│ │ │ │ -
992 else //no derivation in this direction
│ │ │ │ -
993 out[i][0] *= oneDValuesShort[j][ijkCounter[j]];
│ │ │ │ -
994 else //spline is derived two times in the same direction
│ │ │ │ -
995 if (directions[0] == j) //the spline is derived two times in this direction
│ │ │ │ -
996 out[i][0] *= oneDSecondDerivatives[j][ijkCounter[j]];
│ │ │ │ -
997 else //no derivation in this direction
│ │ │ │ -
998 out[i][0] *= oneDValuesShort[j][ijkCounter[j]];
│ │ │ │ -
999 }
│ │ │ │ -
1000 }
│ │ │ │ -
1001 }
│ │ │ │ -
1002 }
│ │ │ │ -
│ │ │ │ -
1003
│ │ │ │ -
1004
│ │ │ │ -
│ │ │ │ -
1009 static std::array<unsigned int,dim> getIJK(typename GridView::IndexSet::IndexType idx, std::array<unsigned int,dim> elements)
│ │ │ │ -
1010 {
│ │ │ │ -
1011 std::array<unsigned,dim> result;
│ │ │ │ -
1012 for (int i=0; i<dim; i++)
│ │ │ │ -
1013 {
│ │ │ │ -
1014 result[i] = idx%elements[i];
│ │ │ │ -
1015 idx /= elements[i];
│ │ │ │ -
1016 }
│ │ │ │ -
1017 return result;
│ │ │ │ -
1018 }
│ │ │ │ -
│ │ │ │ -
1019
│ │ │ │ -
│ │ │ │ -
1028 static void evaluateFunction (const typename GV::ctype& in, std::vector<R>& out,
│ │ │ │ -
1029 const std::vector<R>& knotVector,
│ │ │ │ -
1030 unsigned int order,
│ │ │ │ -
1031 unsigned int currentKnotSpan)
│ │ │ │ -
1032 {
│ │ │ │ -
1033 std::size_t outSize = order+1; // The 'standard' value away from the boundaries of the knot vector
│ │ │ │ -
1034 if (currentKnotSpan<order) // Less near the left end of the knot vector
│ │ │ │ -
1035 outSize -= (order - currentKnotSpan);
│ │ │ │ -
1036 if ( order > (knotVector.size() - currentKnotSpan - 2) )
│ │ │ │ -
1037 outSize -= order - (knotVector.size() - currentKnotSpan - 2);
│ │ │ │ -
1038 out.resize(outSize);
│ │ │ │ -
1039
│ │ │ │ -
1040 // It's not really a matrix that is needed here, a plain 2d array would do
│ │ │ │ -
1041 DynamicMatrix<R> N(order+1, knotVector.size()-1);
│ │ │ │ -
1042
│ │ │ │ -
1043 // The text books on splines use the following geometric condition here to fill the array N
│ │ │ │ -
1044 // (see for example Cottrell, Hughes, Bazilevs, Formula (2.1). However, this condition
│ │ │ │ -
1045 // only works if splines are never evaluated exactly on the knots.
│ │ │ │ -
1046 //
│ │ │ │ -
1047 // for (size_t i=0; i<knotVector.size()-1; i++)
│ │ │ │ -
1048 // N[0][i] = (knotVector[i] <= in) and (in < knotVector[i+1]);
│ │ │ │ -
1049 for (size_t i=0; i<knotVector.size()-1; i++)
│ │ │ │ -
1050 N[0][i] = (i == currentKnotSpan);
│ │ │ │ -
1051
│ │ │ │ -
1052 for (size_t r=1; r<=order; r++)
│ │ │ │ -
1053 for (size_t i=0; i<knotVector.size()-r-1; i++)
│ │ │ │ -
1054 {
│ │ │ │ -
1055 R factor1 = ((knotVector[i+r] - knotVector[i]) > 1e-10)
│ │ │ │ -
1056 ? (in - knotVector[i]) / (knotVector[i+r] - knotVector[i])
│ │ │ │ -
1057 : 0;
│ │ │ │ -
1058 R factor2 = ((knotVector[i+r+1] - knotVector[i+1]) > 1e-10)
│ │ │ │ -
1059 ? (knotVector[i+r+1] - in) / (knotVector[i+r+1] - knotVector[i+1])
│ │ │ │ -
1060 : 0;
│ │ │ │ -
1061 N[r][i] = factor1 * N[r-1][i] + factor2 * N[r-1][i+1];
│ │ │ │ -
1062 }
│ │ │ │ -
1063
│ │ │ │ -
1068 for (size_t i=0; i<out.size(); i++) {
│ │ │ │ -
1069 out[i] = N[order][std::max((int)(currentKnotSpan - order),0) + i];
│ │ │ │ -
1070 }
│ │ │ │ -
1071 }
│ │ │ │ -
│ │ │ │ -
1072
│ │ │ │ -
│ │ │ │ -
1085 static void evaluateFunctionFull(const typename GV::ctype& in,
│ │ │ │ -
1086 DynamicMatrix<R>& out,
│ │ │ │ -
1087 const std::vector<R>& knotVector,
│ │ │ │ -
1088 unsigned int order,
│ │ │ │ -
1089 unsigned int currentKnotSpan)
│ │ │ │ -
1090 {
│ │ │ │ -
1091 // It's not really a matrix that is needed here, a plain 2d array would do
│ │ │ │ -
1092 DynamicMatrix<R>& N = out;
│ │ │ │ -
1093
│ │ │ │ -
1094 N.resize(order+1, knotVector.size()-1);
│ │ │ │ -
1095
│ │ │ │ -
1096 // The text books on splines use the following geometric condition here to fill the array N
│ │ │ │ -
1097 // (see for example Cottrell, Hughes, Bazilevs, Formula (2.1). However, this condition
│ │ │ │ -
1098 // only works if splines are never evaluated exactly on the knots.
│ │ │ │ -
1099 //
│ │ │ │ -
1100 // for (size_t i=0; i<knotVector.size()-1; i++)
│ │ │ │ -
1101 // N[0][i] = (knotVector[i] <= in) and (in < knotVector[i+1]);
│ │ │ │ -
1102 for (size_t i=0; i<knotVector.size()-1; i++)
│ │ │ │ -
1103 N[0][i] = (i == currentKnotSpan);
│ │ │ │ -
1104
│ │ │ │ -
1105 for (size_t r=1; r<=order; r++)
│ │ │ │ -
1106 for (size_t i=0; i<knotVector.size()-r-1; i++)
│ │ │ │ -
1107 {
│ │ │ │ -
1108 R factor1 = ((knotVector[i+r] - knotVector[i]) > 1e-10)
│ │ │ │ -
1109 ? (in - knotVector[i]) / (knotVector[i+r] - knotVector[i])
│ │ │ │ -
1110 : 0;
│ │ │ │ -
1111 R factor2 = ((knotVector[i+r+1] - knotVector[i+1]) > 1e-10)
│ │ │ │ -
1112 ? (knotVector[i+r+1] - in) / (knotVector[i+r+1] - knotVector[i+1])
│ │ │ │ -
1113 : 0;
│ │ │ │ -
1114 N[r][i] = factor1 * N[r-1][i] + factor2 * N[r-1][i+1];
│ │ │ │ -
1115 }
│ │ │ │ -
1116 }
│ │ │ │ -
│ │ │ │ -
1117
│ │ │ │ -
1118
│ │ │ │ -
│ │ │ │ -
1128 static void evaluateAll(const typename GV::ctype& in,
│ │ │ │ -
1129 std::vector<R>& out,
│ │ │ │ -
1130 bool evaluateJacobian, std::vector<R>& outJac,
│ │ │ │ -
1131 bool evaluateHessian, std::vector<R>& outHess,
│ │ │ │ -
1132 const std::vector<R>& knotVector,
│ │ │ │ -
1133 unsigned int order,
│ │ │ │ -
1134 unsigned int currentKnotSpan)
│ │ │ │ -
1135 {
│ │ │ │ -
1136 // How many shape functions to we have in each coordinate direction?
│ │ │ │ -
1137 unsigned int limit;
│ │ │ │ -
1138 limit = order+1; // The 'standard' value away from the boundaries of the knot vector
│ │ │ │ -
1139 if (currentKnotSpan<order)
│ │ │ │ -
1140 limit -= (order - currentKnotSpan);
│ │ │ │ -
1141 if ( order > (knotVector.size() - currentKnotSpan - 2) )
│ │ │ │ -
1142 limit -= order - (knotVector.size() - currentKnotSpan - 2);
│ │ │ │ -
1143
│ │ │ │ -
1144 // The lowest knot spans that we need values from
│ │ │ │ -
1145 unsigned int offset;
│ │ │ │ -
1146 offset = std::max((int)(currentKnotSpan - order),0);
│ │ │ │ -
1147
│ │ │ │ -
1148 // Evaluate 1d function values (needed for the product rule)
│ │ │ │ -
1149 DynamicMatrix<R> values;
│ │ │ │ -
1150
│ │ │ │ -
1151 evaluateFunctionFull(in, values, knotVector, order, currentKnotSpan);
│ │ │ │ -
1152
│ │ │ │ -
1153 out.resize(knotVector.size()-order-1);
│ │ │ │ -
1154 for (size_t j=0; j<out.size(); j++)
│ │ │ │ -
1155 out[j] = values[order][j];
│ │ │ │ -
1156
│ │ │ │ -
1157 // Evaluate 1d function values of one order lower (needed for the derivative formula)
│ │ │ │ -
1158 std::vector<R> lowOrderOneDValues;
│ │ │ │ -
1159
│ │ │ │ -
1160 if (order!=0)
│ │ │ │ -
1161 {
│ │ │ │ -
1162 lowOrderOneDValues.resize(knotVector.size()-(order-1)-1);
│ │ │ │ -
1163 for (size_t j=0; j<lowOrderOneDValues.size(); j++)
│ │ │ │ -
1164 lowOrderOneDValues[j] = values[order-1][j];
│ │ │ │ -
1165 }
│ │ │ │ -
1166
│ │ │ │ -
1167 // Evaluate 1d function values of two order lower (needed for the (second) derivative formula)
│ │ │ │ -
1168 std::vector<R> lowOrderTwoDValues;
│ │ │ │ -
1169
│ │ │ │ -
1170 if (order>1 && evaluateHessian)
│ │ │ │ -
1171 {
│ │ │ │ -
1172 lowOrderTwoDValues.resize(knotVector.size()-(order-2)-1);
│ │ │ │ -
1173 for (size_t j=0; j<lowOrderTwoDValues.size(); j++)
│ │ │ │ -
1174 lowOrderTwoDValues[j] = values[order-2][j];
│ │ │ │ -
1175 }
│ │ │ │ -
1176
│ │ │ │ -
1177 // Evaluate 1d function derivatives
│ │ │ │ -
1178 if (evaluateJacobian)
│ │ │ │ -
1179 {
│ │ │ │ -
1180 outJac.resize(limit);
│ │ │ │ -
1181
│ │ │ │ -
1182 if (order==0) // order-zero functions are piecewise constant, hence all derivatives are zero
│ │ │ │ -
1183 std::fill(outJac.begin(), outJac.end(), R(0.0));
│ │ │ │ -
1184 else
│ │ │ │ -
1185 {
│ │ │ │ -
1186 for (size_t j=offset; j<offset+limit; j++)
│ │ │ │ -
1187 {
│ │ │ │ -
1188 R derivativeAddend1 = lowOrderOneDValues[j] / (knotVector[j+order]-knotVector[j]);
│ │ │ │ -
1189 R derivativeAddend2 = lowOrderOneDValues[j+1] / (knotVector[j+order+1]-knotVector[j+1]);
│ │ │ │ -
1190 // The two previous terms may evaluate as 0/0. This is to be interpreted as 0.
│ │ │ │ -
1191 if (std::isnan(derivativeAddend1))
│ │ │ │ -
1192 derivativeAddend1 = 0;
│ │ │ │ -
1193 if (std::isnan(derivativeAddend2))
│ │ │ │ -
1194 derivativeAddend2 = 0;
│ │ │ │ -
1195 outJac[j-offset] = order * ( derivativeAddend1 - derivativeAddend2 );
│ │ │ │ -
1196 }
│ │ │ │ -
1197 }
│ │ │ │ -
1198 }
│ │ │ │ -
1199
│ │ │ │ -
1200 // Evaluate 1d function second derivatives
│ │ │ │ -
1201 if (evaluateHessian)
│ │ │ │ -
1202 {
│ │ │ │ -
1203 outHess.resize(limit);
│ │ │ │ -
1204
│ │ │ │ -
1205 if (order<2) // order-zero functions are piecewise constant, hence all derivatives are zero
│ │ │ │ -
1206 std::fill(outHess.begin(), outHess.end(), R(0.0));
│ │ │ │ -
1207 else
│ │ │ │ -
1208 {
│ │ │ │ -
1209 for (size_t j=offset; j<offset+limit; j++)
│ │ │ │ -
1210 {
│ │ │ │ -
1211 assert(j+2 < lowOrderTwoDValues.size());
│ │ │ │ -
1212 R derivativeAddend1 = lowOrderTwoDValues[j] / (knotVector[j+order]-knotVector[j]) / (knotVector[j+order-1]-knotVector[j]);
│ │ │ │ -
1213 R derivativeAddend2 = lowOrderTwoDValues[j+1] / (knotVector[j+order]-knotVector[j]) / (knotVector[j+order]-knotVector[j+1]);
│ │ │ │ -
1214 R derivativeAddend3 = lowOrderTwoDValues[j+1] / (knotVector[j+order+1]-knotVector[j+1]) / (knotVector[j+order]-knotVector[j+1]);
│ │ │ │ -
1215 R derivativeAddend4 = lowOrderTwoDValues[j+2] / (knotVector[j+order+1]-knotVector[j+1]) / (knotVector[j+1+order]-knotVector[j+2]);
│ │ │ │ -
1216 // The two previous terms may evaluate as 0/0. This is to be interpreted as 0.
│ │ │ │ -
1217
│ │ │ │ -
1218 if (std::isnan(derivativeAddend1))
│ │ │ │ -
1219 derivativeAddend1 = 0;
│ │ │ │ -
1220 if (std::isnan(derivativeAddend2))
│ │ │ │ -
1221 derivativeAddend2 = 0;
│ │ │ │ -
1222 if (std::isnan(derivativeAddend3))
│ │ │ │ -
1223 derivativeAddend3 = 0;
│ │ │ │ -
1224 if (std::isnan(derivativeAddend4))
│ │ │ │ -
1225 derivativeAddend4 = 0;
│ │ │ │ -
1226 outHess[j-offset] = order * (order-1) * ( derivativeAddend1 - derivativeAddend2 -derivativeAddend3 + derivativeAddend4 );
│ │ │ │ -
1227 }
│ │ │ │ -
1228 }
│ │ │ │ -
1229 }
│ │ │ │ -
1230 }
│ │ │ │ -
│ │ │ │ -
1231
│ │ │ │ -
1232
│ │ │ │ -
1234 std::array<unsigned int, dim> order_;
│ │ │ │ -
1235
│ │ │ │ -
1237 std::array<std::vector<double>, dim> knotVectors_;
│ │ │ │ -
1238
│ │ │ │ -
1240 std::array<unsigned,dim> elements_;
│ │ │ │ -
1241
│ │ │ │ - │ │ │ │ -
1243};
│ │ │ │ -
│ │ │ │ -
1244
│ │ │ │ -
1245
│ │ │ │ -
1246
│ │ │ │ -
1247template<typename GV>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
1249 public LeafBasisNode
│ │ │ │ -
1250{
│ │ │ │ -
1251 static const int dim = GV::dimension;
│ │ │ │ -
1252
│ │ │ │ -
1253public:
│ │ │ │ -
1254
│ │ │ │ -
1255 using size_type = std::size_t;
│ │ │ │ -
1256 using Element = typename GV::template Codim<0>::Entity;
│ │ │ │ - │ │ │ │ -
1258
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
1260 preBasis_(preBasis),
│ │ │ │ -
1261 finiteElement_(*preBasis)
│ │ │ │ -
1262 {}
│ │ │ │ -
│ │ │ │ -
1263
│ │ │ │ -
│ │ │ │ -
1265 const Element& element() const
│ │ │ │ -
1266 {
│ │ │ │ -
1267 return element_;
│ │ │ │ -
1268 }
│ │ │ │ -
│ │ │ │ -
1269
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
1275 {
│ │ │ │ -
1276 return finiteElement_;
│ │ │ │ -
1277 }
│ │ │ │ -
│ │ │ │ -
1278
│ │ │ │ -
│ │ │ │ -
1280 void bind(const Element& e)
│ │ │ │ -
1281 {
│ │ │ │ -
1282 element_ = e;
│ │ │ │ -
1283 auto elementIndex = preBasis_->gridView().indexSet().index(e);
│ │ │ │ -
1284 finiteElement_.bind(preBasis_->getIJK(elementIndex,preBasis_->elements_));
│ │ │ │ -
1285 this->setSize(finiteElement_.size());
│ │ │ │ -
1286 }
│ │ │ │ -
│ │ │ │ -
1287
│ │ │ │ -
1288protected:
│ │ │ │ -
1289
│ │ │ │ - │ │ │ │ -
1291
│ │ │ │ - │ │ │ │ - │ │ │ │ -
1294};
│ │ │ │ -
│ │ │ │ -
1295
│ │ │ │ -
1296
│ │ │ │ -
1297
│ │ │ │ -
1298namespace BasisFactory {
│ │ │ │ -
1299
│ │ │ │ -
│ │ │ │ -
1306inline auto bSpline(const std::vector<double>& knotVector,
│ │ │ │ -
1307 unsigned int order,
│ │ │ │ -
1308 bool makeOpen = true)
│ │ │ │ -
1309{
│ │ │ │ -
1310 return [&knotVector, order, makeOpen](const auto& gridView) {
│ │ │ │ -
1311 return BSplinePreBasis<std::decay_t<decltype(gridView)>>(gridView, knotVector, order, makeOpen);
│ │ │ │ -
1312 };
│ │ │ │ -
1313}
│ │ │ │ -
│ │ │ │ -
1314
│ │ │ │ -
1315} // end namespace BasisFactory
│ │ │ │ -
1316
│ │ │ │ -
1317// *****************************************************************************
│ │ │ │ -
1318// This is the actual global basis implementation based on the reusable parts.
│ │ │ │ -
1319// *****************************************************************************
│ │ │ │ -
1320
│ │ │ │ -
1327template<typename GV>
│ │ │ │ - │ │ │ │ -
1329
│ │ │ │ -
1330
│ │ │ │ -
1331} // namespace Functions
│ │ │ │ -
1332
│ │ │ │ -
1333} // namespace Dune
│ │ │ │ -
1334
│ │ │ │ -
1335#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:1306
│ │ │ │ + │ │ │ │ +
71 {
│ │ │ │ +
72 return gv_.template end<codim>();
│ │ │ │ +
73 }
│ │ │ │ +
│ │ │ │ +
74
│ │ │ │ +
│ │ │ │ +
76 const GridView& gridView() const
│ │ │ │ +
77 {
│ │ │ │ +
78 return gv_;
│ │ │ │ +
79 }
│ │ │ │ +
│ │ │ │ +
80
│ │ │ │ +
81private:
│ │ │ │ +
82 GridView gv_;
│ │ │ │ +
83};
│ │ │ │ +
│ │ │ │ +
84
│ │ │ │ +
85
│ │ │ │ +
86} // end of namespace Dune::Functions
│ │ │ │ +
87} // end of namespace Dune
│ │ │ │ +
88
│ │ │ │ +
89#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
LocalFiniteElement in the sense of dune-localfunctions, for the B-spline basis on tensor-product grid...
Definition bsplinebasis.hh:362
│ │ │ │ -
BSplineLocalFiniteElement(const BSplineLocalFiniteElement &other)
Copy constructor.
Definition bsplinebasis.hh:383
│ │ │ │ -
const BSplinePreBasis< GV > & preBasis_
Definition bsplinebasis.hh:474
│ │ │ │ -
const BSplineLocalInterpolation< dim, BSplineLocalBasis< GV, R > > & localInterpolation() const
Hand out a LocalInterpolation object.
Definition bsplinebasis.hh:439
│ │ │ │ -
LocalFiniteElementTraits< BSplineLocalBasis< GV, R >, BSplineLocalCoefficients< dim >, BSplineLocalInterpolation< dim, BSplineLocalBasis< GV, R > > > Traits
Export various types related to this LocalFiniteElement.
Definition bsplinebasis.hh:372
│ │ │ │ -
std::array< unsigned, dim > currentKnotSpan_
Definition bsplinebasis.hh:481
│ │ │ │ -
BSplineLocalFiniteElement(const BSplinePreBasis< GV > &preBasis)
Constructor with a given B-spline basis.
Definition bsplinebasis.hh:376
│ │ │ │ -
const BSplineLocalCoefficients< dim > & localCoefficients() const
Hand out a LocalCoefficients object.
Definition bsplinebasis.hh:433
│ │ │ │ -
void bind(const std::array< unsigned, dim > &elementIdx)
Bind LocalFiniteElement to a specific knot span of the spline patch.
Definition bsplinebasis.hh:394
│ │ │ │ -
BSplineLocalInterpolation< dim, BSplineLocalBasis< GV, R > > localInterpolation_
Definition bsplinebasis.hh:478
│ │ │ │ -
GeometryType type() const
Return the reference element that the local finite element is defined on (here, a hypercube)
Definition bsplinebasis.hh:455
│ │ │ │ -
unsigned size() const
Number of shape functions in this finite element.
Definition bsplinebasis.hh:445
│ │ │ │ -
BSplineLocalCoefficients< dim > localCoefficients_
Definition bsplinebasis.hh:477
│ │ │ │ -
unsigned int size(int i) const
Number of degrees of freedom for one coordinate direction.
Definition bsplinebasis.hh:463
│ │ │ │ -
BSplineLocalBasis< GV, R > localBasis_
Definition bsplinebasis.hh:476
│ │ │ │ -
const BSplineLocalBasis< GV, R > & localBasis() const
Hand out a LocalBasis object.
Definition bsplinebasis.hh:427
│ │ │ │ -
Pre-basis for B-spline basis.
Definition bsplinebasis.hh:499
│ │ │ │ -
static constexpr size_type multiIndexBufferSize
Definition bsplinebasis.hh:567
│ │ │ │ -
std::array< unsigned, dim > elements_
Number of grid elements in the different coordinate directions.
Definition bsplinebasis.hh:1240
│ │ │ │ -
GridView gridView_
Definition bsplinebasis.hh:1242
│ │ │ │ -
double R
Definition bsplinebasis.hh:570
│ │ │ │ -
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:1085
│ │ │ │ -
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:781
│ │ │ │ -
std::array< unsigned int, dim > order_
Order of the B-spline for each space dimension.
Definition bsplinebasis.hh:1234
│ │ │ │ -
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition bsplinebasis.hh:719
│ │ │ │ -
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:1128
│ │ │ │ -
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:1028
│ │ │ │ -
unsigned int size(size_t d) const
Number of shape functions in one direction.
Definition bsplinebasis.hh:774
│ │ │ │ -
GV GridView
The grid view that the FE space is defined on.
Definition bsplinebasis.hh:560
│ │ │ │ -
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:735
│ │ │ │ -
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:913
│ │ │ │ -
std::size_t size_type
Definition bsplinebasis.hh:561
│ │ │ │ -
static constexpr size_type maxMultiIndexSize
Definition bsplinebasis.hh:565
│ │ │ │ -
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition bsplinebasis.hh:686
│ │ │ │ -
void initializeIndices()
Initialize the global indices.
Definition bsplinebasis.hh:676
│ │ │ │ -
size_type size(const Dune::ReservedVector< ST, i > &prefix) const
Return number of possible values for next position in multi index.
Definition bsplinebasis.hh:712
│ │ │ │ -
unsigned int size() const
Total number of B-spline basis functions.
Definition bsplinebasis.hh:765
│ │ │ │ -
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition bsplinebasis.hh:680
│ │ │ │ -
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:1009
│ │ │ │ -
Node makeNode() const
Create tree node.
Definition bsplinebasis.hh:694
│ │ │ │ -
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:590
│ │ │ │ -
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:812
│ │ │ │ -
static constexpr size_type minMultiIndexSize
Definition bsplinebasis.hh:566
│ │ │ │ -
std::array< std::vector< double >, dim > knotVectors_
The knot vectors, one for each space dimension.
Definition bsplinebasis.hh:1237
│ │ │ │ -
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition bsplinebasis.hh:725
│ │ │ │ -
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:642
│ │ │ │ -
LocalBasis class in the sense of dune-localfunctions, presenting the restriction of a B-spline patch ...
Definition bsplinebasis.hh:46
│ │ │ │ -
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:55
│ │ │ │ -
unsigned int order() const
Polynomial order of the shape functions.
Definition bsplinebasis.hh:140
│ │ │ │ -
std::size_t size() const
Return the number of basis functions on the current knot span.
Definition bsplinebasis.hh:147
│ │ │ │ -
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:97
│ │ │ │ -
void evaluateFunction(const FieldVector< D, dim > &in, std::vector< FieldVector< R, 1 > > &out) const
Evaluate all shape functions.
Definition bsplinebasis.hh:70
│ │ │ │ -
void evaluateJacobian(const FieldVector< D, dim > &in, std::vector< FieldMatrix< D, 1, dim > > &out) const
Evaluate Jacobian of all shape functions.
Definition bsplinebasis.hh:82
│ │ │ │ -
BSplineLocalBasis(const BSplinePreBasis< GV > &preBasis, const BSplineLocalFiniteElement< GV, R > &lFE)
Constructor with a given B-spline patch.
Definition bsplinebasis.hh:61
│ │ │ │ -
Attaches a shape function to an entity.
Definition bsplinebasis.hh:178
│ │ │ │ -
const LocalKey & localKey(std::size_t i) const
get i'th index
Definition bsplinebasis.hh:321
│ │ │ │ -
void init(const std::array< unsigned, dim > &sizes)
Definition bsplinebasis.hh:256
│ │ │ │ -
std::size_t size() const
number of coefficients
Definition bsplinebasis.hh:315
│ │ │ │ -
Local interpolation in the sense of dune-localfunctions, for the B-spline basis on tensor-product gri...
Definition bsplinebasis.hh:340
│ │ │ │ -
void interpolate(const F &f, std::vector< C > &out) const
Local interpolation of a function.
Definition bsplinebasis.hh:344
│ │ │ │ -
Definition bsplinebasis.hh:1250
│ │ │ │ -
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition bsplinebasis.hh:1274
│ │ │ │ -
typename GV::template Codim< 0 >::Entity Element
Definition bsplinebasis.hh:1256
│ │ │ │ -
const BSplinePreBasis< GV > * preBasis_
Definition bsplinebasis.hh:1290
│ │ │ │ -
Element element_
Definition bsplinebasis.hh:1293
│ │ │ │ -
void bind(const Element &e)
Bind to element.
Definition bsplinebasis.hh:1280
│ │ │ │ -
BSplineNode(const BSplinePreBasis< GV > *preBasis)
Definition bsplinebasis.hh:1259
│ │ │ │ -
const Element & element() const
Return current element, throw if unbound.
Definition bsplinebasis.hh:1265
│ │ │ │ -
FiniteElement finiteElement_
Definition bsplinebasis.hh:1292
│ │ │ │ -
std::size_t size_type
Definition bsplinebasis.hh:1255
│ │ │ │ -
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:46
│ │ │ │ -
size_type size() const
Definition nodes.hh:142
│ │ │ │ -
void setSize(const size_type size)
Definition nodes.hh:164
│ │ │ │ -
Definition nodes.hh:186
│ │ │ │ +
An entity set for all entities of given codim in a grid view.
Definition gridviewentityset.hh:23
│ │ │ │ +
GridViewEntitySet(const GridView &gv)
Construct GridViewEntitySet for a GridView.
Definition gridviewentityset.hh:47
│ │ │ │ +
GV GridView
Definition gridviewentityset.hh:26
│ │ │ │ +
GridView::template Codim< codim >::Entity Element
Type of Elements contained in this EntitySet.
Definition gridviewentityset.hh:32
│ │ │ │ +
const_iterator end() const
Create an end iterator.
Definition gridviewentityset.hh:70
│ │ │ │ +
const GridView & gridView() const
Return the associated GridView.
Definition gridviewentityset.hh:76
│ │ │ │ +
Element value_type
Definition gridviewentityset.hh:38
│ │ │ │ +
const_iterator begin() const
Create a begin iterator.
Definition gridviewentityset.hh:64
│ │ │ │ +
GridView::template Codim< codim >::Iterator const_iterator
A forward iterator.
Definition gridviewentityset.hh:41
│ │ │ │ +
Element::Geometry::LocalCoordinate LocalCoordinate
Type of local coordinates with respect to the Element.
Definition gridviewentityset.hh:35
│ │ │ │ +
size_t size() const
Return number of Elements visited by an iterator.
Definition gridviewentityset.hh:58
│ │ │ │ +
Element::Geometry::GlobalCoordinate GlobalCoordinate
Definition gridviewentityset.hh:36
│ │ │ │ +
@ codim
Definition gridviewentityset.hh:28
│ │ │ │ +
bool contains(const Element &e) const
Return true if e is contained in the EntitySet.
Definition gridviewentityset.hh:52
│ │ │ │ +
const_iterator iterator
Same as const_iterator.
Definition gridviewentityset.hh:44
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,1500 +1,140 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -bsplinebasis.hh │ │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ │ +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 -*- │ │ │ │ │ +1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ -3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BSPLINEBASIS_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BSPLINEBASIS_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH │ │ │ │ │ 5 │ │ │ │ │ -10#include │ │ │ │ │ -11#include │ │ │ │ │ +6#include │ │ │ │ │ +7 │ │ │ │ │ +8 │ │ │ │ │ +9namespace _D_u_n_e { │ │ │ │ │ +10 │ │ │ │ │ +11namespace Functions { │ │ │ │ │ 12 │ │ │ │ │ -14#include │ │ │ │ │ -15 │ │ │ │ │ -16#include │ │ │ │ │ -17#include │ │ │ │ │ -18#include │ │ │ │ │ -19#include │ │ │ │ │ -20#include │ │ │ │ │ -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_/_n_o_d_e_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_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ │ -23 │ │ │ │ │ -24namespace _D_u_n_e │ │ │ │ │ -25{ │ │ │ │ │ -26namespace Functions { │ │ │ │ │ -27 │ │ │ │ │ -28// A maze of dependencies between the different parts of this. We need a few │ │ │ │ │ -forward declarations │ │ │ │ │ -29template │ │ │ │ │ -30class _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; │ │ │ │ │ -31 │ │ │ │ │ -32template │ │ │ │ │ -33class _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s; │ │ │ │ │ -34 │ │ │ │ │ -35 │ │ │ │ │ -44template │ │ │ │ │ -_4_5class _B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s │ │ │ │ │ -46{ │ │ │ │ │ -47 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; │ │ │ │ │ -48 │ │ │ │ │ -49 typedef typename GV::ctype D; │ │ │ │ │ -50 enum {dim = GV::dimension}; │ │ │ │ │ -51public: │ │ │ │ │ -52 │ │ │ │ │ -54 typedef LocalBasisTraits,R,1,FieldVector, │ │ │ │ │ -_5_5 FieldMatrix > _T_r_a_i_t_s; │ │ │ │ │ +13 │ │ │ │ │ +21template │ │ │ │ │ +_2_2class _G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t │ │ │ │ │ +23{ │ │ │ │ │ +24public: │ │ │ │ │ +25 │ │ │ │ │ +_2_6 typedef GV _G_r_i_d_V_i_e_w; │ │ │ │ │ +27 enum { │ │ │ │ │ +28 _c_o_d_i_m = cd │ │ │ │ │ +_2_9 }; │ │ │ │ │ +30 │ │ │ │ │ +_3_2 typedef typename GridView::template Codim::Entity _E_l_e_m_e_n_t; │ │ │ │ │ +33 │ │ │ │ │ +_3_5 typedef typename Element::Geometry::LocalCoordinate _L_o_c_a_l_C_o_o_r_d_i_n_a_t_e; │ │ │ │ │ +_3_6 typedef typename Element::Geometry::GlobalCoordinate _G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e; │ │ │ │ │ +37 │ │ │ │ │ +_3_8 typedef _E_l_e_m_e_n_t _v_a_l_u_e___t_y_p_e; │ │ │ │ │ +39 │ │ │ │ │ +_4_1 typedef typename GridView::template Codim::Iterator _c_o_n_s_t___i_t_e_r_a_t_o_r; │ │ │ │ │ +42 │ │ │ │ │ +_4_4 typedef _c_o_n_s_t___i_t_e_r_a_t_o_r _i_t_e_r_a_t_o_r; │ │ │ │ │ +45 │ │ │ │ │ +_4_7 _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) : │ │ │ │ │ +48 gv_(gv) │ │ │ │ │ +49 {} │ │ │ │ │ +50 │ │ │ │ │ +_5_2 bool _c_o_n_t_a_i_n_s(const _E_l_e_m_e_n_t& e) const │ │ │ │ │ +53 { │ │ │ │ │ +54 return gv_.contains(e); │ │ │ │ │ +55 } │ │ │ │ │ 56 │ │ │ │ │ -_6_1 _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, │ │ │ │ │ -62 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) │ │ │ │ │ -63 : preBasis_(preBasis), │ │ │ │ │ -64 lFE_(lFE) │ │ │ │ │ -65 {} │ │ │ │ │ -66 │ │ │ │ │ -_7_0 void _e_v_a_l_u_a_t_e_F_u_n_c_t_i_o_n (const FieldVector& in, │ │ │ │ │ -71 std::vector >& out) const │ │ │ │ │ -72 { │ │ │ │ │ -73 FieldVector globalIn = offset_; │ │ │ │ │ -74 scaling_.umv(in,globalIn); │ │ │ │ │ -75 │ │ │ │ │ -76 preBasis_.evaluateFunction(globalIn, out, lFE_.currentKnotSpan_); │ │ │ │ │ -77 } │ │ │ │ │ -78 │ │ │ │ │ -_8_2 void _e_v_a_l_u_a_t_e_J_a_c_o_b_i_a_n (const FieldVector& in, │ │ │ │ │ -83 std::vector >& out) const │ │ │ │ │ -84 { │ │ │ │ │ -85 FieldVector globalIn = offset_; │ │ │ │ │ -86 scaling_.umv(in,globalIn); │ │ │ │ │ -87 │ │ │ │ │ -88 preBasis_.evaluateJacobian(globalIn, out, lFE_.currentKnotSpan_); │ │ │ │ │ -89 │ │ │ │ │ -90 for (size_t i=0; i │ │ │ │ │ -_9_7 inline void _e_v_a_l_u_a_t_e (const typename std::array& directions, │ │ │ │ │ -98 const typename Traits::DomainType& in, │ │ │ │ │ -99 std::vector& out) const │ │ │ │ │ -100 { │ │ │ │ │ -101 switch(k) │ │ │ │ │ -102 { │ │ │ │ │ -103 case 0: │ │ │ │ │ -104 _e_v_a_l_u_a_t_e_F_u_n_c_t_i_o_n(in, out); │ │ │ │ │ -105 break; │ │ │ │ │ -106 case 1: │ │ │ │ │ -107 { │ │ │ │ │ -108 FieldVector globalIn = offset_; │ │ │ │ │ -109 scaling_.umv(in,globalIn); │ │ │ │ │ -110 │ │ │ │ │ -111 preBasis_.evaluate(directions, globalIn, out, lFE_.currentKnotSpan_); │ │ │ │ │ -112 │ │ │ │ │ -113 for (size_t i=0; i globalIn = offset_; │ │ │ │ │ -120 scaling_.umv(in,globalIn); │ │ │ │ │ -121 │ │ │ │ │ -122 preBasis_.evaluate(directions, globalIn, out, lFE_.currentKnotSpan_); │ │ │ │ │ -123 │ │ │ │ │ -124 for (size_t i=0; i& preBasis_; │ │ │ │ │ -154 │ │ │ │ │ -155 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_; │ │ │ │ │ -156 │ │ │ │ │ -157 // Coordinates in a single knot span differ from coordinates on the B- │ │ │ │ │ -spline patch │ │ │ │ │ -158 // by an affine transformation. This transformation is stored in offset_ │ │ │ │ │ -and scaling_. │ │ │ │ │ -159 FieldVector offset_; │ │ │ │ │ -160 DiagonalMatrix scaling_; │ │ │ │ │ -161}; │ │ │ │ │ -162 │ │ │ │ │ -176template │ │ │ │ │ -_1_7_7class _B_S_p_l_i_n_e_L_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s │ │ │ │ │ -178{ │ │ │ │ │ -179 // Return i as a d-digit number in the (k+1)-nary system │ │ │ │ │ -180 std::array multiindex (unsigned int i) const │ │ │ │ │ -181 { │ │ │ │ │ -182 std::array alpha; │ │ │ │ │ -183 for (int j=0; j& subEntity) │ │ │ │ │ -193 { │ │ │ │ │ -194 if (sizes_[0]==1) │ │ │ │ │ -195 { │ │ │ │ │ -196 subEntity[0] = 0; │ │ │ │ │ -197 return; │ │ │ │ │ -198 } │ │ │ │ │ -199 │ │ │ │ │ -200 /* edge and vertex numbering │ │ │ │ │ -201 0----0----1 │ │ │ │ │ -202 */ │ │ │ │ │ -203 unsigned lastIndex=0; │ │ │ │ │ -204 subEntity[lastIndex++] = 0; // corner 0 │ │ │ │ │ -205 for (unsigned i = 0; i < sizes_[0] - 2; ++i) │ │ │ │ │ -206 subEntity[lastIndex++] = 0; // inner dofs of element (0) │ │ │ │ │ -207 │ │ │ │ │ -208 subEntity[lastIndex++] = 1; // corner 1 │ │ │ │ │ -209 │ │ │ │ │ -210 assert(_s_i_z_e()==lastIndex); │ │ │ │ │ -211 } │ │ │ │ │ -212 │ │ │ │ │ -213 void setup2d(std::vector& subEntity) │ │ │ │ │ -214 { │ │ │ │ │ -215 unsigned lastIndex=0; │ │ │ │ │ -216 │ │ │ │ │ -217 // LocalKey: entity number , entity codim, dof indices within each entity │ │ │ │ │ -218 /* edge and vertex numbering │ │ │ │ │ -219 2----3----3 │ │ │ │ │ -220 | | │ │ │ │ │ -221 | | │ │ │ │ │ -222 0 1 │ │ │ │ │ -223 | | │ │ │ │ │ -224 | | │ │ │ │ │ -225 0----2----1 │ │ │ │ │ -226 */ │ │ │ │ │ -227 │ │ │ │ │ -228 // lower edge (2) │ │ │ │ │ -229 subEntity[lastIndex++] = 0; // corner 0 │ │ │ │ │ -230 for (unsigned i = 0; i < sizes_[0]-2; ++i) │ │ │ │ │ -231 subEntity[lastIndex++] = 2; // inner dofs of lower edge (2) │ │ │ │ │ -232 │ │ │ │ │ -233 subEntity[lastIndex++] = 1; // corner 1 │ │ │ │ │ -234 │ │ │ │ │ -235 // iterate from bottom to top over inner edge dofs │ │ │ │ │ -236 for (unsigned e = 0; e < sizes_[1]-2; ++e) │ │ │ │ │ -237 { │ │ │ │ │ -238 subEntity[lastIndex++] = 0; // left edge (0) │ │ │ │ │ -239 for (unsigned i = 0; i < sizes_[0]-2; ++i) │ │ │ │ │ -240 subEntity[lastIndex++] = 0; // face dofs │ │ │ │ │ -241 subEntity[lastIndex++] = 1; // right edge (1) │ │ │ │ │ -242 } │ │ │ │ │ -243 │ │ │ │ │ -244 // upper edge (3) │ │ │ │ │ -245 subEntity[lastIndex++] = 2; // corner 2 │ │ │ │ │ -246 for (unsigned i = 0; i < sizes_[0]-2; ++i) │ │ │ │ │ -247 subEntity[lastIndex++] = 3; // inner dofs of upper edge (3) │ │ │ │ │ -248 │ │ │ │ │ -249 subEntity[lastIndex++] = 3; // corner 3 │ │ │ │ │ -250 │ │ │ │ │ -251 assert(_s_i_z_e()==lastIndex); │ │ │ │ │ -252 } │ │ │ │ │ -253 │ │ │ │ │ -254 │ │ │ │ │ -255public: │ │ │ │ │ -_2_5_6 void _i_n_i_t(const std::array& sizes) │ │ │ │ │ -257 { │ │ │ │ │ -258 sizes_ = sizes; │ │ │ │ │ -259 │ │ │ │ │ -260 li_.resize(_s_i_z_e()); │ │ │ │ │ -261 │ │ │ │ │ -262 // Set up array of codimension-per-dof-number │ │ │ │ │ -263 std::vector codim(li_.size()); │ │ │ │ │ -264 │ │ │ │ │ -265 for (std::size_t i=0; i mIdx = multiindex(i); │ │ │ │ │ -271 for (int j=0; j index(_s_i_z_e()); │ │ │ │ │ -282 │ │ │ │ │ -283 for (std::size_t i=0; i mIdx = multiindex(i); │ │ │ │ │ -288 │ │ │ │ │ -289 for (int j=dim-1; j>=0; j--) │ │ │ │ │ -290 if (mIdx[j]>0 and mIdx[j] subEntity(li_.size()); │ │ │ │ │ -296 │ │ │ │ │ -297 if (subEntity.size() > 0) │ │ │ │ │ -298 { │ │ │ │ │ -299 if (dim==1) { │ │ │ │ │ -300 │ │ │ │ │ -301 setup1d(subEntity); │ │ │ │ │ -302 │ │ │ │ │ -303 } else if (dim==2 and sizes_[0]>1 and sizes_[1]>1) { │ │ │ │ │ -304 │ │ │ │ │ -305 setup2d(subEntity); │ │ │ │ │ -306 │ │ │ │ │ -307 } │ │ │ │ │ -308 } │ │ │ │ │ -309 │ │ │ │ │ -310 for (size_t i=0; i()); │ │ │ │ │ -318 } │ │ │ │ │ -319 │ │ │ │ │ -_3_2_1 const LocalKey& _l_o_c_a_l_K_e_y (std::size_t i) const │ │ │ │ │ -322 { │ │ │ │ │ -323 return li_[i]; │ │ │ │ │ -324 } │ │ │ │ │ -325 │ │ │ │ │ -326private: │ │ │ │ │ -327 │ │ │ │ │ -328 // Number of shape functions on this element per coordinate direction │ │ │ │ │ -329 std::array sizes_; │ │ │ │ │ -330 │ │ │ │ │ -331 std::vector li_; │ │ │ │ │ -332}; │ │ │ │ │ -333 │ │ │ │ │ -338template │ │ │ │ │ -_3_3_9class _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 │ │ │ │ │ -340{ │ │ │ │ │ -341public: │ │ │ │ │ -343 template │ │ │ │ │ -_3_4_4 void _i_n_t_e_r_p_o_l_a_t_e (const F& f, std::vector& out) const │ │ │ │ │ -345 { │ │ │ │ │ -346 DUNE_THROW(NotImplemented, "BSplineLocalInterpolation::interpolate"); │ │ │ │ │ -347 } │ │ │ │ │ -348 │ │ │ │ │ -349}; │ │ │ │ │ -350 │ │ │ │ │ -360template │ │ │ │ │ -_3_6_1class _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 │ │ │ │ │ -362{ │ │ │ │ │ -_3_6_3 typedef typename GV::ctype D; │ │ │ │ │ -364 enum {dim = GV::dimension}; │ │ │ │ │ -365 friend class _B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s; │ │ │ │ │ -366public: │ │ │ │ │ -367 │ │ │ │ │ -370 typedef LocalFiniteElementTraits, │ │ │ │ │ -371 _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_2 _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; │ │ │ │ │ -373 │ │ │ │ │ -_3_7_6 _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) │ │ │ │ │ -377 : _p_r_e_B_a_s_i_s__(preBasis), │ │ │ │ │ -378 _l_o_c_a_l_B_a_s_i_s__(preBasis,*this) │ │ │ │ │ -379 {} │ │ │ │ │ -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_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t& other) │ │ │ │ │ -384 : _p_r_e_B_a_s_i_s__(other._p_r_e_B_a_s_i_s__), │ │ │ │ │ -385 _l_o_c_a_l_B_a_s_i_s__(_p_r_e_B_a_s_i_s__,*this) │ │ │ │ │ -386 {} │ │ │ │ │ -387 │ │ │ │ │ -_3_9_4 void _b_i_n_d(const std::array& elementIdx) │ │ │ │ │ -395 { │ │ │ │ │ -396 /* \todo In the long run we need to precompute a table for this */ │ │ │ │ │ -397 for (size_t i=0; i sizes; │ │ │ │ │ -421 for (size_t i=0; i& _l_o_c_a_l_B_a_s_i_s() const │ │ │ │ │ -428 { │ │ │ │ │ -429 return _l_o_c_a_l_B_a_s_i_s__; │ │ │ │ │ -430 } │ │ │ │ │ -431 │ │ │ │ │ -_4_3_3 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 │ │ │ │ │ -434 { │ │ │ │ │ -435 return _l_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s__; │ │ │ │ │ -436 } │ │ │ │ │ -437 │ │ │ │ │ -_4_3_9 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 │ │ │ │ │ -440 { │ │ │ │ │ -441 return _l_o_c_a_l_I_n_t_e_r_p_o_l_a_t_i_o_n__; │ │ │ │ │ -442 } │ │ │ │ │ -443 │ │ │ │ │ -_4_4_5 unsigned _s_i_z_e () const │ │ │ │ │ -446 { │ │ │ │ │ -447 std::size_t r = 1; │ │ │ │ │ -448 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) ) │ │ │ │ │ -470 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); │ │ │ │ │ -471 return r; │ │ │ │ │ -472 } │ │ │ │ │ -473 │ │ │ │ │ -_4_7_4 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__; │ │ │ │ │ -475 │ │ │ │ │ -_4_7_6 _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_7_7 _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_7_8 _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__; │ │ │ │ │ -479 │ │ │ │ │ -480 // The knot span we are bound to │ │ │ │ │ -_4_8_1 std::array _c_u_r_r_e_n_t_K_n_o_t_S_p_a_n__; │ │ │ │ │ -482}; │ │ │ │ │ -483 │ │ │ │ │ -484 │ │ │ │ │ -485template │ │ │ │ │ -486class _B_S_p_l_i_n_e_N_o_d_e; │ │ │ │ │ -487 │ │ │ │ │ -497template │ │ │ │ │ -_4_9_8class _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s │ │ │ │ │ -499{ │ │ │ │ │ -500 static const int dim = GV::dimension; │ │ │ │ │ -501 │ │ │ │ │ -503 class MultiDigitCounter │ │ │ │ │ -504 { │ │ │ │ │ -505 public: │ │ │ │ │ -506 │ │ │ │ │ -510 MultiDigitCounter(const std::array& limits) │ │ │ │ │ -511 : limits_(limits) │ │ │ │ │ -512 { │ │ │ │ │ -513 std::fill(counter_.begin(), counter_.end(), 0); │ │ │ │ │ -514 } │ │ │ │ │ -515 │ │ │ │ │ -517 MultiDigitCounter& operator++() │ │ │ │ │ -518 { │ │ │ │ │ -519 for (int i=0; i limits_; │ │ │ │ │ -551 │ │ │ │ │ -553 std::array counter_; │ │ │ │ │ -554 │ │ │ │ │ -555 }; │ │ │ │ │ -556 │ │ │ │ │ -557public: │ │ │ │ │ -558 │ │ │ │ │ -_5_6_0 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ │ -_5_6_1 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ -562 │ │ │ │ │ -_5_6_3 using _N_o_d_e = _B_S_p_l_i_n_e_N_o_d_e_<_G_V_>; │ │ │ │ │ -564 │ │ │ │ │ -_5_6_5 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 = 1; │ │ │ │ │ -_5_6_6 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 = 1; │ │ │ │ │ -_5_6_7 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 = 1; │ │ │ │ │ -568 │ │ │ │ │ -569 // Type used for function values │ │ │ │ │ -_5_7_0 using _R = double; │ │ │ │ │ -571 │ │ │ │ │ -_5_9_0 _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, │ │ │ │ │ -591 const std::vector& knotVector, │ │ │ │ │ -592 unsigned int order, │ │ │ │ │ -593 bool makeOpen = true) │ │ │ │ │ -594 : _g_r_i_d_V_i_e_w__(_g_r_i_d_V_i_e_w) │ │ │ │ │ -595 { │ │ │ │ │ -596 // \todo Detection of duplicate knots │ │ │ │ │ -597 std::fill(_e_l_e_m_e_n_t_s__.begin(), _e_l_e_m_e_n_t_s__.end(), knotVector.size()-1); │ │ │ │ │ -598 │ │ │ │ │ -599 // Mediocre sanity check: we don't know the number of grid elements in each │ │ │ │ │ -direction. │ │ │ │ │ -600 // but at least we know the total number of elements. │ │ │ │ │ -601 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) ); │ │ │ │ │ -602 │ │ │ │ │ -603 for (int i=0; i& lowerLeft, │ │ │ │ │ -644 const FieldVector& upperRight, │ │ │ │ │ -645 const std::array& elements, │ │ │ │ │ -646 unsigned int order, │ │ │ │ │ -647 bool makeOpen = true) │ │ │ │ │ -648 : _e_l_e_m_e_n_t_s__(elements), │ │ │ │ │ -649 _g_r_i_d_V_i_e_w__(_g_r_i_d_V_i_e_w) │ │ │ │ │ -650 { │ │ │ │ │ -651 // Mediocre sanity check: we don't know the number of grid elements in each │ │ │ │ │ -direction. │ │ │ │ │ -652 // but at least we know the total number of elements. │ │ │ │ │ -653 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) ); │ │ │ │ │ -654 │ │ │ │ │ -655 for (int i=0; i │ │ │ │ │ -702 // size_type size(const SizePrefix& prefix) const │ │ │ │ │ -703 // │ │ │ │ │ -704 // But leads to ambiguity with the other size method: │ │ │ │ │ -705 // │ │ │ │ │ -706 // unsigned int size (size_t d) const │ │ │ │ │ -707 // │ │ │ │ │ -708 // Once the latter is removed, this implementation should be changed. │ │ │ │ │ -709 │ │ │ │ │ -711 template │ │ │ │ │ -_7_1_2 _s_i_z_e___t_y_p_e _s_i_z_e(const Dune::ReservedVector& prefix) const │ │ │ │ │ -713 { │ │ │ │ │ -714 assert(prefix.size() == 0 || prefix.size() == 1); │ │ │ │ │ -715 return (prefix.size() == 0) ? _s_i_z_e() : 0; │ │ │ │ │ -716 } │ │ │ │ │ -717 │ │ │ │ │ -_7_1_9 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ │ -720 { │ │ │ │ │ -721 return _s_i_z_e(); │ │ │ │ │ -722 } │ │ │ │ │ -723 │ │ │ │ │ -_7_2_5 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ │ -726 { │ │ │ │ │ -727 _s_i_z_e___t_y_p_e result = 1; │ │ │ │ │ -728 for (int i=0; i │ │ │ │ │ -_7_3_5 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ │ -736 { │ │ │ │ │ -737 // Local degrees of freedom are arranged in a lattice. │ │ │ │ │ -738 // We need the lattice dimensions to be able to compute lattice coordinates │ │ │ │ │ -from a local index │ │ │ │ │ -739 std::array localSizes; │ │ │ │ │ -740 for (int i=0; i localIJK = _g_e_t_I_J_K(i, localSizes); │ │ │ │ │ -745 │ │ │ │ │ -746 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__; │ │ │ │ │ -747 const auto order = _o_r_d_e_r__; │ │ │ │ │ -748 │ │ │ │ │ -749 std::array globalIJK; │ │ │ │ │ -750 for (int i=0; i=0; i--) │ │ │ │ │ -757 globalIdx = globalIdx * _s_i_z_e(i) + globalIJK[i]; │ │ │ │ │ -758 │ │ │ │ │ -759 *it = {{globalIdx}}; │ │ │ │ │ -760 } │ │ │ │ │ -761 return it; │ │ │ │ │ -762 } │ │ │ │ │ -763 │ │ │ │ │ -_7_6_5 unsigned int _s_i_z_e () const │ │ │ │ │ -766 { │ │ │ │ │ -767 unsigned int result = 1; │ │ │ │ │ -768 for (size_t i=0; i& in, │ │ │ │ │ -782 std::vector >& out, │ │ │ │ │ -783 const std::array& currentKnotSpan) const │ │ │ │ │ -784 { │ │ │ │ │ -785 // Evaluate │ │ │ │ │ -786 std::array, dim> oneDValues; │ │ │ │ │ -787 │ │ │ │ │ -788 for (size_t i=0; i limits; │ │ │ │ │ -792 for (int i=0; i& in, │ │ │ │ │ -813 std::vector >& out, │ │ │ │ │ -814 const std::array& currentKnotSpan) const │ │ │ │ │ -815 { │ │ │ │ │ -816 // How many shape functions to we have in each coordinate direction? │ │ │ │ │ -817 std::array limits; │ │ │ │ │ -818 for (int i=0; i (_k_n_o_t_V_e_c_t_o_r_s__[i]._s_i_z_e() - currentKnotSpan[i] - 2) ) │ │ │ │ │ -824 limits[i] -= _o_r_d_e_r__[i] - (_k_n_o_t_V_e_c_t_o_r_s__[i]._s_i_z_e() - currentKnotSpan[i] - 2); │ │ │ │ │ -825 } │ │ │ │ │ -826 │ │ │ │ │ -827 // The lowest knot spans that we need values from │ │ │ │ │ -828 std::array offset; │ │ │ │ │ -829 for (int i=0; i, dim> oneDValues; │ │ │ │ │ -834 │ │ │ │ │ -835 // Evaluate 1d function values of one order lower (needed for the │ │ │ │ │ -derivative formula) │ │ │ │ │ -836 std::array, dim> lowOrderOneDValues; │ │ │ │ │ -837 │ │ │ │ │ -838 std::array, dim> values; │ │ │ │ │ -839 │ │ │ │ │ -840 for (size_t i=0; i, dim> oneDDerivatives; │ │ │ │ │ -858 for (size_t i=0; i, dim> oneDValuesShort; │ │ │ │ │ -883 │ │ │ │ │ -884 for (int i=0; i │ │ │ │ │ -_9_1_3 void _e_v_a_l_u_a_t_e(const typename std::array& directions, │ │ │ │ │ -914 const FieldVector& in, │ │ │ │ │ -915 std::vector >& out, │ │ │ │ │ -916 const std::array& currentKnotSpan) const │ │ │ │ │ -917 { │ │ │ │ │ -918 if (k != 1 && k != 2) │ │ │ │ │ -919 DUNE_THROW(RangeError, "Differentiation order greater than 2 is not │ │ │ │ │ -supported!"); │ │ │ │ │ -920 │ │ │ │ │ -921 // Evaluate 1d function values (needed for the product rule) │ │ │ │ │ -922 std::array, dim> oneDValues; │ │ │ │ │ -923 std::array, dim> oneDDerivatives; │ │ │ │ │ -924 std::array, dim> oneDSecondDerivatives; │ │ │ │ │ -925 │ │ │ │ │ -926 // Evaluate 1d function derivatives │ │ │ │ │ -927 if (k==1) │ │ │ │ │ -928 for (size_t i=0; i offset; │ │ │ │ │ -936 for (int i=0; i limits; │ │ │ │ │ -941 for (int i=0; i (_k_n_o_t_V_e_c_t_o_r_s__[i]._s_i_z_e() - currentKnotSpan[i] - 2) ) │ │ │ │ │ -949 limits[i] -= _o_r_d_e_r__[i] - (_k_n_o_t_V_e_c_t_o_r_s__[i]._s_i_z_e() - currentKnotSpan[i] - 2); │ │ │ │ │ -950 } │ │ │ │ │ -951 │ │ │ │ │ -952 // Working towards computing only the parts that we really need: │ │ │ │ │ -953 // Let's copy them out into a separate array │ │ │ │ │ -954 std::array, dim> oneDValuesShort; │ │ │ │ │ -955 │ │ │ │ │ -956 for (int i=0; i _g_e_t_I_J_K(typename GridView::IndexSet:: │ │ │ │ │ -IndexType idx, std::array elements) │ │ │ │ │ -1010 { │ │ │ │ │ -1011 std::array result; │ │ │ │ │ -1012 for (int i=0; i& out, │ │ │ │ │ -1029 const std::vector& knotVector, │ │ │ │ │ -1030 unsigned int order, │ │ │ │ │ -1031 unsigned int currentKnotSpan) │ │ │ │ │ -1032 { │ │ │ │ │ -1033 std::size_t outSize = order+1; // The 'standard' value away from the │ │ │ │ │ -boundaries of the knot vector │ │ │ │ │ -1034 if (currentKnotSpan (knotVector.size() - currentKnotSpan - 2) ) │ │ │ │ │ -1037 outSize -= order - (knotVector.size() - currentKnotSpan - 2); │ │ │ │ │ -1038 out.resize(outSize); │ │ │ │ │ -1039 │ │ │ │ │ -1040 // It's not really a matrix that is needed here, a plain 2d array would do │ │ │ │ │ -1041 DynamicMatrix N(order+1, knotVector.size()-1); │ │ │ │ │ -1042 │ │ │ │ │ -1043 // The text books on splines use the following geometric condition here to │ │ │ │ │ -fill the array N │ │ │ │ │ -1044 // (see for example Cottrell, Hughes, Bazilevs, Formula (2.1). However, │ │ │ │ │ -this condition │ │ │ │ │ -1045 // only works if splines are never evaluated exactly on the knots. │ │ │ │ │ -1046 // │ │ │ │ │ -1047 // for (size_t i=0; i 1e-10) │ │ │ │ │ -1056 ? (in - knotVector[i]) / (knotVector[i+r] - knotVector[i]) │ │ │ │ │ -1057 : 0; │ │ │ │ │ -1058 _R factor2 = ((knotVector[i+r+1] - knotVector[i+1]) > 1e-10) │ │ │ │ │ -1059 ? (knotVector[i+r+1] - in) / (knotVector[i+r+1] - knotVector[i+1]) │ │ │ │ │ -1060 : 0; │ │ │ │ │ -1061 N[r][i] = factor1 * N[r-1][i] + factor2 * N[r-1][i+1]; │ │ │ │ │ -1062 } │ │ │ │ │ -1063 │ │ │ │ │ -1068 for (size_t i=0; i& out, │ │ │ │ │ -1087 const std::vector& knotVector, │ │ │ │ │ -1088 unsigned int order, │ │ │ │ │ -1089 unsigned int currentKnotSpan) │ │ │ │ │ -1090 { │ │ │ │ │ -1091 // It's not really a matrix that is needed here, a plain 2d array would do │ │ │ │ │ -1092 DynamicMatrix& N = out; │ │ │ │ │ -1093 │ │ │ │ │ -1094 N.resize(order+1, knotVector.size()-1); │ │ │ │ │ -1095 │ │ │ │ │ -1096 // The text books on splines use the following geometric condition here to │ │ │ │ │ -fill the array N │ │ │ │ │ -1097 // (see for example Cottrell, Hughes, Bazilevs, Formula (2.1). However, │ │ │ │ │ -this condition │ │ │ │ │ -1098 // only works if splines are never evaluated exactly on the knots. │ │ │ │ │ -1099 // │ │ │ │ │ -1100 // for (size_t i=0; i 1e-10) │ │ │ │ │ -1109 ? (in - knotVector[i]) / (knotVector[i+r] - knotVector[i]) │ │ │ │ │ -1110 : 0; │ │ │ │ │ -1111 _R factor2 = ((knotVector[i+r+1] - knotVector[i+1]) > 1e-10) │ │ │ │ │ -1112 ? (knotVector[i+r+1] - in) / (knotVector[i+r+1] - knotVector[i+1]) │ │ │ │ │ -1113 : 0; │ │ │ │ │ -1114 N[r][i] = factor1 * N[r-1][i] + factor2 * N[r-1][i+1]; │ │ │ │ │ -1115 } │ │ │ │ │ -1116 } │ │ │ │ │ -1117 │ │ │ │ │ -1118 │ │ │ │ │ -_1_1_2_8 static void _e_v_a_l_u_a_t_e_A_l_l(const typename GV::ctype& in, │ │ │ │ │ -1129 std::vector& out, │ │ │ │ │ -1130 bool _e_v_a_l_u_a_t_e_J_a_c_o_b_i_a_n, std::vector& outJac, │ │ │ │ │ -1131 bool evaluateHessian, std::vector& outHess, │ │ │ │ │ -1132 const std::vector& knotVector, │ │ │ │ │ -1133 unsigned int order, │ │ │ │ │ -1134 unsigned int currentKnotSpan) │ │ │ │ │ -1135 { │ │ │ │ │ -1136 // How many shape functions to we have in each coordinate direction? │ │ │ │ │ -1137 unsigned int limit; │ │ │ │ │ -1138 limit = order+1; // The 'standard' value away from the boundaries of the │ │ │ │ │ -knot vector │ │ │ │ │ -1139 if (currentKnotSpan (knotVector.size() - currentKnotSpan - 2) ) │ │ │ │ │ -1142 limit -= order - (knotVector.size() - currentKnotSpan - 2); │ │ │ │ │ -1143 │ │ │ │ │ -1144 // The lowest knot spans that we need values from │ │ │ │ │ -1145 unsigned int offset; │ │ │ │ │ -1146 offset = std::max((int)(currentKnotSpan - order),0); │ │ │ │ │ -1147 │ │ │ │ │ -1148 // Evaluate 1d function values (needed for the product rule) │ │ │ │ │ -1149 DynamicMatrix values; │ │ │ │ │ -1150 │ │ │ │ │ -1151 _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); │ │ │ │ │ -1152 │ │ │ │ │ -1153 out.resize(knotVector.size()-order-1); │ │ │ │ │ -1154 for (size_t j=0; j lowOrderOneDValues; │ │ │ │ │ -1159 │ │ │ │ │ -1160 if (order!=0) │ │ │ │ │ -1161 { │ │ │ │ │ -1162 lowOrderOneDValues.resize(knotVector.size()-(order-1)-1); │ │ │ │ │ -1163 for (size_t j=0; j lowOrderTwoDValues; │ │ │ │ │ -1169 │ │ │ │ │ -1170 if (order>1 && evaluateHessian) │ │ │ │ │ -1171 { │ │ │ │ │ -1172 lowOrderTwoDValues.resize(knotVector.size()-(order-2)-1); │ │ │ │ │ -1173 for (size_t j=0; j _o_r_d_e_r__; │ │ │ │ │ -1235 │ │ │ │ │ -_1_2_3_7 std::array, dim> _k_n_o_t_V_e_c_t_o_r_s__; │ │ │ │ │ -1238 │ │ │ │ │ -_1_2_4_0 std::array _e_l_e_m_e_n_t_s__; │ │ │ │ │ -1241 │ │ │ │ │ -_1_2_4_2 _G_r_i_d_V_i_e_w _g_r_i_d_V_i_e_w__; │ │ │ │ │ -1243}; │ │ │ │ │ -1244 │ │ │ │ │ -1245 │ │ │ │ │ -1246 │ │ │ │ │ -1247template │ │ │ │ │ -_1_2_4_8class _B_S_p_l_i_n_e_N_o_d_e : │ │ │ │ │ -1249 public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ │ -1250{ │ │ │ │ │ -1251 static const int dim = GV::dimension; │ │ │ │ │ -1252 │ │ │ │ │ -1253public: │ │ │ │ │ -1254 │ │ │ │ │ -_1_2_5_5 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ -_1_2_5_6 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ │ -_1_2_5_7 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_>; │ │ │ │ │ -1258 │ │ │ │ │ -_1_2_5_9 _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) : │ │ │ │ │ -1260 _p_r_e_B_a_s_i_s__(preBasis), │ │ │ │ │ -1261 _f_i_n_i_t_e_E_l_e_m_e_n_t__(*preBasis) │ │ │ │ │ -1262 {} │ │ │ │ │ -1263 │ │ │ │ │ -_1_2_6_5 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ │ -1266 { │ │ │ │ │ -1267 return _e_l_e_m_e_n_t__; │ │ │ │ │ -1268 } │ │ │ │ │ -1269 │ │ │ │ │ -_1_2_7_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 │ │ │ │ │ -1275 { │ │ │ │ │ -1276 return _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ │ -1277 } │ │ │ │ │ -1278 │ │ │ │ │ -_1_2_8_0 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ │ -1281 { │ │ │ │ │ -1282 _e_l_e_m_e_n_t__ = e; │ │ │ │ │ -1283 auto elementIndex = _p_r_e_B_a_s_i_s__->gridView().indexSet().index(e); │ │ │ │ │ -1284 _f_i_n_i_t_e_E_l_e_m_e_n_t__._b_i_n_d(_p_r_e_B_a_s_i_s__->getIJK(elementIndex,_p_r_e_B_a_s_i_s__->elements_)); │ │ │ │ │ -1285 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__._s_i_z_e()); │ │ │ │ │ -1286 } │ │ │ │ │ -1287 │ │ │ │ │ -1288protected: │ │ │ │ │ -1289 │ │ │ │ │ -_1_2_9_0 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__; │ │ │ │ │ -1291 │ │ │ │ │ -_1_2_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_2_9_3 _E_l_e_m_e_n_t _e_l_e_m_e_n_t__; │ │ │ │ │ -1294}; │ │ │ │ │ -1295 │ │ │ │ │ -1296 │ │ │ │ │ -1297 │ │ │ │ │ -1298namespace BasisFactory { │ │ │ │ │ -1299 │ │ │ │ │ -_1_3_0_6inline auto _b_S_p_l_i_n_e(const std::vector& knotVector, │ │ │ │ │ -1307 unsigned int order, │ │ │ │ │ -1308 bool makeOpen = true) │ │ │ │ │ -1309{ │ │ │ │ │ -1310 return [&knotVector, order, makeOpen](const auto& gridView) { │ │ │ │ │ -1311 return _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s>(gridView, │ │ │ │ │ -knotVector, order, makeOpen); │ │ │ │ │ -1312 }; │ │ │ │ │ -1313} │ │ │ │ │ -1314 │ │ │ │ │ -1315} // end namespace BasisFactory │ │ │ │ │ -1316 │ │ │ │ │ -1317/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -1318// This is the actual global basis implementation based on the reusable │ │ │ │ │ -parts. │ │ │ │ │ -1319/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -1320 │ │ │ │ │ -1327template │ │ │ │ │ -_1_3_2_8using _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_> >; │ │ │ │ │ -1329 │ │ │ │ │ -1330 │ │ │ │ │ -1331} // namespace Functions │ │ │ │ │ -1332 │ │ │ │ │ -1333} // namespace Dune │ │ │ │ │ -1334 │ │ │ │ │ -1335#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BSPLINEBASIS_HH │ │ │ │ │ -_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ │ -_n_o_d_e_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:1306 │ │ │ │ │ +_5_8 size_t _s_i_z_e() const │ │ │ │ │ +59 { │ │ │ │ │ +60 return gv_.size(_c_o_d_i_m); │ │ │ │ │ +61 } │ │ │ │ │ +62 │ │ │ │ │ +_6_4 _c_o_n_s_t___i_t_e_r_a_t_o_r _b_e_g_i_n() const │ │ │ │ │ +65 { │ │ │ │ │ +66 return gv_.template begin(); │ │ │ │ │ +67 } │ │ │ │ │ +68 │ │ │ │ │ +_7_0 _c_o_n_s_t___i_t_e_r_a_t_o_r _e_n_d() const │ │ │ │ │ +71 { │ │ │ │ │ +72 return gv_.template end(); │ │ │ │ │ +73 } │ │ │ │ │ +74 │ │ │ │ │ +_7_6 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ │ +77 { │ │ │ │ │ +78 return gv_; │ │ │ │ │ +79 } │ │ │ │ │ +80 │ │ │ │ │ +81private: │ │ │ │ │ +82 _G_r_i_d_V_i_e_w gv_; │ │ │ │ │ +83}; │ │ │ │ │ +84 │ │ │ │ │ +85 │ │ │ │ │ +86} // end of namespace Dune::Functions │ │ │ │ │ +87} // end of namespace Dune │ │ │ │ │ +88 │ │ │ │ │ +89#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:362 │ │ │ │ │ -_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: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_:_:_p_r_e_B_a_s_i_s__ │ │ │ │ │ -const BSplinePreBasis< GV > & preBasis_ │ │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:474 │ │ │ │ │ -_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:439 │ │ │ │ │ -_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:372 │ │ │ │ │ -_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_:_:_c_u_r_r_e_n_t_K_n_o_t_S_p_a_n__ │ │ │ │ │ -std::array< unsigned, dim > currentKnotSpan_ │ │ │ │ │ -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_:_:_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:376 │ │ │ │ │ -_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:433 │ │ │ │ │ -_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:394 │ │ │ │ │ -_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__ │ │ │ │ │ -BSplineLocalInterpolation< dim, BSplineLocalBasis< GV, R > > │ │ │ │ │ -localInterpolation_ │ │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:478 │ │ │ │ │ -_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:455 │ │ │ │ │ -_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:445 │ │ │ │ │ -_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__ │ │ │ │ │ -BSplineLocalCoefficients< dim > localCoefficients_ │ │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:477 │ │ │ │ │ -_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:463 │ │ │ │ │ -_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__ │ │ │ │ │ -BSplineLocalBasis< GV, R > localBasis_ │ │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:476 │ │ │ │ │ -_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:427 │ │ │ │ │ -_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:499 │ │ │ │ │ -_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_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 bsplinebasis.hh:567 │ │ │ │ │ -_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:1240 │ │ │ │ │ -_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:1242 │ │ │ │ │ -_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: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_:_:_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:1085 │ │ │ │ │ -_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:781 │ │ │ │ │ -_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:1234 │ │ │ │ │ -_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 │ │ │ │ │ -size_type dimension() const │ │ │ │ │ -Get the total dimension of the space spanned by this basis. │ │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:719 │ │ │ │ │ -_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:1128 │ │ │ │ │ -_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:1028 │ │ │ │ │ -_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:774 │ │ │ │ │ -_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 │ │ │ │ │ +_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:23 │ │ │ │ │ +_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:47 │ │ │ │ │ +_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 │ │ │ │ │ GV GridView │ │ │ │ │ -The grid view that the FE space is defined on. │ │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:560 │ │ │ │ │ -_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:735 │ │ │ │ │ -_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:913 │ │ │ │ │ -_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:561 │ │ │ │ │ -_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_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ -static constexpr size_type maxMultiIndexSize │ │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:565 │ │ │ │ │ -_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:686 │ │ │ │ │ -_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:676 │ │ │ │ │ -_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 Dune::ReservedVector< ST, i > &prefix) const │ │ │ │ │ -Return number of possible values for next position in multi index. │ │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:712 │ │ │ │ │ -_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() const │ │ │ │ │ -Total number of B-spline basis functions. │ │ │ │ │ -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_:_:_g_r_i_d_V_i_e_w │ │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:26 │ │ │ │ │ +_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_l_e_m_e_n_t │ │ │ │ │ +GridView::template Codim< codim >::Entity Element │ │ │ │ │ +Type of Elements contained in this EntitySet. │ │ │ │ │ +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_:_:_e_n_d │ │ │ │ │ +const_iterator end() const │ │ │ │ │ +Create an end iterator. │ │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:70 │ │ │ │ │ +_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 bsplinebasis.hh:680 │ │ │ │ │ -_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:1009 │ │ │ │ │ -_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:694 │ │ │ │ │ -_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:590 │ │ │ │ │ -_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:812 │ │ │ │ │ -_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_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ -static constexpr size_type minMultiIndexSize │ │ │ │ │ -DDeeffiinniittiioonn bsplinebasis.hh:566 │ │ │ │ │ -_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:1237 │ │ │ │ │ -_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:725 │ │ │ │ │ -_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:642 │ │ │ │ │ -_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:46 │ │ │ │ │ -_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:55 │ │ │ │ │ -_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:140 │ │ │ │ │ -_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: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_:_:_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:97 │ │ │ │ │ -_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:70 │ │ │ │ │ -_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:82 │ │ │ │ │ -_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:61 │ │ │ │ │ -_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:178 │ │ │ │ │ -_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:321 │ │ │ │ │ -_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:256 │ │ │ │ │ -_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:315 │ │ │ │ │ -_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:340 │ │ │ │ │ -_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:344 │ │ │ │ │ -_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:1250 │ │ │ │ │ -_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:1274 │ │ │ │ │ -_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:1256 │ │ │ │ │ -_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:1290 │ │ │ │ │ -_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:1293 │ │ │ │ │ -_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:1280 │ │ │ │ │ -_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:1259 │ │ │ │ │ -_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:1265 │ │ │ │ │ -_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:1292 │ │ │ │ │ -_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:1255 │ │ │ │ │ -_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:46 │ │ │ │ │ -_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 │ │ │ │ │ -DDeeffiinniittiioonn nodes.hh:142 │ │ │ │ │ -_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:164 │ │ │ │ │ -_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:186 │ │ │ │ │ +Return the associated GridView. │ │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:76 │ │ │ │ │ +_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_:_:_v_a_l_u_e___t_y_p_e │ │ │ │ │ +Element value_type │ │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:38 │ │ │ │ │ +_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:64 │ │ │ │ │ +_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_s_t___i_t_e_r_a_t_o_r │ │ │ │ │ +GridView::template Codim< codim >::Iterator const_iterator │ │ │ │ │ +A forward iterator. │ │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:41 │ │ │ │ │ +_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_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ │ +Element::Geometry::LocalCoordinate LocalCoordinate │ │ │ │ │ +Type of local coordinates with respect to the Element. │ │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:35 │ │ │ │ │ +_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:58 │ │ │ │ │ +_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_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ │ +Element::Geometry::GlobalCoordinate GlobalCoordinate │ │ │ │ │ +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_:_:_c_o_d_i_m │ │ │ │ │ +@ codim │ │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:28 │ │ │ │ │ +_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:52 │ │ │ │ │ +_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_:_:_i_t_e_r_a_t_o_r │ │ │ │ │ +const_iterator iterator │ │ │ │ │ +Same as const_iterator. │ │ │ │ │ +DDeeffiinniittiioonn gridviewentityset.hh:44 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00029.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: hierarchicnodetorangemap.hh File Reference │ │ │ │ +dune-functions: differentiablefunction.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,36 +65,41 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
hierarchicnodetorangemap.hh File Reference
│ │ │ │ +
differentiablefunction.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 <dune/common/typeutilities.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

struct  Dune::Functions::HierarchicNodeToRangeMap
 A simple node to range map using the nested tree indices. More...
class  Dune::Functions::DifferentiableFunction< Signature, DerivativeTraits, bufferSize >
 
class  Dune::Functions::DifferentiableFunction< Range(Domain), DerivativeTraits, bufferSize >
 Class storing differentiable functions using type erasure. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,25 +1,32 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_m_o_n │ │ │ │ │ _C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -hierarchicnodetorangemap.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ +differentiablefunction.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 <_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___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 │ │ │ │ │ -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_:_:_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 │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00029_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: hierarchicnodetorangemap.hh Source File │ │ │ │ +dune-functions: differentiablefunction.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,77 +70,142 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
hierarchicnodetorangemap.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH
│ │ │ │
5
│ │ │ │ -
6
│ │ │ │ -
7#include <utility>
│ │ │ │ -
8#include <type_traits>
│ │ │ │ +
6#include <type_traits>
│ │ │ │ +
7
│ │ │ │ +
8#include <dune/common/typeutilities.hh>
│ │ │ │
9
│ │ │ │ -
10#include <dune/common/concept.hh>
│ │ │ │ -
11
│ │ │ │ - │ │ │ │ - │ │ │ │ -
14
│ │ │ │ -
15namespace Dune {
│ │ │ │ -
16namespace Functions {
│ │ │ │ -
17
│ │ │ │ -
18
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
16
│ │ │ │ +
17namespace Dune {
│ │ │ │ +
18namespace Functions {
│ │ │ │
19
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
30{
│ │ │ │ -
31 template<class Node, class TreePath, class Range,
│ │ │ │ -
32 std::enable_if_t< models<Concept::HasIndexAccess, Range, Dune::index_constant<0>>(), int> = 0>
│ │ │ │ -
│ │ │ │ -
33 decltype(auto) operator()(const Node&, const TreePath& treePath, Range&& y) const
│ │ │ │ -
34 {
│ │ │ │ -
35 return resolveStaticMultiIndex(y, treePath);
│ │ │ │ -
36 }
│ │ │ │ -
│ │ │ │ -
37
│ │ │ │ -
38 template<class Node, class TreePath, class Range,
│ │ │ │ -
39 std::enable_if_t<not models<Concept::HasIndexAccess, Range, Dune::index_constant<0>>(), int> = 0>
│ │ │ │ -
│ │ │ │ -
40 decltype(auto) operator()(const Node&, const TreePath&, Range&& y) const
│ │ │ │ -
41 {
│ │ │ │ -
42 return std::forward<Range>(y);
│ │ │ │ -
43 }
│ │ │ │ -
│ │ │ │ -
44};
│ │ │ │ -
│ │ │ │ +
20
│ │ │ │ +
21
│ │ │ │ +
22/*
│ │ │ │ +
23 * Default implementation is empty
│ │ │ │ +
24 * The actual implementation is only given if Signature is an type
│ │ │ │ +
25 * describing a function signature as Range(Domain).
│ │ │ │ +
26 */
│ │ │ │ +
27template<class Signature, template<class> class DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
29{};
│ │ │ │ +
│ │ │ │ +
30
│ │ │ │ +
31
│ │ │ │ +
32
│ │ │ │ +
33namespace Imp
│ │ │ │ +
34{
│ │ │ │ +
35
│ │ │ │ +
37 template<class S, template<class> class DerivativeTraits, size_t bufferSize>
│ │ │ │ +
38 struct DifferentiableFunctionTraits
│ │ │ │ +
39 {
│ │ │ │ +
41 using Signature = S;
│ │ │ │ +
42
│ │ │ │ +
44 using Range = typename SignatureTraits<Signature>::Range;
│ │ │ │
45
│ │ │ │ -
46
│ │ │ │ -
47
│ │ │ │ -
48} // namespace Dune::Functions
│ │ │ │ -
49} // namespace Dune
│ │ │ │ -
50
│ │ │ │ +
47 using Domain = typename SignatureTraits<Signature>::Domain;
│ │ │ │ +
48
│ │ │ │ +
50 using DerivativeSignature = typename SignatureTraits<Signature>::template DerivativeSignature<DerivativeTraits>;
│ │ │ │
51
│ │ │ │ -
52#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:398
│ │ │ │ + │ │ │ │ +
54
│ │ │ │ +
56 using Concept = DifferentiableFunctionWrapperInterface<Signature, DerivativeInterface>;
│ │ │ │ +
57
│ │ │ │ +
59 template<class B>
│ │ │ │ +
60 using Model = DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>;
│ │ │ │ +
61 };
│ │ │ │ +
62}
│ │ │ │ +
63
│ │ │ │ +
64
│ │ │ │ +
65
│ │ │ │ +
80template<class Range, class Domain, template<class> class DerivativeTraits, size_t bufferSize>
│ │ │ │ +
│ │ │ │ +
81class DifferentiableFunction< Range(Domain), DerivativeTraits, bufferSize> :
│ │ │ │ +
82 public TypeErasureBase<
│ │ │ │ +
83 typename Imp::DifferentiableFunctionTraits<Range(Domain), DerivativeTraits, bufferSize>::Concept,
│ │ │ │ +
84 Imp::DifferentiableFunctionTraits<Range(Domain), DerivativeTraits, bufferSize>::template Model>
│ │ │ │ +
85{
│ │ │ │ +
86 using Traits = Imp::DifferentiableFunctionTraits<Range(Domain), DerivativeTraits, bufferSize>;
│ │ │ │ +
87
│ │ │ │ + │ │ │ │ +
89
│ │ │ │ +
90 using DerivativeInterface = typename Traits::DerivativeInterface;
│ │ │ │ +
91
│ │ │ │ +
92public:
│ │ │ │ +
93
│ │ │ │ +
105 template<class F, disableCopyMove<DifferentiableFunction, F> = 0 >
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
107 Base(std::forward<F>(f))
│ │ │ │ +
108 {
│ │ │ │ +
109 static_assert(Dune::Functions::Concept::isFunction<F, Range(Domain)>(), "Trying to construct a DifferentiableFunction from type that does not model the Function concept");
│ │ │ │ +
110 }
│ │ │ │ +
│ │ │ │ +
111
│ │ │ │ + │ │ │ │ +
114
│ │ │ │ +
│ │ │ │ +
118 Range operator() (const Domain& x) const
│ │ │ │ +
119 {
│ │ │ │ +
120 return this->asInterface().operator()(x);
│ │ │ │ +
121 }
│ │ │ │ +
│ │ │ │ +
122
│ │ │ │ +
│ │ │ │ +
130 friend DerivativeInterface derivative(const DifferentiableFunction& t)
│ │ │ │ +
131 {
│ │ │ │ +
132 return t.asInterface().derivative();
│ │ │ │ +
133 }
│ │ │ │ +
│ │ │ │ +
134};
│ │ │ │ +
│ │ │ │ +
135
│ │ │ │ +
136
│ │ │ │ +
137
│ │ │ │ +
138}} // namespace Dune::Functions
│ │ │ │ +
139
│ │ │ │ +
140
│ │ │ │ +
141
│ │ │ │ +
142#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
friend DerivativeInterface derivative(const DifferentiableFunction &t)
Get derivative of wrapped function.
Definition differentiablefunction.hh:130
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
A simple node to range map using the nested tree indices.
Definition hierarchicnodetorangemap.hh:30
│ │ │ │ -
decltype(auto) operator()(const Node &, const TreePath &treePath, Range &&y) const
Definition hierarchicnodetorangemap.hh:33
│ │ │ │ -
decltype(auto) operator()(const Node &, const TreePath &, Range &&y) const
Definition hierarchicnodetorangemap.hh:40
│ │ │ │ - │ │ │ │ +
Definition differentiablefunction.hh:29
│ │ │ │ +
DifferentiableFunction(F &&f)
Construct from function.
Definition differentiablefunction.hh:106
│ │ │ │ + │ │ │ │ +
Helper class to deduce the signature of a callable.
Definition signature.hh:56
│ │ │ │ +
Base class for type-erased interface wrapper.
Definition typeerasure.hh:165
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,76 +1,151 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -hierarchicnodetorangemap.hh │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH │ │ │ │ │ 5 │ │ │ │ │ -6 │ │ │ │ │ -7#include │ │ │ │ │ -8#include │ │ │ │ │ +6#include │ │ │ │ │ +7 │ │ │ │ │ +8#include │ │ │ │ │ 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_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ │ -13#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> │ │ │ │ │ -14 │ │ │ │ │ -15namespace _D_u_n_e { │ │ │ │ │ -16namespace Functions { │ │ │ │ │ -17 │ │ │ │ │ -18 │ │ │ │ │ +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_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#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#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_/_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_/_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ │ +16 │ │ │ │ │ +17namespace _D_u_n_e { │ │ │ │ │ +18namespace Functions { │ │ │ │ │ 19 │ │ │ │ │ -_2_9struct _H_i_e_r_a_r_c_h_i_c_N_o_d_e_T_o_R_a_n_g_e_M_a_p │ │ │ │ │ -30{ │ │ │ │ │ -31 template>(), int> = 0> │ │ │ │ │ -_3_3 decltype(auto) _o_p_e_r_a_t_o_r_(_)(const Node&, const TreePath& treePath, Range&& y) │ │ │ │ │ -const │ │ │ │ │ -34 { │ │ │ │ │ -35 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); │ │ │ │ │ -36 } │ │ │ │ │ -37 │ │ │ │ │ -38 template>(), int> = 0> │ │ │ │ │ -_4_0 decltype(auto) _o_p_e_r_a_t_o_r_(_)(const Node&, const TreePath&, Range&& y) const │ │ │ │ │ -41 { │ │ │ │ │ -42 return std::forward(y); │ │ │ │ │ -43 } │ │ │ │ │ -44}; │ │ │ │ │ +20 │ │ │ │ │ +21 │ │ │ │ │ +22/* │ │ │ │ │ +23 * Default implementation is empty │ │ │ │ │ +24 * The actual implementation is only given if Signature is an type │ │ │ │ │ +25 * describing a function signature as Range(Domain). │ │ │ │ │ +26 */ │ │ │ │ │ +27template class │ │ │ │ │ +DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56> │ │ │ │ │ +_2_8class _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n │ │ │ │ │ +29{}; │ │ │ │ │ +30 │ │ │ │ │ +31 │ │ │ │ │ +32 │ │ │ │ │ +33namespace Imp │ │ │ │ │ +34{ │ │ │ │ │ +35 │ │ │ │ │ +37 template class DerivativeTraits, size_t bufferSize> │ │ │ │ │ +38 struct DifferentiableFunctionTraits │ │ │ │ │ +39 { │ │ │ │ │ +41 using Signature = S; │ │ │ │ │ +42 │ │ │ │ │ +44 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; │ │ │ │ │ 45 │ │ │ │ │ -46 │ │ │ │ │ -47 │ │ │ │ │ -48} // namespace Dune::Functions │ │ │ │ │ -49} // namespace Dune │ │ │ │ │ -50 │ │ │ │ │ +47 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; │ │ │ │ │ +48 │ │ │ │ │ +50 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; │ │ │ │ │ 51 │ │ │ │ │ -52#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:398 │ │ │ │ │ +53 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_>; │ │ │ │ │ +54 │ │ │ │ │ +56 using Concept = DifferentiableFunctionWrapperInterface; │ │ │ │ │ +57 │ │ │ │ │ +59 template │ │ │ │ │ +60 using Model = DifferentiableFunctionWrapperImplementation; │ │ │ │ │ +61 }; │ │ │ │ │ +62} │ │ │ │ │ +63 │ │ │ │ │ +64 │ │ │ │ │ +65 │ │ │ │ │ +80template class DerivativeTraits, │ │ │ │ │ +size_t bufferSize> │ │ │ │ │ +_8_1class _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> : │ │ │ │ │ +82 public _T_y_p_e_E_r_a_s_u_r_e_B_a_s_e< │ │ │ │ │ +83 typename Imp::DifferentiableFunctionTraits::Concept, │ │ │ │ │ +84 Imp::DifferentiableFunctionTraits::template Model> │ │ │ │ │ +85{ │ │ │ │ │ +86 using Traits = Imp::DifferentiableFunctionTraits; │ │ │ │ │ +87 │ │ │ │ │ +88 using _B_a_s_e = _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_>; │ │ │ │ │ +89 │ │ │ │ │ +90 using DerivativeInterface = typename _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; │ │ │ │ │ +91 │ │ │ │ │ +92public: │ │ │ │ │ +93 │ │ │ │ │ +105 template = 0 > │ │ │ │ │ +_1_0_6 _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n(F&& f) : │ │ │ │ │ +107 _B_a_s_e(std::forward(f)) │ │ │ │ │ +108 { │ │ │ │ │ +109 static_assert(Dune::Functions::Concept::isFunction(), │ │ │ │ │ +"Trying to construct a DifferentiableFunction from type that does not model the │ │ │ │ │ +Function concept"); │ │ │ │ │ +110 } │ │ │ │ │ +111 │ │ │ │ │ +_1_1_3 _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n() = default; │ │ │ │ │ +114 │ │ │ │ │ +_1_1_8 Range operator() (const Domain& x) const │ │ │ │ │ +119 { │ │ │ │ │ +120 return this->asInterface().operator()(x); │ │ │ │ │ +121 } │ │ │ │ │ +122 │ │ │ │ │ +_1_3_0 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) │ │ │ │ │ +131 { │ │ │ │ │ +132 return t.asInterface().derivative(); │ │ │ │ │ +133 } │ │ │ │ │ +134}; │ │ │ │ │ +135 │ │ │ │ │ +136 │ │ │ │ │ +137 │ │ │ │ │ +138}} // namespace Dune::Functions │ │ │ │ │ +139 │ │ │ │ │ +140 │ │ │ │ │ +141 │ │ │ │ │ +142#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH │ │ │ │ │ +_s_i_g_n_a_t_u_r_e_._h_h │ │ │ │ │ +_t_y_p_e___t_r_a_i_t_s_._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 │ │ │ │ │ +_t_y_p_e_e_r_a_s_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 │ │ │ │ │ +_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_:_:_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:130 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:30 │ │ │ │ │ -_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:33 │ │ │ │ │ -_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:40 │ │ │ │ │ -_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:29 │ │ │ │ │ +_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:106 │ │ │ │ │ +_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:56 │ │ │ │ │ +_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 │ │ │ │ │ +Base class for type-erased interface wrapper. │ │ │ │ │ +DDeeffiinniittiioonn typeerasure.hh:165 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00032.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: defaultnodetorangemap.hh File Reference │ │ │ │ +dune-functions: referencehelper.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,55 +65,58 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ Namespaces | │ │ │ │ -Functions
│ │ │ │ -
defaultnodetorangemap.hh File Reference
│ │ │ │ +Typedefs | │ │ │ │ +Functions | │ │ │ │ +Variables
│ │ │ │ +
referencehelper.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <dune/common/concept.hh>
│ │ │ │ -#include <dune/functions/functionspacebases/concepts.hh>
│ │ │ │ -#include <dune/typetree/traversal.hh>
│ │ │ │ -#include <dune/typetree/visitor.hh>
│ │ │ │ +
#include <type_traits>
│ │ │ │ +#include <dune/common/referencehelper.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │

│ │ │ │ Namespaces

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

│ │ │ │ -Classes

struct  Dune::Functions::DefaultNodeToRangeMap< Tree >
 A simple node to range map using lexicographic ordering. More...
 
struct  Dune::Functions::DefaultNodeToRangeMap< Tree >::Visitor
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

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

│ │ │ │ +Typedefs

template<class T >
using Dune::Functions::ResolveRef_t = Dune::ResolveRef_t< T >
 This is an alias for Dune::ResolveRef_t.
 
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ Functions

template<class Tree >
DefaultNodeToRangeMap< Tree > Dune::Functions::makeDefaultNodeToRangeMap (const Tree &tree)
 
template<class Basis , class TreePath >
auto Dune::Functions::makeDefaultNodeToRangeMap (const Basis &basis, TreePath &&treePath) -> decltype(makeDefaultNodeToRangeMap(TypeTree::child(basis.localView().tree(), treePath)))
 
template<class T >
decltype(auto) Dune::Functions::resolveRef (T &&t)
 This is an alias for Dune::resolveRef.
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +Variables

template<class T >
constexpr bool Dune::Functions::IsReferenceWrapper_v = Dune::IsReferenceWrapper_v<T>
 This is an alias for Dune::IsReferenceWrapper_v.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,38 +1,35 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -defaultnodetorangemap.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_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +_N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _F_u_n_c_t_i_o_n_s | _V_a_r_i_a_b_l_e_s │ │ │ │ │ +referencehelper.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_:_:_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p_<_ _T_r_e_e_ _> │ │ │ │ │ -  A simple node to range map using lexicographic ordering. _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_N_o_d_e_T_o_R_a_n_g_e_M_a_p_<_ _T_r_e_e_ _>_:_:_V_i_s_i_t_o_r │ │ │ │ │ -  │ │ │ │ │ NNaammeessppaacceess │ │ │ │ │ namespace   _D_u_n_e │ │ │ │ │   │ │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ │   │ │ │ │ │ -FFuunnccttiioonnss │ │ │ │ │ -template │ │ │ │ │ -_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p< Tree >  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p │ │ │ │ │ - (const Tree &tree) │ │ │ │ │ +TTyyppeeddeeffss │ │ │ │ │ +template │ │ │ │ │ +using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_o_l_v_e_R_e_f___t = Dune::ResolveRef_t< T > │ │ │ │ │ +  This is an alias for Dune::ResolveRef_t. │ │ │ │ │   │ │ │ │ │ -template │ │ │ │ │ - auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p │ │ │ │ │ - (const Basis &basis, TreePath &&treePath) - │ │ │ │ │ - > decltype(makeDefaultNodeToRangeMap(TypeTree:: │ │ │ │ │ - child(basis.localView().tree(), treePath))) │ │ │ │ │ +FFuunnccttiioonnss │ │ │ │ │ +template │ │ │ │ │ +decltype(auto)  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_r_e_s_o_l_v_e_R_e_f (T &&t) │ │ │ │ │ +  This is an alias for Dune::resolveRef. │ │ │ │ │ +  │ │ │ │ │ +VVaarriiaabblleess │ │ │ │ │ +template │ │ │ │ │ +constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_s_R_e_f_e_r_e_n_c_e_W_r_a_p_p_e_r___v = Dune:: │ │ │ │ │ + IsReferenceWrapper_v │ │ │ │ │ +  This is an alias for Dune::IsReferenceWrapper_v. │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00032_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: defaultnodetorangemap.hh Source File │ │ │ │ +dune-functions: referencehelper.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,149 +70,71 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
defaultnodetorangemap.hh
│ │ │ │ +
referencehelper.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTNODETORANGEMAP_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTNODETORANGEMAP_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_COMMON_REFERENCE_HELPER_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_COMMON_REFERENCE_HELPER_HH
│ │ │ │
5
│ │ │ │ -
6
│ │ │ │ -
7#include <dune/common/concept.hh>
│ │ │ │ -
8
│ │ │ │ - │ │ │ │ -
10
│ │ │ │ -
11#include <dune/typetree/traversal.hh>
│ │ │ │ -
12#include <dune/typetree/visitor.hh>
│ │ │ │ +
6#warning The header dune/functions/common/referencehelper.hh is deprecated and will be removed after release 2.9. Include dune/common/referencehelper.hh instead.
│ │ │ │ +
7
│ │ │ │ +
8#include <type_traits>
│ │ │ │ +
9
│ │ │ │ +
10#include <dune/common/referencehelper.hh>
│ │ │ │ +
11
│ │ │ │ +
12
│ │ │ │
13
│ │ │ │
14
│ │ │ │
15namespace Dune {
│ │ │ │
16namespace Functions {
│ │ │ │
17
│ │ │ │
18
│ │ │ │ -
19
│ │ │ │ -
37template<class Tree>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
39{
│ │ │ │ -
40
│ │ │ │ -
41 // A simple visitor for computing lexicographic
│ │ │ │ -
42 // subtree indices. To identify a leaf node
│ │ │ │ -
43 // we use its treeIndex() which is unique
│ │ │ │ -
44 // wrt the whole tree and store the computed
│ │ │ │ -
45 // index in a vector indexed by the tree indices.
│ │ │ │ -
│ │ │ │ -
46 struct Visitor
│ │ │ │ -
47 : public TypeTree::TreeVisitor
│ │ │ │ -
48 , public TypeTree::DynamicTraversal
│ │ │ │ -
49 {
│ │ │ │ -
│ │ │ │ -
50 Visitor(std::vector<std::size_t>& indices) :
│ │ │ │ -
51 indices_(indices),
│ │ │ │ -
52 counter_(0)
│ │ │ │ -
53 {}
│ │ │ │ -
│ │ │ │ +
23template<class T>
│ │ │ │ +
24[[deprecated("Use Dune::IsReferenceWrapper_v instead. Will be removed after release 2.9.")]]
│ │ │ │ +
25constexpr bool
│ │ │ │ +
26IsReferenceWrapper_v = Dune::IsReferenceWrapper_v<T>;
│ │ │ │ +
27
│ │ │ │ +
28
│ │ │ │ +
33template<class T>
│ │ │ │ +
34decltype(auto)
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
36[[deprecated("Use Dune::resolveRef instead. Will be removed after release 2.9.")]]
│ │ │ │ +
37(T&& t)
│ │ │ │ +
38{
│ │ │ │ +
39 return Dune::resolveRef(std::forward<T>(t));
│ │ │ │ +
40}
│ │ │ │ +
│ │ │ │ +
41
│ │ │ │ +
46template<class T>
│ │ │ │ + │ │ │ │ +
48[[deprecated("Use Dune::ResolveRef_t instead. Will be removed after release 2.9.")]]
│ │ │ │ +
49 = Dune::ResolveRef_t<T>;
│ │ │ │ +
50
│ │ │ │ +
51
│ │ │ │ +
52}} // namespace Dune::Functions
│ │ │ │ +
53
│ │ │ │
54
│ │ │ │ -
55 template<typename Node, typename TreePath>
│ │ │ │ -
│ │ │ │ -
56 void leaf(Node& node, TreePath treePath)
│ │ │ │ -
57 {
│ │ │ │ -
58 if (indices_.size() < node.treeIndex()+1)
│ │ │ │ -
59 indices_.resize(node.treeIndex()+1);
│ │ │ │ -
60 indices_[node.treeIndex()] = counter_;
│ │ │ │ -
61 ++counter_;
│ │ │ │ -
62 }
│ │ │ │ -
│ │ │ │ -
63
│ │ │ │ -
64 std::vector<std::size_t>& indices_;
│ │ │ │ -
65 std::size_t counter_;
│ │ │ │ -
66 };
│ │ │ │ -
│ │ │ │ -
67
│ │ │ │ -
│ │ │ │ -
78 DefaultNodeToRangeMap(const Tree& tree)
│ │ │ │ -
79 {
│ │ │ │ -
80 TypeTree::applyToTree(tree, Visitor(indices_));
│ │ │ │ -
81 }
│ │ │ │ -
│ │ │ │ -
82
│ │ │ │ -
83 template<class Node, class TreePath, class Range,
│ │ │ │ -
84 std::enable_if_t<models<Concept::HasIndexAccess, Range, decltype(std::declval<Node>().treeIndex())>() and not Tree::isLeaf, int> = 0>
│ │ │ │ -
│ │ │ │ -
85 decltype(auto) operator()(const Node& node, const TreePath& treePath, Range&& y) const
│ │ │ │ -
86 {
│ │ │ │ -
87 return y[indices_[node.treeIndex()]];
│ │ │ │ -
88 }
│ │ │ │ -
│ │ │ │ -
89
│ │ │ │ -
90 template<class Node, class TreePath, class Range,
│ │ │ │ -
91 std::enable_if_t< not models<Concept::HasIndexAccess, Range, decltype(std::declval<Node>().treeIndex())>() or Tree::isLeaf, int> = 0>
│ │ │ │ -
│ │ │ │ -
92 decltype(auto) operator()(const Node& node, const TreePath& treePath, Range&& y) const
│ │ │ │ -
93 {
│ │ │ │ -
94 return std::forward<Range>(y);
│ │ │ │ -
95 }
│ │ │ │ -
│ │ │ │ -
96
│ │ │ │ -
97 std::vector<std::size_t> indices_;
│ │ │ │ -
98};
│ │ │ │ -
│ │ │ │ -
99
│ │ │ │ -
100
│ │ │ │ -
101
│ │ │ │ -
102template<class Tree>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
104{
│ │ │ │ -
105 return DefaultNodeToRangeMap<Tree>(tree);
│ │ │ │ -
106}
│ │ │ │ -
│ │ │ │ -
107
│ │ │ │ -
108
│ │ │ │ -
109
│ │ │ │ -
110template<class Basis, class TreePath>
│ │ │ │ -
│ │ │ │ -
111auto makeDefaultNodeToRangeMap(const Basis& basis, TreePath&& treePath)
│ │ │ │ -
112 -> decltype(makeDefaultNodeToRangeMap(TypeTree::child(basis.localView().tree(),treePath)))
│ │ │ │ -
113{
│ │ │ │ -
114 auto&& localView = basis.localView();
│ │ │ │ -
115 localView.bind(*basis.gridView().template begin<0>());
│ │ │ │ -
116 auto&& tree = TypeTree::child(localView.tree(),treePath);
│ │ │ │ -
117 return makeDefaultNodeToRangeMap(tree);
│ │ │ │ -
118}
│ │ │ │ -
│ │ │ │ -
119
│ │ │ │ -
120
│ │ │ │ -
121
│ │ │ │ -
122} // namespace Dune::Functions
│ │ │ │ -
123} // namespace Dune
│ │ │ │ -
124
│ │ │ │ -
125
│ │ │ │ -
126#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTNODETORANGEMAP_HH
│ │ │ │ +
55
│ │ │ │ +
56#endif // DUNE_FUNCTIONS_COMMON_REFERENCE_HELPER_HH
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
DefaultNodeToRangeMap< Tree > makeDefaultNodeToRangeMap(const Tree &tree)
Definition defaultnodetorangemap.hh:103
│ │ │ │ -
A simple node to range map using lexicographic ordering.
Definition defaultnodetorangemap.hh:39
│ │ │ │ -
std::vector< std::size_t > indices_
Definition defaultnodetorangemap.hh:97
│ │ │ │ -
DefaultNodeToRangeMap(const Tree &tree)
Construct DefaultNodeToRangeMap.
Definition defaultnodetorangemap.hh:78
│ │ │ │ -
Definition defaultnodetorangemap.hh:49
│ │ │ │ -
Visitor(std::vector< std::size_t > &indices)
Definition defaultnodetorangemap.hh:50
│ │ │ │ -
void leaf(Node &node, TreePath treePath)
Definition defaultnodetorangemap.hh:56
│ │ │ │ -
std::size_t counter_
Definition defaultnodetorangemap.hh:65
│ │ │ │ -
std::vector< std::size_t > & indices_
Definition defaultnodetorangemap.hh:64
│ │ │ │ - │ │ │ │ +
constexpr bool IsReferenceWrapper_v
This is an alias for Dune::IsReferenceWrapper_v.
Definition referencehelper.hh:26
│ │ │ │ +
Dune::ResolveRef_t< T > ResolveRef_t
This is an alias for Dune::ResolveRef_t.
Definition referencehelper.hh:49
│ │ │ │ +
decltype(auto) resolveRef(T &&t)
This is an alias for Dune::resolveRef.
Definition referencehelper.hh:37
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,145 +1,74 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -defaultnodetorangemap.hh │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +referencehelper.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTNODETORANGEMAP_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTNODETORANGEMAP_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_COMMON_REFERENCE_HELPER_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_COMMON_REFERENCE_HELPER_HH │ │ │ │ │ 5 │ │ │ │ │ -6 │ │ │ │ │ -7#include │ │ │ │ │ -8 │ │ │ │ │ -9#include <_d_u_n_e_/_f_u_n_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> │ │ │ │ │ -10 │ │ │ │ │ -11#include │ │ │ │ │ -12#include │ │ │ │ │ +6#warning The header dune/functions/common/referencehelper.hh is deprecated and │ │ │ │ │ +will be removed after release 2.9. Include dune/common/referencehelper.hh │ │ │ │ │ +instead. │ │ │ │ │ +7 │ │ │ │ │ +8#include │ │ │ │ │ +9 │ │ │ │ │ +10#include │ │ │ │ │ +11 │ │ │ │ │ +12 │ │ │ │ │ 13 │ │ │ │ │ 14 │ │ │ │ │ 15namespace _D_u_n_e { │ │ │ │ │ 16namespace Functions { │ │ │ │ │ 17 │ │ │ │ │ 18 │ │ │ │ │ -19 │ │ │ │ │ -37template │ │ │ │ │ -_3_8struct _D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p │ │ │ │ │ -39{ │ │ │ │ │ -40 │ │ │ │ │ -41 // A simple visitor for computing lexicographic │ │ │ │ │ -42 // subtree indices. To identify a leaf node │ │ │ │ │ -43 // we use its treeIndex() which is unique │ │ │ │ │ -44 // wrt the whole tree and store the computed │ │ │ │ │ -45 // index in a vector indexed by the tree indices. │ │ │ │ │ -_4_6 struct _V_i_s_i_t_o_r │ │ │ │ │ -47 : public TypeTree::TreeVisitor │ │ │ │ │ -48 , public TypeTree::DynamicTraversal │ │ │ │ │ -49 { │ │ │ │ │ -_5_0 _V_i_s_i_t_o_r(std::vector& indices) : │ │ │ │ │ -51 _i_n_d_i_c_e_s__(indices), │ │ │ │ │ -52 _c_o_u_n_t_e_r__(0) │ │ │ │ │ -53 {} │ │ │ │ │ +23template │ │ │ │ │ +24[[deprecated("Use Dune::IsReferenceWrapper_v instead. Will be removed after │ │ │ │ │ +release 2.9.")]] │ │ │ │ │ +25constexpr bool │ │ │ │ │ +_2_6_I_s_R_e_f_e_r_e_n_c_e_W_r_a_p_p_e_r___v = Dune::IsReferenceWrapper_v; │ │ │ │ │ +27 │ │ │ │ │ +28 │ │ │ │ │ +33template │ │ │ │ │ +34decltype(auto) │ │ │ │ │ +_3_5_r_e_s_o_l_v_e_R_e_f │ │ │ │ │ +36[[deprecated("Use Dune::resolveRef instead. Will be removed after release │ │ │ │ │ +2.9.")]] │ │ │ │ │ +37(T&& t) │ │ │ │ │ +38{ │ │ │ │ │ +39 return Dune::resolveRef(std::forward(t)); │ │ │ │ │ +40} │ │ │ │ │ +41 │ │ │ │ │ +46template │ │ │ │ │ +_4_7using _R_e_s_o_l_v_e_R_e_f___t │ │ │ │ │ +48[[deprecated("Use Dune::ResolveRef_t instead. Will be removed after release │ │ │ │ │ +2.9.")]] │ │ │ │ │ +49 = Dune::ResolveRef_t; │ │ │ │ │ +50 │ │ │ │ │ +51 │ │ │ │ │ +52}} // namespace Dune::Functions │ │ │ │ │ +53 │ │ │ │ │ 54 │ │ │ │ │ -55 template │ │ │ │ │ -_5_6 void _l_e_a_f(Node& node, TreePath treePath) │ │ │ │ │ -57 { │ │ │ │ │ -58 if (_i_n_d_i_c_e_s__.size() < node.treeIndex()+1) │ │ │ │ │ -59 _i_n_d_i_c_e_s__.resize(node.treeIndex()+1); │ │ │ │ │ -60 _i_n_d_i_c_e_s__[node.treeIndex()] = _c_o_u_n_t_e_r__; │ │ │ │ │ -61 ++_c_o_u_n_t_e_r__; │ │ │ │ │ -62 } │ │ │ │ │ -63 │ │ │ │ │ -_6_4 std::vector& _i_n_d_i_c_e_s__; │ │ │ │ │ -_6_5 std::size_t _c_o_u_n_t_e_r__; │ │ │ │ │ -66 }; │ │ │ │ │ -67 │ │ │ │ │ -_7_8 _D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p(const Tree& tree) │ │ │ │ │ -79 { │ │ │ │ │ -80 TypeTree::applyToTree(tree, _V_i_s_i_t_o_r(_i_n_d_i_c_e_s__)); │ │ │ │ │ -81 } │ │ │ │ │ -82 │ │ │ │ │ -83 template().treeIndex())>() and not Tree::isLeaf, int> = 0> │ │ │ │ │ -_8_5 decltype(auto) operator()(const Node& node, const TreePath& treePath, │ │ │ │ │ -Range&& y) const │ │ │ │ │ -86 { │ │ │ │ │ -87 return y[_i_n_d_i_c_e_s__[node.treeIndex()]]; │ │ │ │ │ -88 } │ │ │ │ │ -89 │ │ │ │ │ -90 template().treeIndex())>() or Tree::isLeaf, int> = 0> │ │ │ │ │ -_9_2 decltype(auto) operator()(const Node& node, const TreePath& treePath, │ │ │ │ │ -Range&& y) const │ │ │ │ │ -93 { │ │ │ │ │ -94 return std::forward(y); │ │ │ │ │ -95 } │ │ │ │ │ -96 │ │ │ │ │ -_9_7 std::vector _i_n_d_i_c_e_s__; │ │ │ │ │ -98}; │ │ │ │ │ -99 │ │ │ │ │ -100 │ │ │ │ │ -101 │ │ │ │ │ -102template │ │ │ │ │ -_1_0_3_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p_<_T_r_e_e_> _m_a_k_e_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p(const Tree& tree) │ │ │ │ │ -104{ │ │ │ │ │ -105 return _D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p_<_T_r_e_e_>(tree); │ │ │ │ │ -106} │ │ │ │ │ -107 │ │ │ │ │ -108 │ │ │ │ │ -109 │ │ │ │ │ -110template │ │ │ │ │ -_1_1_1auto _m_a_k_e_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p(const Basis& basis, TreePath&& treePath) │ │ │ │ │ -112 -> decltype(_m_a_k_e_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p(TypeTree::child(basis.localView │ │ │ │ │ -().tree(),treePath))) │ │ │ │ │ -113{ │ │ │ │ │ -114 auto&& localView = basis.localView(); │ │ │ │ │ -115 localView.bind(*basis.gridView().template begin<0>()); │ │ │ │ │ -116 auto&& tree = TypeTree::child(localView.tree(),treePath); │ │ │ │ │ -117 return _m_a_k_e_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p(tree); │ │ │ │ │ -118} │ │ │ │ │ -119 │ │ │ │ │ -120 │ │ │ │ │ -121 │ │ │ │ │ -122} // namespace Dune::Functions │ │ │ │ │ -123} // namespace Dune │ │ │ │ │ -124 │ │ │ │ │ -125 │ │ │ │ │ -126#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTNODETORANGEMAP_HH │ │ │ │ │ +55 │ │ │ │ │ +56#endif // DUNE_FUNCTIONS_COMMON_REFERENCE_HELPER_HH │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p │ │ │ │ │ -DefaultNodeToRangeMap< Tree > makeDefaultNodeToRangeMap(const Tree &tree) │ │ │ │ │ -DDeeffiinniittiioonn defaultnodetorangemap.hh:103 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p │ │ │ │ │ -A simple node to range map using lexicographic ordering. │ │ │ │ │ -DDeeffiinniittiioonn defaultnodetorangemap.hh:39 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p_:_:_i_n_d_i_c_e_s__ │ │ │ │ │ -std::vector< std::size_t > indices_ │ │ │ │ │ -DDeeffiinniittiioonn defaultnodetorangemap.hh:97 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p_:_:_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p │ │ │ │ │ -DefaultNodeToRangeMap(const Tree &tree) │ │ │ │ │ -Construct DefaultNodeToRangeMap. │ │ │ │ │ -DDeeffiinniittiioonn defaultnodetorangemap.hh:78 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p_:_:_V_i_s_i_t_o_r │ │ │ │ │ -DDeeffiinniittiioonn defaultnodetorangemap.hh:49 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p_:_:_V_i_s_i_t_o_r_:_:_V_i_s_i_t_o_r │ │ │ │ │ -Visitor(std::vector< std::size_t > &indices) │ │ │ │ │ -DDeeffiinniittiioonn defaultnodetorangemap.hh:50 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p_:_:_V_i_s_i_t_o_r_:_:_l_e_a_f │ │ │ │ │ -void leaf(Node &node, TreePath treePath) │ │ │ │ │ -DDeeffiinniittiioonn defaultnodetorangemap.hh:56 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p_:_:_V_i_s_i_t_o_r_:_:_c_o_u_n_t_e_r__ │ │ │ │ │ -std::size_t counter_ │ │ │ │ │ -DDeeffiinniittiioonn defaultnodetorangemap.hh:65 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p_:_:_V_i_s_i_t_o_r_:_:_i_n_d_i_c_e_s__ │ │ │ │ │ -std::vector< std::size_t > & indices_ │ │ │ │ │ -DDeeffiinniittiioonn defaultnodetorangemap.hh:64 │ │ │ │ │ -_c_o_n_c_e_p_t_s_._h_h │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_s_R_e_f_e_r_e_n_c_e_W_r_a_p_p_e_r___v │ │ │ │ │ +constexpr bool IsReferenceWrapper_v │ │ │ │ │ +This is an alias for Dune::IsReferenceWrapper_v. │ │ │ │ │ +DDeeffiinniittiioonn referencehelper.hh:26 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_o_l_v_e_R_e_f___t │ │ │ │ │ +Dune::ResolveRef_t< T > ResolveRef_t │ │ │ │ │ +This is an alias for Dune::ResolveRef_t. │ │ │ │ │ +DDeeffiinniittiioonn referencehelper.hh:49 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_r_e_s_o_l_v_e_R_e_f │ │ │ │ │ +decltype(auto) resolveRef(T &&t) │ │ │ │ │ +This is an alias for Dune::resolveRef. │ │ │ │ │ +DDeeffiinniittiioonn referencehelper.hh:37 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00035.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: boundarydofs.hh File Reference │ │ │ │ +dune-functions: staticforloop.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,42 +65,43 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Namespaces | │ │ │ │ Functions
│ │ │ │ -
boundarydofs.hh File Reference
│ │ │ │ +
staticforloop.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <utility>
│ │ │ │ -#include <dune/functions/functionspacebases/subentitydofs.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.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ 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<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,26 +1,25 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_m_o_n │ │ │ │ │ _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -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> │ │ │ │ │ +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_. │ │ │ │ │ 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 │ │ │ │ │ +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. │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00035_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: boundarydofs.hh Source File │ │ │ │ +dune-functions: staticforloop.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,105 +70,81 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
boundarydofs.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH
│ │ │ │
5
│ │ │ │ -
6#include <utility>
│ │ │ │ -
7
│ │ │ │ - │ │ │ │ -
9
│ │ │ │ -
10namespace Dune {
│ │ │ │ -
11namespace Functions {
│ │ │ │ +
6
│ │ │ │ +
7#include <dune/common/concept.hh>
│ │ │ │ +
8
│ │ │ │ + │ │ │ │ + │ │ │ │ +
11
│ │ │ │
12
│ │ │ │ -
13
│ │ │ │ -
14
│ │ │ │ -
34template<class Basis, class F,
│ │ │ │ -
35 decltype(std::declval<std::decay_t<F>>()(0, std::declval<typename Basis::LocalView>(),std::declval<typename Basis::GridView::Intersection>()), 0) = 0>
│ │ │ │ -
│ │ │ │ -
36void forEachBoundaryDOF(const Basis& basis, F&& f)
│ │ │ │ -
37{
│ │ │ │ -
38 auto localView = basis.localView();
│ │ │ │ -
39 auto seDOFs = subEntityDOFs(basis);
│ │ │ │ -
40 const auto& gridView = basis.gridView();
│ │ │ │ -
41 for(auto&& element : elements(gridView))
│ │ │ │ -
42 if (element.hasBoundaryIntersections())
│ │ │ │ -
43 {
│ │ │ │ -
44 localView.bind(element);
│ │ │ │ -
45 for(const auto& intersection: intersections(gridView, element))
│ │ │ │ -
46 if (intersection.boundary())
│ │ │ │ -
47 for(auto localIndex: seDOFs.bind(localView,intersection))
│ │ │ │ -
48 f(localIndex, localView, intersection);
│ │ │ │ -
49 }
│ │ │ │ -
50}
│ │ │ │ -
│ │ │ │ -
51
│ │ │ │ -
52
│ │ │ │ -
53
│ │ │ │ -
71template<class Basis, class F,
│ │ │ │ -
72 decltype(std::declval<std::decay_t<F>>()(0, std::declval<typename Basis::LocalView>()),0) = 0>
│ │ │ │ -
73void forEachBoundaryDOF(const Basis& basis, F&& f)
│ │ │ │ -
74{
│ │ │ │ -
75 auto localView = basis.localView();
│ │ │ │ -
76 auto seDOFs = subEntityDOFs(basis);
│ │ │ │ -
77 const auto& gridView = basis.gridView();
│ │ │ │ -
78 for(auto&& element : elements(gridView))
│ │ │ │ -
79 if (element.hasBoundaryIntersections())
│ │ │ │ -
80 {
│ │ │ │ -
81 localView.bind(element);
│ │ │ │ -
82 for(const auto& intersection: intersections(gridView, element))
│ │ │ │ -
83 if (intersection.boundary())
│ │ │ │ -
84 for(auto localIndex: seDOFs.bind(localView,intersection))
│ │ │ │ -
85 f(localIndex, localView);
│ │ │ │ -
86 }
│ │ │ │ -
87}
│ │ │ │ -
88
│ │ │ │ -
89
│ │ │ │ -
90
│ │ │ │ -
107template<class Basis, class F,
│ │ │ │ -
108 decltype(std::declval<std::decay_t<F>>()(std::declval<typename Basis::MultiIndex>()),0) = 0>
│ │ │ │ -
109void forEachBoundaryDOF(const Basis& basis, F&& f)
│ │ │ │ -
110{
│ │ │ │ -
111 auto localView = basis.localView();
│ │ │ │ -
112 auto seDOFs = subEntityDOFs(basis);
│ │ │ │ -
113 const auto& gridView = basis.gridView();
│ │ │ │ -
114 for(auto&& element : elements(gridView))
│ │ │ │ -
115 if (element.hasBoundaryIntersections())
│ │ │ │ -
116 {
│ │ │ │ -
117 localView.bind(element);
│ │ │ │ -
118 for(const auto& intersection: intersections(gridView, element))
│ │ │ │ -
119 if (intersection.boundary())
│ │ │ │ -
120 for(auto localIndex: seDOFs.bind(localView,intersection))
│ │ │ │ -
121 f(localView.index(localIndex));
│ │ │ │ -
122 }
│ │ │ │ -
123}
│ │ │ │ -
124
│ │ │ │ -
125
│ │ │ │ -
126
│ │ │ │ -
127} // namespace Functions
│ │ │ │ -
128} // namespace Dune
│ │ │ │ -
129
│ │ │ │ -
130#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH
│ │ │ │ - │ │ │ │ -
auto subEntityDOFs(const T &)
Create SubEntityDOFs object.
Definition subentitydofs.hh:160
│ │ │ │ -
void forEachBoundaryDOF(const Basis &basis, F &&f)
Loop over all DOFs on the boundary.
Definition boundarydofs.hh:36
│ │ │ │ +
13namespace Dune {
│ │ │ │ +
14namespace Functions {
│ │ │ │ +
15
│ │ │ │ +
16namespace Imp {
│ │ │ │ +
17
│ │ │ │ +
18template<class ST, ST begin, ST end>
│ │ │ │ +
19struct StaticFindInRange
│ │ │ │ +
20{
│ │ │ │ +
21 template<class F, class...Args>
│ │ │ │ +
22 static void apply(F&& f, Args&&... args)
│ │ │ │ +
23 {
│ │ │ │ +
24 if (f(std::integral_constant<ST, begin>(), std::forward<Args>(args)...))
│ │ │ │ +
25 return;
│ │ │ │ +
26 StaticFindInRange<ST, begin+1, end>::apply(std::forward<F>(f), std::forward<Args>(args)...);
│ │ │ │ +
27 }
│ │ │ │ +
28};
│ │ │ │ +
29
│ │ │ │ +
30template<class ST, ST end>
│ │ │ │ +
31struct StaticFindInRange<ST, end, end>
│ │ │ │ +
32{
│ │ │ │ +
33 template<class F, class...Args>
│ │ │ │ +
34 static void apply(F&& f, Args&&...)
│ │ │ │ +
35 {}
│ │ │ │ +
36};
│ │ │ │ +
37
│ │ │ │ +
38} //end namespace Imp
│ │ │ │ +
39
│ │ │ │ +
40
│ │ │ │ +
41
│ │ │ │ +
55template<std::size_t begin_t, std::size_t end_t, class F, class... Args>
│ │ │ │ +
│ │ │ │ +
56void staticFindInRange(F&& f, Args&&... args)
│ │ │ │ +
57{
│ │ │ │ +
58 Imp::StaticFindInRange<std::size_t, begin_t, end_t>::apply(std::forward<F>(f), std::forward<Args>(args)...);
│ │ │ │ +
59}
│ │ │ │ +
│ │ │ │ +
60
│ │ │ │ +
61
│ │ │ │ +
62} // namespace Dune::Functions
│ │ │ │ +
63} // namespace Dune
│ │ │ │ +
64
│ │ │ │ +
65
│ │ │ │ +
66
│ │ │ │ +
67#endif //DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH
│ │ │ │ + │ │ │ │ +
void staticFindInRange(F &&f, Args &&... args)
Static find loop.
Definition staticforloop.hh:56
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,103 +1,75 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -boundarydofs.hh │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7 │ │ │ │ │ -8#include <_d_u_n_e_/_f_u_n_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> │ │ │ │ │ -9 │ │ │ │ │ -10namespace _D_u_n_e { │ │ │ │ │ -11namespace Functions { │ │ │ │ │ +6 │ │ │ │ │ +7#include │ │ │ │ │ +8 │ │ │ │ │ +9#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 <_d_u_n_e_/_f_u_n_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> │ │ │ │ │ +11 │ │ │ │ │ 12 │ │ │ │ │ -13 │ │ │ │ │ -14 │ │ │ │ │ -34template>()(0, std::declval(),std::declval()), 0) = 0> │ │ │ │ │ -_3_6void _f_o_r_E_a_c_h_B_o_u_n_d_a_r_y_D_O_F(const Basis& basis, F&& f) │ │ │ │ │ -37{ │ │ │ │ │ -38 auto localView = basis.localView(); │ │ │ │ │ -39 auto seDOFs = _s_u_b_E_n_t_i_t_y_D_O_F_s(basis); │ │ │ │ │ -40 const auto& gridView = basis.gridView(); │ │ │ │ │ -41 for(auto&& element : elements(gridView)) │ │ │ │ │ -42 if (element.hasBoundaryIntersections()) │ │ │ │ │ -43 { │ │ │ │ │ -44 localView.bind(element); │ │ │ │ │ -45 for(const auto& intersection: intersections(gridView, element)) │ │ │ │ │ -46 if (intersection.boundary()) │ │ │ │ │ -47 for(auto localIndex: seDOFs.bind(localView,intersection)) │ │ │ │ │ -48 f(localIndex, localView, intersection); │ │ │ │ │ -49 } │ │ │ │ │ -50} │ │ │ │ │ -51 │ │ │ │ │ -52 │ │ │ │ │ -53 │ │ │ │ │ -71template>()(0, std::declval()),0) = 0> │ │ │ │ │ -73void _f_o_r_E_a_c_h_B_o_u_n_d_a_r_y_D_O_F(const Basis& basis, F&& f) │ │ │ │ │ -74{ │ │ │ │ │ -75 auto localView = basis.localView(); │ │ │ │ │ -76 auto seDOFs = _s_u_b_E_n_t_i_t_y_D_O_F_s(basis); │ │ │ │ │ -77 const auto& gridView = basis.gridView(); │ │ │ │ │ -78 for(auto&& element : elements(gridView)) │ │ │ │ │ -79 if (element.hasBoundaryIntersections()) │ │ │ │ │ -80 { │ │ │ │ │ -81 localView.bind(element); │ │ │ │ │ -82 for(const auto& intersection: intersections(gridView, element)) │ │ │ │ │ -83 if (intersection.boundary()) │ │ │ │ │ -84 for(auto localIndex: seDOFs.bind(localView,intersection)) │ │ │ │ │ -85 f(localIndex, localView); │ │ │ │ │ -86 } │ │ │ │ │ -87} │ │ │ │ │ -88 │ │ │ │ │ -89 │ │ │ │ │ -90 │ │ │ │ │ -107template>()(std::declval()),0) = 0> │ │ │ │ │ -109void _f_o_r_E_a_c_h_B_o_u_n_d_a_r_y_D_O_F(const Basis& basis, F&& f) │ │ │ │ │ -110{ │ │ │ │ │ -111 auto localView = basis.localView(); │ │ │ │ │ -112 auto seDOFs = _s_u_b_E_n_t_i_t_y_D_O_F_s(basis); │ │ │ │ │ -113 const auto& gridView = basis.gridView(); │ │ │ │ │ -114 for(auto&& element : elements(gridView)) │ │ │ │ │ -115 if (element.hasBoundaryIntersections()) │ │ │ │ │ -116 { │ │ │ │ │ -117 localView.bind(element); │ │ │ │ │ -118 for(const auto& intersection: intersections(gridView, element)) │ │ │ │ │ -119 if (intersection.boundary()) │ │ │ │ │ -120 for(auto localIndex: seDOFs.bind(localView,intersection)) │ │ │ │ │ -121 f(localView.index(localIndex)); │ │ │ │ │ -122 } │ │ │ │ │ -123} │ │ │ │ │ -124 │ │ │ │ │ -125 │ │ │ │ │ -126 │ │ │ │ │ -127} // namespace Functions │ │ │ │ │ -128} // namespace Dune │ │ │ │ │ -129 │ │ │ │ │ -130#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:160 │ │ │ │ │ -_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:36 │ │ │ │ │ +13namespace _D_u_n_e { │ │ │ │ │ +14namespace Functions { │ │ │ │ │ +15 │ │ │ │ │ +16namespace Imp { │ │ │ │ │ +17 │ │ │ │ │ +18template │ │ │ │ │ +19struct StaticFindInRange │ │ │ │ │ +20{ │ │ │ │ │ +21 template │ │ │ │ │ +22 static void apply(F&& f, Args&&... args) │ │ │ │ │ +23 { │ │ │ │ │ +24 if (f(std::integral_constant(), std::forward(args)...)) │ │ │ │ │ +25 return; │ │ │ │ │ +26 StaticFindInRange::apply(std::forward(f), std:: │ │ │ │ │ +forward(args)...); │ │ │ │ │ +27 } │ │ │ │ │ +28}; │ │ │ │ │ +29 │ │ │ │ │ +30template │ │ │ │ │ +31struct StaticFindInRange │ │ │ │ │ +32{ │ │ │ │ │ +33 template │ │ │ │ │ +34 static void apply(F&& f, Args&&...) │ │ │ │ │ +35 {} │ │ │ │ │ +36}; │ │ │ │ │ +37 │ │ │ │ │ +38} //end namespace Imp │ │ │ │ │ +39 │ │ │ │ │ +40 │ │ │ │ │ +41 │ │ │ │ │ +55template │ │ │ │ │ +_5_6void _s_t_a_t_i_c_F_i_n_d_I_n_R_a_n_g_e(F&& f, Args&&... args) │ │ │ │ │ +57{ │ │ │ │ │ +58 Imp::StaticFindInRange::apply(std::forward │ │ │ │ │ +(f), std::forward(args)...); │ │ │ │ │ +59} │ │ │ │ │ +60 │ │ │ │ │ +61 │ │ │ │ │ +62} // namespace Dune::Functions │ │ │ │ │ +63} // namespace Dune │ │ │ │ │ +64 │ │ │ │ │ +65 │ │ │ │ │ +66 │ │ │ │ │ +67#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:56 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ +_c_o_n_c_e_p_t_s_._h_h │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00038.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: globalvaluedlocalfiniteelement.hh File Reference │ │ │ │ +dune-functions: utility.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,42 +65,97 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Namespaces
│ │ │ │ -
globalvaluedlocalfiniteelement.hh File Reference
│ │ │ │ +Classes | │ │ │ │ +Namespaces | │ │ │ │ +Typedefs | │ │ │ │ +Functions
│ │ │ │ +
utility.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/localfunctions/common/localinterpolation.hh>
│ │ │ │ +
#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

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,27 +1,92 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_a_m_e_s_p_a_c_e_s │ │ │ │ │ -globalvaluedlocalfiniteelement.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +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 │ │ │ │ │ +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< T, │ │ │ │ │ + ArgTuple >::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< F, │ │ │ │ │ + Tuples... >::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< IntegerSequence >::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. │ │ │ │ │ +  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00038_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: globalvaluedlocalfiniteelement.hh Source File │ │ │ │ +dune-functions: utility.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,328 +70,308 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
globalvaluedlocalfiniteelement.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_COMMON_UTILITY_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_COMMON_UTILITY_HH
│ │ │ │
5
│ │ │ │ -
6#include <array>
│ │ │ │ -
7#include <numeric>
│ │ │ │ -
8
│ │ │ │ -
9#include <dune/common/fmatrix.hh>
│ │ │ │ -
10#include <dune/common/fvector.hh>
│ │ │ │ -
11#include <dune/common/math.hh>
│ │ │ │ -
12#include <dune/common/rangeutilities.hh>
│ │ │ │ -
13
│ │ │ │ -
14#include <dune/geometry/referenceelements.hh>
│ │ │ │ -
15
│ │ │ │ -
16#include <dune/localfunctions/common/localbasis.hh>
│ │ │ │ -
17#include <dune/localfunctions/common/localfiniteelementtraits.hh>
│ │ │ │ -
18#include <dune/localfunctions/common/localinterpolation.hh>
│ │ │ │ +
6
│ │ │ │ +
7#include <utility>
│ │ │ │ +
8#include <type_traits>
│ │ │ │ +
9
│ │ │ │ +
10#include <dune/common/overloadset.hh>
│ │ │ │ +
11#include <dune/common/indices.hh>
│ │ │ │ +
12
│ │ │ │ + │ │ │ │ +
14
│ │ │ │ +
15namespace Dune {
│ │ │ │ +
16namespace Functions {
│ │ │ │ +
17
│ │ │ │ +
18
│ │ │ │
19
│ │ │ │ -
20namespace Dune::Functions::Impl
│ │ │ │ -
21{
│ │ │ │ -
22
│ │ │ │ -
36 struct ContravariantPiolaTransformator
│ │ │ │ -
37 {
│ │ │ │ -
42 template<typename Values, typename LocalCoordinate, typename Geometry>
│ │ │ │ -
43 static auto apply(Values& values,
│ │ │ │ -
44 const LocalCoordinate& xi,
│ │ │ │ -
45 const Geometry& geometry)
│ │ │ │ -
46 {
│ │ │ │ -
47 auto jacobianTransposed = geometry.jacobianTransposed(xi);
│ │ │ │ -
48 auto integrationElement = geometry.integrationElement(xi);
│ │ │ │ -
49
│ │ │ │ -
50 for (auto& value : values)
│ │ │ │ -
51 {
│ │ │ │ -
52 auto tmp = value;
│ │ │ │ -
53 jacobianTransposed.mtv(tmp, value);
│ │ │ │ -
54 value /= integrationElement;
│ │ │ │ -
55 }
│ │ │ │ -
56 }
│ │ │ │ -
57
│ │ │ │ -
67 template<typename Gradients, typename LocalCoordinate, typename Geometry>
│ │ │ │ -
68 static auto applyJacobian(Gradients& gradients,
│ │ │ │ -
69 const LocalCoordinate& xi,
│ │ │ │ -
70 const Geometry& geometry)
│ │ │ │ -
71 {
│ │ │ │ -
72 auto jacobianTransposed = geometry.jacobianTransposed(xi);
│ │ │ │ -
73 auto integrationElement = geometry.integrationElement(xi);
│ │ │ │ -
74 for (auto& gradient : gradients)
│ │ │ │ -
75 {
│ │ │ │ -
76 auto tmp = gradient;
│ │ │ │ -
77 gradient = 0;
│ │ │ │ -
78 for (size_t k=0; k<gradient.M(); k++)
│ │ │ │ -
79 for (size_t l=0; l<tmp.N(); l++)
│ │ │ │ -
80 // Use sparseRange because jacobianTransposed may be a sparse DiagonalMatrix
│ │ │ │ -
81 for(auto&& [jacobianTransposed_l_j, j] : sparseRange(jacobianTransposed[l]))
│ │ │ │ -
82 gradient[j][k] += jacobianTransposed_l_j * tmp[l][k];
│ │ │ │ -
83 gradient /= integrationElement;
│ │ │ │ -
84 }
│ │ │ │ -
85 }
│ │ │ │ -
86
│ │ │ │ -
94 template<class Function, class LocalCoordinate, class Element>
│ │ │ │ -
95 class LocalValuedFunction
│ │ │ │ -
96 {
│ │ │ │ -
97 const Function& f_;
│ │ │ │ -
98 const Element& element_;
│ │ │ │ +
20template<class F, class size_type, size_type firstValue, class... Args>
│ │ │ │ +
│ │ │ │ +
21auto forwardAsStaticInteger(std::integer_sequence<size_type, firstValue> values, const size_type& i, F&& f, Args&&... args)
│ │ │ │ +
22 ->decltype(f(std::integral_constant<size_type, firstValue>(), std::forward<Args>(args)...))
│ │ │ │ +
23{
│ │ │ │ +
24 return f(std::integral_constant<size_type, firstValue>(), std::forward<Args>(args)...);
│ │ │ │ +
25}
│ │ │ │ +
│ │ │ │ +
26
│ │ │ │ +
27template<class F, class size_type, size_type firstValue, size_type secondValue, size_type... otherValues, class... Args>
│ │ │ │ +
│ │ │ │ +
28auto forwardAsStaticInteger(std::integer_sequence<size_type, firstValue, secondValue, otherValues...> values, const size_type i, F&& f, Args&&... args)
│ │ │ │ +
29 ->decltype(f(std::integral_constant<size_type, firstValue>(), std::forward<Args>(args)...))
│ │ │ │ +
30{
│ │ │ │ +
31 if (i==firstValue)
│ │ │ │ +
32 return f(std::integral_constant<size_type, firstValue>(), std::forward<Args>(args)...);
│ │ │ │ +
33 return forwardAsStaticInteger(std::integer_sequence<size_type, secondValue, otherValues...>(), i, std::forward<F>(f), std::forward<Args>(args)...);
│ │ │ │ +
34}
│ │ │ │ +
│ │ │ │ +
35
│ │ │ │ +
36
│ │ │ │ +
37
│ │ │ │ +
59template<std::size_t end, class F, class size_type, class... Args>
│ │ │ │ +
│ │ │ │ +
60auto forwardAsStaticIndex(const size_type& i, F&& f, Args&&... args)
│ │ │ │ +
61 ->decltype(f(Dune::Indices::_0, std::forward<Args>(args)...))
│ │ │ │ +
62{
│ │ │ │ +
63 return forwardAsStaticInteger(std::make_index_sequence<end>{}, i, std::forward<F>(f), std::forward<Args>(args)...);
│ │ │ │ +
64}
│ │ │ │ +
│ │ │ │ +
65
│ │ │ │ +
66
│ │ │ │ +
67
│ │ │ │ +
68namespace Imp {
│ │ │ │ +
69
│ │ │ │ +
70 template<template<class...> class T, class List>
│ │ │ │ +
71 struct ExpandTupleHelper
│ │ │ │ +
72 {};
│ │ │ │ +
73
│ │ │ │ +
74 template<template<class...> class T, template<class...> class ListType, class... Args>
│ │ │ │ +
75 struct ExpandTupleHelper<T, ListType<Args...>>
│ │ │ │ +
76 {
│ │ │ │ +
77 using Type = T<Args...>;
│ │ │ │ +
78 };
│ │ │ │ +
79
│ │ │ │ +
80} // end namespace Imp
│ │ │ │ +
81
│ │ │ │ +
93template<template<class...> class T, class ArgTuple>
│ │ │ │ +
94using ExpandTuple = typename Imp::ExpandTupleHelper<T, ArgTuple>::Type;
│ │ │ │ +
95
│ │ │ │ +
96
│ │ │ │ +
97
│ │ │ │ +
98namespace Imp {
│ │ │ │
99
│ │ │ │ -
100 public:
│ │ │ │ -
101
│ │ │ │ -
102 LocalValuedFunction(const Function& f, const Element& element)
│ │ │ │ -
103 : f_(f), element_(element)
│ │ │ │ -
104 {}
│ │ │ │ -
105
│ │ │ │ -
106 auto operator()(const LocalCoordinate& xi) const
│ │ │ │ -
107 {
│ │ │ │ -
108 auto&& f = Dune::Impl::makeFunctionWithCallOperator<LocalCoordinate>(f_);
│ │ │ │ -
109 auto globalValue = f(xi);
│ │ │ │ -
110
│ │ │ │ -
111 // Apply the inverse Piola transform
│ │ │ │ -
112 auto jacobianInverseTransposed = element_.geometry().jacobianInverseTransposed(xi);
│ │ │ │ -
113 auto integrationElement = element_.geometry().integrationElement(xi);
│ │ │ │ -
114
│ │ │ │ -
115 auto localValue = globalValue;
│ │ │ │ -
116 jacobianInverseTransposed.mtv(globalValue, localValue);
│ │ │ │ -
117 localValue *= integrationElement;
│ │ │ │ -
118
│ │ │ │ -
119 return localValue;
│ │ │ │ -
120 }
│ │ │ │ -
121 };
│ │ │ │ -
122 };
│ │ │ │ -
123
│ │ │ │ -
137 struct CovariantPiolaTransformator
│ │ │ │ -
138 {
│ │ │ │ -
143 template<typename Values, typename LocalCoordinate, typename Geometry>
│ │ │ │ -
144 static auto apply(Values& values,
│ │ │ │ -
145 const LocalCoordinate& xi,
│ │ │ │ -
146 const Geometry& geometry)
│ │ │ │ -
147 {
│ │ │ │ -
148 auto jacobianInverseTransposed = geometry.jacobianInverseTransposed(xi);
│ │ │ │ -
149
│ │ │ │ -
150 for (auto& value : values)
│ │ │ │ -
151 {
│ │ │ │ -
152 auto tmp = value;
│ │ │ │ -
153 jacobianInverseTransposed.mv(tmp, value);
│ │ │ │ -
154 }
│ │ │ │ -
155 }
│ │ │ │ -
156
│ │ │ │ -
166 template<typename Gradients, typename LocalCoordinate, typename Geometry>
│ │ │ │ -
167 static auto applyJacobian(Gradients& gradients,
│ │ │ │ -
168 const LocalCoordinate& xi,
│ │ │ │ -
169 const Geometry& geometry)
│ │ │ │ -
170 {
│ │ │ │ -
171 auto jacobianInverseTransposed = geometry.jacobianInverseTransposed(xi);
│ │ │ │ -
172
│ │ │ │ -
173 for (auto& gradient : gradients)
│ │ │ │ -
174 {
│ │ │ │ -
175 auto tmp = gradient;
│ │ │ │ -
176 gradient = 0;
│ │ │ │ -
177 for (size_t j=0; j<gradient.N(); j++)
│ │ │ │ -
178 for (size_t k=0; k<gradient.M(); k++)
│ │ │ │ -
179 // Use sparseRange because jacobianTransposed may be a sparse DiagonalMatrix
│ │ │ │ -
180 for(auto&& [jacobianInverseTransposed_j_l, l] : sparseRange(jacobianInverseTransposed[j]))
│ │ │ │ -
181 gradient[j][k] += jacobianInverseTransposed_j_l * tmp[l][k];
│ │ │ │ -
182 }
│ │ │ │ -
183 }
│ │ │ │ -
184
│ │ │ │ -
192 template<class Function, class LocalCoordinate, class Element>
│ │ │ │ -
193 class LocalValuedFunction
│ │ │ │ -
194 {
│ │ │ │ -
195 const Function& f_;
│ │ │ │ -
196 const Element& element_;
│ │ │ │ -
197
│ │ │ │ -
198 public:
│ │ │ │ -
199
│ │ │ │ -
200 LocalValuedFunction(const Function& f, const Element& element)
│ │ │ │ -
201 : f_(f), element_(element)
│ │ │ │ -
202 {}
│ │ │ │ -
203
│ │ │ │ -
204 auto operator()(const LocalCoordinate& xi) const
│ │ │ │ -
205 {
│ │ │ │ -
206 auto&& f = Dune::Impl::makeFunctionWithCallOperator<LocalCoordinate>(f_);
│ │ │ │ -
207 auto globalValue = f(xi);
│ │ │ │ -
208
│ │ │ │ -
209 // Apply the inverse Piola transform
│ │ │ │ -
210 auto jacobianTransposed = element_.geometry().jacobianTransposed(xi);
│ │ │ │ -
211
│ │ │ │ -
212 auto localValue = globalValue;
│ │ │ │ -
213 jacobianTransposed.mv(globalValue, localValue);
│ │ │ │ +
100 template<template<class...> class T, class... Tuple>
│ │ │ │ +
101 struct TransformTupleHelper
│ │ │ │ +
102 {};
│ │ │ │ +
103
│ │ │ │ +
104 template<template<class...> class T, class... Args1>
│ │ │ │ +
105 struct TransformTupleHelper<T, typename std::tuple<Args1...>>
│ │ │ │ +
106 {
│ │ │ │ +
107 using Type = std::tuple<T<Args1>...>;
│ │ │ │ +
108 };
│ │ │ │ +
109
│ │ │ │ +
110 template<template<class...> class T, class... Args1, class... Args2>
│ │ │ │ +
111 struct TransformTupleHelper<T, typename std::tuple<Args1...>, typename std::tuple<Args2...>>
│ │ │ │ +
112 {
│ │ │ │ +
113 using Type = std::tuple<T<Args1, Args2>...>;
│ │ │ │ +
114 };
│ │ │ │ +
115
│ │ │ │ +
116} // end namespace Imp
│ │ │ │ +
117
│ │ │ │ +
130template<template<class...> class F, class... Tuples>
│ │ │ │ +
131using TransformTuple = typename Imp::TransformTupleHelper<F, Tuples...>::Type;
│ │ │ │ +
132
│ │ │ │ +
133
│ │ │ │ +
134
│ │ │ │ +
135namespace Imp {
│ │ │ │ +
136
│ │ │ │ +
137 template<class F, class... T, std::size_t... k>
│ │ │ │ +
138 auto transformTupleHelper(F&& f, const std::tuple<T...>& tuple, std::index_sequence<k...>)
│ │ │ │ +
139 -> decltype(std::make_tuple(f(std::get<k>(tuple))...))
│ │ │ │ +
140 {
│ │ │ │ +
141 return std::make_tuple(f(std::get<k>(tuple))...);
│ │ │ │ +
142 }
│ │ │ │ +
143
│ │ │ │ +
144 template<class F, class... T1, class...T2, std::size_t... k>
│ │ │ │ +
145 auto transformTupleHelper(F&& f, const std::tuple<T1...>& tuple1, const std::tuple<T2...>& tuple2, std::index_sequence<k...>)
│ │ │ │ +
146 -> decltype(std::make_tuple(f(std::get<k>(tuple1), std::get<k>(tuple2))...))
│ │ │ │ +
147 {
│ │ │ │ +
148 return std::make_tuple(f(std::get<k>(tuple1), std::get<k>(tuple2))...);
│ │ │ │ +
149 }
│ │ │ │ +
150
│ │ │ │ +
151} // end namespace Imp
│ │ │ │ +
152
│ │ │ │ +
164template<class F, class... T>
│ │ │ │ +
│ │ │ │ +
165auto transformTuple(F&& f, const std::tuple<T...>& tuple)
│ │ │ │ +
166 -> decltype(Imp::transformTupleHelper(std::forward<F>(f), tuple, std::index_sequence_for<T...>{}))
│ │ │ │ +
167{
│ │ │ │ +
168 return Imp::transformTupleHelper(std::forward<F>(f), tuple, std::index_sequence_for<T...>{});
│ │ │ │ +
169}
│ │ │ │ +
│ │ │ │ +
170
│ │ │ │ +
184template<class F, class... T1, class... T2>
│ │ │ │ +
│ │ │ │ +
185auto transformTuple(F&& f, const std::tuple<T1...>& tuple1, const std::tuple<T2...>& tuple2)
│ │ │ │ +
186 -> decltype(Imp::transformTupleHelper(std::forward<F>(f), tuple1, tuple2, std::index_sequence_for<T1...>{}))
│ │ │ │ +
187{
│ │ │ │ +
188 return Imp::transformTupleHelper(std::forward<F>(f), tuple1, tuple2, std::index_sequence_for<T1...>{});
│ │ │ │ +
189}
│ │ │ │ +
│ │ │ │ +
190
│ │ │ │ +
191
│ │ │ │ +
192
│ │ │ │ +
193namespace Imp {
│ │ │ │ +
194
│ │ │ │ +
195 template<class IntegerSequence>
│ │ │ │ +
196 struct IntegerSequenceTupleHelper
│ │ │ │ +
197 {};
│ │ │ │ +
198
│ │ │ │ +
199 template<class I, I... k>
│ │ │ │ +
200 struct IntegerSequenceTupleHelper<std::integer_sequence<I, k...>>
│ │ │ │ +
201 {
│ │ │ │ +
202 using Type = std::tuple<std::integral_constant<I, k>...>;
│ │ │ │ +
203 };
│ │ │ │ +
204
│ │ │ │ +
205} // end namespace Imp
│ │ │ │ +
206
│ │ │ │ +
210template<class IntegerSequence>
│ │ │ │ +
211using IntegerSequenceTuple= typename Imp::IntegerSequenceTupleHelper<IntegerSequence>::Type;
│ │ │ │ +
212
│ │ │ │ +
213
│ │ │ │
214
│ │ │ │ -
215 return localValue;
│ │ │ │ -
216 }
│ │ │ │ -
217 };
│ │ │ │ -
218 };
│ │ │ │ -
219
│ │ │ │ -
226 template<class Transformator, class LocalValuedLocalBasis, class Element>
│ │ │ │ -
227 class GlobalValuedLocalBasis
│ │ │ │ -
228 {
│ │ │ │ -
229 public:
│ │ │ │ -
230 using Traits = typename LocalValuedLocalBasis::Traits;
│ │ │ │ -
231
│ │ │ │ -
234 void bind(const LocalValuedLocalBasis& localValuedLocalBasis, const Element& element)
│ │ │ │ -
235 {
│ │ │ │ -
236 localValuedLocalBasis_ = &localValuedLocalBasis;
│ │ │ │ -
237 element_ = &element;
│ │ │ │ -
238 }
│ │ │ │ -
239
│ │ │ │ -
242 auto size() const
│ │ │ │ -
243 {
│ │ │ │ -
244 return localValuedLocalBasis_->size();
│ │ │ │ -
245 }
│ │ │ │ -
246
│ │ │ │ -
248 void evaluateFunction(const typename Traits::DomainType& x,
│ │ │ │ -
249 std::vector<typename Traits::RangeType>& out) const
│ │ │ │ -
250 {
│ │ │ │ -
251 localValuedLocalBasis_->evaluateFunction(x,out);
│ │ │ │ -
252
│ │ │ │ -
253 Transformator::apply(out, x, element_->geometry());
│ │ │ │ -
254 }
│ │ │ │ +
220template<class... T>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
222{
│ │ │ │ +
223 using type = typename std::tuple_element<sizeof...(T)-1, std::tuple<T...>>::type;
│ │ │ │ +
224};
│ │ │ │ +
│ │ │ │ +
225
│ │ │ │ +
226
│ │ │ │ +
227
│ │ │ │ +
228namespace Imp {
│ │ │ │ +
229
│ │ │ │ +
230template<class T, class I>
│ │ │ │ +
231struct RotateHelper;
│ │ │ │ +
232
│ │ │ │ +
233template<class... T, std::size_t... I>
│ │ │ │ +
234struct RotateHelper<std::tuple<T...>, std::index_sequence<I...> >
│ │ │ │ +
235{
│ │ │ │ +
236 using type = typename std::tuple<typename LastType<T...>::type, typename std::tuple_element<I,std::tuple<T...>>::type...>;
│ │ │ │ +
237};
│ │ │ │ +
238
│ │ │ │ +
239} // end namespace Imp
│ │ │ │ +
240
│ │ │ │ +
241
│ │ │ │ +
249template<class... T>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
251{
│ │ │ │ +
252 using type = typename Imp::RotateHelper<std::tuple<T...>, std::make_index_sequence<sizeof...(T)-1>>::type;
│ │ │ │ +
253};
│ │ │ │ +
│ │ │ │ +
254
│ │ │ │
255
│ │ │ │ -
261 void evaluateJacobian(const typename Traits::DomainType& x,
│ │ │ │ -
262 std::vector<typename Traits::JacobianType>& out) const
│ │ │ │ -
263 {
│ │ │ │ -
264 localValuedLocalBasis_->evaluateJacobian(x,out);
│ │ │ │ -
265
│ │ │ │ -
266 Transformator::applyJacobian(out, x, element_->geometry());
│ │ │ │ -
267 }
│ │ │ │ -
268
│ │ │ │ -
275 void partial(const std::array<unsigned int,2>& order,
│ │ │ │ -
276 const typename Traits::DomainType& x,
│ │ │ │ -
277 std::vector<typename Traits::RangeType>& out) const
│ │ │ │ -
278 {
│ │ │ │ -
279 auto totalOrder = std::accumulate(order.begin(), order.end(), 0);
│ │ │ │ -
280 if (totalOrder == 0) {
│ │ │ │ -
281 evaluateFunction(x, out);
│ │ │ │ -
282 } else if (totalOrder == 1) {
│ │ │ │ -
283 auto const direction = std::distance(order.begin(), std::find(order.begin(), order.end(), 1));
│ │ │ │ -
284 out.resize(size());
│ │ │ │ +
256
│ │ │ │ +
278template<class Expression>
│ │ │ │ +
│ │ │ │ +
279auto callableCheck(Expression f)
│ │ │ │ +
280{
│ │ │ │ +
281 return [f](auto&&... args){
│ │ │ │ +
282 return Functions::Concept::isCallable(f, std::forward<decltype(args)>(args)...);
│ │ │ │ +
283 };
│ │ │ │ +
284}
│ │ │ │ +
│ │ │ │
285
│ │ │ │ -
286 // TODO: The following is wasteful: We compute the full Jacobian and then return
│ │ │ │ -
287 // only a part of it. While we need the full Jacobian of the underlying local-valued LFE,
│ │ │ │ -
288 // it should be possible to compute only a partial Piola transform for the requested
│ │ │ │ -
289 // partial derivatives.
│ │ │ │ -
290 std::vector<typename Traits::JacobianType> fullJacobian;
│ │ │ │ -
291 localValuedLocalBasis_->evaluateJacobian(x,fullJacobian);
│ │ │ │ -
292
│ │ │ │ -
293 Transformator::applyJacobian(fullJacobian, x, element_->geometry());
│ │ │ │ -
294
│ │ │ │ -
295 for (std::size_t i=0; i<out.size(); i++)
│ │ │ │ -
296 for (std::size_t j=0; j<out[i].size(); j++)
│ │ │ │ -
297 out[i][j] = fullJacobian[i][j][direction];
│ │ │ │ -
298
│ │ │ │ -
299 } else
│ │ │ │ -
300 DUNE_THROW(NotImplemented, "Partial derivatives of order 2 or higher");
│ │ │ │ -
301 }
│ │ │ │ -
302
│ │ │ │ -
304 auto order() const
│ │ │ │ -
305 {
│ │ │ │ -
306 return localValuedLocalBasis_->order();
│ │ │ │ -
307 }
│ │ │ │ -
308
│ │ │ │ -
309 const LocalValuedLocalBasis* localValuedLocalBasis_;
│ │ │ │ -
310 const Element* element_;
│ │ │ │ -
311 };
│ │ │ │ -
312
│ │ │ │ -
321 template<class Transformator, class LocalValuedLocalInterpolation, class Element>
│ │ │ │ -
322 class GlobalValuedLocalInterpolation
│ │ │ │ -
323 {
│ │ │ │ -
324 public:
│ │ │ │ -
327 void bind(const LocalValuedLocalInterpolation& localValuedLocalInterpolation, const Element& element)
│ │ │ │ -
328 {
│ │ │ │ -
329 localValuedLocalInterpolation_ = &localValuedLocalInterpolation;
│ │ │ │ -
330 element_ = &element;
│ │ │ │ -
331 }
│ │ │ │ -
332
│ │ │ │ -
333 template<typename F, typename C>
│ │ │ │ -
334 void interpolate (const F& f, std::vector<C>& out) const
│ │ │ │ -
335 {
│ │ │ │ -
336 using LocalCoordinate = typename Element::Geometry::LocalCoordinate;
│ │ │ │ -
337 typename Transformator::template LocalValuedFunction<F,LocalCoordinate,Element> localValuedFunction(f, *element_);
│ │ │ │ -
338 localValuedLocalInterpolation_->interpolate(localValuedFunction, out);
│ │ │ │ -
339 }
│ │ │ │ +
286
│ │ │ │ +
287
│ │ │ │ +
303template<class Check>
│ │ │ │ +
│ │ │ │ +
304auto negatePredicate(Check check)
│ │ │ │ +
305{
│ │ │ │ +
306 return [check](auto&&... args){
│ │ │ │ +
307 auto negate = overload(
│ │ │ │ +
308 [](std::true_type) { return std::false_type{};},
│ │ │ │ +
309 [](std::false_type) { return std::true_type{};},
│ │ │ │ +
310 [](bool v) { return not v;});
│ │ │ │ +
311 return negate(check(std::forward<decltype(args)>(args)...));
│ │ │ │ +
312 };
│ │ │ │ +
313}
│ │ │ │ +
│ │ │ │ +
314
│ │ │ │ +
315
│ │ │ │ +
316namespace Impl {
│ │ │ │ +
317
│ │ │ │ +
318 // Wrapper to capture values in a lambda for perfect forwarding.
│ │ │ │ +
319 // This captures value types by value and reference types by reference.
│ │ │ │ +
320 template <typename T>
│ │ │ │ +
321 struct ForwardCaptureWrapper;
│ │ │ │ +
322
│ │ │ │ +
323 template <typename T>
│ │ │ │ +
324 struct ForwardCaptureWrapper
│ │ │ │ +
325 {
│ │ │ │ +
326 template <typename TT>
│ │ │ │ +
327 ForwardCaptureWrapper(TT&& t) : t_{std::forward<TT>(t)} {}
│ │ │ │ +
328
│ │ │ │ +
329 auto forward() const { return std::move(t_); }
│ │ │ │ +
330
│ │ │ │ +
331 T t_;
│ │ │ │ +
332 };
│ │ │ │ +
333
│ │ │ │ +
334 template <typename T>
│ │ │ │ +
335 struct ForwardCaptureWrapper<T&>
│ │ │ │ +
336 {
│ │ │ │ +
337 ForwardCaptureWrapper(T& t) : t_{t} {}
│ │ │ │ +
338
│ │ │ │ +
339 T& forward() const { return t_; };
│ │ │ │
340
│ │ │ │ -
341 private:
│ │ │ │ -
342 const LocalValuedLocalInterpolation* localValuedLocalInterpolation_;
│ │ │ │ -
343 const Element* element_;
│ │ │ │ -
344 };
│ │ │ │ -
345
│ │ │ │ -
346
│ │ │ │ -
353 template<class Transformator, class LocalValuedLFE, class Element>
│ │ │ │ -
354 class GlobalValuedLocalFiniteElement
│ │ │ │ -
355 {
│ │ │ │ -
356 using LocalBasis = GlobalValuedLocalBasis<Transformator,
│ │ │ │ -
357 typename LocalValuedLFE::Traits::LocalBasisType,
│ │ │ │ -
358 Element>;
│ │ │ │ -
359 using LocalInterpolation = GlobalValuedLocalInterpolation<Transformator,
│ │ │ │ -
360 typename LocalValuedLFE::Traits::LocalInterpolationType,
│ │ │ │ -
361 Element>;
│ │ │ │ -
362
│ │ │ │ -
363 public:
│ │ │ │ -
366 using Traits = LocalFiniteElementTraits<LocalBasis,
│ │ │ │ -
367 typename LocalValuedLFE::Traits::LocalCoefficientsType,
│ │ │ │ -
368 LocalInterpolation>;
│ │ │ │ -
369
│ │ │ │ -
370 GlobalValuedLocalFiniteElement() {}
│ │ │ │ -
371
│ │ │ │ -
372 void bind(const LocalValuedLFE& localValuedLFE, const Element& element)
│ │ │ │ -
373 {
│ │ │ │ -
374 globalValuedLocalBasis_.bind(localValuedLFE.localBasis(), element);
│ │ │ │ -
375 globalValuedLocalInterpolation_.bind(localValuedLFE.localInterpolation(), element);
│ │ │ │ -
376 localValuedLFE_ = &localValuedLFE;
│ │ │ │ -
377 }
│ │ │ │ +
341 T& t_;
│ │ │ │ +
342 };
│ │ │ │ +
343
│ │ │ │ +
344 template <typename T>
│ │ │ │ +
345 struct ForwardCaptureWrapper<const T&>
│ │ │ │ +
346 {
│ │ │ │ +
347 ForwardCaptureWrapper(const T& t) : t_{t} {}
│ │ │ │ +
348
│ │ │ │ +
349 const T& forward() const { return t_; };
│ │ │ │ +
350
│ │ │ │ +
351 const T& t_;
│ │ │ │ +
352 };
│ │ │ │ +
353
│ │ │ │ +
354} // end namespace Dune::Functions::Impl
│ │ │ │ +
355
│ │ │ │ +
356
│ │ │ │ +
357
│ │ │ │ +
371template <class T>
│ │ │ │ +
│ │ │ │ +
372auto forwardCapture(T&& t)
│ │ │ │ +
373{
│ │ │ │ +
374 return Impl::ForwardCaptureWrapper<T>(std::forward<T>(t));
│ │ │ │ +
375}
│ │ │ │ +
│ │ │ │ +
376
│ │ │ │ +
377
│ │ │ │
378
│ │ │ │ -
381 const typename Traits::LocalBasisType& localBasis() const
│ │ │ │ -
382 {
│ │ │ │ -
383 return globalValuedLocalBasis_;
│ │ │ │ -
384 }
│ │ │ │ -
385
│ │ │ │ -
388 const typename Traits::LocalCoefficientsType& localCoefficients() const
│ │ │ │ -
389 {
│ │ │ │ -
390 return localValuedLFE_->localCoefficients();
│ │ │ │ -
391 }
│ │ │ │ -
392
│ │ │ │ -
395 const typename Traits::LocalInterpolationType& localInterpolation() const
│ │ │ │ -
396 {
│ │ │ │ -
397 return globalValuedLocalInterpolation_;
│ │ │ │ -
398 }
│ │ │ │ -
399
│ │ │ │ -
401 std::size_t size() const
│ │ │ │ -
402 {
│ │ │ │ -
403 return localValuedLFE_->size();
│ │ │ │ -
404 }
│ │ │ │ -
405
│ │ │ │ -
408 GeometryType type() const
│ │ │ │ -
409 {
│ │ │ │ -
410 return localValuedLFE_->type();
│ │ │ │ -
411 }
│ │ │ │ -
412
│ │ │ │ -
413 private:
│ │ │ │ -
414
│ │ │ │ -
415 typename Traits::LocalBasisType globalValuedLocalBasis_;
│ │ │ │ -
416 typename Traits::LocalInterpolationType globalValuedLocalInterpolation_;
│ │ │ │ -
417 const LocalValuedLFE* localValuedLFE_;
│ │ │ │ -
418 };
│ │ │ │ -
419
│ │ │ │ -
420} // namespace Dune::Functions::Impl
│ │ │ │ -
421
│ │ │ │ -
422#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH
│ │ │ │ -
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:202
│ │ │ │ +
379} // namespace Dune::Functions
│ │ │ │ +
380} // namespace Dune
│ │ │ │ +
381
│ │ │ │ +
382
│ │ │ │ +
383#endif // DUNE_FUNCTIONS_COMMON_UTILITY_HH
│ │ │ │ + │ │ │ │ +
typename Imp::ExpandTupleHelper< T, ArgTuple >::Type ExpandTuple
Expand tuple arguments as template arguments.
Definition utility.hh:94
│ │ │ │ +
typename Imp::TransformTupleHelper< F, Tuples... >::Type TransformTuple
Transform tuple types argument using type-functor.
Definition utility.hh:131
│ │ │ │ +
static constexpr auto isCallable()
Check if f is callable with given argument list.
Definition functionconcepts.hh:47
│ │ │ │ +
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:165
│ │ │ │ +
auto callableCheck(Expression f)
Create a predicate for checking validity of expressions.
Definition utility.hh:279
│ │ │ │ +
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:60
│ │ │ │ +
auto negatePredicate(Check check)
Negate given predicate.
Definition utility.hh:304
│ │ │ │ +
Definition polynomial.hh:10
│ │ │ │ +
auto forwardCapture(T &&t)
Create a capture object for perfect forwarding.
Definition utility.hh:372
│ │ │ │ +
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:21
│ │ │ │ +
typename Imp::IntegerSequenceTupleHelper< IntegerSequence >::Type IntegerSequenceTuple
Transform integer_sequence<I,k...> to tuple<integral_constant<I,k>...>
Definition utility.hh:211
│ │ │ │ +
Get last entry of type list.
Definition utility.hh:222
│ │ │ │ +
typename std::tuple_element< sizeof...(T) -1, std::tuple< T... > >::type type
Definition utility.hh:223
│ │ │ │ +
Rotate type list by one, such that last entry is moved to first position.
Definition utility.hh:251
│ │ │ │ +
typename Imp::RotateHelper< std::tuple< T... >, std::make_index_sequence< sizeof...(T) -1 > >::type type
Definition utility.hh:252
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,336 +1,348 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -globalvaluedlocalfiniteelement.hh │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_COMMON_UTILITY_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_COMMON_UTILITY_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ -8 │ │ │ │ │ -9#include │ │ │ │ │ -10#include │ │ │ │ │ -11#include │ │ │ │ │ -12#include │ │ │ │ │ -13 │ │ │ │ │ -14#include │ │ │ │ │ -15 │ │ │ │ │ -16#include │ │ │ │ │ -17#include │ │ │ │ │ -18#include │ │ │ │ │ +6 │ │ │ │ │ +7#include │ │ │ │ │ +8#include │ │ │ │ │ +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_/_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ │ +14 │ │ │ │ │ +15namespace _D_u_n_e { │ │ │ │ │ +16namespace Functions { │ │ │ │ │ +17 │ │ │ │ │ +18 │ │ │ │ │ 19 │ │ │ │ │ -20namespace Dune::Functions::Impl │ │ │ │ │ -21{ │ │ │ │ │ -22 │ │ │ │ │ -36 struct ContravariantPiolaTransformator │ │ │ │ │ -37 { │ │ │ │ │ -42 template │ │ │ │ │ -43 static auto apply(Values& values, │ │ │ │ │ -44 const LocalCoordinate& xi, │ │ │ │ │ -45 const Geometry& geometry) │ │ │ │ │ -46 { │ │ │ │ │ -47 auto jacobianTransposed = geometry.jacobianTransposed(xi); │ │ │ │ │ -48 auto integrationElement = geometry.integrationElement(xi); │ │ │ │ │ -49 │ │ │ │ │ -50 for (auto& value : values) │ │ │ │ │ -51 { │ │ │ │ │ -52 auto tmp = value; │ │ │ │ │ -53 jacobianTransposed.mtv(tmp, value); │ │ │ │ │ -54 value /= integrationElement; │ │ │ │ │ -55 } │ │ │ │ │ -56 } │ │ │ │ │ -57 │ │ │ │ │ -67 template │ │ │ │ │ -68 static auto applyJacobian(Gradients& gradients, │ │ │ │ │ -69 const LocalCoordinate& xi, │ │ │ │ │ -70 const Geometry& geometry) │ │ │ │ │ -71 { │ │ │ │ │ -72 auto jacobianTransposed = geometry.jacobianTransposed(xi); │ │ │ │ │ -73 auto integrationElement = geometry.integrationElement(xi); │ │ │ │ │ -74 for (auto& gradient : gradients) │ │ │ │ │ -75 { │ │ │ │ │ -76 auto tmp = gradient; │ │ │ │ │ -77 gradient = 0; │ │ │ │ │ -78 for (size_t k=0; k │ │ │ │ │ -95 class LocalValuedFunction │ │ │ │ │ -96 { │ │ │ │ │ -97 const Function& f_; │ │ │ │ │ -98 const Element& element_; │ │ │ │ │ +20template │ │ │ │ │ +_2_1auto _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) │ │ │ │ │ +22 ->decltype(f(std::integral_constant(), std:: │ │ │ │ │ +forward(args)...)) │ │ │ │ │ +23{ │ │ │ │ │ +24 return f(std::integral_constant(), std::forward │ │ │ │ │ +(args)...); │ │ │ │ │ +25} │ │ │ │ │ +26 │ │ │ │ │ +27template │ │ │ │ │ +_2_8auto _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) │ │ │ │ │ +29 ->decltype(f(std::integral_constant(), std:: │ │ │ │ │ +forward(args)...)) │ │ │ │ │ +30{ │ │ │ │ │ +31 if (i==firstValue) │ │ │ │ │ +32 return f(std::integral_constant(), std::forward │ │ │ │ │ +(args)...); │ │ │ │ │ +33 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)...); │ │ │ │ │ +34} │ │ │ │ │ +35 │ │ │ │ │ +36 │ │ │ │ │ +37 │ │ │ │ │ +59template │ │ │ │ │ +_6_0auto _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) │ │ │ │ │ +61 ->decltype(f(Dune::Indices::_0, std::forward(args)...)) │ │ │ │ │ +62{ │ │ │ │ │ +63 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)...); │ │ │ │ │ +64} │ │ │ │ │ +65 │ │ │ │ │ +66 │ │ │ │ │ +67 │ │ │ │ │ +68namespace Imp { │ │ │ │ │ +69 │ │ │ │ │ +70 template class T, class List> │ │ │ │ │ +71 struct ExpandTupleHelper │ │ │ │ │ +72 {}; │ │ │ │ │ +73 │ │ │ │ │ +74 template class T, template class ListType, │ │ │ │ │ +class... Args> │ │ │ │ │ +75 struct ExpandTupleHelper> │ │ │ │ │ +76 { │ │ │ │ │ +77 using Type = T; │ │ │ │ │ +78 }; │ │ │ │ │ +79 │ │ │ │ │ +80} // end namespace Imp │ │ │ │ │ +81 │ │ │ │ │ +93template class T, class ArgTuple> │ │ │ │ │ +_9_4using _E_x_p_a_n_d_T_u_p_l_e = typename Imp::ExpandTupleHelper::Type; │ │ │ │ │ +95 │ │ │ │ │ +96 │ │ │ │ │ +97 │ │ │ │ │ +98namespace Imp { │ │ │ │ │ 99 │ │ │ │ │ -100 public: │ │ │ │ │ -101 │ │ │ │ │ -102 LocalValuedFunction(const Function& f, const Element& element) │ │ │ │ │ -103 : f_(f), element_(element) │ │ │ │ │ -104 {} │ │ │ │ │ -105 │ │ │ │ │ -106 auto operator()(const LocalCoordinate& xi) const │ │ │ │ │ -107 { │ │ │ │ │ -108 auto&& f = Dune::Impl::makeFunctionWithCallOperator(f_); │ │ │ │ │ -109 auto globalValue = f(xi); │ │ │ │ │ -110 │ │ │ │ │ -111 // Apply the inverse Piola transform │ │ │ │ │ -112 auto jacobianInverseTransposed = element_.geometry │ │ │ │ │ -().jacobianInverseTransposed(xi); │ │ │ │ │ -113 auto integrationElement = element_.geometry().integrationElement(xi); │ │ │ │ │ -114 │ │ │ │ │ -115 auto localValue = globalValue; │ │ │ │ │ -116 jacobianInverseTransposed.mtv(globalValue, localValue); │ │ │ │ │ -117 localValue *= integrationElement; │ │ │ │ │ -118 │ │ │ │ │ -119 return localValue; │ │ │ │ │ -120 } │ │ │ │ │ -121 }; │ │ │ │ │ -122 }; │ │ │ │ │ -123 │ │ │ │ │ -137 struct CovariantPiolaTransformator │ │ │ │ │ -138 { │ │ │ │ │ -143 template │ │ │ │ │ -144 static auto apply(Values& values, │ │ │ │ │ -145 const LocalCoordinate& xi, │ │ │ │ │ -146 const Geometry& geometry) │ │ │ │ │ +100 template class T, class... Tuple> │ │ │ │ │ +101 struct TransformTupleHelper │ │ │ │ │ +102 {}; │ │ │ │ │ +103 │ │ │ │ │ +104 template class T, class... Args1> │ │ │ │ │ +105 struct TransformTupleHelper> │ │ │ │ │ +106 { │ │ │ │ │ +107 using Type = std::tuple...>; │ │ │ │ │ +108 }; │ │ │ │ │ +109 │ │ │ │ │ +110 template class T, class... Args1, class... Args2> │ │ │ │ │ +111 struct TransformTupleHelper, typename │ │ │ │ │ +std::tuple> │ │ │ │ │ +112 { │ │ │ │ │ +113 using Type = std::tuple...>; │ │ │ │ │ +114 }; │ │ │ │ │ +115 │ │ │ │ │ +116} // end namespace Imp │ │ │ │ │ +117 │ │ │ │ │ +130template class F, class... Tuples> │ │ │ │ │ +_1_3_1using _T_r_a_n_s_f_o_r_m_T_u_p_l_e = typename Imp::TransformTupleHelper:: │ │ │ │ │ +Type; │ │ │ │ │ +132 │ │ │ │ │ +133 │ │ │ │ │ +134 │ │ │ │ │ +135namespace Imp { │ │ │ │ │ +136 │ │ │ │ │ +137 template │ │ │ │ │ +138 auto transformTupleHelper(F&& f, const std::tuple& tuple, std:: │ │ │ │ │ +index_sequence) │ │ │ │ │ +139 -> decltype(std::make_tuple(f(std::get(tuple))...)) │ │ │ │ │ +140 { │ │ │ │ │ +141 return std::make_tuple(f(std::get(tuple))...); │ │ │ │ │ +142 } │ │ │ │ │ +143 │ │ │ │ │ +144 template │ │ │ │ │ +145 auto transformTupleHelper(F&& f, const std::tuple& tuple1, const │ │ │ │ │ +std::tuple& tuple2, std::index_sequence) │ │ │ │ │ +146 -> decltype(std::make_tuple(f(std::get(tuple1), std::get │ │ │ │ │ +(tuple2))...)) │ │ │ │ │ 147 { │ │ │ │ │ -148 auto jacobianInverseTransposed = geometry.jacobianInverseTransposed(xi); │ │ │ │ │ -149 │ │ │ │ │ -150 for (auto& value : values) │ │ │ │ │ -151 { │ │ │ │ │ -152 auto tmp = value; │ │ │ │ │ -153 jacobianInverseTransposed.mv(tmp, value); │ │ │ │ │ -154 } │ │ │ │ │ -155 } │ │ │ │ │ -156 │ │ │ │ │ -166 template │ │ │ │ │ -167 static auto applyJacobian(Gradients& gradients, │ │ │ │ │ -168 const LocalCoordinate& xi, │ │ │ │ │ -169 const Geometry& geometry) │ │ │ │ │ -170 { │ │ │ │ │ -171 auto jacobianInverseTransposed = geometry.jacobianInverseTransposed(xi); │ │ │ │ │ -172 │ │ │ │ │ -173 for (auto& gradient : gradients) │ │ │ │ │ -174 { │ │ │ │ │ -175 auto tmp = gradient; │ │ │ │ │ -176 gradient = 0; │ │ │ │ │ -177 for (size_t j=0; j │ │ │ │ │ -193 class LocalValuedFunction │ │ │ │ │ -194 { │ │ │ │ │ -195 const Function& f_; │ │ │ │ │ -196 const Element& element_; │ │ │ │ │ -197 │ │ │ │ │ -198 public: │ │ │ │ │ -199 │ │ │ │ │ -200 LocalValuedFunction(const Function& f, const Element& element) │ │ │ │ │ -201 : f_(f), element_(element) │ │ │ │ │ -202 {} │ │ │ │ │ -203 │ │ │ │ │ -204 auto operator()(const LocalCoordinate& xi) const │ │ │ │ │ -205 { │ │ │ │ │ -206 auto&& f = Dune::Impl::makeFunctionWithCallOperator(f_); │ │ │ │ │ -207 auto globalValue = f(xi); │ │ │ │ │ -208 │ │ │ │ │ -209 // Apply the inverse Piola transform │ │ │ │ │ -210 auto jacobianTransposed = element_.geometry().jacobianTransposed(xi); │ │ │ │ │ -211 │ │ │ │ │ -212 auto localValue = globalValue; │ │ │ │ │ -213 jacobianTransposed.mv(globalValue, localValue); │ │ │ │ │ +148 return std::make_tuple(f(std::get(tuple1), std::get(tuple2))...); │ │ │ │ │ +149 } │ │ │ │ │ +150 │ │ │ │ │ +151} // end namespace Imp │ │ │ │ │ +152 │ │ │ │ │ +164template │ │ │ │ │ +_1_6_5auto _t_r_a_n_s_f_o_r_m_T_u_p_l_e(F&& f, const std::tuple& tuple) │ │ │ │ │ +166 -> decltype(Imp::transformTupleHelper(std::forward(f), tuple, std:: │ │ │ │ │ +index_sequence_for{})) │ │ │ │ │ +167{ │ │ │ │ │ +168 return Imp::transformTupleHelper(std::forward(f), tuple, std:: │ │ │ │ │ +index_sequence_for{}); │ │ │ │ │ +169} │ │ │ │ │ +170 │ │ │ │ │ +184template │ │ │ │ │ +_1_8_5auto _t_r_a_n_s_f_o_r_m_T_u_p_l_e(F&& f, const std::tuple& tuple1, const std:: │ │ │ │ │ +tuple& tuple2) │ │ │ │ │ +186 -> decltype(Imp::transformTupleHelper(std::forward(f), tuple1, tuple2, │ │ │ │ │ +std::index_sequence_for{})) │ │ │ │ │ +187{ │ │ │ │ │ +188 return Imp::transformTupleHelper(std::forward(f), tuple1, tuple2, std:: │ │ │ │ │ +index_sequence_for{}); │ │ │ │ │ +189} │ │ │ │ │ +190 │ │ │ │ │ +191 │ │ │ │ │ +192 │ │ │ │ │ +193namespace Imp { │ │ │ │ │ +194 │ │ │ │ │ +195 template │ │ │ │ │ +196 struct IntegerSequenceTupleHelper │ │ │ │ │ +197 {}; │ │ │ │ │ +198 │ │ │ │ │ +199 template │ │ │ │ │ +200 struct IntegerSequenceTupleHelper> │ │ │ │ │ +201 { │ │ │ │ │ +202 using Type = std::tuple...>; │ │ │ │ │ +203 }; │ │ │ │ │ +204 │ │ │ │ │ +205} // end namespace Imp │ │ │ │ │ +206 │ │ │ │ │ +210template │ │ │ │ │ +_2_1_1using _I_n_t_e_g_e_r_S_e_q_u_e_n_c_e_T_u_p_l_e= typename Imp:: │ │ │ │ │ +IntegerSequenceTupleHelper::Type; │ │ │ │ │ +212 │ │ │ │ │ +213 │ │ │ │ │ 214 │ │ │ │ │ -215 return localValue; │ │ │ │ │ -216 } │ │ │ │ │ -217 }; │ │ │ │ │ -218 }; │ │ │ │ │ -219 │ │ │ │ │ -226 template │ │ │ │ │ -227 class GlobalValuedLocalBasis │ │ │ │ │ -228 { │ │ │ │ │ -229 public: │ │ │ │ │ -230 using Traits = typename LocalValuedLocalBasis::Traits; │ │ │ │ │ -231 │ │ │ │ │ -234 void bind(const LocalValuedLocalBasis& localValuedLocalBasis, const │ │ │ │ │ -Element& element) │ │ │ │ │ -235 { │ │ │ │ │ -236 localValuedLocalBasis_ = &localValuedLocalBasis; │ │ │ │ │ -237 element_ = &element; │ │ │ │ │ -238 } │ │ │ │ │ -239 │ │ │ │ │ -242 auto size() const │ │ │ │ │ -243 { │ │ │ │ │ -244 return localValuedLocalBasis_->size(); │ │ │ │ │ -245 } │ │ │ │ │ -246 │ │ │ │ │ -248 void evaluateFunction(const typename Traits::DomainType& x, │ │ │ │ │ -249 std::vector& out) const │ │ │ │ │ -250 { │ │ │ │ │ -251 localValuedLocalBasis_->evaluateFunction(x,out); │ │ │ │ │ -252 │ │ │ │ │ -253 Transformator::apply(out, x, element_->geometry()); │ │ │ │ │ -254 } │ │ │ │ │ +220template │ │ │ │ │ +_2_2_1struct _L_a_s_t_T_y_p_e │ │ │ │ │ +222{ │ │ │ │ │ +_2_2_3 using _t_y_p_e = typename std::tuple_element>_:_:_t_y_p_e; │ │ │ │ │ +224}; │ │ │ │ │ +225 │ │ │ │ │ +226 │ │ │ │ │ +227 │ │ │ │ │ +228namespace Imp { │ │ │ │ │ +229 │ │ │ │ │ +230template │ │ │ │ │ +231struct RotateHelper; │ │ │ │ │ +232 │ │ │ │ │ +233template │ │ │ │ │ +234struct RotateHelper, std::index_sequence > │ │ │ │ │ +235{ │ │ │ │ │ +236 using type = typename std::tuple::type, typename │ │ │ │ │ +std::tuple_element>::type...>; │ │ │ │ │ +237}; │ │ │ │ │ +238 │ │ │ │ │ +239} // end namespace Imp │ │ │ │ │ +240 │ │ │ │ │ +241 │ │ │ │ │ +249template │ │ │ │ │ +_2_5_0struct _R_o_t_a_t_e_T_u_p_l_e │ │ │ │ │ +251{ │ │ │ │ │ +_2_5_2 using _t_y_p_e = typename Imp::RotateHelper, std:: │ │ │ │ │ +make_index_sequence>_:_:_t_y_p_e; │ │ │ │ │ +253}; │ │ │ │ │ +254 │ │ │ │ │ 255 │ │ │ │ │ -261 void evaluateJacobian(const typename Traits::DomainType& x, │ │ │ │ │ -262 std::vector& out) const │ │ │ │ │ -263 { │ │ │ │ │ -264 localValuedLocalBasis_->evaluateJacobian(x,out); │ │ │ │ │ -265 │ │ │ │ │ -266 Transformator::applyJacobian(out, x, element_->geometry()); │ │ │ │ │ -267 } │ │ │ │ │ -268 │ │ │ │ │ -275 void partial(const std::array& order, │ │ │ │ │ -276 const typename Traits::DomainType& x, │ │ │ │ │ -277 std::vector& out) const │ │ │ │ │ -278 { │ │ │ │ │ -279 auto totalOrder = std::accumulate(order.begin(), order.end(), 0); │ │ │ │ │ -280 if (totalOrder == 0) { │ │ │ │ │ -281 evaluateFunction(x, out); │ │ │ │ │ -282 } else if (totalOrder == 1) { │ │ │ │ │ -283 auto const direction = std::distance(order.begin(), std::find(order.begin │ │ │ │ │ -(), order.end(), 1)); │ │ │ │ │ -284 out.resize(size()); │ │ │ │ │ +256 │ │ │ │ │ +278template │ │ │ │ │ +_2_7_9auto _c_a_l_l_a_b_l_e_C_h_e_c_k(Expression f) │ │ │ │ │ +280{ │ │ │ │ │ +281 return [f](auto&&... args){ │ │ │ │ │ +282 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)...); │ │ │ │ │ +283 }; │ │ │ │ │ +284} │ │ │ │ │ 285 │ │ │ │ │ -286 // TODO: The following is wasteful: We compute the full Jacobian and then │ │ │ │ │ -return │ │ │ │ │ -287 // only a part of it. While we need the full Jacobian of the underlying │ │ │ │ │ -local-valued LFE, │ │ │ │ │ -288 // it should be possible to compute only a partial Piola transform for the │ │ │ │ │ -requested │ │ │ │ │ -289 // partial derivatives. │ │ │ │ │ -290 std::vector fullJacobian; │ │ │ │ │ -291 localValuedLocalBasis_->evaluateJacobian(x,fullJacobian); │ │ │ │ │ -292 │ │ │ │ │ -293 Transformator::applyJacobian(fullJacobian, x, element_->geometry()); │ │ │ │ │ -294 │ │ │ │ │ -295 for (std::size_t i=0; iorder(); │ │ │ │ │ -307 } │ │ │ │ │ -308 │ │ │ │ │ -309 const LocalValuedLocalBasis* localValuedLocalBasis_; │ │ │ │ │ -310 const Element* element_; │ │ │ │ │ -311 }; │ │ │ │ │ -312 │ │ │ │ │ -321 template │ │ │ │ │ -322 class GlobalValuedLocalInterpolation │ │ │ │ │ -323 { │ │ │ │ │ -324 public: │ │ │ │ │ -327 void bind(const LocalValuedLocalInterpolation& │ │ │ │ │ -localValuedLocalInterpolation, const Element& element) │ │ │ │ │ -328 { │ │ │ │ │ -329 localValuedLocalInterpolation_ = &localValuedLocalInterpolation; │ │ │ │ │ -330 element_ = &element; │ │ │ │ │ -331 } │ │ │ │ │ -332 │ │ │ │ │ -333 template │ │ │ │ │ -334 void _i_n_t_e_r_p_o_l_a_t_e (const F& f, std::vector& out) const │ │ │ │ │ -335 { │ │ │ │ │ -336 using LocalCoordinate = typename Element::Geometry::LocalCoordinate; │ │ │ │ │ -337 typename Transformator::template │ │ │ │ │ -LocalValuedFunction localValuedFunction(f, │ │ │ │ │ -*element_); │ │ │ │ │ -338 localValuedLocalInterpolation_->interpolate(localValuedFunction, out); │ │ │ │ │ -339 } │ │ │ │ │ +286 │ │ │ │ │ +287 │ │ │ │ │ +303template │ │ │ │ │ +_3_0_4auto _n_e_g_a_t_e_P_r_e_d_i_c_a_t_e(Check check) │ │ │ │ │ +305{ │ │ │ │ │ +306 return [check](auto&&... args){ │ │ │ │ │ +307 auto negate = overload( │ │ │ │ │ +308 [](std::true_type) { return std::false_type{};}, │ │ │ │ │ +309 [](std::false_type) { return std::true_type{};}, │ │ │ │ │ +310 [](bool v) { return not v;}); │ │ │ │ │ +311 return negate(check(std::forward(args)...)); │ │ │ │ │ +312 }; │ │ │ │ │ +313} │ │ │ │ │ +314 │ │ │ │ │ +315 │ │ │ │ │ +316namespace Impl { │ │ │ │ │ +317 │ │ │ │ │ +318 // Wrapper to capture values in a lambda for perfect forwarding. │ │ │ │ │ +319 // This captures value types by value and reference types by reference. │ │ │ │ │ +320 template │ │ │ │ │ +321 struct ForwardCaptureWrapper; │ │ │ │ │ +322 │ │ │ │ │ +323 template │ │ │ │ │ +324 struct ForwardCaptureWrapper │ │ │ │ │ +325 { │ │ │ │ │ +326 template │ │ │ │ │ +327 ForwardCaptureWrapper(TT&& t) : t_{std::forward(t)} {} │ │ │ │ │ +328 │ │ │ │ │ +329 auto forward() const { return std::move(t_); } │ │ │ │ │ +330 │ │ │ │ │ +331 T t_; │ │ │ │ │ +332 }; │ │ │ │ │ +333 │ │ │ │ │ +334 template │ │ │ │ │ +335 struct ForwardCaptureWrapper │ │ │ │ │ +336 { │ │ │ │ │ +337 ForwardCaptureWrapper(T& t) : t_{t} {} │ │ │ │ │ +338 │ │ │ │ │ +339 T& forward() const { return t_; }; │ │ │ │ │ 340 │ │ │ │ │ -341 private: │ │ │ │ │ -342 const LocalValuedLocalInterpolation* localValuedLocalInterpolation_; │ │ │ │ │ -343 const Element* element_; │ │ │ │ │ -344 }; │ │ │ │ │ -345 │ │ │ │ │ -346 │ │ │ │ │ -353 template │ │ │ │ │ -354 class GlobalValuedLocalFiniteElement │ │ │ │ │ -355 { │ │ │ │ │ -356 using LocalBasis = GlobalValuedLocalBasis; │ │ │ │ │ -359 using LocalInterpolation = GlobalValuedLocalInterpolation; │ │ │ │ │ -362 │ │ │ │ │ -363 public: │ │ │ │ │ -366 using Traits = LocalFiniteElementTraits; │ │ │ │ │ -369 │ │ │ │ │ -370 GlobalValuedLocalFiniteElement() {} │ │ │ │ │ -371 │ │ │ │ │ -372 void bind(const LocalValuedLFE& localValuedLFE, const Element& element) │ │ │ │ │ -373 { │ │ │ │ │ -374 globalValuedLocalBasis_.bind(localValuedLFE.localBasis(), element); │ │ │ │ │ -375 globalValuedLocalInterpolation_.bind(localValuedLFE.localInterpolation(), │ │ │ │ │ -element); │ │ │ │ │ -376 localValuedLFE_ = &localValuedLFE; │ │ │ │ │ -377 } │ │ │ │ │ +341 T& t_; │ │ │ │ │ +342 }; │ │ │ │ │ +343 │ │ │ │ │ +344 template │ │ │ │ │ +345 struct ForwardCaptureWrapper │ │ │ │ │ +346 { │ │ │ │ │ +347 ForwardCaptureWrapper(const T& t) : t_{t} {} │ │ │ │ │ +348 │ │ │ │ │ +349 const T& forward() const { return t_; }; │ │ │ │ │ +350 │ │ │ │ │ +351 const T& t_; │ │ │ │ │ +352 }; │ │ │ │ │ +353 │ │ │ │ │ +354} // end namespace Dune::Functions::Impl │ │ │ │ │ +355 │ │ │ │ │ +356 │ │ │ │ │ +357 │ │ │ │ │ +371template │ │ │ │ │ +_3_7_2auto _f_o_r_w_a_r_d_C_a_p_t_u_r_e(T&& t) │ │ │ │ │ +373{ │ │ │ │ │ +374 return Impl::ForwardCaptureWrapper(std::forward(t)); │ │ │ │ │ +375} │ │ │ │ │ +376 │ │ │ │ │ +377 │ │ │ │ │ 378 │ │ │ │ │ -381 const typename Traits::LocalBasisType& localBasis() const │ │ │ │ │ -382 { │ │ │ │ │ -383 return globalValuedLocalBasis_; │ │ │ │ │ -384 } │ │ │ │ │ -385 │ │ │ │ │ -388 const typename Traits::LocalCoefficientsType& localCoefficients() const │ │ │ │ │ -389 { │ │ │ │ │ -390 return localValuedLFE_->localCoefficients(); │ │ │ │ │ -391 } │ │ │ │ │ -392 │ │ │ │ │ -395 const typename Traits::LocalInterpolationType& localInterpolation() const │ │ │ │ │ -396 { │ │ │ │ │ -397 return globalValuedLocalInterpolation_; │ │ │ │ │ -398 } │ │ │ │ │ -399 │ │ │ │ │ -401 std::size_t size() const │ │ │ │ │ -402 { │ │ │ │ │ -403 return localValuedLFE_->size(); │ │ │ │ │ -404 } │ │ │ │ │ -405 │ │ │ │ │ -408 GeometryType type() const │ │ │ │ │ -409 { │ │ │ │ │ -410 return localValuedLFE_->type(); │ │ │ │ │ -411 } │ │ │ │ │ -412 │ │ │ │ │ -413 private: │ │ │ │ │ -414 │ │ │ │ │ -415 typename Traits::LocalBasisType globalValuedLocalBasis_; │ │ │ │ │ -416 typename Traits::LocalInterpolationType globalValuedLocalInterpolation_; │ │ │ │ │ -417 const LocalValuedLFE* localValuedLFE_; │ │ │ │ │ -418 }; │ │ │ │ │ -419 │ │ │ │ │ -420} // namespace Dune::Functions::Impl │ │ │ │ │ -421 │ │ │ │ │ -422#endif / │ │ │ │ │ -/ DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH │ │ │ │ │ -_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:202 │ │ │ │ │ +379} // namespace Dune::Functions │ │ │ │ │ +380} // namespace Dune │ │ │ │ │ +381 │ │ │ │ │ +382 │ │ │ │ │ +383#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_:_:_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:94 │ │ │ │ │ +_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:131 │ │ │ │ │ +_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:47 │ │ │ │ │ +_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:165 │ │ │ │ │ +_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:279 │ │ │ │ │ +_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:60 │ │ │ │ │ +_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:304 │ │ │ │ │ +_D_u_n_e │ │ │ │ │ +DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ +_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:372 │ │ │ │ │ +_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:21 │ │ │ │ │ +_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:211 │ │ │ │ │ +_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:222 │ │ │ │ │ +_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 │ │ │ │ │ +typename std::tuple_element< sizeof...(T) -1, std::tuple< T... > >::type type │ │ │ │ │ +DDeeffiinniittiioonn utility.hh:223 │ │ │ │ │ +_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:251 │ │ │ │ │ +_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:252 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00041.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: nedelecbasis.hh File Reference │ │ │ │ +dune-functions: signature.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,67 +65,57 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces | │ │ │ │ -Typedefs | │ │ │ │ Functions
│ │ │ │ -
nedelecbasis.hh File Reference
│ │ │ │ +
signature.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/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::NedelecPreBasis< GV, Range, kind, order >
struct  Dune::Functions::SignatureTraits< Signature, isCallable >
 Helper class to deduce the signature of a callable. More...
 
class  Dune::Functions::NedelecNode< GV, Range, kind, order >
struct  Dune::Functions::SignatureTag< Range(Domain), DerivativeTraitsT >
 Tag-class to encapsulate signature information. 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.
 
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.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── encoding │ │ │ │ │ @@ -1 +1 @@ │ │ │ │ │ -utf-8 │ │ │ │ │ +us-ascii │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,45 +1,40 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -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_/_n_o_d_e_s_._h_h> │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +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_:_:_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_ _> │ │ │ │ │ +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_._._. │ │ │ │ │   │ │ │ │ │ -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_:_:_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_:_:_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< GV, │ │ │ │ │ - Range, kind, order > > │ │ │ │ │ -  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. │ │ │ │ │ +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. │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00041_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: nedelecbasis.hh Source File │ │ │ │ +dune-functions: signature.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,418 +70,168 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
nedelecbasis.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_COMMON_SIGNATURE_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_COMMON_SIGNATURE_HH
│ │ │ │
5
│ │ │ │ -
6#include <array>
│ │ │ │ -
7#include <dune/common/exceptions.hh>
│ │ │ │ +
6#include <type_traits>
│ │ │ │ +
7#include <tuple>
│ │ │ │
8
│ │ │ │ -
9#include <dune/grid/common/capabilities.hh>
│ │ │ │ -
10#include <dune/grid/common/mcmgmapper.hh>
│ │ │ │ -
11
│ │ │ │ -
12#include <dune/localfunctions/common/localfiniteelementvariant.hh>
│ │ │ │ -
13#include <dune/localfunctions/nedelec.hh>
│ │ │ │ -
14
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
18
│ │ │ │ -
19namespace Dune::Functions
│ │ │ │ -
20{
│ │ │ │ + │ │ │ │ +
10
│ │ │ │ +
11namespace Dune {
│ │ │ │ +
12namespace Functions {
│ │ │ │ +
13
│ │ │ │ +
19template<typename F>
│ │ │ │ + │ │ │ │
21
│ │ │ │ -
22namespace Impl
│ │ │ │ -
23{
│ │ │ │ -
24 template<typename GV, int dim, typename R, std::size_t order>
│ │ │ │ -
25 class Nedelec1stKindLocalFiniteElementMap
│ │ │ │ -
26 {
│ │ │ │ -
27 using D = typename GV::ctype;
│ │ │ │ -
28 constexpr static bool hasFixedElementType = Capabilities::hasSingleGeometryType<typename GV::Grid>::v;
│ │ │ │ -
29
│ │ │ │ -
30 using CubeFiniteElement = Nedelec1stKindCubeLocalFiniteElement<D,R,dim,order>;
│ │ │ │ -
31 using SimplexFiniteElement = Nedelec1stKindSimplexLocalFiniteElement<D,R,dim,order>;
│ │ │ │ -
32
│ │ │ │ -
33 public:
│ │ │ │ -
34
│ │ │ │ -
35 using T = LocalBasisTraits<D, dim, FieldVector<D,dim>, R, dim, FieldVector<R,dim>, FieldMatrix<D,dim,dim> >;
│ │ │ │ +
22#ifndef DOXYGEN
│ │ │ │ +
23template<typename F>
│ │ │ │ +
24struct IsCallable
│ │ │ │ +
25{
│ │ │ │ +
26 struct yes { std::size_t dummy[2]; };
│ │ │ │ +
27 struct no { std::size_t dummy[1]; };
│ │ │ │ +
28
│ │ │ │ +
29 template<typename C>
│ │ │ │ +
30 static yes test(const decltype(&C::operator()) *);
│ │ │ │ +
31 template<typename C>
│ │ │ │ +
32 static no test(...);
│ │ │ │ +
33
│ │ │ │ +
34 enum { value = (sizeof(test<F>(0)) == sizeof(yes)) };
│ │ │ │ +
35};
│ │ │ │
36
│ │ │ │ -
37 constexpr static unsigned int topologyId = Capabilities::hasSingleGeometryType<typename GV::Grid>::topologyId; // meaningless if hasFixedElementType is false
│ │ │ │ -
38 constexpr static GeometryType type = GeometryType(topologyId, GV::dimension);
│ │ │ │ -
39
│ │ │ │ -
40 using FiniteElement = std::conditional_t<hasFixedElementType,
│ │ │ │ -
41 std::conditional_t<type.isCube(),CubeFiniteElement,SimplexFiniteElement>,
│ │ │ │ -
42 LocalFiniteElementVariant<CubeFiniteElement, SimplexFiniteElement> >;
│ │ │ │ -
43
│ │ │ │ -
44 static std::size_t numVariants(GeometryType type)
│ │ │ │ -
45 {
│ │ │ │ -
46 if (order!=1) // I am not sure whether the formula below is correct for all orders.
│ │ │ │ -
47 DUNE_THROW(NotImplemented, "Only Nedelec elements of order 1 are implemented!");
│ │ │ │ -
48
│ │ │ │ -
49 auto numEdges = referenceElement<D,dim>(type).size(dim-1);
│ │ │ │ -
50 return power(2,numEdges);
│ │ │ │ -
51 }
│ │ │ │ -
52
│ │ │ │ -
53 Nedelec1stKindLocalFiniteElementMap(const GV& gv)
│ │ │ │ -
54 : elementMapper_(gv, mcmgElementLayout()),
│ │ │ │ -
55 orientation_(gv.size(0))
│ │ │ │ -
56 {
│ │ │ │ -
57 // create all variants
│ │ │ │ -
58 if constexpr (hasFixedElementType)
│ │ │ │ -
59 {
│ │ │ │ -
60 variants_.resize(numVariants(type));
│ │ │ │ -
61 for (size_t i = 0; i < numVariants(type); i++)
│ │ │ │ -
62 variants_[i] = FiniteElement(i);
│ │ │ │ -
63 }
│ │ │ │ -
64 else
│ │ │ │ -
65 {
│ │ │ │ -
66 // for mixed grids add offset for cubes
│ │ │ │ -
67 variants_.resize(numVariants(GeometryTypes::simplex(dim)) + numVariants(GeometryTypes::cube(dim)));
│ │ │ │ -
68 for (size_t i = 0; i < numVariants(GeometryTypes::simplex(dim)); i++)
│ │ │ │ -
69 variants_[i] = SimplexFiniteElement(i);
│ │ │ │ -
70 for (size_t i = 0; i < numVariants(GeometryTypes::cube(dim)); i++)
│ │ │ │ -
71 variants_[i + numVariants(GeometryTypes::simplex(dim))] = CubeFiniteElement(i);
│ │ │ │ -
72 }
│ │ │ │ -
73
│ │ │ │ -
74
│ │ │ │ -
75 // compute orientation for all elements
│ │ │ │ -
76 const auto& indexSet = gv.indexSet();
│ │ │ │ -
77
│ │ │ │ -
78 for(const auto& element : elements(gv))
│ │ │ │ -
79 {
│ │ │ │ -
80 const auto& refElement = referenceElement(element);
│ │ │ │ -
81 auto elementIndex = elementMapper_.index(element);
│ │ │ │ -
82 orientation_[elementIndex] = 0;
│ │ │ │ -
83
│ │ │ │ -
84 for (std::size_t i=0; i<element.subEntities(dim-1); i++)
│ │ │ │ -
85 {
│ │ │ │ -
86 // Local vertex indices within the element
│ │ │ │ -
87 auto localV0 = refElement.subEntity(i,dim-1, 0,dim);
│ │ │ │ -
88 auto localV1 = refElement.subEntity(i,dim-1, 1,dim);
│ │ │ │ +
37template<typename R, typename D>
│ │ │ │ +
38struct IsCallable<R(D)>
│ │ │ │ +
39{
│ │ │ │ +
40 enum { value = true };
│ │ │ │ +
41};
│ │ │ │ +
42
│ │ │ │ +
43template<typename R, typename D>
│ │ │ │ +
44struct IsCallable<R(*)(D)>
│ │ │ │ +
45{
│ │ │ │ +
46 enum { value = true };
│ │ │ │ +
47};
│ │ │ │ +
48#endif
│ │ │ │ +
49
│ │ │ │ +
55template<class Signature, bool isCallable = IsCallable<Signature>::value >
│ │ │ │ + │ │ │ │ +
57
│ │ │ │ +
58#ifndef DOXYGEN
│ │ │ │ +
60template<class T>
│ │ │ │ +
61struct SignatureTraits<T, true>
│ │ │ │ +
62 : public SignatureTraits<decltype(&T::operator()), true>
│ │ │ │ +
63{};
│ │ │ │ +
64
│ │ │ │ +
66template <typename C, typename R, typename D>
│ │ │ │ +
67struct SignatureTraits<R(C::*)(D) const, true>
│ │ │ │ +
68 : public SignatureTraits<R(D), true>
│ │ │ │ +
69{};
│ │ │ │ +
70
│ │ │ │ +
72template <typename C, typename R, typename D>
│ │ │ │ +
73struct SignatureTraits<R(C::*)(D), true>
│ │ │ │ +
74 : public SignatureTraits<R(D), true>
│ │ │ │ +
75{};
│ │ │ │ +
76
│ │ │ │ +
78template <typename R, typename D>
│ │ │ │ +
79struct SignatureTraits<R(*)(D), true>
│ │ │ │ +
80 : public SignatureTraits<R(D), true>
│ │ │ │ +
81{};
│ │ │ │ +
82
│ │ │ │ +
84template<class R, class D>
│ │ │ │ +
85struct SignatureTraits<R(D), true>
│ │ │ │ +
86{
│ │ │ │ +
87 using Range = R;
│ │ │ │ +
88 using Domain = D;
│ │ │ │
89
│ │ │ │ -
90 // Global vertex indices within the grid
│ │ │ │ -
91 auto globalV0 = indexSet.subIndex(element,localV0,dim);
│ │ │ │ -
92 auto globalV1 = indexSet.subIndex(element,localV1,dim);
│ │ │ │ -
93
│ │ │ │ -
94 if ( (localV0<localV1 && globalV0>globalV1) || (localV0>localV1 && globalV0<globalV1) )
│ │ │ │ -
95 orientation_[elementIndex] |= (1 << i);
│ │ │ │ -
96 }
│ │ │ │ -
97 // for mixed grids add offset for cubes
│ │ │ │ -
98 if constexpr (!hasFixedElementType)
│ │ │ │ -
99 if (element.type().isCube())
│ │ │ │ -
100 orientation_[elementIndex] += numVariants(GeometryTypes::simplex(dim));
│ │ │ │ -
101 }
│ │ │ │ -
102 }
│ │ │ │ +
90 using RawRange = typename std::decay<Range>::type;
│ │ │ │ +
91 using RawDomain = typename std::decay<Domain>::type;
│ │ │ │ +
92
│ │ │ │ +
93 using RawSignature = RawRange(RawDomain);
│ │ │ │ +
94
│ │ │ │ +
95 template<template<class> class DerivativeTraits=DefaultDerivativeTraits>
│ │ │ │ +
96 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(Domain);
│ │ │ │ +
97};
│ │ │ │ +
98#endif
│ │ │ │ +
99
│ │ │ │ +
100
│ │ │ │ +
101template<class Signature, template<class> class DerivativeTraits=DefaultDerivativeTraits>
│ │ │ │ + │ │ │ │
103
│ │ │ │ -
104 template<class Element>
│ │ │ │ -
105 const auto& find(const Element& element) const
│ │ │ │ -
106 {
│ │ │ │ -
107 return variants_[orientation_[elementMapper_.index(element)]];
│ │ │ │ -
108 }
│ │ │ │ -
109
│ │ │ │ -
110 private:
│ │ │ │ -
111 std::vector<FiniteElement> variants_;
│ │ │ │ -
112 const Dune::MultipleCodimMultipleGeomTypeMapper<GV> elementMapper_;
│ │ │ │ -
113 std::vector<unsigned short> orientation_;
│ │ │ │ -
114 };
│ │ │ │ -
115
│ │ │ │ -
116
│ │ │ │ -
117} // namespace Impl
│ │ │ │ -
118
│ │ │ │ -
119
│ │ │ │ -
120// *****************************************************************************
│ │ │ │ -
121// This is the reusable part of the basis. It contains
│ │ │ │ -
122//
│ │ │ │ -
123// NedelecPreBasis
│ │ │ │ -
124// NedelecNode
│ │ │ │ -
125//
│ │ │ │ -
126// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ │ -
127// state. These components do _not_ depend on the global basis and local view
│ │ │ │ -
128// and can be used without a global basis.
│ │ │ │ -
129// *****************************************************************************
│ │ │ │ -
130
│ │ │ │ -
131template<typename GV, typename Range, std::size_t kind, int order>
│ │ │ │ -
132class NedelecNode;
│ │ │ │ -
133
│ │ │ │ -
134template<typename GV, typename Range, std::size_t kind, int order>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
136{
│ │ │ │ -
137 static const int dim = GV::dimension;
│ │ │ │ -
138 static_assert(kind==1, "Only the Nedelec basis of the first kind is currently implemented!");
│ │ │ │ -
139 using FiniteElementMap = typename Impl::Nedelec1stKindLocalFiniteElementMap<GV, dim, Range, order>;
│ │ │ │ +
113template<class Range, class Domain, template<class> class DerivativeTraitsT>
│ │ │ │ +
│ │ │ │ +
114struct SignatureTag<Range(Domain), DerivativeTraitsT>
│ │ │ │ +
115{
│ │ │ │ +
116 using Signature = Range(Domain);
│ │ │ │ +
117
│ │ │ │ +
118 template<class T>
│ │ │ │ +
119 using DerivativeTraits = DerivativeTraitsT<T>;
│ │ │ │ +
120};
│ │ │ │ +
│ │ │ │ +
121
│ │ │ │ +
122
│ │ │ │ +
123
│ │ │ │ +
132template<class Range, class Domain, template<class> class DerivativeTraits>
│ │ │ │ +
│ │ │ │ +
133auto derivativeSignatureTag(SignatureTag<Range(Domain), DerivativeTraits> tag)
│ │ │ │ +
134{
│ │ │ │ +
135 using DerivativeRange = typename DerivativeTraits<Range(Domain)>::Range;
│ │ │ │ + │ │ │ │ +
137}
│ │ │ │ +
│ │ │ │ +
138
│ │ │ │ +
139
│ │ │ │
140
│ │ │ │ -
141 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper<GV>;
│ │ │ │ -
142public:
│ │ │ │ -
143
│ │ │ │ -
145 using GridView = GV;
│ │ │ │ -
146 using size_type = std::size_t;
│ │ │ │ -
147
│ │ │ │ - │ │ │ │ -
149
│ │ │ │ -
150 static constexpr size_type maxMultiIndexSize = 1;
│ │ │ │ -
151 static constexpr size_type minMultiIndexSize = 1;
│ │ │ │ -
152 static constexpr size_type multiIndexBufferSize = 1;
│ │ │ │ -
153
│ │ │ │ +
154template<std::size_t maxOrder, class Signature, template<class> class DerivativeTraits>
│ │ │ │
│ │ │ │ - │ │ │ │ -
156 gridView_(gv),
│ │ │ │ - │ │ │ │ -
158 mapper_(gridView_, mcmgLayout(Dim<1>{}))
│ │ │ │ -
159 {
│ │ │ │ -
160 if (kind!=1)
│ │ │ │ -
161 DUNE_THROW(NotImplemented, "Only Nedelec elements of the first kind are implemented!");
│ │ │ │ -
162
│ │ │ │ -
163 // There is no inherent reason why the basis shouldn't work for grids with more than two
│ │ │ │ -
164 // element types. Somebody simply has to sit down and implement the missing bits.
│ │ │ │ -
165 if (gv.indexSet().types(0).size() > 2)
│ │ │ │ -
166 DUNE_THROW(NotImplemented, "Nédélec basis is only implemented for grids with simplex and cube elements");
│ │ │ │ -
167
│ │ │ │ -
168 for(auto type : gv.indexSet().types(0))
│ │ │ │ -
169 if (!type.isSimplex() && !type.isCube())
│ │ │ │ -
170 DUNE_THROW(NotImplemented, "Nédélec basis is only implemented for grids with simplex or cube elements.");
│ │ │ │ -
171
│ │ │ │ -
172 if (order>1)
│ │ │ │ -
173 DUNE_THROW(NotImplemented, "Only first-order elements are implemented");
│ │ │ │ -
174
│ │ │ │ -
175 if (dim!=2 && dim!=3)
│ │ │ │ -
176 DUNE_THROW(NotImplemented, "Only 2d and 3d Nédélec elements are implemented");
│ │ │ │ -
177 }
│ │ │ │ -
│ │ │ │ -
178
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
180 {}
│ │ │ │ -
│ │ │ │ -
181
│ │ │ │ -
│ │ │ │ -
184 const GridView& gridView() const
│ │ │ │ -
185 {
│ │ │ │ -
186 return gridView_;
│ │ │ │ -
187 }
│ │ │ │ -
│ │ │ │ -
188
│ │ │ │ -
189 /* \brief Update the stored grid view, to be called if the grid has changed */
│ │ │ │ -
│ │ │ │ -
190 void update (const GridView& gv)
│ │ │ │ -
191 {
│ │ │ │ -
192 gridView_ = gv;
│ │ │ │ -
193 mapper_.update(gridView_);
│ │ │ │ -
194 }
│ │ │ │ -
│ │ │ │ -
195
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
200 {
│ │ │ │ -
201 return Node{&finiteElementMap_};
│ │ │ │ -
202 }
│ │ │ │ -
│ │ │ │ -
203
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
205 {
│ │ │ │ -
206 return mapper_.size();
│ │ │ │ -
207 }
│ │ │ │ -
│ │ │ │ -
208
│ │ │ │ -
210 template<class SizePrefix>
│ │ │ │ -
│ │ │ │ -
211 size_type size(const SizePrefix& prefix) const
│ │ │ │ -
212 {
│ │ │ │ -
213 assert(prefix.size() == 0 || prefix.size() == 1);
│ │ │ │ -
214 return (prefix.size() == 0) ? size() : 0;
│ │ │ │ -
215 }
│ │ │ │ -
│ │ │ │ -
216
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
218 {
│ │ │ │ -
219 return size();
│ │ │ │ -
220 }
│ │ │ │ -
│ │ │ │ -
221
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
223 {
│ │ │ │ -
224 size_type result = 0;
│ │ │ │ -
225 for (auto&& type : gridView_.indexSet().types(0))
│ │ │ │ -
226 {
│ │ │ │ -
227 size_type numEdges = referenceElement<typename GV::ctype,dim>(type).size(dim-1);
│ │ │ │ -
228 result = std::max(result, numEdges);
│ │ │ │ -
229 }
│ │ │ │ -
230
│ │ │ │ -
231 return result;
│ │ │ │ -
232 }
│ │ │ │ + │ │ │ │ +
156{
│ │ │ │ +
157 if constexpr (maxOrder==0) {
│ │ │ │ +
158 // If maxOrder== 0 we just need the given SignatureTag
│ │ │ │ +
159 return std::make_tuple(tag);
│ │ │ │ +
160 } else {
│ │ │ │ +
161 // else we first construct the tail tuple with SignatureTags for derivatives
│ │ │ │ +
162 // of order 1 to maxOrder
│ │ │ │ +
163 auto tailTagsTuple = derivativeSignatureTags<std::size_t(maxOrder-1)>(derivativeSignatureTag(tag));
│ │ │ │ +
164 // and prepend this with the given SignatureTag.
│ │ │ │ +
165 // This is done by unpacking the tail tuple with apply().
│ │ │ │ +
166 return std::apply([&](auto&&... tailTags){
│ │ │ │ +
167 return std::make_tuple(tag, tailTags...);
│ │ │ │ +
168 }, tailTagsTuple);
│ │ │ │ +
169 }
│ │ │ │ +
170}
│ │ │ │
│ │ │ │ -
233
│ │ │ │ -
237 template<typename It>
│ │ │ │ -
│ │ │ │ -
238 It indices(const Node& node, It it) const
│ │ │ │ -
239 {
│ │ │ │ -
240 const auto& element = node.element();
│ │ │ │ -
241
│ │ │ │ -
242 // throw if Element is not of predefined type
│ │ │ │ -
243 if (not(element.type().isCube()) and not(element.type().isSimplex()))
│ │ │ │ -
244 DUNE_THROW(NotImplemented, "NedelecBasis only implemented for cube and simplex elements.");
│ │ │ │ -
245
│ │ │ │ -
246 for(std::size_t i=0, end=node.size(); i<end; ++i, ++it)
│ │ │ │ -
247 {
│ │ │ │ -
248 Dune::LocalKey localKey = node.finiteElement().localCoefficients().localKey(i);
│ │ │ │ -
249 *it = { mapper_.subIndex(element, localKey.subEntity(), localKey.codim()) + localKey.index() };
│ │ │ │ -
250 }
│ │ │ │ -
251
│ │ │ │ -
252 return it;
│ │ │ │ -
253 }
│ │ │ │ -
│ │ │ │ -
254
│ │ │ │ -
255protected:
│ │ │ │ - │ │ │ │ -
257 FiniteElementMap finiteElementMap_;
│ │ │ │ -
258 Mapper mapper_;
│ │ │ │ -
259};
│ │ │ │ -
│ │ │ │ -
260
│ │ │ │ -
261
│ │ │ │ -
262
│ │ │ │ -
263template<typename GV, typename Range, size_t kind, int order>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
265 public LeafBasisNode
│ │ │ │ -
266{
│ │ │ │ -
267 static const int dim = GV::dimension;
│ │ │ │ -
268
│ │ │ │ -
269public:
│ │ │ │ -
270
│ │ │ │ -
271 using size_type = std::size_t;
│ │ │ │ -
272 using Element = typename GV::template Codim<0>::Entity;
│ │ │ │ -
273 static_assert(kind==1, "Only Nedelec elements of the first kind are implemented!");
│ │ │ │ -
274 using FiniteElementMap = typename Impl::Nedelec1stKindLocalFiniteElementMap<GV, dim, Range, order>;
│ │ │ │ -
275 using FiniteElement = Impl::GlobalValuedLocalFiniteElement<Impl::CovariantPiolaTransformator,
│ │ │ │ -
276 typename FiniteElementMap::FiniteElement,
│ │ │ │ -
277 Element>;
│ │ │ │ -
278
│ │ │ │ -
│ │ │ │ -
279 NedelecNode(const FiniteElementMap* finiteElementMap) :
│ │ │ │ -
280 element_(nullptr),
│ │ │ │ -
281 finiteElementMap_(finiteElementMap)
│ │ │ │ -
282 { }
│ │ │ │ -
│ │ │ │ -
283
│ │ │ │ -
│ │ │ │ -
285 const Element& element() const
│ │ │ │ -
286 {
│ │ │ │ -
287 return *element_;
│ │ │ │ -
288 }
│ │ │ │ -
│ │ │ │ -
289
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
295 {
│ │ │ │ -
296 return finiteElement_;
│ │ │ │ -
297 }
│ │ │ │ -
│ │ │ │ -
298
│ │ │ │ -
│ │ │ │ -
300 void bind(const Element& e)
│ │ │ │ -
301 {
│ │ │ │ -
302 element_ = &e;
│ │ │ │ -
303 finiteElement_.bind((finiteElementMap_->find(*element_)), e);
│ │ │ │ -
304 this->setSize(finiteElement_.size());
│ │ │ │ -
305 }
│ │ │ │ -
│ │ │ │ -
306
│ │ │ │ -
307protected:
│ │ │ │ -
308
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
312};
│ │ │ │ -
│ │ │ │ -
313
│ │ │ │ -
314
│ │ │ │ -
315
│ │ │ │ -
316namespace BasisFactory {
│ │ │ │ -
317
│ │ │ │ -
327template<std::size_t kind, std::size_t order, typename Range=double>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
329{
│ │ │ │ -
330 return [](const auto& gridView) {
│ │ │ │ -
331 return NedelecPreBasis<std::decay_t<decltype(gridView)>, Range, kind, order>(gridView);
│ │ │ │ -
332 };
│ │ │ │ -
333}
│ │ │ │ -
│ │ │ │ -
334
│ │ │ │ -
335} // end namespace BasisFactory
│ │ │ │ -
336
│ │ │ │ -
337
│ │ │ │ -
338
│ │ │ │ -
339// *****************************************************************************
│ │ │ │ -
340// This is the actual global basis implementation based on the reusable parts.
│ │ │ │ -
341// *****************************************************************************
│ │ │ │ -
342
│ │ │ │ -
350template<typename GV, std::size_t kind, std::size_t order, typename Range=double>
│ │ │ │ - │ │ │ │ -
352
│ │ │ │ -
353} // end namespace Dune::Functions
│ │ │ │ -
354
│ │ │ │ -
355
│ │ │ │ -
356#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
auto nedelec()
Create a pre-basis factory that can create a Nédélec pre-basis.
Definition nedelecbasis.hh:328
│ │ │ │ -
Definition polynomial.hh:11
│ │ │ │ -
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:46
│ │ │ │ -
Definition nedelecbasis.hh:266
│ │ │ │ -
const FiniteElementMap * finiteElementMap_
Definition nedelecbasis.hh:311
│ │ │ │ -
FiniteElement finiteElement_
Definition nedelecbasis.hh:309
│ │ │ │ -
Impl::GlobalValuedLocalFiniteElement< Impl::CovariantPiolaTransformator, typename FiniteElementMap::FiniteElement, Element > FiniteElement
Definition nedelecbasis.hh:277
│ │ │ │ -
void bind(const Element &e)
Bind to element.
Definition nedelecbasis.hh:300
│ │ │ │ -
const Element & element() const
Return current element, throw if unbound.
Definition nedelecbasis.hh:285
│ │ │ │ -
typename GV::template Codim< 0 >::Entity Element
Definition nedelecbasis.hh:272
│ │ │ │ -
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition nedelecbasis.hh:294
│ │ │ │ -
NedelecNode(const FiniteElementMap *finiteElementMap)
Definition nedelecbasis.hh:279
│ │ │ │ -
typename Impl::Nedelec1stKindLocalFiniteElementMap< GV, dim, Range, order > FiniteElementMap
Definition nedelecbasis.hh:274
│ │ │ │ -
const Element * element_
Definition nedelecbasis.hh:310
│ │ │ │ -
std::size_t size_type
Definition nedelecbasis.hh:271
│ │ │ │ -
Definition nedelecbasis.hh:136
│ │ │ │ -
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 nedelecbasis.hh:238
│ │ │ │ -
size_type size(const SizePrefix &prefix) const
Return number possible values for next position in multi index.
Definition nedelecbasis.hh:211
│ │ │ │ -
std::size_t size_type
Definition nedelecbasis.hh:146
│ │ │ │ -
NedelecPreBasis(const GridView &gv)
Constructor for a given grid view object.
Definition nedelecbasis.hh:155
│ │ │ │ -
GV GridView
The grid view that the FE space is defined on.
Definition nedelecbasis.hh:145
│ │ │ │ -
size_type dimension() const
Definition nedelecbasis.hh:217
│ │ │ │ -
static constexpr size_type maxMultiIndexSize
Definition nedelecbasis.hh:150
│ │ │ │ -
static constexpr size_type multiIndexBufferSize
Definition nedelecbasis.hh:152
│ │ │ │ -
GridView gridView_
Definition nedelecbasis.hh:256
│ │ │ │ -
FiniteElementMap finiteElementMap_
Definition nedelecbasis.hh:257
│ │ │ │ -
static constexpr size_type minMultiIndexSize
Definition nedelecbasis.hh:151
│ │ │ │ -
void initializeIndices()
Definition nedelecbasis.hh:179
│ │ │ │ -
void update(const GridView &gv)
Definition nedelecbasis.hh:190
│ │ │ │ -
size_type maxNodeSize() const
Definition nedelecbasis.hh:222
│ │ │ │ -
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition nedelecbasis.hh:184
│ │ │ │ -
Node makeNode() const
Create tree node.
Definition nedelecbasis.hh:199
│ │ │ │ -
size_type size() const
Definition nedelecbasis.hh:204
│ │ │ │ -
Mapper mapper_
Definition nedelecbasis.hh:258
│ │ │ │ -
size_type size() const
Definition nodes.hh:142
│ │ │ │ -
void setSize(const size_type size)
Definition nodes.hh:164
│ │ │ │ -
Definition nodes.hh:186
│ │ │ │ +
171
│ │ │ │ +
172
│ │ │ │ +
173
│ │ │ │ +
174} // namespace Functions
│ │ │ │ +
175} // namespace Dune
│ │ │ │ +
176
│ │ │ │ +
177#endif // DUNE_FUNCTIONS_COMMON_SIGNATURE_HH
│ │ │ │ + │ │ │ │ +
auto derivativeSignatureTag(SignatureTag< Range(Domain), DerivativeTraits > tag)
Construct SignatureTag for derivative.
Definition signature.hh:133
│ │ │ │ +
auto derivativeSignatureTags(Dune::Functions::SignatureTag< Signature, DerivativeTraits > tag)
Construct SignatureTags for derivatives.
Definition signature.hh:155
│ │ │ │ +
Definition polynomial.hh:10
│ │ │ │ +
Helper class to check that F is callable.
Definition signature.hh:20
│ │ │ │ +
Helper class to deduce the signature of a callable.
Definition signature.hh:56
│ │ │ │ +
Definition signature.hh:102
│ │ │ │ +
DerivativeTraitsT< T > DerivativeTraits
Definition signature.hh:119
│ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── encoding │ │ │ │ │ @@ -1 +1 @@ │ │ │ │ │ -utf-8 │ │ │ │ │ +us-ascii │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,496 +1,178 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -nedelecbasis.hh │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_COMMON_SIGNATURE_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_COMMON_SIGNATURE_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ 8 │ │ │ │ │ -9#include │ │ │ │ │ -10#include │ │ │ │ │ -11 │ │ │ │ │ -12#include │ │ │ │ │ -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_/_d_e_f_a_u_l_t_g_l_o_b_a_l_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_/ │ │ │ │ │ -_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> │ │ │ │ │ -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_/_n_o_d_e_s_._h_h> │ │ │ │ │ -18 │ │ │ │ │ -19namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ │ -20{ │ │ │ │ │ +9#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> │ │ │ │ │ +10 │ │ │ │ │ +11namespace _D_u_n_e { │ │ │ │ │ +12namespace Functions { │ │ │ │ │ +13 │ │ │ │ │ +19template │ │ │ │ │ +_2_0struct _I_s_C_a_l_l_a_b_l_e; │ │ │ │ │ 21 │ │ │ │ │ -22namespace Impl │ │ │ │ │ -23{ │ │ │ │ │ -24 template │ │ │ │ │ -25 class Nedelec1stKindLocalFiniteElementMap │ │ │ │ │ -26 { │ │ │ │ │ -27 using D = typename GV::ctype; │ │ │ │ │ -28 constexpr static bool hasFixedElementType = Capabilities:: │ │ │ │ │ -hasSingleGeometryType::v; │ │ │ │ │ -29 │ │ │ │ │ -30 using CubeFiniteElement = │ │ │ │ │ -Nedelec1stKindCubeLocalFiniteElement; │ │ │ │ │ -31 using SimplexFiniteElement = │ │ │ │ │ -Nedelec1stKindSimplexLocalFiniteElement; │ │ │ │ │ -32 │ │ │ │ │ -33 public: │ │ │ │ │ -34 │ │ │ │ │ -35 using T = LocalBasisTraits, R, dim, │ │ │ │ │ -FieldVector, FieldMatrix >; │ │ │ │ │ +22#ifndef DOXYGEN │ │ │ │ │ +23template │ │ │ │ │ +24struct _I_s_C_a_l_l_a_b_l_e │ │ │ │ │ +25{ │ │ │ │ │ +26 struct yes { std::size_t dummy[2]; }; │ │ │ │ │ +27 struct no { std::size_t dummy[1]; }; │ │ │ │ │ +28 │ │ │ │ │ +29 template │ │ │ │ │ +30 static yes test(const decltype(&C::operator()) *); │ │ │ │ │ +31 template │ │ │ │ │ +32 static no test(...); │ │ │ │ │ +33 │ │ │ │ │ +34 enum { value = (sizeof(test(0)) == sizeof(yes)) }; │ │ │ │ │ +35}; │ │ │ │ │ 36 │ │ │ │ │ -37 constexpr static unsigned int topologyId = Capabilities:: │ │ │ │ │ -hasSingleGeometryType::topologyId; // meaningless if │ │ │ │ │ -hasFixedElementType is false │ │ │ │ │ -38 constexpr static GeometryType type = GeometryType(topologyId, GV:: │ │ │ │ │ -dimension); │ │ │ │ │ -39 │ │ │ │ │ -40 using FiniteElement = std::conditional_t, │ │ │ │ │ -42 LocalFiniteElementVariant >; │ │ │ │ │ -43 │ │ │ │ │ -44 static std::size_t numVariants(GeometryType type) │ │ │ │ │ -45 { │ │ │ │ │ -46 if (order!=1) // I am not sure whether the formula below is correct for all │ │ │ │ │ -orders. │ │ │ │ │ -47 DUNE_THROW(NotImplemented, "Only Nedelec elements of order 1 are │ │ │ │ │ -implemented!"); │ │ │ │ │ -48 │ │ │ │ │ -49 auto numEdges = referenceElement(type).size(dim-1); │ │ │ │ │ -50 return power(2,numEdges); │ │ │ │ │ -51 } │ │ │ │ │ -52 │ │ │ │ │ -53 Nedelec1stKindLocalFiniteElementMap(const GV& gv) │ │ │ │ │ -54 : elementMapper_(gv, mcmgElementLayout()), │ │ │ │ │ -55 orientation_(gv.size(0)) │ │ │ │ │ -56 { │ │ │ │ │ -57 // create all variants │ │ │ │ │ -58 if constexpr (hasFixedElementType) │ │ │ │ │ -59 { │ │ │ │ │ -60 variants_.resize(numVariants(type)); │ │ │ │ │ -61 for (size_t i = 0; i < numVariants(type); i++) │ │ │ │ │ -62 variants_[i] = FiniteElement(i); │ │ │ │ │ -63 } │ │ │ │ │ -64 else │ │ │ │ │ -65 { │ │ │ │ │ -66 // for mixed grids add offset for cubes │ │ │ │ │ -67 variants_.resize(numVariants(GeometryTypes::simplex(dim)) + numVariants │ │ │ │ │ -(GeometryTypes::cube(dim))); │ │ │ │ │ -68 for (size_t i = 0; i < numVariants(GeometryTypes::simplex(dim)); i++) │ │ │ │ │ -69 variants_[i] = SimplexFiniteElement(i); │ │ │ │ │ -70 for (size_t i = 0; i < numVariants(GeometryTypes::cube(dim)); i++) │ │ │ │ │ -71 variants_[i + numVariants(GeometryTypes::simplex(dim))] = CubeFiniteElement │ │ │ │ │ -(i); │ │ │ │ │ -72 } │ │ │ │ │ -73 │ │ │ │ │ -74 │ │ │ │ │ -75 // compute orientation for all elements │ │ │ │ │ -76 const auto& indexSet = gv.indexSet(); │ │ │ │ │ -77 │ │ │ │ │ -78 for(const auto& element : elements(gv)) │ │ │ │ │ -79 { │ │ │ │ │ -80 const auto& refElement = referenceElement(element); │ │ │ │ │ -81 auto elementIndex = elementMapper_.index(element); │ │ │ │ │ -82 orientation_[elementIndex] = 0; │ │ │ │ │ -83 │ │ │ │ │ -84 for (std::size_t i=0; i │ │ │ │ │ +38struct IsCallable │ │ │ │ │ +39{ │ │ │ │ │ +40 enum { value = true }; │ │ │ │ │ +41}; │ │ │ │ │ +42 │ │ │ │ │ +43template │ │ │ │ │ +44struct IsCallable │ │ │ │ │ +45{ │ │ │ │ │ +46 enum { value = true }; │ │ │ │ │ +47}; │ │ │ │ │ +48#endif │ │ │ │ │ +49 │ │ │ │ │ +55template::value > │ │ │ │ │ +_5_6struct _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s {}; │ │ │ │ │ +57 │ │ │ │ │ +58#ifndef DOXYGEN │ │ │ │ │ +60template │ │ │ │ │ +61struct _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s │ │ │ │ │ +62 : public _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s │ │ │ │ │ +63{}; │ │ │ │ │ +64 │ │ │ │ │ +66template │ │ │ │ │ +67struct SignatureTraits │ │ │ │ │ +68 : public SignatureTraits │ │ │ │ │ +69{}; │ │ │ │ │ +70 │ │ │ │ │ +72template │ │ │ │ │ +73struct SignatureTraits │ │ │ │ │ +74 : public SignatureTraits │ │ │ │ │ +75{}; │ │ │ │ │ +76 │ │ │ │ │ +78template │ │ │ │ │ +79struct SignatureTraits │ │ │ │ │ +80 : public SignatureTraits │ │ │ │ │ +81{}; │ │ │ │ │ +82 │ │ │ │ │ +84template │ │ │ │ │ +85struct SignatureTraits │ │ │ │ │ +86{ │ │ │ │ │ +87 using Range = R; │ │ │ │ │ +88 using Domain = D; │ │ │ │ │ 89 │ │ │ │ │ -90 // Global vertex indices within the grid │ │ │ │ │ -91 auto globalV0 = indexSet.subIndex(element,localV0,dim); │ │ │ │ │ -92 auto globalV1 = indexSet.subIndex(element,localV1,dim); │ │ │ │ │ -93 │ │ │ │ │ -94 if ( (localV0globalV1) || (localV0>localV1 && │ │ │ │ │ -globalV0::type; │ │ │ │ │ +91 using RawDomain = typename std::decay::type; │ │ │ │ │ +92 │ │ │ │ │ +93 using RawSignature = RawRange(RawDomain); │ │ │ │ │ +94 │ │ │ │ │ +95 template class DerivativeTraits=DefaultDerivativeTraits> │ │ │ │ │ +96 using DerivativeSignature = typename DerivativeTraits::Range │ │ │ │ │ +(Domain); │ │ │ │ │ +97}; │ │ │ │ │ +98#endif │ │ │ │ │ +99 │ │ │ │ │ +100 │ │ │ │ │ +101template class │ │ │ │ │ +DerivativeTraits=DefaultDerivativeTraits> │ │ │ │ │ +_1_0_2struct _S_i_g_n_a_t_u_r_e_T_a_g; │ │ │ │ │ 103 │ │ │ │ │ -104 template │ │ │ │ │ -105 const auto& find(const Element& element) const │ │ │ │ │ -106 { │ │ │ │ │ -107 return variants_[orientation_[elementMapper_.index(element)]]; │ │ │ │ │ -108 } │ │ │ │ │ -109 │ │ │ │ │ -110 private: │ │ │ │ │ -111 std::vector variants_; │ │ │ │ │ -112 const Dune::MultipleCodimMultipleGeomTypeMapper elementMapper_; │ │ │ │ │ -113 std::vector orientation_; │ │ │ │ │ -114 }; │ │ │ │ │ -115 │ │ │ │ │ -116 │ │ │ │ │ -117} // namespace Impl │ │ │ │ │ -118 │ │ │ │ │ -119 │ │ │ │ │ -120/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -121// This is the reusable part of the basis. It contains │ │ │ │ │ -122// │ │ │ │ │ -123// NedelecPreBasis │ │ │ │ │ -124// NedelecNode │ │ │ │ │ -125// │ │ │ │ │ -126// The pre-basis allows to create the others and is the owner of possible │ │ │ │ │ -shared │ │ │ │ │ -127// state. These components do _not_ depend on the global basis and local │ │ │ │ │ -view │ │ │ │ │ -128// and can be used without a global basis. │ │ │ │ │ -129/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -130 │ │ │ │ │ -131template │ │ │ │ │ -132class NedelecNode; │ │ │ │ │ -133 │ │ │ │ │ -134template │ │ │ │ │ -_1_3_5class _N_e_d_e_l_e_c_P_r_e_B_a_s_i_s │ │ │ │ │ -136{ │ │ │ │ │ -137 static const int dim = GV::dimension; │ │ │ │ │ -138 static_assert(kind==1, "Only the Nedelec basis of the first kind is │ │ │ │ │ -currently implemented!"); │ │ │ │ │ -139 using FiniteElementMap = typename Impl:: │ │ │ │ │ -Nedelec1stKindLocalFiniteElementMap; │ │ │ │ │ +113template class DerivativeTraitsT> │ │ │ │ │ +_1_1_4struct _S_i_g_n_a_t_u_r_e_T_a_g │ │ │ │ │ +115{ │ │ │ │ │ +_1_1_6 using _S_i_g_n_a_t_u_r_e = Range(Domain); │ │ │ │ │ +117 │ │ │ │ │ +118 template │ │ │ │ │ +_1_1_9 using _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s = DerivativeTraitsT; │ │ │ │ │ +120}; │ │ │ │ │ +121 │ │ │ │ │ +122 │ │ │ │ │ +123 │ │ │ │ │ +132template class DerivativeTraits> │ │ │ │ │ +_1_3_3auto _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) │ │ │ │ │ +134{ │ │ │ │ │ +135 using DerivativeRange = typename DerivativeTraits::Range; │ │ │ │ │ +136 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_>(); │ │ │ │ │ +137} │ │ │ │ │ +138 │ │ │ │ │ +139 │ │ │ │ │ 140 │ │ │ │ │ -141 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper; │ │ │ │ │ -142public: │ │ │ │ │ -143 │ │ │ │ │ -_1_4_5 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ │ -_1_4_6 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ -147 │ │ │ │ │ -_1_4_8 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_>; │ │ │ │ │ -149 │ │ │ │ │ -_1_5_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 = 1; │ │ │ │ │ -_1_5_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 = 1; │ │ │ │ │ -_1_5_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 = 1; │ │ │ │ │ -153 │ │ │ │ │ -_1_5_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) : │ │ │ │ │ -156 _g_r_i_d_V_i_e_w__(gv), │ │ │ │ │ -157 _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__(gv), │ │ │ │ │ -158 _m_a_p_p_e_r__(_g_r_i_d_V_i_e_w__, mcmgLayout(Dim<1>{})) │ │ │ │ │ -159 { │ │ │ │ │ -160 if (kind!=1) │ │ │ │ │ -161 DUNE_THROW(NotImplemented, "Only Nedelec elements of the first kind are │ │ │ │ │ -implemented!"); │ │ │ │ │ -162 │ │ │ │ │ -163 // There is no inherent reason why the basis shouldn't work for grids with │ │ │ │ │ -more than two │ │ │ │ │ -164 // element types. Somebody simply has to sit down and implement the missing │ │ │ │ │ -bits. │ │ │ │ │ -165 if (gv.indexSet().types(0).size() > 2) │ │ │ │ │ -166 DUNE_THROW(NotImplemented, "Nédélec basis is only implemented for grids │ │ │ │ │ -with simplex and cube elements"); │ │ │ │ │ -167 │ │ │ │ │ -168 for(auto type : gv.indexSet().types(0)) │ │ │ │ │ -169 if (!type.isSimplex() && !type.isCube()) │ │ │ │ │ -170 DUNE_THROW(NotImplemented, "Nédélec basis is only implemented for grids │ │ │ │ │ -with simplex or cube elements."); │ │ │ │ │ +154template class │ │ │ │ │ +DerivativeTraits> │ │ │ │ │ +_1_5_5auto _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) │ │ │ │ │ +156{ │ │ │ │ │ +157 if constexpr (maxOrder==0) { │ │ │ │ │ +158 // If maxOrder== 0 we just need the given SignatureTag │ │ │ │ │ +159 return std::make_tuple(tag); │ │ │ │ │ +160 } else { │ │ │ │ │ +161 // else we first construct the tail tuple with SignatureTags for │ │ │ │ │ +derivatives │ │ │ │ │ +162 // of order 1 to maxOrder │ │ │ │ │ +163 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)); │ │ │ │ │ +164 // and prepend this with the given SignatureTag. │ │ │ │ │ +165 // This is done by unpacking the tail tuple with apply(). │ │ │ │ │ +166 return std::apply([&](auto&&... tailTags){ │ │ │ │ │ +167 return std::make_tuple(tag, tailTags...); │ │ │ │ │ +168 }, tailTagsTuple); │ │ │ │ │ +169 } │ │ │ │ │ +170} │ │ │ │ │ 171 │ │ │ │ │ -172 if (order>1) │ │ │ │ │ -173 DUNE_THROW(NotImplemented, "Only first-order elements are implemented"); │ │ │ │ │ -174 │ │ │ │ │ -175 if (dim!=2 && dim!=3) │ │ │ │ │ -176 DUNE_THROW(NotImplemented, "Only 2d and 3d Nédélec elements are │ │ │ │ │ -implemented"); │ │ │ │ │ -177 } │ │ │ │ │ -178 │ │ │ │ │ -_1_7_9 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ │ -180 {} │ │ │ │ │ -181 │ │ │ │ │ -_1_8_4 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ │ -185 { │ │ │ │ │ -186 return _g_r_i_d_V_i_e_w__; │ │ │ │ │ -187 } │ │ │ │ │ -188 │ │ │ │ │ -189 /* \brief Update the stored grid view, to be called if the grid has changed │ │ │ │ │ -*/ │ │ │ │ │ -_1_9_0 void _u_p_d_a_t_e (const _G_r_i_d_V_i_e_w& gv) │ │ │ │ │ -191 { │ │ │ │ │ -192 _g_r_i_d_V_i_e_w__ = gv; │ │ │ │ │ -193 _m_a_p_p_e_r__.update(_g_r_i_d_V_i_e_w__); │ │ │ │ │ -194 } │ │ │ │ │ -195 │ │ │ │ │ -_1_9_9 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ │ -200 { │ │ │ │ │ -201 return _N_o_d_e{&_f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__}; │ │ │ │ │ -202 } │ │ │ │ │ -203 │ │ │ │ │ -_2_0_4 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ │ -205 { │ │ │ │ │ -206 return _m_a_p_p_e_r__.size(); │ │ │ │ │ -207 } │ │ │ │ │ -208 │ │ │ │ │ -210 template │ │ │ │ │ -_2_1_1 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix) const │ │ │ │ │ -212 { │ │ │ │ │ -213 assert(prefix.size() == 0 || prefix.size() == 1); │ │ │ │ │ -214 return (prefix.size() == 0) ? _s_i_z_e() : 0; │ │ │ │ │ -215 } │ │ │ │ │ -216 │ │ │ │ │ -_2_1_7 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ │ -218 { │ │ │ │ │ -219 return _s_i_z_e(); │ │ │ │ │ -220 } │ │ │ │ │ -221 │ │ │ │ │ -_2_2_2 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ │ -223 { │ │ │ │ │ -224 _s_i_z_e___t_y_p_e result = 0; │ │ │ │ │ -225 for (auto&& type : _g_r_i_d_V_i_e_w__.indexSet().types(0)) │ │ │ │ │ -226 { │ │ │ │ │ -227 _s_i_z_e___t_y_p_e numEdges = referenceElement(type).size │ │ │ │ │ -(dim-1); │ │ │ │ │ -228 result = std::max(result, numEdges); │ │ │ │ │ -229 } │ │ │ │ │ -230 │ │ │ │ │ -231 return result; │ │ │ │ │ -232 } │ │ │ │ │ -233 │ │ │ │ │ -237 template │ │ │ │ │ -_2_3_8 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ │ -239 { │ │ │ │ │ -240 const auto& element = node._e_l_e_m_e_n_t(); │ │ │ │ │ -241 │ │ │ │ │ -242 // throw if Element is not of predefined type │ │ │ │ │ -243 if (not(element.type().isCube()) and not(element.type().isSimplex())) │ │ │ │ │ -244 DUNE_THROW(NotImplemented, "NedelecBasis only implemented for cube and │ │ │ │ │ -simplex elements."); │ │ │ │ │ -245 │ │ │ │ │ -246 for(std::size_t i=0, end=node._s_i_z_e(); i │ │ │ │ │ -_2_6_4class _N_e_d_e_l_e_c_N_o_d_e : │ │ │ │ │ -265 public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ │ -266{ │ │ │ │ │ -267 static const int dim = GV::dimension; │ │ │ │ │ -268 │ │ │ │ │ -269public: │ │ │ │ │ -270 │ │ │ │ │ -_2_7_1 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ -_2_7_2 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ │ -273 static_assert(kind==1, "Only Nedelec elements of the first kind are │ │ │ │ │ -implemented!"); │ │ │ │ │ -_2_7_4 using _F_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p = typename Impl:: │ │ │ │ │ -Nedelec1stKindLocalFiniteElementMap; │ │ │ │ │ -_2_7_5 using _F_i_n_i_t_e_E_l_e_m_e_n_t = Impl::GlobalValuedLocalFiniteElement; │ │ │ │ │ -278 │ │ │ │ │ -_2_7_9 _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) : │ │ │ │ │ -280 _e_l_e_m_e_n_t__(nullptr), │ │ │ │ │ -281 _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__(finiteElementMap) │ │ │ │ │ -282 { } │ │ │ │ │ -283 │ │ │ │ │ -_2_8_5 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ │ -286 { │ │ │ │ │ -287 return *_e_l_e_m_e_n_t__; │ │ │ │ │ -288 } │ │ │ │ │ -289 │ │ │ │ │ -_2_9_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 │ │ │ │ │ -295 { │ │ │ │ │ -296 return _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ │ -297 } │ │ │ │ │ -298 │ │ │ │ │ -_3_0_0 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ │ -301 { │ │ │ │ │ -302 _e_l_e_m_e_n_t__ = &e; │ │ │ │ │ -303 _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); │ │ │ │ │ -304 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__.size()); │ │ │ │ │ -305 } │ │ │ │ │ -306 │ │ │ │ │ -307protected: │ │ │ │ │ -308 │ │ │ │ │ -_3_0_9 _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_1_0 const _E_l_e_m_e_n_t* _e_l_e_m_e_n_t__; │ │ │ │ │ -_3_1_1 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__; │ │ │ │ │ -312}; │ │ │ │ │ -313 │ │ │ │ │ -314 │ │ │ │ │ -315 │ │ │ │ │ -316namespace BasisFactory { │ │ │ │ │ -317 │ │ │ │ │ -327template │ │ │ │ │ -_3_2_8auto _n_e_d_e_l_e_c() │ │ │ │ │ -329{ │ │ │ │ │ -330 return [](const auto& gridView) { │ │ │ │ │ -331 return _N_e_d_e_l_e_c_P_r_e_B_a_s_i_s, Range, kind, │ │ │ │ │ -order>(gridView); │ │ │ │ │ -332 }; │ │ │ │ │ -333} │ │ │ │ │ -334 │ │ │ │ │ -335} // end namespace BasisFactory │ │ │ │ │ -336 │ │ │ │ │ -337 │ │ │ │ │ -338 │ │ │ │ │ -339/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -340// This is the actual global basis implementation based on the reusable │ │ │ │ │ -parts. │ │ │ │ │ -341/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -342 │ │ │ │ │ -350template │ │ │ │ │ -_3_5_1using _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_ _> >; │ │ │ │ │ -352 │ │ │ │ │ -353} // end namespace Dune::Functions │ │ │ │ │ -354 │ │ │ │ │ -355 │ │ │ │ │ -356#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 │ │ │ │ │ -_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ │ -_n_o_d_e_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_:_:_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:328 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ │ -DDeeffiinniittiioonn polynomial.hh:11 │ │ │ │ │ -_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:46 │ │ │ │ │ -_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:266 │ │ │ │ │ -_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:311 │ │ │ │ │ -_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:309 │ │ │ │ │ -_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:277 │ │ │ │ │ -_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:300 │ │ │ │ │ -_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:285 │ │ │ │ │ -_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:272 │ │ │ │ │ -_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:294 │ │ │ │ │ -_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:279 │ │ │ │ │ -_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:274 │ │ │ │ │ -_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:310 │ │ │ │ │ -_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:271 │ │ │ │ │ -_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:136 │ │ │ │ │ -_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_:_:_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 nedelecbasis.hh:238 │ │ │ │ │ -_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 │ │ │ │ │ -size_type size(const SizePrefix &prefix) const │ │ │ │ │ -Return number possible values for next position in multi index. │ │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:211 │ │ │ │ │ -_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:146 │ │ │ │ │ -_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:155 │ │ │ │ │ -_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:145 │ │ │ │ │ -_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_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ │ -size_type dimension() const │ │ │ │ │ -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_:_:_m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ -static constexpr size_type maxMultiIndexSize │ │ │ │ │ -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_:_:_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 nedelecbasis.hh:152 │ │ │ │ │ -_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__ │ │ │ │ │ -GridView gridView_ │ │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:256 │ │ │ │ │ -_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:257 │ │ │ │ │ -_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_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ -static constexpr size_type minMultiIndexSize │ │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:151 │ │ │ │ │ -_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_:_:_i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ │ -void initializeIndices() │ │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:179 │ │ │ │ │ -_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) │ │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:190 │ │ │ │ │ -_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_x_N_o_d_e_S_i_z_e │ │ │ │ │ -size_type maxNodeSize() const │ │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:222 │ │ │ │ │ -_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 │ │ │ │ │ -const GridView & gridView() const │ │ │ │ │ -Obtain the grid view that the basis is defined on. │ │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:184 │ │ │ │ │ -_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:199 │ │ │ │ │ -_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 │ │ │ │ │ -size_type size() const │ │ │ │ │ -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_:_:_m_a_p_p_e_r__ │ │ │ │ │ -Mapper mapper_ │ │ │ │ │ -DDeeffiinniittiioonn nedelecbasis.hh:258 │ │ │ │ │ -_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 │ │ │ │ │ -DDeeffiinniittiioonn nodes.hh:142 │ │ │ │ │ -_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:164 │ │ │ │ │ -_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:186 │ │ │ │ │ +172 │ │ │ │ │ +173 │ │ │ │ │ +174} // namespace Functions │ │ │ │ │ +175} // namespace Dune │ │ │ │ │ +176 │ │ │ │ │ +177#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:133 │ │ │ │ │ +_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:155 │ │ │ │ │ +_D_u_n_e │ │ │ │ │ +DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ +_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:20 │ │ │ │ │ +_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:56 │ │ │ │ │ +_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:102 │ │ │ │ │ +_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:119 │ │ │ │ │ +_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:116 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00044.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: subspacebasis.hh File Reference │ │ │ │ +dune-functions: type_traits.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,61 +65,52 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces | │ │ │ │ -Functions
│ │ │ │ -
subspacebasis.hh File Reference
│ │ │ │ +Typedefs
│ │ │ │ +
type_traits.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <dune/common/reservedvector.hh>
│ │ │ │ +
#include <type_traits>
│ │ │ │ #include <dune/common/typeutilities.hh>
│ │ │ │ -#include <dune/common/concept.hh>
│ │ │ │ -#include <dune/functions/common/type_traits.hh>
│ │ │ │ -#include <dune/functions/functionspacebases/subspacelocalview.hh>
│ │ │ │ -#include <dune/functions/functionspacebases/concepts.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::Functions::SubspaceBasis< RB, TP >
struct  Dune::Functions::HasStaticSize< T >
 Check if type is a statically sized container. More...
 
struct  Dune::Functions::StaticSize< T >
 Obtain size of statically sized container. 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())>, Impl::JoinTreePath_t< InnerTP, OuterTP > >
 
template<class RootBasis , class... PrefixTreeIndices>
auto Dune::Functions::subspaceBasis (const RootBasis &rootBasis, const TypeTree::HybridTreePath< 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)
 

│ │ │ │ +Typedefs

template<class T , class... Args>
using Dune::Functions::enableIfConstructible = typename std::enable_if< std::is_constructible< T, Args... >::value, int >::type
 Helper to constrain forwarding constructors.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,46 +1,32 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -subspacebasis.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s │ │ │ │ │ +type_traits.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> │ │ │ │ │ _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_ _> │ │ │ │ │ +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_<_ _T_ _> │ │ │ │ │ +  Obtain size of statically sized container. _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) -> _S_u_b_s_p_a_c_e_B_a_s_i_s< │ │ │ │ │ - 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 _S_u_b_s_p_a_c_e_B_a_s_i_s< RootRootBasis, │ │ │ │ │ - InnerTP > &rootBasis, const OuterTP &prefixPath) -> _S_u_b_s_p_a_c_e_B_a_s_i_s< std:: │ │ │ │ │ - decay_t< decltype(rootBasis.rootBasis())>, Impl::JoinTreePath_t< InnerTP, │ │ │ │ │ - OuterTP > > │ │ │ │ │ -  │ │ │ │ │ -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::HybridTreePath< 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) │ │ │ │ │ +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 = typename std::enable_if< std:: │ │ │ │ │ + is_constructible< T, Args... >::value, int >::type │ │ │ │ │ +  Helper to constrain forwarding constructors. │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00044_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: subspacebasis.hh Source File │ │ │ │ +dune-functions: type_traits.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,211 +70,108 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
subspacebasis.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACEBASIS_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACEBASIS_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH
│ │ │ │
5
│ │ │ │ -
6#include <dune/common/reservedvector.hh>
│ │ │ │ -
7#include <dune/common/typeutilities.hh>
│ │ │ │ -
8#include <dune/common/concept.hh>
│ │ │ │ +
6#include <type_traits>
│ │ │ │ +
7
│ │ │ │ +
8#include <dune/common/typeutilities.hh>
│ │ │ │
9
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ +
10namespace Dune {
│ │ │ │ +
11namespace Functions {
│ │ │ │ +
12
│ │ │ │
13
│ │ │ │ -
14
│ │ │ │ -
15
│ │ │ │ -
16namespace Dune {
│ │ │ │ -
17namespace Functions {
│ │ │ │ -
18
│ │ │ │ -
19
│ │ │ │ -
20
│ │ │ │ -
21namespace Impl {
│ │ │ │ -
22
│ │ │ │ -
23 template<class... Inner, class... Outer>
│ │ │ │ -
24 auto joinTreePaths(const TypeTree::HybridTreePath<Inner...>& inner, const TypeTree::HybridTreePath<Outer...> outer)
│ │ │ │ -
25 {
│ │ │ │ -
26 return TypeTree::HybridTreePath<Inner..., Outer...>(std::tuple_cat(inner._data, outer._data));
│ │ │ │ -
27 }
│ │ │ │ +
24template<class T, class... Args>
│ │ │ │ +
25using enableIfConstructible = typename std::enable_if<
│ │ │ │ +
26 std::is_constructible<T, Args...>::value, int>::type;
│ │ │ │ +
27
│ │ │ │
28
│ │ │ │ -
29 template<class InnerTP, class OuterTP>
│ │ │ │ -
30 using JoinTreePath_t = std::decay_t<decltype(joinTreePaths(std::declval<InnerTP>(), std::declval<OuterTP>()))>;
│ │ │ │ +
29
│ │ │ │ +
30namespace Imp {
│ │ │ │
31
│ │ │ │ -
32}
│ │ │ │ -
33
│ │ │ │ -
34
│ │ │ │ -
35
│ │ │ │ -
36template<class RB, class TP>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
38{
│ │ │ │ -
39public:
│ │ │ │ -
40
│ │ │ │ -
41 using RootBasis = RB;
│ │ │ │ -
42
│ │ │ │ -
43 using RootLocalView = typename RootBasis::LocalView;
│ │ │ │ -
44
│ │ │ │ -
45 using PrefixPath = TP;
│ │ │ │ -
46
│ │ │ │ -
48 using GridView = typename RootBasis::GridView;
│ │ │ │ -
49
│ │ │ │ -
51 using MultiIndex = typename RootBasis::MultiIndex;
│ │ │ │ -
52
│ │ │ │ -
53 using size_type = std::size_t;
│ │ │ │ -
54
│ │ │ │ - │ │ │ │ -
57
│ │ │ │ -
58 using SizePrefix = typename RootBasis::SizePrefix;
│ │ │ │ -
59
│ │ │ │ -
60
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
65 {}
│ │ │ │ -
│ │ │ │ -
66
│ │ │ │ -
72 template<class RootRootBasis, class InnerTP, class OuterTP>
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ -
75 {}
│ │ │ │ -
│ │ │ │ -
76
│ │ │ │ -
77
│ │ │ │ -
│ │ │ │ -
80 const GridView& gridView() const
│ │ │ │ -
81 {
│ │ │ │ -
82 return rootBasis_->gridView();
│ │ │ │ -
83 }
│ │ │ │ +
32 // As a last resort try if there's a static constexpr size()
│ │ │ │ +
33 template<class T>
│ │ │ │ +
34 constexpr auto staticSize(const T*, const PriorityTag<0>&)
│ │ │ │ +
35 -> decltype(std::integral_constant<std::size_t,T::size()>())
│ │ │ │ +
36 {
│ │ │ │ +
37 return {};
│ │ │ │ +
38 }
│ │ │ │ +
39
│ │ │ │ +
40 // Try if class has constexpr default constructor and size method
│ │ │ │ +
41 template<class T>
│ │ │ │ +
42 constexpr auto staticSize(const T*, const PriorityTag<1>&)
│ │ │ │ +
43 -> decltype(std::integral_constant<std::size_t,T().size()>())
│ │ │ │ +
44 {
│ │ │ │ +
45 return {};
│ │ │ │ +
46 }
│ │ │ │ +
47
│ │ │ │ +
48 // Try if tuple_size is implemented for class
│ │ │ │ +
49 template<class T>
│ │ │ │ +
50 constexpr auto staticSize(const T*, const PriorityTag<2>&)
│ │ │ │ +
51 -> decltype(std::integral_constant<std::size_t,std::tuple_size<T>::value>())
│ │ │ │ +
52 {
│ │ │ │ +
53 return {};
│ │ │ │ +
54 }
│ │ │ │ +
55
│ │ │ │ +
56 template<class T>
│ │ │ │ +
57 constexpr std::false_type hasStaticSize(const T* t, const PriorityTag<0>& p)
│ │ │ │ +
58 {
│ │ │ │ +
59 return {};
│ │ │ │ +
60 }
│ │ │ │ +
61
│ │ │ │ +
62 template<class T>
│ │ │ │ +
63 constexpr auto hasStaticSize(const T* t, const PriorityTag<1>& p)
│ │ │ │ +
64 -> decltype(staticSize(t ,PriorityTag<42>()), std::true_type())
│ │ │ │ +
65 {
│ │ │ │ +
66 return {};
│ │ │ │ +
67 }
│ │ │ │ +
68
│ │ │ │ +
69}
│ │ │ │ +
70
│ │ │ │ +
71
│ │ │ │ +
72
│ │ │ │ +
80template<class T>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
82 public decltype(Imp::hasStaticSize((typename std::decay<T>::type*)(nullptr), PriorityTag<42>()))
│ │ │ │ +
83{};
│ │ │ │
│ │ │ │
84
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
89 {
│ │ │ │ -
90 return rootBasis_->dimension();
│ │ │ │ -
91 }
│ │ │ │ -
│ │ │ │ -
92
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
95 {
│ │ │ │ -
96 return rootBasis_->size();
│ │ │ │ -
97 }
│ │ │ │ +
85
│ │ │ │ +
86
│ │ │ │ +
94template<class T>
│ │ │ │ +
│ │ │ │ +
95struct StaticSize :
│ │ │ │ +
96 public decltype(Imp::staticSize((typename std::decay<T>::type*)(nullptr), PriorityTag<42>()))
│ │ │ │ +
97{};
│ │ │ │
│ │ │ │
98
│ │ │ │ -
│ │ │ │ -
100 size_type size(const SizePrefix& prefix) const
│ │ │ │ -
101 {
│ │ │ │ -
102 return rootBasis_->size(prefix);
│ │ │ │ -
103 }
│ │ │ │ -
│ │ │ │ -
104
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
109 {
│ │ │ │ -
110 return LocalView(*this, prefixPath_);
│ │ │ │ -
111 }
│ │ │ │ -
│ │ │ │ -
112
│ │ │ │ -
│ │ │ │ -
113 const RootBasis& rootBasis() const
│ │ │ │ -
114 {
│ │ │ │ -
115 return *rootBasis_;
│ │ │ │ -
116 }
│ │ │ │ -
│ │ │ │ -
117
│ │ │ │ -
│ │ │ │ -
118 const PrefixPath& prefixPath() const
│ │ │ │ -
119 {
│ │ │ │ -
120 return prefixPath_;
│ │ │ │ -
121 }
│ │ │ │ -
│ │ │ │ -
122
│ │ │ │ -
123protected:
│ │ │ │ - │ │ │ │ - │ │ │ │ -
126};
│ │ │ │ -
│ │ │ │ -
127
│ │ │ │ -
128
│ │ │ │ -
129// CTAD guide for a non-SubspaceBasis root basis
│ │ │ │ -
130template<class RB, class TP>
│ │ │ │ -
131SubspaceBasis(const RB&, const TP) -> SubspaceBasis<RB, TP>;
│ │ │ │ -
132
│ │ │ │ -
133// CTAD guide for a SubspaceBasis root basis
│ │ │ │ -
134template<class RootRootBasis, class InnerTP, class OuterTP>
│ │ │ │ -
135SubspaceBasis(const SubspaceBasis<RootRootBasis, InnerTP>& rootBasis, const OuterTP& prefixPath)
│ │ │ │ -
136 -> SubspaceBasis<std::decay_t<decltype(rootBasis.rootBasis())>, Impl::JoinTreePath_t<InnerTP, OuterTP>>;
│ │ │ │ -
137
│ │ │ │ -
138
│ │ │ │ -
139
│ │ │ │ -
150template<class RootBasis, class... PrefixTreeIndices>
│ │ │ │ -
│ │ │ │ -
151auto subspaceBasis(const RootBasis& rootBasis, const TypeTree::HybridTreePath<PrefixTreeIndices...>& prefixPath)
│ │ │ │ -
152{
│ │ │ │ -
153 return SubspaceBasis(rootBasis, prefixPath);
│ │ │ │ -
154}
│ │ │ │ -
│ │ │ │ -
155
│ │ │ │ -
156template<class RootBasis, class... PrefixTreeIndices>
│ │ │ │ -
│ │ │ │ -
157auto subspaceBasis(const RootBasis& rootBasis, const PrefixTreeIndices&... prefixTreeIndices)
│ │ │ │ -
158{
│ │ │ │ -
159 return subspaceBasis(rootBasis, TypeTree::hybridTreePath(prefixTreeIndices...));
│ │ │ │ -
160}
│ │ │ │ -
│ │ │ │ -
161
│ │ │ │ -
162
│ │ │ │ -
163
│ │ │ │ -
164} // end namespace Functions
│ │ │ │ -
165} // end namespace Dune
│ │ │ │ -
166
│ │ │ │ -
167
│ │ │ │ -
168
│ │ │ │ -
169#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ +
99
│ │ │ │ +
100
│ │ │ │ +
101}} // namespace Dune::Functions
│ │ │ │ +
102
│ │ │ │ +
103#endif // DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH
│ │ │ │ +
typename std::enable_if< std::is_constructible< T, Args... >::value, int >::type enableIfConstructible
Helper to constrain forwarding constructors.
Definition type_traits.hh:26
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
auto subspaceBasis(const RootBasis &rootBasis, const TypeTree::HybridTreePath< PrefixTreeIndices... > &prefixPath)
Create SubspaceBasis from a root basis and a prefixPath.
Definition subspacebasis.hh:151
│ │ │ │ -
Definition subspacebasis.hh:38
│ │ │ │ -
typename RootBasis::LocalView RootLocalView
Definition subspacebasis.hh:43
│ │ │ │ -
LocalView localView() const
Return local view for basis.
Definition subspacebasis.hh:108
│ │ │ │ -
const RootBasis * rootBasis_
Definition subspacebasis.hh:124
│ │ │ │ -
typename RootBasis::SizePrefix SizePrefix
Definition subspacebasis.hh:58
│ │ │ │ -
TP PrefixPath
Definition subspacebasis.hh:45
│ │ │ │ -
SubspaceLocalView< RootLocalView, PrefixPath > LocalView
Type of the local view on the restriction of the basis to a single element.
Definition subspacebasis.hh:56
│ │ │ │ -
size_type size(const SizePrefix &prefix) const
Return number possible values for next position in multi index.
Definition subspacebasis.hh:100
│ │ │ │ -
typename RootBasis::GridView GridView
The grid view that the FE space is defined on.
Definition subspacebasis.hh:48
│ │ │ │ -
const PrefixPath & prefixPath() const
Definition subspacebasis.hh:118
│ │ │ │ -
SubspaceBasis(const SubspaceBasis< RootRootBasis, InnerTP > &rootBasis, const OuterTP &prefixPath)
Constructor from another SubspaceBasis.
Definition subspacebasis.hh:73
│ │ │ │ -
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition subspacebasis.hh:80
│ │ │ │ -
RB RootBasis
Definition subspacebasis.hh:41
│ │ │ │ -
PrefixPath prefixPath_
Definition subspacebasis.hh:125
│ │ │ │ -
size_type size() const
Return number of possible values for next position in empty multi index.
Definition subspacebasis.hh:94
│ │ │ │ -
const RootBasis & rootBasis() const
Definition subspacebasis.hh:113
│ │ │ │ -
typename RootBasis::MultiIndex MultiIndex
Type used for global numbering of the basis vectors.
Definition subspacebasis.hh:51
│ │ │ │ -
size_type dimension() const
Definition subspacebasis.hh:88
│ │ │ │ -
std::size_t size_type
Definition subspacebasis.hh:53
│ │ │ │ -
SubspaceBasis(const RootBasis &rootBasis, const PrefixPath &prefixPath)
Constructor for a given grid view object.
Definition subspacebasis.hh:62
│ │ │ │ -
The restriction of a finite element basis to a single element.
Definition subspacelocalview.hh:30
│ │ │ │ - │ │ │ │ +
Check if type is a statically sized container.
Definition type_traits.hh:83
│ │ │ │ +
Obtain size of statically sized container.
Definition type_traits.hh:97
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,243 +1,105 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -subspacebasis.hh │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACEBASIS_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACEBASIS_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ -8#include │ │ │ │ │ +6#include │ │ │ │ │ +7 │ │ │ │ │ +8#include │ │ │ │ │ 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_/_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> │ │ │ │ │ -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_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ │ +10namespace _D_u_n_e { │ │ │ │ │ +11namespace Functions { │ │ │ │ │ +12 │ │ │ │ │ 13 │ │ │ │ │ -14 │ │ │ │ │ -15 │ │ │ │ │ -16namespace _D_u_n_e { │ │ │ │ │ -17namespace Functions { │ │ │ │ │ -18 │ │ │ │ │ -19 │ │ │ │ │ -20 │ │ │ │ │ -21namespace Impl { │ │ │ │ │ -22 │ │ │ │ │ -23 template │ │ │ │ │ -24 auto joinTreePaths(const TypeTree::HybridTreePath& inner, const │ │ │ │ │ -TypeTree::HybridTreePath outer) │ │ │ │ │ -25 { │ │ │ │ │ -26 return TypeTree::HybridTreePath(std::tuple_cat │ │ │ │ │ -(inner._data, outer._data)); │ │ │ │ │ -27 } │ │ │ │ │ +24template │ │ │ │ │ +_2_5using _e_n_a_b_l_e_I_f_C_o_n_s_t_r_u_c_t_i_b_l_e = typename std::enable_if< │ │ │ │ │ +26 std::is_constructible::value, int>::type; │ │ │ │ │ +27 │ │ │ │ │ 28 │ │ │ │ │ -29 template │ │ │ │ │ -30 using JoinTreePath_t = std::decay_t(), std::declval()))>; │ │ │ │ │ +29 │ │ │ │ │ +30namespace Imp { │ │ │ │ │ 31 │ │ │ │ │ -32} │ │ │ │ │ -33 │ │ │ │ │ -34 │ │ │ │ │ -35 │ │ │ │ │ -36template │ │ │ │ │ -_3_7class _S_u_b_s_p_a_c_e_B_a_s_i_s │ │ │ │ │ -38{ │ │ │ │ │ -39public: │ │ │ │ │ -40 │ │ │ │ │ -_4_1 using _R_o_o_t_B_a_s_i_s = RB; │ │ │ │ │ -42 │ │ │ │ │ -_4_3 using _R_o_o_t_L_o_c_a_l_V_i_e_w = typename RootBasis::LocalView; │ │ │ │ │ -44 │ │ │ │ │ -_4_5 using _P_r_e_f_i_x_P_a_t_h = TP; │ │ │ │ │ -46 │ │ │ │ │ -_4_8 using _G_r_i_d_V_i_e_w = typename RootBasis::GridView; │ │ │ │ │ -49 │ │ │ │ │ -_5_1 using _M_u_l_t_i_I_n_d_e_x = typename RootBasis::MultiIndex; │ │ │ │ │ -52 │ │ │ │ │ -_5_3 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ -54 │ │ │ │ │ -_5_6 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_>; │ │ │ │ │ -57 │ │ │ │ │ -_5_8 using _S_i_z_e_P_r_e_f_i_x = typename RootBasis::SizePrefix; │ │ │ │ │ -59 │ │ │ │ │ -60 │ │ │ │ │ -_6_2 _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) : │ │ │ │ │ -63 _r_o_o_t_B_a_s_i_s__(&_r_o_o_t_B_a_s_i_s), │ │ │ │ │ -64 _p_r_e_f_i_x_P_a_t_h__(_p_r_e_f_i_x_P_a_t_h) │ │ │ │ │ -65 {} │ │ │ │ │ -66 │ │ │ │ │ -72 template │ │ │ │ │ -_7_3 _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) : │ │ │ │ │ -74 _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(), Impl::joinTreePaths │ │ │ │ │ -(_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)) │ │ │ │ │ -75 {} │ │ │ │ │ -76 │ │ │ │ │ -77 │ │ │ │ │ -_8_0 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ │ -81 { │ │ │ │ │ -82 return _r_o_o_t_B_a_s_i_s__->gridView(); │ │ │ │ │ -83 } │ │ │ │ │ +32 // As a last resort try if there's a static constexpr size() │ │ │ │ │ +33 template │ │ │ │ │ +34 constexpr auto staticSize(const T*, const PriorityTag<0>&) │ │ │ │ │ +35 -> decltype(std::integral_constant()) │ │ │ │ │ +36 { │ │ │ │ │ +37 return {}; │ │ │ │ │ +38 } │ │ │ │ │ +39 │ │ │ │ │ +40 // Try if class has constexpr default constructor and size method │ │ │ │ │ +41 template │ │ │ │ │ +42 constexpr auto staticSize(const T*, const PriorityTag<1>&) │ │ │ │ │ +43 -> decltype(std::integral_constant()) │ │ │ │ │ +44 { │ │ │ │ │ +45 return {}; │ │ │ │ │ +46 } │ │ │ │ │ +47 │ │ │ │ │ +48 // Try if tuple_size is implemented for class │ │ │ │ │ +49 template │ │ │ │ │ +50 constexpr auto staticSize(const T*, const PriorityTag<2>&) │ │ │ │ │ +51 -> decltype(std::integral_constant::value>()) │ │ │ │ │ +52 { │ │ │ │ │ +53 return {}; │ │ │ │ │ +54 } │ │ │ │ │ +55 │ │ │ │ │ +56 template │ │ │ │ │ +57 constexpr std::false_type hasStaticSize(const T* t, const PriorityTag<0>& p) │ │ │ │ │ +58 { │ │ │ │ │ +59 return {}; │ │ │ │ │ +60 } │ │ │ │ │ +61 │ │ │ │ │ +62 template │ │ │ │ │ +63 constexpr auto hasStaticSize(const T* t, const PriorityTag<1>& p) │ │ │ │ │ +64 -> decltype(staticSize(t ,PriorityTag<42>()), std::true_type()) │ │ │ │ │ +65 { │ │ │ │ │ +66 return {}; │ │ │ │ │ +67 } │ │ │ │ │ +68 │ │ │ │ │ +69} │ │ │ │ │ +70 │ │ │ │ │ +71 │ │ │ │ │ +72 │ │ │ │ │ +80template │ │ │ │ │ +_8_1struct _H_a_s_S_t_a_t_i_c_S_i_z_e : │ │ │ │ │ +82 public decltype(Imp::hasStaticSize((typename std::decay::type*)(nullptr), │ │ │ │ │ +PriorityTag<42>())) │ │ │ │ │ +83{}; │ │ │ │ │ 84 │ │ │ │ │ -_8_8 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ │ -89 { │ │ │ │ │ -90 return _r_o_o_t_B_a_s_i_s__->dimension(); │ │ │ │ │ -91 } │ │ │ │ │ -92 │ │ │ │ │ -_9_4 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ │ -95 { │ │ │ │ │ -96 return _r_o_o_t_B_a_s_i_s__->size(); │ │ │ │ │ -97 } │ │ │ │ │ +85 │ │ │ │ │ +86 │ │ │ │ │ +94template │ │ │ │ │ +_9_5struct _S_t_a_t_i_c_S_i_z_e : │ │ │ │ │ +96 public decltype(Imp::staticSize((typename std::decay::type*)(nullptr), │ │ │ │ │ +PriorityTag<42>())) │ │ │ │ │ +97{}; │ │ │ │ │ 98 │ │ │ │ │ -_1_0_0 _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 │ │ │ │ │ -101 { │ │ │ │ │ -102 return _r_o_o_t_B_a_s_i_s__->size(prefix); │ │ │ │ │ -103 } │ │ │ │ │ -104 │ │ │ │ │ -_1_0_8 _L_o_c_a_l_V_i_e_w _l_o_c_a_l_V_i_e_w() const │ │ │ │ │ -109 { │ │ │ │ │ -110 return _L_o_c_a_l_V_i_e_w(*this, _p_r_e_f_i_x_P_a_t_h__); │ │ │ │ │ -111 } │ │ │ │ │ -112 │ │ │ │ │ -_1_1_3 const _R_o_o_t_B_a_s_i_s& _r_o_o_t_B_a_s_i_s() const │ │ │ │ │ -114 { │ │ │ │ │ -115 return *_r_o_o_t_B_a_s_i_s__; │ │ │ │ │ -116 } │ │ │ │ │ -117 │ │ │ │ │ -_1_1_8 const _P_r_e_f_i_x_P_a_t_h& _p_r_e_f_i_x_P_a_t_h() const │ │ │ │ │ -119 { │ │ │ │ │ -120 return _p_r_e_f_i_x_P_a_t_h__; │ │ │ │ │ -121 } │ │ │ │ │ -122 │ │ │ │ │ -123protected: │ │ │ │ │ -_1_2_4 const _R_o_o_t_B_a_s_i_s* _r_o_o_t_B_a_s_i_s__; │ │ │ │ │ -_1_2_5 _P_r_e_f_i_x_P_a_t_h _p_r_e_f_i_x_P_a_t_h__; │ │ │ │ │ -126}; │ │ │ │ │ -127 │ │ │ │ │ -128 │ │ │ │ │ -129// CTAD guide for a non-SubspaceBasis root basis │ │ │ │ │ -130template │ │ │ │ │ -_1_3_1_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_>; │ │ │ │ │ -132 │ │ │ │ │ -133// CTAD guide for a SubspaceBasis root basis │ │ │ │ │ -134template │ │ │ │ │ -_1_3_5_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) │ │ │ │ │ -136 -> _S_u_b_s_p_a_c_e_B_a_s_i_s, Impl:: │ │ │ │ │ -JoinTreePath_t>; │ │ │ │ │ -137 │ │ │ │ │ -138 │ │ │ │ │ -139 │ │ │ │ │ -150template │ │ │ │ │ -_1_5_1auto _s_u_b_s_p_a_c_e_B_a_s_i_s(const RootBasis& rootBasis, const TypeTree:: │ │ │ │ │ -HybridTreePath& prefixPath) │ │ │ │ │ -152{ │ │ │ │ │ -153 return _S_u_b_s_p_a_c_e_B_a_s_i_s(rootBasis, prefixPath); │ │ │ │ │ -154} │ │ │ │ │ -155 │ │ │ │ │ -156template │ │ │ │ │ -_1_5_7auto _s_u_b_s_p_a_c_e_B_a_s_i_s(const RootBasis& rootBasis, const PrefixTreeIndices&... │ │ │ │ │ -prefixTreeIndices) │ │ │ │ │ -158{ │ │ │ │ │ -159 return _s_u_b_s_p_a_c_e_B_a_s_i_s(rootBasis, TypeTree::hybridTreePath │ │ │ │ │ -(prefixTreeIndices...)); │ │ │ │ │ -160} │ │ │ │ │ -161 │ │ │ │ │ -162 │ │ │ │ │ -163 │ │ │ │ │ -164} // end namespace Functions │ │ │ │ │ -165} // end namespace Dune │ │ │ │ │ -166 │ │ │ │ │ -167 │ │ │ │ │ -168 │ │ │ │ │ -169#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 │ │ │ │ │ +99 │ │ │ │ │ +100 │ │ │ │ │ +101}} // namespace Dune::Functions │ │ │ │ │ +102 │ │ │ │ │ +103#endif // DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH │ │ │ │ │ +_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 │ │ │ │ │ +typename std::enable_if< std::is_constructible< T, Args... >::value, int >:: │ │ │ │ │ +type enableIfConstructible │ │ │ │ │ +Helper to constrain forwarding constructors. │ │ │ │ │ +DDeeffiinniittiioonn type_traits.hh:26 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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::HybridTreePath< │ │ │ │ │ -PrefixTreeIndices... > &prefixPath) │ │ │ │ │ -Create SubspaceBasis from a root basis and a prefixPath. │ │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:151 │ │ │ │ │ -_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:38 │ │ │ │ │ -_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:43 │ │ │ │ │ -_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:108 │ │ │ │ │ -_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__ │ │ │ │ │ -const RootBasis * rootBasis_ │ │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:124 │ │ │ │ │ -_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:58 │ │ │ │ │ -_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:45 │ │ │ │ │ -_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:56 │ │ │ │ │ -_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:100 │ │ │ │ │ -_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:48 │ │ │ │ │ -_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 │ │ │ │ │ -const PrefixPath & prefixPath() const │ │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:118 │ │ │ │ │ -_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:73 │ │ │ │ │ -_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:80 │ │ │ │ │ -_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:41 │ │ │ │ │ -_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__ │ │ │ │ │ -PrefixPath prefixPath_ │ │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:125 │ │ │ │ │ -_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:94 │ │ │ │ │ -_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 │ │ │ │ │ -const RootBasis & rootBasis() const │ │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:113 │ │ │ │ │ -_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:51 │ │ │ │ │ -_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:88 │ │ │ │ │ -_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:53 │ │ │ │ │ -_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:62 │ │ │ │ │ -_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:30 │ │ │ │ │ -_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 │ │ │ │ │ +Check if type is a statically sized container. │ │ │ │ │ +DDeeffiinniittiioonn type_traits.hh:83 │ │ │ │ │ +_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. │ │ │ │ │ +DDeeffiinniittiioonn type_traits.hh:97 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00047.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: sizeinfo.hh File Reference │ │ │ │ +dune-functions: differentiablefunctionfromcallables.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,47 +65,55 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces | │ │ │ │ Functions
│ │ │ │ -
sizeinfo.hh File Reference
│ │ │ │ +
differentiablefunctionfromcallables.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <array>
│ │ │ │ +
#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::SizeInfo< B >
 A class encapsulating size information. More...
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 Basis >
SizeInfo< Basis > Dune::Functions::sizeInfo (const Basis &basis)
 
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,26 +1,46 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_m_o_n │ │ │ │ │ _C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -sizeinfo.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ +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> │ │ │ │ │ _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_i_z_e_I_n_f_o_<_ _B_ _> │ │ │ │ │ -  A class encapsulating size information. _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_ _> │ │ │ │ │ + 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 │ │ │ │ │ -_S_i_z_e_I_n_f_o< Basis >  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_s_i_z_e_I_n_f_o (const Basis &basis) │ │ │ │ │ +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. │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00047_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: sizeinfo.hh Source File │ │ │ │ +dune-functions: differentiablefunctionfromcallables.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,100 +70,163 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
sizeinfo.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SIZEINFO_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SIZEINFO_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH
│ │ │ │
5
│ │ │ │ -
6#include <array>
│ │ │ │ -
7
│ │ │ │ -
8namespace Dune {
│ │ │ │ -
9namespace Functions {
│ │ │ │ -
10
│ │ │ │ +
6
│ │ │ │ +
7#include <dune/common/typeutilities.hh>
│ │ │ │ +
8#include <dune/common/hybridutilities.hh>
│ │ │ │ +
9
│ │ │ │ + │ │ │ │
11
│ │ │ │ -
12
│ │ │ │ -
23template<class B>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
25{
│ │ │ │ -
26public:
│ │ │ │ -
27 using Basis = B;
│ │ │ │ -
28 using size_type = typename Basis::size_type;
│ │ │ │ -
29 using SizePrefix = typename Basis::SizePrefix;
│ │ │ │ -
30
│ │ │ │ -
│ │ │ │ -
34 SizeInfo(const Basis& basis) :
│ │ │ │ -
35 basis_(&basis)
│ │ │ │ -
36 {}
│ │ │ │ -
│ │ │ │ -
37
│ │ │ │ -
│ │ │ │ -
41 size_type operator()(const SizePrefix& prefix) const
│ │ │ │ -
42 {
│ │ │ │ -
43 return basis_->size(prefix);
│ │ │ │ -
44 }
│ │ │ │ -
│ │ │ │ -
45
│ │ │ │ -
│ │ │ │ -
52 size_type size(const SizePrefix& prefix) const
│ │ │ │ -
53 {
│ │ │ │ -
54 return basis_->size(prefix);
│ │ │ │ -
55 }
│ │ │ │ -
│ │ │ │ -
56
│ │ │ │ -
│ │ │ │ -
57 operator size_type () const
│ │ │ │ -
58 {
│ │ │ │ -
59 return basis_->dimension();
│ │ │ │ -
60 }
│ │ │ │ -
│ │ │ │ -
61
│ │ │ │ -
62protected:
│ │ │ │ -
63
│ │ │ │ -
64 const Basis* basis_;
│ │ │ │ -
65};
│ │ │ │ -
│ │ │ │ -
66
│ │ │ │ -
67
│ │ │ │ -
68template<class Basis>
│ │ │ │ -
│ │ │ │ -
69SizeInfo<Basis> sizeInfo(const Basis& basis)
│ │ │ │ -
70{
│ │ │ │ -
71 return SizeInfo<Basis>(basis);
│ │ │ │ -
72}
│ │ │ │ -
│ │ │ │ -
73
│ │ │ │ -
74
│ │ │ │ -
75
│ │ │ │ -
76} // end namespace Functions
│ │ │ │ -
77} // end namespace Dune
│ │ │ │ -
78
│ │ │ │ -
79#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SIZEINFO_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ +
14
│ │ │ │ +
15
│ │ │ │ +
16
│ │ │ │ +
17namespace Dune {
│ │ │ │ +
18namespace Functions {
│ │ │ │ +
19
│ │ │ │ +
20
│ │ │ │ +
21
│ │ │ │ +
22template<class Signature, template<class> class DerivativeTraits, class... Callables>
│ │ │ │ + │ │ │ │ +
24
│ │ │ │ +
25
│ │ │ │ +
26
│ │ │ │ +
43template<class Range, class Domain, template<class> class DerivativeTraits, class F>
│ │ │ │ +
│ │ │ │ +
44class DifferentiableFunctionFromCallables<Range(Domain), DerivativeTraits, F>
│ │ │ │ +
45{
│ │ │ │ +
46public:
│ │ │ │ +
47
│ │ │ │ +
49 using Signature = Range(Domain);
│ │ │ │ +
50
│ │ │ │ + │ │ │ │ +
52
│ │ │ │ +
54 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(Domain);
│ │ │ │ +
55
│ │ │ │ + │ │ │ │ +
58
│ │ │ │ +
60 template<class FF, disableCopyMove<DifferentiableFunctionFromCallables, FF> = 0>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
62 f_(std::forward<FF>(f))
│ │ │ │ +
63 {}
│ │ │ │ +
│ │ │ │ +
64
│ │ │ │ +
│ │ │ │ +
66 Range operator() (const Domain& x) const
│ │ │ │ +
67 {
│ │ │ │ +
68 return f_(x);
│ │ │ │ +
69 }
│ │ │ │ +
│ │ │ │ +
70
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
77 {
│ │ │ │ +
78 DUNE_THROW(Dune::NotImplemented, "Derivative not implemented");
│ │ │ │ +
79 }
│ │ │ │ +
│ │ │ │ +
80
│ │ │ │ +
81private:
│ │ │ │ +
82 F f_;
│ │ │ │ +
83};
│ │ │ │ +
│ │ │ │ +
84
│ │ │ │ +
85
│ │ │ │ +
86
│ │ │ │ +
103template<class Range, class Domain, template<class> class DerivativeTraits, class F, class DF, class... Derivatives>
│ │ │ │ +
│ │ │ │ +
104class DifferentiableFunctionFromCallables<Range(Domain), DerivativeTraits, F, DF, Derivatives...>
│ │ │ │ +
105{
│ │ │ │ +
106public:
│ │ │ │ +
107
│ │ │ │ +
108 using Signature = Range(Domain);
│ │ │ │ + │ │ │ │ +
110 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(Domain);
│ │ │ │ +
111
│ │ │ │ +
112 using Derivative = DifferentiableFunctionFromCallables<DerivativeSignature, DerivativeTraits, DF, Derivatives...>;
│ │ │ │ +
113
│ │ │ │ +
120 template<class FF, class DFF, class... DDFF>
│ │ │ │ +
│ │ │ │ +
121 DifferentiableFunctionFromCallables(FF&& f, DFF&& df, DDFF&&... ddf) :
│ │ │ │ +
122 f_(std::forward<FF>(f)),
│ │ │ │ +
123 df_(std::forward<DFF>(df), std::forward<DDFF>(ddf)...)
│ │ │ │ +
124 {}
│ │ │ │ +
│ │ │ │ +
125
│ │ │ │ +
│ │ │ │ +
127 Range operator() (const Domain& x) const
│ │ │ │ +
128 {
│ │ │ │ +
129 return f_(x);
│ │ │ │ +
130 }
│ │ │ │ +
│ │ │ │ +
131
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
138 {
│ │ │ │ +
139 return t.df_;
│ │ │ │ +
140 }
│ │ │ │ +
│ │ │ │ +
141
│ │ │ │ +
142private:
│ │ │ │ +
143 F f_;
│ │ │ │ +
144 Derivative df_;
│ │ │ │ +
145};
│ │ │ │ +
│ │ │ │ +
146
│ │ │ │ +
147
│ │ │ │ +
162template<class Signature, template<class> class DerivativeTraits, class... F>
│ │ │ │ +
163DifferentiableFunctionFromCallables<Signature, DerivativeTraits, F...>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
165{
│ │ │ │ +
166 return DifferentiableFunctionFromCallables<Signature, DerivativeTraits, F...>(f...);
│ │ │ │ +
167}
│ │ │ │ +
│ │ │ │ +
168
│ │ │ │ +
169
│ │ │ │ +
170
│ │ │ │ +
171} // namespace Functions
│ │ │ │ +
172} // namespace Dune
│ │ │ │ +
173
│ │ │ │ +
174#endif //DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
friend Derivative derivative(const DifferentiableFunctionFromCallables &t)
Get derivative of DifferentiableFunctionFromCallables.
Definition differentiablefunctionfromcallables.hh:76
│ │ │ │ +
DifferentiableFunctionFromCallables< Signature, DerivativeTraits, F... > makeDifferentiableFunctionFromCallables(const SignatureTag< Signature, DerivativeTraits > &signatureTag, F &&... f)
Create a DifferentiableFunction from callables.
Definition differentiablefunctionfromcallables.hh:164
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
SizeInfo< Basis > sizeInfo(const Basis &basis)
Definition sizeinfo.hh:69
│ │ │ │ -
A class encapsulating size information.
Definition sizeinfo.hh:25
│ │ │ │ -
typename Basis::SizePrefix SizePrefix
Definition sizeinfo.hh:29
│ │ │ │ -
size_type size(const SizePrefix &prefix) const
Return number possible values for next position in multi index.
Definition sizeinfo.hh:52
│ │ │ │ -
size_type operator()(const SizePrefix &prefix) const
Return number possible values for next position in multi index.
Definition sizeinfo.hh:41
│ │ │ │ -
typename Basis::size_type size_type
Definition sizeinfo.hh:28
│ │ │ │ -
B Basis
Definition sizeinfo.hh:27
│ │ │ │ -
SizeInfo(const Basis &basis)
Construct from basis.
Definition sizeinfo.hh:34
│ │ │ │ -
const Basis * basis_
Definition sizeinfo.hh:64
│ │ │ │ +
Definition differentiablefunction.hh:29
│ │ │ │ +
Definition differentiablefunctionfromcallables.hh:23
│ │ │ │ +
DifferentiableFunctionFromCallables(FF &&f)
Constructor copying the given function.
Definition differentiablefunctionfromcallables.hh:61
│ │ │ │ +
typename SignatureTraits< Signature >::RawSignature RawSignature
Definition differentiablefunctionfromcallables.hh:51
│ │ │ │ +
Range(Domain) Signature
Signature of function.
Definition differentiablefunctionfromcallables.hh:49
│ │ │ │ +
typename DerivativeTraits< RawSignature >::Range(Domain) DerivativeSignature
Signature of derivative.
Definition differentiablefunctionfromcallables.hh:54
│ │ │ │ +
typename DerivativeTraits< RawSignature >::Range(Domain) DerivativeSignature
Definition differentiablefunctionfromcallables.hh:110
│ │ │ │ + │ │ │ │ +
typename SignatureTraits< Signature >::RawSignature RawSignature
Definition differentiablefunctionfromcallables.hh:109
│ │ │ │ +
DifferentiableFunctionFromCallables(FF &&f, DFF &&df, DDFF &&... ddf)
Constructor copying the given functions.
Definition differentiablefunctionfromcallables.hh:121
│ │ │ │ +
Helper class to deduce the signature of a callable.
Definition signature.hh:56
│ │ │ │ +
Definition signature.hh:102
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,100 +1,190 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -sizeinfo.hh │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SIZEINFO_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SIZEINFO_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7 │ │ │ │ │ -8namespace _D_u_n_e { │ │ │ │ │ -9namespace Functions { │ │ │ │ │ -10 │ │ │ │ │ +6 │ │ │ │ │ +7#include │ │ │ │ │ +8#include │ │ │ │ │ +9 │ │ │ │ │ +10#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> │ │ │ │ │ 11 │ │ │ │ │ -12 │ │ │ │ │ -23template │ │ │ │ │ -_2_4class _S_i_z_e_I_n_f_o │ │ │ │ │ -25{ │ │ │ │ │ -26public: │ │ │ │ │ -_2_7 using _B_a_s_i_s = B; │ │ │ │ │ -_2_8 using _s_i_z_e___t_y_p_e = typename Basis::size_type; │ │ │ │ │ -_2_9 using _S_i_z_e_P_r_e_f_i_x = typename Basis::SizePrefix; │ │ │ │ │ -30 │ │ │ │ │ -_3_4 _S_i_z_e_I_n_f_o(const _B_a_s_i_s& basis) : │ │ │ │ │ -35 _b_a_s_i_s__(&basis) │ │ │ │ │ -36 {} │ │ │ │ │ -37 │ │ │ │ │ -_4_1 _s_i_z_e___t_y_p_e _o_p_e_r_a_t_o_r_(_)(const _S_i_z_e_P_r_e_f_i_x& prefix) const │ │ │ │ │ -42 { │ │ │ │ │ -43 return _b_a_s_i_s__->size(prefix); │ │ │ │ │ -44 } │ │ │ │ │ -45 │ │ │ │ │ -_5_2 _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 │ │ │ │ │ -53 { │ │ │ │ │ -54 return _b_a_s_i_s__->size(prefix); │ │ │ │ │ -55 } │ │ │ │ │ -56 │ │ │ │ │ -_5_7 operator _s_i_z_e___t_y_p_e () const │ │ │ │ │ -58 { │ │ │ │ │ -59 return _b_a_s_i_s__->dimension(); │ │ │ │ │ -60 } │ │ │ │ │ -61 │ │ │ │ │ -62protected: │ │ │ │ │ -63 │ │ │ │ │ -_6_4 const _B_a_s_i_s* _b_a_s_i_s__; │ │ │ │ │ -65}; │ │ │ │ │ -66 │ │ │ │ │ -67 │ │ │ │ │ -68template │ │ │ │ │ -_6_9_S_i_z_e_I_n_f_o_<_B_a_s_i_s_> _s_i_z_e_I_n_f_o(const Basis& basis) │ │ │ │ │ -70{ │ │ │ │ │ -71 return _S_i_z_e_I_n_f_o_<_B_a_s_i_s_>(basis); │ │ │ │ │ -72} │ │ │ │ │ -73 │ │ │ │ │ -74 │ │ │ │ │ -75 │ │ │ │ │ -76} // end namespace Functions │ │ │ │ │ -77} // end namespace Dune │ │ │ │ │ -78 │ │ │ │ │ -79#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SIZEINFO_HH │ │ │ │ │ +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_._h_h> │ │ │ │ │ +13#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 │ │ │ │ │ +15 │ │ │ │ │ +16 │ │ │ │ │ +17namespace _D_u_n_e { │ │ │ │ │ +18namespace Functions { │ │ │ │ │ +19 │ │ │ │ │ +20 │ │ │ │ │ +21 │ │ │ │ │ +22template class DerivativeTraits, class... │ │ │ │ │ +Callables> │ │ │ │ │ +_2_3class _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; │ │ │ │ │ +24 │ │ │ │ │ +25 │ │ │ │ │ +26 │ │ │ │ │ +43template class DerivativeTraits, │ │ │ │ │ +class F> │ │ │ │ │ +_4_4class _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 │ │ │ │ │ +45{ │ │ │ │ │ +46public: │ │ │ │ │ +47 │ │ │ │ │ +_4_9 using _S_i_g_n_a_t_u_r_e = Range(Domain); │ │ │ │ │ +50 │ │ │ │ │ +_5_1 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; │ │ │ │ │ +52 │ │ │ │ │ +_5_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); │ │ │ │ │ +55 │ │ │ │ │ +_5_7 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_>; │ │ │ │ │ +58 │ │ │ │ │ +60 template │ │ │ │ │ += 0> │ │ │ │ │ +_6_1 _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) : │ │ │ │ │ +62 f_(std::forward(f)) │ │ │ │ │ +63 {} │ │ │ │ │ +64 │ │ │ │ │ +_6_6 Range operator() (const Domain& x) const │ │ │ │ │ +67 { │ │ │ │ │ +68 return f_(x); │ │ │ │ │ +69 } │ │ │ │ │ +70 │ │ │ │ │ +_7_6 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) │ │ │ │ │ +77 { │ │ │ │ │ +78 DUNE_THROW(Dune::NotImplemented, "Derivative not implemented"); │ │ │ │ │ +79 } │ │ │ │ │ +80 │ │ │ │ │ +81private: │ │ │ │ │ +82 F f_; │ │ │ │ │ +83}; │ │ │ │ │ +84 │ │ │ │ │ +85 │ │ │ │ │ +86 │ │ │ │ │ +103template class DerivativeTraits, │ │ │ │ │ +class F, class DF, class... Derivatives> │ │ │ │ │ +_1_0_4class _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 │ │ │ │ │ +105{ │ │ │ │ │ +106public: │ │ │ │ │ +107 │ │ │ │ │ +_1_0_8 using _S_i_g_n_a_t_u_r_e = Range(Domain); │ │ │ │ │ +_1_0_9 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_0 using _D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e = typename DerivativeTraits::Range │ │ │ │ │ +(Domain); │ │ │ │ │ +111 │ │ │ │ │ +_1_1_2 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...>; │ │ │ │ │ +113 │ │ │ │ │ +120 template │ │ │ │ │ +_1_2_1 _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) : │ │ │ │ │ +122 f_(std::forward(f)), │ │ │ │ │ +123 df_(std::forward(df), std::forward(ddf)...) │ │ │ │ │ +124 {} │ │ │ │ │ +125 │ │ │ │ │ +_1_2_7 Range operator() (const Domain& x) const │ │ │ │ │ +128 { │ │ │ │ │ +129 return f_(x); │ │ │ │ │ +130 } │ │ │ │ │ +131 │ │ │ │ │ +_1_3_7 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) │ │ │ │ │ +138 { │ │ │ │ │ +139 return t.df_; │ │ │ │ │ +140 } │ │ │ │ │ +141 │ │ │ │ │ +142private: │ │ │ │ │ +143 F f_; │ │ │ │ │ +144 Derivative df_; │ │ │ │ │ +145}; │ │ │ │ │ +146 │ │ │ │ │ +147 │ │ │ │ │ +162template class DerivativeTraits, class... │ │ │ │ │ +F> │ │ │ │ │ +163DifferentiableFunctionFromCallables │ │ │ │ │ +_1_6_4 _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) │ │ │ │ │ +165{ │ │ │ │ │ +166 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...); │ │ │ │ │ +167} │ │ │ │ │ +168 │ │ │ │ │ +169 │ │ │ │ │ +170 │ │ │ │ │ +171} // namespace Functions │ │ │ │ │ +172} // namespace Dune │ │ │ │ │ +173 │ │ │ │ │ +174#endif //DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_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 │ │ │ │ │ +_s_i_g_n_a_t_u_r_e_._h_h │ │ │ │ │ +_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_:_:_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:76 │ │ │ │ │ +_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:164 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_s_i_z_e_I_n_f_o │ │ │ │ │ -SizeInfo< Basis > sizeInfo(const Basis &basis) │ │ │ │ │ -DDeeffiinniittiioonn sizeinfo.hh:69 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_z_e_I_n_f_o │ │ │ │ │ -A class encapsulating size information. │ │ │ │ │ -DDeeffiinniittiioonn sizeinfo.hh:25 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_z_e_I_n_f_o_:_:_S_i_z_e_P_r_e_f_i_x │ │ │ │ │ -typename Basis::SizePrefix SizePrefix │ │ │ │ │ -DDeeffiinniittiioonn sizeinfo.hh:29 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_z_e_I_n_f_o_:_:_s_i_z_e │ │ │ │ │ -size_type size(const SizePrefix &prefix) const │ │ │ │ │ -Return number possible values for next position in multi index. │ │ │ │ │ -DDeeffiinniittiioonn sizeinfo.hh:52 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_z_e_I_n_f_o_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ │ -size_type operator()(const SizePrefix &prefix) const │ │ │ │ │ -Return number possible values for next position in multi index. │ │ │ │ │ -DDeeffiinniittiioonn sizeinfo.hh:41 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_z_e_I_n_f_o_:_:_s_i_z_e___t_y_p_e │ │ │ │ │ -typename Basis::size_type size_type │ │ │ │ │ -DDeeffiinniittiioonn sizeinfo.hh:28 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_z_e_I_n_f_o_:_:_B_a_s_i_s │ │ │ │ │ -B Basis │ │ │ │ │ -DDeeffiinniittiioonn sizeinfo.hh:27 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_z_e_I_n_f_o_:_:_S_i_z_e_I_n_f_o │ │ │ │ │ -SizeInfo(const Basis &basis) │ │ │ │ │ -Construct from basis. │ │ │ │ │ -DDeeffiinniittiioonn sizeinfo.hh:34 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_z_e_I_n_f_o_:_:_b_a_s_i_s__ │ │ │ │ │ -const Basis * basis_ │ │ │ │ │ -DDeeffiinniittiioonn sizeinfo.hh:64 │ │ │ │ │ +_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:29 │ │ │ │ │ +_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:23 │ │ │ │ │ +_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: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_ _>_:_:_R_a_w_S_i_g_n_a_t_u_r_e │ │ │ │ │ +typename SignatureTraits< Signature >::RawSignature RawSignature │ │ │ │ │ +DDeeffiinniittiioonn differentiablefunctionfromcallables.hh:51 │ │ │ │ │ +_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:49 │ │ │ │ │ +_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:54 │ │ │ │ │ +_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: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_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:108 │ │ │ │ │ +_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:109 │ │ │ │ │ +_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:121 │ │ │ │ │ +_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:56 │ │ │ │ │ +_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:102 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00050.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: hierarchicvectorwrapper.hh File Reference │ │ │ │ +dune-functions: localfunction_imp.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,59 +65,34 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ -Namespaces | │ │ │ │ -Functions
│ │ │ │ -
hierarchicvectorwrapper.hh File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
localfunction_imp.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <dune/common/concept.hh>
│ │ │ │ -#include <dune/common/hybridutilities.hh>
│ │ │ │ -#include <dune/common/indices.hh>
│ │ │ │ -#include <dune/functions/common/indexaccess.hh>
│ │ │ │ -#include <dune/functions/common/utility.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::HierarchicVectorWrapper< V, CO >
 A wrapper providing multiindex access to vector entries. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ │ Namespaces

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

│ │ │ │ -Functions

template<class V >
HierarchicVectorWrapper< V > Dune::Functions::hierarchicVector (V &v)
 
template<class MultiIndex , class V , typename std::enable_if< models< Concept::HasIndexAccess, V, MultiIndex >(), int >::type = 0>
V & Dune::Functions::makeHierarchicVectorForMultiIndex (V &v)
 
template<class MultiIndex , class V , typename std::enable_if< not models< Concept::HasIndexAccess, V, MultiIndex >(), int >::type = 0>
HierarchicVectorWrapper< V > Dune::Functions::makeHierarchicVectorForMultiIndex (V &v)
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,42 +1,19 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -hierarchicvectorwrapper.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_/_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_/_c_o_m_m_o_n_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +_N_a_m_e_s_p_a_c_e_s │ │ │ │ │ +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_/_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_/_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_:_:_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_<_ _V_,_ _C_O_ _> │ │ │ │ │ -  A wrapper providing multiindex access to vector entries. _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 │ │ │ │ │ -_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r< V >  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_h_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r (V &v) │ │ │ │ │ -  │ │ │ │ │ -template(), int >::type = 0> │ │ │ │ │ - V &  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_: │ │ │ │ │ - _m_a_k_e_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_F_o_r_M_u_l_t_i_I_n_d_e_x (V &v) │ │ │ │ │ -  │ │ │ │ │ -template(), int >::type = 0> │ │ │ │ │ -_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r< V >  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_: │ │ │ │ │ - _m_a_k_e_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_F_o_r_M_u_l_t_i_I_n_d_e_x (V &v) │ │ │ │ │ -  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00050_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: hierarchicvectorwrapper.hh Source File │ │ │ │ +dune-functions: localfunction_imp.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,304 +70,92 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
hierarchicvectorwrapper.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICVECTORWRAPPER_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICVECTORWRAPPER_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_COMMON_LOCALFUNCTION_FUNCTION_IMP_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_COMMON_LOCALFUNCTION_FUNCTION_IMP_HH
│ │ │ │
5
│ │ │ │ -
6#include <dune/common/concept.hh>
│ │ │ │ -
7#include <dune/common/hybridutilities.hh>
│ │ │ │ -
8#include <dune/common/indices.hh>
│ │ │ │ + │ │ │ │ + │ │ │ │ +
8
│ │ │ │
9
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ +
10
│ │ │ │ +
11namespace Dune {
│ │ │ │ +
12namespace Functions {
│ │ │ │ +
13namespace Imp {
│ │ │ │
14
│ │ │ │ -
15
│ │ │ │ -
16namespace Dune {
│ │ │ │ -
17namespace Functions {
│ │ │ │ -
18
│ │ │ │ -
19
│ │ │ │ -
20
│ │ │ │ -
21namespace Imp {
│ │ │ │ -
22
│ │ │ │ -
23 // Construct default coefficient type from vector and multiindex type
│ │ │ │ -
24 // This requires that MultiIndex has a static size. Otherwise the
│ │ │ │ -
25 // vector type itself is returned.
│ │ │ │ -
26 template<class V, class MultiIndex>
│ │ │ │ -
27 struct CoefficientType
│ │ │ │ -
28 {
│ │ │ │ -
29 template<class E, std::size_t size>
│ │ │ │ -
30 struct DefaultCoefficientTypeHelper
│ │ │ │ -
31 {
│ │ │ │ -
32 using E0 = decltype(std::declval<E>()[Dune::Indices::_0]);
│ │ │ │ -
33 using type = typename DefaultCoefficientTypeHelper<E0, size-1>::type;
│ │ │ │ -
34 };
│ │ │ │ -
35
│ │ │ │ -
36 template<class E>
│ │ │ │ -
37 struct DefaultCoefficientTypeHelper<E, 0>
│ │ │ │ -
38 {
│ │ │ │ -
39 using type = E;
│ │ │ │ -
40 };
│ │ │ │ -
41
│ │ │ │ -
42 template<class MI,
│ │ │ │ -
43 typename std::enable_if<HasStaticSize<MI>::value, int>::type = 0>
│ │ │ │ -
44 static constexpr std::size_t getStaticSizeOrZero()
│ │ │ │ -
45 {
│ │ │ │ -
46 return StaticSize<MI>::value;
│ │ │ │ -
47 }
│ │ │ │ -
48
│ │ │ │ -
49 template<class MI,
│ │ │ │ -
50 typename std::enable_if<not HasStaticSize<MI>::value, int>::type = 0>
│ │ │ │ -
51 static constexpr std::size_t getStaticSizeOrZero()
│ │ │ │ -
52 {
│ │ │ │ -
53 return 0;
│ │ │ │ -
54 }
│ │ │ │ -
55
│ │ │ │ -
56 using type = typename DefaultCoefficientTypeHelper<V, getStaticSizeOrZero<MultiIndex>()>::type;
│ │ │ │ -
57 };
│ │ │ │ -
58
│ │ │ │ -
59
│ │ │ │ -
60
│ │ │ │ -
61 // This tag class is used as Coefficient template parameter
│ │ │ │ -
62 // for HierarchicVectorWrapper if the coefficient type should
│ │ │ │ -
63 // be deduced.
│ │ │ │ -
64 struct DeducedCoefficientTag {};
│ │ │ │ +
15// Interface of type erasure wrapper
│ │ │ │ +
16//
│ │ │ │ +
17// Notice that the basic interface of polymorphic classes (destructor, clone, ...)
│ │ │ │ +
18// will be added by the type erasure foundation classes.
│ │ │ │ +
19template<class Signature, class DerivativeInterface, class LocalContext>
│ │ │ │ +
20class LocalFunctionWrapperInterface :
│ │ │ │ +
21 public DifferentiableFunctionWrapperInterface<Signature, DerivativeInterface>
│ │ │ │ +
22{
│ │ │ │ +
23public:
│ │ │ │ +
24 virtual void bind(const LocalContext&) = 0;
│ │ │ │ +
25
│ │ │ │ +
26 virtual void unbind() = 0;
│ │ │ │ +
27
│ │ │ │ +
28 virtual bool bound() const = 0;
│ │ │ │ +
29
│ │ │ │ +
30 virtual const LocalContext& localContext() const = 0;
│ │ │ │ +
31};
│ │ │ │ +
32
│ │ │ │ +
33
│ │ │ │ +
34// Implementation of type erasure wrapper
│ │ │ │ +
35template<class Signature, class DerivativeInterface, class LocalContext, class B>
│ │ │ │ +
36class LocalFunctionWrapperImplementation :
│ │ │ │ +
37 public DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>
│ │ │ │ +
38{
│ │ │ │ +
39 using Base = DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>;
│ │ │ │ +
40public:
│ │ │ │ +
41 using Base::Base;
│ │ │ │ +
42
│ │ │ │ +
43 virtual void bind(const LocalContext& context)
│ │ │ │ +
44 {
│ │ │ │ +
45 this->get().bind(context);
│ │ │ │ +
46 }
│ │ │ │ +
47
│ │ │ │ +
48 virtual void unbind()
│ │ │ │ +
49 {
│ │ │ │ +
50 this->get().unbind();
│ │ │ │ +
51 }
│ │ │ │ +
52
│ │ │ │ +
53 virtual bool bound() const
│ │ │ │ +
54 {
│ │ │ │ +
55 return this->get().bound();
│ │ │ │ +
56 }
│ │ │ │ +
57
│ │ │ │ +
58 virtual const LocalContext& localContext() const
│ │ │ │ +
59 {
│ │ │ │ +
60 return this->get().localContext();
│ │ │ │ +
61 }
│ │ │ │ +
62};
│ │ │ │ +
63
│ │ │ │ +
64}}} // namespace Dune::Functions::Imp
│ │ │ │
65
│ │ │ │ -
66} // namespace Imp
│ │ │ │ +
66
│ │ │ │
67
│ │ │ │ -
68
│ │ │ │ -
69
│ │ │ │ -
90template<class V, class CO=Imp::DeducedCoefficientTag>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
92{
│ │ │ │ -
93 template<class MultiIndex>
│ │ │ │ -
94 using Coefficient = typename std::conditional< std::is_same<Imp::DeducedCoefficientTag,CO>::value and HasStaticSize<MultiIndex>::value,
│ │ │ │ -
95 typename Imp::CoefficientType<V, MultiIndex>::type,
│ │ │ │ -
96 CO
│ │ │ │ -
97 >::type;
│ │ │ │ -
98
│ │ │ │ -
99
│ │ │ │ -
100 using size_type = std::size_t;
│ │ │ │ -
101
│ │ │ │ -
102 template<class C, class SizeProvider,
│ │ │ │ -
103 typename std::enable_if< not models<Concept::HasResize, C>(), int>::type = 0,
│ │ │ │ -
104 typename std::enable_if< not models<Concept::HasSizeMethod, C>(), int>::type = 0>
│ │ │ │ -
105 static void resizeHelper(C& c, const SizeProvider& sizeProvider, typename SizeProvider::SizePrefix prefix)
│ │ │ │ -
106 {
│ │ │ │ -
107 auto size = sizeProvider.size(prefix);
│ │ │ │ -
108 if (size != 0)
│ │ │ │ -
109 DUNE_THROW(RangeError, "Can't resize scalar vector entry v[" << prefix << "] to size(" << prefix << ")=" << size);
│ │ │ │ -
110 }
│ │ │ │ -
111
│ │ │ │ -
112 struct StaticResizeHelper
│ │ │ │ -
113 {
│ │ │ │ -
114 template<class I, class C, class SizeProvider>
│ │ │ │ -
115 static void apply(I&& i, C& c, const SizeProvider& sizeProvider, typename SizeProvider::SizePrefix prefix)
│ │ │ │ -
116 {
│ │ │ │ -
117 prefix.back() = i;
│ │ │ │ -
118 resizeHelper(c[i], sizeProvider, prefix);
│ │ │ │ -
119 }
│ │ │ │ -
120 };
│ │ │ │ -
121
│ │ │ │ -
122 template<class C, class SizeProvider,
│ │ │ │ -
123 typename std::enable_if< not models<Concept::HasResize, C>(), int>::type = 0,
│ │ │ │ -
124 typename std::enable_if< models<Concept::HasSizeMethod, C>(), int>::type = 0>
│ │ │ │ -
125 static void resizeHelper(C& c, const SizeProvider& sizeProvider, typename SizeProvider::SizePrefix prefix)
│ │ │ │ -
126 {
│ │ │ │ -
127 auto size = sizeProvider.size(prefix);
│ │ │ │ -
128 if (size == 0)
│ │ │ │ -
129 return;
│ │ │ │ -
130
│ │ │ │ -
131 if (c.size() != size)
│ │ │ │ -
132 DUNE_THROW(RangeError, "Can't resize statically sized vector entry v[" << prefix << "] of size " << c.size() << " to size(" << prefix << ")=" << size);
│ │ │ │ -
133
│ │ │ │ -
134 using namespace Dune::Hybrid;
│ │ │ │ -
135 prefix.push_back(0);
│ │ │ │ -
136 forEach(integralRange(Hybrid::size(c)), [&](auto&& i) {
│ │ │ │ -
137 StaticResizeHelper::apply(i, c, sizeProvider, prefix);
│ │ │ │ -
138 });
│ │ │ │ -
139 }
│ │ │ │ -
140
│ │ │ │ -
141 template<class C, class SizeProvider,
│ │ │ │ -
142 typename std::enable_if< models<Concept::HasResize, C>(), int>::type = 0>
│ │ │ │ -
143 static void resizeHelper(C& c, const SizeProvider& sizeProvider, typename SizeProvider::SizePrefix prefix)
│ │ │ │ -
144 {
│ │ │ │ -
145 auto size = sizeProvider.size(prefix);
│ │ │ │ -
146 if (size==0)
│ │ │ │ -
147 {
│ │ │ │ -
148 if (c.size()==0)
│ │ │ │ -
149 DUNE_THROW(RangeError, "Can't resize dynamically sized vector entry v[" << prefix << "]. Its size is 0 but the target size is unknown due to size(" << prefix << ")=0.");
│ │ │ │ -
150 else
│ │ │ │ -
151 return;
│ │ │ │ -
152 }
│ │ │ │ -
153
│ │ │ │ -
154 c.resize(size);
│ │ │ │ -
155 prefix.push_back(0);
│ │ │ │ -
156 for(std::size_t i=0; i<size; ++i)
│ │ │ │ -
157 {
│ │ │ │ -
158 prefix.back() = i;
│ │ │ │ -
159 resizeHelper(c[i], sizeProvider, prefix);
│ │ │ │ -
160 }
│ │ │ │ -
161 }
│ │ │ │ -
162
│ │ │ │ -
163
│ │ │ │ -
164
│ │ │ │ -
165public:
│ │ │ │ -
166
│ │ │ │ -
167 using Vector = V;
│ │ │ │ -
168
│ │ │ │ -
169 template<class MultiIndex>
│ │ │ │ -
170 using Entry = Coefficient<MultiIndex>;
│ │ │ │ -
171
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
173 vector_(&vector)
│ │ │ │ -
174 {}
│ │ │ │ -
│ │ │ │ -
175
│ │ │ │ -
176 template<class SizeProvider>
│ │ │ │ -
│ │ │ │ -
177 void resize(const SizeProvider& sizeProvider)
│ │ │ │ -
178 {
│ │ │ │ -
179 typename SizeProvider::SizePrefix prefix;
│ │ │ │ -
180 prefix.resize(0);
│ │ │ │ -
181 resizeHelper(*vector_, sizeProvider, prefix);
│ │ │ │ -
182 }
│ │ │ │ -
│ │ │ │ -
183
│ │ │ │ -
184 template<class MultiIndex>
│ │ │ │ -
│ │ │ │ -
185 const Entry<MultiIndex>& operator[](const MultiIndex& index) const
│ │ │ │ -
186 {
│ │ │ │ -
187 static_assert(not std::is_same<Imp::DeducedCoefficientTag,Entry<MultiIndex>>::value, "Coefficient type for HierarchicVectorWrapper and given multi-index type cannot be determined automatically!");
│ │ │ │ -
188 return hybridMultiIndexAccess<const Entry<MultiIndex>&>(*vector_, index);
│ │ │ │ -
189 }
│ │ │ │ -
│ │ │ │ -
190
│ │ │ │ -
191 template<class MultiIndex>
│ │ │ │ -
│ │ │ │ -
192 Entry<MultiIndex>& operator[](const MultiIndex& index)
│ │ │ │ -
193 {
│ │ │ │ -
194 static_assert(not std::is_same<Imp::DeducedCoefficientTag,Entry<MultiIndex>>::value, "Coefficient type for HierarchicVectorWrapper and given multi-index type cannot be determined automatically!");
│ │ │ │ -
195 return hybridMultiIndexAccess<Entry<MultiIndex>&>(*vector_, index);
│ │ │ │ -
196 }
│ │ │ │ -
│ │ │ │ -
197
│ │ │ │ -
198 template<class MultiIndex>
│ │ │ │ -
│ │ │ │ -
199 const Entry<MultiIndex>& operator()(const MultiIndex& index) const
│ │ │ │ -
200 {
│ │ │ │ -
201 static_assert(not std::is_same<Imp::DeducedCoefficientTag,Entry<MultiIndex>>::value, "Coefficient type for HierarchicVectorWrapper and given multi-index type cannot be determined automatically!");
│ │ │ │ -
202 return (*this)[index];
│ │ │ │ -
203 }
│ │ │ │ -
│ │ │ │ -
204
│ │ │ │ -
205 template<class MultiIndex>
│ │ │ │ -
│ │ │ │ -
206 Entry<MultiIndex>& operator()(const MultiIndex& index)
│ │ │ │ -
207 {
│ │ │ │ -
208 static_assert(not std::is_same<Imp::DeducedCoefficientTag,Entry<MultiIndex>>::value, "Coefficient type for HierarchicVectorWrapper and given multi-index type cannot be determined automatically!");
│ │ │ │ -
209 return (*this)[index];
│ │ │ │ -
210 }
│ │ │ │ -
│ │ │ │ -
211
│ │ │ │ -
│ │ │ │ -
212 const Vector& vector() const
│ │ │ │ -
213 {
│ │ │ │ -
214 return *vector_;
│ │ │ │ -
215 }
│ │ │ │ -
│ │ │ │ -
216
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
218 {
│ │ │ │ -
219 return *vector_;
│ │ │ │ -
220 }
│ │ │ │ -
│ │ │ │ -
221
│ │ │ │ -
222private:
│ │ │ │ -
223
│ │ │ │ -
224 Vector* vector_;
│ │ │ │ -
225};
│ │ │ │ -
│ │ │ │ -
226
│ │ │ │ -
227
│ │ │ │ -
228
│ │ │ │ -
229
│ │ │ │ -
230template<class V>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
232{
│ │ │ │ - │ │ │ │ -
234}
│ │ │ │ -
│ │ │ │ -
235
│ │ │ │ -
236
│ │ │ │ -
237
│ │ │ │ -
238template<class MultiIndex, class V,
│ │ │ │ -
239 typename std::enable_if< models<Concept::HasIndexAccess, V, MultiIndex>(), int>::type = 0>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
241{
│ │ │ │ -
242 return v;
│ │ │ │ -
243}
│ │ │ │ -
│ │ │ │ -
244
│ │ │ │ -
245
│ │ │ │ -
246
│ │ │ │ -
247template<class MultiIndex, class V,
│ │ │ │ -
248 typename std::enable_if< not models<Concept::HasIndexAccess, V, MultiIndex>(), int>::type = 0>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
250{
│ │ │ │ - │ │ │ │ -
252}
│ │ │ │ -
│ │ │ │ -
253
│ │ │ │ -
254
│ │ │ │ -
255
│ │ │ │ -
256} // namespace Dune::Functions
│ │ │ │ -
257} // namespace Dune
│ │ │ │ -
258
│ │ │ │ -
259
│ │ │ │ -
260#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICVECTORWRAPPER_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ +
68#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH
│ │ │ │ + │ │ │ │ + │ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
V & makeHierarchicVectorForMultiIndex(V &v)
Definition hierarchicvectorwrapper.hh:240
│ │ │ │ -
HierarchicVectorWrapper< V > hierarchicVector(V &v)
Definition hierarchicvectorwrapper.hh:231
│ │ │ │ -
Check if type is a statically sized container.
Definition type_traits.hh:83
│ │ │ │ -
A wrapper providing multiindex access to vector entries.
Definition hierarchicvectorwrapper.hh:92
│ │ │ │ -
Entry< MultiIndex > & operator()(const MultiIndex &index)
Definition hierarchicvectorwrapper.hh:206
│ │ │ │ -
Entry< MultiIndex > & operator[](const MultiIndex &index)
Definition hierarchicvectorwrapper.hh:192
│ │ │ │ -
const Entry< MultiIndex > & operator[](const MultiIndex &index) const
Definition hierarchicvectorwrapper.hh:185
│ │ │ │ -
Vector & vector()
Definition hierarchicvectorwrapper.hh:217
│ │ │ │ -
V Vector
Definition hierarchicvectorwrapper.hh:167
│ │ │ │ -
Coefficient< MultiIndex > Entry
Definition hierarchicvectorwrapper.hh:170
│ │ │ │ -
const Vector & vector() const
Definition hierarchicvectorwrapper.hh:212
│ │ │ │ -
HierarchicVectorWrapper(Vector &vector)
Definition hierarchicvectorwrapper.hh:172
│ │ │ │ -
const Entry< MultiIndex > & operator()(const MultiIndex &index) const
Definition hierarchicvectorwrapper.hh:199
│ │ │ │ -
void resize(const SizeProvider &sizeProvider)
Definition hierarchicvectorwrapper.hh:177
│ │ │ │ - │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,327 +1,88 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -hierarchicvectorwrapper.hh │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICVECTORWRAPPER_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICVECTORWRAPPER_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_COMMON_LOCALFUNCTION_FUNCTION_IMP_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_COMMON_LOCALFUNCTION_FUNCTION_IMP_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ -8#include │ │ │ │ │ +6#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> │ │ │ │ │ +7#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> │ │ │ │ │ +8 │ │ │ │ │ 9 │ │ │ │ │ -10#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> │ │ │ │ │ -11#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> │ │ │ │ │ -12#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> │ │ │ │ │ -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_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ │ +10 │ │ │ │ │ +11namespace _D_u_n_e { │ │ │ │ │ +12namespace Functions { │ │ │ │ │ +13namespace Imp { │ │ │ │ │ 14 │ │ │ │ │ -15 │ │ │ │ │ -16namespace _D_u_n_e { │ │ │ │ │ -17namespace Functions { │ │ │ │ │ -18 │ │ │ │ │ -19 │ │ │ │ │ -20 │ │ │ │ │ -21namespace Imp { │ │ │ │ │ -22 │ │ │ │ │ -23 // Construct default coefficient type from vector and multiindex type │ │ │ │ │ -24 // This requires that MultiIndex has a static size. Otherwise the │ │ │ │ │ -25 // vector type itself is returned. │ │ │ │ │ -26 template │ │ │ │ │ -27 struct CoefficientType │ │ │ │ │ -28 { │ │ │ │ │ -29 template │ │ │ │ │ -30 struct DefaultCoefficientTypeHelper │ │ │ │ │ -31 { │ │ │ │ │ -32 using E0 = decltype(std::declval()[Dune::Indices::_0]); │ │ │ │ │ -33 using type = typename DefaultCoefficientTypeHelper::type; │ │ │ │ │ -34 }; │ │ │ │ │ -35 │ │ │ │ │ -36 template │ │ │ │ │ -37 struct DefaultCoefficientTypeHelper │ │ │ │ │ -38 { │ │ │ │ │ -39 using type = E; │ │ │ │ │ -40 }; │ │ │ │ │ -41 │ │ │ │ │ -42 template::value, int>::type = 0> │ │ │ │ │ -44 static constexpr std::size_t getStaticSizeOrZero() │ │ │ │ │ -45 { │ │ │ │ │ -46 return StaticSize::value; │ │ │ │ │ -47 } │ │ │ │ │ -48 │ │ │ │ │ -49 template::value, int>::type = 0> │ │ │ │ │ -51 static constexpr std::size_t getStaticSizeOrZero() │ │ │ │ │ -52 { │ │ │ │ │ -53 return 0; │ │ │ │ │ -54 } │ │ │ │ │ -55 │ │ │ │ │ -56 using type = typename DefaultCoefficientTypeHelper()>::type; │ │ │ │ │ -57 }; │ │ │ │ │ -58 │ │ │ │ │ -59 │ │ │ │ │ -60 │ │ │ │ │ -61 // This tag class is used as Coefficient template parameter │ │ │ │ │ -62 // for HierarchicVectorWrapper if the coefficient type should │ │ │ │ │ -63 // be deduced. │ │ │ │ │ -64 struct DeducedCoefficientTag {}; │ │ │ │ │ +15// Interface of type erasure wrapper │ │ │ │ │ +16// │ │ │ │ │ +17// Notice that the basic interface of polymorphic classes (destructor, clone, │ │ │ │ │ +...) │ │ │ │ │ +18// will be added by the type erasure foundation classes. │ │ │ │ │ +19template │ │ │ │ │ +20class LocalFunctionWrapperInterface : │ │ │ │ │ +21 public DifferentiableFunctionWrapperInterface │ │ │ │ │ +22{ │ │ │ │ │ +23public: │ │ │ │ │ +24 virtual void bind(const LocalContext&) = 0; │ │ │ │ │ +25 │ │ │ │ │ +26 virtual void unbind() = 0; │ │ │ │ │ +27 │ │ │ │ │ +28 virtual bool bound() const = 0; │ │ │ │ │ +29 │ │ │ │ │ +30 virtual const LocalContext& localContext() const = 0; │ │ │ │ │ +31}; │ │ │ │ │ +32 │ │ │ │ │ +33 │ │ │ │ │ +34// Implementation of type erasure wrapper │ │ │ │ │ +35template │ │ │ │ │ +36class LocalFunctionWrapperImplementation : │ │ │ │ │ +37 public DifferentiableFunctionWrapperImplementation │ │ │ │ │ +38{ │ │ │ │ │ +39 using Base = DifferentiableFunctionWrapperImplementation; │ │ │ │ │ +40public: │ │ │ │ │ +41 using Base::Base; │ │ │ │ │ +42 │ │ │ │ │ +43 virtual void bind(const LocalContext& context) │ │ │ │ │ +44 { │ │ │ │ │ +45 this->get().bind(context); │ │ │ │ │ +46 } │ │ │ │ │ +47 │ │ │ │ │ +48 virtual void unbind() │ │ │ │ │ +49 { │ │ │ │ │ +50 this->get().unbind(); │ │ │ │ │ +51 } │ │ │ │ │ +52 │ │ │ │ │ +53 virtual bool bound() const │ │ │ │ │ +54 { │ │ │ │ │ +55 return this->get().bound(); │ │ │ │ │ +56 } │ │ │ │ │ +57 │ │ │ │ │ +58 virtual const LocalContext& localContext() const │ │ │ │ │ +59 { │ │ │ │ │ +60 return this->get().localContext(); │ │ │ │ │ +61 } │ │ │ │ │ +62}; │ │ │ │ │ +63 │ │ │ │ │ +64}}} // namespace Dune::Functions::Imp │ │ │ │ │ 65 │ │ │ │ │ -66} // namespace Imp │ │ │ │ │ +66 │ │ │ │ │ 67 │ │ │ │ │ -68 │ │ │ │ │ -69 │ │ │ │ │ -90template │ │ │ │ │ -_9_1class _H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r │ │ │ │ │ -92{ │ │ │ │ │ -93 template │ │ │ │ │ -94 using Coefficient = typename std::conditional< std::is_same::value and _H_a_s_S_t_a_t_i_c_S_i_z_e_<_M_u_l_t_i_I_n_d_e_x_>_:_:_v_a_l_u_e, │ │ │ │ │ -95 typename Imp::CoefficientType::type, │ │ │ │ │ -96 CO │ │ │ │ │ -97 >::type; │ │ │ │ │ -98 │ │ │ │ │ -99 │ │ │ │ │ -100 using size_type = std::size_t; │ │ │ │ │ -101 │ │ │ │ │ -102 template(), int>::type = │ │ │ │ │ -0, │ │ │ │ │ -104 typename std::enable_if< not models(), int>:: │ │ │ │ │ -type = 0> │ │ │ │ │ -105 static void resizeHelper(C& c, const SizeProvider& sizeProvider, typename │ │ │ │ │ -SizeProvider::SizePrefix prefix) │ │ │ │ │ -106 { │ │ │ │ │ -107 auto size = sizeProvider.size(prefix); │ │ │ │ │ -108 if (size != 0) │ │ │ │ │ -109 DUNE_THROW(RangeError, "Can't resize scalar vector entry v[" << prefix << │ │ │ │ │ -"] to size(" << prefix << ")=" << size); │ │ │ │ │ -110 } │ │ │ │ │ -111 │ │ │ │ │ -112 struct StaticResizeHelper │ │ │ │ │ -113 { │ │ │ │ │ -114 template │ │ │ │ │ -115 static void apply(I&& i, C& c, const SizeProvider& sizeProvider, typename │ │ │ │ │ -SizeProvider::SizePrefix prefix) │ │ │ │ │ -116 { │ │ │ │ │ -117 prefix.back() = i; │ │ │ │ │ -118 resizeHelper(c[i], sizeProvider, prefix); │ │ │ │ │ -119 } │ │ │ │ │ -120 }; │ │ │ │ │ -121 │ │ │ │ │ -122 template(), int>::type = │ │ │ │ │ -0, │ │ │ │ │ -124 typename std::enable_if< models(), int>::type = │ │ │ │ │ -0> │ │ │ │ │ -125 static void resizeHelper(C& c, const SizeProvider& sizeProvider, typename │ │ │ │ │ -SizeProvider::SizePrefix prefix) │ │ │ │ │ -126 { │ │ │ │ │ -127 auto size = sizeProvider.size(prefix); │ │ │ │ │ -128 if (size == 0) │ │ │ │ │ -129 return; │ │ │ │ │ -130 │ │ │ │ │ -131 if (c.size() != size) │ │ │ │ │ -132 DUNE_THROW(RangeError, "Can't resize statically sized vector entry v[" << │ │ │ │ │ -prefix << "] of size " << c.size() << " to size(" << prefix << ")=" << size); │ │ │ │ │ -133 │ │ │ │ │ -134 using namespace Dune::Hybrid; │ │ │ │ │ -135 prefix.push_back(0); │ │ │ │ │ -136 forEach(integralRange(Hybrid::size(c)), [&](auto&& i) { │ │ │ │ │ -137 StaticResizeHelper::apply(i, c, sizeProvider, prefix); │ │ │ │ │ -138 }); │ │ │ │ │ -139 } │ │ │ │ │ -140 │ │ │ │ │ -141 template(), int>::type = 0> │ │ │ │ │ -143 static void resizeHelper(C& c, const SizeProvider& sizeProvider, typename │ │ │ │ │ -SizeProvider::SizePrefix prefix) │ │ │ │ │ -144 { │ │ │ │ │ -145 auto size = sizeProvider.size(prefix); │ │ │ │ │ -146 if (size==0) │ │ │ │ │ -147 { │ │ │ │ │ -148 if (c.size()==0) │ │ │ │ │ -149 DUNE_THROW(RangeError, "Can't resize dynamically sized vector entry v[" << │ │ │ │ │ -prefix << "]. Its size is 0 but the target size is unknown due to size(" << │ │ │ │ │ -prefix << ")=0."); │ │ │ │ │ -150 else │ │ │ │ │ -151 return; │ │ │ │ │ -152 } │ │ │ │ │ -153 │ │ │ │ │ -154 c.resize(size); │ │ │ │ │ -155 prefix.push_back(0); │ │ │ │ │ -156 for(std::size_t i=0; i │ │ │ │ │ -_1_7_0 using _E_n_t_r_y = Coefficient; │ │ │ │ │ -171 │ │ │ │ │ -_1_7_2 _H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r(_V_e_c_t_o_r& _v_e_c_t_o_r) : │ │ │ │ │ -173 vector_(&_v_e_c_t_o_r) │ │ │ │ │ -174 {} │ │ │ │ │ -175 │ │ │ │ │ -176 template │ │ │ │ │ -_1_7_7 void _r_e_s_i_z_e(const SizeProvider& sizeProvider) │ │ │ │ │ -178 { │ │ │ │ │ -179 typename SizeProvider::SizePrefix prefix; │ │ │ │ │ -180 prefix.resize(0); │ │ │ │ │ -181 resizeHelper(*vector_, sizeProvider, prefix); │ │ │ │ │ -182 } │ │ │ │ │ -183 │ │ │ │ │ -184 template │ │ │ │ │ -_1_8_5 const _E_n_t_r_y_<_M_u_l_t_i_I_n_d_e_x_>& _o_p_e_r_a_t_o_r_[_](const MultiIndex& index) const │ │ │ │ │ -186 { │ │ │ │ │ -187 static_assert(not std::is_same>::value, "Coefficient type for │ │ │ │ │ -HierarchicVectorWrapper and given multi-index type cannot be determined │ │ │ │ │ -automatically!"); │ │ │ │ │ -188 return hybridMultiIndexAccess&>(*vector_, index); │ │ │ │ │ -189 } │ │ │ │ │ -190 │ │ │ │ │ -191 template │ │ │ │ │ -_1_9_2 _E_n_t_r_y_<_M_u_l_t_i_I_n_d_e_x_>& _o_p_e_r_a_t_o_r_[_](const MultiIndex& index) │ │ │ │ │ -193 { │ │ │ │ │ -194 static_assert(not std::is_same>::value, "Coefficient type for │ │ │ │ │ -HierarchicVectorWrapper and given multi-index type cannot be determined │ │ │ │ │ -automatically!"); │ │ │ │ │ -195 return hybridMultiIndexAccess&>(*vector_, index); │ │ │ │ │ -196 } │ │ │ │ │ -197 │ │ │ │ │ -198 template │ │ │ │ │ -_1_9_9 const _E_n_t_r_y_<_M_u_l_t_i_I_n_d_e_x_>& _o_p_e_r_a_t_o_r_(_)(const MultiIndex& index) const │ │ │ │ │ -200 { │ │ │ │ │ -201 static_assert(not std::is_same>::value, "Coefficient type for │ │ │ │ │ -HierarchicVectorWrapper and given multi-index type cannot be determined │ │ │ │ │ -automatically!"); │ │ │ │ │ -202 return (*this)[index]; │ │ │ │ │ -203 } │ │ │ │ │ -204 │ │ │ │ │ -205 template │ │ │ │ │ -_2_0_6 _E_n_t_r_y_<_M_u_l_t_i_I_n_d_e_x_>& _o_p_e_r_a_t_o_r_(_)(const MultiIndex& index) │ │ │ │ │ -207 { │ │ │ │ │ -208 static_assert(not std::is_same>::value, "Coefficient type for │ │ │ │ │ -HierarchicVectorWrapper and given multi-index type cannot be determined │ │ │ │ │ -automatically!"); │ │ │ │ │ -209 return (*this)[index]; │ │ │ │ │ -210 } │ │ │ │ │ -211 │ │ │ │ │ -_2_1_2 const _V_e_c_t_o_r& _v_e_c_t_o_r() const │ │ │ │ │ -213 { │ │ │ │ │ -214 return *vector_; │ │ │ │ │ -215 } │ │ │ │ │ -216 │ │ │ │ │ -_2_1_7 _V_e_c_t_o_r& _v_e_c_t_o_r() │ │ │ │ │ -218 { │ │ │ │ │ -219 return *vector_; │ │ │ │ │ -220 } │ │ │ │ │ -221 │ │ │ │ │ -222private: │ │ │ │ │ -223 │ │ │ │ │ -224 _V_e_c_t_o_r* vector_; │ │ │ │ │ -225}; │ │ │ │ │ -226 │ │ │ │ │ -227 │ │ │ │ │ -228 │ │ │ │ │ -229 │ │ │ │ │ -230template │ │ │ │ │ -_2_3_1_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_<_ _V_ _> _h_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r(V& v) │ │ │ │ │ -232{ │ │ │ │ │ -233 return _H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_<_V_>(v); │ │ │ │ │ -234} │ │ │ │ │ -235 │ │ │ │ │ -236 │ │ │ │ │ -237 │ │ │ │ │ -238template(), │ │ │ │ │ -int>::type = 0> │ │ │ │ │ -_2_4_0V& _m_a_k_e_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_F_o_r_M_u_l_t_i_I_n_d_e_x(V& v) │ │ │ │ │ -241{ │ │ │ │ │ -242 return v; │ │ │ │ │ -243} │ │ │ │ │ -244 │ │ │ │ │ -245 │ │ │ │ │ -246 │ │ │ │ │ -247template │ │ │ │ │ -(), int>::type = 0> │ │ │ │ │ -_2_4_9_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_<_ _V_ _> _m_a_k_e_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_F_o_r_M_u_l_t_i_I_n_d_e_x(V& v) │ │ │ │ │ -250{ │ │ │ │ │ -251 return _H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_<_V_>(v); │ │ │ │ │ -252} │ │ │ │ │ -253 │ │ │ │ │ -254 │ │ │ │ │ -255 │ │ │ │ │ -256} // namespace Dune::Functions │ │ │ │ │ -257} // namespace Dune │ │ │ │ │ -258 │ │ │ │ │ -259 │ │ │ │ │ -260#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICVECTORWRAPPER_HH │ │ │ │ │ +68#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH │ │ │ │ │ _t_y_p_e___t_r_a_i_t_s_._h_h │ │ │ │ │ -_u_t_i_l_i_t_y_._h_h │ │ │ │ │ -_i_n_d_e_x_a_c_c_e_s_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 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_F_o_r_M_u_l_t_i_I_n_d_e_x │ │ │ │ │ -V & makeHierarchicVectorForMultiIndex(V &v) │ │ │ │ │ -DDeeffiinniittiioonn hierarchicvectorwrapper.hh:240 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_h_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r │ │ │ │ │ -HierarchicVectorWrapper< V > hierarchicVector(V &v) │ │ │ │ │ -DDeeffiinniittiioonn hierarchicvectorwrapper.hh:231 │ │ │ │ │ -_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:83 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r │ │ │ │ │ -A wrapper providing multiindex access to vector entries. │ │ │ │ │ -DDeeffiinniittiioonn hierarchicvectorwrapper.hh:92 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ │ -Entry< MultiIndex > & operator()(const MultiIndex &index) │ │ │ │ │ -DDeeffiinniittiioonn hierarchicvectorwrapper.hh:206 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_:_:_o_p_e_r_a_t_o_r_[_] │ │ │ │ │ -Entry< MultiIndex > & operator[](const MultiIndex &index) │ │ │ │ │ -DDeeffiinniittiioonn hierarchicvectorwrapper.hh:192 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_:_:_o_p_e_r_a_t_o_r_[_] │ │ │ │ │ -const Entry< MultiIndex > & operator[](const MultiIndex &index) const │ │ │ │ │ -DDeeffiinniittiioonn hierarchicvectorwrapper.hh:185 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_:_:_v_e_c_t_o_r │ │ │ │ │ -Vector & vector() │ │ │ │ │ -DDeeffiinniittiioonn hierarchicvectorwrapper.hh:217 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_:_:_V_e_c_t_o_r │ │ │ │ │ -V Vector │ │ │ │ │ -DDeeffiinniittiioonn hierarchicvectorwrapper.hh:167 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_:_:_E_n_t_r_y │ │ │ │ │ -Coefficient< MultiIndex > Entry │ │ │ │ │ -DDeeffiinniittiioonn hierarchicvectorwrapper.hh:170 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_:_:_v_e_c_t_o_r │ │ │ │ │ -const Vector & vector() const │ │ │ │ │ -DDeeffiinniittiioonn hierarchicvectorwrapper.hh:212 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_:_:_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r │ │ │ │ │ -HierarchicVectorWrapper(Vector &vector) │ │ │ │ │ -DDeeffiinniittiioonn hierarchicvectorwrapper.hh:172 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ │ -const Entry< MultiIndex > & operator()(const MultiIndex &index) const │ │ │ │ │ -DDeeffiinniittiioonn hierarchicvectorwrapper.hh:199 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_:_:_r_e_s_i_z_e │ │ │ │ │ -void resize(const SizeProvider &sizeProvider) │ │ │ │ │ -DDeeffiinniittiioonn hierarchicvectorwrapper.hh:177 │ │ │ │ │ -_c_o_n_c_e_p_t_s_._h_h │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00053.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: raviartthomasbasis.hh File Reference │ │ │ │ +dune-functions: callable.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,75 +65,55 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces | │ │ │ │ -Typedefs | │ │ │ │ Functions
│ │ │ │ -
raviartthomasbasis.hh File Reference
│ │ │ │ +
callable.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/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 <memory>
│ │ │ │ +#include <functional>
│ │ │ │ +#include <dune/common/function.hh>
│ │ │ │ +#include <dune/common/shared_ptr.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::Functions::RaviartThomasPreBasis< GV, k >
 
class  Dune::Functions::RaviartThomasNode< GV, k >
class  Dune::Functions::CallableFunctionWrapper< F >
 Wrap a Dune::VirtualFunction into a callable object. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ 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.
 
template<class F >
CallableFunctionWrapper< F > Dune::Functions::callable (const F &f)
 Create a callable object from some Dune::VirtualFunction.
 
template<class F >
CallableFunctionWrapper< F > Dune::Functions::callable (const std::shared_ptr< F > &fp)
 Create a callable object from std::shared_ptr<F>
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,52 +1,36 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -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> │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +callable.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_:_:_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_ _> │ │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r_<_ _F_ _> │ │ │ │ │ +  Wrap a Dune::VirtualFunction into a callable object. _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_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< GV, k > > │ │ │ │ │ -  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. │ │ │ │ │ +template │ │ │ │ │ +_C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r< F >  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_a_l_l_a_b_l_e (const F &f) │ │ │ │ │ +  Create a callable object from some Dune:: │ │ │ │ │ + VirtualFunction. │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +_C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r< F >  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_a_l_l_a_b_l_e (const std::shared_ptr< │ │ │ │ │ + F > &fp) │ │ │ │ │ +  Create a callable object from std::shared_ptr │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00053_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: raviartthomasbasis.hh Source File │ │ │ │ +dune-functions: callable.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,482 +70,106 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
raviartthomasbasis.hh
│ │ │ │ +
callable.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_COMMON_CALLABLE_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_COMMON_CALLABLE_HH
│ │ │ │
5
│ │ │ │ -
6#include <array>
│ │ │ │ -
7#include <dune/common/exceptions.hh>
│ │ │ │ +
6#include <memory>
│ │ │ │ +
7#include <functional>
│ │ │ │
8
│ │ │ │ -
9#include <dune/grid/common/capabilities.hh>
│ │ │ │ -
10#include <dune/grid/common/mcmgmapper.hh>
│ │ │ │ +
9#include <dune/common/function.hh>
│ │ │ │ +
10#include <dune/common/shared_ptr.hh>
│ │ │ │
11
│ │ │ │ -
12#include <dune/localfunctions/common/localfiniteelementvariant.hh>
│ │ │ │ -
13#include <dune/localfunctions/raviartthomas.hh>
│ │ │ │ -
14#include <dune/localfunctions/raviartthomas/raviartthomas0cube2d.hh>
│ │ │ │ -
15#include <dune/localfunctions/raviartthomas/raviartthomas0cube3d.hh>
│ │ │ │ -
16#include <dune/localfunctions/raviartthomas/raviartthomas02d.hh>
│ │ │ │ -
17#include <dune/localfunctions/raviartthomas/raviartthomas03d.hh>
│ │ │ │ -
18#include <dune/localfunctions/raviartthomas/raviartthomas1cube2d.hh>
│ │ │ │ -
19#include <dune/localfunctions/raviartthomas/raviartthomas1cube3d.hh>
│ │ │ │ -
20#include <dune/localfunctions/raviartthomas/raviartthomas12d.hh>
│ │ │ │ -
21#include <dune/localfunctions/raviartthomas/raviartthomas2cube2d.hh>
│ │ │ │ -
22
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
26
│ │ │ │ -
27namespace Dune {
│ │ │ │ -
28namespace Functions {
│ │ │ │ -
29
│ │ │ │ -
30namespace Impl {
│ │ │ │ -
31
│ │ │ │ -
32 template<int dim, typename D, typename R, std::size_t k>
│ │ │ │ -
33 struct RaviartThomasSimplexLocalInfo
│ │ │ │ -
34 {
│ │ │ │ -
35 // Dummy type, must be something that we can have a std::unique_ptr to
│ │ │ │ -
36 using FiniteElement = void*;
│ │ │ │ -
37 };
│ │ │ │ -
38
│ │ │ │ -
39 template<typename D, typename R>
│ │ │ │ -
40 struct RaviartThomasSimplexLocalInfo<2,D,R,0>
│ │ │ │ -
41 {
│ │ │ │ -
42 using FiniteElement = RT02DLocalFiniteElement<D,R>;
│ │ │ │ -
43 };
│ │ │ │ -
44
│ │ │ │ -
45 template<typename D, typename R>
│ │ │ │ -
46 struct RaviartThomasSimplexLocalInfo<2,D,R,1>
│ │ │ │ -
47 {
│ │ │ │ -
48 using FiniteElement = RT12DLocalFiniteElement<D,R>;
│ │ │ │ -
49 };
│ │ │ │ -
50
│ │ │ │ -
51 template<typename D, typename R>
│ │ │ │ -
52 struct RaviartThomasSimplexLocalInfo<3,D,R,0>
│ │ │ │ -
53 {
│ │ │ │ -
54 using FiniteElement = RT03DLocalFiniteElement<D,R>;
│ │ │ │ -
55 };
│ │ │ │ -
56
│ │ │ │ -
57 template<int dim, typename D, typename R, std::size_t k>
│ │ │ │ -
58 struct RaviartThomasCubeLocalInfo
│ │ │ │ -
59 {
│ │ │ │ -
60 // Dummy type, must be something that we can have a std::unique_ptr to
│ │ │ │ -
61 using FiniteElement = void*;
│ │ │ │ -
62 };
│ │ │ │ -
63
│ │ │ │ -
64 template<typename D, typename R>
│ │ │ │ -
65 struct RaviartThomasCubeLocalInfo<2,D,R,0>
│ │ │ │ -
66 {
│ │ │ │ -
67 using FiniteElement = RT0Cube2DLocalFiniteElement<D,R>;
│ │ │ │ -
68 };
│ │ │ │ -
69
│ │ │ │ -
70 template<typename D, typename R>
│ │ │ │ -
71 struct RaviartThomasCubeLocalInfo<2,D,R,1>
│ │ │ │ -
72 {
│ │ │ │ -
73 using FiniteElement = RT1Cube2DLocalFiniteElement<D,R>;
│ │ │ │ -
74 };
│ │ │ │ -
75
│ │ │ │ -
76 template<typename D, typename R>
│ │ │ │ -
77 struct RaviartThomasCubeLocalInfo<2,D,R,2>
│ │ │ │ -
78 {
│ │ │ │ -
79 using FiniteElement = RT2Cube2DLocalFiniteElement<D,R>;
│ │ │ │ -
80 };
│ │ │ │ +
12
│ │ │ │ +
13namespace Dune {
│ │ │ │ +
14namespace Functions {
│ │ │ │ +
15
│ │ │ │ +
16
│ │ │ │ +
17
│ │ │ │ +
18
│ │ │ │ +
36template<class F>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
38{
│ │ │ │ +
39 using Range = typename F::RangeType;
│ │ │ │ +
40 using Domain = typename F::DomainType;
│ │ │ │ +
41
│ │ │ │ +
42 public:
│ │ │ │ +
43
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
51 {
│ │ │ │ +
52 f_ = Dune::stackobject_to_shared_ptr(f);
│ │ │ │ +
53 }
│ │ │ │ +
│ │ │ │ +
54
│ │ │ │ +
│ │ │ │ +
61 CallableFunctionWrapper(const std::shared_ptr<const F>& f) :
│ │ │ │ +
62 f_(f)
│ │ │ │ +
63 {}
│ │ │ │ +
│ │ │ │ +
64
│ │ │ │ +
│ │ │ │ +
70 Range operator()(const Domain& x) const
│ │ │ │ +
71 {
│ │ │ │ +
72 Range y;
│ │ │ │ +
73 f_->evaluate(x, y);
│ │ │ │ +
74 return y;
│ │ │ │ +
75 }
│ │ │ │ +
│ │ │ │ +
76
│ │ │ │ +
77 private:
│ │ │ │ +
78 std::shared_ptr<const F> f_;
│ │ │ │ +
79};
│ │ │ │ +
│ │ │ │ +
80
│ │ │ │
81
│ │ │ │ -
82 template<typename D, typename R>
│ │ │ │ -
83 struct RaviartThomasCubeLocalInfo<3,D,R,0>
│ │ │ │ -
84 {
│ │ │ │ -
85 using FiniteElement = RT0Cube3DLocalFiniteElement<D,R>;
│ │ │ │ -
86 };
│ │ │ │ -
87
│ │ │ │ -
88 template<typename D, typename R>
│ │ │ │ -
89 struct RaviartThomasCubeLocalInfo<3,D,R,1>
│ │ │ │ -
90 {
│ │ │ │ -
91 using FiniteElement = RT1Cube3DLocalFiniteElement<D,R>;
│ │ │ │ -
92 };
│ │ │ │ -
93
│ │ │ │ -
94 template<typename GV, int dim, typename R, std::size_t k>
│ │ │ │ -
95 class RaviartThomasLocalFiniteElementMap
│ │ │ │ -
96 {
│ │ │ │ -
97 using D = typename GV::ctype;
│ │ │ │ -
98 constexpr static bool hasFixedElementType = Capabilities::hasSingleGeometryType<typename GV::Grid>::v;
│ │ │ │ -
99
│ │ │ │ -
100 using CubeFiniteElement = typename RaviartThomasCubeLocalInfo<dim, D, R, k>::FiniteElement;
│ │ │ │ -
101 using SimplexFiniteElement = typename RaviartThomasSimplexLocalInfo<dim, D, R, k>::FiniteElement;
│ │ │ │ -
102
│ │ │ │ -
103 public:
│ │ │ │ -
104
│ │ │ │ -
105 using T = LocalBasisTraits<D, dim, FieldVector<D,dim>, R, dim, FieldVector<R,dim>, FieldMatrix<D,dim,dim> >;
│ │ │ │ -
106
│ │ │ │ -
107 constexpr static unsigned int topologyId = Capabilities::hasSingleGeometryType<typename GV::Grid>::topologyId; // meaningless if hasFixedElementType is false
│ │ │ │ -
108 constexpr static GeometryType type = GeometryType(topologyId, GV::dimension);
│ │ │ │ +
82
│ │ │ │ +
104template<class F>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
106{
│ │ │ │ + │ │ │ │ +
108}
│ │ │ │ +
│ │ │ │
109
│ │ │ │ -
110 using FiniteElement = std::conditional_t<hasFixedElementType,
│ │ │ │ -
111 std::conditional_t<type.isCube(),CubeFiniteElement,SimplexFiniteElement>,
│ │ │ │ -
112 LocalFiniteElementVariant<CubeFiniteElement, SimplexFiniteElement> >;
│ │ │ │ -
113
│ │ │ │ -
114 // Each element facet can have its orientation reversed, hence there are
│ │ │ │ -
115 // 2^#facets different variants.
│ │ │ │ -
116 static std::size_t numVariants(GeometryType type)
│ │ │ │ -
117 {
│ │ │ │ -
118 auto numFacets = referenceElement<D,dim>(type).size(1);
│ │ │ │ -
119 return power(2,numFacets);
│ │ │ │ -
120 }
│ │ │ │ -
121
│ │ │ │ -
122 RaviartThomasLocalFiniteElementMap(const GV& gv)
│ │ │ │ -
123 : elementMapper_(gv, mcmgElementLayout()),
│ │ │ │ -
124 orient_(gv.size(0))
│ │ │ │ -
125 {
│ │ │ │ -
126 if constexpr (hasFixedElementType)
│ │ │ │ -
127 {
│ │ │ │ -
128 variants_.resize(numVariants(type));
│ │ │ │ -
129 for (size_t i = 0; i < numVariants(type); i++)
│ │ │ │ -
130 variants_[i] = FiniteElement(i);
│ │ │ │ -
131 }
│ │ │ │ -
132 else
│ │ │ │ -
133 {
│ │ │ │ -
134 // for mixed grids add offset for cubes
│ │ │ │ -
135 variants_.resize(numVariants(GeometryTypes::simplex(dim)) + numVariants(GeometryTypes::cube(dim)));
│ │ │ │ -
136 for (size_t i = 0; i < numVariants(GeometryTypes::simplex(dim)); i++)
│ │ │ │ -
137 variants_[i] = SimplexFiniteElement(i);
│ │ │ │ -
138 for (size_t i = 0; i < numVariants(GeometryTypes::cube(dim)); i++)
│ │ │ │ -
139 variants_[i + numVariants(GeometryTypes::simplex(dim))] = CubeFiniteElement(i);
│ │ │ │ -
140 }
│ │ │ │ +
110
│ │ │ │ +
136template<class F>
│ │ │ │ +
│ │ │ │ +
137CallableFunctionWrapper<F> callable(const std::shared_ptr<F>& fp)
│ │ │ │ +
138{
│ │ │ │ + │ │ │ │ +
140}
│ │ │ │ +
│ │ │ │
141
│ │ │ │ -
142 for(const auto& cell : elements(gv))
│ │ │ │ -
143 {
│ │ │ │ -
144 unsigned int myId = elementMapper_.index(cell);
│ │ │ │ -
145 orient_[myId] = 0;
│ │ │ │ +
142
│ │ │ │ +
143
│ │ │ │ +
144} // namespace Functions
│ │ │ │ +
145} // namespace Dune
│ │ │ │
146
│ │ │ │ -
147 for (const auto& intersection : intersections(gv,cell))
│ │ │ │ -
148 {
│ │ │ │ -
149 if (intersection.neighbor() && (elementMapper_.index(intersection.outside()) > myId))
│ │ │ │ -
150 orient_[myId] |= (1 << intersection.indexInInside());
│ │ │ │ -
151 }
│ │ │ │ -
152
│ │ │ │ -
153 // for mixed grids add offset for cubes
│ │ │ │ -
154 if constexpr (!hasFixedElementType)
│ │ │ │ -
155 if (cell.type().isCube())
│ │ │ │ -
156 orient_[myId] += numVariants(GeometryTypes::simplex(dim));
│ │ │ │ -
157 }
│ │ │ │ -
158 }
│ │ │ │ -
159
│ │ │ │ -
160 template<class EntityType>
│ │ │ │ -
161 const FiniteElement& find(const EntityType& e) const
│ │ │ │ -
162 {
│ │ │ │ -
163 return variants_[orient_[elementMapper_.index(e)]];
│ │ │ │ -
164 }
│ │ │ │ -
165
│ │ │ │ -
166 private:
│ │ │ │ -
167 std::vector<FiniteElement> variants_;
│ │ │ │ -
168 const Dune::MultipleCodimMultipleGeomTypeMapper<GV> elementMapper_;
│ │ │ │ -
169 std::vector<unsigned char> orient_;
│ │ │ │ -
170 };
│ │ │ │ -
171
│ │ │ │ -
172
│ │ │ │ -
173} // namespace Impl
│ │ │ │ -
174
│ │ │ │ -
175
│ │ │ │ -
176// *****************************************************************************
│ │ │ │ -
177// This is the reusable part of the basis. It contains
│ │ │ │ -
178//
│ │ │ │ -
179// RaviartThomasPreBasis
│ │ │ │ -
180// RaviartThomasNode
│ │ │ │ -
181//
│ │ │ │ -
182// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ │ -
183// state. These components do _not_ depend on the global basis and local view
│ │ │ │ -
184// and can be used without a global basis.
│ │ │ │ -
185// *****************************************************************************
│ │ │ │ -
186
│ │ │ │ -
187template<typename GV, int k>
│ │ │ │ -
188class RaviartThomasNode;
│ │ │ │ -
189
│ │ │ │ -
190template<typename GV, int k>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
192{
│ │ │ │ -
193 static const int dim = GV::dimension;
│ │ │ │ -
194 using FiniteElementMap = typename Impl::RaviartThomasLocalFiniteElementMap<GV, dim, double, k>;
│ │ │ │ -
195
│ │ │ │ -
196public:
│ │ │ │ -
197
│ │ │ │ -
199 using GridView = GV;
│ │ │ │ -
200 using size_type = std::size_t;
│ │ │ │ -
201
│ │ │ │ - │ │ │ │ -
203
│ │ │ │ -
204 static constexpr size_type maxMultiIndexSize = 1;
│ │ │ │ -
205 static constexpr size_type minMultiIndexSize = 1;
│ │ │ │ -
206 static constexpr size_type multiIndexBufferSize = 1;
│ │ │ │ -
207
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
210 gridView_(gv),
│ │ │ │ - │ │ │ │ -
212 {
│ │ │ │ -
213 // Currently there are some unresolved bugs with hybrid grids and higher order Raviart-Thomas elements
│ │ │ │ -
214 if (gv.indexSet().types(0).size() > 1 and k>0)
│ │ │ │ -
215 DUNE_THROW(Dune::NotImplemented, "Raviart-Thomas basis with index k>0 is only implemented for grids with a single element type");
│ │ │ │ -
216
│ │ │ │ -
217 for(auto type : gv.indexSet().types(0))
│ │ │ │ -
218 if (!type.isSimplex() && !type.isCube())
│ │ │ │ -
219 DUNE_THROW(Dune::NotImplemented, "Raviart-Thomas elements are only implemented for grids with simplex or cube elements.");
│ │ │ │ -
220
│ │ │ │ -
221 GeometryType type = gv.template begin<0>()->type();
│ │ │ │ -
222 const static int dofsPerElement = type.isCube() ? ((dim == 2) ? k*(k+1)*dim : k*(k+1)*(k+1)*dim) : k*dim;
│ │ │ │ -
223 const static int dofsPerFace = type.isCube() ? (dim-2)*2*k+k+1 : (dim-1)*k+1 ;
│ │ │ │ -
224
│ │ │ │ -
225 dofsPerCodim_ = {{dofsPerElement, dofsPerFace}};
│ │ │ │ -
226 }
│ │ │ │ -
│ │ │ │ -
227
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
229 {
│ │ │ │ -
230 codimOffset_[0] = 0;
│ │ │ │ -
231 codimOffset_[1] = codimOffset_[0] + dofsPerCodim_[0] * gridView_.size(0);
│ │ │ │ -
232 }
│ │ │ │ -
│ │ │ │ -
233
│ │ │ │ -
│ │ │ │ -
236 const GridView& gridView() const
│ │ │ │ -
237 {
│ │ │ │ -
238 return gridView_;
│ │ │ │ -
239 }
│ │ │ │ -
│ │ │ │ -
240
│ │ │ │ -
241 /* \brief Update the stored grid view, to be called if the grid has changed */
│ │ │ │ -
│ │ │ │ -
242 void update (const GridView& gv)
│ │ │ │ -
243 {
│ │ │ │ -
244 gridView_ = gv;
│ │ │ │ -
245 }
│ │ │ │ -
│ │ │ │ -
246
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
251 {
│ │ │ │ -
252 return Node{&finiteElementMap_};
│ │ │ │ -
253 }
│ │ │ │ -
│ │ │ │ -
254
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
256 {
│ │ │ │ -
257 return dofsPerCodim_[0] * gridView_.size(0) + dofsPerCodim_[1] * gridView_.size(1);
│ │ │ │ -
258 }
│ │ │ │ -
│ │ │ │ -
259
│ │ │ │ -
261 template<class SizePrefix>
│ │ │ │ -
│ │ │ │ -
262 size_type size(const SizePrefix& prefix) const
│ │ │ │ -
263 {
│ │ │ │ -
264 assert(prefix.size() == 0 || prefix.size() == 1);
│ │ │ │ -
265 return (prefix.size() == 0) ? size() : 0;
│ │ │ │ -
266 }
│ │ │ │ -
│ │ │ │ -
267
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
270 {
│ │ │ │ -
271 return size();
│ │ │ │ -
272 }
│ │ │ │ -
│ │ │ │ -
273
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
275 {
│ │ │ │ -
276 size_type result = 0;
│ │ │ │ -
277 for (auto&& type : gridView_.indexSet().types(0))
│ │ │ │ -
278 {
│ │ │ │ -
279 size_t numFaces = ReferenceElements<double,dim>::general(type).size(1);
│ │ │ │ -
280 const static int dofsPerElement = type.isCube() ? ((dim == 2) ? k*(k+1)*dim : k*(k+1)*(k+1)*dim) : k*dim;
│ │ │ │ -
281 const static int dofsPerFace = type.isCube() ? (dim-2)*2*k+k+1 : (dim-1)*k+1 ;
│ │ │ │ -
282 result = std::max(result, dofsPerElement + dofsPerFace * numFaces);
│ │ │ │ -
283 }
│ │ │ │ -
284
│ │ │ │ -
285 return result;
│ │ │ │ -
286 }
│ │ │ │ -
│ │ │ │ -
287
│ │ │ │ -
293 template<typename It>
│ │ │ │ -
│ │ │ │ -
294 It indices(const Node& node, It it) const
│ │ │ │ -
295 {
│ │ │ │ -
296 const auto& gridIndexSet = gridView().indexSet();
│ │ │ │ -
297 const auto& element = node.element();
│ │ │ │ -
298
│ │ │ │ -
299 // throw if Element is not of predefined type
│ │ │ │ -
300 if (not(element.type().isCube()) and not(element.type().isSimplex()))
│ │ │ │ -
301 DUNE_THROW(Dune::NotImplemented, "RaviartThomasBasis only implemented for cube and simplex elements.");
│ │ │ │ -
302
│ │ │ │ -
303 for(std::size_t i=0, end=node.size(); i<end; ++i, ++it)
│ │ │ │ -
304 {
│ │ │ │ -
305 Dune::LocalKey localKey = node.finiteElement().localCoefficients().localKey(i);
│ │ │ │ -
306
│ │ │ │ -
307 // The dimension of the entity that the current dof is related to
│ │ │ │ -
308 size_t subentity = localKey.subEntity();
│ │ │ │ -
309 size_t codim = localKey.codim();
│ │ │ │ -
310
│ │ │ │ -
311 if (not(codim==0 or codim==1))
│ │ │ │ -
312 DUNE_THROW(Dune::NotImplemented, "Grid contains elements not supported for the RaviartThomasBasis");
│ │ │ │ -
313
│ │ │ │ -
314 *it = { codimOffset_[codim] +
│ │ │ │ -
315 dofsPerCodim_[codim] * gridIndexSet.subIndex(element, subentity, codim) + localKey.index() };
│ │ │ │ -
316 }
│ │ │ │ -
317
│ │ │ │ -
318 return it;
│ │ │ │ -
319 }
│ │ │ │ -
│ │ │ │ -
320
│ │ │ │ -
321protected:
│ │ │ │ - │ │ │ │ -
323 std::array<size_t,dim+1> codimOffset_;
│ │ │ │ -
324 FiniteElementMap finiteElementMap_;
│ │ │ │ -
325 // Number of dofs per entity type depending on the entity's codimension and type
│ │ │ │ -
326 std::array<int,dim+1> dofsPerCodim_;
│ │ │ │ -
327};
│ │ │ │ -
│ │ │ │ -
328
│ │ │ │ -
329
│ │ │ │ -
330
│ │ │ │ -
331template<typename GV, int k>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
333 public LeafBasisNode
│ │ │ │ -
334{
│ │ │ │ -
335 static const int dim = GV::dimension;
│ │ │ │ -
336
│ │ │ │ -
337public:
│ │ │ │ -
338
│ │ │ │ -
339 using size_type = std::size_t;
│ │ │ │ -
340 using Element = typename GV::template Codim<0>::Entity;
│ │ │ │ -
341 using FiniteElementMap = typename Impl::RaviartThomasLocalFiniteElementMap<GV, dim, double, k>;
│ │ │ │ -
342 using FiniteElement = Impl::GlobalValuedLocalFiniteElement<Impl::ContravariantPiolaTransformator,
│ │ │ │ -
343 typename FiniteElementMap::FiniteElement,
│ │ │ │ -
344 Element>;
│ │ │ │ -
345
│ │ │ │ -
│ │ │ │ -
346 RaviartThomasNode(const FiniteElementMap* finiteElementMap) :
│ │ │ │ -
347 element_(nullptr),
│ │ │ │ -
348 finiteElementMap_(finiteElementMap)
│ │ │ │ -
349 { }
│ │ │ │ -
│ │ │ │ -
350
│ │ │ │ -
│ │ │ │ -
352 const Element& element() const
│ │ │ │ -
353 {
│ │ │ │ -
354 return *element_;
│ │ │ │ -
355 }
│ │ │ │ -
│ │ │ │ -
356
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
362 {
│ │ │ │ -
363 return finiteElement_;
│ │ │ │ -
364 }
│ │ │ │ -
│ │ │ │ -
365
│ │ │ │ -
│ │ │ │ -
367 void bind(const Element& e)
│ │ │ │ -
368 {
│ │ │ │ -
369 element_ = &e;
│ │ │ │ -
370 finiteElement_.bind((finiteElementMap_->find(*element_)), e);
│ │ │ │ -
371 this->setSize(finiteElement_.size());
│ │ │ │ -
372 }
│ │ │ │ -
│ │ │ │ -
373
│ │ │ │ -
374protected:
│ │ │ │ -
375
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
379};
│ │ │ │ -
│ │ │ │ -
380
│ │ │ │ -
381namespace BasisFactory {
│ │ │ │ -
382
│ │ │ │ -
390template<std::size_t k>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
392{
│ │ │ │ -
393 return [](const auto& gridView) {
│ │ │ │ -
394 return RaviartThomasPreBasis<std::decay_t<decltype(gridView)>, k>(gridView);
│ │ │ │ -
395 };
│ │ │ │ -
396}
│ │ │ │ -
│ │ │ │ -
397
│ │ │ │ -
398} // end namespace BasisFactory
│ │ │ │ -
399
│ │ │ │ -
400
│ │ │ │ -
401
│ │ │ │ -
402// *****************************************************************************
│ │ │ │ -
403// This is the actual global basis implementation based on the reusable parts.
│ │ │ │ -
404// *****************************************************************************
│ │ │ │ -
405
│ │ │ │ -
413template<typename GV, int k>
│ │ │ │ - │ │ │ │ -
415
│ │ │ │ -
416} // end namespace Functions
│ │ │ │ -
417} // end namespace Dune
│ │ │ │ -
418
│ │ │ │ -
419
│ │ │ │ -
420#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
auto raviartThomas()
Create a pre-basis factory that can create a Raviart-Thomas pre-basis.
Definition raviartthomasbasis.hh:391
│ │ │ │ +
147#endif //DUNE_FUNCTIONS_COMMON_CALLABLE_HH
│ │ │ │ +
CallableFunctionWrapper< F > callable(const F &f)
Create a callable object from some Dune::VirtualFunction.
Definition callable.hh:105
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:46
│ │ │ │ -
size_type size() const
Definition nodes.hh:142
│ │ │ │ -
void setSize(const size_type size)
Definition nodes.hh:164
│ │ │ │ -
Definition nodes.hh:186
│ │ │ │ -
Definition raviartthomasbasis.hh:334
│ │ │ │ -
typename Impl::RaviartThomasLocalFiniteElementMap< GV, dim, double, k > FiniteElementMap
Definition raviartthomasbasis.hh:341
│ │ │ │ -
void bind(const Element &e)
Bind to element.
Definition raviartthomasbasis.hh:367
│ │ │ │ -
Impl::GlobalValuedLocalFiniteElement< Impl::ContravariantPiolaTransformator, typename FiniteElementMap::FiniteElement, Element > FiniteElement
Definition raviartthomasbasis.hh:344
│ │ │ │ -
typename GV::template Codim< 0 >::Entity Element
Definition raviartthomasbasis.hh:340
│ │ │ │ -
const Element * element_
Definition raviartthomasbasis.hh:377
│ │ │ │ -
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition raviartthomasbasis.hh:361
│ │ │ │ -
std::size_t size_type
Definition raviartthomasbasis.hh:339
│ │ │ │ -
RaviartThomasNode(const FiniteElementMap *finiteElementMap)
Definition raviartthomasbasis.hh:346
│ │ │ │ -
const Element & element() const
Return current element, throw if unbound.
Definition raviartthomasbasis.hh:352
│ │ │ │ -
FiniteElement finiteElement_
Definition raviartthomasbasis.hh:376
│ │ │ │ -
const FiniteElementMap * finiteElementMap_
Definition raviartthomasbasis.hh:378
│ │ │ │ -
Definition raviartthomasbasis.hh:192
│ │ │ │ -
static constexpr size_type minMultiIndexSize
Definition raviartthomasbasis.hh:205
│ │ │ │ -
static constexpr size_type maxMultiIndexSize
Definition raviartthomasbasis.hh:204
│ │ │ │ -
Node makeNode() const
Create tree node.
Definition raviartthomasbasis.hh:250
│ │ │ │ -
std::array< int, dim+1 > dofsPerCodim_
Definition raviartthomasbasis.hh:326
│ │ │ │ -
void update(const GridView &gv)
Definition raviartthomasbasis.hh:242
│ │ │ │ -
RaviartThomasPreBasis(const GridView &gv)
Constructor for a given grid view object.
Definition raviartthomasbasis.hh:209
│ │ │ │ -
std::size_t size_type
Definition raviartthomasbasis.hh:200
│ │ │ │ -
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition raviartthomasbasis.hh:236
│ │ │ │ -
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 raviartthomasbasis.hh:294
│ │ │ │ -
static constexpr size_type multiIndexBufferSize
Definition raviartthomasbasis.hh:206
│ │ │ │ -
FiniteElementMap finiteElementMap_
Definition raviartthomasbasis.hh:324
│ │ │ │ -
size_type size() const
Definition raviartthomasbasis.hh:255
│ │ │ │ -
size_type dimension() const
Definition raviartthomasbasis.hh:269
│ │ │ │ -
GV GridView
The grid view that the FE space is defined on.
Definition raviartthomasbasis.hh:199
│ │ │ │ -
size_type maxNodeSize() const
Definition raviartthomasbasis.hh:274
│ │ │ │ -
GridView gridView_
Definition raviartthomasbasis.hh:322
│ │ │ │ -
size_type size(const SizePrefix &prefix) const
Return number possible values for next position in multi index.
Definition raviartthomasbasis.hh:262
│ │ │ │ -
void initializeIndices()
Definition raviartthomasbasis.hh:228
│ │ │ │ -
std::array< size_t, dim+1 > codimOffset_
Definition raviartthomasbasis.hh:323
│ │ │ │ +
Wrap a Dune::VirtualFunction into a callable object.
Definition callable.hh:38
│ │ │ │ +
Range operator()(const Domain &x) const
Forward operator() to F::evaluate()
Definition callable.hh:70
│ │ │ │ +
CallableFunctionWrapper(const F &f)
Instantiate from reference to f.
Definition callable.hh:50
│ │ │ │ +
CallableFunctionWrapper(const std::shared_ptr< const F > &f)
Instantiate from std::shared_ptr to f.
Definition callable.hh:61
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,560 +1,99 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -raviartthomasbasis.hh │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +callable.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_COMMON_CALLABLE_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_COMMON_CALLABLE_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ 8 │ │ │ │ │ -9#include │ │ │ │ │ -10#include │ │ │ │ │ +9#include │ │ │ │ │ +10#include │ │ │ │ │ 11 │ │ │ │ │ -12#include │ │ │ │ │ -13#include │ │ │ │ │ -14#include │ │ │ │ │ -15#include │ │ │ │ │ -16#include │ │ │ │ │ -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 │ │ │ │ │ -27namespace _D_u_n_e { │ │ │ │ │ -28namespace Functions { │ │ │ │ │ -29 │ │ │ │ │ -30namespace Impl { │ │ │ │ │ -31 │ │ │ │ │ -32 template │ │ │ │ │ -33 struct RaviartThomasSimplexLocalInfo │ │ │ │ │ -34 { │ │ │ │ │ -35 // Dummy type, must be something that we can have a std::unique_ptr to │ │ │ │ │ -36 using FiniteElement = void*; │ │ │ │ │ -37 }; │ │ │ │ │ -38 │ │ │ │ │ -39 template │ │ │ │ │ -40 struct RaviartThomasSimplexLocalInfo<2,D,R,0> │ │ │ │ │ -41 { │ │ │ │ │ -42 using FiniteElement = RT02DLocalFiniteElement; │ │ │ │ │ -43 }; │ │ │ │ │ -44 │ │ │ │ │ -45 template │ │ │ │ │ -46 struct RaviartThomasSimplexLocalInfo<2,D,R,1> │ │ │ │ │ -47 { │ │ │ │ │ -48 using FiniteElement = RT12DLocalFiniteElement; │ │ │ │ │ -49 }; │ │ │ │ │ -50 │ │ │ │ │ -51 template │ │ │ │ │ -52 struct RaviartThomasSimplexLocalInfo<3,D,R,0> │ │ │ │ │ -53 { │ │ │ │ │ -54 using FiniteElement = RT03DLocalFiniteElement; │ │ │ │ │ -55 }; │ │ │ │ │ -56 │ │ │ │ │ -57 template │ │ │ │ │ -58 struct RaviartThomasCubeLocalInfo │ │ │ │ │ -59 { │ │ │ │ │ -60 // Dummy type, must be something that we can have a std::unique_ptr to │ │ │ │ │ -61 using FiniteElement = void*; │ │ │ │ │ -62 }; │ │ │ │ │ -63 │ │ │ │ │ -64 template │ │ │ │ │ -65 struct RaviartThomasCubeLocalInfo<2,D,R,0> │ │ │ │ │ -66 { │ │ │ │ │ -67 using FiniteElement = RT0Cube2DLocalFiniteElement; │ │ │ │ │ -68 }; │ │ │ │ │ -69 │ │ │ │ │ -70 template │ │ │ │ │ -71 struct RaviartThomasCubeLocalInfo<2,D,R,1> │ │ │ │ │ -72 { │ │ │ │ │ -73 using FiniteElement = RT1Cube2DLocalFiniteElement; │ │ │ │ │ -74 }; │ │ │ │ │ -75 │ │ │ │ │ -76 template │ │ │ │ │ -77 struct RaviartThomasCubeLocalInfo<2,D,R,2> │ │ │ │ │ -78 { │ │ │ │ │ -79 using FiniteElement = RT2Cube2DLocalFiniteElement; │ │ │ │ │ -80 }; │ │ │ │ │ +12 │ │ │ │ │ +13namespace _D_u_n_e { │ │ │ │ │ +14namespace Functions { │ │ │ │ │ +15 │ │ │ │ │ +16 │ │ │ │ │ +17 │ │ │ │ │ +18 │ │ │ │ │ +36template │ │ │ │ │ +_3_7class _C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r │ │ │ │ │ +38{ │ │ │ │ │ +39 using Range = typename F::RangeType; │ │ │ │ │ +40 using Domain = typename F::DomainType; │ │ │ │ │ +41 │ │ │ │ │ +42 public: │ │ │ │ │ +43 │ │ │ │ │ +_5_0 _C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r(const F& f) │ │ │ │ │ +51 { │ │ │ │ │ +52 f_ = Dune::stackobject_to_shared_ptr(f); │ │ │ │ │ +53 } │ │ │ │ │ +54 │ │ │ │ │ +_6_1 _C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r(const std::shared_ptr& f) : │ │ │ │ │ +62 f_(f) │ │ │ │ │ +63 {} │ │ │ │ │ +64 │ │ │ │ │ +_7_0 Range _o_p_e_r_a_t_o_r_(_)(const Domain& x) const │ │ │ │ │ +71 { │ │ │ │ │ +72 Range y; │ │ │ │ │ +73 f_->evaluate(x, y); │ │ │ │ │ +74 return y; │ │ │ │ │ +75 } │ │ │ │ │ +76 │ │ │ │ │ +77 private: │ │ │ │ │ +78 std::shared_ptr f_; │ │ │ │ │ +79}; │ │ │ │ │ +80 │ │ │ │ │ 81 │ │ │ │ │ -82 template │ │ │ │ │ -83 struct RaviartThomasCubeLocalInfo<3,D,R,0> │ │ │ │ │ -84 { │ │ │ │ │ -85 using FiniteElement = RT0Cube3DLocalFiniteElement; │ │ │ │ │ -86 }; │ │ │ │ │ -87 │ │ │ │ │ -88 template │ │ │ │ │ -89 struct RaviartThomasCubeLocalInfo<3,D,R,1> │ │ │ │ │ -90 { │ │ │ │ │ -91 using FiniteElement = RT1Cube3DLocalFiniteElement; │ │ │ │ │ -92 }; │ │ │ │ │ -93 │ │ │ │ │ -94 template │ │ │ │ │ -95 class RaviartThomasLocalFiniteElementMap │ │ │ │ │ -96 { │ │ │ │ │ -97 using D = typename GV::ctype; │ │ │ │ │ -98 constexpr static bool hasFixedElementType = Capabilities:: │ │ │ │ │ -hasSingleGeometryType::v; │ │ │ │ │ -99 │ │ │ │ │ -100 using CubeFiniteElement = typename RaviartThomasCubeLocalInfo::FiniteElement; │ │ │ │ │ -101 using SimplexFiniteElement = typename RaviartThomasSimplexLocalInfo::FiniteElement; │ │ │ │ │ -102 │ │ │ │ │ -103 public: │ │ │ │ │ -104 │ │ │ │ │ -105 using T = LocalBasisTraits, R, dim, │ │ │ │ │ -FieldVector, FieldMatrix >; │ │ │ │ │ -106 │ │ │ │ │ -107 constexpr static unsigned int topologyId = Capabilities:: │ │ │ │ │ -hasSingleGeometryType::topologyId; // meaningless if │ │ │ │ │ -hasFixedElementType is false │ │ │ │ │ -108 constexpr static GeometryType type = GeometryType(topologyId, GV:: │ │ │ │ │ -dimension); │ │ │ │ │ +82 │ │ │ │ │ +104template │ │ │ │ │ +_1_0_5_C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r_<_F_> _c_a_l_l_a_b_l_e(const F& f) │ │ │ │ │ +106{ │ │ │ │ │ +107 return _C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r_<_F_>(f); │ │ │ │ │ +108} │ │ │ │ │ 109 │ │ │ │ │ -110 using FiniteElement = std::conditional_t, │ │ │ │ │ -112 LocalFiniteElementVariant >; │ │ │ │ │ -113 │ │ │ │ │ -114 // Each element facet can have its orientation reversed, hence there are │ │ │ │ │ -115 // 2^#facets different variants. │ │ │ │ │ -116 static std::size_t numVariants(GeometryType type) │ │ │ │ │ -117 { │ │ │ │ │ -118 auto numFacets = referenceElement(type).size(1); │ │ │ │ │ -119 return power(2,numFacets); │ │ │ │ │ -120 } │ │ │ │ │ -121 │ │ │ │ │ -122 RaviartThomasLocalFiniteElementMap(const GV& gv) │ │ │ │ │ -123 : elementMapper_(gv, mcmgElementLayout()), │ │ │ │ │ -124 orient_(gv.size(0)) │ │ │ │ │ -125 { │ │ │ │ │ -126 if constexpr (hasFixedElementType) │ │ │ │ │ -127 { │ │ │ │ │ -128 variants_.resize(numVariants(type)); │ │ │ │ │ -129 for (size_t i = 0; i < numVariants(type); i++) │ │ │ │ │ -130 variants_[i] = FiniteElement(i); │ │ │ │ │ -131 } │ │ │ │ │ -132 else │ │ │ │ │ -133 { │ │ │ │ │ -134 // for mixed grids add offset for cubes │ │ │ │ │ -135 variants_.resize(numVariants(GeometryTypes::simplex(dim)) + numVariants │ │ │ │ │ -(GeometryTypes::cube(dim))); │ │ │ │ │ -136 for (size_t i = 0; i < numVariants(GeometryTypes::simplex(dim)); i++) │ │ │ │ │ -137 variants_[i] = SimplexFiniteElement(i); │ │ │ │ │ -138 for (size_t i = 0; i < numVariants(GeometryTypes::cube(dim)); i++) │ │ │ │ │ -139 variants_[i + numVariants(GeometryTypes::simplex(dim))] = CubeFiniteElement │ │ │ │ │ -(i); │ │ │ │ │ -140 } │ │ │ │ │ +110 │ │ │ │ │ +136template │ │ │ │ │ +_1_3_7_C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r_<_F_> _c_a_l_l_a_b_l_e(const std::shared_ptr& fp) │ │ │ │ │ +138{ │ │ │ │ │ +139 return _C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r_<_F_>(fp); │ │ │ │ │ +140} │ │ │ │ │ 141 │ │ │ │ │ -142 for(const auto& cell : elements(gv)) │ │ │ │ │ -143 { │ │ │ │ │ -144 unsigned int myId = elementMapper_.index(cell); │ │ │ │ │ -145 orient_[myId] = 0; │ │ │ │ │ +142 │ │ │ │ │ +143 │ │ │ │ │ +144} // namespace Functions │ │ │ │ │ +145} // namespace Dune │ │ │ │ │ 146 │ │ │ │ │ -147 for (const auto& intersection : intersections(gv,cell)) │ │ │ │ │ -148 { │ │ │ │ │ -149 if (intersection.neighbor() && (elementMapper_.index(intersection.outside │ │ │ │ │ -()) > myId)) │ │ │ │ │ -150 orient_[myId] |= (1 << intersection.indexInInside()); │ │ │ │ │ -151 } │ │ │ │ │ -152 │ │ │ │ │ -153 // for mixed grids add offset for cubes │ │ │ │ │ -154 if constexpr (!hasFixedElementType) │ │ │ │ │ -155 if (cell.type().isCube()) │ │ │ │ │ -156 orient_[myId] += numVariants(GeometryTypes::simplex(dim)); │ │ │ │ │ -157 } │ │ │ │ │ -158 } │ │ │ │ │ -159 │ │ │ │ │ -160 template │ │ │ │ │ -161 const FiniteElement& find(const EntityType& e) const │ │ │ │ │ -162 { │ │ │ │ │ -163 return variants_[orient_[elementMapper_.index(e)]]; │ │ │ │ │ -164 } │ │ │ │ │ -165 │ │ │ │ │ -166 private: │ │ │ │ │ -167 std::vector variants_; │ │ │ │ │ -168 const Dune::MultipleCodimMultipleGeomTypeMapper elementMapper_; │ │ │ │ │ -169 std::vector orient_; │ │ │ │ │ -170 }; │ │ │ │ │ -171 │ │ │ │ │ -172 │ │ │ │ │ -173} // namespace Impl │ │ │ │ │ -174 │ │ │ │ │ -175 │ │ │ │ │ -176/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -177// This is the reusable part of the basis. It contains │ │ │ │ │ -178// │ │ │ │ │ -179// RaviartThomasPreBasis │ │ │ │ │ -180// RaviartThomasNode │ │ │ │ │ -181// │ │ │ │ │ -182// The pre-basis allows to create the others and is the owner of possible │ │ │ │ │ -shared │ │ │ │ │ -183// state. These components do _not_ depend on the global basis and local │ │ │ │ │ -view │ │ │ │ │ -184// and can be used without a global basis. │ │ │ │ │ -185/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -186 │ │ │ │ │ -187template │ │ │ │ │ -188class RaviartThomasNode; │ │ │ │ │ -189 │ │ │ │ │ -190template │ │ │ │ │ -_1_9_1class _R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s │ │ │ │ │ -192{ │ │ │ │ │ -193 static const int dim = GV::dimension; │ │ │ │ │ -194 using FiniteElementMap = typename Impl:: │ │ │ │ │ -RaviartThomasLocalFiniteElementMap; │ │ │ │ │ -195 │ │ │ │ │ -196public: │ │ │ │ │ -197 │ │ │ │ │ -_1_9_9 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ │ -_2_0_0 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ -201 │ │ │ │ │ -_2_0_2 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_>; │ │ │ │ │ -203 │ │ │ │ │ -_2_0_4 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 = 1; │ │ │ │ │ -_2_0_5 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 = 1; │ │ │ │ │ -_2_0_6 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 = 1; │ │ │ │ │ -207 │ │ │ │ │ -_2_0_9 _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) : │ │ │ │ │ -210 _g_r_i_d_V_i_e_w__(gv), │ │ │ │ │ -211 _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__(gv) │ │ │ │ │ -212 { │ │ │ │ │ -213 // Currently there are some unresolved bugs with hybrid grids and higher │ │ │ │ │ -order Raviart-Thomas elements │ │ │ │ │ -214 if (gv.indexSet().types(0).size() > 1 and k>0) │ │ │ │ │ -215 DUNE_THROW(Dune::NotImplemented, "Raviart-Thomas basis with index k>0 is │ │ │ │ │ -only implemented for grids with a single element type"); │ │ │ │ │ -216 │ │ │ │ │ -217 for(auto type : gv.indexSet().types(0)) │ │ │ │ │ -218 if (!type.isSimplex() && !type.isCube()) │ │ │ │ │ -219 DUNE_THROW(Dune::NotImplemented, "Raviart-Thomas elements are only │ │ │ │ │ -implemented for grids with simplex or cube elements."); │ │ │ │ │ -220 │ │ │ │ │ -221 GeometryType type = gv.template begin<0>()->type(); │ │ │ │ │ -222 const static int dofsPerElement = type.isCube() ? ((dim == 2) ? k*(k+1)*dim │ │ │ │ │ -: k*(k+1)*(k+1)*dim) : k*dim; │ │ │ │ │ -223 const static int dofsPerFace = type.isCube() ? (dim-2)*2*k+k+1 : (dim- │ │ │ │ │ -1)*k+1 ; │ │ │ │ │ -224 │ │ │ │ │ -225 _d_o_f_s_P_e_r_C_o_d_i_m__ = {{dofsPerElement, dofsPerFace}}; │ │ │ │ │ -226 } │ │ │ │ │ -227 │ │ │ │ │ -_2_2_8 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ │ -229 { │ │ │ │ │ -230 _c_o_d_i_m_O_f_f_s_e_t__[0] = 0; │ │ │ │ │ -231 _c_o_d_i_m_O_f_f_s_e_t__[1] = _c_o_d_i_m_O_f_f_s_e_t__[0] + _d_o_f_s_P_e_r_C_o_d_i_m__[0] * _g_r_i_d_V_i_e_w__.size(0); │ │ │ │ │ -232 } │ │ │ │ │ -233 │ │ │ │ │ -_2_3_6 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ │ -237 { │ │ │ │ │ -238 return _g_r_i_d_V_i_e_w__; │ │ │ │ │ -239 } │ │ │ │ │ -240 │ │ │ │ │ -241 /* \brief Update the stored grid view, to be called if the grid has changed │ │ │ │ │ -*/ │ │ │ │ │ -_2_4_2 void _u_p_d_a_t_e (const _G_r_i_d_V_i_e_w& gv) │ │ │ │ │ -243 { │ │ │ │ │ -244 _g_r_i_d_V_i_e_w__ = gv; │ │ │ │ │ -245 } │ │ │ │ │ -246 │ │ │ │ │ -_2_5_0 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ │ -251 { │ │ │ │ │ -252 return _N_o_d_e{&_f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__}; │ │ │ │ │ -253 } │ │ │ │ │ -254 │ │ │ │ │ -_2_5_5 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ │ -256 { │ │ │ │ │ -257 return _d_o_f_s_P_e_r_C_o_d_i_m__[0] * _g_r_i_d_V_i_e_w__.size(0) + _d_o_f_s_P_e_r_C_o_d_i_m__[1] * │ │ │ │ │ -_g_r_i_d_V_i_e_w__.size(1); │ │ │ │ │ -258 } │ │ │ │ │ -259 │ │ │ │ │ -261 template │ │ │ │ │ -_2_6_2 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix) const │ │ │ │ │ -263 { │ │ │ │ │ -264 assert(prefix.size() == 0 || prefix.size() == 1); │ │ │ │ │ -265 return (prefix.size() == 0) ? _s_i_z_e() : 0; │ │ │ │ │ -266 } │ │ │ │ │ -267 │ │ │ │ │ -_2_6_9 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ │ -270 { │ │ │ │ │ -271 return _s_i_z_e(); │ │ │ │ │ -272 } │ │ │ │ │ -273 │ │ │ │ │ -_2_7_4 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ │ -275 { │ │ │ │ │ -276 _s_i_z_e___t_y_p_e result = 0; │ │ │ │ │ -277 for (auto&& type : _g_r_i_d_V_i_e_w__.indexSet().types(0)) │ │ │ │ │ -278 { │ │ │ │ │ -279 size_t numFaces = ReferenceElements::general(type).size(1); │ │ │ │ │ -280 const static int dofsPerElement = type.isCube() ? ((dim == 2) ? k*(k+1)*dim │ │ │ │ │ -: k*(k+1)*(k+1)*dim) : k*dim; │ │ │ │ │ -281 const static int dofsPerFace = type.isCube() ? (dim-2)*2*k+k+1 : (dim- │ │ │ │ │ -1)*k+1 ; │ │ │ │ │ -282 result = std::max(result, dofsPerElement + dofsPerFace * numFaces); │ │ │ │ │ -283 } │ │ │ │ │ -284 │ │ │ │ │ -285 return result; │ │ │ │ │ -286 } │ │ │ │ │ -287 │ │ │ │ │ -293 template │ │ │ │ │ -_2_9_4 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ │ -295 { │ │ │ │ │ -296 const auto& gridIndexSet = _g_r_i_d_V_i_e_w().indexSet(); │ │ │ │ │ -297 const auto& element = node._e_l_e_m_e_n_t(); │ │ │ │ │ -298 │ │ │ │ │ -299 // throw if Element is not of predefined type │ │ │ │ │ -300 if (not(element.type().isCube()) and not(element.type().isSimplex())) │ │ │ │ │ -301 DUNE_THROW(Dune::NotImplemented, "RaviartThomasBasis only implemented for │ │ │ │ │ -cube and simplex elements."); │ │ │ │ │ -302 │ │ │ │ │ -303 for(std::size_t i=0, end=node._s_i_z_e(); i _c_o_d_i_m_O_f_f_s_e_t__; │ │ │ │ │ -_3_2_4 FiniteElementMap _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__; │ │ │ │ │ -325 // Number of dofs per entity type depending on the entity's codimension and │ │ │ │ │ -type │ │ │ │ │ -_3_2_6 std::array _d_o_f_s_P_e_r_C_o_d_i_m__; │ │ │ │ │ -327}; │ │ │ │ │ -328 │ │ │ │ │ -329 │ │ │ │ │ -330 │ │ │ │ │ -331template │ │ │ │ │ -_3_3_2class _R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e : │ │ │ │ │ -333 public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ │ -334{ │ │ │ │ │ -335 static const int dim = GV::dimension; │ │ │ │ │ -336 │ │ │ │ │ -337public: │ │ │ │ │ -338 │ │ │ │ │ -_3_3_9 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ -_3_4_0 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ │ -_3_4_1 using _F_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p = typename Impl:: │ │ │ │ │ -RaviartThomasLocalFiniteElementMap; │ │ │ │ │ -_3_4_2 using _F_i_n_i_t_e_E_l_e_m_e_n_t = Impl::GlobalValuedLocalFiniteElement; │ │ │ │ │ -345 │ │ │ │ │ -_3_4_6 _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) : │ │ │ │ │ -347 _e_l_e_m_e_n_t__(nullptr), │ │ │ │ │ -348 _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__(finiteElementMap) │ │ │ │ │ -349 { } │ │ │ │ │ -350 │ │ │ │ │ -_3_5_2 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ │ -353 { │ │ │ │ │ -354 return *_e_l_e_m_e_n_t__; │ │ │ │ │ -355 } │ │ │ │ │ -356 │ │ │ │ │ -_3_6_1 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 │ │ │ │ │ -362 { │ │ │ │ │ -363 return _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ │ -364 } │ │ │ │ │ -365 │ │ │ │ │ -_3_6_7 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ │ -368 { │ │ │ │ │ -369 _e_l_e_m_e_n_t__ = &e; │ │ │ │ │ -370 _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); │ │ │ │ │ -371 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__.size()); │ │ │ │ │ -372 } │ │ │ │ │ -373 │ │ │ │ │ -374protected: │ │ │ │ │ -375 │ │ │ │ │ -_3_7_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__; │ │ │ │ │ -_3_7_7 const _E_l_e_m_e_n_t* _e_l_e_m_e_n_t__; │ │ │ │ │ -_3_7_8 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__; │ │ │ │ │ -379}; │ │ │ │ │ -380 │ │ │ │ │ -381namespace BasisFactory { │ │ │ │ │ -382 │ │ │ │ │ -390template │ │ │ │ │ -_3_9_1auto _r_a_v_i_a_r_t_T_h_o_m_a_s() │ │ │ │ │ -392{ │ │ │ │ │ -393 return [](const auto& gridView) { │ │ │ │ │ -394 return _R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s, k> │ │ │ │ │ -(gridView); │ │ │ │ │ -395 }; │ │ │ │ │ -396} │ │ │ │ │ -397 │ │ │ │ │ -398} // end namespace BasisFactory │ │ │ │ │ -399 │ │ │ │ │ -400 │ │ │ │ │ -401 │ │ │ │ │ -402/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -403// This is the actual global basis implementation based on the reusable │ │ │ │ │ -parts. │ │ │ │ │ -404/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -405 │ │ │ │ │ -413template │ │ │ │ │ -_4_1_4using _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_> │ │ │ │ │ ->; │ │ │ │ │ -415 │ │ │ │ │ -416} // end namespace Functions │ │ │ │ │ -417} // end namespace Dune │ │ │ │ │ -418 │ │ │ │ │ -419 │ │ │ │ │ -420#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 │ │ │ │ │ -_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ │ -_n_o_d_e_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:391 │ │ │ │ │ +147#endif //DUNE_FUNCTIONS_COMMON_CALLABLE_HH │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_a_l_l_a_b_l_e │ │ │ │ │ +CallableFunctionWrapper< F > callable(const F &f) │ │ │ │ │ +Create a callable object from some Dune::VirtualFunction. │ │ │ │ │ +DDeeffiinniittiioonn callable.hh:105 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:46 │ │ │ │ │ -_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 │ │ │ │ │ -DDeeffiinniittiioonn nodes.hh:142 │ │ │ │ │ -_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:164 │ │ │ │ │ -_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:186 │ │ │ │ │ -_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: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_M_a_p │ │ │ │ │ -typename Impl::RaviartThomasLocalFiniteElementMap< GV, dim, double, k > │ │ │ │ │ -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_:_:_b_i_n_d │ │ │ │ │ -void bind(const Element &e) │ │ │ │ │ -Bind to element. │ │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:367 │ │ │ │ │ -_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:344 │ │ │ │ │ -_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:340 │ │ │ │ │ -_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:377 │ │ │ │ │ -_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:361 │ │ │ │ │ -_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:339 │ │ │ │ │ -_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:346 │ │ │ │ │ -_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:352 │ │ │ │ │ -_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:376 │ │ │ │ │ -_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:378 │ │ │ │ │ -_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:192 │ │ │ │ │ -_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_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ -static constexpr size_type minMultiIndexSize │ │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:205 │ │ │ │ │ -_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_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ -static constexpr size_type maxMultiIndexSize │ │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:204 │ │ │ │ │ -_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:250 │ │ │ │ │ -_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_:_:_d_o_f_s_P_e_r_C_o_d_i_m__ │ │ │ │ │ -std::array< int, dim+1 > dofsPerCodim_ │ │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:326 │ │ │ │ │ -_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) │ │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:242 │ │ │ │ │ -_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:209 │ │ │ │ │ -_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:200 │ │ │ │ │ -_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 │ │ │ │ │ -const GridView & gridView() const │ │ │ │ │ -Obtain the grid view that the basis is defined on. │ │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:236 │ │ │ │ │ -_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_:_:_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 raviartthomasbasis.hh:294 │ │ │ │ │ -_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_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 raviartthomasbasis.hh:206 │ │ │ │ │ -_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:324 │ │ │ │ │ -_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 │ │ │ │ │ -size_type size() const │ │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:255 │ │ │ │ │ -_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_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ │ -size_type dimension() const │ │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:269 │ │ │ │ │ -_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:199 │ │ │ │ │ -_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_x_N_o_d_e_S_i_z_e │ │ │ │ │ -size_type maxNodeSize() const │ │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:274 │ │ │ │ │ -_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__ │ │ │ │ │ -GridView gridView_ │ │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:322 │ │ │ │ │ -_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 │ │ │ │ │ -size_type size(const SizePrefix &prefix) const │ │ │ │ │ -Return number possible values for next position in multi index. │ │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:262 │ │ │ │ │ -_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_:_:_i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ │ -void initializeIndices() │ │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:228 │ │ │ │ │ -_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_:_:_c_o_d_i_m_O_f_f_s_e_t__ │ │ │ │ │ -std::array< size_t, dim+1 > codimOffset_ │ │ │ │ │ -DDeeffiinniittiioonn raviartthomasbasis.hh:323 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r │ │ │ │ │ +Wrap a Dune::VirtualFunction into a callable object. │ │ │ │ │ +DDeeffiinniittiioonn callable.hh:38 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ │ +Range operator()(const Domain &x) const │ │ │ │ │ +Forward operator() to F::evaluate() │ │ │ │ │ +DDeeffiinniittiioonn callable.hh:70 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r_:_:_C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r │ │ │ │ │ +CallableFunctionWrapper(const F &f) │ │ │ │ │ +Instantiate from reference to f. │ │ │ │ │ +DDeeffiinniittiioonn callable.hh:50 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r_:_:_C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r │ │ │ │ │ +CallableFunctionWrapper(const std::shared_ptr< const F > &f) │ │ │ │ │ +Instantiate from std::shared_ptr to f. │ │ │ │ │ +DDeeffiinniittiioonn callable.hh:61 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00056.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: lagrangedgbasis.hh File Reference │ │ │ │ +dune-functions: defaultderivativetraits.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,65 +65,58 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces | │ │ │ │ -Typedefs | │ │ │ │ -Functions
│ │ │ │ -
lagrangedgbasis.hh File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
defaultderivativetraits.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <array>
│ │ │ │ -#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 <type_traits>
│ │ │ │ +#include <utility>
│ │ │ │ +#include <dune/common/fvector.hh>
│ │ │ │ +#include <dune/common/fmatrix.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::Functions::LagrangeDGPreBasis< GV, k >
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>
using Dune::Functions::LagrangeDGNode = LagrangeNode< GV, k >
 
template<typename GV , int k>
using Dune::Functions::LagrangeDGBasis = DefaultGlobalBasis< LagrangeDGPreBasis< GV, k > >
 Basis of a scalar k-th-order Lagrangean-DG finite element space.
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ -Functions

template<std::size_t k>
auto Dune::Functions::BasisFactory::lagrangeDG ()
 Create a pre-basis factory that can create a LagrangeDG pre-basis.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,42 +1,42 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -lagrangedgbasis.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> │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ +defaultderivativetraits.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_:_:_L_a_g_r_a_n_g_e_D_G_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_:_:_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_:_:_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< GV, k > │ │ │ │ │ -  │ │ │ │ │ -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< GV, k > > │ │ │ │ │ -  Basis of a scalar k-th-order Lagrangean-DG 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_D_G () │ │ │ │ │ -  Create a pre-basis factory that can create a LagrangeDG pre-basis. │ │ │ │ │ -  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00056_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: lagrangedgbasis.hh Source File │ │ │ │ +dune-functions: defaultderivativetraits.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,312 +70,97 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
lagrangedgbasis.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH
│ │ │ │
5
│ │ │ │ -
6#include <array>
│ │ │ │ -
7#include <dune/common/exceptions.hh>
│ │ │ │ -
8#include <dune/common/math.hh>
│ │ │ │ -
9
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
13
│ │ │ │ +
6#include <type_traits>
│ │ │ │ +
7#include <utility>
│ │ │ │ +
8
│ │ │ │ +
9#include <dune/common/fvector.hh>
│ │ │ │ +
10#include <dune/common/fmatrix.hh>
│ │ │ │ +
11
│ │ │ │ +
12namespace Dune {
│ │ │ │ +
13namespace Functions {
│ │ │ │
14
│ │ │ │
15
│ │ │ │
16
│ │ │ │ -
17namespace Dune {
│ │ │ │ -
18namespace Functions {
│ │ │ │ -
19
│ │ │ │ -
20
│ │ │ │ -
21
│ │ │ │ -
22// *****************************************************************************
│ │ │ │ -
23// This is the reusable part of the basis. It contains
│ │ │ │ -
24//
│ │ │ │ -
25// LagrangeDGPreBasis
│ │ │ │ -
26// LagrangeDGNode
│ │ │ │ -
27//
│ │ │ │ -
28// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ │ -
29// state. These components do _not_ depend on the global basis and local view
│ │ │ │ -
30// and can be used without a global basis.
│ │ │ │ -
31// *****************************************************************************
│ │ │ │ -
32
│ │ │ │ -
33template<typename GV, int k>
│ │ │ │ - │ │ │ │ -
35
│ │ │ │ -
36template<typename GV, int k>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
38{
│ │ │ │ -
39 static const int dim = GV::dimension;
│ │ │ │ -
40
│ │ │ │ -
41public:
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
23{};
│ │ │ │ +
│ │ │ │ +
24
│ │ │ │ +
25
│ │ │ │ +
35template<class Signature>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
37{
│ │ │ │ + │ │ │ │ +
40};
│ │ │ │ +
│ │ │ │ +
41
│ │ │ │
42
│ │ │ │ -
44 using GridView = GV;
│ │ │ │ -
45 using size_type = std::size_t;
│ │ │ │ -
46
│ │ │ │ -
47
│ │ │ │ -
48 // Precompute the number of dofs per entity type
│ │ │ │ -
49 const static int dofsPerEdge = k+1;
│ │ │ │ -
50 const static int dofsPerTriangle = (k+1)*(k+2)/2;
│ │ │ │ -
51 const static int dofsPerQuad = (k+1)*(k+1);
│ │ │ │ -
52 const static int dofsPerTetrahedron = (k+1)*(k+2)*(k+3)/6;
│ │ │ │ -
53 const static int dofsPerPrism = (k+1)*(k+1)*(k+2)/2;
│ │ │ │ -
54 const static int dofsPerHexahedron = (k+1)*(k+1)*(k+1);
│ │ │ │ -
55 const static int dofsPerPyramid = (k+1)*(k+2)*(2*k+3)/6;
│ │ │ │ +
50template<>
│ │ │ │ +
│ │ │ │ +
51struct DefaultDerivativeTraits< double(double) >
│ │ │ │ +
52{
│ │ │ │ +
54 typedef double Range;
│ │ │ │ +
55};
│ │ │ │ +
│ │ │ │
56
│ │ │ │ -
57
│ │ │ │ - │ │ │ │ -
59
│ │ │ │ -
60 static constexpr size_type maxMultiIndexSize = 1;
│ │ │ │ -
61 static constexpr size_type minMultiIndexSize = 1;
│ │ │ │ -
62 static constexpr size_type multiIndexBufferSize = 1;
│ │ │ │ -
63
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
66 gridView_(gv)
│ │ │ │ -
67 {}
│ │ │ │ -
│ │ │ │ -
68
│ │ │ │ -
69
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
71 {
│ │ │ │ -
72 switch (dim)
│ │ │ │ -
73 {
│ │ │ │ -
74 case 1:
│ │ │ │ -
75 {
│ │ │ │ -
76 break;
│ │ │ │ -
77 }
│ │ │ │ -
78 case 2:
│ │ │ │ -
79 {
│ │ │ │ -
80 quadrilateralOffset_ = dofsPerTriangle * gridView_.size(Dune::GeometryTypes::triangle);
│ │ │ │ -
81 break;
│ │ │ │ -
82 }
│ │ │ │ -
83 case 3:
│ │ │ │ -
84 {
│ │ │ │ -
85 prismOffset_ = dofsPerTetrahedron * gridView_.size(Dune::GeometryTypes::tetrahedron);
│ │ │ │ -
86
│ │ │ │ -
87 hexahedronOffset_ = prismOffset_ + dofsPerPrism * gridView_.size(Dune::GeometryTypes::prism);
│ │ │ │ +
66template<typename K, int n>
│ │ │ │ +
│ │ │ │ +
67struct DefaultDerivativeTraits<K(FieldVector<K,n>)>
│ │ │ │ +
68{
│ │ │ │ +
70 typedef FieldVector<K,n> Range;
│ │ │ │ +
71};
│ │ │ │ +
│ │ │ │ +
72
│ │ │ │ +
82template<typename K, int n, int m>
│ │ │ │ +
│ │ │ │ +
83struct DefaultDerivativeTraits<FieldVector<K,m>(FieldVector<K,n>)>
│ │ │ │ +
84{
│ │ │ │ +
86 typedef FieldMatrix<K,m,n> Range;
│ │ │ │ +
87};
│ │ │ │ +
│ │ │ │
88
│ │ │ │ -
89 pyramidOffset_ = hexahedronOffset_ + dofsPerHexahedron * gridView_.size(Dune::GeometryTypes::hexahedron);
│ │ │ │ -
90 break;
│ │ │ │ -
91 }
│ │ │ │ -
92 }
│ │ │ │ -
93 }
│ │ │ │ -
│ │ │ │ -
94
│ │ │ │ -
│ │ │ │ -
97 const GridView& gridView() const
│ │ │ │ -
98 {
│ │ │ │ -
99 return gridView_;
│ │ │ │ -
100 }
│ │ │ │ -
│ │ │ │ -
101
│ │ │ │ -
│ │ │ │ -
102 void update(const GridView& gv)
│ │ │ │ -
103 {
│ │ │ │ -
104 gridView_ = gv;
│ │ │ │ -
105 }
│ │ │ │ -
│ │ │ │ -
106
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
111 {
│ │ │ │ -
112 return Node{};
│ │ │ │ -
113 }
│ │ │ │ -
│ │ │ │ -
114
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
116 {
│ │ │ │ -
117 switch (dim)
│ │ │ │ -
118 {
│ │ │ │ -
119 case 1:
│ │ │ │ -
120 return dofsPerEdge*gridView_.size(0);
│ │ │ │ -
121 case 2:
│ │ │ │ -
122 {
│ │ │ │ -
123 return dofsPerTriangle*gridView_.size(Dune::GeometryTypes::triangle) + dofsPerQuad*gridView_.size(Dune::GeometryTypes::quadrilateral);
│ │ │ │ -
124 }
│ │ │ │ -
125 case 3:
│ │ │ │ -
126 {
│ │ │ │ -
127 return dofsPerTetrahedron*gridView_.size(Dune::GeometryTypes::tetrahedron)
│ │ │ │ -
128 + dofsPerPyramid*gridView_.size(Dune::GeometryTypes::pyramid)
│ │ │ │ -
129 + dofsPerPrism*gridView_.size(Dune::GeometryTypes::prism)
│ │ │ │ -
130 + dofsPerHexahedron*gridView_.size(Dune::GeometryTypes::hexahedron);
│ │ │ │ -
131 }
│ │ │ │ -
132 }
│ │ │ │ -
133 DUNE_THROW(Dune::NotImplemented, "No size method for " << dim << "d grids available yet!");
│ │ │ │ -
134 }
│ │ │ │ -
│ │ │ │ -
135
│ │ │ │ -
137 template<class SizePrefix>
│ │ │ │ -
│ │ │ │ -
138 size_type size(const SizePrefix& prefix) const
│ │ │ │ -
139 {
│ │ │ │ -
140 assert(prefix.size() == 0 || prefix.size() == 1);
│ │ │ │ -
141 return (prefix.size() == 0) ? size() : 0;
│ │ │ │ -
142 }
│ │ │ │ -
│ │ │ │ -
143
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
146 {
│ │ │ │ -
147 return size();
│ │ │ │ -
148 }
│ │ │ │ -
│ │ │ │ -
149
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
151 {
│ │ │ │ -
152 return Dune::power(k+1, int(GV::dimension));
│ │ │ │ -
153 }
│ │ │ │ -
│ │ │ │ -
154
│ │ │ │ -
155 template<typename It>
│ │ │ │ -
│ │ │ │ -
156 It indices(const Node& node, It it) const
│ │ │ │ -
157 {
│ │ │ │ -
158 const auto& gridIndexSet = gridView().indexSet();
│ │ │ │ -
159 const auto& element = node.element();
│ │ │ │ -
160
│ │ │ │ -
161 size_type offset = 0;
│ │ │ │ -
162 if constexpr (dim==1)
│ │ │ │ -
163 offset = dofsPerEdge*gridIndexSet.subIndex(element,0,0);
│ │ │ │ -
164 else if constexpr (dim==2)
│ │ │ │ -
165 {
│ │ │ │ -
166 if (element.type().isTriangle())
│ │ │ │ -
167 offset = dofsPerTriangle*gridIndexSet.subIndex(element,0,0);
│ │ │ │ -
168 else if (element.type().isQuadrilateral())
│ │ │ │ -
169 offset = quadrilateralOffset_ + dofsPerQuad*gridIndexSet.subIndex(element,0,0);
│ │ │ │ -
170 else
│ │ │ │ -
171 DUNE_THROW(Dune::NotImplemented, "2d elements have to be triangles or quadrilaterals");
│ │ │ │ -
172 }
│ │ │ │ -
173 else if constexpr (dim==3)
│ │ │ │ -
174 {
│ │ │ │ -
175 if (element.type().isTetrahedron())
│ │ │ │ -
176 offset = dofsPerTetrahedron*gridIndexSet.subIndex(element,0,0);
│ │ │ │ -
177 else if (element.type().isPrism())
│ │ │ │ -
178 offset = prismOffset_ + dofsPerPrism*gridIndexSet.subIndex(element,0,0);
│ │ │ │ -
179 else if (element.type().isHexahedron())
│ │ │ │ -
180 offset = hexahedronOffset_ + dofsPerHexahedron*gridIndexSet.subIndex(element,0,0);
│ │ │ │ -
181 else if (element.type().isPyramid())
│ │ │ │ -
182 offset = pyramidOffset_ + dofsPerPyramid*gridIndexSet.subIndex(element,0,0);
│ │ │ │ -
183 else
│ │ │ │ -
184 DUNE_THROW(Dune::NotImplemented, "3d elements have to be tetrahedrons, prisms, hexahedrons or pyramids");
│ │ │ │ -
185 }
│ │ │ │ -
186 else
│ │ │ │ -
187 DUNE_THROW(Dune::NotImplemented, "No index method for " << dim << "d grids available yet!");
│ │ │ │ -
188 for (size_type i = 0, end = node.size() ; i < end ; ++i, ++it)
│ │ │ │ -
189 *it = {offset + i};
│ │ │ │ -
190 return it;
│ │ │ │ -
191 }
│ │ │ │ -
│ │ │ │ -
192
│ │ │ │ -
│ │ │ │ -
194 unsigned int order() const
│ │ │ │ -
195 {
│ │ │ │ -
196 return k;
│ │ │ │ -
197 }
│ │ │ │ -
│ │ │ │ -
198
│ │ │ │ -
199protected:
│ │ │ │ - │ │ │ │ -
201
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
206};
│ │ │ │ -
│ │ │ │ -
207
│ │ │ │ -
208
│ │ │ │ -
209
│ │ │ │ -
210namespace BasisFactory {
│ │ │ │ -
211
│ │ │ │ -
219template<std::size_t k>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
221{
│ │ │ │ -
222 return [](const auto& gridView) {
│ │ │ │ -
223 return LagrangeDGPreBasis<std::decay_t<decltype(gridView)>, k>(gridView);
│ │ │ │ -
224 };
│ │ │ │ -
225}
│ │ │ │ -
│ │ │ │ -
226
│ │ │ │ -
227} // end namespace BasisFactory
│ │ │ │ -
228
│ │ │ │ -
229
│ │ │ │ -
230
│ │ │ │ -
231// *****************************************************************************
│ │ │ │ -
232// This is the actual global basis implementation based on the reusable parts.
│ │ │ │ -
233// *****************************************************************************
│ │ │ │ -
234
│ │ │ │ -
242template<typename GV, int k>
│ │ │ │ - │ │ │ │ -
244
│ │ │ │ -
245
│ │ │ │ -
246
│ │ │ │ -
247} // end namespace Functions
│ │ │ │ -
248} // end namespace Dune
│ │ │ │ -
249
│ │ │ │ -
250
│ │ │ │ -
251#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
auto lagrangeDG()
Create a pre-basis factory that can create a LagrangeDG pre-basis.
Definition lagrangedgbasis.hh:220
│ │ │ │ +
98template<typename K, int n, int m>
│ │ │ │ +
│ │ │ │ +
99struct DefaultDerivativeTraits<FieldMatrix<K,1,m>(FieldVector<K,n>)>
│ │ │ │ +
100{
│ │ │ │ +
102 typedef FieldMatrix<K,m,n> Range;
│ │ │ │ +
103};
│ │ │ │ +
│ │ │ │ +
104
│ │ │ │ +
105
│ │ │ │ +
106}} // namespace Dune::Functions
│ │ │ │ +
107
│ │ │ │ +
108
│ │ │ │ +
109#endif // DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:46
│ │ │ │ -
Definition lagrangebasis.hh:387
│ │ │ │ -
const Element & element() const
Return current element, throw if unbound.
Definition lagrangebasis.hh:439
│ │ │ │ -
Definition lagrangedgbasis.hh:38
│ │ │ │ -
size_type size() const
Definition lagrangedgbasis.hh:115
│ │ │ │ -
It indices(const Node &node, It it) const
Definition lagrangedgbasis.hh:156
│ │ │ │ -
size_type maxNodeSize() const
Definition lagrangedgbasis.hh:150
│ │ │ │ -
static constexpr size_type multiIndexBufferSize
Definition lagrangedgbasis.hh:62
│ │ │ │ -
unsigned int order() const
Polynomial order used in the local Lagrange finite-elements.
Definition lagrangedgbasis.hh:194
│ │ │ │ -
void update(const GridView &gv)
Definition lagrangedgbasis.hh:102
│ │ │ │ -
size_t hexahedronOffset_
Definition lagrangedgbasis.hh:205
│ │ │ │ -
Node makeNode() const
Create tree node.
Definition lagrangedgbasis.hh:110
│ │ │ │ -
static constexpr size_type maxMultiIndexSize
Definition lagrangedgbasis.hh:60
│ │ │ │ -
static const int dofsPerHexahedron
Definition lagrangedgbasis.hh:54
│ │ │ │ -
LagrangeDGPreBasis(const GridView &gv)
Constructor for a given grid view object.
Definition lagrangedgbasis.hh:65
│ │ │ │ -
size_t pyramidOffset_
Definition lagrangedgbasis.hh:203
│ │ │ │ -
static const int dofsPerTetrahedron
Definition lagrangedgbasis.hh:52
│ │ │ │ -
size_type size(const SizePrefix &prefix) const
Return number possible values for next position in multi index.
Definition lagrangedgbasis.hh:138
│ │ │ │ -
GV GridView
The grid view that the FE space is defined on.
Definition lagrangedgbasis.hh:44
│ │ │ │ -
void initializeIndices()
Definition lagrangedgbasis.hh:70
│ │ │ │ -
size_t quadrilateralOffset_
Definition lagrangedgbasis.hh:202
│ │ │ │ -
static const int dofsPerEdge
Definition lagrangedgbasis.hh:49
│ │ │ │ -
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition lagrangedgbasis.hh:97
│ │ │ │ -
static const int dofsPerQuad
Definition lagrangedgbasis.hh:51
│ │ │ │ -
static const int dofsPerTriangle
Definition lagrangedgbasis.hh:50
│ │ │ │ -
static const int dofsPerPyramid
Definition lagrangedgbasis.hh:55
│ │ │ │ -
GridView gridView_
Definition lagrangedgbasis.hh:200
│ │ │ │ -
static constexpr size_type minMultiIndexSize
Definition lagrangedgbasis.hh:61
│ │ │ │ -
std::size_t size_type
Definition lagrangedgbasis.hh:45
│ │ │ │ -
size_type dimension() const
Definition lagrangedgbasis.hh:145
│ │ │ │ -
size_t prismOffset_
Definition lagrangedgbasis.hh:204
│ │ │ │ -
static const int dofsPerPrism
Definition lagrangedgbasis.hh:53
│ │ │ │ -
size_type size() const
Definition nodes.hh:142
│ │ │ │ +
Dummy range class to be used if no proper type is available.
Definition defaultderivativetraits.hh:23
│ │ │ │ +
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:37
│ │ │ │ +
InvalidRange Range
Range of derivative for function with given signature.
Definition defaultderivativetraits.hh:39
│ │ │ │ +
double Range
Range of derivative for function with given signature.
Definition defaultderivativetraits.hh:54
│ │ │ │ +
FieldVector< K, n > Range
Range of derivative for function with given signature.
Definition defaultderivativetraits.hh:70
│ │ │ │ +
FieldMatrix< K, m, n > Range
Range of derivative for function with given signature.
Definition defaultderivativetraits.hh:86
│ │ │ │ +
FieldMatrix< K, m, n > Range
Range of derivative for function with given signature.
Definition defaultderivativetraits.hh:102
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,369 +1,97 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -lagrangedgbasis.hh │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ -8#include │ │ │ │ │ -9 │ │ │ │ │ -10#include <_d_u_n_e_/_f_u_n_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 <_d_u_n_e_/_f_u_n_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> │ │ │ │ │ -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_a_g_r_a_n_g_e_b_a_s_i_s_._h_h> │ │ │ │ │ -13 │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ +8 │ │ │ │ │ +9#include │ │ │ │ │ +10#include │ │ │ │ │ +11 │ │ │ │ │ +12namespace _D_u_n_e { │ │ │ │ │ +13namespace Functions { │ │ │ │ │ 14 │ │ │ │ │ 15 │ │ │ │ │ 16 │ │ │ │ │ -17namespace _D_u_n_e { │ │ │ │ │ -18namespace Functions { │ │ │ │ │ -19 │ │ │ │ │ -20 │ │ │ │ │ -21 │ │ │ │ │ -22/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -23// This is the reusable part of the basis. It contains │ │ │ │ │ -24// │ │ │ │ │ -25// LagrangeDGPreBasis │ │ │ │ │ -26// LagrangeDGNode │ │ │ │ │ -27// │ │ │ │ │ -28// The pre-basis allows to create the others and is the owner of possible │ │ │ │ │ -shared │ │ │ │ │ -29// state. These components do _not_ depend on the global basis and local view │ │ │ │ │ -30// and can be used without a global basis. │ │ │ │ │ -31/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -32 │ │ │ │ │ -33template │ │ │ │ │ -_3_4using _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_>; │ │ │ │ │ -35 │ │ │ │ │ -36template │ │ │ │ │ -_3_7class _L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s │ │ │ │ │ -38{ │ │ │ │ │ -39 static const int dim = GV::dimension; │ │ │ │ │ -40 │ │ │ │ │ -41public: │ │ │ │ │ +_2_2class _I_n_v_a_l_i_d_R_a_n_g_e │ │ │ │ │ +23{}; │ │ │ │ │ +24 │ │ │ │ │ +25 │ │ │ │ │ +35template │ │ │ │ │ +_3_6struct _D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ │ +37{ │ │ │ │ │ +_3_9 typedef _I_n_v_a_l_i_d_R_a_n_g_e _R_a_n_g_e; │ │ │ │ │ +40}; │ │ │ │ │ +41 │ │ │ │ │ 42 │ │ │ │ │ -_4_4 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ │ -_4_5 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ -46 │ │ │ │ │ -47 │ │ │ │ │ -48 // Precompute the number of dofs per entity type │ │ │ │ │ -_4_9 const static int _d_o_f_s_P_e_r_E_d_g_e = k+1; │ │ │ │ │ -_5_0 const static int _d_o_f_s_P_e_r_T_r_i_a_n_g_l_e = (k+1)*(k+2)/2; │ │ │ │ │ -_5_1 const static int _d_o_f_s_P_e_r_Q_u_a_d = (k+1)*(k+1); │ │ │ │ │ -_5_2 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; │ │ │ │ │ -_5_3 const static int _d_o_f_s_P_e_r_P_r_i_s_m = (k+1)*(k+1)*(k+2)/2; │ │ │ │ │ -_5_4 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); │ │ │ │ │ -_5_5 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; │ │ │ │ │ +50template<> │ │ │ │ │ +_5_1struct _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) > │ │ │ │ │ +52{ │ │ │ │ │ +_5_4 typedef double _R_a_n_g_e; │ │ │ │ │ +55}; │ │ │ │ │ 56 │ │ │ │ │ -57 │ │ │ │ │ -_5_8 using _N_o_d_e = _L_a_g_r_a_n_g_e_D_G_N_o_d_e_<_G_V_,_ _k_>; │ │ │ │ │ -59 │ │ │ │ │ -_6_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 = 1; │ │ │ │ │ -_6_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 = 1; │ │ │ │ │ -_6_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 = 1; │ │ │ │ │ -63 │ │ │ │ │ -_6_5 _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) : │ │ │ │ │ -66 _g_r_i_d_V_i_e_w__(gv) │ │ │ │ │ -67 {} │ │ │ │ │ -68 │ │ │ │ │ -69 │ │ │ │ │ -_7_0 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ │ -71 { │ │ │ │ │ -72 switch (dim) │ │ │ │ │ -73 { │ │ │ │ │ -74 case 1: │ │ │ │ │ -75 { │ │ │ │ │ -76 break; │ │ │ │ │ -77 } │ │ │ │ │ -78 case 2: │ │ │ │ │ -79 { │ │ │ │ │ -80 _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_T_r_i_a_n_g_l_e * _g_r_i_d_V_i_e_w__.size(Dune:: │ │ │ │ │ -GeometryTypes::triangle); │ │ │ │ │ -81 break; │ │ │ │ │ -82 } │ │ │ │ │ -83 case 3: │ │ │ │ │ -84 { │ │ │ │ │ -85 _p_r_i_s_m_O_f_f_s_e_t__ = _d_o_f_s_P_e_r_T_e_t_r_a_h_e_d_r_o_n * _g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes:: │ │ │ │ │ -tetrahedron); │ │ │ │ │ -86 │ │ │ │ │ -87 _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 * _g_r_i_d_V_i_e_w__.size(Dune:: │ │ │ │ │ -GeometryTypes::prism); │ │ │ │ │ +66template │ │ │ │ │ +_6_7struct _D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s)> │ │ │ │ │ +68{ │ │ │ │ │ +_7_0 typedef FieldVector _R_a_n_g_e; │ │ │ │ │ +71}; │ │ │ │ │ +72 │ │ │ │ │ +82template │ │ │ │ │ +_8_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)> │ │ │ │ │ +84{ │ │ │ │ │ +_8_6 typedef FieldMatrix _R_a_n_g_e; │ │ │ │ │ +87}; │ │ │ │ │ 88 │ │ │ │ │ -89 _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_H_e_x_a_h_e_d_r_o_n * _g_r_i_d_V_i_e_w__.size │ │ │ │ │ -(Dune::GeometryTypes::hexahedron); │ │ │ │ │ -90 break; │ │ │ │ │ -91 } │ │ │ │ │ -92 } │ │ │ │ │ -93 } │ │ │ │ │ -94 │ │ │ │ │ -_9_7 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ │ -98 { │ │ │ │ │ -99 return _g_r_i_d_V_i_e_w__; │ │ │ │ │ -100 } │ │ │ │ │ -101 │ │ │ │ │ -_1_0_2 void _u_p_d_a_t_e(const _G_r_i_d_V_i_e_w& gv) │ │ │ │ │ -103 { │ │ │ │ │ -104 _g_r_i_d_V_i_e_w__ = gv; │ │ │ │ │ -105 } │ │ │ │ │ -106 │ │ │ │ │ -_1_1_0 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ │ -111 { │ │ │ │ │ -112 return _N_o_d_e{}; │ │ │ │ │ -113 } │ │ │ │ │ -114 │ │ │ │ │ -_1_1_5 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ │ -116 { │ │ │ │ │ -117 switch (dim) │ │ │ │ │ -118 { │ │ │ │ │ -119 case 1: │ │ │ │ │ -120 return _d_o_f_s_P_e_r_E_d_g_e*_g_r_i_d_V_i_e_w__.size(0); │ │ │ │ │ -121 case 2: │ │ │ │ │ -122 { │ │ │ │ │ -123 return _d_o_f_s_P_e_r_T_r_i_a_n_g_l_e*_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes::triangle) + │ │ │ │ │ -_d_o_f_s_P_e_r_Q_u_a_d*_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes::quadrilateral); │ │ │ │ │ -124 } │ │ │ │ │ -125 case 3: │ │ │ │ │ -126 { │ │ │ │ │ -127 return _d_o_f_s_P_e_r_T_e_t_r_a_h_e_d_r_o_n*_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes::tetrahedron) │ │ │ │ │ -128 + _d_o_f_s_P_e_r_P_y_r_a_m_i_d*_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes::pyramid) │ │ │ │ │ -129 + _d_o_f_s_P_e_r_P_r_i_s_m*_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes::prism) │ │ │ │ │ -130 + _d_o_f_s_P_e_r_H_e_x_a_h_e_d_r_o_n*_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes::hexahedron); │ │ │ │ │ -131 } │ │ │ │ │ -132 } │ │ │ │ │ -133 DUNE_THROW(Dune::NotImplemented, "No size method for " << dim << "d grids │ │ │ │ │ -available yet!"); │ │ │ │ │ -134 } │ │ │ │ │ -135 │ │ │ │ │ -137 template │ │ │ │ │ -_1_3_8 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix) const │ │ │ │ │ -139 { │ │ │ │ │ -140 assert(prefix.size() == 0 || prefix.size() == 1); │ │ │ │ │ -141 return (prefix.size() == 0) ? _s_i_z_e() : 0; │ │ │ │ │ -142 } │ │ │ │ │ -143 │ │ │ │ │ -_1_4_5 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ │ -146 { │ │ │ │ │ -147 return _s_i_z_e(); │ │ │ │ │ -148 } │ │ │ │ │ -149 │ │ │ │ │ -_1_5_0 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ │ -151 { │ │ │ │ │ -152 return Dune::power(k+1, int(GV::dimension)); │ │ │ │ │ -153 } │ │ │ │ │ -154 │ │ │ │ │ -155 template │ │ │ │ │ -_1_5_6 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ │ -157 { │ │ │ │ │ -158 const auto& gridIndexSet = _g_r_i_d_V_i_e_w().indexSet(); │ │ │ │ │ -159 const auto& element = node._e_l_e_m_e_n_t(); │ │ │ │ │ -160 │ │ │ │ │ -161 _s_i_z_e___t_y_p_e offset = 0; │ │ │ │ │ -162 if constexpr (dim==1) │ │ │ │ │ -163 offset = _d_o_f_s_P_e_r_E_d_g_e*gridIndexSet.subIndex(element,0,0); │ │ │ │ │ -164 else if constexpr (dim==2) │ │ │ │ │ -165 { │ │ │ │ │ -166 if (element.type().isTriangle()) │ │ │ │ │ -167 offset = _d_o_f_s_P_e_r_T_r_i_a_n_g_l_e*gridIndexSet.subIndex(element,0,0); │ │ │ │ │ -168 else if (element.type().isQuadrilateral()) │ │ │ │ │ -169 offset = _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_Q_u_a_d*gridIndexSet.subIndex │ │ │ │ │ -(element,0,0); │ │ │ │ │ -170 else │ │ │ │ │ -171 DUNE_THROW(Dune::NotImplemented, "2d elements have to be triangles or │ │ │ │ │ -quadrilaterals"); │ │ │ │ │ -172 } │ │ │ │ │ -173 else if constexpr (dim==3) │ │ │ │ │ -174 { │ │ │ │ │ -175 if (element.type().isTetrahedron()) │ │ │ │ │ -176 offset = _d_o_f_s_P_e_r_T_e_t_r_a_h_e_d_r_o_n*gridIndexSet.subIndex(element,0,0); │ │ │ │ │ -177 else if (element.type().isPrism()) │ │ │ │ │ -178 offset = _p_r_i_s_m_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_P_r_i_s_m*gridIndexSet.subIndex(element,0,0); │ │ │ │ │ -179 else if (element.type().isHexahedron()) │ │ │ │ │ -180 offset = _h_e_x_a_h_e_d_r_o_n_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_H_e_x_a_h_e_d_r_o_n*gridIndexSet.subIndex │ │ │ │ │ -(element,0,0); │ │ │ │ │ -181 else if (element.type().isPyramid()) │ │ │ │ │ -182 offset = _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*gridIndexSet.subIndex │ │ │ │ │ -(element,0,0); │ │ │ │ │ -183 else │ │ │ │ │ -184 DUNE_THROW(Dune::NotImplemented, "3d elements have to be tetrahedrons, │ │ │ │ │ -prisms, hexahedrons or pyramids"); │ │ │ │ │ -185 } │ │ │ │ │ -186 else │ │ │ │ │ -187 DUNE_THROW(Dune::NotImplemented, "No index method for " << dim << "d grids │ │ │ │ │ -available yet!"); │ │ │ │ │ -188 for (_s_i_z_e___t_y_p_e i = 0, end = node._s_i_z_e() ; i < end ; ++i, ++it) │ │ │ │ │ -189 *it = {offset + i}; │ │ │ │ │ -190 return it; │ │ │ │ │ -191 } │ │ │ │ │ -192 │ │ │ │ │ -_1_9_4 unsigned int _o_r_d_e_r() const │ │ │ │ │ -195 { │ │ │ │ │ -196 return k; │ │ │ │ │ -197 } │ │ │ │ │ -198 │ │ │ │ │ -199protected: │ │ │ │ │ -_2_0_0 _G_r_i_d_V_i_e_w _g_r_i_d_V_i_e_w__; │ │ │ │ │ -201 │ │ │ │ │ -_2_0_2 size_t _q_u_a_d_r_i_l_a_t_e_r_a_l_O_f_f_s_e_t__; │ │ │ │ │ -_2_0_3 size_t _p_y_r_a_m_i_d_O_f_f_s_e_t__; │ │ │ │ │ -_2_0_4 size_t _p_r_i_s_m_O_f_f_s_e_t__; │ │ │ │ │ -_2_0_5 size_t _h_e_x_a_h_e_d_r_o_n_O_f_f_s_e_t__; │ │ │ │ │ -206}; │ │ │ │ │ -207 │ │ │ │ │ -208 │ │ │ │ │ -209 │ │ │ │ │ -210namespace BasisFactory { │ │ │ │ │ -211 │ │ │ │ │ -219template │ │ │ │ │ -_2_2_0auto _l_a_g_r_a_n_g_e_D_G() │ │ │ │ │ -221{ │ │ │ │ │ -222 return [](const auto& gridView) { │ │ │ │ │ -223 return _L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s, k>(gridView); │ │ │ │ │ -224 }; │ │ │ │ │ -225} │ │ │ │ │ -226 │ │ │ │ │ -227} // end namespace BasisFactory │ │ │ │ │ -228 │ │ │ │ │ -229 │ │ │ │ │ -230 │ │ │ │ │ -231/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -232// This is the actual global basis implementation based on the reusable │ │ │ │ │ -parts. │ │ │ │ │ -233/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -234 │ │ │ │ │ -242template │ │ │ │ │ -_2_4_3using _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_> >; │ │ │ │ │ -244 │ │ │ │ │ -245 │ │ │ │ │ -246 │ │ │ │ │ -247} // end namespace Functions │ │ │ │ │ -248} // end namespace Dune │ │ │ │ │ -249 │ │ │ │ │ -250 │ │ │ │ │ -251#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH │ │ │ │ │ -_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 │ │ │ │ │ -_n_o_d_e_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:220 │ │ │ │ │ +98template │ │ │ │ │ +_9_9struct _D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s(FieldVector)> │ │ │ │ │ +100{ │ │ │ │ │ +_1_0_2 typedef FieldMatrix _R_a_n_g_e; │ │ │ │ │ +103}; │ │ │ │ │ +104 │ │ │ │ │ +105 │ │ │ │ │ +106}} // namespace Dune::Functions │ │ │ │ │ +107 │ │ │ │ │ +108 │ │ │ │ │ +109#endif // DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:46 │ │ │ │ │ -_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:387 │ │ │ │ │ -_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:439 │ │ │ │ │ -_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 │ │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:38 │ │ │ │ │ -_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 │ │ │ │ │ -size_type size() const │ │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:115 │ │ │ │ │ -_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:156 │ │ │ │ │ -_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_x_N_o_d_e_S_i_z_e │ │ │ │ │ -size_type maxNodeSize() const │ │ │ │ │ -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_:_:_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 lagrangedgbasis.hh:62 │ │ │ │ │ -_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:194 │ │ │ │ │ -_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_:_:_u_p_d_a_t_e │ │ │ │ │ -void update(const GridView &gv) │ │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:102 │ │ │ │ │ -_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_:_:_h_e_x_a_h_e_d_r_o_n_O_f_f_s_e_t__ │ │ │ │ │ -size_t hexahedronOffset_ │ │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:205 │ │ │ │ │ -_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:110 │ │ │ │ │ -_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_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ -static constexpr size_type maxMultiIndexSize │ │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:60 │ │ │ │ │ -_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:54 │ │ │ │ │ -_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:65 │ │ │ │ │ -_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_:_:_p_y_r_a_m_i_d_O_f_f_s_e_t__ │ │ │ │ │ -size_t pyramidOffset_ │ │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:203 │ │ │ │ │ -_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:52 │ │ │ │ │ -_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 │ │ │ │ │ -size_type size(const SizePrefix &prefix) const │ │ │ │ │ -Return number possible values for next position in multi index. │ │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:138 │ │ │ │ │ -_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:44 │ │ │ │ │ -_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_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ │ -void initializeIndices() │ │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:70 │ │ │ │ │ -_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_:_:_q_u_a_d_r_i_l_a_t_e_r_a_l_O_f_f_s_e_t__ │ │ │ │ │ -size_t quadrilateralOffset_ │ │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:202 │ │ │ │ │ -_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:49 │ │ │ │ │ -_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 │ │ │ │ │ -const GridView & gridView() const │ │ │ │ │ -Obtain the grid view that the basis is defined on. │ │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:97 │ │ │ │ │ -_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: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_:_:_d_o_f_s_P_e_r_T_r_i_a_n_g_l_e │ │ │ │ │ -static const int dofsPerTriangle │ │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:50 │ │ │ │ │ -_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:55 │ │ │ │ │ -_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__ │ │ │ │ │ -GridView gridView_ │ │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:200 │ │ │ │ │ -_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_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ -static constexpr size_type minMultiIndexSize │ │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:61 │ │ │ │ │ -_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 │ │ │ │ │ -std::size_t size_type │ │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:45 │ │ │ │ │ -_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_i_m_e_n_s_i_o_n │ │ │ │ │ -size_type dimension() const │ │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:145 │ │ │ │ │ -_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_:_:_p_r_i_s_m_O_f_f_s_e_t__ │ │ │ │ │ -size_t prismOffset_ │ │ │ │ │ -DDeeffiinniittiioonn lagrangedgbasis.hh:204 │ │ │ │ │ -_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:53 │ │ │ │ │ -_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 │ │ │ │ │ -DDeeffiinniittiioonn nodes.hh:142 │ │ │ │ │ +_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:23 │ │ │ │ │ +_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:37 │ │ │ │ │ +_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:39 │ │ │ │ │ +_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:54 │ │ │ │ │ +_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:70 │ │ │ │ │ +_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:86 │ │ │ │ │ +_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:102 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00059.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: hierarchicallagrangebasis.hh File Reference │ │ │ │ +dune-functions: typeerasure.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,64 +65,44 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces | │ │ │ │ -Typedefs | │ │ │ │ -Functions
│ │ │ │ -
hierarchicallagrangebasis.hh File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
typeerasure.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#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/grid/common/mcmgmapper.hh>
│ │ │ │ +
#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>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::Functions::HierarchicalLagrangePreBasis< GV, k, R >
 A pre-basis for a hierarchical basis. More...
 
class  Dune::Functions::HierarchicalLagrangeNode< GV, k, R >
class  Dune::Functions::TypeErasureBase< Interface, Implementation, bufferSize >
 Base class for type-erased interface wrapper. 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<std::size_t k, typename R = double>
auto Dune::Functions::BasisFactory::hierarchicalLagrange ()
 Create a pre-basis factory that can create a HierarchicalLagrange pre-basis.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,42 +1,27 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -hierarchicallagrangebasis.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_/_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 │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ +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> │ │ │ │ │ _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_,_ _k_,_ _R_ _> │ │ │ │ │ -  A pre-basis for a hierarchical basis. _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_N_o_d_e_<_ _G_V_,_ _k_,_ _R_ _> │ │ │ │ │ +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 │ │ │ │ │   │ │ │ │ │ -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< GV, k, R > > │ │ │ │ │ -  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 () │ │ │ │ │ -  Create a pre-basis factory that can create a HierarchicalLagrange pre- │ │ │ │ │ - basis. │ │ │ │ │ -  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00059_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: hierarchicallagrangebasis.hh Source File │ │ │ │ +dune-functions: typeerasure.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,307 +70,173 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
hierarchicallagrangebasis.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH
│ │ │ │
5
│ │ │ │ -
6#include <dune/common/exceptions.hh>
│ │ │ │ -
7#include <dune/localfunctions/hierarchical/hierarchicalp2.hh>
│ │ │ │ -
8
│ │ │ │ - │ │ │ │ - │ │ │ │ -
11#include <dune/grid/common/mcmgmapper.hh>
│ │ │ │ -
12
│ │ │ │ -
13namespace Dune {
│ │ │ │ -
14 namespace Functions {
│ │ │ │ -
15
│ │ │ │ -
16 // *****************************************************************************
│ │ │ │ -
17 // Implementation for Hierarchical Lagrange Basis
│ │ │ │ -
18 //
│ │ │ │ -
19 // -- only order k=2 is implemented up to now --
│ │ │ │ -
20 // -- currently only supports simplex grids --
│ │ │ │ -
21 //
│ │ │ │ -
22 // This is the reusable part of the HierarchicalLagrangeBasis. It contains
│ │ │ │ -
23 //
│ │ │ │ -
24 // HierarchicalLagrangePreBasis
│ │ │ │ -
25 // HierarchicalLagrangeNode
│ │ │ │ -
26 //
│ │ │ │ -
27 // The pre-basis allows to create the others and is the owner of possible shared
│ │ │ │ -
28 // state. These components do _not_ depend on the global basis and can be
│ │ │ │ -
29 // used without a global basis.
│ │ │ │ -
30 // *****************************************************************************
│ │ │ │ -
31
│ │ │ │ -
32 template<typename GV, int k, typename R=double>
│ │ │ │ -
33 class HierarchicalLagrangeNode;
│ │ │ │ -
34
│ │ │ │ -
35 template<typename GV, int k, typename R=double>
│ │ │ │ -
36 class HierarchicalLagrangePreBasis;
│ │ │ │ -
37
│ │ │ │ -
47 template<typename GV, int k, typename R>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
49 {
│ │ │ │ -
50 static const int dim = GV::dimension;
│ │ │ │ -
51
│ │ │ │ -
52 public:
│ │ │ │ -
53
│ │ │ │ -
55 using GridView = GV;
│ │ │ │ -
56
│ │ │ │ -
58 using size_type = std::size_t;
│ │ │ │ -
59
│ │ │ │ - │ │ │ │ -
62
│ │ │ │ -
63 static constexpr size_type maxMultiIndexSize = 1;
│ │ │ │ -
64 static constexpr size_type minMultiIndexSize = 1;
│ │ │ │ -
65 static constexpr size_type multiIndexBufferSize = 1;
│ │ │ │ -
66
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
72 {}
│ │ │ │ -
│ │ │ │ -
73
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
76 {}
│ │ │ │ -
│ │ │ │ -
77
│ │ │ │ -
│ │ │ │ -
79 const GridView& gridView() const
│ │ │ │ -
80 {
│ │ │ │ -
81 return gridView_;
│ │ │ │ -
82 }
│ │ │ │ -
│ │ │ │ -
83
│ │ │ │ -
│ │ │ │ -
85 void update (const GridView& gv)
│ │ │ │ -
86 {
│ │ │ │ -
87 gridView_ = gv;
│ │ │ │ -
88 mcmgMapper_.update(gv);
│ │ │ │ -
89 }
│ │ │ │ -
│ │ │ │ -
90
│ │ │ │ -
│ │ │ │ -
94 Node makeNode() const
│ │ │ │ -
95 {
│ │ │ │ -
96 return Node{};
│ │ │ │ -
97 }
│ │ │ │ -
│ │ │ │ -
98
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
101 {
│ │ │ │ -
102 return mcmgMapper_.size();
│ │ │ │ -
103 }
│ │ │ │ -
│ │ │ │ -
104
│ │ │ │ -
106 template<class SizePrefix>
│ │ │ │ -
│ │ │ │ -
107 size_type size(const SizePrefix prefix) const
│ │ │ │ -
108 {
│ │ │ │ -
109 assert(prefix.size() == 0 || prefix.size() == 1);
│ │ │ │ -
110 return (prefix.size() == 0) ? size() : 0;
│ │ │ │ -
111 }
│ │ │ │ -
│ │ │ │ -
112
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
115 {
│ │ │ │ -
116 return size();
│ │ │ │ -
117 }
│ │ │ │ -
│ │ │ │ -
118
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
124 {
│ │ │ │ -
125 // That cast to unsigned int is necessary because GV::dimension is an enum
│ │ │ │ -
126 return Dune::binomial(std::size_t(order() + (unsigned int)GV::dimension),std::size_t(order()));
│ │ │ │ -
127 }
│ │ │ │ -
│ │ │ │ -
128
│ │ │ │ -
129 template<typename It>
│ │ │ │ -
│ │ │ │ -
130 It indices(const Node& node, It it) const
│ │ │ │ -
131 {
│ │ │ │ -
132 for (size_type i = 0, end = node.finiteElement().size() ; i < end ; ++it, ++i)
│ │ │ │ -
133 {
│ │ │ │ -
134 Dune::LocalKey localKey = node.finiteElement().localCoefficients().localKey(i);
│ │ │ │ -
135 const auto& element = node.element();
│ │ │ │ -
136
│ │ │ │ -
137 *it = {{ (size_type)(mcmgMapper_.subIndex(element,localKey.subEntity(),localKey.codim())) }};
│ │ │ │ -
138 }
│ │ │ │ -
139 return it;
│ │ │ │ -
140 }
│ │ │ │ -
│ │ │ │ +
6#include <typeinfo>
│ │ │ │ +
7
│ │ │ │ +
8#include <dune/common/typeutilities.hh>
│ │ │ │ +
9
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
13
│ │ │ │ +
14namespace Dune {
│ │ │ │ +
15namespace Functions {
│ │ │ │ +
16namespace Imp {
│ │ │ │ +
17
│ │ │ │ +
18
│ │ │ │ +
19
│ │ │ │ +
33template<class Interface>
│ │ │ │ +
34class TypeErasureWrapperInterface :
│ │ │ │ +
35 public Interface,
│ │ │ │ +
36 public PolymorphicType<TypeErasureWrapperInterface<Interface>>
│ │ │ │ +
37{
│ │ │ │ +
38public:
│ │ │ │ +
39 virtual const std::type_info& target_type() const = 0;
│ │ │ │ +
40};
│ │ │ │ +
41
│ │ │ │ +
42
│ │ │ │ +
43
│ │ │ │ +
60template<class Interface, class T>
│ │ │ │ +
61class TypeErasureWrapperBase :
│ │ │ │ +
62 public TypeErasureWrapperInterface<Interface>
│ │ │ │ +
63{
│ │ │ │ +
64public:
│ │ │ │ +
65 template<class TT, disableCopyMove<TypeErasureWrapperBase, TT> = 0>
│ │ │ │ +
66 TypeErasureWrapperBase(TT&& t) :
│ │ │ │ +
67 wrapped_(std::forward<TT>(t))
│ │ │ │ +
68 {}
│ │ │ │ +
69
│ │ │ │ +
71 T& get()
│ │ │ │ +
72 {
│ │ │ │ +
73 return wrapped_;
│ │ │ │ +
74 }
│ │ │ │ +
75
│ │ │ │ +
77 const T& get() const
│ │ │ │ +
78 {
│ │ │ │ +
79 return wrapped_;
│ │ │ │ +
80 }
│ │ │ │ +
81
│ │ │ │ +
82protected:
│ │ │ │ +
83 using Wrapped = T;
│ │ │ │ +
84 Wrapped wrapped_;
│ │ │ │ +
85};
│ │ │ │ +
86
│ │ │ │ +
87
│ │ │ │ +
88
│ │ │ │ +
112template<class Interface, template<class> class Implementation, class T>
│ │ │ │ +
113class TypeErasureWrapperImplementation :
│ │ │ │ +
114 public Implementation<TypeErasureWrapperBase<Interface, T> >
│ │ │ │ +
115{
│ │ │ │ +
116public:
│ │ │ │ +
117
│ │ │ │ +
119 template<class TT, disableCopyMove<TypeErasureWrapperImplementation, T> = 0>
│ │ │ │ +
120 TypeErasureWrapperImplementation(TT&& t) :
│ │ │ │ +
121 Implementation<TypeErasureWrapperBase<Interface, T> >(std::forward<TT>(t))
│ │ │ │ +
122 {}
│ │ │ │ +
123
│ │ │ │ +
125 virtual TypeErasureWrapperImplementation* clone() const
│ │ │ │ +
126 {
│ │ │ │ +
127 return new TypeErasureWrapperImplementation(*this);
│ │ │ │ +
128 }
│ │ │ │ +
129
│ │ │ │ +
131 virtual TypeErasureWrapperImplementation* clone(void* buffer) const
│ │ │ │ +
132 {
│ │ │ │ +
133 return new (buffer) TypeErasureWrapperImplementation(*this);
│ │ │ │ +
134 }
│ │ │ │ +
135
│ │ │ │ +
137 virtual TypeErasureWrapperImplementation* move(void* buffer)
│ │ │ │ +
138 {
│ │ │ │ +
139 return new (buffer) TypeErasureWrapperImplementation(std::move(*this));
│ │ │ │ +
140 }
│ │ │ │
141
│ │ │ │ -
142 protected:
│ │ │ │ - │ │ │ │ -
144
│ │ │ │ -
│ │ │ │ -
145 unsigned int order() const
│ │ │ │ -
146 {
│ │ │ │ -
147 return 2;
│ │ │ │ -
148 }
│ │ │ │ -
│ │ │ │ -
149
│ │ │ │ -
150 MultipleCodimMultipleGeomTypeMapper<GridView> mcmgMapper_;
│ │ │ │ +
143 virtual const std::type_info& target_type() const
│ │ │ │ +
144 {
│ │ │ │ +
145 return typeid(T);
│ │ │ │ +
146 }
│ │ │ │ +
147};
│ │ │ │ +
148
│ │ │ │ +
149} // namespace Dune::Functions::Imp
│ │ │ │ +
150
│ │ │ │
151
│ │ │ │ -
152 private:
│ │ │ │ -
157 static auto p2Layout()
│ │ │ │ -
158 {
│ │ │ │ -
159 return [](Dune::GeometryType type, int gridDim)
│ │ │ │ -
160 {
│ │ │ │ -
161 if (type.isVertex())
│ │ │ │ -
162 return 1;
│ │ │ │ -
163 if (type.isLine())
│ │ │ │ -
164 return 1;
│ │ │ │ -
165 if (type.isTriangle())
│ │ │ │ -
166 return 0;
│ │ │ │ -
167 assert(type.isTetrahedron());
│ │ │ │ -
168 return 0;
│ │ │ │ -
169 };
│ │ │ │ -
170 }
│ │ │ │ -
171 };
│ │ │ │ +
152
│ │ │ │ +
163template<class Interface, template<class> class Implementation, size_t bufferSize = 56>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
165{
│ │ │ │ +
166public:
│ │ │ │ +
167
│ │ │ │ +
169 template<class T, disableCopyMove<TypeErasureBase, T> = 0 >
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
171 wrapped_(Imp::TypeErasureWrapperImplementation<Interface, Implementation, typename std::decay<T>::type>(std::forward<T>(t)))
│ │ │ │ +
172 {}
│ │ │ │
│ │ │ │ -
172
│ │ │ │
173
│ │ │ │ -
174
│ │ │ │ -
175 template<typename GV, int k, typename R>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
177 public LeafBasisNode
│ │ │ │ -
178 {
│ │ │ │ -
179 static const int dim = GV::dimension;
│ │ │ │ -
180
│ │ │ │ -
181 public:
│ │ │ │ +
175 TypeErasureBase() = default;
│ │ │ │ +
176
│ │ │ │ +
│ │ │ │ +
178 Interface& asInterface()
│ │ │ │ +
179 {
│ │ │ │ +
180 return wrapped_.get();
│ │ │ │ +
181 }
│ │ │ │ +
│ │ │ │
182
│ │ │ │ -
183 using size_type = std::size_t;
│ │ │ │ -
184 using Element = typename GV::template Codim<0>::Entity;
│ │ │ │ -
185 using FiniteElement = HierarchicalP2LocalFiniteElement<typename GV::ctype,R,dim>;
│ │ │ │ -
186
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ -
189 element_(nullptr)
│ │ │ │ -
190 {}
│ │ │ │ -
│ │ │ │ -
191
│ │ │ │ -
│ │ │ │ -
193 const Element& element() const
│ │ │ │ -
194 {
│ │ │ │ -
195 return *element_;
│ │ │ │ -
196 }
│ │ │ │ -
│ │ │ │ -
197
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
203 {
│ │ │ │ -
204 return finiteElement_;
│ │ │ │ -
205 }
│ │ │ │ -
│ │ │ │ -
206
│ │ │ │ -
│ │ │ │ -
208 void bind(const Element& e)
│ │ │ │ -
209 {
│ │ │ │ -
210 element_ = &e;
│ │ │ │ -
211
│ │ │ │ -
212 if (e.type() != finiteElement_.type())
│ │ │ │ -
213 DUNE_THROW(Dune::Exception,
│ │ │ │ -
214 "HierarchicalLagrange-elements do not exist for elements of type " << e.type());
│ │ │ │ -
215
│ │ │ │ -
216 this->setSize(finiteElement_.size());
│ │ │ │ -
217 }
│ │ │ │ -
│ │ │ │ -
218
│ │ │ │ -
219 protected:
│ │ │ │ -
220
│ │ │ │ -
│ │ │ │ -
221 unsigned int order() const
│ │ │ │ -
222 {
│ │ │ │ -
223 return 2;
│ │ │ │ -
224 }
│ │ │ │ -
│ │ │ │ -
225
│ │ │ │ - │ │ │ │ - │ │ │ │ -
228 };
│ │ │ │ -
│ │ │ │ -
229
│ │ │ │ -
230
│ │ │ │ -
231
│ │ │ │ -
232 namespace BasisFactory {
│ │ │ │ -
233
│ │ │ │ -
242 template<std::size_t k, typename R=double>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
244 {
│ │ │ │ -
245 return [](const auto& gridView) {
│ │ │ │ -
246 return HierarchicalLagrangePreBasis<std::decay_t<decltype(gridView)>, k, R>(gridView);
│ │ │ │ -
247 };
│ │ │ │ -
248 }
│ │ │ │ -
│ │ │ │ -
249
│ │ │ │ -
250 } // end namespace BasisFactory
│ │ │ │ -
251
│ │ │ │ -
262 template<typename GV, int k, typename R=double>
│ │ │ │ - │ │ │ │ -
264
│ │ │ │ -
265 } // end namespace Functions
│ │ │ │ -
266} // end namespace Dune
│ │ │ │ -
267
│ │ │ │ -
268#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ -
auto hierarchicalLagrange()
Create a pre-basis factory that can create a HierarchicalLagrange pre-basis.
Definition hierarchicallagrangebasis.hh:243
│ │ │ │ +
│ │ │ │ +
184 const Interface& asInterface() const
│ │ │ │ +
185 {
│ │ │ │ +
186 return wrapped_.get();
│ │ │ │ +
187 }
│ │ │ │ +
│ │ │ │ +
188
│ │ │ │ +
│ │ │ │ +
190 const std::type_info& target_type() const
│ │ │ │ +
191 {
│ │ │ │ +
192 return wrapped_.get().target_type();
│ │ │ │ +
193 }
│ │ │ │ +
│ │ │ │ +
194
│ │ │ │ +
195protected:
│ │ │ │ + │ │ │ │ +
197};
│ │ │ │ +
│ │ │ │ +
198
│ │ │ │ +
199
│ │ │ │ +
200}} // namespace Dune::Functions
│ │ │ │ +
201
│ │ │ │ +
202
│ │ │ │ +
203
│ │ │ │ +
204#endif // DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:46
│ │ │ │ -
Definition hierarchicallagrangebasis.hh:178
│ │ │ │ -
HierarchicalP2LocalFiniteElement< typename GV::ctype, R, dim > FiniteElement
Definition hierarchicallagrangebasis.hh:185
│ │ │ │ -
const Element & element() const
Return current element, throw if unbound.
Definition hierarchicallagrangebasis.hh:193
│ │ │ │ -
void bind(const Element &e)
Bind to element.
Definition hierarchicallagrangebasis.hh:208
│ │ │ │ -
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition hierarchicallagrangebasis.hh:202
│ │ │ │ -
const Element * element_
Definition hierarchicallagrangebasis.hh:227
│ │ │ │ -
const FiniteElement finiteElement_
Definition hierarchicallagrangebasis.hh:226
│ │ │ │ -
unsigned int order() const
Definition hierarchicallagrangebasis.hh:221
│ │ │ │ -
HierarchicalLagrangeNode()
Definition hierarchicallagrangebasis.hh:187
│ │ │ │ -
std::size_t size_type
Definition hierarchicallagrangebasis.hh:183
│ │ │ │ -
typename GV::template Codim< 0 >::Entity Element
Definition hierarchicallagrangebasis.hh:184
│ │ │ │ -
A pre-basis for a hierarchical basis.
Definition hierarchicallagrangebasis.hh:49
│ │ │ │ -
std::size_t size_type
Type used for indices and size information.
Definition hierarchicallagrangebasis.hh:58
│ │ │ │ -
unsigned int order() const
Definition hierarchicallagrangebasis.hh:145
│ │ │ │ -
Node makeNode() const
Create tree node.
Definition hierarchicallagrangebasis.hh:94
│ │ │ │ -
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition hierarchicallagrangebasis.hh:123
│ │ │ │ -
static constexpr size_type multiIndexBufferSize
Definition hierarchicallagrangebasis.hh:65
│ │ │ │ -
void update(const GridView &gv)
Update the stored grid view & MultipleCodimMultipleGeomTypeMapper, to be called if the grid has chang...
Definition hierarchicallagrangebasis.hh:85
│ │ │ │ -
MultipleCodimMultipleGeomTypeMapper< GridView > mcmgMapper_
Definition hierarchicallagrangebasis.hh:150
│ │ │ │ -
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition hierarchicallagrangebasis.hh:114
│ │ │ │ -
GV GridView
The grid view that the FE basis is defined on.
Definition hierarchicallagrangebasis.hh:55
│ │ │ │ -
HierarchicalLagrangePreBasis(const GridView &gv)
Constructor for a given grid view object with layout for second order.
Definition hierarchicallagrangebasis.hh:71
│ │ │ │ -
static constexpr size_type maxMultiIndexSize
Definition hierarchicallagrangebasis.hh:63
│ │ │ │ -
size_type size(const SizePrefix prefix) const
Return number of possible values for next position in multi index.
Definition hierarchicallagrangebasis.hh:107
│ │ │ │ -
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition hierarchicallagrangebasis.hh:79
│ │ │ │ -
GridView gridView_
Definition hierarchicallagrangebasis.hh:143
│ │ │ │ -
size_type size() const
Same as size(prefix) with empty prefix.
Definition hierarchicallagrangebasis.hh:100
│ │ │ │ -
void initializeIndices()
Initialize the global indices.
Definition hierarchicallagrangebasis.hh:75
│ │ │ │ -
It indices(const Node &node, It it) const
Definition hierarchicallagrangebasis.hh:130
│ │ │ │ -
static constexpr size_type minMultiIndexSize
Definition hierarchicallagrangebasis.hh:64
│ │ │ │ -
void setSize(const size_type size)
Definition nodes.hh:164
│ │ │ │ -
Definition nodes.hh:186
│ │ │ │ +
A wrapper providing small object optimization with polymorphic types.
Definition polymorphicsmallobject.hh:45
│ │ │ │ +
Base class for type-erased interface wrapper.
Definition typeerasure.hh:165
│ │ │ │ +
const std::type_info & target_type() const
Get type of stored object.
Definition typeerasure.hh:190
│ │ │ │ +
TypeErasureBase(T &&t)
Construct wrapper from object.
Definition typeerasure.hh:170
│ │ │ │ +
PolymorphicSmallObject< Imp::TypeErasureWrapperInterface< Interface >, bufferSize > wrapped_
Definition typeerasure.hh:196
│ │ │ │ +
TypeErasureBase()=default
Default constructor.
│ │ │ │ +
Interface & asInterface()
Get mutable reference to wrapped object.
Definition typeerasure.hh:178
│ │ │ │ +
const Interface & asInterface() const
Get reference to wrapped object.
Definition typeerasure.hh:184
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,354 +1,179 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -hierarchicallagrangebasis.hh │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ -8 │ │ │ │ │ -9#include <_d_u_n_e_/_f_u_n_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> │ │ │ │ │ -10#include <_d_u_n_e_/_f_u_n_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> │ │ │ │ │ -11#include │ │ │ │ │ -12 │ │ │ │ │ -13namespace _D_u_n_e { │ │ │ │ │ -14 namespace Functions { │ │ │ │ │ -15 │ │ │ │ │ -16 / │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -17 // Implementation for Hierarchical Lagrange Basis │ │ │ │ │ -18 // │ │ │ │ │ -19 // -- only order k=2 is implemented up to now -- │ │ │ │ │ -20 // -- currently only supports simplex grids -- │ │ │ │ │ -21 // │ │ │ │ │ -22 // This is the reusable part of the HierarchicalLagrangeBasis. It contains │ │ │ │ │ -23 // │ │ │ │ │ -24 // HierarchicalLagrangePreBasis │ │ │ │ │ -25 // HierarchicalLagrangeNode │ │ │ │ │ -26 // │ │ │ │ │ -27 // The pre-basis allows to create the others and is the owner of possible │ │ │ │ │ -shared │ │ │ │ │ -28 // state. These components do _not_ depend on the global basis and can be │ │ │ │ │ -29 // used without a global basis. │ │ │ │ │ -30 / │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -31 │ │ │ │ │ -32 template │ │ │ │ │ -33 class HierarchicalLagrangeNode; │ │ │ │ │ -34 │ │ │ │ │ -35 template │ │ │ │ │ -36 class HierarchicalLagrangePreBasis; │ │ │ │ │ -37 │ │ │ │ │ -47 template │ │ │ │ │ -_4_8 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 │ │ │ │ │ -49 { │ │ │ │ │ -50 static const int dim = GV::dimension; │ │ │ │ │ -51 │ │ │ │ │ -52 public: │ │ │ │ │ -53 │ │ │ │ │ -_5_5 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ │ -56 │ │ │ │ │ -_5_8 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ -59 │ │ │ │ │ -_6_1 using _N_o_d_e = _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_N_o_d_e_<_G_V_,_ _k_,_ _R_>; │ │ │ │ │ -62 │ │ │ │ │ -_6_3 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 = 1; │ │ │ │ │ -_6_4 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 = 1; │ │ │ │ │ -_6_5 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 = 1; │ │ │ │ │ -66 │ │ │ │ │ -_7_1 _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 _G_r_i_d_V_i_e_w& gv) : _g_r_i_d_V_i_e_w__(gv) , │ │ │ │ │ -_m_c_m_g_M_a_p_p_e_r__(gv,p2Layout()) │ │ │ │ │ -72 {} │ │ │ │ │ -73 │ │ │ │ │ -_7_5 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ │ -76 {} │ │ │ │ │ -77 │ │ │ │ │ -_7_9 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ │ -80 { │ │ │ │ │ -81 return _g_r_i_d_V_i_e_w__; │ │ │ │ │ -82 } │ │ │ │ │ -83 │ │ │ │ │ -_8_5 void _u_p_d_a_t_e (const _G_r_i_d_V_i_e_w& gv) │ │ │ │ │ -86 { │ │ │ │ │ -87 _g_r_i_d_V_i_e_w__ = gv; │ │ │ │ │ -88 _m_c_m_g_M_a_p_p_e_r__.update(gv); │ │ │ │ │ -89 } │ │ │ │ │ -90 │ │ │ │ │ -_9_4 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ │ -95 { │ │ │ │ │ -96 return _N_o_d_e{}; │ │ │ │ │ -97 } │ │ │ │ │ -98 │ │ │ │ │ -_1_0_0 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ │ -101 { │ │ │ │ │ -102 return _m_c_m_g_M_a_p_p_e_r__.size(); │ │ │ │ │ -103 } │ │ │ │ │ -104 │ │ │ │ │ -106 template │ │ │ │ │ -_1_0_7 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix prefix) const │ │ │ │ │ -108 { │ │ │ │ │ -109 assert(prefix.size() == 0 || prefix.size() == 1); │ │ │ │ │ -110 return (prefix.size() == 0) ? _s_i_z_e() : 0; │ │ │ │ │ -111 } │ │ │ │ │ -112 │ │ │ │ │ -_1_1_4 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ │ -115 { │ │ │ │ │ -116 return _s_i_z_e(); │ │ │ │ │ -117 } │ │ │ │ │ -118 │ │ │ │ │ -_1_2_3 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ │ -124 { │ │ │ │ │ -125 // That cast to unsigned int is necessary because GV::dimension is an enum │ │ │ │ │ -126 return Dune::binomial(std::size_t(_o_r_d_e_r() + (unsigned int)GV:: │ │ │ │ │ -dimension),std::size_t(_o_r_d_e_r())); │ │ │ │ │ -127 } │ │ │ │ │ -128 │ │ │ │ │ -129 template │ │ │ │ │ -_1_3_0 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ │ -131 { │ │ │ │ │ -132 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) │ │ │ │ │ -133 { │ │ │ │ │ -134 Dune::LocalKey localKey = node._f_i_n_i_t_e_E_l_e_m_e_n_t().localCoefficients().localKey │ │ │ │ │ -(i); │ │ │ │ │ -135 const auto& element = node._e_l_e_m_e_n_t(); │ │ │ │ │ -136 │ │ │ │ │ -137 *it = {{ (_s_i_z_e___t_y_p_e)(_m_c_m_g_M_a_p_p_e_r__.subIndex(element,localKey.subEntity │ │ │ │ │ -(),localKey.codim())) }}; │ │ │ │ │ -138 } │ │ │ │ │ -139 return it; │ │ │ │ │ +6#include │ │ │ │ │ +7 │ │ │ │ │ +8#include │ │ │ │ │ +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_/_p_o_l_y_m_o_r_p_h_i_c_s_m_a_l_l_o_b_j_e_c_t_._h_h> │ │ │ │ │ +13 │ │ │ │ │ +14namespace _D_u_n_e { │ │ │ │ │ +15namespace Functions { │ │ │ │ │ +16namespace Imp { │ │ │ │ │ +17 │ │ │ │ │ +18 │ │ │ │ │ +19 │ │ │ │ │ +33template │ │ │ │ │ +34class TypeErasureWrapperInterface : │ │ │ │ │ +35 public Interface, │ │ │ │ │ +36 public PolymorphicType> │ │ │ │ │ +37{ │ │ │ │ │ +38public: │ │ │ │ │ +39 virtual const std::type_info& target_type() const = 0; │ │ │ │ │ +40}; │ │ │ │ │ +41 │ │ │ │ │ +42 │ │ │ │ │ +43 │ │ │ │ │ +60template │ │ │ │ │ +61class TypeErasureWrapperBase : │ │ │ │ │ +62 public TypeErasureWrapperInterface │ │ │ │ │ +63{ │ │ │ │ │ +64public: │ │ │ │ │ +65 template = 0> │ │ │ │ │ +66 TypeErasureWrapperBase(TT&& t) : │ │ │ │ │ +67 wrapped_(std::forward(t)) │ │ │ │ │ +68 {} │ │ │ │ │ +69 │ │ │ │ │ +71 T& get() │ │ │ │ │ +72 { │ │ │ │ │ +73 return wrapped_; │ │ │ │ │ +74 } │ │ │ │ │ +75 │ │ │ │ │ +77 const T& get() const │ │ │ │ │ +78 { │ │ │ │ │ +79 return wrapped_; │ │ │ │ │ +80 } │ │ │ │ │ +81 │ │ │ │ │ +82protected: │ │ │ │ │ +83 using Wrapped = T; │ │ │ │ │ +84 Wrapped wrapped_; │ │ │ │ │ +85}; │ │ │ │ │ +86 │ │ │ │ │ +87 │ │ │ │ │ +88 │ │ │ │ │ +112template class Implementation, class T> │ │ │ │ │ +113class TypeErasureWrapperImplementation : │ │ │ │ │ +114 public Implementation > │ │ │ │ │ +115{ │ │ │ │ │ +116public: │ │ │ │ │ +117 │ │ │ │ │ +119 template = │ │ │ │ │ +0> │ │ │ │ │ +120 TypeErasureWrapperImplementation(TT&& t) : │ │ │ │ │ +121 Implementation >(std::forward(t)) │ │ │ │ │ +122 {} │ │ │ │ │ +123 │ │ │ │ │ +125 virtual TypeErasureWrapperImplementation* clone() const │ │ │ │ │ +126 { │ │ │ │ │ +127 return new TypeErasureWrapperImplementation(*this); │ │ │ │ │ +128 } │ │ │ │ │ +129 │ │ │ │ │ +131 virtual TypeErasureWrapperImplementation* clone(void* buffer) const │ │ │ │ │ +132 { │ │ │ │ │ +133 return new (buffer) TypeErasureWrapperImplementation(*this); │ │ │ │ │ +134 } │ │ │ │ │ +135 │ │ │ │ │ +137 virtual TypeErasureWrapperImplementation* move(void* buffer) │ │ │ │ │ +138 { │ │ │ │ │ +139 return new (buffer) TypeErasureWrapperImplementation(std::move(*this)); │ │ │ │ │ 140 } │ │ │ │ │ 141 │ │ │ │ │ -142 protected: │ │ │ │ │ -_1_4_3 _G_r_i_d_V_i_e_w _g_r_i_d_V_i_e_w__; │ │ │ │ │ -144 │ │ │ │ │ -_1_4_5 unsigned int _o_r_d_e_r() const │ │ │ │ │ -146 { │ │ │ │ │ -147 return 2; │ │ │ │ │ -148 } │ │ │ │ │ -149 │ │ │ │ │ -_1_5_0 MultipleCodimMultipleGeomTypeMapper _m_c_m_g_M_a_p_p_e_r__; │ │ │ │ │ +143 virtual const std::type_info& target_type() const │ │ │ │ │ +144 { │ │ │ │ │ +145 return typeid(T); │ │ │ │ │ +146 } │ │ │ │ │ +147}; │ │ │ │ │ +148 │ │ │ │ │ +149} // namespace Dune::Functions::Imp │ │ │ │ │ +150 │ │ │ │ │ 151 │ │ │ │ │ -152 private: │ │ │ │ │ -157 static auto p2Layout() │ │ │ │ │ -158 { │ │ │ │ │ -159 return [](Dune::GeometryType type, int gridDim) │ │ │ │ │ -160 { │ │ │ │ │ -161 if (type.isVertex()) │ │ │ │ │ -162 return 1; │ │ │ │ │ -163 if (type.isLine()) │ │ │ │ │ -164 return 1; │ │ │ │ │ -165 if (type.isTriangle()) │ │ │ │ │ -166 return 0; │ │ │ │ │ -167 assert(type.isTetrahedron()); │ │ │ │ │ -168 return 0; │ │ │ │ │ -169 }; │ │ │ │ │ -170 } │ │ │ │ │ -171 }; │ │ │ │ │ -172 │ │ │ │ │ +152 │ │ │ │ │ +163template class Implementation, size_t │ │ │ │ │ +bufferSize = 56> │ │ │ │ │ +_1_6_4class _T_y_p_e_E_r_a_s_u_r_e_B_a_s_e │ │ │ │ │ +165{ │ │ │ │ │ +166public: │ │ │ │ │ +167 │ │ │ │ │ +169 template = 0 > │ │ │ │ │ +_1_7_0 _T_y_p_e_E_r_a_s_u_r_e_B_a_s_e(T&& t) : │ │ │ │ │ +171 _w_r_a_p_p_e_d__(Imp::TypeErasureWrapperImplementation::type>(std::forward(t))) │ │ │ │ │ +172 {} │ │ │ │ │ 173 │ │ │ │ │ -174 │ │ │ │ │ -175 template │ │ │ │ │ -_1_7_6 class _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_N_o_d_e : │ │ │ │ │ -177 public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ │ -178 { │ │ │ │ │ -179 static const int dim = GV::dimension; │ │ │ │ │ -180 │ │ │ │ │ -181 public: │ │ │ │ │ +_1_7_5 _T_y_p_e_E_r_a_s_u_r_e_B_a_s_e() = default; │ │ │ │ │ +176 │ │ │ │ │ +_1_7_8 Interface& _a_s_I_n_t_e_r_f_a_c_e() │ │ │ │ │ +179 { │ │ │ │ │ +180 return _w_r_a_p_p_e_d__.get(); │ │ │ │ │ +181 } │ │ │ │ │ 182 │ │ │ │ │ -_1_8_3 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ -_1_8_4 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ │ -_1_8_5 using _F_i_n_i_t_e_E_l_e_m_e_n_t = HierarchicalP2LocalFiniteElement; │ │ │ │ │ -186 │ │ │ │ │ -_1_8_7 _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_N_o_d_e() : │ │ │ │ │ -188 _f_i_n_i_t_e_E_l_e_m_e_n_t__(), │ │ │ │ │ -189 _e_l_e_m_e_n_t__(nullptr) │ │ │ │ │ -190 {} │ │ │ │ │ -191 │ │ │ │ │ -_1_9_3 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ │ -194 { │ │ │ │ │ -195 return *_e_l_e_m_e_n_t__; │ │ │ │ │ -196 } │ │ │ │ │ -197 │ │ │ │ │ -_2_0_2 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 │ │ │ │ │ -203 { │ │ │ │ │ -204 return _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ │ -205 } │ │ │ │ │ -206 │ │ │ │ │ -_2_0_8 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ │ -209 { │ │ │ │ │ -210 _e_l_e_m_e_n_t__ = &e; │ │ │ │ │ -211 │ │ │ │ │ -212 if (e.type() != _f_i_n_i_t_e_E_l_e_m_e_n_t__.type()) │ │ │ │ │ -213 DUNE_THROW(Dune::Exception, │ │ │ │ │ -214 "HierarchicalLagrange-elements do not exist for elements of type " << │ │ │ │ │ -e.type()); │ │ │ │ │ -215 │ │ │ │ │ -216 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__.size()); │ │ │ │ │ -217 } │ │ │ │ │ -218 │ │ │ │ │ -219 protected: │ │ │ │ │ -220 │ │ │ │ │ -_2_2_1 unsigned int _o_r_d_e_r() const │ │ │ │ │ -222 { │ │ │ │ │ -223 return 2; │ │ │ │ │ -224 } │ │ │ │ │ -225 │ │ │ │ │ -_2_2_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__; │ │ │ │ │ -_2_2_7 const _E_l_e_m_e_n_t* _e_l_e_m_e_n_t__; │ │ │ │ │ -228 }; │ │ │ │ │ -229 │ │ │ │ │ -230 │ │ │ │ │ -231 │ │ │ │ │ -232 namespace BasisFactory { │ │ │ │ │ -233 │ │ │ │ │ -242 template │ │ │ │ │ -_2_4_3 auto _h_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e() │ │ │ │ │ -244 { │ │ │ │ │ -245 return [](const auto& gridView) { │ │ │ │ │ -246 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); │ │ │ │ │ -247 }; │ │ │ │ │ -248 } │ │ │ │ │ -249 │ │ │ │ │ -250 } // end namespace BasisFactory │ │ │ │ │ -251 │ │ │ │ │ -262 template │ │ │ │ │ -_2_6_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_> >; │ │ │ │ │ -264 │ │ │ │ │ -265 } // end namespace Functions │ │ │ │ │ -266} // end namespace Dune │ │ │ │ │ -267 │ │ │ │ │ -268#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH │ │ │ │ │ -_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ │ -_n_o_d_e_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 │ │ │ │ │ -auto hierarchicalLagrange() │ │ │ │ │ -Create a pre-basis factory that can create a HierarchicalLagrange pre-basis. │ │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:243 │ │ │ │ │ +_1_8_4 const Interface& _a_s_I_n_t_e_r_f_a_c_e() const │ │ │ │ │ +185 { │ │ │ │ │ +186 return _w_r_a_p_p_e_d__.get(); │ │ │ │ │ +187 } │ │ │ │ │ +188 │ │ │ │ │ +_1_9_0 const std::type_info& _t_a_r_g_e_t___t_y_p_e() const │ │ │ │ │ +191 { │ │ │ │ │ +192 return _w_r_a_p_p_e_d__.get().target_type(); │ │ │ │ │ +193 } │ │ │ │ │ +194 │ │ │ │ │ +195protected: │ │ │ │ │ +_1_9_6 _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__; │ │ │ │ │ +197}; │ │ │ │ │ +198 │ │ │ │ │ +199 │ │ │ │ │ +200}} // namespace Dune::Functions │ │ │ │ │ +201 │ │ │ │ │ +202 │ │ │ │ │ +203 │ │ │ │ │ +204#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 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:46 │ │ │ │ │ -_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_N_o_d_e │ │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:178 │ │ │ │ │ -_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_N_o_d_e_:_:_F_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ │ -HierarchicalP2LocalFiniteElement< typename GV::ctype, R, dim > FiniteElement │ │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:185 │ │ │ │ │ -_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_N_o_d_e_:_:_e_l_e_m_e_n_t │ │ │ │ │ -const Element & element() const │ │ │ │ │ -Return current element, throw if unbound. │ │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:193 │ │ │ │ │ -_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_N_o_d_e_:_:_b_i_n_d │ │ │ │ │ -void bind(const Element &e) │ │ │ │ │ -Bind to element. │ │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:208 │ │ │ │ │ -_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_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 hierarchicallagrangebasis.hh:202 │ │ │ │ │ -_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_N_o_d_e_:_:_e_l_e_m_e_n_t__ │ │ │ │ │ -const Element * element_ │ │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:227 │ │ │ │ │ -_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_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t__ │ │ │ │ │ -const FiniteElement finiteElement_ │ │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:226 │ │ │ │ │ -_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_N_o_d_e_:_:_o_r_d_e_r │ │ │ │ │ -unsigned int order() const │ │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:221 │ │ │ │ │ -_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_N_o_d_e_:_:_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_N_o_d_e │ │ │ │ │ -HierarchicalLagrangeNode() │ │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:187 │ │ │ │ │ -_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_N_o_d_e_:_:_s_i_z_e___t_y_p_e │ │ │ │ │ -std::size_t size_type │ │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:183 │ │ │ │ │ -_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_N_o_d_e_:_:_E_l_e_m_e_n_t │ │ │ │ │ -typename GV::template Codim< 0 >::Entity Element │ │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:184 │ │ │ │ │ -_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 basis. │ │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:49 │ │ │ │ │ -_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_:_:_s_i_z_e___t_y_p_e │ │ │ │ │ -std::size_t size_type │ │ │ │ │ -Type used for indices and size information. │ │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:58 │ │ │ │ │ -_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_:_:_o_r_d_e_r │ │ │ │ │ -unsigned int order() const │ │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:145 │ │ │ │ │ -_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_:_:_m_a_k_e_N_o_d_e │ │ │ │ │ -Node makeNode() const │ │ │ │ │ -Create tree node. │ │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:94 │ │ │ │ │ -_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_:_:_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 hierarchicallagrangebasis.hh:123 │ │ │ │ │ -_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_:_:_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 hierarchicallagrangebasis.hh:65 │ │ │ │ │ -_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_:_:_u_p_d_a_t_e │ │ │ │ │ -void update(const GridView &gv) │ │ │ │ │ -Update the stored grid view & MultipleCodimMultipleGeomTypeMapper, to be called │ │ │ │ │ -if the grid has chang... │ │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:85 │ │ │ │ │ -_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_:_:_m_c_m_g_M_a_p_p_e_r__ │ │ │ │ │ -MultipleCodimMultipleGeomTypeMapper< GridView > mcmgMapper_ │ │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:150 │ │ │ │ │ -_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_:_:_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 hierarchicallagrangebasis.hh:114 │ │ │ │ │ -_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_r_i_d_V_i_e_w │ │ │ │ │ -GV GridView │ │ │ │ │ -The grid view that the FE basis is defined on. │ │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:55 │ │ │ │ │ -_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_:_:_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 GridView &gv) │ │ │ │ │ -Constructor for a given grid view object with layout for second order. │ │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:71 │ │ │ │ │ -_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_:_:_m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ -static constexpr size_type maxMultiIndexSize │ │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:63 │ │ │ │ │ -_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_:_:_s_i_z_e │ │ │ │ │ -size_type size(const SizePrefix prefix) const │ │ │ │ │ -Return number of possible values for next position in multi index. │ │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:107 │ │ │ │ │ -_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_r_i_d_V_i_e_w │ │ │ │ │ -const GridView & gridView() const │ │ │ │ │ -Obtain the grid view that the basis is defined on. │ │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:79 │ │ │ │ │ -_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_r_i_d_V_i_e_w__ │ │ │ │ │ -GridView gridView_ │ │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:143 │ │ │ │ │ -_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_:_:_s_i_z_e │ │ │ │ │ -size_type size() const │ │ │ │ │ -Same as size(prefix) with empty prefix. │ │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:100 │ │ │ │ │ -_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_:_:_i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ │ -void initializeIndices() │ │ │ │ │ -Initialize the global indices. │ │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:75 │ │ │ │ │ -_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_:_:_i_n_d_i_c_e_s │ │ │ │ │ -It indices(const Node &node, It it) const │ │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:130 │ │ │ │ │ -_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_:_:_m_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ -static constexpr size_type minMultiIndexSize │ │ │ │ │ -DDeeffiinniittiioonn hierarchicallagrangebasis.hh:64 │ │ │ │ │ -_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:164 │ │ │ │ │ -_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:186 │ │ │ │ │ +_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:45 │ │ │ │ │ +_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 │ │ │ │ │ +Base class for type-erased interface wrapper. │ │ │ │ │ +DDeeffiinniittiioonn typeerasure.hh:165 │ │ │ │ │ +_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:190 │ │ │ │ │ +_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:170 │ │ │ │ │ +_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_:_:_w_r_a_p_p_e_d__ │ │ │ │ │ +PolymorphicSmallObject< Imp::TypeErasureWrapperInterface< Interface >, │ │ │ │ │ +bufferSize > wrapped_ │ │ │ │ │ +DDeeffiinniittiioonn typeerasure.hh:196 │ │ │ │ │ +_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:178 │ │ │ │ │ +_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:184 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00062.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: lagrangebasis.hh File Reference │ │ │ │ +dune-functions: polymorphicsmallobject.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,70 +65,41 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces | │ │ │ │ -Typedefs | │ │ │ │ -Functions
│ │ │ │ -
lagrangebasis.hh File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
polymorphicsmallobject.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <type_traits>
│ │ │ │ -#include <dune/common/exceptions.hh>
│ │ │ │ -#include <dune/localfunctions/lagrange.hh>
│ │ │ │ -#include <dune/localfunctions/lagrange/equidistantpoints.hh>
│ │ │ │ -#include <dune/localfunctions/lagrange/pqkfactory.hh>
│ │ │ │ -#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ │ -#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
│ │ │ │ +
#include <utility>
│ │ │ │ +#include <type_traits>
│ │ │ │
│ │ │ │

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::PolymorphicSmallObject< Base, bufferSize >
 A wrapper providing small object optimization with polymorphic types. 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,48 +1,24 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -lagrangebasis.hh File Reference │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ +polymorphicsmallobject.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_/_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> │ │ │ │ │ _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_:_:_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 │ │ │ │ │   │ │ │ │ │ -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< │ │ │ │ │ - GV, k, R > > │ │ │ │ │ -  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. │ │ │ │ │ -  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00062_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: lagrangebasis.hh Source File │ │ │ │ +dune-functions: polymorphicsmallobject.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,611 +70,192 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
lagrangebasis.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH
│ │ │ │
5
│ │ │ │ -
6#include <type_traits>
│ │ │ │ -
7#include <dune/common/exceptions.hh>
│ │ │ │ +
6#include <utility>
│ │ │ │ +
7#include <type_traits>
│ │ │ │
8
│ │ │ │ -
9#include <dune/localfunctions/lagrange.hh>
│ │ │ │ -
10#include <dune/localfunctions/lagrange/equidistantpoints.hh>
│ │ │ │ -
11#include <dune/localfunctions/lagrange/pqkfactory.hh>
│ │ │ │ +
9namespace Dune {
│ │ │ │ +
10namespace Functions {
│ │ │ │ +
11
│ │ │ │
12
│ │ │ │ - │ │ │ │ - │ │ │ │ -
15
│ │ │ │ -
16
│ │ │ │ -
17namespace Dune {
│ │ │ │ -
18namespace Functions {
│ │ │ │ -
19
│ │ │ │ -
20// *****************************************************************************
│ │ │ │ -
21// This is the reusable part of the LagrangeBasis. It contains
│ │ │ │ -
22//
│ │ │ │ -
23// LagrangePreBasis
│ │ │ │ -
24// LagrangeNode
│ │ │ │ -
25//
│ │ │ │ -
26// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ │ -
27// state. These components do _not_ depend on the global basis and local view
│ │ │ │ -
28// and can be used without a global basis.
│ │ │ │ -
29// *****************************************************************************
│ │ │ │ -
30
│ │ │ │ -
31template<typename GV, int k, typename R=double>
│ │ │ │ -
32class LagrangeNode;
│ │ │ │ -
33
│ │ │ │ -
34template<typename GV, int k, typename R=double>
│ │ │ │ -
35class LagrangePreBasis;
│ │ │ │ -
36
│ │ │ │ -
37
│ │ │ │ -
38
│ │ │ │ -
53template<typename GV, int k, typename R>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
55{
│ │ │ │ -
56 static const int dim = GV::dimension;
│ │ │ │ -
57 static const bool useDynamicOrder = (k<0);
│ │ │ │ -
58
│ │ │ │ -
59public:
│ │ │ │ -
60
│ │ │ │ -
62 using GridView = GV;
│ │ │ │ -
63
│ │ │ │ -
65 using size_type = std::size_t;
│ │ │ │ -
66
│ │ │ │ - │ │ │ │ -
69
│ │ │ │ -
70 static constexpr size_type maxMultiIndexSize = 1;
│ │ │ │ -
71 static constexpr size_type minMultiIndexSize = 1;
│ │ │ │ -
72 static constexpr size_type multiIndexBufferSize = 1;
│ │ │ │ -
73
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
76 : LagrangePreBasis(gv, std::numeric_limits<unsigned int>::max())
│ │ │ │ -
77 {}
│ │ │ │ -
│ │ │ │ -
78
│ │ │ │ -
│ │ │ │ -
80 LagrangePreBasis(const GridView& gv, unsigned int order) :
│ │ │ │ - │ │ │ │ -
82 {
│ │ │ │ -
83 if (!useDynamicOrder && order!=std::numeric_limits<unsigned int>::max())
│ │ │ │ -
84 DUNE_THROW(RangeError, "Template argument k has to be -1 when supplying a run-time order!");
│ │ │ │ -
85
│ │ │ │ -
86 for (int i=0; i<=dim; i++)
│ │ │ │ -
87 {
│ │ │ │ - │ │ │ │ - │ │ │ │ -
90 }
│ │ │ │ - │ │ │ │ - │ │ │ │ -
93 }
│ │ │ │ -
│ │ │ │ -
94
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
97 {
│ │ │ │ -
98 vertexOffset_ = 0;
│ │ │ │ - │ │ │ │ +
43template<class Base, size_t bufferSize>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
45{
│ │ │ │ +
46public:
│ │ │ │ +
47
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
50 p_(nullptr)
│ │ │ │ +
51 {}
│ │ │ │ +
│ │ │ │ +
52
│ │ │ │ +
59 template<class Derived,
│ │ │ │ +
60 typename std::enable_if<std::is_base_of<Base, std::remove_cv_t<
│ │ │ │ +
61 std::remove_reference_t<Derived>>>::value, int>::type = 0>
│ │ │ │ +
│ │ │ │ +
62 PolymorphicSmallObject(Derived&& derived)
│ │ │ │ +
63 {
│ │ │ │ +
64 constexpr bool useBuffer = sizeof(Derived) <= bufferSize;
│ │ │ │ +
65 if constexpr (useBuffer) {
│ │ │ │ +
66 p_ = new (&buffer_) Derived(std::forward<Derived>(derived));
│ │ │ │ +
67 } else {
│ │ │ │ +
68 p_ = new Derived(std::forward<Derived>(derived));
│ │ │ │ +
69 }
│ │ │ │ +
70 }
│ │ │ │ +
│ │ │ │ +
71
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
74 {
│ │ │ │ +
75 moveToWrappedObject(std::move(other));
│ │ │ │ +
76 }
│ │ │ │ +
│ │ │ │ +
77
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
80 {
│ │ │ │ +
81 copyToWrappedObject(other);
│ │ │ │ +
82 }
│ │ │ │ +
│ │ │ │ +
83
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
86 {
│ │ │ │ +
87 destroyWrappedObject();
│ │ │ │ +
88 }
│ │ │ │ +
│ │ │ │ +
89
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
92 {
│ │ │ │ +
93 if (&other!=this)
│ │ │ │ +
94 {
│ │ │ │ +
95 destroyWrappedObject();
│ │ │ │ +
96 copyToWrappedObject(other);
│ │ │ │ +
97 }
│ │ │ │ +
98 return *this;
│ │ │ │ +
99 }
│ │ │ │ +
│ │ │ │
100
│ │ │ │ -
101 if (dim>=2)
│ │ │ │ -
102 {
│ │ │ │ - │ │ │ │ -
104
│ │ │ │ -
105 quadrilateralOffset_ = triangleOffset_ + dofsPerSimplex(2) * ((size_type)gridView_.size(Dune::GeometryTypes::triangle));
│ │ │ │ -
106 }
│ │ │ │ -
107
│ │ │ │ -
108 if (dim==3) {
│ │ │ │ -
109 tetrahedronOffset_ = quadrilateralOffset_ + dofsPerCube(2) * ((size_type)gridView_.size(Dune::GeometryTypes::quadrilateral));
│ │ │ │ -
110
│ │ │ │ -
111 prismOffset_ = tetrahedronOffset_ + dofsPerSimplex(3) * ((size_type)gridView_.size(Dune::GeometryTypes::tetrahedron));
│ │ │ │ -
112
│ │ │ │ -
113 hexahedronOffset_ = prismOffset_ + dofsPerPrism() * ((size_type)gridView_.size(Dune::GeometryTypes::prism));
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
103 {
│ │ │ │ +
104 destroyWrappedObject();
│ │ │ │ +
105 moveToWrappedObject(std::move(other));
│ │ │ │ +
106 return *this;
│ │ │ │ +
107 }
│ │ │ │ +
│ │ │ │ +
108
│ │ │ │ +
│ │ │ │ +
110 explicit operator bool() const
│ │ │ │ +
111 {
│ │ │ │ +
112 return p_;
│ │ │ │ +
113 }
│ │ │ │ +
│ │ │ │
114
│ │ │ │ -
115 pyramidOffset_ = hexahedronOffset_ + dofsPerCube(3) * ((size_type)gridView_.size(Dune::GeometryTypes::hexahedron));
│ │ │ │ -
116 }
│ │ │ │ -
117 }
│ │ │ │ -
│ │ │ │ -
118
│ │ │ │ -
│ │ │ │ -
120 const GridView& gridView() const
│ │ │ │ -
121 {
│ │ │ │ -
122 return gridView_;
│ │ │ │ -
123 }
│ │ │ │ -
│ │ │ │ -
124
│ │ │ │ -
│ │ │ │ -
126 void update (const GridView& gv)
│ │ │ │ -
127 {
│ │ │ │ -
128 gridView_ = gv;
│ │ │ │ -
129 }
│ │ │ │ -
│ │ │ │ -
130
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
135 {
│ │ │ │ -
136 return Node{order_};
│ │ │ │ -
137 }
│ │ │ │ -
│ │ │ │ -
138
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
141 {
│ │ │ │ -
142 switch (dim)
│ │ │ │ -
143 {
│ │ │ │ -
144 case 1:
│ │ │ │ -
145 return dofsPerCube(0) * ((size_type)gridView_.size(dim))
│ │ │ │ -
146 + dofsPerCube(1) * ((size_type)gridView_.size(dim-1));
│ │ │ │ -
147 case 2:
│ │ │ │ -
148 {
│ │ │ │ -
149 return dofsPerCube(0) * ((size_type)gridView_.size(dim))
│ │ │ │ -
150 + dofsPerCube(1) * ((size_type)gridView_.size(dim-1))
│ │ │ │ -
151 + dofsPerSimplex(2) * ((size_type)gridView_.size(Dune::GeometryTypes::triangle))
│ │ │ │ -
152 + dofsPerCube(2) * ((size_type)gridView_.size(Dune::GeometryTypes::quadrilateral));
│ │ │ │ -
153 }
│ │ │ │ -
154 case 3:
│ │ │ │ -
155 {
│ │ │ │ -
156 return dofsPerCube(0) * ((size_type)gridView_.size(dim))
│ │ │ │ -
157 + dofsPerCube(1) * ((size_type)gridView_.size(dim-1))
│ │ │ │ -
158 + dofsPerSimplex(2) * ((size_type)gridView_.size(Dune::GeometryTypes::triangle))
│ │ │ │ -
159 + dofsPerCube(2) * ((size_type)gridView_.size(Dune::GeometryTypes::quadrilateral))
│ │ │ │ -
160 + dofsPerSimplex(3) * ((size_type)gridView_.size(Dune::GeometryTypes::tetrahedron))
│ │ │ │ -
161 + dofsPerPyramid() * ((size_type)gridView_.size(Dune::GeometryTypes::pyramid))
│ │ │ │ -
162 + dofsPerPrism() * ((size_type)gridView_.size(Dune::GeometryTypes::prism))
│ │ │ │ -
163 + dofsPerCube(3) * ((size_type)gridView_.size(Dune::GeometryTypes::hexahedron));
│ │ │ │ -
164 }
│ │ │ │ -
165 }
│ │ │ │ -
166 DUNE_THROW(Dune::NotImplemented, "No size method for " << dim << "d grids available yet!");
│ │ │ │ -
167 }
│ │ │ │ -
│ │ │ │ -
168
│ │ │ │ -
170 template<class SizePrefix>
│ │ │ │ -
│ │ │ │ -
171 size_type size(const SizePrefix& prefix) const
│ │ │ │ -
172 {
│ │ │ │ -
173 assert(prefix.size() == 0 || prefix.size() == 1);
│ │ │ │ -
174 return (prefix.size() == 0) ? size() : 0;
│ │ │ │ -
175 }
│ │ │ │ +
│ │ │ │ +
116 bool bufferUsed() const
│ │ │ │ +
117 {
│ │ │ │ +
118 return ((void*) (p_) == (void*)(&buffer_));
│ │ │ │ +
119 }
│ │ │ │ +
│ │ │ │ +
120
│ │ │ │ +
│ │ │ │ +
122 const Base& get() const
│ │ │ │ +
123 {
│ │ │ │ +
124 return *p_;
│ │ │ │ +
125 }
│ │ │ │ +
│ │ │ │ +
126
│ │ │ │ +
│ │ │ │ +
128 Base& get()
│ │ │ │ +
129 {
│ │ │ │ +
130 return *p_;
│ │ │ │ +
131 }
│ │ │ │ +
│ │ │ │ +
132
│ │ │ │ +
133private:
│ │ │ │ +
134
│ │ │ │ +
135 void destroyWrappedObject() noexcept
│ │ │ │ +
136 {
│ │ │ │ +
137 if (operator bool())
│ │ │ │ +
138 {
│ │ │ │ +
139 if (bufferUsed())
│ │ │ │ +
140 p_->~Base();
│ │ │ │ +
141 else
│ │ │ │ +
142 delete p_;
│ │ │ │ +
143 }
│ │ │ │ +
144 }
│ │ │ │ +
145
│ │ │ │ +
146 void moveToWrappedObject(PolymorphicSmallObject&& other) noexcept
│ │ │ │ +
147 {
│ │ │ │ +
148 if (other.bufferUsed())
│ │ │ │ +
149 p_ = other.p_->move(&buffer_);
│ │ │ │ +
150 else
│ │ │ │ +
151 {
│ │ │ │ +
152 // We don't need to check for &other_!=this, because you can't
│ │ │ │ +
153 // have an rvalue to *this and call it's assignment/constructor
│ │ │ │ +
154 // at the same time. (Despite trying to shoot yourself in the foot
│ │ │ │ +
155 // with std::move explicitly.)
│ │ │ │ +
156
│ │ │ │ +
157 // Take ownership of allocated object
│ │ │ │ +
158 p_ = other.p_;
│ │ │ │ +
159
│ │ │ │ +
160 // Leave pointer in a clean state to avoid double freeing it.
│ │ │ │ +
161 other.p_ = 0;
│ │ │ │ +
162 }
│ │ │ │ +
163 }
│ │ │ │ +
164
│ │ │ │ +
165 void copyToWrappedObject(const PolymorphicSmallObject& other)
│ │ │ │ +
166 {
│ │ │ │ +
167 if (other.bufferUsed())
│ │ │ │ +
168 p_ = other.p_->clone(&buffer_);
│ │ │ │ +
169 else
│ │ │ │ +
170 p_ = other.p_->clone();
│ │ │ │ +
171 }
│ │ │ │ +
172
│ │ │ │ +
173 std::aligned_storage_t<bufferSize> buffer_;
│ │ │ │ +
174 Base* p_;
│ │ │ │ +
175};
│ │ │ │
│ │ │ │
176
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
179 {
│ │ │ │ -
180 return size();
│ │ │ │ -
181 }
│ │ │ │ -
│ │ │ │ -
182
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
185 {
│ │ │ │ -
186 // That cast to unsigned int is necessary because GV::dimension is an enum,
│ │ │ │ -
187 // which is not recognized by the power method as an integer type...
│ │ │ │ -
188 return power(order()+1, (unsigned int)GV::dimension);
│ │ │ │ -
189 }
│ │ │ │ -
│ │ │ │ -
190
│ │ │ │ -
191 template<typename It>
│ │ │ │ -
│ │ │ │ -
192 It indices(const Node& node, It it) const
│ │ │ │ -
193 {
│ │ │ │ -
194 for (size_type i = 0, end = node.finiteElement().size() ; i < end ; ++it, ++i)
│ │ │ │ -
195 {
│ │ │ │ -
196 Dune::LocalKey localKey = node.finiteElement().localCoefficients().localKey(i);
│ │ │ │ -
197 const auto& gridIndexSet = gridView().indexSet();
│ │ │ │ -
198 const auto& element = node.element();
│ │ │ │ -
199
│ │ │ │ -
200 // The dimension of the entity that the current dof is related to
│ │ │ │ -
201 auto dofDim = dim - localKey.codim();
│ │ │ │ -
202
│ │ │ │ -
203 // Test for a vertex dof
│ │ │ │ -
204 // The test for k==1 is redundant, but having it here allows the compiler to conclude
│ │ │ │ -
205 // at compile-time that the dofDim==0 case is the only one that will ever happen.
│ │ │ │ -
206 // This leads to measurable speed-up: see
│ │ │ │ -
207 // https://gitlab.dune-project.org/staging/dune-functions/issues/30
│ │ │ │ -
208 if (k==1 || dofDim==0) {
│ │ │ │ -
209 *it = {{ (size_type)(gridIndexSet.subIndex(element,localKey.subEntity(),dim)) }};
│ │ │ │ -
210 continue;
│ │ │ │ -
211 }
│ │ │ │ -
212
│ │ │ │ -
213 if (dofDim==1)
│ │ │ │ -
214 { // edge dof
│ │ │ │ -
215 if (dim==1) // element dof -- any local numbering is fine
│ │ │ │ -
216 {
│ │ │ │ -
217 *it = {{ edgeOffset_
│ │ │ │ -
218 + dofsPerCube(1) * ((size_type)gridIndexSet.subIndex(element,0,0))
│ │ │ │ -
219 + localKey.index() }};
│ │ │ │ -
220 continue;
│ │ │ │ -
221 }
│ │ │ │ -
222 else
│ │ │ │ -
223 {
│ │ │ │ -
224 const auto refElement
│ │ │ │ -
225 = Dune::referenceElement<double,dim>(element.type());
│ │ │ │ -
226
│ │ │ │ -
227 // We have to reverse the numbering if the local element edge is
│ │ │ │ -
228 // not aligned with the global edge.
│ │ │ │ -
229 auto v0 = (size_type)gridIndexSet.subIndex(element,refElement.subEntity(localKey.subEntity(),localKey.codim(),0,dim),dim);
│ │ │ │ -
230 auto v1 = (size_type)gridIndexSet.subIndex(element,refElement.subEntity(localKey.subEntity(),localKey.codim(),1,dim),dim);
│ │ │ │ -
231 bool flip = (v0 > v1);
│ │ │ │ -
232 *it = {{ (flip)
│ │ │ │ - │ │ │ │ -
234 + dofsPerCube(1)*((size_type)gridIndexSet.subIndex(element,localKey.subEntity(),localKey.codim()))
│ │ │ │ -
235 + (dofsPerCube(1)-1)-localKey.index()
│ │ │ │ - │ │ │ │ -
237 + dofsPerCube(1)*((size_type)gridIndexSet.subIndex(element,localKey.subEntity(),localKey.codim()))
│ │ │ │ -
238 + localKey.index() }};
│ │ │ │ -
239 continue;
│ │ │ │ -
240 }
│ │ │ │ -
241 }
│ │ │ │ -
242
│ │ │ │ -
243 if (dofDim==2)
│ │ │ │ -
244 {
│ │ │ │ -
245 if (dim==2) // element dof -- any local numbering is fine
│ │ │ │ -
246 {
│ │ │ │ -
247 if (element.type().isTriangle())
│ │ │ │ -
248 {
│ │ │ │ -
249 *it = {{ triangleOffset_ + dofsPerSimplex(2)*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
│ │ │ │ -
250 continue;
│ │ │ │ -
251 }
│ │ │ │ -
252 else if (element.type().isQuadrilateral())
│ │ │ │ -
253 {
│ │ │ │ -
254 *it = {{ quadrilateralOffset_ + dofsPerCube(2)*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
│ │ │ │ -
255 continue;
│ │ │ │ -
256 }
│ │ │ │ -
257 else
│ │ │ │ -
258 DUNE_THROW(Dune::NotImplemented, "2d elements have to be triangles or quadrilaterals");
│ │ │ │ -
259 } else
│ │ │ │ -
260 {
│ │ │ │ -
261 const auto refElement
│ │ │ │ -
262 = Dune::referenceElement<double,dim>(element.type());
│ │ │ │ -
263
│ │ │ │ -
264 if (order()>3)
│ │ │ │ -
265 DUNE_THROW(Dune::NotImplemented, "LagrangeBasis for 3D grids is only implemented if k<=3");
│ │ │ │ -
266
│ │ │ │ -
267 if (order()==3 and !refElement.type(localKey.subEntity(), localKey.codim()).isTriangle())
│ │ │ │ -
268 DUNE_THROW(Dune::NotImplemented, "LagrangeBasis for 3D grids with k==3 is only implemented if the grid is a simplex grid");
│ │ │ │ -
269
│ │ │ │ -
270 *it = {{ triangleOffset_ + ((size_type)gridIndexSet.subIndex(element,localKey.subEntity(),localKey.codim())) }};
│ │ │ │ -
271 continue;
│ │ │ │ -
272 }
│ │ │ │ -
273 }
│ │ │ │ -
274
│ │ │ │ -
275 if (dofDim==3)
│ │ │ │ -
276 {
│ │ │ │ -
277 if (dim==3) // element dof -- any local numbering is fine
│ │ │ │ -
278 {
│ │ │ │ -
279 if (element.type().isTetrahedron())
│ │ │ │ -
280 {
│ │ │ │ -
281 *it = {{ tetrahedronOffset_ + dofsPerSimplex(3)*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
│ │ │ │ -
282 continue;
│ │ │ │ -
283 }
│ │ │ │ -
284 else if (element.type().isHexahedron())
│ │ │ │ -
285 {
│ │ │ │ -
286 *it = {{ hexahedronOffset_ + dofsPerCube(3)*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
│ │ │ │ -
287 continue;
│ │ │ │ -
288 }
│ │ │ │ -
289 else if (element.type().isPrism())
│ │ │ │ -
290 {
│ │ │ │ -
291 *it = {{ prismOffset_ + dofsPerPrism()*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
│ │ │ │ -
292 continue;
│ │ │ │ -
293 }
│ │ │ │ -
294 else if (element.type().isPyramid())
│ │ │ │ -
295 {
│ │ │ │ -
296 *it = {{ pyramidOffset_ + dofsPerPyramid()*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
│ │ │ │ -
297 continue;
│ │ │ │ -
298 }
│ │ │ │ -
299 else
│ │ │ │ -
300 DUNE_THROW(Dune::NotImplemented, "3d elements have to be tetrahedra, hexahedra, prisms, or pyramids");
│ │ │ │ -
301 } else
│ │ │ │ -
302 DUNE_THROW(Dune::NotImplemented, "Grids of dimension larger than 3 are no supported");
│ │ │ │ -
303 }
│ │ │ │ -
304 DUNE_THROW(Dune::NotImplemented, "Grid contains elements not supported for the LagrangeBasis");
│ │ │ │ -
305 }
│ │ │ │ -
306 return it;
│ │ │ │ -
307 }
│ │ │ │ -
│ │ │ │ -
308
│ │ │ │ -
│ │ │ │ -
310 unsigned int order() const
│ │ │ │ -
311 {
│ │ │ │ -
312 return (useDynamicOrder) ? order_ : k;
│ │ │ │ -
313 }
│ │ │ │ -
│ │ │ │ -
314
│ │ │ │ -
315protected:
│ │ │ │ - │ │ │ │ -
317
│ │ │ │ -
318 // Run-time order, only valid if k<0
│ │ │ │ -
319 const unsigned int order_;
│ │ │ │ -
320
│ │ │ │ -
│ │ │ │ -
322 size_type dofsPerSimplex(std::size_t simplexDim) const
│ │ │ │ -
323 {
│ │ │ │ -
324 return useDynamicOrder ? dofsPerSimplex_[simplexDim] : computeDofsPerSimplex(simplexDim);
│ │ │ │ -
325 }
│ │ │ │ -
│ │ │ │ -
326
│ │ │ │ -
│ │ │ │ -
328 size_type dofsPerCube(std::size_t cubeDim) const
│ │ │ │ -
329 {
│ │ │ │ -
330 return useDynamicOrder ? dofsPerCube_[cubeDim] : computeDofsPerCube(cubeDim);
│ │ │ │ -
331 }
│ │ │ │ -
│ │ │ │ -
332
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
334 {
│ │ │ │ -
335 return useDynamicOrder ? dofsPerPrism_ : computeDofsPerPrism();
│ │ │ │ -
336 }
│ │ │ │ -
│ │ │ │ -
337
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
339 {
│ │ │ │ -
340 return useDynamicOrder ? dofsPerPyramid_ : computeDofsPerPyramid();
│ │ │ │ -
341 }
│ │ │ │ -
│ │ │ │ -
342
│ │ │ │ -
│ │ │ │ -
344 size_type computeDofsPerSimplex(std::size_t simplexDim) const
│ │ │ │ -
345 {
│ │ │ │ -
346 return order() == 0 ? (dim == simplexDim ? 1 : 0) : Dune::binomial(std::size_t(order()-1),simplexDim);
│ │ │ │ -
347 }
│ │ │ │ -
│ │ │ │ -
348
│ │ │ │ -
│ │ │ │ -
350 size_type computeDofsPerCube(std::size_t cubeDim) const
│ │ │ │ -
351 {
│ │ │ │ -
352 return order() == 0 ? (dim == cubeDim ? 1 : 0) : Dune::power(order()-1, cubeDim);
│ │ │ │ -
353 }
│ │ │ │ -
│ │ │ │ -
354
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
356 {
│ │ │ │ -
357 return order() == 0 ? (dim == 3 ? 1 : 0) : (order()-1)*(order()-1)*(order()-2)/2;
│ │ │ │ -
358 }
│ │ │ │ -
│ │ │ │ -
359
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
361 {
│ │ │ │ -
362 return order() == 0 ? (dim == 3 ? 1 : 0) : (order()-2)*(order()-1)*(2*order()-3)/6;
│ │ │ │ -
363 }
│ │ │ │ -
│ │ │ │ -
364
│ │ │ │ -
365 // When the order is given at run-time, the following numbers are pre-computed:
│ │ │ │ -
366 std::array<size_type,dim+1> dofsPerSimplex_;
│ │ │ │ -
367 std::array<size_type,dim+1> dofsPerCube_;
│ │ │ │ - │ │ │ │ - │ │ │ │ -
370
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
379
│ │ │ │ -
380};
│ │ │ │ -
│ │ │ │ -
381
│ │ │ │ -
382
│ │ │ │ -
383
│ │ │ │ -
384template<typename GV, int k, typename R>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
386 public LeafBasisNode
│ │ │ │ -
387{
│ │ │ │ -
388 // Stores LocalFiniteElement implementations with run-time order as a function of GeometryType
│ │ │ │ -
389 template<typename Domain, typename Range, int dim>
│ │ │ │ -
390 class LagrangeRunTimeLFECache
│ │ │ │ -
391 {
│ │ │ │ -
392 public:
│ │ │ │ -
393 using FiniteElementType = LagrangeLocalFiniteElement<EquidistantPointSet,dim,Domain,Range>;
│ │ │ │ -
394
│ │ │ │ -
395 const FiniteElementType& get(GeometryType type)
│ │ │ │ -
396 {
│ │ │ │ -
397 auto i = data_.find(type);
│ │ │ │ -
398 if (i==data_.end())
│ │ │ │ -
399 i = data_.emplace(type,FiniteElementType(type,order_)).first;
│ │ │ │ -
400 return (*i).second;
│ │ │ │ -
401 }
│ │ │ │ -
402
│ │ │ │ -
403 std::map<GeometryType, FiniteElementType> data_;
│ │ │ │ -
404 unsigned int order_;
│ │ │ │ -
405 };
│ │ │ │ -
406
│ │ │ │ -
407 static constexpr int dim = GV::dimension;
│ │ │ │ -
408 static constexpr bool useDynamicOrder = (k<0);
│ │ │ │ -
409
│ │ │ │ -
410 using FiniteElementCache = typename std::conditional<(useDynamicOrder),
│ │ │ │ -
411 LagrangeRunTimeLFECache<typename GV::ctype, R, dim>,
│ │ │ │ -
412 PQkLocalFiniteElementCache<typename GV::ctype, R, dim, k>
│ │ │ │ -
413 >::type;
│ │ │ │ -
414
│ │ │ │ -
415public:
│ │ │ │ -
416
│ │ │ │ -
417 using size_type = std::size_t;
│ │ │ │ -
418 using Element = typename GV::template Codim<0>::Entity;
│ │ │ │ -
419 using FiniteElement = typename FiniteElementCache::FiniteElementType;
│ │ │ │ -
420
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
423 finiteElement_(nullptr),
│ │ │ │ -
424 element_(nullptr)
│ │ │ │ -
425 {}
│ │ │ │ -
│ │ │ │ -
426
│ │ │ │ -
│ │ │ │ -
428 LagrangeNode(unsigned int order) :
│ │ │ │ -
429 order_(order),
│ │ │ │ -
430 finiteElement_(nullptr),
│ │ │ │ -
431 element_(nullptr)
│ │ │ │ -
432 {
│ │ │ │ -
433 // Only the cache for the run-time-order case (i.e., k<0), has the 'order_' member
│ │ │ │ -
434 if constexpr (useDynamicOrder)
│ │ │ │ -
435 cache_.order_ = order;
│ │ │ │ -
436 }
│ │ │ │ -
│ │ │ │ -
437
│ │ │ │ -
│ │ │ │ -
439 const Element& element() const
│ │ │ │ -
440 {
│ │ │ │ -
441 return *element_;
│ │ │ │ -
442 }
│ │ │ │ -
│ │ │ │ -
443
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
449 {
│ │ │ │ -
450 return *finiteElement_;
│ │ │ │ -
451 }
│ │ │ │ -
│ │ │ │ -
452
│ │ │ │ -
│ │ │ │ -
454 void bind(const Element& e)
│ │ │ │ -
455 {
│ │ │ │ -
456 element_ = &e;
│ │ │ │ -
457 finiteElement_ = &(cache_.get(element_->type()));
│ │ │ │ -
458 this->setSize(finiteElement_->size());
│ │ │ │ -
459 }
│ │ │ │ -
│ │ │ │ -
460
│ │ │ │ -
461protected:
│ │ │ │ -
462
│ │ │ │ -
│ │ │ │ -
463 unsigned int order() const
│ │ │ │ -
464 {
│ │ │ │ -
465 return (useDynamicOrder) ? order_ : k;
│ │ │ │ -
466 }
│ │ │ │ -
│ │ │ │ -
467
│ │ │ │ -
468 // Run-time order, only valid if k<0
│ │ │ │ -
469 unsigned int order_;
│ │ │ │ -
470
│ │ │ │ -
471 FiniteElementCache cache_;
│ │ │ │ - │ │ │ │ - │ │ │ │ -
474};
│ │ │ │ -
│ │ │ │ -
475
│ │ │ │ -
476
│ │ │ │ -
477
│ │ │ │ -
478namespace BasisFactory {
│ │ │ │ -
479
│ │ │ │ -
488template<std::size_t k, typename R=double>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
490{
│ │ │ │ -
491 return [](const auto& gridView) {
│ │ │ │ -
492 return LagrangePreBasis<std::decay_t<decltype(gridView)>, k, R>(gridView);
│ │ │ │ -
493 };
│ │ │ │ -
494}
│ │ │ │ -
│ │ │ │ -
495
│ │ │ │ -
503template<typename R=double>
│ │ │ │ -
│ │ │ │ -
504auto lagrange(int order)
│ │ │ │ -
505{
│ │ │ │ -
506 return [=](const auto& gridView) {
│ │ │ │ -
507 return LagrangePreBasis<std::decay_t<decltype(gridView)>, -1, R>(gridView, order);
│ │ │ │ -
508 };
│ │ │ │ -
509}
│ │ │ │ -
│ │ │ │ -
510
│ │ │ │ -
511} // end namespace BasisFactory
│ │ │ │ -
512
│ │ │ │ -
513
│ │ │ │ -
514
│ │ │ │ -
538template<typename GV, int k=-1, typename R=double>
│ │ │ │ - │ │ │ │ -
540
│ │ │ │ -
541
│ │ │ │ -
542
│ │ │ │ -
543
│ │ │ │ -
544
│ │ │ │ -
545} // end namespace Functions
│ │ │ │ -
546} // end namespace Dune
│ │ │ │ -
547
│ │ │ │ -
548
│ │ │ │ -
549#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ -
auto lagrange()
Create a pre-basis factory that can create a Lagrange pre-basis.
Definition lagrangebasis.hh:489
│ │ │ │ +
177
│ │ │ │ +
178} // namespace Functions
│ │ │ │ +
179} // namespace Dune
│ │ │ │ +
180
│ │ │ │ +
181#endif // DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:46
│ │ │ │ -
Definition lagrangebasis.hh:387
│ │ │ │ -
LagrangeNode(unsigned int order)
Constructor with a run-time order.
Definition lagrangebasis.hh:428
│ │ │ │ -
unsigned int order() const
Definition lagrangebasis.hh:463
│ │ │ │ -
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition lagrangebasis.hh:448
│ │ │ │ -
const Element * element_
Definition lagrangebasis.hh:473
│ │ │ │ -
const Element & element() const
Return current element, throw if unbound.
Definition lagrangebasis.hh:439
│ │ │ │ -
FiniteElementCache cache_
Definition lagrangebasis.hh:471
│ │ │ │ -
typename FiniteElementCache::FiniteElementType FiniteElement
Definition lagrangebasis.hh:419
│ │ │ │ -
void bind(const Element &e)
Bind to element.
Definition lagrangebasis.hh:454
│ │ │ │ -
typename GV::template Codim< 0 >::Entity Element
Definition lagrangebasis.hh:418
│ │ │ │ -
const FiniteElement * finiteElement_
Definition lagrangebasis.hh:472
│ │ │ │ -
unsigned int order_
Definition lagrangebasis.hh:469
│ │ │ │ -
std::size_t size_type
Definition lagrangebasis.hh:417
│ │ │ │ -
LagrangeNode()
Constructor without order (uses the compile-time value)
Definition lagrangebasis.hh:422
│ │ │ │ -
A pre-basis for a PQ-lagrange bases with given order.
Definition lagrangebasis.hh:55
│ │ │ │ -
size_type dofsPerPrism() const
Definition lagrangebasis.hh:333
│ │ │ │ -
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:350
│ │ │ │ -
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:344
│ │ │ │ -
static constexpr size_type maxMultiIndexSize
Definition lagrangebasis.hh:70
│ │ │ │ -
size_type computeDofsPerPrism() const
Definition lagrangebasis.hh:355
│ │ │ │ -
size_type edgeOffset_
Definition lagrangebasis.hh:372
│ │ │ │ -
std::array< size_type, dim+1 > dofsPerSimplex_
Definition lagrangebasis.hh:366
│ │ │ │ -
It indices(const Node &node, It it) const
Definition lagrangebasis.hh:192
│ │ │ │ -
size_type vertexOffset_
Definition lagrangebasis.hh:371
│ │ │ │ -
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:322
│ │ │ │ -
std::size_t size_type
Type used for indices and size information.
Definition lagrangebasis.hh:65
│ │ │ │ -
size_type pyramidOffset_
Definition lagrangebasis.hh:376
│ │ │ │ -
size_type prismOffset_
Definition lagrangebasis.hh:377
│ │ │ │ -
size_type tetrahedronOffset_
Definition lagrangebasis.hh:375
│ │ │ │ -
void initializeIndices()
Initialize the global indices.
Definition lagrangebasis.hh:96
│ │ │ │ -
size_type computeDofsPerPyramid() const
Definition lagrangebasis.hh:360
│ │ │ │ -
LagrangePreBasis(const GridView &gv, unsigned int order)
Constructor for a given grid view object and run-time order.
Definition lagrangebasis.hh:80
│ │ │ │ -
size_type dofsPerPyramid_
Definition lagrangebasis.hh:369
│ │ │ │ -
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition lagrangebasis.hh:178
│ │ │ │ -
LagrangePreBasis(const GridView &gv)
Constructor for a given grid view object with compile-time order.
Definition lagrangebasis.hh:75
│ │ │ │ -
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition lagrangebasis.hh:126
│ │ │ │ -
size_type size(const SizePrefix &prefix) const
Return number of possible values for next position in multi index.
Definition lagrangebasis.hh:171
│ │ │ │ -
static constexpr size_type multiIndexBufferSize
Definition lagrangebasis.hh:72
│ │ │ │ -
GV GridView
The grid view that the FE basis is defined on.
Definition lagrangebasis.hh:62
│ │ │ │ -
size_type quadrilateralOffset_
Definition lagrangebasis.hh:374
│ │ │ │ -
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition lagrangebasis.hh:120
│ │ │ │ -
GridView gridView_
Definition lagrangebasis.hh:316
│ │ │ │ -
Node makeNode() const
Create tree node.
Definition lagrangebasis.hh:134
│ │ │ │ -
unsigned int order() const
Polynomial order used in the local Lagrange finite-elements.
Definition lagrangebasis.hh:310
│ │ │ │ -
const unsigned int order_
Definition lagrangebasis.hh:319
│ │ │ │ -
std::array< size_type, dim+1 > dofsPerCube_
Definition lagrangebasis.hh:367
│ │ │ │ -
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition lagrangebasis.hh:184
│ │ │ │ -
size_type size() const
Same as size(prefix) with empty prefix.
Definition lagrangebasis.hh:140
│ │ │ │ -
size_type dofsPerPrism_
Definition lagrangebasis.hh:368
│ │ │ │ -
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:328
│ │ │ │ -
size_type triangleOffset_
Definition lagrangebasis.hh:373
│ │ │ │ -
size_type hexahedronOffset_
Definition lagrangebasis.hh:378
│ │ │ │ -
static constexpr size_type minMultiIndexSize
Definition lagrangebasis.hh:71
│ │ │ │ -
size_type dofsPerPyramid() const
Definition lagrangebasis.hh:338
│ │ │ │ -
void setSize(const size_type size)
Definition nodes.hh:164
│ │ │ │ -
Definition nodes.hh:186
│ │ │ │ +
A wrapper providing small object optimization with polymorphic types.
Definition polymorphicsmallobject.hh:45
│ │ │ │ +
const Base & get() const
Obtain reference to stored object.
Definition polymorphicsmallobject.hh:122
│ │ │ │ +
bool bufferUsed() const
Check if object is stored in internal stack buffer.
Definition polymorphicsmallobject.hh:116
│ │ │ │ +
PolymorphicSmallObject(Derived &&derived)
Construct from object.
Definition polymorphicsmallobject.hh:62
│ │ │ │ +
PolymorphicSmallObject(PolymorphicSmallObject &&other) noexcept
Move constructor from other PolymorphicSmallObject.
Definition polymorphicsmallobject.hh:73
│ │ │ │ +
PolymorphicSmallObject & operator=(const PolymorphicSmallObject &other)
Copy assignment from other PolymorphicSmallObject.
Definition polymorphicsmallobject.hh:91
│ │ │ │ +
PolymorphicSmallObject & operator=(PolymorphicSmallObject &&other) noexcept
Move assignment from other PolymorphicSmallObject.
Definition polymorphicsmallobject.hh:102
│ │ │ │ +
PolymorphicSmallObject(const PolymorphicSmallObject &other)
Copy constructor from other PolymorphicSmallObject.
Definition polymorphicsmallobject.hh:79
│ │ │ │ +
~PolymorphicSmallObject()
Destructor.
Definition polymorphicsmallobject.hh:85
│ │ │ │ +
PolymorphicSmallObject()
Default constructor.
Definition polymorphicsmallobject.hh:49
│ │ │ │ +
Base & get()
Obtain mutable reference to stored object.
Definition polymorphicsmallobject.hh:128
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,736 +1,191 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -lagrangebasis.hh │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ 8 │ │ │ │ │ -9#include │ │ │ │ │ -10#include │ │ │ │ │ -11#include │ │ │ │ │ +9namespace _D_u_n_e { │ │ │ │ │ +10namespace Functions { │ │ │ │ │ +11 │ │ │ │ │ 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 │ │ │ │ │ -16 │ │ │ │ │ -17namespace _D_u_n_e { │ │ │ │ │ -18namespace Functions { │ │ │ │ │ -19 │ │ │ │ │ -20/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -21// This is the reusable part of the LagrangeBasis. It contains │ │ │ │ │ -22// │ │ │ │ │ -23// LagrangePreBasis │ │ │ │ │ -24// LagrangeNode │ │ │ │ │ -25// │ │ │ │ │ -26// The pre-basis allows to create the others and is the owner of possible │ │ │ │ │ -shared │ │ │ │ │ -27// state. These components do _not_ depend on the global basis and local view │ │ │ │ │ -28// and can be used without a global basis. │ │ │ │ │ -29/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -30 │ │ │ │ │ -31template │ │ │ │ │ -32class LagrangeNode; │ │ │ │ │ -33 │ │ │ │ │ -34template │ │ │ │ │ -35class LagrangePreBasis; │ │ │ │ │ -36 │ │ │ │ │ -37 │ │ │ │ │ -38 │ │ │ │ │ -53template │ │ │ │ │ -_5_4class _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s │ │ │ │ │ -55{ │ │ │ │ │ -56 static const int dim = GV::dimension; │ │ │ │ │ -57 static const bool useDynamicOrder = (k<0); │ │ │ │ │ -58 │ │ │ │ │ -59public: │ │ │ │ │ -60 │ │ │ │ │ -_6_2 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ │ -63 │ │ │ │ │ -_6_5 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ -66 │ │ │ │ │ -_6_8 using _N_o_d_e = _L_a_g_r_a_n_g_e_N_o_d_e_<_G_V_,_ _k_,_ _R_>; │ │ │ │ │ -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 = 1; │ │ │ │ │ -_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 = 1; │ │ │ │ │ -_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 = 1; │ │ │ │ │ -73 │ │ │ │ │ -_7_5 _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) │ │ │ │ │ -76 : _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s(gv, std::numeric_limits::max()) │ │ │ │ │ -77 {} │ │ │ │ │ -78 │ │ │ │ │ -_8_0 _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) : │ │ │ │ │ -81 _g_r_i_d_V_i_e_w__(gv), _o_r_d_e_r__(_o_r_d_e_r) │ │ │ │ │ -82 { │ │ │ │ │ -83 if (!useDynamicOrder && _o_r_d_e_r!=std::numeric_limits::max()) │ │ │ │ │ -84 DUNE_THROW(RangeError, "Template argument k has to be -1 when supplying a │ │ │ │ │ -run-time order!"); │ │ │ │ │ -85 │ │ │ │ │ -86 for (int i=0; i<=dim; i++) │ │ │ │ │ -87 { │ │ │ │ │ -88 _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); │ │ │ │ │ -89 _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); │ │ │ │ │ -90 } │ │ │ │ │ -91 _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(); │ │ │ │ │ -92 _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(); │ │ │ │ │ -93 } │ │ │ │ │ -94 │ │ │ │ │ -_9_6 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ │ -97 { │ │ │ │ │ -98 _v_e_r_t_e_x_O_f_f_s_e_t__ = 0; │ │ │ │ │ -99 _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)); │ │ │ │ │ +43template │ │ │ │ │ +_4_4class _P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t │ │ │ │ │ +45{ │ │ │ │ │ +46public: │ │ │ │ │ +47 │ │ │ │ │ +_4_9 _P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t() : │ │ │ │ │ +50 p_(nullptr) │ │ │ │ │ +51 {} │ │ │ │ │ +52 │ │ │ │ │ +59 template>>::value, int>::type = 0> │ │ │ │ │ +_6_2 _P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t(Derived&& derived) │ │ │ │ │ +63 { │ │ │ │ │ +64 constexpr bool useBuffer = sizeof(Derived) <= bufferSize; │ │ │ │ │ +65 if constexpr (useBuffer) { │ │ │ │ │ +66 p_ = new (&buffer_) Derived(std::forward(derived)); │ │ │ │ │ +67 } else { │ │ │ │ │ +68 p_ = new Derived(std::forward(derived)); │ │ │ │ │ +69 } │ │ │ │ │ +70 } │ │ │ │ │ +71 │ │ │ │ │ +_7_3 _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 │ │ │ │ │ +74 { │ │ │ │ │ +75 moveToWrappedObject(std::move(other)); │ │ │ │ │ +76 } │ │ │ │ │ +77 │ │ │ │ │ +_7_9 _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) │ │ │ │ │ +80 { │ │ │ │ │ +81 copyToWrappedObject(other); │ │ │ │ │ +82 } │ │ │ │ │ +83 │ │ │ │ │ +_8_5 _~_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t() │ │ │ │ │ +86 { │ │ │ │ │ +87 destroyWrappedObject(); │ │ │ │ │ +88 } │ │ │ │ │ +89 │ │ │ │ │ +_9_1 _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) │ │ │ │ │ +92 { │ │ │ │ │ +93 if (&other!=this) │ │ │ │ │ +94 { │ │ │ │ │ +95 destroyWrappedObject(); │ │ │ │ │ +96 copyToWrappedObject(other); │ │ │ │ │ +97 } │ │ │ │ │ +98 return *this; │ │ │ │ │ +99 } │ │ │ │ │ 100 │ │ │ │ │ -101 if (dim>=2) │ │ │ │ │ -102 { │ │ │ │ │ -103 _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)); │ │ │ │ │ -104 │ │ │ │ │ -105 _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)); │ │ │ │ │ -106 } │ │ │ │ │ -107 │ │ │ │ │ -108 if (dim==3) { │ │ │ │ │ -109 _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)); │ │ │ │ │ -110 │ │ │ │ │ -111 _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)); │ │ │ │ │ -112 │ │ │ │ │ -113 _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)); │ │ │ │ │ +_1_0_2 _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 │ │ │ │ │ +103 { │ │ │ │ │ +104 destroyWrappedObject(); │ │ │ │ │ +105 moveToWrappedObject(std::move(other)); │ │ │ │ │ +106 return *this; │ │ │ │ │ +107 } │ │ │ │ │ +108 │ │ │ │ │ +_1_1_0 explicit operator bool() const │ │ │ │ │ +111 { │ │ │ │ │ +112 return p_; │ │ │ │ │ +113 } │ │ │ │ │ 114 │ │ │ │ │ -115 _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)); │ │ │ │ │ -116 } │ │ │ │ │ -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_2_6 void _u_p_d_a_t_e (const _G_r_i_d_V_i_e_w& gv) │ │ │ │ │ -127 { │ │ │ │ │ -128 _g_r_i_d_V_i_e_w__ = gv; │ │ │ │ │ -129 } │ │ │ │ │ -130 │ │ │ │ │ -_1_3_4 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ │ -135 { │ │ │ │ │ -136 return _N_o_d_e{_o_r_d_e_r__}; │ │ │ │ │ -137 } │ │ │ │ │ -138 │ │ │ │ │ -_1_4_0 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ │ -141 { │ │ │ │ │ -142 switch (dim) │ │ │ │ │ -143 { │ │ │ │ │ -144 case 1: │ │ │ │ │ -145 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)) │ │ │ │ │ -146 + _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)); │ │ │ │ │ -147 case 2: │ │ │ │ │ -148 { │ │ │ │ │ -149 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)) │ │ │ │ │ -150 + _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)) │ │ │ │ │ -151 + _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)) │ │ │ │ │ -152 + _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)); │ │ │ │ │ -153 } │ │ │ │ │ -154 case 3: │ │ │ │ │ -155 { │ │ │ │ │ -156 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)) │ │ │ │ │ -157 + _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)) │ │ │ │ │ -158 + _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)) │ │ │ │ │ -159 + _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)) │ │ │ │ │ -160 + _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)) │ │ │ │ │ -161 + _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)) │ │ │ │ │ -162 + _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)) │ │ │ │ │ -163 + _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)); │ │ │ │ │ -164 } │ │ │ │ │ -165 } │ │ │ │ │ -166 DUNE_THROW(Dune::NotImplemented, "No size method for " << dim << "d grids │ │ │ │ │ -available yet!"); │ │ │ │ │ -167 } │ │ │ │ │ -168 │ │ │ │ │ -170 template │ │ │ │ │ -_1_7_1 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix) const │ │ │ │ │ -172 { │ │ │ │ │ -173 assert(prefix.size() == 0 || prefix.size() == 1); │ │ │ │ │ -174 return (prefix.size() == 0) ? _s_i_z_e() : 0; │ │ │ │ │ -175 } │ │ │ │ │ +_1_1_6 bool _b_u_f_f_e_r_U_s_e_d() const │ │ │ │ │ +117 { │ │ │ │ │ +118 return ((void*) (p_) == (void*)(&buffer_)); │ │ │ │ │ +119 } │ │ │ │ │ +120 │ │ │ │ │ +_1_2_2 const Base& _g_e_t() const │ │ │ │ │ +123 { │ │ │ │ │ +124 return *p_; │ │ │ │ │ +125 } │ │ │ │ │ +126 │ │ │ │ │ +_1_2_8 Base& _g_e_t() │ │ │ │ │ +129 { │ │ │ │ │ +130 return *p_; │ │ │ │ │ +131 } │ │ │ │ │ +132 │ │ │ │ │ +133private: │ │ │ │ │ +134 │ │ │ │ │ +135 void destroyWrappedObject() noexcept │ │ │ │ │ +136 { │ │ │ │ │ +137 if (operator bool()) │ │ │ │ │ +138 { │ │ │ │ │ +139 if (_b_u_f_f_e_r_U_s_e_d()) │ │ │ │ │ +140 p_->~Base(); │ │ │ │ │ +141 else │ │ │ │ │ +142 delete p_; │ │ │ │ │ +143 } │ │ │ │ │ +144 } │ │ │ │ │ +145 │ │ │ │ │ +146 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 │ │ │ │ │ +147 { │ │ │ │ │ +148 if (other.bufferUsed()) │ │ │ │ │ +149 p_ = other.p_->move(&buffer_); │ │ │ │ │ +150 else │ │ │ │ │ +151 { │ │ │ │ │ +152 // We don't need to check for &other_!=this, because you can't │ │ │ │ │ +153 // have an rvalue to *this and call it's assignment/constructor │ │ │ │ │ +154 // at the same time. (Despite trying to shoot yourself in the foot │ │ │ │ │ +155 // with std::move explicitly.) │ │ │ │ │ +156 │ │ │ │ │ +157 // Take ownership of allocated object │ │ │ │ │ +158 p_ = other.p_; │ │ │ │ │ +159 │ │ │ │ │ +160 // Leave pointer in a clean state to avoid double freeing it. │ │ │ │ │ +161 other.p_ = 0; │ │ │ │ │ +162 } │ │ │ │ │ +163 } │ │ │ │ │ +164 │ │ │ │ │ +165 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) │ │ │ │ │ +166 { │ │ │ │ │ +167 if (other.bufferUsed()) │ │ │ │ │ +168 p_ = other.p_->clone(&buffer_); │ │ │ │ │ +169 else │ │ │ │ │ +170 p_ = other.p_->clone(); │ │ │ │ │ +171 } │ │ │ │ │ +172 │ │ │ │ │ +173 std::aligned_storage_t buffer_; │ │ │ │ │ +174 Base* p_; │ │ │ │ │ +175}; │ │ │ │ │ 176 │ │ │ │ │ -_1_7_8 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ │ -179 { │ │ │ │ │ -180 return _s_i_z_e(); │ │ │ │ │ -181 } │ │ │ │ │ -182 │ │ │ │ │ -_1_8_4 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ │ -185 { │ │ │ │ │ -186 // That cast to unsigned int is necessary because GV::dimension is an enum, │ │ │ │ │ -187 // which is not recognized by the power method as an integer type... │ │ │ │ │ -188 return power(_o_r_d_e_r()+1, (unsigned int)GV::dimension); │ │ │ │ │ -189 } │ │ │ │ │ -190 │ │ │ │ │ -191 template │ │ │ │ │ -_1_9_2 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ │ -193 { │ │ │ │ │ -194 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) │ │ │ │ │ -195 { │ │ │ │ │ -196 Dune::LocalKey localKey = node._f_i_n_i_t_e_E_l_e_m_e_n_t().localCoefficients().localKey │ │ │ │ │ -(i); │ │ │ │ │ -197 const auto& gridIndexSet = _g_r_i_d_V_i_e_w().indexSet(); │ │ │ │ │ -198 const auto& element = node._e_l_e_m_e_n_t(); │ │ │ │ │ -199 │ │ │ │ │ -200 // The dimension of the entity that the current dof is related to │ │ │ │ │ -201 auto dofDim = dim - localKey.codim(); │ │ │ │ │ -202 │ │ │ │ │ -203 // Test for a vertex dof │ │ │ │ │ -204 // The test for k==1 is redundant, but having it here allows the compiler │ │ │ │ │ -to conclude │ │ │ │ │ -205 // at compile-time that the dofDim==0 case is the only one that will ever │ │ │ │ │ -happen. │ │ │ │ │ -206 // This leads to measurable speed-up: see │ │ │ │ │ -207 // https://gitlab.dune-project.org/staging/dune-functions/issues/30 │ │ │ │ │ -208 if (k==1 || dofDim==0) { │ │ │ │ │ -209 *it = {{ (_s_i_z_e___t_y_p_e)(gridIndexSet.subIndex(element,localKey.subEntity │ │ │ │ │ -(),dim)) }}; │ │ │ │ │ -210 continue; │ │ │ │ │ -211 } │ │ │ │ │ -212 │ │ │ │ │ -213 if (dofDim==1) │ │ │ │ │ -214 { // edge dof │ │ │ │ │ -215 if (dim==1) // element dof -- any local numbering is fine │ │ │ │ │ -216 { │ │ │ │ │ -217 *it = {{ _e_d_g_e_O_f_f_s_e_t__ │ │ │ │ │ -218 + _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)) │ │ │ │ │ -219 + localKey.index() }}; │ │ │ │ │ -220 continue; │ │ │ │ │ -221 } │ │ │ │ │ -222 else │ │ │ │ │ -223 { │ │ │ │ │ -224 const auto refElement │ │ │ │ │ -225 = Dune::referenceElement(element.type()); │ │ │ │ │ -226 │ │ │ │ │ -227 // We have to reverse the numbering if the local element edge is │ │ │ │ │ -228 // not aligned with the global edge. │ │ │ │ │ -229 auto v0 = (_s_i_z_e___t_y_p_e)gridIndexSet.subIndex(element,refElement.subEntity │ │ │ │ │ -(localKey.subEntity(),localKey.codim(),0,dim),dim); │ │ │ │ │ -230 auto v1 = (_s_i_z_e___t_y_p_e)gridIndexSet.subIndex(element,refElement.subEntity │ │ │ │ │ -(localKey.subEntity(),localKey.codim(),1,dim),dim); │ │ │ │ │ -231 bool flip = (v0 > v1); │ │ │ │ │ -232 *it = {{ (flip) │ │ │ │ │ -233 ? _e_d_g_e_O_f_f_s_e_t__ │ │ │ │ │ -234 + _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())) │ │ │ │ │ -235 + (_d_o_f_s_P_e_r_C_u_b_e(1)-1)-localKey.index() │ │ │ │ │ -236 : _e_d_g_e_O_f_f_s_e_t__ │ │ │ │ │ -237 + _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())) │ │ │ │ │ -238 + localKey.index() }}; │ │ │ │ │ -239 continue; │ │ │ │ │ -240 } │ │ │ │ │ -241 } │ │ │ │ │ -242 │ │ │ │ │ -243 if (dofDim==2) │ │ │ │ │ -244 { │ │ │ │ │ -245 if (dim==2) // element dof -- any local numbering is fine │ │ │ │ │ -246 { │ │ │ │ │ -247 if (element.type().isTriangle()) │ │ │ │ │ -248 { │ │ │ │ │ -249 *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() }}; │ │ │ │ │ -250 continue; │ │ │ │ │ -251 } │ │ │ │ │ -252 else if (element.type().isQuadrilateral()) │ │ │ │ │ -253 { │ │ │ │ │ -254 *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() }}; │ │ │ │ │ -255 continue; │ │ │ │ │ -256 } │ │ │ │ │ -257 else │ │ │ │ │ -258 DUNE_THROW(Dune::NotImplemented, "2d elements have to be triangles or │ │ │ │ │ -quadrilaterals"); │ │ │ │ │ -259 } else │ │ │ │ │ -260 { │ │ │ │ │ -261 const auto refElement │ │ │ │ │ -262 = Dune::referenceElement(element.type()); │ │ │ │ │ -263 │ │ │ │ │ -264 if (_o_r_d_e_r()>3) │ │ │ │ │ -265 DUNE_THROW(Dune::NotImplemented, "LagrangeBasis for 3D grids is only │ │ │ │ │ -implemented if k<=3"); │ │ │ │ │ -266 │ │ │ │ │ -267 if (_o_r_d_e_r()==3 and !refElement.type(localKey.subEntity(), localKey.codim │ │ │ │ │ -()).isTriangle()) │ │ │ │ │ -268 DUNE_THROW(Dune::NotImplemented, "LagrangeBasis for 3D grids with k==3 is │ │ │ │ │ -only implemented if the grid is a simplex grid"); │ │ │ │ │ -269 │ │ │ │ │ -270 *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())) }}; │ │ │ │ │ -271 continue; │ │ │ │ │ -272 } │ │ │ │ │ -273 } │ │ │ │ │ -274 │ │ │ │ │ -275 if (dofDim==3) │ │ │ │ │ -276 { │ │ │ │ │ -277 if (dim==3) // element dof -- any local numbering is fine │ │ │ │ │ -278 { │ │ │ │ │ -279 if (element.type().isTetrahedron()) │ │ │ │ │ -280 { │ │ │ │ │ -281 *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() }}; │ │ │ │ │ -282 continue; │ │ │ │ │ -283 } │ │ │ │ │ -284 else if (element.type().isHexahedron()) │ │ │ │ │ -285 { │ │ │ │ │ -286 *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() }}; │ │ │ │ │ -287 continue; │ │ │ │ │ -288 } │ │ │ │ │ -289 else if (element.type().isPrism()) │ │ │ │ │ -290 { │ │ │ │ │ -291 *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() }}; │ │ │ │ │ -292 continue; │ │ │ │ │ -293 } │ │ │ │ │ -294 else if (element.type().isPyramid()) │ │ │ │ │ -295 { │ │ │ │ │ -296 *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() }}; │ │ │ │ │ -297 continue; │ │ │ │ │ -298 } │ │ │ │ │ -299 else │ │ │ │ │ -300 DUNE_THROW(Dune::NotImplemented, "3d elements have to be tetrahedra, │ │ │ │ │ -hexahedra, prisms, or pyramids"); │ │ │ │ │ -301 } else │ │ │ │ │ -302 DUNE_THROW(Dune::NotImplemented, "Grids of dimension larger than 3 are no │ │ │ │ │ -supported"); │ │ │ │ │ -303 } │ │ │ │ │ -304 DUNE_THROW(Dune::NotImplemented, "Grid contains elements not supported for │ │ │ │ │ -the LagrangeBasis"); │ │ │ │ │ -305 } │ │ │ │ │ -306 return it; │ │ │ │ │ -307 } │ │ │ │ │ -308 │ │ │ │ │ -_3_1_0 unsigned int _o_r_d_e_r() const │ │ │ │ │ -311 { │ │ │ │ │ -312 return (useDynamicOrder) ? _o_r_d_e_r__ : k; │ │ │ │ │ -313 } │ │ │ │ │ -314 │ │ │ │ │ -315protected: │ │ │ │ │ -_3_1_6 _G_r_i_d_V_i_e_w _g_r_i_d_V_i_e_w__; │ │ │ │ │ -317 │ │ │ │ │ -318 // Run-time order, only valid if k<0 │ │ │ │ │ -_3_1_9 const unsigned int _o_r_d_e_r__; │ │ │ │ │ -320 │ │ │ │ │ -_3_2_2 _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 │ │ │ │ │ -323 { │ │ │ │ │ -324 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); │ │ │ │ │ -325 } │ │ │ │ │ -326 │ │ │ │ │ -_3_2_8 _s_i_z_e___t_y_p_e _d_o_f_s_P_e_r_C_u_b_e(std::size_t cubeDim) const │ │ │ │ │ -329 { │ │ │ │ │ -330 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); │ │ │ │ │ -331 } │ │ │ │ │ -332 │ │ │ │ │ -_3_3_3 _s_i_z_e___t_y_p_e _d_o_f_s_P_e_r_P_r_i_s_m() const │ │ │ │ │ -334 { │ │ │ │ │ -335 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(); │ │ │ │ │ -336 } │ │ │ │ │ -337 │ │ │ │ │ -_3_3_8 _s_i_z_e___t_y_p_e _d_o_f_s_P_e_r_P_y_r_a_m_i_d() const │ │ │ │ │ -339 { │ │ │ │ │ -340 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(); │ │ │ │ │ -341 } │ │ │ │ │ -342 │ │ │ │ │ -_3_4_4 _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 │ │ │ │ │ -345 { │ │ │ │ │ -346 return _o_r_d_e_r() == 0 ? (dim == simplexDim ? 1 : 0) : Dune::binomial(std:: │ │ │ │ │ -size_t(_o_r_d_e_r()-1),simplexDim); │ │ │ │ │ -347 } │ │ │ │ │ -348 │ │ │ │ │ -_3_5_0 _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 │ │ │ │ │ -351 { │ │ │ │ │ -352 return _o_r_d_e_r() == 0 ? (dim == cubeDim ? 1 : 0) : Dune::power(_o_r_d_e_r()-1, │ │ │ │ │ -cubeDim); │ │ │ │ │ -353 } │ │ │ │ │ -354 │ │ │ │ │ -_3_5_5 _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 │ │ │ │ │ -356 { │ │ │ │ │ -357 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; │ │ │ │ │ -358 } │ │ │ │ │ -359 │ │ │ │ │ -_3_6_0 _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 │ │ │ │ │ -361 { │ │ │ │ │ -362 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; │ │ │ │ │ -363 } │ │ │ │ │ -364 │ │ │ │ │ -365 // When the order is given at run-time, the following numbers are pre- │ │ │ │ │ -computed: │ │ │ │ │ -_3_6_6 std::array _d_o_f_s_P_e_r_S_i_m_p_l_e_x__; │ │ │ │ │ -_3_6_7 std::array _d_o_f_s_P_e_r_C_u_b_e__; │ │ │ │ │ -_3_6_8 _s_i_z_e___t_y_p_e _d_o_f_s_P_e_r_P_r_i_s_m__; │ │ │ │ │ -_3_6_9 _s_i_z_e___t_y_p_e _d_o_f_s_P_e_r_P_y_r_a_m_i_d__; │ │ │ │ │ -370 │ │ │ │ │ -_3_7_1 _s_i_z_e___t_y_p_e _v_e_r_t_e_x_O_f_f_s_e_t__; │ │ │ │ │ -_3_7_2 _s_i_z_e___t_y_p_e _e_d_g_e_O_f_f_s_e_t__; │ │ │ │ │ -_3_7_3 _s_i_z_e___t_y_p_e _t_r_i_a_n_g_l_e_O_f_f_s_e_t__; │ │ │ │ │ -_3_7_4 _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_7_5 _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_7_6 _s_i_z_e___t_y_p_e _p_y_r_a_m_i_d_O_f_f_s_e_t__; │ │ │ │ │ -_3_7_7 _s_i_z_e___t_y_p_e _p_r_i_s_m_O_f_f_s_e_t__; │ │ │ │ │ -_3_7_8 _s_i_z_e___t_y_p_e _h_e_x_a_h_e_d_r_o_n_O_f_f_s_e_t__; │ │ │ │ │ -379 │ │ │ │ │ -380}; │ │ │ │ │ -381 │ │ │ │ │ -382 │ │ │ │ │ -383 │ │ │ │ │ -384template │ │ │ │ │ -_3_8_5class _L_a_g_r_a_n_g_e_N_o_d_e : │ │ │ │ │ -386 public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ │ -387{ │ │ │ │ │ -388 // Stores LocalFiniteElement implementations with run-time order as a │ │ │ │ │ -function of GeometryType │ │ │ │ │ -389 template │ │ │ │ │ -390 class LagrangeRunTimeLFECache │ │ │ │ │ -391 { │ │ │ │ │ -392 public: │ │ │ │ │ -393 using FiniteElementType = │ │ │ │ │ -LagrangeLocalFiniteElement; │ │ │ │ │ -394 │ │ │ │ │ -395 const FiniteElementType& get(GeometryType type) │ │ │ │ │ -396 { │ │ │ │ │ -397 auto i = data_.find(type); │ │ │ │ │ -398 if (i==data_.end()) │ │ │ │ │ -399 i = data_.emplace(type,FiniteElementType(type,order_)).first; │ │ │ │ │ -400 return (*i).second; │ │ │ │ │ -401 } │ │ │ │ │ -402 │ │ │ │ │ -403 std::map data_; │ │ │ │ │ -404 unsigned int order_; │ │ │ │ │ -405 }; │ │ │ │ │ -406 │ │ │ │ │ -407 static constexpr int dim = GV::dimension; │ │ │ │ │ -408 static constexpr bool useDynamicOrder = (k<0); │ │ │ │ │ -409 │ │ │ │ │ -410 using FiniteElementCache = typename std::conditional<(useDynamicOrder), │ │ │ │ │ -411 LagrangeRunTimeLFECache, │ │ │ │ │ -412 PQkLocalFiniteElementCache │ │ │ │ │ -413 >::type; │ │ │ │ │ -414 │ │ │ │ │ -415public: │ │ │ │ │ -416 │ │ │ │ │ -_4_1_7 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ -_4_1_8 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ │ -_4_1_9 using _F_i_n_i_t_e_E_l_e_m_e_n_t = typename FiniteElementCache::FiniteElementType; │ │ │ │ │ -420 │ │ │ │ │ -_4_2_2 _L_a_g_r_a_n_g_e_N_o_d_e() : │ │ │ │ │ -423 _f_i_n_i_t_e_E_l_e_m_e_n_t__(nullptr), │ │ │ │ │ -424 _e_l_e_m_e_n_t__(nullptr) │ │ │ │ │ -425 {} │ │ │ │ │ -426 │ │ │ │ │ -_4_2_8 _L_a_g_r_a_n_g_e_N_o_d_e(unsigned int _o_r_d_e_r) : │ │ │ │ │ -429 _o_r_d_e_r__(_o_r_d_e_r), │ │ │ │ │ -430 _f_i_n_i_t_e_E_l_e_m_e_n_t__(nullptr), │ │ │ │ │ -431 _e_l_e_m_e_n_t__(nullptr) │ │ │ │ │ -432 { │ │ │ │ │ -433 // Only the cache for the run-time-order case (i.e., k<0), has the 'order_' │ │ │ │ │ -member │ │ │ │ │ -434 if constexpr (useDynamicOrder) │ │ │ │ │ -435 _c_a_c_h_e__.order_ = _o_r_d_e_r; │ │ │ │ │ -436 } │ │ │ │ │ -437 │ │ │ │ │ -_4_3_9 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ │ -440 { │ │ │ │ │ -441 return *_e_l_e_m_e_n_t__; │ │ │ │ │ -442 } │ │ │ │ │ -443 │ │ │ │ │ -_4_4_8 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 │ │ │ │ │ -449 { │ │ │ │ │ -450 return *_f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ │ -451 } │ │ │ │ │ -452 │ │ │ │ │ -_4_5_4 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ │ -455 { │ │ │ │ │ -456 _e_l_e_m_e_n_t__ = &e; │ │ │ │ │ -457 _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())); │ │ │ │ │ -458 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__->size()); │ │ │ │ │ -459 } │ │ │ │ │ -460 │ │ │ │ │ -461protected: │ │ │ │ │ -462 │ │ │ │ │ -_4_6_3 unsigned int _o_r_d_e_r() const │ │ │ │ │ -464 { │ │ │ │ │ -465 return (useDynamicOrder) ? _o_r_d_e_r__ : k; │ │ │ │ │ -466 } │ │ │ │ │ -467 │ │ │ │ │ -468 // Run-time order, only valid if k<0 │ │ │ │ │ -_4_6_9 unsigned int _o_r_d_e_r__; │ │ │ │ │ -470 │ │ │ │ │ -_4_7_1 FiniteElementCache _c_a_c_h_e__; │ │ │ │ │ -_4_7_2 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_7_3 const _E_l_e_m_e_n_t* _e_l_e_m_e_n_t__; │ │ │ │ │ -474}; │ │ │ │ │ -475 │ │ │ │ │ -476 │ │ │ │ │ -477 │ │ │ │ │ -478namespace BasisFactory { │ │ │ │ │ -479 │ │ │ │ │ -488template │ │ │ │ │ -_4_8_9auto _l_a_g_r_a_n_g_e() │ │ │ │ │ -490{ │ │ │ │ │ -491 return [](const auto& gridView) { │ │ │ │ │ -492 return _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s, k, R>(gridView); │ │ │ │ │ -493 }; │ │ │ │ │ -494} │ │ │ │ │ -495 │ │ │ │ │ -503template │ │ │ │ │ -_5_0_4auto _l_a_g_r_a_n_g_e(int order) │ │ │ │ │ -505{ │ │ │ │ │ -506 return [=](const auto& gridView) { │ │ │ │ │ -507 return _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s, -1, R>(gridView, │ │ │ │ │ -order); │ │ │ │ │ -508 }; │ │ │ │ │ -509} │ │ │ │ │ -510 │ │ │ │ │ -511} // end namespace BasisFactory │ │ │ │ │ -512 │ │ │ │ │ -513 │ │ │ │ │ -514 │ │ │ │ │ -538template │ │ │ │ │ -_5_3_9using _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_> >; │ │ │ │ │ -540 │ │ │ │ │ -541 │ │ │ │ │ -542 │ │ │ │ │ -543 │ │ │ │ │ -544 │ │ │ │ │ -545} // end namespace Functions │ │ │ │ │ -546} // end namespace Dune │ │ │ │ │ -547 │ │ │ │ │ -548 │ │ │ │ │ -549#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH │ │ │ │ │ -_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ │ -_n_o_d_e_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:489 │ │ │ │ │ +177 │ │ │ │ │ +178} // namespace Functions │ │ │ │ │ +179} // namespace Dune │ │ │ │ │ +180 │ │ │ │ │ +181#endif // DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:46 │ │ │ │ │ -_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:387 │ │ │ │ │ -_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:428 │ │ │ │ │ -_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:463 │ │ │ │ │ -_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:448 │ │ │ │ │ -_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_ │ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:473 │ │ │ │ │ -_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:439 │ │ │ │ │ -_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_:_:_c_a_c_h_e__ │ │ │ │ │ -FiniteElementCache cache_ │ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:471 │ │ │ │ │ -_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: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_:_:_b_i_n_d │ │ │ │ │ -void bind(const Element &e) │ │ │ │ │ -Bind to element. │ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:454 │ │ │ │ │ -_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:418 │ │ │ │ │ -_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_ │ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:472 │ │ │ │ │ -_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_ │ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:469 │ │ │ │ │ -_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:417 │ │ │ │ │ -_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:422 │ │ │ │ │ -_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:55 │ │ │ │ │ -_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:333 │ │ │ │ │ -_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:350 │ │ │ │ │ -_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:344 │ │ │ │ │ -_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_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ -static constexpr size_type maxMultiIndexSize │ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:70 │ │ │ │ │ -_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:355 │ │ │ │ │ -_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_:_:_e_d_g_e_O_f_f_s_e_t__ │ │ │ │ │ -size_type edgeOffset_ │ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:372 │ │ │ │ │ -_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__ │ │ │ │ │ -std::array< size_type, dim+1 > dofsPerSimplex_ │ │ │ │ │ -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_:_:_i_n_d_i_c_e_s │ │ │ │ │ -It indices(const Node &node, It it) const │ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:192 │ │ │ │ │ -_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_:_:_v_e_r_t_e_x_O_f_f_s_e_t__ │ │ │ │ │ -size_type vertexOffset_ │ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:371 │ │ │ │ │ -_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:322 │ │ │ │ │ -_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: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_:_:_p_y_r_a_m_i_d_O_f_f_s_e_t__ │ │ │ │ │ -size_type pyramidOffset_ │ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:376 │ │ │ │ │ -_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_:_:_p_r_i_s_m_O_f_f_s_e_t__ │ │ │ │ │ -size_type prismOffset_ │ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:377 │ │ │ │ │ -_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_:_:_t_e_t_r_a_h_e_d_r_o_n_O_f_f_s_e_t__ │ │ │ │ │ -size_type tetrahedronOffset_ │ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:375 │ │ │ │ │ -_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:96 │ │ │ │ │ -_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: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_:_:_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:80 │ │ │ │ │ -_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_ │ │ │ │ │ -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_:_:_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:178 │ │ │ │ │ -_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: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_:_:_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: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_:_:_s_i_z_e │ │ │ │ │ -size_type size(const SizePrefix &prefix) const │ │ │ │ │ -Return number of possible values for next position in multi index. │ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:171 │ │ │ │ │ -_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_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 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_r_i_d_V_i_e_w │ │ │ │ │ -GV GridView │ │ │ │ │ -The grid view that the FE basis is defined on. │ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:62 │ │ │ │ │ -_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_:_:_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:374 │ │ │ │ │ -_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:120 │ │ │ │ │ -_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__ │ │ │ │ │ -GridView gridView_ │ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:316 │ │ │ │ │ -_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:134 │ │ │ │ │ -_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_:_:_o_r_d_e_r │ │ │ │ │ -unsigned int order() const │ │ │ │ │ -Polynomial order used in the local Lagrange finite-elements. │ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:310 │ │ │ │ │ -_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_:_:_o_r_d_e_r__ │ │ │ │ │ -const unsigned int order_ │ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:319 │ │ │ │ │ -_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__ │ │ │ │ │ -std::array< size_type, dim+1 > dofsPerCube_ │ │ │ │ │ -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_:_:_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: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_:_:_s_i_z_e │ │ │ │ │ -size_type size() const │ │ │ │ │ -Same as size(prefix) with empty prefix. │ │ │ │ │ -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_:_:_d_o_f_s_P_e_r_P_r_i_s_m__ │ │ │ │ │ -size_type dofsPerPrism_ │ │ │ │ │ -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_:_:_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:328 │ │ │ │ │ -_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_:_:_t_r_i_a_n_g_l_e_O_f_f_s_e_t__ │ │ │ │ │ -size_type triangleOffset_ │ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:373 │ │ │ │ │ -_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_:_:_h_e_x_a_h_e_d_r_o_n_O_f_f_s_e_t__ │ │ │ │ │ -size_type hexahedronOffset_ │ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:378 │ │ │ │ │ -_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_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ -static constexpr size_type minMultiIndexSize │ │ │ │ │ -DDeeffiinniittiioonn lagrangebasis.hh:71 │ │ │ │ │ -_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:338 │ │ │ │ │ -_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:164 │ │ │ │ │ -_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:186 │ │ │ │ │ +_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:45 │ │ │ │ │ +_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:122 │ │ │ │ │ +_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:116 │ │ │ │ │ +_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: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_:_:_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:73 │ │ │ │ │ +_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:91 │ │ │ │ │ +_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:102 │ │ │ │ │ +_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:79 │ │ │ │ │ +_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:85 │ │ │ │ │ +_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:49 │ │ │ │ │ +_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:128 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00065.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: compositebasis.hh File Reference │ │ │ │ +dune-functions: differentiablefunction_imp.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,58 +65,35 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ Namespaces
│ │ │ │ -
compositebasis.hh File Reference
│ │ │ │ +
differentiablefunction_imp.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <tuple>
│ │ │ │ -#include <utility>
│ │ │ │ -#include <dune/common/std/apply.hh>
│ │ │ │ -#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 <dune/functions/functionspacebases/concepts.hh>
│ │ │ │ -#include <dune/functions/functionspacebases/defaultglobalbasis.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::CompositePreBasis< IMS, SPB >
 A pre-basis for composite bases. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::Functions
 
namespace  Dune::Functions::BasisFactory
 
namespace  Dune::Functions::BasisBuilder
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,40 +1,20 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -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> │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +_N_a_m_e_s_p_a_c_e_s │ │ │ │ │ +differentiablefunction_imp.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_/_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_:_:_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_:_:_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_B_u_i_l_d_e_r │ │ │ │ │ -  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00065_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: compositebasis.hh Source File │ │ │ │ +dune-functions: differentiablefunction_imp.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,452 +70,120 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
compositebasis.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH
│ │ │ │
5
│ │ │ │ -
6#include <tuple>
│ │ │ │ -
7#include <utility>
│ │ │ │ +
6#include <dune/common/exceptions.hh>
│ │ │ │ +
7#include <dune/common/concept.hh>
│ │ │ │
8
│ │ │ │ -
9#include <dune/common/std/apply.hh>
│ │ │ │ -
10#include <dune/common/hybridutilities.hh>
│ │ │ │ -
11#include <dune/common/reservedvector.hh>
│ │ │ │ -
12#include <dune/common/typeutilities.hh>
│ │ │ │ -
13#include <dune/common/hybridutilities.hh>
│ │ │ │ -
14#include <dune/common/tupleutility.hh>
│ │ │ │ -
15#include <dune/common/tuplevector.hh>
│ │ │ │ -
16
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
24
│ │ │ │ -
25
│ │ │ │ -
26namespace Dune {
│ │ │ │ -
27namespace Functions {
│ │ │ │ + │ │ │ │ +
10
│ │ │ │ +
11
│ │ │ │ +
12namespace Dune {
│ │ │ │ +
13namespace Functions {
│ │ │ │ +
14namespace Imp {
│ │ │ │ +
15
│ │ │ │ +
19struct HasFreeDerivative
│ │ │ │ +
20{
│ │ │ │ +
21 template<class F>
│ │ │ │ +
22 auto require(F&& f) -> decltype(
│ │ │ │ +
23 derivative(f)
│ │ │ │ +
24 );
│ │ │ │ +
25};
│ │ │ │ +
26
│ │ │ │ +
27
│ │ │ │
28
│ │ │ │ -
29// *****************************************************************************
│ │ │ │ -
30// This is the reusable part of the composite bases. It contains
│ │ │ │ -
31//
│ │ │ │ -
32// CompositePreBasis
│ │ │ │ -
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// *****************************************************************************
│ │ │ │ +
29template<class Dummy, class F,
│ │ │ │ +
30 typename std::enable_if<
│ │ │ │ +
31 models< HasFreeDerivative, F>() , int>::type = 0>
│ │ │ │ +
32auto derivativeIfImplemented(const F& f) -> decltype(derivative(f))
│ │ │ │ +
33{
│ │ │ │ +
34 return derivative(f);
│ │ │ │ +
35}
│ │ │ │ +
36
│ │ │ │ +
37
│ │ │ │
38
│ │ │ │ -
39
│ │ │ │ -
51template<class IMS, class... SPB>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
53{
│ │ │ │ -
54 static const bool isBlocked = std::is_same_v<IMS,BasisFactory::BlockedLexicographic> or std::is_same_v<IMS,BasisFactory::BlockedInterleaved>;
│ │ │ │ -
55public:
│ │ │ │ -
56
│ │ │ │ -
58 using SubPreBases = std::tuple<SPB...>;
│ │ │ │ -
59
│ │ │ │ -
61 template<std::size_t i>
│ │ │ │ -
62 using SubPreBasis = std::tuple_element_t<i, SubPreBases>;
│ │ │ │ -
63
│ │ │ │ -
65 using GridView = typename std::tuple_element_t<0, SubPreBases>::GridView;
│ │ │ │ +
39template<class Dummy, class F,
│ │ │ │ +
40 typename std::enable_if<
│ │ │ │ +
41 not(models< HasFreeDerivative, F>()) , int>::type = 0>
│ │ │ │ +
42Dummy derivativeIfImplemented(const F& f)
│ │ │ │ +
43{
│ │ │ │ +
44 DUNE_THROW(Dune::NotImplemented, "Derivative not implemented");
│ │ │ │ +
45}
│ │ │ │ +
46
│ │ │ │ +
47
│ │ │ │ +
48
│ │ │ │ +
49template<class Signature, class DerivativeInterface>
│ │ │ │ +
50class DifferentiableFunctionWrapperInterface
│ │ │ │ +
51{};
│ │ │ │ +
52
│ │ │ │ +
53// Interface of type erasure wrapper
│ │ │ │ +
54//
│ │ │ │ +
55// Notice that the basic interface of polymorphic classes (destructor, clone, ...)
│ │ │ │ +
56// will be added by the type erasure foundation classes.
│ │ │ │ +
57template<class Range, class Domain, class DerivativeInterface>
│ │ │ │ +
58class DifferentiableFunctionWrapperInterface<Range(Domain), DerivativeInterface>
│ │ │ │ +
59{
│ │ │ │ +
60public:
│ │ │ │ +
61 virtual Range operator() (const Domain& x) const = 0;
│ │ │ │ +
62
│ │ │ │ +
63 virtual DerivativeInterface derivative() const = 0;
│ │ │ │ +
64};
│ │ │ │ +
65
│ │ │ │
66
│ │ │ │ -
68 using size_type = std::size_t;
│ │ │ │ -
69
│ │ │ │ - │ │ │ │ -
72
│ │ │ │ -
73protected:
│ │ │ │ -
74 static const std::size_t children = sizeof...(SPB);
│ │ │ │ -
75
│ │ │ │ -
76 using ChildIndices = std::make_index_sequence<children>;
│ │ │ │ -
77
│ │ │ │ -
78public:
│ │ │ │ -
79
│ │ │ │ -
81 using Node = CompositeBasisNode<typename SPB::Node...>;
│ │ │ │ -
82
│ │ │ │ -
83 static constexpr size_type maxMultiIndexSize = std::max({SPB::maxMultiIndexSize...}) + isBlocked;
│ │ │ │ -
84 static constexpr size_type minMultiIndexSize = std::min({SPB::minMultiIndexSize...}) + isBlocked;
│ │ │ │ -
85 static constexpr size_type multiIndexBufferSize = std::max({SPB::multiIndexBufferSize...}) + isBlocked;
│ │ │ │ +
67
│ │ │ │ +
68template<class Signature, class DerivativeInterface, class B>
│ │ │ │ +
69class DifferentiableFunctionWrapperImplementation
│ │ │ │ +
70{};
│ │ │ │ +
71
│ │ │ │ +
72// Implementation of type erasure wrapper
│ │ │ │ +
73template<class Range, class Domain, class DerivativeInterface, class B>
│ │ │ │ +
74class DifferentiableFunctionWrapperImplementation< Range(Domain), DerivativeInterface, B> :
│ │ │ │ +
75 public B
│ │ │ │ +
76{
│ │ │ │ +
77public:
│ │ │ │ +
78
│ │ │ │ +
79 using B::B;
│ │ │ │ +
80 using Wrapped = typename B::Wrapped;
│ │ │ │ +
81
│ │ │ │ +
82 virtual Range operator() (const Domain& x) const
│ │ │ │ +
83 {
│ │ │ │ +
84 return this->get()(x);
│ │ │ │ +
85 }
│ │ │ │
86
│ │ │ │ -
92 template<class... SFArgs,
│ │ │ │ -
93 disableCopyMove<CompositePreBasis, SFArgs...> = 0,
│ │ │ │ -
94 enableIfConstructible<std::tuple<SPB...>, SFArgs...> = 0>
│ │ │ │ -
│ │ │ │ -
95 CompositePreBasis(SFArgs&&... sfArgs) :
│ │ │ │ -
96 subPreBases_(std::forward<SFArgs>(sfArgs)...)
│ │ │ │ -
97 {
│ │ │ │ -
98 Hybrid::forEach(subPreBases_, [&](const auto& subPreBasis){
│ │ │ │ -
99 static_assert(models<Concept::PreBasis<GridView>, std::decay_t<decltype(subPreBasis)>>(), "Subprebases passed to CompositePreBasis does not model the PreBasis concept.");
│ │ │ │ -
100 });
│ │ │ │ -
101 }
│ │ │ │ -
│ │ │ │ -
102
│ │ │ │ -
109 template<class GV,
│ │ │ │ -
110 std::enable_if_t<std::conjunction_v<
│ │ │ │ -
111 std::bool_constant<(children > 1)>, // Avoid ambiguous constructor if there's only one child
│ │ │ │ -
112 std::is_same<GV, GridView>,
│ │ │ │ -
113 std::is_constructible<SPB, GridView>...
│ │ │ │ -
114 >, int> = 0>
│ │ │ │ -
│ │ │ │ -
115 CompositePreBasis(const GV& gv) :
│ │ │ │ -
116 subPreBases_(SPB(gv)...)
│ │ │ │ -
117 {
│ │ │ │ -
118 Hybrid::forEach(subPreBases_, [&](const auto& subPreBasis){
│ │ │ │ -
119 static_assert(models<Concept::PreBasis<GridView>, std::decay_t<decltype(subPreBasis)>>(), "Subprebases passed to CompositePreBasis does not model the PreBasis concept.");
│ │ │ │ -
120 });
│ │ │ │ -
121 }
│ │ │ │ -
│ │ │ │ -
122
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
125 {
│ │ │ │ -
126 Hybrid::forEach(ChildIndices(), [&](auto i) {
│ │ │ │ -
127 this->subPreBasis(i).initializeIndices();
│ │ │ │ -
128 });
│ │ │ │ -
129 }
│ │ │ │ -
│ │ │ │ -
130
│ │ │ │ -
│ │ │ │ -
132 const GridView& gridView() const
│ │ │ │ -
133 {
│ │ │ │ -
134 return std::get<0>(subPreBases_).gridView();
│ │ │ │ -
135 }
│ │ │ │ -
│ │ │ │ -
136
│ │ │ │ -
│ │ │ │ -
138 void update(const GridView& gv)
│ │ │ │ -
139 {
│ │ │ │ -
140 Hybrid::forEach(ChildIndices(), [&](auto i) {
│ │ │ │ -
141 this->subPreBasis(i).update(gv);
│ │ │ │ -
142 });
│ │ │ │ -
143 }
│ │ │ │ -
│ │ │ │ -
144
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
149 {
│ │ │ │ -
150 auto node = Node{};
│ │ │ │ -
151 Hybrid::forEach(ChildIndices(), [&](auto i) {
│ │ │ │ -
152 node.setChild(this->subPreBasis(i).makeNode(), i);
│ │ │ │ -
153 });
│ │ │ │ -
154 return node;
│ │ │ │ -
155 }
│ │ │ │ -
│ │ │ │ -
156
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
159 {
│ │ │ │ -
160 return size(Dune::ReservedVector<size_type, multiIndexBufferSize>{});
│ │ │ │ -
161 }
│ │ │ │ -
│ │ │ │ -
162
│ │ │ │ -
164 template<class SizePrefix>
│ │ │ │ -
│ │ │ │ -
165 size_type size(const SizePrefix& prefix) const
│ │ │ │ -
166 {
│ │ │ │ -
167 return size(prefix, IndexMergingStrategy{});
│ │ │ │ -
168 }
│ │ │ │ -
│ │ │ │ -
169
│ │ │ │ -
170private:
│ │ │ │ -
171
│ │ │ │ -
172 template<class SizePrefix>
│ │ │ │ -
173 size_type size(const SizePrefix& prefix, BasisFactory::BlockedLexicographic) const
│ │ │ │ -
174 {
│ │ │ │ -
175 if (prefix.size() == 0)
│ │ │ │ -
176 return children;
│ │ │ │ -
177
│ │ │ │ -
178 return Hybrid::switchCases(ChildIndices(), prefix[0], [&] (auto i) {
│ │ │ │ -
179 SizePrefix subPrefix;
│ │ │ │ -
180 for(std::size_t i=1; i<prefix.size(); ++i)
│ │ │ │ -
181 subPrefix.push_back(prefix[i]);
│ │ │ │ -
182 return this->subPreBasis(i).size(subPrefix);
│ │ │ │ -
183 }, []() {
│ │ │ │ -
184 return size_type(0);
│ │ │ │ -
185 });
│ │ │ │ -
186 }
│ │ │ │ -
187
│ │ │ │ -
188 template<class SizePrefix>
│ │ │ │ -
189 size_type size(const SizePrefix& prefix, BasisFactory::FlatLexicographic) const
│ │ │ │ -
190 {
│ │ │ │ -
191 size_type result = 0;
│ │ │ │ -
192 if (prefix.size() == 0)
│ │ │ │ -
193 Hybrid::forEach(ChildIndices(), [&](auto i) {
│ │ │ │ -
194 result += this->subPreBasis(i).size();
│ │ │ │ -
195 });
│ │ │ │ -
196 else {
│ │ │ │ -
197 size_type shiftedFirstDigit = prefix[0];
│ │ │ │ -
198 staticFindInRange<0, children>([&](auto i) {
│ │ │ │ -
199 auto firstDigitSize = this->subPreBasis(i).size();
│ │ │ │ -
200 if (shiftedFirstDigit < firstDigitSize)
│ │ │ │ -
201 {
│ │ │ │ -
202 SizePrefix subPrefix;
│ │ │ │ -
203 subPrefix.push_back(shiftedFirstDigit);
│ │ │ │ -
204 for(std::size_t i=1; i<prefix.size(); ++i)
│ │ │ │ -
205 subPrefix.push_back(prefix[i]);
│ │ │ │ -
206 result = this->subPreBasis(i).size(subPrefix);
│ │ │ │ -
207 return true;
│ │ │ │ -
208 }
│ │ │ │ -
209 shiftedFirstDigit -= firstDigitSize;
│ │ │ │ -
210 return false;
│ │ │ │ -
211 });
│ │ │ │ -
212 }
│ │ │ │ -
213 return result;
│ │ │ │ -
214 }
│ │ │ │ -
215
│ │ │ │ -
216public:
│ │ │ │ -
217
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
220 {
│ │ │ │ -
221 size_type r=0;
│ │ │ │ -
222 // Accumulate dimension() for all subprebases
│ │ │ │ -
223 Hybrid::forEach(ChildIndices(), [&](auto i) {
│ │ │ │ -
224 r += this->subPreBasis(i).dimension();
│ │ │ │ -
225 });
│ │ │ │ -
226 return r;
│ │ │ │ -
227 }
│ │ │ │ -
│ │ │ │ -
228
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
231 {
│ │ │ │ -
232 size_type r=0;
│ │ │ │ -
233 // Accumulate maxNodeSize() for all subprebases
│ │ │ │ -
234 Hybrid::forEach(ChildIndices(), [&](auto i) {
│ │ │ │ -
235 r += this->subPreBasis(i).maxNodeSize();
│ │ │ │ -
236 });
│ │ │ │ -
237 return r;
│ │ │ │ -
238 }
│ │ │ │ -
│ │ │ │ -
239
│ │ │ │ -
241 template<std::size_t i>
│ │ │ │ -
│ │ │ │ -
242 const SubPreBasis<i>& subPreBasis(Dune::index_constant<i> = {}) const
│ │ │ │ -
243 {
│ │ │ │ -
244 return std::get<i>(subPreBases_);
│ │ │ │ -
245 }
│ │ │ │ -
│ │ │ │ -
246
│ │ │ │ -
248 template<std::size_t i>
│ │ │ │ -
│ │ │ │ -
249 SubPreBasis<i>& subPreBasis(Dune::index_constant<i> = {})
│ │ │ │ -
250 {
│ │ │ │ -
251 return std::get<i>(subPreBases_);
│ │ │ │ -
252 }
│ │ │ │ -
│ │ │ │ -
253
│ │ │ │ -
255 template<typename It>
│ │ │ │ -
│ │ │ │ -
256 It indices(const Node& node, It it) const
│ │ │ │ -
257 {
│ │ │ │ -
258 return indices(node, it, IndexMergingStrategy{});
│ │ │ │ -
259 }
│ │ │ │ -
│ │ │ │ -
260
│ │ │ │ -
261private:
│ │ │ │ -
262
│ │ │ │ -
263 template<typename It>
│ │ │ │ -
264 It indices(const Node& node, It multiIndices, BasisFactory::FlatLexicographic) const
│ │ │ │ -
265 {
│ │ │ │ -
266 size_type firstComponentOffset = 0;
│ │ │ │ -
267 // Loop over all children
│ │ │ │ -
268 Hybrid::forEach(ChildIndices(), [&](auto child){
│ │ │ │ -
269 size_type subTreeSize = node.child(child).size();
│ │ │ │ -
270 // Fill indices for current child into index buffer starting from current
│ │ │ │ -
271 // buffer position and shift first index component of any index for current
│ │ │ │ -
272 // child by suitable offset to get lexicographic indices.
│ │ │ │ -
273 subPreBasis(child).indices(node.child(child), multiIndices);
│ │ │ │ -
274 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ │ -
275 multiIndices[i][0] += firstComponentOffset;
│ │ │ │ -
276 // Increment offset by the size for first index component of the current child
│ │ │ │ -
277 firstComponentOffset += subPreBasis(child).size();
│ │ │ │ -
278 // Increment buffer iterator by the number of indices processed for current child
│ │ │ │ -
279 multiIndices += subTreeSize;
│ │ │ │ -
280 });
│ │ │ │ -
281 return multiIndices;
│ │ │ │ -
282 }
│ │ │ │ -
283
│ │ │ │ -
284 template<class MultiIndex>
│ │ │ │ -
285 static void multiIndexPushFront(MultiIndex& M, size_type M0)
│ │ │ │ -
286 {
│ │ │ │ -
287 M.resize(M.size()+1);
│ │ │ │ -
288 for(std::size_t i=M.size()-1; i>0; --i)
│ │ │ │ -
289 M[i] = M[i-1];
│ │ │ │ -
290 M[0] = M0;
│ │ │ │ -
291 }
│ │ │ │ -
292
│ │ │ │ -
293 template<typename It>
│ │ │ │ -
294 It indices(const Node& node, It multiIndices, BasisFactory::BlockedLexicographic) const
│ │ │ │ -
295 {
│ │ │ │ -
296 // Loop over all children
│ │ │ │ -
297 Hybrid::forEach(ChildIndices(), [&](auto child){
│ │ │ │ -
298 size_type subTreeSize = node.child(child).size();
│ │ │ │ -
299 // Fill indices for current child into index buffer starting from current position
│ │ │ │ -
300 subPreBasis(child).indices(node.child(child), multiIndices);
│ │ │ │ -
301 // Insert child index before first component of all indices of current child.
│ │ │ │ -
302 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ │ -
303 this->multiIndexPushFront(multiIndices[i], child);
│ │ │ │ -
304 // Increment buffer iterator by the number of indices processed for current child
│ │ │ │ -
305 multiIndices += subTreeSize;
│ │ │ │ -
306 });
│ │ │ │ -
307 return multiIndices;
│ │ │ │ -
308 }
│ │ │ │ -
309
│ │ │ │ -
310 std::tuple<SPB...> subPreBases_;
│ │ │ │ -
311};
│ │ │ │ -
│ │ │ │ -
312
│ │ │ │ -
313
│ │ │ │ -
314
│ │ │ │ -
315namespace BasisFactory {
│ │ │ │ -
316
│ │ │ │ -
317namespace Imp {
│ │ │ │ -
318
│ │ │ │ -
319template<class IndexMergingStrategy, class... ChildPreBasisFactory>
│ │ │ │ -
320class CompositePreBasisFactory
│ │ │ │ -
321{
│ │ │ │ -
322
│ │ │ │ -
323 template<class GridView, class... ChildPreBasis>
│ │ │ │ -
324 auto makePreBasisFromChildPreBases(const GridView&, ChildPreBasis&&... childPreBasis) const
│ │ │ │ -
325 {
│ │ │ │ -
326 return CompositePreBasis<IndexMergingStrategy, std::decay_t<ChildPreBasis>...>(std::forward<ChildPreBasis>(childPreBasis)...);
│ │ │ │ -
327 }
│ │ │ │ -
328
│ │ │ │ -
329public:
│ │ │ │ -
330
│ │ │ │ -
331 CompositePreBasisFactory(const ChildPreBasisFactory&... childPreBasisFactory) :
│ │ │ │ -
332 childPreBasisFactories_(childPreBasisFactory...)
│ │ │ │ -
333 {}
│ │ │ │ -
334
│ │ │ │ -
335 CompositePreBasisFactory(ChildPreBasisFactory&&... childPreBasisFactory) :
│ │ │ │ -
336 childPreBasisFactories_(std::move(childPreBasisFactory)...)
│ │ │ │ -
337 {}
│ │ │ │ -
338
│ │ │ │ -
339 template<class GridView>
│ │ │ │ -
340 auto operator()(const GridView& gridView) const
│ │ │ │ -
341 {
│ │ │ │ -
342 // Use std::apply to unpack the tuple childPreBasisFactories_
│ │ │ │ -
343 return std::apply([&](const auto&... childPreBasisFactory) {
│ │ │ │ -
344 return this->makePreBasisFromChildPreBases(gridView, childPreBasisFactory(gridView)...);
│ │ │ │ -
345 }, childPreBasisFactories_);
│ │ │ │ -
346 }
│ │ │ │ -
347
│ │ │ │ -
348private:
│ │ │ │ -
349 std::tuple<ChildPreBasisFactory...> childPreBasisFactories_;
│ │ │ │ -
350};
│ │ │ │ -
351
│ │ │ │ -
352} // end namespace BasisFactory::Imp
│ │ │ │ -
353
│ │ │ │ -
354
│ │ │ │ -
355
│ │ │ │ -
366template<
│ │ │ │ -
367 typename... Args,
│ │ │ │ -
368 std::enable_if_t<Concept::isIndexMergingStrategy<typename LastType<Args...>::type>(),int> = 0>
│ │ │ │ -
369auto composite(Args&&... args)
│ │ │ │ -
370{
│ │ │ │ -
371 // We have to separate the last entry which is the IndexMergingStrategy
│ │ │ │ -
372 // and the preceding ones, which are the ChildPreBasisFactories
│ │ │ │ -
373
│ │ │ │ -
374 using ArgTuple = std::tuple<std::decay_t<Args>...>;
│ │ │ │ -
375
│ │ │ │ -
376 // Compute number of children and index of the IndexMergingStrategy argument
│ │ │ │ -
377 constexpr std::size_t children = Dune::SizeOf<Args...>::value-1;
│ │ │ │ -
378
│ │ │ │ -
379 // Use last type as IndexMergingStrategy
│ │ │ │ -
380 using IndexMergingStrategy = std::tuple_element_t<children, ArgTuple>;
│ │ │ │ -
381
│ │ │ │ -
382 // Index sequence for all but the last entry for partial tuple unpacking
│ │ │ │ -
383 auto childIndices = std::make_index_sequence<children>{};
│ │ │ │ -
384
│ │ │ │ -
385 // Unpack tuple only for those entries related to children
│ │ │ │ -
386 return applyPartial([](auto&&... childPreBasisFactory){
│ │ │ │ -
387 return Imp::CompositePreBasisFactory<IndexMergingStrategy, std::decay_t<decltype(childPreBasisFactory)>...>(std::forward<decltype(childPreBasisFactory)>(childPreBasisFactory)...);
│ │ │ │ -
388 },
│ │ │ │ -
389 std::forward_as_tuple(std::forward<Args>(args)...),
│ │ │ │ -
390 childIndices);
│ │ │ │ -
391}
│ │ │ │ -
392
│ │ │ │ -
404template<
│ │ │ │ -
405 typename... Args,
│ │ │ │ -
406 std::enable_if_t<not Concept::isIndexMergingStrategy<typename LastType<Args...>::type>(),int> = 0>
│ │ │ │ -
407auto composite(Args&&... args)
│ │ │ │ -
408{
│ │ │ │ -
409 return Imp::CompositePreBasisFactory<BasisFactory::BlockedLexicographic, std::decay_t<Args>...>(std::forward<Args>(args)...);
│ │ │ │ -
410}
│ │ │ │ -
411
│ │ │ │ -
412} // end namespace BasisFactory
│ │ │ │ -
413
│ │ │ │ -
414// Backward compatibility
│ │ │ │ -
415namespace BasisBuilder {
│ │ │ │ -
416
│ │ │ │ -
417 using namespace BasisFactory;
│ │ │ │ -
418
│ │ │ │ -
419}
│ │ │ │ -
420
│ │ │ │ -
421
│ │ │ │ -
422
│ │ │ │ -
423} // end namespace Functions
│ │ │ │ -
424} // end namespace Dune
│ │ │ │ -
425
│ │ │ │ -
426
│ │ │ │ -
427#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
typename std::enable_if< std::is_constructible< T, Args... >::value, int >::type enableIfConstructible
Helper to constrain forwarding constructors.
Definition type_traits.hh:26
│ │ │ │ +
87 virtual DerivativeInterface derivative() const
│ │ │ │ +
88 {
│ │ │ │ +
89 return derivativeIfImplemented<DerivativeInterface, Wrapped>(this->get());
│ │ │ │ +
90 }
│ │ │ │ +
91};
│ │ │ │ +
92
│ │ │ │ +
93
│ │ │ │ +
94
│ │ │ │ +
95}}} // namespace Dune::Functions::Imp
│ │ │ │ +
96
│ │ │ │ +
97
│ │ │ │ +
98
│ │ │ │ +
99#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:39
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
static constexpr bool isIndexMergingStrategy()
Definition basistags.hh:23
│ │ │ │ -
Lexicographic merging of direct children without blocking.
Definition basistags.hh:80
│ │ │ │ -
Lexicographic merging of direct children with blocking (i.e. creating one block per direct child).
Definition basistags.hh:148
│ │ │ │ -
A pre-basis for composite bases.
Definition compositebasis.hh:53
│ │ │ │ -
SubPreBasis< i > & subPreBasis(Dune::index_constant< i >={})
Mutable access to the stored prebasis of the factor in the power space.
Definition compositebasis.hh:249
│ │ │ │ -
IMS IndexMergingStrategy
Strategy used to merge the global indices of the child pre-bases.
Definition compositebasis.hh:71
│ │ │ │ -
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition compositebasis.hh:230
│ │ │ │ -
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:242
│ │ │ │ -
std::size_t size_type
Type used for indices and size information.
Definition compositebasis.hh:68
│ │ │ │ -
CompositeBasisNode< typename SPB::Node... > Node
Template mapping root tree path to type of created tree node.
Definition compositebasis.hh:81
│ │ │ │ -
size_type size(const SizePrefix &prefix) const
Return number of possible values for next position in multi index.
Definition compositebasis.hh:165
│ │ │ │ -
CompositePreBasis(SFArgs &&... sfArgs)
Constructor for given child pre-basis objects.
Definition compositebasis.hh:95
│ │ │ │ -
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition compositebasis.hh:219
│ │ │ │ -
CompositePreBasis(const GV &gv)
Constructor for given GridView.
Definition compositebasis.hh:115
│ │ │ │ -
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:256
│ │ │ │ -
size_type size() const
Same as size(prefix) with empty prefix.
Definition compositebasis.hh:158
│ │ │ │ -
typename std::tuple_element_t< 0, SubPreBases >::GridView GridView
The grid view that the FE basis is defined on.
Definition compositebasis.hh:65
│ │ │ │ -
static const std::size_t children
Definition compositebasis.hh:74
│ │ │ │ -
std::tuple< SPB... > SubPreBases
Tuple of child pre-bases.
Definition compositebasis.hh:58
│ │ │ │ -
Node makeNode() const
Create tree node.
Definition compositebasis.hh:148
│ │ │ │ -
void initializeIndices()
Initialize the global indices.
Definition compositebasis.hh:124
│ │ │ │ -
std::tuple_element_t< i, SubPreBases > SubPreBasis
Export individual child pre-bases by index.
Definition compositebasis.hh:62
│ │ │ │ -
std::make_index_sequence< children > ChildIndices
Definition compositebasis.hh:76
│ │ │ │ -
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition compositebasis.hh:138
│ │ │ │ -
static constexpr size_type multiIndexBufferSize
Definition compositebasis.hh:85
│ │ │ │ -
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition compositebasis.hh:132
│ │ │ │ -
static constexpr size_type minMultiIndexSize
Definition compositebasis.hh:84
│ │ │ │ -
static constexpr size_type maxMultiIndexSize
Definition compositebasis.hh:83
│ │ │ │ - │ │ │ │ - │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,528 +1,118 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -compositebasis.hh │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ 8 │ │ │ │ │ -9#include │ │ │ │ │ -10#include │ │ │ │ │ -11#include │ │ │ │ │ -12#include │ │ │ │ │ -13#include │ │ │ │ │ -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_/_s_t_a_t_i_c_f_o_r_l_o_o_p_._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___t_r_a_i_t_s_._h_h> │ │ │ │ │ -19#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> │ │ │ │ │ -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_/_b_a_s_i_s_t_a_g_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_/_n_o_d_e_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_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_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ │ -24 │ │ │ │ │ -25 │ │ │ │ │ -26namespace _D_u_n_e { │ │ │ │ │ -27namespace Functions { │ │ │ │ │ +9#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 │ │ │ │ │ +11 │ │ │ │ │ +12namespace _D_u_n_e { │ │ │ │ │ +13namespace Functions { │ │ │ │ │ +14namespace Imp { │ │ │ │ │ +15 │ │ │ │ │ +19struct HasFreeDerivative │ │ │ │ │ +20{ │ │ │ │ │ +21 template │ │ │ │ │ +22 auto require(F&& f) -> decltype( │ │ │ │ │ +23 _d_e_r_i_v_a_t_i_v_e(f) │ │ │ │ │ +24 ); │ │ │ │ │ +25}; │ │ │ │ │ +26 │ │ │ │ │ +27 │ │ │ │ │ 28 │ │ │ │ │ -29/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ -30// This is the reusable part of the composite bases. It contains │ │ │ │ │ -31// │ │ │ │ │ -32// CompositePreBasis │ │ │ │ │ -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/ │ │ │ │ │ -/ ***************************************************************************** │ │ │ │ │ +29template() , int>::type = 0> │ │ │ │ │ +32auto derivativeIfImplemented(const F& f) -> decltype(_d_e_r_i_v_a_t_i_v_e(f)) │ │ │ │ │ +33{ │ │ │ │ │ +34 return _d_e_r_i_v_a_t_i_v_e(f); │ │ │ │ │ +35} │ │ │ │ │ +36 │ │ │ │ │ +37 │ │ │ │ │ 38 │ │ │ │ │ -39 │ │ │ │ │ -51template │ │ │ │ │ -_5_2class _C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s │ │ │ │ │ -53{ │ │ │ │ │ -54 static const bool isBlocked = std::is_same_v or std::is_same_v; │ │ │ │ │ -55public: │ │ │ │ │ -56 │ │ │ │ │ -_5_8 using _S_u_b_P_r_e_B_a_s_e_s = std::tuple; │ │ │ │ │ -59 │ │ │ │ │ -61 template │ │ │ │ │ -_6_2 using _S_u_b_P_r_e_B_a_s_i_s = std::tuple_element_t; │ │ │ │ │ -63 │ │ │ │ │ -_6_5 using _G_r_i_d_V_i_e_w = typename std::tuple_element_t<0, SubPreBases>::GridView; │ │ │ │ │ +39template()) , int>::type = 0> │ │ │ │ │ +42Dummy derivativeIfImplemented(const F& f) │ │ │ │ │ +43{ │ │ │ │ │ +44 DUNE_THROW(Dune::NotImplemented, "Derivative not implemented"); │ │ │ │ │ +45} │ │ │ │ │ +46 │ │ │ │ │ +47 │ │ │ │ │ +48 │ │ │ │ │ +49template │ │ │ │ │ +50class DifferentiableFunctionWrapperInterface │ │ │ │ │ +51{}; │ │ │ │ │ +52 │ │ │ │ │ +53// Interface of type erasure wrapper │ │ │ │ │ +54// │ │ │ │ │ +55// Notice that the basic interface of polymorphic classes (destructor, clone, │ │ │ │ │ +...) │ │ │ │ │ +56// will be added by the type erasure foundation classes. │ │ │ │ │ +57template │ │ │ │ │ +58class DifferentiableFunctionWrapperInterface │ │ │ │ │ +59{ │ │ │ │ │ +60public: │ │ │ │ │ +61 virtual Range operator() (const Domain& x) const = 0; │ │ │ │ │ +62 │ │ │ │ │ +63 virtual DerivativeInterface _d_e_r_i_v_a_t_i_v_e() const = 0; │ │ │ │ │ +64}; │ │ │ │ │ +65 │ │ │ │ │ 66 │ │ │ │ │ -_6_8 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ -69 │ │ │ │ │ -_7_1 using _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y = IMS; │ │ │ │ │ -72 │ │ │ │ │ -73protected: │ │ │ │ │ -_7_4 static const std::size_t _c_h_i_l_d_r_e_n = sizeof...(SPB); │ │ │ │ │ -75 │ │ │ │ │ -_7_6 using _C_h_i_l_d_I_n_d_i_c_e_s = std::make_index_sequence; │ │ │ │ │ -77 │ │ │ │ │ -78public: │ │ │ │ │ -79 │ │ │ │ │ -_8_1 using _N_o_d_e = _C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e; │ │ │ │ │ -82 │ │ │ │ │ -_8_3 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_4 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_5 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; │ │ │ │ │ +67 │ │ │ │ │ +68template │ │ │ │ │ +69class DifferentiableFunctionWrapperImplementation │ │ │ │ │ +70{}; │ │ │ │ │ +71 │ │ │ │ │ +72// Implementation of type erasure wrapper │ │ │ │ │ +73template │ │ │ │ │ +74class DifferentiableFunctionWrapperImplementation< Range(Domain), │ │ │ │ │ +DerivativeInterface, B> : │ │ │ │ │ +75 public B │ │ │ │ │ +76{ │ │ │ │ │ +77public: │ │ │ │ │ +78 │ │ │ │ │ +79 using B::B; │ │ │ │ │ +80 using Wrapped = typename B::Wrapped; │ │ │ │ │ +81 │ │ │ │ │ +82 virtual Range operator() (const Domain& x) const │ │ │ │ │ +83 { │ │ │ │ │ +84 return this->get()(x); │ │ │ │ │ +85 } │ │ │ │ │ 86 │ │ │ │ │ -92 template = 0, │ │ │ │ │ -94 _e_n_a_b_l_e_I_f_C_o_n_s_t_r_u_c_t_i_b_l_e, SFArgs...> = 0> │ │ │ │ │ -_9_5 _C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s(SFArgs&&... sfArgs) : │ │ │ │ │ -96 subPreBases_(std::forward(sfArgs)...) │ │ │ │ │ -97 { │ │ │ │ │ -98 Hybrid::forEach(subPreBases_, [&](const auto& _s_u_b_P_r_e_B_a_s_i_s){ │ │ │ │ │ -99 static_assert(models, std::decay_t>(), "Subprebases passed to CompositePreBasis does not model the │ │ │ │ │ -PreBasis concept."); │ │ │ │ │ -100 }); │ │ │ │ │ -101 } │ │ │ │ │ -102 │ │ │ │ │ -109 template 1)>, // Avoid ambiguous constructor if │ │ │ │ │ -there's only one child │ │ │ │ │ -112 std::is_same, │ │ │ │ │ -113 std::is_constructible... │ │ │ │ │ -114 >, int> = 0> │ │ │ │ │ -_1_1_5 _C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s(const GV& gv) : │ │ │ │ │ -116 subPreBases_(SPB(gv)...) │ │ │ │ │ -117 { │ │ │ │ │ -118 Hybrid::forEach(subPreBases_, [&](const auto& _s_u_b_P_r_e_B_a_s_i_s){ │ │ │ │ │ -119 static_assert(models, std::decay_t>(), "Subprebases passed to CompositePreBasis does not model the │ │ │ │ │ -PreBasis concept."); │ │ │ │ │ -120 }); │ │ │ │ │ -121 } │ │ │ │ │ -122 │ │ │ │ │ -_1_2_4 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ │ -125 { │ │ │ │ │ -126 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto i) { │ │ │ │ │ -127 this->_s_u_b_P_r_e_B_a_s_i_s(i).initializeIndices(); │ │ │ │ │ -128 }); │ │ │ │ │ -129 } │ │ │ │ │ -130 │ │ │ │ │ -_1_3_2 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ │ -133 { │ │ │ │ │ -134 return std::get<0>(subPreBases_).gridView(); │ │ │ │ │ -135 } │ │ │ │ │ -136 │ │ │ │ │ -_1_3_8 void _u_p_d_a_t_e(const _G_r_i_d_V_i_e_w& gv) │ │ │ │ │ -139 { │ │ │ │ │ -140 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto i) { │ │ │ │ │ -141 this->_s_u_b_P_r_e_B_a_s_i_s(i).update(gv); │ │ │ │ │ -142 }); │ │ │ │ │ -143 } │ │ │ │ │ -144 │ │ │ │ │ -_1_4_8 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ │ -149 { │ │ │ │ │ -150 auto node = _N_o_d_e{}; │ │ │ │ │ -151 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto i) { │ │ │ │ │ -152 node.setChild(this->_s_u_b_P_r_e_B_a_s_i_s(i)._m_a_k_e_N_o_d_e(), i); │ │ │ │ │ -153 }); │ │ │ │ │ -154 return node; │ │ │ │ │ -155 } │ │ │ │ │ -156 │ │ │ │ │ -_1_5_8 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ │ -159 { │ │ │ │ │ -160 return _s_i_z_e(Dune::ReservedVector{}); │ │ │ │ │ -161 } │ │ │ │ │ -162 │ │ │ │ │ -164 template │ │ │ │ │ -_1_6_5 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix) const │ │ │ │ │ -166 { │ │ │ │ │ -167 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{}); │ │ │ │ │ -168 } │ │ │ │ │ -169 │ │ │ │ │ -170private: │ │ │ │ │ -171 │ │ │ │ │ -172 template │ │ │ │ │ -173 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix, _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 │ │ │ │ │ -174 { │ │ │ │ │ -175 if (prefix.size() == 0) │ │ │ │ │ -176 return _c_h_i_l_d_r_e_n; │ │ │ │ │ -177 │ │ │ │ │ -178 return Hybrid::switchCases(_C_h_i_l_d_I_n_d_i_c_e_s(), prefix[0], [&] (auto i) { │ │ │ │ │ -179 SizePrefix subPrefix; │ │ │ │ │ -180 for(std::size_t i=1; i_s_u_b_P_r_e_B_a_s_i_s(i).size(subPrefix); │ │ │ │ │ -183 }, []() { │ │ │ │ │ -184 return _s_i_z_e___t_y_p_e(0); │ │ │ │ │ -185 }); │ │ │ │ │ -186 } │ │ │ │ │ -187 │ │ │ │ │ -188 template │ │ │ │ │ -189 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix, BasisFactory::FlatLexicographic) │ │ │ │ │ -const │ │ │ │ │ -190 { │ │ │ │ │ -191 _s_i_z_e___t_y_p_e result = 0; │ │ │ │ │ -192 if (prefix.size() == 0) │ │ │ │ │ -193 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto i) { │ │ │ │ │ -194 result += this->_s_u_b_P_r_e_B_a_s_i_s(i).size(); │ │ │ │ │ -195 }); │ │ │ │ │ -196 else { │ │ │ │ │ -197 _s_i_z_e___t_y_p_e shiftedFirstDigit = prefix[0]; │ │ │ │ │ -198 staticFindInRange<0, children>([&](auto i) { │ │ │ │ │ -199 auto firstDigitSize = this->_s_u_b_P_r_e_B_a_s_i_s(i).size(); │ │ │ │ │ -200 if (shiftedFirstDigit < firstDigitSize) │ │ │ │ │ -201 { │ │ │ │ │ -202 SizePrefix subPrefix; │ │ │ │ │ -203 subPrefix.push_back(shiftedFirstDigit); │ │ │ │ │ -204 for(std::size_t i=1; i_s_u_b_P_r_e_B_a_s_i_s(i).size(subPrefix); │ │ │ │ │ -207 return true; │ │ │ │ │ -208 } │ │ │ │ │ -209 shiftedFirstDigit -= firstDigitSize; │ │ │ │ │ -210 return false; │ │ │ │ │ -211 }); │ │ │ │ │ -212 } │ │ │ │ │ -213 return result; │ │ │ │ │ -214 } │ │ │ │ │ -215 │ │ │ │ │ -216public: │ │ │ │ │ -217 │ │ │ │ │ -_2_1_9 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ │ -220 { │ │ │ │ │ -221 _s_i_z_e___t_y_p_e r=0; │ │ │ │ │ -222 // Accumulate dimension() for all subprebases │ │ │ │ │ -223 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto i) { │ │ │ │ │ -224 r += this->_s_u_b_P_r_e_B_a_s_i_s(i).dimension(); │ │ │ │ │ -225 }); │ │ │ │ │ -226 return r; │ │ │ │ │ -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 _s_i_z_e___t_y_p_e r=0; │ │ │ │ │ -233 // Accumulate maxNodeSize() for all subprebases │ │ │ │ │ -234 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto i) { │ │ │ │ │ -235 r += this->_s_u_b_P_r_e_B_a_s_i_s(i).maxNodeSize(); │ │ │ │ │ -236 }); │ │ │ │ │ -237 return r; │ │ │ │ │ -238 } │ │ │ │ │ -239 │ │ │ │ │ -241 template │ │ │ │ │ -_2_4_2 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 │ │ │ │ │ -243 { │ │ │ │ │ -244 return std::get(subPreBases_); │ │ │ │ │ -245 } │ │ │ │ │ -246 │ │ │ │ │ -248 template │ │ │ │ │ -_2_4_9 _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 = {}) │ │ │ │ │ -250 { │ │ │ │ │ -251 return std::get(subPreBases_); │ │ │ │ │ -252 } │ │ │ │ │ -253 │ │ │ │ │ -255 template │ │ │ │ │ -_2_5_6 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ │ -257 { │ │ │ │ │ -258 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{}); │ │ │ │ │ -259 } │ │ │ │ │ -260 │ │ │ │ │ -261private: │ │ │ │ │ -262 │ │ │ │ │ -263 template │ │ │ │ │ -264 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 │ │ │ │ │ -265 { │ │ │ │ │ -266 _s_i_z_e___t_y_p_e firstComponentOffset = 0; │ │ │ │ │ -267 // Loop over all children │ │ │ │ │ -268 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto child){ │ │ │ │ │ -269 _s_i_z_e___t_y_p_e subTreeSize = node.child(child)._s_i_z_e(); │ │ │ │ │ -270 // Fill indices for current child into index buffer starting from current │ │ │ │ │ -271 // buffer position and shift first index component of any index for current │ │ │ │ │ -272 // child by suitable offset to get lexicographic indices. │ │ │ │ │ -273 _s_u_b_P_r_e_B_a_s_i_s(child).indices(node.child(child), multiIndices); │ │ │ │ │ -274 for (std::size_t i = 0; i │ │ │ │ │ -285 static void multiIndexPushFront(MultiIndex& M, _s_i_z_e___t_y_p_e M0) │ │ │ │ │ -286 { │ │ │ │ │ -287 M.resize(M.size()+1); │ │ │ │ │ -288 for(std::size_t i=M.size()-1; i>0; --i) │ │ │ │ │ -289 M[i] = M[i-1]; │ │ │ │ │ -290 M[0] = M0; │ │ │ │ │ -291 } │ │ │ │ │ -292 │ │ │ │ │ -293 template │ │ │ │ │ -294 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It multiIndices, BasisFactory:: │ │ │ │ │ -BlockedLexicographic) const │ │ │ │ │ -295 { │ │ │ │ │ -296 // Loop over all children │ │ │ │ │ -297 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto child){ │ │ │ │ │ -298 _s_i_z_e___t_y_p_e subTreeSize = node.child(child)._s_i_z_e(); │ │ │ │ │ -299 // Fill indices for current child into index buffer starting from current │ │ │ │ │ -position │ │ │ │ │ -300 _s_u_b_P_r_e_B_a_s_i_s(child).indices(node.child(child), multiIndices); │ │ │ │ │ -301 // Insert child index before first component of all indices of current │ │ │ │ │ -child. │ │ │ │ │ -302 for (std::size_t i = 0; imultiIndexPushFront(multiIndices[i], child); │ │ │ │ │ -304 // Increment buffer iterator by the number of indices processed for current │ │ │ │ │ -child │ │ │ │ │ -305 multiIndices += subTreeSize; │ │ │ │ │ -306 }); │ │ │ │ │ -307 return multiIndices; │ │ │ │ │ -308 } │ │ │ │ │ -309 │ │ │ │ │ -310 std::tuple subPreBases_; │ │ │ │ │ -311}; │ │ │ │ │ -312 │ │ │ │ │ -313 │ │ │ │ │ -314 │ │ │ │ │ -315namespace BasisFactory { │ │ │ │ │ -316 │ │ │ │ │ -317namespace Imp { │ │ │ │ │ -318 │ │ │ │ │ -319template │ │ │ │ │ -320class CompositePreBasisFactory │ │ │ │ │ -321{ │ │ │ │ │ -322 │ │ │ │ │ -323 template │ │ │ │ │ -324 auto makePreBasisFromChildPreBases(const GridView&, ChildPreBasis&&... │ │ │ │ │ -childPreBasis) const │ │ │ │ │ -325 { │ │ │ │ │ -326 return CompositePreBasis...>(std::forward(childPreBasis)...); │ │ │ │ │ -327 } │ │ │ │ │ -328 │ │ │ │ │ -329public: │ │ │ │ │ -330 │ │ │ │ │ -331 CompositePreBasisFactory(const ChildPreBasisFactory&... │ │ │ │ │ -childPreBasisFactory) : │ │ │ │ │ -332 childPreBasisFactories_(childPreBasisFactory...) │ │ │ │ │ -333 {} │ │ │ │ │ -334 │ │ │ │ │ -335 CompositePreBasisFactory(ChildPreBasisFactory&&... childPreBasisFactory) : │ │ │ │ │ -336 childPreBasisFactories_(std::move(childPreBasisFactory)...) │ │ │ │ │ -337 {} │ │ │ │ │ -338 │ │ │ │ │ -339 template │ │ │ │ │ -340 auto operator()(const GridView& gridView) const │ │ │ │ │ -341 { │ │ │ │ │ -342 // Use std::apply to unpack the tuple childPreBasisFactories_ │ │ │ │ │ -343 return std::apply([&](const auto&... childPreBasisFactory) { │ │ │ │ │ -344 return this->makePreBasisFromChildPreBases(gridView, childPreBasisFactory │ │ │ │ │ -(gridView)...); │ │ │ │ │ -345 }, childPreBasisFactories_); │ │ │ │ │ -346 } │ │ │ │ │ -347 │ │ │ │ │ -348private: │ │ │ │ │ -349 std::tuple childPreBasisFactories_; │ │ │ │ │ -350}; │ │ │ │ │ -351 │ │ │ │ │ -352} // end namespace BasisFactory::Imp │ │ │ │ │ -353 │ │ │ │ │ -354 │ │ │ │ │ -355 │ │ │ │ │ -366template< │ │ │ │ │ -367 typename... Args, │ │ │ │ │ -368 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> │ │ │ │ │ -369auto composite(Args&&... args) │ │ │ │ │ -370{ │ │ │ │ │ -371 // We have to separate the last entry which is the IndexMergingStrategy │ │ │ │ │ -372 // and the preceding ones, which are the ChildPreBasisFactories │ │ │ │ │ -373 │ │ │ │ │ -374 using ArgTuple = std::tuple...>; │ │ │ │ │ -375 │ │ │ │ │ -376 // Compute number of children and index of the IndexMergingStrategy │ │ │ │ │ -argument │ │ │ │ │ -377 constexpr std::size_t children = Dune::SizeOf::value-1; │ │ │ │ │ -378 │ │ │ │ │ -379 // Use last type as IndexMergingStrategy │ │ │ │ │ -380 using IndexMergingStrategy = std::tuple_element_t; │ │ │ │ │ -381 │ │ │ │ │ -382 // Index sequence for all but the last entry for partial tuple unpacking │ │ │ │ │ -383 auto childIndices = std::make_index_sequence{}; │ │ │ │ │ -384 │ │ │ │ │ -385 // Unpack tuple only for those entries related to children │ │ │ │ │ -386 return applyPartial([](auto&&... childPreBasisFactory){ │ │ │ │ │ -387 return Imp::CompositePreBasisFactory...>(std::forward(childPreBasisFactory)...); │ │ │ │ │ -388 }, │ │ │ │ │ -389 std::forward_as_tuple(std::forward(args)...), │ │ │ │ │ -390 childIndices); │ │ │ │ │ -391} │ │ │ │ │ -392 │ │ │ │ │ -404template< │ │ │ │ │ -405 typename... Args, │ │ │ │ │ -406 std::enable_if_t::type>(),int> = 0> │ │ │ │ │ -407auto composite(Args&&... args) │ │ │ │ │ -408{ │ │ │ │ │ -409 return Imp::CompositePreBasisFactory...>(std::forward(args)...); │ │ │ │ │ -410} │ │ │ │ │ -411 │ │ │ │ │ -412} // end namespace BasisFactory │ │ │ │ │ -413 │ │ │ │ │ -414// Backward compatibility │ │ │ │ │ -415namespace BasisBuilder { │ │ │ │ │ -416 │ │ │ │ │ -417 using namespace BasisFactory; │ │ │ │ │ -418 │ │ │ │ │ -419} │ │ │ │ │ -420 │ │ │ │ │ -421 │ │ │ │ │ -422 │ │ │ │ │ -423} // end namespace Functions │ │ │ │ │ -424} // end namespace Dune │ │ │ │ │ -425 │ │ │ │ │ -426 │ │ │ │ │ -427#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH │ │ │ │ │ -_b_a_s_i_s_t_a_g_s_._h_h │ │ │ │ │ -_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h │ │ │ │ │ -_n_o_d_e_s_._h_h │ │ │ │ │ +87 virtual DerivativeInterface _d_e_r_i_v_a_t_i_v_e() const │ │ │ │ │ +88 { │ │ │ │ │ +89 return derivativeIfImplemented(this->get()); │ │ │ │ │ +90 } │ │ │ │ │ +91}; │ │ │ │ │ +92 │ │ │ │ │ +93 │ │ │ │ │ +94 │ │ │ │ │ +95}}} // namespace Dune::Functions::Imp │ │ │ │ │ +96 │ │ │ │ │ +97 │ │ │ │ │ +98 │ │ │ │ │ +99#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH │ │ │ │ │ _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 │ │ │ │ │ -_u_t_i_l_i_t_y_._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 │ │ │ │ │ -typename std::enable_if< std::is_constructible< T, Args... >::value, int >:: │ │ │ │ │ -type enableIfConstructible │ │ │ │ │ -Helper to constrain forwarding constructors. │ │ │ │ │ -DDeeffiinniittiioonn type_traits.hh:26 │ │ │ │ │ +_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:39 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:23 │ │ │ │ │ -_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:80 │ │ │ │ │ -_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:148 │ │ │ │ │ -_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:53 │ │ │ │ │ -_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:249 │ │ │ │ │ -_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:71 │ │ │ │ │ -_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:230 │ │ │ │ │ -_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:242 │ │ │ │ │ -_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:68 │ │ │ │ │ -_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:81 │ │ │ │ │ -_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:165 │ │ │ │ │ -_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:95 │ │ │ │ │ -_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:219 │ │ │ │ │ -_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:115 │ │ │ │ │ -_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:256 │ │ │ │ │ -_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:158 │ │ │ │ │ -_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:65 │ │ │ │ │ -_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:74 │ │ │ │ │ -_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:58 │ │ │ │ │ -_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:148 │ │ │ │ │ -_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:124 │ │ │ │ │ -_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: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_:_:_C_h_i_l_d_I_n_d_i_c_e_s │ │ │ │ │ -std::make_index_sequence< children > ChildIndices │ │ │ │ │ -DDeeffiinniittiioonn compositebasis.hh:76 │ │ │ │ │ -_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:138 │ │ │ │ │ -_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: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_:_:_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:132 │ │ │ │ │ -_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: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_:_:_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:83 │ │ │ │ │ -_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:219 │ │ │ │ │ -_c_o_n_c_e_p_t_s_._h_h │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00068.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: flatmultiindex.hh File Reference │ │ │ │ +dune-functions: reserveddeque.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,43 +65,75 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ +Classes | │ │ │ │ Namespaces | │ │ │ │ -Typedefs
│ │ │ │ -
flatmultiindex.hh File Reference
│ │ │ │ +Macros
│ │ │ │ +
reserveddeque.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <array>
│ │ │ │ -#include <dune/functions/common/multiindex.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::ReservedDeque< T, n >
 A double-ended queue (deque) class with statically reserved memory. 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.
 

│ │ │ │ +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)   {}
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,24 +1,37 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s │ │ │ │ │ -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> │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _M_a_c_r_o_s │ │ │ │ │ +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_:_:_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 │ │ │ │ │   │ │ │ │ │ -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< size_type, 1 > │ │ │ │ │ -  A multi-index class with only one level. │ │ │ │ │ +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 (   X )    {} │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00068_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: flatmultiindex.hh Source File │ │ │ │ +dune-functions: reserveddeque.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,48 +70,281 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
flatmultiindex.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH
│ │ │ │
5
│ │ │ │ -
6#include <array>
│ │ │ │ -
7
│ │ │ │ - │ │ │ │ -
9
│ │ │ │ -
10namespace Dune {
│ │ │ │ -
11namespace Functions {
│ │ │ │ -
12
│ │ │ │ -
13
│ │ │ │ +
10#include <algorithm>
│ │ │ │ +
11#include <iostream>
│ │ │ │ +
12#include <cstddef>
│ │ │ │ +
13#include <initializer_list>
│ │ │ │
14
│ │ │ │ -
30template<class size_type>
│ │ │ │ - │ │ │ │ -
32
│ │ │ │ -
33
│ │ │ │ -
34
│ │ │ │ -
35} // end namespace Functions
│ │ │ │ -
36} // end namespace Dune
│ │ │ │ -
37
│ │ │ │ -
38#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH
│ │ │ │ - │ │ │ │ +
15#include <dune/common/genericiterator.hh>
│ │ │ │ +
16
│ │ │ │ +
17#ifdef CHECK_RESERVEDDEQUE
│ │ │ │ +
18#define CHECKSIZE(X) assert(X)
│ │ │ │ +
19#else
│ │ │ │ +
20#define CHECKSIZE(X) {}
│ │ │ │ +
21#endif
│ │ │ │ +
22
│ │ │ │ +
23namespace Dune {
│ │ │ │ +
24namespace Functions {
│ │ │ │ +
25
│ │ │ │ +
43 template<class T, int n>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
45 {
│ │ │ │ +
46 public:
│ │ │ │ +
47
│ │ │ │ +
51 typedef T value_type;
│ │ │ │ +
53 typedef T* pointer;
│ │ │ │ +
55 typedef T& reference;
│ │ │ │ +
57 typedef const T& const_reference;
│ │ │ │ +
59 typedef size_t size_type;
│ │ │ │ +
61 typedef std::ptrdiff_t difference_type;
│ │ │ │ +
63 typedef Dune::GenericIterator<ReservedDeque, value_type> iterator;
│ │ │ │ +
65 typedef Dune::GenericIterator<const ReservedDeque, const value_type> const_iterator;
│ │ │ │ +
66
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
73 size_(0),
│ │ │ │ +
74 first_(0)
│ │ │ │ +
75 {}
│ │ │ │ +
│ │ │ │ +
76
│ │ │ │ +
│ │ │ │ +
77 ReservedDeque(std::initializer_list<T> const &l)
│ │ │ │ +
78 {
│ │ │ │ +
79 assert(l.size() <= n);// Actually, this is not needed any more!
│ │ │ │ +
80 size_ = l.size();
│ │ │ │ +
81 std::copy_n(l.begin(), size_, data_);
│ │ │ │ +
82 }
│ │ │ │ +
│ │ │ │ +
83
│ │ │ │ +
│ │ │ │ +
89 void clear()
│ │ │ │ +
90 {
│ │ │ │ +
91 first_ = 0;
│ │ │ │ +
92 size_ = 0;
│ │ │ │ +
93 }
│ │ │ │ +
│ │ │ │ +
94
│ │ │ │ +
│ │ │ │ +
96 void resize(size_t s)
│ │ │ │ +
97 {
│ │ │ │ +
98 CHECKSIZE(s<=n);
│ │ │ │ +
99 size_ = s;
│ │ │ │ +
100 }
│ │ │ │ +
│ │ │ │ +
101
│ │ │ │ +
│ │ │ │ +
103 void push_back(const T& t)
│ │ │ │ +
104 {
│ │ │ │ +
105 CHECKSIZE(size_<n);
│ │ │ │ +
106 data_[size_++ % n] = t;
│ │ │ │ +
107 }
│ │ │ │ +
│ │ │ │ +
108
│ │ │ │ +
│ │ │ │ +
110 void push_front(const T& t)
│ │ │ │ +
111 {
│ │ │ │ +
112 CHECKSIZE(size_<n);
│ │ │ │ +
113 ++size_;
│ │ │ │ +
114 first_ = (first_+(n-1)) % n;
│ │ │ │ +
115 data_[first_] = t;
│ │ │ │ +
116 }
│ │ │ │ +
│ │ │ │ +
117
│ │ │ │ +
│ │ │ │ +
119 void pop_back()
│ │ │ │ +
120 {
│ │ │ │ +
121 if (! empty())
│ │ │ │ +
122 size_--;
│ │ │ │ +
123 }
│ │ │ │ +
│ │ │ │ +
124
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
127 {
│ │ │ │ +
128 if (! empty())
│ │ │ │ +
129 {
│ │ │ │ +
130 size_--;
│ │ │ │ +
131 first_ = (++first_) % n;
│ │ │ │ +
132 }
│ │ │ │ +
133 }
│ │ │ │ +
│ │ │ │ +
134
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
137 return iterator(*this, 0);
│ │ │ │ +
138 }
│ │ │ │ +
│ │ │ │ +
139
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
142 return const_iterator(*this, 0);
│ │ │ │ +
143 }
│ │ │ │ +
│ │ │ │ +
144
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
147 return iterator(*this, size_);
│ │ │ │ +
148 }
│ │ │ │ +
│ │ │ │ +
149
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
152 return const_iterator(*this, size_);
│ │ │ │ +
153 }
│ │ │ │ +
│ │ │ │ +
154
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
157 {
│ │ │ │ +
158 CHECKSIZE(size_>i);
│ │ │ │ +
159 return data_[(first_ + i) % n];
│ │ │ │ +
160 }
│ │ │ │ +
│ │ │ │ +
161
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
164 {
│ │ │ │ +
165 CHECKSIZE(size_>i);
│ │ │ │ +
166 return data_[(first_ + i) % n];
│ │ │ │ +
167 }
│ │ │ │ +
│ │ │ │ +
168
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
171 {
│ │ │ │ +
172 CHECKSIZE(size_>0);
│ │ │ │ +
173 return data_[first_];
│ │ │ │ +
174 }
│ │ │ │ +
│ │ │ │ +
175
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
178 {
│ │ │ │ +
179 CHECKSIZE(size_>0);
│ │ │ │ +
180 return data_[first_];
│ │ │ │ +
181 }
│ │ │ │ +
│ │ │ │ +
182
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
185 {
│ │ │ │ +
186 CHECKSIZE(size_>0);
│ │ │ │ +
187 return data_[(first_ + size_-1) % n];
│ │ │ │ +
188 }
│ │ │ │ +
│ │ │ │ +
189
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
192 {
│ │ │ │ +
193 CHECKSIZE(size_>0);
│ │ │ │ +
194 return data_[(first_ + size_-1) % n];
│ │ │ │ +
195 }
│ │ │ │ +
│ │ │ │ +
196
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
203 {
│ │ │ │ +
204 return size_;
│ │ │ │ +
205 }
│ │ │ │ +
│ │ │ │ +
206
│ │ │ │ +
│ │ │ │ +
208 bool empty() const
│ │ │ │ +
209 {
│ │ │ │ +
210 return size_==0;
│ │ │ │ +
211 }
│ │ │ │ +
│ │ │ │ +
212
│ │ │ │ +
│ │ │ │ +
214 static constexpr size_type capacity()
│ │ │ │ +
215 {
│ │ │ │ +
216 return n;
│ │ │ │ +
217 }
│ │ │ │ +
│ │ │ │ +
218
│ │ │ │ +
│ │ │ │ +
220 static constexpr size_type max_size()
│ │ │ │ +
221 {
│ │ │ │ +
222 return n;
│ │ │ │ +
223 }
│ │ │ │ +
│ │ │ │ +
224
│ │ │ │ +
│ │ │ │ +
228 friend std::ostream& operator<< (std::ostream& s, const ReservedDeque& v)
│ │ │ │ +
229 {
│ │ │ │ +
230 for (size_t i=0; i<v.size(); i++)
│ │ │ │ +
231 s << v[i] << " ";
│ │ │ │ +
232 return s;
│ │ │ │ +
233 }
│ │ │ │ +
│ │ │ │ +
234
│ │ │ │ +
235 private:
│ │ │ │ +
236 T data_[n];
│ │ │ │ +
237 size_type first_;
│ │ │ │ +
238 size_type size_;
│ │ │ │ +
239 };
│ │ │ │ +
│ │ │ │ +
240
│ │ │ │ +
241} // end namespace Functions
│ │ │ │ +
242} // end namespace Dune
│ │ │ │ +
243
│ │ │ │ +
244#undef CHECKSIZE
│ │ │ │ +
245
│ │ │ │ +
246#endif // DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH
│ │ │ │ +
#define CHECKSIZE(X)
Definition reserveddeque.hh:20
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
A statically sized MultiIndex type.
Definition multiindex.hh:25
│ │ │ │ -
A statically sized MultiIndex type.
Definition multiindex.hh:49
│ │ │ │ +
A double-ended queue (deque) class with statically reserved memory.
Definition reserveddeque.hh:45
│ │ │ │ +
void pop_front()
Erases the first element of the vector, O(1) time.
Definition reserveddeque.hh:126
│ │ │ │ +
static constexpr size_type capacity()
Returns current capacity (allocated memory) of the vector.
Definition reserveddeque.hh:214
│ │ │ │ +
void clear()
Erases all elements.
Definition reserveddeque.hh:89
│ │ │ │ +
Dune::GenericIterator< ReservedDeque, value_type > iterator
Iterator used to iterate through a vector.
Definition reserveddeque.hh:63
│ │ │ │ +
T value_type
The type of object, T, stored in the vector.
Definition reserveddeque.hh:51
│ │ │ │ +
ReservedDeque()
Constructor.
Definition reserveddeque.hh:72
│ │ │ │ +
bool empty() const
Returns true if vector has no elements.
Definition reserveddeque.hh:208
│ │ │ │ +
const_reference back() const
Returns const reference to last element of vector.
Definition reserveddeque.hh:191
│ │ │ │ +
friend std::ostream & operator<<(std::ostream &s, const ReservedDeque &v)
Send ReservedDeque to an output stream.
Definition reserveddeque.hh:228
│ │ │ │ +
void push_front(const T &t)
Prepends an element to the begin of a deque if size<capacity, O(1) time.
Definition reserveddeque.hh:110
│ │ │ │ +
reference operator[](size_type i)
Returns reference to the i'th element.
Definition reserveddeque.hh:156
│ │ │ │ +
reference front()
Returns reference to first element of vector.
Definition reserveddeque.hh:170
│ │ │ │ +
T * pointer
Pointer to T.
Definition reserveddeque.hh:53
│ │ │ │ +
const_reference front() const
Returns const reference to first element of vector.
Definition reserveddeque.hh:177
│ │ │ │ +
iterator end()
Returns an iterator pointing to the end of the vector.
Definition reserveddeque.hh:146
│ │ │ │ +
reference back()
Returns reference to last element of vector.
Definition reserveddeque.hh:184
│ │ │ │ +
void pop_back()
Erases the last element of the vector, O(1) time.
Definition reserveddeque.hh:119
│ │ │ │ +
const T & const_reference
Const reference to T.
Definition reserveddeque.hh:57
│ │ │ │ +
static constexpr size_type max_size()
Returns the maximum length of the vector.
Definition reserveddeque.hh:220
│ │ │ │ +
std::ptrdiff_t difference_type
A signed integral type.
Definition reserveddeque.hh:61
│ │ │ │ +
T & reference
Reference to T.
Definition reserveddeque.hh:55
│ │ │ │ +
Dune::GenericIterator< const ReservedDeque, const value_type > const_iterator
Const iterator used to iterate through a vector.
Definition reserveddeque.hh:65
│ │ │ │ +
size_type size() const
Returns number of elements in the vector.
Definition reserveddeque.hh:202
│ │ │ │ +
const_iterator end() const
Returns a const_iterator pointing to the end of the vector.
Definition reserveddeque.hh:151
│ │ │ │ +
void resize(size_t s)
Specifies a new size for the vector.
Definition reserveddeque.hh:96
│ │ │ │ +
iterator begin()
Returns a iterator pointing to the beginning of the vector.
Definition reserveddeque.hh:136
│ │ │ │ +
const_iterator begin() const
Returns a const_iterator pointing to the beginning of the vector.
Definition reserveddeque.hh:141
│ │ │ │ +
ReservedDeque(std::initializer_list< T > const &l)
Definition reserveddeque.hh:77
│ │ │ │ +
size_t size_type
An unsigned integral type.
Definition reserveddeque.hh:59
│ │ │ │ +
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:103
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,43 +1,318 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -flatmultiindex.hh │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7 │ │ │ │ │ -8#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> │ │ │ │ │ -9 │ │ │ │ │ -10namespace _D_u_n_e { │ │ │ │ │ -11namespace Functions { │ │ │ │ │ -12 │ │ │ │ │ -13 │ │ │ │ │ +10#include │ │ │ │ │ +11#include │ │ │ │ │ +12#include │ │ │ │ │ +13#include │ │ │ │ │ 14 │ │ │ │ │ -30template │ │ │ │ │ -_3_1using _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_>; │ │ │ │ │ -32 │ │ │ │ │ -33 │ │ │ │ │ -34 │ │ │ │ │ -35} // end namespace Functions │ │ │ │ │ -36} // end namespace Dune │ │ │ │ │ -37 │ │ │ │ │ -38#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH │ │ │ │ │ -_m_u_l_t_i_i_n_d_e_x_._h_h │ │ │ │ │ +15#include │ │ │ │ │ +16 │ │ │ │ │ +17#ifdef CHECK_RESERVEDDEQUE │ │ │ │ │ +18#define CHECKSIZE(X) assert(X) │ │ │ │ │ +19#else │ │ │ │ │ +_2_0#define CHECKSIZE(X) {} │ │ │ │ │ +21#endif │ │ │ │ │ +22 │ │ │ │ │ +23namespace _D_u_n_e { │ │ │ │ │ +24namespace Functions { │ │ │ │ │ +25 │ │ │ │ │ +43 template │ │ │ │ │ +_4_4 class _R_e_s_e_r_v_e_d_D_e_q_u_e │ │ │ │ │ +45 { │ │ │ │ │ +46 public: │ │ │ │ │ +47 │ │ │ │ │ +_5_1 typedef T _v_a_l_u_e___t_y_p_e; │ │ │ │ │ +_5_3 typedef T* _p_o_i_n_t_e_r; │ │ │ │ │ +_5_5 typedef T& _r_e_f_e_r_e_n_c_e; │ │ │ │ │ +_5_7 typedef const T& _c_o_n_s_t___r_e_f_e_r_e_n_c_e; │ │ │ │ │ +_5_9 typedef size_t _s_i_z_e___t_y_p_e; │ │ │ │ │ +_6_1 typedef std::ptrdiff_t _d_i_f_f_e_r_e_n_c_e___t_y_p_e; │ │ │ │ │ +_6_3 typedef Dune::GenericIterator _i_t_e_r_a_t_o_r; │ │ │ │ │ +_6_5 typedef Dune::GenericIterator │ │ │ │ │ +_c_o_n_s_t___i_t_e_r_a_t_o_r; │ │ │ │ │ +66 │ │ │ │ │ +_7_2 _R_e_s_e_r_v_e_d_D_e_q_u_e() : │ │ │ │ │ +73 size_(0), │ │ │ │ │ +74 first_(0) │ │ │ │ │ +75 {} │ │ │ │ │ +76 │ │ │ │ │ +_7_7 _R_e_s_e_r_v_e_d_D_e_q_u_e(std::initializer_list const &l) │ │ │ │ │ +78 { │ │ │ │ │ +79 assert(l.size() <= n);// Actually, this is not needed any more! │ │ │ │ │ +80 size_ = l.size(); │ │ │ │ │ +81 std::copy_n(l.begin(), size_, data_); │ │ │ │ │ +82 } │ │ │ │ │ +83 │ │ │ │ │ +_8_9 void _c_l_e_a_r() │ │ │ │ │ +90 { │ │ │ │ │ +91 first_ = 0; │ │ │ │ │ +92 size_ = 0; │ │ │ │ │ +93 } │ │ │ │ │ +94 │ │ │ │ │ +_9_6 void _r_e_s_i_z_e(size_t s) │ │ │ │ │ +97 { │ │ │ │ │ +98 _C_H_E_C_K_S_I_Z_E(s<=n); │ │ │ │ │ +99 size_ = s; │ │ │ │ │ +100 } │ │ │ │ │ +101 │ │ │ │ │ +_1_0_3 void _p_u_s_h___b_a_c_k(const T& t) │ │ │ │ │ +104 { │ │ │ │ │ +105 _C_H_E_C_K_S_I_Z_E(size_i); │ │ │ │ │ +159 return data_[(first_ + i) % n]; │ │ │ │ │ +160 } │ │ │ │ │ +161 │ │ │ │ │ +_1_6_3 _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 │ │ │ │ │ +164 { │ │ │ │ │ +165 _C_H_E_C_K_S_I_Z_E(size_>i); │ │ │ │ │ +166 return data_[(first_ + i) % n]; │ │ │ │ │ +167 } │ │ │ │ │ +168 │ │ │ │ │ +_1_7_0 _r_e_f_e_r_e_n_c_e _f_r_o_n_t() │ │ │ │ │ +171 { │ │ │ │ │ +172 _C_H_E_C_K_S_I_Z_E(size_>0); │ │ │ │ │ +173 return data_[first_]; │ │ │ │ │ +174 } │ │ │ │ │ +175 │ │ │ │ │ +_1_7_7 _c_o_n_s_t___r_e_f_e_r_e_n_c_e _f_r_o_n_t() const │ │ │ │ │ +178 { │ │ │ │ │ +179 _C_H_E_C_K_S_I_Z_E(size_>0); │ │ │ │ │ +180 return data_[first_]; │ │ │ │ │ +181 } │ │ │ │ │ +182 │ │ │ │ │ +_1_8_4 _r_e_f_e_r_e_n_c_e _b_a_c_k() │ │ │ │ │ +185 { │ │ │ │ │ +186 _C_H_E_C_K_S_I_Z_E(size_>0); │ │ │ │ │ +187 return data_[(first_ + size_-1) % n]; │ │ │ │ │ +188 } │ │ │ │ │ +189 │ │ │ │ │ +_1_9_1 _c_o_n_s_t___r_e_f_e_r_e_n_c_e _b_a_c_k() const │ │ │ │ │ +192 { │ │ │ │ │ +193 _C_H_E_C_K_S_I_Z_E(size_>0); │ │ │ │ │ +194 return data_[(first_ + size_-1) % n]; │ │ │ │ │ +195 } │ │ │ │ │ +196 │ │ │ │ │ +_2_0_2 _s_i_z_e___t_y_p_e _s_i_z_e () const │ │ │ │ │ +203 { │ │ │ │ │ +204 return size_; │ │ │ │ │ +205 } │ │ │ │ │ +206 │ │ │ │ │ +_2_0_8 bool _e_m_p_t_y() const │ │ │ │ │ +209 { │ │ │ │ │ +210 return size_==0; │ │ │ │ │ +211 } │ │ │ │ │ +212 │ │ │ │ │ +_2_1_4 static constexpr _s_i_z_e___t_y_p_e _c_a_p_a_c_i_t_y() │ │ │ │ │ +215 { │ │ │ │ │ +216 return n; │ │ │ │ │ +217 } │ │ │ │ │ +218 │ │ │ │ │ +_2_2_0 static constexpr _s_i_z_e___t_y_p_e _m_a_x___s_i_z_e() │ │ │ │ │ +221 { │ │ │ │ │ +222 return n; │ │ │ │ │ +223 } │ │ │ │ │ +224 │ │ │ │ │ +_2_2_8 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) │ │ │ │ │ +229 { │ │ │ │ │ +230 for (size_t i=0; i │ │ │ │ │ -A statically sized MultiIndex type. │ │ │ │ │ -DDeeffiinniittiioonn multiindex.hh:49 │ │ │ │ │ +_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 │ │ │ │ │ +A double-ended queue (deque) class with statically reserved memory. │ │ │ │ │ +DDeeffiinniittiioonn reserveddeque.hh:45 │ │ │ │ │ +_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:126 │ │ │ │ │ +_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:214 │ │ │ │ │ +_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:89 │ │ │ │ │ +_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: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_:_:_v_a_l_u_e___t_y_p_e │ │ │ │ │ +T value_type │ │ │ │ │ +The type of object, T, stored in the vector. │ │ │ │ │ +DDeeffiinniittiioonn reserveddeque.hh:51 │ │ │ │ │ +_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:72 │ │ │ │ │ +_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:208 │ │ │ │ │ +_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:191 │ │ │ │ │ +_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:228 │ │ │ │ │ +_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:65 │ │ │ │ │ +_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:202 │ │ │ │ │ +_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:151 │ │ │ │ │ +_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:96 │ │ │ │ │ +_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:136 │ │ │ │ │ +_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:141 │ │ │ │ │ +_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:77 │ │ │ │ │ +_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:59 │ │ │ │ │ +_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:103 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00071.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: flatvectorview.hh File Reference │ │ │ │ +dune-functions: interfaces.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,53 +65,40 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Namespaces | │ │ │ │ -Functions
│ │ │ │ -
flatvectorview.hh File Reference
│ │ │ │ +Classes | │ │ │ │ +Namespaces
│ │ │ │ +
interfaces.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>
│ │ │ │
│ │ │ │

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 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.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,35 +1,22 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -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> │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ +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_:_:_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 │ │ │ │ │ -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. │ │ │ │ │ -  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00071_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: flatvectorview.hh Source File │ │ │ │ +dune-functions: interfaces.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,219 +70,64 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
flatvectorview.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_COMMON_INTERFACES_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_COMMON_INTERFACES_HH
│ │ │ │
5
│ │ │ │ -
6
│ │ │ │ -
7#include <array>
│ │ │ │ +
6#include <type_traits>
│ │ │ │ +
7
│ │ │ │
8
│ │ │ │ -
9#include <dune/common/concept.hh>
│ │ │ │ -
10#include <dune/common/hybridutilities.hh>
│ │ │ │ -
11#include <dune/common/indices.hh>
│ │ │ │ +
9namespace Dune {
│ │ │ │ +
10namespace Functions {
│ │ │ │ +
11
│ │ │ │
12
│ │ │ │ - │ │ │ │ -
14
│ │ │ │ -
15
│ │ │ │ -
16
│ │ │ │ -
17
│ │ │ │ -
18namespace Dune {
│ │ │ │ -
19namespace Functions {
│ │ │ │ -
20namespace Impl {
│ │ │ │ -
21
│ │ │ │ -
22
│ │ │ │ -
23template<class V>
│ │ │ │ -
24struct FlatVectorBackend
│ │ │ │ +
13
│ │ │ │ +
23template<class Interface>
│ │ │ │ +
│ │ │ │ + │ │ │ │
25{
│ │ │ │ -
26
│ │ │ │ -
27 template<class VV, class Index,
│ │ │ │ -
28 typename std::enable_if< models<Concept::HasIndexAccess, VV, Index>(), int>::type = 0>
│ │ │ │ -
29 static decltype(auto) getEntry(VV&& v, const Index& i)
│ │ │ │ -
30 {
│ │ │ │ -
31 return v[i];
│ │ │ │ -
32 }
│ │ │ │ -
33
│ │ │ │ -
34 template<class VV, class Index,
│ │ │ │ -
35 typename std::enable_if< not models<Concept::HasIndexAccess, VV, Index>(), int>::type = 0>
│ │ │ │ -
36 static decltype(auto) getEntry(VV&& v, const Index&)
│ │ │ │ -
37 {
│ │ │ │ -
38 return std::forward<VV>(v);
│ │ │ │ -
39 }
│ │ │ │ -
40
│ │ │ │ -
41 template<class VV,
│ │ │ │ -
42 typename std::enable_if< models<Concept::HasSizeMethod, VV>(), int>::type = 0>
│ │ │ │ -
43 static auto size(VV&& v)
│ │ │ │ -
44 {
│ │ │ │ -
45 return Dune::Hybrid::size(v);
│ │ │ │ -
46 }
│ │ │ │ -
47
│ │ │ │ -
48 template<class VV,
│ │ │ │ -
49 typename std::enable_if< not models<Concept::HasSizeMethod, VV>(), int>::type = 0>
│ │ │ │ -
50 static auto size(VV&&)
│ │ │ │ -
51 {
│ │ │ │ -
52 return Dune::index_constant<1>{};
│ │ │ │ -
53 }
│ │ │ │ -
54};
│ │ │ │ -
55
│ │ │ │ -
56
│ │ │ │ -
57
│ │ │ │ -
58
│ │ │ │ -
59template<class K, int n, int m>
│ │ │ │ -
60struct FlatVectorBackend<typename Dune::FieldMatrix<K, n, m> >
│ │ │ │ -
61{
│ │ │ │ -
62
│ │ │ │ -
63 template<class VV, class Index>
│ │ │ │ -
64 static decltype(auto) getEntry(VV&& v, const Index& i)
│ │ │ │ -
65 {
│ │ │ │ -
66 return v[i/m][i%m];
│ │ │ │ -
67 }
│ │ │ │ +
26public:
│ │ │ │ +
27
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
30 {}
│ │ │ │ +
│ │ │ │ +
31
│ │ │ │ +
40 virtual Interface* clone() const = 0;
│ │ │ │ +
41
│ │ │ │ +
51 virtual Interface* clone(void* buffer) const = 0;
│ │ │ │ +
52
│ │ │ │ +
62 virtual Interface* move(void* buffer) = 0;
│ │ │ │ +
63};
│ │ │ │ +
│ │ │ │ +
64
│ │ │ │ +
65
│ │ │ │ +
66
│ │ │ │ +
67}} // namespace Dune::Functions
│ │ │ │
68
│ │ │ │ -
69 template<class VV>
│ │ │ │ -
70 static auto size(VV&& v)
│ │ │ │ -
71 {
│ │ │ │ -
72 return Dune::index_constant<n*m>{};
│ │ │ │ -
73 }
│ │ │ │ -
74};
│ │ │ │ -
75
│ │ │ │ -
76
│ │ │ │ -
77
│ │ │ │ -
78template<class K, std::size_t n>
│ │ │ │ -
79struct FlatVectorBackend< std::array<K, n> >
│ │ │ │ -
80{
│ │ │ │ -
81
│ │ │ │ -
82 template<class VV, class Index>
│ │ │ │ -
83 static decltype(auto) getEntry(VV&& v, const Index& i)
│ │ │ │ -
84 {
│ │ │ │ -
85 const auto innerSize = decltype(FlatVectorBackend<K>::size(v[0]))::value;
│ │ │ │ -
86 return FlatVectorBackend<K>::getEntry(v[i/innerSize], i%innerSize);
│ │ │ │ -
87 }
│ │ │ │ -
88
│ │ │ │ -
89 template<class VV>
│ │ │ │ -
90 static auto size(VV&& v)
│ │ │ │ -
91 {
│ │ │ │ -
92 const auto innerSize = decltype(FlatVectorBackend<K>::size(v[0]))::value;
│ │ │ │ -
93 return Dune::index_constant<n*innerSize>{};
│ │ │ │ -
94 }
│ │ │ │ -
95
│ │ │ │ -
96};
│ │ │ │ -
97
│ │ │ │ -
98
│ │ │ │ -
99
│ │ │ │ -
100
│ │ │ │ -
101template<class T>
│ │ │ │ -
102class FlatVectorView
│ │ │ │ -
103{
│ │ │ │ -
104 using Backend = FlatVectorBackend<std::decay_t<T>>;
│ │ │ │ -
105public:
│ │ │ │ -
106 FlatVectorView(T& t) :
│ │ │ │ -
107 t_(&t)
│ │ │ │ -
108 {}
│ │ │ │ -
109
│ │ │ │ -
110 auto size() const
│ │ │ │ -
111 {
│ │ │ │ -
112 return Backend::size(*t_);
│ │ │ │ -
113 }
│ │ │ │ -
114
│ │ │ │ -
115 template<class Index>
│ │ │ │ -
116 decltype(auto) operator[](const Index& i) const
│ │ │ │ -
117 {
│ │ │ │ -
118 return Backend::getEntry(*t_, i);
│ │ │ │ -
119 }
│ │ │ │ -
120
│ │ │ │ -
121 template<class Index>
│ │ │ │ -
122 decltype(auto) operator[](const Index& i)
│ │ │ │ -
123 {
│ │ │ │ -
124 return Backend::getEntry(*t_, i);
│ │ │ │ -
125 }
│ │ │ │ -
126
│ │ │ │ -
127private:
│ │ │ │ -
128 T* t_;
│ │ │ │ -
129};
│ │ │ │ -
130
│ │ │ │ -
131
│ │ │ │ -
132template<class T>
│ │ │ │ -
133class FlatVectorView<T&&>
│ │ │ │ -
134{
│ │ │ │ -
135 using Backend = FlatVectorBackend<std::decay_t<T>>;
│ │ │ │ -
136public:
│ │ │ │ -
137 FlatVectorView(T&& t) :
│ │ │ │ -
138 t_(std::move(t))
│ │ │ │ -
139 {}
│ │ │ │ -
140
│ │ │ │ -
141 auto size() const
│ │ │ │ -
142 {
│ │ │ │ -
143 return Backend::size(t_);
│ │ │ │ -
144 }
│ │ │ │ -
145
│ │ │ │ -
146 template<class Index>
│ │ │ │ -
147 decltype(auto) operator[](const Index& i) const
│ │ │ │ -
148 {
│ │ │ │ -
149 return Backend::getEntry(t_, i);
│ │ │ │ -
150 }
│ │ │ │ -
151
│ │ │ │ -
152 template<class Index>
│ │ │ │ -
153 decltype(auto) operator[](const Index& i)
│ │ │ │ -
154 {
│ │ │ │ -
155 return Backend::getEntry(t_, i);
│ │ │ │ -
156 }
│ │ │ │ -
157
│ │ │ │ -
158private:
│ │ │ │ -
159 T t_;
│ │ │ │ -
160};
│ │ │ │ -
161
│ │ │ │ -
162} // namespace Impl
│ │ │ │ -
163
│ │ │ │ -
164
│ │ │ │ -
165
│ │ │ │ -
178template<class T>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
180{
│ │ │ │ -
181 return Impl::FlatVectorView<T>(t);
│ │ │ │ -
182}
│ │ │ │ -
│ │ │ │ -
183
│ │ │ │ -
196template<class T>
│ │ │ │ -
│ │ │ │ -
197auto flatVectorView(const T& t)
│ │ │ │ -
198{
│ │ │ │ -
199 return Impl::FlatVectorView<const T>(t);
│ │ │ │ -
200}
│ │ │ │ -
│ │ │ │ -
201
│ │ │ │ -
214template<class T>
│ │ │ │ -
│ │ │ │ -
215auto flatVectorView(T&& t)
│ │ │ │ -
216{
│ │ │ │ -
217 return Impl::FlatVectorView<T&&>(std::move(t));
│ │ │ │ -
218}
│ │ │ │ -
│ │ │ │ -
219
│ │ │ │ -
220
│ │ │ │ -
221} // namespace Dune::Functions
│ │ │ │ -
222} // namespace Dune
│ │ │ │ -
223
│ │ │ │ -
224
│ │ │ │ -
225#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH
│ │ │ │ +
69#endif // DUNE_FUNCTIONS_COMMON_EXTENDED_CLONEABLE_HH
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
auto flatVectorView(T &t)
Create flat vector view of passed mutable container.
Definition flatvectorview.hh:179
│ │ │ │ - │ │ │ │ +
Base class with polymorphic type boiler plate code.
Definition interfaces.hh:25
│ │ │ │ +
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:29
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,211 +1,62 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -flatvectorview.hh │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_COMMON_INTERFACES_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_COMMON_INTERFACES_HH │ │ │ │ │ 5 │ │ │ │ │ -6 │ │ │ │ │ -7#include │ │ │ │ │ +6#include │ │ │ │ │ +7 │ │ │ │ │ 8 │ │ │ │ │ -9#include │ │ │ │ │ -10#include │ │ │ │ │ -11#include │ │ │ │ │ +9namespace _D_u_n_e { │ │ │ │ │ +10namespace Functions { │ │ │ │ │ +11 │ │ │ │ │ 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_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ │ -14 │ │ │ │ │ -15 │ │ │ │ │ -16 │ │ │ │ │ -17 │ │ │ │ │ -18namespace _D_u_n_e { │ │ │ │ │ -19namespace Functions { │ │ │ │ │ -20namespace Impl { │ │ │ │ │ -21 │ │ │ │ │ -22 │ │ │ │ │ -23template │ │ │ │ │ -24struct FlatVectorBackend │ │ │ │ │ +13 │ │ │ │ │ +23template │ │ │ │ │ +_2_4class _P_o_l_y_m_o_r_p_h_i_c_T_y_p_e │ │ │ │ │ 25{ │ │ │ │ │ -26 │ │ │ │ │ -27 template(), │ │ │ │ │ -int>::type = 0> │ │ │ │ │ -29 static decltype(auto) getEntry(VV&& v, const Index& i) │ │ │ │ │ -30 { │ │ │ │ │ -31 return v[i]; │ │ │ │ │ -32 } │ │ │ │ │ -33 │ │ │ │ │ -34 template(), │ │ │ │ │ -int>::type = 0> │ │ │ │ │ -36 static decltype(auto) getEntry(VV&& v, const Index&) │ │ │ │ │ -37 { │ │ │ │ │ -38 return std::forward(v); │ │ │ │ │ -39 } │ │ │ │ │ -40 │ │ │ │ │ -41 template(), int>::type = │ │ │ │ │ -0> │ │ │ │ │ -43 static auto size(VV&& v) │ │ │ │ │ -44 { │ │ │ │ │ -45 return Dune::Hybrid::size(v); │ │ │ │ │ -46 } │ │ │ │ │ -47 │ │ │ │ │ -48 template(), int>:: │ │ │ │ │ -type = 0> │ │ │ │ │ -50 static auto size(VV&&) │ │ │ │ │ -51 { │ │ │ │ │ -52 return Dune::index_constant<1>{}; │ │ │ │ │ -53 } │ │ │ │ │ -54}; │ │ │ │ │ -55 │ │ │ │ │ -56 │ │ │ │ │ -57 │ │ │ │ │ -58 │ │ │ │ │ -59template │ │ │ │ │ -60struct FlatVectorBackend > │ │ │ │ │ -61{ │ │ │ │ │ -62 │ │ │ │ │ -63 template │ │ │ │ │ -64 static decltype(auto) getEntry(VV&& v, const Index& i) │ │ │ │ │ -65 { │ │ │ │ │ -66 return v[i/m][i%m]; │ │ │ │ │ -67 } │ │ │ │ │ +26public: │ │ │ │ │ +27 │ │ │ │ │ +_2_9 virtual _~_P_o_l_y_m_o_r_p_h_i_c_T_y_p_e() │ │ │ │ │ +30 {} │ │ │ │ │ +31 │ │ │ │ │ +_4_0 virtual Interface* _c_l_o_n_e() const = 0; │ │ │ │ │ +41 │ │ │ │ │ +_5_1 virtual Interface* _c_l_o_n_e(void* buffer) const = 0; │ │ │ │ │ +52 │ │ │ │ │ +_6_2 virtual Interface* _m_o_v_e(void* buffer) = 0; │ │ │ │ │ +63}; │ │ │ │ │ +64 │ │ │ │ │ +65 │ │ │ │ │ +66 │ │ │ │ │ +67}} // namespace Dune::Functions │ │ │ │ │ 68 │ │ │ │ │ -69 template │ │ │ │ │ -70 static auto size(VV&& v) │ │ │ │ │ -71 { │ │ │ │ │ -72 return Dune::index_constant{}; │ │ │ │ │ -73 } │ │ │ │ │ -74}; │ │ │ │ │ -75 │ │ │ │ │ -76 │ │ │ │ │ -77 │ │ │ │ │ -78template │ │ │ │ │ -79struct FlatVectorBackend< std::array > │ │ │ │ │ -80{ │ │ │ │ │ -81 │ │ │ │ │ -82 template │ │ │ │ │ -83 static decltype(auto) getEntry(VV&& v, const Index& i) │ │ │ │ │ -84 { │ │ │ │ │ -85 const auto innerSize = decltype(FlatVectorBackend::size(v[0]))::value; │ │ │ │ │ -86 return FlatVectorBackend::getEntry(v[i/innerSize], i%innerSize); │ │ │ │ │ -87 } │ │ │ │ │ -88 │ │ │ │ │ -89 template │ │ │ │ │ -90 static auto size(VV&& v) │ │ │ │ │ -91 { │ │ │ │ │ -92 const auto innerSize = decltype(FlatVectorBackend::size(v[0]))::value; │ │ │ │ │ -93 return Dune::index_constant{}; │ │ │ │ │ -94 } │ │ │ │ │ -95 │ │ │ │ │ -96}; │ │ │ │ │ -97 │ │ │ │ │ -98 │ │ │ │ │ -99 │ │ │ │ │ -100 │ │ │ │ │ -101template │ │ │ │ │ -102class FlatVectorView │ │ │ │ │ -103{ │ │ │ │ │ -104 using Backend = FlatVectorBackend>; │ │ │ │ │ -105public: │ │ │ │ │ -106 FlatVectorView(T& t) : │ │ │ │ │ -107 t_(&t) │ │ │ │ │ -108 {} │ │ │ │ │ -109 │ │ │ │ │ -110 auto size() const │ │ │ │ │ -111 { │ │ │ │ │ -112 return Backend::size(*t_); │ │ │ │ │ -113 } │ │ │ │ │ -114 │ │ │ │ │ -115 template │ │ │ │ │ -116 decltype(auto) operator[](const Index& i) const │ │ │ │ │ -117 { │ │ │ │ │ -118 return Backend::getEntry(*t_, i); │ │ │ │ │ -119 } │ │ │ │ │ -120 │ │ │ │ │ -121 template │ │ │ │ │ -122 decltype(auto) operator[](const Index& i) │ │ │ │ │ -123 { │ │ │ │ │ -124 return Backend::getEntry(*t_, i); │ │ │ │ │ -125 } │ │ │ │ │ -126 │ │ │ │ │ -127private: │ │ │ │ │ -128 T* t_; │ │ │ │ │ -129}; │ │ │ │ │ -130 │ │ │ │ │ -131 │ │ │ │ │ -132template │ │ │ │ │ -133class FlatVectorView │ │ │ │ │ -134{ │ │ │ │ │ -135 using Backend = FlatVectorBackend>; │ │ │ │ │ -136public: │ │ │ │ │ -137 FlatVectorView(T&& t) : │ │ │ │ │ -138 t_(std::move(t)) │ │ │ │ │ -139 {} │ │ │ │ │ -140 │ │ │ │ │ -141 auto size() const │ │ │ │ │ -142 { │ │ │ │ │ -143 return Backend::size(t_); │ │ │ │ │ -144 } │ │ │ │ │ -145 │ │ │ │ │ -146 template │ │ │ │ │ -147 decltype(auto) operator[](const Index& i) const │ │ │ │ │ -148 { │ │ │ │ │ -149 return Backend::getEntry(t_, i); │ │ │ │ │ -150 } │ │ │ │ │ -151 │ │ │ │ │ -152 template │ │ │ │ │ -153 decltype(auto) operator[](const Index& i) │ │ │ │ │ -154 { │ │ │ │ │ -155 return Backend::getEntry(t_, i); │ │ │ │ │ -156 } │ │ │ │ │ -157 │ │ │ │ │ -158private: │ │ │ │ │ -159 T t_; │ │ │ │ │ -160}; │ │ │ │ │ -161 │ │ │ │ │ -162} // namespace Impl │ │ │ │ │ -163 │ │ │ │ │ -164 │ │ │ │ │ -165 │ │ │ │ │ -178template │ │ │ │ │ -_1_7_9auto _f_l_a_t_V_e_c_t_o_r_V_i_e_w(T& t) │ │ │ │ │ -180{ │ │ │ │ │ -181 return Impl::FlatVectorView(t); │ │ │ │ │ -182} │ │ │ │ │ -183 │ │ │ │ │ -196template │ │ │ │ │ -_1_9_7auto _f_l_a_t_V_e_c_t_o_r_V_i_e_w(const T& t) │ │ │ │ │ -198{ │ │ │ │ │ -199 return Impl::FlatVectorView(t); │ │ │ │ │ -200} │ │ │ │ │ -201 │ │ │ │ │ -214template │ │ │ │ │ -_2_1_5auto _f_l_a_t_V_e_c_t_o_r_V_i_e_w(T&& t) │ │ │ │ │ -216{ │ │ │ │ │ -217 return Impl::FlatVectorView(std::move(t)); │ │ │ │ │ -218} │ │ │ │ │ -219 │ │ │ │ │ -220 │ │ │ │ │ -221} // namespace Dune::Functions │ │ │ │ │ -222} // namespace Dune │ │ │ │ │ -223 │ │ │ │ │ -224 │ │ │ │ │ -225#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH │ │ │ │ │ +69#endif // DUNE_FUNCTIONS_COMMON_EXTENDED_CLONEABLE_HH │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:179 │ │ │ │ │ -_c_o_n_c_e_p_t_s_._h_h │ │ │ │ │ +_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:25 │ │ │ │ │ +_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:29 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00074.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: basistags.hh File Reference │ │ │ │ +dune-functions: treedata.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,85 +65,53 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces | │ │ │ │ -Functions
│ │ │ │ -
basistags.hh File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
treedata.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <type_traits>
│ │ │ │ -#include <dune/common/concept.hh>
│ │ │ │ +
#include <memory>
│ │ │ │ +#include <dune/common/shared_ptr.hh>
│ │ │ │ +#include <dune/typetree/pairtraversal.hh>
│ │ │ │ +#include <dune/functions/gridfunctions/gridviewentityset.hh>
│ │ │ │ +#include <dune/functions/gridfunctions/gridfunction.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

struct  Dune::Functions::Concept::IndexMergingStrategy
struct  Dune::Functions::UniformNodeVisitor< SimpleNodeVisitorImp, leafOnly >
 Mixin for visitors that should apply the same action on all nodes. More...
 
struct  Dune::Functions::BasisFactory::IndexMergingStrategy
 Base class for index merging strategies to simplify detection. More...
class  Dune::Functions::TreeData< T, ND, LO >
 Container allowing to attach data to each node of a tree. More...
 
struct  Dune::Functions::BasisFactory::FlatLexicographic
 Lexicographic merging of direct children without blocking. More...
struct  Dune::Functions::TreeData< T, ND, LO >::InitVisitor
 
struct  Dune::Functions::BasisFactory::FlatInterleaved
 Interleaved merging of direct children without blocking. More...
struct  Dune::Functions::TreeData< T, ND, LO >::DestroyVisitor
 
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...
struct  Dune::Functions::TreeData< T, ND, LO >::CopyVisitor
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::Functions
 
namespace  Dune::Functions::Concept
 
namespace  Dune::Functions::BasisFactory
 
namespace  Dune::Functions::BasisBuilder
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ -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,80 +1,36 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -basistags.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ +treedata.hh File Reference │ │ │ │ │ +#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_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> │ │ │ │ │ _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_:_:_U_n_i_f_o_r_m_N_o_d_e_V_i_s_i_t_o_r_<_ _S_i_m_p_l_e_N_o_d_e_V_i_s_i_t_o_r_I_m_p_,_ _l_e_a_f_O_n_l_y_ _> │ │ │ │ │ +  Mixin for visitors that should apply the same action on all nodes. │ │ │ │ │ + _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_:_:_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_._._. │ │ │ │ │ + class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_<_ _T_,_ _N_D_,_ _L_O_ _> │ │ │ │ │ +  Container allowing to attach data to each node of a tree. _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_:_:_T_r_e_e_D_a_t_a_<_ _T_,_ _N_D_,_ _L_O_ _>_:_:_I_n_i_t_V_i_s_i_t_o_r │ │ │ │ │   │ │ │ │ │ -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_:_:_T_r_e_e_D_a_t_a_<_ _T_,_ _N_D_,_ _L_O_ _>_:_:_D_e_s_t_r_o_y_V_i_s_i_t_o_r │ │ │ │ │   │ │ │ │ │ -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_._._. │ │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_<_ _T_,_ _N_D_,_ _L_O_ _>_:_:_C_o_p_y_V_i_s_i_t_o_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 │ │ │ │ │ -  │ │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_B_u_i_l_d_e_r │ │ │ │ │ -  │ │ │ │ │ -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). │ │ │ │ │ -  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00074_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: basistags.hh Source File │ │ │ │ +dune-functions: treedata.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,150 +70,304 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
basistags.hh
│ │ │ │ +
treedata.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_COMMON_TREEDATA_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_COMMON_TREEDATA_HH
│ │ │ │
5
│ │ │ │ -
6#include <type_traits>
│ │ │ │ -
7#include <dune/common/concept.hh>
│ │ │ │ +
6
│ │ │ │ +
7#warning This file is deprecated. Please use TreeContainer from dune-typetree instead.
│ │ │ │
8
│ │ │ │ -
9namespace Dune {
│ │ │ │ -
10namespace Functions {
│ │ │ │ -
11
│ │ │ │ -
12 namespace Concept {
│ │ │ │ -
13
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
15 {
│ │ │ │ -
16 template<typename T>
│ │ │ │ -
17 auto require(T&& t) -> decltype(
│ │ │ │ -
18 registerIndexMergingStrategy(t)
│ │ │ │ -
19 );
│ │ │ │ -
20 };
│ │ │ │ -
│ │ │ │ -
21
│ │ │ │ -
22 template<typename T>
│ │ │ │ -
│ │ │ │ -
23 static constexpr bool isIndexMergingStrategy()
│ │ │ │ -
24 {
│ │ │ │ -
25 return models<Concept::IndexMergingStrategy,T>();
│ │ │ │ -
26 }
│ │ │ │ -
│ │ │ │ -
27
│ │ │ │ -
28 template<typename T>
│ │ │ │ -
│ │ │ │ -
29 static constexpr bool isIndexMergingStrategy(T&& t)
│ │ │ │ -
30 {
│ │ │ │ -
31 return models<Concept::IndexMergingStrategy,std::decay_t<T>>();
│ │ │ │ -
32 }
│ │ │ │ -
│ │ │ │ -
33
│ │ │ │ -
34 } // namespace Concept
│ │ │ │ -
35
│ │ │ │ -
36
│ │ │ │ -
│ │ │ │ -
37namespace BasisFactory {
│ │ │ │ -
38
│ │ │ │ - │ │ │ │ -
45
│ │ │ │ - │ │ │ │ -
47
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ -
80 {};
│ │ │ │ -
│ │ │ │ -
81
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
113 : public IndexMergingStrategy
│ │ │ │ -
114 {};
│ │ │ │ -
│ │ │ │ +
9#include <memory>
│ │ │ │ +
10
│ │ │ │ +
11#include <dune/common/shared_ptr.hh>
│ │ │ │ +
12
│ │ │ │ +
13#include <dune/typetree/pairtraversal.hh>
│ │ │ │ +
14
│ │ │ │ + │ │ │ │ + │ │ │ │ +
17
│ │ │ │ +
18namespace Dune {
│ │ │ │ +
19namespace Functions {
│ │ │ │ +
20
│ │ │ │ +
34template<class SimpleNodeVisitorImp, bool leafOnly>
│ │ │ │ +
│ │ │ │ +
35struct
│ │ │ │ +
36[[deprecated("This is an implementation detail of the deprecated class TreeDate and thus deprecated itself.")]]
│ │ │ │ + │ │ │ │ +
38 public TypeTree::TreeVisitor,
│ │ │ │ +
39 public TypeTree::DynamicTraversal
│ │ │ │ +
40{
│ │ │ │ +
41 // This is only enabled, if we want to incorporate inner nodes.
│ │ │ │ +
42 // Checking leafOnly would be sufficient, but for SFINAE the
│ │ │ │ +
43 // the enable_if condition must depend on the template parameter.
│ │ │ │ +
44 template<typename Node, typename TreePath,
│ │ │ │ +
45 typename std::enable_if<(not leafOnly) and (not Node::isLeaf), int>::type = 0>
│ │ │ │ +
│ │ │ │ +
46 void pre(Node& node, TreePath treePath)
│ │ │ │ +
47 {
│ │ │ │ +
48 static_cast<SimpleNodeVisitorImp*>(this)->apply(node, treePath);
│ │ │ │ +
49 }
│ │ │ │ +
│ │ │ │ +
50
│ │ │ │ +
51 template<typename Node, typename TreePath,
│ │ │ │ +
52 typename std::enable_if<(leafOnly) and (not Node::isLeaf), int>::type = 0>
│ │ │ │ +
│ │ │ │ +
53 void pre(Node& node, TreePath treePath)
│ │ │ │ +
54 {}
│ │ │ │ +
│ │ │ │ +
55
│ │ │ │ +
56 template<typename Node, typename TreePath>
│ │ │ │ +
│ │ │ │ +
57 void leaf(Node& node, TreePath treePath)
│ │ │ │ +
58 {
│ │ │ │ +
59 static_cast<SimpleNodeVisitorImp*>(this)->apply(node, treePath);
│ │ │ │ +
60 }
│ │ │ │ +
│ │ │ │ +
61};
│ │ │ │ +
│ │ │ │ +
62
│ │ │ │ +
63
│ │ │ │ +
64
│ │ │ │ +
91template<class T, template<class> class ND, bool LO>
│ │ │ │ +
│ │ │ │ +
92class
│ │ │ │ +
93[[deprecated("This class is deprecated. Please use TreeContainer from dune-typetree instead.")]]
│ │ │ │ + │ │ │ │ +
95{
│ │ │ │ +
96
│ │ │ │ +
97public:
│ │ │ │ +
98
│ │ │ │ +
100 using Tree = T;
│ │ │ │ +
101
│ │ │ │ +
103 using size_type = typename Tree::size_type;
│ │ │ │ +
104
│ │ │ │ +
106 static const bool leafOnly = LO;
│ │ │ │ +
107
│ │ │ │ +
109 template<class Node>
│ │ │ │ +
110 using NodeData = ND<Node>;
│ │ │ │ +
111
│ │ │ │ +
112protected:
│ │ │ │ +
113 using RawContainer = std::vector<void*>;
│ │ │ │ +
114
│ │ │ │
115
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
147 : public IndexMergingStrategy
│ │ │ │ -
148 {};
│ │ │ │ +
116 // Since we can generate the node data type only if
│ │ │ │ +
117 // we know the type of the node, we have to do
│ │ │ │ +
118 // initialization, copy, and destruction via a
│ │ │ │ +
119 // tree traversal. Once we can use C++14 this can
│ │ │ │ +
120 // be written in a much easier and more selfcontained
│ │ │ │ +
121 // ways using generic lambda functions.
│ │ │ │ +
122 // Until then we need explicit visitor classes for
│ │ │ │ +
123 // each operation.
│ │ │ │ +
124
│ │ │ │ +
│ │ │ │ +
125 struct InitVisitor :
│ │ │ │ +
126 public UniformNodeVisitor<InitVisitor, leafOnly>
│ │ │ │ +
127 {
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
129 data_(data)
│ │ │ │ +
130 {}
│ │ │ │ +
│ │ │ │ +
131
│ │ │ │ +
132 template<typename Node, typename TreePath>
│ │ │ │ +
│ │ │ │ +
133 void apply(Node& node, TreePath treePath)
│ │ │ │ +
134 {
│ │ │ │ +
135 auto&& index = node.treeIndex();
│ │ │ │ +
136 if (data_.size() < index+1)
│ │ │ │ +
137 data_.resize(index+1, nullptr);
│ │ │ │ +
138 data_[index] = new NodeData<Node>;
│ │ │ │ +
139 }
│ │ │ │ +
│ │ │ │ +
140
│ │ │ │ +
141
│ │ │ │ + │ │ │ │ +
143 };
│ │ │ │ +
│ │ │ │ +
144
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
146 public UniformNodeVisitor<DestroyVisitor, leafOnly>
│ │ │ │ +
147 {
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
149 data_(data)
│ │ │ │ +
150 {}
│ │ │ │ +
│ │ │ │ +
151
│ │ │ │ +
152 template<typename Node, typename TreePath>
│ │ │ │ +
│ │ │ │ +
153 void apply(Node& node, TreePath treePath)
│ │ │ │ +
154 {
│ │ │ │ +
155 auto&& index = node.treeIndex();
│ │ │ │ +
156 auto p = (NodeData<Node>*)(data_[index]);
│ │ │ │ +
157 delete p;
│ │ │ │ +
158 data_[index] = nullptr;
│ │ │ │ +
159 }
│ │ │ │ +
│ │ │ │ +
160
│ │ │ │ + │ │ │ │ +
162 };
│ │ │ │ +
│ │ │ │ +
163
│ │ │ │ +
│ │ │ │ +
164 struct CopyVisitor :
│ │ │ │ +
165 public UniformNodeVisitor<CopyVisitor, leafOnly>
│ │ │ │ +
166 {
│ │ │ │ +
│ │ │ │ +
167 CopyVisitor(TreeData& thisTD, const TreeData& otherTD) :
│ │ │ │ +
168 thisTD_(thisTD),
│ │ │ │ +
169 otherTD_(otherTD)
│ │ │ │ +
170 {}
│ │ │ │ +
│ │ │ │ +
171
│ │ │ │ +
172 template<typename Node, typename TreePath>
│ │ │ │ +
│ │ │ │ +
173 void apply(Node& node, TreePath treePath)
│ │ │ │ +
174 {
│ │ │ │ +
175 thisTD_[node] = otherTD_[node];
│ │ │ │ +
176 }
│ │ │ │ +
│ │ │ │ +
177
│ │ │ │ + │ │ │ │ + │ │ │ │ +
180 };
│ │ │ │
│ │ │ │ -
149
│ │ │ │ - │ │ │ │
181
│ │ │ │ -
182
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
189 {
│ │ │ │ -
190 return {};
│ │ │ │ -
191 }
│ │ │ │ -
│ │ │ │ -
192
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
199 {
│ │ │ │ -
200 return {};
│ │ │ │ -
201 }
│ │ │ │ -
│ │ │ │ -
202
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
209 {
│ │ │ │ -
210 return {};
│ │ │ │ -
211 }
│ │ │ │ -
│ │ │ │ -
212
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
219 {
│ │ │ │ -
220 return {};
│ │ │ │ -
221 }
│ │ │ │ -
│ │ │ │ -
222
│ │ │ │ -
223} // end namespace BasisFactory
│ │ │ │ -
│ │ │ │ -
224
│ │ │ │ -
225// Backward compatibility
│ │ │ │ -
│ │ │ │ -
226namespace BasisBuilder {
│ │ │ │ -
227
│ │ │ │ -
228 using namespace BasisFactory;
│ │ │ │ -
229
│ │ │ │ -
230}
│ │ │ │ +
182public:
│ │ │ │ +
183
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
186 tree_(nullptr)
│ │ │ │ +
187 {}
│ │ │ │ +
│ │ │ │ +
188
│ │ │ │ +
│ │ │ │ +
196 void init(const Tree& tree)
│ │ │ │ +
197 {
│ │ │ │ +
198 if (tree_)
│ │ │ │ +
199 destroy();
│ │ │ │ +
200 tree_ = &tree;
│ │ │ │ +
201 TypeTree::applyToTree(*tree_, InitVisitor(data_));
│ │ │ │ +
202 }
│ │ │ │ +
│ │ │ │ +
203
│ │ │ │ +
│ │ │ │ +
205 TreeData(const TreeData& other) :
│ │ │ │ +
206 tree_(other.tree_)
│ │ │ │ +
207 {
│ │ │ │ +
208 TypeTree::applyToTree(*tree_, InitVisitor(data_));
│ │ │ │ +
209 TypeTree::applyToTree(*tree_, CopyVisitor(*this, other));
│ │ │ │ +
210 }
│ │ │ │ +
│ │ │ │ +
211
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
214 {
│ │ │ │ +
215 if (tree_)
│ │ │ │ +
216 TypeTree::applyToTree(*tree_, DestroyVisitor(data_));
│ │ │ │ +
217 tree_ = other.tree_;
│ │ │ │ +
218 TypeTree::applyToTree(*tree_, CopyVisitor(*this, other));
│ │ │ │ +
219 return *this;
│ │ │ │ +
220 }
│ │ │ │ +
│ │ │ │ +
221
│ │ │ │ +
│ │ │ │ +
223 void destroy()
│ │ │ │ +
224 {
│ │ │ │ +
225 if (tree_)
│ │ │ │ +
226 TypeTree::applyToTree(*tree_, DestroyVisitor(data_));
│ │ │ │ +
227 tree_ = nullptr;
│ │ │ │ +
228 }
│ │ │ │
│ │ │ │ -
231
│ │ │ │ -
232} // end namespace Functions
│ │ │ │ -
233} // end namespace Dune
│ │ │ │ -
234
│ │ │ │ -
235
│ │ │ │ -
236#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH
│ │ │ │ -
constexpr FlatLexicographic flatLexicographic()
Creates a lexicographic merging of direct children without blocking.
Definition basistags.hh:188
│ │ │ │ -
constexpr BlockedInterleaved blockedInterleaved()
Creates an interleaved merging of direct children with blocking (i.e. creating blocks at the leaves c...
Definition basistags.hh:218
│ │ │ │ -
constexpr FlatInterleaved flatInterleaved()
Creates an interleaved merging of direct children without blocking.
Definition basistags.hh:198
│ │ │ │ -
constexpr BlockedLexicographic blockedLexicographic()
Creates a lexicographic merging of direct children with blocking (i.e. creating one block per direct ...
Definition basistags.hh:208
│ │ │ │ +
229
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
232 {
│ │ │ │ +
233 if (tree_)
│ │ │ │ +
234 TypeTree::applyToTree(*tree_, DestroyVisitor(data_));
│ │ │ │ +
235 }
│ │ │ │ +
│ │ │ │ +
236
│ │ │ │ +
238 template<class Node>
│ │ │ │ +
│ │ │ │ +
239 NodeData<Node>& operator[](const Node& node)
│ │ │ │ +
240 {
│ │ │ │ +
241 return *(NodeData<Node>*)(data_[node.treeIndex()]);
│ │ │ │ +
242 }
│ │ │ │ +
│ │ │ │ +
243
│ │ │ │ +
245 template<class Node>
│ │ │ │ +
│ │ │ │ +
246 const NodeData<Node>& operator[](const Node& node) const
│ │ │ │ +
247 {
│ │ │ │ +
248 return *(NodeData<Node>*)(data_[node.treeIndex()]);
│ │ │ │ +
249 }
│ │ │ │ +
│ │ │ │ +
250
│ │ │ │ +
251protected:
│ │ │ │ +
252
│ │ │ │ +
253 const Tree* tree_;
│ │ │ │ + │ │ │ │ +
255};
│ │ │ │ +
│ │ │ │ +
256
│ │ │ │ +
257
│ │ │ │ +
258
│ │ │ │ +
259} // namespace Functions
│ │ │ │ +
260} // namespace Dune
│ │ │ │ +
261
│ │ │ │ +
262#endif // DUNE_FUNCTIONS_COMMON_TREEDATA_HH
│ │ │ │ + │ │ │ │ + │ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
static constexpr bool isIndexMergingStrategy()
Definition basistags.hh:23
│ │ │ │ -
void registerIndexMergingStrategy(IndexMergingStrategy)
│ │ │ │ - │ │ │ │ -
auto require(T &&t) -> decltype(registerIndexMergingStrategy(t))
│ │ │ │ -
Base class for index merging strategies to simplify detection.
Definition basistags.hh:44
│ │ │ │ -
Lexicographic merging of direct children without blocking.
Definition basistags.hh:80
│ │ │ │ -
Interleaved merging of direct children without blocking.
Definition basistags.hh:114
│ │ │ │ -
Lexicographic merging of direct children with blocking (i.e. creating one block per direct child).
Definition basistags.hh:148
│ │ │ │ -
Interleaved merging of direct children with blocking (i.e. creating blocks at the leaves containing o...
Definition basistags.hh:180
│ │ │ │ +
Mixin for visitors that should apply the same action on all nodes.
Definition treedata.hh:40
│ │ │ │ +
void pre(Node &node, TreePath treePath)
Definition treedata.hh:46
│ │ │ │ +
void leaf(Node &node, TreePath treePath)
Definition treedata.hh:57
│ │ │ │ +
Container allowing to attach data to each node of a tree.
Definition treedata.hh:95
│ │ │ │ +
TreeData(const TreeData &other)
Copy constructor.
Definition treedata.hh:205
│ │ │ │ +
void init(const Tree &tree)
Initialize from tree.
Definition treedata.hh:196
│ │ │ │ +
T Tree
Type of tree the data is associated with.
Definition treedata.hh:100
│ │ │ │ +
const Tree * tree_
Definition treedata.hh:253
│ │ │ │ +
void destroy()
Destroy data.
Definition treedata.hh:223
│ │ │ │ +
const NodeData< Node > & operator[](const Node &node) const
Get reference to data associated to given node.
Definition treedata.hh:246
│ │ │ │ +
TreeData & operator=(const TreeData &other)
Copy assignment.
Definition treedata.hh:213
│ │ │ │ +
~TreeData()
Destructor.
Definition treedata.hh:231
│ │ │ │ +
ND< Node > NodeData
Template to determine the data type for given node type.
Definition treedata.hh:110
│ │ │ │ +
TreeData()
Default constructor.
Definition treedata.hh:185
│ │ │ │ +
std::vector< void * > RawContainer
Definition treedata.hh:113
│ │ │ │ +
NodeData< Node > & operator[](const Node &node)
Get mutable reference to data associated to given node.
Definition treedata.hh:239
│ │ │ │ +
typename Tree::size_type size_type
Type used for indices and size information.
Definition treedata.hh:103
│ │ │ │ +
RawContainer data_
Definition treedata.hh:254
│ │ │ │ +
Definition treedata.hh:127
│ │ │ │ +
InitVisitor(RawContainer &data)
Definition treedata.hh:128
│ │ │ │ +
void apply(Node &node, TreePath treePath)
Definition treedata.hh:133
│ │ │ │ +
RawContainer & data_
Definition treedata.hh:142
│ │ │ │ + │ │ │ │ +
RawContainer & data_
Definition treedata.hh:161
│ │ │ │ +
DestroyVisitor(RawContainer &data)
Definition treedata.hh:148
│ │ │ │ +
void apply(Node &node, TreePath treePath)
Definition treedata.hh:153
│ │ │ │ +
Definition treedata.hh:166
│ │ │ │ +
CopyVisitor(TreeData &thisTD, const TreeData &otherTD)
Definition treedata.hh:167
│ │ │ │ +
void apply(Node &node, TreePath treePath)
Definition treedata.hh:173
│ │ │ │ +
TreeData & thisTD_
Definition treedata.hh:178
│ │ │ │ +
const TreeData & otherTD_
Definition treedata.hh:179
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,148 +1,325 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -basistags.hh │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +treedata.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_COMMON_TREEDATA_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_COMMON_TREEDATA_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ +6 │ │ │ │ │ +7#warning This file is deprecated. Please use TreeContainer from dune-typetree │ │ │ │ │ +instead. │ │ │ │ │ 8 │ │ │ │ │ -9namespace _D_u_n_e { │ │ │ │ │ -10namespace Functions { │ │ │ │ │ -11 │ │ │ │ │ -12 namespace Concept { │ │ │ │ │ -13 │ │ │ │ │ -_1_4 struct _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ │ -15 { │ │ │ │ │ -16 template │ │ │ │ │ -_1_7 auto _r_e_q_u_i_r_e(T&& t) -> decltype( │ │ │ │ │ -18 registerIndexMergingStrategy(t) │ │ │ │ │ -19 ); │ │ │ │ │ -20 }; │ │ │ │ │ -21 │ │ │ │ │ -22 template │ │ │ │ │ -_2_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() │ │ │ │ │ -24 { │ │ │ │ │ -25 return models(); │ │ │ │ │ -26 } │ │ │ │ │ -27 │ │ │ │ │ -28 template │ │ │ │ │ -_2_9 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) │ │ │ │ │ -30 { │ │ │ │ │ -31 return models>(); │ │ │ │ │ -32 } │ │ │ │ │ -33 │ │ │ │ │ -34 } // namespace Concept │ │ │ │ │ -35 │ │ │ │ │ -36 │ │ │ │ │ -_3_7namespace BasisFactory { │ │ │ │ │ -38 │ │ │ │ │ -_4_4 struct _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y {}; │ │ │ │ │ -45 │ │ │ │ │ -_4_6 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); │ │ │ │ │ -47 │ │ │ │ │ -_7_8 struct _F_l_a_t_L_e_x_i_c_o_g_r_a_p_h_i_c │ │ │ │ │ -79 : public _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ │ -80 {}; │ │ │ │ │ -81 │ │ │ │ │ -_1_1_2 struct _F_l_a_t_I_n_t_e_r_l_e_a_v_e_d │ │ │ │ │ -113 : public _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ │ -114 {}; │ │ │ │ │ +9#include │ │ │ │ │ +10 │ │ │ │ │ +11#include │ │ │ │ │ +12 │ │ │ │ │ +13#include │ │ │ │ │ +14 │ │ │ │ │ +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_/_g_r_i_d_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ │ +17 │ │ │ │ │ +18namespace _D_u_n_e { │ │ │ │ │ +19namespace Functions { │ │ │ │ │ +20 │ │ │ │ │ +34template │ │ │ │ │ +_3_5struct │ │ │ │ │ +36[[deprecated("This is an implementation detail of the deprecated class │ │ │ │ │ +TreeDate and thus deprecated itself.")]] │ │ │ │ │ +37_U_n_i_f_o_r_m_N_o_d_e_V_i_s_i_t_o_r : │ │ │ │ │ +38 public TypeTree::TreeVisitor, │ │ │ │ │ +39 public TypeTree::DynamicTraversal │ │ │ │ │ +40{ │ │ │ │ │ +41 // This is only enabled, if we want to incorporate inner nodes. │ │ │ │ │ +42 // Checking leafOnly would be sufficient, but for SFINAE the │ │ │ │ │ +43 // the enable_if condition must depend on the template parameter. │ │ │ │ │ +44 template::type = │ │ │ │ │ +0> │ │ │ │ │ +_4_6 void _p_r_e(Node& node, TreePath treePath) │ │ │ │ │ +47 { │ │ │ │ │ +48 static_cast(this)->apply(node, treePath); │ │ │ │ │ +49 } │ │ │ │ │ +50 │ │ │ │ │ +51 template::type = 0> │ │ │ │ │ +_5_3 void _p_r_e(Node& node, TreePath treePath) │ │ │ │ │ +54 {} │ │ │ │ │ +55 │ │ │ │ │ +56 template │ │ │ │ │ +_5_7 void _l_e_a_f(Node& node, TreePath treePath) │ │ │ │ │ +58 { │ │ │ │ │ +59 static_cast(this)->apply(node, treePath); │ │ │ │ │ +60 } │ │ │ │ │ +61}; │ │ │ │ │ +62 │ │ │ │ │ +63 │ │ │ │ │ +64 │ │ │ │ │ +91template class ND, bool LO> │ │ │ │ │ +_9_2class │ │ │ │ │ +93[[deprecated("This class is deprecated. Please use TreeContainer from dune- │ │ │ │ │ +typetree instead.")]] │ │ │ │ │ +94_T_r_e_e_D_a_t_a │ │ │ │ │ +95{ │ │ │ │ │ +96 │ │ │ │ │ +97public: │ │ │ │ │ +98 │ │ │ │ │ +_1_0_0 using _T_r_e_e = T; │ │ │ │ │ +101 │ │ │ │ │ +_1_0_3 using _s_i_z_e___t_y_p_e = typename Tree::size_type; │ │ │ │ │ +104 │ │ │ │ │ +_1_0_6 static const bool leafOnly = LO; │ │ │ │ │ +107 │ │ │ │ │ +109 template │ │ │ │ │ +_1_1_0 using _N_o_d_e_D_a_t_a = ND; │ │ │ │ │ +111 │ │ │ │ │ +112protected: │ │ │ │ │ +_1_1_3 using _R_a_w_C_o_n_t_a_i_n_e_r = std::vector; │ │ │ │ │ +114 │ │ │ │ │ 115 │ │ │ │ │ -_1_4_6 struct _B_l_o_c_k_e_d_L_e_x_i_c_o_g_r_a_p_h_i_c │ │ │ │ │ -147 : public _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ │ -148 {}; │ │ │ │ │ -149 │ │ │ │ │ -_1_8_0 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 {}; │ │ │ │ │ +116 // Since we can generate the node data type only if │ │ │ │ │ +117 // we know the type of the node, we have to do │ │ │ │ │ +118 // initialization, copy, and destruction via a │ │ │ │ │ +119 // tree traversal. Once we can use C++14 this can │ │ │ │ │ +120 // be written in a much easier and more selfcontained │ │ │ │ │ +121 // ways using generic lambda functions. │ │ │ │ │ +122 // Until then we need explicit visitor classes for │ │ │ │ │ +123 // each operation. │ │ │ │ │ +124 │ │ │ │ │ +_1_2_5 struct _I_n_i_t_V_i_s_i_t_o_r : │ │ │ │ │ +126 public _U_n_i_f_o_r_m_N_o_d_e_V_i_s_i_t_o_r │ │ │ │ │ +127 { │ │ │ │ │ +_1_2_8 _I_n_i_t_V_i_s_i_t_o_r(_R_a_w_C_o_n_t_a_i_n_e_r& data) : │ │ │ │ │ +129 data_(data) │ │ │ │ │ +130 {} │ │ │ │ │ +131 │ │ │ │ │ +132 template │ │ │ │ │ +_1_3_3 void _a_p_p_l_y(Node& node, TreePath treePath) │ │ │ │ │ +134 { │ │ │ │ │ +135 auto&& index = node.treeIndex(); │ │ │ │ │ +136 if (data_.size() < index+1) │ │ │ │ │ +137 data_.resize(index+1, nullptr); │ │ │ │ │ +138 data_[index] = new _N_o_d_e_D_a_t_a_<_N_o_d_e_>; │ │ │ │ │ +139 } │ │ │ │ │ +140 │ │ │ │ │ +141 │ │ │ │ │ +_1_4_2 _R_a_w_C_o_n_t_a_i_n_e_r& _d_a_t_a__; │ │ │ │ │ +143 }; │ │ │ │ │ +144 │ │ │ │ │ +_1_4_5 struct _D_e_s_t_r_o_y_V_i_s_i_t_o_r : │ │ │ │ │ +146 public _U_n_i_f_o_r_m_N_o_d_e_V_i_s_i_t_o_r │ │ │ │ │ +147 { │ │ │ │ │ +_1_4_8 _D_e_s_t_r_o_y_V_i_s_i_t_o_r(_R_a_w_C_o_n_t_a_i_n_e_r& data) : │ │ │ │ │ +149 data_(data) │ │ │ │ │ +150 {} │ │ │ │ │ +151 │ │ │ │ │ +152 template │ │ │ │ │ +_1_5_3 void _a_p_p_l_y(Node& node, TreePath treePath) │ │ │ │ │ +154 { │ │ │ │ │ +155 auto&& index = node.treeIndex(); │ │ │ │ │ +156 auto p = (_N_o_d_e_D_a_t_a_<_N_o_d_e_>*)(data_[index]); │ │ │ │ │ +157 delete p; │ │ │ │ │ +158 data_[index] = nullptr; │ │ │ │ │ +159 } │ │ │ │ │ +160 │ │ │ │ │ +_1_6_1 _R_a_w_C_o_n_t_a_i_n_e_r& _d_a_t_a__; │ │ │ │ │ +162 }; │ │ │ │ │ +163 │ │ │ │ │ +_1_6_4 struct _C_o_p_y_V_i_s_i_t_o_r : │ │ │ │ │ +165 public _U_n_i_f_o_r_m_N_o_d_e_V_i_s_i_t_o_r │ │ │ │ │ +166 { │ │ │ │ │ +_1_6_7 _C_o_p_y_V_i_s_i_t_o_r(_T_r_e_e_D_a_t_a& thisTD, const _T_r_e_e_D_a_t_a& otherTD) : │ │ │ │ │ +168 thisTD_(thisTD), │ │ │ │ │ +169 otherTD_(otherTD) │ │ │ │ │ +170 {} │ │ │ │ │ +171 │ │ │ │ │ +172 template │ │ │ │ │ +_1_7_3 void _a_p_p_l_y(Node& node, TreePath treePath) │ │ │ │ │ +174 { │ │ │ │ │ +175 thisTD_[node] = otherTD_[node]; │ │ │ │ │ +176 } │ │ │ │ │ +177 │ │ │ │ │ +_1_7_8 _T_r_e_e_D_a_t_a& _t_h_i_s_T_D__; │ │ │ │ │ +_1_7_9 const _T_r_e_e_D_a_t_a& _o_t_h_e_r_T_D__; │ │ │ │ │ +180 }; │ │ │ │ │ 181 │ │ │ │ │ -182 │ │ │ │ │ -_1_8_8 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() │ │ │ │ │ -189 { │ │ │ │ │ -190 return {}; │ │ │ │ │ -191 } │ │ │ │ │ -192 │ │ │ │ │ -_1_9_8 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() │ │ │ │ │ -199 { │ │ │ │ │ -200 return {}; │ │ │ │ │ -201 } │ │ │ │ │ -202 │ │ │ │ │ -_2_0_8 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() │ │ │ │ │ -209 { │ │ │ │ │ -210 return {}; │ │ │ │ │ -211 } │ │ │ │ │ -212 │ │ │ │ │ -_2_1_8 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() │ │ │ │ │ -219 { │ │ │ │ │ -220 return {}; │ │ │ │ │ -221 } │ │ │ │ │ -222 │ │ │ │ │ -223} // end namespace BasisFactory │ │ │ │ │ -224 │ │ │ │ │ -225// Backward compatibility │ │ │ │ │ -_2_2_6namespace BasisBuilder { │ │ │ │ │ -227 │ │ │ │ │ -228 using namespace BasisFactory; │ │ │ │ │ +182public: │ │ │ │ │ +183 │ │ │ │ │ +_1_8_5 _T_r_e_e_D_a_t_a() : │ │ │ │ │ +186 tree_(nullptr) │ │ │ │ │ +187 {} │ │ │ │ │ +188 │ │ │ │ │ +_1_9_6 void _i_n_i_t(const _T_r_e_e& tree) │ │ │ │ │ +197 { │ │ │ │ │ +198 if (tree_) │ │ │ │ │ +199 destroy(); │ │ │ │ │ +200 tree_ = &tree; │ │ │ │ │ +201 TypeTree::applyToTree(*tree_, _I_n_i_t_V_i_s_i_t_o_r(data_)); │ │ │ │ │ +202 } │ │ │ │ │ +203 │ │ │ │ │ +_2_0_5 _T_r_e_e_D_a_t_a(const _T_r_e_e_D_a_t_a& other) : │ │ │ │ │ +206 tree_(other.tree_) │ │ │ │ │ +207 { │ │ │ │ │ +208 TypeTree::applyToTree(*tree_, _I_n_i_t_V_i_s_i_t_o_r(data_)); │ │ │ │ │ +209 TypeTree::applyToTree(*tree_, _C_o_p_y_V_i_s_i_t_o_r(*this, other)); │ │ │ │ │ +210 } │ │ │ │ │ +211 │ │ │ │ │ +_2_1_3 _T_r_e_e_D_a_t_a& _o_p_e_r_a_t_o_r_=(const _T_r_e_e_D_a_t_a& other) │ │ │ │ │ +214 { │ │ │ │ │ +215 if (tree_) │ │ │ │ │ +216 TypeTree::applyToTree(*tree_, _D_e_s_t_r_o_y_V_i_s_i_t_o_r(data_)); │ │ │ │ │ +217 tree_ = other._t_r_e_e__; │ │ │ │ │ +218 TypeTree::applyToTree(*tree_, _C_o_p_y_V_i_s_i_t_o_r(*this, other)); │ │ │ │ │ +219 return *this; │ │ │ │ │ +220 } │ │ │ │ │ +221 │ │ │ │ │ +_2_2_3 void _d_e_s_t_r_o_y() │ │ │ │ │ +224 { │ │ │ │ │ +225 if (tree_) │ │ │ │ │ +226 TypeTree::applyToTree(*tree_, _D_e_s_t_r_o_y_V_i_s_i_t_o_r(data_)); │ │ │ │ │ +227 tree_ = nullptr; │ │ │ │ │ +228 } │ │ │ │ │ 229 │ │ │ │ │ -230} │ │ │ │ │ -231 │ │ │ │ │ -232} // end namespace Functions │ │ │ │ │ -233} // end namespace Dune │ │ │ │ │ -234 │ │ │ │ │ -235 │ │ │ │ │ -236#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: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_:_:_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:218 │ │ │ │ │ -_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:198 │ │ │ │ │ -_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:208 │ │ │ │ │ +_2_3_1 _~_T_r_e_e_D_a_t_a() │ │ │ │ │ +232 { │ │ │ │ │ +233 if (tree_) │ │ │ │ │ +234 TypeTree::applyToTree(*tree_, _D_e_s_t_r_o_y_V_i_s_i_t_o_r(data_)); │ │ │ │ │ +235 } │ │ │ │ │ +236 │ │ │ │ │ +238 template │ │ │ │ │ +_2_3_9 _N_o_d_e_D_a_t_a_<_N_o_d_e_>& _o_p_e_r_a_t_o_r_[_](const Node& node) │ │ │ │ │ +240 { │ │ │ │ │ +241 return *(_N_o_d_e_D_a_t_a_<_N_o_d_e_>*)(data_[node.treeIndex()]); │ │ │ │ │ +242 } │ │ │ │ │ +243 │ │ │ │ │ +245 template │ │ │ │ │ +_2_4_6 const _N_o_d_e_D_a_t_a_<_N_o_d_e_>& _o_p_e_r_a_t_o_r_[_](const Node& node) const │ │ │ │ │ +247 { │ │ │ │ │ +248 return *(_N_o_d_e_D_a_t_a_<_N_o_d_e_>*)(data_[node.treeIndex()]); │ │ │ │ │ +249 } │ │ │ │ │ +250 │ │ │ │ │ +251protected: │ │ │ │ │ +252 │ │ │ │ │ +_2_5_3 const _T_r_e_e* _t_r_e_e__; │ │ │ │ │ +_2_5_4 _R_a_w_C_o_n_t_a_i_n_e_r _d_a_t_a__; │ │ │ │ │ +255}; │ │ │ │ │ +256 │ │ │ │ │ +257 │ │ │ │ │ +258 │ │ │ │ │ +259} // namespace Functions │ │ │ │ │ +260} // namespace Dune │ │ │ │ │ +261 │ │ │ │ │ +262#endif // DUNE_FUNCTIONS_COMMON_TREEDATA_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 │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:23 │ │ │ │ │ -_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:15 │ │ │ │ │ -_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:44 │ │ │ │ │ -_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:80 │ │ │ │ │ -_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:114 │ │ │ │ │ -_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:148 │ │ │ │ │ -_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:180 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_U_n_i_f_o_r_m_N_o_d_e_V_i_s_i_t_o_r │ │ │ │ │ +Mixin for visitors that should apply the same action on all nodes. │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:40 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_U_n_i_f_o_r_m_N_o_d_e_V_i_s_i_t_o_r_:_:_p_r_e │ │ │ │ │ +void pre(Node &node, TreePath treePath) │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:46 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_U_n_i_f_o_r_m_N_o_d_e_V_i_s_i_t_o_r_:_:_l_e_a_f │ │ │ │ │ +void leaf(Node &node, TreePath treePath) │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:57 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a │ │ │ │ │ +Container allowing to attach data to each node of a tree. │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:95 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_T_r_e_e_D_a_t_a │ │ │ │ │ +TreeData(const TreeData &other) │ │ │ │ │ +Copy constructor. │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:205 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_i_n_i_t │ │ │ │ │ +void init(const Tree &tree) │ │ │ │ │ +Initialize from tree. │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:196 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_T_r_e_e │ │ │ │ │ +T Tree │ │ │ │ │ +Type of tree the data is associated with. │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:100 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_t_r_e_e__ │ │ │ │ │ +const Tree * tree_ │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:253 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_d_e_s_t_r_o_y │ │ │ │ │ +void destroy() │ │ │ │ │ +Destroy data. │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:223 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_o_p_e_r_a_t_o_r_[_] │ │ │ │ │ +const NodeData< Node > & operator[](const Node &node) const │ │ │ │ │ +Get reference to data associated to given node. │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:246 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_o_p_e_r_a_t_o_r_= │ │ │ │ │ +TreeData & operator=(const TreeData &other) │ │ │ │ │ +Copy assignment. │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:213 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_~_T_r_e_e_D_a_t_a │ │ │ │ │ +~TreeData() │ │ │ │ │ +Destructor. │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:231 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_N_o_d_e_D_a_t_a │ │ │ │ │ +ND< Node > NodeData │ │ │ │ │ +Template to determine the data type for given node type. │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:110 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_T_r_e_e_D_a_t_a │ │ │ │ │ +TreeData() │ │ │ │ │ +Default constructor. │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:185 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_R_a_w_C_o_n_t_a_i_n_e_r │ │ │ │ │ +std::vector< void * > RawContainer │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:113 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_o_p_e_r_a_t_o_r_[_] │ │ │ │ │ +NodeData< Node > & operator[](const Node &node) │ │ │ │ │ +Get mutable reference to data associated to given node. │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:239 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_s_i_z_e___t_y_p_e │ │ │ │ │ +typename Tree::size_type size_type │ │ │ │ │ +Type used for indices and size information. │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:103 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_d_a_t_a__ │ │ │ │ │ +RawContainer data_ │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:254 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_I_n_i_t_V_i_s_i_t_o_r │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:127 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_I_n_i_t_V_i_s_i_t_o_r_:_:_I_n_i_t_V_i_s_i_t_o_r │ │ │ │ │ +InitVisitor(RawContainer &data) │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:128 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_I_n_i_t_V_i_s_i_t_o_r_:_:_a_p_p_l_y │ │ │ │ │ +void apply(Node &node, TreePath treePath) │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:133 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_I_n_i_t_V_i_s_i_t_o_r_:_:_d_a_t_a__ │ │ │ │ │ +RawContainer & data_ │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:142 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_D_e_s_t_r_o_y_V_i_s_i_t_o_r │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:147 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_D_e_s_t_r_o_y_V_i_s_i_t_o_r_:_:_d_a_t_a__ │ │ │ │ │ +RawContainer & data_ │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:161 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_D_e_s_t_r_o_y_V_i_s_i_t_o_r_:_:_D_e_s_t_r_o_y_V_i_s_i_t_o_r │ │ │ │ │ +DestroyVisitor(RawContainer &data) │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:148 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_D_e_s_t_r_o_y_V_i_s_i_t_o_r_:_:_a_p_p_l_y │ │ │ │ │ +void apply(Node &node, TreePath treePath) │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:153 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_C_o_p_y_V_i_s_i_t_o_r │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:166 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_C_o_p_y_V_i_s_i_t_o_r_:_:_C_o_p_y_V_i_s_i_t_o_r │ │ │ │ │ +CopyVisitor(TreeData &thisTD, const TreeData &otherTD) │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:167 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_C_o_p_y_V_i_s_i_t_o_r_:_:_a_p_p_l_y │ │ │ │ │ +void apply(Node &node, TreePath treePath) │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:173 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_C_o_p_y_V_i_s_i_t_o_r_:_:_t_h_i_s_T_D__ │ │ │ │ │ +TreeData & thisTD_ │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:178 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_C_o_p_y_V_i_s_i_t_o_r_:_:_o_t_h_e_r_T_D__ │ │ │ │ │ +const TreeData & otherTD_ │ │ │ │ │ +DDeeffiinniittiioonn treedata.hh:179 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00077.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: subentitydofs.hh File Reference │ │ │ │ +dune-functions: localfunction.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,58 +65,48 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces | │ │ │ │ -Functions
│ │ │ │ -
subentitydofs.hh File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
localfunction.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <vector>
│ │ │ │ -#include <dune/geometry/referenceelements.hh>
│ │ │ │ -#include <dune/typetree/traversal.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

class  Dune::Functions::SubEntityDOFs< GridView >
 Range of DOFs associated to sub-entity. More...
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
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ -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.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,39 +1,32 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -subentitydofs.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ +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 │ │ │ │ │ -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_._._. │ │ │ │ │ +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 │ │ │ │ │   │ │ │ │ │ -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. │ │ │ │ │ -  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00077_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: subentitydofs.hh Source File │ │ │ │ +dune-functions: localfunction.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,174 +70,174 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
subentitydofs.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH
│ │ │ │
5
│ │ │ │ -
6#include <vector>
│ │ │ │ +
6#include <type_traits>
│ │ │ │
7
│ │ │ │ -
8#include <dune/geometry/referenceelements.hh>
│ │ │ │ -
9#include <dune/typetree/traversal.hh>
│ │ │ │ -
10
│ │ │ │ -
11
│ │ │ │ -
12
│ │ │ │ -
13namespace Dune {
│ │ │ │ -
14namespace Functions {
│ │ │ │ +
8#include <dune/common/typeutilities.hh>
│ │ │ │ +
9
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
15
│ │ │ │
16
│ │ │ │
17
│ │ │ │ -
40template<class GridView>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
42{
│ │ │ │ -
43 static const int dim = GridView::dimension;
│ │ │ │ +
18namespace Dune {
│ │ │ │ +
19namespace Functions {
│ │ │ │ +
20
│ │ │ │ +
21
│ │ │ │ +
22
│ │ │ │ +
23/*
│ │ │ │ +
24 * Default implementation is empty
│ │ │ │ +
25 * The actual implementation is only given if Signature is an type
│ │ │ │ +
26 * describing a function signature as Range(Domain).
│ │ │ │ +
27 */
│ │ │ │ +
28template<class Signature, class LocalContext, template<class> class DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
30{};
│ │ │ │ +
│ │ │ │ +
31
│ │ │ │ +
32
│ │ │ │ +
33
│ │ │ │ +
34namespace Imp
│ │ │ │ +
35{
│ │ │ │ +
36
│ │ │ │ +
38 template<class S, class L, template<class> class DerivativeTraits, size_t bufferSize>
│ │ │ │ +
39 struct LocalFunctionTraits :
│ │ │ │ +
40 DifferentiableFunctionTraits<S, DerivativeTraits, bufferSize>
│ │ │ │ +
41 {
│ │ │ │ +
42 protected:
│ │ │ │ +
43 using Base=DifferentiableFunctionTraits<S, DerivativeTraits, bufferSize>;
│ │ │ │
44
│ │ │ │ -
45public:
│ │ │ │ -
46
│ │ │ │ -
63 template<class LocalView>
│ │ │ │ -
│ │ │ │ -
64 SubEntityDOFs& bind(const LocalView& localView, std::size_t subEntityIndex, std::size_t subEntityCodim)
│ │ │ │ -
65 {
│ │ │ │ -
66 // fill vector with local indices of all DOFs contained in subentity
│ │ │ │ -
67 containedDOFs_.clear();
│ │ │ │ -
68 dofIsContained_.assign(localView.size(), false);
│ │ │ │ -
69
│ │ │ │ -
70 auto re = Dune::referenceElement<double,dim>(localView.element().type());
│ │ │ │ -
71
│ │ │ │ -
72 Dune::TypeTree::forEachLeafNode(localView.tree(), [&](auto&& node, auto&& /*treePath*/) {
│ │ │ │ -
73 const auto& localCoefficients = node.finiteElement().localCoefficients();
│ │ │ │ -
74 std::size_t localSize = localCoefficients.size();
│ │ │ │ -
75 for(std::size_t i=0; i<localSize; ++i)
│ │ │ │ -
76 {
│ │ │ │ -
77 auto localKey = localCoefficients.localKey(i);
│ │ │ │ -
78 if (re.subEntities(subEntityIndex, subEntityCodim, localKey.codim()).contains(localKey.subEntity()))
│ │ │ │ -
79 {
│ │ │ │ -
80 containedDOFs_.push_back(node.localIndex(i));
│ │ │ │ -
81 dofIsContained_[node.localIndex(i)] = true;
│ │ │ │ -
82 }
│ │ │ │ -
83 }
│ │ │ │ -
84 });
│ │ │ │ -
85 return *this;
│ │ │ │ -
86 }
│ │ │ │ -
│ │ │ │ -
87
│ │ │ │ -
103 template<class LocalView, class Intersection>
│ │ │ │ -
│ │ │ │ -
104 SubEntityDOFs& bind(const LocalView& localView, const Intersection& intersection)
│ │ │ │ -
105 {
│ │ │ │ -
106 return bind(localView, intersection.indexInInside(), 1);
│ │ │ │ -
107 }
│ │ │ │ -
│ │ │ │ -
108
│ │ │ │ -
│ │ │ │ -
110 auto begin() const
│ │ │ │ -
111 {
│ │ │ │ -
112 return containedDOFs_.cbegin();
│ │ │ │ -
113 }
│ │ │ │ -
│ │ │ │ -
114
│ │ │ │ -
│ │ │ │ -
116 auto end() const
│ │ │ │ -
117 {
│ │ │ │ -
118 return containedDOFs_.cend();
│ │ │ │ -
119 }
│ │ │ │ -
│ │ │ │ -
120
│ │ │ │ -
│ │ │ │ -
122 auto size() const
│ │ │ │ -
123 {
│ │ │ │ -
124 return containedDOFs_.size();
│ │ │ │ -
125 }
│ │ │ │ -
│ │ │ │ -
126
│ │ │ │ -
│ │ │ │ -
128 decltype(auto) operator[](std::size_t i) const
│ │ │ │ -
129 {
│ │ │ │ -
130 return containedDOFs_[i];
│ │ │ │ -
131 }
│ │ │ │ -
│ │ │ │ -
132
│ │ │ │ -
│ │ │ │ -
134 bool contains(std::size_t localIndex) const
│ │ │ │ -
135 {
│ │ │ │ -
136 return dofIsContained_[localIndex];
│ │ │ │ -
137 }
│ │ │ │ -
│ │ │ │ -
138
│ │ │ │ -
139private:
│ │ │ │ -
140
│ │ │ │ -
141 std::vector<std::size_t> containedDOFs_;
│ │ │ │ -
142 std::vector<bool> dofIsContained_;
│ │ │ │ -
143};
│ │ │ │ -
│ │ │ │ -
144
│ │ │ │ -
145
│ │ │ │ -
146
│ │ │ │ -
159template<class T>
│ │ │ │ -
│ │ │ │ -
160auto subEntityDOFs(const T&)
│ │ │ │ -
161{
│ │ │ │ - │ │ │ │ -
163}
│ │ │ │ +
45 public:
│ │ │ │ +
47 using LocalContext = L;
│ │ │ │ +
48
│ │ │ │ +
50 using DerivativeSignature = typename Base::DerivativeSignature;
│ │ │ │ +
51
│ │ │ │ + │ │ │ │ +
54
│ │ │ │ +
56 using Concept = LocalFunctionWrapperInterface<S, DerivativeInterface, L>;
│ │ │ │ +
57
│ │ │ │ +
59 template<class B>
│ │ │ │ +
60 using Model = LocalFunctionWrapperImplementation<S, DerivativeInterface, L, B>;
│ │ │ │ +
61 };
│ │ │ │ +
62}
│ │ │ │ +
63
│ │ │ │ +
64
│ │ │ │ +
65
│ │ │ │ +
86template<class Range, class Domain, class LocalContext, template<class> class DerivativeTraits, size_t bufferSize>
│ │ │ │ +
│ │ │ │ +
87class LocalFunction< Range(Domain), LocalContext, DerivativeTraits, bufferSize> :
│ │ │ │ +
88 public TypeErasureBase<
│ │ │ │ +
89 typename Imp::LocalFunctionTraits<Range(Domain), LocalContext, DerivativeTraits, bufferSize>::Concept,
│ │ │ │ +
90 Imp::LocalFunctionTraits<Range(Domain), LocalContext, DerivativeTraits, bufferSize>::template Model>
│ │ │ │ +
91{
│ │ │ │ +
92 using Traits = Imp::LocalFunctionTraits<Range(Domain), LocalContext, DerivativeTraits, bufferSize>;
│ │ │ │ +
93
│ │ │ │ + │ │ │ │ +
95
│ │ │ │ +
96 using DerivativeInterface = typename Traits::DerivativeInterface;
│ │ │ │ +
97
│ │ │ │ +
98public:
│ │ │ │ +
99
│ │ │ │ +
111 template<class F, disableCopyMove<LocalFunction, F> = 0 >
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
113 Base(std::forward<F>(f))
│ │ │ │ +
114 {
│ │ │ │ +
115 static_assert(Dune::Functions::Concept::isLocalFunction<F, Range(Domain), LocalContext>(), "Trying to construct a LocalFunction from type that does not model the LocalFunction concept");
│ │ │ │ +
116 }
│ │ │ │ +
│ │ │ │ +
117
│ │ │ │ +
118 LocalFunction() = default;
│ │ │ │ +
119
│ │ │ │ +
│ │ │ │ +
123 Range operator() (const Domain& x) const
│ │ │ │ +
124 {
│ │ │ │ +
125 return this->asInterface().operator()(x);
│ │ │ │ +
126 }
│ │ │ │ +
│ │ │ │ +
127
│ │ │ │ +
│ │ │ │ +
135 friend DerivativeInterface derivative(const LocalFunction& t)
│ │ │ │ +
136 {
│ │ │ │ +
137 return t.asInterface().derivative();
│ │ │ │ +
138 }
│ │ │ │ +
│ │ │ │ +
139
│ │ │ │ +
│ │ │ │ +
146 void bind(const LocalContext& context)
│ │ │ │ +
147 {
│ │ │ │ +
148 this->asInterface().bind(context);
│ │ │ │ +
149 }
│ │ │ │ +
│ │ │ │ +
150
│ │ │ │ +
│ │ │ │ +
154 void unbind()
│ │ │ │ +
155 {
│ │ │ │ +
156 this->asInterface().unbind();
│ │ │ │ +
157 }
│ │ │ │ +
│ │ │ │ +
158
│ │ │ │ +
│ │ │ │ +
161 bool bound() const
│ │ │ │ +
162 {
│ │ │ │ +
163 return this->asInterface().bound();
│ │ │ │ +
164 }
│ │ │ │
│ │ │ │ -
164
│ │ │ │
165
│ │ │ │ -
166
│ │ │ │ -
186template<class LocalView>
│ │ │ │ -
│ │ │ │ -
187auto subEntityDOFs(const LocalView& localView, std::size_t subEntityIndex, std::size_t subEntityCodim)
│ │ │ │ -
188{
│ │ │ │ -
189 using GridView = typename LocalView::GridView;
│ │ │ │ - │ │ │ │ -
191 subEntityDOFs.bind(localView, subEntityIndex, subEntityCodim);
│ │ │ │ -
192 return subEntityDOFs;
│ │ │ │ -
193}
│ │ │ │ -
│ │ │ │ -
194
│ │ │ │ -
195
│ │ │ │ -
196
│ │ │ │ -
215template<class LocalView, class Intersection>
│ │ │ │ -
│ │ │ │ -
216auto subEntityDOFs(const LocalView& localView, const Intersection& intersection)
│ │ │ │ -
217{
│ │ │ │ -
218 using GridView = typename LocalView::GridView;
│ │ │ │ - │ │ │ │ -
220 subEntityDOFs.bind(localView, intersection);
│ │ │ │ -
221 return subEntityDOFs;
│ │ │ │ -
222}
│ │ │ │ -
│ │ │ │ -
223
│ │ │ │ -
224
│ │ │ │ -
225
│ │ │ │ -
226} // namespace Functions
│ │ │ │ -
227} // namespace Dune
│ │ │ │ -
228
│ │ │ │ -
229#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH
│ │ │ │ -
auto subEntityDOFs(const T &)
Create SubEntityDOFs object.
Definition subentitydofs.hh:160
│ │ │ │ +
│ │ │ │ +
169 const LocalContext& localContext() const
│ │ │ │ +
170 {
│ │ │ │ +
171 return this->asInterface().localContext();
│ │ │ │ +
172 }
│ │ │ │ +
│ │ │ │ +
173};
│ │ │ │ +
│ │ │ │ +
174
│ │ │ │ +
175
│ │ │ │ +
176
│ │ │ │ +
177}} // namespace Dune::Functions
│ │ │ │ +
178
│ │ │ │ +
179
│ │ │ │ +
180
│ │ │ │ +
181#endif // DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
friend DerivativeInterface derivative(const LocalFunction &t)
Get derivative of wrapped function.
Definition localfunction.hh:135
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
Range of DOFs associated to sub-entity.
Definition subentitydofs.hh:42
│ │ │ │ -
auto begin() const
Create begin iterator for access to range of contained local indices.
Definition subentitydofs.hh:110
│ │ │ │ -
auto size() const
Return number of contained DOFs.
Definition subentitydofs.hh:122
│ │ │ │ -
SubEntityDOFs & bind(const LocalView &localView, const Intersection &intersection)
Bind SubEntityDOFs object to LocalView and sub-entity.
Definition subentitydofs.hh:104
│ │ │ │ -
bool contains(std::size_t localIndex) const
Check if given local index is contained in this range of DOFs.
Definition subentitydofs.hh:134
│ │ │ │ -
auto end() const
Create end iterator for access to range of contained local indices.
Definition subentitydofs.hh:116
│ │ │ │ -
SubEntityDOFs & bind(const LocalView &localView, std::size_t subEntityIndex, std::size_t subEntityCodim)
Bind SubEntityDOFs object to LocalView and sub-entity.
Definition subentitydofs.hh:64
│ │ │ │ +
Definition localfunction.hh:30
│ │ │ │ +
const LocalContext & localContext() const
Obtain local context this LocalFunction is bound to.
Definition localfunction.hh:169
│ │ │ │ +
LocalFunction(F &&f)
Construct from function.
Definition localfunction.hh:112
│ │ │ │ +
void unbind()
Unbind from local context.
Definition localfunction.hh:154
│ │ │ │ +
bool bound() const
Return if the local function is bound to a grid element.
Definition localfunction.hh:161
│ │ │ │ +
void bind(const LocalContext &context)
Bind function to a local context.
Definition localfunction.hh:146
│ │ │ │ + │ │ │ │ +
Base class for type-erased interface wrapper.
Definition typeerasure.hh:165
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,174 +1,188 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -subentitydofs.hh │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ +6#include │ │ │ │ │ 7 │ │ │ │ │ -8#include │ │ │ │ │ -9#include │ │ │ │ │ -10 │ │ │ │ │ -11 │ │ │ │ │ -12 │ │ │ │ │ -13namespace _D_u_n_e { │ │ │ │ │ -14namespace Functions { │ │ │ │ │ +8#include │ │ │ │ │ +9 │ │ │ │ │ +10#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> │ │ │ │ │ +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_._h_h> │ │ │ │ │ +12#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> │ │ │ │ │ +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_e_r_a_s_u_r_e_._h_h> │ │ │ │ │ +14#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> │ │ │ │ │ 15 │ │ │ │ │ 16 │ │ │ │ │ 17 │ │ │ │ │ -40template │ │ │ │ │ -_4_1class _S_u_b_E_n_t_i_t_y_D_O_F_s │ │ │ │ │ -42{ │ │ │ │ │ -43 static const int dim = GridView::dimension; │ │ │ │ │ +18namespace _D_u_n_e { │ │ │ │ │ +19namespace Functions { │ │ │ │ │ +20 │ │ │ │ │ +21 │ │ │ │ │ +22 │ │ │ │ │ +23/* │ │ │ │ │ +24 * Default implementation is empty │ │ │ │ │ +25 * The actual implementation is only given if Signature is an type │ │ │ │ │ +26 * describing a function signature as Range(Domain). │ │ │ │ │ +27 */ │ │ │ │ │ +28template class │ │ │ │ │ +DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56> │ │ │ │ │ +_2_9class _L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ │ +30{}; │ │ │ │ │ +31 │ │ │ │ │ +32 │ │ │ │ │ +33 │ │ │ │ │ +34namespace Imp │ │ │ │ │ +35{ │ │ │ │ │ +36 │ │ │ │ │ +38 template class DerivativeTraits, size_t │ │ │ │ │ +bufferSize> │ │ │ │ │ +39 struct LocalFunctionTraits : │ │ │ │ │ +40 DifferentiableFunctionTraits │ │ │ │ │ +41 { │ │ │ │ │ +42 protected: │ │ │ │ │ +43 using Base=DifferentiableFunctionTraits; │ │ │ │ │ 44 │ │ │ │ │ -45public: │ │ │ │ │ -46 │ │ │ │ │ -63 template │ │ │ │ │ -_6_4 _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) │ │ │ │ │ -65 { │ │ │ │ │ -66 // fill vector with local indices of all DOFs contained in subentity │ │ │ │ │ -67 containedDOFs_.clear(); │ │ │ │ │ -68 dofIsContained_.assign(localView.size(), false); │ │ │ │ │ -69 │ │ │ │ │ -70 auto re = Dune::referenceElement(localView.element().type()); │ │ │ │ │ -71 │ │ │ │ │ -72 Dune::TypeTree::forEachLeafNode(localView.tree(), [&](auto&& node, auto&& / │ │ │ │ │ -*treePath*/) { │ │ │ │ │ -73 const auto& localCoefficients = node.finiteElement().localCoefficients(); │ │ │ │ │ -74 std::size_t localSize = localCoefficients.size(); │ │ │ │ │ -75 for(std::size_t i=0; i │ │ │ │ │ -_1_0_4 _S_u_b_E_n_t_i_t_y_D_O_F_s& _b_i_n_d(const LocalView& localView, const Intersection& │ │ │ │ │ -intersection) │ │ │ │ │ -105 { │ │ │ │ │ -106 return bind(localView, intersection.indexInInside(), 1); │ │ │ │ │ -107 } │ │ │ │ │ -108 │ │ │ │ │ -_1_1_0 auto _b_e_g_i_n() const │ │ │ │ │ -111 { │ │ │ │ │ -112 return containedDOFs_.cbegin(); │ │ │ │ │ -113 } │ │ │ │ │ -114 │ │ │ │ │ -_1_1_6 auto _e_n_d() const │ │ │ │ │ -117 { │ │ │ │ │ -118 return containedDOFs_.cend(); │ │ │ │ │ -119 } │ │ │ │ │ -120 │ │ │ │ │ -_1_2_2 auto _s_i_z_e() const │ │ │ │ │ -123 { │ │ │ │ │ -124 return containedDOFs_.size(); │ │ │ │ │ -125 } │ │ │ │ │ -126 │ │ │ │ │ -_1_2_8 decltype(auto) operator[](std::size_t i) const │ │ │ │ │ -129 { │ │ │ │ │ -130 return containedDOFs_[i]; │ │ │ │ │ -131 } │ │ │ │ │ -132 │ │ │ │ │ -_1_3_4 bool _c_o_n_t_a_i_n_s(std::size_t localIndex) const │ │ │ │ │ -135 { │ │ │ │ │ -136 return dofIsContained_[localIndex]; │ │ │ │ │ -137 } │ │ │ │ │ -138 │ │ │ │ │ -139private: │ │ │ │ │ -140 │ │ │ │ │ -141 std::vector containedDOFs_; │ │ │ │ │ -142 std::vector dofIsContained_; │ │ │ │ │ -143}; │ │ │ │ │ -144 │ │ │ │ │ -145 │ │ │ │ │ -146 │ │ │ │ │ -159template │ │ │ │ │ -_1_6_0auto _s_u_b_E_n_t_i_t_y_D_O_F_s(const T&) │ │ │ │ │ -161{ │ │ │ │ │ -162 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_>{}; │ │ │ │ │ -163} │ │ │ │ │ -164 │ │ │ │ │ +45 public: │ │ │ │ │ +47 using LocalContext = L; │ │ │ │ │ +48 │ │ │ │ │ +50 using DerivativeSignature = typename Base::DerivativeSignature; │ │ │ │ │ +51 │ │ │ │ │ +53 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_>; │ │ │ │ │ +54 │ │ │ │ │ +56 using Concept = LocalFunctionWrapperInterface; │ │ │ │ │ +57 │ │ │ │ │ +59 template │ │ │ │ │ +60 using Model = LocalFunctionWrapperImplementation; │ │ │ │ │ +61 }; │ │ │ │ │ +62} │ │ │ │ │ +63 │ │ │ │ │ +64 │ │ │ │ │ +65 │ │ │ │ │ +86template class │ │ │ │ │ +DerivativeTraits, size_t bufferSize> │ │ │ │ │ +_8_7class _L_o_c_a_l_F_u_n_c_t_i_o_n< Range(Domain), LocalContext, DerivativeTraits, │ │ │ │ │ +bufferSize> : │ │ │ │ │ +88 public _T_y_p_e_E_r_a_s_u_r_e_B_a_s_e< │ │ │ │ │ +89 typename Imp::LocalFunctionTraits::Concept, │ │ │ │ │ +90 Imp::LocalFunctionTraits::template Model> │ │ │ │ │ +91{ │ │ │ │ │ +92 using Traits = Imp::LocalFunctionTraits; │ │ │ │ │ +93 │ │ │ │ │ +94 using _B_a_s_e = _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_>; │ │ │ │ │ +95 │ │ │ │ │ +96 using DerivativeInterface = typename _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; │ │ │ │ │ +97 │ │ │ │ │ +98public: │ │ │ │ │ +99 │ │ │ │ │ +111 template = 0 > │ │ │ │ │ +_1_1_2 _L_o_c_a_l_F_u_n_c_t_i_o_n(F&& f) : │ │ │ │ │ +113 _B_a_s_e(std::forward(f)) │ │ │ │ │ +114 { │ │ │ │ │ +115 static_assert(Dune::Functions::Concept::isLocalFunction(), "Trying to construct a LocalFunction from type that does not │ │ │ │ │ +model the LocalFunction concept"); │ │ │ │ │ +116 } │ │ │ │ │ +117 │ │ │ │ │ +_1_1_8 _L_o_c_a_l_F_u_n_c_t_i_o_n() = default; │ │ │ │ │ +119 │ │ │ │ │ +_1_2_3 Range operator() (const Domain& x) const │ │ │ │ │ +124 { │ │ │ │ │ +125 return this->asInterface().operator()(x); │ │ │ │ │ +126 } │ │ │ │ │ +127 │ │ │ │ │ +_1_3_5 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) │ │ │ │ │ +136 { │ │ │ │ │ +137 return t.asInterface().derivative(); │ │ │ │ │ +138 } │ │ │ │ │ +139 │ │ │ │ │ +_1_4_6 void _b_i_n_d(const LocalContext& context) │ │ │ │ │ +147 { │ │ │ │ │ +148 this->asInterface().bind(context); │ │ │ │ │ +149 } │ │ │ │ │ +150 │ │ │ │ │ +_1_5_4 void _u_n_b_i_n_d() │ │ │ │ │ +155 { │ │ │ │ │ +156 this->asInterface().unbind(); │ │ │ │ │ +157 } │ │ │ │ │ +158 │ │ │ │ │ +_1_6_1 bool _b_o_u_n_d() const │ │ │ │ │ +162 { │ │ │ │ │ +163 return this->asInterface().bound(); │ │ │ │ │ +164 } │ │ │ │ │ 165 │ │ │ │ │ -166 │ │ │ │ │ -186template │ │ │ │ │ -_1_8_7auto _s_u_b_E_n_t_i_t_y_D_O_F_s(const LocalView& localView, std::size_t subEntityIndex, │ │ │ │ │ -std::size_t subEntityCodim) │ │ │ │ │ -188{ │ │ │ │ │ -189 using GridView = typename LocalView::GridView; │ │ │ │ │ -190 _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; │ │ │ │ │ -191 _s_u_b_E_n_t_i_t_y_D_O_F_s.bind(localView, subEntityIndex, subEntityCodim); │ │ │ │ │ -192 return _s_u_b_E_n_t_i_t_y_D_O_F_s; │ │ │ │ │ -193} │ │ │ │ │ -194 │ │ │ │ │ -195 │ │ │ │ │ -196 │ │ │ │ │ -215template │ │ │ │ │ -_2_1_6auto _s_u_b_E_n_t_i_t_y_D_O_F_s(const LocalView& localView, const Intersection& │ │ │ │ │ -intersection) │ │ │ │ │ -217{ │ │ │ │ │ -218 using GridView = typename LocalView::GridView; │ │ │ │ │ -219 _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; │ │ │ │ │ -220 _s_u_b_E_n_t_i_t_y_D_O_F_s.bind(localView, intersection); │ │ │ │ │ -221 return _s_u_b_E_n_t_i_t_y_D_O_F_s; │ │ │ │ │ -222} │ │ │ │ │ -223 │ │ │ │ │ -224 │ │ │ │ │ -225 │ │ │ │ │ -226} // namespace Functions │ │ │ │ │ -227} // namespace Dune │ │ │ │ │ -228 │ │ │ │ │ -229#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:160 │ │ │ │ │ +_1_6_9 const LocalContext& _l_o_c_a_l_C_o_n_t_e_x_t() const │ │ │ │ │ +170 { │ │ │ │ │ +171 return this->asInterface().localContext(); │ │ │ │ │ +172 } │ │ │ │ │ +173}; │ │ │ │ │ +174 │ │ │ │ │ +175 │ │ │ │ │ +176 │ │ │ │ │ +177}} // namespace Dune::Functions │ │ │ │ │ +178 │ │ │ │ │ +179 │ │ │ │ │ +180 │ │ │ │ │ +181#endif // DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_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 │ │ │ │ │ +_l_o_c_a_l_f_u_n_c_t_i_o_n___i_m_p_._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 │ │ │ │ │ +_t_y_p_e_e_r_a_s_u_r_e_._h_h │ │ │ │ │ +_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_:_:_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:135 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:42 │ │ │ │ │ -_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:110 │ │ │ │ │ -_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:122 │ │ │ │ │ -_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:104 │ │ │ │ │ -_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:134 │ │ │ │ │ -_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:116 │ │ │ │ │ -_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:64 │ │ │ │ │ +_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:30 │ │ │ │ │ +_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:169 │ │ │ │ │ +_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:112 │ │ │ │ │ +_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:154 │ │ │ │ │ +_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:161 │ │ │ │ │ +_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:146 │ │ │ │ │ +_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 │ │ │ │ │ +Base class for type-erased interface wrapper. │ │ │ │ │ +DDeeffiinniittiioonn typeerasure.hh:165 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00080.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: periodicbasis.hh File Reference │ │ │ │ +dune-functions: multiindex.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,58 +65,55 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces | │ │ │ │ Functions
│ │ │ │ -
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/transformedindexbasis.hh>
│ │ │ │ +
#include <cstddef>
│ │ │ │ +#include <array>
│ │ │ │ +#include <iostream>
│ │ │ │ +#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<typename Stream , class size_type , std::size_t n>
Stream & Dune::Functions::operator<< (Stream &stream, const StaticMultiIndex< size_type, n > &c)
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,38 +1,35 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_m_o_n │ │ │ │ │ _C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -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_/_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 │ │ │ │ │ _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 │ │ │ │ │ +Stream &  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_o_p_e_r_a_t_o_r_<_< (Stream &stream, const _S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x< │ │ │ │ │ + size_type, n > &c) │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00080_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: periodicbasis.hh Source File │ │ │ │ +dune-functions: multiindex.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,218 +70,118 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_PERIODICBASIS_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_PERIODICBASIS_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH
│ │ │ │
5
│ │ │ │ -
6#include <utility>
│ │ │ │ -
7#include <type_traits>
│ │ │ │ -
8#include <limits>
│ │ │ │ -
9#include <set>
│ │ │ │ -
10#include <vector>
│ │ │ │ +
6#include <cstddef>
│ │ │ │ +
7#include <array>
│ │ │ │ +
8#include <iostream>
│ │ │ │ +
9
│ │ │ │ +
10#include <dune/common/hash.hh>
│ │ │ │
11
│ │ │ │ - │ │ │ │ - │ │ │ │ +
12
│ │ │ │ +
13namespace Dune::Functions {
│ │ │ │
14
│ │ │ │
15
│ │ │ │ -
16namespace Dune::Functions {
│ │ │ │ -
17
│ │ │ │ -
18namespace BasisFactory {
│ │ │ │ -
19
│ │ │ │ -
20// The PeriodicBasis class is in the Experimental namespace because we are
│ │ │ │ -
21// not completely sure yet whether we like it. We reserve the right to
│ │ │ │ -
22// modify it without advance warning. Use at your own risk!
│ │ │ │ -
23
│ │ │ │ -
│ │ │ │ -
24namespace Experimental {
│ │ │ │ -
25
│ │ │ │ -
26
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
36{
│ │ │ │ -
37 using IndexPairSet = std::set<std::pair<std::size_t,std::size_t>>;
│ │ │ │ -
38public:
│ │ │ │ -
39
│ │ │ │ -
│ │ │ │ -
47 void unifyIndexPair(std::size_t a, std::size_t b)
│ │ │ │ -
48 {
│ │ │ │ -
49 if (a>b)
│ │ │ │ -
50 std::swap(a,b);
│ │ │ │ -
51 if (a==b)
│ │ │ │ -
52 return;
│ │ │ │ -
53 indexPairSet_.insert(std::make_pair(a,b));
│ │ │ │ -
54 }
│ │ │ │ -
│ │ │ │ -
55
│ │ │ │ -
│ │ │ │ -
56 const auto& indexPairSet() const
│ │ │ │ -
57 {
│ │ │ │ -
58 return indexPairSet_;
│ │ │ │ -
59 }
│ │ │ │ -
│ │ │ │ -
60
│ │ │ │ -
61private:
│ │ │ │ -
62 IndexPairSet indexPairSet_;
│ │ │ │ -
63};
│ │ │ │ +
16
│ │ │ │ +
22template<class size_type, std::size_t n>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
24 public std::array<size_type, n>
│ │ │ │ +
25{
│ │ │ │ +
26public:
│ │ │ │ +
27 static constexpr std::size_t size() { return n; }
│ │ │ │ +
28
│ │ │ │ +
│ │ │ │ +
29 inline friend std::size_t hash_value(const StaticMultiIndex& v) noexcept {
│ │ │ │ +
30 return hash_range(v.begin(), v.end());
│ │ │ │ +
31 }
│ │ │ │ +
│ │ │ │ +
32
│ │ │ │ +
33};
│ │ │ │ +
│ │ │ │ +
34
│ │ │ │ +
35
│ │ │ │ +
36
│ │ │ │ +
46template<class size_type>
│ │ │ │ +
│ │ │ │ +
47class StaticMultiIndex<size_type,1> :
│ │ │ │ +
48 public std::array<size_type, 1>
│ │ │ │ +
49{
│ │ │ │ +
50public:
│ │ │ │ +
51
│ │ │ │ +
52 static constexpr std::size_t size() { return 1; }
│ │ │ │ +
53
│ │ │ │ +
│ │ │ │ +
54 operator const size_type& () const {
│ │ │ │ +
55 return (*this)[0];
│ │ │ │ +
56 }
│ │ │ │ +
│ │ │ │ +
57
│ │ │ │ +
│ │ │ │ +
58 inline friend std::size_t hash_value(const StaticMultiIndex& v) noexcept {
│ │ │ │ +
59 return hash_range(v.begin(), v.end());
│ │ │ │ +
60 }
│ │ │ │ +
│ │ │ │ +
61
│ │ │ │ +
│ │ │ │ +
62 operator size_type& () {
│ │ │ │ +
63 return (*this)[0];
│ │ │ │ +
64 }
│ │ │ │
│ │ │ │ -
64
│ │ │ │
65
│ │ │ │ -
66
│ │ │ │ -
67namespace Impl {
│ │ │ │ +
66};
│ │ │ │ +
│ │ │ │ +
67
│ │ │ │
68
│ │ │ │ -
69// An index transformation for a TransformedIndexPreBasis
│ │ │ │ -
70// implementing periodic functions by merging indices.
│ │ │ │ -
71// Currently only flat indices are supported.
│ │ │ │ -
72class PeriodicIndexingTransformation
│ │ │ │ -
73{
│ │ │ │ -
74public:
│ │ │ │ -
75
│ │ │ │ -
76 static constexpr std::size_t minIndexSize = 1;
│ │ │ │ -
77 static constexpr std::size_t maxIndexSize = 1;
│ │ │ │ +
69
│ │ │ │ +
70template<typename Stream, class size_type, std::size_t n>
│ │ │ │ +
│ │ │ │ +
71inline Stream& operator<<(Stream& stream, const StaticMultiIndex<size_type,n>& c) {
│ │ │ │ +
72 for (const auto& ci : c)
│ │ │ │ +
73 stream << ci << " ";
│ │ │ │ +
74 return stream;
│ │ │ │ +
75}
│ │ │ │ +
│ │ │ │ +
76
│ │ │ │ +
77
│ │ │ │
78
│ │ │ │ -
79 template<class RawPreBasis, class IndexPairSet>
│ │ │ │ -
80 PeriodicIndexingTransformation(const RawPreBasis& rawPreBasis, const IndexPairSet& indexPairSet)
│ │ │ │ -
81 {
│ │ │ │ -
82 static_assert(RawPreBasis::maxMultiIndexSize==1, "PeriodicIndexingTransformation is only implemented for flat multi-indices");
│ │ │ │ -
83 std::size_t invalid = {std::numeric_limits<std::size_t>::max()};
│ │ │ │ -
84 mappedIdx_.resize(rawPreBasis.size(), invalid);
│ │ │ │ -
85 numIndices_ = 0;
│ │ │ │ -
86 std::size_t i = 0;
│ │ │ │ -
87 for(const auto& [a, b] : indexPairSet)
│ │ │ │ -
88 {
│ │ │ │ -
89 for(; i<=a; ++i)
│ │ │ │ -
90 if (mappedIdx_[i] == invalid)
│ │ │ │ -
91 mappedIdx_[i] = numIndices_++;
│ │ │ │ -
92 mappedIdx_[b] = mappedIdx_[a];
│ │ │ │ -
93 }
│ │ │ │ -
94 for(; i<rawPreBasis.size(); ++i)
│ │ │ │ -
95 if (mappedIdx_[i] == invalid)
│ │ │ │ -
96 mappedIdx_[i] = numIndices_++;
│ │ │ │ -
97 }
│ │ │ │ -
98
│ │ │ │ -
99 template<class MultiIndex, class PreBasis>
│ │ │ │ -
100 void transformIndex(MultiIndex& multiIndex, const PreBasis& preBasis) const
│ │ │ │ -
101 {
│ │ │ │ -
102 multiIndex = {{ mappedIdx_[multiIndex[0]] }};
│ │ │ │ -
103 }
│ │ │ │ -
104
│ │ │ │ -
105 template<class Prefix, class PreBasis>
│ │ │ │ -
106 std::size_t size(const Prefix& prefix, const PreBasis& preBasis) const
│ │ │ │ -
107 {
│ │ │ │ -
108 if (prefix.size() == 1)
│ │ │ │ -
109 return 0;
│ │ │ │ -
110 return numIndices_;
│ │ │ │ -
111 }
│ │ │ │ -
112
│ │ │ │ -
113 template<class PreBasis>
│ │ │ │ -
114 auto dimension(const PreBasis& preBasis) const
│ │ │ │ -
115 {
│ │ │ │ -
116 return numIndices_;
│ │ │ │ -
117 }
│ │ │ │ -
118
│ │ │ │ -
119private:
│ │ │ │ -
120 std::vector<std::size_t> mappedIdx_;
│ │ │ │ -
121 std::size_t numIndices_;
│ │ │ │ -
122};
│ │ │ │ -
123
│ │ │ │ -
124
│ │ │ │ -
125
│ │ │ │ -
126template<class RawPreBasisIndicator>
│ │ │ │ -
127class PeriodicPreBasisFactory
│ │ │ │ -
128{
│ │ │ │ -
129public:
│ │ │ │ -
130 PeriodicPreBasisFactory()
│ │ │ │ -
131 {}
│ │ │ │ -
132
│ │ │ │ -
133 template<class RPBI, class PIS>
│ │ │ │ -
134 PeriodicPreBasisFactory(RPBI&& rawPreBasisIndicator, PIS&& periodicIndexSet) :
│ │ │ │ -
135 rawPreBasisIndicator_(std::forward<RPBI>(rawPreBasisIndicator)),
│ │ │ │ -
136 periodicIndexSet_(std::forward<PIS>(periodicIndexSet))
│ │ │ │ -
137 {}
│ │ │ │ -
138
│ │ │ │ -
139 template<class GridView,
│ │ │ │ -
140 std::enable_if_t<models<Concept::GlobalBasis<GridView>,RawPreBasisIndicator>(), int> = 0>
│ │ │ │ -
141 auto operator()(const GridView& gridView) const
│ │ │ │ -
142 {
│ │ │ │ -
143 const auto& rawPreBasis = rawPreBasisIndicator_.preBasis();
│ │ │ │ -
144 auto transformation = PeriodicIndexingTransformation(rawPreBasis, periodicIndexSet_.indexPairSet());
│ │ │ │ -
145 return Dune::Functions::Experimental::TransformedIndexPreBasis(std::move(rawPreBasis), std::move(transformation));
│ │ │ │ -
146 }
│ │ │ │ -
147
│ │ │ │ -
148 template<class GridView,
│ │ │ │ -
149 std::enable_if_t<models<Concept::PreBasis<GridView>,RawPreBasisIndicator>(), int> = 0>
│ │ │ │ -
150 auto operator()(const GridView& gridView) const
│ │ │ │ -
151 {
│ │ │ │ -
152 const auto& rawPreBasis = rawPreBasisIndicator_;
│ │ │ │ -
153 auto transformation = PeriodicIndexingTransformation(rawPreBasis, periodicIndexSet_.indexPairSet());
│ │ │ │ -
154 return Dune::Functions::Experimental::TransformedIndexPreBasis(std::move(rawPreBasis), std::move(transformation));
│ │ │ │ -
155 }
│ │ │ │ -
156
│ │ │ │ -
157 template<class GridView,
│ │ │ │ -
158 std::enable_if_t<not models<Concept::GlobalBasis<GridView>,RawPreBasisIndicator>(), int> = 0,
│ │ │ │ -
159 std::enable_if_t<not models<Concept::PreBasis<GridView>,RawPreBasisIndicator>(), int> = 0>
│ │ │ │ -
160 auto operator()(const GridView& gridView) const
│ │ │ │ -
161 {
│ │ │ │ -
162 auto rawPreBasis = rawPreBasisIndicator_(gridView);
│ │ │ │ -
163 rawPreBasis.initializeIndices();
│ │ │ │ -
164 auto transformation = PeriodicIndexingTransformation(rawPreBasis, periodicIndexSet_.indexPairSet());
│ │ │ │ -
165 return Dune::Functions::Experimental::TransformedIndexPreBasis(std::move(rawPreBasis), std::move(transformation));
│ │ │ │ -
166 }
│ │ │ │ -
167
│ │ │ │ -
168private:
│ │ │ │ -
169 RawPreBasisIndicator rawPreBasisIndicator_;
│ │ │ │ -
170 PeriodicIndexSet periodicIndexSet_;
│ │ │ │ -
171};
│ │ │ │ -
172
│ │ │ │ -
173} // end namespace BasisFactory::Impl
│ │ │ │ -
174
│ │ │ │ -
175
│ │ │ │ -
176
│ │ │ │ -
190template<class RawPreBasisIndicator, class PIS>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
192 RawPreBasisIndicator&& rawPreBasisIndicator,
│ │ │ │ -
193 PIS&& periodicIndexSet
│ │ │ │ -
194 )
│ │ │ │ -
195{
│ │ │ │ -
196 return Impl::PeriodicPreBasisFactory<std::decay_t<RawPreBasisIndicator>>(
│ │ │ │ -
197 std::forward<RawPreBasisIndicator>(rawPreBasisIndicator),
│ │ │ │ -
198 std::forward<PIS>(periodicIndexSet));
│ │ │ │ -
199}
│ │ │ │ -
│ │ │ │ -
200
│ │ │ │ -
201} // end namespace Experimental
│ │ │ │ -
│ │ │ │ -
202
│ │ │ │ -
203} // end namespace BasisFactory
│ │ │ │ -
204
│ │ │ │ -
205} // end namespace Dune::Functions
│ │ │ │ -
206
│ │ │ │ -
207#endif // DUNE_FUFEM_PERIODICBASIS_HH
│ │ │ │ - │ │ │ │ -
auto periodic(RawPreBasisIndicator &&rawPreBasisIndicator, PIS &&periodicIndexSet)
Create a pre-basis factory that can create a periodic pre-basis.
Definition periodicbasis.hh:191
│ │ │ │ +
79} // namespace Dune::Functions
│ │ │ │ +
80
│ │ │ │ +
81template<class size_type, std::size_t n>
│ │ │ │ +
│ │ │ │ +
82struct std::tuple_size< Dune::Functions::StaticMultiIndex<size_type,n> >
│ │ │ │ +
83 : std::integral_constant<std::size_t, n> { };
│ │ │ │ +
│ │ │ │ +
84
│ │ │ │ +
85DUNE_DEFINE_HASH(DUNE_HASH_TEMPLATE_ARGS(typename size_type, std::size_t n),DUNE_HASH_TYPE(Dune::Functions::StaticMultiIndex<size_type,n>))
│ │ │ │ +
86
│ │ │ │ +
87#endif // DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH
│ │ │ │ +
Definition polynomial.hh:10
│ │ │ │
Definition polynomial.hh:11
│ │ │ │ -
Container storing identified indices for a periodic basis.
Definition periodicbasis.hh:36
│ │ │ │ -
void unifyIndexPair(std::size_t a, std::size_t b)
Insert a pair of indices.
Definition periodicbasis.hh:47
│ │ │ │ -
const auto & indexPairSet() const
Definition periodicbasis.hh:56
│ │ │ │ -
A pre-basis transforming multi-indices.
Definition transformedindexbasis.hh:52
│ │ │ │ - │ │ │ │ +
Stream & operator<<(Stream &stream, const StaticMultiIndex< size_type, n > &c)
Definition multiindex.hh:71
│ │ │ │ +
A statically sized MultiIndex type.
Definition multiindex.hh:25
│ │ │ │ +
static constexpr std::size_t size()
Definition multiindex.hh:27
│ │ │ │ +
friend std::size_t hash_value(const StaticMultiIndex &v) noexcept
Definition multiindex.hh:29
│ │ │ │ +
static constexpr std::size_t size()
Definition multiindex.hh:52
│ │ │ │ +
friend std::size_t hash_value(const StaticMultiIndex &v) noexcept
Definition multiindex.hh:58
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,225 +1,108 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -periodicbasis.hh │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_PERIODICBASIS_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_PERIODICBASIS_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ -8#include │ │ │ │ │ -9#include │ │ │ │ │ -10#include │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ +8#include │ │ │ │ │ +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_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ │ -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_/_t_r_a_n_s_f_o_r_m_e_d_i_n_d_e_x_b_a_s_i_s_._h_h> │ │ │ │ │ +12 │ │ │ │ │ +13namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ │ 14 │ │ │ │ │ 15 │ │ │ │ │ -16namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ │ -17 │ │ │ │ │ -18namespace BasisFactory { │ │ │ │ │ -19 │ │ │ │ │ -20// The PeriodicBasis class is in the Experimental namespace because we are │ │ │ │ │ -21// not completely sure yet whether we like it. We reserve the right to │ │ │ │ │ -22// modify it without advance warning. Use at your own risk! │ │ │ │ │ -23 │ │ │ │ │ -_2_4namespace Experimental { │ │ │ │ │ -25 │ │ │ │ │ -26 │ │ │ │ │ -_3_5class _P_e_r_i_o_d_i_c_I_n_d_e_x_S_e_t │ │ │ │ │ -36{ │ │ │ │ │ -37 using IndexPairSet = std::set>; │ │ │ │ │ -38public: │ │ │ │ │ -39 │ │ │ │ │ -_4_7 void _u_n_i_f_y_I_n_d_e_x_P_a_i_r(std::size_t a, std::size_t b) │ │ │ │ │ -48 { │ │ │ │ │ -49 if (a>b) │ │ │ │ │ -50 std::swap(a,b); │ │ │ │ │ -51 if (a==b) │ │ │ │ │ -52 return; │ │ │ │ │ -53 indexPairSet_.insert(std::make_pair(a,b)); │ │ │ │ │ -54 } │ │ │ │ │ -55 │ │ │ │ │ -_5_6 const auto& _i_n_d_e_x_P_a_i_r_S_e_t() const │ │ │ │ │ -57 { │ │ │ │ │ -58 return indexPairSet_; │ │ │ │ │ -59 } │ │ │ │ │ -60 │ │ │ │ │ -61private: │ │ │ │ │ -62 IndexPairSet indexPairSet_; │ │ │ │ │ -63}; │ │ │ │ │ -64 │ │ │ │ │ +16 │ │ │ │ │ +22template │ │ │ │ │ +_2_3class _S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x : │ │ │ │ │ +24 public std::array │ │ │ │ │ +25{ │ │ │ │ │ +26public: │ │ │ │ │ +_2_7 static constexpr std::size_t _s_i_z_e() { return n; } │ │ │ │ │ +28 │ │ │ │ │ +_2_9 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 { │ │ │ │ │ +30 return hash_range(v.begin(), v.end()); │ │ │ │ │ +31 } │ │ │ │ │ +32 │ │ │ │ │ +33}; │ │ │ │ │ +34 │ │ │ │ │ +35 │ │ │ │ │ +36 │ │ │ │ │ +46template │ │ │ │ │ +_4_7class _S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x : │ │ │ │ │ +48 public std::array │ │ │ │ │ +49{ │ │ │ │ │ +50public: │ │ │ │ │ +51 │ │ │ │ │ +_5_2 static constexpr std::size_t _s_i_z_e() { return 1; } │ │ │ │ │ +53 │ │ │ │ │ +_5_4 operator const size_type& () const { │ │ │ │ │ +55 return (*this)[0]; │ │ │ │ │ +56 } │ │ │ │ │ +57 │ │ │ │ │ +_5_8 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 { │ │ │ │ │ +59 return hash_range(v.begin(), v.end()); │ │ │ │ │ +60 } │ │ │ │ │ +61 │ │ │ │ │ +_6_2 operator size_type& () { │ │ │ │ │ +63 return (*this)[0]; │ │ │ │ │ +64 } │ │ │ │ │ 65 │ │ │ │ │ -66 │ │ │ │ │ -67namespace Impl { │ │ │ │ │ +66}; │ │ │ │ │ +67 │ │ │ │ │ 68 │ │ │ │ │ -69// An index transformation for a TransformedIndexPreBasis │ │ │ │ │ -70// implementing periodic functions by merging indices. │ │ │ │ │ -71// Currently only flat indices are supported. │ │ │ │ │ -72class PeriodicIndexingTransformation │ │ │ │ │ -73{ │ │ │ │ │ -74public: │ │ │ │ │ -75 │ │ │ │ │ -76 static constexpr std::size_t minIndexSize = 1; │ │ │ │ │ -77 static constexpr std::size_t maxIndexSize = 1; │ │ │ │ │ +69 │ │ │ │ │ +70template │ │ │ │ │ +_7_1inline Stream& _o_p_e_r_a_t_o_r_<_<(Stream& 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) { │ │ │ │ │ +72 for (const auto& ci : c) │ │ │ │ │ +73 stream << ci << " "; │ │ │ │ │ +74 return stream; │ │ │ │ │ +75} │ │ │ │ │ +76 │ │ │ │ │ +77 │ │ │ │ │ 78 │ │ │ │ │ -79 template │ │ │ │ │ -80 PeriodicIndexingTransformation(const RawPreBasis& rawPreBasis, const │ │ │ │ │ -IndexPairSet& indexPairSet) │ │ │ │ │ -81 { │ │ │ │ │ -82 static_assert(RawPreBasis::maxMultiIndexSize==1, │ │ │ │ │ -"PeriodicIndexingTransformation is only implemented for flat multi-indices"); │ │ │ │ │ -83 std::size_t invalid = {std::numeric_limits::max()}; │ │ │ │ │ -84 mappedIdx_.resize(rawPreBasis.size(), invalid); │ │ │ │ │ -85 numIndices_ = 0; │ │ │ │ │ -86 std::size_t i = 0; │ │ │ │ │ -87 for(const auto& [a, b] : indexPairSet) │ │ │ │ │ -88 { │ │ │ │ │ -89 for(; i<=a; ++i) │ │ │ │ │ -90 if (mappedIdx_[i] == invalid) │ │ │ │ │ -91 mappedIdx_[i] = numIndices_++; │ │ │ │ │ -92 mappedIdx_[b] = mappedIdx_[a]; │ │ │ │ │ -93 } │ │ │ │ │ -94 for(; i │ │ │ │ │ -100 void transformIndex(MultiIndex& multiIndex, const PreBasis& preBasis) const │ │ │ │ │ -101 { │ │ │ │ │ -102 multiIndex = {{ mappedIdx_[multiIndex[0]] }}; │ │ │ │ │ -103 } │ │ │ │ │ -104 │ │ │ │ │ -105 template │ │ │ │ │ -106 std::size_t size(const Prefix& prefix, const PreBasis& preBasis) const │ │ │ │ │ -107 { │ │ │ │ │ -108 if (prefix.size() == 1) │ │ │ │ │ -109 return 0; │ │ │ │ │ -110 return numIndices_; │ │ │ │ │ -111 } │ │ │ │ │ -112 │ │ │ │ │ -113 template │ │ │ │ │ -114 auto dimension(const PreBasis& preBasis) const │ │ │ │ │ -115 { │ │ │ │ │ -116 return numIndices_; │ │ │ │ │ -117 } │ │ │ │ │ -118 │ │ │ │ │ -119private: │ │ │ │ │ -120 std::vector mappedIdx_; │ │ │ │ │ -121 std::size_t numIndices_; │ │ │ │ │ -122}; │ │ │ │ │ -123 │ │ │ │ │ -124 │ │ │ │ │ -125 │ │ │ │ │ -126template │ │ │ │ │ -127class PeriodicPreBasisFactory │ │ │ │ │ -128{ │ │ │ │ │ -129public: │ │ │ │ │ -130 PeriodicPreBasisFactory() │ │ │ │ │ -131 {} │ │ │ │ │ -132 │ │ │ │ │ -133 template │ │ │ │ │ -134 PeriodicPreBasisFactory(RPBI&& rawPreBasisIndicator, PIS&& │ │ │ │ │ -periodicIndexSet) : │ │ │ │ │ -135 rawPreBasisIndicator_(std::forward(rawPreBasisIndicator)), │ │ │ │ │ -136 periodicIndexSet_(std::forward(periodicIndexSet)) │ │ │ │ │ -137 {} │ │ │ │ │ -138 │ │ │ │ │ -139 template,RawPreBasisIndicator>(), int> = 0> │ │ │ │ │ -141 auto operator()(const GridView& gridView) const │ │ │ │ │ -142 { │ │ │ │ │ -143 const auto& rawPreBasis = rawPreBasisIndicator_.preBasis(); │ │ │ │ │ -144 auto transformation = PeriodicIndexingTransformation(rawPreBasis, │ │ │ │ │ -periodicIndexSet_.indexPairSet()); │ │ │ │ │ -145 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)); │ │ │ │ │ -146 } │ │ │ │ │ -147 │ │ │ │ │ -148 template,RawPreBasisIndicator> │ │ │ │ │ -(), int> = 0> │ │ │ │ │ -150 auto operator()(const GridView& gridView) const │ │ │ │ │ -151 { │ │ │ │ │ -152 const auto& rawPreBasis = rawPreBasisIndicator_; │ │ │ │ │ -153 auto transformation = PeriodicIndexingTransformation(rawPreBasis, │ │ │ │ │ -periodicIndexSet_.indexPairSet()); │ │ │ │ │ -154 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)); │ │ │ │ │ -155 } │ │ │ │ │ -156 │ │ │ │ │ -157 template,RawPreBasisIndicator>(), int> = 0, │ │ │ │ │ -159 std::enable_if_t,RawPreBasisIndicator>(), int> = 0> │ │ │ │ │ -160 auto operator()(const GridView& gridView) const │ │ │ │ │ -161 { │ │ │ │ │ -162 auto rawPreBasis = rawPreBasisIndicator_(gridView); │ │ │ │ │ -163 rawPreBasis.initializeIndices(); │ │ │ │ │ -164 auto transformation = PeriodicIndexingTransformation(rawPreBasis, │ │ │ │ │ -periodicIndexSet_.indexPairSet()); │ │ │ │ │ -165 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)); │ │ │ │ │ -166 } │ │ │ │ │ -167 │ │ │ │ │ -168private: │ │ │ │ │ -169 RawPreBasisIndicator rawPreBasisIndicator_; │ │ │ │ │ -170 PeriodicIndexSet periodicIndexSet_; │ │ │ │ │ -171}; │ │ │ │ │ -172 │ │ │ │ │ -173} // end namespace BasisFactory::Impl │ │ │ │ │ -174 │ │ │ │ │ -175 │ │ │ │ │ -176 │ │ │ │ │ -190template │ │ │ │ │ -_1_9_1auto _p_e_r_i_o_d_i_c( │ │ │ │ │ -192 RawPreBasisIndicator&& rawPreBasisIndicator, │ │ │ │ │ -193 PIS&& periodicIndexSet │ │ │ │ │ -194 ) │ │ │ │ │ -195{ │ │ │ │ │ -196 return Impl::PeriodicPreBasisFactory>( │ │ │ │ │ -197 std::forward(rawPreBasisIndicator), │ │ │ │ │ -198 std::forward(periodicIndexSet)); │ │ │ │ │ -199} │ │ │ │ │ -200 │ │ │ │ │ -201} // end namespace Experimental │ │ │ │ │ -202 │ │ │ │ │ -203} // end namespace BasisFactory │ │ │ │ │ -204 │ │ │ │ │ -205} // end namespace Dune::Functions │ │ │ │ │ -206 │ │ │ │ │ -207#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 │ │ │ │ │ -_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:191 │ │ │ │ │ +79} // namespace Dune::Functions │ │ │ │ │ +80 │ │ │ │ │ +81template │ │ │ │ │ +_8_2struct std::tuple_size< _D_u_n_e::Functions::StaticMultiIndex > │ │ │ │ │ +83 : std::integral_constant { }; │ │ │ │ │ +84 │ │ │ │ │ +85DUNE_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_>)) │ │ │ │ │ +86 │ │ │ │ │ +87#endif // DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH │ │ │ │ │ +_D_u_n_e │ │ │ │ │ +DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:11 │ │ │ │ │ -_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:36 │ │ │ │ │ -_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:47 │ │ │ │ │ -_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:56 │ │ │ │ │ -_D_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 │ │ │ │ │ -_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_<_< │ │ │ │ │ +Stream & operator<<(Stream &stream, const StaticMultiIndex< size_type, n > &c) │ │ │ │ │ +DDeeffiinniittiioonn multiindex.hh:71 │ │ │ │ │ +_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:25 │ │ │ │ │ +_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:27 │ │ │ │ │ +_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:29 │ │ │ │ │ +_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:52 │ │ │ │ │ +_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:58 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00083.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: interpolate.hh File Reference │ │ │ │ +dune-functions: overflowarray.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,62 +65,45 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Namespaces | │ │ │ │ -Functions
│ │ │ │ -
interpolate.hh File Reference
│ │ │ │ +Classes | │ │ │ │ +Namespaces
│ │ │ │ +
overflowarray.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <memory>
│ │ │ │ -#include <vector>
│ │ │ │ -#include <dune/common/exceptions.hh>
│ │ │ │ -#include <dune/common/bitsetvector.hh>
│ │ │ │ -#include <dune/typetree/childextraction.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/sizeinfo.hh>
│ │ │ │ -#include <dune/functions/functionspacebases/flatvectorview.hh>
│ │ │ │ -#include <dune/functions/functionspacebases/hierarchicnodetorangemap.hh>
│ │ │ │ -#include <dune/typetree/traversal.hh>
│ │ │ │ -#include <dune/typetree/visitor.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::OverflowArray< BA, maxSize >
 A dynamically sized array-like class with overflow. 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.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,46 +1,27 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -interpolate.hh File Reference │ │ │ │ │ -#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_/_s_i_z_e_i_n_f_o_._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 │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ +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_:_:_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 │ │ │ │ │   │ │ │ │ │ -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. │ │ │ │ │ -  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00083_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: interpolate.hh Source File │ │ │ │ +dune-functions: overflowarray.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,296 +70,282 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
interpolate.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH
│ │ │ │
5
│ │ │ │ -
6#include <memory>
│ │ │ │ -
7#include <vector>
│ │ │ │ -
8
│ │ │ │ -
9#include <dune/common/exceptions.hh>
│ │ │ │ -
10#include <dune/common/bitsetvector.hh>
│ │ │ │ +
6#include <algorithm>
│ │ │ │ +
7#include <iostream>
│ │ │ │ +
8#include <cstddef>
│ │ │ │ +
9#include <array>
│ │ │ │ +
10#include <initializer_list>
│ │ │ │
11
│ │ │ │ -
12#include <dune/typetree/childextraction.hh>
│ │ │ │ +
12#include <dune/common/genericiterator.hh>
│ │ │ │
13
│ │ │ │ - │ │ │ │ - │ │ │ │ -
16
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
22
│ │ │ │ -
23#include <dune/typetree/traversal.hh>
│ │ │ │ -
24#include <dune/typetree/visitor.hh>
│ │ │ │ -
25
│ │ │ │ -
26namespace Dune {
│ │ │ │ -
27namespace Functions {
│ │ │ │ -
28
│ │ │ │ -
29namespace Imp {
│ │ │ │ -
30
│ │ │ │ -
31struct AllTrueBitSetVector
│ │ │ │ -
32{
│ │ │ │ -
33 struct AllTrueBitSet
│ │ │ │ -
34 {
│ │ │ │ -
35 bool test(int) const { return true; }
│ │ │ │ -
36 } allTrue_;
│ │ │ │ -
37
│ │ │ │ -
38 operator bool() const
│ │ │ │ -
39 {
│ │ │ │ -
40 return true;
│ │ │ │ -
41 }
│ │ │ │ -
42
│ │ │ │ -
43 template<class I>
│ │ │ │ -
44 const AllTrueBitSetVector& operator[](const I&) const
│ │ │ │ -
45 {
│ │ │ │ -
46 return *this;
│ │ │ │ -
47 }
│ │ │ │ -
48
│ │ │ │ -
49 template<class SP>
│ │ │ │ -
50 void resize(const SP&) const
│ │ │ │ -
51 {}
│ │ │ │ -
52
│ │ │ │ -
53};
│ │ │ │ -
54
│ │ │ │ -
55
│ │ │ │ -
56
│ │ │ │ -
57template <class B, class T, class NTRE, class HV, class LF, class HBV>
│ │ │ │ -
58class LocalInterpolateVisitor
│ │ │ │ -
59 : public TypeTree::TreeVisitor
│ │ │ │ -
60 , public TypeTree::DynamicTraversal
│ │ │ │ -
61{
│ │ │ │ +
14
│ │ │ │ +
15
│ │ │ │ +
16namespace Dune::Functions {
│ │ │ │ +
17
│ │ │ │ +
18
│ │ │ │ +
42template<class BA, std::size_t maxSize = std::tuple_size_v<BA>>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
44 public BA
│ │ │ │ +
45{
│ │ │ │ +
46 static constexpr std::size_t baseSize = std::tuple_size_v<BA>;
│ │ │ │ +
47
│ │ │ │ +
48public:
│ │ │ │ +
49 using BaseArray = BA;
│ │ │ │ +
50
│ │ │ │ +
51 using value_type = typename BaseArray::value_type;
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
55 using difference_type = std::ptrdiff_t;
│ │ │ │ +
56 using size_type = std::size_t;
│ │ │ │ +
57 using iterator = Dune::GenericIterator<OverflowArray, value_type>;
│ │ │ │ +
58 using const_iterator = Dune::GenericIterator<const OverflowArray, const value_type>;
│ │ │ │ +
59
│ │ │ │ +
60private:
│ │ │ │ +
61 using OverflowBuffer = std::array<value_type, maxSize-baseSize>;
│ │ │ │
62
│ │ │ │
63public:
│ │ │ │
64
│ │ │ │ -
65 using Basis = B;
│ │ │ │ -
66 using LocalView = typename B::LocalView;
│ │ │ │ -
67 using MultiIndex = typename LocalView::MultiIndex;
│ │ │ │ -
68
│ │ │ │ -
69 using LocalFunction = LF;
│ │ │ │ -
70
│ │ │ │ -
71 using Tree = T;
│ │ │ │ +
65 OverflowArray() = default;
│ │ │ │ +
66
│ │ │ │ +
│ │ │ │ +
67 OverflowArray(const std::initializer_list<value_type>& l) {
│ │ │ │ +
68 assert(l.size() <= capacity());
│ │ │ │ +
69 size_ = l.size();
│ │ │ │ +
70 std::copy_n(l.begin(), size_, begin());
│ │ │ │ +
71 }
│ │ │ │ +
│ │ │ │
72
│ │ │ │ -
73 using VectorBackend = HV;
│ │ │ │ -
74 using BitVectorBackend = HBV;
│ │ │ │ -
75
│ │ │ │ -
76 using NodeToRangeEntry = NTRE;
│ │ │ │ -
77
│ │ │ │ -
78 using GridView = typename Basis::GridView;
│ │ │ │ -
79 using Element = typename GridView::template Codim<0>::Entity;
│ │ │ │ -
80
│ │ │ │ -
81 using LocalDomain = typename Element::Geometry::LocalCoordinate;
│ │ │ │ -
82
│ │ │ │ -
83 using GlobalDomain = typename Element::Geometry::GlobalCoordinate;
│ │ │ │ -
84
│ │ │ │ -
85 LocalInterpolateVisitor(const B& /*basis*/, HV& coeff, const HBV& bitVector, const LF& localF, const LocalView& localView, const NodeToRangeEntry& nodeToRangeEntry) :
│ │ │ │ -
86 vector_(coeff),
│ │ │ │ -
87 localF_(localF),
│ │ │ │ -
88 bitVector_(bitVector),
│ │ │ │ -
89 localView_(localView),
│ │ │ │ -
90 nodeToRangeEntry_(nodeToRangeEntry)
│ │ │ │ -
91 {
│ │ │ │ -
92 static_assert(Dune::Functions::Concept::isCallable<LocalFunction, LocalDomain>(), "Function passed to LocalInterpolateVisitor does not model the Callable<LocalCoordinate> concept");
│ │ │ │ -
93 }
│ │ │ │ -
94
│ │ │ │ -
95 template<typename Node, typename TreePath>
│ │ │ │ -
96 void pre(Node&, TreePath)
│ │ │ │ -
97 {}
│ │ │ │ -
98
│ │ │ │ -
99 template<typename Node, typename TreePath>
│ │ │ │ -
100 void post(Node&, TreePath)
│ │ │ │ -
101 {}
│ │ │ │ -
102
│ │ │ │ -
103 template<typename Node, typename TreePath>
│ │ │ │ -
104 void leaf(Node& node, TreePath treePath)
│ │ │ │ -
105 {
│ │ │ │ -
106 using FiniteElement = typename Node::FiniteElement;
│ │ │ │ -
107 using FiniteElementRange = typename FiniteElement::Traits::LocalBasisType::Traits::RangeType;
│ │ │ │ -
108 using FiniteElementRangeField = typename FiniteElement::Traits::LocalBasisType::Traits::RangeFieldType;
│ │ │ │ -
109
│ │ │ │ -
110 auto interpolationCoefficients = std::vector<FiniteElementRangeField>();
│ │ │ │ -
111 auto&& fe = node.finiteElement();
│ │ │ │ -
112
│ │ │ │ -
113 // backward compatibility: for scalar basis functions and possibly vector valued coefficients
│ │ │ │ -
114 // (like used in dune-fufem for power bases) loop over the components
│ │ │ │ -
115 // of the coefficients
│ │ │ │ -
116 if constexpr ( FiniteElement::Traits::LocalBasisType::Traits::dimRange == 1 )
│ │ │ │ -
117 {
│ │ │ │ -
118 // Note that we capture j by reference. Hence we can switch
│ │ │ │ -
119 // the selected component later on by modifying j. Maybe we
│ │ │ │ -
120 // should avoid this naughty statefull lambda hack in favor
│ │ │ │ -
121 // of a separate helper class.
│ │ │ │ -
122 std::size_t j=0;
│ │ │ │ -
123 auto localFj = [&](const LocalDomain& x){
│ │ │ │ -
124 const auto& y = localF_(x);
│ │ │ │ -
125 return FiniteElementRange(flatVectorView(nodeToRangeEntry_(node, treePath, y))[j]);
│ │ │ │ -
126 };
│ │ │ │ -
127
│ │ │ │ -
128 // We loop over j defined above and thus over the components of the
│ │ │ │ -
129 // range type of localF_.
│ │ │ │ -
130
│ │ │ │ -
131 auto blockSize = flatVectorView(vector_[localView_.index(0)]).size();
│ │ │ │ -
132
│ │ │ │ -
133 for(j=0; j<blockSize; ++j)
│ │ │ │ -
134 {
│ │ │ │ -
135 fe.localInterpolation().interpolate(localFj, interpolationCoefficients);
│ │ │ │ -
136 for (size_t i=0; i<fe.localBasis().size(); ++i)
│ │ │ │ -
137 {
│ │ │ │ -
138 auto multiIndex = localView_.index(node.localIndex(i));
│ │ │ │ -
139 auto bitVectorBlock = flatVectorView(bitVector_[multiIndex]);
│ │ │ │ -
140 if (bitVectorBlock[j])
│ │ │ │ -
141 {
│ │ │ │ -
142 auto vectorBlock = flatVectorView(vector_[multiIndex]);
│ │ │ │ -
143 vectorBlock[j] = interpolationCoefficients[i];
│ │ │ │ -
144 }
│ │ │ │ -
145 }
│ │ │ │ -
146 }
│ │ │ │ -
147 }
│ │ │ │ -
148 else // ( FiniteElement::Traits::LocalBasisType::Traits::dimRange != 1 )
│ │ │ │ -
149 {
│ │ │ │ -
150 // for all other finite elements: use the FiniteElementRange directly for the interpolation
│ │ │ │ -
151 auto localF = [&](const LocalDomain& x){
│ │ │ │ -
152 const auto& y = localF_(x);
│ │ │ │ -
153 return FiniteElementRange(nodeToRangeEntry_(node, treePath, y));
│ │ │ │ -
154 };
│ │ │ │ -
155
│ │ │ │ -
156 fe.localInterpolation().interpolate(localF, interpolationCoefficients);
│ │ │ │ -
157 for (size_t i=0; i<fe.localBasis().size(); ++i)
│ │ │ │ -
158 {
│ │ │ │ -
159 auto multiIndex = localView_.index(node.localIndex(i));
│ │ │ │ -
160 if ( bitVector_[multiIndex] )
│ │ │ │ -
161 {
│ │ │ │ -
162 vector_[multiIndex] = interpolationCoefficients[i];
│ │ │ │ -
163 }
│ │ │ │ -
164 }
│ │ │ │ -
165 }
│ │ │ │ -
166 }
│ │ │ │ -
167
│ │ │ │ -
168
│ │ │ │ -
169protected:
│ │ │ │ +
│ │ │ │ +
73 bool operator == (const OverflowArray& other) const {
│ │ │ │ +
74 if (size() != other.size())
│ │ │ │ +
75 return false;
│ │ │ │ +
76 for (size_type i=0; i<size(); ++i)
│ │ │ │ +
77 if ((*this)[i] != other[i])
│ │ │ │ +
78 return false;
│ │ │ │ +
79 return true;
│ │ │ │ +
80 }
│ │ │ │ +
│ │ │ │ +
81
│ │ │ │ +
│ │ │ │ +
83 void clear() {
│ │ │ │ +
84 size_ = 0;
│ │ │ │ +
85 }
│ │ │ │ +
│ │ │ │ +
86
│ │ │ │ +
│ │ │ │ +
93 void resize(size_type n) {
│ │ │ │ +
94 assert(n <= capacity());
│ │ │ │ +
95 size_ = n;
│ │ │ │ +
96 }
│ │ │ │ +
│ │ │ │ +
97
│ │ │ │ +
│ │ │ │ +
104 void push_back(const value_type& t) {
│ │ │ │ +
105 assert(size() < capacity());
│ │ │ │ +
106 (*this)[size_++] = t;
│ │ │ │ +
107 }
│ │ │ │ +
│ │ │ │ +
108
│ │ │ │ +
│ │ │ │ +
110 void pop_back() {
│ │ │ │ +
111 assert(size() > 0);
│ │ │ │ +
112 if (! empty())
│ │ │ │ +
113 size_--;
│ │ │ │ +
114 }
│ │ │ │ +
│ │ │ │ +
115
│ │ │ │ +
│ │ │ │ +
122 void push_front(const value_type& t) {
│ │ │ │ +
123 assert(size() < capacity());
│ │ │ │ +
124 for (size_type i=0; i<size(); i++)
│ │ │ │ +
125 (*this)[i+1] = (*this)[i];
│ │ │ │ +
126 (*this)[0] = t;
│ │ │ │ +
127 }
│ │ │ │ +
│ │ │ │ +
128
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
131 return iterator(*this, 0);
│ │ │ │ +
132 }
│ │ │ │ +
│ │ │ │ +
133
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
136 return const_iterator(*this, 0);
│ │ │ │ +
137 }
│ │ │ │ +
│ │ │ │ +
138
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
141 return iterator(*this, size());
│ │ │ │ +
142 }
│ │ │ │ +
│ │ │ │ +
143
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
146 return const_iterator(*this, size());
│ │ │ │ +
147 }
│ │ │ │ +
│ │ │ │ +
148
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
151 assert(i < size());
│ │ │ │ +
152 // If there's no padding between the base class and the overflow_ member,
│ │ │ │ +
153 // the compiler should be able to optimize this to
│ │ │ │ +
154 // return *(&BaseArray::operator[](0) + i);
│ │ │ │ +
155 if (i<baseSize)
│ │ │ │ +
156 return BaseArray::operator[](i);
│ │ │ │ +
157 return overflow_[i-baseSize];
│ │ │ │ +
158 }
│ │ │ │ +
│ │ │ │ +
159
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
162 assert(i < size());
│ │ │ │ +
163 // If there's no padding between the base class and the overflow_ member,
│ │ │ │ +
164 // the compiler should be able to optimize this to
│ │ │ │ +
165 // return *(&BaseArray::operator[](0) + i);
│ │ │ │ +
166 if (i<baseSize)
│ │ │ │ +
167 return BaseArray::operator[](i);
│ │ │ │ +
168 return overflow_[i-baseSize];
│ │ │ │ +
169 }
│ │ │ │ +
│ │ │ │
170
│ │ │ │ -
171 VectorBackend& vector_;
│ │ │ │ -
172 const LocalFunction& localF_;
│ │ │ │ -
173 const BitVectorBackend& bitVector_;
│ │ │ │ -
174 const LocalView& localView_;
│ │ │ │ -
175 const NodeToRangeEntry& nodeToRangeEntry_;
│ │ │ │ -
176};
│ │ │ │ -
177
│ │ │ │ -
178
│ │ │ │ -
179} // namespace Imp
│ │ │ │ -
180
│ │ │ │ -
181
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
173 assert(size() > 0);
│ │ │ │ +
174 return (*this)[0];
│ │ │ │ +
175 }
│ │ │ │ +
│ │ │ │ +
176
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
179 assert(size() > 0);
│ │ │ │ +
180 return (*this)[0];
│ │ │ │ +
181 }
│ │ │ │ +
│ │ │ │
182
│ │ │ │ -
183
│ │ │ │ -
201template <class B, class C, class F, class BV, class NTRE>
│ │ │ │ -
│ │ │ │ -
202void interpolate(const B& basis, C&& coeff, const F& f, const BV& bv, const NTRE& nodeToRangeEntry)
│ │ │ │ -
203{
│ │ │ │ -
204 using GridView = typename B::GridView;
│ │ │ │ -
205 using Element = typename GridView::template Codim<0>::Entity;
│ │ │ │ -
206
│ │ │ │ -
207 using Tree = typename B::LocalView::Tree;
│ │ │ │ -
208
│ │ │ │ -
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();
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
185 assert(size() > 0);
│ │ │ │ +
186 return (*this)[size()-1];
│ │ │ │ +
187 }
│ │ │ │ +
│ │ │ │ +
188
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
191 assert(size() > 0);
│ │ │ │ +
192 return (*this)[size()-1];
│ │ │ │ +
193 }
│ │ │ │ +
│ │ │ │ +
194
│ │ │ │ +
│ │ │ │ +
196 size_type size () const {
│ │ │ │ +
197 return size_;
│ │ │ │ +
198 }
│ │ │ │ +
│ │ │ │ +
199
│ │ │ │ +
│ │ │ │ +
201 bool empty() const {
│ │ │ │ +
202 return size() == 0;
│ │ │ │ +
203 }
│ │ │ │ +
│ │ │ │ +
204
│ │ │ │ +
│ │ │ │ +
206 static constexpr size_type capacity() {
│ │ │ │ +
207 return maxSize;
│ │ │ │ +
208 }
│ │ │ │ +
│ │ │ │ +
209
│ │ │ │ +
│ │ │ │ +
211 static constexpr size_type max_size() {
│ │ │ │ +
212 return maxSize;
│ │ │ │ +
213 }
│ │ │ │ +
│ │ │ │
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 };
│ │ │ │ +
│ │ │ │ +
216 inline friend std::size_t hash_value(const OverflowArray& v) noexcept {
│ │ │ │ +
217 return hash_range(v.begin(), v.end());
│ │ │ │ +
218 }
│ │ │ │ +
│ │ │ │ +
219
│ │ │ │ +
│ │ │ │ +
221 friend std::ostream& operator<< (std::ostream& s, const OverflowArray& c) {
│ │ │ │ +
222 for (const auto& ci : c)
│ │ │ │ +
223 s << ci << " ";
│ │ │ │ +
224 return s;
│ │ │ │ +
225 }
│ │ │ │ +
│ │ │ │ +
226
│ │ │ │ +
227private:
│ │ │ │ +
228 OverflowBuffer overflow_;
│ │ │ │ +
229 size_type size_ = 0;
│ │ │ │ +
230};
│ │ │ │ +
│ │ │ │ +
231
│ │ │ │
232
│ │ │ │ -
233 auto&& bitVector = toConstVectorBackend(bv);
│ │ │ │ -
234 auto&& vector = toVectorBackend(coeff);
│ │ │ │ -
235 vector.resize(sizeInfo(basis));
│ │ │ │ +
233
│ │ │ │ +
234} // namespace Dune::Functions
│ │ │ │ +
235
│ │ │ │
236
│ │ │ │
237
│ │ │ │ -
238
│ │ │ │ -
239 // Make a grid function supporting local evaluation out of f
│ │ │ │ -
240 auto gf = makeGridViewFunction(f, gridView);
│ │ │ │ -
241
│ │ │ │ -
242 // Obtain a local view of f
│ │ │ │ -
243 auto localF = localFunction(gf);
│ │ │ │ -
244
│ │ │ │ -
245 auto localView = basis.localView();
│ │ │ │ -
246
│ │ │ │ -
247 for (const auto& e : elements(gridView))
│ │ │ │ -
248 {
│ │ │ │ -
249 localView.bind(e);
│ │ │ │ -
250 localF.bind(e);
│ │ │ │ -
251
│ │ │ │ -
252 Imp::LocalInterpolateVisitor<B, Tree, NTRE, decltype(vector), decltype(localF), decltype(bitVector)> localInterpolateVisitor(basis, vector, bitVector, localF, localView, nodeToRangeEntry);
│ │ │ │ -
253 TypeTree::applyToTree(localView.tree(),localInterpolateVisitor);
│ │ │ │ -
254 }
│ │ │ │ -
255}
│ │ │ │ -
│ │ │ │ -
256
│ │ │ │ -
273template <class B, class C, class F, class BV>
│ │ │ │ -
│ │ │ │ -
274void interpolate(const B& basis, C&& coeff, const F& f, const BV& bitVector)
│ │ │ │ -
275{
│ │ │ │ -
276 interpolate(basis, coeff, f, bitVector, HierarchicNodeToRangeMap());
│ │ │ │ -
277}
│ │ │ │ -
│ │ │ │ -
278
│ │ │ │ -
293template <class B, class C, class F>
│ │ │ │ -
│ │ │ │ -
294void interpolate(const B& basis, C&& coeff, const F& f)
│ │ │ │ -
295{
│ │ │ │ -
296 interpolate (basis, coeff, f, Imp::AllTrueBitSetVector(), HierarchicNodeToRangeMap());
│ │ │ │ -
297}
│ │ │ │ -
│ │ │ │ -
298
│ │ │ │ -
299} // namespace Functions
│ │ │ │ -
300} // namespace Dune
│ │ │ │ -
301
│ │ │ │ -
302#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
auto istlVectorBackend(Vector &v)
Return a vector backend wrapping non-const ISTL like containers.
Definition istlvectorbackend.hh:346
│ │ │ │ -
Definition polynomial.hh:10
│ │ │ │ -
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:202
│ │ │ │ -
std::decay< F >::type makeGridViewFunction(F &&f, const GridView &gridView)
Construct a function modeling GridViewFunction from function and grid view.
Definition gridviewfunction.hh:68
│ │ │ │ -
SizeInfo< Basis > sizeInfo(const Basis &basis)
Definition sizeinfo.hh:69
│ │ │ │ -
auto flatVectorView(T &t)
Create flat vector view of passed mutable container.
Definition flatvectorview.hh:179
│ │ │ │ -
A simple node to range map using the nested tree indices.
Definition hierarchicnodetorangemap.hh:30
│ │ │ │ - │ │ │ │ +
238#endif // DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH
│ │ │ │ +
Definition polynomial.hh:11
│ │ │ │ +
A dynamically sized array-like class with overflow.
Definition overflowarray.hh:45
│ │ │ │ +
const value_type & const_reference
Definition overflowarray.hh:53
│ │ │ │ +
value_type & reference
Definition overflowarray.hh:52
│ │ │ │ +
const_iterator end() const
Returns a const_iterator pointing to the end of the OverflowArray.
Definition overflowarray.hh:145
│ │ │ │ +
bool operator==(const OverflowArray &other) const
Definition overflowarray.hh:73
│ │ │ │ +
friend std::size_t hash_value(const OverflowArray &v) noexcept
Compute hash value.
Definition overflowarray.hh:216
│ │ │ │ +
void push_back(const value_type &t)
Appends an element to the end of the OverflowArray,.
Definition overflowarray.hh:104
│ │ │ │ +
friend std::ostream & operator<<(std::ostream &s, const OverflowArray &c)
Write container to an output stream.
Definition overflowarray.hh:221
│ │ │ │ +
iterator begin()
Returns a iterator pointing to the beginning of the OverflowArray.
Definition overflowarray.hh:130
│ │ │ │ +
bool empty() const
Returns true if OverflowArray has no elements.
Definition overflowarray.hh:201
│ │ │ │ +
size_type size() const
Returns number of elements in the OverflowArray.
Definition overflowarray.hh:196
│ │ │ │ +
typename BaseArray::value_type value_type
Definition overflowarray.hh:51
│ │ │ │ +
void pop_back()
Erases the last element of the OverflowArray, O(1) time.
Definition overflowarray.hh:110
│ │ │ │ +
Dune::GenericIterator< OverflowArray, value_type > iterator
Definition overflowarray.hh:57
│ │ │ │ +
const_iterator begin() const
Returns a const_iterator pointing to the beginning of the OverflowArray.
Definition overflowarray.hh:135
│ │ │ │ +
std::ptrdiff_t difference_type
Definition overflowarray.hh:55
│ │ │ │ + │ │ │ │ +
BA BaseArray
Definition overflowarray.hh:49
│ │ │ │ +
static constexpr size_type capacity()
Returns the capacity of the OverflowArray.
Definition overflowarray.hh:206
│ │ │ │ +
static constexpr size_type max_size()
Returns the maximum length of the OverflowArray.
Definition overflowarray.hh:211
│ │ │ │ +
const_reference front() const
Returns const reference to first element of OverflowArray.
Definition overflowarray.hh:178
│ │ │ │ +
void clear()
Erases all elements.
Definition overflowarray.hh:83
│ │ │ │ +
iterator end()
Returns an iterator pointing to the end of the OverflowArray.
Definition overflowarray.hh:140
│ │ │ │ +
std::size_t size_type
Definition overflowarray.hh:56
│ │ │ │ +
void resize(size_type n)
Specifies a new size for the OverflowArray.
Definition overflowarray.hh:93
│ │ │ │ +
value_type * pointer
Definition overflowarray.hh:54
│ │ │ │ +
Dune::GenericIterator< const OverflowArray, const value_type > const_iterator
Definition overflowarray.hh:58
│ │ │ │ +
const_reference back() const
Returns const reference to last element of OverflowArray.
Definition overflowarray.hh:190
│ │ │ │ +
OverflowArray(const std::initializer_list< value_type > &l)
Definition overflowarray.hh:67
│ │ │ │ +
reference back()
Returns reference to last element of OverflowArray.
Definition overflowarray.hh:184
│ │ │ │ +
void push_front(const value_type &t)
Inserts an element to the begin of the OverflowArray,.
Definition overflowarray.hh:122
│ │ │ │ +
reference front()
Returns reference to first element of OverflowArray.
Definition overflowarray.hh:172
│ │ │ │ +
reference operator[](size_type i)
Returns reference to the i'th element.
Definition overflowarray.hh:150
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,314 +1,311 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -interpolate.hh │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ -8 │ │ │ │ │ -9#include │ │ │ │ │ -10#include │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ +8#include │ │ │ │ │ +9#include │ │ │ │ │ +10#include │ │ │ │ │ 11 │ │ │ │ │ -12#include │ │ │ │ │ +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_v_i_e_w_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_/_c_o_m_m_o_n_/_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ │ -16 │ │ │ │ │ -17#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> │ │ │ │ │ -18#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> │ │ │ │ │ -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_/_s_i_z_e_i_n_f_o_._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_/_f_l_a_t_v_e_c_t_o_r_v_i_e_w_._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_/_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 │ │ │ │ │ -23#include │ │ │ │ │ -24#include │ │ │ │ │ -25 │ │ │ │ │ -26namespace _D_u_n_e { │ │ │ │ │ -27namespace Functions { │ │ │ │ │ -28 │ │ │ │ │ -29namespace Imp { │ │ │ │ │ -30 │ │ │ │ │ -31struct AllTrueBitSetVector │ │ │ │ │ -32{ │ │ │ │ │ -33 struct AllTrueBitSet │ │ │ │ │ -34 { │ │ │ │ │ -35 bool test(int) const { return true; } │ │ │ │ │ -36 } allTrue_; │ │ │ │ │ -37 │ │ │ │ │ -38 operator bool() const │ │ │ │ │ -39 { │ │ │ │ │ -40 return true; │ │ │ │ │ -41 } │ │ │ │ │ -42 │ │ │ │ │ -43 template │ │ │ │ │ -44 const AllTrueBitSetVector& operator[](const I&) const │ │ │ │ │ -45 { │ │ │ │ │ -46 return *this; │ │ │ │ │ -47 } │ │ │ │ │ -48 │ │ │ │ │ -49 template │ │ │ │ │ -50 void resize(const SP&) const │ │ │ │ │ -51 {} │ │ │ │ │ -52 │ │ │ │ │ -53}; │ │ │ │ │ -54 │ │ │ │ │ -55 │ │ │ │ │ -56 │ │ │ │ │ -57template │ │ │ │ │ -58class LocalInterpolateVisitor │ │ │ │ │ -59 : public TypeTree::TreeVisitor │ │ │ │ │ -60 , public TypeTree::DynamicTraversal │ │ │ │ │ -61{ │ │ │ │ │ +14 │ │ │ │ │ +15 │ │ │ │ │ +16namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ │ +17 │ │ │ │ │ +18 │ │ │ │ │ +42template> │ │ │ │ │ +_4_3class _O_v_e_r_f_l_o_w_A_r_r_a_y : │ │ │ │ │ +44 public BA │ │ │ │ │ +45{ │ │ │ │ │ +46 static constexpr std::size_t baseSize = std::tuple_size_v; │ │ │ │ │ +47 │ │ │ │ │ +48public: │ │ │ │ │ +_4_9 using _B_a_s_e_A_r_r_a_y = BA; │ │ │ │ │ +50 │ │ │ │ │ +_5_1 using _v_a_l_u_e___t_y_p_e = typename BaseArray::value_type; │ │ │ │ │ +_5_2 using _r_e_f_e_r_e_n_c_e = _v_a_l_u_e___t_y_p_e&; │ │ │ │ │ +_5_3 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_4 using _p_o_i_n_t_e_r = _v_a_l_u_e___t_y_p_e*; │ │ │ │ │ +_5_5 using _d_i_f_f_e_r_e_n_c_e___t_y_p_e = std::ptrdiff_t; │ │ │ │ │ +_5_6 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ +_5_7 using _i_t_e_r_a_t_o_r = Dune::GenericIterator; │ │ │ │ │ +_5_8 using _c_o_n_s_t___i_t_e_r_a_t_o_r = Dune::GenericIterator; │ │ │ │ │ +59 │ │ │ │ │ +60private: │ │ │ │ │ +61 using OverflowBuffer = std::array<_v_a_l_u_e___t_y_p_e, maxSize-baseSize>; │ │ │ │ │ 62 │ │ │ │ │ 63public: │ │ │ │ │ 64 │ │ │ │ │ -65 using Basis = B; │ │ │ │ │ -66 using LocalView = typename B::LocalView; │ │ │ │ │ -67 using MultiIndex = typename LocalView::MultiIndex; │ │ │ │ │ -68 │ │ │ │ │ -69 using LocalFunction = LF; │ │ │ │ │ -70 │ │ │ │ │ -71 using Tree = T; │ │ │ │ │ +_6_5 _O_v_e_r_f_l_o_w_A_r_r_a_y() = default; │ │ │ │ │ +66 │ │ │ │ │ +_6_7 _O_v_e_r_f_l_o_w_A_r_r_a_y(const std::initializer_list& l) { │ │ │ │ │ +68 assert(l.size() <= _c_a_p_a_c_i_t_y()); │ │ │ │ │ +69 size_ = l.size(); │ │ │ │ │ +70 std::copy_n(l.begin(), size_, _b_e_g_i_n()); │ │ │ │ │ +71 } │ │ │ │ │ 72 │ │ │ │ │ -73 using VectorBackend = HV; │ │ │ │ │ -74 using BitVectorBackend = HBV; │ │ │ │ │ -75 │ │ │ │ │ -76 using NodeToRangeEntry = NTRE; │ │ │ │ │ -77 │ │ │ │ │ -78 using GridView = typename Basis::GridView; │ │ │ │ │ -79 using Element = typename GridView::template Codim<0>::Entity; │ │ │ │ │ -80 │ │ │ │ │ -81 using LocalDomain = typename Element::Geometry::LocalCoordinate; │ │ │ │ │ -82 │ │ │ │ │ -83 using GlobalDomain = typename Element::Geometry::GlobalCoordinate; │ │ │ │ │ -84 │ │ │ │ │ -85 LocalInterpolateVisitor(const B& /*basis*/, HV& coeff, const HBV& bitVector, │ │ │ │ │ -const LF& localF, const LocalView& localView, const NodeToRangeEntry& │ │ │ │ │ -nodeToRangeEntry) : │ │ │ │ │ -86 vector_(coeff), │ │ │ │ │ -87 localF_(localF), │ │ │ │ │ -88 bitVector_(bitVector), │ │ │ │ │ -89 localView_(localView), │ │ │ │ │ -90 nodeToRangeEntry_(nodeToRangeEntry) │ │ │ │ │ -91 { │ │ │ │ │ -92 static_assert(Dune::Functions::Concept::isCallable(), "Function passed to LocalInterpolateVisitor does not model the │ │ │ │ │ -Callable concept"); │ │ │ │ │ -93 } │ │ │ │ │ -94 │ │ │ │ │ -95 template │ │ │ │ │ -96 void pre(Node&, TreePath) │ │ │ │ │ -97 {} │ │ │ │ │ -98 │ │ │ │ │ -99 template │ │ │ │ │ -100 void post(Node&, TreePath) │ │ │ │ │ -101 {} │ │ │ │ │ -102 │ │ │ │ │ -103 template │ │ │ │ │ -104 void leaf(Node& node, TreePath treePath) │ │ │ │ │ -105 { │ │ │ │ │ -106 using FiniteElement = typename Node::FiniteElement; │ │ │ │ │ -107 using FiniteElementRange = typename FiniteElement::Traits::LocalBasisType:: │ │ │ │ │ -Traits::RangeType; │ │ │ │ │ -108 using FiniteElementRangeField = typename FiniteElement::Traits:: │ │ │ │ │ -LocalBasisType::Traits::RangeFieldType; │ │ │ │ │ -109 │ │ │ │ │ -110 auto interpolationCoefficients = std::vector(); │ │ │ │ │ -111 auto&& fe = node.finiteElement(); │ │ │ │ │ -112 │ │ │ │ │ -113 // backward compatibility: for scalar basis functions and possibly vector │ │ │ │ │ -valued coefficients │ │ │ │ │ -114 // (like used in dune-fufem for power bases) loop over the components │ │ │ │ │ -115 // of the coefficients │ │ │ │ │ -116 if constexpr ( FiniteElement::Traits::LocalBasisType::Traits::dimRange == 1 │ │ │ │ │ -) │ │ │ │ │ -117 { │ │ │ │ │ -118 // Note that we capture j by reference. Hence we can switch │ │ │ │ │ -119 // the selected component later on by modifying j. Maybe we │ │ │ │ │ -120 // should avoid this naughty statefull lambda hack in favor │ │ │ │ │ -121 // of a separate helper class. │ │ │ │ │ -122 std::size_t j=0; │ │ │ │ │ -123 auto localFj = [&](const LocalDomain& x){ │ │ │ │ │ -124 const auto& y = localF_(x); │ │ │ │ │ -125 return FiniteElementRange(_f_l_a_t_V_e_c_t_o_r_V_i_e_w(nodeToRangeEntry_(node, treePath, │ │ │ │ │ -y))[j]); │ │ │ │ │ -126 }; │ │ │ │ │ -127 │ │ │ │ │ -128 // We loop over j defined above and thus over the components of the │ │ │ │ │ -129 // range type of localF_. │ │ │ │ │ -130 │ │ │ │ │ -131 auto blockSize = _f_l_a_t_V_e_c_t_o_r_V_i_e_w(vector_[localView_.index(0)]).size(); │ │ │ │ │ -132 │ │ │ │ │ -133 for(j=0; j 0); │ │ │ │ │ +112 if (! _e_m_p_t_y()) │ │ │ │ │ +113 size_--; │ │ │ │ │ +114 } │ │ │ │ │ +115 │ │ │ │ │ +_1_2_2 void _p_u_s_h___f_r_o_n_t(const _v_a_l_u_e___t_y_p_e& t) { │ │ │ │ │ +123 assert(_s_i_z_e() < _c_a_p_a_c_i_t_y()); │ │ │ │ │ +124 for (_s_i_z_e___t_y_p_e i=0; i<_s_i_z_e(); i++) │ │ │ │ │ +125 (*this)[i+1] = (*this)[i]; │ │ │ │ │ +126 (*this)[0] = t; │ │ │ │ │ +127 } │ │ │ │ │ +128 │ │ │ │ │ +_1_3_0 _i_t_e_r_a_t_o_r _b_e_g_i_n() { │ │ │ │ │ +131 return _i_t_e_r_a_t_o_r(*this, 0); │ │ │ │ │ +132 } │ │ │ │ │ +133 │ │ │ │ │ +_1_3_5 _c_o_n_s_t___i_t_e_r_a_t_o_r _b_e_g_i_n() const { │ │ │ │ │ +136 return _c_o_n_s_t___i_t_e_r_a_t_o_r(*this, 0); │ │ │ │ │ +137 } │ │ │ │ │ +138 │ │ │ │ │ +_1_4_0 _i_t_e_r_a_t_o_r _e_n_d() { │ │ │ │ │ +141 return _i_t_e_r_a_t_o_r(*this, _s_i_z_e()); │ │ │ │ │ +142 } │ │ │ │ │ +143 │ │ │ │ │ +_1_4_5 _c_o_n_s_t___i_t_e_r_a_t_o_r _e_n_d() const { │ │ │ │ │ +146 return _c_o_n_s_t___i_t_e_r_a_t_o_r(*this, _s_i_z_e()); │ │ │ │ │ 147 } │ │ │ │ │ -148 else // ( FiniteElement::Traits::LocalBasisType::Traits::dimRange != 1 ) │ │ │ │ │ -149 { │ │ │ │ │ -150 // for all other finite elements: use the FiniteElementRange directly for │ │ │ │ │ -the interpolation │ │ │ │ │ -151 auto localF = [&](const LocalDomain& x){ │ │ │ │ │ -152 const auto& y = localF_(x); │ │ │ │ │ -153 return FiniteElementRange(nodeToRangeEntry_(node, treePath, y)); │ │ │ │ │ -154 }; │ │ │ │ │ -155 │ │ │ │ │ -156 fe.localInterpolation().interpolate(localF, interpolationCoefficients); │ │ │ │ │ -157 for (size_t i=0; i 0); │ │ │ │ │ +174 return (*this)[0]; │ │ │ │ │ +175 } │ │ │ │ │ +176 │ │ │ │ │ +_1_7_8 _c_o_n_s_t___r_e_f_e_r_e_n_c_e _f_r_o_n_t() const { │ │ │ │ │ +179 assert(_s_i_z_e() > 0); │ │ │ │ │ +180 return (*this)[0]; │ │ │ │ │ +181 } │ │ │ │ │ 182 │ │ │ │ │ -183 │ │ │ │ │ -201template │ │ │ │ │ -_2_0_2void _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) │ │ │ │ │ -203{ │ │ │ │ │ -204 using GridView = typename B::GridView; │ │ │ │ │ -205 using Element = typename GridView::template Codim<0>::Entity; │ │ │ │ │ -206 │ │ │ │ │ -207 using Tree = typename B::LocalView::Tree; │ │ │ │ │ -208 │ │ │ │ │ -209 using GlobalDomain = typename Element::Geometry::GlobalCoordinate; │ │ │ │ │ -210 │ │ │ │ │ -211 static_assert(Dune::Functions::Concept::isCallable(), │ │ │ │ │ -"Function passed to interpolate does not model the Callable │ │ │ │ │ -concept"); │ │ │ │ │ -212 │ │ │ │ │ -213 auto&& gridView = basis.gridView(); │ │ │ │ │ +_1_8_4 _r_e_f_e_r_e_n_c_e _b_a_c_k() { │ │ │ │ │ +185 assert(_s_i_z_e() > 0); │ │ │ │ │ +186 return (*this)[_s_i_z_e()-1]; │ │ │ │ │ +187 } │ │ │ │ │ +188 │ │ │ │ │ +_1_9_0 _c_o_n_s_t___r_e_f_e_r_e_n_c_e _b_a_c_k() const { │ │ │ │ │ +191 assert(_s_i_z_e() > 0); │ │ │ │ │ +192 return (*this)[_s_i_z_e()-1]; │ │ │ │ │ +193 } │ │ │ │ │ +194 │ │ │ │ │ +_1_9_6 _s_i_z_e___t_y_p_e _s_i_z_e () const { │ │ │ │ │ +197 return size_; │ │ │ │ │ +198 } │ │ │ │ │ +199 │ │ │ │ │ +_2_0_1 bool _e_m_p_t_y() const { │ │ │ │ │ +202 return _s_i_z_e() == 0; │ │ │ │ │ +203 } │ │ │ │ │ +204 │ │ │ │ │ +_2_0_6 static constexpr _s_i_z_e___t_y_p_e _c_a_p_a_c_i_t_y() { │ │ │ │ │ +207 return maxSize; │ │ │ │ │ +208 } │ │ │ │ │ +209 │ │ │ │ │ +_2_1_1 static constexpr _s_i_z_e___t_y_p_e _m_a_x___s_i_z_e() { │ │ │ │ │ +212 return maxSize; │ │ │ │ │ +213 } │ │ │ │ │ 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 }; │ │ │ │ │ +_2_1_6 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 { │ │ │ │ │ +217 return hash_range(v.begin(), v.end()); │ │ │ │ │ +218 } │ │ │ │ │ +219 │ │ │ │ │ +_2_2_1 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) { │ │ │ │ │ +222 for (const auto& ci : c) │ │ │ │ │ +223 s << ci << " "; │ │ │ │ │ +224 return s; │ │ │ │ │ +225 } │ │ │ │ │ +226 │ │ │ │ │ +227private: │ │ │ │ │ +228 OverflowBuffer overflow_; │ │ │ │ │ +229 _s_i_z_e___t_y_p_e size_ = 0; │ │ │ │ │ +230}; │ │ │ │ │ +231 │ │ │ │ │ 232 │ │ │ │ │ -233 auto&& bitVector = toConstVectorBackend(bv); │ │ │ │ │ -234 auto&& vector = toVectorBackend(coeff); │ │ │ │ │ -235 vector.resize(_s_i_z_e_I_n_f_o(basis)); │ │ │ │ │ +233 │ │ │ │ │ +234} // namespace Dune::Functions │ │ │ │ │ +235 │ │ │ │ │ 236 │ │ │ │ │ 237 │ │ │ │ │ -238 │ │ │ │ │ -239 // Make a grid function supporting local evaluation out of f │ │ │ │ │ -240 auto gf = _m_a_k_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n(f, gridView); │ │ │ │ │ -241 │ │ │ │ │ -242 // Obtain a local view of f │ │ │ │ │ -243 auto localF = localFunction(gf); │ │ │ │ │ -244 │ │ │ │ │ -245 auto localView = basis.localView(); │ │ │ │ │ -246 │ │ │ │ │ -247 for (const auto& e : elements(gridView)) │ │ │ │ │ -248 { │ │ │ │ │ -249 localView.bind(e); │ │ │ │ │ -250 localF.bind(e); │ │ │ │ │ -251 │ │ │ │ │ -252 Imp::LocalInterpolateVisitor localInterpolateVisitor(basis, vector, │ │ │ │ │ -bitVector, localF, localView, nodeToRangeEntry); │ │ │ │ │ -253 TypeTree::applyToTree(localView.tree(),localInterpolateVisitor); │ │ │ │ │ -254 } │ │ │ │ │ -255} │ │ │ │ │ -256 │ │ │ │ │ -273template │ │ │ │ │ -_2_7_4void _i_n_t_e_r_p_o_l_a_t_e(const B& basis, C&& coeff, const F& f, const BV& bitVector) │ │ │ │ │ -275{ │ │ │ │ │ -276 _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()); │ │ │ │ │ -277} │ │ │ │ │ -278 │ │ │ │ │ -293template │ │ │ │ │ -_2_9_4void _i_n_t_e_r_p_o_l_a_t_e(const B& basis, C&& coeff, const F& f) │ │ │ │ │ -295{ │ │ │ │ │ -296 _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()); │ │ │ │ │ -297} │ │ │ │ │ -298 │ │ │ │ │ -299} // namespace Functions │ │ │ │ │ -300} // namespace Dune │ │ │ │ │ -301 │ │ │ │ │ -302#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH │ │ │ │ │ -_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 │ │ │ │ │ -_s_i_z_e_i_n_f_o_._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 │ │ │ │ │ -_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_:_:_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:346 │ │ │ │ │ -_D_u_n_e │ │ │ │ │ -DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:202 │ │ │ │ │ -_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< F >::type makeGridViewFunction(F &&f, const GridView &gridView) │ │ │ │ │ -Construct a function modeling GridViewFunction from function and grid view. │ │ │ │ │ -DDeeffiinniittiioonn gridviewfunction.hh:68 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_s_i_z_e_I_n_f_o │ │ │ │ │ -SizeInfo< Basis > sizeInfo(const Basis &basis) │ │ │ │ │ -DDeeffiinniittiioonn sizeinfo.hh:69 │ │ │ │ │ -_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:179 │ │ │ │ │ -_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:30 │ │ │ │ │ -_c_o_n_c_e_p_t_s_._h_h │ │ │ │ │ +238#endif // DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ │ +DDeeffiinniittiioonn polynomial.hh:11 │ │ │ │ │ +_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:45 │ │ │ │ │ +_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: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_:_:_r_e_f_e_r_e_n_c_e │ │ │ │ │ +value_type & reference │ │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:52 │ │ │ │ │ +_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:145 │ │ │ │ │ +_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:73 │ │ │ │ │ +_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:216 │ │ │ │ │ +_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:104 │ │ │ │ │ +_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:221 │ │ │ │ │ +_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:130 │ │ │ │ │ +_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:201 │ │ │ │ │ +_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:196 │ │ │ │ │ +_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:51 │ │ │ │ │ +_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:110 │ │ │ │ │ +_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: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_:_:_b_e_g_i_n │ │ │ │ │ +const_iterator begin() const │ │ │ │ │ +Returns a const_iterator pointing to the beginning of the OverflowArray. │ │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:135 │ │ │ │ │ +_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: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_:_:_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:49 │ │ │ │ │ +_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:206 │ │ │ │ │ +_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:211 │ │ │ │ │ +_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:178 │ │ │ │ │ +_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:83 │ │ │ │ │ +_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:140 │ │ │ │ │ +_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: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_:_:_r_e_s_i_z_e │ │ │ │ │ +void resize(size_type n) │ │ │ │ │ +Specifies a new size for the OverflowArray. │ │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:93 │ │ │ │ │ +_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:54 │ │ │ │ │ +_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: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_:_:_b_a_c_k │ │ │ │ │ +const_reference back() const │ │ │ │ │ +Returns const reference to last element of OverflowArray. │ │ │ │ │ +DDeeffiinniittiioonn overflowarray.hh:190 │ │ │ │ │ +_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:67 │ │ │ │ │ +_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:184 │ │ │ │ │ +_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:122 │ │ │ │ │ +_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:172 │ │ │ │ │ +_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:150 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00086.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: defaultlocalview.hh File Reference │ │ │ │ +dune-functions: functionfromcallable.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,39 +65,33 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
defaultlocalview.hh File Reference
│ │ │ │ +
functionfromcallable.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 <dune/common/function.hh>
│ │ │ │ +#include <dune/functions/common/signature.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...
class  Dune::Functions::FunctionFromCallable< Range(Domain), F, FunctionInterface >
 Wrap a callable object as Dune::Function or Dune::VirtualFunction. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,28 +1,24 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_m_o_n │ │ │ │ │ _C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -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> │ │ │ │ │ +functionfromcallable.hh File Reference │ │ │ │ │ +#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> │ │ │ │ │ _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_:_:_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _F_, │ │ │ │ │ + _F_u_n_c_t_i_o_n_I_n_t_e_r_f_a_c_e_ _> │ │ │ │ │ +  Wrap a callable object as Dune::Function or Dune::VirtualFunction. │ │ │ │ │ + _M_o_r_e_._._. │ │ │ │ │   │ │ │ │ │ NNaammeessppaacceess │ │ │ │ │ namespace   _D_u_n_e │ │ │ │ │   │ │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00086_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: defaultlocalview.hh Source File │ │ │ │ +dune-functions: functionfromcallable.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,220 +70,85 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
defaultlocalview.hh
│ │ │ │ +
functionfromcallable.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_COMMON_FUNCTION_FROM_CALLABLE_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_COMMON_FUNCTION_FROM_CALLABLE_HH
│ │ │ │
5
│ │ │ │ -
6
│ │ │ │ -
7#include <tuple>
│ │ │ │ -
8#include <optional>
│ │ │ │ +
6#include <dune/common/function.hh>
│ │ │ │ +
7
│ │ │ │ + │ │ │ │
9
│ │ │ │ -
10#include <dune/common/concept.hh>
│ │ │ │ -
11#include <dune/common/hybridutilities.hh>
│ │ │ │ -
12#include <dune/common/reservedvector.hh>
│ │ │ │ +
10
│ │ │ │ +
11namespace Dune {
│ │ │ │ +
12namespace Functions {
│ │ │ │
13
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
17
│ │ │ │ -
18
│ │ │ │ -
19
│ │ │ │ -
20namespace Dune {
│ │ │ │ -
21namespace Functions {
│ │ │ │ -
22
│ │ │ │ -
23
│ │ │ │ -
24
│ │ │ │ -
26template<class GB>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
28{
│ │ │ │ -
29public:
│ │ │ │ -
30
│ │ │ │ -
32 using GlobalBasis = GB;
│ │ │ │ -
33
│ │ │ │ -
35 using GridView = typename GlobalBasis::GridView;
│ │ │ │ -
36
│ │ │ │ -
38 using Element = typename GridView::template Codim<0>::Entity;
│ │ │ │ -
39
│ │ │ │ -
41 using size_type = std::size_t;
│ │ │ │ +
14
│ │ │ │ +
15
│ │ │ │ +
16template<class Signature, class F,
│ │ │ │ +
17 class FunctionInterface = typename Dune::VirtualFunction<
│ │ │ │ +
18 typename SignatureTraits<Signature>::RawDomain,
│ │ │ │ +
19 typename SignatureTraits<Signature>::RawRange> >
│ │ │ │ + │ │ │ │ +
21
│ │ │ │ +
37template<class Range, class Domain, class F, class FunctionInterface>
│ │ │ │ +
│ │ │ │ +
38class FunctionFromCallable<Range(Domain), F, FunctionInterface> :
│ │ │ │ +
39 public FunctionInterface
│ │ │ │ +
40{
│ │ │ │ +
41public:
│ │ │ │
42
│ │ │ │ -
44 using Tree = typename GlobalBasis::PreBasis::Node;
│ │ │ │ -
45
│ │ │ │ -
46protected:
│ │ │ │ -
47
│ │ │ │ -
48 using PreBasis = typename GlobalBasis::PreBasis;
│ │ │ │ -
49
│ │ │ │ -
50 // Type used to store the multi indices of the basis vectors.
│ │ │ │ -
51 // In contrast to MultiIndex this always has dynamic size.
│ │ │ │ -
52 // It's guaranteed, that you can always cast it to MultiIndex
│ │ │ │ - │ │ │ │ -
54 std::conditional_t<(PreBasis::minMultiIndexSize == PreBasis::maxMultiIndexSize),
│ │ │ │ - │ │ │ │ -
56 Dune::ReservedVector<size_type, PreBasis::multiIndexBufferSize>>;
│ │ │ │ -
57
│ │ │ │ -
58public:
│ │ │ │ -
59
│ │ │ │ -
61 using MultiIndex =
│ │ │ │ -
62 std::conditional_t<(PreBasis::minMultiIndexSize == PreBasis::maxMultiIndexSize),
│ │ │ │ - │ │ │ │ -
64 Dune::ReservedVector<size_type, PreBasis::multiIndexBufferSize>>;
│ │ │ │ -
65
│ │ │ │ -
66
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ -
70 tree_(globalBasis_->preBasis().makeNode())
│ │ │ │ -
71 {
│ │ │ │ -
72 static_assert(models<Concept::BasisTree<GridView>, Tree>(), "Tree type passed to DefaultLocalView does not model the BasisNode concept.");
│ │ │ │ - │ │ │ │ -
74 }
│ │ │ │ -
│ │ │ │ -
75
│ │ │ │ -
│ │ │ │ -
81 void bind(const Element& e)
│ │ │ │ -
82 {
│ │ │ │ -
83 element_ = e;
│ │ │ │ - │ │ │ │ -
85 indices_.resize(size());
│ │ │ │ -
86 globalBasis_->preBasis().indices(tree_, indices_.begin());
│ │ │ │ -
87 }
│ │ │ │ -
│ │ │ │ -
88
│ │ │ │ -
91 [[deprecated("Use the bound() method instead")]]
│ │ │ │ -
│ │ │ │ -
92 bool isBound() const {
│ │ │ │ -
93 return static_cast<bool>(element_);
│ │ │ │ -
94 }
│ │ │ │ -
│ │ │ │ -
95
│ │ │ │ -
│ │ │ │ -
98 bool bound() const
│ │ │ │ -
99 {
│ │ │ │ -
100 return static_cast<bool>(element_);
│ │ │ │ -
101 }
│ │ │ │ -
│ │ │ │ -
102
│ │ │ │ -
│ │ │ │ -
107 const Element& element() const
│ │ │ │ -
108 {
│ │ │ │ -
109 return *element_;
│ │ │ │ -
110 }
│ │ │ │ -
│ │ │ │ -
111
│ │ │ │ -
│ │ │ │ -
116 void unbind()
│ │ │ │ -
117 {
│ │ │ │ -
118 element_.reset();
│ │ │ │ -
119 }
│ │ │ │ -
│ │ │ │ -
120
│ │ │ │ -
│ │ │ │ -
125 const Tree& tree() const
│ │ │ │ -
126 {
│ │ │ │ -
127 return tree_;
│ │ │ │ -
128 }
│ │ │ │ -
│ │ │ │ -
129
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
133 {
│ │ │ │ -
134 return tree_.size();
│ │ │ │ -
135 }
│ │ │ │ -
│ │ │ │ -
136
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
144 {
│ │ │ │ -
145 return globalBasis_->preBasis().maxNodeSize();
│ │ │ │ -
146 }
│ │ │ │ -
│ │ │ │ -
147
│ │ │ │ -
│ │ │ │ -
149 const MultiIndex& index(size_type i) const
│ │ │ │ -
150 {
│ │ │ │ -
151 return indices_[i];
│ │ │ │ -
152 }
│ │ │ │ -
│ │ │ │ -
153
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
157 {
│ │ │ │ -
158 return *globalBasis_;
│ │ │ │ -
159 }
│ │ │ │ -
│ │ │ │ -
160
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
162 {
│ │ │ │ -
163 return *this;
│ │ │ │ -
164 }
│ │ │ │ -
│ │ │ │ -
165
│ │ │ │ -
166protected:
│ │ │ │ - │ │ │ │ -
168 std::optional<Element> element_;
│ │ │ │ - │ │ │ │ -
170 std::vector<MultiIndexStorage> indices_;
│ │ │ │ -
171};
│ │ │ │ -
│ │ │ │ -
172
│ │ │ │ -
173
│ │ │ │ -
174
│ │ │ │ -
175} // end namespace Functions
│ │ │ │ -
176} // end namespace Dune
│ │ │ │ -
177
│ │ │ │ -
178
│ │ │ │ -
179
│ │ │ │ -
180#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ +
│ │ │ │ + │ │ │ │ +
53 f_(f)
│ │ │ │ +
54 {}
│ │ │ │ +
│ │ │ │ +
55
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
65 f_(f)
│ │ │ │ +
66 {}
│ │ │ │ +
│ │ │ │ +
67
│ │ │ │ +
│ │ │ │ +
73 void evaluate(const Domain& x, Range&y) const
│ │ │ │ +
74 {
│ │ │ │ +
75 y = f_(x);
│ │ │ │ +
76 }
│ │ │ │ +
│ │ │ │ +
77
│ │ │ │ +
78private:
│ │ │ │ +
79 F f_;
│ │ │ │ +
80};
│ │ │ │ +
│ │ │ │ +
81
│ │ │ │ +
82
│ │ │ │ +
83
│ │ │ │ +
84} // namespace Functions
│ │ │ │ +
85} // namespace Dune
│ │ │ │ +
86
│ │ │ │ +
87#endif //DUNE_FUNCTIONS_COMMON_FUNCTION_FROM_CALLABLE_HH
│ │ │ │ + │ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
void bindTree(Tree &tree, const Entity &entity, std::size_t offset=0)
Definition nodes.hh:253
│ │ │ │ -
void initializeTree(Tree &tree, std::size_t treeIndexOffset=0)
Definition nodes.hh:260
│ │ │ │ -
A statically sized MultiIndex type.
Definition multiindex.hh:25
│ │ │ │ -
A dynamically sized array-like class with overflow.
Definition overflowarray.hh:45
│ │ │ │ -
The restriction of a finite element basis to a single element.
Definition defaultlocalview.hh:28
│ │ │ │ -
typename GlobalBasis::PreBasis PreBasis
Definition defaultlocalview.hh:48
│ │ │ │ -
void unbind()
Unbind from the current element.
Definition defaultlocalview.hh:116
│ │ │ │ -
bool bound() const
Return if the view is bound to a grid element.
Definition defaultlocalview.hh:98
│ │ │ │ -
typename GlobalBasis::GridView GridView
The grid view the global FE basis lives on.
Definition defaultlocalview.hh:35
│ │ │ │ -
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:149
│ │ │ │ -
std::optional< Element > element_
Definition defaultlocalview.hh:168
│ │ │ │ -
typename GridView::template Codim< 0 >::Entity Element
Type of the grid element we are bound to.
Definition defaultlocalview.hh:38
│ │ │ │ -
const Tree & tree() const
Return the local ansatz tree associated to the bound entity.
Definition defaultlocalview.hh:125
│ │ │ │ -
void bind(const Element &e)
Bind the view to a grid element.
Definition defaultlocalview.hh:81
│ │ │ │ -
const Element & element() const
Return the grid element that the view is bound to.
Definition defaultlocalview.hh:107
│ │ │ │ -
size_type size() const
Total number of degrees of freedom on this element.
Definition defaultlocalview.hh:132
│ │ │ │ -
GB GlobalBasis
The global FE basis that this is a view on.
Definition defaultlocalview.hh:32
│ │ │ │ -
Tree tree_
Definition defaultlocalview.hh:169
│ │ │ │ -
size_type maxSize() const
Maximum local size for any element on the GridView.
Definition defaultlocalview.hh:143
│ │ │ │ -
std::size_t size_type
The type used for sizes.
Definition defaultlocalview.hh:41
│ │ │ │ -
bool isBound() const
Return if the view is bound to a grid element.
Definition defaultlocalview.hh:92
│ │ │ │ -
const DefaultLocalView & rootLocalView() const
Definition defaultlocalview.hh:161
│ │ │ │ -
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:56
│ │ │ │ -
std::conditional_t<(PreBasis::minMultiIndexSize==PreBasis::maxMultiIndexSize), StaticMultiIndex< size_type, PreBasis::maxMultiIndexSize >, Dune::ReservedVector< size_type, PreBasis::multiIndexBufferSize > > MultiIndex
Type used for global numbering of the basis vectors.
Definition defaultlocalview.hh:64
│ │ │ │ -
std::vector< MultiIndexStorage > indices_
Definition defaultlocalview.hh:170
│ │ │ │ -
typename GlobalBasis::PreBasis::Node Tree
Tree of local finite elements / local shape function sets.
Definition defaultlocalview.hh:44
│ │ │ │ -
DefaultLocalView(const GlobalBasis &globalBasis)
Construct local view for a given global finite element basis.
Definition defaultlocalview.hh:68
│ │ │ │ -
const GlobalBasis * globalBasis_
Definition defaultlocalview.hh:167
│ │ │ │ -
const GlobalBasis & globalBasis() const
Return the global basis that we are a view on.
Definition defaultlocalview.hh:156
│ │ │ │ - │ │ │ │ +
Definition functionfromcallable.hh:20
│ │ │ │ +
FunctionFromCallable(F &&f)
Create VirtualFunction from callable object.
Definition functionfromcallable.hh:52
│ │ │ │ +
void evaluate(const Domain &x, Range &y) const
Evaluate function.
Definition functionfromcallable.hh:73
│ │ │ │ +
FunctionFromCallable(const F &f)
Create VirtualFunction from callable object.
Definition functionfromcallable.hh:64
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,270 +1,81 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -defaultlocalview.hh │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +functionfromcallable.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_COMMON_FUNCTION_FROM_CALLABLE_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_COMMON_FUNCTION_FROM_CALLABLE_HH │ │ │ │ │ 5 │ │ │ │ │ -6 │ │ │ │ │ -7#include │ │ │ │ │ -8#include │ │ │ │ │ +6#include │ │ │ │ │ +7 │ │ │ │ │ +8#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> │ │ │ │ │ 9 │ │ │ │ │ -10#include │ │ │ │ │ -11#include │ │ │ │ │ -12#include │ │ │ │ │ +10 │ │ │ │ │ +11namespace _D_u_n_e { │ │ │ │ │ +12namespace Functions { │ │ │ │ │ 13 │ │ │ │ │ -14#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> │ │ │ │ │ -15#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> │ │ │ │ │ -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 │ │ │ │ │ -18 │ │ │ │ │ -19 │ │ │ │ │ -20namespace _D_u_n_e { │ │ │ │ │ -21namespace Functions { │ │ │ │ │ -22 │ │ │ │ │ -23 │ │ │ │ │ -24 │ │ │ │ │ -26template │ │ │ │ │ -_2_7class _D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w │ │ │ │ │ -28{ │ │ │ │ │ -29public: │ │ │ │ │ -30 │ │ │ │ │ -_3_2 using _G_l_o_b_a_l_B_a_s_i_s = GB; │ │ │ │ │ -33 │ │ │ │ │ -_3_5 using _G_r_i_d_V_i_e_w = typename GlobalBasis::GridView; │ │ │ │ │ -36 │ │ │ │ │ -_3_8 using _E_l_e_m_e_n_t = typename GridView::template Codim<0>::Entity; │ │ │ │ │ -39 │ │ │ │ │ -_4_1 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ +14 │ │ │ │ │ +15 │ │ │ │ │ +16template::RawDomain, │ │ │ │ │ +19 typename SignatureTraits::RawRange> > │ │ │ │ │ +_2_0class _F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e; │ │ │ │ │ +21 │ │ │ │ │ +37template │ │ │ │ │ +_3_8class _F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e : │ │ │ │ │ +39 public FunctionInterface │ │ │ │ │ +40{ │ │ │ │ │ +41public: │ │ │ │ │ 42 │ │ │ │ │ -_4_4 using _T_r_e_e = typename GlobalBasis::PreBasis::Node; │ │ │ │ │ -45 │ │ │ │ │ -46protected: │ │ │ │ │ -47 │ │ │ │ │ -_4_8 using _P_r_e_B_a_s_i_s = typename GlobalBasis::PreBasis; │ │ │ │ │ -49 │ │ │ │ │ -50 // Type used to store the multi indices of the basis vectors. │ │ │ │ │ -51 // In contrast to MultiIndex this always has dynamic size. │ │ │ │ │ -52 // It's guaranteed, that you can always cast it to MultiIndex │ │ │ │ │ -_5_3 using _M_u_l_t_i_I_n_d_e_x_S_t_o_r_a_g_e = │ │ │ │ │ -54 std::conditional_t<(PreBasis::minMultiIndexSize == PreBasis:: │ │ │ │ │ -maxMultiIndexSize), │ │ │ │ │ -55 _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>, │ │ │ │ │ -56 Dune::ReservedVector>; │ │ │ │ │ -57 │ │ │ │ │ -58public: │ │ │ │ │ -59 │ │ │ │ │ -_6_1 using _M_u_l_t_i_I_n_d_e_x = │ │ │ │ │ -62 std::conditional_t<(PreBasis::minMultiIndexSize == PreBasis:: │ │ │ │ │ -maxMultiIndexSize), │ │ │ │ │ -63 _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_>, │ │ │ │ │ -64 Dune::ReservedVector>; │ │ │ │ │ -65 │ │ │ │ │ -66 │ │ │ │ │ -_6_8 _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) : │ │ │ │ │ -69 _g_l_o_b_a_l_B_a_s_i_s__(&_g_l_o_b_a_l_B_a_s_i_s), │ │ │ │ │ -70 _t_r_e_e__(_g_l_o_b_a_l_B_a_s_i_s__->preBasis().makeNode()) │ │ │ │ │ -71 { │ │ │ │ │ -72 static_assert(models, _T_r_e_e>(), "Tree type │ │ │ │ │ -passed to DefaultLocalView does not model the BasisNode concept."); │ │ │ │ │ -73 _i_n_i_t_i_a_l_i_z_e_T_r_e_e(_t_r_e_e__); │ │ │ │ │ -74 } │ │ │ │ │ -75 │ │ │ │ │ -_8_1 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ │ -82 { │ │ │ │ │ -83 _e_l_e_m_e_n_t__ = e; │ │ │ │ │ -84 _b_i_n_d_T_r_e_e(_t_r_e_e__, *_e_l_e_m_e_n_t__); │ │ │ │ │ -85 _i_n_d_i_c_e_s__.resize(_s_i_z_e()); │ │ │ │ │ -86 _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()); │ │ │ │ │ -87 } │ │ │ │ │ -88 │ │ │ │ │ -91 [[deprecated("Use the bound() method instead")]] │ │ │ │ │ -_9_2 bool _i_s_B_o_u_n_d() const { │ │ │ │ │ -93 return static_cast(_e_l_e_m_e_n_t__); │ │ │ │ │ -94 } │ │ │ │ │ -95 │ │ │ │ │ -_9_8 bool _b_o_u_n_d() const │ │ │ │ │ -99 { │ │ │ │ │ -100 return static_cast(_e_l_e_m_e_n_t__); │ │ │ │ │ -101 } │ │ │ │ │ -102 │ │ │ │ │ -_1_0_7 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ │ -108 { │ │ │ │ │ -109 return *_e_l_e_m_e_n_t__; │ │ │ │ │ -110 } │ │ │ │ │ -111 │ │ │ │ │ -_1_1_6 void _u_n_b_i_n_d() │ │ │ │ │ -117 { │ │ │ │ │ -118 _e_l_e_m_e_n_t__.reset(); │ │ │ │ │ -119 } │ │ │ │ │ -120 │ │ │ │ │ -_1_2_5 const _T_r_e_e& _t_r_e_e() const │ │ │ │ │ -126 { │ │ │ │ │ -127 return _t_r_e_e__; │ │ │ │ │ -128 } │ │ │ │ │ -129 │ │ │ │ │ -_1_3_2 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ │ -133 { │ │ │ │ │ -134 return _t_r_e_e__.size(); │ │ │ │ │ -135 } │ │ │ │ │ -136 │ │ │ │ │ -_1_4_3 _s_i_z_e___t_y_p_e _m_a_x_S_i_z_e() const │ │ │ │ │ -144 { │ │ │ │ │ -145 return _g_l_o_b_a_l_B_a_s_i_s__->preBasis().maxNodeSize(); │ │ │ │ │ -146 } │ │ │ │ │ -147 │ │ │ │ │ -_1_4_9 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 │ │ │ │ │ -150 { │ │ │ │ │ -151 return _i_n_d_i_c_e_s__[i]; │ │ │ │ │ -152 } │ │ │ │ │ -153 │ │ │ │ │ -_1_5_6 const _G_l_o_b_a_l_B_a_s_i_s& _g_l_o_b_a_l_B_a_s_i_s() const │ │ │ │ │ -157 { │ │ │ │ │ -158 return *_g_l_o_b_a_l_B_a_s_i_s__; │ │ │ │ │ -159 } │ │ │ │ │ -160 │ │ │ │ │ -_1_6_1 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 │ │ │ │ │ -162 { │ │ │ │ │ -163 return *this; │ │ │ │ │ -164 } │ │ │ │ │ -165 │ │ │ │ │ -166protected: │ │ │ │ │ -_1_6_7 const _G_l_o_b_a_l_B_a_s_i_s* _g_l_o_b_a_l_B_a_s_i_s__; │ │ │ │ │ -_1_6_8 std::optional _e_l_e_m_e_n_t__; │ │ │ │ │ -_1_6_9 _T_r_e_e _t_r_e_e__; │ │ │ │ │ -_1_7_0 std::vector _i_n_d_i_c_e_s__; │ │ │ │ │ -171}; │ │ │ │ │ -172 │ │ │ │ │ -173 │ │ │ │ │ -174 │ │ │ │ │ -175} // end namespace Functions │ │ │ │ │ -176} // end namespace Dune │ │ │ │ │ -177 │ │ │ │ │ -178 │ │ │ │ │ -179 │ │ │ │ │ -180#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH │ │ │ │ │ -_m_u_l_t_i_i_n_d_e_x_._h_h │ │ │ │ │ -_o_v_e_r_f_l_o_w_a_r_r_a_y_._h_h │ │ │ │ │ +_5_2 _F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e(F&& f) : │ │ │ │ │ +53 f_(f) │ │ │ │ │ +54 {} │ │ │ │ │ +55 │ │ │ │ │ +_6_4 _F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e(const F& f) : │ │ │ │ │ +65 f_(f) │ │ │ │ │ +66 {} │ │ │ │ │ +67 │ │ │ │ │ +_7_3 void _e_v_a_l_u_a_t_e(const Domain& x, Range&y) const │ │ │ │ │ +74 { │ │ │ │ │ +75 y = f_(x); │ │ │ │ │ +76 } │ │ │ │ │ +77 │ │ │ │ │ +78private: │ │ │ │ │ +79 F f_; │ │ │ │ │ +80}; │ │ │ │ │ +81 │ │ │ │ │ +82 │ │ │ │ │ +83 │ │ │ │ │ +84} // namespace Functions │ │ │ │ │ +85} // namespace Dune │ │ │ │ │ +86 │ │ │ │ │ +87#endif //DUNE_FUNCTIONS_COMMON_FUNCTION_FROM_CALLABLE_HH │ │ │ │ │ +_s_i_g_n_a_t_u_r_e_._h_h │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:253 │ │ │ │ │ -_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:260 │ │ │ │ │ -_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:25 │ │ │ │ │ -_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: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 │ │ │ │ │ -The restriction of a finite element basis to a single element. │ │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:28 │ │ │ │ │ -_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_:_:_P_r_e_B_a_s_i_s │ │ │ │ │ -typename GlobalBasis::PreBasis PreBasis │ │ │ │ │ -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_:_:_u_n_b_i_n_d │ │ │ │ │ -void unbind() │ │ │ │ │ -Unbind from the current element. │ │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:116 │ │ │ │ │ -_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:98 │ │ │ │ │ -_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_r_i_d_V_i_e_w │ │ │ │ │ -typename GlobalBasis::GridView GridView │ │ │ │ │ -The grid view the global FE basis lives on. │ │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:35 │ │ │ │ │ -_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:149 │ │ │ │ │ -_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__ │ │ │ │ │ -std::optional< Element > element_ │ │ │ │ │ -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_:_:_E_l_e_m_e_n_t │ │ │ │ │ -typename GridView::template Codim< 0 >::Entity Element │ │ │ │ │ -Type of the grid element we are bound to. │ │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:38 │ │ │ │ │ -_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:125 │ │ │ │ │ -_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: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_:_:_e_l_e_m_e_n_t │ │ │ │ │ -const Element & element() const │ │ │ │ │ -Return the grid element that the view is bound to. │ │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:107 │ │ │ │ │ -_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: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_:_:_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ │ -GB GlobalBasis │ │ │ │ │ -The global FE basis that this is a view on. │ │ │ │ │ -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_:_:_t_r_e_e__ │ │ │ │ │ -Tree tree_ │ │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:169 │ │ │ │ │ -_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:143 │ │ │ │ │ -_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___t_y_p_e │ │ │ │ │ -std::size_t size_type │ │ │ │ │ -The type used for sizes. │ │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:41 │ │ │ │ │ -_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_s_B_o_u_n_d │ │ │ │ │ -bool isBound() const │ │ │ │ │ -Return if the view is bound to a grid element. │ │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:92 │ │ │ │ │ -_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:161 │ │ │ │ │ -_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_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:56 │ │ │ │ │ -_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_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 │ │ │ │ │ -Type used for global numbering of the basis vectors. │ │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:64 │ │ │ │ │ -_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_i_c_e_s__ │ │ │ │ │ -std::vector< MultiIndexStorage > indices_ │ │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:170 │ │ │ │ │ -_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 │ │ │ │ │ -typename GlobalBasis::PreBasis::Node Tree │ │ │ │ │ -Tree of local finite elements / local shape function sets. │ │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:44 │ │ │ │ │ -_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:68 │ │ │ │ │ -_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_l_o_b_a_l_B_a_s_i_s__ │ │ │ │ │ -const GlobalBasis * globalBasis_ │ │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:167 │ │ │ │ │ -_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_l_o_b_a_l_B_a_s_i_s │ │ │ │ │ -const GlobalBasis & globalBasis() const │ │ │ │ │ -Return the global basis that we are a view on. │ │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:156 │ │ │ │ │ -_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_F_r_o_m_C_a_l_l_a_b_l_e │ │ │ │ │ +DDeeffiinniittiioonn functionfromcallable.hh:20 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _F_,_ _F_u_n_c_t_i_o_n_I_n_t_e_r_f_a_c_e_ _>_:_: │ │ │ │ │ +_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e │ │ │ │ │ +FunctionFromCallable(F &&f) │ │ │ │ │ +Create VirtualFunction from callable object. │ │ │ │ │ +DDeeffiinniittiioonn functionfromcallable.hh:52 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _F_,_ _F_u_n_c_t_i_o_n_I_n_t_e_r_f_a_c_e_ _>_:_: │ │ │ │ │ +_e_v_a_l_u_a_t_e │ │ │ │ │ +void evaluate(const Domain &x, Range &y) const │ │ │ │ │ +Evaluate function. │ │ │ │ │ +DDeeffiinniittiioonn functionfromcallable.hh:73 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _F_,_ _F_u_n_c_t_i_o_n_I_n_t_e_r_f_a_c_e_ _>_:_: │ │ │ │ │ +_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e │ │ │ │ │ +FunctionFromCallable(const F &f) │ │ │ │ │ +Create VirtualFunction from callable object. │ │ │ │ │ +DDeeffiinniittiioonn functionfromcallable.hh:64 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00089.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: defaultglobalbasis.hh File Reference │ │ │ │ +dune-functions: indexaccess.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,65 +65,66 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ Namespaces | │ │ │ │ Functions
│ │ │ │ -
defaultglobalbasis.hh File Reference
│ │ │ │ +
indexaccess.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <cstddef>
│ │ │ │ +
#include <utility>
│ │ │ │ #include <type_traits>
│ │ │ │ -#include <utility>
│ │ │ │ -#include <dune/common/reservedvector.hh>
│ │ │ │ -#include <dune/common/typeutilities.hh>
│ │ │ │ +#include <dune/common/typetraits.hh>
│ │ │ │ #include <dune/common/concept.hh>
│ │ │ │ -#include <dune/functions/common/type_traits.hh>
│ │ │ │ -#include <dune/functions/functionspacebases/defaultlocalview.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.

│ │ │ │

│ │ │ │ Namespaces

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

│ │ │ │ -Classes

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

│ │ │ │ Namespaces

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

│ │ │ │ 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)
 
template<class C , class I , class F , typename std::enable_if< Dune::models< Imp::Concept::HasDynamicIndexAccess< I >, C >(), int >::type = 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 , typename std::enable_if< not Dune::models< Imp::Concept::HasDynamicIndexAccess< I >, C >(), int >::type = 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,56 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -defaultglobalbasis.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +_N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +indexaccess.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_/_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 │ │ │ │ │ +#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_:_:_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 │ │ │ │ │ -  │ │ │ │ │ -namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_B_u_i_l_d_e_r │ │ │ │ │ -  │ │ │ │ │ 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 &&) -> _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s< │ │ │ │ │ - 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) -> _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s< 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) │ │ │ │ │ +template, C >(), int >::type = 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 >::type = 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[]. │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00089_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: defaultglobalbasis.hh Source File │ │ │ │ +dune-functions: indexaccess.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,234 +70,328 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
defaultglobalbasis.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH
│ │ │ │
5
│ │ │ │ -
6#include <cstddef>
│ │ │ │ -
7#include <type_traits>
│ │ │ │ -
8#include <utility>
│ │ │ │ +
6
│ │ │ │ +
7#include <utility>
│ │ │ │ +
8#include <type_traits>
│ │ │ │
9
│ │ │ │ -
10#include <dune/common/reservedvector.hh>
│ │ │ │ -
11#include <dune/common/typeutilities.hh>
│ │ │ │ -
12#include <dune/common/concept.hh>
│ │ │ │ +
10#include <dune/common/typetraits.hh>
│ │ │ │ +
11#include <dune/common/concept.hh>
│ │ │ │ +
12#include <dune/common/hybridutilities.hh>
│ │ │ │
13
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ +
15
│ │ │ │ +
16
│ │ │ │
17
│ │ │ │ -
18
│ │ │ │ -
19
│ │ │ │ -
20namespace Dune {
│ │ │ │ -
21namespace Functions {
│ │ │ │ -
22
│ │ │ │ +
18namespace Dune {
│ │ │ │ +
19namespace Functions {
│ │ │ │ +
20
│ │ │ │ +
21
│ │ │ │ +
22namespace Imp {
│ │ │ │
23
│ │ │ │ -
24
│ │ │ │ -
44template<class PB>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
46{
│ │ │ │ +
24namespace Concept {
│ │ │ │ +
25
│ │ │ │ +
26template<class size_type>
│ │ │ │ +
27struct HasDynamicIndexAccess
│ │ │ │ +
28{
│ │ │ │ +
29 template<class C>
│ │ │ │ +
30 auto require(C&& c) -> decltype(
│ │ │ │ +
31 c[std::declval<size_type>()]
│ │ │ │ +
32 );
│ │ │ │ +
33};
│ │ │ │ +
34
│ │ │ │ +
35struct HasStaticIndexAccess
│ │ │ │ +
36{
│ │ │ │ +
37 template<class C>
│ │ │ │ +
38 auto require(C&& c) -> decltype(
│ │ │ │ +
39 c[Dune::Indices::_0]
│ │ │ │ +
40 );
│ │ │ │ +
41};
│ │ │ │ +
42
│ │ │ │ +
43} // namespace Concept
│ │ │ │ +
44
│ │ │ │ +
45} // namespace Imp
│ │ │ │ +
46
│ │ │ │
47
│ │ │ │ -
48public:
│ │ │ │ -
49
│ │ │ │ -
51 using PreBasis = PB;
│ │ │ │ -
52
│ │ │ │ -
54 using PrefixPath = TypeTree::HybridTreePath<>;
│ │ │ │ -
55
│ │ │ │ -
57 using GridView = typename PreBasis::GridView;
│ │ │ │ -
58
│ │ │ │ -
60 using size_type = std::size_t;
│ │ │ │ -
61
│ │ │ │ - │ │ │ │ -
64
│ │ │ │ - │ │ │ │ -
67
│ │ │ │ -
69 using SizePrefix = Dune::ReservedVector<std::size_t, PreBasis::multiIndexBufferSize>;
│ │ │ │ -
70
│ │ │ │ -
79 template<class... T,
│ │ │ │ -
80 disableCopyMove<DefaultGlobalBasis, T...> = 0,
│ │ │ │ - │ │ │ │ -
│ │ │ │ - │ │ │ │ -
83 preBasis_(std::forward<T>(t)...),
│ │ │ │ - │ │ │ │ -
85 {
│ │ │ │ -
86 static_assert(models<Concept::PreBasis<GridView>, PreBasis>(), "Type passed to DefaultGlobalBasis does not model the PreBasis concept.");
│ │ │ │ -
87 preBasis_.initializeIndices();
│ │ │ │ -
88 }
│ │ │ │ -
│ │ │ │ -
89
│ │ │ │ -
96 template<class PreBasisFactory,
│ │ │ │ -
97 std::enable_if_t<Dune::IsCallable<PreBasisFactory(GridView), PreBasis>::value, int> = 0>
│ │ │ │ -
│ │ │ │ -
98 DefaultGlobalBasis(const GridView& gridView, PreBasisFactory&& factory) :
│ │ │ │ -
99 preBasis_(factory(gridView)),
│ │ │ │ - │ │ │ │ -
101 {
│ │ │ │ -
102 static_assert(models<Concept::PreBasis<GridView>, PreBasis>(), "Type passed to DefaultGlobalBasis does not model the PreBasis concept.");
│ │ │ │ -
103 preBasis_.initializeIndices();
│ │ │ │ -
104 }
│ │ │ │ -
│ │ │ │ -
105
│ │ │ │ -
│ │ │ │ -
107 const GridView& gridView() const
│ │ │ │ -
108 {
│ │ │ │ -
109 return preBasis_.gridView();
│ │ │ │ -
110 }
│ │ │ │ -
│ │ │ │ -
111
│ │ │ │ -
│ │ │ │ -
113 const PreBasis& preBasis() const
│ │ │ │ -
114 {
│ │ │ │ -
115 return preBasis_;
│ │ │ │ -
116 }
│ │ │ │ -
│ │ │ │ -
117
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
120 {
│ │ │ │ -
121 return preBasis_;
│ │ │ │ -
122 }
│ │ │ │ -
│ │ │ │ -
123
│ │ │ │ -
│ │ │ │ -
130 void update(const GridView & gv)
│ │ │ │ -
131 {
│ │ │ │ -
132 preBasis_.update(gv);
│ │ │ │ -
133 preBasis_.initializeIndices();
│ │ │ │ -
134 }
│ │ │ │ -
│ │ │ │ -
135
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
138 {
│ │ │ │ -
139 return preBasis_.dimension();
│ │ │ │ -
140 }
│ │ │ │ -
│ │ │ │ -
141
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
144 {
│ │ │ │ -
145 return preBasis_.size();
│ │ │ │ -
146 }
│ │ │ │ -
│ │ │ │ -
147
│ │ │ │ -
│ │ │ │ -
149 size_type size(const SizePrefix& prefix) const
│ │ │ │ -
150 {
│ │ │ │ -
151 return preBasis_.size(prefix);
│ │ │ │ -
152 }
│ │ │ │ -
│ │ │ │ -
153
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
156 {
│ │ │ │ -
157 return LocalView(*this);
│ │ │ │ -
158 }
│ │ │ │ -
│ │ │ │ -
159
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
162 {
│ │ │ │ -
163 return *this;
│ │ │ │ -
164 }
│ │ │ │ -
│ │ │ │ -
165
│ │ │ │ -
│ │ │ │ -
167 const PrefixPath& prefixPath() const
│ │ │ │ -
168 {
│ │ │ │ -
169 return prefixPath_;
│ │ │ │ -
170 }
│ │ │ │ -
│ │ │ │ -
171
│ │ │ │ -
172protected:
│ │ │ │ - │ │ │ │ - │ │ │ │ -
175};
│ │ │ │ -
│ │ │ │ +
48
│ │ │ │ +
61template<class C, class I, class F,
│ │ │ │ +
62 typename std::enable_if< Dune::models<Imp::Concept::HasDynamicIndexAccess<I>, C>(), int>::type = 0>
│ │ │ │ +
│ │ │ │ +
63auto hybridIndexAccess(C&& c, const I& i, F&& f)
│ │ │ │ +
64 -> decltype(f(c[i]))
│ │ │ │ +
65{
│ │ │ │ +
66 return f(c[i]);
│ │ │ │ +
67}
│ │ │ │ +
│ │ │ │ +
68
│ │ │ │ +
86template<class C, class I, class F,
│ │ │ │ +
87 typename std::enable_if< not Dune::models<Imp::Concept::HasDynamicIndexAccess<I>, C>(), int>::type = 0>
│ │ │ │ +
│ │ │ │ +
88decltype(auto) hybridIndexAccess(C&& c, const I& i, F&& f)
│ │ │ │ +
89{
│ │ │ │ +
90 using Size = decltype(Hybrid::size(c));
│ │ │ │ +
91 return Hybrid::switchCases(std::make_index_sequence<Size::value>(), i,
│ │ │ │ +
92 [&](const auto& ii) -> decltype(auto){
│ │ │ │ +
93 return f(c[ii]);
│ │ │ │ +
94 }, [&]() -> decltype(auto){
│ │ │ │ +
95 return f(c[Dune::Indices::_0]);
│ │ │ │ +
96 });
│ │ │ │ +
97}
│ │ │ │ +
│ │ │ │ +
98
│ │ │ │ +
99
│ │ │ │ +
100namespace Imp {
│ │ │ │ +
101
│ │ │ │ +
115 template<class Index, std::size_t offset=1>
│ │ │ │ +
116 class ShiftedDynamicMultiIndex
│ │ │ │ +
117 {
│ │ │ │ +
118 public:
│ │ │ │ +
119 ShiftedDynamicMultiIndex(const Index& index) :
│ │ │ │ +
120 index_(index)
│ │ │ │ +
121 {}
│ │ │ │ +
122
│ │ │ │ +
123 std::size_t operator[](std::size_t position) const
│ │ │ │ +
124 {
│ │ │ │ +
125 if (position<size())
│ │ │ │ +
126 return index_[position+offset];
│ │ │ │ +
127 else
│ │ │ │ +
128 return 0;
│ │ │ │ +
129 }
│ │ │ │ +
130
│ │ │ │ +
134 ShiftedDynamicMultiIndex<Index, offset+1> pop() const
│ │ │ │ +
135 {
│ │ │ │ +
136 return {index_};
│ │ │ │ +
137 }
│ │ │ │ +
138
│ │ │ │ +
139 std::size_t size() const
│ │ │ │ +
140 {
│ │ │ │ +
141 if (offset < index_.size())
│ │ │ │ +
142 return index_.size() - offset;
│ │ │ │ +
143 else
│ │ │ │ +
144 return 0;
│ │ │ │ +
145 }
│ │ │ │ +
146
│ │ │ │ +
147 private:
│ │ │ │ +
148 const Index& index_;
│ │ │ │ +
149 };
│ │ │ │ +
150
│ │ │ │ +
151 template<class Index, std::size_t offset=1>
│ │ │ │ +
152 class ShiftedStaticMultiIndex
│ │ │ │ +
153 {
│ │ │ │ +
154 public:
│ │ │ │ +
155 ShiftedStaticMultiIndex(const Index& index) :
│ │ │ │ +
156 index_(index)
│ │ │ │ +
157 {}
│ │ │ │ +
158
│ │ │ │ +
159 template<std::size_t i>
│ │ │ │ +
160 auto operator[](Dune::index_constant<i>) const
│ │ │ │ +
161 {
│ │ │ │ +
162 if constexpr (i<size()) {
│ │ │ │ +
163 return index_[Dune::index_constant<i+offset>{}];
│ │ │ │ +
164 } else {
│ │ │ │ +
165 return Dune::index_constant<0>{};
│ │ │ │ +
166 }
│ │ │ │ +
167 }
│ │ │ │ +
168
│ │ │ │ +
172 ShiftedStaticMultiIndex<Index, offset+1> pop() const
│ │ │ │ +
173 {
│ │ │ │ +
174 return {index_};
│ │ │ │ +
175 }
│ │ │ │
176
│ │ │ │ -
177
│ │ │ │ -
178
│ │ │ │ -
179template<class PreBasis>
│ │ │ │ - │ │ │ │ -
181
│ │ │ │ -
182template<class GridView, class PreBasisFactory>
│ │ │ │ -
183DefaultGlobalBasis(const GridView& gv, PreBasisFactory&& f) -> DefaultGlobalBasis<std::decay_t<decltype(f(gv))>>;
│ │ │ │ -
184
│ │ │ │ +
177 static constexpr std::size_t size()
│ │ │ │ +
178 {
│ │ │ │ +
179 auto fullSize = decltype(Hybrid::size(std::declval<Index>()))::value;
│ │ │ │ +
180 if (offset < fullSize)
│ │ │ │ +
181 return fullSize - offset;
│ │ │ │ +
182 else
│ │ │ │ +
183 return 0;
│ │ │ │ +
184 }
│ │ │ │
185
│ │ │ │ -
186
│ │ │ │ -
187namespace BasisFactory {
│ │ │ │ -
188
│ │ │ │ -
189template<class GridView, class PreBasisFactory>
│ │ │ │ -
│ │ │ │ -
190auto makeBasis(const GridView& gridView, PreBasisFactory&& preBasisFactory)
│ │ │ │ -
191{
│ │ │ │ -
192 return DefaultGlobalBasis(preBasisFactory(gridView));
│ │ │ │ -
193}
│ │ │ │ -
│ │ │ │ -
194
│ │ │ │ -
195} // end namespace BasisFactory
│ │ │ │ -
196
│ │ │ │ -
197// Backward compatibility
│ │ │ │ -
198namespace BasisBuilder {
│ │ │ │ -
199
│ │ │ │ -
200 using namespace BasisFactory;
│ │ │ │ -
201
│ │ │ │ -
202}
│ │ │ │ -
203
│ │ │ │ -
204
│ │ │ │ -
205} // end namespace Functions
│ │ │ │ -
206} // end namespace Dune
│ │ │ │ -
207
│ │ │ │ +
186 private:
│ │ │ │ +
187 const Index& index_;
│ │ │ │ +
188 };
│ │ │ │ +
189
│ │ │ │ +
195 template<std::size_t offset, class Index>
│ │ │ │ +
196 ShiftedDynamicMultiIndex<Index, offset> shiftedDynamicMultiIndex(const Index& index)
│ │ │ │ +
197 {
│ │ │ │ +
198 return {index};
│ │ │ │ +
199 }
│ │ │ │ +
200
│ │ │ │ +
201 template<std::size_t offset, class Index>
│ │ │ │ +
202 ShiftedStaticMultiIndex<Index, offset> shiftedStaticMultiIndex(const Index& index)
│ │ │ │ +
203 {
│ │ │ │ +
204 return {index};
│ │ │ │ +
205 }
│ │ │ │ +
206
│ │ │ │ +
207} // namespace Imp
│ │ │ │
208
│ │ │ │
209
│ │ │ │ -
210#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ -
typename std::enable_if< std::is_constructible< T, Args... >::value, int >::type enableIfConstructible
Helper to constrain forwarding constructors.
Definition type_traits.hh:26
│ │ │ │ +
210
│ │ │ │ +
211
│ │ │ │ +
212namespace Imp {
│ │ │ │ +
213
│ │ │ │ +
214template<class Result, class Index>
│ │ │ │ +
215struct MultiIndexResolver
│ │ │ │ +
216{
│ │ │ │ +
217 MultiIndexResolver(const Index& index) :
│ │ │ │ +
218 index_(index)
│ │ │ │ +
219 {}
│ │ │ │ +
220
│ │ │ │ +
221 template<class C,
│ │ │ │ +
222 typename std::enable_if<not std::is_convertible<C&, Result>::value, int>::type = 0>
│ │ │ │ +
223 Result operator()(C&& c)
│ │ │ │ +
224 {
│ │ │ │ +
225 auto&& subIndex = Imp::shiftedDynamicMultiIndex<1>(index_);
│ │ │ │ +
226 auto&& subIndexResolver = MultiIndexResolver<Result, decltype(subIndex)>(subIndex);
│ │ │ │ +
227 return (Result)(hybridIndexAccess(c, index_[Dune::Indices::_0], subIndexResolver));
│ │ │ │ +
228 }
│ │ │ │ +
229
│ │ │ │ +
230 template<class C,
│ │ │ │ +
231 typename std::enable_if<std::is_convertible<C&, Result>::value, int>::type = 0>
│ │ │ │ +
232 Result operator()(C&& c)
│ │ │ │ +
233 {
│ │ │ │ +
234 return (Result)(std::forward<C>(c));
│ │ │ │ +
235 }
│ │ │ │ +
236
│ │ │ │ +
237 const Index& index_;
│ │ │ │ +
238};
│ │ │ │ +
239
│ │ │ │ +
240} // namespace Imp
│ │ │ │ +
241
│ │ │ │ +
242
│ │ │ │ +
243
│ │ │ │ +
262template<class Result, class C, class MultiIndex>
│ │ │ │ +
│ │ │ │ +
263Result hybridMultiIndexAccess(C&& c, const MultiIndex& index)
│ │ │ │ +
264{
│ │ │ │ +
265
│ │ │ │ +
266 Imp::MultiIndexResolver<Result, MultiIndex> multiIndexResolver(index);
│ │ │ │ +
267 return multiIndexResolver(c);
│ │ │ │ +
268}
│ │ │ │ +
│ │ │ │ +
269
│ │ │ │ +
270
│ │ │ │ +
271
│ │ │ │ +
272
│ │ │ │ +
273
│ │ │ │ +
274
│ │ │ │ +
275namespace Imp {
│ │ │ │ +
276
│ │ │ │ +
277 template<class C, class MultiIndex, class IsFinal>
│ │ │ │ +
278 constexpr decltype(auto) resolveDynamicMultiIndex(C&& c, const MultiIndex& multiIndex, const IsFinal& isFinal)
│ │ │ │ +
279 {
│ │ │ │ +
280 // If c is already considered final simply return it,
│ │ │ │ +
281 // else resolve the next multiIndex entry.
│ │ │ │ +
282 return Hybrid::ifElse(isFinal(c), [&, c = forwardCapture(std::forward<C>(c))](auto) -> decltype(auto) {
│ │ │ │ +
283 assert(multiIndex.size() == 0);
│ │ │ │ +
284 return c.forward();
│ │ │ │ +
285 }, [&](auto) -> decltype(auto) {
│ │ │ │ +
286 auto hasDynamicAccess = callableCheck([](auto&& cc) -> std::void_t<decltype(cc[0])> {});
│ │ │ │ +
287
│ │ │ │ +
288 // Split multiIndex into first entry and remaining ones.
│ │ │ │ +
289 auto i = multiIndex[0];
│ │ │ │ +
290 auto tail = multiIndex.pop();
│ │ │ │ +
291
│ │ │ │ +
292 // Resolve first multiIndex entry by c[multiIndex[0]] and
│ │ │ │ +
293 // continue resolving with the remaining remaining ones.
│ │ │ │ +
294 // If c has a dynamic operator[] this is straight forward.
│ │ │ │ +
295 // Else the dynamic multiIndex[0] has to be translated into
│ │ │ │ +
296 // a static one using hybridIndexAccess.
│ │ │ │ +
297 return Hybrid::ifElse(hasDynamicAccess(c), [&](auto id) -> decltype(auto) {
│ │ │ │ +
298 return Imp::resolveDynamicMultiIndex(id(c)[i], tail, isFinal);
│ │ │ │ +
299 }, [&](auto id) -> decltype(auto) {
│ │ │ │ +
300 // auto indexRange = range(Hybrid::size(id(c)));
│ │ │ │ +
301 auto indexRange = typename decltype(range(Hybrid::size(id(c))))::integer_sequence();
│ │ │ │ +
302 return Hybrid::switchCases(indexRange, i, [&](auto static_i) -> decltype(auto){
│ │ │ │ +
303 // Do rescursion with static version of i
│ │ │ │ +
304 return Imp::resolveDynamicMultiIndex(id(c)[static_i], tail, isFinal);
│ │ │ │ +
305 }, [&]() -> decltype(auto){
│ │ │ │ +
306 // As fallback we use c[0] this is needed, because there must be one branch that matches.
│ │ │ │ +
307 return Imp::resolveDynamicMultiIndex(id(c)[Dune::Indices::_0], tail, isFinal);
│ │ │ │ +
308 });
│ │ │ │ +
309 });
│ │ │ │ +
310 });
│ │ │ │ +
311 }
│ │ │ │ +
312
│ │ │ │ +
313 template<class C, class MultiIndex>
│ │ │ │ +
314 constexpr decltype(auto) resolveStaticMultiIndex(C&& c, const MultiIndex& multiIndex)
│ │ │ │ +
315 {
│ │ │ │ +
316 auto isExhausted = Hybrid::equals(Hybrid::size(multiIndex), Dune::Indices::_0);
│ │ │ │ +
317 return Hybrid::ifElse(isExhausted, [&, c = forwardCapture(std::forward<C>(c))](auto) -> decltype(auto) {
│ │ │ │ +
318 return c.forward();
│ │ │ │ +
319 }, [&](auto id) -> decltype(auto) {
│ │ │ │ +
320 auto head = multiIndex[Dune::Indices::_0];
│ │ │ │ +
321 auto tail = multiIndex.pop();
│ │ │ │ +
322
│ │ │ │ +
323 return Imp::resolveStaticMultiIndex(id(c)[head], tail);
│ │ │ │ +
324 });
│ │ │ │ +
325 }
│ │ │ │ +
326
│ │ │ │ +
327} // namespace Imp
│ │ │ │ +
328
│ │ │ │ +
329
│ │ │ │ +
330
│ │ │ │ +
353template<class C, class MultiIndex, class IsFinal>
│ │ │ │ +
│ │ │ │ +
354constexpr decltype(auto) resolveDynamicMultiIndex(C&& c, const MultiIndex& multiIndex, const IsFinal& isFinal)
│ │ │ │ +
355{
│ │ │ │ +
356 return Imp::resolveDynamicMultiIndex(std::forward<C>(c), Imp::shiftedDynamicMultiIndex<0>(multiIndex), isFinal);
│ │ │ │ +
357}
│ │ │ │ +
│ │ │ │ +
358
│ │ │ │ +
375template<class C, class MultiIndex>
│ │ │ │ +
│ │ │ │ +
376constexpr decltype(auto) resolveDynamicMultiIndex(C&& c, const MultiIndex& multiIndex)
│ │ │ │ +
377{
│ │ │ │ +
378 auto hasNoIndexAccess = negatePredicate(callableCheck([](auto&& cc) -> std::void_t<decltype(cc[Dune::Indices::_0])> {}));
│ │ │ │ +
379 return Imp::resolveDynamicMultiIndex(std::forward<C>(c), Imp::shiftedDynamicMultiIndex<0>(multiIndex), hasNoIndexAccess);
│ │ │ │ +
380}
│ │ │ │ +
│ │ │ │ +
381
│ │ │ │ +
397template<class C, class MultiIndex>
│ │ │ │ +
│ │ │ │ +
398constexpr decltype(auto) resolveStaticMultiIndex(C&& c, const MultiIndex& multiIndex)
│ │ │ │ +
399{
│ │ │ │ +
400 return Imp::resolveStaticMultiIndex(std::forward<C>(c), Imp::shiftedStaticMultiIndex<0>(multiIndex));
│ │ │ │ +
401}
│ │ │ │ +
│ │ │ │ +
402
│ │ │ │ +
403
│ │ │ │ +
404
│ │ │ │ +
405} // namespace Dune::Functions
│ │ │ │ +
406} // namespace Dune
│ │ │ │ +
407
│ │ │ │ +
408
│ │ │ │ +
409
│ │ │ │ +
410#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:63
│ │ │ │ +
constexpr decltype(auto) resolveStaticMultiIndex(C &&c, const MultiIndex &multiIndex)
Provide multi-index access by chaining operator[].
Definition indexaccess.hh:398
│ │ │ │ +
auto callableCheck(Expression f)
Create a predicate for checking validity of expressions.
Definition utility.hh:279
│ │ │ │ +
constexpr decltype(auto) resolveDynamicMultiIndex(C &&c, const MultiIndex &multiIndex, const IsFinal &isFinal)
Provide multi-index access by chaining operator[].
Definition indexaccess.hh:354
│ │ │ │ +
Result hybridMultiIndexAccess(C &&c, const MultiIndex &index)
Provide multi-index access by chaining operator[].
Definition indexaccess.hh:263
│ │ │ │ +
auto negatePredicate(Check check)
Negate given predicate.
Definition utility.hh:304
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
auto makeBasis(const GridView &gridView, PreBasisFactory &&preBasisFactory)
Definition defaultglobalbasis.hh:190
│ │ │ │ -
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:46
│ │ │ │ -
Dune::ReservedVector< std::size_t, PreBasis::multiIndexBufferSize > SizePrefix
Type used for prefixes handed to the size() method.
Definition defaultglobalbasis.hh:69
│ │ │ │ -
std::size_t size_type
Type used for indices and size information.
Definition defaultglobalbasis.hh:60
│ │ │ │ -
typename PreBasis::GridView GridView
The grid view that the FE space is defined on.
Definition defaultglobalbasis.hh:57
│ │ │ │ -
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition defaultglobalbasis.hh:107
│ │ │ │ -
PB PreBasis
Pre-basis providing the implementation details.
Definition defaultglobalbasis.hh:51
│ │ │ │ -
PreBasis & preBasis()
Obtain the pre-basis providing the implementation details.
Definition defaultglobalbasis.hh:119
│ │ │ │ -
void update(const GridView &gv)
Update the stored grid view.
Definition defaultglobalbasis.hh:130
│ │ │ │ -
DefaultLocalView< DefaultGlobalBasis< PreBasis > > LocalView
Type of the local view on the restriction of the basis to a single element.
Definition defaultglobalbasis.hh:63
│ │ │ │ -
typename LocalView::MultiIndex MultiIndex
Type used for global numbering of the basis vectors.
Definition defaultglobalbasis.hh:66
│ │ │ │ -
size_type size(const SizePrefix &prefix) const
Return number of possible values for next position in multi index.
Definition defaultglobalbasis.hh:149
│ │ │ │ -
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition defaultglobalbasis.hh:137
│ │ │ │ -
PreBasis preBasis_
Definition defaultglobalbasis.hh:173
│ │ │ │ -
LocalView localView() const
Return local view for basis.
Definition defaultglobalbasis.hh:155
│ │ │ │ -
TypeTree::HybridTreePath<> PrefixPath
The empty prefix path that identifies the root in the local ansatz tree.
Definition defaultglobalbasis.hh:54
│ │ │ │ -
DefaultGlobalBasis(T &&... t)
Constructor.
Definition defaultglobalbasis.hh:82
│ │ │ │ -
DefaultGlobalBasis(const GridView &gridView, PreBasisFactory &&factory)
Constructor from a PreBasis factory.
Definition defaultglobalbasis.hh:98
│ │ │ │ -
size_type size() const
Return number of possible values for next position in empty multi index.
Definition defaultglobalbasis.hh:143
│ │ │ │ -
const PreBasis & preBasis() const
Obtain the pre-basis providing the implementation details.
Definition defaultglobalbasis.hh:113
│ │ │ │ -
PrefixPath prefixPath_
Definition defaultglobalbasis.hh:174
│ │ │ │ -
const DefaultGlobalBasis & rootBasis() const
Return *this because we are not embedded in a larger basis.
Definition defaultglobalbasis.hh:161
│ │ │ │ -
const PrefixPath & prefixPath() const
Return empty path, because this is the root in the local ansatz tree.
Definition defaultglobalbasis.hh:167
│ │ │ │ -
The restriction of a finite element basis to a single element.
Definition defaultlocalview.hh:28
│ │ │ │ -
std::conditional_t<(PreBasis::minMultiIndexSize==PreBasis::maxMultiIndexSize), StaticMultiIndex< size_type, PreBasis::maxMultiIndexSize >, Dune::ReservedVector< size_type, PreBasis::multiIndexBufferSize > > MultiIndex
Type used for global numbering of the basis vectors.
Definition defaultlocalview.hh:64
│ │ │ │ - │ │ │ │ +
auto forwardCapture(T &&t)
Create a capture object for perfect forwarding.
Definition utility.hh:372
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,279 +1,355 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -defaultglobalbasis.hh │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ -8#include │ │ │ │ │ +6 │ │ │ │ │ +7#include │ │ │ │ │ +8#include │ │ │ │ │ 9 │ │ │ │ │ -10#include │ │ │ │ │ -11#include │ │ │ │ │ -12#include │ │ │ │ │ +10#include │ │ │ │ │ +11#include │ │ │ │ │ +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_/_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> │ │ │ │ │ -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> │ │ │ │ │ +14#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> │ │ │ │ │ +15 │ │ │ │ │ +16 │ │ │ │ │ 17 │ │ │ │ │ -18 │ │ │ │ │ -19 │ │ │ │ │ -20namespace _D_u_n_e { │ │ │ │ │ -21namespace Functions { │ │ │ │ │ -22 │ │ │ │ │ +18namespace _D_u_n_e { │ │ │ │ │ +19namespace Functions { │ │ │ │ │ +20 │ │ │ │ │ +21 │ │ │ │ │ +22namespace Imp { │ │ │ │ │ 23 │ │ │ │ │ -24 │ │ │ │ │ -44template │ │ │ │ │ -_4_5class _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ │ -46{ │ │ │ │ │ +24namespace Concept { │ │ │ │ │ +25 │ │ │ │ │ +26template │ │ │ │ │ +27struct HasDynamicIndexAccess │ │ │ │ │ +28{ │ │ │ │ │ +29 template │ │ │ │ │ +30 auto require(C&& c) -> decltype( │ │ │ │ │ +31 c[std::declval()] │ │ │ │ │ +32 ); │ │ │ │ │ +33}; │ │ │ │ │ +34 │ │ │ │ │ +35struct HasStaticIndexAccess │ │ │ │ │ +36{ │ │ │ │ │ +37 template │ │ │ │ │ +38 auto require(C&& c) -> decltype( │ │ │ │ │ +39 c[Dune::Indices::_0] │ │ │ │ │ +40 ); │ │ │ │ │ +41}; │ │ │ │ │ +42 │ │ │ │ │ +43} // namespace Concept │ │ │ │ │ +44 │ │ │ │ │ +45} // namespace Imp │ │ │ │ │ +46 │ │ │ │ │ 47 │ │ │ │ │ -48public: │ │ │ │ │ -49 │ │ │ │ │ -_5_1 using _P_r_e_B_a_s_i_s = PB; │ │ │ │ │ -52 │ │ │ │ │ -_5_4 using _P_r_e_f_i_x_P_a_t_h = TypeTree::HybridTreePath<>; │ │ │ │ │ -55 │ │ │ │ │ -_5_7 using _G_r_i_d_V_i_e_w = typename PreBasis::GridView; │ │ │ │ │ -58 │ │ │ │ │ -_6_0 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ -61 │ │ │ │ │ -_6_3 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_>>; │ │ │ │ │ -64 │ │ │ │ │ -_6_6 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; │ │ │ │ │ -67 │ │ │ │ │ -_6_9 using _S_i_z_e_P_r_e_f_i_x = Dune::ReservedVector; │ │ │ │ │ -70 │ │ │ │ │ -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<_P_r_e_B_a_s_i_s, T...> = 0> │ │ │ │ │ -_8_2 _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s(T&&... t) : │ │ │ │ │ -83 _p_r_e_B_a_s_i_s__(std::forward(t)...), │ │ │ │ │ -84 _p_r_e_f_i_x_P_a_t_h__() │ │ │ │ │ -85 { │ │ │ │ │ -86 static_assert(models, _P_r_e_B_a_s_i_s>(), "Type passed │ │ │ │ │ -to DefaultGlobalBasis does not model the PreBasis concept."); │ │ │ │ │ -87 _p_r_e_B_a_s_i_s__.initializeIndices(); │ │ │ │ │ -88 } │ │ │ │ │ -89 │ │ │ │ │ -96 template:: │ │ │ │ │ -value, int> = 0> │ │ │ │ │ -_9_8 _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) : │ │ │ │ │ -99 _p_r_e_B_a_s_i_s__(factory(_g_r_i_d_V_i_e_w)), │ │ │ │ │ -100 _p_r_e_f_i_x_P_a_t_h__() │ │ │ │ │ -101 { │ │ │ │ │ -102 static_assert(models, _P_r_e_B_a_s_i_s>(), "Type passed │ │ │ │ │ -to DefaultGlobalBasis does not model the PreBasis concept."); │ │ │ │ │ -103 _p_r_e_B_a_s_i_s__.initializeIndices(); │ │ │ │ │ -104 } │ │ │ │ │ -105 │ │ │ │ │ -_1_0_7 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ │ -108 { │ │ │ │ │ -109 return _p_r_e_B_a_s_i_s__.gridView(); │ │ │ │ │ -110 } │ │ │ │ │ -111 │ │ │ │ │ -_1_1_3 const _P_r_e_B_a_s_i_s& _p_r_e_B_a_s_i_s() const │ │ │ │ │ -114 { │ │ │ │ │ -115 return _p_r_e_B_a_s_i_s__; │ │ │ │ │ -116 } │ │ │ │ │ -117 │ │ │ │ │ -_1_1_9 _P_r_e_B_a_s_i_s& _p_r_e_B_a_s_i_s() │ │ │ │ │ -120 { │ │ │ │ │ -121 return _p_r_e_B_a_s_i_s__; │ │ │ │ │ -122 } │ │ │ │ │ -123 │ │ │ │ │ -_1_3_0 void _u_p_d_a_t_e(const _G_r_i_d_V_i_e_w & gv) │ │ │ │ │ -131 { │ │ │ │ │ -132 _p_r_e_B_a_s_i_s__.update(gv); │ │ │ │ │ -133 _p_r_e_B_a_s_i_s__.initializeIndices(); │ │ │ │ │ -134 } │ │ │ │ │ -135 │ │ │ │ │ -_1_3_7 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ │ -138 { │ │ │ │ │ -139 return _p_r_e_B_a_s_i_s__.dimension(); │ │ │ │ │ -140 } │ │ │ │ │ -141 │ │ │ │ │ -_1_4_3 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ │ -144 { │ │ │ │ │ -145 return _p_r_e_B_a_s_i_s__.size(); │ │ │ │ │ -146 } │ │ │ │ │ -147 │ │ │ │ │ -_1_4_9 _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 │ │ │ │ │ -150 { │ │ │ │ │ -151 return _p_r_e_B_a_s_i_s__.size(prefix); │ │ │ │ │ -152 } │ │ │ │ │ -153 │ │ │ │ │ -_1_5_5 _L_o_c_a_l_V_i_e_w _l_o_c_a_l_V_i_e_w() const │ │ │ │ │ -156 { │ │ │ │ │ -157 return _L_o_c_a_l_V_i_e_w(*this); │ │ │ │ │ -158 } │ │ │ │ │ -159 │ │ │ │ │ -_1_6_1 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 │ │ │ │ │ -162 { │ │ │ │ │ -163 return *this; │ │ │ │ │ -164 } │ │ │ │ │ -165 │ │ │ │ │ -_1_6_7 const _P_r_e_f_i_x_P_a_t_h& _p_r_e_f_i_x_P_a_t_h() const │ │ │ │ │ -168 { │ │ │ │ │ -169 return _p_r_e_f_i_x_P_a_t_h__; │ │ │ │ │ -170 } │ │ │ │ │ -171 │ │ │ │ │ -172protected: │ │ │ │ │ -_1_7_3 _P_r_e_B_a_s_i_s _p_r_e_B_a_s_i_s__; │ │ │ │ │ -_1_7_4 _P_r_e_f_i_x_P_a_t_h _p_r_e_f_i_x_P_a_t_h__; │ │ │ │ │ -175}; │ │ │ │ │ +48 │ │ │ │ │ +61template, C>(), int>::type = 0> │ │ │ │ │ +_6_3auto _h_y_b_r_i_d_I_n_d_e_x_A_c_c_e_s_s(C&& c, const I& i, F&& f) │ │ │ │ │ +64 -> decltype(f(c[i])) │ │ │ │ │ +65{ │ │ │ │ │ +66 return f(c[i]); │ │ │ │ │ +67} │ │ │ │ │ +68 │ │ │ │ │ +86template, C>(), int>::type = 0> │ │ │ │ │ +_8_8decltype(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) │ │ │ │ │ +89{ │ │ │ │ │ +90 using Size = decltype(Hybrid::size(c)); │ │ │ │ │ +91 return Hybrid::switchCases(std::make_index_sequence(), i, │ │ │ │ │ +92 [&](const auto& ii) -> decltype(auto){ │ │ │ │ │ +93 return f(c[ii]); │ │ │ │ │ +94 }, [&]() -> decltype(auto){ │ │ │ │ │ +95 return f(c[Dune::Indices::_0]); │ │ │ │ │ +96 }); │ │ │ │ │ +97} │ │ │ │ │ +98 │ │ │ │ │ +99 │ │ │ │ │ +100namespace Imp { │ │ │ │ │ +101 │ │ │ │ │ +115 template │ │ │ │ │ +116 class ShiftedDynamicMultiIndex │ │ │ │ │ +117 { │ │ │ │ │ +118 public: │ │ │ │ │ +119 ShiftedDynamicMultiIndex(const Index& index) : │ │ │ │ │ +120 index_(index) │ │ │ │ │ +121 {} │ │ │ │ │ +122 │ │ │ │ │ +123 std::size_t operator[](std::size_t position) const │ │ │ │ │ +124 { │ │ │ │ │ +125 if (position pop() const │ │ │ │ │ +135 { │ │ │ │ │ +136 return {index_}; │ │ │ │ │ +137 } │ │ │ │ │ +138 │ │ │ │ │ +139 std::size_t size() const │ │ │ │ │ +140 { │ │ │ │ │ +141 if (offset < index_.size()) │ │ │ │ │ +142 return index_.size() - offset; │ │ │ │ │ +143 else │ │ │ │ │ +144 return 0; │ │ │ │ │ +145 } │ │ │ │ │ +146 │ │ │ │ │ +147 private: │ │ │ │ │ +148 const Index& index_; │ │ │ │ │ +149 }; │ │ │ │ │ +150 │ │ │ │ │ +151 template │ │ │ │ │ +152 class ShiftedStaticMultiIndex │ │ │ │ │ +153 { │ │ │ │ │ +154 public: │ │ │ │ │ +155 ShiftedStaticMultiIndex(const Index& index) : │ │ │ │ │ +156 index_(index) │ │ │ │ │ +157 {} │ │ │ │ │ +158 │ │ │ │ │ +159 template │ │ │ │ │ +160 auto operator[](Dune::index_constant) const │ │ │ │ │ +161 { │ │ │ │ │ +162 if constexpr (i{}]; │ │ │ │ │ +164 } else { │ │ │ │ │ +165 return Dune::index_constant<0>{}; │ │ │ │ │ +166 } │ │ │ │ │ +167 } │ │ │ │ │ +168 │ │ │ │ │ +172 ShiftedStaticMultiIndex pop() const │ │ │ │ │ +173 { │ │ │ │ │ +174 return {index_}; │ │ │ │ │ +175 } │ │ │ │ │ 176 │ │ │ │ │ -177 │ │ │ │ │ -178 │ │ │ │ │ -179template │ │ │ │ │ -_1_8_0_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_>>; │ │ │ │ │ -181 │ │ │ │ │ -182template │ │ │ │ │ -_1_8_3_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>; │ │ │ │ │ -184 │ │ │ │ │ +177 static constexpr std::size_t size() │ │ │ │ │ +178 { │ │ │ │ │ +179 auto fullSize = decltype(Hybrid::size(std::declval()))::value; │ │ │ │ │ +180 if (offset < fullSize) │ │ │ │ │ +181 return fullSize - offset; │ │ │ │ │ +182 else │ │ │ │ │ +183 return 0; │ │ │ │ │ +184 } │ │ │ │ │ 185 │ │ │ │ │ -186 │ │ │ │ │ -187namespace BasisFactory { │ │ │ │ │ -188 │ │ │ │ │ -189template │ │ │ │ │ -_1_9_0auto _m_a_k_e_B_a_s_i_s(const GridView& gridView, PreBasisFactory&& preBasisFactory) │ │ │ │ │ -191{ │ │ │ │ │ -192 return _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s(preBasisFactory(gridView)); │ │ │ │ │ -193} │ │ │ │ │ -194 │ │ │ │ │ -195} // end namespace BasisFactory │ │ │ │ │ -196 │ │ │ │ │ -197// Backward compatibility │ │ │ │ │ -198namespace BasisBuilder { │ │ │ │ │ -199 │ │ │ │ │ -200 using namespace BasisFactory; │ │ │ │ │ -201 │ │ │ │ │ -202} │ │ │ │ │ -203 │ │ │ │ │ -204 │ │ │ │ │ -205} // end namespace Functions │ │ │ │ │ -206} // end namespace Dune │ │ │ │ │ -207 │ │ │ │ │ +186 private: │ │ │ │ │ +187 const Index& index_; │ │ │ │ │ +188 }; │ │ │ │ │ +189 │ │ │ │ │ +195 template │ │ │ │ │ +196 ShiftedDynamicMultiIndex shiftedDynamicMultiIndex(const │ │ │ │ │ +Index& index) │ │ │ │ │ +197 { │ │ │ │ │ +198 return {index}; │ │ │ │ │ +199 } │ │ │ │ │ +200 │ │ │ │ │ +201 template │ │ │ │ │ +202 ShiftedStaticMultiIndex shiftedStaticMultiIndex(const Index& │ │ │ │ │ +index) │ │ │ │ │ +203 { │ │ │ │ │ +204 return {index}; │ │ │ │ │ +205 } │ │ │ │ │ +206 │ │ │ │ │ +207} // namespace Imp │ │ │ │ │ 208 │ │ │ │ │ 209 │ │ │ │ │ -210#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH │ │ │ │ │ -_d_e_f_a_u_l_t_l_o_c_a_l_v_i_e_w_._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_:_:_e_n_a_b_l_e_I_f_C_o_n_s_t_r_u_c_t_i_b_l_e │ │ │ │ │ -typename std::enable_if< std::is_constructible< T, Args... >::value, int >:: │ │ │ │ │ -type enableIfConstructible │ │ │ │ │ -Helper to constrain forwarding constructors. │ │ │ │ │ -DDeeffiinniittiioonn type_traits.hh:26 │ │ │ │ │ +210 │ │ │ │ │ +211 │ │ │ │ │ +212namespace Imp { │ │ │ │ │ +213 │ │ │ │ │ +214template │ │ │ │ │ +215struct MultiIndexResolver │ │ │ │ │ +216{ │ │ │ │ │ +217 MultiIndexResolver(const Index& index) : │ │ │ │ │ +218 index_(index) │ │ │ │ │ +219 {} │ │ │ │ │ +220 │ │ │ │ │ +221 template::value, int>:: │ │ │ │ │ +type = 0> │ │ │ │ │ +223 Result operator()(C&& c) │ │ │ │ │ +224 { │ │ │ │ │ +225 auto&& subIndex = Imp::shiftedDynamicMultiIndex<1>(index_); │ │ │ │ │ +226 auto&& subIndexResolver = MultiIndexResolver │ │ │ │ │ +(subIndex); │ │ │ │ │ +227 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)); │ │ │ │ │ +228 } │ │ │ │ │ +229 │ │ │ │ │ +230 template::value, int>::type │ │ │ │ │ += 0> │ │ │ │ │ +232 Result operator()(C&& c) │ │ │ │ │ +233 { │ │ │ │ │ +234 return (Result)(std::forward(c)); │ │ │ │ │ +235 } │ │ │ │ │ +236 │ │ │ │ │ +237 const Index& index_; │ │ │ │ │ +238}; │ │ │ │ │ +239 │ │ │ │ │ +240} // namespace Imp │ │ │ │ │ +241 │ │ │ │ │ +242 │ │ │ │ │ +243 │ │ │ │ │ +262template │ │ │ │ │ +_2_6_3Result _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) │ │ │ │ │ +264{ │ │ │ │ │ +265 │ │ │ │ │ +266 Imp::MultiIndexResolver multiIndexResolver(index); │ │ │ │ │ +267 return multiIndexResolver(c); │ │ │ │ │ +268} │ │ │ │ │ +269 │ │ │ │ │ +270 │ │ │ │ │ +271 │ │ │ │ │ +272 │ │ │ │ │ +273 │ │ │ │ │ +274 │ │ │ │ │ +275namespace Imp { │ │ │ │ │ +276 │ │ │ │ │ +277 template │ │ │ │ │ +278 constexpr decltype(auto) resolveDynamicMultiIndex(C&& c, const MultiIndex& │ │ │ │ │ +multiIndex, const IsFinal& isFinal) │ │ │ │ │ +279 { │ │ │ │ │ +280 // If c is already considered final simply return it, │ │ │ │ │ +281 // else resolve the next multiIndex entry. │ │ │ │ │ +282 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) { │ │ │ │ │ +283 assert(multiIndex.size() == 0); │ │ │ │ │ +284 return c.forward(); │ │ │ │ │ +285 }, [&](auto) -> decltype(auto) { │ │ │ │ │ +286 auto hasDynamicAccess = _c_a_l_l_a_b_l_e_C_h_e_c_k([](auto&& cc) -> std::void_t {}); │ │ │ │ │ +287 │ │ │ │ │ +288 // Split multiIndex into first entry and remaining ones. │ │ │ │ │ +289 auto i = multiIndex[0]; │ │ │ │ │ +290 auto tail = multiIndex.pop(); │ │ │ │ │ +291 │ │ │ │ │ +292 // Resolve first multiIndex entry by c[multiIndex[0]] and │ │ │ │ │ +293 // continue resolving with the remaining remaining ones. │ │ │ │ │ +294 // If c has a dynamic operator[] this is straight forward. │ │ │ │ │ +295 // Else the dynamic multiIndex[0] has to be translated into │ │ │ │ │ +296 // a static one using hybridIndexAccess. │ │ │ │ │ +297 return Hybrid::ifElse(hasDynamicAccess(c), [&](auto id) -> decltype(auto) { │ │ │ │ │ +298 return Imp::resolveDynamicMultiIndex(id(c)[i], tail, isFinal); │ │ │ │ │ +299 }, [&](auto id) -> decltype(auto) { │ │ │ │ │ +300 // auto indexRange = range(Hybrid::size(id(c))); │ │ │ │ │ +301 auto indexRange = typename decltype(range(Hybrid::size(id(c)))):: │ │ │ │ │ +integer_sequence(); │ │ │ │ │ +302 return Hybrid::switchCases(indexRange, i, [&](auto static_i) -> decltype │ │ │ │ │ +(auto){ │ │ │ │ │ +303 // Do rescursion with static version of i │ │ │ │ │ +304 return Imp::resolveDynamicMultiIndex(id(c)[static_i], tail, isFinal); │ │ │ │ │ +305 }, [&]() -> decltype(auto){ │ │ │ │ │ +306 // As fallback we use c[0] this is needed, because there must be one branch │ │ │ │ │ +that matches. │ │ │ │ │ +307 return Imp::resolveDynamicMultiIndex(id(c)[Dune::Indices::_0], tail, │ │ │ │ │ +isFinal); │ │ │ │ │ +308 }); │ │ │ │ │ +309 }); │ │ │ │ │ +310 }); │ │ │ │ │ +311 } │ │ │ │ │ +312 │ │ │ │ │ +313 template │ │ │ │ │ +314 constexpr decltype(auto) resolveStaticMultiIndex(C&& c, const MultiIndex& │ │ │ │ │ +multiIndex) │ │ │ │ │ +315 { │ │ │ │ │ +316 auto isExhausted = Hybrid::equals(Hybrid::size(multiIndex), Dune::Indices:: │ │ │ │ │ +_0); │ │ │ │ │ +317 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) { │ │ │ │ │ +318 return c.forward(); │ │ │ │ │ +319 }, [&](auto id) -> decltype(auto) { │ │ │ │ │ +320 auto head = multiIndex[Dune::Indices::_0]; │ │ │ │ │ +321 auto tail = multiIndex.pop(); │ │ │ │ │ +322 │ │ │ │ │ +323 return Imp::resolveStaticMultiIndex(id(c)[head], tail); │ │ │ │ │ +324 }); │ │ │ │ │ +325 } │ │ │ │ │ +326 │ │ │ │ │ +327} // namespace Imp │ │ │ │ │ +328 │ │ │ │ │ +329 │ │ │ │ │ +330 │ │ │ │ │ +353template │ │ │ │ │ +_3_5_4constexpr 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) │ │ │ │ │ +355{ │ │ │ │ │ +356 return Imp::resolveDynamicMultiIndex(std::forward(c), Imp:: │ │ │ │ │ +shiftedDynamicMultiIndex<0>(multiIndex), isFinal); │ │ │ │ │ +357} │ │ │ │ │ +358 │ │ │ │ │ +375template │ │ │ │ │ +_3_7_6constexpr 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) │ │ │ │ │ +377{ │ │ │ │ │ +378 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 {})); │ │ │ │ │ +379 return Imp::resolveDynamicMultiIndex(std::forward(c), Imp:: │ │ │ │ │ +shiftedDynamicMultiIndex<0>(multiIndex), hasNoIndexAccess); │ │ │ │ │ +380} │ │ │ │ │ +381 │ │ │ │ │ +397template │ │ │ │ │ +_3_9_8constexpr 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) │ │ │ │ │ +399{ │ │ │ │ │ +400 return Imp::resolveStaticMultiIndex(std::forward(c), Imp:: │ │ │ │ │ +shiftedStaticMultiIndex<0>(multiIndex)); │ │ │ │ │ +401} │ │ │ │ │ +402 │ │ │ │ │ +403 │ │ │ │ │ +404 │ │ │ │ │ +405} // namespace Dune::Functions │ │ │ │ │ +406} // namespace Dune │ │ │ │ │ +407 │ │ │ │ │ +408 │ │ │ │ │ +409 │ │ │ │ │ +410#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:63 │ │ │ │ │ +_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:398 │ │ │ │ │ +_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:279 │ │ │ │ │ +_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:354 │ │ │ │ │ +_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:263 │ │ │ │ │ +_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:304 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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: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 │ │ │ │ │ -Global basis for given pre-basis. │ │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:46 │ │ │ │ │ -_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_P_r_e_f_i_x │ │ │ │ │ -Dune::ReservedVector< std::size_t, PreBasis::multiIndexBufferSize > SizePrefix │ │ │ │ │ -Type used for prefixes handed to the size() method. │ │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:69 │ │ │ │ │ -_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___t_y_p_e │ │ │ │ │ -std::size_t size_type │ │ │ │ │ -Type used for indices and size information. │ │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:60 │ │ │ │ │ -_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:57 │ │ │ │ │ -_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 │ │ │ │ │ -const GridView & gridView() const │ │ │ │ │ -Obtain the grid view that the basis is defined on. │ │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:107 │ │ │ │ │ -_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:51 │ │ │ │ │ -_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:119 │ │ │ │ │ -_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:130 │ │ │ │ │ -_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 │ │ │ │ │ -DefaultLocalView< DefaultGlobalBasis< PreBasis > > LocalView │ │ │ │ │ -Type of the local view on the restriction of the basis to a single element. │ │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:63 │ │ │ │ │ -_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_:_:_M_u_l_t_i_I_n_d_e_x │ │ │ │ │ -typename LocalView::MultiIndex MultiIndex │ │ │ │ │ -Type used for global numbering of the basis vectors. │ │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.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_:_:_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:149 │ │ │ │ │ -_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: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_:_:_p_r_e_B_a_s_i_s__ │ │ │ │ │ -PreBasis preBasis_ │ │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:173 │ │ │ │ │ -_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:155 │ │ │ │ │ -_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 │ │ │ │ │ -TypeTree::HybridTreePath<> PrefixPath │ │ │ │ │ -The empty prefix path that identifies the root in the local ansatz tree. │ │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:54 │ │ │ │ │ -_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:82 │ │ │ │ │ -_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:98 │ │ │ │ │ -_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:143 │ │ │ │ │ -_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:113 │ │ │ │ │ -_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__ │ │ │ │ │ -PrefixPath prefixPath_ │ │ │ │ │ -DDeeffiinniittiioonn defaultglobalbasis.hh:174 │ │ │ │ │ -_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:161 │ │ │ │ │ -_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:167 │ │ │ │ │ -_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:28 │ │ │ │ │ -_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_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 │ │ │ │ │ -Type used for global numbering of the basis vectors. │ │ │ │ │ -DDeeffiinniittiioonn defaultlocalview.hh:64 │ │ │ │ │ -_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:372 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00092.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: subspacelocalview.hh File Reference │ │ │ │ +dune-functions: functionconcepts.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,43 +65,129 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces
│ │ │ │ -
subspacelocalview.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Functions
│ │ │ │ +
functionconcepts.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <tuple>
│ │ │ │ +
#include <dune/common/typelist.hh>
│ │ │ │ #include <dune/common/concept.hh>
│ │ │ │ -#include <dune/typetree/childextraction.hh>
│ │ │ │ -#include <dune/functions/functionspacebases/concepts.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

class  Dune::Functions::SubspaceLocalView< RLV, PP >
 The restriction of a finite element basis to a single element. More...
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,25 +1,136 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -subspacelocalview.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +functionconcepts.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_/_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_/_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 │ │ │ │ │ -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_._._. │ │ │ │ │ +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 Concept::GridFunction _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. │ │ │ │ │ +  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00092_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: subspacelocalview.hh Source File │ │ │ │ +dune-functions: functionconcepts.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,191 +70,370 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
subspacelocalview.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH
│ │ │ │
5
│ │ │ │ -
6
│ │ │ │ -
7#include <tuple>
│ │ │ │ +
6#include <dune/common/typelist.hh>
│ │ │ │ +
7#include <dune/common/concept.hh>
│ │ │ │
8
│ │ │ │ -
9#include <dune/common/concept.hh>
│ │ │ │ -
10
│ │ │ │ -
11#include <dune/typetree/childextraction.hh>
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
12
│ │ │ │ - │ │ │ │ -
14
│ │ │ │ -
15
│ │ │ │ +
13namespace Dune {
│ │ │ │ +
14namespace Functions {
│ │ │ │ +
15namespace Concept {
│ │ │ │
16
│ │ │ │ -
17namespace Dune {
│ │ │ │ -
18namespace Functions {
│ │ │ │ +
17using namespace Dune::Concept;
│ │ │ │ +
18
│ │ │ │
19
│ │ │ │
20
│ │ │ │ -
21
│ │ │ │ -
22template<class RB, class PP>
│ │ │ │ -
23class SubspaceBasis;
│ │ │ │ -
24
│ │ │ │ -
25
│ │ │ │ -
26
│ │ │ │ -
28template<class RLV, class PP>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
30{
│ │ │ │ -
31 using PrefixPath = PP;
│ │ │ │ -
32
│ │ │ │ -
33public:
│ │ │ │ -
34
│ │ │ │ -
35 using RootLocalView = RLV;
│ │ │ │ -
36
│ │ │ │ - │ │ │ │ -
39
│ │ │ │ - │ │ │ │ -
42
│ │ │ │ -
44 using Element = typename GridView::template Codim<0>::Entity;
│ │ │ │ -
45
│ │ │ │ -
47 using size_type = std::size_t;
│ │ │ │ -
48
│ │ │ │ -
50 using RootTree = typename RootLocalView::Tree;
│ │ │ │ -
51
│ │ │ │ -
53 using Tree = typename TypeTree::ChildForTreePath<RootTree, PrefixPath>;
│ │ │ │ -
54
│ │ │ │ -
56 using MultiIndex = typename RootLocalView::MultiIndex;
│ │ │ │ -
57
│ │ │ │ -
│ │ │ │ -
59 SubspaceLocalView(const GlobalBasis& globalBasis, const PrefixPath& /*prefixPath*/) :
│ │ │ │ - │ │ │ │ -
61 rootLocalView_(globalBasis.rootBasis().localView())
│ │ │ │ -
62 {
│ │ │ │ -
63// static_assert(models<Concept::BasisTree<GridView>, Tree>(), "Tree type passed to SubspaceLocalView does not model the BasisNode concept.");
│ │ │ │ -
64 }
│ │ │ │ -
│ │ │ │ -
65
│ │ │ │ -
│ │ │ │ -
71 void bind(const Element& e)
│ │ │ │ -
72 {
│ │ │ │ -
73 rootLocalView_.bind(e);
│ │ │ │ -
74 }
│ │ │ │ -
│ │ │ │ -
75
│ │ │ │ -
│ │ │ │ -
80 const Element& element() const
│ │ │ │ -
81 {
│ │ │ │ -
82 return rootLocalView_.element();
│ │ │ │ -
83 }
│ │ │ │ -
│ │ │ │ -
84
│ │ │ │ -
│ │ │ │ -
89 void unbind()
│ │ │ │ -
90 {
│ │ │ │ -
91 rootLocalView_.unbind();
│ │ │ │ -
92 }
│ │ │ │ -
│ │ │ │ -
93
│ │ │ │ -
│ │ │ │ -
96 bool bound() const
│ │ │ │ -
97 {
│ │ │ │ -
98 return rootLocalView_.bound();
│ │ │ │ -
99 }
│ │ │ │ -
│ │ │ │ -
100
│ │ │ │ -
│ │ │ │ -
105 const Tree& tree() const
│ │ │ │ -
106 {
│ │ │ │ -
107 return TypeTree::child(rootLocalView_.tree(), globalBasis_->prefixPath());
│ │ │ │ -
108 }
│ │ │ │ -
│ │ │ │ -
109
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
113 {
│ │ │ │ -
114 return rootLocalView_.size();
│ │ │ │ -
115 }
│ │ │ │ -
│ │ │ │ -
116
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
124 {
│ │ │ │ -
125 return rootLocalView_.maxSize();
│ │ │ │ -
126 }
│ │ │ │ -
│ │ │ │ -
127
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
130 {
│ │ │ │ -
131 return rootLocalView_.index(i);
│ │ │ │ -
132 }
│ │ │ │ -
│ │ │ │ -
133
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
137 {
│ │ │ │ -
138 return *globalBasis_;
│ │ │ │ -
139 }
│ │ │ │ +
21// Callable concept ############################################################
│ │ │ │ +
22
│ │ │ │ +
23
│ │ │ │ +
31template<class... Args>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
33{
│ │ │ │ +
34 template<class F>
│ │ │ │ +
35 auto require(F&& f) -> decltype(
│ │ │ │ +
36 f(std::declval<Args>()...)
│ │ │ │ +
37 );
│ │ │ │ +
38};
│ │ │ │
│ │ │ │ +
39
│ │ │ │ +
46template<class F, class... Args>
│ │ │ │ +
│ │ │ │ +
47static constexpr auto isCallable()
│ │ │ │ +
48{ return models<Concept::Callable<Args...>, F>(); }
│ │ │ │ +
│ │ │ │ +
49
│ │ │ │ +
56template<class F, class... Args>
│ │ │ │ +
│ │ │ │ +
57static constexpr auto isCallable(F&&, Args&&...)
│ │ │ │ +
58{
│ │ │ │ +
59 return models<Concept::Callable<Args&&...>, F>();
│ │ │ │ +
60}
│ │ │ │ +
│ │ │ │ +
61
│ │ │ │ +
62
│ │ │ │ +
63
│ │ │ │ +
64// Function concept ############################################################
│ │ │ │ +
65template<class Signature>
│ │ │ │ +
66struct Function;
│ │ │ │ +
67
│ │ │ │ +
76template<class Range, class Domain>
│ │ │ │ +
│ │ │ │ +
77struct Function<Range(Domain)> : Refines<Callable<Domain> >
│ │ │ │ +
78{
│ │ │ │ +
79 template<class F>
│ │ │ │ +
80 auto require(F&& f) -> decltype(
│ │ │ │ +
81 // F models Function<Range(Domain)> if the result of F(Domain) is implicitly convertible to Range
│ │ │ │ +
82 requireConvertible<Range>(f(std::declval<Domain>()))
│ │ │ │ +
83 );
│ │ │ │ +
84};
│ │ │ │ +
│ │ │ │ +
85
│ │ │ │ +
87template<class F, class Signature>
│ │ │ │ +
│ │ │ │ +
88static constexpr bool isFunction()
│ │ │ │ +
89{ return models<Concept::Function<Signature>, F>(); }
│ │ │ │ +
│ │ │ │ +
90
│ │ │ │ +
92template<class F, class Signature, template<class> class DerivativeTraits>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
94{ return models<Concept::Function<Signature>, F>(); }
│ │ │ │ +
│ │ │ │ +
95
│ │ │ │ +
96
│ │ │ │ +
97
│ │ │ │ +
98// DifferentiableFunction concept ##############################################
│ │ │ │ +
99template<class Signature, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ │ + │ │ │ │ +
101
│ │ │ │ +
113template<class Range, class Domain, template<class> class DerivativeTraits>
│ │ │ │ +
│ │ │ │ +
114struct DifferentiableFunction<Range(Domain), DerivativeTraits> : Refines<Dune::Functions::Concept::Function<Range(Domain)> >
│ │ │ │ +
115{
│ │ │ │ + │ │ │ │ +
117
│ │ │ │ +
118 template<class F>
│ │ │ │ +
119 auto require(F&& f) -> decltype(
│ │ │ │ +
120 derivative(f),
│ │ │ │ +
121 requireConcept<Function<DerivativeSignature>>(derivative(f))
│ │ │ │ +
122 );
│ │ │ │ +
123};
│ │ │ │ +
│ │ │ │ +
124
│ │ │ │ +
126template<class F, class Signature, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ │ +
│ │ │ │ +
127static constexpr bool isDifferentiableFunction()
│ │ │ │ +
128{ return models<Concept::DifferentiableFunction<Signature, DerivativeTraits>, F>(); }
│ │ │ │ +
│ │ │ │ +
129
│ │ │ │ +
131template<class F, class Signature, template<class> class DerivativeTraits>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
133{ return models<Concept::DifferentiableFunction<Signature, DerivativeTraits>, F>(); }
│ │ │ │ +
│ │ │ │ +
134
│ │ │ │ +
135
│ │ │ │ +
136
│ │ │ │ +
137// LocalFunction concept ##############################################
│ │ │ │ +
138template<class Signature, class LocalContext>
│ │ │ │ + │ │ │ │
140
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
142 {
│ │ │ │ -
143 return rootLocalView_;
│ │ │ │ -
144 }
│ │ │ │ -
│ │ │ │ -
145
│ │ │ │ -
146protected:
│ │ │ │ - │ │ │ │ - │ │ │ │ -
149};
│ │ │ │ -
│ │ │ │ -
150
│ │ │ │ -
151
│ │ │ │ -
152
│ │ │ │ -
153} // end namespace Functions
│ │ │ │ -
154} // end namespace Dune
│ │ │ │ -
155
│ │ │ │ -
156
│ │ │ │ -
157
│ │ │ │ -
158#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH
│ │ │ │ +
150template<class Range, class Domain, class LocalContext>
│ │ │ │ +
│ │ │ │ +
151struct LocalFunction<Range(Domain), LocalContext> :
│ │ │ │ +
152 Refines<Dune::Functions::Concept::Function<Range(Domain)> >
│ │ │ │ +
153{
│ │ │ │ +
154 template<class F>
│ │ │ │ +
155 auto require(F&& f) -> decltype(
│ │ │ │ +
156 f.bind(std::declval<LocalContext>()),
│ │ │ │ +
157 f.unbind(),
│ │ │ │ +
158 requireConvertible<bool>(f.bound()),
│ │ │ │ +
159 f.localContext(),
│ │ │ │ +
160 requireConvertible<LocalContext>(f.localContext())
│ │ │ │ +
161 );
│ │ │ │ +
162};
│ │ │ │ +
│ │ │ │ +
163
│ │ │ │ +
165template<class F, class Signature, class LocalContext>
│ │ │ │ +
│ │ │ │ +
166static constexpr bool isLocalFunction()
│ │ │ │ +
167{ return models<Concept::LocalFunction<Signature, LocalContext>, F>(); }
│ │ │ │ +
│ │ │ │ +
168
│ │ │ │ +
169
│ │ │ │ +
170// DifferentiableLocalFunction concept ##############################################
│ │ │ │ +
171template<class Signature, class LocalContext, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ │ + │ │ │ │ +
173
│ │ │ │ +
186template<class Range, class Domain, class LocalContext, template<class> class DerivativeTraits>
│ │ │ │ +
│ │ │ │ +
187struct DifferentiableLocalFunction<Range(Domain), LocalContext, DerivativeTraits> :
│ │ │ │ +
188 Refines<
│ │ │ │ +
189 Dune::Functions::Concept::DifferentiableFunction<Range(Domain), DerivativeTraits>,
│ │ │ │ +
190 Dune::Functions::Concept::LocalFunction<Range(Domain),LocalContext>
│ │ │ │ +
191 >
│ │ │ │ +
192{
│ │ │ │ +
193 template<class F>
│ │ │ │ +
194 auto require(F&& f) -> decltype(
│ │ │ │ +
195 f.bind(std::declval<LocalContext>()),
│ │ │ │ +
196 f.unbind(),
│ │ │ │ +
197 f.localContext(),
│ │ │ │ +
198 requireConvertible<LocalContext>(f.localContext())
│ │ │ │ +
199 );
│ │ │ │ +
200};
│ │ │ │ +
│ │ │ │ +
201
│ │ │ │ +
203template<class F, class Signature, class LocalContext, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ │ +
│ │ │ │ +
204static constexpr bool isDifferentiableLocalFunction()
│ │ │ │ +
205{ return models<Concept::DifferentiableLocalFunction<Signature, LocalContext, DerivativeTraits>, F>(); }
│ │ │ │ +
│ │ │ │ +
206
│ │ │ │ +
207
│ │ │ │ +
208// EntitySet concept ##############################################
│ │ │ │ +
209
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
220{
│ │ │ │ +
221 template<class E>
│ │ │ │ +
222 auto require(E&& f) -> decltype(
│ │ │ │ +
223 requireType<typename E::Element>(),
│ │ │ │ +
224 requireType<typename E::LocalCoordinate>(),
│ │ │ │ +
225 requireType<typename E::GlobalCoordinate>()
│ │ │ │ +
226 );
│ │ │ │ +
227};
│ │ │ │ +
│ │ │ │ +
228
│ │ │ │ +
230template<class E>
│ │ │ │ +
│ │ │ │ +
231static constexpr bool isEntitySet()
│ │ │ │ +
232{ return models<Concept::EntitySet, E>(); }
│ │ │ │ +
│ │ │ │ +
233
│ │ │ │ +
234
│ │ │ │ +
235
│ │ │ │ +
236// GridFunction concept ##############################################
│ │ │ │ +
237template<class Signature, class EntitySet>
│ │ │ │ + │ │ │ │ +
239
│ │ │ │ +
249template<class Range, class Domain, class EntitySet>
│ │ │ │ +
│ │ │ │ +
250struct GridFunction<Range(Domain), EntitySet> :
│ │ │ │ +
251 Refines<Dune::Functions::Concept::Function<Range(Domain)> >
│ │ │ │ +
252{
│ │ │ │ +
253 using LocalSignature = Range(typename EntitySet::LocalCoordinate);
│ │ │ │ +
254 using LocalContext = typename EntitySet::Element;
│ │ │ │ +
255
│ │ │ │ +
256 template<class F>
│ │ │ │ +
257 auto require(F&& f) -> decltype(
│ │ │ │ +
258 localFunction(f),
│ │ │ │ +
259 f.entitySet(),
│ │ │ │ +
260 requireConcept<LocalFunction<LocalSignature, LocalContext>>(localFunction(f)),
│ │ │ │ +
261 requireConcept<Concept::EntitySet, EntitySet>(),
│ │ │ │ +
262 requireConvertible<EntitySet>(f.entitySet()),
│ │ │ │ +
263 requireConvertible<typename EntitySet::GlobalCoordinate, Domain>()
│ │ │ │ +
264 );
│ │ │ │ +
265};
│ │ │ │ +
│ │ │ │ +
266
│ │ │ │ +
268template<class F, class Signature, class EntitySet>
│ │ │ │ +
│ │ │ │ +
269static constexpr bool isGridFunction()
│ │ │ │ +
270{ return models<Concept::GridFunction<Signature, EntitySet>, F>(); }
│ │ │ │ +
│ │ │ │ +
271
│ │ │ │ +
272
│ │ │ │ +
273// DifferentiableGridFunction concept ##############################################
│ │ │ │ +
274template<class Signature, class EntitySet, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ │ + │ │ │ │ +
276
│ │ │ │ +
289template<class Range, class Domain, class EntitySet, template<class> class DerivativeTraits>
│ │ │ │ +
│ │ │ │ +
290struct DifferentiableGridFunction<Range(Domain), EntitySet, DerivativeTraits> :
│ │ │ │ +
291 Refines<
│ │ │ │ +
292 Dune::Functions::Concept::DifferentiableFunction<Range(Domain), DerivativeTraits>,
│ │ │ │ +
293 Dune::Functions::Concept::GridFunction<Range(Domain),EntitySet>
│ │ │ │ +
294 >
│ │ │ │ +
295{
│ │ │ │ +
296 using LocalSignature = Range(typename EntitySet::LocalCoordinate);
│ │ │ │ +
297 using LocalContext = typename EntitySet::Element;
│ │ │ │ +
298
│ │ │ │ +
299 template<class R>
│ │ │ │ + │ │ │ │ +
301
│ │ │ │ +
302 template<class F>
│ │ │ │ +
303 auto require(F&& f) -> decltype(
│ │ │ │ +
304 requireConcept<DifferentiableLocalFunction<LocalSignature, LocalContext, LocalDerivativeTraits>>(localFunction(f))
│ │ │ │ +
305 );
│ │ │ │ +
306};
│ │ │ │ +
│ │ │ │ +
307
│ │ │ │ +
309template<class F, class Signature, class EntitySet, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ │ +
│ │ │ │ +
310static constexpr bool isDifferentiableGridFunction()
│ │ │ │ +
311{ return models<Concept::DifferentiableGridFunction<Signature, EntitySet, DerivativeTraits>, F>(); }
│ │ │ │ +
│ │ │ │ +
312
│ │ │ │ +
313
│ │ │ │ +
314
│ │ │ │ +
315// GridViewFunction concept ##############################################
│ │ │ │ +
316template<class Signature, class GridView>
│ │ │ │ + │ │ │ │ +
318
│ │ │ │ +
331template<class Range, class Domain, class GridView>
│ │ │ │ +
│ │ │ │ +
332struct GridViewFunction<Range(Domain), GridView> :
│ │ │ │ +
333 Refines<Dune::Functions::Concept::GridFunction<Range(Domain), GridViewEntitySet<GridView,0>>>
│ │ │ │ +
334{
│ │ │ │ +
335 template<class F>
│ │ │ │ +
336 auto require(F&& f) -> decltype(
│ │ │ │ +
337 0 // We don't need to check any further expressions, because a GridViewFunction is just a GridFunction with a special EntitySet
│ │ │ │ +
338 );
│ │ │ │ +
339};
│ │ │ │ +
│ │ │ │ +
340
│ │ │ │ +
342template<class F, class Signature, class GridView>
│ │ │ │ +
│ │ │ │ +
343static constexpr bool isGridViewFunction()
│ │ │ │ +
344{ return models<Concept::GridViewFunction<Signature, GridView>, F>(); }
│ │ │ │ +
│ │ │ │ +
345
│ │ │ │ +
346
│ │ │ │ +
347// DifferentiableGridViewFunction concept ##############################################
│ │ │ │ +
348template<class Signature, class GridView, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ │ + │ │ │ │ +
350
│ │ │ │ +
364template<class Range, class Domain, class GridView, template<class> class DerivativeTraits>
│ │ │ │ +
│ │ │ │ +
365struct DifferentiableGridViewFunction<Range(Domain), GridView, DerivativeTraits> :
│ │ │ │ +
366 Refines<Dune::Functions::Concept::DifferentiableGridFunction<Range(Domain), GridViewEntitySet<GridView,0>, DerivativeTraits>>
│ │ │ │ +
367{
│ │ │ │ +
368 template<class F>
│ │ │ │ +
369 auto require(F&& f) -> decltype(
│ │ │ │ +
370 0 // We don't need to check any further expressions, because a GridViewFunction is just a GridFunction with a special EntitySet
│ │ │ │ +
371 );
│ │ │ │ +
372};
│ │ │ │ +
│ │ │ │ +
373
│ │ │ │ +
375template<class F, class Signature, class GridView, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ │ +
│ │ │ │ +
376static constexpr bool isDifferentiableGridViewFunction()
│ │ │ │ +
377{ return models<Concept::DifferentiableGridViewFunction<Signature, GridView, DerivativeTraits>, F>(); }
│ │ │ │ +
│ │ │ │ +
378
│ │ │ │ +
379
│ │ │ │ +
380
│ │ │ │ +
381}}} // namespace Dune::Functions::Concept
│ │ │ │ +
382
│ │ │ │ +
383#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:269
│ │ │ │ +
static constexpr bool isDifferentiableLocalFunction()
Check if F models the DifferentiableLocalFunction concept with given signature and local context.
Definition functionconcepts.hh:204
│ │ │ │ +
static constexpr bool isFunction()
Check if F models the Function concept with given signature.
Definition functionconcepts.hh:88
│ │ │ │ +
static constexpr bool isDifferentiableGridViewFunction()
Check if F models the DifferentiableGridViewFunction concept with given signature.
Definition functionconcepts.hh:376
│ │ │ │ +
static constexpr bool isDifferentiableFunction()
Check if F models the DifferentiableFunction concept with given signature.
Definition functionconcepts.hh:127
│ │ │ │ +
static constexpr bool isGridViewFunction()
Check if F models the GridViewFunction concept with given signature.
Definition functionconcepts.hh:343
│ │ │ │ +
static constexpr bool isEntitySet()
Check if F models the GridFunction concept with given signature and entity set.
Definition functionconcepts.hh:231
│ │ │ │ +
static constexpr bool isDifferentiableGridFunction()
Check if F models the DifferentiableGridFunction concept with given signature and entity set.
Definition functionconcepts.hh:310
│ │ │ │ +
static constexpr bool isLocalFunction()
Check if F models the LocalFunction concept with given signature and local context.
Definition functionconcepts.hh:166
│ │ │ │ +
TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
Obtain derivative of TrigonometricFunction function.
Definition trigonometricfunction.hh:39
│ │ │ │ +
static constexpr auto isCallable()
Check if f is callable with given argument list.
Definition functionconcepts.hh:47
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
SubspaceBasis(const RB &, const TP) -> SubspaceBasis< RB, TP >
│ │ │ │ -
Definition subspacebasis.hh:38
│ │ │ │ -
typename RootBasis::GridView GridView
The grid view that the FE space is defined on.
Definition subspacebasis.hh:48
│ │ │ │ -
const PrefixPath & prefixPath() const
Definition subspacebasis.hh:118
│ │ │ │ -
The restriction of a finite element basis to a single element.
Definition subspacelocalview.hh:30
│ │ │ │ -
typename TypeTree::ChildForTreePath< RootTree, PrefixPath > Tree
Tree of local finite elements / local shape function sets.
Definition subspacelocalview.hh:53
│ │ │ │ -
void unbind()
Unbind from the current element.
Definition subspacelocalview.hh:89
│ │ │ │ -
const Element & element() const
Return the grid element that the view is bound to.
Definition subspacelocalview.hh:80
│ │ │ │ -
const GlobalBasis * globalBasis_
Definition subspacelocalview.hh:147
│ │ │ │ -
bool bound() const
Return if the view is bound to a grid element.
Definition subspacelocalview.hh:96
│ │ │ │ -
typename RootLocalView::MultiIndex MultiIndex
Type used for global numbering of the basis vectors.
Definition subspacelocalview.hh:56
│ │ │ │ -
size_type size() const
Total number of degrees of freedom on this element.
Definition subspacelocalview.hh:112
│ │ │ │ -
RootLocalView rootLocalView_
Definition subspacelocalview.hh:148
│ │ │ │ -
void bind(const Element &e)
Bind the view to a grid element.
Definition subspacelocalview.hh:71
│ │ │ │ -
typename GlobalBasis::GridView GridView
The grid view the global FE basis lives on.
Definition subspacelocalview.hh:41
│ │ │ │ -
SubspaceLocalView(const GlobalBasis &globalBasis, const PrefixPath &)
Construct local view for a given global finite element basis.
Definition subspacelocalview.hh:59
│ │ │ │ -
RLV RootLocalView
Definition subspacelocalview.hh:35
│ │ │ │ -
const RootLocalView & rootLocalView() const
Definition subspacelocalview.hh:141
│ │ │ │ -
std::size_t size_type
The type used for sizes.
Definition subspacelocalview.hh:47
│ │ │ │ -
typename GridView::template Codim< 0 >::Entity Element
Type of the grid element we are bound to.
Definition subspacelocalview.hh:44
│ │ │ │ -
const GlobalBasis & globalBasis() const
Return the global basis that we are a view on.
Definition subspacelocalview.hh:136
│ │ │ │ -
size_type maxSize() const
Maximum local size for any element on the GridView.
Definition subspacelocalview.hh:123
│ │ │ │ -
const Tree & tree() const
Return the local ansatz tree associated to the bound entity.
Definition subspacelocalview.hh:105
│ │ │ │ -
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:129
│ │ │ │ -
typename RootLocalView::Tree RootTree
Tree of local finite elements / local shape function sets.
Definition subspacelocalview.hh:50
│ │ │ │ - │ │ │ │ +
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:37
│ │ │ │ +
Concept objects that can be called with given argument list.
Definition functionconcepts.hh:33
│ │ │ │ +
auto require(F &&f) -> decltype(f(std::declval< Args >()...))
│ │ │ │ +
Definition functionconcepts.hh:66
│ │ │ │ +
auto require(F &&f) -> decltype(requireConvertible< Range >(f(std::declval< Domain >())))
│ │ │ │ +
Definition functionconcepts.hh:100
│ │ │ │ +
typename SignatureTraits< Range(Domain)>::template DerivativeSignature< DerivativeTraits > DerivativeSignature
Definition functionconcepts.hh:116
│ │ │ │ +
auto require(F &&f) -> decltype(derivative(f), requireConcept< Function< DerivativeSignature > >(derivative(f)))
│ │ │ │ +
Definition functionconcepts.hh:139
│ │ │ │ +
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:220
│ │ │ │ +
auto require(E &&f) -> decltype(requireType< typename E::Element >(), requireType< typename E::LocalCoordinate >(), requireType< typename E::GlobalCoordinate >())
│ │ │ │ +
Definition functionconcepts.hh:238
│ │ │ │ +
typename EntitySet::Element LocalContext
Definition functionconcepts.hh:254
│ │ │ │ +
Range(typename EntitySet::LocalCoordinate) LocalSignature
Definition functionconcepts.hh:253
│ │ │ │ +
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:300
│ │ │ │ +
auto require(F &&f) -> decltype(requireConcept< DifferentiableLocalFunction< LocalSignature, LocalContext, LocalDerivativeTraits > >(localFunction(f)))
│ │ │ │ +
Range(typename EntitySet::LocalCoordinate) LocalSignature
Definition functionconcepts.hh:296
│ │ │ │ + │ │ │ │ +
Definition functionconcepts.hh:317
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
Helper class to deduce the signature of a callable.
Definition signature.hh:56
│ │ │ │ +
Definition signature.hh:102
│ │ │ │ +
Derivative traits for local functions.
Definition localderivativetraits.hh:28
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,227 +1,459 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -subspacelocalview.hh │ │ │ │ │ + * _c_o_m_m_o_n │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH │ │ │ │ │ 5 │ │ │ │ │ -6 │ │ │ │ │ -7#include │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ 8 │ │ │ │ │ -9#include │ │ │ │ │ -10 │ │ │ │ │ -11#include │ │ │ │ │ +9#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> │ │ │ │ │ +10#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> │ │ │ │ │ +11#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> │ │ │ │ │ 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_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ │ -14 │ │ │ │ │ -15 │ │ │ │ │ +13namespace _D_u_n_e { │ │ │ │ │ +14namespace Functions { │ │ │ │ │ +15namespace Concept { │ │ │ │ │ 16 │ │ │ │ │ -17namespace _D_u_n_e { │ │ │ │ │ -18namespace Functions { │ │ │ │ │ +17using namespace Dune::Concept; │ │ │ │ │ +18 │ │ │ │ │ 19 │ │ │ │ │ 20 │ │ │ │ │ -21 │ │ │ │ │ -22template │ │ │ │ │ -23class _S_u_b_s_p_a_c_e_B_a_s_i_s; │ │ │ │ │ -24 │ │ │ │ │ -25 │ │ │ │ │ -26 │ │ │ │ │ -28template │ │ │ │ │ -_2_9class _S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w │ │ │ │ │ -30{ │ │ │ │ │ -31 using PrefixPath = PP; │ │ │ │ │ -32 │ │ │ │ │ -33public: │ │ │ │ │ -34 │ │ │ │ │ -_3_5 using _R_o_o_t_L_o_c_a_l_V_i_e_w = RLV; │ │ │ │ │ -36 │ │ │ │ │ -_3_8 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_>; │ │ │ │ │ +21// Callable concept │ │ │ │ │ +############################################################ │ │ │ │ │ +22 │ │ │ │ │ +23 │ │ │ │ │ +31template │ │ │ │ │ +_3_2struct _C_a_l_l_a_b_l_e │ │ │ │ │ +33{ │ │ │ │ │ +34 template │ │ │ │ │ +_3_5 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ │ +36 f(std::declval()...) │ │ │ │ │ +37 ); │ │ │ │ │ +38}; │ │ │ │ │ 39 │ │ │ │ │ -_4_1 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; │ │ │ │ │ -42 │ │ │ │ │ -_4_4 using _E_l_e_m_e_n_t = typename GridView::template Codim<0>::Entity; │ │ │ │ │ -45 │ │ │ │ │ -_4_7 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ -48 │ │ │ │ │ -_5_0 using _R_o_o_t_T_r_e_e = typename RootLocalView::Tree; │ │ │ │ │ -51 │ │ │ │ │ -_5_3 using _T_r_e_e = typename TypeTree::ChildForTreePath; │ │ │ │ │ -54 │ │ │ │ │ -_5_6 using _M_u_l_t_i_I_n_d_e_x = typename RootLocalView::MultiIndex; │ │ │ │ │ -57 │ │ │ │ │ -_5_9 _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*/) : │ │ │ │ │ -60 _g_l_o_b_a_l_B_a_s_i_s__(&_g_l_o_b_a_l_B_a_s_i_s), │ │ │ │ │ -61 _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()) │ │ │ │ │ -62 { │ │ │ │ │ -63// static_assert(models, Tree>(), "Tree type │ │ │ │ │ -passed to SubspaceLocalView does not model the BasisNode concept."); │ │ │ │ │ -64 } │ │ │ │ │ -65 │ │ │ │ │ -_7_1 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ │ -72 { │ │ │ │ │ -73 _r_o_o_t_L_o_c_a_l_V_i_e_w__.bind(e); │ │ │ │ │ -74 } │ │ │ │ │ -75 │ │ │ │ │ -_8_0 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ │ -81 { │ │ │ │ │ -82 return _r_o_o_t_L_o_c_a_l_V_i_e_w__.element(); │ │ │ │ │ -83 } │ │ │ │ │ -84 │ │ │ │ │ -_8_9 void _u_n_b_i_n_d() │ │ │ │ │ -90 { │ │ │ │ │ -91 _r_o_o_t_L_o_c_a_l_V_i_e_w__.unbind(); │ │ │ │ │ -92 } │ │ │ │ │ -93 │ │ │ │ │ -_9_6 bool _b_o_u_n_d() const │ │ │ │ │ -97 { │ │ │ │ │ -98 return _r_o_o_t_L_o_c_a_l_V_i_e_w__.bound(); │ │ │ │ │ -99 } │ │ │ │ │ -100 │ │ │ │ │ -_1_0_5 const _T_r_e_e& _t_r_e_e() const │ │ │ │ │ -106 { │ │ │ │ │ -107 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__->_p_r_e_f_i_x_P_a_t_h()); │ │ │ │ │ -108 } │ │ │ │ │ -109 │ │ │ │ │ -_1_1_2 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ │ -113 { │ │ │ │ │ -114 return _r_o_o_t_L_o_c_a_l_V_i_e_w__.size(); │ │ │ │ │ -115 } │ │ │ │ │ -116 │ │ │ │ │ -_1_2_3 _s_i_z_e___t_y_p_e _m_a_x_S_i_z_e() const │ │ │ │ │ -124 { │ │ │ │ │ -125 return _r_o_o_t_L_o_c_a_l_V_i_e_w__.maxSize(); │ │ │ │ │ -126 } │ │ │ │ │ -127 │ │ │ │ │ -_1_2_9 _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 │ │ │ │ │ -130 { │ │ │ │ │ -131 return _r_o_o_t_L_o_c_a_l_V_i_e_w__.index(i); │ │ │ │ │ -132 } │ │ │ │ │ -133 │ │ │ │ │ -_1_3_6 const _G_l_o_b_a_l_B_a_s_i_s& _g_l_o_b_a_l_B_a_s_i_s() const │ │ │ │ │ -137 { │ │ │ │ │ -138 return *_g_l_o_b_a_l_B_a_s_i_s__; │ │ │ │ │ -139 } │ │ │ │ │ +46template │ │ │ │ │ +_4_7static constexpr auto _i_s_C_a_l_l_a_b_l_e() │ │ │ │ │ +48{ return models<_C_o_n_c_e_p_t_:_:_C_a_l_l_a_b_l_e, F>(); } │ │ │ │ │ +49 │ │ │ │ │ +56template │ │ │ │ │ +_5_7static constexpr auto _i_s_C_a_l_l_a_b_l_e(F&&, Args&&...) │ │ │ │ │ +58{ │ │ │ │ │ +59 return models<_C_o_n_c_e_p_t_:_:_C_a_l_l_a_b_l_e, F>(); │ │ │ │ │ +60} │ │ │ │ │ +61 │ │ │ │ │ +62 │ │ │ │ │ +63 │ │ │ │ │ +64// Function concept │ │ │ │ │ +############################################################ │ │ │ │ │ +65template │ │ │ │ │ +_6_6struct _F_u_n_c_t_i_o_n; │ │ │ │ │ +67 │ │ │ │ │ +76template │ │ │ │ │ +_7_7struct _F_u_n_c_t_i_o_n : Refines > │ │ │ │ │ +78{ │ │ │ │ │ +79 template │ │ │ │ │ +_8_0 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ │ +81 // F models Function if the result of F(Domain) is implicitly │ │ │ │ │ +convertible to Range │ │ │ │ │ +82 requireConvertible(f(std::declval())) │ │ │ │ │ +83 ); │ │ │ │ │ +84}; │ │ │ │ │ +85 │ │ │ │ │ +87template │ │ │ │ │ +_8_8static constexpr bool _i_s_F_u_n_c_t_i_o_n() │ │ │ │ │ +89{ return models, F>(); } │ │ │ │ │ +90 │ │ │ │ │ +92template class DerivativeTraits> │ │ │ │ │ +_9_3static 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_>) │ │ │ │ │ +94{ return models, F>(); } │ │ │ │ │ +95 │ │ │ │ │ +96 │ │ │ │ │ +97 │ │ │ │ │ +98// DifferentiableFunction concept │ │ │ │ │ +############################################## │ │ │ │ │ +99template 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_0struct _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n; │ │ │ │ │ +101 │ │ │ │ │ +113template class DerivativeTraits> │ │ │ │ │ +_1_1_4struct _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n : │ │ │ │ │ +Refines > │ │ │ │ │ +115{ │ │ │ │ │ +_1_1_6 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_>; │ │ │ │ │ +117 │ │ │ │ │ +118 template │ │ │ │ │ +_1_1_9 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ │ +120 _d_e_r_i_v_a_t_i_v_e(f), │ │ │ │ │ +121 requireConcept>(_d_e_r_i_v_a_t_i_v_e(f)) │ │ │ │ │ +122 ); │ │ │ │ │ +123}; │ │ │ │ │ +124 │ │ │ │ │ +126template 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_2_7static 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() │ │ │ │ │ +128{ return models, F>(); } │ │ │ │ │ +129 │ │ │ │ │ +131template class DerivativeTraits> │ │ │ │ │ +_1_3_2static 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_>) │ │ │ │ │ +133{ return models, F>(); } │ │ │ │ │ +134 │ │ │ │ │ +135 │ │ │ │ │ +136 │ │ │ │ │ +137// LocalFunction concept ############################################## │ │ │ │ │ +138template │ │ │ │ │ +_1_3_9struct _L_o_c_a_l_F_u_n_c_t_i_o_n; │ │ │ │ │ 140 │ │ │ │ │ -_1_4_1 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 │ │ │ │ │ -142 { │ │ │ │ │ -143 return _r_o_o_t_L_o_c_a_l_V_i_e_w__; │ │ │ │ │ -144 } │ │ │ │ │ -145 │ │ │ │ │ -146protected: │ │ │ │ │ -_1_4_7 const _G_l_o_b_a_l_B_a_s_i_s* _g_l_o_b_a_l_B_a_s_i_s__; │ │ │ │ │ -_1_4_8 _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__; │ │ │ │ │ -149}; │ │ │ │ │ -150 │ │ │ │ │ -151 │ │ │ │ │ -152 │ │ │ │ │ -153} // end namespace Functions │ │ │ │ │ -154} // end namespace Dune │ │ │ │ │ -155 │ │ │ │ │ -156 │ │ │ │ │ -157 │ │ │ │ │ -158#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH │ │ │ │ │ +150template │ │ │ │ │ +_1_5_1struct _L_o_c_a_l_F_u_n_c_t_i_o_n : │ │ │ │ │ +152 Refines > │ │ │ │ │ +153{ │ │ │ │ │ +154 template │ │ │ │ │ +_1_5_5 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ │ +156 f.bind(std::declval()), │ │ │ │ │ +157 f.unbind(), │ │ │ │ │ +158 requireConvertible(f.bound()), │ │ │ │ │ +159 f.localContext(), │ │ │ │ │ +160 requireConvertible(f.localContext()) │ │ │ │ │ +161 ); │ │ │ │ │ +162}; │ │ │ │ │ +163 │ │ │ │ │ +165template │ │ │ │ │ +_1_6_6static constexpr bool _i_s_L_o_c_a_l_F_u_n_c_t_i_o_n() │ │ │ │ │ +167{ return models, F>(); } │ │ │ │ │ +168 │ │ │ │ │ +169 │ │ │ │ │ +170// DifferentiableLocalFunction concept │ │ │ │ │ +############################################## │ │ │ │ │ +171template 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_2struct _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; │ │ │ │ │ +173 │ │ │ │ │ +186template │ │ │ │ │ +class DerivativeTraits> │ │ │ │ │ +_1_8_7struct _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 : │ │ │ │ │ +188 Refines< │ │ │ │ │ +189 Dune::Functions::Concept::DifferentiableFunction, │ │ │ │ │ +190 Dune::Functions::Concept::LocalFunction │ │ │ │ │ +191 > │ │ │ │ │ +192{ │ │ │ │ │ +193 template │ │ │ │ │ +_1_9_4 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ │ +195 f.bind(std::declval()), │ │ │ │ │ +196 f.unbind(), │ │ │ │ │ +197 f.localContext(), │ │ │ │ │ +198 requireConvertible(f.localContext()) │ │ │ │ │ +199 ); │ │ │ │ │ +200}; │ │ │ │ │ +201 │ │ │ │ │ +203template 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_4static 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() │ │ │ │ │ +205{ return models, F>(); } │ │ │ │ │ +206 │ │ │ │ │ +207 │ │ │ │ │ +208// EntitySet concept ############################################## │ │ │ │ │ +209 │ │ │ │ │ +_2_1_9struct _E_n_t_i_t_y_S_e_t │ │ │ │ │ +220{ │ │ │ │ │ +221 template │ │ │ │ │ +_2_2_2 auto _r_e_q_u_i_r_e(E&& f) -> decltype( │ │ │ │ │ +223 requireType(), │ │ │ │ │ +224 requireType(), │ │ │ │ │ +225 requireType() │ │ │ │ │ +226 ); │ │ │ │ │ +227}; │ │ │ │ │ +228 │ │ │ │ │ +230template │ │ │ │ │ +_2_3_1static constexpr bool _i_s_E_n_t_i_t_y_S_e_t() │ │ │ │ │ +232{ return models(); } │ │ │ │ │ +233 │ │ │ │ │ +234 │ │ │ │ │ +235 │ │ │ │ │ +236// GridFunction concept ############################################## │ │ │ │ │ +237template │ │ │ │ │ +_2_3_8struct _G_r_i_d_F_u_n_c_t_i_o_n; │ │ │ │ │ +239 │ │ │ │ │ +249template │ │ │ │ │ +_2_5_0struct _G_r_i_d_F_u_n_c_t_i_o_n : │ │ │ │ │ +251 Refines > │ │ │ │ │ +252{ │ │ │ │ │ +_2_5_3 using _L_o_c_a_l_S_i_g_n_a_t_u_r_e = Range(typename EntitySet::LocalCoordinate); │ │ │ │ │ +_2_5_4 using _L_o_c_a_l_C_o_n_t_e_x_t = typename EntitySet::Element; │ │ │ │ │ +255 │ │ │ │ │ +256 template │ │ │ │ │ +_2_5_7 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ │ +258 localFunction(f), │ │ │ │ │ +259 f.entitySet(), │ │ │ │ │ +260 requireConcept>(localFunction │ │ │ │ │ +(f)), │ │ │ │ │ +261 requireConcept(), │ │ │ │ │ +262 requireConvertible(f.entitySet()), │ │ │ │ │ +263 requireConvertible() │ │ │ │ │ +264 ); │ │ │ │ │ +265}; │ │ │ │ │ +266 │ │ │ │ │ +268template │ │ │ │ │ +_2_6_9static constexpr bool _i_s_G_r_i_d_F_u_n_c_t_i_o_n() │ │ │ │ │ +270{ return models, F>(); } │ │ │ │ │ +271 │ │ │ │ │ +272 │ │ │ │ │ +273// DifferentiableGridFunction concept │ │ │ │ │ +############################################## │ │ │ │ │ +274template 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_5struct _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; │ │ │ │ │ +276 │ │ │ │ │ +289template class │ │ │ │ │ +DerivativeTraits> │ │ │ │ │ +_2_9_0struct _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 : │ │ │ │ │ +291 Refines< │ │ │ │ │ +292 Dune::Functions::Concept::DifferentiableFunction, │ │ │ │ │ +293 Dune::Functions::Concept::GridFunction │ │ │ │ │ +294 > │ │ │ │ │ +295{ │ │ │ │ │ +_2_9_6 using _L_o_c_a_l_S_i_g_n_a_t_u_r_e = Range(typename EntitySet::LocalCoordinate); │ │ │ │ │ +_2_9_7 using _L_o_c_a_l_C_o_n_t_e_x_t = typename EntitySet::Element; │ │ │ │ │ +298 │ │ │ │ │ +299 template │ │ │ │ │ +_3_0_0 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; │ │ │ │ │ +301 │ │ │ │ │ +302 template │ │ │ │ │ +_3_0_3 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ │ +304 requireConcept>(localFunction(f)) │ │ │ │ │ +305 ); │ │ │ │ │ +306}; │ │ │ │ │ +307 │ │ │ │ │ +309template 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_0static 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() │ │ │ │ │ +311{ return models, F>(); } │ │ │ │ │ +312 │ │ │ │ │ +313 │ │ │ │ │ +314 │ │ │ │ │ +315// GridViewFunction concept ############################################## │ │ │ │ │ +316template │ │ │ │ │ +_3_1_7struct _G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n; │ │ │ │ │ +318 │ │ │ │ │ +331template │ │ │ │ │ +_3_3_2struct _G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n : │ │ │ │ │ +333 Refines>> │ │ │ │ │ +334{ │ │ │ │ │ +335 template │ │ │ │ │ +_3_3_6 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ │ +337 0 // We don't need to check any further expressions, because a │ │ │ │ │ +GridViewFunction is just a GridFunction with a special EntitySet │ │ │ │ │ +338 ); │ │ │ │ │ +339}; │ │ │ │ │ +340 │ │ │ │ │ +342template │ │ │ │ │ +_3_4_3static constexpr bool _i_s_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n() │ │ │ │ │ +344{ return models, F>(); } │ │ │ │ │ +345 │ │ │ │ │ +346 │ │ │ │ │ +347// DifferentiableGridViewFunction concept │ │ │ │ │ +############################################## │ │ │ │ │ +348template 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_4_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; │ │ │ │ │ +350 │ │ │ │ │ +364template class │ │ │ │ │ +DerivativeTraits> │ │ │ │ │ +_3_6_5struct _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 : │ │ │ │ │ +366 Refines, DerivativeTraits>> │ │ │ │ │ +367{ │ │ │ │ │ +368 template │ │ │ │ │ +_3_6_9 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ │ +370 0 // We don't need to check any further expressions, because a │ │ │ │ │ +GridViewFunction is just a GridFunction with a special EntitySet │ │ │ │ │ +371 ); │ │ │ │ │ +372}; │ │ │ │ │ +373 │ │ │ │ │ +375template 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_7_6static 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() │ │ │ │ │ +377{ return models, F>(); } │ │ │ │ │ +378 │ │ │ │ │ +379 │ │ │ │ │ +380 │ │ │ │ │ +381}}} // namespace Dune::Functions::Concept │ │ │ │ │ +382 │ │ │ │ │ +383#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:269 │ │ │ │ │ +_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:204 │ │ │ │ │ +_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:88 │ │ │ │ │ +_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:376 │ │ │ │ │ +_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:127 │ │ │ │ │ +_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:343 │ │ │ │ │ +_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:231 │ │ │ │ │ +_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:310 │ │ │ │ │ +_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:166 │ │ │ │ │ +_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:39 │ │ │ │ │ +_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:47 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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 │ │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:38 │ │ │ │ │ -_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:48 │ │ │ │ │ -_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 │ │ │ │ │ -const PrefixPath & prefixPath() const │ │ │ │ │ -DDeeffiinniittiioonn subspacebasis.hh:118 │ │ │ │ │ -_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:30 │ │ │ │ │ -_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 │ │ │ │ │ -typename TypeTree::ChildForTreePath< RootTree, PrefixPath > Tree │ │ │ │ │ -Tree of local finite elements / local shape function sets. │ │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.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_:_:_u_n_b_i_n_d │ │ │ │ │ -void unbind() │ │ │ │ │ -Unbind from the current element. │ │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:89 │ │ │ │ │ -_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:80 │ │ │ │ │ -_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_:_:_g_l_o_b_a_l_B_a_s_i_s__ │ │ │ │ │ -const GlobalBasis * globalBasis_ │ │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:147 │ │ │ │ │ -_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:96 │ │ │ │ │ -_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_u_l_t_i_I_n_d_e_x │ │ │ │ │ -typename RootLocalView::MultiIndex MultiIndex │ │ │ │ │ -Type used for global numbering of the basis vectors. │ │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:56 │ │ │ │ │ -_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:112 │ │ │ │ │ -_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__ │ │ │ │ │ -RootLocalView rootLocalView_ │ │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:148 │ │ │ │ │ -_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:71 │ │ │ │ │ -_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_:_:_G_r_i_d_V_i_e_w │ │ │ │ │ -typename GlobalBasis::GridView GridView │ │ │ │ │ -The grid view the global FE basis lives on. │ │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:41 │ │ │ │ │ -_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:59 │ │ │ │ │ -_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 │ │ │ │ │ -RLV RootLocalView │ │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:35 │ │ │ │ │ -_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:141 │ │ │ │ │ -_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___t_y_p_e │ │ │ │ │ -std::size_t size_type │ │ │ │ │ -The type used for sizes. │ │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:47 │ │ │ │ │ -_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 │ │ │ │ │ -typename GridView::template Codim< 0 >::Entity Element │ │ │ │ │ -Type of the grid element we are bound to. │ │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:44 │ │ │ │ │ -_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_:_:_g_l_o_b_a_l_B_a_s_i_s │ │ │ │ │ -const GlobalBasis & globalBasis() const │ │ │ │ │ -Return the global basis that we are a view on. │ │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:136 │ │ │ │ │ -_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:123 │ │ │ │ │ -_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:105 │ │ │ │ │ -_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:129 │ │ │ │ │ -_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_T_r_e_e │ │ │ │ │ -typename RootLocalView::Tree RootTree │ │ │ │ │ -Tree of local finite elements / local shape function sets. │ │ │ │ │ -DDeeffiinniittiioonn subspacelocalview.hh:50 │ │ │ │ │ -_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: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 │ │ │ │ │ +Concept objects that can be called with given argument list. │ │ │ │ │ +DDeeffiinniittiioonn functionconcepts.hh:33 │ │ │ │ │ +_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:66 │ │ │ │ │ +_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:100 │ │ │ │ │ +_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:116 │ │ │ │ │ +_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:139 │ │ │ │ │ +_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:172 │ │ │ │ │ +_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:220 │ │ │ │ │ +_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:238 │ │ │ │ │ +_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:254 │ │ │ │ │ +_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:253 │ │ │ │ │ +_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:275 │ │ │ │ │ +_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: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_ _>_:_:_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:296 │ │ │ │ │ +_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:297 │ │ │ │ │ +_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:317 │ │ │ │ │ +_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:349 │ │ │ │ │ +_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:56 │ │ │ │ │ +_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:102 │ │ │ │ │ +_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:28 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00095.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: nodes.hh File Reference │ │ │ │ +dune-functions: powerbasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -71,59 +71,46 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces | │ │ │ │ -Functions
│ │ │ │ -
nodes.hh File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
powerbasis.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <cassert>
│ │ │ │ -#include <memory>
│ │ │ │ +
#include <dune/common/reservedvector.hh>
│ │ │ │ +#include <dune/common/typeutilities.hh>
│ │ │ │ #include <dune/common/indices.hh>
│ │ │ │ -#include <dune/typetree/leafnode.hh>
│ │ │ │ -#include <dune/typetree/powernode.hh>
│ │ │ │ -#include <dune/typetree/compositenode.hh>
│ │ │ │ -#include <dune/typetree/traversal.hh>
│ │ │ │ -#include <dune/typetree/visitor.hh>
│ │ │ │ +#include <dune/functions/common/utility.hh>
│ │ │ │ +#include <dune/functions/common/type_traits.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::BasisNodeMixin
 
class  Dune::Functions::LeafBasisNode
 
class  Dune::Functions::PowerBasisNode< T, n >
 
class  Dune::Functions::CompositeBasisNode< T >
class  Dune::Functions::PowerPreBasis< IMS, SPB, C >
 A pre-basis for power bases. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ │ Namespaces

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

│ │ │ │ -Functions

template<typename Tree >
void Dune::Functions::clearSize (Tree &tree, std::size_t offset)
 
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)
 
namespace  Dune::Functions::BasisFactory
 
namespace  Dune::Functions::BasisBuilder
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,46 +1,34 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_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_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -nodes.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ +powerbasis.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_/_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_/_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_:_:_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_:_:_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_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_<_ _T_ _> │ │ │ │ │ +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 │ │ │ │ │   │ │ │ │ │ -FFuunnccttiioonnss │ │ │ │ │ -template │ │ │ │ │ -void  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_l_e_a_r_S_i_z_e (Tree &tree, std::size_t offset) │ │ │ │ │ -  │ │ │ │ │ -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) │ │ │ │ │ +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 │ │ │ │ │   │ │ │ │ │ -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) │ │ │ │ │ +namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_B_u_i_l_d_e_r │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00095_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: nodes.hh Source File │ │ │ │ +dune-functions: powerbasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,354 +74,430 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
nodes.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH
│ │ │ │
5
│ │ │ │ -
6#include <cassert>
│ │ │ │ -
7#include <memory>
│ │ │ │ -
8
│ │ │ │ -
9#include <dune/common/indices.hh>
│ │ │ │ -
10
│ │ │ │ -
11#include <dune/typetree/leafnode.hh>
│ │ │ │ -
12#include <dune/typetree/powernode.hh>
│ │ │ │ -
13#include <dune/typetree/compositenode.hh>
│ │ │ │ -
14#include <dune/typetree/traversal.hh>
│ │ │ │ -
15#include <dune/typetree/visitor.hh>
│ │ │ │ +
6#include <dune/common/reservedvector.hh>
│ │ │ │ +
7#include <dune/common/typeutilities.hh>
│ │ │ │ +
8#include <dune/common/indices.hh>
│ │ │ │ +
9
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
16
│ │ │ │ -
17namespace Dune {
│ │ │ │ -
18 namespace Functions {
│ │ │ │ -
19
│ │ │ │ -
20
│ │ │ │ -
21 namespace Impl {
│ │ │ │ +
17
│ │ │ │ +
18
│ │ │ │ +
19namespace Dune {
│ │ │ │ +
20namespace Functions {
│ │ │ │ +
21
│ │ │ │
22
│ │ │ │ -
23
│ │ │ │ -
24 struct ClearSizeVisitor
│ │ │ │ -
25 : public TypeTree::TreeVisitor
│ │ │ │ -
26 , public TypeTree::DynamicTraversal
│ │ │ │ -
27 {
│ │ │ │ -
28
│ │ │ │ -
29 template<typename Node, typename TreePath>
│ │ │ │ -
30 void pre(Node& node, TreePath treePath)
│ │ │ │ -
31 {
│ │ │ │ -
32 leaf(node,treePath);
│ │ │ │ -
33 node.setSize(0);
│ │ │ │ -
34 }
│ │ │ │ -
35
│ │ │ │ -
36 template<typename Node, typename TreePath>
│ │ │ │ -
37 void leaf(Node& node, TreePath treePath)
│ │ │ │ -
38 {
│ │ │ │ -
39 node.setOffset(offset_);
│ │ │ │ -
40 }
│ │ │ │ -
41
│ │ │ │ -
42 ClearSizeVisitor(std::size_t offset)
│ │ │ │ -
43 : offset_(offset)
│ │ │ │ -
44 {}
│ │ │ │ -
45
│ │ │ │ -
46 const std::size_t offset_;
│ │ │ │ -
47
│ │ │ │ -
48 };
│ │ │ │ -
49
│ │ │ │ +
23// *****************************************************************************
│ │ │ │ +
24// This is the reusable part of the power bases. It contains
│ │ │ │ +
25//
│ │ │ │ +
26// PowerPreBasis
│ │ │ │ +
27//
│ │ │ │ +
28// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ │ +
29// state. These components do _not_ depend on the global basis and local view
│ │ │ │ +
30// and can be used without a global basis.
│ │ │ │ +
31// *****************************************************************************
│ │ │ │ +
32
│ │ │ │ +
43template<class IMS, class SPB, std::size_t C>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
45{
│ │ │ │ +
46 static const std::size_t children = C;
│ │ │ │ +
47 static const bool isBlocked = std::is_same_v<IMS,BasisFactory::BlockedLexicographic> or std::is_same_v<IMS,BasisFactory::BlockedInterleaved>;
│ │ │ │ +
48
│ │ │ │ +
49public:
│ │ │ │
50
│ │ │ │ -
51 template<typename Entity>
│ │ │ │ -
52 struct BindVisitor
│ │ │ │ -
53 : public TypeTree::TreeVisitor
│ │ │ │ -
54 , public TypeTree::DynamicTraversal
│ │ │ │ -
55 {
│ │ │ │ +
52 using SubPreBasis = SPB;
│ │ │ │ +
53
│ │ │ │ +
55 using GridView = typename SPB::GridView;
│ │ │ │
56
│ │ │ │ -
57 template<typename Node, typename TreePath>
│ │ │ │ -
58 void pre(Node& node, TreePath)
│ │ │ │ -
59 {
│ │ │ │ -
60 node.setOffset(offset_);
│ │ │ │ -
61 }
│ │ │ │ +
58 using size_type = std::size_t;
│ │ │ │ +
59
│ │ │ │ + │ │ │ │
62
│ │ │ │ -
63 template<typename Node, typename TreePath>
│ │ │ │ -
64 void post(Node& node, TreePath)
│ │ │ │ -
65 {
│ │ │ │ -
66 node.setSize(offset_ - node.offset());
│ │ │ │ -
67 }
│ │ │ │ -
68
│ │ │ │ -
69 template<typename Node, typename TreePath>
│ │ │ │ -
70 void leaf(Node& node, TreePath)
│ │ │ │ -
71 {
│ │ │ │ -
72 node.setOffset(offset_);
│ │ │ │ -
73 node.bind(entity_);
│ │ │ │ -
74 offset_ += node.size();
│ │ │ │ -
75 }
│ │ │ │ -
76
│ │ │ │ -
77 BindVisitor(const Entity& entity, std::size_t offset = 0)
│ │ │ │ -
78 : entity_(entity)
│ │ │ │ -
79 , offset_(offset)
│ │ │ │ -
80 {}
│ │ │ │ -
81
│ │ │ │ -
82 const Entity& entity_;
│ │ │ │ -
83 std::size_t offset_;
│ │ │ │ -
84
│ │ │ │ -
85 };
│ │ │ │ -
86
│ │ │ │ -
87
│ │ │ │ -
88 struct InitializeTreeVisitor :
│ │ │ │ -
89 public TypeTree::TreeVisitor,
│ │ │ │ -
90 public TypeTree::DynamicTraversal
│ │ │ │ -
91 {
│ │ │ │ -
92 template<typename Node, typename TreePath>
│ │ │ │ -
93 void pre(Node& node, TreePath)
│ │ │ │ -
94 {
│ │ │ │ -
95 node.setTreeIndex(treeIndex_);
│ │ │ │ -
96 ++treeIndex_;
│ │ │ │ -
97 }
│ │ │ │ -
98
│ │ │ │ -
99 template<typename Node, typename TreePath>
│ │ │ │ -
100 void leaf(Node& node, TreePath)
│ │ │ │ -
101 {
│ │ │ │ -
102 node.setTreeIndex(treeIndex_);
│ │ │ │ -
103 ++treeIndex_;
│ │ │ │ -
104 }
│ │ │ │ -
105
│ │ │ │ -
106 InitializeTreeVisitor(std::size_t treeIndexOffset = 0) :
│ │ │ │ -
107 treeIndex_(treeIndexOffset)
│ │ │ │ -
108 {}
│ │ │ │ -
109
│ │ │ │ -
110 std::size_t treeIndex_;
│ │ │ │ -
111 };
│ │ │ │ -
112
│ │ │ │ -
113 } // end namespace Impl
│ │ │ │ +
63 using SubNode = typename SubPreBasis::Node;
│ │ │ │ +
64
│ │ │ │ + │ │ │ │ +
67
│ │ │ │ +
68 static constexpr size_type maxMultiIndexSize = SubPreBasis::maxMultiIndexSize + isBlocked;
│ │ │ │ +
69 static constexpr size_type minMultiIndexSize = SubPreBasis::minMultiIndexSize + isBlocked;
│ │ │ │ +
70 static constexpr size_type multiIndexBufferSize = SubPreBasis::multiIndexBufferSize + isBlocked;
│ │ │ │ +
71
│ │ │ │ +
77 template<class... SFArgs,
│ │ │ │ +
78 disableCopyMove<PowerPreBasis, SFArgs...> = 0,
│ │ │ │ +
79 enableIfConstructible<SubPreBasis, SFArgs...> = 0>
│ │ │ │ +
│ │ │ │ +
80 PowerPreBasis(SFArgs&&... sfArgs) :
│ │ │ │ +
81 subPreBasis_(std::forward<SFArgs>(sfArgs)...)
│ │ │ │ +
82 {
│ │ │ │ +
83 static_assert(models<Concept::PreBasis<GridView>, SubPreBasis>(), "Subprebasis passed to PowerPreBasis does not model the PreBasis concept.");
│ │ │ │ +
84 }
│ │ │ │ +
│ │ │ │ +
85
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
88 {
│ │ │ │ +
89 subPreBasis_.initializeIndices();
│ │ │ │ +
90 }
│ │ │ │ +
│ │ │ │ +
91
│ │ │ │ +
│ │ │ │ +
93 const GridView& gridView() const
│ │ │ │ +
94 {
│ │ │ │ +
95 return subPreBasis_.gridView();
│ │ │ │ +
96 }
│ │ │ │ +
│ │ │ │ +
97
│ │ │ │ +
│ │ │ │ +
99 void update(const GridView& gv)
│ │ │ │ +
100 {
│ │ │ │ +
101 subPreBasis_.update(gv);
│ │ │ │ +
102 }
│ │ │ │ +
│ │ │ │ +
103
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
108 {
│ │ │ │ +
109 auto node = Node{};
│ │ │ │ +
110 for (std::size_t i=0; i<children; ++i)
│ │ │ │ +
111 node.setChild(i, subPreBasis_.makeNode());
│ │ │ │ +
112 return node;
│ │ │ │ +
113 }
│ │ │ │ +
│ │ │ │
114
│ │ │ │ -
115
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
117 {
│ │ │ │ -
118
│ │ │ │ -
119 friend struct Impl::ClearSizeVisitor;
│ │ │ │ -
120
│ │ │ │ -
121 template<typename>
│ │ │ │ -
122 friend struct Impl::BindVisitor;
│ │ │ │ -
123
│ │ │ │ -
124 friend struct Impl::InitializeTreeVisitor;
│ │ │ │ -
125
│ │ │ │ -
126 public:
│ │ │ │ -
127
│ │ │ │ -
128 using size_type = std::size_t;
│ │ │ │ -
129
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
131 offset_(0),
│ │ │ │ -
132 size_(0),
│ │ │ │ -
133 treeIndex_(0)
│ │ │ │ -
134 {}
│ │ │ │ -
│ │ │ │ -
135
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
137 {
│ │ │ │ -
138 assert(i < size_);
│ │ │ │ -
139 return offset_ + i;
│ │ │ │ -
140 }
│ │ │ │ -
│ │ │ │ -
141
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
143 {
│ │ │ │ -
144 return size_;
│ │ │ │ -
145 }
│ │ │ │ -
│ │ │ │ -
146
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
148 {
│ │ │ │ -
149 return treeIndex_;
│ │ │ │ -
150 }
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
117 {
│ │ │ │ +
118 return size(Dune::ReservedVector<size_type, multiIndexBufferSize>{});
│ │ │ │ +
119 }
│ │ │ │
│ │ │ │ +
120
│ │ │ │ +
122
│ │ │ │ +
123 template<class SizePrefix>
│ │ │ │ +
│ │ │ │ +
124 size_type size(const SizePrefix& prefix) const
│ │ │ │ +
125 {
│ │ │ │ +
126 return size(prefix, IndexMergingStrategy{});
│ │ │ │ +
127 }
│ │ │ │ +
│ │ │ │ +
128
│ │ │ │ +
129private:
│ │ │ │ +
130
│ │ │ │ +
131 template<class SizePrefix>
│ │ │ │ +
132 size_type size(const SizePrefix& prefix, BasisFactory::FlatInterleaved) const
│ │ │ │ +
133 {
│ │ │ │ +
134 // The root index size is the root index size of a single subnode
│ │ │ │ +
135 // multiplied by the number of subnodes because we enumerate all
│ │ │ │ +
136 // child indices in a row.
│ │ │ │ +
137 if (prefix.size() == 0)
│ │ │ │ +
138 return children*subPreBasis_.size();
│ │ │ │ +
139
│ │ │ │ +
140 // The first prefix entry refers to one of the (root index size)
│ │ │ │ +
141 // subindex trees. Hence we have to first compute the corresponding
│ │ │ │ +
142 // prefix entry for a single subnode subnode. The we can append
│ │ │ │ +
143 // the other prefix entries unmodified, because the index tree
│ │ │ │ +
144 // looks the same after the first level.
│ │ │ │ +
145 SizePrefix subPrefix;
│ │ │ │ +
146 subPrefix.push_back(prefix[0] / children);
│ │ │ │ +
147 for(std::size_t i=1; i<prefix.size(); ++i)
│ │ │ │ +
148 subPrefix.push_back(prefix[i]);
│ │ │ │ +
149 return subPreBasis_.size(subPrefix);
│ │ │ │ +
150 }
│ │ │ │
151
│ │ │ │ -
152 protected:
│ │ │ │ -
153
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
155 {
│ │ │ │ -
156 return offset_;
│ │ │ │ -
157 }
│ │ │ │ -
│ │ │ │ -
158
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
160 {
│ │ │ │ -
161 offset_ = offset;
│ │ │ │ -
162 }
│ │ │ │ -
│ │ │ │ -
163
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
165 {
│ │ │ │ -
166 size_ = size;
│ │ │ │ -
167 }
│ │ │ │ -
│ │ │ │ -
168
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
170 {
│ │ │ │ -
171 treeIndex_ = treeIndex;
│ │ │ │ -
172 }
│ │ │ │ -
│ │ │ │ -
173
│ │ │ │ -
174 private:
│ │ │ │ -
175
│ │ │ │ -
176 size_type offset_;
│ │ │ │ -
177 size_type size_;
│ │ │ │ -
178 size_type treeIndex_;
│ │ │ │ -
179
│ │ │ │ -
180 };
│ │ │ │ -
│ │ │ │ -
181
│ │ │ │ -
182
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
184 public BasisNodeMixin,
│ │ │ │ -
185 public TypeTree::LeafNode
│ │ │ │ -
186 {};
│ │ │ │ -
│ │ │ │ -
187
│ │ │ │ -
188
│ │ │ │ -
189 template<typename T, std::size_t n>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
191 public BasisNodeMixin,
│ │ │ │ -
192 public TypeTree::PowerNode<T,n>
│ │ │ │ -
193 {
│ │ │ │ -
194
│ │ │ │ -
195 using Node = TypeTree::PowerNode<T,n>;
│ │ │ │ -
196
│ │ │ │ -
197 public:
│ │ │ │ -
198
│ │ │ │ -
199 using Element = typename T::Element;
│ │ │ │ -
200
│ │ │ │ -
201 PowerBasisNode() = default;
│ │ │ │ -
202
│ │ │ │ -
│ │ │ │ -
203 PowerBasisNode(const typename Node::NodeStorage& children) :
│ │ │ │ -
204 Node(children)
│ │ │ │ -
205 {}
│ │ │ │ -
│ │ │ │ -
206
│ │ │ │ +
152 template<class SizePrefix>
│ │ │ │ +
153 size_type size(const SizePrefix& prefix, BasisFactory::FlatLexicographic) const
│ │ │ │ +
154 {
│ │ │ │ +
155 // The size at the index tree root is the size of at the index tree
│ │ │ │ +
156 // root of a single subnode multiplied by the number of subnodes
│ │ │ │ +
157 // because we enumerate all child indices in a row.
│ │ │ │ +
158 if (prefix.size() == 0)
│ │ │ │ +
159 return children*subPreBasis_.size();
│ │ │ │ +
160
│ │ │ │ +
161 // The first prefix entry refers to one of the (root index size)
│ │ │ │ +
162 // subindex trees. Hence we have to first compute the corresponding
│ │ │ │ +
163 // prefix entry for a single subnode subnode. The we can append
│ │ │ │ +
164 // the other prefix entries unmodified, because the index tree
│ │ │ │ +
165 // looks the same after the first level.
│ │ │ │ +
166 SizePrefix subPrefix;
│ │ │ │ +
167 subPrefix.push_back(prefix[0] % children);
│ │ │ │ +
168 for(std::size_t i=1; i<prefix.size(); ++i)
│ │ │ │ +
169 subPrefix.push_back(prefix[i]);
│ │ │ │ +
170 return subPreBasis_.size(subPrefix);
│ │ │ │ +
171 }
│ │ │ │ +
172
│ │ │ │ +
173 template<class SizePrefix>
│ │ │ │ +
174 size_type size(const SizePrefix& prefix, BasisFactory::BlockedLexicographic) const
│ │ │ │ +
175 {
│ │ │ │ +
176 if (prefix.size() == 0)
│ │ │ │ +
177 return children;
│ │ │ │ +
178 SizePrefix subPrefix;
│ │ │ │ +
179 for(std::size_t i=1; i<prefix.size(); ++i)
│ │ │ │ +
180 subPrefix.push_back(prefix[i]);
│ │ │ │ +
181 return subPreBasis_.size(subPrefix);
│ │ │ │ +
182 }
│ │ │ │ +
183
│ │ │ │ +
184 template<class SizePrefix>
│ │ │ │ +
185 size_type size(const SizePrefix& prefix, BasisFactory::BlockedInterleaved) const
│ │ │ │ +
186 {
│ │ │ │ +
187 if (prefix.size() == 0)
│ │ │ │ +
188 return subPreBasis_.size();
│ │ │ │ +
189
│ │ │ │ +
190 SizePrefix subPrefix;
│ │ │ │ +
191 for(std::size_t i=0; i<prefix.size()-1; ++i)
│ │ │ │ +
192 subPrefix.push_back(prefix[i]);
│ │ │ │ +
193
│ │ │ │ +
194 size_type r = subPreBasis_.size(subPrefix);
│ │ │ │ +
195 if (r==0)
│ │ │ │ +
196 return 0;
│ │ │ │ +
197 subPrefix.push_back(prefix.back());
│ │ │ │ +
198 r = subPreBasis_.size(subPrefix);
│ │ │ │ +
199 if (r==0)
│ │ │ │ +
200 return children;
│ │ │ │ +
201 return r;
│ │ │ │ +
202 }
│ │ │ │ +
203
│ │ │ │ +
204public:
│ │ │ │ +
205
│ │ │ │
│ │ │ │ -
207 const Element& element() const
│ │ │ │ -
208 {
│ │ │ │ -
209 return this->child(Dune::Indices::_0).element();
│ │ │ │ -
210 }
│ │ │ │ + │ │ │ │ +
208 {
│ │ │ │ +
209 return subPreBasis_.dimension() * children;
│ │ │ │ +
210 }
│ │ │ │
│ │ │ │
211
│ │ │ │ -
212 };
│ │ │ │ -
│ │ │ │ -
213
│ │ │ │ -
214
│ │ │ │ -
215 template<typename... T>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
217 public BasisNodeMixin,
│ │ │ │ -
218 public TypeTree::CompositeNode<T...>
│ │ │ │ -
219 {
│ │ │ │ -
220
│ │ │ │ -
221 using Node = TypeTree::CompositeNode<T...>;
│ │ │ │ -
222
│ │ │ │ -
223 public:
│ │ │ │ -
224
│ │ │ │ -
225 using Element = typename Node::template Child<0>::Type::Element;
│ │ │ │ -
226
│ │ │ │ - │ │ │ │ -
228
│ │ │ │ -
│ │ │ │ -
229 CompositeBasisNode(const typename Node::NodeStorage& children) :
│ │ │ │ -
230 Node(children)
│ │ │ │ -
231 {}
│ │ │ │ -
│ │ │ │ -
232
│ │ │ │ -
233 template<typename... Children>
│ │ │ │ -
│ │ │ │ -
234 CompositeBasisNode(const std::shared_ptr<Children>&... children) :
│ │ │ │ -
235 Node(children...)
│ │ │ │ -
236 {}
│ │ │ │ -
│ │ │ │ -
237
│ │ │ │ -
│ │ │ │ -
238 const Element& element() const
│ │ │ │ -
239 {
│ │ │ │ -
240 return this->child(Dune::Indices::_0).element();
│ │ │ │ -
241 }
│ │ │ │ -
│ │ │ │ -
242
│ │ │ │ -
243 };
│ │ │ │ -
│ │ │ │ -
244
│ │ │ │ -
245
│ │ │ │ -
246 template<typename Tree>
│ │ │ │ -
│ │ │ │ -
247 void clearSize(Tree& tree, std::size_t offset)
│ │ │ │ -
248 {
│ │ │ │ -
249 TypeTree::applyToTree(tree,Impl::ClearSizeVisitor(offset));
│ │ │ │ -
250 }
│ │ │ │ -
│ │ │ │ -
251
│ │ │ │ -
252 template<typename Tree, typename Entity>
│ │ │ │ -
│ │ │ │ -
253 void bindTree(Tree& tree, const Entity& entity, std::size_t offset = 0)
│ │ │ │ -
254 {
│ │ │ │ -
255 Impl::BindVisitor<Entity> visitor(entity,offset);
│ │ │ │ -
256 TypeTree::applyToTree(tree,visitor);
│ │ │ │ -
257 }
│ │ │ │ -
│ │ │ │ -
258
│ │ │ │ -
259 template<typename Tree>
│ │ │ │ -
│ │ │ │ -
260 void initializeTree(Tree& tree, std::size_t treeIndexOffset = 0)
│ │ │ │ -
261 {
│ │ │ │ -
262 Impl::InitializeTreeVisitor visitor(treeIndexOffset);
│ │ │ │ -
263 TypeTree::applyToTree(tree,visitor);
│ │ │ │ -
264 }
│ │ │ │ -
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
214 {
│ │ │ │ +
215 return subPreBasis_.maxNodeSize() * children;
│ │ │ │ +
216 }
│ │ │ │ +
│ │ │ │ +
217
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
220 {
│ │ │ │ +
221 return subPreBasis_;
│ │ │ │ +
222 }
│ │ │ │ +
│ │ │ │ +
223
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
226 {
│ │ │ │ +
227 return subPreBasis_;
│ │ │ │ +
228 }
│ │ │ │ +
│ │ │ │ +
229
│ │ │ │ +
231 template<typename It>
│ │ │ │ +
│ │ │ │ +
232 It indices(const Node& node, It it) const
│ │ │ │ +
233 {
│ │ │ │ +
234 return indices(node, it, IndexMergingStrategy{});
│ │ │ │ +
235 }
│ │ │ │ +
│ │ │ │ +
236
│ │ │ │ +
237private:
│ │ │ │ +
238
│ │ │ │ +
239 template<typename It>
│ │ │ │ +
240 It indices(const Node& node, It multiIndices, BasisFactory::FlatInterleaved) const
│ │ │ │ +
241 {
│ │ │ │ +
242 using namespace Dune::Indices;
│ │ │ │ +
243 size_type subTreeSize = node.child(_0).size();
│ │ │ │ +
244 // Fill indices for first child at the beginning.
│ │ │ │ +
245 auto next = subPreBasis().indices(node.child(_0), multiIndices);
│ │ │ │ +
246 // Multiply first component of all indices for first child by
│ │ │ │ +
247 // number of children to stretch the index range for interleaving.
│ │ │ │ +
248 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ │ +
249 multiIndices[i][0] *= children;
│ │ │ │ +
250 for (std::size_t child = 1; child<children; ++child)
│ │ │ │ +
251 {
│ │ │ │ +
252 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ │ +
253 {
│ │ │ │ +
254 // Copy indices from first child for all other children
│ │ │ │ +
255 // and shift them by child index to interleave indices.
│ │ │ │ +
256 // multiIndices[child*subTreeSize+i] = multiIndices[i];
│ │ │ │ +
257 // multiIndices[child*subTreeSize+i][0] = multiIndices[i][0]+child;
│ │ │ │ +
258 (*next) = multiIndices[i];
│ │ │ │ +
259 (*next)[0] = multiIndices[i][0]+child;
│ │ │ │ +
260 ++next;
│ │ │ │ +
261 }
│ │ │ │ +
262 }
│ │ │ │ +
263 return next;
│ │ │ │ +
264 }
│ │ │ │
265
│ │ │ │ -
266
│ │ │ │ -
267 } // namespace Functions
│ │ │ │ -
268
│ │ │ │ -
269} // namespace Dune
│ │ │ │ -
270
│ │ │ │ -
271#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH
│ │ │ │ +
266 template<typename It>
│ │ │ │ +
267 It indices(const Node& node, It multiIndices, BasisFactory::FlatLexicographic) const
│ │ │ │ +
268 {
│ │ │ │ +
269 using namespace Dune::Indices;
│ │ │ │ +
270 size_type subTreeSize = node.child(_0).size();
│ │ │ │ +
271 size_type firstIndexEntrySize = subPreBasis().size();
│ │ │ │ +
272 // Fill indices for first child at the beginning.
│ │ │ │ +
273 auto next = subPreBasis().indices(node.child(_0), multiIndices);
│ │ │ │ +
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 suitable offset to get lexicographic indices.
│ │ │ │ +
280 // multiIndices[child*subTreeSize+i] = multiIndices[i];
│ │ │ │ +
281 // multiIndices[child*subTreeSize+i][0] += child*firstIndexEntrySize;
│ │ │ │ +
282 (*next) = multiIndices[i];
│ │ │ │ +
283 (*next)[0] += child*firstIndexEntrySize;
│ │ │ │ +
284 ++next;
│ │ │ │ +
285 }
│ │ │ │ +
286 }
│ │ │ │ +
287 return next;
│ │ │ │ +
288 }
│ │ │ │ +
289
│ │ │ │ +
290 template<class MultiIndex>
│ │ │ │ +
291 static void multiIndexPushFront(MultiIndex& M, size_type M0)
│ │ │ │ +
292 {
│ │ │ │ +
293 M.resize(M.size()+1);
│ │ │ │ +
294 for(std::size_t i=M.size()-1; i>0; --i)
│ │ │ │ +
295 M[i] = M[i-1];
│ │ │ │ +
296 M[0] = M0;
│ │ │ │ +
297 }
│ │ │ │ +
298
│ │ │ │ +
299 template<typename It>
│ │ │ │ +
300 It indices(const Node& node, It multiIndices, BasisFactory::BlockedLexicographic) const
│ │ │ │ +
301 {
│ │ │ │ +
302 using namespace Dune::Indices;
│ │ │ │ +
303 size_type subTreeSize = node.child(_0).size();
│ │ │ │ +
304 // Fill indices for first child at the beginning.
│ │ │ │ +
305 auto next = subPreBasis().indices(node.child(_0), multiIndices);
│ │ │ │ +
306 // Insert 0 before first component of all indices for first child.
│ │ │ │ +
307 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ │ +
308 multiIndexPushFront(multiIndices[i], 0);
│ │ │ │ +
309 for (std::size_t child = 1; child<children; ++child)
│ │ │ │ +
310 {
│ │ │ │ +
311 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ │ +
312 {
│ │ │ │ +
313 // Copy indices from first child for all other children and overwrite
│ │ │ │ +
314 // zero in first component as inserted above by child index.
│ │ │ │ +
315 // multiIndices[child*subTreeSize+i] = multiIndices[i];
│ │ │ │ +
316 // multiIndices[child*subTreeSize+i][0] = child;
│ │ │ │ +
317 (*next) = multiIndices[i];
│ │ │ │ +
318 (*next)[0] = child;
│ │ │ │ +
319 ++next;
│ │ │ │ +
320 }
│ │ │ │ +
321 }
│ │ │ │ +
322 return next;
│ │ │ │ +
323 }
│ │ │ │ +
324
│ │ │ │ +
325 template<typename It>
│ │ │ │ +
326 It indices(const Node& node, It multiIndices, BasisFactory::BlockedInterleaved) const
│ │ │ │ +
327 {
│ │ │ │ +
328 using namespace Dune::Indices;
│ │ │ │ +
329 size_type subTreeSize = node.child(_0).size();
│ │ │ │ +
330 // Fill indices for first child at the beginning.
│ │ │ │ +
331 auto next = subPreBasis().indices(node.child(_0), multiIndices);
│ │ │ │ +
332 // Append 0 after last component of all indices for first child.
│ │ │ │ +
333 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ │ +
334 multiIndices[i].push_back(0);
│ │ │ │ +
335 for (std::size_t child = 1; child<children; ++child)
│ │ │ │ +
336 {
│ │ │ │ +
337 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ │ +
338 {
│ │ │ │ +
339 // Copy indices from first child for all other children and overwrite
│ │ │ │ +
340 // zero in last component as appended above by child index.
│ │ │ │ +
341 (*next) = multiIndices[i];
│ │ │ │ +
342 (*next).back() = child;
│ │ │ │ +
343 ++next;
│ │ │ │ +
344 }
│ │ │ │ +
345 }
│ │ │ │ +
346 return next;
│ │ │ │ +
347 }
│ │ │ │ +
348
│ │ │ │ +
349 SubPreBasis subPreBasis_;
│ │ │ │ +
350};
│ │ │ │ +
│ │ │ │ +
351
│ │ │ │ +
352
│ │ │ │ +
353
│ │ │ │ +
354namespace BasisFactory {
│ │ │ │ +
355
│ │ │ │ +
368template<std::size_t k, class ChildPreBasisFactory, class IndexMergingStrategy>
│ │ │ │ +
369auto power(ChildPreBasisFactory&& childPreBasisFactory, const IndexMergingStrategy&)
│ │ │ │ +
370{
│ │ │ │ +
371 return [childPreBasisFactory](const auto& gridView) {
│ │ │ │ +
372 auto childPreBasis = childPreBasisFactory(gridView);
│ │ │ │ +
373 return PowerPreBasis<IndexMergingStrategy, decltype(childPreBasis), k>(std::move(childPreBasis));
│ │ │ │ +
374 };
│ │ │ │ +
375}
│ │ │ │ +
376
│ │ │ │ +
387template<std::size_t k, class ChildPreBasisFactory>
│ │ │ │ +
388auto power(ChildPreBasisFactory&& childPreBasisFactory)
│ │ │ │ +
389{
│ │ │ │ +
390 return [childPreBasisFactory](const auto& gridView) {
│ │ │ │ +
391 auto childPreBasis = childPreBasisFactory(gridView);
│ │ │ │ +
392 return PowerPreBasis<BlockedInterleaved, decltype(childPreBasis), k>(std::move(childPreBasis));
│ │ │ │ +
393 };
│ │ │ │ +
394}
│ │ │ │ +
395
│ │ │ │ +
396} // end namespace BasisFactory
│ │ │ │ +
397
│ │ │ │ +
398// Backward compatibility
│ │ │ │ +
399namespace BasisBuilder {
│ │ │ │ +
400
│ │ │ │ +
401 using namespace BasisFactory;
│ │ │ │ +
402
│ │ │ │ +
403}
│ │ │ │ +
404
│ │ │ │ +
405
│ │ │ │ +
406} // end namespace Functions
│ │ │ │ +
407} // end namespace Dune
│ │ │ │ +
408
│ │ │ │ +
409
│ │ │ │ +
410#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
typename std::enable_if< std::is_constructible< T, Args... >::value, int >::type enableIfConstructible
Helper to constrain forwarding constructors.
Definition type_traits.hh:26
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
void clearSize(Tree &tree, std::size_t offset)
Definition nodes.hh:247
│ │ │ │ -
void bindTree(Tree &tree, const Entity &entity, std::size_t offset=0)
Definition nodes.hh:253
│ │ │ │ -
void initializeTree(Tree &tree, std::size_t treeIndexOffset=0)
Definition nodes.hh:260
│ │ │ │ -
Definition nodes.hh:117
│ │ │ │ -
size_type treeIndex() const
Definition nodes.hh:147
│ │ │ │ -
size_type localIndex(size_type i) const
Definition nodes.hh:136
│ │ │ │ -
size_type offset() const
Definition nodes.hh:154
│ │ │ │ -
size_type size() const
Definition nodes.hh:142
│ │ │ │ -
void setOffset(const size_type offset)
Definition nodes.hh:159
│ │ │ │ -
std::size_t size_type
Definition nodes.hh:128
│ │ │ │ -
BasisNodeMixin()
Definition nodes.hh:130
│ │ │ │ -
void setSize(const size_type size)
Definition nodes.hh:164
│ │ │ │ -
void setTreeIndex(size_type treeIndex)
Definition nodes.hh:169
│ │ │ │ -
Definition nodes.hh:186
│ │ │ │ +
Interleaved merging of direct children without blocking.
Definition basistags.hh:114
│ │ │ │
Definition nodes.hh:193
│ │ │ │ -
const Element & element() const
Definition nodes.hh:207
│ │ │ │ -
typename T::Element Element
Definition nodes.hh:199
│ │ │ │ -
PowerBasisNode(const typename Node::NodeStorage &children)
Definition nodes.hh:203
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
CompositeBasisNode(const typename Node::NodeStorage &children)
Definition nodes.hh:229
│ │ │ │ -
const Element & element() const
Definition nodes.hh:238
│ │ │ │ -
typename Node::template Child< 0 >::Type::Element Element
Definition nodes.hh:225
│ │ │ │ -
CompositeBasisNode(const std::shared_ptr< Children > &... children)
Definition nodes.hh:234
│ │ │ │ +
A pre-basis for power bases.
Definition powerbasis.hh:45
│ │ │ │ +
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition powerbasis.hh:207
│ │ │ │ +
std::size_t size_type
Type used for indices and size information.
Definition powerbasis.hh:58
│ │ │ │ +
IMS IndexMergingStrategy
Strategy used to merge the global indices of the child factories.
Definition powerbasis.hh:61
│ │ │ │ +
PowerBasisNode< SubNode, children > Node
Template mapping root tree path to type of created tree node.
Definition powerbasis.hh:66
│ │ │ │ +
typename SPB::GridView GridView
The grid view that the FE basis is defined on.
Definition powerbasis.hh:55
│ │ │ │ +
static constexpr size_type multiIndexBufferSize
Definition powerbasis.hh:70
│ │ │ │ +
SPB SubPreBasis
The child pre-basis.
Definition powerbasis.hh:52
│ │ │ │ +
typename SubPreBasis::Node SubNode
Definition powerbasis.hh:63
│ │ │ │ +
void initializeIndices()
Initialize the global indices.
Definition powerbasis.hh:87
│ │ │ │ +
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition powerbasis.hh:99
│ │ │ │ +
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 powerbasis.hh:232
│ │ │ │ +
PowerPreBasis(SFArgs &&... sfArgs)
Constructor for given child pre-basis objects.
Definition powerbasis.hh:80
│ │ │ │ +
size_type size() const
Same as size(prefix) with empty prefix.
Definition powerbasis.hh:116
│ │ │ │ +
SubPreBasis & subPreBasis()
Mutable access to the stored prebasis of the factor in the power space.
Definition powerbasis.hh:225
│ │ │ │ +
Node makeNode() const
Create tree node.
Definition powerbasis.hh:107
│ │ │ │ +
static constexpr size_type maxMultiIndexSize
Definition powerbasis.hh:68
│ │ │ │ +
static constexpr size_type minMultiIndexSize
Definition powerbasis.hh:69
│ │ │ │ +
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition powerbasis.hh:213
│ │ │ │ +
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition powerbasis.hh:93
│ │ │ │ +
size_type size(const SizePrefix &prefix) const
Return number of possible values for next position in multi index.
Definition powerbasis.hh:124
│ │ │ │ +
const SubPreBasis & subPreBasis() const
Const access to the stored prebasis of the factor in the power space.
Definition powerbasis.hh:219
│ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,353 +1,488 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ -nodes.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ -8 │ │ │ │ │ -9#include │ │ │ │ │ -10 │ │ │ │ │ -11#include │ │ │ │ │ -12#include │ │ │ │ │ -13#include │ │ │ │ │ -14#include │ │ │ │ │ -15#include │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ +8#include │ │ │ │ │ +9 │ │ │ │ │ +10#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 <_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> │ │ │ │ │ +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_/_b_a_s_i_s_t_a_g_s_._h_h> │ │ │ │ │ +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_/_c_o_n_c_e_p_t_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_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ │ 16 │ │ │ │ │ -17namespace _D_u_n_e { │ │ │ │ │ -18 namespace Functions { │ │ │ │ │ -19 │ │ │ │ │ -20 │ │ │ │ │ -21 namespace Impl { │ │ │ │ │ +17 │ │ │ │ │ +18 │ │ │ │ │ +19namespace _D_u_n_e { │ │ │ │ │ +20namespace Functions { │ │ │ │ │ +21 │ │ │ │ │ 22 │ │ │ │ │ -23 │ │ │ │ │ -24 struct ClearSizeVisitor │ │ │ │ │ -25 : public TypeTree::TreeVisitor │ │ │ │ │ -26 , public TypeTree::DynamicTraversal │ │ │ │ │ -27 { │ │ │ │ │ -28 │ │ │ │ │ -29 template │ │ │ │ │ -30 void pre(Node& node, TreePath treePath) │ │ │ │ │ -31 { │ │ │ │ │ -32 leaf(node,treePath); │ │ │ │ │ -33 node.setSize(0); │ │ │ │ │ -34 } │ │ │ │ │ -35 │ │ │ │ │ -36 template │ │ │ │ │ -37 void leaf(Node& node, TreePath treePath) │ │ │ │ │ -38 { │ │ │ │ │ -39 node.setOffset(offset_); │ │ │ │ │ -40 } │ │ │ │ │ -41 │ │ │ │ │ -42 ClearSizeVisitor(std::size_t offset) │ │ │ │ │ -43 : offset_(offset) │ │ │ │ │ -44 {} │ │ │ │ │ -45 │ │ │ │ │ -46 const std::size_t offset_; │ │ │ │ │ -47 │ │ │ │ │ -48 }; │ │ │ │ │ -49 │ │ │ │ │ +23/ │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +24// This is the reusable part of the power bases. It contains │ │ │ │ │ +25// │ │ │ │ │ +26// PowerPreBasis │ │ │ │ │ +27// │ │ │ │ │ +28// The pre-basis allows to create the others and is the owner of possible │ │ │ │ │ +shared │ │ │ │ │ +29// state. These components do _not_ depend on the global basis and local view │ │ │ │ │ +30// and can be used without a global basis. │ │ │ │ │ +31/ │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +32 │ │ │ │ │ +43template │ │ │ │ │ +_4_4class _P_o_w_e_r_P_r_e_B_a_s_i_s │ │ │ │ │ +45{ │ │ │ │ │ +46 static const std::size_t children = C; │ │ │ │ │ +47 static const bool isBlocked = std::is_same_v or std::is_same_v; │ │ │ │ │ +48 │ │ │ │ │ +49public: │ │ │ │ │ 50 │ │ │ │ │ -51 template │ │ │ │ │ -52 struct BindVisitor │ │ │ │ │ -53 : public TypeTree::TreeVisitor │ │ │ │ │ -54 , public TypeTree::DynamicTraversal │ │ │ │ │ -55 { │ │ │ │ │ +_5_2 using _S_u_b_P_r_e_B_a_s_i_s = SPB; │ │ │ │ │ +53 │ │ │ │ │ +_5_5 using _G_r_i_d_V_i_e_w = typename SPB::GridView; │ │ │ │ │ 56 │ │ │ │ │ -57 template │ │ │ │ │ -58 void pre(Node& node, TreePath) │ │ │ │ │ -59 { │ │ │ │ │ -60 node.setOffset(offset_); │ │ │ │ │ -61 } │ │ │ │ │ +_5_8 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ +59 │ │ │ │ │ +_6_1 using _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y = IMS; │ │ │ │ │ 62 │ │ │ │ │ -63 template │ │ │ │ │ -64 void post(Node& node, TreePath) │ │ │ │ │ -65 { │ │ │ │ │ -66 node.setSize(offset_ - node.offset()); │ │ │ │ │ -67 } │ │ │ │ │ -68 │ │ │ │ │ -69 template │ │ │ │ │ -70 void leaf(Node& node, TreePath) │ │ │ │ │ -71 { │ │ │ │ │ -72 node.setOffset(offset_); │ │ │ │ │ -73 node.bind(entity_); │ │ │ │ │ -74 offset_ += node.size(); │ │ │ │ │ -75 } │ │ │ │ │ -76 │ │ │ │ │ -77 BindVisitor(const Entity& entity, std::size_t offset = 0) │ │ │ │ │ -78 : entity_(entity) │ │ │ │ │ -79 , offset_(offset) │ │ │ │ │ -80 {} │ │ │ │ │ -81 │ │ │ │ │ -82 const Entity& entity_; │ │ │ │ │ -83 std::size_t offset_; │ │ │ │ │ -84 │ │ │ │ │ -85 }; │ │ │ │ │ -86 │ │ │ │ │ -87 │ │ │ │ │ -88 struct InitializeTreeVisitor : │ │ │ │ │ -89 public TypeTree::TreeVisitor, │ │ │ │ │ -90 public TypeTree::DynamicTraversal │ │ │ │ │ -91 { │ │ │ │ │ -92 template │ │ │ │ │ -93 void pre(Node& node, TreePath) │ │ │ │ │ +_6_3 using _S_u_b_N_o_d_e = typename SubPreBasis::Node; │ │ │ │ │ +64 │ │ │ │ │ +_6_6 using _N_o_d_e = _P_o_w_e_r_B_a_s_i_s_N_o_d_e_<_S_u_b_N_o_d_e_,_ _c_h_i_l_d_r_e_n_>; │ │ │ │ │ +67 │ │ │ │ │ +_6_8 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; │ │ │ │ │ +_6_9 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_0 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; │ │ │ │ │ +71 │ │ │ │ │ +77 template = 0, │ │ │ │ │ +79 _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_0 _P_o_w_e_r_P_r_e_B_a_s_i_s(SFArgs&&... sfArgs) : │ │ │ │ │ +81 subPreBasis_(std::forward(sfArgs)...) │ │ │ │ │ +82 { │ │ │ │ │ +83 static_assert(models, _S_u_b_P_r_e_B_a_s_i_s>(), │ │ │ │ │ +"Subprebasis passed to PowerPreBasis does not model the PreBasis concept."); │ │ │ │ │ +84 } │ │ │ │ │ +85 │ │ │ │ │ +_8_7 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ │ +88 { │ │ │ │ │ +89 subPreBasis_.initializeIndices(); │ │ │ │ │ +90 } │ │ │ │ │ +91 │ │ │ │ │ +_9_3 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ │ 94 { │ │ │ │ │ -95 node.setTreeIndex(treeIndex_); │ │ │ │ │ -96 ++treeIndex_; │ │ │ │ │ -97 } │ │ │ │ │ -98 │ │ │ │ │ -99 template │ │ │ │ │ -100 void leaf(Node& node, TreePath) │ │ │ │ │ -101 { │ │ │ │ │ -102 node.setTreeIndex(treeIndex_); │ │ │ │ │ -103 ++treeIndex_; │ │ │ │ │ -104 } │ │ │ │ │ -105 │ │ │ │ │ -106 InitializeTreeVisitor(std::size_t treeIndexOffset = 0) : │ │ │ │ │ -107 treeIndex_(treeIndexOffset) │ │ │ │ │ -108 {} │ │ │ │ │ -109 │ │ │ │ │ -110 std::size_t treeIndex_; │ │ │ │ │ -111 }; │ │ │ │ │ -112 │ │ │ │ │ -113 } // end namespace Impl │ │ │ │ │ +95 return subPreBasis_.gridView(); │ │ │ │ │ +96 } │ │ │ │ │ +97 │ │ │ │ │ +_9_9 void _u_p_d_a_t_e(const _G_r_i_d_V_i_e_w& gv) │ │ │ │ │ +100 { │ │ │ │ │ +101 subPreBasis_.update(gv); │ │ │ │ │ +102 } │ │ │ │ │ +103 │ │ │ │ │ +_1_0_7 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ │ +108 { │ │ │ │ │ +109 auto node = _N_o_d_e{}; │ │ │ │ │ +110 for (std::size_t i=0; i{}); │ │ │ │ │ +119 } │ │ │ │ │ 120 │ │ │ │ │ -121 template │ │ │ │ │ -122 friend struct Impl::BindVisitor; │ │ │ │ │ -123 │ │ │ │ │ -124 friend struct Impl::InitializeTreeVisitor; │ │ │ │ │ -125 │ │ │ │ │ -126 public: │ │ │ │ │ -127 │ │ │ │ │ -_1_2_8 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ -129 │ │ │ │ │ -_1_3_0 _B_a_s_i_s_N_o_d_e_M_i_x_i_n() : │ │ │ │ │ -131 offset_(0), │ │ │ │ │ -132 size_(0), │ │ │ │ │ -133 treeIndex_(0) │ │ │ │ │ -134 {} │ │ │ │ │ -135 │ │ │ │ │ -_1_3_6 _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 │ │ │ │ │ -137 { │ │ │ │ │ -138 assert(i < size_); │ │ │ │ │ -139 return offset_ + i; │ │ │ │ │ -140 } │ │ │ │ │ -141 │ │ │ │ │ -_1_4_2 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ │ -143 { │ │ │ │ │ -144 return size_; │ │ │ │ │ -145 } │ │ │ │ │ -146 │ │ │ │ │ -_1_4_7 _s_i_z_e___t_y_p_e _t_r_e_e_I_n_d_e_x() const │ │ │ │ │ -148 { │ │ │ │ │ -149 return treeIndex_; │ │ │ │ │ +122 │ │ │ │ │ +123 template │ │ │ │ │ +_1_2_4 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix) const │ │ │ │ │ +125 { │ │ │ │ │ +126 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{}); │ │ │ │ │ +127 } │ │ │ │ │ +128 │ │ │ │ │ +129private: │ │ │ │ │ +130 │ │ │ │ │ +131 template │ │ │ │ │ +132 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix, _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 │ │ │ │ │ +133 { │ │ │ │ │ +134 // The root index size is the root index size of a single subnode │ │ │ │ │ +135 // multiplied by the number of subnodes because we enumerate all │ │ │ │ │ +136 // child indices in a row. │ │ │ │ │ +137 if (prefix.size() == 0) │ │ │ │ │ +138 return children*subPreBasis_.size(); │ │ │ │ │ +139 │ │ │ │ │ +140 // The first prefix entry refers to one of the (root index size) │ │ │ │ │ +141 // subindex trees. Hence we have to first compute the corresponding │ │ │ │ │ +142 // prefix entry for a single subnode subnode. The we can append │ │ │ │ │ +143 // the other prefix entries unmodified, because the index tree │ │ │ │ │ +144 // looks the same after the first level. │ │ │ │ │ +145 SizePrefix subPrefix; │ │ │ │ │ +146 subPrefix.push_back(prefix[0] / children); │ │ │ │ │ +147 for(std::size_t i=1; i │ │ │ │ │ -_1_9_0 class _P_o_w_e_r_B_a_s_i_s_N_o_d_e : │ │ │ │ │ -191 public _B_a_s_i_s_N_o_d_e_M_i_x_i_n, │ │ │ │ │ -192 public TypeTree::PowerNode │ │ │ │ │ -193 { │ │ │ │ │ -194 │ │ │ │ │ -195 using Node = TypeTree::PowerNode; │ │ │ │ │ -196 │ │ │ │ │ -197 public: │ │ │ │ │ -198 │ │ │ │ │ -_1_9_9 using _E_l_e_m_e_n_t = typename T::Element; │ │ │ │ │ -200 │ │ │ │ │ -_2_0_1 _P_o_w_e_r_B_a_s_i_s_N_o_d_e() = default; │ │ │ │ │ -202 │ │ │ │ │ -_2_0_3 _P_o_w_e_r_B_a_s_i_s_N_o_d_e(const typename Node::NodeStorage& children) : │ │ │ │ │ -204 Node(children) │ │ │ │ │ -205 {} │ │ │ │ │ -206 │ │ │ │ │ -_2_0_7 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ │ +152 template │ │ │ │ │ +153 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix, BasisFactory::FlatLexicographic) │ │ │ │ │ +const │ │ │ │ │ +154 { │ │ │ │ │ +155 // The size at the index tree root is the size of at the index tree │ │ │ │ │ +156 // root of a single subnode multiplied by the number of subnodes │ │ │ │ │ +157 // because we enumerate all child indices in a row. │ │ │ │ │ +158 if (prefix.size() == 0) │ │ │ │ │ +159 return children*subPreBasis_.size(); │ │ │ │ │ +160 │ │ │ │ │ +161 // The first prefix entry refers to one of the (root index size) │ │ │ │ │ +162 // subindex trees. Hence we have to first compute the corresponding │ │ │ │ │ +163 // prefix entry for a single subnode subnode. The we can append │ │ │ │ │ +164 // the other prefix entries unmodified, because the index tree │ │ │ │ │ +165 // looks the same after the first level. │ │ │ │ │ +166 SizePrefix subPrefix; │ │ │ │ │ +167 subPrefix.push_back(prefix[0] % children); │ │ │ │ │ +168 for(std::size_t i=1; i │ │ │ │ │ +174 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix, BasisFactory:: │ │ │ │ │ +BlockedLexicographic) const │ │ │ │ │ +175 { │ │ │ │ │ +176 if (prefix.size() == 0) │ │ │ │ │ +177 return children; │ │ │ │ │ +178 SizePrefix subPrefix; │ │ │ │ │ +179 for(std::size_t i=1; i │ │ │ │ │ +185 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix, BasisFactory::BlockedInterleaved) │ │ │ │ │ +const │ │ │ │ │ +186 { │ │ │ │ │ +187 if (prefix.size() == 0) │ │ │ │ │ +188 return subPreBasis_.size(); │ │ │ │ │ +189 │ │ │ │ │ +190 SizePrefix subPrefix; │ │ │ │ │ +191 for(std::size_t i=0; ichild(Dune::Indices::_0).element(); │ │ │ │ │ +209 return subPreBasis_.dimension() * children; │ │ │ │ │ 210 } │ │ │ │ │ 211 │ │ │ │ │ -212 }; │ │ │ │ │ -213 │ │ │ │ │ -214 │ │ │ │ │ -215 template │ │ │ │ │ -_2_1_6 class _C_o_m_p_o_s_i_t_e_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 public TypeTree::CompositeNode │ │ │ │ │ -219 { │ │ │ │ │ -220 │ │ │ │ │ -221 using Node = TypeTree::CompositeNode; │ │ │ │ │ -222 │ │ │ │ │ -223 public: │ │ │ │ │ -224 │ │ │ │ │ -_2_2_5 using _E_l_e_m_e_n_t = typename Node::template Child<0>::Type::Element; │ │ │ │ │ -226 │ │ │ │ │ -_2_2_7 _C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e() = default; │ │ │ │ │ -228 │ │ │ │ │ -_2_2_9 _C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e(const typename Node::NodeStorage& children) : │ │ │ │ │ -230 Node(children) │ │ │ │ │ -231 {} │ │ │ │ │ -232 │ │ │ │ │ -233 template │ │ │ │ │ -_2_3_4 _C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e(const std::shared_ptr&... children) : │ │ │ │ │ -235 Node(children...) │ │ │ │ │ -236 {} │ │ │ │ │ -237 │ │ │ │ │ -_2_3_8 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ │ -239 { │ │ │ │ │ -240 return this->child(Dune::Indices::_0).element(); │ │ │ │ │ -241 } │ │ │ │ │ -242 │ │ │ │ │ -243 }; │ │ │ │ │ -244 │ │ │ │ │ -245 │ │ │ │ │ -246 template │ │ │ │ │ -_2_4_7 void _c_l_e_a_r_S_i_z_e(Tree& tree, std::size_t offset) │ │ │ │ │ -248 { │ │ │ │ │ -249 TypeTree::applyToTree(tree,Impl::ClearSizeVisitor(offset)); │ │ │ │ │ -250 } │ │ │ │ │ -251 │ │ │ │ │ -252 template │ │ │ │ │ -_2_5_3 void _b_i_n_d_T_r_e_e(Tree& tree, const Entity& entity, std::size_t offset = 0) │ │ │ │ │ -254 { │ │ │ │ │ -255 Impl::BindVisitor visitor(entity,offset); │ │ │ │ │ -256 TypeTree::applyToTree(tree,visitor); │ │ │ │ │ -257 } │ │ │ │ │ -258 │ │ │ │ │ -259 template │ │ │ │ │ -_2_6_0 void _i_n_i_t_i_a_l_i_z_e_T_r_e_e(Tree& tree, std::size_t treeIndexOffset = 0) │ │ │ │ │ -261 { │ │ │ │ │ -262 Impl::InitializeTreeVisitor visitor(treeIndexOffset); │ │ │ │ │ -263 TypeTree::applyToTree(tree,visitor); │ │ │ │ │ +_2_1_3 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ │ +214 { │ │ │ │ │ +215 return subPreBasis_.maxNodeSize() * children; │ │ │ │ │ +216 } │ │ │ │ │ +217 │ │ │ │ │ +_2_1_9 const _S_u_b_P_r_e_B_a_s_i_s& _s_u_b_P_r_e_B_a_s_i_s() const │ │ │ │ │ +220 { │ │ │ │ │ +221 return subPreBasis_; │ │ │ │ │ +222 } │ │ │ │ │ +223 │ │ │ │ │ +_2_2_5 _S_u_b_P_r_e_B_a_s_i_s& _s_u_b_P_r_e_B_a_s_i_s() │ │ │ │ │ +226 { │ │ │ │ │ +227 return subPreBasis_; │ │ │ │ │ +228 } │ │ │ │ │ +229 │ │ │ │ │ +231 template │ │ │ │ │ +_2_3_2 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ │ +233 { │ │ │ │ │ +234 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{}); │ │ │ │ │ +235 } │ │ │ │ │ +236 │ │ │ │ │ +237private: │ │ │ │ │ +238 │ │ │ │ │ +239 template │ │ │ │ │ +240 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_I_n_t_e_r_l_e_a_v_e_d) const │ │ │ │ │ +241 { │ │ │ │ │ +242 using namespace Dune::Indices; │ │ │ │ │ +243 _s_i_z_e___t_y_p_e subTreeSize = node.child(_0).size(); │ │ │ │ │ +244 // Fill indices for first child at the beginning. │ │ │ │ │ +245 auto next = _s_u_b_P_r_e_B_a_s_i_s().indices(node.child(_0), multiIndices); │ │ │ │ │ +246 // Multiply first component of all indices for first child by │ │ │ │ │ +247 // number of children to stretch the index range for interleaving. │ │ │ │ │ +248 for (std::size_t i = 0; i │ │ │ │ │ +267 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It multiIndices, BasisFactory:: │ │ │ │ │ +FlatLexicographic) const │ │ │ │ │ +268 { │ │ │ │ │ +269 using namespace Dune::Indices; │ │ │ │ │ +270 _s_i_z_e___t_y_p_e subTreeSize = node.child(_0).size(); │ │ │ │ │ +271 _s_i_z_e___t_y_p_e firstIndexEntrySize = _s_u_b_P_r_e_B_a_s_i_s().size(); │ │ │ │ │ +272 // Fill indices for first child at the beginning. │ │ │ │ │ +273 auto next = _s_u_b_P_r_e_B_a_s_i_s().indices(node.child(_0), multiIndices); │ │ │ │ │ +274 for (std::size_t child = 1; child │ │ │ │ │ +291 static void multiIndexPushFront(MultiIndex& M, _s_i_z_e___t_y_p_e M0) │ │ │ │ │ +292 { │ │ │ │ │ +293 M.resize(M.size()+1); │ │ │ │ │ +294 for(std::size_t i=M.size()-1; i>0; --i) │ │ │ │ │ +295 M[i] = M[i-1]; │ │ │ │ │ +296 M[0] = M0; │ │ │ │ │ +297 } │ │ │ │ │ +298 │ │ │ │ │ +299 template │ │ │ │ │ +300 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It multiIndices, BasisFactory:: │ │ │ │ │ +BlockedLexicographic) const │ │ │ │ │ +301 { │ │ │ │ │ +302 using namespace Dune::Indices; │ │ │ │ │ +303 _s_i_z_e___t_y_p_e subTreeSize = node.child(_0).size(); │ │ │ │ │ +304 // Fill indices for first child at the beginning. │ │ │ │ │ +305 auto next = _s_u_b_P_r_e_B_a_s_i_s().indices(node.child(_0), multiIndices); │ │ │ │ │ +306 // Insert 0 before first component of all indices for first child. │ │ │ │ │ +307 for (std::size_t i = 0; i │ │ │ │ │ +326 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It multiIndices, BasisFactory:: │ │ │ │ │ +BlockedInterleaved) const │ │ │ │ │ +327 { │ │ │ │ │ +328 using namespace Dune::Indices; │ │ │ │ │ +329 _s_i_z_e___t_y_p_e subTreeSize = node.child(_0).size(); │ │ │ │ │ +330 // Fill indices for first child at the beginning. │ │ │ │ │ +331 auto next = _s_u_b_P_r_e_B_a_s_i_s().indices(node.child(_0), multiIndices); │ │ │ │ │ +332 // Append 0 after last component of all indices for first child. │ │ │ │ │ +333 for (std::size_t i = 0; i │ │ │ │ │ +369auto power(ChildPreBasisFactory&& childPreBasisFactory, const │ │ │ │ │ +IndexMergingStrategy&) │ │ │ │ │ +370{ │ │ │ │ │ +371 return [childPreBasisFactory](const auto& gridView) { │ │ │ │ │ +372 auto childPreBasis = childPreBasisFactory(gridView); │ │ │ │ │ +373 return PowerPreBasis │ │ │ │ │ +(std::move(childPreBasis)); │ │ │ │ │ +374 }; │ │ │ │ │ +375} │ │ │ │ │ +376 │ │ │ │ │ +387template │ │ │ │ │ +388auto power(ChildPreBasisFactory&& childPreBasisFactory) │ │ │ │ │ +389{ │ │ │ │ │ +390 return [childPreBasisFactory](const auto& gridView) { │ │ │ │ │ +391 auto childPreBasis = childPreBasisFactory(gridView); │ │ │ │ │ +392 return PowerPreBasis(std:: │ │ │ │ │ +move(childPreBasis)); │ │ │ │ │ +393 }; │ │ │ │ │ +394} │ │ │ │ │ +395 │ │ │ │ │ +396} // end namespace BasisFactory │ │ │ │ │ +397 │ │ │ │ │ +398// Backward compatibility │ │ │ │ │ +399namespace BasisBuilder { │ │ │ │ │ +400 │ │ │ │ │ +401 using namespace BasisFactory; │ │ │ │ │ +402 │ │ │ │ │ +403} │ │ │ │ │ +404 │ │ │ │ │ +405 │ │ │ │ │ +406} // end namespace Functions │ │ │ │ │ +407} // end namespace Dune │ │ │ │ │ +408 │ │ │ │ │ +409 │ │ │ │ │ +410#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 │ │ │ │ │ +_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 │ │ │ │ │ +typename std::enable_if< std::is_constructible< T, Args... >::value, int >:: │ │ │ │ │ +type enableIfConstructible │ │ │ │ │ +Helper to constrain forwarding constructors. │ │ │ │ │ +DDeeffiinniittiioonn type_traits.hh:26 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_l_e_a_r_S_i_z_e │ │ │ │ │ -void clearSize(Tree &tree, std::size_t offset) │ │ │ │ │ -DDeeffiinniittiioonn nodes.hh:247 │ │ │ │ │ -_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:253 │ │ │ │ │ -_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:260 │ │ │ │ │ -_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 │ │ │ │ │ -DDeeffiinniittiioonn nodes.hh:117 │ │ │ │ │ -_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:147 │ │ │ │ │ -_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:136 │ │ │ │ │ -_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:154 │ │ │ │ │ -_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 │ │ │ │ │ -DDeeffiinniittiioonn nodes.hh:142 │ │ │ │ │ -_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:159 │ │ │ │ │ -_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:128 │ │ │ │ │ -_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:130 │ │ │ │ │ -_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:164 │ │ │ │ │ -_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:169 │ │ │ │ │ -_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:186 │ │ │ │ │ +_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:114 │ │ │ │ │ _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:193 │ │ │ │ │ -_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:207 │ │ │ │ │ -_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:199 │ │ │ │ │ -_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(const typename Node::NodeStorage &children) │ │ │ │ │ -DDeeffiinniittiioonn nodes.hh:203 │ │ │ │ │ -_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_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e │ │ │ │ │ -DDeeffiinniittiioonn nodes.hh:219 │ │ │ │ │ -_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_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e │ │ │ │ │ -CompositeBasisNode(const typename Node::NodeStorage &children) │ │ │ │ │ -DDeeffiinniittiioonn nodes.hh:229 │ │ │ │ │ -_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:238 │ │ │ │ │ -_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 │ │ │ │ │ -typename Node::template Child< 0 >::Type::Element Element │ │ │ │ │ -DDeeffiinniittiioonn nodes.hh:225 │ │ │ │ │ -_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 std::shared_ptr< Children > &... children) │ │ │ │ │ -DDeeffiinniittiioonn nodes.hh:234 │ │ │ │ │ +_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:45 │ │ │ │ │ +_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_:_:_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 powerbasis.hh:207 │ │ │ │ │ +_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 │ │ │ │ │ +std::size_t size_type │ │ │ │ │ +Type used for indices and size information. │ │ │ │ │ +DDeeffiinniittiioonn powerbasis.hh:58 │ │ │ │ │ +_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:61 │ │ │ │ │ +_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< SubNode, children > Node │ │ │ │ │ +Template mapping root tree path to type of created tree node. │ │ │ │ │ +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_:_:_G_r_i_d_V_i_e_w │ │ │ │ │ +typename SPB::GridView GridView │ │ │ │ │ +The grid view that the FE basis is defined on. │ │ │ │ │ +DDeeffiinniittiioonn powerbasis.hh:55 │ │ │ │ │ +_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_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 powerbasis.hh:70 │ │ │ │ │ +_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:52 │ │ │ │ │ +_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_N_o_d_e │ │ │ │ │ +typename SubPreBasis::Node SubNode │ │ │ │ │ +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_:_:_i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ │ +void initializeIndices() │ │ │ │ │ +Initialize the global indices. │ │ │ │ │ +DDeeffiinniittiioonn powerbasis.hh:87 │ │ │ │ │ +_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_:_:_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 powerbasis.hh:99 │ │ │ │ │ +_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 Node &node, It it) const │ │ │ │ │ +Maps from subtree index set [0..size-1] to a globally unique multi index in │ │ │ │ │ +global basis. │ │ │ │ │ +DDeeffiinniittiioonn powerbasis.hh:232 │ │ │ │ │ +_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. │ │ │ │ │ +DDeeffiinniittiioonn powerbasis.hh:80 │ │ │ │ │ +_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:116 │ │ │ │ │ +_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 │ │ │ │ │ +SubPreBasis & subPreBasis() │ │ │ │ │ +Mutable access to the stored prebasis of the factor in the power space. │ │ │ │ │ +DDeeffiinniittiioonn powerbasis.hh:225 │ │ │ │ │ +_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:107 │ │ │ │ │ +_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_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ +static constexpr size_type maxMultiIndexSize │ │ │ │ │ +DDeeffiinniittiioonn powerbasis.hh:68 │ │ │ │ │ +_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_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ +static constexpr size_type minMultiIndexSize │ │ │ │ │ +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_:_:_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 powerbasis.hh:213 │ │ │ │ │ +_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_:_:_g_r_i_d_V_i_e_w │ │ │ │ │ +const GridView & gridView() const │ │ │ │ │ +Obtain the grid view that the basis is defined on. │ │ │ │ │ +DDeeffiinniittiioonn powerbasis.hh:93 │ │ │ │ │ +_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:124 │ │ │ │ │ +_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 │ │ │ │ │ +const SubPreBasis & subPreBasis() const │ │ │ │ │ +Const access to the stored prebasis of the factor in the power space. │ │ │ │ │ +DDeeffiinniittiioonn powerbasis.hh:219 │ │ │ │ │ +_c_o_n_c_e_p_t_s_._h_h │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00098.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: type_traits.hh File Reference │ │ │ │ +dune-functions: compositebasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,52 +65,58 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces | │ │ │ │ -Typedefs
│ │ │ │ -
type_traits.hh File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
compositebasis.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <type_traits>
│ │ │ │ +
#include <tuple>
│ │ │ │ +#include <utility>
│ │ │ │ +#include <dune/common/std/apply.hh>
│ │ │ │ +#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 <dune/functions/functionspacebases/concepts.hh>
│ │ │ │ +#include <dune/functions/functionspacebases/defaultglobalbasis.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::StaticSize< T >
 Obtain size of statically sized container. More...
class  Dune::Functions::CompositePreBasis< IMS, SPB >
 A pre-basis for composite bases. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ │ Namespaces

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

│ │ │ │ -Typedefs

template<class T , class... Args>
using Dune::Functions::enableIfConstructible = typename std::enable_if< std::is_constructible< T, Args... >::value, int >::type
 Helper to constrain forwarding constructors.
 
namespace  Dune::Functions::BasisFactory
 
namespace  Dune::Functions::BasisBuilder
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,32 +1,40 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s │ │ │ │ │ -type_traits.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ +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_/_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_:_:_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_<_ _T_ _> │ │ │ │ │ -  Obtain size of statically sized container. _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 │ │ │ │ │   │ │ │ │ │ -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 = typename std::enable_if< std:: │ │ │ │ │ - is_constructible< T, Args... >::value, int >::type │ │ │ │ │ -  Helper to constrain forwarding constructors. │ │ │ │ │ +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_B_u_i_l_d_e_r │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00098_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: type_traits.hh Source File │ │ │ │ +dune-functions: compositebasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,108 +70,452 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
type_traits.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#ifndef DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH
│ │ │ │
5
│ │ │ │ -
6#include <type_traits>
│ │ │ │ -
7
│ │ │ │ -
8#include <dune/common/typeutilities.hh>
│ │ │ │ -
9
│ │ │ │ -
10namespace Dune {
│ │ │ │ -
11namespace Functions {
│ │ │ │ -
12
│ │ │ │ -
13
│ │ │ │ -
24template<class T, class... Args>
│ │ │ │ -
25using enableIfConstructible = typename std::enable_if<
│ │ │ │ -
26 std::is_constructible<T, Args...>::value, int>::type;
│ │ │ │ -
27
│ │ │ │ +
6#include <tuple>
│ │ │ │ +
7#include <utility>
│ │ │ │ +
8
│ │ │ │ +
9#include <dune/common/std/apply.hh>
│ │ │ │ +
10#include <dune/common/hybridutilities.hh>
│ │ │ │ +
11#include <dune/common/reservedvector.hh>
│ │ │ │ +
12#include <dune/common/typeutilities.hh>
│ │ │ │ +
13#include <dune/common/hybridutilities.hh>
│ │ │ │ +
14#include <dune/common/tupleutility.hh>
│ │ │ │ +
15#include <dune/common/tuplevector.hh>
│ │ │ │ +
16
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
24
│ │ │ │ +
25
│ │ │ │ +
26namespace Dune {
│ │ │ │ +
27namespace Functions {
│ │ │ │
28
│ │ │ │ -
29
│ │ │ │ -
30namespace Imp {
│ │ │ │ -
31
│ │ │ │ -
32 // As a last resort try if there's a static constexpr size()
│ │ │ │ -
33 template<class T>
│ │ │ │ -
34 constexpr auto staticSize(const T*, const PriorityTag<0>&)
│ │ │ │ -
35 -> decltype(std::integral_constant<std::size_t,T::size()>())
│ │ │ │ -
36 {
│ │ │ │ -
37 return {};
│ │ │ │ -
38 }
│ │ │ │ +
29// *****************************************************************************
│ │ │ │ +
30// This is the reusable part of the composite bases. It contains
│ │ │ │ +
31//
│ │ │ │ +
32// CompositePreBasis
│ │ │ │ +
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
│ │ │ │
39
│ │ │ │ -
40 // Try if class has constexpr default constructor and size method
│ │ │ │ -
41 template<class T>
│ │ │ │ -
42 constexpr auto staticSize(const T*, const PriorityTag<1>&)
│ │ │ │ -
43 -> decltype(std::integral_constant<std::size_t,T().size()>())
│ │ │ │ -
44 {
│ │ │ │ -
45 return {};
│ │ │ │ -
46 }
│ │ │ │ -
47
│ │ │ │ -
48 // Try if tuple_size is implemented for class
│ │ │ │ -
49 template<class T>
│ │ │ │ -
50 constexpr auto staticSize(const T*, const PriorityTag<2>&)
│ │ │ │ -
51 -> decltype(std::integral_constant<std::size_t,std::tuple_size<T>::value>())
│ │ │ │ -
52 {
│ │ │ │ -
53 return {};
│ │ │ │ -
54 }
│ │ │ │ -
55
│ │ │ │ -
56 template<class T>
│ │ │ │ -
57 constexpr std::false_type hasStaticSize(const T* t, const PriorityTag<0>& p)
│ │ │ │ -
58 {
│ │ │ │ -
59 return {};
│ │ │ │ -
60 }
│ │ │ │ -
61
│ │ │ │ -
62 template<class T>
│ │ │ │ -
63 constexpr auto hasStaticSize(const T* t, const PriorityTag<1>& p)
│ │ │ │ -
64 -> decltype(staticSize(t ,PriorityTag<42>()), std::true_type())
│ │ │ │ -
65 {
│ │ │ │ -
66 return {};
│ │ │ │ -
67 }
│ │ │ │ -
68
│ │ │ │ -
69}
│ │ │ │ -
70
│ │ │ │ -
71
│ │ │ │ +
51template<class IMS, class... SPB>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
53{
│ │ │ │ +
54 static const bool isBlocked = std::is_same_v<IMS,BasisFactory::BlockedLexicographic> or std::is_same_v<IMS,BasisFactory::BlockedInterleaved>;
│ │ │ │ +
55public:
│ │ │ │ +
56
│ │ │ │ +
58 using SubPreBases = std::tuple<SPB...>;
│ │ │ │ +
59
│ │ │ │ +
61 template<std::size_t i>
│ │ │ │ +
62 using SubPreBasis = std::tuple_element_t<i, SubPreBases>;
│ │ │ │ +
63
│ │ │ │ +
65 using GridView = typename std::tuple_element_t<0, SubPreBases>::GridView;
│ │ │ │ +
66
│ │ │ │ +
68 using size_type = std::size_t;
│ │ │ │ +
69
│ │ │ │ + │ │ │ │
72
│ │ │ │ -
80template<class T>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
82 public decltype(Imp::hasStaticSize((typename std::decay<T>::type*)(nullptr), PriorityTag<42>()))
│ │ │ │ -
83{};
│ │ │ │ -
│ │ │ │ -
84
│ │ │ │ -
85
│ │ │ │ +
73protected:
│ │ │ │ +
74 static const std::size_t children = sizeof...(SPB);
│ │ │ │ +
75
│ │ │ │ +
76 using ChildIndices = std::make_index_sequence<children>;
│ │ │ │ +
77
│ │ │ │ +
78public:
│ │ │ │ +
79
│ │ │ │ +
81 using Node = CompositeBasisNode<typename SPB::Node...>;
│ │ │ │ +
82
│ │ │ │ +
83 static constexpr size_type maxMultiIndexSize = std::max({SPB::maxMultiIndexSize...}) + isBlocked;
│ │ │ │ +
84 static constexpr size_type minMultiIndexSize = std::min({SPB::minMultiIndexSize...}) + isBlocked;
│ │ │ │ +
85 static constexpr size_type multiIndexBufferSize = std::max({SPB::multiIndexBufferSize...}) + isBlocked;
│ │ │ │
86
│ │ │ │ -
94template<class T>
│ │ │ │ -
│ │ │ │ -
95struct StaticSize :
│ │ │ │ -
96 public decltype(Imp::staticSize((typename std::decay<T>::type*)(nullptr), PriorityTag<42>()))
│ │ │ │ -
97{};
│ │ │ │ -
│ │ │ │ -
98
│ │ │ │ -
99
│ │ │ │ -
100
│ │ │ │ -
101}} // namespace Dune::Functions
│ │ │ │ +
92 template<class... SFArgs,
│ │ │ │ +
93 disableCopyMove<CompositePreBasis, SFArgs...> = 0,
│ │ │ │ +
94 enableIfConstructible<std::tuple<SPB...>, SFArgs...> = 0>
│ │ │ │ +
│ │ │ │ +
95 CompositePreBasis(SFArgs&&... sfArgs) :
│ │ │ │ +
96 subPreBases_(std::forward<SFArgs>(sfArgs)...)
│ │ │ │ +
97 {
│ │ │ │ +
98 Hybrid::forEach(subPreBases_, [&](const auto& subPreBasis){
│ │ │ │ +
99 static_assert(models<Concept::PreBasis<GridView>, std::decay_t<decltype(subPreBasis)>>(), "Subprebases passed to CompositePreBasis does not model the PreBasis concept.");
│ │ │ │ +
100 });
│ │ │ │ +
101 }
│ │ │ │ +
│ │ │ │
102
│ │ │ │ -
103#endif // DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH
│ │ │ │ +
109 template<class GV,
│ │ │ │ +
110 std::enable_if_t<std::conjunction_v<
│ │ │ │ +
111 std::bool_constant<(children > 1)>, // Avoid ambiguous constructor if there's only one child
│ │ │ │ +
112 std::is_same<GV, GridView>,
│ │ │ │ +
113 std::is_constructible<SPB, GridView>...
│ │ │ │ +
114 >, int> = 0>
│ │ │ │ +
│ │ │ │ +
115 CompositePreBasis(const GV& gv) :
│ │ │ │ +
116 subPreBases_(SPB(gv)...)
│ │ │ │ +
117 {
│ │ │ │ +
118 Hybrid::forEach(subPreBases_, [&](const auto& subPreBasis){
│ │ │ │ +
119 static_assert(models<Concept::PreBasis<GridView>, std::decay_t<decltype(subPreBasis)>>(), "Subprebases passed to CompositePreBasis does not model the PreBasis concept.");
│ │ │ │ +
120 });
│ │ │ │ +
121 }
│ │ │ │ +
│ │ │ │ +
122
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
125 {
│ │ │ │ +
126 Hybrid::forEach(ChildIndices(), [&](auto i) {
│ │ │ │ +
127 this->subPreBasis(i).initializeIndices();
│ │ │ │ +
128 });
│ │ │ │ +
129 }
│ │ │ │ +
│ │ │ │ +
130
│ │ │ │ +
│ │ │ │ +
132 const GridView& gridView() const
│ │ │ │ +
133 {
│ │ │ │ +
134 return std::get<0>(subPreBases_).gridView();
│ │ │ │ +
135 }
│ │ │ │ +
│ │ │ │ +
136
│ │ │ │ +
│ │ │ │ +
138 void update(const GridView& gv)
│ │ │ │ +
139 {
│ │ │ │ +
140 Hybrid::forEach(ChildIndices(), [&](auto i) {
│ │ │ │ +
141 this->subPreBasis(i).update(gv);
│ │ │ │ +
142 });
│ │ │ │ +
143 }
│ │ │ │ +
│ │ │ │ +
144
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
149 {
│ │ │ │ +
150 auto node = Node{};
│ │ │ │ +
151 Hybrid::forEach(ChildIndices(), [&](auto i) {
│ │ │ │ +
152 node.setChild(this->subPreBasis(i).makeNode(), i);
│ │ │ │ +
153 });
│ │ │ │ +
154 return node;
│ │ │ │ +
155 }
│ │ │ │ +
│ │ │ │ +
156
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
159 {
│ │ │ │ +
160 return size(Dune::ReservedVector<size_type, multiIndexBufferSize>{});
│ │ │ │ +
161 }
│ │ │ │ +
│ │ │ │ +
162
│ │ │ │ +
164 template<class SizePrefix>
│ │ │ │ +
│ │ │ │ +
165 size_type size(const SizePrefix& prefix) const
│ │ │ │ +
166 {
│ │ │ │ +
167 return size(prefix, IndexMergingStrategy{});
│ │ │ │ +
168 }
│ │ │ │ +
│ │ │ │ +
169
│ │ │ │ +
170private:
│ │ │ │ +
171
│ │ │ │ +
172 template<class SizePrefix>
│ │ │ │ +
173 size_type size(const SizePrefix& prefix, BasisFactory::BlockedLexicographic) const
│ │ │ │ +
174 {
│ │ │ │ +
175 if (prefix.size() == 0)
│ │ │ │ +
176 return children;
│ │ │ │ +
177
│ │ │ │ +
178 return Hybrid::switchCases(ChildIndices(), prefix[0], [&] (auto i) {
│ │ │ │ +
179 SizePrefix subPrefix;
│ │ │ │ +
180 for(std::size_t i=1; i<prefix.size(); ++i)
│ │ │ │ +
181 subPrefix.push_back(prefix[i]);
│ │ │ │ +
182 return this->subPreBasis(i).size(subPrefix);
│ │ │ │ +
183 }, []() {
│ │ │ │ +
184 return size_type(0);
│ │ │ │ +
185 });
│ │ │ │ +
186 }
│ │ │ │ +
187
│ │ │ │ +
188 template<class SizePrefix>
│ │ │ │ +
189 size_type size(const SizePrefix& prefix, BasisFactory::FlatLexicographic) const
│ │ │ │ +
190 {
│ │ │ │ +
191 size_type result = 0;
│ │ │ │ +
192 if (prefix.size() == 0)
│ │ │ │ +
193 Hybrid::forEach(ChildIndices(), [&](auto i) {
│ │ │ │ +
194 result += this->subPreBasis(i).size();
│ │ │ │ +
195 });
│ │ │ │ +
196 else {
│ │ │ │ +
197 size_type shiftedFirstDigit = prefix[0];
│ │ │ │ +
198 staticFindInRange<0, children>([&](auto i) {
│ │ │ │ +
199 auto firstDigitSize = this->subPreBasis(i).size();
│ │ │ │ +
200 if (shiftedFirstDigit < firstDigitSize)
│ │ │ │ +
201 {
│ │ │ │ +
202 SizePrefix subPrefix;
│ │ │ │ +
203 subPrefix.push_back(shiftedFirstDigit);
│ │ │ │ +
204 for(std::size_t i=1; i<prefix.size(); ++i)
│ │ │ │ +
205 subPrefix.push_back(prefix[i]);
│ │ │ │ +
206 result = this->subPreBasis(i).size(subPrefix);
│ │ │ │ +
207 return true;
│ │ │ │ +
208 }
│ │ │ │ +
209 shiftedFirstDigit -= firstDigitSize;
│ │ │ │ +
210 return false;
│ │ │ │ +
211 });
│ │ │ │ +
212 }
│ │ │ │ +
213 return result;
│ │ │ │ +
214 }
│ │ │ │ +
215
│ │ │ │ +
216public:
│ │ │ │ +
217
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
220 {
│ │ │ │ +
221 size_type r=0;
│ │ │ │ +
222 // Accumulate dimension() for all subprebases
│ │ │ │ +
223 Hybrid::forEach(ChildIndices(), [&](auto i) {
│ │ │ │ +
224 r += this->subPreBasis(i).dimension();
│ │ │ │ +
225 });
│ │ │ │ +
226 return r;
│ │ │ │ +
227 }
│ │ │ │ +
│ │ │ │ +
228
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
231 {
│ │ │ │ +
232 size_type r=0;
│ │ │ │ +
233 // Accumulate maxNodeSize() for all subprebases
│ │ │ │ +
234 Hybrid::forEach(ChildIndices(), [&](auto i) {
│ │ │ │ +
235 r += this->subPreBasis(i).maxNodeSize();
│ │ │ │ +
236 });
│ │ │ │ +
237 return r;
│ │ │ │ +
238 }
│ │ │ │ +
│ │ │ │ +
239
│ │ │ │ +
241 template<std::size_t i>
│ │ │ │ +
│ │ │ │ +
242 const SubPreBasis<i>& subPreBasis(Dune::index_constant<i> = {}) const
│ │ │ │ +
243 {
│ │ │ │ +
244 return std::get<i>(subPreBases_);
│ │ │ │ +
245 }
│ │ │ │ +
│ │ │ │ +
246
│ │ │ │ +
248 template<std::size_t i>
│ │ │ │ +
│ │ │ │ +
249 SubPreBasis<i>& subPreBasis(Dune::index_constant<i> = {})
│ │ │ │ +
250 {
│ │ │ │ +
251 return std::get<i>(subPreBases_);
│ │ │ │ +
252 }
│ │ │ │ +
│ │ │ │ +
253
│ │ │ │ +
255 template<typename It>
│ │ │ │ +
│ │ │ │ +
256 It indices(const Node& node, It it) const
│ │ │ │ +
257 {
│ │ │ │ +
258 return indices(node, it, IndexMergingStrategy{});
│ │ │ │ +
259 }
│ │ │ │ +
│ │ │ │ +
260
│ │ │ │ +
261private:
│ │ │ │ +
262
│ │ │ │ +
263 template<typename It>
│ │ │ │ +
264 It indices(const Node& node, It multiIndices, BasisFactory::FlatLexicographic) const
│ │ │ │ +
265 {
│ │ │ │ +
266 size_type firstComponentOffset = 0;
│ │ │ │ +
267 // Loop over all children
│ │ │ │ +
268 Hybrid::forEach(ChildIndices(), [&](auto child){
│ │ │ │ +
269 size_type subTreeSize = node.child(child).size();
│ │ │ │ +
270 // Fill indices for current child into index buffer starting from current
│ │ │ │ +
271 // buffer position and shift first index component of any index for current
│ │ │ │ +
272 // child by suitable offset to get lexicographic indices.
│ │ │ │ +
273 subPreBasis(child).indices(node.child(child), multiIndices);
│ │ │ │ +
274 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ │ +
275 multiIndices[i][0] += firstComponentOffset;
│ │ │ │ +
276 // Increment offset by the size for first index component of the current child
│ │ │ │ +
277 firstComponentOffset += subPreBasis(child).size();
│ │ │ │ +
278 // Increment buffer iterator by the number of indices processed for current child
│ │ │ │ +
279 multiIndices += subTreeSize;
│ │ │ │ +
280 });
│ │ │ │ +
281 return multiIndices;
│ │ │ │ +
282 }
│ │ │ │ +
283
│ │ │ │ +
284 template<class MultiIndex>
│ │ │ │ +
285 static void multiIndexPushFront(MultiIndex& M, size_type M0)
│ │ │ │ +
286 {
│ │ │ │ +
287 M.resize(M.size()+1);
│ │ │ │ +
288 for(std::size_t i=M.size()-1; i>0; --i)
│ │ │ │ +
289 M[i] = M[i-1];
│ │ │ │ +
290 M[0] = M0;
│ │ │ │ +
291 }
│ │ │ │ +
292
│ │ │ │ +
293 template<typename It>
│ │ │ │ +
294 It indices(const Node& node, It multiIndices, BasisFactory::BlockedLexicographic) const
│ │ │ │ +
295 {
│ │ │ │ +
296 // Loop over all children
│ │ │ │ +
297 Hybrid::forEach(ChildIndices(), [&](auto child){
│ │ │ │ +
298 size_type subTreeSize = node.child(child).size();
│ │ │ │ +
299 // Fill indices for current child into index buffer starting from current position
│ │ │ │ +
300 subPreBasis(child).indices(node.child(child), multiIndices);
│ │ │ │ +
301 // Insert child index before first component of all indices of current child.
│ │ │ │ +
302 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ │ +
303 this->multiIndexPushFront(multiIndices[i], child);
│ │ │ │ +
304 // Increment buffer iterator by the number of indices processed for current child
│ │ │ │ +
305 multiIndices += subTreeSize;
│ │ │ │ +
306 });
│ │ │ │ +
307 return multiIndices;
│ │ │ │ +
308 }
│ │ │ │ +
309
│ │ │ │ +
310 std::tuple<SPB...> subPreBases_;
│ │ │ │ +
311};
│ │ │ │ +
│ │ │ │ +
312
│ │ │ │ +
313
│ │ │ │ +
314
│ │ │ │ +
315namespace BasisFactory {
│ │ │ │ +
316
│ │ │ │ +
317namespace Imp {
│ │ │ │ +
318
│ │ │ │ +
319template<class IndexMergingStrategy, class... ChildPreBasisFactory>
│ │ │ │ +
320class CompositePreBasisFactory
│ │ │ │ +
321{
│ │ │ │ +
322
│ │ │ │ +
323 template<class GridView, class... ChildPreBasis>
│ │ │ │ +
324 auto makePreBasisFromChildPreBases(const GridView&, ChildPreBasis&&... childPreBasis) const
│ │ │ │ +
325 {
│ │ │ │ +
326 return CompositePreBasis<IndexMergingStrategy, std::decay_t<ChildPreBasis>...>(std::forward<ChildPreBasis>(childPreBasis)...);
│ │ │ │ +
327 }
│ │ │ │ +
328
│ │ │ │ +
329public:
│ │ │ │ +
330
│ │ │ │ +
331 CompositePreBasisFactory(const ChildPreBasisFactory&... childPreBasisFactory) :
│ │ │ │ +
332 childPreBasisFactories_(childPreBasisFactory...)
│ │ │ │ +
333 {}
│ │ │ │ +
334
│ │ │ │ +
335 CompositePreBasisFactory(ChildPreBasisFactory&&... childPreBasisFactory) :
│ │ │ │ +
336 childPreBasisFactories_(std::move(childPreBasisFactory)...)
│ │ │ │ +
337 {}
│ │ │ │ +
338
│ │ │ │ +
339 template<class GridView>
│ │ │ │ +
340 auto operator()(const GridView& gridView) const
│ │ │ │ +
341 {
│ │ │ │ +
342 // Use std::apply to unpack the tuple childPreBasisFactories_
│ │ │ │ +
343 return std::apply([&](const auto&... childPreBasisFactory) {
│ │ │ │ +
344 return this->makePreBasisFromChildPreBases(gridView, childPreBasisFactory(gridView)...);
│ │ │ │ +
345 }, childPreBasisFactories_);
│ │ │ │ +
346 }
│ │ │ │ +
347
│ │ │ │ +
348private:
│ │ │ │ +
349 std::tuple<ChildPreBasisFactory...> childPreBasisFactories_;
│ │ │ │ +
350};
│ │ │ │ +
351
│ │ │ │ +
352} // end namespace BasisFactory::Imp
│ │ │ │ +
353
│ │ │ │ +
354
│ │ │ │ +
355
│ │ │ │ +
366template<
│ │ │ │ +
367 typename... Args,
│ │ │ │ +
368 std::enable_if_t<Concept::isIndexMergingStrategy<typename LastType<Args...>::type>(),int> = 0>
│ │ │ │ +
369auto composite(Args&&... args)
│ │ │ │ +
370{
│ │ │ │ +
371 // We have to separate the last entry which is the IndexMergingStrategy
│ │ │ │ +
372 // and the preceding ones, which are the ChildPreBasisFactories
│ │ │ │ +
373
│ │ │ │ +
374 using ArgTuple = std::tuple<std::decay_t<Args>...>;
│ │ │ │ +
375
│ │ │ │ +
376 // Compute number of children and index of the IndexMergingStrategy argument
│ │ │ │ +
377 constexpr std::size_t children = Dune::SizeOf<Args...>::value-1;
│ │ │ │ +
378
│ │ │ │ +
379 // Use last type as IndexMergingStrategy
│ │ │ │ +
380 using IndexMergingStrategy = std::tuple_element_t<children, ArgTuple>;
│ │ │ │ +
381
│ │ │ │ +
382 // Index sequence for all but the last entry for partial tuple unpacking
│ │ │ │ +
383 auto childIndices = std::make_index_sequence<children>{};
│ │ │ │ +
384
│ │ │ │ +
385 // Unpack tuple only for those entries related to children
│ │ │ │ +
386 return applyPartial([](auto&&... childPreBasisFactory){
│ │ │ │ +
387 return Imp::CompositePreBasisFactory<IndexMergingStrategy, std::decay_t<decltype(childPreBasisFactory)>...>(std::forward<decltype(childPreBasisFactory)>(childPreBasisFactory)...);
│ │ │ │ +
388 },
│ │ │ │ +
389 std::forward_as_tuple(std::forward<Args>(args)...),
│ │ │ │ +
390 childIndices);
│ │ │ │ +
391}
│ │ │ │ +
392
│ │ │ │ +
404template<
│ │ │ │ +
405 typename... Args,
│ │ │ │ +
406 std::enable_if_t<not Concept::isIndexMergingStrategy<typename LastType<Args...>::type>(),int> = 0>
│ │ │ │ +
407auto composite(Args&&... args)
│ │ │ │ +
408{
│ │ │ │ +
409 return Imp::CompositePreBasisFactory<BasisFactory::BlockedLexicographic, std::decay_t<Args>...>(std::forward<Args>(args)...);
│ │ │ │ +
410}
│ │ │ │ +
411
│ │ │ │ +
412} // end namespace BasisFactory
│ │ │ │ +
413
│ │ │ │ +
414// Backward compatibility
│ │ │ │ +
415namespace BasisBuilder {
│ │ │ │ +
416
│ │ │ │ +
417 using namespace BasisFactory;
│ │ │ │ +
418
│ │ │ │ +
419}
│ │ │ │ +
420
│ │ │ │ +
421
│ │ │ │ +
422
│ │ │ │ +
423} // end namespace Functions
│ │ │ │ +
424} // end namespace Dune
│ │ │ │ +
425
│ │ │ │ +
426
│ │ │ │ +
427#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
typename std::enable_if< std::is_constructible< T, Args... >::value, int >::type enableIfConstructible
Helper to constrain forwarding constructors.
Definition type_traits.hh:26
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
Check if type is a statically sized container.
Definition type_traits.hh:83
│ │ │ │ -
Obtain size of statically sized container.
Definition type_traits.hh:97
│ │ │ │ +
static constexpr bool isIndexMergingStrategy()
Definition basistags.hh:23
│ │ │ │ +
Lexicographic merging of direct children without blocking.
Definition basistags.hh:80
│ │ │ │ +
Lexicographic merging of direct children with blocking (i.e. creating one block per direct child).
Definition basistags.hh:148
│ │ │ │ +
A pre-basis for composite bases.
Definition compositebasis.hh:53
│ │ │ │ +
SubPreBasis< i > & subPreBasis(Dune::index_constant< i >={})
Mutable access to the stored prebasis of the factor in the power space.
Definition compositebasis.hh:249
│ │ │ │ +
IMS IndexMergingStrategy
Strategy used to merge the global indices of the child pre-bases.
Definition compositebasis.hh:71
│ │ │ │ +
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition compositebasis.hh:230
│ │ │ │ +
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:242
│ │ │ │ +
std::size_t size_type
Type used for indices and size information.
Definition compositebasis.hh:68
│ │ │ │ +
CompositeBasisNode< typename SPB::Node... > Node
Template mapping root tree path to type of created tree node.
Definition compositebasis.hh:81
│ │ │ │ +
size_type size(const SizePrefix &prefix) const
Return number of possible values for next position in multi index.
Definition compositebasis.hh:165
│ │ │ │ +
CompositePreBasis(SFArgs &&... sfArgs)
Constructor for given child pre-basis objects.
Definition compositebasis.hh:95
│ │ │ │ +
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition compositebasis.hh:219
│ │ │ │ +
CompositePreBasis(const GV &gv)
Constructor for given GridView.
Definition compositebasis.hh:115
│ │ │ │ +
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:256
│ │ │ │ +
size_type size() const
Same as size(prefix) with empty prefix.
Definition compositebasis.hh:158
│ │ │ │ +
typename std::tuple_element_t< 0, SubPreBases >::GridView GridView
The grid view that the FE basis is defined on.
Definition compositebasis.hh:65
│ │ │ │ +
static const std::size_t children
Definition compositebasis.hh:74
│ │ │ │ +
std::tuple< SPB... > SubPreBases
Tuple of child pre-bases.
Definition compositebasis.hh:58
│ │ │ │ +
Node makeNode() const
Create tree node.
Definition compositebasis.hh:148
│ │ │ │ +
void initializeIndices()
Initialize the global indices.
Definition compositebasis.hh:124
│ │ │ │ +
std::tuple_element_t< i, SubPreBases > SubPreBasis
Export individual child pre-bases by index.
Definition compositebasis.hh:62
│ │ │ │ +
std::make_index_sequence< children > ChildIndices
Definition compositebasis.hh:76
│ │ │ │ +
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition compositebasis.hh:138
│ │ │ │ +
static constexpr size_type multiIndexBufferSize
Definition compositebasis.hh:85
│ │ │ │ +
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition compositebasis.hh:132
│ │ │ │ +
static constexpr size_type minMultiIndexSize
Definition compositebasis.hh:84
│ │ │ │ +
static constexpr size_type maxMultiIndexSize
Definition compositebasis.hh:83
│ │ │ │ + │ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,105 +1,528 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -type_traits.hh │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7 │ │ │ │ │ -8#include │ │ │ │ │ -9 │ │ │ │ │ -10namespace _D_u_n_e { │ │ │ │ │ -11namespace Functions { │ │ │ │ │ -12 │ │ │ │ │ -13 │ │ │ │ │ -24template │ │ │ │ │ -_2_5using _e_n_a_b_l_e_I_f_C_o_n_s_t_r_u_c_t_i_b_l_e = typename std::enable_if< │ │ │ │ │ -26 std::is_constructible::value, int>::type; │ │ │ │ │ -27 │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ +8 │ │ │ │ │ +9#include │ │ │ │ │ +10#include │ │ │ │ │ +11#include │ │ │ │ │ +12#include │ │ │ │ │ +13#include │ │ │ │ │ +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_/_s_t_a_t_i_c_f_o_r_l_o_o_p_._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___t_r_a_i_t_s_._h_h> │ │ │ │ │ +19#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> │ │ │ │ │ +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_/_b_a_s_i_s_t_a_g_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_/_n_o_d_e_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_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_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ │ +24 │ │ │ │ │ +25 │ │ │ │ │ +26namespace _D_u_n_e { │ │ │ │ │ +27namespace Functions { │ │ │ │ │ 28 │ │ │ │ │ -29 │ │ │ │ │ -30namespace Imp { │ │ │ │ │ -31 │ │ │ │ │ -32 // As a last resort try if there's a static constexpr size() │ │ │ │ │ -33 template │ │ │ │ │ -34 constexpr auto staticSize(const T*, const PriorityTag<0>&) │ │ │ │ │ -35 -> decltype(std::integral_constant()) │ │ │ │ │ -36 { │ │ │ │ │ -37 return {}; │ │ │ │ │ -38 } │ │ │ │ │ +29/ │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +30// This is the reusable part of the composite bases. It contains │ │ │ │ │ +31// │ │ │ │ │ +32// CompositePreBasis │ │ │ │ │ +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 │ │ │ │ │ 39 │ │ │ │ │ -40 // Try if class has constexpr default constructor and size method │ │ │ │ │ -41 template │ │ │ │ │ -42 constexpr auto staticSize(const T*, const PriorityTag<1>&) │ │ │ │ │ -43 -> decltype(std::integral_constant()) │ │ │ │ │ -44 { │ │ │ │ │ -45 return {}; │ │ │ │ │ -46 } │ │ │ │ │ -47 │ │ │ │ │ -48 // Try if tuple_size is implemented for class │ │ │ │ │ -49 template │ │ │ │ │ -50 constexpr auto staticSize(const T*, const PriorityTag<2>&) │ │ │ │ │ -51 -> decltype(std::integral_constant::value>()) │ │ │ │ │ -52 { │ │ │ │ │ -53 return {}; │ │ │ │ │ -54 } │ │ │ │ │ -55 │ │ │ │ │ -56 template │ │ │ │ │ -57 constexpr std::false_type hasStaticSize(const T* t, const PriorityTag<0>& p) │ │ │ │ │ -58 { │ │ │ │ │ -59 return {}; │ │ │ │ │ -60 } │ │ │ │ │ -61 │ │ │ │ │ -62 template │ │ │ │ │ -63 constexpr auto hasStaticSize(const T* t, const PriorityTag<1>& p) │ │ │ │ │ -64 -> decltype(staticSize(t ,PriorityTag<42>()), std::true_type()) │ │ │ │ │ -65 { │ │ │ │ │ -66 return {}; │ │ │ │ │ -67 } │ │ │ │ │ -68 │ │ │ │ │ -69} │ │ │ │ │ -70 │ │ │ │ │ -71 │ │ │ │ │ +51template │ │ │ │ │ +_5_2class _C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s │ │ │ │ │ +53{ │ │ │ │ │ +54 static const bool isBlocked = std::is_same_v or std::is_same_v; │ │ │ │ │ +55public: │ │ │ │ │ +56 │ │ │ │ │ +_5_8 using _S_u_b_P_r_e_B_a_s_e_s = std::tuple; │ │ │ │ │ +59 │ │ │ │ │ +61 template │ │ │ │ │ +_6_2 using _S_u_b_P_r_e_B_a_s_i_s = std::tuple_element_t; │ │ │ │ │ +63 │ │ │ │ │ +_6_5 using _G_r_i_d_V_i_e_w = typename std::tuple_element_t<0, SubPreBases>::GridView; │ │ │ │ │ +66 │ │ │ │ │ +_6_8 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ +69 │ │ │ │ │ +_7_1 using _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y = IMS; │ │ │ │ │ 72 │ │ │ │ │ -80template │ │ │ │ │ -_8_1struct _H_a_s_S_t_a_t_i_c_S_i_z_e : │ │ │ │ │ -82 public decltype(Imp::hasStaticSize((typename std::decay::type*)(nullptr), │ │ │ │ │ -PriorityTag<42>())) │ │ │ │ │ -83{}; │ │ │ │ │ -84 │ │ │ │ │ -85 │ │ │ │ │ +73protected: │ │ │ │ │ +_7_4 static const std::size_t _c_h_i_l_d_r_e_n = sizeof...(SPB); │ │ │ │ │ +75 │ │ │ │ │ +_7_6 using _C_h_i_l_d_I_n_d_i_c_e_s = std::make_index_sequence; │ │ │ │ │ +77 │ │ │ │ │ +78public: │ │ │ │ │ +79 │ │ │ │ │ +_8_1 using _N_o_d_e = _C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e; │ │ │ │ │ +82 │ │ │ │ │ +_8_3 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_4 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_5 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; │ │ │ │ │ 86 │ │ │ │ │ -94template │ │ │ │ │ -_9_5struct _S_t_a_t_i_c_S_i_z_e : │ │ │ │ │ -96 public decltype(Imp::staticSize((typename std::decay::type*)(nullptr), │ │ │ │ │ -PriorityTag<42>())) │ │ │ │ │ -97{}; │ │ │ │ │ -98 │ │ │ │ │ -99 │ │ │ │ │ -100 │ │ │ │ │ -101}} // namespace Dune::Functions │ │ │ │ │ +92 template = 0, │ │ │ │ │ +94 _e_n_a_b_l_e_I_f_C_o_n_s_t_r_u_c_t_i_b_l_e, SFArgs...> = 0> │ │ │ │ │ +_9_5 _C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s(SFArgs&&... sfArgs) : │ │ │ │ │ +96 subPreBases_(std::forward(sfArgs)...) │ │ │ │ │ +97 { │ │ │ │ │ +98 Hybrid::forEach(subPreBases_, [&](const auto& _s_u_b_P_r_e_B_a_s_i_s){ │ │ │ │ │ +99 static_assert(models, std::decay_t>(), "Subprebases passed to CompositePreBasis does not model the │ │ │ │ │ +PreBasis concept."); │ │ │ │ │ +100 }); │ │ │ │ │ +101 } │ │ │ │ │ 102 │ │ │ │ │ -103#endif // DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH │ │ │ │ │ +109 template 1)>, // Avoid ambiguous constructor if │ │ │ │ │ +there's only one child │ │ │ │ │ +112 std::is_same, │ │ │ │ │ +113 std::is_constructible... │ │ │ │ │ +114 >, int> = 0> │ │ │ │ │ +_1_1_5 _C_o_m_p_o_s_i_t_e_P_r_e_B_a_s_i_s(const GV& gv) : │ │ │ │ │ +116 subPreBases_(SPB(gv)...) │ │ │ │ │ +117 { │ │ │ │ │ +118 Hybrid::forEach(subPreBases_, [&](const auto& _s_u_b_P_r_e_B_a_s_i_s){ │ │ │ │ │ +119 static_assert(models, std::decay_t>(), "Subprebases passed to CompositePreBasis does not model the │ │ │ │ │ +PreBasis concept."); │ │ │ │ │ +120 }); │ │ │ │ │ +121 } │ │ │ │ │ +122 │ │ │ │ │ +_1_2_4 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ │ +125 { │ │ │ │ │ +126 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto i) { │ │ │ │ │ +127 this->_s_u_b_P_r_e_B_a_s_i_s(i).initializeIndices(); │ │ │ │ │ +128 }); │ │ │ │ │ +129 } │ │ │ │ │ +130 │ │ │ │ │ +_1_3_2 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ │ +133 { │ │ │ │ │ +134 return std::get<0>(subPreBases_).gridView(); │ │ │ │ │ +135 } │ │ │ │ │ +136 │ │ │ │ │ +_1_3_8 void _u_p_d_a_t_e(const _G_r_i_d_V_i_e_w& gv) │ │ │ │ │ +139 { │ │ │ │ │ +140 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto i) { │ │ │ │ │ +141 this->_s_u_b_P_r_e_B_a_s_i_s(i).update(gv); │ │ │ │ │ +142 }); │ │ │ │ │ +143 } │ │ │ │ │ +144 │ │ │ │ │ +_1_4_8 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ │ +149 { │ │ │ │ │ +150 auto node = _N_o_d_e{}; │ │ │ │ │ +151 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto i) { │ │ │ │ │ +152 node.setChild(this->_s_u_b_P_r_e_B_a_s_i_s(i)._m_a_k_e_N_o_d_e(), i); │ │ │ │ │ +153 }); │ │ │ │ │ +154 return node; │ │ │ │ │ +155 } │ │ │ │ │ +156 │ │ │ │ │ +_1_5_8 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ │ +159 { │ │ │ │ │ +160 return _s_i_z_e(Dune::ReservedVector{}); │ │ │ │ │ +161 } │ │ │ │ │ +162 │ │ │ │ │ +164 template │ │ │ │ │ +_1_6_5 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix) const │ │ │ │ │ +166 { │ │ │ │ │ +167 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{}); │ │ │ │ │ +168 } │ │ │ │ │ +169 │ │ │ │ │ +170private: │ │ │ │ │ +171 │ │ │ │ │ +172 template │ │ │ │ │ +173 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix, _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 │ │ │ │ │ +174 { │ │ │ │ │ +175 if (prefix.size() == 0) │ │ │ │ │ +176 return _c_h_i_l_d_r_e_n; │ │ │ │ │ +177 │ │ │ │ │ +178 return Hybrid::switchCases(_C_h_i_l_d_I_n_d_i_c_e_s(), prefix[0], [&] (auto i) { │ │ │ │ │ +179 SizePrefix subPrefix; │ │ │ │ │ +180 for(std::size_t i=1; i_s_u_b_P_r_e_B_a_s_i_s(i).size(subPrefix); │ │ │ │ │ +183 }, []() { │ │ │ │ │ +184 return _s_i_z_e___t_y_p_e(0); │ │ │ │ │ +185 }); │ │ │ │ │ +186 } │ │ │ │ │ +187 │ │ │ │ │ +188 template │ │ │ │ │ +189 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix, BasisFactory::FlatLexicographic) │ │ │ │ │ +const │ │ │ │ │ +190 { │ │ │ │ │ +191 _s_i_z_e___t_y_p_e result = 0; │ │ │ │ │ +192 if (prefix.size() == 0) │ │ │ │ │ +193 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto i) { │ │ │ │ │ +194 result += this->_s_u_b_P_r_e_B_a_s_i_s(i).size(); │ │ │ │ │ +195 }); │ │ │ │ │ +196 else { │ │ │ │ │ +197 _s_i_z_e___t_y_p_e shiftedFirstDigit = prefix[0]; │ │ │ │ │ +198 staticFindInRange<0, children>([&](auto i) { │ │ │ │ │ +199 auto firstDigitSize = this->_s_u_b_P_r_e_B_a_s_i_s(i).size(); │ │ │ │ │ +200 if (shiftedFirstDigit < firstDigitSize) │ │ │ │ │ +201 { │ │ │ │ │ +202 SizePrefix subPrefix; │ │ │ │ │ +203 subPrefix.push_back(shiftedFirstDigit); │ │ │ │ │ +204 for(std::size_t i=1; i_s_u_b_P_r_e_B_a_s_i_s(i).size(subPrefix); │ │ │ │ │ +207 return true; │ │ │ │ │ +208 } │ │ │ │ │ +209 shiftedFirstDigit -= firstDigitSize; │ │ │ │ │ +210 return false; │ │ │ │ │ +211 }); │ │ │ │ │ +212 } │ │ │ │ │ +213 return result; │ │ │ │ │ +214 } │ │ │ │ │ +215 │ │ │ │ │ +216public: │ │ │ │ │ +217 │ │ │ │ │ +_2_1_9 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ │ +220 { │ │ │ │ │ +221 _s_i_z_e___t_y_p_e r=0; │ │ │ │ │ +222 // Accumulate dimension() for all subprebases │ │ │ │ │ +223 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto i) { │ │ │ │ │ +224 r += this->_s_u_b_P_r_e_B_a_s_i_s(i).dimension(); │ │ │ │ │ +225 }); │ │ │ │ │ +226 return r; │ │ │ │ │ +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 _s_i_z_e___t_y_p_e r=0; │ │ │ │ │ +233 // Accumulate maxNodeSize() for all subprebases │ │ │ │ │ +234 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto i) { │ │ │ │ │ +235 r += this->_s_u_b_P_r_e_B_a_s_i_s(i).maxNodeSize(); │ │ │ │ │ +236 }); │ │ │ │ │ +237 return r; │ │ │ │ │ +238 } │ │ │ │ │ +239 │ │ │ │ │ +241 template │ │ │ │ │ +_2_4_2 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 │ │ │ │ │ +243 { │ │ │ │ │ +244 return std::get(subPreBases_); │ │ │ │ │ +245 } │ │ │ │ │ +246 │ │ │ │ │ +248 template │ │ │ │ │ +_2_4_9 _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 = {}) │ │ │ │ │ +250 { │ │ │ │ │ +251 return std::get(subPreBases_); │ │ │ │ │ +252 } │ │ │ │ │ +253 │ │ │ │ │ +255 template │ │ │ │ │ +_2_5_6 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ │ +257 { │ │ │ │ │ +258 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{}); │ │ │ │ │ +259 } │ │ │ │ │ +260 │ │ │ │ │ +261private: │ │ │ │ │ +262 │ │ │ │ │ +263 template │ │ │ │ │ +264 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 │ │ │ │ │ +265 { │ │ │ │ │ +266 _s_i_z_e___t_y_p_e firstComponentOffset = 0; │ │ │ │ │ +267 // Loop over all children │ │ │ │ │ +268 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto child){ │ │ │ │ │ +269 _s_i_z_e___t_y_p_e subTreeSize = node.child(child)._s_i_z_e(); │ │ │ │ │ +270 // Fill indices for current child into index buffer starting from current │ │ │ │ │ +271 // buffer position and shift first index component of any index for current │ │ │ │ │ +272 // child by suitable offset to get lexicographic indices. │ │ │ │ │ +273 _s_u_b_P_r_e_B_a_s_i_s(child).indices(node.child(child), multiIndices); │ │ │ │ │ +274 for (std::size_t i = 0; i │ │ │ │ │ +285 static void multiIndexPushFront(MultiIndex& M, _s_i_z_e___t_y_p_e M0) │ │ │ │ │ +286 { │ │ │ │ │ +287 M.resize(M.size()+1); │ │ │ │ │ +288 for(std::size_t i=M.size()-1; i>0; --i) │ │ │ │ │ +289 M[i] = M[i-1]; │ │ │ │ │ +290 M[0] = M0; │ │ │ │ │ +291 } │ │ │ │ │ +292 │ │ │ │ │ +293 template │ │ │ │ │ +294 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It multiIndices, BasisFactory:: │ │ │ │ │ +BlockedLexicographic) const │ │ │ │ │ +295 { │ │ │ │ │ +296 // Loop over all children │ │ │ │ │ +297 Hybrid::forEach(_C_h_i_l_d_I_n_d_i_c_e_s(), [&](auto child){ │ │ │ │ │ +298 _s_i_z_e___t_y_p_e subTreeSize = node.child(child)._s_i_z_e(); │ │ │ │ │ +299 // Fill indices for current child into index buffer starting from current │ │ │ │ │ +position │ │ │ │ │ +300 _s_u_b_P_r_e_B_a_s_i_s(child).indices(node.child(child), multiIndices); │ │ │ │ │ +301 // Insert child index before first component of all indices of current │ │ │ │ │ +child. │ │ │ │ │ +302 for (std::size_t i = 0; imultiIndexPushFront(multiIndices[i], child); │ │ │ │ │ +304 // Increment buffer iterator by the number of indices processed for current │ │ │ │ │ +child │ │ │ │ │ +305 multiIndices += subTreeSize; │ │ │ │ │ +306 }); │ │ │ │ │ +307 return multiIndices; │ │ │ │ │ +308 } │ │ │ │ │ +309 │ │ │ │ │ +310 std::tuple subPreBases_; │ │ │ │ │ +311}; │ │ │ │ │ +312 │ │ │ │ │ +313 │ │ │ │ │ +314 │ │ │ │ │ +315namespace BasisFactory { │ │ │ │ │ +316 │ │ │ │ │ +317namespace Imp { │ │ │ │ │ +318 │ │ │ │ │ +319template │ │ │ │ │ +320class CompositePreBasisFactory │ │ │ │ │ +321{ │ │ │ │ │ +322 │ │ │ │ │ +323 template │ │ │ │ │ +324 auto makePreBasisFromChildPreBases(const GridView&, ChildPreBasis&&... │ │ │ │ │ +childPreBasis) const │ │ │ │ │ +325 { │ │ │ │ │ +326 return CompositePreBasis...>(std::forward(childPreBasis)...); │ │ │ │ │ +327 } │ │ │ │ │ +328 │ │ │ │ │ +329public: │ │ │ │ │ +330 │ │ │ │ │ +331 CompositePreBasisFactory(const ChildPreBasisFactory&... │ │ │ │ │ +childPreBasisFactory) : │ │ │ │ │ +332 childPreBasisFactories_(childPreBasisFactory...) │ │ │ │ │ +333 {} │ │ │ │ │ +334 │ │ │ │ │ +335 CompositePreBasisFactory(ChildPreBasisFactory&&... childPreBasisFactory) : │ │ │ │ │ +336 childPreBasisFactories_(std::move(childPreBasisFactory)...) │ │ │ │ │ +337 {} │ │ │ │ │ +338 │ │ │ │ │ +339 template │ │ │ │ │ +340 auto operator()(const GridView& gridView) const │ │ │ │ │ +341 { │ │ │ │ │ +342 // Use std::apply to unpack the tuple childPreBasisFactories_ │ │ │ │ │ +343 return std::apply([&](const auto&... childPreBasisFactory) { │ │ │ │ │ +344 return this->makePreBasisFromChildPreBases(gridView, childPreBasisFactory │ │ │ │ │ +(gridView)...); │ │ │ │ │ +345 }, childPreBasisFactories_); │ │ │ │ │ +346 } │ │ │ │ │ +347 │ │ │ │ │ +348private: │ │ │ │ │ +349 std::tuple childPreBasisFactories_; │ │ │ │ │ +350}; │ │ │ │ │ +351 │ │ │ │ │ +352} // end namespace BasisFactory::Imp │ │ │ │ │ +353 │ │ │ │ │ +354 │ │ │ │ │ +355 │ │ │ │ │ +366template< │ │ │ │ │ +367 typename... Args, │ │ │ │ │ +368 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> │ │ │ │ │ +369auto composite(Args&&... args) │ │ │ │ │ +370{ │ │ │ │ │ +371 // We have to separate the last entry which is the IndexMergingStrategy │ │ │ │ │ +372 // and the preceding ones, which are the ChildPreBasisFactories │ │ │ │ │ +373 │ │ │ │ │ +374 using ArgTuple = std::tuple...>; │ │ │ │ │ +375 │ │ │ │ │ +376 // Compute number of children and index of the IndexMergingStrategy │ │ │ │ │ +argument │ │ │ │ │ +377 constexpr std::size_t children = Dune::SizeOf::value-1; │ │ │ │ │ +378 │ │ │ │ │ +379 // Use last type as IndexMergingStrategy │ │ │ │ │ +380 using IndexMergingStrategy = std::tuple_element_t; │ │ │ │ │ +381 │ │ │ │ │ +382 // Index sequence for all but the last entry for partial tuple unpacking │ │ │ │ │ +383 auto childIndices = std::make_index_sequence{}; │ │ │ │ │ +384 │ │ │ │ │ +385 // Unpack tuple only for those entries related to children │ │ │ │ │ +386 return applyPartial([](auto&&... childPreBasisFactory){ │ │ │ │ │ +387 return Imp::CompositePreBasisFactory...>(std::forward(childPreBasisFactory)...); │ │ │ │ │ +388 }, │ │ │ │ │ +389 std::forward_as_tuple(std::forward(args)...), │ │ │ │ │ +390 childIndices); │ │ │ │ │ +391} │ │ │ │ │ +392 │ │ │ │ │ +404template< │ │ │ │ │ +405 typename... Args, │ │ │ │ │ +406 std::enable_if_t::type>(),int> = 0> │ │ │ │ │ +407auto composite(Args&&... args) │ │ │ │ │ +408{ │ │ │ │ │ +409 return Imp::CompositePreBasisFactory...>(std::forward(args)...); │ │ │ │ │ +410} │ │ │ │ │ +411 │ │ │ │ │ +412} // end namespace BasisFactory │ │ │ │ │ +413 │ │ │ │ │ +414// Backward compatibility │ │ │ │ │ +415namespace BasisBuilder { │ │ │ │ │ +416 │ │ │ │ │ +417 using namespace BasisFactory; │ │ │ │ │ +418 │ │ │ │ │ +419} │ │ │ │ │ +420 │ │ │ │ │ +421 │ │ │ │ │ +422 │ │ │ │ │ +423} // end namespace Functions │ │ │ │ │ +424} // end namespace Dune │ │ │ │ │ +425 │ │ │ │ │ +426 │ │ │ │ │ +427#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH │ │ │ │ │ +_s_t_a_t_i_c_f_o_r_l_o_o_p_._h_h │ │ │ │ │ +_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 │ │ │ │ │ _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 │ │ │ │ │ typename std::enable_if< std::is_constructible< T, Args... >::value, int >:: │ │ │ │ │ type enableIfConstructible │ │ │ │ │ Helper to constrain forwarding constructors. │ │ │ │ │ DDeeffiinniittiioonn type_traits.hh:26 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:83 │ │ │ │ │ -_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. │ │ │ │ │ -DDeeffiinniittiioonn type_traits.hh:97 │ │ │ │ │ +_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:23 │ │ │ │ │ +_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:80 │ │ │ │ │ +_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:148 │ │ │ │ │ +_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:53 │ │ │ │ │ +_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:249 │ │ │ │ │ +_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:71 │ │ │ │ │ +_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:230 │ │ │ │ │ +_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:242 │ │ │ │ │ +_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:68 │ │ │ │ │ +_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:81 │ │ │ │ │ +_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:165 │ │ │ │ │ +_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:95 │ │ │ │ │ +_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:219 │ │ │ │ │ +_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:115 │ │ │ │ │ +_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:256 │ │ │ │ │ +_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:158 │ │ │ │ │ +_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:65 │ │ │ │ │ +_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:74 │ │ │ │ │ +_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:58 │ │ │ │ │ +_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:148 │ │ │ │ │ +_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:124 │ │ │ │ │ +_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: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_:_:_C_h_i_l_d_I_n_d_i_c_e_s │ │ │ │ │ +std::make_index_sequence< children > ChildIndices │ │ │ │ │ +DDeeffiinniittiioonn compositebasis.hh:76 │ │ │ │ │ +_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:138 │ │ │ │ │ +_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: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_:_:_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:132 │ │ │ │ │ +_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: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_:_:_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:83 │ │ │ │ │ +_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:219 │ │ │ │ │ +_c_o_n_c_e_p_t_s_._h_h │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00101.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: staticforloop.hh File Reference │ │ │ │ +dune-functions: taylorhoodbasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,43 +65,68 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ +Classes | │ │ │ │ Namespaces | │ │ │ │ +Typedefs | │ │ │ │ Functions
│ │ │ │ -
staticforloop.hh File Reference
│ │ │ │ +
taylorhoodbasis.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <dune/common/concept.hh>
│ │ │ │ -#include <dune/functions/common/type_traits.hh>
│ │ │ │ -#include <dune/functions/functionspacebases/concepts.hh>
│ │ │ │ +
#include <dune/common/exceptions.hh>
│ │ │ │ +#include <dune/common/reservedvector.hh>
│ │ │ │ +#include <dune/common/indices.hh>
│ │ │ │ +#include <dune/typetree/powernode.hh>
│ │ │ │ +#include <dune/typetree/compositenode.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::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 >
using Dune::Functions::TaylorHoodBasis = DefaultGlobalBasis< TaylorHoodPreBasis< GV > >
 Nodal basis for a lowest order Taylor-Hood Lagrangean finite element space.
 
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ 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.
 
auto Dune::Functions::BasisFactory::taylorHood ()
 Create a pre-basis factory that can create a Taylor-Hood pre-basis.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,25 +1,46 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -_N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -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> │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +taylorhoodbasis.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_/_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> │ │ │ │ │ _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_ _> │ │ │ │ │ +  │ │ │ │ │ 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< GV > > │ │ │ │ │ +  Nodal basis for a lowest order Taylor-Hood Lagrangean finite element │ │ │ │ │ + space. │ │ │ │ │ +  │ │ │ │ │ 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. │ │ │ │ │ +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. │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00101_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: staticforloop.hh Source File │ │ │ │ +dune-functions: taylorhoodbasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,81 +70,394 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
staticforloop.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#ifndef DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH
│ │ │ │
5
│ │ │ │ -
6
│ │ │ │ -
7#include <dune/common/concept.hh>
│ │ │ │ -
8
│ │ │ │ - │ │ │ │ - │ │ │ │ -
11
│ │ │ │ +
6#include <dune/common/exceptions.hh>
│ │ │ │ +
7#include <dune/common/reservedvector.hh>
│ │ │ │ +
8#include <dune/common/indices.hh>
│ │ │ │ +
9
│ │ │ │ +
10#include <dune/typetree/powernode.hh>
│ │ │ │ +
11#include <dune/typetree/compositenode.hh>
│ │ │ │
12
│ │ │ │ -
13namespace Dune {
│ │ │ │ -
14namespace Functions {
│ │ │ │ -
15
│ │ │ │ -
16namespace Imp {
│ │ │ │ + │ │ │ │ +
14
│ │ │ │ + │ │ │ │ + │ │ │ │
17
│ │ │ │ -
18template<class ST, ST begin, ST end>
│ │ │ │ -
19struct StaticFindInRange
│ │ │ │ -
20{
│ │ │ │ -
21 template<class F, class...Args>
│ │ │ │ -
22 static void apply(F&& f, Args&&... args)
│ │ │ │ -
23 {
│ │ │ │ -
24 if (f(std::integral_constant<ST, begin>(), std::forward<Args>(args)...))
│ │ │ │ -
25 return;
│ │ │ │ -
26 StaticFindInRange<ST, begin+1, end>::apply(std::forward<F>(f), std::forward<Args>(args)...);
│ │ │ │ -
27 }
│ │ │ │ -
28};
│ │ │ │ -
29
│ │ │ │ -
30template<class ST, ST end>
│ │ │ │ -
31struct StaticFindInRange<ST, end, end>
│ │ │ │ -
32{
│ │ │ │ -
33 template<class F, class...Args>
│ │ │ │ -
34 static void apply(F&& f, Args&&...)
│ │ │ │ -
35 {}
│ │ │ │ -
36};
│ │ │ │ -
37
│ │ │ │ -
38} //end namespace Imp
│ │ │ │ +
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>
│ │ │ │ +
35class TaylorHoodVelocityTree;
│ │ │ │ +
36
│ │ │ │ +
37template<typename GV>
│ │ │ │ +
38class TaylorHoodBasisTree;
│ │ │ │
39
│ │ │ │ -
40
│ │ │ │ -
41
│ │ │ │ -
55template<std::size_t begin_t, std::size_t end_t, class F, class... Args>
│ │ │ │ -
│ │ │ │ -
56void staticFindInRange(F&& f, Args&&... args)
│ │ │ │ -
57{
│ │ │ │ -
58 Imp::StaticFindInRange<std::size_t, begin_t, end_t>::apply(std::forward<F>(f), std::forward<Args>(args)...);
│ │ │ │ -
59}
│ │ │ │ -
│ │ │ │ -
60
│ │ │ │ -
61
│ │ │ │ -
62} // namespace Dune::Functions
│ │ │ │ -
63} // namespace Dune
│ │ │ │ -
64
│ │ │ │ +
59template<typename GV, bool HI=false>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
61{
│ │ │ │ +
62 static const bool useHybridIndices = HI;
│ │ │ │ +
63
│ │ │ │ +
64 static const int dim = GV::dimension;
│ │ │ │
65
│ │ │ │ -
66
│ │ │ │ -
67#endif //DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH
│ │ │ │ - │ │ │ │ -
void staticFindInRange(F &&f, Args &&... args)
Static find loop.
Definition staticforloop.hh:56
│ │ │ │ +
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
│ │ │ │ + │ │ │ │ + │ │ │ │ +
85
│ │ │ │ +
86public:
│ │ │ │ +
87
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
90 gridView_(gv),
│ │ │ │ +
91 pq1PreBasis_(gv),
│ │ │ │ +
92 pq2PreBasis_(gv)
│ │ │ │ +
93 {}
│ │ │ │ +
│ │ │ │ +
94
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
97 {
│ │ │ │ + │ │ │ │ + │ │ │ │ +
100 }
│ │ │ │ +
│ │ │ │ +
101
│ │ │ │ +
│ │ │ │ +
103 const GridView& gridView() const
│ │ │ │ +
104 {
│ │ │ │ +
105 return gridView_;
│ │ │ │ +
106 }
│ │ │ │ +
│ │ │ │ +
107
│ │ │ │ +
│ │ │ │ +
109 void update (const GridView& gv)
│ │ │ │ +
110 {
│ │ │ │ + │ │ │ │ + │ │ │ │ +
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 typename std::enable_if<not hi,int>::type = 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 typename std::enable_if<hi,int>::type = 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 {
│ │ │ │ + │ │ │ │ +
191 }
│ │ │ │ +
│ │ │ │ +
192
│ │ │ │ +
193 template<typename It>
│ │ │ │ +
│ │ │ │ +
194 It indices(const Node& node, It it) const
│ │ │ │ +
195 {
│ │ │ │ +
196 return indicesImp<useHybridIndices>(node, it);
│ │ │ │ +
197 }
│ │ │ │ +
│ │ │ │ +
198
│ │ │ │ +
199protected:
│ │ │ │ +
200
│ │ │ │ +
201 template<class MultiIndex>
│ │ │ │ +
│ │ │ │ +
202 static const void multiIndexPushFront(MultiIndex& M, size_type M0)
│ │ │ │ +
203 {
│ │ │ │ +
204 M.resize(M.size()+1);
│ │ │ │ +
205 for(std::size_t i=M.size()-1; i>0; --i)
│ │ │ │ +
206 M[i] = M[i-1];
│ │ │ │ +
207 M[0] = M0;
│ │ │ │ +
208 }
│ │ │ │ +
│ │ │ │ +
209
│ │ │ │ +
210 template<bool hi, class It,
│ │ │ │ +
211 typename std::enable_if<not hi,int>::type = 0>
│ │ │ │ +
│ │ │ │ +
212 It indicesImp(const Node& node, It multiIndices) const
│ │ │ │ +
213 {
│ │ │ │ +
214 using namespace Dune::Indices;
│ │ │ │ +
215 for(std::size_t child=0; child<dim; ++child)
│ │ │ │ +
216 {
│ │ │ │ +
217 size_type subTreeSize = node.child(_0, 0).size();
│ │ │ │ +
218 pq2PreBasis_.indices(node.child(_0, 0), multiIndices);
│ │ │ │ +
219 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ │ +
220 {
│ │ │ │ +
221 multiIndexPushFront(multiIndices[i], 0);
│ │ │ │ +
222 multiIndices[i][1] = multiIndices[i][1]*dim + child;
│ │ │ │ +
223 }
│ │ │ │ +
224 multiIndices += subTreeSize;
│ │ │ │ +
225 }
│ │ │ │ +
226 size_type subTreeSize = node.child(_1).size();
│ │ │ │ +
227 pq1PreBasis_.indices(node.child(_1), multiIndices);
│ │ │ │ +
228 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ │ +
229 multiIndexPushFront(multiIndices[i], 1);
│ │ │ │ +
230 multiIndices += subTreeSize;
│ │ │ │ +
231 return multiIndices;
│ │ │ │ +
232 }
│ │ │ │ +
│ │ │ │ +
233
│ │ │ │ +
234 template<bool hi, class It,
│ │ │ │ +
235 typename std::enable_if<hi,int>::type = 0>
│ │ │ │ +
│ │ │ │ +
236 It indicesImp(const Node& node, It multiIndices) const
│ │ │ │ +
237 {
│ │ │ │ +
238 using namespace Dune::Indices;
│ │ │ │ +
239 for(std::size_t child=0; child<dim; ++child)
│ │ │ │ +
240 {
│ │ │ │ +
241 size_type subTreeSize = node.child(_0, 0).size();
│ │ │ │ +
242 pq2PreBasis_.indices(node.child(_0, 0), multiIndices);
│ │ │ │ +
243 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ │ +
244 {
│ │ │ │ +
245 multiIndexPushFront(multiIndices[i], 0);
│ │ │ │ +
246 multiIndices[i].push_back(i);
│ │ │ │ +
247 }
│ │ │ │ +
248 multiIndices += subTreeSize;
│ │ │ │ +
249 }
│ │ │ │ +
250 size_type subTreeSize = node.child(_1).size();
│ │ │ │ +
251 pq1PreBasis_.indices(node.child(_1), multiIndices);
│ │ │ │ +
252 for (std::size_t i = 0; i<subTreeSize; ++i)
│ │ │ │ +
253 multiIndexPushFront(multiIndices[i], 1);
│ │ │ │ +
254 multiIndices += subTreeSize;
│ │ │ │ +
255 return multiIndices;
│ │ │ │ +
256 }
│ │ │ │ +
│ │ │ │ +
257
│ │ │ │ + │ │ │ │ +
259
│ │ │ │ + │ │ │ │ + │ │ │ │ +
262};
│ │ │ │ +
│ │ │ │ +
263
│ │ │ │ +
264
│ │ │ │ +
265
│ │ │ │ +
266template<typename GV>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
268 public PowerBasisNode<LagrangeNode<GV,2>, GV::dimension>
│ │ │ │ +
269{
│ │ │ │ + │ │ │ │ + │ │ │ │ +
272
│ │ │ │ +
273public:
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
275 {
│ │ │ │ +
276 for(int i=0; i<GV::dimension; ++i)
│ │ │ │ +
277 this->setChild(i, std::make_shared<PQ2Node>());
│ │ │ │ +
278 }
│ │ │ │ +
│ │ │ │ +
279};
│ │ │ │ +
│ │ │ │ +
280
│ │ │ │ +
281template<typename GV>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
283 public CompositeBasisNode<
│ │ │ │ +
284 TaylorHoodVelocityTree<GV>,
│ │ │ │ +
285 LagrangeNode<GV,1>
│ │ │ │ +
286 >
│ │ │ │ +
287{
│ │ │ │ + │ │ │ │ + │ │ │ │ +
290
│ │ │ │ + │ │ │ │ +
292
│ │ │ │ +
293public:
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
295 {
│ │ │ │ +
296 this->template setChild<0>(std::make_shared<VelocityNode>());
│ │ │ │ +
297 this->template setChild<1>(std::make_shared<PressureNode>());
│ │ │ │ +
298 }
│ │ │ │ +
│ │ │ │ +
299};
│ │ │ │ +
│ │ │ │ +
300
│ │ │ │ +
301
│ │ │ │ +
302
│ │ │ │ +
303namespace BasisFactory {
│ │ │ │ +
304
│ │ │ │ +
│ │ │ │ +
311inline auto taylorHood()
│ │ │ │ +
312{
│ │ │ │ +
313 return [](const auto& gridView) {
│ │ │ │ +
314 return TaylorHoodPreBasis<std::decay_t<decltype(gridView)>>(gridView);
│ │ │ │ +
315 };
│ │ │ │ +
316}
│ │ │ │ +
│ │ │ │ +
317
│ │ │ │ +
318} // end namespace BasisFactory
│ │ │ │ +
319
│ │ │ │ +
320// *****************************************************************************
│ │ │ │ +
321// This is the actual global basis implementation based on the reusable parts.
│ │ │ │ +
322// *****************************************************************************
│ │ │ │ +
323
│ │ │ │ +
345template<typename GV>
│ │ │ │ + │ │ │ │ +
347
│ │ │ │ +
348
│ │ │ │ +
349
│ │ │ │ +
350} // end namespace Functions
│ │ │ │ +
351} // end namespace Dune
│ │ │ │ +
352
│ │ │ │ +
353
│ │ │ │ +
354#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
auto taylorHood()
Create a pre-basis factory that can create a Taylor-Hood pre-basis.
Definition taylorhoodbasis.hh:311
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ - │ │ │ │ +
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:46
│ │ │ │ +
Definition lagrangebasis.hh:387
│ │ │ │ + │ │ │ │ +
It indices(const Node &node, It it) const
Definition lagrangebasis.hh:192
│ │ │ │ +
void initializeIndices()
Initialize the global indices.
Definition lagrangebasis.hh:96
│ │ │ │ +
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition lagrangebasis.hh:126
│ │ │ │ +
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition lagrangebasis.hh:184
│ │ │ │ +
size_type size() const
Same as size(prefix) with empty prefix.
Definition lagrangebasis.hh:140
│ │ │ │ +
size_type size() const
Definition nodes.hh:142
│ │ │ │ +
Definition nodes.hh:193
│ │ │ │ + │ │ │ │ +
Definition taylorhoodbasis.hh:269
│ │ │ │ +
TaylorHoodVelocityTree()
Definition taylorhoodbasis.hh:274
│ │ │ │ +
Definition taylorhoodbasis.hh:287
│ │ │ │ +
TaylorHoodBasisTree()
Definition taylorhoodbasis.hh:294
│ │ │ │ +
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:258
│ │ │ │ +
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
│ │ │ │ +
PQ2PreBasis pq2PreBasis_
Definition taylorhoodbasis.hh:261
│ │ │ │ +
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:260
│ │ │ │ +
static const void multiIndexPushFront(MultiIndex &M, size_type M0)
Definition taylorhoodbasis.hh:202
│ │ │ │ +
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:212
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,75 +1,436 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -staticforloop.hh │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH │ │ │ │ │ 5 │ │ │ │ │ -6 │ │ │ │ │ -7#include │ │ │ │ │ -8 │ │ │ │ │ -9#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 <_d_u_n_e_/_f_u_n_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> │ │ │ │ │ -11 │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ +8#include │ │ │ │ │ +9 │ │ │ │ │ +10#include │ │ │ │ │ +11#include │ │ │ │ │ 12 │ │ │ │ │ -13namespace _D_u_n_e { │ │ │ │ │ -14namespace Functions { │ │ │ │ │ -15 │ │ │ │ │ -16namespace Imp { │ │ │ │ │ +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 │ │ │ │ │ +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 │ │ │ │ │ -18template │ │ │ │ │ -19struct StaticFindInRange │ │ │ │ │ -20{ │ │ │ │ │ -21 template │ │ │ │ │ -22 static void apply(F&& f, Args&&... args) │ │ │ │ │ -23 { │ │ │ │ │ -24 if (f(std::integral_constant(), std::forward(args)...)) │ │ │ │ │ -25 return; │ │ │ │ │ -26 StaticFindInRange::apply(std::forward(f), std:: │ │ │ │ │ -forward(args)...); │ │ │ │ │ -27 } │ │ │ │ │ -28}; │ │ │ │ │ -29 │ │ │ │ │ -30template │ │ │ │ │ -31struct StaticFindInRange │ │ │ │ │ -32{ │ │ │ │ │ -33 template │ │ │ │ │ -34 static void apply(F&& f, Args&&...) │ │ │ │ │ -35 {} │ │ │ │ │ -36}; │ │ │ │ │ -37 │ │ │ │ │ -38} //end namespace Imp │ │ │ │ │ +18namespace _D_u_n_e { │ │ │ │ │ +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 │ │ │ │ │ +35class TaylorHoodVelocityTree; │ │ │ │ │ +36 │ │ │ │ │ +37template │ │ │ │ │ +38class TaylorHoodBasisTree; │ │ │ │ │ 39 │ │ │ │ │ -40 │ │ │ │ │ -41 │ │ │ │ │ -55template │ │ │ │ │ -_5_6void _s_t_a_t_i_c_F_i_n_d_I_n_R_a_n_g_e(F&& f, Args&&... args) │ │ │ │ │ -57{ │ │ │ │ │ -58 Imp::StaticFindInRange::apply(std::forward │ │ │ │ │ -(f), std::forward(args)...); │ │ │ │ │ -59} │ │ │ │ │ -60 │ │ │ │ │ -61 │ │ │ │ │ -62} // namespace Dune::Functions │ │ │ │ │ -63} // namespace Dune │ │ │ │ │ -64 │ │ │ │ │ +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 │ │ │ │ │ -67#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:56 │ │ │ │ │ +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 _P_Q_1_P_r_e_B_a_s_i_s = _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s_<_G_V_,_1_>; │ │ │ │ │ +84 using _P_Q_2_P_r_e_B_a_s_i_s = _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__._i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s(); │ │ │ │ │ +99 _p_q_2_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(); │ │ │ │ │ +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__._u_p_d_a_t_e(gv); │ │ │ │ │ +112 _p_q_2_P_r_e_B_a_s_i_s__._u_p_d_a_t_e(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::type = 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::type = 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__._s_i_z_e() + _p_q_1_P_r_e_B_a_s_i_s__._s_i_z_e(); │ │ │ │ │ +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__._m_a_x_N_o_d_e_S_i_z_e() + _p_q_1_P_r_e_B_a_s_i_s__._m_a_x_N_o_d_e_S_i_z_e(); │ │ │ │ │ +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 indicesImp(node, it); │ │ │ │ │ +197 } │ │ │ │ │ +198 │ │ │ │ │ +199protected: │ │ │ │ │ +200 │ │ │ │ │ +201 template │ │ │ │ │ +_2_0_2 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) │ │ │ │ │ +203 { │ │ │ │ │ +204 M.resize(M.size()+1); │ │ │ │ │ +205 for(std::size_t i=M.size()-1; i>0; --i) │ │ │ │ │ +206 M[i] = M[i-1]; │ │ │ │ │ +207 M[0] = M0; │ │ │ │ │ +208 } │ │ │ │ │ +209 │ │ │ │ │ +210 template::type = 0> │ │ │ │ │ +_2_1_2 It _i_n_d_i_c_e_s_I_m_p(const _N_o_d_e& node, It multiIndices) const │ │ │ │ │ +213 { │ │ │ │ │ +214 using namespace Dune::Indices; │ │ │ │ │ +215 for(std::size_t child=0; child::type = 0> │ │ │ │ │ +_2_3_6 It _i_n_d_i_c_e_s_I_m_p(const _N_o_d_e& node, It multiIndices) const │ │ │ │ │ +237 { │ │ │ │ │ +238 using namespace Dune::Indices; │ │ │ │ │ +239 for(std::size_t child=0; child │ │ │ │ │ +_2_6_7class _T_a_y_l_o_r_H_o_o_d_V_e_l_o_c_i_t_y_T_r_e_e : │ │ │ │ │ +268 public _P_o_w_e_r_B_a_s_i_s_N_o_d_e, GV::dimension> │ │ │ │ │ +269{ │ │ │ │ │ +270 using _P_Q_2_N_o_d_e = _L_a_g_r_a_n_g_e_N_o_d_e_<_G_V_,_2_>; │ │ │ │ │ +271 using _B_a_s_e = _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_>; │ │ │ │ │ +272 │ │ │ │ │ +273public: │ │ │ │ │ +_2_7_4 _T_a_y_l_o_r_H_o_o_d_V_e_l_o_c_i_t_y_T_r_e_e() │ │ │ │ │ +275 { │ │ │ │ │ +276 for(int i=0; isetChild(i, std::make_shared()); │ │ │ │ │ +278 } │ │ │ │ │ +279}; │ │ │ │ │ +280 │ │ │ │ │ +281template │ │ │ │ │ +_2_8_2class _T_a_y_l_o_r_H_o_o_d_B_a_s_i_s_T_r_e_e : │ │ │ │ │ +283 public _C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e< │ │ │ │ │ +284 TaylorHoodVelocityTree, │ │ │ │ │ +285 LagrangeNode │ │ │ │ │ +286 > │ │ │ │ │ +287{ │ │ │ │ │ +288 using _V_e_l_o_c_i_t_y_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_>; │ │ │ │ │ +289 using _P_r_e_s_s_u_r_e_N_o_d_e=_L_a_g_r_a_n_g_e_N_o_d_e_<_G_V_,_1_>; │ │ │ │ │ +290 │ │ │ │ │ +291 using _B_a_s_e=_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_>; │ │ │ │ │ +292 │ │ │ │ │ +293public: │ │ │ │ │ +_2_9_4 _T_a_y_l_o_r_H_o_o_d_B_a_s_i_s_T_r_e_e() │ │ │ │ │ +295 { │ │ │ │ │ +296 this->template setChild<0>(std::make_shared()); │ │ │ │ │ +297 this->template setChild<1>(std::make_shared()); │ │ │ │ │ +298 } │ │ │ │ │ +299}; │ │ │ │ │ +300 │ │ │ │ │ +301 │ │ │ │ │ +302 │ │ │ │ │ +303namespace BasisFactory { │ │ │ │ │ +304 │ │ │ │ │ +_3_1_1inline auto _t_a_y_l_o_r_H_o_o_d() │ │ │ │ │ +312{ │ │ │ │ │ +313 return [](const auto& gridView) { │ │ │ │ │ +314 return _T_a_y_l_o_r_H_o_o_d_P_r_e_B_a_s_i_s>(gridView); │ │ │ │ │ +315 }; │ │ │ │ │ +316} │ │ │ │ │ +317 │ │ │ │ │ +318} // end namespace BasisFactory │ │ │ │ │ +319 │ │ │ │ │ +320/ │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +321// This is the actual global basis implementation based on the reusable │ │ │ │ │ +parts. │ │ │ │ │ +322/ │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +323 │ │ │ │ │ +345template │ │ │ │ │ +_3_4_6using _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_> >; │ │ │ │ │ +347 │ │ │ │ │ +348 │ │ │ │ │ +349 │ │ │ │ │ +350} // end namespace Functions │ │ │ │ │ +351} // end namespace Dune │ │ │ │ │ +352 │ │ │ │ │ +353 │ │ │ │ │ +354#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH │ │ │ │ │ +_l_a_g_r_a_n_g_e_b_a_s_i_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 │ │ │ │ │ +_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:311 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ │ +Global basis for given pre-basis. │ │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:46 │ │ │ │ │ +_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:387 │ │ │ │ │ +_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_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:192 │ │ │ │ │ +_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:96 │ │ │ │ │ +_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: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_:_:_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: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_:_:_s_i_z_e │ │ │ │ │ +size_type size() const │ │ │ │ │ +Same as size(prefix) with empty prefix. │ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:140 │ │ │ │ │ +_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 │ │ │ │ │ +DDeeffiinniittiioonn nodes.hh:142 │ │ │ │ │ +_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:193 │ │ │ │ │ +_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:219 │ │ │ │ │ +_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:269 │ │ │ │ │ +_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:274 │ │ │ │ │ +_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:287 │ │ │ │ │ +_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:294 │ │ │ │ │ +_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:258 │ │ │ │ │ +_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_:_:_p_q_2_P_r_e_B_a_s_i_s__ │ │ │ │ │ +PQ2PreBasis pq2PreBasis_ │ │ │ │ │ +DDeeffiinniittiioonn taylorhoodbasis.hh:261 │ │ │ │ │ +_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:260 │ │ │ │ │ +_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:202 │ │ │ │ │ +_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:212 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00104.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: reserveddeque.hh File Reference │ │ │ │ +dune-functions: lagrangebasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,75 +65,71 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces | │ │ │ │ -Macros
│ │ │ │ -
reserveddeque.hh File Reference
│ │ │ │ +Typedefs | │ │ │ │ +Functions
│ │ │ │ +
lagrangebasis.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 <type_traits>
│ │ │ │ +#include <dune/common/exceptions.hh>
│ │ │ │ +#include <dune/localfunctions/lagrange.hh>
│ │ │ │ +#include <dune/localfunctions/lagrange/equidistantpoints.hh>
│ │ │ │ +#include <dune/localfunctions/lagrange/pqkfactory.hh>
│ │ │ │ +#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ │ +#include <dune/functions/functionspacebases/defaultglobalbasis.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::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.
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ -Macros

#define CHECKSIZE(X)   {}
 

│ │ │ │ +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.
 
│ │ │ │ -

Detailed Description

│ │ │ │ -

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

│ │ │ │ -

Macro Definition Documentation

│ │ │ │ - │ │ │ │ -

◆ CHECKSIZE

│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
#define CHECKSIZE( X)   {}
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,37 +1,48 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _M_a_c_r_o_s │ │ │ │ │ -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 │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +lagrangebasis.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> │ │ │ │ │ _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_:_:_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 │ │ │ │ │   │ │ │ │ │ -MMaaccrrooss │ │ │ │ │ -#define  _C_H_E_C_K_S_I_Z_E(X)   {} │ │ │ │ │ +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< │ │ │ │ │ + GV, k, R > > │ │ │ │ │ +  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. │ │ │ │ │   │ │ │ │ │ -********** DDeettaaiilleedd DDeessccrriippttiioonn ********** │ │ │ │ │ -An stl-compliant double-ended queue which stores everything on the stack. │ │ │ │ │ -********** MMaaccrroo DDeeffiinniittiioonn DDooccuummeennttaattiioonn ********** │ │ │ │ │ -********** _?◆_? CCHHEECCKKSSIIZZEE ********** │ │ │ │ │ -#define CHECKSIZE (   X )    {} │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00104_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: reserveddeque.hh Source File │ │ │ │ +dune-functions: lagrangebasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,281 +70,611 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
reserveddeque.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#ifndef DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH
│ │ │ │
5
│ │ │ │ -
10#include <algorithm>
│ │ │ │ -
11#include <iostream>
│ │ │ │ -
12#include <cstddef>
│ │ │ │ -
13#include <initializer_list>
│ │ │ │ -
14
│ │ │ │ -
15#include <dune/common/genericiterator.hh>
│ │ │ │ +
6#include <type_traits>
│ │ │ │ +
7#include <dune/common/exceptions.hh>
│ │ │ │ +
8
│ │ │ │ +
9#include <dune/localfunctions/lagrange.hh>
│ │ │ │ +
10#include <dune/localfunctions/lagrange/equidistantpoints.hh>
│ │ │ │ +
11#include <dune/localfunctions/lagrange/pqkfactory.hh>
│ │ │ │ +
12
│ │ │ │ + │ │ │ │ + │ │ │ │ +
15
│ │ │ │
16
│ │ │ │ -
17#ifdef CHECK_RESERVEDDEQUE
│ │ │ │ -
18#define CHECKSIZE(X) assert(X)
│ │ │ │ -
19#else
│ │ │ │ -
20#define CHECKSIZE(X) {}
│ │ │ │ -
21#endif
│ │ │ │ -
22
│ │ │ │ -
23namespace Dune {
│ │ │ │ -
24namespace Functions {
│ │ │ │ -
25
│ │ │ │ -
43 template<class T, int n>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
45 {
│ │ │ │ -
46 public:
│ │ │ │ -
47
│ │ │ │ -
51 typedef T value_type;
│ │ │ │ -
53 typedef T* pointer;
│ │ │ │ -
55 typedef T& reference;
│ │ │ │ -
57 typedef const T& const_reference;
│ │ │ │ -
59 typedef size_t size_type;
│ │ │ │ -
61 typedef std::ptrdiff_t difference_type;
│ │ │ │ -
63 typedef Dune::GenericIterator<ReservedDeque, value_type> iterator;
│ │ │ │ -
65 typedef Dune::GenericIterator<const ReservedDeque, const value_type> const_iterator;
│ │ │ │ +
17namespace Dune {
│ │ │ │ +
18namespace Functions {
│ │ │ │ +
19
│ │ │ │ +
20// *****************************************************************************
│ │ │ │ +
21// This is the reusable part of the LagrangeBasis. It contains
│ │ │ │ +
22//
│ │ │ │ +
23// LagrangePreBasis
│ │ │ │ +
24// LagrangeNode
│ │ │ │ +
25//
│ │ │ │ +
26// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ │ +
27// state. These components do _not_ depend on the global basis and local view
│ │ │ │ +
28// and can be used without a global basis.
│ │ │ │ +
29// *****************************************************************************
│ │ │ │ +
30
│ │ │ │ +
31template<typename GV, int k, typename R=double>
│ │ │ │ +
32class LagrangeNode;
│ │ │ │ +
33
│ │ │ │ +
34template<typename GV, int k, typename R=double>
│ │ │ │ +
35class LagrangePreBasis;
│ │ │ │ +
36
│ │ │ │ +
37
│ │ │ │ +
38
│ │ │ │ +
53template<typename GV, int k, typename R>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
55{
│ │ │ │ +
56 static const int dim = GV::dimension;
│ │ │ │ +
57 static const bool useDynamicOrder = (k<0);
│ │ │ │ +
58
│ │ │ │ +
59public:
│ │ │ │ +
60
│ │ │ │ +
62 using GridView = GV;
│ │ │ │ +
63
│ │ │ │ +
65 using size_type = std::size_t;
│ │ │ │
66
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
73 size_(0),
│ │ │ │ -
74 first_(0)
│ │ │ │ -
75 {}
│ │ │ │ -
│ │ │ │ -
76
│ │ │ │ -
│ │ │ │ -
77 ReservedDeque(std::initializer_list<T> const &l)
│ │ │ │ -
78 {
│ │ │ │ -
79 assert(l.size() <= n);// Actually, this is not needed any more!
│ │ │ │ -
80 size_ = l.size();
│ │ │ │ -
81 std::copy_n(l.begin(), size_, data_);
│ │ │ │ -
82 }
│ │ │ │ -
│ │ │ │ -
83
│ │ │ │ -
│ │ │ │ -
89 void clear()
│ │ │ │ -
90 {
│ │ │ │ -
91 first_ = 0;
│ │ │ │ -
92 size_ = 0;
│ │ │ │ -
93 }
│ │ │ │ + │ │ │ │ +
69
│ │ │ │ +
70 static constexpr size_type maxMultiIndexSize = 1;
│ │ │ │ +
71 static constexpr size_type minMultiIndexSize = 1;
│ │ │ │ +
72 static constexpr size_type multiIndexBufferSize = 1;
│ │ │ │ +
73
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
76 : LagrangePreBasis(gv, std::numeric_limits<unsigned int>::max())
│ │ │ │ +
77 {}
│ │ │ │ +
│ │ │ │ +
78
│ │ │ │ +
│ │ │ │ +
80 LagrangePreBasis(const GridView& gv, unsigned int order) :
│ │ │ │ + │ │ │ │ +
82 {
│ │ │ │ +
83 if (!useDynamicOrder && order!=std::numeric_limits<unsigned int>::max())
│ │ │ │ +
84 DUNE_THROW(RangeError, "Template argument k has to be -1 when supplying a run-time order!");
│ │ │ │ +
85
│ │ │ │ +
86 for (int i=0; i<=dim; i++)
│ │ │ │ +
87 {
│ │ │ │ + │ │ │ │ + │ │ │ │ +
90 }
│ │ │ │ + │ │ │ │ + │ │ │ │ +
93 }
│ │ │ │
│ │ │ │
94
│ │ │ │
│ │ │ │ -
96 void resize(size_t s)
│ │ │ │ -
97 {
│ │ │ │ -
98 CHECKSIZE(s<=n);
│ │ │ │ -
99 size_ = s;
│ │ │ │ -
100 }
│ │ │ │ -
│ │ │ │ -
101
│ │ │ │ -
│ │ │ │ -
103 void push_back(const T& t)
│ │ │ │ -
104 {
│ │ │ │ -
105 CHECKSIZE(size_<n);
│ │ │ │ -
106 data_[size_++ % n] = t;
│ │ │ │ -
107 }
│ │ │ │ -
│ │ │ │ -
108
│ │ │ │ -
│ │ │ │ -
110 void push_front(const T& t)
│ │ │ │ -
111 {
│ │ │ │ -
112 CHECKSIZE(size_<n);
│ │ │ │ -
113 ++size_;
│ │ │ │ -
114 first_ = (first_+(n-1)) % n;
│ │ │ │ -
115 data_[first_] = t;
│ │ │ │ + │ │ │ │ +
97 {
│ │ │ │ +
98 vertexOffset_ = 0;
│ │ │ │ + │ │ │ │ +
100
│ │ │ │ +
101 if (dim>=2)
│ │ │ │ +
102 {
│ │ │ │ + │ │ │ │ +
104
│ │ │ │ +
105 quadrilateralOffset_ = triangleOffset_ + dofsPerSimplex(2) * ((size_type)gridView_.size(Dune::GeometryTypes::triangle));
│ │ │ │ +
106 }
│ │ │ │ +
107
│ │ │ │ +
108 if (dim==3) {
│ │ │ │ +
109 tetrahedronOffset_ = quadrilateralOffset_ + dofsPerCube(2) * ((size_type)gridView_.size(Dune::GeometryTypes::quadrilateral));
│ │ │ │ +
110
│ │ │ │ +
111 prismOffset_ = tetrahedronOffset_ + dofsPerSimplex(3) * ((size_type)gridView_.size(Dune::GeometryTypes::tetrahedron));
│ │ │ │ +
112
│ │ │ │ +
113 hexahedronOffset_ = prismOffset_ + dofsPerPrism() * ((size_type)gridView_.size(Dune::GeometryTypes::prism));
│ │ │ │ +
114
│ │ │ │ +
115 pyramidOffset_ = hexahedronOffset_ + dofsPerCube(3) * ((size_type)gridView_.size(Dune::GeometryTypes::hexahedron));
│ │ │ │
116 }
│ │ │ │ +
117 }
│ │ │ │
│ │ │ │ -
117
│ │ │ │ -
│ │ │ │ -
119 void pop_back()
│ │ │ │ -
120 {
│ │ │ │ -
121 if (! empty())
│ │ │ │ -
122 size_--;
│ │ │ │ -
123 }
│ │ │ │ +
118
│ │ │ │ +
│ │ │ │ +
120 const GridView& gridView() const
│ │ │ │ +
121 {
│ │ │ │ +
122 return gridView_;
│ │ │ │ +
123 }
│ │ │ │
│ │ │ │
124
│ │ │ │
│ │ │ │ - │ │ │ │ -
127 {
│ │ │ │ -
128 if (! empty())
│ │ │ │ -
129 {
│ │ │ │ -
130 size_--;
│ │ │ │ -
131 first_ = (++first_) % n;
│ │ │ │ -
132 }
│ │ │ │ -
133 }
│ │ │ │ -
│ │ │ │ -
134
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
137 return iterator(*this, 0);
│ │ │ │ -
138 }
│ │ │ │ -
│ │ │ │ -
139
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
142 return const_iterator(*this, 0);
│ │ │ │ -
143 }
│ │ │ │ -
│ │ │ │ -
144
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
147 return iterator(*this, size_);
│ │ │ │ -
148 }
│ │ │ │ -
│ │ │ │ -
149
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
152 return const_iterator(*this, size_);
│ │ │ │ -
153 }
│ │ │ │ -
│ │ │ │ -
154
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
157 {
│ │ │ │ -
158 CHECKSIZE(size_>i);
│ │ │ │ -
159 return data_[(first_ + i) % n];
│ │ │ │ -
160 }
│ │ │ │ -
│ │ │ │ -
161
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
164 {
│ │ │ │ -
165 CHECKSIZE(size_>i);
│ │ │ │ -
166 return data_[(first_ + i) % n];
│ │ │ │ -
167 }
│ │ │ │ +
126 void update (const GridView& gv)
│ │ │ │ +
127 {
│ │ │ │ +
128 gridView_ = gv;
│ │ │ │ +
129 }
│ │ │ │ +
│ │ │ │ +
130
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
135 {
│ │ │ │ +
136 return Node{order_};
│ │ │ │ +
137 }
│ │ │ │ +
│ │ │ │ +
138
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
141 {
│ │ │ │ +
142 switch (dim)
│ │ │ │ +
143 {
│ │ │ │ +
144 case 1:
│ │ │ │ +
145 return dofsPerCube(0) * ((size_type)gridView_.size(dim))
│ │ │ │ +
146 + dofsPerCube(1) * ((size_type)gridView_.size(dim-1));
│ │ │ │ +
147 case 2:
│ │ │ │ +
148 {
│ │ │ │ +
149 return dofsPerCube(0) * ((size_type)gridView_.size(dim))
│ │ │ │ +
150 + dofsPerCube(1) * ((size_type)gridView_.size(dim-1))
│ │ │ │ +
151 + dofsPerSimplex(2) * ((size_type)gridView_.size(Dune::GeometryTypes::triangle))
│ │ │ │ +
152 + dofsPerCube(2) * ((size_type)gridView_.size(Dune::GeometryTypes::quadrilateral));
│ │ │ │ +
153 }
│ │ │ │ +
154 case 3:
│ │ │ │ +
155 {
│ │ │ │ +
156 return dofsPerCube(0) * ((size_type)gridView_.size(dim))
│ │ │ │ +
157 + dofsPerCube(1) * ((size_type)gridView_.size(dim-1))
│ │ │ │ +
158 + dofsPerSimplex(2) * ((size_type)gridView_.size(Dune::GeometryTypes::triangle))
│ │ │ │ +
159 + dofsPerCube(2) * ((size_type)gridView_.size(Dune::GeometryTypes::quadrilateral))
│ │ │ │ +
160 + dofsPerSimplex(3) * ((size_type)gridView_.size(Dune::GeometryTypes::tetrahedron))
│ │ │ │ +
161 + dofsPerPyramid() * ((size_type)gridView_.size(Dune::GeometryTypes::pyramid))
│ │ │ │ +
162 + dofsPerPrism() * ((size_type)gridView_.size(Dune::GeometryTypes::prism))
│ │ │ │ +
163 + dofsPerCube(3) * ((size_type)gridView_.size(Dune::GeometryTypes::hexahedron));
│ │ │ │ +
164 }
│ │ │ │ +
165 }
│ │ │ │ +
166 DUNE_THROW(Dune::NotImplemented, "No size method for " << dim << "d grids available yet!");
│ │ │ │ +
167 }
│ │ │ │
│ │ │ │
168
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
171 {
│ │ │ │ -
172 CHECKSIZE(size_>0);
│ │ │ │ -
173 return data_[first_];
│ │ │ │ -
174 }
│ │ │ │ -
│ │ │ │ -
175
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
178 {
│ │ │ │ -
179 CHECKSIZE(size_>0);
│ │ │ │ -
180 return data_[first_];
│ │ │ │ -
181 }
│ │ │ │ +
170 template<class SizePrefix>
│ │ │ │ +
│ │ │ │ +
171 size_type size(const SizePrefix& prefix) const
│ │ │ │ +
172 {
│ │ │ │ +
173 assert(prefix.size() == 0 || prefix.size() == 1);
│ │ │ │ +
174 return (prefix.size() == 0) ? size() : 0;
│ │ │ │ +
175 }
│ │ │ │ +
│ │ │ │ +
176
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
179 {
│ │ │ │ +
180 return size();
│ │ │ │ +
181 }
│ │ │ │
│ │ │ │
182
│ │ │ │
│ │ │ │ - │ │ │ │ -
185 {
│ │ │ │ -
186 CHECKSIZE(size_>0);
│ │ │ │ -
187 return data_[(first_ + size_-1) % n];
│ │ │ │ -
188 }
│ │ │ │ -
│ │ │ │ -
189
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
192 {
│ │ │ │ -
193 CHECKSIZE(size_>0);
│ │ │ │ -
194 return data_[(first_ + size_-1) % n];
│ │ │ │ -
195 }
│ │ │ │ -
│ │ │ │ -
196
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
203 {
│ │ │ │ -
204 return size_;
│ │ │ │ -
205 }
│ │ │ │ -
│ │ │ │ -
206
│ │ │ │ -
│ │ │ │ -
208 bool empty() const
│ │ │ │ -
209 {
│ │ │ │ -
210 return size_==0;
│ │ │ │ -
211 }
│ │ │ │ -
│ │ │ │ + │ │ │ │ +
185 {
│ │ │ │ +
186 // That cast to unsigned int is necessary because GV::dimension is an enum,
│ │ │ │ +
187 // which is not recognized by the power method as an integer type...
│ │ │ │ +
188 return power(order()+1, (unsigned int)GV::dimension);
│ │ │ │ +
189 }
│ │ │ │ +
│ │ │ │ +
190
│ │ │ │ +
191 template<typename It>
│ │ │ │ +
│ │ │ │ +
192 It indices(const Node& node, It it) const
│ │ │ │ +
193 {
│ │ │ │ +
194 for (size_type i = 0, end = node.finiteElement().size() ; i < end ; ++it, ++i)
│ │ │ │ +
195 {
│ │ │ │ +
196 Dune::LocalKey localKey = node.finiteElement().localCoefficients().localKey(i);
│ │ │ │ +
197 const auto& gridIndexSet = gridView().indexSet();
│ │ │ │ +
198 const auto& element = node.element();
│ │ │ │ +
199
│ │ │ │ +
200 // The dimension of the entity that the current dof is related to
│ │ │ │ +
201 auto dofDim = dim - localKey.codim();
│ │ │ │ +
202
│ │ │ │ +
203 // Test for a vertex dof
│ │ │ │ +
204 // The test for k==1 is redundant, but having it here allows the compiler to conclude
│ │ │ │ +
205 // at compile-time that the dofDim==0 case is the only one that will ever happen.
│ │ │ │ +
206 // This leads to measurable speed-up: see
│ │ │ │ +
207 // https://gitlab.dune-project.org/staging/dune-functions/issues/30
│ │ │ │ +
208 if (k==1 || dofDim==0) {
│ │ │ │ +
209 *it = {{ (size_type)(gridIndexSet.subIndex(element,localKey.subEntity(),dim)) }};
│ │ │ │ +
210 continue;
│ │ │ │ +
211 }
│ │ │ │
212
│ │ │ │ -
│ │ │ │ -
214 static constexpr size_type capacity()
│ │ │ │ -
215 {
│ │ │ │ -
216 return n;
│ │ │ │ -
217 }
│ │ │ │ -
│ │ │ │ -
218
│ │ │ │ -
│ │ │ │ -
220 static constexpr size_type max_size()
│ │ │ │ -
221 {
│ │ │ │ -
222 return n;
│ │ │ │ -
223 }
│ │ │ │ -
│ │ │ │ -
224
│ │ │ │ -
│ │ │ │ -
228 friend std::ostream& operator<< (std::ostream& s, const ReservedDeque& v)
│ │ │ │ -
229 {
│ │ │ │ -
230 for (size_t i=0; i<v.size(); i++)
│ │ │ │ -
231 s << v[i] << " ";
│ │ │ │ -
232 return s;
│ │ │ │ -
233 }
│ │ │ │ -
│ │ │ │ -
234
│ │ │ │ -
235 private:
│ │ │ │ -
236 T data_[n];
│ │ │ │ -
237 size_type first_;
│ │ │ │ -
238 size_type size_;
│ │ │ │ -
239 };
│ │ │ │ -
│ │ │ │ -
240
│ │ │ │ -
241} // end namespace Functions
│ │ │ │ -
242} // end namespace Dune
│ │ │ │ -
243
│ │ │ │ -
244#undef CHECKSIZE
│ │ │ │ -
245
│ │ │ │ -
246#endif // DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH
│ │ │ │ -
#define CHECKSIZE(X)
Definition reserveddeque.hh:20
│ │ │ │ +
213 if (dofDim==1)
│ │ │ │ +
214 { // edge dof
│ │ │ │ +
215 if (dim==1) // element dof -- any local numbering is fine
│ │ │ │ +
216 {
│ │ │ │ +
217 *it = {{ edgeOffset_
│ │ │ │ +
218 + dofsPerCube(1) * ((size_type)gridIndexSet.subIndex(element,0,0))
│ │ │ │ +
219 + localKey.index() }};
│ │ │ │ +
220 continue;
│ │ │ │ +
221 }
│ │ │ │ +
222 else
│ │ │ │ +
223 {
│ │ │ │ +
224 const auto refElement
│ │ │ │ +
225 = Dune::referenceElement<double,dim>(element.type());
│ │ │ │ +
226
│ │ │ │ +
227 // We have to reverse the numbering if the local element edge is
│ │ │ │ +
228 // not aligned with the global edge.
│ │ │ │ +
229 auto v0 = (size_type)gridIndexSet.subIndex(element,refElement.subEntity(localKey.subEntity(),localKey.codim(),0,dim),dim);
│ │ │ │ +
230 auto v1 = (size_type)gridIndexSet.subIndex(element,refElement.subEntity(localKey.subEntity(),localKey.codim(),1,dim),dim);
│ │ │ │ +
231 bool flip = (v0 > v1);
│ │ │ │ +
232 *it = {{ (flip)
│ │ │ │ + │ │ │ │ +
234 + dofsPerCube(1)*((size_type)gridIndexSet.subIndex(element,localKey.subEntity(),localKey.codim()))
│ │ │ │ +
235 + (dofsPerCube(1)-1)-localKey.index()
│ │ │ │ + │ │ │ │ +
237 + dofsPerCube(1)*((size_type)gridIndexSet.subIndex(element,localKey.subEntity(),localKey.codim()))
│ │ │ │ +
238 + localKey.index() }};
│ │ │ │ +
239 continue;
│ │ │ │ +
240 }
│ │ │ │ +
241 }
│ │ │ │ +
242
│ │ │ │ +
243 if (dofDim==2)
│ │ │ │ +
244 {
│ │ │ │ +
245 if (dim==2) // element dof -- any local numbering is fine
│ │ │ │ +
246 {
│ │ │ │ +
247 if (element.type().isTriangle())
│ │ │ │ +
248 {
│ │ │ │ +
249 *it = {{ triangleOffset_ + dofsPerSimplex(2)*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
│ │ │ │ +
250 continue;
│ │ │ │ +
251 }
│ │ │ │ +
252 else if (element.type().isQuadrilateral())
│ │ │ │ +
253 {
│ │ │ │ +
254 *it = {{ quadrilateralOffset_ + dofsPerCube(2)*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
│ │ │ │ +
255 continue;
│ │ │ │ +
256 }
│ │ │ │ +
257 else
│ │ │ │ +
258 DUNE_THROW(Dune::NotImplemented, "2d elements have to be triangles or quadrilaterals");
│ │ │ │ +
259 } else
│ │ │ │ +
260 {
│ │ │ │ +
261 const auto refElement
│ │ │ │ +
262 = Dune::referenceElement<double,dim>(element.type());
│ │ │ │ +
263
│ │ │ │ +
264 if (order()>3)
│ │ │ │ +
265 DUNE_THROW(Dune::NotImplemented, "LagrangeBasis for 3D grids is only implemented if k<=3");
│ │ │ │ +
266
│ │ │ │ +
267 if (order()==3 and !refElement.type(localKey.subEntity(), localKey.codim()).isTriangle())
│ │ │ │ +
268 DUNE_THROW(Dune::NotImplemented, "LagrangeBasis for 3D grids with k==3 is only implemented if the grid is a simplex grid");
│ │ │ │ +
269
│ │ │ │ +
270 *it = {{ triangleOffset_ + ((size_type)gridIndexSet.subIndex(element,localKey.subEntity(),localKey.codim())) }};
│ │ │ │ +
271 continue;
│ │ │ │ +
272 }
│ │ │ │ +
273 }
│ │ │ │ +
274
│ │ │ │ +
275 if (dofDim==3)
│ │ │ │ +
276 {
│ │ │ │ +
277 if (dim==3) // element dof -- any local numbering is fine
│ │ │ │ +
278 {
│ │ │ │ +
279 if (element.type().isTetrahedron())
│ │ │ │ +
280 {
│ │ │ │ +
281 *it = {{ tetrahedronOffset_ + dofsPerSimplex(3)*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
│ │ │ │ +
282 continue;
│ │ │ │ +
283 }
│ │ │ │ +
284 else if (element.type().isHexahedron())
│ │ │ │ +
285 {
│ │ │ │ +
286 *it = {{ hexahedronOffset_ + dofsPerCube(3)*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
│ │ │ │ +
287 continue;
│ │ │ │ +
288 }
│ │ │ │ +
289 else if (element.type().isPrism())
│ │ │ │ +
290 {
│ │ │ │ +
291 *it = {{ prismOffset_ + dofsPerPrism()*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
│ │ │ │ +
292 continue;
│ │ │ │ +
293 }
│ │ │ │ +
294 else if (element.type().isPyramid())
│ │ │ │ +
295 {
│ │ │ │ +
296 *it = {{ pyramidOffset_ + dofsPerPyramid()*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
│ │ │ │ +
297 continue;
│ │ │ │ +
298 }
│ │ │ │ +
299 else
│ │ │ │ +
300 DUNE_THROW(Dune::NotImplemented, "3d elements have to be tetrahedra, hexahedra, prisms, or pyramids");
│ │ │ │ +
301 } else
│ │ │ │ +
302 DUNE_THROW(Dune::NotImplemented, "Grids of dimension larger than 3 are no supported");
│ │ │ │ +
303 }
│ │ │ │ +
304 DUNE_THROW(Dune::NotImplemented, "Grid contains elements not supported for the LagrangeBasis");
│ │ │ │ +
305 }
│ │ │ │ +
306 return it;
│ │ │ │ +
307 }
│ │ │ │ +
│ │ │ │ +
308
│ │ │ │ +
│ │ │ │ +
310 unsigned int order() const
│ │ │ │ +
311 {
│ │ │ │ +
312 return (useDynamicOrder) ? order_ : k;
│ │ │ │ +
313 }
│ │ │ │ +
│ │ │ │ +
314
│ │ │ │ +
315protected:
│ │ │ │ + │ │ │ │ +
317
│ │ │ │ +
318 // Run-time order, only valid if k<0
│ │ │ │ +
319 const unsigned int order_;
│ │ │ │ +
320
│ │ │ │ +
│ │ │ │ +
322 size_type dofsPerSimplex(std::size_t simplexDim) const
│ │ │ │ +
323 {
│ │ │ │ +
324 return useDynamicOrder ? dofsPerSimplex_[simplexDim] : computeDofsPerSimplex(simplexDim);
│ │ │ │ +
325 }
│ │ │ │ +
│ │ │ │ +
326
│ │ │ │ +
│ │ │ │ +
328 size_type dofsPerCube(std::size_t cubeDim) const
│ │ │ │ +
329 {
│ │ │ │ +
330 return useDynamicOrder ? dofsPerCube_[cubeDim] : computeDofsPerCube(cubeDim);
│ │ │ │ +
331 }
│ │ │ │ +
│ │ │ │ +
332
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
334 {
│ │ │ │ +
335 return useDynamicOrder ? dofsPerPrism_ : computeDofsPerPrism();
│ │ │ │ +
336 }
│ │ │ │ +
│ │ │ │ +
337
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
339 {
│ │ │ │ +
340 return useDynamicOrder ? dofsPerPyramid_ : computeDofsPerPyramid();
│ │ │ │ +
341 }
│ │ │ │ +
│ │ │ │ +
342
│ │ │ │ +
│ │ │ │ +
344 size_type computeDofsPerSimplex(std::size_t simplexDim) const
│ │ │ │ +
345 {
│ │ │ │ +
346 return order() == 0 ? (dim == simplexDim ? 1 : 0) : Dune::binomial(std::size_t(order()-1),simplexDim);
│ │ │ │ +
347 }
│ │ │ │ +
│ │ │ │ +
348
│ │ │ │ +
│ │ │ │ +
350 size_type computeDofsPerCube(std::size_t cubeDim) const
│ │ │ │ +
351 {
│ │ │ │ +
352 return order() == 0 ? (dim == cubeDim ? 1 : 0) : Dune::power(order()-1, cubeDim);
│ │ │ │ +
353 }
│ │ │ │ +
│ │ │ │ +
354
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
356 {
│ │ │ │ +
357 return order() == 0 ? (dim == 3 ? 1 : 0) : (order()-1)*(order()-1)*(order()-2)/2;
│ │ │ │ +
358 }
│ │ │ │ +
│ │ │ │ +
359
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
361 {
│ │ │ │ +
362 return order() == 0 ? (dim == 3 ? 1 : 0) : (order()-2)*(order()-1)*(2*order()-3)/6;
│ │ │ │ +
363 }
│ │ │ │ +
│ │ │ │ +
364
│ │ │ │ +
365 // When the order is given at run-time, the following numbers are pre-computed:
│ │ │ │ +
366 std::array<size_type,dim+1> dofsPerSimplex_;
│ │ │ │ +
367 std::array<size_type,dim+1> dofsPerCube_;
│ │ │ │ + │ │ │ │ + │ │ │ │ +
370
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
379
│ │ │ │ +
380};
│ │ │ │ +
│ │ │ │ +
381
│ │ │ │ +
382
│ │ │ │ +
383
│ │ │ │ +
384template<typename GV, int k, typename R>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
386 public LeafBasisNode
│ │ │ │ +
387{
│ │ │ │ +
388 // Stores LocalFiniteElement implementations with run-time order as a function of GeometryType
│ │ │ │ +
389 template<typename Domain, typename Range, int dim>
│ │ │ │ +
390 class LagrangeRunTimeLFECache
│ │ │ │ +
391 {
│ │ │ │ +
392 public:
│ │ │ │ +
393 using FiniteElementType = LagrangeLocalFiniteElement<EquidistantPointSet,dim,Domain,Range>;
│ │ │ │ +
394
│ │ │ │ +
395 const FiniteElementType& get(GeometryType type)
│ │ │ │ +
396 {
│ │ │ │ +
397 auto i = data_.find(type);
│ │ │ │ +
398 if (i==data_.end())
│ │ │ │ +
399 i = data_.emplace(type,FiniteElementType(type,order_)).first;
│ │ │ │ +
400 return (*i).second;
│ │ │ │ +
401 }
│ │ │ │ +
402
│ │ │ │ +
403 std::map<GeometryType, FiniteElementType> data_;
│ │ │ │ +
404 unsigned int order_;
│ │ │ │ +
405 };
│ │ │ │ +
406
│ │ │ │ +
407 static constexpr int dim = GV::dimension;
│ │ │ │ +
408 static constexpr bool useDynamicOrder = (k<0);
│ │ │ │ +
409
│ │ │ │ +
410 using FiniteElementCache = typename std::conditional<(useDynamicOrder),
│ │ │ │ +
411 LagrangeRunTimeLFECache<typename GV::ctype, R, dim>,
│ │ │ │ +
412 PQkLocalFiniteElementCache<typename GV::ctype, R, dim, k>
│ │ │ │ +
413 >::type;
│ │ │ │ +
414
│ │ │ │ +
415public:
│ │ │ │ +
416
│ │ │ │ +
417 using size_type = std::size_t;
│ │ │ │ +
418 using Element = typename GV::template Codim<0>::Entity;
│ │ │ │ +
419 using FiniteElement = typename FiniteElementCache::FiniteElementType;
│ │ │ │ +
420
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
423 finiteElement_(nullptr),
│ │ │ │ +
424 element_(nullptr)
│ │ │ │ +
425 {}
│ │ │ │ +
│ │ │ │ +
426
│ │ │ │ +
│ │ │ │ +
428 LagrangeNode(unsigned int order) :
│ │ │ │ +
429 order_(order),
│ │ │ │ +
430 finiteElement_(nullptr),
│ │ │ │ +
431 element_(nullptr)
│ │ │ │ +
432 {
│ │ │ │ +
433 // Only the cache for the run-time-order case (i.e., k<0), has the 'order_' member
│ │ │ │ +
434 if constexpr (useDynamicOrder)
│ │ │ │ +
435 cache_.order_ = order;
│ │ │ │ +
436 }
│ │ │ │ +
│ │ │ │ +
437
│ │ │ │ +
│ │ │ │ +
439 const Element& element() const
│ │ │ │ +
440 {
│ │ │ │ +
441 return *element_;
│ │ │ │ +
442 }
│ │ │ │ +
│ │ │ │ +
443
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
449 {
│ │ │ │ +
450 return *finiteElement_;
│ │ │ │ +
451 }
│ │ │ │ +
│ │ │ │ +
452
│ │ │ │ +
│ │ │ │ +
454 void bind(const Element& e)
│ │ │ │ +
455 {
│ │ │ │ +
456 element_ = &e;
│ │ │ │ +
457 finiteElement_ = &(cache_.get(element_->type()));
│ │ │ │ +
458 this->setSize(finiteElement_->size());
│ │ │ │ +
459 }
│ │ │ │ +
│ │ │ │ +
460
│ │ │ │ +
461protected:
│ │ │ │ +
462
│ │ │ │ +
│ │ │ │ +
463 unsigned int order() const
│ │ │ │ +
464 {
│ │ │ │ +
465 return (useDynamicOrder) ? order_ : k;
│ │ │ │ +
466 }
│ │ │ │ +
│ │ │ │ +
467
│ │ │ │ +
468 // Run-time order, only valid if k<0
│ │ │ │ +
469 unsigned int order_;
│ │ │ │ +
470
│ │ │ │ +
471 FiniteElementCache cache_;
│ │ │ │ + │ │ │ │ + │ │ │ │ +
474};
│ │ │ │ +
│ │ │ │ +
475
│ │ │ │ +
476
│ │ │ │ +
477
│ │ │ │ +
478namespace BasisFactory {
│ │ │ │ +
479
│ │ │ │ +
488template<std::size_t k, typename R=double>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
490{
│ │ │ │ +
491 return [](const auto& gridView) {
│ │ │ │ +
492 return LagrangePreBasis<std::decay_t<decltype(gridView)>, k, R>(gridView);
│ │ │ │ +
493 };
│ │ │ │ +
494}
│ │ │ │ +
│ │ │ │ +
495
│ │ │ │ +
503template<typename R=double>
│ │ │ │ +
│ │ │ │ +
504auto lagrange(int order)
│ │ │ │ +
505{
│ │ │ │ +
506 return [=](const auto& gridView) {
│ │ │ │ +
507 return LagrangePreBasis<std::decay_t<decltype(gridView)>, -1, R>(gridView, order);
│ │ │ │ +
508 };
│ │ │ │ +
509}
│ │ │ │ +
│ │ │ │ +
510
│ │ │ │ +
511} // end namespace BasisFactory
│ │ │ │ +
512
│ │ │ │ +
513
│ │ │ │ +
514
│ │ │ │ +
538template<typename GV, int k=-1, typename R=double>
│ │ │ │ + │ │ │ │ +
540
│ │ │ │ +
541
│ │ │ │ +
542
│ │ │ │ +
543
│ │ │ │ +
544
│ │ │ │ +
545} // end namespace Functions
│ │ │ │ +
546} // end namespace Dune
│ │ │ │ +
547
│ │ │ │ +
548
│ │ │ │ +
549#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ +
auto lagrange()
Create a pre-basis factory that can create a Lagrange pre-basis.
Definition lagrangebasis.hh:489
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
A double-ended queue (deque) class with statically reserved memory.
Definition reserveddeque.hh:45
│ │ │ │ -
void pop_front()
Erases the first element of the vector, O(1) time.
Definition reserveddeque.hh:126
│ │ │ │ -
static constexpr size_type capacity()
Returns current capacity (allocated memory) of the vector.
Definition reserveddeque.hh:214
│ │ │ │ -
void clear()
Erases all elements.
Definition reserveddeque.hh:89
│ │ │ │ -
Dune::GenericIterator< ReservedDeque, value_type > iterator
Iterator used to iterate through a vector.
Definition reserveddeque.hh:63
│ │ │ │ -
T value_type
The type of object, T, stored in the vector.
Definition reserveddeque.hh:51
│ │ │ │ -
ReservedDeque()
Constructor.
Definition reserveddeque.hh:72
│ │ │ │ -
bool empty() const
Returns true if vector has no elements.
Definition reserveddeque.hh:208
│ │ │ │ -
const_reference back() const
Returns const reference to last element of vector.
Definition reserveddeque.hh:191
│ │ │ │ -
friend std::ostream & operator<<(std::ostream &s, const ReservedDeque &v)
Send ReservedDeque to an output stream.
Definition reserveddeque.hh:228
│ │ │ │ -
void push_front(const T &t)
Prepends an element to the begin of a deque if size<capacity, O(1) time.
Definition reserveddeque.hh:110
│ │ │ │ -
reference operator[](size_type i)
Returns reference to the i'th element.
Definition reserveddeque.hh:156
│ │ │ │ -
reference front()
Returns reference to first element of vector.
Definition reserveddeque.hh:170
│ │ │ │ -
T * pointer
Pointer to T.
Definition reserveddeque.hh:53
│ │ │ │ -
const_reference front() const
Returns const reference to first element of vector.
Definition reserveddeque.hh:177
│ │ │ │ -
iterator end()
Returns an iterator pointing to the end of the vector.
Definition reserveddeque.hh:146
│ │ │ │ -
reference back()
Returns reference to last element of vector.
Definition reserveddeque.hh:184
│ │ │ │ -
void pop_back()
Erases the last element of the vector, O(1) time.
Definition reserveddeque.hh:119
│ │ │ │ -
const T & const_reference
Const reference to T.
Definition reserveddeque.hh:57
│ │ │ │ -
static constexpr size_type max_size()
Returns the maximum length of the vector.
Definition reserveddeque.hh:220
│ │ │ │ -
std::ptrdiff_t difference_type
A signed integral type.
Definition reserveddeque.hh:61
│ │ │ │ -
T & reference
Reference to T.
Definition reserveddeque.hh:55
│ │ │ │ -
Dune::GenericIterator< const ReservedDeque, const value_type > const_iterator
Const iterator used to iterate through a vector.
Definition reserveddeque.hh:65
│ │ │ │ -
size_type size() const
Returns number of elements in the vector.
Definition reserveddeque.hh:202
│ │ │ │ -
const_iterator end() const
Returns a const_iterator pointing to the end of the vector.
Definition reserveddeque.hh:151
│ │ │ │ -
void resize(size_t s)
Specifies a new size for the vector.
Definition reserveddeque.hh:96
│ │ │ │ -
iterator begin()
Returns a iterator pointing to the beginning of the vector.
Definition reserveddeque.hh:136
│ │ │ │ -
const_iterator begin() const
Returns a const_iterator pointing to the beginning of the vector.
Definition reserveddeque.hh:141
│ │ │ │ -
ReservedDeque(std::initializer_list< T > const &l)
Definition reserveddeque.hh:77
│ │ │ │ -
size_t size_type
An unsigned integral type.
Definition reserveddeque.hh:59
│ │ │ │ -
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:103
│ │ │ │ +
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:46
│ │ │ │ +
Definition lagrangebasis.hh:387
│ │ │ │ +
LagrangeNode(unsigned int order)
Constructor with a run-time order.
Definition lagrangebasis.hh:428
│ │ │ │ +
unsigned int order() const
Definition lagrangebasis.hh:463
│ │ │ │ +
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition lagrangebasis.hh:448
│ │ │ │ +
const Element * element_
Definition lagrangebasis.hh:473
│ │ │ │ +
const Element & element() const
Return current element, throw if unbound.
Definition lagrangebasis.hh:439
│ │ │ │ +
FiniteElementCache cache_
Definition lagrangebasis.hh:471
│ │ │ │ +
typename FiniteElementCache::FiniteElementType FiniteElement
Definition lagrangebasis.hh:419
│ │ │ │ +
void bind(const Element &e)
Bind to element.
Definition lagrangebasis.hh:454
│ │ │ │ +
typename GV::template Codim< 0 >::Entity Element
Definition lagrangebasis.hh:418
│ │ │ │ +
const FiniteElement * finiteElement_
Definition lagrangebasis.hh:472
│ │ │ │ +
unsigned int order_
Definition lagrangebasis.hh:469
│ │ │ │ +
std::size_t size_type
Definition lagrangebasis.hh:417
│ │ │ │ +
LagrangeNode()
Constructor without order (uses the compile-time value)
Definition lagrangebasis.hh:422
│ │ │ │ +
A pre-basis for a PQ-lagrange bases with given order.
Definition lagrangebasis.hh:55
│ │ │ │ +
size_type dofsPerPrism() const
Definition lagrangebasis.hh:333
│ │ │ │ +
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:350
│ │ │ │ +
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:344
│ │ │ │ +
static constexpr size_type maxMultiIndexSize
Definition lagrangebasis.hh:70
│ │ │ │ +
size_type computeDofsPerPrism() const
Definition lagrangebasis.hh:355
│ │ │ │ +
size_type edgeOffset_
Definition lagrangebasis.hh:372
│ │ │ │ +
std::array< size_type, dim+1 > dofsPerSimplex_
Definition lagrangebasis.hh:366
│ │ │ │ +
It indices(const Node &node, It it) const
Definition lagrangebasis.hh:192
│ │ │ │ +
size_type vertexOffset_
Definition lagrangebasis.hh:371
│ │ │ │ +
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:322
│ │ │ │ +
std::size_t size_type
Type used for indices and size information.
Definition lagrangebasis.hh:65
│ │ │ │ +
size_type pyramidOffset_
Definition lagrangebasis.hh:376
│ │ │ │ +
size_type prismOffset_
Definition lagrangebasis.hh:377
│ │ │ │ +
size_type tetrahedronOffset_
Definition lagrangebasis.hh:375
│ │ │ │ +
void initializeIndices()
Initialize the global indices.
Definition lagrangebasis.hh:96
│ │ │ │ +
size_type computeDofsPerPyramid() const
Definition lagrangebasis.hh:360
│ │ │ │ +
LagrangePreBasis(const GridView &gv, unsigned int order)
Constructor for a given grid view object and run-time order.
Definition lagrangebasis.hh:80
│ │ │ │ +
size_type dofsPerPyramid_
Definition lagrangebasis.hh:369
│ │ │ │ +
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition lagrangebasis.hh:178
│ │ │ │ +
LagrangePreBasis(const GridView &gv)
Constructor for a given grid view object with compile-time order.
Definition lagrangebasis.hh:75
│ │ │ │ +
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition lagrangebasis.hh:126
│ │ │ │ +
size_type size(const SizePrefix &prefix) const
Return number of possible values for next position in multi index.
Definition lagrangebasis.hh:171
│ │ │ │ +
static constexpr size_type multiIndexBufferSize
Definition lagrangebasis.hh:72
│ │ │ │ +
GV GridView
The grid view that the FE basis is defined on.
Definition lagrangebasis.hh:62
│ │ │ │ +
size_type quadrilateralOffset_
Definition lagrangebasis.hh:374
│ │ │ │ +
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition lagrangebasis.hh:120
│ │ │ │ +
GridView gridView_
Definition lagrangebasis.hh:316
│ │ │ │ +
Node makeNode() const
Create tree node.
Definition lagrangebasis.hh:134
│ │ │ │ +
unsigned int order() const
Polynomial order used in the local Lagrange finite-elements.
Definition lagrangebasis.hh:310
│ │ │ │ +
const unsigned int order_
Definition lagrangebasis.hh:319
│ │ │ │ +
std::array< size_type, dim+1 > dofsPerCube_
Definition lagrangebasis.hh:367
│ │ │ │ +
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition lagrangebasis.hh:184
│ │ │ │ +
size_type size() const
Same as size(prefix) with empty prefix.
Definition lagrangebasis.hh:140
│ │ │ │ +
size_type dofsPerPrism_
Definition lagrangebasis.hh:368
│ │ │ │ +
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:328
│ │ │ │ +
size_type triangleOffset_
Definition lagrangebasis.hh:373
│ │ │ │ +
size_type hexahedronOffset_
Definition lagrangebasis.hh:378
│ │ │ │ +
static constexpr size_type minMultiIndexSize
Definition lagrangebasis.hh:71
│ │ │ │ +
size_type dofsPerPyramid() const
Definition lagrangebasis.hh:338
│ │ │ │ +
void setSize(const size_type size)
Definition nodes.hh:164
│ │ │ │ +
Definition nodes.hh:186
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,318 +1,736 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -reserveddeque.hh │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH │ │ │ │ │ 5 │ │ │ │ │ -10#include │ │ │ │ │ -11#include │ │ │ │ │ -12#include │ │ │ │ │ -13#include │ │ │ │ │ -14 │ │ │ │ │ -15#include │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ +8 │ │ │ │ │ +9#include │ │ │ │ │ +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 │ │ │ │ │ 16 │ │ │ │ │ -17#ifdef CHECK_RESERVEDDEQUE │ │ │ │ │ -18#define CHECKSIZE(X) assert(X) │ │ │ │ │ -19#else │ │ │ │ │ -_2_0#define CHECKSIZE(X) {} │ │ │ │ │ -21#endif │ │ │ │ │ -22 │ │ │ │ │ -23namespace _D_u_n_e { │ │ │ │ │ -24namespace Functions { │ │ │ │ │ -25 │ │ │ │ │ -43 template │ │ │ │ │ -_4_4 class _R_e_s_e_r_v_e_d_D_e_q_u_e │ │ │ │ │ -45 { │ │ │ │ │ -46 public: │ │ │ │ │ -47 │ │ │ │ │ -_5_1 typedef T _v_a_l_u_e___t_y_p_e; │ │ │ │ │ -_5_3 typedef T* _p_o_i_n_t_e_r; │ │ │ │ │ -_5_5 typedef T& _r_e_f_e_r_e_n_c_e; │ │ │ │ │ -_5_7 typedef const T& _c_o_n_s_t___r_e_f_e_r_e_n_c_e; │ │ │ │ │ -_5_9 typedef size_t _s_i_z_e___t_y_p_e; │ │ │ │ │ -_6_1 typedef std::ptrdiff_t _d_i_f_f_e_r_e_n_c_e___t_y_p_e; │ │ │ │ │ -_6_3 typedef Dune::GenericIterator _i_t_e_r_a_t_o_r; │ │ │ │ │ -_6_5 typedef Dune::GenericIterator │ │ │ │ │ -_c_o_n_s_t___i_t_e_r_a_t_o_r; │ │ │ │ │ +17namespace _D_u_n_e { │ │ │ │ │ +18namespace Functions { │ │ │ │ │ +19 │ │ │ │ │ +20/ │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +21// This is the reusable part of the LagrangeBasis. It contains │ │ │ │ │ +22// │ │ │ │ │ +23// LagrangePreBasis │ │ │ │ │ +24// LagrangeNode │ │ │ │ │ +25// │ │ │ │ │ +26// The pre-basis allows to create the others and is the owner of possible │ │ │ │ │ +shared │ │ │ │ │ +27// state. These components do _not_ depend on the global basis and local view │ │ │ │ │ +28// and can be used without a global basis. │ │ │ │ │ +29/ │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +30 │ │ │ │ │ +31template │ │ │ │ │ +32class LagrangeNode; │ │ │ │ │ +33 │ │ │ │ │ +34template │ │ │ │ │ +35class LagrangePreBasis; │ │ │ │ │ +36 │ │ │ │ │ +37 │ │ │ │ │ +38 │ │ │ │ │ +53template │ │ │ │ │ +_5_4class _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s │ │ │ │ │ +55{ │ │ │ │ │ +56 static const int dim = GV::dimension; │ │ │ │ │ +57 static const bool useDynamicOrder = (k<0); │ │ │ │ │ +58 │ │ │ │ │ +59public: │ │ │ │ │ +60 │ │ │ │ │ +_6_2 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ │ +63 │ │ │ │ │ +_6_5 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ 66 │ │ │ │ │ -_7_2 _R_e_s_e_r_v_e_d_D_e_q_u_e() : │ │ │ │ │ -73 size_(0), │ │ │ │ │ -74 first_(0) │ │ │ │ │ -75 {} │ │ │ │ │ -76 │ │ │ │ │ -_7_7 _R_e_s_e_r_v_e_d_D_e_q_u_e(std::initializer_list const &l) │ │ │ │ │ -78 { │ │ │ │ │ -79 assert(l.size() <= n);// Actually, this is not needed any more! │ │ │ │ │ -80 size_ = l.size(); │ │ │ │ │ -81 std::copy_n(l.begin(), size_, data_); │ │ │ │ │ -82 } │ │ │ │ │ -83 │ │ │ │ │ -_8_9 void _c_l_e_a_r() │ │ │ │ │ -90 { │ │ │ │ │ -91 first_ = 0; │ │ │ │ │ -92 size_ = 0; │ │ │ │ │ +_6_8 using _N_o_d_e = _L_a_g_r_a_n_g_e_N_o_d_e_<_G_V_,_ _k_,_ _R_>; │ │ │ │ │ +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 = 1; │ │ │ │ │ +_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 = 1; │ │ │ │ │ +_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 = 1; │ │ │ │ │ +73 │ │ │ │ │ +_7_5 _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) │ │ │ │ │ +76 : _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s(gv, std::numeric_limits::max()) │ │ │ │ │ +77 {} │ │ │ │ │ +78 │ │ │ │ │ +_8_0 _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) : │ │ │ │ │ +81 _g_r_i_d_V_i_e_w__(gv), _o_r_d_e_r__(_o_r_d_e_r) │ │ │ │ │ +82 { │ │ │ │ │ +83 if (!useDynamicOrder && _o_r_d_e_r!=std::numeric_limits::max()) │ │ │ │ │ +84 DUNE_THROW(RangeError, "Template argument k has to be -1 when supplying a │ │ │ │ │ +run-time order!"); │ │ │ │ │ +85 │ │ │ │ │ +86 for (int i=0; i<=dim; i++) │ │ │ │ │ +87 { │ │ │ │ │ +88 _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); │ │ │ │ │ +89 _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); │ │ │ │ │ +90 } │ │ │ │ │ +91 _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(); │ │ │ │ │ +92 _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(); │ │ │ │ │ 93 } │ │ │ │ │ 94 │ │ │ │ │ -_9_6 void _r_e_s_i_z_e(size_t s) │ │ │ │ │ +_9_6 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ │ 97 { │ │ │ │ │ -98 _C_H_E_C_K_S_I_Z_E(s<=n); │ │ │ │ │ -99 size_ = s; │ │ │ │ │ -100 } │ │ │ │ │ -101 │ │ │ │ │ -_1_0_3 void _p_u_s_h___b_a_c_k(const T& t) │ │ │ │ │ -104 { │ │ │ │ │ -105 _C_H_E_C_K_S_I_Z_E(size_=2) │ │ │ │ │ +102 { │ │ │ │ │ +103 _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)); │ │ │ │ │ +104 │ │ │ │ │ +105 _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)); │ │ │ │ │ +106 } │ │ │ │ │ +107 │ │ │ │ │ +108 if (dim==3) { │ │ │ │ │ +109 _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)); │ │ │ │ │ +110 │ │ │ │ │ +111 _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)); │ │ │ │ │ +112 │ │ │ │ │ +113 _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)); │ │ │ │ │ +114 │ │ │ │ │ +115 _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)); │ │ │ │ │ 116 } │ │ │ │ │ -117 │ │ │ │ │ -_1_1_9 void _p_o_p___b_a_c_k() │ │ │ │ │ -120 { │ │ │ │ │ -121 if (! _e_m_p_t_y()) │ │ │ │ │ -122 size_--; │ │ │ │ │ +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_2_6 void _p_o_p___f_r_o_n_t() │ │ │ │ │ +_1_2_6 void _u_p_d_a_t_e (const _G_r_i_d_V_i_e_w& gv) │ │ │ │ │ 127 { │ │ │ │ │ -128 if (! _e_m_p_t_y()) │ │ │ │ │ -129 { │ │ │ │ │ -130 size_--; │ │ │ │ │ -131 first_ = (++first_) % n; │ │ │ │ │ -132 } │ │ │ │ │ -133 } │ │ │ │ │ -134 │ │ │ │ │ -_1_3_6 _i_t_e_r_a_t_o_r _b_e_g_i_n(){ │ │ │ │ │ -137 return _i_t_e_r_a_t_o_r(*this, 0); │ │ │ │ │ -138 } │ │ │ │ │ -139 │ │ │ │ │ -_1_4_1 _c_o_n_s_t___i_t_e_r_a_t_o_r _b_e_g_i_n() const { │ │ │ │ │ -142 return _c_o_n_s_t___i_t_e_r_a_t_o_r(*this, 0); │ │ │ │ │ -143 } │ │ │ │ │ -144 │ │ │ │ │ -_1_4_6 _i_t_e_r_a_t_o_r _e_n_d(){ │ │ │ │ │ -147 return _i_t_e_r_a_t_o_r(*this, size_); │ │ │ │ │ -148 } │ │ │ │ │ -149 │ │ │ │ │ -_1_5_1 _c_o_n_s_t___i_t_e_r_a_t_o_r _e_n_d() const { │ │ │ │ │ -152 return _c_o_n_s_t___i_t_e_r_a_t_o_r(*this, size_); │ │ │ │ │ +128 _g_r_i_d_V_i_e_w__ = gv; │ │ │ │ │ +129 } │ │ │ │ │ +130 │ │ │ │ │ +_1_3_4 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ │ +135 { │ │ │ │ │ +136 return _N_o_d_e{_o_r_d_e_r__}; │ │ │ │ │ +137 } │ │ │ │ │ +138 │ │ │ │ │ +_1_4_0 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ │ +141 { │ │ │ │ │ +142 switch (dim) │ │ │ │ │ +143 { │ │ │ │ │ +144 case 1: │ │ │ │ │ +145 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)) │ │ │ │ │ +146 + _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)); │ │ │ │ │ +147 case 2: │ │ │ │ │ +148 { │ │ │ │ │ +149 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)) │ │ │ │ │ +150 + _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)) │ │ │ │ │ +151 + _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)) │ │ │ │ │ +152 + _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)); │ │ │ │ │ 153 } │ │ │ │ │ -154 │ │ │ │ │ -_1_5_6 _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) │ │ │ │ │ -157 { │ │ │ │ │ -158 _C_H_E_C_K_S_I_Z_E(size_>i); │ │ │ │ │ -159 return data_[(first_ + i) % n]; │ │ │ │ │ -160 } │ │ │ │ │ -161 │ │ │ │ │ -_1_6_3 _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 │ │ │ │ │ -164 { │ │ │ │ │ -165 _C_H_E_C_K_S_I_Z_E(size_>i); │ │ │ │ │ -166 return data_[(first_ + i) % n]; │ │ │ │ │ +154 case 3: │ │ │ │ │ +155 { │ │ │ │ │ +156 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)) │ │ │ │ │ +157 + _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)) │ │ │ │ │ +158 + _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)) │ │ │ │ │ +159 + _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)) │ │ │ │ │ +160 + _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)) │ │ │ │ │ +161 + _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)) │ │ │ │ │ +162 + _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)) │ │ │ │ │ +163 + _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)); │ │ │ │ │ +164 } │ │ │ │ │ +165 } │ │ │ │ │ +166 DUNE_THROW(Dune::NotImplemented, "No size method for " << dim << "d grids │ │ │ │ │ +available yet!"); │ │ │ │ │ 167 } │ │ │ │ │ 168 │ │ │ │ │ -_1_7_0 _r_e_f_e_r_e_n_c_e _f_r_o_n_t() │ │ │ │ │ -171 { │ │ │ │ │ -172 _C_H_E_C_K_S_I_Z_E(size_>0); │ │ │ │ │ -173 return data_[first_]; │ │ │ │ │ -174 } │ │ │ │ │ -175 │ │ │ │ │ -_1_7_7 _c_o_n_s_t___r_e_f_e_r_e_n_c_e _f_r_o_n_t() const │ │ │ │ │ -178 { │ │ │ │ │ -179 _C_H_E_C_K_S_I_Z_E(size_>0); │ │ │ │ │ -180 return data_[first_]; │ │ │ │ │ +170 template │ │ │ │ │ +_1_7_1 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix) const │ │ │ │ │ +172 { │ │ │ │ │ +173 assert(prefix.size() == 0 || prefix.size() == 1); │ │ │ │ │ +174 return (prefix.size() == 0) ? _s_i_z_e() : 0; │ │ │ │ │ +175 } │ │ │ │ │ +176 │ │ │ │ │ +_1_7_8 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ │ +179 { │ │ │ │ │ +180 return _s_i_z_e(); │ │ │ │ │ 181 } │ │ │ │ │ 182 │ │ │ │ │ -_1_8_4 _r_e_f_e_r_e_n_c_e _b_a_c_k() │ │ │ │ │ +_1_8_4 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ │ 185 { │ │ │ │ │ -186 _C_H_E_C_K_S_I_Z_E(size_>0); │ │ │ │ │ -187 return data_[(first_ + size_-1) % n]; │ │ │ │ │ -188 } │ │ │ │ │ -189 │ │ │ │ │ -_1_9_1 _c_o_n_s_t___r_e_f_e_r_e_n_c_e _b_a_c_k() const │ │ │ │ │ -192 { │ │ │ │ │ -193 _C_H_E_C_K_S_I_Z_E(size_>0); │ │ │ │ │ -194 return data_[(first_ + size_-1) % n]; │ │ │ │ │ -195 } │ │ │ │ │ -196 │ │ │ │ │ -_2_0_2 _s_i_z_e___t_y_p_e _s_i_z_e () const │ │ │ │ │ -203 { │ │ │ │ │ -204 return size_; │ │ │ │ │ -205 } │ │ │ │ │ -206 │ │ │ │ │ -_2_0_8 bool _e_m_p_t_y() const │ │ │ │ │ -209 { │ │ │ │ │ -210 return size_==0; │ │ │ │ │ +186 // That cast to unsigned int is necessary because GV::dimension is an enum, │ │ │ │ │ +187 // which is not recognized by the power method as an integer type... │ │ │ │ │ +188 return power(_o_r_d_e_r()+1, (unsigned int)GV::dimension); │ │ │ │ │ +189 } │ │ │ │ │ +190 │ │ │ │ │ +191 template │ │ │ │ │ +_1_9_2 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ │ +193 { │ │ │ │ │ +194 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) │ │ │ │ │ +195 { │ │ │ │ │ +196 Dune::LocalKey localKey = node._f_i_n_i_t_e_E_l_e_m_e_n_t().localCoefficients().localKey │ │ │ │ │ +(i); │ │ │ │ │ +197 const auto& gridIndexSet = _g_r_i_d_V_i_e_w().indexSet(); │ │ │ │ │ +198 const auto& element = node._e_l_e_m_e_n_t(); │ │ │ │ │ +199 │ │ │ │ │ +200 // The dimension of the entity that the current dof is related to │ │ │ │ │ +201 auto dofDim = dim - localKey.codim(); │ │ │ │ │ +202 │ │ │ │ │ +203 // Test for a vertex dof │ │ │ │ │ +204 // The test for k==1 is redundant, but having it here allows the compiler │ │ │ │ │ +to conclude │ │ │ │ │ +205 // at compile-time that the dofDim==0 case is the only one that will ever │ │ │ │ │ +happen. │ │ │ │ │ +206 // This leads to measurable speed-up: see │ │ │ │ │ +207 // https://gitlab.dune-project.org/staging/dune-functions/issues/30 │ │ │ │ │ +208 if (k==1 || dofDim==0) { │ │ │ │ │ +209 *it = {{ (_s_i_z_e___t_y_p_e)(gridIndexSet.subIndex(element,localKey.subEntity │ │ │ │ │ +(),dim)) }}; │ │ │ │ │ +210 continue; │ │ │ │ │ 211 } │ │ │ │ │ 212 │ │ │ │ │ -_2_1_4 static constexpr _s_i_z_e___t_y_p_e _c_a_p_a_c_i_t_y() │ │ │ │ │ -215 { │ │ │ │ │ -216 return n; │ │ │ │ │ -217 } │ │ │ │ │ -218 │ │ │ │ │ -_2_2_0 static constexpr _s_i_z_e___t_y_p_e _m_a_x___s_i_z_e() │ │ │ │ │ -221 { │ │ │ │ │ -222 return n; │ │ │ │ │ -223 } │ │ │ │ │ -224 │ │ │ │ │ -_2_2_8 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) │ │ │ │ │ -229 { │ │ │ │ │ -230 for (size_t i=0; i(element.type()); │ │ │ │ │ +226 │ │ │ │ │ +227 // We have to reverse the numbering if the local element edge is │ │ │ │ │ +228 // not aligned with the global edge. │ │ │ │ │ +229 auto v0 = (_s_i_z_e___t_y_p_e)gridIndexSet.subIndex(element,refElement.subEntity │ │ │ │ │ +(localKey.subEntity(),localKey.codim(),0,dim),dim); │ │ │ │ │ +230 auto v1 = (_s_i_z_e___t_y_p_e)gridIndexSet.subIndex(element,refElement.subEntity │ │ │ │ │ +(localKey.subEntity(),localKey.codim(),1,dim),dim); │ │ │ │ │ +231 bool flip = (v0 > v1); │ │ │ │ │ +232 *it = {{ (flip) │ │ │ │ │ +233 ? _e_d_g_e_O_f_f_s_e_t__ │ │ │ │ │ +234 + _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())) │ │ │ │ │ +235 + (_d_o_f_s_P_e_r_C_u_b_e(1)-1)-localKey.index() │ │ │ │ │ +236 : _e_d_g_e_O_f_f_s_e_t__ │ │ │ │ │ +237 + _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())) │ │ │ │ │ +238 + localKey.index() }}; │ │ │ │ │ +239 continue; │ │ │ │ │ +240 } │ │ │ │ │ +241 } │ │ │ │ │ +242 │ │ │ │ │ +243 if (dofDim==2) │ │ │ │ │ +244 { │ │ │ │ │ +245 if (dim==2) // element dof -- any local numbering is fine │ │ │ │ │ +246 { │ │ │ │ │ +247 if (element.type().isTriangle()) │ │ │ │ │ +248 { │ │ │ │ │ +249 *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() }}; │ │ │ │ │ +250 continue; │ │ │ │ │ +251 } │ │ │ │ │ +252 else if (element.type().isQuadrilateral()) │ │ │ │ │ +253 { │ │ │ │ │ +254 *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() }}; │ │ │ │ │ +255 continue; │ │ │ │ │ +256 } │ │ │ │ │ +257 else │ │ │ │ │ +258 DUNE_THROW(Dune::NotImplemented, "2d elements have to be triangles or │ │ │ │ │ +quadrilaterals"); │ │ │ │ │ +259 } else │ │ │ │ │ +260 { │ │ │ │ │ +261 const auto refElement │ │ │ │ │ +262 = Dune::referenceElement(element.type()); │ │ │ │ │ +263 │ │ │ │ │ +264 if (_o_r_d_e_r()>3) │ │ │ │ │ +265 DUNE_THROW(Dune::NotImplemented, "LagrangeBasis for 3D grids is only │ │ │ │ │ +implemented if k<=3"); │ │ │ │ │ +266 │ │ │ │ │ +267 if (_o_r_d_e_r()==3 and !refElement.type(localKey.subEntity(), localKey.codim │ │ │ │ │ +()).isTriangle()) │ │ │ │ │ +268 DUNE_THROW(Dune::NotImplemented, "LagrangeBasis for 3D grids with k==3 is │ │ │ │ │ +only implemented if the grid is a simplex grid"); │ │ │ │ │ +269 │ │ │ │ │ +270 *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())) }}; │ │ │ │ │ +271 continue; │ │ │ │ │ +272 } │ │ │ │ │ +273 } │ │ │ │ │ +274 │ │ │ │ │ +275 if (dofDim==3) │ │ │ │ │ +276 { │ │ │ │ │ +277 if (dim==3) // element dof -- any local numbering is fine │ │ │ │ │ +278 { │ │ │ │ │ +279 if (element.type().isTetrahedron()) │ │ │ │ │ +280 { │ │ │ │ │ +281 *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() }}; │ │ │ │ │ +282 continue; │ │ │ │ │ +283 } │ │ │ │ │ +284 else if (element.type().isHexahedron()) │ │ │ │ │ +285 { │ │ │ │ │ +286 *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() }}; │ │ │ │ │ +287 continue; │ │ │ │ │ +288 } │ │ │ │ │ +289 else if (element.type().isPrism()) │ │ │ │ │ +290 { │ │ │ │ │ +291 *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() }}; │ │ │ │ │ +292 continue; │ │ │ │ │ +293 } │ │ │ │ │ +294 else if (element.type().isPyramid()) │ │ │ │ │ +295 { │ │ │ │ │ +296 *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() }}; │ │ │ │ │ +297 continue; │ │ │ │ │ +298 } │ │ │ │ │ +299 else │ │ │ │ │ +300 DUNE_THROW(Dune::NotImplemented, "3d elements have to be tetrahedra, │ │ │ │ │ +hexahedra, prisms, or pyramids"); │ │ │ │ │ +301 } else │ │ │ │ │ +302 DUNE_THROW(Dune::NotImplemented, "Grids of dimension larger than 3 are no │ │ │ │ │ +supported"); │ │ │ │ │ +303 } │ │ │ │ │ +304 DUNE_THROW(Dune::NotImplemented, "Grid contains elements not supported for │ │ │ │ │ +the LagrangeBasis"); │ │ │ │ │ +305 } │ │ │ │ │ +306 return it; │ │ │ │ │ +307 } │ │ │ │ │ +308 │ │ │ │ │ +_3_1_0 unsigned int _o_r_d_e_r() const │ │ │ │ │ +311 { │ │ │ │ │ +312 return (useDynamicOrder) ? _o_r_d_e_r__ : k; │ │ │ │ │ +313 } │ │ │ │ │ +314 │ │ │ │ │ +315protected: │ │ │ │ │ +_3_1_6 _G_r_i_d_V_i_e_w _g_r_i_d_V_i_e_w__; │ │ │ │ │ +317 │ │ │ │ │ +318 // Run-time order, only valid if k<0 │ │ │ │ │ +_3_1_9 const unsigned int _o_r_d_e_r__; │ │ │ │ │ +320 │ │ │ │ │ +_3_2_2 _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 │ │ │ │ │ +323 { │ │ │ │ │ +324 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); │ │ │ │ │ +325 } │ │ │ │ │ +326 │ │ │ │ │ +_3_2_8 _s_i_z_e___t_y_p_e _d_o_f_s_P_e_r_C_u_b_e(std::size_t cubeDim) const │ │ │ │ │ +329 { │ │ │ │ │ +330 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); │ │ │ │ │ +331 } │ │ │ │ │ +332 │ │ │ │ │ +_3_3_3 _s_i_z_e___t_y_p_e _d_o_f_s_P_e_r_P_r_i_s_m() const │ │ │ │ │ +334 { │ │ │ │ │ +335 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(); │ │ │ │ │ +336 } │ │ │ │ │ +337 │ │ │ │ │ +_3_3_8 _s_i_z_e___t_y_p_e _d_o_f_s_P_e_r_P_y_r_a_m_i_d() const │ │ │ │ │ +339 { │ │ │ │ │ +340 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(); │ │ │ │ │ +341 } │ │ │ │ │ +342 │ │ │ │ │ +_3_4_4 _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 │ │ │ │ │ +345 { │ │ │ │ │ +346 return _o_r_d_e_r() == 0 ? (dim == simplexDim ? 1 : 0) : Dune::binomial(std:: │ │ │ │ │ +size_t(_o_r_d_e_r()-1),simplexDim); │ │ │ │ │ +347 } │ │ │ │ │ +348 │ │ │ │ │ +_3_5_0 _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 │ │ │ │ │ +351 { │ │ │ │ │ +352 return _o_r_d_e_r() == 0 ? (dim == cubeDim ? 1 : 0) : Dune::power(_o_r_d_e_r()-1, │ │ │ │ │ +cubeDim); │ │ │ │ │ +353 } │ │ │ │ │ +354 │ │ │ │ │ +_3_5_5 _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 │ │ │ │ │ +356 { │ │ │ │ │ +357 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; │ │ │ │ │ +358 } │ │ │ │ │ +359 │ │ │ │ │ +_3_6_0 _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 │ │ │ │ │ +361 { │ │ │ │ │ +362 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; │ │ │ │ │ +363 } │ │ │ │ │ +364 │ │ │ │ │ +365 // When the order is given at run-time, the following numbers are pre- │ │ │ │ │ +computed: │ │ │ │ │ +_3_6_6 std::array _d_o_f_s_P_e_r_S_i_m_p_l_e_x__; │ │ │ │ │ +_3_6_7 std::array _d_o_f_s_P_e_r_C_u_b_e__; │ │ │ │ │ +_3_6_8 _s_i_z_e___t_y_p_e _d_o_f_s_P_e_r_P_r_i_s_m__; │ │ │ │ │ +_3_6_9 _s_i_z_e___t_y_p_e _d_o_f_s_P_e_r_P_y_r_a_m_i_d__; │ │ │ │ │ +370 │ │ │ │ │ +_3_7_1 _s_i_z_e___t_y_p_e _v_e_r_t_e_x_O_f_f_s_e_t__; │ │ │ │ │ +_3_7_2 _s_i_z_e___t_y_p_e _e_d_g_e_O_f_f_s_e_t__; │ │ │ │ │ +_3_7_3 _s_i_z_e___t_y_p_e _t_r_i_a_n_g_l_e_O_f_f_s_e_t__; │ │ │ │ │ +_3_7_4 _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_7_5 _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_7_6 _s_i_z_e___t_y_p_e _p_y_r_a_m_i_d_O_f_f_s_e_t__; │ │ │ │ │ +_3_7_7 _s_i_z_e___t_y_p_e _p_r_i_s_m_O_f_f_s_e_t__; │ │ │ │ │ +_3_7_8 _s_i_z_e___t_y_p_e _h_e_x_a_h_e_d_r_o_n_O_f_f_s_e_t__; │ │ │ │ │ +379 │ │ │ │ │ +380}; │ │ │ │ │ +381 │ │ │ │ │ +382 │ │ │ │ │ +383 │ │ │ │ │ +384template │ │ │ │ │ +_3_8_5class _L_a_g_r_a_n_g_e_N_o_d_e : │ │ │ │ │ +386 public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ │ +387{ │ │ │ │ │ +388 // Stores LocalFiniteElement implementations with run-time order as a │ │ │ │ │ +function of GeometryType │ │ │ │ │ +389 template │ │ │ │ │ +390 class LagrangeRunTimeLFECache │ │ │ │ │ +391 { │ │ │ │ │ +392 public: │ │ │ │ │ +393 using FiniteElementType = │ │ │ │ │ +LagrangeLocalFiniteElement; │ │ │ │ │ +394 │ │ │ │ │ +395 const FiniteElementType& get(GeometryType type) │ │ │ │ │ +396 { │ │ │ │ │ +397 auto i = data_.find(type); │ │ │ │ │ +398 if (i==data_.end()) │ │ │ │ │ +399 i = data_.emplace(type,FiniteElementType(type,order_)).first; │ │ │ │ │ +400 return (*i).second; │ │ │ │ │ +401 } │ │ │ │ │ +402 │ │ │ │ │ +403 std::map data_; │ │ │ │ │ +404 unsigned int order_; │ │ │ │ │ +405 }; │ │ │ │ │ +406 │ │ │ │ │ +407 static constexpr int dim = GV::dimension; │ │ │ │ │ +408 static constexpr bool useDynamicOrder = (k<0); │ │ │ │ │ +409 │ │ │ │ │ +410 using FiniteElementCache = typename std::conditional<(useDynamicOrder), │ │ │ │ │ +411 LagrangeRunTimeLFECache, │ │ │ │ │ +412 PQkLocalFiniteElementCache │ │ │ │ │ +413 >::type; │ │ │ │ │ +414 │ │ │ │ │ +415public: │ │ │ │ │ +416 │ │ │ │ │ +_4_1_7 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ +_4_1_8 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ │ +_4_1_9 using _F_i_n_i_t_e_E_l_e_m_e_n_t = typename FiniteElementCache::FiniteElementType; │ │ │ │ │ +420 │ │ │ │ │ +_4_2_2 _L_a_g_r_a_n_g_e_N_o_d_e() : │ │ │ │ │ +423 _f_i_n_i_t_e_E_l_e_m_e_n_t__(nullptr), │ │ │ │ │ +424 _e_l_e_m_e_n_t__(nullptr) │ │ │ │ │ +425 {} │ │ │ │ │ +426 │ │ │ │ │ +_4_2_8 _L_a_g_r_a_n_g_e_N_o_d_e(unsigned int _o_r_d_e_r) : │ │ │ │ │ +429 _o_r_d_e_r__(_o_r_d_e_r), │ │ │ │ │ +430 _f_i_n_i_t_e_E_l_e_m_e_n_t__(nullptr), │ │ │ │ │ +431 _e_l_e_m_e_n_t__(nullptr) │ │ │ │ │ +432 { │ │ │ │ │ +433 // Only the cache for the run-time-order case (i.e., k<0), has the 'order_' │ │ │ │ │ +member │ │ │ │ │ +434 if constexpr (useDynamicOrder) │ │ │ │ │ +435 _c_a_c_h_e__.order_ = _o_r_d_e_r; │ │ │ │ │ +436 } │ │ │ │ │ +437 │ │ │ │ │ +_4_3_9 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ │ +440 { │ │ │ │ │ +441 return *_e_l_e_m_e_n_t__; │ │ │ │ │ +442 } │ │ │ │ │ +443 │ │ │ │ │ +_4_4_8 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 │ │ │ │ │ +449 { │ │ │ │ │ +450 return *_f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ │ +451 } │ │ │ │ │ +452 │ │ │ │ │ +_4_5_4 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ │ +455 { │ │ │ │ │ +456 _e_l_e_m_e_n_t__ = &e; │ │ │ │ │ +457 _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())); │ │ │ │ │ +458 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__->size()); │ │ │ │ │ +459 } │ │ │ │ │ +460 │ │ │ │ │ +461protected: │ │ │ │ │ +462 │ │ │ │ │ +_4_6_3 unsigned int _o_r_d_e_r() const │ │ │ │ │ +464 { │ │ │ │ │ +465 return (useDynamicOrder) ? _o_r_d_e_r__ : k; │ │ │ │ │ +466 } │ │ │ │ │ +467 │ │ │ │ │ +468 // Run-time order, only valid if k<0 │ │ │ │ │ +_4_6_9 unsigned int _o_r_d_e_r__; │ │ │ │ │ +470 │ │ │ │ │ +_4_7_1 FiniteElementCache _c_a_c_h_e__; │ │ │ │ │ +_4_7_2 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_7_3 const _E_l_e_m_e_n_t* _e_l_e_m_e_n_t__; │ │ │ │ │ +474}; │ │ │ │ │ +475 │ │ │ │ │ +476 │ │ │ │ │ +477 │ │ │ │ │ +478namespace BasisFactory { │ │ │ │ │ +479 │ │ │ │ │ +488template │ │ │ │ │ +_4_8_9auto _l_a_g_r_a_n_g_e() │ │ │ │ │ +490{ │ │ │ │ │ +491 return [](const auto& gridView) { │ │ │ │ │ +492 return _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s, k, R>(gridView); │ │ │ │ │ +493 }; │ │ │ │ │ +494} │ │ │ │ │ +495 │ │ │ │ │ +503template │ │ │ │ │ +_5_0_4auto _l_a_g_r_a_n_g_e(int order) │ │ │ │ │ +505{ │ │ │ │ │ +506 return [=](const auto& gridView) { │ │ │ │ │ +507 return _L_a_g_r_a_n_g_e_P_r_e_B_a_s_i_s, -1, R>(gridView, │ │ │ │ │ +order); │ │ │ │ │ +508 }; │ │ │ │ │ +509} │ │ │ │ │ +510 │ │ │ │ │ +511} // end namespace BasisFactory │ │ │ │ │ +512 │ │ │ │ │ +513 │ │ │ │ │ +514 │ │ │ │ │ +538template │ │ │ │ │ +_5_3_9using _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_> >; │ │ │ │ │ +540 │ │ │ │ │ +541 │ │ │ │ │ +542 │ │ │ │ │ +543 │ │ │ │ │ +544 │ │ │ │ │ +545} // end namespace Functions │ │ │ │ │ +546} // end namespace Dune │ │ │ │ │ +547 │ │ │ │ │ +548 │ │ │ │ │ +549#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 │ │ │ │ │ +_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:489 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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 │ │ │ │ │ -A double-ended queue (deque) class with statically reserved memory. │ │ │ │ │ -DDeeffiinniittiioonn reserveddeque.hh:45 │ │ │ │ │ -_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:126 │ │ │ │ │ -_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:214 │ │ │ │ │ -_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:89 │ │ │ │ │ -_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: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_:_:_v_a_l_u_e___t_y_p_e │ │ │ │ │ -T value_type │ │ │ │ │ -The type of object, T, stored in the vector. │ │ │ │ │ -DDeeffiinniittiioonn reserveddeque.hh:51 │ │ │ │ │ -_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:72 │ │ │ │ │ -_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:208 │ │ │ │ │ -_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:191 │ │ │ │ │ -_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:228 │ │ │ │ │ -_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:65 │ │ │ │ │ -_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 │ │ │ │ │ +_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:46 │ │ │ │ │ +_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:387 │ │ │ │ │ +_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:428 │ │ │ │ │ +_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:463 │ │ │ │ │ +_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:448 │ │ │ │ │ +_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_ │ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:473 │ │ │ │ │ +_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:439 │ │ │ │ │ +_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_:_:_c_a_c_h_e__ │ │ │ │ │ +FiniteElementCache cache_ │ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:471 │ │ │ │ │ +_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: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_:_:_b_i_n_d │ │ │ │ │ +void bind(const Element &e) │ │ │ │ │ +Bind to element. │ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:454 │ │ │ │ │ +_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:418 │ │ │ │ │ +_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_ │ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:472 │ │ │ │ │ +_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_ │ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:469 │ │ │ │ │ +_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:417 │ │ │ │ │ +_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:422 │ │ │ │ │ +_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:55 │ │ │ │ │ +_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:333 │ │ │ │ │ +_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:350 │ │ │ │ │ +_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:344 │ │ │ │ │ +_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_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ +static constexpr size_type maxMultiIndexSize │ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:70 │ │ │ │ │ +_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:355 │ │ │ │ │ +_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_:_:_e_d_g_e_O_f_f_s_e_t__ │ │ │ │ │ +size_type edgeOffset_ │ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:372 │ │ │ │ │ +_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__ │ │ │ │ │ +std::array< size_type, dim+1 > dofsPerSimplex_ │ │ │ │ │ +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_:_:_i_n_d_i_c_e_s │ │ │ │ │ +It indices(const Node &node, It it) const │ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:192 │ │ │ │ │ +_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_:_:_v_e_r_t_e_x_O_f_f_s_e_t__ │ │ │ │ │ +size_type vertexOffset_ │ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:371 │ │ │ │ │ +_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:322 │ │ │ │ │ +_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: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_:_:_p_y_r_a_m_i_d_O_f_f_s_e_t__ │ │ │ │ │ +size_type pyramidOffset_ │ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:376 │ │ │ │ │ +_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_:_:_p_r_i_s_m_O_f_f_s_e_t__ │ │ │ │ │ +size_type prismOffset_ │ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:377 │ │ │ │ │ +_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_:_:_t_e_t_r_a_h_e_d_r_o_n_O_f_f_s_e_t__ │ │ │ │ │ +size_type tetrahedronOffset_ │ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:375 │ │ │ │ │ +_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:96 │ │ │ │ │ +_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: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_:_:_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:80 │ │ │ │ │ +_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_ │ │ │ │ │ +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_:_:_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:178 │ │ │ │ │ +_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: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_:_:_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: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_:_:_s_i_z_e │ │ │ │ │ +size_type size(const SizePrefix &prefix) const │ │ │ │ │ +Return number of possible values for next position in multi index. │ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:171 │ │ │ │ │ +_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_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 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_r_i_d_V_i_e_w │ │ │ │ │ +GV GridView │ │ │ │ │ +The grid view that the FE basis is defined on. │ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:62 │ │ │ │ │ +_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_:_:_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:374 │ │ │ │ │ +_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:120 │ │ │ │ │ +_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__ │ │ │ │ │ +GridView gridView_ │ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:316 │ │ │ │ │ +_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:134 │ │ │ │ │ +_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_:_:_o_r_d_e_r │ │ │ │ │ +unsigned int order() const │ │ │ │ │ +Polynomial order used in the local Lagrange finite-elements. │ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:310 │ │ │ │ │ +_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_:_:_o_r_d_e_r__ │ │ │ │ │ +const unsigned int order_ │ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:319 │ │ │ │ │ +_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__ │ │ │ │ │ +std::array< size_type, dim+1 > dofsPerCube_ │ │ │ │ │ +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_:_:_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: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_:_:_s_i_z_e │ │ │ │ │ size_type size() const │ │ │ │ │ -Returns number of elements in the vector. │ │ │ │ │ -DDeeffiinniittiioonn reserveddeque.hh:202 │ │ │ │ │ -_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:151 │ │ │ │ │ -_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:96 │ │ │ │ │ -_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:136 │ │ │ │ │ -_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:141 │ │ │ │ │ -_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:77 │ │ │ │ │ -_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:59 │ │ │ │ │ -_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:103 │ │ │ │ │ +Same as size(prefix) with empty prefix. │ │ │ │ │ +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_:_:_d_o_f_s_P_e_r_P_r_i_s_m__ │ │ │ │ │ +size_type dofsPerPrism_ │ │ │ │ │ +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_:_:_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:328 │ │ │ │ │ +_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_:_:_t_r_i_a_n_g_l_e_O_f_f_s_e_t__ │ │ │ │ │ +size_type triangleOffset_ │ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:373 │ │ │ │ │ +_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_:_:_h_e_x_a_h_e_d_r_o_n_O_f_f_s_e_t__ │ │ │ │ │ +size_type hexahedronOffset_ │ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:378 │ │ │ │ │ +_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_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ +static constexpr size_type minMultiIndexSize │ │ │ │ │ +DDeeffiinniittiioonn lagrangebasis.hh:71 │ │ │ │ │ +_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:338 │ │ │ │ │ +_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:164 │ │ │ │ │ +_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:186 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00107.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: referencehelper.hh File Reference │ │ │ │ +dune-functions: subspacelocalview.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,58 +65,43 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Namespaces | │ │ │ │ -Typedefs | │ │ │ │ -Functions | │ │ │ │ -Variables
│ │ │ │ -
referencehelper.hh File Reference
│ │ │ │ +Classes | │ │ │ │ +Namespaces
│ │ │ │ +
subspacelocalview.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <type_traits>
│ │ │ │ -#include <dune/common/referencehelper.hh>
│ │ │ │ +
#include <tuple>
│ │ │ │ +#include <dune/common/concept.hh>
│ │ │ │ +#include <dune/typetree/childextraction.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
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Typedefs

template<class T >
using Dune::Functions::ResolveRef_t = Dune::ResolveRef_t< T >
 This is an alias for Dune::ResolveRef_t.
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Functions

template<class T >
decltype(auto) Dune::Functions::resolveRef (T &&t)
 This is an alias for Dune::resolveRef.
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ -Variables

template<class T >
constexpr bool Dune::Functions::IsReferenceWrapper_v = Dune::IsReferenceWrapper_v<T>
 This is an alias for Dune::IsReferenceWrapper_v.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,35 +1,25 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -_N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _F_u_n_c_t_i_o_n_s | _V_a_r_i_a_b_l_e_s │ │ │ │ │ -referencehelper.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ +subspacelocalview.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_/_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 │ │ │ │ │   │ │ │ │ │ -TTyyppeeddeeffss │ │ │ │ │ -template │ │ │ │ │ -using  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_o_l_v_e_R_e_f___t = Dune::ResolveRef_t< T > │ │ │ │ │ -  This is an alias for Dune::ResolveRef_t. │ │ │ │ │ -  │ │ │ │ │ -FFuunnccttiioonnss │ │ │ │ │ -template │ │ │ │ │ -decltype(auto)  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_r_e_s_o_l_v_e_R_e_f (T &&t) │ │ │ │ │ -  This is an alias for Dune::resolveRef. │ │ │ │ │ -  │ │ │ │ │ -VVaarriiaabblleess │ │ │ │ │ -template │ │ │ │ │ -constexpr bool  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_s_R_e_f_e_r_e_n_c_e_W_r_a_p_p_e_r___v = Dune:: │ │ │ │ │ - IsReferenceWrapper_v │ │ │ │ │ -  This is an alias for Dune::IsReferenceWrapper_v. │ │ │ │ │ -  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00107_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: referencehelper.hh Source File │ │ │ │ +dune-functions: subspacelocalview.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,71 +70,191 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
referencehelper.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#ifndef DUNE_FUNCTIONS_COMMON_REFERENCE_HELPER_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_COMMON_REFERENCE_HELPER_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH
│ │ │ │
5
│ │ │ │ -
6#warning The header dune/functions/common/referencehelper.hh is deprecated and will be removed after release 2.9. Include dune/common/referencehelper.hh instead.
│ │ │ │ -
7
│ │ │ │ -
8#include <type_traits>
│ │ │ │ -
9
│ │ │ │ -
10#include <dune/common/referencehelper.hh>
│ │ │ │ -
11
│ │ │ │ +
6
│ │ │ │ +
7#include <tuple>
│ │ │ │ +
8
│ │ │ │ +
9#include <dune/common/concept.hh>
│ │ │ │ +
10
│ │ │ │ +
11#include <dune/typetree/childextraction.hh>
│ │ │ │
12
│ │ │ │ -
13
│ │ │ │ + │ │ │ │
14
│ │ │ │ -
15namespace Dune {
│ │ │ │ -
16namespace Functions {
│ │ │ │ -
17
│ │ │ │ -
18
│ │ │ │ -
23template<class T>
│ │ │ │ -
24[[deprecated("Use Dune::IsReferenceWrapper_v instead. Will be removed after release 2.9.")]]
│ │ │ │ -
25constexpr bool
│ │ │ │ -
26IsReferenceWrapper_v = Dune::IsReferenceWrapper_v<T>;
│ │ │ │ -
27
│ │ │ │ -
28
│ │ │ │ -
33template<class T>
│ │ │ │ -
34decltype(auto)
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
36[[deprecated("Use Dune::resolveRef instead. Will be removed after release 2.9.")]]
│ │ │ │ -
37(T&& t)
│ │ │ │ -
38{
│ │ │ │ -
39 return Dune::resolveRef(std::forward<T>(t));
│ │ │ │ -
40}
│ │ │ │ -
│ │ │ │ -
41
│ │ │ │ -
46template<class T>
│ │ │ │ - │ │ │ │ -
48[[deprecated("Use Dune::ResolveRef_t instead. Will be removed after release 2.9.")]]
│ │ │ │ -
49 = Dune::ResolveRef_t<T>;
│ │ │ │ -
50
│ │ │ │ +
15
│ │ │ │ +
16
│ │ │ │ +
17namespace Dune {
│ │ │ │ +
18namespace Functions {
│ │ │ │ +
19
│ │ │ │ +
20
│ │ │ │ +
21
│ │ │ │ +
22template<class RB, class PP>
│ │ │ │ +
23class SubspaceBasis;
│ │ │ │ +
24
│ │ │ │ +
25
│ │ │ │ +
26
│ │ │ │ +
28template<class RLV, class PP>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
30{
│ │ │ │ +
31 using PrefixPath = PP;
│ │ │ │ +
32
│ │ │ │ +
33public:
│ │ │ │ +
34
│ │ │ │ +
35 using RootLocalView = RLV;
│ │ │ │ +
36
│ │ │ │ + │ │ │ │ +
39
│ │ │ │ + │ │ │ │ +
42
│ │ │ │ +
44 using Element = typename GridView::template Codim<0>::Entity;
│ │ │ │ +
45
│ │ │ │ +
47 using size_type = std::size_t;
│ │ │ │ +
48
│ │ │ │ +
50 using RootTree = typename RootLocalView::Tree;
│ │ │ │
51
│ │ │ │ -
52}} // namespace Dune::Functions
│ │ │ │ -
53
│ │ │ │ +
53 using Tree = typename TypeTree::ChildForTreePath<RootTree, PrefixPath>;
│ │ │ │
54
│ │ │ │ -
55
│ │ │ │ -
56#endif // DUNE_FUNCTIONS_COMMON_REFERENCE_HELPER_HH
│ │ │ │ +
56 using MultiIndex = typename RootLocalView::MultiIndex;
│ │ │ │ +
57
│ │ │ │ +
│ │ │ │ +
59 SubspaceLocalView(const GlobalBasis& globalBasis, const PrefixPath& /*prefixPath*/) :
│ │ │ │ + │ │ │ │ +
61 rootLocalView_(globalBasis.rootBasis().localView())
│ │ │ │ +
62 {
│ │ │ │ +
63// static_assert(models<Concept::BasisTree<GridView>, Tree>(), "Tree type passed to SubspaceLocalView does not model the BasisNode concept.");
│ │ │ │ +
64 }
│ │ │ │ +
│ │ │ │ +
65
│ │ │ │ +
│ │ │ │ +
71 void bind(const Element& e)
│ │ │ │ +
72 {
│ │ │ │ +
73 rootLocalView_.bind(e);
│ │ │ │ +
74 }
│ │ │ │ +
│ │ │ │ +
75
│ │ │ │ +
│ │ │ │ +
80 const Element& element() const
│ │ │ │ +
81 {
│ │ │ │ +
82 return rootLocalView_.element();
│ │ │ │ +
83 }
│ │ │ │ +
│ │ │ │ +
84
│ │ │ │ +
│ │ │ │ +
89 void unbind()
│ │ │ │ +
90 {
│ │ │ │ +
91 rootLocalView_.unbind();
│ │ │ │ +
92 }
│ │ │ │ +
│ │ │ │ +
93
│ │ │ │ +
│ │ │ │ +
96 bool bound() const
│ │ │ │ +
97 {
│ │ │ │ +
98 return rootLocalView_.bound();
│ │ │ │ +
99 }
│ │ │ │ +
│ │ │ │ +
100
│ │ │ │ +
│ │ │ │ +
105 const Tree& tree() const
│ │ │ │ +
106 {
│ │ │ │ +
107 return TypeTree::child(rootLocalView_.tree(), globalBasis_->prefixPath());
│ │ │ │ +
108 }
│ │ │ │ +
│ │ │ │ +
109
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
113 {
│ │ │ │ +
114 return rootLocalView_.size();
│ │ │ │ +
115 }
│ │ │ │ +
│ │ │ │ +
116
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
124 {
│ │ │ │ +
125 return rootLocalView_.maxSize();
│ │ │ │ +
126 }
│ │ │ │ +
│ │ │ │ +
127
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
130 {
│ │ │ │ +
131 return rootLocalView_.index(i);
│ │ │ │ +
132 }
│ │ │ │ +
│ │ │ │ +
133
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
137 {
│ │ │ │ +
138 return *globalBasis_;
│ │ │ │ +
139 }
│ │ │ │ +
│ │ │ │ +
140
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
142 {
│ │ │ │ +
143 return rootLocalView_;
│ │ │ │ +
144 }
│ │ │ │ +
│ │ │ │ +
145
│ │ │ │ +
146protected:
│ │ │ │ + │ │ │ │ + │ │ │ │ +
149};
│ │ │ │ +
│ │ │ │ +
150
│ │ │ │ +
151
│ │ │ │ +
152
│ │ │ │ +
153} // end namespace Functions
│ │ │ │ +
154} // end namespace Dune
│ │ │ │ +
155
│ │ │ │ +
156
│ │ │ │ +
157
│ │ │ │ +
158#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
constexpr bool IsReferenceWrapper_v
This is an alias for Dune::IsReferenceWrapper_v.
Definition referencehelper.hh:26
│ │ │ │ -
Dune::ResolveRef_t< T > ResolveRef_t
This is an alias for Dune::ResolveRef_t.
Definition referencehelper.hh:49
│ │ │ │ -
decltype(auto) resolveRef(T &&t)
This is an alias for Dune::resolveRef.
Definition referencehelper.hh:37
│ │ │ │ +
SubspaceBasis(const RB &, const TP) -> SubspaceBasis< RB, TP >
│ │ │ │ +
Definition subspacebasis.hh:38
│ │ │ │ +
typename RootBasis::GridView GridView
The grid view that the FE space is defined on.
Definition subspacebasis.hh:48
│ │ │ │ +
const PrefixPath & prefixPath() const
Definition subspacebasis.hh:118
│ │ │ │ +
The restriction of a finite element basis to a single element.
Definition subspacelocalview.hh:30
│ │ │ │ +
typename TypeTree::ChildForTreePath< RootTree, PrefixPath > Tree
Tree of local finite elements / local shape function sets.
Definition subspacelocalview.hh:53
│ │ │ │ +
void unbind()
Unbind from the current element.
Definition subspacelocalview.hh:89
│ │ │ │ +
const Element & element() const
Return the grid element that the view is bound to.
Definition subspacelocalview.hh:80
│ │ │ │ +
const GlobalBasis * globalBasis_
Definition subspacelocalview.hh:147
│ │ │ │ +
bool bound() const
Return if the view is bound to a grid element.
Definition subspacelocalview.hh:96
│ │ │ │ +
typename RootLocalView::MultiIndex MultiIndex
Type used for global numbering of the basis vectors.
Definition subspacelocalview.hh:56
│ │ │ │ +
size_type size() const
Total number of degrees of freedom on this element.
Definition subspacelocalview.hh:112
│ │ │ │ +
RootLocalView rootLocalView_
Definition subspacelocalview.hh:148
│ │ │ │ +
void bind(const Element &e)
Bind the view to a grid element.
Definition subspacelocalview.hh:71
│ │ │ │ +
typename GlobalBasis::GridView GridView
The grid view the global FE basis lives on.
Definition subspacelocalview.hh:41
│ │ │ │ +
SubspaceLocalView(const GlobalBasis &globalBasis, const PrefixPath &)
Construct local view for a given global finite element basis.
Definition subspacelocalview.hh:59
│ │ │ │ +
RLV RootLocalView
Definition subspacelocalview.hh:35
│ │ │ │ +
const RootLocalView & rootLocalView() const
Definition subspacelocalview.hh:141
│ │ │ │ +
std::size_t size_type
The type used for sizes.
Definition subspacelocalview.hh:47
│ │ │ │ +
typename GridView::template Codim< 0 >::Entity Element
Type of the grid element we are bound to.
Definition subspacelocalview.hh:44
│ │ │ │ +
const GlobalBasis & globalBasis() const
Return the global basis that we are a view on.
Definition subspacelocalview.hh:136
│ │ │ │ +
size_type maxSize() const
Maximum local size for any element on the GridView.
Definition subspacelocalview.hh:123
│ │ │ │ +
const Tree & tree() const
Return the local ansatz tree associated to the bound entity.
Definition subspacelocalview.hh:105
│ │ │ │ +
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:129
│ │ │ │ +
typename RootLocalView::Tree RootTree
Tree of local finite elements / local shape function sets.
Definition subspacelocalview.hh:50
│ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,74 +1,227 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -referencehelper.hh │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_COMMON_REFERENCE_HELPER_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_COMMON_REFERENCE_HELPER_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH │ │ │ │ │ 5 │ │ │ │ │ -6#warning The header dune/functions/common/referencehelper.hh is deprecated and │ │ │ │ │ -will be removed after release 2.9. Include dune/common/referencehelper.hh │ │ │ │ │ -instead. │ │ │ │ │ -7 │ │ │ │ │ -8#include │ │ │ │ │ -9 │ │ │ │ │ -10#include │ │ │ │ │ -11 │ │ │ │ │ +6 │ │ │ │ │ +7#include │ │ │ │ │ +8 │ │ │ │ │ +9#include │ │ │ │ │ +10 │ │ │ │ │ +11#include │ │ │ │ │ 12 │ │ │ │ │ -13 │ │ │ │ │ +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_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ │ 14 │ │ │ │ │ -15namespace _D_u_n_e { │ │ │ │ │ -16namespace Functions { │ │ │ │ │ -17 │ │ │ │ │ -18 │ │ │ │ │ -23template │ │ │ │ │ -24[[deprecated("Use Dune::IsReferenceWrapper_v instead. Will be removed after │ │ │ │ │ -release 2.9.")]] │ │ │ │ │ -25constexpr bool │ │ │ │ │ -_2_6_I_s_R_e_f_e_r_e_n_c_e_W_r_a_p_p_e_r___v = Dune::IsReferenceWrapper_v; │ │ │ │ │ -27 │ │ │ │ │ -28 │ │ │ │ │ -33template │ │ │ │ │ -34decltype(auto) │ │ │ │ │ -_3_5_r_e_s_o_l_v_e_R_e_f │ │ │ │ │ -36[[deprecated("Use Dune::resolveRef instead. Will be removed after release │ │ │ │ │ -2.9.")]] │ │ │ │ │ -37(T&& t) │ │ │ │ │ -38{ │ │ │ │ │ -39 return Dune::resolveRef(std::forward(t)); │ │ │ │ │ -40} │ │ │ │ │ -41 │ │ │ │ │ -46template │ │ │ │ │ -_4_7using _R_e_s_o_l_v_e_R_e_f___t │ │ │ │ │ -48[[deprecated("Use Dune::ResolveRef_t instead. Will be removed after release │ │ │ │ │ -2.9.")]] │ │ │ │ │ -49 = Dune::ResolveRef_t; │ │ │ │ │ -50 │ │ │ │ │ +15 │ │ │ │ │ +16 │ │ │ │ │ +17namespace _D_u_n_e { │ │ │ │ │ +18namespace Functions { │ │ │ │ │ +19 │ │ │ │ │ +20 │ │ │ │ │ +21 │ │ │ │ │ +22template │ │ │ │ │ +23class _S_u_b_s_p_a_c_e_B_a_s_i_s; │ │ │ │ │ +24 │ │ │ │ │ +25 │ │ │ │ │ +26 │ │ │ │ │ +28template │ │ │ │ │ +_2_9class _S_u_b_s_p_a_c_e_L_o_c_a_l_V_i_e_w │ │ │ │ │ +30{ │ │ │ │ │ +31 using PrefixPath = PP; │ │ │ │ │ +32 │ │ │ │ │ +33public: │ │ │ │ │ +34 │ │ │ │ │ +_3_5 using _R_o_o_t_L_o_c_a_l_V_i_e_w = RLV; │ │ │ │ │ +36 │ │ │ │ │ +_3_8 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_>; │ │ │ │ │ +39 │ │ │ │ │ +_4_1 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; │ │ │ │ │ +42 │ │ │ │ │ +_4_4 using _E_l_e_m_e_n_t = typename GridView::template Codim<0>::Entity; │ │ │ │ │ +45 │ │ │ │ │ +_4_7 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ +48 │ │ │ │ │ +_5_0 using _R_o_o_t_T_r_e_e = typename RootLocalView::Tree; │ │ │ │ │ 51 │ │ │ │ │ -52}} // namespace Dune::Functions │ │ │ │ │ -53 │ │ │ │ │ +_5_3 using _T_r_e_e = typename TypeTree::ChildForTreePath; │ │ │ │ │ 54 │ │ │ │ │ -55 │ │ │ │ │ -56#endif // DUNE_FUNCTIONS_COMMON_REFERENCE_HELPER_HH │ │ │ │ │ +_5_6 using _M_u_l_t_i_I_n_d_e_x = typename RootLocalView::MultiIndex; │ │ │ │ │ +57 │ │ │ │ │ +_5_9 _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*/) : │ │ │ │ │ +60 _g_l_o_b_a_l_B_a_s_i_s__(&_g_l_o_b_a_l_B_a_s_i_s), │ │ │ │ │ +61 _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()) │ │ │ │ │ +62 { │ │ │ │ │ +63// static_assert(models, Tree>(), "Tree type │ │ │ │ │ +passed to SubspaceLocalView does not model the BasisNode concept."); │ │ │ │ │ +64 } │ │ │ │ │ +65 │ │ │ │ │ +_7_1 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ │ +72 { │ │ │ │ │ +73 _r_o_o_t_L_o_c_a_l_V_i_e_w__.bind(e); │ │ │ │ │ +74 } │ │ │ │ │ +75 │ │ │ │ │ +_8_0 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ │ +81 { │ │ │ │ │ +82 return _r_o_o_t_L_o_c_a_l_V_i_e_w__.element(); │ │ │ │ │ +83 } │ │ │ │ │ +84 │ │ │ │ │ +_8_9 void _u_n_b_i_n_d() │ │ │ │ │ +90 { │ │ │ │ │ +91 _r_o_o_t_L_o_c_a_l_V_i_e_w__.unbind(); │ │ │ │ │ +92 } │ │ │ │ │ +93 │ │ │ │ │ +_9_6 bool _b_o_u_n_d() const │ │ │ │ │ +97 { │ │ │ │ │ +98 return _r_o_o_t_L_o_c_a_l_V_i_e_w__.bound(); │ │ │ │ │ +99 } │ │ │ │ │ +100 │ │ │ │ │ +_1_0_5 const _T_r_e_e& _t_r_e_e() const │ │ │ │ │ +106 { │ │ │ │ │ +107 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__->_p_r_e_f_i_x_P_a_t_h()); │ │ │ │ │ +108 } │ │ │ │ │ +109 │ │ │ │ │ +_1_1_2 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ │ +113 { │ │ │ │ │ +114 return _r_o_o_t_L_o_c_a_l_V_i_e_w__.size(); │ │ │ │ │ +115 } │ │ │ │ │ +116 │ │ │ │ │ +_1_2_3 _s_i_z_e___t_y_p_e _m_a_x_S_i_z_e() const │ │ │ │ │ +124 { │ │ │ │ │ +125 return _r_o_o_t_L_o_c_a_l_V_i_e_w__.maxSize(); │ │ │ │ │ +126 } │ │ │ │ │ +127 │ │ │ │ │ +_1_2_9 _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 │ │ │ │ │ +130 { │ │ │ │ │ +131 return _r_o_o_t_L_o_c_a_l_V_i_e_w__.index(i); │ │ │ │ │ +132 } │ │ │ │ │ +133 │ │ │ │ │ +_1_3_6 const _G_l_o_b_a_l_B_a_s_i_s& _g_l_o_b_a_l_B_a_s_i_s() const │ │ │ │ │ +137 { │ │ │ │ │ +138 return *_g_l_o_b_a_l_B_a_s_i_s__; │ │ │ │ │ +139 } │ │ │ │ │ +140 │ │ │ │ │ +_1_4_1 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 │ │ │ │ │ +142 { │ │ │ │ │ +143 return _r_o_o_t_L_o_c_a_l_V_i_e_w__; │ │ │ │ │ +144 } │ │ │ │ │ +145 │ │ │ │ │ +146protected: │ │ │ │ │ +_1_4_7 const _G_l_o_b_a_l_B_a_s_i_s* _g_l_o_b_a_l_B_a_s_i_s__; │ │ │ │ │ +_1_4_8 _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__; │ │ │ │ │ +149}; │ │ │ │ │ +150 │ │ │ │ │ +151 │ │ │ │ │ +152 │ │ │ │ │ +153} // end namespace Functions │ │ │ │ │ +154} // end namespace Dune │ │ │ │ │ +155 │ │ │ │ │ +156 │ │ │ │ │ +157 │ │ │ │ │ +158#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_I_s_R_e_f_e_r_e_n_c_e_W_r_a_p_p_e_r___v │ │ │ │ │ -constexpr bool IsReferenceWrapper_v │ │ │ │ │ -This is an alias for Dune::IsReferenceWrapper_v. │ │ │ │ │ -DDeeffiinniittiioonn referencehelper.hh:26 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_R_e_s_o_l_v_e_R_e_f___t │ │ │ │ │ -Dune::ResolveRef_t< T > ResolveRef_t │ │ │ │ │ -This is an alias for Dune::ResolveRef_t. │ │ │ │ │ -DDeeffiinniittiioonn referencehelper.hh:49 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_r_e_s_o_l_v_e_R_e_f │ │ │ │ │ -decltype(auto) resolveRef(T &&t) │ │ │ │ │ -This is an alias for Dune::resolveRef. │ │ │ │ │ -DDeeffiinniittiioonn referencehelper.hh:37 │ │ │ │ │ +_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 │ │ │ │ │ +DDeeffiinniittiioonn subspacebasis.hh:38 │ │ │ │ │ +_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:48 │ │ │ │ │ +_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 │ │ │ │ │ +const PrefixPath & prefixPath() const │ │ │ │ │ +DDeeffiinniittiioonn subspacebasis.hh:118 │ │ │ │ │ +_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:30 │ │ │ │ │ +_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 │ │ │ │ │ +typename TypeTree::ChildForTreePath< RootTree, PrefixPath > Tree │ │ │ │ │ +Tree of local finite elements / local shape function sets. │ │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.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_:_:_u_n_b_i_n_d │ │ │ │ │ +void unbind() │ │ │ │ │ +Unbind from the current element. │ │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:89 │ │ │ │ │ +_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:80 │ │ │ │ │ +_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_:_:_g_l_o_b_a_l_B_a_s_i_s__ │ │ │ │ │ +const GlobalBasis * globalBasis_ │ │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:147 │ │ │ │ │ +_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:96 │ │ │ │ │ +_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_u_l_t_i_I_n_d_e_x │ │ │ │ │ +typename RootLocalView::MultiIndex MultiIndex │ │ │ │ │ +Type used for global numbering of the basis vectors. │ │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:56 │ │ │ │ │ +_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:112 │ │ │ │ │ +_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__ │ │ │ │ │ +RootLocalView rootLocalView_ │ │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:148 │ │ │ │ │ +_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:71 │ │ │ │ │ +_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_:_:_G_r_i_d_V_i_e_w │ │ │ │ │ +typename GlobalBasis::GridView GridView │ │ │ │ │ +The grid view the global FE basis lives on. │ │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:41 │ │ │ │ │ +_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:59 │ │ │ │ │ +_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 │ │ │ │ │ +RLV RootLocalView │ │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:35 │ │ │ │ │ +_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:141 │ │ │ │ │ +_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___t_y_p_e │ │ │ │ │ +std::size_t size_type │ │ │ │ │ +The type used for sizes. │ │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:47 │ │ │ │ │ +_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 │ │ │ │ │ +typename GridView::template Codim< 0 >::Entity Element │ │ │ │ │ +Type of the grid element we are bound to. │ │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:44 │ │ │ │ │ +_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_:_:_g_l_o_b_a_l_B_a_s_i_s │ │ │ │ │ +const GlobalBasis & globalBasis() const │ │ │ │ │ +Return the global basis that we are a view on. │ │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:136 │ │ │ │ │ +_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:123 │ │ │ │ │ +_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:105 │ │ │ │ │ +_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:129 │ │ │ │ │ +_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_T_r_e_e │ │ │ │ │ +typename RootLocalView::Tree RootTree │ │ │ │ │ +Tree of local finite elements / local shape function sets. │ │ │ │ │ +DDeeffiinniittiioonn subspacelocalview.hh:50 │ │ │ │ │ +_c_o_n_c_e_p_t_s_._h_h │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00110.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: interfaces.hh File Reference │ │ │ │ +dune-functions: boundarydofs.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,40 +65,42 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ -Namespaces
│ │ │ │ -
interfaces.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Functions
│ │ │ │ +
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.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,22 +1,26 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -interfaces.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +_N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +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. │ │ │ │ │ +  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00110_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: interfaces.hh Source File │ │ │ │ +dune-functions: boundarydofs.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,64 +70,105 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
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#ifndef DUNE_FUNCTIONS_COMMON_INTERFACES_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_COMMON_INTERFACES_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH
│ │ │ │
5
│ │ │ │ -
6#include <type_traits>
│ │ │ │ +
6#include <utility>
│ │ │ │
7
│ │ │ │ -
8
│ │ │ │ -
9namespace Dune {
│ │ │ │ -
10namespace Functions {
│ │ │ │ -
11
│ │ │ │ + │ │ │ │ +
9
│ │ │ │ +
10namespace Dune {
│ │ │ │ +
11namespace Functions {
│ │ │ │
12
│ │ │ │
13
│ │ │ │ -
23template<class Interface>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
25{
│ │ │ │ -
26public:
│ │ │ │ -
27
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
30 {}
│ │ │ │ -
│ │ │ │ -
31
│ │ │ │ -
40 virtual Interface* clone() const = 0;
│ │ │ │ -
41
│ │ │ │ -
51 virtual Interface* clone(void* buffer) const = 0;
│ │ │ │ -
52
│ │ │ │ -
62 virtual Interface* move(void* buffer) = 0;
│ │ │ │ -
63};
│ │ │ │ +
14
│ │ │ │ +
34template<class Basis, class F,
│ │ │ │ +
35 decltype(std::declval<std::decay_t<F>>()(0, std::declval<typename Basis::LocalView>(),std::declval<typename Basis::GridView::Intersection>()), 0) = 0>
│ │ │ │ +
│ │ │ │ +
36void forEachBoundaryDOF(const Basis& basis, F&& f)
│ │ │ │ +
37{
│ │ │ │ +
38 auto localView = basis.localView();
│ │ │ │ +
39 auto seDOFs = subEntityDOFs(basis);
│ │ │ │ +
40 const auto& gridView = basis.gridView();
│ │ │ │ +
41 for(auto&& element : elements(gridView))
│ │ │ │ +
42 if (element.hasBoundaryIntersections())
│ │ │ │ +
43 {
│ │ │ │ +
44 localView.bind(element);
│ │ │ │ +
45 for(const auto& intersection: intersections(gridView, element))
│ │ │ │ +
46 if (intersection.boundary())
│ │ │ │ +
47 for(auto localIndex: seDOFs.bind(localView,intersection))
│ │ │ │ +
48 f(localIndex, localView, intersection);
│ │ │ │ +
49 }
│ │ │ │ +
50}
│ │ │ │
│ │ │ │ -
64
│ │ │ │ -
65
│ │ │ │ -
66
│ │ │ │ -
67}} // namespace Dune::Functions
│ │ │ │ -
68
│ │ │ │ -
69#endif // DUNE_FUNCTIONS_COMMON_EXTENDED_CLONEABLE_HH
│ │ │ │ +
51
│ │ │ │ +
52
│ │ │ │ +
53
│ │ │ │ +
71template<class Basis, class F,
│ │ │ │ +
72 decltype(std::declval<std::decay_t<F>>()(0, std::declval<typename Basis::LocalView>()),0) = 0>
│ │ │ │ +
73void forEachBoundaryDOF(const Basis& basis, F&& f)
│ │ │ │ +
74{
│ │ │ │ +
75 auto localView = basis.localView();
│ │ │ │ +
76 auto seDOFs = subEntityDOFs(basis);
│ │ │ │ +
77 const auto& gridView = basis.gridView();
│ │ │ │ +
78 for(auto&& element : elements(gridView))
│ │ │ │ +
79 if (element.hasBoundaryIntersections())
│ │ │ │ +
80 {
│ │ │ │ +
81 localView.bind(element);
│ │ │ │ +
82 for(const auto& intersection: intersections(gridView, element))
│ │ │ │ +
83 if (intersection.boundary())
│ │ │ │ +
84 for(auto localIndex: seDOFs.bind(localView,intersection))
│ │ │ │ +
85 f(localIndex, localView);
│ │ │ │ +
86 }
│ │ │ │ +
87}
│ │ │ │ +
88
│ │ │ │ +
89
│ │ │ │ +
90
│ │ │ │ +
107template<class Basis, class F,
│ │ │ │ +
108 decltype(std::declval<std::decay_t<F>>()(std::declval<typename Basis::MultiIndex>()),0) = 0>
│ │ │ │ +
109void forEachBoundaryDOF(const Basis& basis, F&& f)
│ │ │ │ +
110{
│ │ │ │ +
111 auto localView = basis.localView();
│ │ │ │ +
112 auto seDOFs = subEntityDOFs(basis);
│ │ │ │ +
113 const auto& gridView = basis.gridView();
│ │ │ │ +
114 for(auto&& element : elements(gridView))
│ │ │ │ +
115 if (element.hasBoundaryIntersections())
│ │ │ │ +
116 {
│ │ │ │ +
117 localView.bind(element);
│ │ │ │ +
118 for(const auto& intersection: intersections(gridView, element))
│ │ │ │ +
119 if (intersection.boundary())
│ │ │ │ +
120 for(auto localIndex: seDOFs.bind(localView,intersection))
│ │ │ │ +
121 f(localView.index(localIndex));
│ │ │ │ +
122 }
│ │ │ │ +
123}
│ │ │ │ +
124
│ │ │ │ +
125
│ │ │ │ +
126
│ │ │ │ +
127} // namespace Functions
│ │ │ │ +
128} // namespace Dune
│ │ │ │ +
129
│ │ │ │ +
130#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH
│ │ │ │ + │ │ │ │ +
auto subEntityDOFs(const T &)
Create SubEntityDOFs object.
Definition subentitydofs.hh:160
│ │ │ │ +
void forEachBoundaryDOF(const Basis &basis, F &&f)
Loop over all DOFs on the boundary.
Definition boundarydofs.hh:36
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
Base class with polymorphic type boiler plate code.
Definition interfaces.hh:25
│ │ │ │ -
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:29
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,62 +1,103 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -interfaces.hh │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_COMMON_INTERFACES_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_COMMON_INTERFACES_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ +6#include │ │ │ │ │ 7 │ │ │ │ │ -8 │ │ │ │ │ -9namespace _D_u_n_e { │ │ │ │ │ -10namespace Functions { │ │ │ │ │ -11 │ │ │ │ │ +8#include <_d_u_n_e_/_f_u_n_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> │ │ │ │ │ +9 │ │ │ │ │ +10namespace _D_u_n_e { │ │ │ │ │ +11namespace Functions { │ │ │ │ │ 12 │ │ │ │ │ 13 │ │ │ │ │ -23template │ │ │ │ │ -_2_4class _P_o_l_y_m_o_r_p_h_i_c_T_y_p_e │ │ │ │ │ -25{ │ │ │ │ │ -26public: │ │ │ │ │ -27 │ │ │ │ │ -_2_9 virtual _~_P_o_l_y_m_o_r_p_h_i_c_T_y_p_e() │ │ │ │ │ -30 {} │ │ │ │ │ -31 │ │ │ │ │ -_4_0 virtual Interface* _c_l_o_n_e() const = 0; │ │ │ │ │ -41 │ │ │ │ │ -_5_1 virtual Interface* _c_l_o_n_e(void* buffer) const = 0; │ │ │ │ │ +14 │ │ │ │ │ +34template>()(0, std::declval(),std::declval()), 0) = 0> │ │ │ │ │ +_3_6void _f_o_r_E_a_c_h_B_o_u_n_d_a_r_y_D_O_F(const Basis& basis, F&& f) │ │ │ │ │ +37{ │ │ │ │ │ +38 auto localView = basis.localView(); │ │ │ │ │ +39 auto seDOFs = _s_u_b_E_n_t_i_t_y_D_O_F_s(basis); │ │ │ │ │ +40 const auto& gridView = basis.gridView(); │ │ │ │ │ +41 for(auto&& element : elements(gridView)) │ │ │ │ │ +42 if (element.hasBoundaryIntersections()) │ │ │ │ │ +43 { │ │ │ │ │ +44 localView.bind(element); │ │ │ │ │ +45 for(const auto& intersection: intersections(gridView, element)) │ │ │ │ │ +46 if (intersection.boundary()) │ │ │ │ │ +47 for(auto localIndex: seDOFs.bind(localView,intersection)) │ │ │ │ │ +48 f(localIndex, localView, intersection); │ │ │ │ │ +49 } │ │ │ │ │ +50} │ │ │ │ │ +51 │ │ │ │ │ 52 │ │ │ │ │ -_6_2 virtual Interface* _m_o_v_e(void* buffer) = 0; │ │ │ │ │ -63}; │ │ │ │ │ -64 │ │ │ │ │ -65 │ │ │ │ │ -66 │ │ │ │ │ -67}} // namespace Dune::Functions │ │ │ │ │ -68 │ │ │ │ │ -69#endif // DUNE_FUNCTIONS_COMMON_EXTENDED_CLONEABLE_HH │ │ │ │ │ +53 │ │ │ │ │ +71template>()(0, std::declval()),0) = 0> │ │ │ │ │ +73void _f_o_r_E_a_c_h_B_o_u_n_d_a_r_y_D_O_F(const Basis& basis, F&& f) │ │ │ │ │ +74{ │ │ │ │ │ +75 auto localView = basis.localView(); │ │ │ │ │ +76 auto seDOFs = _s_u_b_E_n_t_i_t_y_D_O_F_s(basis); │ │ │ │ │ +77 const auto& gridView = basis.gridView(); │ │ │ │ │ +78 for(auto&& element : elements(gridView)) │ │ │ │ │ +79 if (element.hasBoundaryIntersections()) │ │ │ │ │ +80 { │ │ │ │ │ +81 localView.bind(element); │ │ │ │ │ +82 for(const auto& intersection: intersections(gridView, element)) │ │ │ │ │ +83 if (intersection.boundary()) │ │ │ │ │ +84 for(auto localIndex: seDOFs.bind(localView,intersection)) │ │ │ │ │ +85 f(localIndex, localView); │ │ │ │ │ +86 } │ │ │ │ │ +87} │ │ │ │ │ +88 │ │ │ │ │ +89 │ │ │ │ │ +90 │ │ │ │ │ +107template>()(std::declval()),0) = 0> │ │ │ │ │ +109void _f_o_r_E_a_c_h_B_o_u_n_d_a_r_y_D_O_F(const Basis& basis, F&& f) │ │ │ │ │ +110{ │ │ │ │ │ +111 auto localView = basis.localView(); │ │ │ │ │ +112 auto seDOFs = _s_u_b_E_n_t_i_t_y_D_O_F_s(basis); │ │ │ │ │ +113 const auto& gridView = basis.gridView(); │ │ │ │ │ +114 for(auto&& element : elements(gridView)) │ │ │ │ │ +115 if (element.hasBoundaryIntersections()) │ │ │ │ │ +116 { │ │ │ │ │ +117 localView.bind(element); │ │ │ │ │ +118 for(const auto& intersection: intersections(gridView, element)) │ │ │ │ │ +119 if (intersection.boundary()) │ │ │ │ │ +120 for(auto localIndex: seDOFs.bind(localView,intersection)) │ │ │ │ │ +121 f(localView.index(localIndex)); │ │ │ │ │ +122 } │ │ │ │ │ +123} │ │ │ │ │ +124 │ │ │ │ │ +125 │ │ │ │ │ +126 │ │ │ │ │ +127} // namespace Functions │ │ │ │ │ +128} // namespace Dune │ │ │ │ │ +129 │ │ │ │ │ +130#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:160 │ │ │ │ │ +_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:36 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:25 │ │ │ │ │ -_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:29 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00113.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: multiindex.hh File Reference │ │ │ │ +dune-functions: flatvectorview.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,55 +65,53 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ Namespaces | │ │ │ │ Functions
│ │ │ │ -
multiindex.hh File Reference
│ │ │ │ +
flatvectorview.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <cstddef>
│ │ │ │ -#include <array>
│ │ │ │ -#include <iostream>
│ │ │ │ -#include <dune/common/hash.hh>
│ │ │ │ +
#include <array>
│ │ │ │ +#include <dune/common/concept.hh>
│ │ │ │ +#include <dune/common/hybridutilities.hh>
│ │ │ │ +#include <dune/common/indices.hh>
│ │ │ │ +#include <dune/functions/functionspacebases/concepts.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 > >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

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

│ │ │ │ Functions

template<typename Stream , class size_type , std::size_t n>
Stream & Dune::Functions::operator<< (Stream &stream, const StaticMultiIndex< size_type, n > &c)
 
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.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,35 +1,35 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -multiindex.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +_N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +flatvectorview.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_/_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_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 │ │ │ │ │   │ │ │ │ │ FFuunnccttiioonnss │ │ │ │ │ -template │ │ │ │ │ -Stream &  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_o_p_e_r_a_t_o_r_<_< (Stream &stream, const _S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x< │ │ │ │ │ - size_type, n > &c) │ │ │ │ │ +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. │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00113_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: multiindex.hh Source File │ │ │ │ +dune-functions: flatvectorview.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,118 +70,219 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
multiindex.hh
│ │ │ │ +
flatvectorview.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#ifndef DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH
│ │ │ │
5
│ │ │ │ -
6#include <cstddef>
│ │ │ │ +
6
│ │ │ │
7#include <array>
│ │ │ │ -
8#include <iostream>
│ │ │ │ -
9
│ │ │ │ -
10#include <dune/common/hash.hh>
│ │ │ │ -
11
│ │ │ │ +
8
│ │ │ │ +
9#include <dune/common/concept.hh>
│ │ │ │ +
10#include <dune/common/hybridutilities.hh>
│ │ │ │ +
11#include <dune/common/indices.hh>
│ │ │ │
12
│ │ │ │ -
13namespace Dune::Functions {
│ │ │ │ + │ │ │ │
14
│ │ │ │
15
│ │ │ │
16
│ │ │ │ -
22template<class size_type, std::size_t n>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
24 public std::array<size_type, n>
│ │ │ │ +
17
│ │ │ │ +
18namespace Dune {
│ │ │ │ +
19namespace Functions {
│ │ │ │ +
20namespace Impl {
│ │ │ │ +
21
│ │ │ │ +
22
│ │ │ │ +
23template<class V>
│ │ │ │ +
24struct FlatVectorBackend
│ │ │ │
25{
│ │ │ │ -
26public:
│ │ │ │ -
27 static constexpr std::size_t size() { return n; }
│ │ │ │ -
28
│ │ │ │ -
│ │ │ │ -
29 inline friend std::size_t hash_value(const StaticMultiIndex& v) noexcept {
│ │ │ │ -
30 return hash_range(v.begin(), v.end());
│ │ │ │ -
31 }
│ │ │ │ -
│ │ │ │ -
32
│ │ │ │ -
33};
│ │ │ │ -
│ │ │ │ -
34
│ │ │ │ -
35
│ │ │ │ -
36
│ │ │ │ -
46template<class size_type>
│ │ │ │ -
│ │ │ │ -
47class StaticMultiIndex<size_type,1> :
│ │ │ │ -
48 public std::array<size_type, 1>
│ │ │ │ -
49{
│ │ │ │ -
50public:
│ │ │ │ -
51
│ │ │ │ -
52 static constexpr std::size_t size() { return 1; }
│ │ │ │ -
53
│ │ │ │ -
│ │ │ │ -
54 operator const size_type& () const {
│ │ │ │ -
55 return (*this)[0];
│ │ │ │ -
56 }
│ │ │ │ -
│ │ │ │ +
26
│ │ │ │ +
27 template<class VV, class Index,
│ │ │ │ +
28 typename std::enable_if< models<Concept::HasIndexAccess, VV, Index>(), int>::type = 0>
│ │ │ │ +
29 static decltype(auto) getEntry(VV&& v, const Index& i)
│ │ │ │ +
30 {
│ │ │ │ +
31 return v[i];
│ │ │ │ +
32 }
│ │ │ │ +
33
│ │ │ │ +
34 template<class VV, class Index,
│ │ │ │ +
35 typename std::enable_if< not models<Concept::HasIndexAccess, VV, Index>(), int>::type = 0>
│ │ │ │ +
36 static decltype(auto) getEntry(VV&& v, const Index&)
│ │ │ │ +
37 {
│ │ │ │ +
38 return std::forward<VV>(v);
│ │ │ │ +
39 }
│ │ │ │ +
40
│ │ │ │ +
41 template<class VV,
│ │ │ │ +
42 typename std::enable_if< models<Concept::HasSizeMethod, VV>(), int>::type = 0>
│ │ │ │ +
43 static auto size(VV&& v)
│ │ │ │ +
44 {
│ │ │ │ +
45 return Dune::Hybrid::size(v);
│ │ │ │ +
46 }
│ │ │ │ +
47
│ │ │ │ +
48 template<class VV,
│ │ │ │ +
49 typename std::enable_if< not models<Concept::HasSizeMethod, VV>(), int>::type = 0>
│ │ │ │ +
50 static auto size(VV&&)
│ │ │ │ +
51 {
│ │ │ │ +
52 return Dune::index_constant<1>{};
│ │ │ │ +
53 }
│ │ │ │ +
54};
│ │ │ │ +
55
│ │ │ │ +
56
│ │ │ │
57
│ │ │ │ -
│ │ │ │ -
58 inline friend std::size_t hash_value(const StaticMultiIndex& v) noexcept {
│ │ │ │ -
59 return hash_range(v.begin(), v.end());
│ │ │ │ -
60 }
│ │ │ │ -
│ │ │ │ -
61
│ │ │ │ -
│ │ │ │ -
62 operator size_type& () {
│ │ │ │ -
63 return (*this)[0];
│ │ │ │ -
64 }
│ │ │ │ -
│ │ │ │ -
65
│ │ │ │ -
66};
│ │ │ │ -
│ │ │ │ -
67
│ │ │ │ +
58
│ │ │ │ +
59template<class K, int n, int m>
│ │ │ │ +
60struct FlatVectorBackend<typename Dune::FieldMatrix<K, n, m> >
│ │ │ │ +
61{
│ │ │ │ +
62
│ │ │ │ +
63 template<class VV, class Index>
│ │ │ │ +
64 static decltype(auto) getEntry(VV&& v, const Index& i)
│ │ │ │ +
65 {
│ │ │ │ +
66 return v[i/m][i%m];
│ │ │ │ +
67 }
│ │ │ │
68
│ │ │ │ -
69
│ │ │ │ -
70template<typename Stream, class size_type, std::size_t n>
│ │ │ │ -
│ │ │ │ -
71inline Stream& operator<<(Stream& stream, const StaticMultiIndex<size_type,n>& c) {
│ │ │ │ -
72 for (const auto& ci : c)
│ │ │ │ -
73 stream << ci << " ";
│ │ │ │ -
74 return stream;
│ │ │ │ -
75}
│ │ │ │ -
│ │ │ │ +
69 template<class VV>
│ │ │ │ +
70 static auto size(VV&& v)
│ │ │ │ +
71 {
│ │ │ │ +
72 return Dune::index_constant<n*m>{};
│ │ │ │ +
73 }
│ │ │ │ +
74};
│ │ │ │ +
75
│ │ │ │
76
│ │ │ │
77
│ │ │ │ -
78
│ │ │ │ -
79} // namespace Dune::Functions
│ │ │ │ -
80
│ │ │ │ -
81template<class size_type, std::size_t n>
│ │ │ │ -
│ │ │ │ -
82struct std::tuple_size< Dune::Functions::StaticMultiIndex<size_type,n> >
│ │ │ │ -
83 : std::integral_constant<std::size_t, n> { };
│ │ │ │ -
│ │ │ │ -
84
│ │ │ │ -
85DUNE_DEFINE_HASH(DUNE_HASH_TEMPLATE_ARGS(typename size_type, std::size_t n),DUNE_HASH_TYPE(Dune::Functions::StaticMultiIndex<size_type,n>))
│ │ │ │ -
86
│ │ │ │ -
87#endif // DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH
│ │ │ │ +
78template<class K, std::size_t n>
│ │ │ │ +
79struct FlatVectorBackend< std::array<K, n> >
│ │ │ │ +
80{
│ │ │ │ +
81
│ │ │ │ +
82 template<class VV, class Index>
│ │ │ │ +
83 static decltype(auto) getEntry(VV&& v, const Index& i)
│ │ │ │ +
84 {
│ │ │ │ +
85 const auto innerSize = decltype(FlatVectorBackend<K>::size(v[0]))::value;
│ │ │ │ +
86 return FlatVectorBackend<K>::getEntry(v[i/innerSize], i%innerSize);
│ │ │ │ +
87 }
│ │ │ │ +
88
│ │ │ │ +
89 template<class VV>
│ │ │ │ +
90 static auto size(VV&& v)
│ │ │ │ +
91 {
│ │ │ │ +
92 const auto innerSize = decltype(FlatVectorBackend<K>::size(v[0]))::value;
│ │ │ │ +
93 return Dune::index_constant<n*innerSize>{};
│ │ │ │ +
94 }
│ │ │ │ +
95
│ │ │ │ +
96};
│ │ │ │ +
97
│ │ │ │ +
98
│ │ │ │ +
99
│ │ │ │ +
100
│ │ │ │ +
101template<class T>
│ │ │ │ +
102class FlatVectorView
│ │ │ │ +
103{
│ │ │ │ +
104 using Backend = FlatVectorBackend<std::decay_t<T>>;
│ │ │ │ +
105public:
│ │ │ │ +
106 FlatVectorView(T& t) :
│ │ │ │ +
107 t_(&t)
│ │ │ │ +
108 {}
│ │ │ │ +
109
│ │ │ │ +
110 auto size() const
│ │ │ │ +
111 {
│ │ │ │ +
112 return Backend::size(*t_);
│ │ │ │ +
113 }
│ │ │ │ +
114
│ │ │ │ +
115 template<class Index>
│ │ │ │ +
116 decltype(auto) operator[](const Index& i) const
│ │ │ │ +
117 {
│ │ │ │ +
118 return Backend::getEntry(*t_, i);
│ │ │ │ +
119 }
│ │ │ │ +
120
│ │ │ │ +
121 template<class Index>
│ │ │ │ +
122 decltype(auto) operator[](const Index& i)
│ │ │ │ +
123 {
│ │ │ │ +
124 return Backend::getEntry(*t_, i);
│ │ │ │ +
125 }
│ │ │ │ +
126
│ │ │ │ +
127private:
│ │ │ │ +
128 T* t_;
│ │ │ │ +
129};
│ │ │ │ +
130
│ │ │ │ +
131
│ │ │ │ +
132template<class T>
│ │ │ │ +
133class FlatVectorView<T&&>
│ │ │ │ +
134{
│ │ │ │ +
135 using Backend = FlatVectorBackend<std::decay_t<T>>;
│ │ │ │ +
136public:
│ │ │ │ +
137 FlatVectorView(T&& t) :
│ │ │ │ +
138 t_(std::move(t))
│ │ │ │ +
139 {}
│ │ │ │ +
140
│ │ │ │ +
141 auto size() const
│ │ │ │ +
142 {
│ │ │ │ +
143 return Backend::size(t_);
│ │ │ │ +
144 }
│ │ │ │ +
145
│ │ │ │ +
146 template<class Index>
│ │ │ │ +
147 decltype(auto) operator[](const Index& i) const
│ │ │ │ +
148 {
│ │ │ │ +
149 return Backend::getEntry(t_, i);
│ │ │ │ +
150 }
│ │ │ │ +
151
│ │ │ │ +
152 template<class Index>
│ │ │ │ +
153 decltype(auto) operator[](const Index& i)
│ │ │ │ +
154 {
│ │ │ │ +
155 return Backend::getEntry(t_, i);
│ │ │ │ +
156 }
│ │ │ │ +
157
│ │ │ │ +
158private:
│ │ │ │ +
159 T t_;
│ │ │ │ +
160};
│ │ │ │ +
161
│ │ │ │ +
162} // namespace Impl
│ │ │ │ +
163
│ │ │ │ +
164
│ │ │ │ +
165
│ │ │ │ +
178template<class T>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
180{
│ │ │ │ +
181 return Impl::FlatVectorView<T>(t);
│ │ │ │ +
182}
│ │ │ │ +
│ │ │ │ +
183
│ │ │ │ +
196template<class T>
│ │ │ │ +
│ │ │ │ +
197auto flatVectorView(const T& t)
│ │ │ │ +
198{
│ │ │ │ +
199 return Impl::FlatVectorView<const T>(t);
│ │ │ │ +
200}
│ │ │ │ +
│ │ │ │ +
201
│ │ │ │ +
214template<class T>
│ │ │ │ +
│ │ │ │ +
215auto flatVectorView(T&& t)
│ │ │ │ +
216{
│ │ │ │ +
217 return Impl::FlatVectorView<T&&>(std::move(t));
│ │ │ │ +
218}
│ │ │ │ +
│ │ │ │ +
219
│ │ │ │ +
220
│ │ │ │ +
221} // namespace Dune::Functions
│ │ │ │ +
222} // namespace Dune
│ │ │ │ +
223
│ │ │ │ +
224
│ │ │ │ +
225#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
Definition polynomial.hh:11
│ │ │ │ -
Stream & operator<<(Stream &stream, const StaticMultiIndex< size_type, n > &c)
Definition multiindex.hh:71
│ │ │ │ -
A statically sized MultiIndex type.
Definition multiindex.hh:25
│ │ │ │ -
static constexpr std::size_t size()
Definition multiindex.hh:27
│ │ │ │ -
friend std::size_t hash_value(const StaticMultiIndex &v) noexcept
Definition multiindex.hh:29
│ │ │ │ -
static constexpr std::size_t size()
Definition multiindex.hh:52
│ │ │ │ -
friend std::size_t hash_value(const StaticMultiIndex &v) noexcept
Definition multiindex.hh:58
│ │ │ │ +
auto flatVectorView(T &t)
Create flat vector view of passed mutable container.
Definition flatvectorview.hh:179
│ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,108 +1,211 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -multiindex.hh │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +flatvectorview.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#ifndef DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ +6 │ │ │ │ │ 7#include │ │ │ │ │ -8#include │ │ │ │ │ -9 │ │ │ │ │ -10#include │ │ │ │ │ -11 │ │ │ │ │ +8 │ │ │ │ │ +9#include │ │ │ │ │ +10#include │ │ │ │ │ +11#include │ │ │ │ │ 12 │ │ │ │ │ -13namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ │ +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_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ │ 14 │ │ │ │ │ 15 │ │ │ │ │ 16 │ │ │ │ │ -22template │ │ │ │ │ -_2_3class _S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x : │ │ │ │ │ -24 public std::array │ │ │ │ │ +17 │ │ │ │ │ +18namespace _D_u_n_e { │ │ │ │ │ +19namespace Functions { │ │ │ │ │ +20namespace Impl { │ │ │ │ │ +21 │ │ │ │ │ +22 │ │ │ │ │ +23template │ │ │ │ │ +24struct FlatVectorBackend │ │ │ │ │ 25{ │ │ │ │ │ -26public: │ │ │ │ │ -_2_7 static constexpr std::size_t _s_i_z_e() { return n; } │ │ │ │ │ -28 │ │ │ │ │ -_2_9 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 { │ │ │ │ │ -30 return hash_range(v.begin(), v.end()); │ │ │ │ │ -31 } │ │ │ │ │ -32 │ │ │ │ │ -33}; │ │ │ │ │ -34 │ │ │ │ │ -35 │ │ │ │ │ -36 │ │ │ │ │ -46template │ │ │ │ │ -_4_7class _S_t_a_t_i_c_M_u_l_t_i_I_n_d_e_x : │ │ │ │ │ -48 public std::array │ │ │ │ │ -49{ │ │ │ │ │ -50public: │ │ │ │ │ -51 │ │ │ │ │ -_5_2 static constexpr std::size_t _s_i_z_e() { return 1; } │ │ │ │ │ -53 │ │ │ │ │ -_5_4 operator const size_type& () const { │ │ │ │ │ -55 return (*this)[0]; │ │ │ │ │ -56 } │ │ │ │ │ +26 │ │ │ │ │ +27 template(), │ │ │ │ │ +int>::type = 0> │ │ │ │ │ +29 static decltype(auto) getEntry(VV&& v, const Index& i) │ │ │ │ │ +30 { │ │ │ │ │ +31 return v[i]; │ │ │ │ │ +32 } │ │ │ │ │ +33 │ │ │ │ │ +34 template(), │ │ │ │ │ +int>::type = 0> │ │ │ │ │ +36 static decltype(auto) getEntry(VV&& v, const Index&) │ │ │ │ │ +37 { │ │ │ │ │ +38 return std::forward(v); │ │ │ │ │ +39 } │ │ │ │ │ +40 │ │ │ │ │ +41 template(), int>::type = │ │ │ │ │ +0> │ │ │ │ │ +43 static auto size(VV&& v) │ │ │ │ │ +44 { │ │ │ │ │ +45 return Dune::Hybrid::size(v); │ │ │ │ │ +46 } │ │ │ │ │ +47 │ │ │ │ │ +48 template(), int>:: │ │ │ │ │ +type = 0> │ │ │ │ │ +50 static auto size(VV&&) │ │ │ │ │ +51 { │ │ │ │ │ +52 return Dune::index_constant<1>{}; │ │ │ │ │ +53 } │ │ │ │ │ +54}; │ │ │ │ │ +55 │ │ │ │ │ +56 │ │ │ │ │ 57 │ │ │ │ │ -_5_8 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 { │ │ │ │ │ -59 return hash_range(v.begin(), v.end()); │ │ │ │ │ -60 } │ │ │ │ │ -61 │ │ │ │ │ -_6_2 operator size_type& () { │ │ │ │ │ -63 return (*this)[0]; │ │ │ │ │ -64 } │ │ │ │ │ -65 │ │ │ │ │ -66}; │ │ │ │ │ -67 │ │ │ │ │ +58 │ │ │ │ │ +59template │ │ │ │ │ +60struct FlatVectorBackend > │ │ │ │ │ +61{ │ │ │ │ │ +62 │ │ │ │ │ +63 template │ │ │ │ │ +64 static decltype(auto) getEntry(VV&& v, const Index& i) │ │ │ │ │ +65 { │ │ │ │ │ +66 return v[i/m][i%m]; │ │ │ │ │ +67 } │ │ │ │ │ 68 │ │ │ │ │ -69 │ │ │ │ │ -70template │ │ │ │ │ -_7_1inline Stream& _o_p_e_r_a_t_o_r_<_<(Stream& 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) { │ │ │ │ │ -72 for (const auto& ci : c) │ │ │ │ │ -73 stream << ci << " "; │ │ │ │ │ -74 return stream; │ │ │ │ │ -75} │ │ │ │ │ +69 template │ │ │ │ │ +70 static auto size(VV&& v) │ │ │ │ │ +71 { │ │ │ │ │ +72 return Dune::index_constant{}; │ │ │ │ │ +73 } │ │ │ │ │ +74}; │ │ │ │ │ +75 │ │ │ │ │ 76 │ │ │ │ │ 77 │ │ │ │ │ -78 │ │ │ │ │ -79} // namespace Dune::Functions │ │ │ │ │ -80 │ │ │ │ │ -81template │ │ │ │ │ -_8_2struct std::tuple_size< _D_u_n_e::Functions::StaticMultiIndex > │ │ │ │ │ -83 : std::integral_constant { }; │ │ │ │ │ -84 │ │ │ │ │ -85DUNE_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_>)) │ │ │ │ │ -86 │ │ │ │ │ -87#endif // DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH │ │ │ │ │ +78template │ │ │ │ │ +79struct FlatVectorBackend< std::array > │ │ │ │ │ +80{ │ │ │ │ │ +81 │ │ │ │ │ +82 template │ │ │ │ │ +83 static decltype(auto) getEntry(VV&& v, const Index& i) │ │ │ │ │ +84 { │ │ │ │ │ +85 const auto innerSize = decltype(FlatVectorBackend::size(v[0]))::value; │ │ │ │ │ +86 return FlatVectorBackend::getEntry(v[i/innerSize], i%innerSize); │ │ │ │ │ +87 } │ │ │ │ │ +88 │ │ │ │ │ +89 template │ │ │ │ │ +90 static auto size(VV&& v) │ │ │ │ │ +91 { │ │ │ │ │ +92 const auto innerSize = decltype(FlatVectorBackend::size(v[0]))::value; │ │ │ │ │ +93 return Dune::index_constant{}; │ │ │ │ │ +94 } │ │ │ │ │ +95 │ │ │ │ │ +96}; │ │ │ │ │ +97 │ │ │ │ │ +98 │ │ │ │ │ +99 │ │ │ │ │ +100 │ │ │ │ │ +101template │ │ │ │ │ +102class FlatVectorView │ │ │ │ │ +103{ │ │ │ │ │ +104 using Backend = FlatVectorBackend>; │ │ │ │ │ +105public: │ │ │ │ │ +106 FlatVectorView(T& t) : │ │ │ │ │ +107 t_(&t) │ │ │ │ │ +108 {} │ │ │ │ │ +109 │ │ │ │ │ +110 auto size() const │ │ │ │ │ +111 { │ │ │ │ │ +112 return Backend::size(*t_); │ │ │ │ │ +113 } │ │ │ │ │ +114 │ │ │ │ │ +115 template │ │ │ │ │ +116 decltype(auto) operator[](const Index& i) const │ │ │ │ │ +117 { │ │ │ │ │ +118 return Backend::getEntry(*t_, i); │ │ │ │ │ +119 } │ │ │ │ │ +120 │ │ │ │ │ +121 template │ │ │ │ │ +122 decltype(auto) operator[](const Index& i) │ │ │ │ │ +123 { │ │ │ │ │ +124 return Backend::getEntry(*t_, i); │ │ │ │ │ +125 } │ │ │ │ │ +126 │ │ │ │ │ +127private: │ │ │ │ │ +128 T* t_; │ │ │ │ │ +129}; │ │ │ │ │ +130 │ │ │ │ │ +131 │ │ │ │ │ +132template │ │ │ │ │ +133class FlatVectorView │ │ │ │ │ +134{ │ │ │ │ │ +135 using Backend = FlatVectorBackend>; │ │ │ │ │ +136public: │ │ │ │ │ +137 FlatVectorView(T&& t) : │ │ │ │ │ +138 t_(std::move(t)) │ │ │ │ │ +139 {} │ │ │ │ │ +140 │ │ │ │ │ +141 auto size() const │ │ │ │ │ +142 { │ │ │ │ │ +143 return Backend::size(t_); │ │ │ │ │ +144 } │ │ │ │ │ +145 │ │ │ │ │ +146 template │ │ │ │ │ +147 decltype(auto) operator[](const Index& i) const │ │ │ │ │ +148 { │ │ │ │ │ +149 return Backend::getEntry(t_, i); │ │ │ │ │ +150 } │ │ │ │ │ +151 │ │ │ │ │ +152 template │ │ │ │ │ +153 decltype(auto) operator[](const Index& i) │ │ │ │ │ +154 { │ │ │ │ │ +155 return Backend::getEntry(t_, i); │ │ │ │ │ +156 } │ │ │ │ │ +157 │ │ │ │ │ +158private: │ │ │ │ │ +159 T t_; │ │ │ │ │ +160}; │ │ │ │ │ +161 │ │ │ │ │ +162} // namespace Impl │ │ │ │ │ +163 │ │ │ │ │ +164 │ │ │ │ │ +165 │ │ │ │ │ +178template │ │ │ │ │ +_1_7_9auto _f_l_a_t_V_e_c_t_o_r_V_i_e_w(T& t) │ │ │ │ │ +180{ │ │ │ │ │ +181 return Impl::FlatVectorView(t); │ │ │ │ │ +182} │ │ │ │ │ +183 │ │ │ │ │ +196template │ │ │ │ │ +_1_9_7auto _f_l_a_t_V_e_c_t_o_r_V_i_e_w(const T& t) │ │ │ │ │ +198{ │ │ │ │ │ +199 return Impl::FlatVectorView(t); │ │ │ │ │ +200} │ │ │ │ │ +201 │ │ │ │ │ +214template │ │ │ │ │ +_2_1_5auto _f_l_a_t_V_e_c_t_o_r_V_i_e_w(T&& t) │ │ │ │ │ +216{ │ │ │ │ │ +217 return Impl::FlatVectorView(std::move(t)); │ │ │ │ │ +218} │ │ │ │ │ +219 │ │ │ │ │ +220 │ │ │ │ │ +221} // namespace Dune::Functions │ │ │ │ │ +222} // namespace Dune │ │ │ │ │ +223 │ │ │ │ │ +224 │ │ │ │ │ +225#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ │ -DDeeffiinniittiioonn polynomial.hh:11 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_o_p_e_r_a_t_o_r_<_< │ │ │ │ │ -Stream & operator<<(Stream &stream, const StaticMultiIndex< size_type, n > &c) │ │ │ │ │ -DDeeffiinniittiioonn multiindex.hh:71 │ │ │ │ │ -_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:25 │ │ │ │ │ -_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:27 │ │ │ │ │ -_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:29 │ │ │ │ │ -_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:52 │ │ │ │ │ -_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:58 │ │ │ │ │ +_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:179 │ │ │ │ │ +_c_o_n_c_e_p_t_s_._h_h │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00116.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: utility.hh File Reference │ │ │ │ +dune-functions: globalvaluedlocalfiniteelement.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,97 +65,42 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ -Namespaces | │ │ │ │ -Typedefs | │ │ │ │ -Functions
│ │ │ │ -
utility.hh File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
globalvaluedlocalfiniteelement.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <utility>
│ │ │ │ -#include <type_traits>
│ │ │ │ -#include <dune/common/overloadset.hh>
│ │ │ │ -#include <dune/common/indices.hh>
│ │ │ │ -#include <dune/functions/common/functionconcepts.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/localfunctions/common/localinterpolation.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...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ │ 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,92 +1,27 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -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> │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +_N_a_m_e_s_p_a_c_e_s │ │ │ │ │ +globalvaluedlocalfiniteelement.hh File Reference │ │ │ │ │ +#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 │ │ │ │ │ -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< T, │ │ │ │ │ - ArgTuple >::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< F, │ │ │ │ │ - Tuples... >::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< IntegerSequence >::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. │ │ │ │ │ -  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00116_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: utility.hh Source File │ │ │ │ +dune-functions: globalvaluedlocalfiniteelement.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,308 +70,328 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
utility.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#ifndef DUNE_FUNCTIONS_COMMON_UTILITY_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_COMMON_UTILITY_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH
│ │ │ │
5
│ │ │ │ -
6
│ │ │ │ -
7#include <utility>
│ │ │ │ -
8#include <type_traits>
│ │ │ │ -
9
│ │ │ │ -
10#include <dune/common/overloadset.hh>
│ │ │ │ -
11#include <dune/common/indices.hh>
│ │ │ │ -
12
│ │ │ │ - │ │ │ │ -
14
│ │ │ │ -
15namespace Dune {
│ │ │ │ -
16namespace Functions {
│ │ │ │ -
17
│ │ │ │ -
18
│ │ │ │ +
6#include <array>
│ │ │ │ +
7#include <numeric>
│ │ │ │ +
8
│ │ │ │ +
9#include <dune/common/fmatrix.hh>
│ │ │ │ +
10#include <dune/common/fvector.hh>
│ │ │ │ +
11#include <dune/common/math.hh>
│ │ │ │ +
12#include <dune/common/rangeutilities.hh>
│ │ │ │ +
13
│ │ │ │ +
14#include <dune/geometry/referenceelements.hh>
│ │ │ │ +
15
│ │ │ │ +
16#include <dune/localfunctions/common/localbasis.hh>
│ │ │ │ +
17#include <dune/localfunctions/common/localfiniteelementtraits.hh>
│ │ │ │ +
18#include <dune/localfunctions/common/localinterpolation.hh>
│ │ │ │
19
│ │ │ │ -
20template<class F, class size_type, size_type firstValue, class... Args>
│ │ │ │ -
│ │ │ │ -
21auto forwardAsStaticInteger(std::integer_sequence<size_type, firstValue> values, const size_type& i, F&& f, Args&&... args)
│ │ │ │ -
22 ->decltype(f(std::integral_constant<size_type, firstValue>(), std::forward<Args>(args)...))
│ │ │ │ -
23{
│ │ │ │ -
24 return f(std::integral_constant<size_type, firstValue>(), std::forward<Args>(args)...);
│ │ │ │ -
25}
│ │ │ │ -
│ │ │ │ -
26
│ │ │ │ -
27template<class F, class size_type, size_type firstValue, size_type secondValue, size_type... otherValues, class... Args>
│ │ │ │ -
│ │ │ │ -
28auto forwardAsStaticInteger(std::integer_sequence<size_type, firstValue, secondValue, otherValues...> values, const size_type i, F&& f, Args&&... args)
│ │ │ │ -
29 ->decltype(f(std::integral_constant<size_type, firstValue>(), std::forward<Args>(args)...))
│ │ │ │ -
30{
│ │ │ │ -
31 if (i==firstValue)
│ │ │ │ -
32 return f(std::integral_constant<size_type, firstValue>(), std::forward<Args>(args)...);
│ │ │ │ -
33 return forwardAsStaticInteger(std::integer_sequence<size_type, secondValue, otherValues...>(), i, std::forward<F>(f), std::forward<Args>(args)...);
│ │ │ │ -
34}
│ │ │ │ -
│ │ │ │ -
35
│ │ │ │ -
36
│ │ │ │ -
37
│ │ │ │ -
59template<std::size_t end, class F, class size_type, class... Args>
│ │ │ │ -
│ │ │ │ -
60auto forwardAsStaticIndex(const size_type& i, F&& f, Args&&... args)
│ │ │ │ -
61 ->decltype(f(Dune::Indices::_0, std::forward<Args>(args)...))
│ │ │ │ -
62{
│ │ │ │ -
63 return forwardAsStaticInteger(std::make_index_sequence<end>{}, i, std::forward<F>(f), std::forward<Args>(args)...);
│ │ │ │ -
64}
│ │ │ │ -
│ │ │ │ -
65
│ │ │ │ -
66
│ │ │ │ -
67
│ │ │ │ -
68namespace Imp {
│ │ │ │ -
69
│ │ │ │ -
70 template<template<class...> class T, class List>
│ │ │ │ -
71 struct ExpandTupleHelper
│ │ │ │ -
72 {};
│ │ │ │ -
73
│ │ │ │ -
74 template<template<class...> class T, template<class...> class ListType, class... Args>
│ │ │ │ -
75 struct ExpandTupleHelper<T, ListType<Args...>>
│ │ │ │ -
76 {
│ │ │ │ -
77 using Type = T<Args...>;
│ │ │ │ -
78 };
│ │ │ │ -
79
│ │ │ │ -
80} // end namespace Imp
│ │ │ │ -
81
│ │ │ │ -
93template<template<class...> class T, class ArgTuple>
│ │ │ │ -
94using ExpandTuple = typename Imp::ExpandTupleHelper<T, ArgTuple>::Type;
│ │ │ │ -
95
│ │ │ │ -
96
│ │ │ │ -
97
│ │ │ │ -
98namespace Imp {
│ │ │ │ +
20namespace Dune::Functions::Impl
│ │ │ │ +
21{
│ │ │ │ +
22
│ │ │ │ +
36 struct ContravariantPiolaTransformator
│ │ │ │ +
37 {
│ │ │ │ +
42 template<typename Values, typename LocalCoordinate, typename Geometry>
│ │ │ │ +
43 static auto apply(Values& values,
│ │ │ │ +
44 const LocalCoordinate& xi,
│ │ │ │ +
45 const Geometry& geometry)
│ │ │ │ +
46 {
│ │ │ │ +
47 auto jacobianTransposed = geometry.jacobianTransposed(xi);
│ │ │ │ +
48 auto integrationElement = geometry.integrationElement(xi);
│ │ │ │ +
49
│ │ │ │ +
50 for (auto& value : values)
│ │ │ │ +
51 {
│ │ │ │ +
52 auto tmp = value;
│ │ │ │ +
53 jacobianTransposed.mtv(tmp, value);
│ │ │ │ +
54 value /= integrationElement;
│ │ │ │ +
55 }
│ │ │ │ +
56 }
│ │ │ │ +
57
│ │ │ │ +
67 template<typename Gradients, typename LocalCoordinate, typename Geometry>
│ │ │ │ +
68 static auto applyJacobian(Gradients& gradients,
│ │ │ │ +
69 const LocalCoordinate& xi,
│ │ │ │ +
70 const Geometry& geometry)
│ │ │ │ +
71 {
│ │ │ │ +
72 auto jacobianTransposed = geometry.jacobianTransposed(xi);
│ │ │ │ +
73 auto integrationElement = geometry.integrationElement(xi);
│ │ │ │ +
74 for (auto& gradient : gradients)
│ │ │ │ +
75 {
│ │ │ │ +
76 auto tmp = gradient;
│ │ │ │ +
77 gradient = 0;
│ │ │ │ +
78 for (size_t k=0; k<gradient.M(); k++)
│ │ │ │ +
79 for (size_t l=0; l<tmp.N(); l++)
│ │ │ │ +
80 // Use sparseRange because jacobianTransposed may be a sparse DiagonalMatrix
│ │ │ │ +
81 for(auto&& [jacobianTransposed_l_j, j] : sparseRange(jacobianTransposed[l]))
│ │ │ │ +
82 gradient[j][k] += jacobianTransposed_l_j * tmp[l][k];
│ │ │ │ +
83 gradient /= integrationElement;
│ │ │ │ +
84 }
│ │ │ │ +
85 }
│ │ │ │ +
86
│ │ │ │ +
94 template<class Function, class LocalCoordinate, class Element>
│ │ │ │ +
95 class LocalValuedFunction
│ │ │ │ +
96 {
│ │ │ │ +
97 const Function& f_;
│ │ │ │ +
98 const Element& element_;
│ │ │ │
99
│ │ │ │ -
100 template<template<class...> class T, class... Tuple>
│ │ │ │ -
101 struct TransformTupleHelper
│ │ │ │ -
102 {};
│ │ │ │ -
103
│ │ │ │ -
104 template<template<class...> class T, class... Args1>
│ │ │ │ -
105 struct TransformTupleHelper<T, typename std::tuple<Args1...>>
│ │ │ │ -
106 {
│ │ │ │ -
107 using Type = std::tuple<T<Args1>...>;
│ │ │ │ -
108 };
│ │ │ │ -
109
│ │ │ │ -
110 template<template<class...> class T, class... Args1, class... Args2>
│ │ │ │ -
111 struct TransformTupleHelper<T, typename std::tuple<Args1...>, typename std::tuple<Args2...>>
│ │ │ │ -
112 {
│ │ │ │ -
113 using Type = std::tuple<T<Args1, Args2>...>;
│ │ │ │ -
114 };
│ │ │ │ -
115
│ │ │ │ -
116} // end namespace Imp
│ │ │ │ -
117
│ │ │ │ -
130template<template<class...> class F, class... Tuples>
│ │ │ │ -
131using TransformTuple = typename Imp::TransformTupleHelper<F, Tuples...>::Type;
│ │ │ │ -
132
│ │ │ │ -
133
│ │ │ │ -
134
│ │ │ │ -
135namespace Imp {
│ │ │ │ -
136
│ │ │ │ -
137 template<class F, class... T, std::size_t... k>
│ │ │ │ -
138 auto transformTupleHelper(F&& f, const std::tuple<T...>& tuple, std::index_sequence<k...>)
│ │ │ │ -
139 -> decltype(std::make_tuple(f(std::get<k>(tuple))...))
│ │ │ │ -
140 {
│ │ │ │ -
141 return std::make_tuple(f(std::get<k>(tuple))...);
│ │ │ │ -
142 }
│ │ │ │ -
143
│ │ │ │ -
144 template<class F, class... T1, class...T2, std::size_t... k>
│ │ │ │ -
145 auto transformTupleHelper(F&& f, const std::tuple<T1...>& tuple1, const std::tuple<T2...>& tuple2, std::index_sequence<k...>)
│ │ │ │ -
146 -> decltype(std::make_tuple(f(std::get<k>(tuple1), std::get<k>(tuple2))...))
│ │ │ │ -
147 {
│ │ │ │ -
148 return std::make_tuple(f(std::get<k>(tuple1), std::get<k>(tuple2))...);
│ │ │ │ -
149 }
│ │ │ │ -
150
│ │ │ │ -
151} // end namespace Imp
│ │ │ │ -
152
│ │ │ │ -
164template<class F, class... T>
│ │ │ │ -
│ │ │ │ -
165auto transformTuple(F&& f, const std::tuple<T...>& tuple)
│ │ │ │ -
166 -> decltype(Imp::transformTupleHelper(std::forward<F>(f), tuple, std::index_sequence_for<T...>{}))
│ │ │ │ -
167{
│ │ │ │ -
168 return Imp::transformTupleHelper(std::forward<F>(f), tuple, std::index_sequence_for<T...>{});
│ │ │ │ -
169}
│ │ │ │ -
│ │ │ │ -
170
│ │ │ │ -
184template<class F, class... T1, class... T2>
│ │ │ │ -
│ │ │ │ -
185auto transformTuple(F&& f, const std::tuple<T1...>& tuple1, const std::tuple<T2...>& tuple2)
│ │ │ │ -
186 -> decltype(Imp::transformTupleHelper(std::forward<F>(f), tuple1, tuple2, std::index_sequence_for<T1...>{}))
│ │ │ │ -
187{
│ │ │ │ -
188 return Imp::transformTupleHelper(std::forward<F>(f), tuple1, tuple2, std::index_sequence_for<T1...>{});
│ │ │ │ -
189}
│ │ │ │ -
│ │ │ │ -
190
│ │ │ │ -
191
│ │ │ │ -
192
│ │ │ │ -
193namespace Imp {
│ │ │ │ -
194
│ │ │ │ -
195 template<class IntegerSequence>
│ │ │ │ -
196 struct IntegerSequenceTupleHelper
│ │ │ │ -
197 {};
│ │ │ │ -
198
│ │ │ │ -
199 template<class I, I... k>
│ │ │ │ -
200 struct IntegerSequenceTupleHelper<std::integer_sequence<I, k...>>
│ │ │ │ -
201 {
│ │ │ │ -
202 using Type = std::tuple<std::integral_constant<I, k>...>;
│ │ │ │ -
203 };
│ │ │ │ -
204
│ │ │ │ -
205} // end namespace Imp
│ │ │ │ -
206
│ │ │ │ -
210template<class IntegerSequence>
│ │ │ │ -
211using IntegerSequenceTuple= typename Imp::IntegerSequenceTupleHelper<IntegerSequence>::Type;
│ │ │ │ -
212
│ │ │ │ -
213
│ │ │ │ +
100 public:
│ │ │ │ +
101
│ │ │ │ +
102 LocalValuedFunction(const Function& f, const Element& element)
│ │ │ │ +
103 : f_(f), element_(element)
│ │ │ │ +
104 {}
│ │ │ │ +
105
│ │ │ │ +
106 auto operator()(const LocalCoordinate& xi) const
│ │ │ │ +
107 {
│ │ │ │ +
108 auto&& f = Dune::Impl::makeFunctionWithCallOperator<LocalCoordinate>(f_);
│ │ │ │ +
109 auto globalValue = f(xi);
│ │ │ │ +
110
│ │ │ │ +
111 // Apply the inverse Piola transform
│ │ │ │ +
112 auto jacobianInverseTransposed = element_.geometry().jacobianInverseTransposed(xi);
│ │ │ │ +
113 auto integrationElement = element_.geometry().integrationElement(xi);
│ │ │ │ +
114
│ │ │ │ +
115 auto localValue = globalValue;
│ │ │ │ +
116 jacobianInverseTransposed.mtv(globalValue, localValue);
│ │ │ │ +
117 localValue *= integrationElement;
│ │ │ │ +
118
│ │ │ │ +
119 return localValue;
│ │ │ │ +
120 }
│ │ │ │ +
121 };
│ │ │ │ +
122 };
│ │ │ │ +
123
│ │ │ │ +
137 struct CovariantPiolaTransformator
│ │ │ │ +
138 {
│ │ │ │ +
143 template<typename Values, typename LocalCoordinate, typename Geometry>
│ │ │ │ +
144 static auto apply(Values& values,
│ │ │ │ +
145 const LocalCoordinate& xi,
│ │ │ │ +
146 const Geometry& geometry)
│ │ │ │ +
147 {
│ │ │ │ +
148 auto jacobianInverseTransposed = geometry.jacobianInverseTransposed(xi);
│ │ │ │ +
149
│ │ │ │ +
150 for (auto& value : values)
│ │ │ │ +
151 {
│ │ │ │ +
152 auto tmp = value;
│ │ │ │ +
153 jacobianInverseTransposed.mv(tmp, value);
│ │ │ │ +
154 }
│ │ │ │ +
155 }
│ │ │ │ +
156
│ │ │ │ +
166 template<typename Gradients, typename LocalCoordinate, typename Geometry>
│ │ │ │ +
167 static auto applyJacobian(Gradients& gradients,
│ │ │ │ +
168 const LocalCoordinate& xi,
│ │ │ │ +
169 const Geometry& geometry)
│ │ │ │ +
170 {
│ │ │ │ +
171 auto jacobianInverseTransposed = geometry.jacobianInverseTransposed(xi);
│ │ │ │ +
172
│ │ │ │ +
173 for (auto& gradient : gradients)
│ │ │ │ +
174 {
│ │ │ │ +
175 auto tmp = gradient;
│ │ │ │ +
176 gradient = 0;
│ │ │ │ +
177 for (size_t j=0; j<gradient.N(); j++)
│ │ │ │ +
178 for (size_t k=0; k<gradient.M(); k++)
│ │ │ │ +
179 // Use sparseRange because jacobianTransposed may be a sparse DiagonalMatrix
│ │ │ │ +
180 for(auto&& [jacobianInverseTransposed_j_l, l] : sparseRange(jacobianInverseTransposed[j]))
│ │ │ │ +
181 gradient[j][k] += jacobianInverseTransposed_j_l * tmp[l][k];
│ │ │ │ +
182 }
│ │ │ │ +
183 }
│ │ │ │ +
184
│ │ │ │ +
192 template<class Function, class LocalCoordinate, class Element>
│ │ │ │ +
193 class LocalValuedFunction
│ │ │ │ +
194 {
│ │ │ │ +
195 const Function& f_;
│ │ │ │ +
196 const Element& element_;
│ │ │ │ +
197
│ │ │ │ +
198 public:
│ │ │ │ +
199
│ │ │ │ +
200 LocalValuedFunction(const Function& f, const Element& element)
│ │ │ │ +
201 : f_(f), element_(element)
│ │ │ │ +
202 {}
│ │ │ │ +
203
│ │ │ │ +
204 auto operator()(const LocalCoordinate& xi) const
│ │ │ │ +
205 {
│ │ │ │ +
206 auto&& f = Dune::Impl::makeFunctionWithCallOperator<LocalCoordinate>(f_);
│ │ │ │ +
207 auto globalValue = f(xi);
│ │ │ │ +
208
│ │ │ │ +
209 // Apply the inverse Piola transform
│ │ │ │ +
210 auto jacobianTransposed = element_.geometry().jacobianTransposed(xi);
│ │ │ │ +
211
│ │ │ │ +
212 auto localValue = globalValue;
│ │ │ │ +
213 jacobianTransposed.mv(globalValue, localValue);
│ │ │ │
214
│ │ │ │ -
220template<class... T>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
222{
│ │ │ │ -
223 using type = typename std::tuple_element<sizeof...(T)-1, std::tuple<T...>>::type;
│ │ │ │ -
224};
│ │ │ │ -
│ │ │ │ -
225
│ │ │ │ -
226
│ │ │ │ -
227
│ │ │ │ -
228namespace Imp {
│ │ │ │ -
229
│ │ │ │ -
230template<class T, class I>
│ │ │ │ -
231struct RotateHelper;
│ │ │ │ -
232
│ │ │ │ -
233template<class... T, std::size_t... I>
│ │ │ │ -
234struct RotateHelper<std::tuple<T...>, std::index_sequence<I...> >
│ │ │ │ -
235{
│ │ │ │ -
236 using type = typename std::tuple<typename LastType<T...>::type, typename std::tuple_element<I,std::tuple<T...>>::type...>;
│ │ │ │ -
237};
│ │ │ │ -
238
│ │ │ │ -
239} // end namespace Imp
│ │ │ │ -
240
│ │ │ │ -
241
│ │ │ │ -
249template<class... T>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
251{
│ │ │ │ -
252 using type = typename Imp::RotateHelper<std::tuple<T...>, std::make_index_sequence<sizeof...(T)-1>>::type;
│ │ │ │ -
253};
│ │ │ │ -
│ │ │ │ -
254
│ │ │ │ +
215 return localValue;
│ │ │ │ +
216 }
│ │ │ │ +
217 };
│ │ │ │ +
218 };
│ │ │ │ +
219
│ │ │ │ +
226 template<class Transformator, class LocalValuedLocalBasis, class Element>
│ │ │ │ +
227 class GlobalValuedLocalBasis
│ │ │ │ +
228 {
│ │ │ │ +
229 public:
│ │ │ │ +
230 using Traits = typename LocalValuedLocalBasis::Traits;
│ │ │ │ +
231
│ │ │ │ +
234 void bind(const LocalValuedLocalBasis& localValuedLocalBasis, const Element& element)
│ │ │ │ +
235 {
│ │ │ │ +
236 localValuedLocalBasis_ = &localValuedLocalBasis;
│ │ │ │ +
237 element_ = &element;
│ │ │ │ +
238 }
│ │ │ │ +
239
│ │ │ │ +
242 auto size() const
│ │ │ │ +
243 {
│ │ │ │ +
244 return localValuedLocalBasis_->size();
│ │ │ │ +
245 }
│ │ │ │ +
246
│ │ │ │ +
248 void evaluateFunction(const typename Traits::DomainType& x,
│ │ │ │ +
249 std::vector<typename Traits::RangeType>& out) const
│ │ │ │ +
250 {
│ │ │ │ +
251 localValuedLocalBasis_->evaluateFunction(x,out);
│ │ │ │ +
252
│ │ │ │ +
253 Transformator::apply(out, x, element_->geometry());
│ │ │ │ +
254 }
│ │ │ │
255
│ │ │ │ -
256
│ │ │ │ -
278template<class Expression>
│ │ │ │ -
│ │ │ │ -
279auto callableCheck(Expression f)
│ │ │ │ -
280{
│ │ │ │ -
281 return [f](auto&&... args){
│ │ │ │ -
282 return Functions::Concept::isCallable(f, std::forward<decltype(args)>(args)...);
│ │ │ │ -
283 };
│ │ │ │ -
284}
│ │ │ │ -
│ │ │ │ +
261 void evaluateJacobian(const typename Traits::DomainType& x,
│ │ │ │ +
262 std::vector<typename Traits::JacobianType>& out) const
│ │ │ │ +
263 {
│ │ │ │ +
264 localValuedLocalBasis_->evaluateJacobian(x,out);
│ │ │ │ +
265
│ │ │ │ +
266 Transformator::applyJacobian(out, x, element_->geometry());
│ │ │ │ +
267 }
│ │ │ │ +
268
│ │ │ │ +
275 void partial(const std::array<unsigned int,2>& order,
│ │ │ │ +
276 const typename Traits::DomainType& x,
│ │ │ │ +
277 std::vector<typename Traits::RangeType>& out) const
│ │ │ │ +
278 {
│ │ │ │ +
279 auto totalOrder = std::accumulate(order.begin(), order.end(), 0);
│ │ │ │ +
280 if (totalOrder == 0) {
│ │ │ │ +
281 evaluateFunction(x, out);
│ │ │ │ +
282 } else if (totalOrder == 1) {
│ │ │ │ +
283 auto const direction = std::distance(order.begin(), std::find(order.begin(), order.end(), 1));
│ │ │ │ +
284 out.resize(size());
│ │ │ │
285
│ │ │ │ -
286
│ │ │ │ -
287
│ │ │ │ -
303template<class Check>
│ │ │ │ -
│ │ │ │ -
304auto negatePredicate(Check check)
│ │ │ │ -
305{
│ │ │ │ -
306 return [check](auto&&... args){
│ │ │ │ -
307 auto negate = overload(
│ │ │ │ -
308 [](std::true_type) { return std::false_type{};},
│ │ │ │ -
309 [](std::false_type) { return std::true_type{};},
│ │ │ │ -
310 [](bool v) { return not v;});
│ │ │ │ -
311 return negate(check(std::forward<decltype(args)>(args)...));
│ │ │ │ -
312 };
│ │ │ │ -
313}
│ │ │ │ -
│ │ │ │ -
314
│ │ │ │ -
315
│ │ │ │ -
316namespace Impl {
│ │ │ │ -
317
│ │ │ │ -
318 // Wrapper to capture values in a lambda for perfect forwarding.
│ │ │ │ -
319 // This captures value types by value and reference types by reference.
│ │ │ │ -
320 template <typename T>
│ │ │ │ -
321 struct ForwardCaptureWrapper;
│ │ │ │ -
322
│ │ │ │ -
323 template <typename T>
│ │ │ │ -
324 struct ForwardCaptureWrapper
│ │ │ │ -
325 {
│ │ │ │ -
326 template <typename TT>
│ │ │ │ -
327 ForwardCaptureWrapper(TT&& t) : t_{std::forward<TT>(t)} {}
│ │ │ │ -
328
│ │ │ │ -
329 auto forward() const { return std::move(t_); }
│ │ │ │ -
330
│ │ │ │ -
331 T t_;
│ │ │ │ -
332 };
│ │ │ │ -
333
│ │ │ │ -
334 template <typename T>
│ │ │ │ -
335 struct ForwardCaptureWrapper<T&>
│ │ │ │ -
336 {
│ │ │ │ -
337 ForwardCaptureWrapper(T& t) : t_{t} {}
│ │ │ │ -
338
│ │ │ │ -
339 T& forward() const { return t_; };
│ │ │ │ +
286 // TODO: The following is wasteful: We compute the full Jacobian and then return
│ │ │ │ +
287 // only a part of it. While we need the full Jacobian of the underlying local-valued LFE,
│ │ │ │ +
288 // it should be possible to compute only a partial Piola transform for the requested
│ │ │ │ +
289 // partial derivatives.
│ │ │ │ +
290 std::vector<typename Traits::JacobianType> fullJacobian;
│ │ │ │ +
291 localValuedLocalBasis_->evaluateJacobian(x,fullJacobian);
│ │ │ │ +
292
│ │ │ │ +
293 Transformator::applyJacobian(fullJacobian, x, element_->geometry());
│ │ │ │ +
294
│ │ │ │ +
295 for (std::size_t i=0; i<out.size(); i++)
│ │ │ │ +
296 for (std::size_t j=0; j<out[i].size(); j++)
│ │ │ │ +
297 out[i][j] = fullJacobian[i][j][direction];
│ │ │ │ +
298
│ │ │ │ +
299 } else
│ │ │ │ +
300 DUNE_THROW(NotImplemented, "Partial derivatives of order 2 or higher");
│ │ │ │ +
301 }
│ │ │ │ +
302
│ │ │ │ +
304 auto order() const
│ │ │ │ +
305 {
│ │ │ │ +
306 return localValuedLocalBasis_->order();
│ │ │ │ +
307 }
│ │ │ │ +
308
│ │ │ │ +
309 const LocalValuedLocalBasis* localValuedLocalBasis_;
│ │ │ │ +
310 const Element* element_;
│ │ │ │ +
311 };
│ │ │ │ +
312
│ │ │ │ +
321 template<class Transformator, class LocalValuedLocalInterpolation, class Element>
│ │ │ │ +
322 class GlobalValuedLocalInterpolation
│ │ │ │ +
323 {
│ │ │ │ +
324 public:
│ │ │ │ +
327 void bind(const LocalValuedLocalInterpolation& localValuedLocalInterpolation, const Element& element)
│ │ │ │ +
328 {
│ │ │ │ +
329 localValuedLocalInterpolation_ = &localValuedLocalInterpolation;
│ │ │ │ +
330 element_ = &element;
│ │ │ │ +
331 }
│ │ │ │ +
332
│ │ │ │ +
333 template<typename F, typename C>
│ │ │ │ +
334 void interpolate (const F& f, std::vector<C>& out) const
│ │ │ │ +
335 {
│ │ │ │ +
336 using LocalCoordinate = typename Element::Geometry::LocalCoordinate;
│ │ │ │ +
337 typename Transformator::template LocalValuedFunction<F,LocalCoordinate,Element> localValuedFunction(f, *element_);
│ │ │ │ +
338 localValuedLocalInterpolation_->interpolate(localValuedFunction, out);
│ │ │ │ +
339 }
│ │ │ │
340
│ │ │ │ -
341 T& t_;
│ │ │ │ -
342 };
│ │ │ │ -
343
│ │ │ │ -
344 template <typename T>
│ │ │ │ -
345 struct ForwardCaptureWrapper<const T&>
│ │ │ │ -
346 {
│ │ │ │ -
347 ForwardCaptureWrapper(const T& t) : t_{t} {}
│ │ │ │ -
348
│ │ │ │ -
349 const T& forward() const { return t_; };
│ │ │ │ -
350
│ │ │ │ -
351 const T& t_;
│ │ │ │ -
352 };
│ │ │ │ -
353
│ │ │ │ -
354} // end namespace Dune::Functions::Impl
│ │ │ │ -
355
│ │ │ │ -
356
│ │ │ │ -
357
│ │ │ │ -
371template <class T>
│ │ │ │ -
│ │ │ │ -
372auto forwardCapture(T&& t)
│ │ │ │ -
373{
│ │ │ │ -
374 return Impl::ForwardCaptureWrapper<T>(std::forward<T>(t));
│ │ │ │ -
375}
│ │ │ │ -
│ │ │ │ -
376
│ │ │ │ -
377
│ │ │ │ +
341 private:
│ │ │ │ +
342 const LocalValuedLocalInterpolation* localValuedLocalInterpolation_;
│ │ │ │ +
343 const Element* element_;
│ │ │ │ +
344 };
│ │ │ │ +
345
│ │ │ │ +
346
│ │ │ │ +
353 template<class Transformator, class LocalValuedLFE, class Element>
│ │ │ │ +
354 class GlobalValuedLocalFiniteElement
│ │ │ │ +
355 {
│ │ │ │ +
356 using LocalBasis = GlobalValuedLocalBasis<Transformator,
│ │ │ │ +
357 typename LocalValuedLFE::Traits::LocalBasisType,
│ │ │ │ +
358 Element>;
│ │ │ │ +
359 using LocalInterpolation = GlobalValuedLocalInterpolation<Transformator,
│ │ │ │ +
360 typename LocalValuedLFE::Traits::LocalInterpolationType,
│ │ │ │ +
361 Element>;
│ │ │ │ +
362
│ │ │ │ +
363 public:
│ │ │ │ +
366 using Traits = LocalFiniteElementTraits<LocalBasis,
│ │ │ │ +
367 typename LocalValuedLFE::Traits::LocalCoefficientsType,
│ │ │ │ +
368 LocalInterpolation>;
│ │ │ │ +
369
│ │ │ │ +
370 GlobalValuedLocalFiniteElement() {}
│ │ │ │ +
371
│ │ │ │ +
372 void bind(const LocalValuedLFE& localValuedLFE, const Element& element)
│ │ │ │ +
373 {
│ │ │ │ +
374 globalValuedLocalBasis_.bind(localValuedLFE.localBasis(), element);
│ │ │ │ +
375 globalValuedLocalInterpolation_.bind(localValuedLFE.localInterpolation(), element);
│ │ │ │ +
376 localValuedLFE_ = &localValuedLFE;
│ │ │ │ +
377 }
│ │ │ │
378
│ │ │ │ -
379} // namespace Dune::Functions
│ │ │ │ -
380} // namespace Dune
│ │ │ │ -
381
│ │ │ │ -
382
│ │ │ │ -
383#endif // DUNE_FUNCTIONS_COMMON_UTILITY_HH
│ │ │ │ - │ │ │ │ -
typename Imp::ExpandTupleHelper< T, ArgTuple >::Type ExpandTuple
Expand tuple arguments as template arguments.
Definition utility.hh:94
│ │ │ │ -
typename Imp::TransformTupleHelper< F, Tuples... >::Type TransformTuple
Transform tuple types argument using type-functor.
Definition utility.hh:131
│ │ │ │ -
static constexpr auto isCallable()
Check if f is callable with given argument list.
Definition functionconcepts.hh:47
│ │ │ │ -
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:165
│ │ │ │ -
auto callableCheck(Expression f)
Create a predicate for checking validity of expressions.
Definition utility.hh:279
│ │ │ │ -
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:60
│ │ │ │ -
auto negatePredicate(Check check)
Negate given predicate.
Definition utility.hh:304
│ │ │ │ -
Definition polynomial.hh:10
│ │ │ │ -
auto forwardCapture(T &&t)
Create a capture object for perfect forwarding.
Definition utility.hh:372
│ │ │ │ -
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:21
│ │ │ │ -
typename Imp::IntegerSequenceTupleHelper< IntegerSequence >::Type IntegerSequenceTuple
Transform integer_sequence<I,k...> to tuple<integral_constant<I,k>...>
Definition utility.hh:211
│ │ │ │ -
Get last entry of type list.
Definition utility.hh:222
│ │ │ │ -
typename std::tuple_element< sizeof...(T) -1, std::tuple< T... > >::type type
Definition utility.hh:223
│ │ │ │ -
Rotate type list by one, such that last entry is moved to first position.
Definition utility.hh:251
│ │ │ │ -
typename Imp::RotateHelper< std::tuple< T... >, std::make_index_sequence< sizeof...(T) -1 > >::type type
Definition utility.hh:252
│ │ │ │ +
381 const typename Traits::LocalBasisType& localBasis() const
│ │ │ │ +
382 {
│ │ │ │ +
383 return globalValuedLocalBasis_;
│ │ │ │ +
384 }
│ │ │ │ +
385
│ │ │ │ +
388 const typename Traits::LocalCoefficientsType& localCoefficients() const
│ │ │ │ +
389 {
│ │ │ │ +
390 return localValuedLFE_->localCoefficients();
│ │ │ │ +
391 }
│ │ │ │ +
392
│ │ │ │ +
395 const typename Traits::LocalInterpolationType& localInterpolation() const
│ │ │ │ +
396 {
│ │ │ │ +
397 return globalValuedLocalInterpolation_;
│ │ │ │ +
398 }
│ │ │ │ +
399
│ │ │ │ +
401 std::size_t size() const
│ │ │ │ +
402 {
│ │ │ │ +
403 return localValuedLFE_->size();
│ │ │ │ +
404 }
│ │ │ │ +
405
│ │ │ │ +
408 GeometryType type() const
│ │ │ │ +
409 {
│ │ │ │ +
410 return localValuedLFE_->type();
│ │ │ │ +
411 }
│ │ │ │ +
412
│ │ │ │ +
413 private:
│ │ │ │ +
414
│ │ │ │ +
415 typename Traits::LocalBasisType globalValuedLocalBasis_;
│ │ │ │ +
416 typename Traits::LocalInterpolationType globalValuedLocalInterpolation_;
│ │ │ │ +
417 const LocalValuedLFE* localValuedLFE_;
│ │ │ │ +
418 };
│ │ │ │ +
419
│ │ │ │ +
420} // namespace Dune::Functions::Impl
│ │ │ │ +
421
│ │ │ │ +
422#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH
│ │ │ │ +
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:202
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,348 +1,336 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -utility.hh │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_COMMON_UTILITY_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_COMMON_UTILITY_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH │ │ │ │ │ 5 │ │ │ │ │ -6 │ │ │ │ │ -7#include │ │ │ │ │ -8#include │ │ │ │ │ -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_/_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ │ -14 │ │ │ │ │ -15namespace _D_u_n_e { │ │ │ │ │ -16namespace Functions { │ │ │ │ │ -17 │ │ │ │ │ -18 │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ +8 │ │ │ │ │ +9#include │ │ │ │ │ +10#include │ │ │ │ │ +11#include │ │ │ │ │ +12#include │ │ │ │ │ +13 │ │ │ │ │ +14#include │ │ │ │ │ +15 │ │ │ │ │ +16#include │ │ │ │ │ +17#include │ │ │ │ │ +18#include │ │ │ │ │ 19 │ │ │ │ │ -20template │ │ │ │ │ -_2_1auto _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) │ │ │ │ │ -22 ->decltype(f(std::integral_constant(), std:: │ │ │ │ │ -forward(args)...)) │ │ │ │ │ -23{ │ │ │ │ │ -24 return f(std::integral_constant(), std::forward │ │ │ │ │ -(args)...); │ │ │ │ │ -25} │ │ │ │ │ -26 │ │ │ │ │ -27template │ │ │ │ │ -_2_8auto _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) │ │ │ │ │ -29 ->decltype(f(std::integral_constant(), std:: │ │ │ │ │ -forward(args)...)) │ │ │ │ │ -30{ │ │ │ │ │ -31 if (i==firstValue) │ │ │ │ │ -32 return f(std::integral_constant(), std::forward │ │ │ │ │ -(args)...); │ │ │ │ │ -33 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)...); │ │ │ │ │ -34} │ │ │ │ │ -35 │ │ │ │ │ -36 │ │ │ │ │ -37 │ │ │ │ │ -59template │ │ │ │ │ -_6_0auto _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) │ │ │ │ │ -61 ->decltype(f(Dune::Indices::_0, std::forward(args)...)) │ │ │ │ │ -62{ │ │ │ │ │ -63 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)...); │ │ │ │ │ -64} │ │ │ │ │ -65 │ │ │ │ │ -66 │ │ │ │ │ -67 │ │ │ │ │ -68namespace Imp { │ │ │ │ │ -69 │ │ │ │ │ -70 template class T, class List> │ │ │ │ │ -71 struct ExpandTupleHelper │ │ │ │ │ -72 {}; │ │ │ │ │ -73 │ │ │ │ │ -74 template class T, template class ListType, │ │ │ │ │ -class... Args> │ │ │ │ │ -75 struct ExpandTupleHelper> │ │ │ │ │ -76 { │ │ │ │ │ -77 using Type = T; │ │ │ │ │ -78 }; │ │ │ │ │ -79 │ │ │ │ │ -80} // end namespace Imp │ │ │ │ │ -81 │ │ │ │ │ -93template class T, class ArgTuple> │ │ │ │ │ -_9_4using _E_x_p_a_n_d_T_u_p_l_e = typename Imp::ExpandTupleHelper::Type; │ │ │ │ │ -95 │ │ │ │ │ -96 │ │ │ │ │ -97 │ │ │ │ │ -98namespace Imp { │ │ │ │ │ +20namespace Dune::Functions::Impl │ │ │ │ │ +21{ │ │ │ │ │ +22 │ │ │ │ │ +36 struct ContravariantPiolaTransformator │ │ │ │ │ +37 { │ │ │ │ │ +42 template │ │ │ │ │ +43 static auto apply(Values& values, │ │ │ │ │ +44 const LocalCoordinate& xi, │ │ │ │ │ +45 const Geometry& geometry) │ │ │ │ │ +46 { │ │ │ │ │ +47 auto jacobianTransposed = geometry.jacobianTransposed(xi); │ │ │ │ │ +48 auto integrationElement = geometry.integrationElement(xi); │ │ │ │ │ +49 │ │ │ │ │ +50 for (auto& value : values) │ │ │ │ │ +51 { │ │ │ │ │ +52 auto tmp = value; │ │ │ │ │ +53 jacobianTransposed.mtv(tmp, value); │ │ │ │ │ +54 value /= integrationElement; │ │ │ │ │ +55 } │ │ │ │ │ +56 } │ │ │ │ │ +57 │ │ │ │ │ +67 template │ │ │ │ │ +68 static auto applyJacobian(Gradients& gradients, │ │ │ │ │ +69 const LocalCoordinate& xi, │ │ │ │ │ +70 const Geometry& geometry) │ │ │ │ │ +71 { │ │ │ │ │ +72 auto jacobianTransposed = geometry.jacobianTransposed(xi); │ │ │ │ │ +73 auto integrationElement = geometry.integrationElement(xi); │ │ │ │ │ +74 for (auto& gradient : gradients) │ │ │ │ │ +75 { │ │ │ │ │ +76 auto tmp = gradient; │ │ │ │ │ +77 gradient = 0; │ │ │ │ │ +78 for (size_t k=0; k │ │ │ │ │ +95 class LocalValuedFunction │ │ │ │ │ +96 { │ │ │ │ │ +97 const Function& f_; │ │ │ │ │ +98 const Element& element_; │ │ │ │ │ 99 │ │ │ │ │ -100 template class T, class... Tuple> │ │ │ │ │ -101 struct TransformTupleHelper │ │ │ │ │ -102 {}; │ │ │ │ │ -103 │ │ │ │ │ -104 template class T, class... Args1> │ │ │ │ │ -105 struct TransformTupleHelper> │ │ │ │ │ -106 { │ │ │ │ │ -107 using Type = std::tuple...>; │ │ │ │ │ -108 }; │ │ │ │ │ -109 │ │ │ │ │ -110 template class T, class... Args1, class... Args2> │ │ │ │ │ -111 struct TransformTupleHelper, typename │ │ │ │ │ -std::tuple> │ │ │ │ │ -112 { │ │ │ │ │ -113 using Type = std::tuple...>; │ │ │ │ │ -114 }; │ │ │ │ │ -115 │ │ │ │ │ -116} // end namespace Imp │ │ │ │ │ -117 │ │ │ │ │ -130template class F, class... Tuples> │ │ │ │ │ -_1_3_1using _T_r_a_n_s_f_o_r_m_T_u_p_l_e = typename Imp::TransformTupleHelper:: │ │ │ │ │ -Type; │ │ │ │ │ -132 │ │ │ │ │ -133 │ │ │ │ │ -134 │ │ │ │ │ -135namespace Imp { │ │ │ │ │ -136 │ │ │ │ │ -137 template │ │ │ │ │ -138 auto transformTupleHelper(F&& f, const std::tuple& tuple, std:: │ │ │ │ │ -index_sequence) │ │ │ │ │ -139 -> decltype(std::make_tuple(f(std::get(tuple))...)) │ │ │ │ │ -140 { │ │ │ │ │ -141 return std::make_tuple(f(std::get(tuple))...); │ │ │ │ │ -142 } │ │ │ │ │ -143 │ │ │ │ │ -144 template │ │ │ │ │ -145 auto transformTupleHelper(F&& f, const std::tuple& tuple1, const │ │ │ │ │ -std::tuple& tuple2, std::index_sequence) │ │ │ │ │ -146 -> decltype(std::make_tuple(f(std::get(tuple1), std::get │ │ │ │ │ -(tuple2))...)) │ │ │ │ │ +100 public: │ │ │ │ │ +101 │ │ │ │ │ +102 LocalValuedFunction(const Function& f, const Element& element) │ │ │ │ │ +103 : f_(f), element_(element) │ │ │ │ │ +104 {} │ │ │ │ │ +105 │ │ │ │ │ +106 auto operator()(const LocalCoordinate& xi) const │ │ │ │ │ +107 { │ │ │ │ │ +108 auto&& f = Dune::Impl::makeFunctionWithCallOperator(f_); │ │ │ │ │ +109 auto globalValue = f(xi); │ │ │ │ │ +110 │ │ │ │ │ +111 // Apply the inverse Piola transform │ │ │ │ │ +112 auto jacobianInverseTransposed = element_.geometry │ │ │ │ │ +().jacobianInverseTransposed(xi); │ │ │ │ │ +113 auto integrationElement = element_.geometry().integrationElement(xi); │ │ │ │ │ +114 │ │ │ │ │ +115 auto localValue = globalValue; │ │ │ │ │ +116 jacobianInverseTransposed.mtv(globalValue, localValue); │ │ │ │ │ +117 localValue *= integrationElement; │ │ │ │ │ +118 │ │ │ │ │ +119 return localValue; │ │ │ │ │ +120 } │ │ │ │ │ +121 }; │ │ │ │ │ +122 }; │ │ │ │ │ +123 │ │ │ │ │ +137 struct CovariantPiolaTransformator │ │ │ │ │ +138 { │ │ │ │ │ +143 template │ │ │ │ │ +144 static auto apply(Values& values, │ │ │ │ │ +145 const LocalCoordinate& xi, │ │ │ │ │ +146 const Geometry& geometry) │ │ │ │ │ 147 { │ │ │ │ │ -148 return std::make_tuple(f(std::get(tuple1), std::get(tuple2))...); │ │ │ │ │ -149 } │ │ │ │ │ -150 │ │ │ │ │ -151} // end namespace Imp │ │ │ │ │ -152 │ │ │ │ │ -164template │ │ │ │ │ -_1_6_5auto _t_r_a_n_s_f_o_r_m_T_u_p_l_e(F&& f, const std::tuple& tuple) │ │ │ │ │ -166 -> decltype(Imp::transformTupleHelper(std::forward(f), tuple, std:: │ │ │ │ │ -index_sequence_for{})) │ │ │ │ │ -167{ │ │ │ │ │ -168 return Imp::transformTupleHelper(std::forward(f), tuple, std:: │ │ │ │ │ -index_sequence_for{}); │ │ │ │ │ -169} │ │ │ │ │ -170 │ │ │ │ │ -184template │ │ │ │ │ -_1_8_5auto _t_r_a_n_s_f_o_r_m_T_u_p_l_e(F&& f, const std::tuple& tuple1, const std:: │ │ │ │ │ -tuple& tuple2) │ │ │ │ │ -186 -> decltype(Imp::transformTupleHelper(std::forward(f), tuple1, tuple2, │ │ │ │ │ -std::index_sequence_for{})) │ │ │ │ │ -187{ │ │ │ │ │ -188 return Imp::transformTupleHelper(std::forward(f), tuple1, tuple2, std:: │ │ │ │ │ -index_sequence_for{}); │ │ │ │ │ -189} │ │ │ │ │ -190 │ │ │ │ │ -191 │ │ │ │ │ -192 │ │ │ │ │ -193namespace Imp { │ │ │ │ │ -194 │ │ │ │ │ -195 template │ │ │ │ │ -196 struct IntegerSequenceTupleHelper │ │ │ │ │ -197 {}; │ │ │ │ │ -198 │ │ │ │ │ -199 template │ │ │ │ │ -200 struct IntegerSequenceTupleHelper> │ │ │ │ │ -201 { │ │ │ │ │ -202 using Type = std::tuple...>; │ │ │ │ │ -203 }; │ │ │ │ │ -204 │ │ │ │ │ -205} // end namespace Imp │ │ │ │ │ -206 │ │ │ │ │ -210template │ │ │ │ │ -_2_1_1using _I_n_t_e_g_e_r_S_e_q_u_e_n_c_e_T_u_p_l_e= typename Imp:: │ │ │ │ │ -IntegerSequenceTupleHelper::Type; │ │ │ │ │ -212 │ │ │ │ │ -213 │ │ │ │ │ +148 auto jacobianInverseTransposed = geometry.jacobianInverseTransposed(xi); │ │ │ │ │ +149 │ │ │ │ │ +150 for (auto& value : values) │ │ │ │ │ +151 { │ │ │ │ │ +152 auto tmp = value; │ │ │ │ │ +153 jacobianInverseTransposed.mv(tmp, value); │ │ │ │ │ +154 } │ │ │ │ │ +155 } │ │ │ │ │ +156 │ │ │ │ │ +166 template │ │ │ │ │ +167 static auto applyJacobian(Gradients& gradients, │ │ │ │ │ +168 const LocalCoordinate& xi, │ │ │ │ │ +169 const Geometry& geometry) │ │ │ │ │ +170 { │ │ │ │ │ +171 auto jacobianInverseTransposed = geometry.jacobianInverseTransposed(xi); │ │ │ │ │ +172 │ │ │ │ │ +173 for (auto& gradient : gradients) │ │ │ │ │ +174 { │ │ │ │ │ +175 auto tmp = gradient; │ │ │ │ │ +176 gradient = 0; │ │ │ │ │ +177 for (size_t j=0; j │ │ │ │ │ +193 class LocalValuedFunction │ │ │ │ │ +194 { │ │ │ │ │ +195 const Function& f_; │ │ │ │ │ +196 const Element& element_; │ │ │ │ │ +197 │ │ │ │ │ +198 public: │ │ │ │ │ +199 │ │ │ │ │ +200 LocalValuedFunction(const Function& f, const Element& element) │ │ │ │ │ +201 : f_(f), element_(element) │ │ │ │ │ +202 {} │ │ │ │ │ +203 │ │ │ │ │ +204 auto operator()(const LocalCoordinate& xi) const │ │ │ │ │ +205 { │ │ │ │ │ +206 auto&& f = Dune::Impl::makeFunctionWithCallOperator(f_); │ │ │ │ │ +207 auto globalValue = f(xi); │ │ │ │ │ +208 │ │ │ │ │ +209 // Apply the inverse Piola transform │ │ │ │ │ +210 auto jacobianTransposed = element_.geometry().jacobianTransposed(xi); │ │ │ │ │ +211 │ │ │ │ │ +212 auto localValue = globalValue; │ │ │ │ │ +213 jacobianTransposed.mv(globalValue, localValue); │ │ │ │ │ 214 │ │ │ │ │ -220template │ │ │ │ │ -_2_2_1struct _L_a_s_t_T_y_p_e │ │ │ │ │ -222{ │ │ │ │ │ -_2_2_3 using _t_y_p_e = typename std::tuple_element>_:_:_t_y_p_e; │ │ │ │ │ -224}; │ │ │ │ │ -225 │ │ │ │ │ -226 │ │ │ │ │ -227 │ │ │ │ │ -228namespace Imp { │ │ │ │ │ -229 │ │ │ │ │ -230template │ │ │ │ │ -231struct RotateHelper; │ │ │ │ │ -232 │ │ │ │ │ -233template │ │ │ │ │ -234struct RotateHelper, std::index_sequence > │ │ │ │ │ -235{ │ │ │ │ │ -236 using type = typename std::tuple::type, typename │ │ │ │ │ -std::tuple_element>::type...>; │ │ │ │ │ -237}; │ │ │ │ │ -238 │ │ │ │ │ -239} // end namespace Imp │ │ │ │ │ -240 │ │ │ │ │ -241 │ │ │ │ │ -249template │ │ │ │ │ -_2_5_0struct _R_o_t_a_t_e_T_u_p_l_e │ │ │ │ │ -251{ │ │ │ │ │ -_2_5_2 using _t_y_p_e = typename Imp::RotateHelper, std:: │ │ │ │ │ -make_index_sequence>_:_:_t_y_p_e; │ │ │ │ │ -253}; │ │ │ │ │ -254 │ │ │ │ │ +215 return localValue; │ │ │ │ │ +216 } │ │ │ │ │ +217 }; │ │ │ │ │ +218 }; │ │ │ │ │ +219 │ │ │ │ │ +226 template │ │ │ │ │ +227 class GlobalValuedLocalBasis │ │ │ │ │ +228 { │ │ │ │ │ +229 public: │ │ │ │ │ +230 using Traits = typename LocalValuedLocalBasis::Traits; │ │ │ │ │ +231 │ │ │ │ │ +234 void bind(const LocalValuedLocalBasis& localValuedLocalBasis, const │ │ │ │ │ +Element& element) │ │ │ │ │ +235 { │ │ │ │ │ +236 localValuedLocalBasis_ = &localValuedLocalBasis; │ │ │ │ │ +237 element_ = &element; │ │ │ │ │ +238 } │ │ │ │ │ +239 │ │ │ │ │ +242 auto size() const │ │ │ │ │ +243 { │ │ │ │ │ +244 return localValuedLocalBasis_->size(); │ │ │ │ │ +245 } │ │ │ │ │ +246 │ │ │ │ │ +248 void evaluateFunction(const typename Traits::DomainType& x, │ │ │ │ │ +249 std::vector& out) const │ │ │ │ │ +250 { │ │ │ │ │ +251 localValuedLocalBasis_->evaluateFunction(x,out); │ │ │ │ │ +252 │ │ │ │ │ +253 Transformator::apply(out, x, element_->geometry()); │ │ │ │ │ +254 } │ │ │ │ │ 255 │ │ │ │ │ -256 │ │ │ │ │ -278template │ │ │ │ │ -_2_7_9auto _c_a_l_l_a_b_l_e_C_h_e_c_k(Expression f) │ │ │ │ │ -280{ │ │ │ │ │ -281 return [f](auto&&... args){ │ │ │ │ │ -282 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)...); │ │ │ │ │ -283 }; │ │ │ │ │ -284} │ │ │ │ │ +261 void evaluateJacobian(const typename Traits::DomainType& x, │ │ │ │ │ +262 std::vector& out) const │ │ │ │ │ +263 { │ │ │ │ │ +264 localValuedLocalBasis_->evaluateJacobian(x,out); │ │ │ │ │ +265 │ │ │ │ │ +266 Transformator::applyJacobian(out, x, element_->geometry()); │ │ │ │ │ +267 } │ │ │ │ │ +268 │ │ │ │ │ +275 void partial(const std::array& order, │ │ │ │ │ +276 const typename Traits::DomainType& x, │ │ │ │ │ +277 std::vector& out) const │ │ │ │ │ +278 { │ │ │ │ │ +279 auto totalOrder = std::accumulate(order.begin(), order.end(), 0); │ │ │ │ │ +280 if (totalOrder == 0) { │ │ │ │ │ +281 evaluateFunction(x, out); │ │ │ │ │ +282 } else if (totalOrder == 1) { │ │ │ │ │ +283 auto const direction = std::distance(order.begin(), std::find(order.begin │ │ │ │ │ +(), order.end(), 1)); │ │ │ │ │ +284 out.resize(size()); │ │ │ │ │ 285 │ │ │ │ │ -286 │ │ │ │ │ -287 │ │ │ │ │ -303template │ │ │ │ │ -_3_0_4auto _n_e_g_a_t_e_P_r_e_d_i_c_a_t_e(Check check) │ │ │ │ │ -305{ │ │ │ │ │ -306 return [check](auto&&... args){ │ │ │ │ │ -307 auto negate = overload( │ │ │ │ │ -308 [](std::true_type) { return std::false_type{};}, │ │ │ │ │ -309 [](std::false_type) { return std::true_type{};}, │ │ │ │ │ -310 [](bool v) { return not v;}); │ │ │ │ │ -311 return negate(check(std::forward(args)...)); │ │ │ │ │ -312 }; │ │ │ │ │ -313} │ │ │ │ │ -314 │ │ │ │ │ -315 │ │ │ │ │ -316namespace Impl { │ │ │ │ │ -317 │ │ │ │ │ -318 // Wrapper to capture values in a lambda for perfect forwarding. │ │ │ │ │ -319 // This captures value types by value and reference types by reference. │ │ │ │ │ -320 template │ │ │ │ │ -321 struct ForwardCaptureWrapper; │ │ │ │ │ -322 │ │ │ │ │ -323 template │ │ │ │ │ -324 struct ForwardCaptureWrapper │ │ │ │ │ -325 { │ │ │ │ │ -326 template │ │ │ │ │ -327 ForwardCaptureWrapper(TT&& t) : t_{std::forward(t)} {} │ │ │ │ │ -328 │ │ │ │ │ -329 auto forward() const { return std::move(t_); } │ │ │ │ │ -330 │ │ │ │ │ -331 T t_; │ │ │ │ │ -332 }; │ │ │ │ │ -333 │ │ │ │ │ -334 template │ │ │ │ │ -335 struct ForwardCaptureWrapper │ │ │ │ │ -336 { │ │ │ │ │ -337 ForwardCaptureWrapper(T& t) : t_{t} {} │ │ │ │ │ -338 │ │ │ │ │ -339 T& forward() const { return t_; }; │ │ │ │ │ +286 // TODO: The following is wasteful: We compute the full Jacobian and then │ │ │ │ │ +return │ │ │ │ │ +287 // only a part of it. While we need the full Jacobian of the underlying │ │ │ │ │ +local-valued LFE, │ │ │ │ │ +288 // it should be possible to compute only a partial Piola transform for the │ │ │ │ │ +requested │ │ │ │ │ +289 // partial derivatives. │ │ │ │ │ +290 std::vector fullJacobian; │ │ │ │ │ +291 localValuedLocalBasis_->evaluateJacobian(x,fullJacobian); │ │ │ │ │ +292 │ │ │ │ │ +293 Transformator::applyJacobian(fullJacobian, x, element_->geometry()); │ │ │ │ │ +294 │ │ │ │ │ +295 for (std::size_t i=0; iorder(); │ │ │ │ │ +307 } │ │ │ │ │ +308 │ │ │ │ │ +309 const LocalValuedLocalBasis* localValuedLocalBasis_; │ │ │ │ │ +310 const Element* element_; │ │ │ │ │ +311 }; │ │ │ │ │ +312 │ │ │ │ │ +321 template │ │ │ │ │ +322 class GlobalValuedLocalInterpolation │ │ │ │ │ +323 { │ │ │ │ │ +324 public: │ │ │ │ │ +327 void bind(const LocalValuedLocalInterpolation& │ │ │ │ │ +localValuedLocalInterpolation, const Element& element) │ │ │ │ │ +328 { │ │ │ │ │ +329 localValuedLocalInterpolation_ = &localValuedLocalInterpolation; │ │ │ │ │ +330 element_ = &element; │ │ │ │ │ +331 } │ │ │ │ │ +332 │ │ │ │ │ +333 template │ │ │ │ │ +334 void _i_n_t_e_r_p_o_l_a_t_e (const F& f, std::vector& out) const │ │ │ │ │ +335 { │ │ │ │ │ +336 using LocalCoordinate = typename Element::Geometry::LocalCoordinate; │ │ │ │ │ +337 typename Transformator::template │ │ │ │ │ +LocalValuedFunction localValuedFunction(f, │ │ │ │ │ +*element_); │ │ │ │ │ +338 localValuedLocalInterpolation_->interpolate(localValuedFunction, out); │ │ │ │ │ +339 } │ │ │ │ │ 340 │ │ │ │ │ -341 T& t_; │ │ │ │ │ -342 }; │ │ │ │ │ -343 │ │ │ │ │ -344 template │ │ │ │ │ -345 struct ForwardCaptureWrapper │ │ │ │ │ -346 { │ │ │ │ │ -347 ForwardCaptureWrapper(const T& t) : t_{t} {} │ │ │ │ │ -348 │ │ │ │ │ -349 const T& forward() const { return t_; }; │ │ │ │ │ -350 │ │ │ │ │ -351 const T& t_; │ │ │ │ │ -352 }; │ │ │ │ │ -353 │ │ │ │ │ -354} // end namespace Dune::Functions::Impl │ │ │ │ │ -355 │ │ │ │ │ -356 │ │ │ │ │ -357 │ │ │ │ │ -371template │ │ │ │ │ -_3_7_2auto _f_o_r_w_a_r_d_C_a_p_t_u_r_e(T&& t) │ │ │ │ │ -373{ │ │ │ │ │ -374 return Impl::ForwardCaptureWrapper(std::forward(t)); │ │ │ │ │ -375} │ │ │ │ │ -376 │ │ │ │ │ -377 │ │ │ │ │ +341 private: │ │ │ │ │ +342 const LocalValuedLocalInterpolation* localValuedLocalInterpolation_; │ │ │ │ │ +343 const Element* element_; │ │ │ │ │ +344 }; │ │ │ │ │ +345 │ │ │ │ │ +346 │ │ │ │ │ +353 template │ │ │ │ │ +354 class GlobalValuedLocalFiniteElement │ │ │ │ │ +355 { │ │ │ │ │ +356 using LocalBasis = GlobalValuedLocalBasis; │ │ │ │ │ +359 using LocalInterpolation = GlobalValuedLocalInterpolation; │ │ │ │ │ +362 │ │ │ │ │ +363 public: │ │ │ │ │ +366 using Traits = LocalFiniteElementTraits; │ │ │ │ │ +369 │ │ │ │ │ +370 GlobalValuedLocalFiniteElement() {} │ │ │ │ │ +371 │ │ │ │ │ +372 void bind(const LocalValuedLFE& localValuedLFE, const Element& element) │ │ │ │ │ +373 { │ │ │ │ │ +374 globalValuedLocalBasis_.bind(localValuedLFE.localBasis(), element); │ │ │ │ │ +375 globalValuedLocalInterpolation_.bind(localValuedLFE.localInterpolation(), │ │ │ │ │ +element); │ │ │ │ │ +376 localValuedLFE_ = &localValuedLFE; │ │ │ │ │ +377 } │ │ │ │ │ 378 │ │ │ │ │ -379} // namespace Dune::Functions │ │ │ │ │ -380} // namespace Dune │ │ │ │ │ -381 │ │ │ │ │ -382 │ │ │ │ │ -383#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_:_:_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:94 │ │ │ │ │ -_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:131 │ │ │ │ │ -_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:47 │ │ │ │ │ -_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:165 │ │ │ │ │ -_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:279 │ │ │ │ │ -_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:60 │ │ │ │ │ -_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:304 │ │ │ │ │ -_D_u_n_e │ │ │ │ │ -DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:372 │ │ │ │ │ -_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:21 │ │ │ │ │ -_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:211 │ │ │ │ │ -_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:222 │ │ │ │ │ -_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 │ │ │ │ │ -typename std::tuple_element< sizeof...(T) -1, std::tuple< T... > >::type type │ │ │ │ │ -DDeeffiinniittiioonn utility.hh:223 │ │ │ │ │ -_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:251 │ │ │ │ │ -_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:252 │ │ │ │ │ +381 const typename Traits::LocalBasisType& localBasis() const │ │ │ │ │ +382 { │ │ │ │ │ +383 return globalValuedLocalBasis_; │ │ │ │ │ +384 } │ │ │ │ │ +385 │ │ │ │ │ +388 const typename Traits::LocalCoefficientsType& localCoefficients() const │ │ │ │ │ +389 { │ │ │ │ │ +390 return localValuedLFE_->localCoefficients(); │ │ │ │ │ +391 } │ │ │ │ │ +392 │ │ │ │ │ +395 const typename Traits::LocalInterpolationType& localInterpolation() const │ │ │ │ │ +396 { │ │ │ │ │ +397 return globalValuedLocalInterpolation_; │ │ │ │ │ +398 } │ │ │ │ │ +399 │ │ │ │ │ +401 std::size_t size() const │ │ │ │ │ +402 { │ │ │ │ │ +403 return localValuedLFE_->size(); │ │ │ │ │ +404 } │ │ │ │ │ +405 │ │ │ │ │ +408 GeometryType type() const │ │ │ │ │ +409 { │ │ │ │ │ +410 return localValuedLFE_->type(); │ │ │ │ │ +411 } │ │ │ │ │ +412 │ │ │ │ │ +413 private: │ │ │ │ │ +414 │ │ │ │ │ +415 typename Traits::LocalBasisType globalValuedLocalBasis_; │ │ │ │ │ +416 typename Traits::LocalInterpolationType globalValuedLocalInterpolation_; │ │ │ │ │ +417 const LocalValuedLFE* localValuedLFE_; │ │ │ │ │ +418 }; │ │ │ │ │ +419 │ │ │ │ │ +420} // namespace Dune::Functions::Impl │ │ │ │ │ +421 │ │ │ │ │ +422#endif / │ │ │ │ │ +/ DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH │ │ │ │ │ +_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:202 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00119.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: indexaccess.hh File Reference │ │ │ │ +dune-functions: nodes.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,66 +65,65 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ +Classes | │ │ │ │ Namespaces | │ │ │ │ Functions
│ │ │ │ -
indexaccess.hh File Reference
│ │ │ │ +
nodes.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <utility>
│ │ │ │ -#include <type_traits>
│ │ │ │ -#include <dune/common/typetraits.hh>
│ │ │ │ -#include <dune/common/concept.hh>
│ │ │ │ -#include <dune/common/hybridutilities.hh>
│ │ │ │ -#include <dune/functions/common/utility.hh>
│ │ │ │ +
#include <cassert>
│ │ │ │ +#include <memory>
│ │ │ │ +#include <dune/common/indices.hh>
│ │ │ │ +#include <dune/typetree/leafnode.hh>
│ │ │ │ +#include <dune/typetree/powernode.hh>
│ │ │ │ +#include <dune/typetree/compositenode.hh>
│ │ │ │ +#include <dune/typetree/traversal.hh>
│ │ │ │ +#include <dune/typetree/visitor.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ +Classes

class  Dune::Functions::BasisNodeMixin
 
class  Dune::Functions::LeafBasisNode
 
class  Dune::Functions::PowerBasisNode< T, n >
 
class  Dune::Functions::CompositeBasisNode< T >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

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

│ │ │ │ Functions

template<class C , class I , class F , typename std::enable_if< Dune::models< Imp::Concept::HasDynamicIndexAccess< I >, C >(), int >::type = 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 , typename std::enable_if< not Dune::models< Imp::Concept::HasDynamicIndexAccess< I >, C >(), int >::type = 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[].
 
template<typename Tree >
void Dune::Functions::clearSize (Tree &tree, std::size_t offset)
 
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)
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,56 +1,46 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -_N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -indexaccess.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_/_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 │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +nodes.hh File Reference │ │ │ │ │ +#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_:_:_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_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e_<_ _T_ _> │ │ │ │ │ +  │ │ │ │ │ NNaammeessppaacceess │ │ │ │ │ namespace   _D_u_n_e │ │ │ │ │   │ │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ │   │ │ │ │ │ FFuunnccttiioonnss │ │ │ │ │ -template, C >(), int >::type = 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 >::type = 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[]. │ │ │ │ │ +template │ │ │ │ │ +void  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_l_e_a_r_S_i_z_e (Tree &tree, std::size_t offset) │ │ │ │ │ +  │ │ │ │ │ +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) │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00119_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: indexaccess.hh Source File │ │ │ │ +dune-functions: nodes.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,328 +70,358 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
indexaccess.hh
│ │ │ │ +
nodes.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#ifndef DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH
│ │ │ │
5
│ │ │ │ -
6
│ │ │ │ -
7#include <utility>
│ │ │ │ -
8#include <type_traits>
│ │ │ │ -
9
│ │ │ │ -
10#include <dune/common/typetraits.hh>
│ │ │ │ -
11#include <dune/common/concept.hh>
│ │ │ │ -
12#include <dune/common/hybridutilities.hh>
│ │ │ │ -
13
│ │ │ │ - │ │ │ │ -
15
│ │ │ │ +
6#include <cassert>
│ │ │ │ +
7#include <memory>
│ │ │ │ +
8
│ │ │ │ +
9#include <dune/common/indices.hh>
│ │ │ │ +
10
│ │ │ │ +
11#include <dune/typetree/leafnode.hh>
│ │ │ │ +
12#include <dune/typetree/powernode.hh>
│ │ │ │ +
13#include <dune/typetree/compositenode.hh>
│ │ │ │ +
14#include <dune/typetree/traversal.hh>
│ │ │ │ +
15#include <dune/typetree/visitor.hh>
│ │ │ │
16
│ │ │ │ -
17
│ │ │ │ -
18namespace Dune {
│ │ │ │ -
19namespace Functions {
│ │ │ │ +
17namespace Dune {
│ │ │ │ +
18 namespace Functions {
│ │ │ │ +
19
│ │ │ │
20
│ │ │ │ -
21
│ │ │ │ -
22namespace Imp {
│ │ │ │ +
21 namespace Impl {
│ │ │ │ +
22
│ │ │ │
23
│ │ │ │ -
24namespace Concept {
│ │ │ │ -
25
│ │ │ │ -
26template<class size_type>
│ │ │ │ -
27struct HasDynamicIndexAccess
│ │ │ │ -
28{
│ │ │ │ -
29 template<class C>
│ │ │ │ -
30 auto require(C&& c) -> decltype(
│ │ │ │ -
31 c[std::declval<size_type>()]
│ │ │ │ -
32 );
│ │ │ │ -
33};
│ │ │ │ -
34
│ │ │ │ -
35struct HasStaticIndexAccess
│ │ │ │ -
36{
│ │ │ │ -
37 template<class C>
│ │ │ │ -
38 auto require(C&& c) -> decltype(
│ │ │ │ -
39 c[Dune::Indices::_0]
│ │ │ │ -
40 );
│ │ │ │ -
41};
│ │ │ │ -
42
│ │ │ │ -
43} // namespace Concept
│ │ │ │ -
44
│ │ │ │ -
45} // namespace Imp
│ │ │ │ -
46
│ │ │ │ +
24 struct ClearSizeVisitor
│ │ │ │ +
25 : public TypeTree::TreeVisitor
│ │ │ │ +
26 , public TypeTree::DynamicTraversal
│ │ │ │ +
27 {
│ │ │ │ +
28
│ │ │ │ +
29 template<typename Node, typename TreePath>
│ │ │ │ +
30 void pre(Node& node, TreePath treePath)
│ │ │ │ +
31 {
│ │ │ │ +
32 leaf(node,treePath);
│ │ │ │ +
33 node.setSize(0);
│ │ │ │ +
34 }
│ │ │ │ +
35
│ │ │ │ +
36 template<typename Node, typename TreePath>
│ │ │ │ +
37 void leaf(Node& node, TreePath treePath)
│ │ │ │ +
38 {
│ │ │ │ +
39 node.setOffset(offset_);
│ │ │ │ +
40 }
│ │ │ │ +
41
│ │ │ │ +
42 ClearSizeVisitor(std::size_t offset)
│ │ │ │ +
43 : offset_(offset)
│ │ │ │ +
44 {}
│ │ │ │ +
45
│ │ │ │ +
46 const std::size_t offset_;
│ │ │ │
47
│ │ │ │ -
48
│ │ │ │ -
61template<class C, class I, class F,
│ │ │ │ -
62 typename std::enable_if< Dune::models<Imp::Concept::HasDynamicIndexAccess<I>, C>(), int>::type = 0>
│ │ │ │ -
│ │ │ │ -
63auto hybridIndexAccess(C&& c, const I& i, F&& f)
│ │ │ │ -
64 -> decltype(f(c[i]))
│ │ │ │ -
65{
│ │ │ │ -
66 return f(c[i]);
│ │ │ │ -
67}
│ │ │ │ -
│ │ │ │ +
48 };
│ │ │ │ +
49
│ │ │ │ +
50
│ │ │ │ +
51 template<typename Entity>
│ │ │ │ +
52 struct BindVisitor
│ │ │ │ +
53 : public TypeTree::TreeVisitor
│ │ │ │ +
54 , public TypeTree::DynamicTraversal
│ │ │ │ +
55 {
│ │ │ │ +
56
│ │ │ │ +
57 template<typename Node, typename TreePath>
│ │ │ │ +
58 void pre(Node& node, TreePath)
│ │ │ │ +
59 {
│ │ │ │ +
60 node.setOffset(offset_);
│ │ │ │ +
61 }
│ │ │ │ +
62
│ │ │ │ +
63 template<typename Node, typename TreePath>
│ │ │ │ +
64 void post(Node& node, TreePath)
│ │ │ │ +
65 {
│ │ │ │ +
66 node.setSize(offset_ - node.offset());
│ │ │ │ +
67 }
│ │ │ │
68
│ │ │ │ -
86template<class C, class I, class F,
│ │ │ │ -
87 typename std::enable_if< not Dune::models<Imp::Concept::HasDynamicIndexAccess<I>, C>(), int>::type = 0>
│ │ │ │ -
│ │ │ │ -
88decltype(auto) hybridIndexAccess(C&& c, const I& i, F&& f)
│ │ │ │ -
89{
│ │ │ │ -
90 using Size = decltype(Hybrid::size(c));
│ │ │ │ -
91 return Hybrid::switchCases(std::make_index_sequence<Size::value>(), i,
│ │ │ │ -
92 [&](const auto& ii) -> decltype(auto){
│ │ │ │ -
93 return f(c[ii]);
│ │ │ │ -
94 }, [&]() -> decltype(auto){
│ │ │ │ -
95 return f(c[Dune::Indices::_0]);
│ │ │ │ -
96 });
│ │ │ │ -
97}
│ │ │ │ -
│ │ │ │ +
69 template<typename Node, typename TreePath>
│ │ │ │ +
70 void leaf(Node& node, TreePath)
│ │ │ │ +
71 {
│ │ │ │ +
72 node.setOffset(offset_);
│ │ │ │ +
73 node.bind(entity_);
│ │ │ │ +
74 offset_ += node.size();
│ │ │ │ +
75 }
│ │ │ │ +
76
│ │ │ │ +
77 BindVisitor(const Entity& entity, std::size_t offset = 0)
│ │ │ │ +
78 : entity_(entity)
│ │ │ │ +
79 , offset_(offset)
│ │ │ │ +
80 {}
│ │ │ │ +
81
│ │ │ │ +
82 const Entity& entity_;
│ │ │ │ +
83 std::size_t offset_;
│ │ │ │ +
84
│ │ │ │ +
85 };
│ │ │ │ +
86
│ │ │ │ +
87
│ │ │ │ +
88 struct InitializeTreeVisitor :
│ │ │ │ +
89 public TypeTree::TreeVisitor,
│ │ │ │ +
90 public TypeTree::DynamicTraversal
│ │ │ │ +
91 {
│ │ │ │ +
92 template<typename Node, typename TreePath>
│ │ │ │ +
93 void pre(Node& node, TreePath)
│ │ │ │ +
94 {
│ │ │ │ +
95 node.setTreeIndex(treeIndex_);
│ │ │ │ +
96 ++treeIndex_;
│ │ │ │ +
97 }
│ │ │ │
98
│ │ │ │ -
99
│ │ │ │ -
100namespace Imp {
│ │ │ │ -
101
│ │ │ │ -
115 template<class Index, std::size_t offset=1>
│ │ │ │ -
116 class ShiftedDynamicMultiIndex
│ │ │ │ -
117 {
│ │ │ │ -
118 public:
│ │ │ │ -
119 ShiftedDynamicMultiIndex(const Index& index) :
│ │ │ │ -
120 index_(index)
│ │ │ │ -
121 {}
│ │ │ │ -
122
│ │ │ │ -
123 std::size_t operator[](std::size_t position) const
│ │ │ │ -
124 {
│ │ │ │ -
125 if (position<size())
│ │ │ │ -
126 return index_[position+offset];
│ │ │ │ -
127 else
│ │ │ │ -
128 return 0;
│ │ │ │ -
129 }
│ │ │ │ -
130
│ │ │ │ -
134 ShiftedDynamicMultiIndex<Index, offset+1> pop() const
│ │ │ │ -
135 {
│ │ │ │ -
136 return {index_};
│ │ │ │ -
137 }
│ │ │ │ -
138
│ │ │ │ -
139 std::size_t size() const
│ │ │ │ -
140 {
│ │ │ │ -
141 if (offset < index_.size())
│ │ │ │ -
142 return index_.size() - offset;
│ │ │ │ -
143 else
│ │ │ │ -
144 return 0;
│ │ │ │ -
145 }
│ │ │ │ +
99 template<typename Node, typename TreePath>
│ │ │ │ +
100 void leaf(Node& node, TreePath)
│ │ │ │ +
101 {
│ │ │ │ +
102 node.setTreeIndex(treeIndex_);
│ │ │ │ +
103 ++treeIndex_;
│ │ │ │ +
104 }
│ │ │ │ +
105
│ │ │ │ +
106 InitializeTreeVisitor(std::size_t treeIndexOffset = 0) :
│ │ │ │ +
107 treeIndex_(treeIndexOffset)
│ │ │ │ +
108 {}
│ │ │ │ +
109
│ │ │ │ +
110 std::size_t treeIndex_;
│ │ │ │ +
111 };
│ │ │ │ +
112
│ │ │ │ +
113 } // end namespace Impl
│ │ │ │ +
114
│ │ │ │ +
115
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
117 {
│ │ │ │ +
118
│ │ │ │ +
119 friend struct Impl::ClearSizeVisitor;
│ │ │ │ +
120
│ │ │ │ +
121 template<typename>
│ │ │ │ +
122 friend struct Impl::BindVisitor;
│ │ │ │ +
123
│ │ │ │ +
124 friend struct Impl::InitializeTreeVisitor;
│ │ │ │ +
125
│ │ │ │ +
126 public:
│ │ │ │ +
127
│ │ │ │ +
128 using size_type = std::size_t;
│ │ │ │ +
129
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
131 offset_(0),
│ │ │ │ +
132 size_(0),
│ │ │ │ +
133 treeIndex_(0)
│ │ │ │ +
134 {}
│ │ │ │ +
│ │ │ │ +
135
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
137 {
│ │ │ │ +
138 assert(i < size_);
│ │ │ │ +
139 return offset_ + i;
│ │ │ │ +
140 }
│ │ │ │ +
│ │ │ │ +
141
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
143 {
│ │ │ │ +
144 return size_;
│ │ │ │ +
145 }
│ │ │ │ +
│ │ │ │
146
│ │ │ │ -
147 private:
│ │ │ │ -
148 const Index& index_;
│ │ │ │ -
149 };
│ │ │ │ -
150
│ │ │ │ -
151 template<class Index, std::size_t offset=1>
│ │ │ │ -
152 class ShiftedStaticMultiIndex
│ │ │ │ -
153 {
│ │ │ │ -
154 public:
│ │ │ │ -
155 ShiftedStaticMultiIndex(const Index& index) :
│ │ │ │ -
156 index_(index)
│ │ │ │ -
157 {}
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
148 {
│ │ │ │ +
149 return treeIndex_;
│ │ │ │ +
150 }
│ │ │ │ +
│ │ │ │ +
151
│ │ │ │ +
152 protected:
│ │ │ │ +
153
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
155 {
│ │ │ │ +
156 return offset_;
│ │ │ │ +
157 }
│ │ │ │ +
│ │ │ │
158
│ │ │ │ -
159 template<std::size_t i>
│ │ │ │ -
160 auto operator[](Dune::index_constant<i>) const
│ │ │ │ -
161 {
│ │ │ │ -
162 if constexpr (i<size()) {
│ │ │ │ -
163 return index_[Dune::index_constant<i+offset>{}];
│ │ │ │ -
164 } else {
│ │ │ │ -
165 return Dune::index_constant<0>{};
│ │ │ │ -
166 }
│ │ │ │ -
167 }
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
160 {
│ │ │ │ +
161 offset_ = offset;
│ │ │ │ +
162 }
│ │ │ │ +
│ │ │ │ +
163
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
165 {
│ │ │ │ +
166 size_ = size;
│ │ │ │ +
167 }
│ │ │ │ +
│ │ │ │
168
│ │ │ │ -
172 ShiftedStaticMultiIndex<Index, offset+1> pop() const
│ │ │ │ -
173 {
│ │ │ │ -
174 return {index_};
│ │ │ │ -
175 }
│ │ │ │ -
176
│ │ │ │ -
177 static constexpr std::size_t size()
│ │ │ │ -
178 {
│ │ │ │ -
179 auto fullSize = decltype(Hybrid::size(std::declval<Index>()))::value;
│ │ │ │ -
180 if (offset < fullSize)
│ │ │ │ -
181 return fullSize - offset;
│ │ │ │ -
182 else
│ │ │ │ -
183 return 0;
│ │ │ │ -
184 }
│ │ │ │ -
185
│ │ │ │ -
186 private:
│ │ │ │ -
187 const Index& index_;
│ │ │ │ -
188 };
│ │ │ │ -
189
│ │ │ │ -
195 template<std::size_t offset, class Index>
│ │ │ │ -
196 ShiftedDynamicMultiIndex<Index, offset> shiftedDynamicMultiIndex(const Index& index)
│ │ │ │ -
197 {
│ │ │ │ -
198 return {index};
│ │ │ │ -
199 }
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
170 {
│ │ │ │ +
171 treeIndex_ = treeIndex;
│ │ │ │ +
172 }
│ │ │ │ +
│ │ │ │ +
173
│ │ │ │ +
174 private:
│ │ │ │ +
175
│ │ │ │ +
176 size_type offset_;
│ │ │ │ +
177 size_type size_;
│ │ │ │ +
178 size_type treeIndex_;
│ │ │ │ +
179
│ │ │ │ +
180 };
│ │ │ │ +
│ │ │ │ +
181
│ │ │ │ +
182
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
184 public BasisNodeMixin,
│ │ │ │ +
185 public TypeTree::LeafNode
│ │ │ │ +
186 {};
│ │ │ │ +
│ │ │ │ +
187
│ │ │ │ +
188
│ │ │ │ +
189 template<typename T, std::size_t n>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
191 public BasisNodeMixin,
│ │ │ │ +
192 public TypeTree::PowerNode<T,n>
│ │ │ │ +
193 {
│ │ │ │ +
194
│ │ │ │ +
195 using Node = TypeTree::PowerNode<T,n>;
│ │ │ │ +
196
│ │ │ │ +
197 public:
│ │ │ │ +
198
│ │ │ │ +
199 using Element = typename T::Element;
│ │ │ │
200
│ │ │ │ -
201 template<std::size_t offset, class Index>
│ │ │ │ -
202 ShiftedStaticMultiIndex<Index, offset> shiftedStaticMultiIndex(const Index& index)
│ │ │ │ -
203 {
│ │ │ │ -
204 return {index};
│ │ │ │ -
205 }
│ │ │ │ +
201 PowerBasisNode() = default;
│ │ │ │ +
202
│ │ │ │ +
│ │ │ │ +
203 PowerBasisNode(const typename Node::NodeStorage& children) :
│ │ │ │ +
204 Node(children)
│ │ │ │ +
205 {}
│ │ │ │ +
│ │ │ │
206
│ │ │ │ -
207} // namespace Imp
│ │ │ │ -
208
│ │ │ │ -
209
│ │ │ │ -
210
│ │ │ │ +
│ │ │ │ +
207 const Element& element() const
│ │ │ │ +
208 {
│ │ │ │ +
209 return this->child(Dune::Indices::_0).element();
│ │ │ │ +
210 }
│ │ │ │ +
│ │ │ │
211
│ │ │ │ -
212namespace Imp {
│ │ │ │ +
212 };
│ │ │ │ +
│ │ │ │
213
│ │ │ │ -
214template<class Result, class Index>
│ │ │ │ -
215struct MultiIndexResolver
│ │ │ │ -
216{
│ │ │ │ -
217 MultiIndexResolver(const Index& index) :
│ │ │ │ -
218 index_(index)
│ │ │ │ -
219 {}
│ │ │ │ +
214
│ │ │ │ +
215 template<typename... T>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
217 public BasisNodeMixin,
│ │ │ │ +
218 public TypeTree::CompositeNode<T...>
│ │ │ │ +
219 {
│ │ │ │
220
│ │ │ │ -
221 template<class C,
│ │ │ │ -
222 typename std::enable_if<not std::is_convertible<C&, Result>::value, int>::type = 0>
│ │ │ │ -
223 Result operator()(C&& c)
│ │ │ │ -
224 {
│ │ │ │ -
225 auto&& subIndex = Imp::shiftedDynamicMultiIndex<1>(index_);
│ │ │ │ -
226 auto&& subIndexResolver = MultiIndexResolver<Result, decltype(subIndex)>(subIndex);
│ │ │ │ -
227 return (Result)(hybridIndexAccess(c, index_[Dune::Indices::_0], subIndexResolver));
│ │ │ │ -
228 }
│ │ │ │ -
229
│ │ │ │ -
230 template<class C,
│ │ │ │ -
231 typename std::enable_if<std::is_convertible<C&, Result>::value, int>::type = 0>
│ │ │ │ -
232 Result operator()(C&& c)
│ │ │ │ -
233 {
│ │ │ │ -
234 return (Result)(std::forward<C>(c));
│ │ │ │ -
235 }
│ │ │ │ -
236
│ │ │ │ -
237 const Index& index_;
│ │ │ │ -
238};
│ │ │ │ -
239
│ │ │ │ -
240} // namespace Imp
│ │ │ │ -
241
│ │ │ │ +
221 using Node = TypeTree::CompositeNode<T...>;
│ │ │ │ +
222
│ │ │ │ +
223 public:
│ │ │ │ +
224
│ │ │ │ +
225 using Element = typename Node::template Child<0>::Type::Element;
│ │ │ │ +
226
│ │ │ │ + │ │ │ │ +
228
│ │ │ │ +
│ │ │ │ +
229 CompositeBasisNode(const typename Node::NodeStorage& children) :
│ │ │ │ +
230 Node(children)
│ │ │ │ +
231 {}
│ │ │ │ +
│ │ │ │ +
232
│ │ │ │ +
233 template<typename... Children>
│ │ │ │ +
│ │ │ │ +
234 CompositeBasisNode(const std::shared_ptr<Children>&... children) :
│ │ │ │ +
235 Node(children...)
│ │ │ │ +
236 {}
│ │ │ │ +
│ │ │ │ +
237
│ │ │ │ +
│ │ │ │ +
238 const Element& element() const
│ │ │ │ +
239 {
│ │ │ │ +
240 return this->child(Dune::Indices::_0).element();
│ │ │ │ +
241 }
│ │ │ │ +
│ │ │ │
242
│ │ │ │ -
243
│ │ │ │ -
262template<class Result, class C, class MultiIndex>
│ │ │ │ -
│ │ │ │ -
263Result hybridMultiIndexAccess(C&& c, const MultiIndex& index)
│ │ │ │ -
264{
│ │ │ │ -
265
│ │ │ │ -
266 Imp::MultiIndexResolver<Result, MultiIndex> multiIndexResolver(index);
│ │ │ │ -
267 return multiIndexResolver(c);
│ │ │ │ -
268}
│ │ │ │ +
243 };
│ │ │ │ +
│ │ │ │ +
244
│ │ │ │ +
245
│ │ │ │ +
246 template<typename Tree>
│ │ │ │ +
│ │ │ │ +
247 void clearSize(Tree& tree, std::size_t offset)
│ │ │ │ +
248 {
│ │ │ │ +
249 TypeTree::applyToTree(tree,Impl::ClearSizeVisitor(offset));
│ │ │ │ +
250 }
│ │ │ │ +
│ │ │ │ +
251
│ │ │ │ +
252 template<typename Tree, typename Entity>
│ │ │ │ +
│ │ │ │ +
253 void bindTree(Tree& tree, const Entity& entity, std::size_t offset = 0)
│ │ │ │ +
254 {
│ │ │ │ +
255 Impl::BindVisitor<Entity> visitor(entity,offset);
│ │ │ │ +
256 TypeTree::applyToTree(tree,visitor);
│ │ │ │ +
257 }
│ │ │ │ +
│ │ │ │ +
258
│ │ │ │ +
259 template<typename Tree>
│ │ │ │ +
│ │ │ │ +
260 void initializeTree(Tree& tree, std::size_t treeIndexOffset = 0)
│ │ │ │ +
261 {
│ │ │ │ +
262 Impl::InitializeTreeVisitor visitor(treeIndexOffset);
│ │ │ │ +
263 TypeTree::applyToTree(tree,visitor);
│ │ │ │ +
264 }
│ │ │ │
│ │ │ │ -
269
│ │ │ │ +
265
│ │ │ │ +
266
│ │ │ │ +
267 } // namespace Functions
│ │ │ │ +
268
│ │ │ │ +
269} // namespace Dune
│ │ │ │
270
│ │ │ │ -
271
│ │ │ │ -
272
│ │ │ │ -
273
│ │ │ │ -
274
│ │ │ │ -
275namespace Imp {
│ │ │ │ -
276
│ │ │ │ -
277 template<class C, class MultiIndex, class IsFinal>
│ │ │ │ -
278 constexpr decltype(auto) resolveDynamicMultiIndex(C&& c, const MultiIndex& multiIndex, const IsFinal& isFinal)
│ │ │ │ -
279 {
│ │ │ │ -
280 // If c is already considered final simply return it,
│ │ │ │ -
281 // else resolve the next multiIndex entry.
│ │ │ │ -
282 return Hybrid::ifElse(isFinal(c), [&, c = forwardCapture(std::forward<C>(c))](auto) -> decltype(auto) {
│ │ │ │ -
283 assert(multiIndex.size() == 0);
│ │ │ │ -
284 return c.forward();
│ │ │ │ -
285 }, [&](auto) -> decltype(auto) {
│ │ │ │ -
286 auto hasDynamicAccess = callableCheck([](auto&& cc) -> std::void_t<decltype(cc[0])> {});
│ │ │ │ -
287
│ │ │ │ -
288 // Split multiIndex into first entry and remaining ones.
│ │ │ │ -
289 auto i = multiIndex[0];
│ │ │ │ -
290 auto tail = multiIndex.pop();
│ │ │ │ -
291
│ │ │ │ -
292 // Resolve first multiIndex entry by c[multiIndex[0]] and
│ │ │ │ -
293 // continue resolving with the remaining remaining ones.
│ │ │ │ -
294 // If c has a dynamic operator[] this is straight forward.
│ │ │ │ -
295 // Else the dynamic multiIndex[0] has to be translated into
│ │ │ │ -
296 // a static one using hybridIndexAccess.
│ │ │ │ -
297 return Hybrid::ifElse(hasDynamicAccess(c), [&](auto id) -> decltype(auto) {
│ │ │ │ -
298 return Imp::resolveDynamicMultiIndex(id(c)[i], tail, isFinal);
│ │ │ │ -
299 }, [&](auto id) -> decltype(auto) {
│ │ │ │ -
300 // auto indexRange = range(Hybrid::size(id(c)));
│ │ │ │ -
301 auto indexRange = typename decltype(range(Hybrid::size(id(c))))::integer_sequence();
│ │ │ │ -
302 return Hybrid::switchCases(indexRange, i, [&](auto static_i) -> decltype(auto){
│ │ │ │ -
303 // Do rescursion with static version of i
│ │ │ │ -
304 return Imp::resolveDynamicMultiIndex(id(c)[static_i], tail, isFinal);
│ │ │ │ -
305 }, [&]() -> decltype(auto){
│ │ │ │ -
306 // As fallback we use c[0] this is needed, because there must be one branch that matches.
│ │ │ │ -
307 return Imp::resolveDynamicMultiIndex(id(c)[Dune::Indices::_0], tail, isFinal);
│ │ │ │ -
308 });
│ │ │ │ -
309 });
│ │ │ │ -
310 });
│ │ │ │ -
311 }
│ │ │ │ -
312
│ │ │ │ -
313 template<class C, class MultiIndex>
│ │ │ │ -
314 constexpr decltype(auto) resolveStaticMultiIndex(C&& c, const MultiIndex& multiIndex)
│ │ │ │ -
315 {
│ │ │ │ -
316 auto isExhausted = Hybrid::equals(Hybrid::size(multiIndex), Dune::Indices::_0);
│ │ │ │ -
317 return Hybrid::ifElse(isExhausted, [&, c = forwardCapture(std::forward<C>(c))](auto) -> decltype(auto) {
│ │ │ │ -
318 return c.forward();
│ │ │ │ -
319 }, [&](auto id) -> decltype(auto) {
│ │ │ │ -
320 auto head = multiIndex[Dune::Indices::_0];
│ │ │ │ -
321 auto tail = multiIndex.pop();
│ │ │ │ -
322
│ │ │ │ -
323 return Imp::resolveStaticMultiIndex(id(c)[head], tail);
│ │ │ │ -
324 });
│ │ │ │ -
325 }
│ │ │ │ -
326
│ │ │ │ -
327} // namespace Imp
│ │ │ │ -
328
│ │ │ │ -
329
│ │ │ │ -
330
│ │ │ │ -
353template<class C, class MultiIndex, class IsFinal>
│ │ │ │ -
│ │ │ │ -
354constexpr decltype(auto) resolveDynamicMultiIndex(C&& c, const MultiIndex& multiIndex, const IsFinal& isFinal)
│ │ │ │ -
355{
│ │ │ │ -
356 return Imp::resolveDynamicMultiIndex(std::forward<C>(c), Imp::shiftedDynamicMultiIndex<0>(multiIndex), isFinal);
│ │ │ │ -
357}
│ │ │ │ -
│ │ │ │ -
358
│ │ │ │ -
375template<class C, class MultiIndex>
│ │ │ │ -
│ │ │ │ -
376constexpr decltype(auto) resolveDynamicMultiIndex(C&& c, const MultiIndex& multiIndex)
│ │ │ │ -
377{
│ │ │ │ -
378 auto hasNoIndexAccess = negatePredicate(callableCheck([](auto&& cc) -> std::void_t<decltype(cc[Dune::Indices::_0])> {}));
│ │ │ │ -
379 return Imp::resolveDynamicMultiIndex(std::forward<C>(c), Imp::shiftedDynamicMultiIndex<0>(multiIndex), hasNoIndexAccess);
│ │ │ │ -
380}
│ │ │ │ -
│ │ │ │ -
381
│ │ │ │ -
397template<class C, class MultiIndex>
│ │ │ │ -
│ │ │ │ -
398constexpr decltype(auto) resolveStaticMultiIndex(C&& c, const MultiIndex& multiIndex)
│ │ │ │ -
399{
│ │ │ │ -
400 return Imp::resolveStaticMultiIndex(std::forward<C>(c), Imp::shiftedStaticMultiIndex<0>(multiIndex));
│ │ │ │ -
401}
│ │ │ │ -
│ │ │ │ -
402
│ │ │ │ -
403
│ │ │ │ -
404
│ │ │ │ -
405} // namespace Dune::Functions
│ │ │ │ -
406} // namespace Dune
│ │ │ │ -
407
│ │ │ │ -
408
│ │ │ │ -
409
│ │ │ │ -
410#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:63
│ │ │ │ -
constexpr decltype(auto) resolveStaticMultiIndex(C &&c, const MultiIndex &multiIndex)
Provide multi-index access by chaining operator[].
Definition indexaccess.hh:398
│ │ │ │ -
auto callableCheck(Expression f)
Create a predicate for checking validity of expressions.
Definition utility.hh:279
│ │ │ │ -
constexpr decltype(auto) resolveDynamicMultiIndex(C &&c, const MultiIndex &multiIndex, const IsFinal &isFinal)
Provide multi-index access by chaining operator[].
Definition indexaccess.hh:354
│ │ │ │ -
Result hybridMultiIndexAccess(C &&c, const MultiIndex &index)
Provide multi-index access by chaining operator[].
Definition indexaccess.hh:263
│ │ │ │ -
auto negatePredicate(Check check)
Negate given predicate.
Definition utility.hh:304
│ │ │ │ +
271#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
auto forwardCapture(T &&t)
Create a capture object for perfect forwarding.
Definition utility.hh:372
│ │ │ │ +
void clearSize(Tree &tree, std::size_t offset)
Definition nodes.hh:247
│ │ │ │ +
void bindTree(Tree &tree, const Entity &entity, std::size_t offset=0)
Definition nodes.hh:253
│ │ │ │ +
void initializeTree(Tree &tree, std::size_t treeIndexOffset=0)
Definition nodes.hh:260
│ │ │ │ +
Definition nodes.hh:117
│ │ │ │ +
size_type treeIndex() const
Definition nodes.hh:147
│ │ │ │ +
size_type localIndex(size_type i) const
Definition nodes.hh:136
│ │ │ │ +
size_type offset() const
Definition nodes.hh:154
│ │ │ │ +
size_type size() const
Definition nodes.hh:142
│ │ │ │ +
void setOffset(const size_type offset)
Definition nodes.hh:159
│ │ │ │ +
std::size_t size_type
Definition nodes.hh:128
│ │ │ │ +
BasisNodeMixin()
Definition nodes.hh:130
│ │ │ │ +
void setSize(const size_type size)
Definition nodes.hh:164
│ │ │ │ +
void setTreeIndex(size_type treeIndex)
Definition nodes.hh:169
│ │ │ │ +
Definition nodes.hh:186
│ │ │ │ +
Definition nodes.hh:193
│ │ │ │ +
const Element & element() const
Definition nodes.hh:207
│ │ │ │ +
typename T::Element Element
Definition nodes.hh:199
│ │ │ │ +
PowerBasisNode(const typename Node::NodeStorage &children)
Definition nodes.hh:203
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
CompositeBasisNode(const typename Node::NodeStorage &children)
Definition nodes.hh:229
│ │ │ │ +
const Element & element() const
Definition nodes.hh:238
│ │ │ │ +
typename Node::template Child< 0 >::Type::Element Element
Definition nodes.hh:225
│ │ │ │ +
CompositeBasisNode(const std::shared_ptr< Children > &... children)
Definition nodes.hh:234
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,355 +1,353 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -indexaccess.hh │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +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 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ -3#ifndef DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH │ │ │ │ │ 5 │ │ │ │ │ -6 │ │ │ │ │ -7#include │ │ │ │ │ -8#include │ │ │ │ │ -9 │ │ │ │ │ -10#include │ │ │ │ │ -11#include │ │ │ │ │ -12#include │ │ │ │ │ -13 │ │ │ │ │ -14#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> │ │ │ │ │ -15 │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ +8 │ │ │ │ │ +9#include │ │ │ │ │ +10 │ │ │ │ │ +11#include │ │ │ │ │ +12#include │ │ │ │ │ +13#include │ │ │ │ │ +14#include │ │ │ │ │ +15#include │ │ │ │ │ 16 │ │ │ │ │ -17 │ │ │ │ │ -18namespace _D_u_n_e { │ │ │ │ │ -19namespace Functions { │ │ │ │ │ +17namespace _D_u_n_e { │ │ │ │ │ +18 namespace Functions { │ │ │ │ │ +19 │ │ │ │ │ 20 │ │ │ │ │ -21 │ │ │ │ │ -22namespace Imp { │ │ │ │ │ +21 namespace Impl { │ │ │ │ │ +22 │ │ │ │ │ 23 │ │ │ │ │ -24namespace Concept { │ │ │ │ │ -25 │ │ │ │ │ -26template │ │ │ │ │ -27struct HasDynamicIndexAccess │ │ │ │ │ -28{ │ │ │ │ │ -29 template │ │ │ │ │ -30 auto require(C&& c) -> decltype( │ │ │ │ │ -31 c[std::declval()] │ │ │ │ │ -32 ); │ │ │ │ │ -33}; │ │ │ │ │ -34 │ │ │ │ │ -35struct HasStaticIndexAccess │ │ │ │ │ -36{ │ │ │ │ │ -37 template │ │ │ │ │ -38 auto require(C&& c) -> decltype( │ │ │ │ │ -39 c[Dune::Indices::_0] │ │ │ │ │ -40 ); │ │ │ │ │ -41}; │ │ │ │ │ -42 │ │ │ │ │ -43} // namespace Concept │ │ │ │ │ -44 │ │ │ │ │ -45} // namespace Imp │ │ │ │ │ -46 │ │ │ │ │ +24 struct ClearSizeVisitor │ │ │ │ │ +25 : public TypeTree::TreeVisitor │ │ │ │ │ +26 , public TypeTree::DynamicTraversal │ │ │ │ │ +27 { │ │ │ │ │ +28 │ │ │ │ │ +29 template │ │ │ │ │ +30 void pre(Node& node, TreePath treePath) │ │ │ │ │ +31 { │ │ │ │ │ +32 leaf(node,treePath); │ │ │ │ │ +33 node.setSize(0); │ │ │ │ │ +34 } │ │ │ │ │ +35 │ │ │ │ │ +36 template │ │ │ │ │ +37 void leaf(Node& node, TreePath treePath) │ │ │ │ │ +38 { │ │ │ │ │ +39 node.setOffset(offset_); │ │ │ │ │ +40 } │ │ │ │ │ +41 │ │ │ │ │ +42 ClearSizeVisitor(std::size_t offset) │ │ │ │ │ +43 : offset_(offset) │ │ │ │ │ +44 {} │ │ │ │ │ +45 │ │ │ │ │ +46 const std::size_t offset_; │ │ │ │ │ 47 │ │ │ │ │ -48 │ │ │ │ │ -61template, C>(), int>::type = 0> │ │ │ │ │ -_6_3auto _h_y_b_r_i_d_I_n_d_e_x_A_c_c_e_s_s(C&& c, const I& i, F&& f) │ │ │ │ │ -64 -> decltype(f(c[i])) │ │ │ │ │ -65{ │ │ │ │ │ -66 return f(c[i]); │ │ │ │ │ -67} │ │ │ │ │ +48 }; │ │ │ │ │ +49 │ │ │ │ │ +50 │ │ │ │ │ +51 template │ │ │ │ │ +52 struct BindVisitor │ │ │ │ │ +53 : public TypeTree::TreeVisitor │ │ │ │ │ +54 , public TypeTree::DynamicTraversal │ │ │ │ │ +55 { │ │ │ │ │ +56 │ │ │ │ │ +57 template │ │ │ │ │ +58 void pre(Node& node, TreePath) │ │ │ │ │ +59 { │ │ │ │ │ +60 node.setOffset(offset_); │ │ │ │ │ +61 } │ │ │ │ │ +62 │ │ │ │ │ +63 template │ │ │ │ │ +64 void post(Node& node, TreePath) │ │ │ │ │ +65 { │ │ │ │ │ +66 node.setSize(offset_ - node.offset()); │ │ │ │ │ +67 } │ │ │ │ │ 68 │ │ │ │ │ -86template, C>(), int>::type = 0> │ │ │ │ │ -_8_8decltype(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) │ │ │ │ │ -89{ │ │ │ │ │ -90 using Size = decltype(Hybrid::size(c)); │ │ │ │ │ -91 return Hybrid::switchCases(std::make_index_sequence(), i, │ │ │ │ │ -92 [&](const auto& ii) -> decltype(auto){ │ │ │ │ │ -93 return f(c[ii]); │ │ │ │ │ -94 }, [&]() -> decltype(auto){ │ │ │ │ │ -95 return f(c[Dune::Indices::_0]); │ │ │ │ │ -96 }); │ │ │ │ │ -97} │ │ │ │ │ +69 template │ │ │ │ │ +70 void leaf(Node& node, TreePath) │ │ │ │ │ +71 { │ │ │ │ │ +72 node.setOffset(offset_); │ │ │ │ │ +73 node.bind(entity_); │ │ │ │ │ +74 offset_ += node.size(); │ │ │ │ │ +75 } │ │ │ │ │ +76 │ │ │ │ │ +77 BindVisitor(const Entity& entity, std::size_t offset = 0) │ │ │ │ │ +78 : entity_(entity) │ │ │ │ │ +79 , offset_(offset) │ │ │ │ │ +80 {} │ │ │ │ │ +81 │ │ │ │ │ +82 const Entity& entity_; │ │ │ │ │ +83 std::size_t offset_; │ │ │ │ │ +84 │ │ │ │ │ +85 }; │ │ │ │ │ +86 │ │ │ │ │ +87 │ │ │ │ │ +88 struct InitializeTreeVisitor : │ │ │ │ │ +89 public TypeTree::TreeVisitor, │ │ │ │ │ +90 public TypeTree::DynamicTraversal │ │ │ │ │ +91 { │ │ │ │ │ +92 template │ │ │ │ │ +93 void pre(Node& node, TreePath) │ │ │ │ │ +94 { │ │ │ │ │ +95 node.setTreeIndex(treeIndex_); │ │ │ │ │ +96 ++treeIndex_; │ │ │ │ │ +97 } │ │ │ │ │ 98 │ │ │ │ │ -99 │ │ │ │ │ -100namespace Imp { │ │ │ │ │ -101 │ │ │ │ │ -115 template │ │ │ │ │ -116 class ShiftedDynamicMultiIndex │ │ │ │ │ +99 template │ │ │ │ │ +100 void leaf(Node& node, TreePath) │ │ │ │ │ +101 { │ │ │ │ │ +102 node.setTreeIndex(treeIndex_); │ │ │ │ │ +103 ++treeIndex_; │ │ │ │ │ +104 } │ │ │ │ │ +105 │ │ │ │ │ +106 InitializeTreeVisitor(std::size_t treeIndexOffset = 0) : │ │ │ │ │ +107 treeIndex_(treeIndexOffset) │ │ │ │ │ +108 {} │ │ │ │ │ +109 │ │ │ │ │ +110 std::size_t treeIndex_; │ │ │ │ │ +111 }; │ │ │ │ │ +112 │ │ │ │ │ +113 } // end namespace Impl │ │ │ │ │ +114 │ │ │ │ │ +115 │ │ │ │ │ +_1_1_6 class _B_a_s_i_s_N_o_d_e_M_i_x_i_n │ │ │ │ │ 117 { │ │ │ │ │ -118 public: │ │ │ │ │ -119 ShiftedDynamicMultiIndex(const Index& index) : │ │ │ │ │ -120 index_(index) │ │ │ │ │ -121 {} │ │ │ │ │ -122 │ │ │ │ │ -123 std::size_t operator[](std::size_t position) const │ │ │ │ │ -124 { │ │ │ │ │ -125 if (position pop() const │ │ │ │ │ -135 { │ │ │ │ │ -136 return {index_}; │ │ │ │ │ -137 } │ │ │ │ │ -138 │ │ │ │ │ -139 std::size_t size() const │ │ │ │ │ -140 { │ │ │ │ │ -141 if (offset < index_.size()) │ │ │ │ │ -142 return index_.size() - offset; │ │ │ │ │ -143 else │ │ │ │ │ -144 return 0; │ │ │ │ │ +118 │ │ │ │ │ +119 friend struct Impl::ClearSizeVisitor; │ │ │ │ │ +120 │ │ │ │ │ +121 template │ │ │ │ │ +122 friend struct Impl::BindVisitor; │ │ │ │ │ +123 │ │ │ │ │ +124 friend struct Impl::InitializeTreeVisitor; │ │ │ │ │ +125 │ │ │ │ │ +126 public: │ │ │ │ │ +127 │ │ │ │ │ +_1_2_8 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ +129 │ │ │ │ │ +_1_3_0 _B_a_s_i_s_N_o_d_e_M_i_x_i_n() : │ │ │ │ │ +131 offset_(0), │ │ │ │ │ +132 size_(0), │ │ │ │ │ +133 treeIndex_(0) │ │ │ │ │ +134 {} │ │ │ │ │ +135 │ │ │ │ │ +_1_3_6 _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 │ │ │ │ │ +137 { │ │ │ │ │ +138 assert(i < size_); │ │ │ │ │ +139 return offset_ + i; │ │ │ │ │ +140 } │ │ │ │ │ +141 │ │ │ │ │ +_1_4_2 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ │ +143 { │ │ │ │ │ +144 return size_; │ │ │ │ │ 145 } │ │ │ │ │ 146 │ │ │ │ │ -147 private: │ │ │ │ │ -148 const Index& index_; │ │ │ │ │ -149 }; │ │ │ │ │ -150 │ │ │ │ │ -151 template │ │ │ │ │ -152 class ShiftedStaticMultiIndex │ │ │ │ │ -153 { │ │ │ │ │ -154 public: │ │ │ │ │ -155 ShiftedStaticMultiIndex(const Index& index) : │ │ │ │ │ -156 index_(index) │ │ │ │ │ -157 {} │ │ │ │ │ +_1_4_7 _s_i_z_e___t_y_p_e _t_r_e_e_I_n_d_e_x() const │ │ │ │ │ +148 { │ │ │ │ │ +149 return treeIndex_; │ │ │ │ │ +150 } │ │ │ │ │ +151 │ │ │ │ │ +152 protected: │ │ │ │ │ +153 │ │ │ │ │ +_1_5_4 _s_i_z_e___t_y_p_e _o_f_f_s_e_t() const │ │ │ │ │ +155 { │ │ │ │ │ +156 return offset_; │ │ │ │ │ +157 } │ │ │ │ │ 158 │ │ │ │ │ -159 template │ │ │ │ │ -160 auto operator[](Dune::index_constant) const │ │ │ │ │ -161 { │ │ │ │ │ -162 if constexpr (i{}]; │ │ │ │ │ -164 } else { │ │ │ │ │ -165 return Dune::index_constant<0>{}; │ │ │ │ │ -166 } │ │ │ │ │ +_1_5_9 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) │ │ │ │ │ +160 { │ │ │ │ │ +161 offset_ = _o_f_f_s_e_t; │ │ │ │ │ +162 } │ │ │ │ │ +163 │ │ │ │ │ +_1_6_4 void _s_e_t_S_i_z_e(const _s_i_z_e___t_y_p_e _s_i_z_e) │ │ │ │ │ +165 { │ │ │ │ │ +166 size_ = _s_i_z_e; │ │ │ │ │ 167 } │ │ │ │ │ 168 │ │ │ │ │ -172 ShiftedStaticMultiIndex pop() const │ │ │ │ │ -173 { │ │ │ │ │ -174 return {index_}; │ │ │ │ │ -175 } │ │ │ │ │ -176 │ │ │ │ │ -177 static constexpr std::size_t size() │ │ │ │ │ -178 { │ │ │ │ │ -179 auto fullSize = decltype(Hybrid::size(std::declval()))::value; │ │ │ │ │ -180 if (offset < fullSize) │ │ │ │ │ -181 return fullSize - offset; │ │ │ │ │ -182 else │ │ │ │ │ -183 return 0; │ │ │ │ │ -184 } │ │ │ │ │ -185 │ │ │ │ │ -186 private: │ │ │ │ │ -187 const Index& index_; │ │ │ │ │ -188 }; │ │ │ │ │ -189 │ │ │ │ │ -195 template │ │ │ │ │ -196 ShiftedDynamicMultiIndex shiftedDynamicMultiIndex(const │ │ │ │ │ -Index& index) │ │ │ │ │ -197 { │ │ │ │ │ -198 return {index}; │ │ │ │ │ -199 } │ │ │ │ │ +_1_6_9 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) │ │ │ │ │ +170 { │ │ │ │ │ +171 treeIndex_ = _t_r_e_e_I_n_d_e_x; │ │ │ │ │ +172 } │ │ │ │ │ +173 │ │ │ │ │ +174 private: │ │ │ │ │ +175 │ │ │ │ │ +176 _s_i_z_e___t_y_p_e offset_; │ │ │ │ │ +177 _s_i_z_e___t_y_p_e size_; │ │ │ │ │ +178 _s_i_z_e___t_y_p_e treeIndex_; │ │ │ │ │ +179 │ │ │ │ │ +180 }; │ │ │ │ │ +181 │ │ │ │ │ +182 │ │ │ │ │ +_1_8_3 class _L_e_a_f_B_a_s_i_s_N_o_d_e : │ │ │ │ │ +184 public _B_a_s_i_s_N_o_d_e_M_i_x_i_n, │ │ │ │ │ +185 public TypeTree::LeafNode │ │ │ │ │ +186 {}; │ │ │ │ │ +187 │ │ │ │ │ +188 │ │ │ │ │ +189 template │ │ │ │ │ +_1_9_0 class _P_o_w_e_r_B_a_s_i_s_N_o_d_e : │ │ │ │ │ +191 public _B_a_s_i_s_N_o_d_e_M_i_x_i_n, │ │ │ │ │ +192 public TypeTree::PowerNode │ │ │ │ │ +193 { │ │ │ │ │ +194 │ │ │ │ │ +195 using Node = TypeTree::PowerNode; │ │ │ │ │ +196 │ │ │ │ │ +197 public: │ │ │ │ │ +198 │ │ │ │ │ +_1_9_9 using _E_l_e_m_e_n_t = typename T::Element; │ │ │ │ │ 200 │ │ │ │ │ -201 template │ │ │ │ │ -202 ShiftedStaticMultiIndex shiftedStaticMultiIndex(const Index& │ │ │ │ │ -index) │ │ │ │ │ -203 { │ │ │ │ │ -204 return {index}; │ │ │ │ │ -205 } │ │ │ │ │ +_2_0_1 _P_o_w_e_r_B_a_s_i_s_N_o_d_e() = default; │ │ │ │ │ +202 │ │ │ │ │ +_2_0_3 _P_o_w_e_r_B_a_s_i_s_N_o_d_e(const typename Node::NodeStorage& children) : │ │ │ │ │ +204 Node(children) │ │ │ │ │ +205 {} │ │ │ │ │ 206 │ │ │ │ │ -207} // namespace Imp │ │ │ │ │ -208 │ │ │ │ │ -209 │ │ │ │ │ -210 │ │ │ │ │ +_2_0_7 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ │ +208 { │ │ │ │ │ +209 return this->child(Dune::Indices::_0).element(); │ │ │ │ │ +210 } │ │ │ │ │ 211 │ │ │ │ │ -212namespace Imp { │ │ │ │ │ +212 }; │ │ │ │ │ 213 │ │ │ │ │ -214template │ │ │ │ │ -215struct MultiIndexResolver │ │ │ │ │ -216{ │ │ │ │ │ -217 MultiIndexResolver(const Index& index) : │ │ │ │ │ -218 index_(index) │ │ │ │ │ -219 {} │ │ │ │ │ +214 │ │ │ │ │ +215 template │ │ │ │ │ +_2_1_6 class _C_o_m_p_o_s_i_t_e_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 public TypeTree::CompositeNode │ │ │ │ │ +219 { │ │ │ │ │ 220 │ │ │ │ │ -221 template::value, int>:: │ │ │ │ │ -type = 0> │ │ │ │ │ -223 Result operator()(C&& c) │ │ │ │ │ -224 { │ │ │ │ │ -225 auto&& subIndex = Imp::shiftedDynamicMultiIndex<1>(index_); │ │ │ │ │ -226 auto&& subIndexResolver = MultiIndexResolver │ │ │ │ │ -(subIndex); │ │ │ │ │ -227 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)); │ │ │ │ │ -228 } │ │ │ │ │ -229 │ │ │ │ │ -230 template::value, int>::type │ │ │ │ │ -= 0> │ │ │ │ │ -232 Result operator()(C&& c) │ │ │ │ │ -233 { │ │ │ │ │ -234 return (Result)(std::forward(c)); │ │ │ │ │ -235 } │ │ │ │ │ -236 │ │ │ │ │ -237 const Index& index_; │ │ │ │ │ -238}; │ │ │ │ │ -239 │ │ │ │ │ -240} // namespace Imp │ │ │ │ │ -241 │ │ │ │ │ +221 using Node = TypeTree::CompositeNode; │ │ │ │ │ +222 │ │ │ │ │ +223 public: │ │ │ │ │ +224 │ │ │ │ │ +_2_2_5 using _E_l_e_m_e_n_t = typename Node::template Child<0>::Type::Element; │ │ │ │ │ +226 │ │ │ │ │ +_2_2_7 _C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e() = default; │ │ │ │ │ +228 │ │ │ │ │ +_2_2_9 _C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e(const typename Node::NodeStorage& children) : │ │ │ │ │ +230 Node(children) │ │ │ │ │ +231 {} │ │ │ │ │ +232 │ │ │ │ │ +233 template │ │ │ │ │ +_2_3_4 _C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e(const std::shared_ptr&... children) : │ │ │ │ │ +235 Node(children...) │ │ │ │ │ +236 {} │ │ │ │ │ +237 │ │ │ │ │ +_2_3_8 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ │ +239 { │ │ │ │ │ +240 return this->child(Dune::Indices::_0).element(); │ │ │ │ │ +241 } │ │ │ │ │ 242 │ │ │ │ │ -243 │ │ │ │ │ -262template │ │ │ │ │ -_2_6_3Result _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) │ │ │ │ │ -264{ │ │ │ │ │ +243 }; │ │ │ │ │ +244 │ │ │ │ │ +245 │ │ │ │ │ +246 template │ │ │ │ │ +_2_4_7 void _c_l_e_a_r_S_i_z_e(Tree& tree, std::size_t offset) │ │ │ │ │ +248 { │ │ │ │ │ +249 TypeTree::applyToTree(tree,Impl::ClearSizeVisitor(offset)); │ │ │ │ │ +250 } │ │ │ │ │ +251 │ │ │ │ │ +252 template │ │ │ │ │ +_2_5_3 void _b_i_n_d_T_r_e_e(Tree& tree, const Entity& entity, std::size_t offset = 0) │ │ │ │ │ +254 { │ │ │ │ │ +255 Impl::BindVisitor visitor(entity,offset); │ │ │ │ │ +256 TypeTree::applyToTree(tree,visitor); │ │ │ │ │ +257 } │ │ │ │ │ +258 │ │ │ │ │ +259 template │ │ │ │ │ +_2_6_0 void _i_n_i_t_i_a_l_i_z_e_T_r_e_e(Tree& tree, std::size_t treeIndexOffset = 0) │ │ │ │ │ +261 { │ │ │ │ │ +262 Impl::InitializeTreeVisitor visitor(treeIndexOffset); │ │ │ │ │ +263 TypeTree::applyToTree(tree,visitor); │ │ │ │ │ +264 } │ │ │ │ │ 265 │ │ │ │ │ -266 Imp::MultiIndexResolver multiIndexResolver(index); │ │ │ │ │ -267 return multiIndexResolver(c); │ │ │ │ │ -268} │ │ │ │ │ -269 │ │ │ │ │ +266 │ │ │ │ │ +267 } // namespace Functions │ │ │ │ │ +268 │ │ │ │ │ +269} // namespace Dune │ │ │ │ │ 270 │ │ │ │ │ -271 │ │ │ │ │ -272 │ │ │ │ │ -273 │ │ │ │ │ -274 │ │ │ │ │ -275namespace Imp { │ │ │ │ │ -276 │ │ │ │ │ -277 template │ │ │ │ │ -278 constexpr decltype(auto) resolveDynamicMultiIndex(C&& c, const MultiIndex& │ │ │ │ │ -multiIndex, const IsFinal& isFinal) │ │ │ │ │ -279 { │ │ │ │ │ -280 // If c is already considered final simply return it, │ │ │ │ │ -281 // else resolve the next multiIndex entry. │ │ │ │ │ -282 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) { │ │ │ │ │ -283 assert(multiIndex.size() == 0); │ │ │ │ │ -284 return c.forward(); │ │ │ │ │ -285 }, [&](auto) -> decltype(auto) { │ │ │ │ │ -286 auto hasDynamicAccess = _c_a_l_l_a_b_l_e_C_h_e_c_k([](auto&& cc) -> std::void_t {}); │ │ │ │ │ -287 │ │ │ │ │ -288 // Split multiIndex into first entry and remaining ones. │ │ │ │ │ -289 auto i = multiIndex[0]; │ │ │ │ │ -290 auto tail = multiIndex.pop(); │ │ │ │ │ -291 │ │ │ │ │ -292 // Resolve first multiIndex entry by c[multiIndex[0]] and │ │ │ │ │ -293 // continue resolving with the remaining remaining ones. │ │ │ │ │ -294 // If c has a dynamic operator[] this is straight forward. │ │ │ │ │ -295 // Else the dynamic multiIndex[0] has to be translated into │ │ │ │ │ -296 // a static one using hybridIndexAccess. │ │ │ │ │ -297 return Hybrid::ifElse(hasDynamicAccess(c), [&](auto id) -> decltype(auto) { │ │ │ │ │ -298 return Imp::resolveDynamicMultiIndex(id(c)[i], tail, isFinal); │ │ │ │ │ -299 }, [&](auto id) -> decltype(auto) { │ │ │ │ │ -300 // auto indexRange = range(Hybrid::size(id(c))); │ │ │ │ │ -301 auto indexRange = typename decltype(range(Hybrid::size(id(c)))):: │ │ │ │ │ -integer_sequence(); │ │ │ │ │ -302 return Hybrid::switchCases(indexRange, i, [&](auto static_i) -> decltype │ │ │ │ │ -(auto){ │ │ │ │ │ -303 // Do rescursion with static version of i │ │ │ │ │ -304 return Imp::resolveDynamicMultiIndex(id(c)[static_i], tail, isFinal); │ │ │ │ │ -305 }, [&]() -> decltype(auto){ │ │ │ │ │ -306 // As fallback we use c[0] this is needed, because there must be one branch │ │ │ │ │ -that matches. │ │ │ │ │ -307 return Imp::resolveDynamicMultiIndex(id(c)[Dune::Indices::_0], tail, │ │ │ │ │ -isFinal); │ │ │ │ │ -308 }); │ │ │ │ │ -309 }); │ │ │ │ │ -310 }); │ │ │ │ │ -311 } │ │ │ │ │ -312 │ │ │ │ │ -313 template │ │ │ │ │ -314 constexpr decltype(auto) resolveStaticMultiIndex(C&& c, const MultiIndex& │ │ │ │ │ -multiIndex) │ │ │ │ │ -315 { │ │ │ │ │ -316 auto isExhausted = Hybrid::equals(Hybrid::size(multiIndex), Dune::Indices:: │ │ │ │ │ -_0); │ │ │ │ │ -317 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) { │ │ │ │ │ -318 return c.forward(); │ │ │ │ │ -319 }, [&](auto id) -> decltype(auto) { │ │ │ │ │ -320 auto head = multiIndex[Dune::Indices::_0]; │ │ │ │ │ -321 auto tail = multiIndex.pop(); │ │ │ │ │ -322 │ │ │ │ │ -323 return Imp::resolveStaticMultiIndex(id(c)[head], tail); │ │ │ │ │ -324 }); │ │ │ │ │ -325 } │ │ │ │ │ -326 │ │ │ │ │ -327} // namespace Imp │ │ │ │ │ -328 │ │ │ │ │ -329 │ │ │ │ │ -330 │ │ │ │ │ -353template │ │ │ │ │ -_3_5_4constexpr 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) │ │ │ │ │ -355{ │ │ │ │ │ -356 return Imp::resolveDynamicMultiIndex(std::forward(c), Imp:: │ │ │ │ │ -shiftedDynamicMultiIndex<0>(multiIndex), isFinal); │ │ │ │ │ -357} │ │ │ │ │ -358 │ │ │ │ │ -375template │ │ │ │ │ -_3_7_6constexpr 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) │ │ │ │ │ -377{ │ │ │ │ │ -378 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 {})); │ │ │ │ │ -379 return Imp::resolveDynamicMultiIndex(std::forward(c), Imp:: │ │ │ │ │ -shiftedDynamicMultiIndex<0>(multiIndex), hasNoIndexAccess); │ │ │ │ │ -380} │ │ │ │ │ -381 │ │ │ │ │ -397template │ │ │ │ │ -_3_9_8constexpr 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) │ │ │ │ │ -399{ │ │ │ │ │ -400 return Imp::resolveStaticMultiIndex(std::forward(c), Imp:: │ │ │ │ │ -shiftedStaticMultiIndex<0>(multiIndex)); │ │ │ │ │ -401} │ │ │ │ │ -402 │ │ │ │ │ -403 │ │ │ │ │ -404 │ │ │ │ │ -405} // namespace Dune::Functions │ │ │ │ │ -406} // namespace Dune │ │ │ │ │ -407 │ │ │ │ │ -408 │ │ │ │ │ -409 │ │ │ │ │ -410#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:63 │ │ │ │ │ -_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:398 │ │ │ │ │ -_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:279 │ │ │ │ │ -_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:354 │ │ │ │ │ -_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:263 │ │ │ │ │ -_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:304 │ │ │ │ │ +271#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:372 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_l_e_a_r_S_i_z_e │ │ │ │ │ +void clearSize(Tree &tree, std::size_t offset) │ │ │ │ │ +DDeeffiinniittiioonn nodes.hh:247 │ │ │ │ │ +_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:253 │ │ │ │ │ +_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:260 │ │ │ │ │ +_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 │ │ │ │ │ +DDeeffiinniittiioonn nodes.hh:117 │ │ │ │ │ +_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:147 │ │ │ │ │ +_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:136 │ │ │ │ │ +_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:154 │ │ │ │ │ +_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 │ │ │ │ │ +DDeeffiinniittiioonn nodes.hh:142 │ │ │ │ │ +_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:159 │ │ │ │ │ +_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:128 │ │ │ │ │ +_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:130 │ │ │ │ │ +_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:164 │ │ │ │ │ +_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:169 │ │ │ │ │ +_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:186 │ │ │ │ │ +_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:193 │ │ │ │ │ +_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:207 │ │ │ │ │ +_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:199 │ │ │ │ │ +_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(const typename Node::NodeStorage &children) │ │ │ │ │ +DDeeffiinniittiioonn nodes.hh:203 │ │ │ │ │ +_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_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e │ │ │ │ │ +DDeeffiinniittiioonn nodes.hh:219 │ │ │ │ │ +_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_:_:_C_o_m_p_o_s_i_t_e_B_a_s_i_s_N_o_d_e │ │ │ │ │ +CompositeBasisNode(const typename Node::NodeStorage &children) │ │ │ │ │ +DDeeffiinniittiioonn nodes.hh:229 │ │ │ │ │ +_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:238 │ │ │ │ │ +_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 │ │ │ │ │ +typename Node::template Child< 0 >::Type::Element Element │ │ │ │ │ +DDeeffiinniittiioonn nodes.hh:225 │ │ │ │ │ +_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 std::shared_ptr< Children > &... children) │ │ │ │ │ +DDeeffiinniittiioonn nodes.hh:234 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00122.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: callable.hh File Reference │ │ │ │ +dune-functions: hierarchicallagrangebasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,55 +65,64 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces | │ │ │ │ +Typedefs | │ │ │ │ Functions
│ │ │ │ -
callable.hh File Reference
│ │ │ │ +
hierarchicallagrangebasis.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <memory>
│ │ │ │ -#include <functional>
│ │ │ │ -#include <dune/common/function.hh>
│ │ │ │ -#include <dune/common/shared_ptr.hh>
│ │ │ │ +
#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/grid/common/mcmgmapper.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::Functions::CallableFunctionWrapper< F >
 Wrap a Dune::VirtualFunction into a callable object. More...
class  Dune::Functions::HierarchicalLagrangePreBasis< GV, k, R >
 A pre-basis for a hierarchical basis. More...
 
class  Dune::Functions::HierarchicalLagrangeNode< GV, k, 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<class F >
CallableFunctionWrapper< F > Dune::Functions::callable (const F &f)
 Create a callable object from some Dune::VirtualFunction.
 
template<class F >
CallableFunctionWrapper< F > Dune::Functions::callable (const std::shared_ptr< F > &fp)
 Create a callable object from std::shared_ptr<F>
 
template<std::size_t k, typename R = double>
auto Dune::Functions::BasisFactory::hierarchicalLagrange ()
 Create a pre-basis factory that can create a HierarchicalLagrange pre-basis.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,36 +1,42 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -callable.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +hierarchicallagrangebasis.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_/_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 │ │ │ │ │ _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_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r_<_ _F_ _> │ │ │ │ │ -  Wrap a Dune::VirtualFunction into a callable object. _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_,_ _k_,_ _R_ _> │ │ │ │ │ +  A pre-basis for a hierarchical basis. _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_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_:_:_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< GV, k, R > > │ │ │ │ │ +  Basis of a scalar Hierarchical Lagrange finite element space. │ │ │ │ │ +  │ │ │ │ │ FFuunnccttiioonnss │ │ │ │ │ -template │ │ │ │ │ -_C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r< F >  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_a_l_l_a_b_l_e (const F &f) │ │ │ │ │ -  Create a callable object from some Dune:: │ │ │ │ │ - VirtualFunction. │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -_C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r< F >  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_a_l_l_a_b_l_e (const std::shared_ptr< │ │ │ │ │ - F > &fp) │ │ │ │ │ -  Create a callable object from std::shared_ptr │ │ │ │ │ +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 () │ │ │ │ │ +  Create a pre-basis factory that can create a HierarchicalLagrange pre- │ │ │ │ │ + basis. │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00122_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: callable.hh Source File │ │ │ │ +dune-functions: hierarchicallagrangebasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,106 +70,307 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
callable.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#ifndef DUNE_FUNCTIONS_COMMON_CALLABLE_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_COMMON_CALLABLE_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH
│ │ │ │
5
│ │ │ │ -
6#include <memory>
│ │ │ │ -
7#include <functional>
│ │ │ │ +
6#include <dune/common/exceptions.hh>
│ │ │ │ +
7#include <dune/localfunctions/hierarchical/hierarchicalp2.hh>
│ │ │ │
8
│ │ │ │ -
9#include <dune/common/function.hh>
│ │ │ │ -
10#include <dune/common/shared_ptr.hh>
│ │ │ │ -
11
│ │ │ │ + │ │ │ │ + │ │ │ │ +
11#include <dune/grid/common/mcmgmapper.hh>
│ │ │ │
12
│ │ │ │
13namespace Dune {
│ │ │ │ -
14namespace Functions {
│ │ │ │ +
14 namespace Functions {
│ │ │ │
15
│ │ │ │ -
16
│ │ │ │ -
17
│ │ │ │ -
18
│ │ │ │ -
36template<class F>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
38{
│ │ │ │ -
39 using Range = typename F::RangeType;
│ │ │ │ -
40 using Domain = typename F::DomainType;
│ │ │ │ -
41
│ │ │ │ -
42 public:
│ │ │ │ -
43
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
51 {
│ │ │ │ -
52 f_ = Dune::stackobject_to_shared_ptr(f);
│ │ │ │ -
53 }
│ │ │ │ -
│ │ │ │ -
54
│ │ │ │ -
│ │ │ │ -
61 CallableFunctionWrapper(const std::shared_ptr<const F>& f) :
│ │ │ │ -
62 f_(f)
│ │ │ │ -
63 {}
│ │ │ │ -
│ │ │ │ -
64
│ │ │ │ -
│ │ │ │ -
70 Range operator()(const Domain& x) const
│ │ │ │ -
71 {
│ │ │ │ -
72 Range y;
│ │ │ │ -
73 f_->evaluate(x, y);
│ │ │ │ -
74 return y;
│ │ │ │ -
75 }
│ │ │ │ -
│ │ │ │ -
76
│ │ │ │ -
77 private:
│ │ │ │ -
78 std::shared_ptr<const F> f_;
│ │ │ │ -
79};
│ │ │ │ -
│ │ │ │ -
80
│ │ │ │ -
81
│ │ │ │ -
82
│ │ │ │ -
104template<class F>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
106{
│ │ │ │ - │ │ │ │ -
108}
│ │ │ │ -
│ │ │ │ -
109
│ │ │ │ -
110
│ │ │ │ -
136template<class F>
│ │ │ │ -
│ │ │ │ -
137CallableFunctionWrapper<F> callable(const std::shared_ptr<F>& fp)
│ │ │ │ -
138{
│ │ │ │ - │ │ │ │ -
140}
│ │ │ │ +
16 // *****************************************************************************
│ │ │ │ +
17 // Implementation for Hierarchical Lagrange Basis
│ │ │ │ +
18 //
│ │ │ │ +
19 // -- only order k=2 is implemented up to now --
│ │ │ │ +
20 // -- currently only supports simplex grids --
│ │ │ │ +
21 //
│ │ │ │ +
22 // This is the reusable part of the HierarchicalLagrangeBasis. It contains
│ │ │ │ +
23 //
│ │ │ │ +
24 // HierarchicalLagrangePreBasis
│ │ │ │ +
25 // HierarchicalLagrangeNode
│ │ │ │ +
26 //
│ │ │ │ +
27 // The pre-basis allows to create the others and is the owner of possible shared
│ │ │ │ +
28 // state. These components do _not_ depend on the global basis and can be
│ │ │ │ +
29 // used without a global basis.
│ │ │ │ +
30 // *****************************************************************************
│ │ │ │ +
31
│ │ │ │ +
32 template<typename GV, int k, typename R=double>
│ │ │ │ +
33 class HierarchicalLagrangeNode;
│ │ │ │ +
34
│ │ │ │ +
35 template<typename GV, int k, typename R=double>
│ │ │ │ +
36 class HierarchicalLagrangePreBasis;
│ │ │ │ +
37
│ │ │ │ +
47 template<typename GV, int k, typename R>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
49 {
│ │ │ │ +
50 static const int dim = GV::dimension;
│ │ │ │ +
51
│ │ │ │ +
52 public:
│ │ │ │ +
53
│ │ │ │ +
55 using GridView = GV;
│ │ │ │ +
56
│ │ │ │ +
58 using size_type = std::size_t;
│ │ │ │ +
59
│ │ │ │ + │ │ │ │ +
62
│ │ │ │ +
63 static constexpr size_type maxMultiIndexSize = 1;
│ │ │ │ +
64 static constexpr size_type minMultiIndexSize = 1;
│ │ │ │ +
65 static constexpr size_type multiIndexBufferSize = 1;
│ │ │ │ +
66
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
72 {}
│ │ │ │ +
│ │ │ │ +
73
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
76 {}
│ │ │ │ +
│ │ │ │ +
77
│ │ │ │ +
│ │ │ │ +
79 const GridView& gridView() const
│ │ │ │ +
80 {
│ │ │ │ +
81 return gridView_;
│ │ │ │ +
82 }
│ │ │ │ +
│ │ │ │ +
83
│ │ │ │ +
│ │ │ │ +
85 void update (const GridView& gv)
│ │ │ │ +
86 {
│ │ │ │ +
87 gridView_ = gv;
│ │ │ │ +
88 mcmgMapper_.update(gv);
│ │ │ │ +
89 }
│ │ │ │ +
│ │ │ │ +
90
│ │ │ │ +
│ │ │ │ +
94 Node makeNode() const
│ │ │ │ +
95 {
│ │ │ │ +
96 return Node{};
│ │ │ │ +
97 }
│ │ │ │ +
│ │ │ │ +
98
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
101 {
│ │ │ │ +
102 return mcmgMapper_.size();
│ │ │ │ +
103 }
│ │ │ │ +
│ │ │ │ +
104
│ │ │ │ +
106 template<class SizePrefix>
│ │ │ │ +
│ │ │ │ +
107 size_type size(const SizePrefix prefix) const
│ │ │ │ +
108 {
│ │ │ │ +
109 assert(prefix.size() == 0 || prefix.size() == 1);
│ │ │ │ +
110 return (prefix.size() == 0) ? size() : 0;
│ │ │ │ +
111 }
│ │ │ │ +
│ │ │ │ +
112
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
115 {
│ │ │ │ +
116 return size();
│ │ │ │ +
117 }
│ │ │ │ +
│ │ │ │ +
118
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
124 {
│ │ │ │ +
125 // That cast to unsigned int is necessary because GV::dimension is an enum
│ │ │ │ +
126 return Dune::binomial(std::size_t(order() + (unsigned int)GV::dimension),std::size_t(order()));
│ │ │ │ +
127 }
│ │ │ │ +
│ │ │ │ +
128
│ │ │ │ +
129 template<typename It>
│ │ │ │ +
│ │ │ │ +
130 It indices(const Node& node, It it) const
│ │ │ │ +
131 {
│ │ │ │ +
132 for (size_type i = 0, end = node.finiteElement().size() ; i < end ; ++it, ++i)
│ │ │ │ +
133 {
│ │ │ │ +
134 Dune::LocalKey localKey = node.finiteElement().localCoefficients().localKey(i);
│ │ │ │ +
135 const auto& element = node.element();
│ │ │ │ +
136
│ │ │ │ +
137 *it = {{ (size_type)(mcmgMapper_.subIndex(element,localKey.subEntity(),localKey.codim())) }};
│ │ │ │ +
138 }
│ │ │ │ +
139 return it;
│ │ │ │ +
140 }
│ │ │ │
│ │ │ │
141
│ │ │ │ -
142
│ │ │ │ -
143
│ │ │ │ -
144} // namespace Functions
│ │ │ │ -
145} // namespace Dune
│ │ │ │ -
146
│ │ │ │ -
147#endif //DUNE_FUNCTIONS_COMMON_CALLABLE_HH
│ │ │ │ -
CallableFunctionWrapper< F > callable(const F &f)
Create a callable object from some Dune::VirtualFunction.
Definition callable.hh:105
│ │ │ │ +
142 protected:
│ │ │ │ + │ │ │ │ +
144
│ │ │ │ +
│ │ │ │ +
145 unsigned int order() const
│ │ │ │ +
146 {
│ │ │ │ +
147 return 2;
│ │ │ │ +
148 }
│ │ │ │ +
│ │ │ │ +
149
│ │ │ │ +
150 MultipleCodimMultipleGeomTypeMapper<GridView> mcmgMapper_;
│ │ │ │ +
151
│ │ │ │ +
152 private:
│ │ │ │ +
157 static auto p2Layout()
│ │ │ │ +
158 {
│ │ │ │ +
159 return [](Dune::GeometryType type, int gridDim)
│ │ │ │ +
160 {
│ │ │ │ +
161 if (type.isVertex())
│ │ │ │ +
162 return 1;
│ │ │ │ +
163 if (type.isLine())
│ │ │ │ +
164 return 1;
│ │ │ │ +
165 if (type.isTriangle())
│ │ │ │ +
166 return 0;
│ │ │ │ +
167 assert(type.isTetrahedron());
│ │ │ │ +
168 return 0;
│ │ │ │ +
169 };
│ │ │ │ +
170 }
│ │ │ │ +
171 };
│ │ │ │ +
│ │ │ │ +
172
│ │ │ │ +
173
│ │ │ │ +
174
│ │ │ │ +
175 template<typename GV, int k, typename R>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
177 public LeafBasisNode
│ │ │ │ +
178 {
│ │ │ │ +
179 static const int dim = GV::dimension;
│ │ │ │ +
180
│ │ │ │ +
181 public:
│ │ │ │ +
182
│ │ │ │ +
183 using size_type = std::size_t;
│ │ │ │ +
184 using Element = typename GV::template Codim<0>::Entity;
│ │ │ │ +
185 using FiniteElement = HierarchicalP2LocalFiniteElement<typename GV::ctype,R,dim>;
│ │ │ │ +
186
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ +
189 element_(nullptr)
│ │ │ │ +
190 {}
│ │ │ │ +
│ │ │ │ +
191
│ │ │ │ +
│ │ │ │ +
193 const Element& element() const
│ │ │ │ +
194 {
│ │ │ │ +
195 return *element_;
│ │ │ │ +
196 }
│ │ │ │ +
│ │ │ │ +
197
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
203 {
│ │ │ │ +
204 return finiteElement_;
│ │ │ │ +
205 }
│ │ │ │ +
│ │ │ │ +
206
│ │ │ │ +
│ │ │ │ +
208 void bind(const Element& e)
│ │ │ │ +
209 {
│ │ │ │ +
210 element_ = &e;
│ │ │ │ +
211
│ │ │ │ +
212 if (e.type() != finiteElement_.type())
│ │ │ │ +
213 DUNE_THROW(Dune::Exception,
│ │ │ │ +
214 "HierarchicalLagrange-elements do not exist for elements of type " << e.type());
│ │ │ │ +
215
│ │ │ │ +
216 this->setSize(finiteElement_.size());
│ │ │ │ +
217 }
│ │ │ │ +
│ │ │ │ +
218
│ │ │ │ +
219 protected:
│ │ │ │ +
220
│ │ │ │ +
│ │ │ │ +
221 unsigned int order() const
│ │ │ │ +
222 {
│ │ │ │ +
223 return 2;
│ │ │ │ +
224 }
│ │ │ │ +
│ │ │ │ +
225
│ │ │ │ + │ │ │ │ + │ │ │ │ +
228 };
│ │ │ │ +
│ │ │ │ +
229
│ │ │ │ +
230
│ │ │ │ +
231
│ │ │ │ +
232 namespace BasisFactory {
│ │ │ │ +
233
│ │ │ │ +
242 template<std::size_t k, typename R=double>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
244 {
│ │ │ │ +
245 return [](const auto& gridView) {
│ │ │ │ +
246 return HierarchicalLagrangePreBasis<std::decay_t<decltype(gridView)>, k, R>(gridView);
│ │ │ │ +
247 };
│ │ │ │ +
248 }
│ │ │ │ +
│ │ │ │ +
249
│ │ │ │ +
250 } // end namespace BasisFactory
│ │ │ │ +
251
│ │ │ │ +
262 template<typename GV, int k, typename R=double>
│ │ │ │ + │ │ │ │ +
264
│ │ │ │ +
265 } // end namespace Functions
│ │ │ │ +
266} // end namespace Dune
│ │ │ │ +
267
│ │ │ │ +
268#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ +
auto hierarchicalLagrange()
Create a pre-basis factory that can create a HierarchicalLagrange pre-basis.
Definition hierarchicallagrangebasis.hh:243
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
Wrap a Dune::VirtualFunction into a callable object.
Definition callable.hh:38
│ │ │ │ -
Range operator()(const Domain &x) const
Forward operator() to F::evaluate()
Definition callable.hh:70
│ │ │ │ -
CallableFunctionWrapper(const F &f)
Instantiate from reference to f.
Definition callable.hh:50
│ │ │ │ -
CallableFunctionWrapper(const std::shared_ptr< const F > &f)
Instantiate from std::shared_ptr to f.
Definition callable.hh:61
│ │ │ │ +
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:46
│ │ │ │ +
Definition hierarchicallagrangebasis.hh:178
│ │ │ │ +
HierarchicalP2LocalFiniteElement< typename GV::ctype, R, dim > FiniteElement
Definition hierarchicallagrangebasis.hh:185
│ │ │ │ +
const Element & element() const
Return current element, throw if unbound.
Definition hierarchicallagrangebasis.hh:193
│ │ │ │ +
void bind(const Element &e)
Bind to element.
Definition hierarchicallagrangebasis.hh:208
│ │ │ │ +
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition hierarchicallagrangebasis.hh:202
│ │ │ │ +
const Element * element_
Definition hierarchicallagrangebasis.hh:227
│ │ │ │ +
const FiniteElement finiteElement_
Definition hierarchicallagrangebasis.hh:226
│ │ │ │ +
unsigned int order() const
Definition hierarchicallagrangebasis.hh:221
│ │ │ │ +
HierarchicalLagrangeNode()
Definition hierarchicallagrangebasis.hh:187
│ │ │ │ +
std::size_t size_type
Definition hierarchicallagrangebasis.hh:183
│ │ │ │ +
typename GV::template Codim< 0 >::Entity Element
Definition hierarchicallagrangebasis.hh:184
│ │ │ │ +
A pre-basis for a hierarchical basis.
Definition hierarchicallagrangebasis.hh:49
│ │ │ │ +
std::size_t size_type
Type used for indices and size information.
Definition hierarchicallagrangebasis.hh:58
│ │ │ │ +
unsigned int order() const
Definition hierarchicallagrangebasis.hh:145
│ │ │ │ +
Node makeNode() const
Create tree node.
Definition hierarchicallagrangebasis.hh:94
│ │ │ │ +
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition hierarchicallagrangebasis.hh:123
│ │ │ │ +
static constexpr size_type multiIndexBufferSize
Definition hierarchicallagrangebasis.hh:65
│ │ │ │ +
void update(const GridView &gv)
Update the stored grid view & MultipleCodimMultipleGeomTypeMapper, to be called if the grid has chang...
Definition hierarchicallagrangebasis.hh:85
│ │ │ │ +
MultipleCodimMultipleGeomTypeMapper< GridView > mcmgMapper_
Definition hierarchicallagrangebasis.hh:150
│ │ │ │ +
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition hierarchicallagrangebasis.hh:114
│ │ │ │ +
GV GridView
The grid view that the FE basis is defined on.
Definition hierarchicallagrangebasis.hh:55
│ │ │ │ +
HierarchicalLagrangePreBasis(const GridView &gv)
Constructor for a given grid view object with layout for second order.
Definition hierarchicallagrangebasis.hh:71
│ │ │ │ +
static constexpr size_type maxMultiIndexSize
Definition hierarchicallagrangebasis.hh:63
│ │ │ │ +
size_type size(const SizePrefix prefix) const
Return number of possible values for next position in multi index.
Definition hierarchicallagrangebasis.hh:107
│ │ │ │ +
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition hierarchicallagrangebasis.hh:79
│ │ │ │ +
GridView gridView_
Definition hierarchicallagrangebasis.hh:143
│ │ │ │ +
size_type size() const
Same as size(prefix) with empty prefix.
Definition hierarchicallagrangebasis.hh:100
│ │ │ │ +
void initializeIndices()
Initialize the global indices.
Definition hierarchicallagrangebasis.hh:75
│ │ │ │ +
It indices(const Node &node, It it) const
Definition hierarchicallagrangebasis.hh:130
│ │ │ │ +
static constexpr size_type minMultiIndexSize
Definition hierarchicallagrangebasis.hh:64
│ │ │ │ +
void setSize(const size_type size)
Definition nodes.hh:164
│ │ │ │ +
Definition nodes.hh:186
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,99 +1,354 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -callable.hh │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_COMMON_CALLABLE_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_COMMON_CALLABLE_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ 8 │ │ │ │ │ -9#include │ │ │ │ │ -10#include │ │ │ │ │ -11 │ │ │ │ │ +9#include <_d_u_n_e_/_f_u_n_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> │ │ │ │ │ +10#include <_d_u_n_e_/_f_u_n_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> │ │ │ │ │ +11#include │ │ │ │ │ 12 │ │ │ │ │ 13namespace _D_u_n_e { │ │ │ │ │ -14namespace Functions { │ │ │ │ │ +14 namespace Functions { │ │ │ │ │ 15 │ │ │ │ │ -16 │ │ │ │ │ -17 │ │ │ │ │ -18 │ │ │ │ │ -36template │ │ │ │ │ -_3_7class _C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r │ │ │ │ │ -38{ │ │ │ │ │ -39 using Range = typename F::RangeType; │ │ │ │ │ -40 using Domain = typename F::DomainType; │ │ │ │ │ -41 │ │ │ │ │ -42 public: │ │ │ │ │ -43 │ │ │ │ │ -_5_0 _C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r(const F& f) │ │ │ │ │ -51 { │ │ │ │ │ -52 f_ = Dune::stackobject_to_shared_ptr(f); │ │ │ │ │ -53 } │ │ │ │ │ -54 │ │ │ │ │ -_6_1 _C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r(const std::shared_ptr& f) : │ │ │ │ │ -62 f_(f) │ │ │ │ │ -63 {} │ │ │ │ │ -64 │ │ │ │ │ -_7_0 Range _o_p_e_r_a_t_o_r_(_)(const Domain& x) const │ │ │ │ │ -71 { │ │ │ │ │ -72 Range y; │ │ │ │ │ -73 f_->evaluate(x, y); │ │ │ │ │ -74 return y; │ │ │ │ │ -75 } │ │ │ │ │ -76 │ │ │ │ │ -77 private: │ │ │ │ │ -78 std::shared_ptr f_; │ │ │ │ │ -79}; │ │ │ │ │ -80 │ │ │ │ │ -81 │ │ │ │ │ -82 │ │ │ │ │ -104template │ │ │ │ │ -_1_0_5_C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r_<_F_> _c_a_l_l_a_b_l_e(const F& f) │ │ │ │ │ -106{ │ │ │ │ │ -107 return _C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r_<_F_>(f); │ │ │ │ │ -108} │ │ │ │ │ -109 │ │ │ │ │ -110 │ │ │ │ │ -136template │ │ │ │ │ -_1_3_7_C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r_<_F_> _c_a_l_l_a_b_l_e(const std::shared_ptr& fp) │ │ │ │ │ -138{ │ │ │ │ │ -139 return _C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r_<_F_>(fp); │ │ │ │ │ -140} │ │ │ │ │ +16 / │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +17 // Implementation for Hierarchical Lagrange Basis │ │ │ │ │ +18 // │ │ │ │ │ +19 // -- only order k=2 is implemented up to now -- │ │ │ │ │ +20 // -- currently only supports simplex grids -- │ │ │ │ │ +21 // │ │ │ │ │ +22 // This is the reusable part of the HierarchicalLagrangeBasis. It contains │ │ │ │ │ +23 // │ │ │ │ │ +24 // HierarchicalLagrangePreBasis │ │ │ │ │ +25 // HierarchicalLagrangeNode │ │ │ │ │ +26 // │ │ │ │ │ +27 // The pre-basis allows to create the others and is the owner of possible │ │ │ │ │ +shared │ │ │ │ │ +28 // state. These components do _not_ depend on the global basis and can be │ │ │ │ │ +29 // used without a global basis. │ │ │ │ │ +30 / │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +31 │ │ │ │ │ +32 template │ │ │ │ │ +33 class HierarchicalLagrangeNode; │ │ │ │ │ +34 │ │ │ │ │ +35 template │ │ │ │ │ +36 class HierarchicalLagrangePreBasis; │ │ │ │ │ +37 │ │ │ │ │ +47 template │ │ │ │ │ +_4_8 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 │ │ │ │ │ +49 { │ │ │ │ │ +50 static const int dim = GV::dimension; │ │ │ │ │ +51 │ │ │ │ │ +52 public: │ │ │ │ │ +53 │ │ │ │ │ +_5_5 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ │ +56 │ │ │ │ │ +_5_8 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ +59 │ │ │ │ │ +_6_1 using _N_o_d_e = _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_N_o_d_e_<_G_V_,_ _k_,_ _R_>; │ │ │ │ │ +62 │ │ │ │ │ +_6_3 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 = 1; │ │ │ │ │ +_6_4 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 = 1; │ │ │ │ │ +_6_5 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 = 1; │ │ │ │ │ +66 │ │ │ │ │ +_7_1 _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 _G_r_i_d_V_i_e_w& gv) : _g_r_i_d_V_i_e_w__(gv) , │ │ │ │ │ +_m_c_m_g_M_a_p_p_e_r__(gv,p2Layout()) │ │ │ │ │ +72 {} │ │ │ │ │ +73 │ │ │ │ │ +_7_5 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ │ +76 {} │ │ │ │ │ +77 │ │ │ │ │ +_7_9 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ │ +80 { │ │ │ │ │ +81 return _g_r_i_d_V_i_e_w__; │ │ │ │ │ +82 } │ │ │ │ │ +83 │ │ │ │ │ +_8_5 void _u_p_d_a_t_e (const _G_r_i_d_V_i_e_w& gv) │ │ │ │ │ +86 { │ │ │ │ │ +87 _g_r_i_d_V_i_e_w__ = gv; │ │ │ │ │ +88 _m_c_m_g_M_a_p_p_e_r__.update(gv); │ │ │ │ │ +89 } │ │ │ │ │ +90 │ │ │ │ │ +_9_4 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ │ +95 { │ │ │ │ │ +96 return _N_o_d_e{}; │ │ │ │ │ +97 } │ │ │ │ │ +98 │ │ │ │ │ +_1_0_0 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ │ +101 { │ │ │ │ │ +102 return _m_c_m_g_M_a_p_p_e_r__.size(); │ │ │ │ │ +103 } │ │ │ │ │ +104 │ │ │ │ │ +106 template │ │ │ │ │ +_1_0_7 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix prefix) const │ │ │ │ │ +108 { │ │ │ │ │ +109 assert(prefix.size() == 0 || prefix.size() == 1); │ │ │ │ │ +110 return (prefix.size() == 0) ? _s_i_z_e() : 0; │ │ │ │ │ +111 } │ │ │ │ │ +112 │ │ │ │ │ +_1_1_4 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ │ +115 { │ │ │ │ │ +116 return _s_i_z_e(); │ │ │ │ │ +117 } │ │ │ │ │ +118 │ │ │ │ │ +_1_2_3 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ │ +124 { │ │ │ │ │ +125 // That cast to unsigned int is necessary because GV::dimension is an enum │ │ │ │ │ +126 return Dune::binomial(std::size_t(_o_r_d_e_r() + (unsigned int)GV:: │ │ │ │ │ +dimension),std::size_t(_o_r_d_e_r())); │ │ │ │ │ +127 } │ │ │ │ │ +128 │ │ │ │ │ +129 template │ │ │ │ │ +_1_3_0 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ │ +131 { │ │ │ │ │ +132 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) │ │ │ │ │ +133 { │ │ │ │ │ +134 Dune::LocalKey localKey = node._f_i_n_i_t_e_E_l_e_m_e_n_t().localCoefficients().localKey │ │ │ │ │ +(i); │ │ │ │ │ +135 const auto& element = node._e_l_e_m_e_n_t(); │ │ │ │ │ +136 │ │ │ │ │ +137 *it = {{ (_s_i_z_e___t_y_p_e)(_m_c_m_g_M_a_p_p_e_r__.subIndex(element,localKey.subEntity │ │ │ │ │ +(),localKey.codim())) }}; │ │ │ │ │ +138 } │ │ │ │ │ +139 return it; │ │ │ │ │ +140 } │ │ │ │ │ 141 │ │ │ │ │ -142 │ │ │ │ │ -143 │ │ │ │ │ -144} // namespace Functions │ │ │ │ │ -145} // namespace Dune │ │ │ │ │ -146 │ │ │ │ │ -147#endif //DUNE_FUNCTIONS_COMMON_CALLABLE_HH │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_c_a_l_l_a_b_l_e │ │ │ │ │ -CallableFunctionWrapper< F > callable(const F &f) │ │ │ │ │ -Create a callable object from some Dune::VirtualFunction. │ │ │ │ │ -DDeeffiinniittiioonn callable.hh:105 │ │ │ │ │ +142 protected: │ │ │ │ │ +_1_4_3 _G_r_i_d_V_i_e_w _g_r_i_d_V_i_e_w__; │ │ │ │ │ +144 │ │ │ │ │ +_1_4_5 unsigned int _o_r_d_e_r() const │ │ │ │ │ +146 { │ │ │ │ │ +147 return 2; │ │ │ │ │ +148 } │ │ │ │ │ +149 │ │ │ │ │ +_1_5_0 MultipleCodimMultipleGeomTypeMapper _m_c_m_g_M_a_p_p_e_r__; │ │ │ │ │ +151 │ │ │ │ │ +152 private: │ │ │ │ │ +157 static auto p2Layout() │ │ │ │ │ +158 { │ │ │ │ │ +159 return [](Dune::GeometryType type, int gridDim) │ │ │ │ │ +160 { │ │ │ │ │ +161 if (type.isVertex()) │ │ │ │ │ +162 return 1; │ │ │ │ │ +163 if (type.isLine()) │ │ │ │ │ +164 return 1; │ │ │ │ │ +165 if (type.isTriangle()) │ │ │ │ │ +166 return 0; │ │ │ │ │ +167 assert(type.isTetrahedron()); │ │ │ │ │ +168 return 0; │ │ │ │ │ +169 }; │ │ │ │ │ +170 } │ │ │ │ │ +171 }; │ │ │ │ │ +172 │ │ │ │ │ +173 │ │ │ │ │ +174 │ │ │ │ │ +175 template │ │ │ │ │ +_1_7_6 class _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_N_o_d_e : │ │ │ │ │ +177 public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ │ +178 { │ │ │ │ │ +179 static const int dim = GV::dimension; │ │ │ │ │ +180 │ │ │ │ │ +181 public: │ │ │ │ │ +182 │ │ │ │ │ +_1_8_3 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ +_1_8_4 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ │ +_1_8_5 using _F_i_n_i_t_e_E_l_e_m_e_n_t = HierarchicalP2LocalFiniteElement; │ │ │ │ │ +186 │ │ │ │ │ +_1_8_7 _H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_N_o_d_e() : │ │ │ │ │ +188 _f_i_n_i_t_e_E_l_e_m_e_n_t__(), │ │ │ │ │ +189 _e_l_e_m_e_n_t__(nullptr) │ │ │ │ │ +190 {} │ │ │ │ │ +191 │ │ │ │ │ +_1_9_3 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ │ +194 { │ │ │ │ │ +195 return *_e_l_e_m_e_n_t__; │ │ │ │ │ +196 } │ │ │ │ │ +197 │ │ │ │ │ +_2_0_2 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 │ │ │ │ │ +203 { │ │ │ │ │ +204 return _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ │ +205 } │ │ │ │ │ +206 │ │ │ │ │ +_2_0_8 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ │ +209 { │ │ │ │ │ +210 _e_l_e_m_e_n_t__ = &e; │ │ │ │ │ +211 │ │ │ │ │ +212 if (e.type() != _f_i_n_i_t_e_E_l_e_m_e_n_t__.type()) │ │ │ │ │ +213 DUNE_THROW(Dune::Exception, │ │ │ │ │ +214 "HierarchicalLagrange-elements do not exist for elements of type " << │ │ │ │ │ +e.type()); │ │ │ │ │ +215 │ │ │ │ │ +216 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__.size()); │ │ │ │ │ +217 } │ │ │ │ │ +218 │ │ │ │ │ +219 protected: │ │ │ │ │ +220 │ │ │ │ │ +_2_2_1 unsigned int _o_r_d_e_r() const │ │ │ │ │ +222 { │ │ │ │ │ +223 return 2; │ │ │ │ │ +224 } │ │ │ │ │ +225 │ │ │ │ │ +_2_2_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__; │ │ │ │ │ +_2_2_7 const _E_l_e_m_e_n_t* _e_l_e_m_e_n_t__; │ │ │ │ │ +228 }; │ │ │ │ │ +229 │ │ │ │ │ +230 │ │ │ │ │ +231 │ │ │ │ │ +232 namespace BasisFactory { │ │ │ │ │ +233 │ │ │ │ │ +242 template │ │ │ │ │ +_2_4_3 auto _h_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e() │ │ │ │ │ +244 { │ │ │ │ │ +245 return [](const auto& gridView) { │ │ │ │ │ +246 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); │ │ │ │ │ +247 }; │ │ │ │ │ +248 } │ │ │ │ │ +249 │ │ │ │ │ +250 } // end namespace BasisFactory │ │ │ │ │ +251 │ │ │ │ │ +262 template │ │ │ │ │ +_2_6_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_> >; │ │ │ │ │ +264 │ │ │ │ │ +265 } // end namespace Functions │ │ │ │ │ +266} // end namespace Dune │ │ │ │ │ +267 │ │ │ │ │ +268#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_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 │ │ │ │ │ +_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() │ │ │ │ │ +Create a pre-basis factory that can create a HierarchicalLagrange pre-basis. │ │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:243 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r │ │ │ │ │ -Wrap a Dune::VirtualFunction into a callable object. │ │ │ │ │ -DDeeffiinniittiioonn callable.hh:38 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ │ -Range operator()(const Domain &x) const │ │ │ │ │ -Forward operator() to F::evaluate() │ │ │ │ │ -DDeeffiinniittiioonn callable.hh:70 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r_:_:_C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r │ │ │ │ │ -CallableFunctionWrapper(const F &f) │ │ │ │ │ -Instantiate from reference to f. │ │ │ │ │ -DDeeffiinniittiioonn callable.hh:50 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r_:_:_C_a_l_l_a_b_l_e_F_u_n_c_t_i_o_n_W_r_a_p_p_e_r │ │ │ │ │ -CallableFunctionWrapper(const std::shared_ptr< const F > &f) │ │ │ │ │ -Instantiate from std::shared_ptr to f. │ │ │ │ │ -DDeeffiinniittiioonn callable.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 │ │ │ │ │ +Global basis for given pre-basis. │ │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:46 │ │ │ │ │ +_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_N_o_d_e │ │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:178 │ │ │ │ │ +_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_N_o_d_e_:_:_F_i_n_i_t_e_E_l_e_m_e_n_t │ │ │ │ │ +HierarchicalP2LocalFiniteElement< typename GV::ctype, R, dim > FiniteElement │ │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:185 │ │ │ │ │ +_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_N_o_d_e_:_:_e_l_e_m_e_n_t │ │ │ │ │ +const Element & element() const │ │ │ │ │ +Return current element, throw if unbound. │ │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:193 │ │ │ │ │ +_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_N_o_d_e_:_:_b_i_n_d │ │ │ │ │ +void bind(const Element &e) │ │ │ │ │ +Bind to element. │ │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:208 │ │ │ │ │ +_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_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 hierarchicallagrangebasis.hh:202 │ │ │ │ │ +_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_N_o_d_e_:_:_e_l_e_m_e_n_t__ │ │ │ │ │ +const Element * element_ │ │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:227 │ │ │ │ │ +_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_N_o_d_e_:_:_f_i_n_i_t_e_E_l_e_m_e_n_t__ │ │ │ │ │ +const FiniteElement finiteElement_ │ │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:226 │ │ │ │ │ +_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_N_o_d_e_:_:_o_r_d_e_r │ │ │ │ │ +unsigned int order() const │ │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:221 │ │ │ │ │ +_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_N_o_d_e_:_:_H_i_e_r_a_r_c_h_i_c_a_l_L_a_g_r_a_n_g_e_N_o_d_e │ │ │ │ │ +HierarchicalLagrangeNode() │ │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:187 │ │ │ │ │ +_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_N_o_d_e_:_:_s_i_z_e___t_y_p_e │ │ │ │ │ +std::size_t size_type │ │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:183 │ │ │ │ │ +_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_N_o_d_e_:_:_E_l_e_m_e_n_t │ │ │ │ │ +typename GV::template Codim< 0 >::Entity Element │ │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:184 │ │ │ │ │ +_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 basis. │ │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:49 │ │ │ │ │ +_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_:_:_s_i_z_e___t_y_p_e │ │ │ │ │ +std::size_t size_type │ │ │ │ │ +Type used for indices and size information. │ │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:58 │ │ │ │ │ +_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_:_:_o_r_d_e_r │ │ │ │ │ +unsigned int order() const │ │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:145 │ │ │ │ │ +_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_:_:_m_a_k_e_N_o_d_e │ │ │ │ │ +Node makeNode() const │ │ │ │ │ +Create tree node. │ │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:94 │ │ │ │ │ +_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_:_:_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 hierarchicallagrangebasis.hh:123 │ │ │ │ │ +_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_:_:_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 hierarchicallagrangebasis.hh:65 │ │ │ │ │ +_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_:_:_u_p_d_a_t_e │ │ │ │ │ +void update(const GridView &gv) │ │ │ │ │ +Update the stored grid view & MultipleCodimMultipleGeomTypeMapper, to be called │ │ │ │ │ +if the grid has chang... │ │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:85 │ │ │ │ │ +_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_:_:_m_c_m_g_M_a_p_p_e_r__ │ │ │ │ │ +MultipleCodimMultipleGeomTypeMapper< GridView > mcmgMapper_ │ │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:150 │ │ │ │ │ +_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_:_:_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 hierarchicallagrangebasis.hh:114 │ │ │ │ │ +_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_r_i_d_V_i_e_w │ │ │ │ │ +GV GridView │ │ │ │ │ +The grid view that the FE basis is defined on. │ │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:55 │ │ │ │ │ +_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_:_:_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 GridView &gv) │ │ │ │ │ +Constructor for a given grid view object with layout for second order. │ │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:71 │ │ │ │ │ +_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_:_:_m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ +static constexpr size_type maxMultiIndexSize │ │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:63 │ │ │ │ │ +_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_:_:_s_i_z_e │ │ │ │ │ +size_type size(const SizePrefix prefix) const │ │ │ │ │ +Return number of possible values for next position in multi index. │ │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:107 │ │ │ │ │ +_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_r_i_d_V_i_e_w │ │ │ │ │ +const GridView & gridView() const │ │ │ │ │ +Obtain the grid view that the basis is defined on. │ │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:79 │ │ │ │ │ +_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_r_i_d_V_i_e_w__ │ │ │ │ │ +GridView gridView_ │ │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:143 │ │ │ │ │ +_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_:_:_s_i_z_e │ │ │ │ │ +size_type size() const │ │ │ │ │ +Same as size(prefix) with empty prefix. │ │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:100 │ │ │ │ │ +_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_:_:_i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ │ +void initializeIndices() │ │ │ │ │ +Initialize the global indices. │ │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:75 │ │ │ │ │ +_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_:_:_i_n_d_i_c_e_s │ │ │ │ │ +It indices(const Node &node, It it) const │ │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:130 │ │ │ │ │ +_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_:_:_m_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ +static constexpr size_type minMultiIndexSize │ │ │ │ │ +DDeeffiinniittiioonn hierarchicallagrangebasis.hh:64 │ │ │ │ │ +_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:164 │ │ │ │ │ +_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:186 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00125.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: treedata.hh File Reference │ │ │ │ +dune-functions: defaultglobalbasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,53 +65,65 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces
│ │ │ │ -
treedata.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Functions
│ │ │ │ +
defaultglobalbasis.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <memory>
│ │ │ │ -#include <dune/common/shared_ptr.hh>
│ │ │ │ -#include <dune/typetree/pairtraversal.hh>
│ │ │ │ -#include <dune/functions/gridfunctions/gridviewentityset.hh>
│ │ │ │ -#include <dune/functions/gridfunctions/gridfunction.hh>
│ │ │ │ +
#include <cstddef>
│ │ │ │ +#include <type_traits>
│ │ │ │ +#include <utility>
│ │ │ │ +#include <dune/common/reservedvector.hh>
│ │ │ │ +#include <dune/common/typeutilities.hh>
│ │ │ │ +#include <dune/common/concept.hh>
│ │ │ │ +#include <dune/functions/common/type_traits.hh>
│ │ │ │ +#include <dune/functions/functionspacebases/defaultlocalview.hh>
│ │ │ │ +#include <dune/functions/functionspacebases/concepts.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

struct  Dune::Functions::UniformNodeVisitor< SimpleNodeVisitorImp, leafOnly >
 Mixin for visitors that should apply the same action on all nodes. More...
 
class  Dune::Functions::TreeData< T, ND, LO >
 Container allowing to attach data to each node of a tree. More...
 
struct  Dune::Functions::TreeData< T, ND, LO >::InitVisitor
 
struct  Dune::Functions::TreeData< T, ND, LO >::DestroyVisitor
 
struct  Dune::Functions::TreeData< T, ND, LO >::CopyVisitor
class  Dune::Functions::DefaultGlobalBasis< PB >
 Global basis for given pre-basis. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ Namespaces

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

│ │ │ │ +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,36 +1,47 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -treedata.hh File Reference │ │ │ │ │ -#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_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> │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +defaultglobalbasis.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_/_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> │ │ │ │ │ _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_:_:_U_n_i_f_o_r_m_N_o_d_e_V_i_s_i_t_o_r_<_ _S_i_m_p_l_e_N_o_d_e_V_i_s_i_t_o_r_I_m_p_,_ _l_e_a_f_O_n_l_y_ _> │ │ │ │ │ -  Mixin for visitors that should apply the same action on all nodes. │ │ │ │ │ - _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ - class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_<_ _T_,_ _N_D_,_ _L_O_ _> │ │ │ │ │ -  Container allowing to attach data to each node of a tree. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_<_ _T_,_ _N_D_,_ _L_O_ _>_:_:_I_n_i_t_V_i_s_i_t_o_r │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_<_ _T_,_ _N_D_,_ _L_O_ _>_:_:_D_e_s_t_r_o_y_V_i_s_i_t_o_r │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_<_ _T_,_ _N_D_,_ _L_O_ _>_:_:_C_o_p_y_V_i_s_i_t_o_r │ │ │ │ │ +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 │ │ │ │ │ +  │ │ │ │ │ +namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_B_u_i_l_d_e_r │ │ │ │ │ +  │ │ │ │ │ +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 &&) -> _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s< │ │ │ │ │ + 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) -> _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s< 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) │ │ │ │ │ +  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00125_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: treedata.hh Source File │ │ │ │ +dune-functions: defaultglobalbasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,304 +70,234 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
treedata.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#ifndef DUNE_FUNCTIONS_COMMON_TREEDATA_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_COMMON_TREEDATA_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH
│ │ │ │
5
│ │ │ │ -
6
│ │ │ │ -
7#warning This file is deprecated. Please use TreeContainer from dune-typetree instead.
│ │ │ │ -
8
│ │ │ │ -
9#include <memory>
│ │ │ │ -
10
│ │ │ │ -
11#include <dune/common/shared_ptr.hh>
│ │ │ │ -
12
│ │ │ │ -
13#include <dune/typetree/pairtraversal.hh>
│ │ │ │ -
14
│ │ │ │ - │ │ │ │ - │ │ │ │ +
6#include <cstddef>
│ │ │ │ +
7#include <type_traits>
│ │ │ │ +
8#include <utility>
│ │ │ │ +
9
│ │ │ │ +
10#include <dune/common/reservedvector.hh>
│ │ │ │ +
11#include <dune/common/typeutilities.hh>
│ │ │ │ +
12#include <dune/common/concept.hh>
│ │ │ │ +
13
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
17
│ │ │ │ -
18namespace Dune {
│ │ │ │ -
19namespace Functions {
│ │ │ │ -
20
│ │ │ │ -
34template<class SimpleNodeVisitorImp, bool leafOnly>
│ │ │ │ -
│ │ │ │ -
35struct
│ │ │ │ -
36[[deprecated("This is an implementation detail of the deprecated class TreeDate and thus deprecated itself.")]]
│ │ │ │ - │ │ │ │ -
38 public TypeTree::TreeVisitor,
│ │ │ │ -
39 public TypeTree::DynamicTraversal
│ │ │ │ -
40{
│ │ │ │ -
41 // This is only enabled, if we want to incorporate inner nodes.
│ │ │ │ -
42 // Checking leafOnly would be sufficient, but for SFINAE the
│ │ │ │ -
43 // the enable_if condition must depend on the template parameter.
│ │ │ │ -
44 template<typename Node, typename TreePath,
│ │ │ │ -
45 typename std::enable_if<(not leafOnly) and (not Node::isLeaf), int>::type = 0>
│ │ │ │ -
│ │ │ │ -
46 void pre(Node& node, TreePath treePath)
│ │ │ │ -
47 {
│ │ │ │ -
48 static_cast<SimpleNodeVisitorImp*>(this)->apply(node, treePath);
│ │ │ │ -
49 }
│ │ │ │ -
│ │ │ │ -
50
│ │ │ │ -
51 template<typename Node, typename TreePath,
│ │ │ │ -
52 typename std::enable_if<(leafOnly) and (not Node::isLeaf), int>::type = 0>
│ │ │ │ -
│ │ │ │ -
53 void pre(Node& node, TreePath treePath)
│ │ │ │ -
54 {}
│ │ │ │ -
│ │ │ │ +
18
│ │ │ │ +
19
│ │ │ │ +
20namespace Dune {
│ │ │ │ +
21namespace Functions {
│ │ │ │ +
22
│ │ │ │ +
23
│ │ │ │ +
24
│ │ │ │ +
44template<class PB>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
46{
│ │ │ │ +
47
│ │ │ │ +
48public:
│ │ │ │ +
49
│ │ │ │ +
51 using PreBasis = PB;
│ │ │ │ +
52
│ │ │ │ +
54 using PrefixPath = TypeTree::HybridTreePath<>;
│ │ │ │
55
│ │ │ │ -
56 template<typename Node, typename TreePath>
│ │ │ │ -
│ │ │ │ -
57 void leaf(Node& node, TreePath treePath)
│ │ │ │ -
58 {
│ │ │ │ -
59 static_cast<SimpleNodeVisitorImp*>(this)->apply(node, treePath);
│ │ │ │ -
60 }
│ │ │ │ -
│ │ │ │ -
61};
│ │ │ │ -
│ │ │ │ -
62
│ │ │ │ -
63
│ │ │ │ +
57 using GridView = typename PreBasis::GridView;
│ │ │ │ +
58
│ │ │ │ +
60 using size_type = std::size_t;
│ │ │ │ +
61
│ │ │ │ + │ │ │ │
64
│ │ │ │ -
91template<class T, template<class> class ND, bool LO>
│ │ │ │ -
│ │ │ │ -
92class
│ │ │ │ -
93[[deprecated("This class is deprecated. Please use TreeContainer from dune-typetree instead.")]]
│ │ │ │ - │ │ │ │ -
95{
│ │ │ │ -
96
│ │ │ │ -
97public:
│ │ │ │ -
98
│ │ │ │ -
100 using Tree = T;
│ │ │ │ -
101
│ │ │ │ -
103 using size_type = typename Tree::size_type;
│ │ │ │ -
104
│ │ │ │ -
106 static const bool leafOnly = LO;
│ │ │ │ -
107
│ │ │ │ -
109 template<class Node>
│ │ │ │ -
110 using NodeData = ND<Node>;
│ │ │ │ + │ │ │ │ +
67
│ │ │ │ +
69 using SizePrefix = Dune::ReservedVector<std::size_t, PreBasis::multiIndexBufferSize>;
│ │ │ │ +
70
│ │ │ │ +
79 template<class... T,
│ │ │ │ +
80 disableCopyMove<DefaultGlobalBasis, T...> = 0,
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
83 preBasis_(std::forward<T>(t)...),
│ │ │ │ + │ │ │ │ +
85 {
│ │ │ │ +
86 static_assert(models<Concept::PreBasis<GridView>, PreBasis>(), "Type passed to DefaultGlobalBasis does not model the PreBasis concept.");
│ │ │ │ +
87 preBasis_.initializeIndices();
│ │ │ │ +
88 }
│ │ │ │ +
│ │ │ │ +
89
│ │ │ │ +
96 template<class PreBasisFactory,
│ │ │ │ +
97 std::enable_if_t<Dune::IsCallable<PreBasisFactory(GridView), PreBasis>::value, int> = 0>
│ │ │ │ +
│ │ │ │ +
98 DefaultGlobalBasis(const GridView& gridView, PreBasisFactory&& factory) :
│ │ │ │ +
99 preBasis_(factory(gridView)),
│ │ │ │ + │ │ │ │ +
101 {
│ │ │ │ +
102 static_assert(models<Concept::PreBasis<GridView>, PreBasis>(), "Type passed to DefaultGlobalBasis does not model the PreBasis concept.");
│ │ │ │ +
103 preBasis_.initializeIndices();
│ │ │ │ +
104 }
│ │ │ │ +
│ │ │ │ +
105
│ │ │ │ +
│ │ │ │ +
107 const GridView& gridView() const
│ │ │ │ +
108 {
│ │ │ │ +
109 return preBasis_.gridView();
│ │ │ │ +
110 }
│ │ │ │ +
│ │ │ │
111
│ │ │ │ -
112protected:
│ │ │ │ -
113 using RawContainer = std::vector<void*>;
│ │ │ │ -
114
│ │ │ │ -
115
│ │ │ │ -
116 // Since we can generate the node data type only if
│ │ │ │ -
117 // we know the type of the node, we have to do
│ │ │ │ -
118 // initialization, copy, and destruction via a
│ │ │ │ -
119 // tree traversal. Once we can use C++14 this can
│ │ │ │ -
120 // be written in a much easier and more selfcontained
│ │ │ │ -
121 // ways using generic lambda functions.
│ │ │ │ -
122 // Until then we need explicit visitor classes for
│ │ │ │ -
123 // each operation.
│ │ │ │ -
124
│ │ │ │ -
│ │ │ │ -
125 struct InitVisitor :
│ │ │ │ -
126 public UniformNodeVisitor<InitVisitor, leafOnly>
│ │ │ │ -
127 {
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
129 data_(data)
│ │ │ │ -
130 {}
│ │ │ │ -
│ │ │ │ -
131
│ │ │ │ -
132 template<typename Node, typename TreePath>
│ │ │ │ -
│ │ │ │ -
133 void apply(Node& node, TreePath treePath)
│ │ │ │ -
134 {
│ │ │ │ -
135 auto&& index = node.treeIndex();
│ │ │ │ -
136 if (data_.size() < index+1)
│ │ │ │ -
137 data_.resize(index+1, nullptr);
│ │ │ │ -
138 data_[index] = new NodeData<Node>;
│ │ │ │ -
139 }
│ │ │ │ +
│ │ │ │ +
113 const PreBasis& preBasis() const
│ │ │ │ +
114 {
│ │ │ │ +
115 return preBasis_;
│ │ │ │ +
116 }
│ │ │ │ +
│ │ │ │ +
117
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
120 {
│ │ │ │ +
121 return preBasis_;
│ │ │ │ +
122 }
│ │ │ │ +
│ │ │ │ +
123
│ │ │ │ +
│ │ │ │ +
130 void update(const GridView & gv)
│ │ │ │ +
131 {
│ │ │ │ +
132 preBasis_.update(gv);
│ │ │ │ +
133 preBasis_.initializeIndices();
│ │ │ │ +
134 }
│ │ │ │ +
│ │ │ │ +
135
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
138 {
│ │ │ │ +
139 return preBasis_.dimension();
│ │ │ │ +
140 }
│ │ │ │
│ │ │ │ -
140
│ │ │ │
141
│ │ │ │ - │ │ │ │ -
143 };
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
144 {
│ │ │ │ +
145 return preBasis_.size();
│ │ │ │ +
146 }
│ │ │ │ +
│ │ │ │ +
147
│ │ │ │ +
│ │ │ │ +
149 size_type size(const SizePrefix& prefix) const
│ │ │ │ +
150 {
│ │ │ │ +
151 return preBasis_.size(prefix);
│ │ │ │ +
152 }
│ │ │ │ +
│ │ │ │ +
153
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
156 {
│ │ │ │ +
157 return LocalView(*this);
│ │ │ │ +
158 }
│ │ │ │ +
│ │ │ │ +
159
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
162 {
│ │ │ │ +
163 return *this;
│ │ │ │ +
164 }
│ │ │ │
│ │ │ │ -
144
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
146 public UniformNodeVisitor<DestroyVisitor, leafOnly>
│ │ │ │ -
147 {
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
149 data_(data)
│ │ │ │ -
150 {}
│ │ │ │ -
│ │ │ │ -
151
│ │ │ │ -
152 template<typename Node, typename TreePath>
│ │ │ │ -
│ │ │ │ -
153 void apply(Node& node, TreePath treePath)
│ │ │ │ -
154 {
│ │ │ │ -
155 auto&& index = node.treeIndex();
│ │ │ │ -
156 auto p = (NodeData<Node>*)(data_[index]);
│ │ │ │ -
157 delete p;
│ │ │ │ -
158 data_[index] = nullptr;
│ │ │ │ -
159 }
│ │ │ │ -
│ │ │ │ -
160
│ │ │ │ - │ │ │ │ -
162 };
│ │ │ │ -
│ │ │ │ -
163
│ │ │ │ -
│ │ │ │ -
164 struct CopyVisitor :
│ │ │ │ -
165 public UniformNodeVisitor<CopyVisitor, leafOnly>
│ │ │ │ -
166 {
│ │ │ │ +
165
│ │ │ │
│ │ │ │ -
167 CopyVisitor(TreeData& thisTD, const TreeData& otherTD) :
│ │ │ │ -
168 thisTD_(thisTD),
│ │ │ │ -
169 otherTD_(otherTD)
│ │ │ │ -
170 {}
│ │ │ │ +
167 const PrefixPath& prefixPath() const
│ │ │ │ +
168 {
│ │ │ │ +
169 return prefixPath_;
│ │ │ │ +
170 }
│ │ │ │
│ │ │ │
171
│ │ │ │ -
172 template<typename Node, typename TreePath>
│ │ │ │ -
│ │ │ │ -
173 void apply(Node& node, TreePath treePath)
│ │ │ │ -
174 {
│ │ │ │ -
175 thisTD_[node] = otherTD_[node];
│ │ │ │ -
176 }
│ │ │ │ +
172protected:
│ │ │ │ + │ │ │ │ + │ │ │ │ +
175};
│ │ │ │
│ │ │ │ +
176
│ │ │ │
177
│ │ │ │ - │ │ │ │ - │ │ │ │ -
180 };
│ │ │ │ -
│ │ │ │ +
178
│ │ │ │ +
179template<class PreBasis>
│ │ │ │ + │ │ │ │
181
│ │ │ │ -
182public:
│ │ │ │ -
183
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
186 tree_(nullptr)
│ │ │ │ -
187 {}
│ │ │ │ -
│ │ │ │ +
182template<class GridView, class PreBasisFactory>
│ │ │ │ +
183DefaultGlobalBasis(const GridView& gv, PreBasisFactory&& f) -> DefaultGlobalBasis<std::decay_t<decltype(f(gv))>>;
│ │ │ │ +
184
│ │ │ │ +
185
│ │ │ │ +
186
│ │ │ │ +
187namespace BasisFactory {
│ │ │ │
188
│ │ │ │ -
│ │ │ │ -
196 void init(const Tree& tree)
│ │ │ │ -
197 {
│ │ │ │ -
198 if (tree_)
│ │ │ │ -
199 destroy();
│ │ │ │ -
200 tree_ = &tree;
│ │ │ │ -
201 TypeTree::applyToTree(*tree_, InitVisitor(data_));
│ │ │ │ -
202 }
│ │ │ │ -
│ │ │ │ +
189template<class GridView, class PreBasisFactory>
│ │ │ │ +
│ │ │ │ +
190auto makeBasis(const GridView& gridView, PreBasisFactory&& preBasisFactory)
│ │ │ │ +
191{
│ │ │ │ +
192 return DefaultGlobalBasis(preBasisFactory(gridView));
│ │ │ │ +
193}
│ │ │ │ +
│ │ │ │ +
194
│ │ │ │ +
195} // end namespace BasisFactory
│ │ │ │ +
196
│ │ │ │ +
197// Backward compatibility
│ │ │ │ +
198namespace BasisBuilder {
│ │ │ │ +
199
│ │ │ │ +
200 using namespace BasisFactory;
│ │ │ │ +
201
│ │ │ │ +
202}
│ │ │ │
203
│ │ │ │ -
│ │ │ │ -
205 TreeData(const TreeData& other) :
│ │ │ │ -
206 tree_(other.tree_)
│ │ │ │ -
207 {
│ │ │ │ -
208 TypeTree::applyToTree(*tree_, InitVisitor(data_));
│ │ │ │ -
209 TypeTree::applyToTree(*tree_, CopyVisitor(*this, other));
│ │ │ │ -
210 }
│ │ │ │ -
│ │ │ │ -
211
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
214 {
│ │ │ │ -
215 if (tree_)
│ │ │ │ -
216 TypeTree::applyToTree(*tree_, DestroyVisitor(data_));
│ │ │ │ -
217 tree_ = other.tree_;
│ │ │ │ -
218 TypeTree::applyToTree(*tree_, CopyVisitor(*this, other));
│ │ │ │ -
219 return *this;
│ │ │ │ -
220 }
│ │ │ │ -
│ │ │ │ -
221
│ │ │ │ -
│ │ │ │ -
223 void destroy()
│ │ │ │ -
224 {
│ │ │ │ -
225 if (tree_)
│ │ │ │ -
226 TypeTree::applyToTree(*tree_, DestroyVisitor(data_));
│ │ │ │ -
227 tree_ = nullptr;
│ │ │ │ -
228 }
│ │ │ │ -
│ │ │ │ -
229
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
232 {
│ │ │ │ -
233 if (tree_)
│ │ │ │ -
234 TypeTree::applyToTree(*tree_, DestroyVisitor(data_));
│ │ │ │ -
235 }
│ │ │ │ -
│ │ │ │ -
236
│ │ │ │ -
238 template<class Node>
│ │ │ │ -
│ │ │ │ -
239 NodeData<Node>& operator[](const Node& node)
│ │ │ │ -
240 {
│ │ │ │ -
241 return *(NodeData<Node>*)(data_[node.treeIndex()]);
│ │ │ │ -
242 }
│ │ │ │ -
│ │ │ │ -
243
│ │ │ │ -
245 template<class Node>
│ │ │ │ -
│ │ │ │ -
246 const NodeData<Node>& operator[](const Node& node) const
│ │ │ │ -
247 {
│ │ │ │ -
248 return *(NodeData<Node>*)(data_[node.treeIndex()]);
│ │ │ │ -
249 }
│ │ │ │ -
│ │ │ │ -
250
│ │ │ │ -
251protected:
│ │ │ │ -
252
│ │ │ │ -
253 const Tree* tree_;
│ │ │ │ - │ │ │ │ -
255};
│ │ │ │ -
│ │ │ │ -
256
│ │ │ │ -
257
│ │ │ │ -
258
│ │ │ │ -
259} // namespace Functions
│ │ │ │ -
260} // namespace Dune
│ │ │ │ -
261
│ │ │ │ -
262#endif // DUNE_FUNCTIONS_COMMON_TREEDATA_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ +
204
│ │ │ │ +
205} // end namespace Functions
│ │ │ │ +
206} // end namespace Dune
│ │ │ │ +
207
│ │ │ │ +
208
│ │ │ │ +
209
│ │ │ │ +
210#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ +
typename std::enable_if< std::is_constructible< T, Args... >::value, int >::type enableIfConstructible
Helper to constrain forwarding constructors.
Definition type_traits.hh:26
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
Mixin for visitors that should apply the same action on all nodes.
Definition treedata.hh:40
│ │ │ │ -
void pre(Node &node, TreePath treePath)
Definition treedata.hh:46
│ │ │ │ -
void leaf(Node &node, TreePath treePath)
Definition treedata.hh:57
│ │ │ │ -
Container allowing to attach data to each node of a tree.
Definition treedata.hh:95
│ │ │ │ -
TreeData(const TreeData &other)
Copy constructor.
Definition treedata.hh:205
│ │ │ │ -
void init(const Tree &tree)
Initialize from tree.
Definition treedata.hh:196
│ │ │ │ -
T Tree
Type of tree the data is associated with.
Definition treedata.hh:100
│ │ │ │ -
const Tree * tree_
Definition treedata.hh:253
│ │ │ │ -
void destroy()
Destroy data.
Definition treedata.hh:223
│ │ │ │ -
const NodeData< Node > & operator[](const Node &node) const
Get reference to data associated to given node.
Definition treedata.hh:246
│ │ │ │ -
TreeData & operator=(const TreeData &other)
Copy assignment.
Definition treedata.hh:213
│ │ │ │ -
~TreeData()
Destructor.
Definition treedata.hh:231
│ │ │ │ -
ND< Node > NodeData
Template to determine the data type for given node type.
Definition treedata.hh:110
│ │ │ │ -
TreeData()
Default constructor.
Definition treedata.hh:185
│ │ │ │ -
std::vector< void * > RawContainer
Definition treedata.hh:113
│ │ │ │ -
NodeData< Node > & operator[](const Node &node)
Get mutable reference to data associated to given node.
Definition treedata.hh:239
│ │ │ │ -
typename Tree::size_type size_type
Type used for indices and size information.
Definition treedata.hh:103
│ │ │ │ -
RawContainer data_
Definition treedata.hh:254
│ │ │ │ -
Definition treedata.hh:127
│ │ │ │ -
InitVisitor(RawContainer &data)
Definition treedata.hh:128
│ │ │ │ -
void apply(Node &node, TreePath treePath)
Definition treedata.hh:133
│ │ │ │ -
RawContainer & data_
Definition treedata.hh:142
│ │ │ │ - │ │ │ │ -
RawContainer & data_
Definition treedata.hh:161
│ │ │ │ -
DestroyVisitor(RawContainer &data)
Definition treedata.hh:148
│ │ │ │ -
void apply(Node &node, TreePath treePath)
Definition treedata.hh:153
│ │ │ │ -
Definition treedata.hh:166
│ │ │ │ -
CopyVisitor(TreeData &thisTD, const TreeData &otherTD)
Definition treedata.hh:167
│ │ │ │ -
void apply(Node &node, TreePath treePath)
Definition treedata.hh:173
│ │ │ │ -
TreeData & thisTD_
Definition treedata.hh:178
│ │ │ │ -
const TreeData & otherTD_
Definition treedata.hh:179
│ │ │ │ +
auto makeBasis(const GridView &gridView, PreBasisFactory &&preBasisFactory)
Definition defaultglobalbasis.hh:190
│ │ │ │ +
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:46
│ │ │ │ +
Dune::ReservedVector< std::size_t, PreBasis::multiIndexBufferSize > SizePrefix
Type used for prefixes handed to the size() method.
Definition defaultglobalbasis.hh:69
│ │ │ │ +
std::size_t size_type
Type used for indices and size information.
Definition defaultglobalbasis.hh:60
│ │ │ │ +
typename PreBasis::GridView GridView
The grid view that the FE space is defined on.
Definition defaultglobalbasis.hh:57
│ │ │ │ +
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition defaultglobalbasis.hh:107
│ │ │ │ +
PB PreBasis
Pre-basis providing the implementation details.
Definition defaultglobalbasis.hh:51
│ │ │ │ +
PreBasis & preBasis()
Obtain the pre-basis providing the implementation details.
Definition defaultglobalbasis.hh:119
│ │ │ │ +
void update(const GridView &gv)
Update the stored grid view.
Definition defaultglobalbasis.hh:130
│ │ │ │ +
DefaultLocalView< DefaultGlobalBasis< PreBasis > > LocalView
Type of the local view on the restriction of the basis to a single element.
Definition defaultglobalbasis.hh:63
│ │ │ │ +
typename LocalView::MultiIndex MultiIndex
Type used for global numbering of the basis vectors.
Definition defaultglobalbasis.hh:66
│ │ │ │ +
size_type size(const SizePrefix &prefix) const
Return number of possible values for next position in multi index.
Definition defaultglobalbasis.hh:149
│ │ │ │ +
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition defaultglobalbasis.hh:137
│ │ │ │ +
PreBasis preBasis_
Definition defaultglobalbasis.hh:173
│ │ │ │ +
LocalView localView() const
Return local view for basis.
Definition defaultglobalbasis.hh:155
│ │ │ │ +
TypeTree::HybridTreePath<> PrefixPath
The empty prefix path that identifies the root in the local ansatz tree.
Definition defaultglobalbasis.hh:54
│ │ │ │ +
DefaultGlobalBasis(T &&... t)
Constructor.
Definition defaultglobalbasis.hh:82
│ │ │ │ +
DefaultGlobalBasis(const GridView &gridView, PreBasisFactory &&factory)
Constructor from a PreBasis factory.
Definition defaultglobalbasis.hh:98
│ │ │ │ +
size_type size() const
Return number of possible values for next position in empty multi index.
Definition defaultglobalbasis.hh:143
│ │ │ │ +
const PreBasis & preBasis() const
Obtain the pre-basis providing the implementation details.
Definition defaultglobalbasis.hh:113
│ │ │ │ +
PrefixPath prefixPath_
Definition defaultglobalbasis.hh:174
│ │ │ │ +
const DefaultGlobalBasis & rootBasis() const
Return *this because we are not embedded in a larger basis.
Definition defaultglobalbasis.hh:161
│ │ │ │ +
const PrefixPath & prefixPath() const
Return empty path, because this is the root in the local ansatz tree.
Definition defaultglobalbasis.hh:167
│ │ │ │ +
The restriction of a finite element basis to a single element.
Definition defaultlocalview.hh:28
│ │ │ │ +
std::conditional_t<(PreBasis::minMultiIndexSize==PreBasis::maxMultiIndexSize), StaticMultiIndex< size_type, PreBasis::maxMultiIndexSize >, Dune::ReservedVector< size_type, PreBasis::multiIndexBufferSize > > MultiIndex
Type used for global numbering of the basis vectors.
Definition defaultlocalview.hh:64
│ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,325 +1,279 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -treedata.hh │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_COMMON_TREEDATA_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_COMMON_TREEDATA_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH │ │ │ │ │ 5 │ │ │ │ │ -6 │ │ │ │ │ -7#warning This file is deprecated. Please use TreeContainer from dune-typetree │ │ │ │ │ -instead. │ │ │ │ │ -8 │ │ │ │ │ -9#include │ │ │ │ │ -10 │ │ │ │ │ -11#include │ │ │ │ │ -12 │ │ │ │ │ -13#include │ │ │ │ │ -14 │ │ │ │ │ -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_/_g_r_i_d_f_u_n_c_t_i_o_n_._h_h> │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ +8#include │ │ │ │ │ +9 │ │ │ │ │ +10#include │ │ │ │ │ +11#include │ │ │ │ │ +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_/_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> │ │ │ │ │ +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 │ │ │ │ │ -18namespace _D_u_n_e { │ │ │ │ │ -19namespace Functions { │ │ │ │ │ -20 │ │ │ │ │ -34template │ │ │ │ │ -_3_5struct │ │ │ │ │ -36[[deprecated("This is an implementation detail of the deprecated class │ │ │ │ │ -TreeDate and thus deprecated itself.")]] │ │ │ │ │ -37_U_n_i_f_o_r_m_N_o_d_e_V_i_s_i_t_o_r : │ │ │ │ │ -38 public TypeTree::TreeVisitor, │ │ │ │ │ -39 public TypeTree::DynamicTraversal │ │ │ │ │ -40{ │ │ │ │ │ -41 // This is only enabled, if we want to incorporate inner nodes. │ │ │ │ │ -42 // Checking leafOnly would be sufficient, but for SFINAE the │ │ │ │ │ -43 // the enable_if condition must depend on the template parameter. │ │ │ │ │ -44 template::type = │ │ │ │ │ -0> │ │ │ │ │ -_4_6 void _p_r_e(Node& node, TreePath treePath) │ │ │ │ │ -47 { │ │ │ │ │ -48 static_cast(this)->apply(node, treePath); │ │ │ │ │ -49 } │ │ │ │ │ -50 │ │ │ │ │ -51 template::type = 0> │ │ │ │ │ -_5_3 void _p_r_e(Node& node, TreePath treePath) │ │ │ │ │ -54 {} │ │ │ │ │ +18 │ │ │ │ │ +19 │ │ │ │ │ +20namespace _D_u_n_e { │ │ │ │ │ +21namespace Functions { │ │ │ │ │ +22 │ │ │ │ │ +23 │ │ │ │ │ +24 │ │ │ │ │ +44template │ │ │ │ │ +_4_5class _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ │ +46{ │ │ │ │ │ +47 │ │ │ │ │ +48public: │ │ │ │ │ +49 │ │ │ │ │ +_5_1 using _P_r_e_B_a_s_i_s = PB; │ │ │ │ │ +52 │ │ │ │ │ +_5_4 using _P_r_e_f_i_x_P_a_t_h = TypeTree::HybridTreePath<>; │ │ │ │ │ 55 │ │ │ │ │ -56 template │ │ │ │ │ -_5_7 void _l_e_a_f(Node& node, TreePath treePath) │ │ │ │ │ -58 { │ │ │ │ │ -59 static_cast(this)->apply(node, treePath); │ │ │ │ │ -60 } │ │ │ │ │ -61}; │ │ │ │ │ -62 │ │ │ │ │ -63 │ │ │ │ │ +_5_7 using _G_r_i_d_V_i_e_w = typename PreBasis::GridView; │ │ │ │ │ +58 │ │ │ │ │ +_6_0 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ +61 │ │ │ │ │ +_6_3 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_>>; │ │ │ │ │ 64 │ │ │ │ │ -91template class ND, bool LO> │ │ │ │ │ -_9_2class │ │ │ │ │ -93[[deprecated("This class is deprecated. Please use TreeContainer from dune- │ │ │ │ │ -typetree instead.")]] │ │ │ │ │ -94_T_r_e_e_D_a_t_a │ │ │ │ │ -95{ │ │ │ │ │ -96 │ │ │ │ │ -97public: │ │ │ │ │ -98 │ │ │ │ │ -_1_0_0 using _T_r_e_e = T; │ │ │ │ │ -101 │ │ │ │ │ -_1_0_3 using _s_i_z_e___t_y_p_e = typename Tree::size_type; │ │ │ │ │ -104 │ │ │ │ │ -_1_0_6 static const bool leafOnly = LO; │ │ │ │ │ -107 │ │ │ │ │ -109 template │ │ │ │ │ -_1_1_0 using _N_o_d_e_D_a_t_a = ND; │ │ │ │ │ +_6_6 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; │ │ │ │ │ +67 │ │ │ │ │ +_6_9 using _S_i_z_e_P_r_e_f_i_x = Dune::ReservedVector; │ │ │ │ │ +70 │ │ │ │ │ +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<_P_r_e_B_a_s_i_s, T...> = 0> │ │ │ │ │ +_8_2 _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s(T&&... t) : │ │ │ │ │ +83 _p_r_e_B_a_s_i_s__(std::forward(t)...), │ │ │ │ │ +84 _p_r_e_f_i_x_P_a_t_h__() │ │ │ │ │ +85 { │ │ │ │ │ +86 static_assert(models, _P_r_e_B_a_s_i_s>(), "Type passed │ │ │ │ │ +to DefaultGlobalBasis does not model the PreBasis concept."); │ │ │ │ │ +87 _p_r_e_B_a_s_i_s__.initializeIndices(); │ │ │ │ │ +88 } │ │ │ │ │ +89 │ │ │ │ │ +96 template:: │ │ │ │ │ +value, int> = 0> │ │ │ │ │ +_9_8 _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) : │ │ │ │ │ +99 _p_r_e_B_a_s_i_s__(factory(_g_r_i_d_V_i_e_w)), │ │ │ │ │ +100 _p_r_e_f_i_x_P_a_t_h__() │ │ │ │ │ +101 { │ │ │ │ │ +102 static_assert(models, _P_r_e_B_a_s_i_s>(), "Type passed │ │ │ │ │ +to DefaultGlobalBasis does not model the PreBasis concept."); │ │ │ │ │ +103 _p_r_e_B_a_s_i_s__.initializeIndices(); │ │ │ │ │ +104 } │ │ │ │ │ +105 │ │ │ │ │ +_1_0_7 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ │ +108 { │ │ │ │ │ +109 return _p_r_e_B_a_s_i_s__.gridView(); │ │ │ │ │ +110 } │ │ │ │ │ 111 │ │ │ │ │ -112protected: │ │ │ │ │ -_1_1_3 using _R_a_w_C_o_n_t_a_i_n_e_r = std::vector; │ │ │ │ │ -114 │ │ │ │ │ -115 │ │ │ │ │ -116 // Since we can generate the node data type only if │ │ │ │ │ -117 // we know the type of the node, we have to do │ │ │ │ │ -118 // initialization, copy, and destruction via a │ │ │ │ │ -119 // tree traversal. Once we can use C++14 this can │ │ │ │ │ -120 // be written in a much easier and more selfcontained │ │ │ │ │ -121 // ways using generic lambda functions. │ │ │ │ │ -122 // Until then we need explicit visitor classes for │ │ │ │ │ -123 // each operation. │ │ │ │ │ -124 │ │ │ │ │ -_1_2_5 struct _I_n_i_t_V_i_s_i_t_o_r : │ │ │ │ │ -126 public _U_n_i_f_o_r_m_N_o_d_e_V_i_s_i_t_o_r │ │ │ │ │ -127 { │ │ │ │ │ -_1_2_8 _I_n_i_t_V_i_s_i_t_o_r(_R_a_w_C_o_n_t_a_i_n_e_r& data) : │ │ │ │ │ -129 data_(data) │ │ │ │ │ -130 {} │ │ │ │ │ -131 │ │ │ │ │ -132 template │ │ │ │ │ -_1_3_3 void _a_p_p_l_y(Node& node, TreePath treePath) │ │ │ │ │ -134 { │ │ │ │ │ -135 auto&& index = node.treeIndex(); │ │ │ │ │ -136 if (data_.size() < index+1) │ │ │ │ │ -137 data_.resize(index+1, nullptr); │ │ │ │ │ -138 data_[index] = new _N_o_d_e_D_a_t_a_<_N_o_d_e_>; │ │ │ │ │ -139 } │ │ │ │ │ -140 │ │ │ │ │ +_1_1_3 const _P_r_e_B_a_s_i_s& _p_r_e_B_a_s_i_s() const │ │ │ │ │ +114 { │ │ │ │ │ +115 return _p_r_e_B_a_s_i_s__; │ │ │ │ │ +116 } │ │ │ │ │ +117 │ │ │ │ │ +_1_1_9 _P_r_e_B_a_s_i_s& _p_r_e_B_a_s_i_s() │ │ │ │ │ +120 { │ │ │ │ │ +121 return _p_r_e_B_a_s_i_s__; │ │ │ │ │ +122 } │ │ │ │ │ +123 │ │ │ │ │ +_1_3_0 void _u_p_d_a_t_e(const _G_r_i_d_V_i_e_w & gv) │ │ │ │ │ +131 { │ │ │ │ │ +132 _p_r_e_B_a_s_i_s__.update(gv); │ │ │ │ │ +133 _p_r_e_B_a_s_i_s__.initializeIndices(); │ │ │ │ │ +134 } │ │ │ │ │ +135 │ │ │ │ │ +_1_3_7 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ │ +138 { │ │ │ │ │ +139 return _p_r_e_B_a_s_i_s__.dimension(); │ │ │ │ │ +140 } │ │ │ │ │ 141 │ │ │ │ │ -_1_4_2 _R_a_w_C_o_n_t_a_i_n_e_r& _d_a_t_a__; │ │ │ │ │ -143 }; │ │ │ │ │ -144 │ │ │ │ │ -_1_4_5 struct _D_e_s_t_r_o_y_V_i_s_i_t_o_r : │ │ │ │ │ -146 public _U_n_i_f_o_r_m_N_o_d_e_V_i_s_i_t_o_r │ │ │ │ │ -147 { │ │ │ │ │ -_1_4_8 _D_e_s_t_r_o_y_V_i_s_i_t_o_r(_R_a_w_C_o_n_t_a_i_n_e_r& data) : │ │ │ │ │ -149 data_(data) │ │ │ │ │ -150 {} │ │ │ │ │ -151 │ │ │ │ │ -152 template │ │ │ │ │ -_1_5_3 void _a_p_p_l_y(Node& node, TreePath treePath) │ │ │ │ │ -154 { │ │ │ │ │ -155 auto&& index = node.treeIndex(); │ │ │ │ │ -156 auto p = (_N_o_d_e_D_a_t_a_<_N_o_d_e_>*)(data_[index]); │ │ │ │ │ -157 delete p; │ │ │ │ │ -158 data_[index] = nullptr; │ │ │ │ │ -159 } │ │ │ │ │ -160 │ │ │ │ │ -_1_6_1 _R_a_w_C_o_n_t_a_i_n_e_r& _d_a_t_a__; │ │ │ │ │ -162 }; │ │ │ │ │ -163 │ │ │ │ │ -_1_6_4 struct _C_o_p_y_V_i_s_i_t_o_r : │ │ │ │ │ -165 public _U_n_i_f_o_r_m_N_o_d_e_V_i_s_i_t_o_r │ │ │ │ │ -166 { │ │ │ │ │ -_1_6_7 _C_o_p_y_V_i_s_i_t_o_r(_T_r_e_e_D_a_t_a& thisTD, const _T_r_e_e_D_a_t_a& otherTD) : │ │ │ │ │ -168 thisTD_(thisTD), │ │ │ │ │ -169 otherTD_(otherTD) │ │ │ │ │ -170 {} │ │ │ │ │ +_1_4_3 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ │ +144 { │ │ │ │ │ +145 return _p_r_e_B_a_s_i_s__.size(); │ │ │ │ │ +146 } │ │ │ │ │ +147 │ │ │ │ │ +_1_4_9 _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 │ │ │ │ │ +150 { │ │ │ │ │ +151 return _p_r_e_B_a_s_i_s__.size(prefix); │ │ │ │ │ +152 } │ │ │ │ │ +153 │ │ │ │ │ +_1_5_5 _L_o_c_a_l_V_i_e_w _l_o_c_a_l_V_i_e_w() const │ │ │ │ │ +156 { │ │ │ │ │ +157 return _L_o_c_a_l_V_i_e_w(*this); │ │ │ │ │ +158 } │ │ │ │ │ +159 │ │ │ │ │ +_1_6_1 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 │ │ │ │ │ +162 { │ │ │ │ │ +163 return *this; │ │ │ │ │ +164 } │ │ │ │ │ +165 │ │ │ │ │ +_1_6_7 const _P_r_e_f_i_x_P_a_t_h& _p_r_e_f_i_x_P_a_t_h() const │ │ │ │ │ +168 { │ │ │ │ │ +169 return _p_r_e_f_i_x_P_a_t_h__; │ │ │ │ │ +170 } │ │ │ │ │ 171 │ │ │ │ │ -172 template │ │ │ │ │ -_1_7_3 void _a_p_p_l_y(Node& node, TreePath treePath) │ │ │ │ │ -174 { │ │ │ │ │ -175 thisTD_[node] = otherTD_[node]; │ │ │ │ │ -176 } │ │ │ │ │ +172protected: │ │ │ │ │ +_1_7_3 _P_r_e_B_a_s_i_s _p_r_e_B_a_s_i_s__; │ │ │ │ │ +_1_7_4 _P_r_e_f_i_x_P_a_t_h _p_r_e_f_i_x_P_a_t_h__; │ │ │ │ │ +175}; │ │ │ │ │ +176 │ │ │ │ │ 177 │ │ │ │ │ -_1_7_8 _T_r_e_e_D_a_t_a& _t_h_i_s_T_D__; │ │ │ │ │ -_1_7_9 const _T_r_e_e_D_a_t_a& _o_t_h_e_r_T_D__; │ │ │ │ │ -180 }; │ │ │ │ │ +178 │ │ │ │ │ +179template │ │ │ │ │ +_1_8_0_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_>>; │ │ │ │ │ 181 │ │ │ │ │ -182public: │ │ │ │ │ -183 │ │ │ │ │ -_1_8_5 _T_r_e_e_D_a_t_a() : │ │ │ │ │ -186 tree_(nullptr) │ │ │ │ │ -187 {} │ │ │ │ │ +182template │ │ │ │ │ +_1_8_3_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>; │ │ │ │ │ +184 │ │ │ │ │ +185 │ │ │ │ │ +186 │ │ │ │ │ +187namespace BasisFactory { │ │ │ │ │ 188 │ │ │ │ │ -_1_9_6 void _i_n_i_t(const _T_r_e_e& tree) │ │ │ │ │ -197 { │ │ │ │ │ -198 if (tree_) │ │ │ │ │ -199 destroy(); │ │ │ │ │ -200 tree_ = &tree; │ │ │ │ │ -201 TypeTree::applyToTree(*tree_, _I_n_i_t_V_i_s_i_t_o_r(data_)); │ │ │ │ │ -202 } │ │ │ │ │ +189template │ │ │ │ │ +_1_9_0auto _m_a_k_e_B_a_s_i_s(const GridView& gridView, PreBasisFactory&& preBasisFactory) │ │ │ │ │ +191{ │ │ │ │ │ +192 return _D_e_f_a_u_l_t_G_l_o_b_a_l_B_a_s_i_s(preBasisFactory(gridView)); │ │ │ │ │ +193} │ │ │ │ │ +194 │ │ │ │ │ +195} // end namespace BasisFactory │ │ │ │ │ +196 │ │ │ │ │ +197// Backward compatibility │ │ │ │ │ +198namespace BasisBuilder { │ │ │ │ │ +199 │ │ │ │ │ +200 using namespace BasisFactory; │ │ │ │ │ +201 │ │ │ │ │ +202} │ │ │ │ │ 203 │ │ │ │ │ -_2_0_5 _T_r_e_e_D_a_t_a(const _T_r_e_e_D_a_t_a& other) : │ │ │ │ │ -206 tree_(other.tree_) │ │ │ │ │ -207 { │ │ │ │ │ -208 TypeTree::applyToTree(*tree_, _I_n_i_t_V_i_s_i_t_o_r(data_)); │ │ │ │ │ -209 TypeTree::applyToTree(*tree_, _C_o_p_y_V_i_s_i_t_o_r(*this, other)); │ │ │ │ │ -210 } │ │ │ │ │ -211 │ │ │ │ │ -_2_1_3 _T_r_e_e_D_a_t_a& _o_p_e_r_a_t_o_r_=(const _T_r_e_e_D_a_t_a& other) │ │ │ │ │ -214 { │ │ │ │ │ -215 if (tree_) │ │ │ │ │ -216 TypeTree::applyToTree(*tree_, _D_e_s_t_r_o_y_V_i_s_i_t_o_r(data_)); │ │ │ │ │ -217 tree_ = other._t_r_e_e__; │ │ │ │ │ -218 TypeTree::applyToTree(*tree_, _C_o_p_y_V_i_s_i_t_o_r(*this, other)); │ │ │ │ │ -219 return *this; │ │ │ │ │ -220 } │ │ │ │ │ -221 │ │ │ │ │ -_2_2_3 void _d_e_s_t_r_o_y() │ │ │ │ │ -224 { │ │ │ │ │ -225 if (tree_) │ │ │ │ │ -226 TypeTree::applyToTree(*tree_, _D_e_s_t_r_o_y_V_i_s_i_t_o_r(data_)); │ │ │ │ │ -227 tree_ = nullptr; │ │ │ │ │ -228 } │ │ │ │ │ -229 │ │ │ │ │ -_2_3_1 _~_T_r_e_e_D_a_t_a() │ │ │ │ │ -232 { │ │ │ │ │ -233 if (tree_) │ │ │ │ │ -234 TypeTree::applyToTree(*tree_, _D_e_s_t_r_o_y_V_i_s_i_t_o_r(data_)); │ │ │ │ │ -235 } │ │ │ │ │ -236 │ │ │ │ │ -238 template │ │ │ │ │ -_2_3_9 _N_o_d_e_D_a_t_a_<_N_o_d_e_>& _o_p_e_r_a_t_o_r_[_](const Node& node) │ │ │ │ │ -240 { │ │ │ │ │ -241 return *(_N_o_d_e_D_a_t_a_<_N_o_d_e_>*)(data_[node.treeIndex()]); │ │ │ │ │ -242 } │ │ │ │ │ -243 │ │ │ │ │ -245 template │ │ │ │ │ -_2_4_6 const _N_o_d_e_D_a_t_a_<_N_o_d_e_>& _o_p_e_r_a_t_o_r_[_](const Node& node) const │ │ │ │ │ -247 { │ │ │ │ │ -248 return *(_N_o_d_e_D_a_t_a_<_N_o_d_e_>*)(data_[node.treeIndex()]); │ │ │ │ │ -249 } │ │ │ │ │ -250 │ │ │ │ │ -251protected: │ │ │ │ │ -252 │ │ │ │ │ -_2_5_3 const _T_r_e_e* _t_r_e_e__; │ │ │ │ │ -_2_5_4 _R_a_w_C_o_n_t_a_i_n_e_r _d_a_t_a__; │ │ │ │ │ -255}; │ │ │ │ │ -256 │ │ │ │ │ -257 │ │ │ │ │ -258 │ │ │ │ │ -259} // namespace Functions │ │ │ │ │ -260} // namespace Dune │ │ │ │ │ -261 │ │ │ │ │ -262#endif // DUNE_FUNCTIONS_COMMON_TREEDATA_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 │ │ │ │ │ +204 │ │ │ │ │ +205} // end namespace Functions │ │ │ │ │ +206} // end namespace Dune │ │ │ │ │ +207 │ │ │ │ │ +208 │ │ │ │ │ +209 │ │ │ │ │ +210#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 │ │ │ │ │ +_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 │ │ │ │ │ +typename std::enable_if< std::is_constructible< T, Args... >::value, int >:: │ │ │ │ │ +type enableIfConstructible │ │ │ │ │ +Helper to constrain forwarding constructors. │ │ │ │ │ +DDeeffiinniittiioonn type_traits.hh:26 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_U_n_i_f_o_r_m_N_o_d_e_V_i_s_i_t_o_r │ │ │ │ │ -Mixin for visitors that should apply the same action on all nodes. │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:40 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_U_n_i_f_o_r_m_N_o_d_e_V_i_s_i_t_o_r_:_:_p_r_e │ │ │ │ │ -void pre(Node &node, TreePath treePath) │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:46 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_U_n_i_f_o_r_m_N_o_d_e_V_i_s_i_t_o_r_:_:_l_e_a_f │ │ │ │ │ -void leaf(Node &node, TreePath treePath) │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:57 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a │ │ │ │ │ -Container allowing to attach data to each node of a tree. │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:95 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_T_r_e_e_D_a_t_a │ │ │ │ │ -TreeData(const TreeData &other) │ │ │ │ │ -Copy constructor. │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:205 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_i_n_i_t │ │ │ │ │ -void init(const Tree &tree) │ │ │ │ │ -Initialize from tree. │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:196 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_T_r_e_e │ │ │ │ │ -T Tree │ │ │ │ │ -Type of tree the data is associated with. │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:100 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_t_r_e_e__ │ │ │ │ │ -const Tree * tree_ │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:253 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_d_e_s_t_r_o_y │ │ │ │ │ -void destroy() │ │ │ │ │ -Destroy data. │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:223 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_o_p_e_r_a_t_o_r_[_] │ │ │ │ │ -const NodeData< Node > & operator[](const Node &node) const │ │ │ │ │ -Get reference to data associated to given node. │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:246 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_o_p_e_r_a_t_o_r_= │ │ │ │ │ -TreeData & operator=(const TreeData &other) │ │ │ │ │ -Copy assignment. │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:213 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_~_T_r_e_e_D_a_t_a │ │ │ │ │ -~TreeData() │ │ │ │ │ -Destructor. │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:231 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_N_o_d_e_D_a_t_a │ │ │ │ │ -ND< Node > NodeData │ │ │ │ │ -Template to determine the data type for given node type. │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:110 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_T_r_e_e_D_a_t_a │ │ │ │ │ -TreeData() │ │ │ │ │ -Default constructor. │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:185 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_R_a_w_C_o_n_t_a_i_n_e_r │ │ │ │ │ -std::vector< void * > RawContainer │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:113 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_o_p_e_r_a_t_o_r_[_] │ │ │ │ │ -NodeData< Node > & operator[](const Node &node) │ │ │ │ │ -Get mutable reference to data associated to given node. │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:239 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_s_i_z_e___t_y_p_e │ │ │ │ │ -typename Tree::size_type size_type │ │ │ │ │ +_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: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 │ │ │ │ │ +Global basis for given pre-basis. │ │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:46 │ │ │ │ │ +_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_P_r_e_f_i_x │ │ │ │ │ +Dune::ReservedVector< std::size_t, PreBasis::multiIndexBufferSize > SizePrefix │ │ │ │ │ +Type used for prefixes handed to the size() method. │ │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:69 │ │ │ │ │ +_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___t_y_p_e │ │ │ │ │ +std::size_t size_type │ │ │ │ │ Type used for indices and size information. │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:103 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_d_a_t_a__ │ │ │ │ │ -RawContainer data_ │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:254 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_I_n_i_t_V_i_s_i_t_o_r │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:127 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_I_n_i_t_V_i_s_i_t_o_r_:_:_I_n_i_t_V_i_s_i_t_o_r │ │ │ │ │ -InitVisitor(RawContainer &data) │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:128 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_I_n_i_t_V_i_s_i_t_o_r_:_:_a_p_p_l_y │ │ │ │ │ -void apply(Node &node, TreePath treePath) │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:133 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_I_n_i_t_V_i_s_i_t_o_r_:_:_d_a_t_a__ │ │ │ │ │ -RawContainer & data_ │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:142 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_D_e_s_t_r_o_y_V_i_s_i_t_o_r │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:147 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_D_e_s_t_r_o_y_V_i_s_i_t_o_r_:_:_d_a_t_a__ │ │ │ │ │ -RawContainer & data_ │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:161 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_D_e_s_t_r_o_y_V_i_s_i_t_o_r_:_:_D_e_s_t_r_o_y_V_i_s_i_t_o_r │ │ │ │ │ -DestroyVisitor(RawContainer &data) │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:148 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_D_e_s_t_r_o_y_V_i_s_i_t_o_r_:_:_a_p_p_l_y │ │ │ │ │ -void apply(Node &node, TreePath treePath) │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:153 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_C_o_p_y_V_i_s_i_t_o_r │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:166 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_C_o_p_y_V_i_s_i_t_o_r_:_:_C_o_p_y_V_i_s_i_t_o_r │ │ │ │ │ -CopyVisitor(TreeData &thisTD, const TreeData &otherTD) │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:167 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_C_o_p_y_V_i_s_i_t_o_r_:_:_a_p_p_l_y │ │ │ │ │ -void apply(Node &node, TreePath treePath) │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:173 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_C_o_p_y_V_i_s_i_t_o_r_:_:_t_h_i_s_T_D__ │ │ │ │ │ -TreeData & thisTD_ │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:178 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_T_r_e_e_D_a_t_a_:_:_C_o_p_y_V_i_s_i_t_o_r_:_:_o_t_h_e_r_T_D__ │ │ │ │ │ -const TreeData & otherTD_ │ │ │ │ │ -DDeeffiinniittiioonn treedata.hh:179 │ │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:60 │ │ │ │ │ +_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:57 │ │ │ │ │ +_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 │ │ │ │ │ +const GridView & gridView() const │ │ │ │ │ +Obtain the grid view that the basis is defined on. │ │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:107 │ │ │ │ │ +_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:51 │ │ │ │ │ +_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:119 │ │ │ │ │ +_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:130 │ │ │ │ │ +_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 │ │ │ │ │ +DefaultLocalView< DefaultGlobalBasis< PreBasis > > LocalView │ │ │ │ │ +Type of the local view on the restriction of the basis to a single element. │ │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:63 │ │ │ │ │ +_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_:_:_M_u_l_t_i_I_n_d_e_x │ │ │ │ │ +typename LocalView::MultiIndex MultiIndex │ │ │ │ │ +Type used for global numbering of the basis vectors. │ │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.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_:_:_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:149 │ │ │ │ │ +_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: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_:_:_p_r_e_B_a_s_i_s__ │ │ │ │ │ +PreBasis preBasis_ │ │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:173 │ │ │ │ │ +_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:155 │ │ │ │ │ +_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 │ │ │ │ │ +TypeTree::HybridTreePath<> PrefixPath │ │ │ │ │ +The empty prefix path that identifies the root in the local ansatz tree. │ │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:54 │ │ │ │ │ +_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:82 │ │ │ │ │ +_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:98 │ │ │ │ │ +_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:143 │ │ │ │ │ +_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:113 │ │ │ │ │ +_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__ │ │ │ │ │ +PrefixPath prefixPath_ │ │ │ │ │ +DDeeffiinniittiioonn defaultglobalbasis.hh:174 │ │ │ │ │ +_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:161 │ │ │ │ │ +_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:167 │ │ │ │ │ +_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:28 │ │ │ │ │ +_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_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 │ │ │ │ │ +Type used for global numbering of the basis vectors. │ │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:64 │ │ │ │ │ +_c_o_n_c_e_p_t_s_._h_h │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00128.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: overflowarray.hh File Reference │ │ │ │ +dune-functions: basistags.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,45 +65,85 @@ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces
│ │ │ │ -
overflowarray.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Functions
│ │ │ │ +
basistags.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <algorithm>
│ │ │ │ -#include <iostream>
│ │ │ │ -#include <cstddef>
│ │ │ │ -#include <array>
│ │ │ │ -#include <initializer_list>
│ │ │ │ -#include <dune/common/genericiterator.hh>
│ │ │ │ +
#include <type_traits>
│ │ │ │ +#include <dune/common/concept.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...
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
 
namespace  Dune::Functions::BasisBuilder
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +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,27 +1,80 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -overflowarray.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +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 │ │ │ │ │ -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_._._. │ │ │ │ │ +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 │ │ │ │ │ +  │ │ │ │ │ +namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_B_a_s_i_s_B_u_i_l_d_e_r │ │ │ │ │ +  │ │ │ │ │ +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). │ │ │ │ │ +  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00128_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: overflowarray.hh Source File │ │ │ │ +dune-functions: basistags.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,282 +70,150 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
overflowarray.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#ifndef DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH
│ │ │ │
5
│ │ │ │ -
6#include <algorithm>
│ │ │ │ -
7#include <iostream>
│ │ │ │ -
8#include <cstddef>
│ │ │ │ -
9#include <array>
│ │ │ │ -
10#include <initializer_list>
│ │ │ │ +
6#include <type_traits>
│ │ │ │ +
7#include <dune/common/concept.hh>
│ │ │ │ +
8
│ │ │ │ +
9namespace Dune {
│ │ │ │ +
10namespace Functions {
│ │ │ │
11
│ │ │ │ -
12#include <dune/common/genericiterator.hh>
│ │ │ │ +
12 namespace Concept {
│ │ │ │
13
│ │ │ │ -
14
│ │ │ │ -
15
│ │ │ │ -
16namespace Dune::Functions {
│ │ │ │ -
17
│ │ │ │ -
18
│ │ │ │ -
42template<class BA, std::size_t maxSize = std::tuple_size_v<BA>>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
44 public BA
│ │ │ │ -
45{
│ │ │ │ -
46 static constexpr std::size_t baseSize = std::tuple_size_v<BA>;
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
15 {
│ │ │ │ +
16 template<typename T>
│ │ │ │ +
17 auto require(T&& t) -> decltype(
│ │ │ │ +
18 registerIndexMergingStrategy(t)
│ │ │ │ +
19 );
│ │ │ │ +
20 };
│ │ │ │ +
│ │ │ │ +
21
│ │ │ │ +
22 template<typename T>
│ │ │ │ +
│ │ │ │ +
23 static constexpr bool isIndexMergingStrategy()
│ │ │ │ +
24 {
│ │ │ │ +
25 return models<Concept::IndexMergingStrategy,T>();
│ │ │ │ +
26 }
│ │ │ │ +
│ │ │ │ +
27
│ │ │ │ +
28 template<typename T>
│ │ │ │ +
│ │ │ │ +
29 static constexpr bool isIndexMergingStrategy(T&& t)
│ │ │ │ +
30 {
│ │ │ │ +
31 return models<Concept::IndexMergingStrategy,std::decay_t<T>>();
│ │ │ │ +
32 }
│ │ │ │ +
│ │ │ │ +
33
│ │ │ │ +
34 } // namespace Concept
│ │ │ │ +
35
│ │ │ │ +
36
│ │ │ │ +
│ │ │ │ +
37namespace BasisFactory {
│ │ │ │ +
38
│ │ │ │ + │ │ │ │ +
45
│ │ │ │ + │ │ │ │
47
│ │ │ │ -
48public:
│ │ │ │ -
49 using BaseArray = BA;
│ │ │ │ -
50
│ │ │ │ -
51 using value_type = typename BaseArray::value_type;
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
55 using difference_type = std::ptrdiff_t;
│ │ │ │ -
56 using size_type = std::size_t;
│ │ │ │ -
57 using iterator = Dune::GenericIterator<OverflowArray, value_type>;
│ │ │ │ -
58 using const_iterator = Dune::GenericIterator<const OverflowArray, const value_type>;
│ │ │ │ -
59
│ │ │ │ -
60private:
│ │ │ │ -
61 using OverflowBuffer = std::array<value_type, maxSize-baseSize>;
│ │ │ │ -
62
│ │ │ │ -
63public:
│ │ │ │ -
64
│ │ │ │ -
65 OverflowArray() = default;
│ │ │ │ -
66
│ │ │ │ -
│ │ │ │ -
67 OverflowArray(const std::initializer_list<value_type>& l) {
│ │ │ │ -
68 assert(l.size() <= capacity());
│ │ │ │ -
69 size_ = l.size();
│ │ │ │ -
70 std::copy_n(l.begin(), size_, begin());
│ │ │ │ -
71 }
│ │ │ │ -
│ │ │ │ -
72
│ │ │ │ -
│ │ │ │ -
73 bool operator == (const OverflowArray& other) const {
│ │ │ │ -
74 if (size() != other.size())
│ │ │ │ -
75 return false;
│ │ │ │ -
76 for (size_type i=0; i<size(); ++i)
│ │ │ │ -
77 if ((*this)[i] != other[i])
│ │ │ │ -
78 return false;
│ │ │ │ -
79 return true;
│ │ │ │ -
80 }
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ +
80 {};
│ │ │ │
│ │ │ │
81
│ │ │ │ -
│ │ │ │ -
83 void clear() {
│ │ │ │ -
84 size_ = 0;
│ │ │ │ -
85 }
│ │ │ │ -
│ │ │ │ -
86
│ │ │ │ -
│ │ │ │ -
93 void resize(size_type n) {
│ │ │ │ -
94 assert(n <= capacity());
│ │ │ │ -
95 size_ = n;
│ │ │ │ -
96 }
│ │ │ │ -
│ │ │ │ -
97
│ │ │ │ -
│ │ │ │ -
104 void push_back(const value_type& t) {
│ │ │ │ -
105 assert(size() < capacity());
│ │ │ │ -
106 (*this)[size_++] = t;
│ │ │ │ -
107 }
│ │ │ │ -
│ │ │ │ -
108
│ │ │ │ -
│ │ │ │ -
110 void pop_back() {
│ │ │ │ -
111 assert(size() > 0);
│ │ │ │ -
112 if (! empty())
│ │ │ │ -
113 size_--;
│ │ │ │ -
114 }
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
113 : public IndexMergingStrategy
│ │ │ │ +
114 {};
│ │ │ │
│ │ │ │
115
│ │ │ │ -
│ │ │ │ -
122 void push_front(const value_type& t) {
│ │ │ │ -
123 assert(size() < capacity());
│ │ │ │ -
124 for (size_type i=0; i<size(); i++)
│ │ │ │ -
125 (*this)[i+1] = (*this)[i];
│ │ │ │ -
126 (*this)[0] = t;
│ │ │ │ -
127 }
│ │ │ │ -
│ │ │ │ -
128
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
131 return iterator(*this, 0);
│ │ │ │ -
132 }
│ │ │ │ -
│ │ │ │ -
133
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
136 return const_iterator(*this, 0);
│ │ │ │ -
137 }
│ │ │ │ -
│ │ │ │ -
138
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
141 return iterator(*this, size());
│ │ │ │ -
142 }
│ │ │ │ -
│ │ │ │ -
143
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
146 return const_iterator(*this, size());
│ │ │ │ -
147 }
│ │ │ │ -
│ │ │ │ -
148
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
151 assert(i < size());
│ │ │ │ -
152 // If there's no padding between the base class and the overflow_ member,
│ │ │ │ -
153 // the compiler should be able to optimize this to
│ │ │ │ -
154 // return *(&BaseArray::operator[](0) + i);
│ │ │ │ -
155 if (i<baseSize)
│ │ │ │ -
156 return BaseArray::operator[](i);
│ │ │ │ -
157 return overflow_[i-baseSize];
│ │ │ │ -
158 }
│ │ │ │ -
│ │ │ │ -
159
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
162 assert(i < size());
│ │ │ │ -
163 // If there's no padding between the base class and the overflow_ member,
│ │ │ │ -
164 // the compiler should be able to optimize this to
│ │ │ │ -
165 // return *(&BaseArray::operator[](0) + i);
│ │ │ │ -
166 if (i<baseSize)
│ │ │ │ -
167 return BaseArray::operator[](i);
│ │ │ │ -
168 return overflow_[i-baseSize];
│ │ │ │ -
169 }
│ │ │ │ -
│ │ │ │ -
170
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
173 assert(size() > 0);
│ │ │ │ -
174 return (*this)[0];
│ │ │ │ -
175 }
│ │ │ │ -
│ │ │ │ -
176
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
179 assert(size() > 0);
│ │ │ │ -
180 return (*this)[0];
│ │ │ │ -
181 }
│ │ │ │ -
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
147 : public IndexMergingStrategy
│ │ │ │ +
148 {};
│ │ │ │ +
│ │ │ │ +
149
│ │ │ │ + │ │ │ │ +
181
│ │ │ │
182
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
185 assert(size() > 0);
│ │ │ │ -
186 return (*this)[size()-1];
│ │ │ │ -
187 }
│ │ │ │ -
│ │ │ │ -
188
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
191 assert(size() > 0);
│ │ │ │ -
192 return (*this)[size()-1];
│ │ │ │ -
193 }
│ │ │ │ -
│ │ │ │ -
194
│ │ │ │ -
│ │ │ │ -
196 size_type size () const {
│ │ │ │ -
197 return size_;
│ │ │ │ -
198 }
│ │ │ │ -
│ │ │ │ -
199
│ │ │ │ -
│ │ │ │ -
201 bool empty() const {
│ │ │ │ -
202 return size() == 0;
│ │ │ │ -
203 }
│ │ │ │ -
│ │ │ │ -
204
│ │ │ │ -
│ │ │ │ -
206 static constexpr size_type capacity() {
│ │ │ │ -
207 return maxSize;
│ │ │ │ -
208 }
│ │ │ │ -
│ │ │ │ -
209
│ │ │ │ -
│ │ │ │ -
211 static constexpr size_type max_size() {
│ │ │ │ -
212 return maxSize;
│ │ │ │ -
213 }
│ │ │ │ -
│ │ │ │ -
214
│ │ │ │ -
│ │ │ │ -
216 inline friend std::size_t hash_value(const OverflowArray& v) noexcept {
│ │ │ │ -
217 return hash_range(v.begin(), v.end());
│ │ │ │ -
218 }
│ │ │ │ -
│ │ │ │ -
219
│ │ │ │ -
│ │ │ │ -
221 friend std::ostream& operator<< (std::ostream& s, const OverflowArray& c) {
│ │ │ │ -
222 for (const auto& ci : c)
│ │ │ │ -
223 s << ci << " ";
│ │ │ │ -
224 return s;
│ │ │ │ -
225 }
│ │ │ │ -
│ │ │ │ -
226
│ │ │ │ -
227private:
│ │ │ │ -
228 OverflowBuffer overflow_;
│ │ │ │ -
229 size_type size_ = 0;
│ │ │ │ -
230};
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
189 {
│ │ │ │ +
190 return {};
│ │ │ │ +
191 }
│ │ │ │ +
│ │ │ │ +
192
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
199 {
│ │ │ │ +
200 return {};
│ │ │ │ +
201 }
│ │ │ │ +
│ │ │ │ +
202
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
209 {
│ │ │ │ +
210 return {};
│ │ │ │ +
211 }
│ │ │ │ +
│ │ │ │ +
212
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
219 {
│ │ │ │ +
220 return {};
│ │ │ │ +
221 }
│ │ │ │ +
│ │ │ │ +
222
│ │ │ │ +
223} // end namespace BasisFactory
│ │ │ │ +
│ │ │ │ +
224
│ │ │ │ +
225// Backward compatibility
│ │ │ │ +
│ │ │ │ +
226namespace BasisBuilder {
│ │ │ │ +
227
│ │ │ │ +
228 using namespace BasisFactory;
│ │ │ │ +
229
│ │ │ │ +
230}
│ │ │ │
│ │ │ │
231
│ │ │ │ -
232
│ │ │ │ -
233
│ │ │ │ -
234} // namespace Dune::Functions
│ │ │ │ +
232} // end namespace Functions
│ │ │ │ +
233} // end namespace Dune
│ │ │ │ +
234
│ │ │ │
235
│ │ │ │ -
236
│ │ │ │ -
237
│ │ │ │ -
238#endif // DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH
│ │ │ │ -
Definition polynomial.hh:11
│ │ │ │ -
A dynamically sized array-like class with overflow.
Definition overflowarray.hh:45
│ │ │ │ -
const value_type & const_reference
Definition overflowarray.hh:53
│ │ │ │ -
value_type & reference
Definition overflowarray.hh:52
│ │ │ │ -
const_iterator end() const
Returns a const_iterator pointing to the end of the OverflowArray.
Definition overflowarray.hh:145
│ │ │ │ -
bool operator==(const OverflowArray &other) const
Definition overflowarray.hh:73
│ │ │ │ -
friend std::size_t hash_value(const OverflowArray &v) noexcept
Compute hash value.
Definition overflowarray.hh:216
│ │ │ │ -
void push_back(const value_type &t)
Appends an element to the end of the OverflowArray,.
Definition overflowarray.hh:104
│ │ │ │ -
friend std::ostream & operator<<(std::ostream &s, const OverflowArray &c)
Write container to an output stream.
Definition overflowarray.hh:221
│ │ │ │ -
iterator begin()
Returns a iterator pointing to the beginning of the OverflowArray.
Definition overflowarray.hh:130
│ │ │ │ -
bool empty() const
Returns true if OverflowArray has no elements.
Definition overflowarray.hh:201
│ │ │ │ -
size_type size() const
Returns number of elements in the OverflowArray.
Definition overflowarray.hh:196
│ │ │ │ -
typename BaseArray::value_type value_type
Definition overflowarray.hh:51
│ │ │ │ -
void pop_back()
Erases the last element of the OverflowArray, O(1) time.
Definition overflowarray.hh:110
│ │ │ │ -
Dune::GenericIterator< OverflowArray, value_type > iterator
Definition overflowarray.hh:57
│ │ │ │ -
const_iterator begin() const
Returns a const_iterator pointing to the beginning of the OverflowArray.
Definition overflowarray.hh:135
│ │ │ │ -
std::ptrdiff_t difference_type
Definition overflowarray.hh:55
│ │ │ │ - │ │ │ │ -
BA BaseArray
Definition overflowarray.hh:49
│ │ │ │ -
static constexpr size_type capacity()
Returns the capacity of the OverflowArray.
Definition overflowarray.hh:206
│ │ │ │ -
static constexpr size_type max_size()
Returns the maximum length of the OverflowArray.
Definition overflowarray.hh:211
│ │ │ │ -
const_reference front() const
Returns const reference to first element of OverflowArray.
Definition overflowarray.hh:178
│ │ │ │ -
void clear()
Erases all elements.
Definition overflowarray.hh:83
│ │ │ │ -
iterator end()
Returns an iterator pointing to the end of the OverflowArray.
Definition overflowarray.hh:140
│ │ │ │ -
std::size_t size_type
Definition overflowarray.hh:56
│ │ │ │ -
void resize(size_type n)
Specifies a new size for the OverflowArray.
Definition overflowarray.hh:93
│ │ │ │ -
value_type * pointer
Definition overflowarray.hh:54
│ │ │ │ -
Dune::GenericIterator< const OverflowArray, const value_type > const_iterator
Definition overflowarray.hh:58
│ │ │ │ -
const_reference back() const
Returns const reference to last element of OverflowArray.
Definition overflowarray.hh:190
│ │ │ │ -
OverflowArray(const std::initializer_list< value_type > &l)
Definition overflowarray.hh:67
│ │ │ │ -
reference back()
Returns reference to last element of OverflowArray.
Definition overflowarray.hh:184
│ │ │ │ -
void push_front(const value_type &t)
Inserts an element to the begin of the OverflowArray,.
Definition overflowarray.hh:122
│ │ │ │ -
reference front()
Returns reference to first element of OverflowArray.
Definition overflowarray.hh:172
│ │ │ │ -
reference operator[](size_type i)
Returns reference to the i'th element.
Definition overflowarray.hh:150
│ │ │ │ +
236#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH
│ │ │ │ +
constexpr FlatLexicographic flatLexicographic()
Creates a lexicographic merging of direct children without blocking.
Definition basistags.hh:188
│ │ │ │ +
constexpr BlockedInterleaved blockedInterleaved()
Creates an interleaved merging of direct children with blocking (i.e. creating blocks at the leaves c...
Definition basistags.hh:218
│ │ │ │ +
constexpr FlatInterleaved flatInterleaved()
Creates an interleaved merging of direct children without blocking.
Definition basistags.hh:198
│ │ │ │ +
constexpr BlockedLexicographic blockedLexicographic()
Creates a lexicographic merging of direct children with blocking (i.e. creating one block per direct ...
Definition basistags.hh:208
│ │ │ │ +
Definition polynomial.hh:10
│ │ │ │ +
static constexpr bool isIndexMergingStrategy()
Definition basistags.hh:23
│ │ │ │ +
void registerIndexMergingStrategy(IndexMergingStrategy)
│ │ │ │ + │ │ │ │ +
auto require(T &&t) -> decltype(registerIndexMergingStrategy(t))
│ │ │ │ +
Base class for index merging strategies to simplify detection.
Definition basistags.hh:44
│ │ │ │ +
Lexicographic merging of direct children without blocking.
Definition basistags.hh:80
│ │ │ │ +
Interleaved merging of direct children without blocking.
Definition basistags.hh:114
│ │ │ │ +
Lexicographic merging of direct children with blocking (i.e. creating one block per direct child).
Definition basistags.hh:148
│ │ │ │ +
Interleaved merging of direct children with blocking (i.e. creating blocks at the leaves containing o...
Definition basistags.hh:180
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,311 +1,148 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -overflowarray.hh │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ -8#include │ │ │ │ │ -9#include │ │ │ │ │ -10#include │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ +8 │ │ │ │ │ +9namespace _D_u_n_e { │ │ │ │ │ +10namespace Functions { │ │ │ │ │ 11 │ │ │ │ │ -12#include │ │ │ │ │ +12 namespace Concept { │ │ │ │ │ 13 │ │ │ │ │ -14 │ │ │ │ │ -15 │ │ │ │ │ -16namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ │ -17 │ │ │ │ │ -18 │ │ │ │ │ -42template> │ │ │ │ │ -_4_3class _O_v_e_r_f_l_o_w_A_r_r_a_y : │ │ │ │ │ -44 public BA │ │ │ │ │ -45{ │ │ │ │ │ -46 static constexpr std::size_t baseSize = std::tuple_size_v; │ │ │ │ │ +_1_4 struct _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ │ +15 { │ │ │ │ │ +16 template │ │ │ │ │ +_1_7 auto _r_e_q_u_i_r_e(T&& t) -> decltype( │ │ │ │ │ +18 registerIndexMergingStrategy(t) │ │ │ │ │ +19 ); │ │ │ │ │ +20 }; │ │ │ │ │ +21 │ │ │ │ │ +22 template │ │ │ │ │ +_2_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() │ │ │ │ │ +24 { │ │ │ │ │ +25 return models(); │ │ │ │ │ +26 } │ │ │ │ │ +27 │ │ │ │ │ +28 template │ │ │ │ │ +_2_9 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) │ │ │ │ │ +30 { │ │ │ │ │ +31 return models>(); │ │ │ │ │ +32 } │ │ │ │ │ +33 │ │ │ │ │ +34 } // namespace Concept │ │ │ │ │ +35 │ │ │ │ │ +36 │ │ │ │ │ +_3_7namespace BasisFactory { │ │ │ │ │ +38 │ │ │ │ │ +_4_4 struct _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y {}; │ │ │ │ │ +45 │ │ │ │ │ +_4_6 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); │ │ │ │ │ 47 │ │ │ │ │ -48public: │ │ │ │ │ -_4_9 using _B_a_s_e_A_r_r_a_y = BA; │ │ │ │ │ -50 │ │ │ │ │ -_5_1 using _v_a_l_u_e___t_y_p_e = typename BaseArray::value_type; │ │ │ │ │ -_5_2 using _r_e_f_e_r_e_n_c_e = _v_a_l_u_e___t_y_p_e&; │ │ │ │ │ -_5_3 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_4 using _p_o_i_n_t_e_r = _v_a_l_u_e___t_y_p_e*; │ │ │ │ │ -_5_5 using _d_i_f_f_e_r_e_n_c_e___t_y_p_e = std::ptrdiff_t; │ │ │ │ │ -_5_6 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ -_5_7 using _i_t_e_r_a_t_o_r = Dune::GenericIterator; │ │ │ │ │ -_5_8 using _c_o_n_s_t___i_t_e_r_a_t_o_r = Dune::GenericIterator; │ │ │ │ │ -59 │ │ │ │ │ -60private: │ │ │ │ │ -61 using OverflowBuffer = std::array<_v_a_l_u_e___t_y_p_e, maxSize-baseSize>; │ │ │ │ │ -62 │ │ │ │ │ -63public: │ │ │ │ │ -64 │ │ │ │ │ -_6_5 _O_v_e_r_f_l_o_w_A_r_r_a_y() = default; │ │ │ │ │ -66 │ │ │ │ │ -_6_7 _O_v_e_r_f_l_o_w_A_r_r_a_y(const std::initializer_list& l) { │ │ │ │ │ -68 assert(l.size() <= _c_a_p_a_c_i_t_y()); │ │ │ │ │ -69 size_ = l.size(); │ │ │ │ │ -70 std::copy_n(l.begin(), size_, _b_e_g_i_n()); │ │ │ │ │ -71 } │ │ │ │ │ -72 │ │ │ │ │ -_7_3 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 { │ │ │ │ │ -74 if (_s_i_z_e() != other._s_i_z_e()) │ │ │ │ │ -75 return false; │ │ │ │ │ -76 for (_s_i_z_e___t_y_p_e i=0; i<_s_i_z_e(); ++i) │ │ │ │ │ -77 if ((*this)[i] != other[i]) │ │ │ │ │ -78 return false; │ │ │ │ │ -79 return true; │ │ │ │ │ -80 } │ │ │ │ │ +_7_8 struct _F_l_a_t_L_e_x_i_c_o_g_r_a_p_h_i_c │ │ │ │ │ +79 : public _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ │ +80 {}; │ │ │ │ │ 81 │ │ │ │ │ -_8_3 void _c_l_e_a_r() { │ │ │ │ │ -84 size_ = 0; │ │ │ │ │ -85 } │ │ │ │ │ -86 │ │ │ │ │ -_9_3 void _r_e_s_i_z_e(_s_i_z_e___t_y_p_e n) { │ │ │ │ │ -94 assert(n <= _c_a_p_a_c_i_t_y()); │ │ │ │ │ -95 size_ = n; │ │ │ │ │ -96 } │ │ │ │ │ -97 │ │ │ │ │ -_1_0_4 void _p_u_s_h___b_a_c_k(const _v_a_l_u_e___t_y_p_e& t) { │ │ │ │ │ -105 assert(_s_i_z_e() < _c_a_p_a_c_i_t_y()); │ │ │ │ │ -106 (*this)[size_++] = t; │ │ │ │ │ -107 } │ │ │ │ │ -108 │ │ │ │ │ -_1_1_0 void _p_o_p___b_a_c_k() { │ │ │ │ │ -111 assert(_s_i_z_e() > 0); │ │ │ │ │ -112 if (! _e_m_p_t_y()) │ │ │ │ │ -113 size_--; │ │ │ │ │ -114 } │ │ │ │ │ +_1_1_2 struct _F_l_a_t_I_n_t_e_r_l_e_a_v_e_d │ │ │ │ │ +113 : public _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ │ +114 {}; │ │ │ │ │ 115 │ │ │ │ │ -_1_2_2 void _p_u_s_h___f_r_o_n_t(const _v_a_l_u_e___t_y_p_e& t) { │ │ │ │ │ -123 assert(_s_i_z_e() < _c_a_p_a_c_i_t_y()); │ │ │ │ │ -124 for (_s_i_z_e___t_y_p_e i=0; i<_s_i_z_e(); i++) │ │ │ │ │ -125 (*this)[i+1] = (*this)[i]; │ │ │ │ │ -126 (*this)[0] = t; │ │ │ │ │ -127 } │ │ │ │ │ -128 │ │ │ │ │ -_1_3_0 _i_t_e_r_a_t_o_r _b_e_g_i_n() { │ │ │ │ │ -131 return _i_t_e_r_a_t_o_r(*this, 0); │ │ │ │ │ -132 } │ │ │ │ │ -133 │ │ │ │ │ -_1_3_5 _c_o_n_s_t___i_t_e_r_a_t_o_r _b_e_g_i_n() const { │ │ │ │ │ -136 return _c_o_n_s_t___i_t_e_r_a_t_o_r(*this, 0); │ │ │ │ │ -137 } │ │ │ │ │ -138 │ │ │ │ │ -_1_4_0 _i_t_e_r_a_t_o_r _e_n_d() { │ │ │ │ │ -141 return _i_t_e_r_a_t_o_r(*this, _s_i_z_e()); │ │ │ │ │ -142 } │ │ │ │ │ -143 │ │ │ │ │ -_1_4_5 _c_o_n_s_t___i_t_e_r_a_t_o_r _e_n_d() const { │ │ │ │ │ -146 return _c_o_n_s_t___i_t_e_r_a_t_o_r(*this, _s_i_z_e()); │ │ │ │ │ -147 } │ │ │ │ │ -148 │ │ │ │ │ -_1_5_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) { │ │ │ │ │ -151 assert(i < _s_i_z_e()); │ │ │ │ │ -152 // If there's no padding between the base class and the overflow_ member, │ │ │ │ │ -153 // the compiler should be able to optimize this to │ │ │ │ │ -154 // return *(&BaseArray::operator[](0) + i); │ │ │ │ │ -155 if (i 0); │ │ │ │ │ -174 return (*this)[0]; │ │ │ │ │ -175 } │ │ │ │ │ -176 │ │ │ │ │ -_1_7_8 _c_o_n_s_t___r_e_f_e_r_e_n_c_e _f_r_o_n_t() const { │ │ │ │ │ -179 assert(_s_i_z_e() > 0); │ │ │ │ │ -180 return (*this)[0]; │ │ │ │ │ -181 } │ │ │ │ │ +_1_4_6 struct _B_l_o_c_k_e_d_L_e_x_i_c_o_g_r_a_p_h_i_c │ │ │ │ │ +147 : public _I_n_d_e_x_M_e_r_g_i_n_g_S_t_r_a_t_e_g_y │ │ │ │ │ +148 {}; │ │ │ │ │ +149 │ │ │ │ │ +_1_8_0 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 {}; │ │ │ │ │ +181 │ │ │ │ │ 182 │ │ │ │ │ -_1_8_4 _r_e_f_e_r_e_n_c_e _b_a_c_k() { │ │ │ │ │ -185 assert(_s_i_z_e() > 0); │ │ │ │ │ -186 return (*this)[_s_i_z_e()-1]; │ │ │ │ │ -187 } │ │ │ │ │ -188 │ │ │ │ │ -_1_9_0 _c_o_n_s_t___r_e_f_e_r_e_n_c_e _b_a_c_k() const { │ │ │ │ │ -191 assert(_s_i_z_e() > 0); │ │ │ │ │ -192 return (*this)[_s_i_z_e()-1]; │ │ │ │ │ -193 } │ │ │ │ │ -194 │ │ │ │ │ -_1_9_6 _s_i_z_e___t_y_p_e _s_i_z_e () const { │ │ │ │ │ -197 return size_; │ │ │ │ │ -198 } │ │ │ │ │ -199 │ │ │ │ │ -_2_0_1 bool _e_m_p_t_y() const { │ │ │ │ │ -202 return _s_i_z_e() == 0; │ │ │ │ │ -203 } │ │ │ │ │ -204 │ │ │ │ │ -_2_0_6 static constexpr _s_i_z_e___t_y_p_e _c_a_p_a_c_i_t_y() { │ │ │ │ │ -207 return maxSize; │ │ │ │ │ -208 } │ │ │ │ │ -209 │ │ │ │ │ -_2_1_1 static constexpr _s_i_z_e___t_y_p_e _m_a_x___s_i_z_e() { │ │ │ │ │ -212 return maxSize; │ │ │ │ │ -213 } │ │ │ │ │ -214 │ │ │ │ │ -_2_1_6 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 { │ │ │ │ │ -217 return hash_range(v.begin(), v.end()); │ │ │ │ │ -218 } │ │ │ │ │ -219 │ │ │ │ │ -_2_2_1 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) { │ │ │ │ │ -222 for (const auto& ci : c) │ │ │ │ │ -223 s << ci << " "; │ │ │ │ │ -224 return s; │ │ │ │ │ -225 } │ │ │ │ │ -226 │ │ │ │ │ -227private: │ │ │ │ │ -228 OverflowBuffer overflow_; │ │ │ │ │ -229 _s_i_z_e___t_y_p_e size_ = 0; │ │ │ │ │ -230}; │ │ │ │ │ +_1_8_8 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() │ │ │ │ │ +189 { │ │ │ │ │ +190 return {}; │ │ │ │ │ +191 } │ │ │ │ │ +192 │ │ │ │ │ +_1_9_8 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() │ │ │ │ │ +199 { │ │ │ │ │ +200 return {}; │ │ │ │ │ +201 } │ │ │ │ │ +202 │ │ │ │ │ +_2_0_8 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() │ │ │ │ │ +209 { │ │ │ │ │ +210 return {}; │ │ │ │ │ +211 } │ │ │ │ │ +212 │ │ │ │ │ +_2_1_8 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() │ │ │ │ │ +219 { │ │ │ │ │ +220 return {}; │ │ │ │ │ +221 } │ │ │ │ │ +222 │ │ │ │ │ +223} // end namespace BasisFactory │ │ │ │ │ +224 │ │ │ │ │ +225// Backward compatibility │ │ │ │ │ +_2_2_6namespace BasisBuilder { │ │ │ │ │ +227 │ │ │ │ │ +228 using namespace BasisFactory; │ │ │ │ │ +229 │ │ │ │ │ +230} │ │ │ │ │ 231 │ │ │ │ │ -232 │ │ │ │ │ -233 │ │ │ │ │ -234} // namespace Dune::Functions │ │ │ │ │ +232} // end namespace Functions │ │ │ │ │ +233} // end namespace Dune │ │ │ │ │ +234 │ │ │ │ │ 235 │ │ │ │ │ -236 │ │ │ │ │ -237 │ │ │ │ │ -238#endif // DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ │ -DDeeffiinniittiioonn polynomial.hh:11 │ │ │ │ │ -_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:45 │ │ │ │ │ -_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: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_:_:_r_e_f_e_r_e_n_c_e │ │ │ │ │ -value_type & reference │ │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:52 │ │ │ │ │ -_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:145 │ │ │ │ │ -_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:73 │ │ │ │ │ -_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:216 │ │ │ │ │ -_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:104 │ │ │ │ │ -_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:221 │ │ │ │ │ -_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:130 │ │ │ │ │ -_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:201 │ │ │ │ │ -_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:196 │ │ │ │ │ -_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:51 │ │ │ │ │ -_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:110 │ │ │ │ │ -_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: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_:_:_b_e_g_i_n │ │ │ │ │ -const_iterator begin() const │ │ │ │ │ -Returns a const_iterator pointing to the beginning of the OverflowArray. │ │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:135 │ │ │ │ │ -_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: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_:_:_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:49 │ │ │ │ │ -_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:206 │ │ │ │ │ -_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:211 │ │ │ │ │ -_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:178 │ │ │ │ │ -_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:83 │ │ │ │ │ -_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:140 │ │ │ │ │ -_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: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_:_:_r_e_s_i_z_e │ │ │ │ │ -void resize(size_type n) │ │ │ │ │ -Specifies a new size for the OverflowArray. │ │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:93 │ │ │ │ │ -_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:54 │ │ │ │ │ -_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: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_:_:_b_a_c_k │ │ │ │ │ -const_reference back() const │ │ │ │ │ -Returns const reference to last element of OverflowArray. │ │ │ │ │ -DDeeffiinniittiioonn overflowarray.hh:190 │ │ │ │ │ -_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:67 │ │ │ │ │ -_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:184 │ │ │ │ │ -_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:122 │ │ │ │ │ -_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:172 │ │ │ │ │ -_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:150 │ │ │ │ │ +236#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: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_:_:_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:218 │ │ │ │ │ +_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:198 │ │ │ │ │ +_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:208 │ │ │ │ │ +_D_u_n_e │ │ │ │ │ +DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ +_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:23 │ │ │ │ │ +_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:15 │ │ │ │ │ +_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:44 │ │ │ │ │ +_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:80 │ │ │ │ │ +_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:114 │ │ │ │ │ +_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:148 │ │ │ │ │ +_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:180 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00131.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: defaultderivativetraits.hh File Reference │ │ │ │ +dune-functions: brezzidouglasmarinibasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,58 +65,71 @@ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces
│ │ │ │ -
defaultderivativetraits.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Typedefs | │ │ │ │ +Functions
│ │ │ │ +
brezzidouglasmarinibasis.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <type_traits>
│ │ │ │ -#include <utility>
│ │ │ │ -#include <dune/common/fvector.hh>
│ │ │ │ -#include <dune/common/fmatrix.hh>
│ │ │ │ +
#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>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::Functions::InvalidRange
 Dummy range class to be used if no proper type is available. More...
class  Dune::Functions::BrezziDouglasMariniPreBasis< GV, k >
 
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...
class  Dune::Functions::BrezziDouglasMariniNode< GV, k >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ 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.
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +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.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,42 +1,55 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -defaultderivativetraits.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +brezzidouglasmarinibasis.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_/_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> │ │ │ │ │ _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_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_._._. │ │ │ │ │ +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_ _> │ │ │ │ │   │ │ │ │ │ -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_._._. │ │ │ │ │ +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_ _> │ │ │ │ │   │ │ │ │ │ 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< GV, k > > │ │ │ │ │ +  Basis of a scalar k-th-order BDM finite element space on simplex and │ │ │ │ │ + cube grids. │ │ │ │ │ +  │ │ │ │ │ +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. │ │ │ │ │ +  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00131_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: defaultderivativetraits.hh Source File │ │ │ │ +dune-functions: brezzidouglasmarinibasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,97 +70,427 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
defaultderivativetraits.hh
│ │ │ │ +
brezzidouglasmarinibasis.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#ifndef DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BREZZIDOUGLASMARINIBASIS_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BREZZIDOUGLASMARINIBASIS_HH
│ │ │ │
5
│ │ │ │ -
6#include <type_traits>
│ │ │ │ -
7#include <utility>
│ │ │ │ -
8
│ │ │ │ -
9#include <dune/common/fvector.hh>
│ │ │ │ -
10#include <dune/common/fmatrix.hh>
│ │ │ │ -
11
│ │ │ │ -
12namespace Dune {
│ │ │ │ -
13namespace Functions {
│ │ │ │ -
14
│ │ │ │ -
15
│ │ │ │ -
16
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
23{};
│ │ │ │ -
│ │ │ │ -
24
│ │ │ │ +
6#include <array>
│ │ │ │ +
7#include <dune/common/exceptions.hh>
│ │ │ │ +
8#include <dune/geometry/referenceelements.hh>
│ │ │ │ +
9
│ │ │ │ +
10#include <dune/localfunctions/common/virtualinterface.hh>
│ │ │ │ +
11#include <dune/localfunctions/common/virtualwrappers.hh>
│ │ │ │ +
12
│ │ │ │ +
13#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini1cube2d.hh>
│ │ │ │ +
14#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini1cube3d.hh>
│ │ │ │ +
15#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini1simplex2d.hh>
│ │ │ │ +
16#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini2cube2d.hh>
│ │ │ │ +
17#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini2simplex2d.hh>
│ │ │ │ +
18
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
22
│ │ │ │ +
23namespace Dune {
│ │ │ │ +
24namespace Functions {
│ │ │ │
25
│ │ │ │ -
35template<class Signature>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
37{
│ │ │ │ - │ │ │ │ -
40};
│ │ │ │ -
│ │ │ │ -
41
│ │ │ │ -
42
│ │ │ │ -
50template<>
│ │ │ │ -
│ │ │ │ -
51struct DefaultDerivativeTraits< double(double) >
│ │ │ │ -
52{
│ │ │ │ -
54 typedef double Range;
│ │ │ │ -
55};
│ │ │ │ -
│ │ │ │ -
56
│ │ │ │ -
66template<typename K, int n>
│ │ │ │ -
│ │ │ │ -
67struct DefaultDerivativeTraits<K(FieldVector<K,n>)>
│ │ │ │ -
68{
│ │ │ │ -
70 typedef FieldVector<K,n> Range;
│ │ │ │ -
71};
│ │ │ │ -
│ │ │ │ -
72
│ │ │ │ -
82template<typename K, int n, int m>
│ │ │ │ -
│ │ │ │ -
83struct DefaultDerivativeTraits<FieldVector<K,m>(FieldVector<K,n>)>
│ │ │ │ -
84{
│ │ │ │ -
86 typedef FieldMatrix<K,m,n> Range;
│ │ │ │ -
87};
│ │ │ │ -
│ │ │ │ -
88
│ │ │ │ -
98template<typename K, int n, int m>
│ │ │ │ -
│ │ │ │ -
99struct DefaultDerivativeTraits<FieldMatrix<K,1,m>(FieldVector<K,n>)>
│ │ │ │ -
100{
│ │ │ │ -
102 typedef FieldMatrix<K,m,n> Range;
│ │ │ │ -
103};
│ │ │ │ -
│ │ │ │ -
104
│ │ │ │ -
105
│ │ │ │ -
106}} // namespace Dune::Functions
│ │ │ │ -
107
│ │ │ │ -
108
│ │ │ │ -
109#endif // DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH
│ │ │ │ +
26namespace Impl {
│ │ │ │ +
27
│ │ │ │ +
28 template<int dim, typename D, typename R, std::size_t k>
│ │ │ │ +
29 struct BDMSimplexLocalInfo
│ │ │ │ +
30 {
│ │ │ │ +
31 static_assert((AlwaysFalse<D>::value),"The requested type of BDM element is not implemented, sorry!");
│ │ │ │ +
32 };
│ │ │ │ +
33
│ │ │ │ +
34 template<typename D, typename R>
│ │ │ │ +
35 struct BDMSimplexLocalInfo<2,D,R,1>
│ │ │ │ +
36 {
│ │ │ │ +
37 using FiniteElement = BDM1Simplex2DLocalFiniteElement<D,R>;
│ │ │ │ +
38 static const std::size_t Variants = 8;
│ │ │ │ +
39 };
│ │ │ │ +
40
│ │ │ │ +
41 template<typename D, typename R>
│ │ │ │ +
42 struct BDMSimplexLocalInfo<2,D,R,2>
│ │ │ │ +
43 {
│ │ │ │ +
44 using FiniteElement = BDM2Simplex2DLocalFiniteElement<D,R>;
│ │ │ │ +
45 static const std::size_t Variants = 8;
│ │ │ │ +
46 };
│ │ │ │ +
47
│ │ │ │ +
48 template<int dim, typename D, typename R, std::size_t k>
│ │ │ │ +
49 struct BDMCubeLocalInfo
│ │ │ │ +
50 {
│ │ │ │ +
51 static_assert((AlwaysFalse<D>::value),"The requested type of BDM element is not implemented, sorry!");
│ │ │ │ +
52 };
│ │ │ │ +
53
│ │ │ │ +
54 template<typename D, typename R>
│ │ │ │ +
55 struct BDMCubeLocalInfo<2,D,R,1>
│ │ │ │ +
56 {
│ │ │ │ +
57 using FiniteElement = BDM1Cube2DLocalFiniteElement<D,R>;
│ │ │ │ +
58 static const std::size_t Variants = 16;
│ │ │ │ +
59 };
│ │ │ │ +
60
│ │ │ │ +
61 template<typename D, typename R>
│ │ │ │ +
62 struct BDMCubeLocalInfo<2,D,R,2>
│ │ │ │ +
63 {
│ │ │ │ +
64 using FiniteElement = BDM2Cube2DLocalFiniteElement<D,R>;
│ │ │ │ +
65 static const std::size_t Variants = 16;
│ │ │ │ +
66 };
│ │ │ │ +
67
│ │ │ │ +
68 template<typename D, typename R>
│ │ │ │ +
69 struct BDMCubeLocalInfo<3,D,R,1>
│ │ │ │ +
70 {
│ │ │ │ +
71 using FiniteElement = BDM1Cube3DLocalFiniteElement<D,R>;
│ │ │ │ +
72 static const std::size_t Variants = 64;
│ │ │ │ +
73 };
│ │ │ │ +
74
│ │ │ │ +
75 template<typename GV, int dim, typename R, std::size_t k>
│ │ │ │ +
76 class BDMLocalFiniteElementMap
│ │ │ │ +
77 {
│ │ │ │ +
78 using D = typename GV::ctype;
│ │ │ │ +
79 using CubeFiniteElement = typename BDMCubeLocalInfo<dim, D, R, k>::FiniteElement;
│ │ │ │ +
80 using SimplexFiniteElement = typename BDMSimplexLocalInfo<dim, D, R, k>::FiniteElement;
│ │ │ │ +
81
│ │ │ │ +
82 public:
│ │ │ │ +
83
│ │ │ │ +
84 using T = LocalBasisTraits<D, dim, FieldVector<D,dim>, R, dim, FieldVector<R,dim>, FieldMatrix<D,dim,dim> >;
│ │ │ │ +
85 using FiniteElement = LocalFiniteElementVirtualInterface<T>;
│ │ │ │ +
86
│ │ │ │ +
87 BDMLocalFiniteElementMap(const GV& gv)
│ │ │ │ +
88 : is_(&(gv.indexSet())), orient_(gv.size(0))
│ │ │ │ +
89 {
│ │ │ │ +
90 cubeVariant_.resize(BDMCubeLocalInfo<dim, D, R, k>::Variants);
│ │ │ │ +
91 simplexVariant_.resize(BDMSimplexLocalInfo<dim, D, R, k>::Variants);
│ │ │ │ +
92
│ │ │ │ +
93 // create all variants
│ │ │ │ +
94 for (size_t i = 0; i < cubeVariant_.size(); i++)
│ │ │ │ +
95 cubeVariant_[i] = std::make_unique<LocalFiniteElementVirtualImp<CubeFiniteElement> >(CubeFiniteElement(i));
│ │ │ │ +
96
│ │ │ │ +
97 for (size_t i = 0; i < simplexVariant_.size(); i++)
│ │ │ │ +
98 simplexVariant_[i] = std::make_unique<LocalFiniteElementVirtualImp<SimplexFiniteElement> >(SimplexFiniteElement(i));
│ │ │ │ +
99
│ │ │ │ +
100 // compute orientation for all elements
│ │ │ │ +
101 // loop once over the grid
│ │ │ │ +
102 for(const auto& cell : elements(gv))
│ │ │ │ +
103 {
│ │ │ │ +
104 unsigned int myId = is_->index(cell);
│ │ │ │ +
105 orient_[myId] = 0;
│ │ │ │ +
106
│ │ │ │ +
107 for (const auto& intersection : intersections(gv,cell))
│ │ │ │ +
108 {
│ │ │ │ +
109 if (intersection.neighbor() && (is_->index(intersection.outside()) > myId))
│ │ │ │ +
110 orient_[myId] |= (1 << intersection.indexInInside());
│ │ │ │ +
111 }
│ │ │ │ +
112 }
│ │ │ │ +
113 }
│ │ │ │ +
114
│ │ │ │ +
116 template<class EntityType>
│ │ │ │ +
117 const FiniteElement& find(const EntityType& e) const
│ │ │ │ +
118 {
│ │ │ │ +
119 if (e.type().isCube())
│ │ │ │ +
120 return *cubeVariant_[orient_[is_->index(e)]];
│ │ │ │ +
121 else
│ │ │ │ +
122 return *simplexVariant_[orient_[is_->index(e)]];
│ │ │ │ +
123 }
│ │ │ │ +
124
│ │ │ │ +
125 private:
│ │ │ │ +
126 std::vector<std::unique_ptr<LocalFiniteElementVirtualImp<CubeFiniteElement> > > cubeVariant_;
│ │ │ │ +
127 std::vector<std::unique_ptr<LocalFiniteElementVirtualImp<SimplexFiniteElement> > > simplexVariant_;
│ │ │ │ +
128 const typename GV::IndexSet* is_;
│ │ │ │ +
129 std::vector<unsigned char> orient_;
│ │ │ │ +
130 };
│ │ │ │ +
131
│ │ │ │ +
132
│ │ │ │ +
133} // namespace Impl
│ │ │ │ +
134
│ │ │ │ +
135
│ │ │ │ +
136// *****************************************************************************
│ │ │ │ +
137// This is the reusable part of the basis. It contains
│ │ │ │ +
138//
│ │ │ │ +
139// BrezziDouglasMariniPreBasis
│ │ │ │ +
140// BrezziDouglasMariniNode
│ │ │ │ +
141//
│ │ │ │ +
142// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ │ +
143// state. These components do _not_ depend on the global basis and local view
│ │ │ │ +
144// and can be used without a global basis.
│ │ │ │ +
145// *****************************************************************************
│ │ │ │ +
146
│ │ │ │ +
147template<typename GV, int k>
│ │ │ │ +
148class BrezziDouglasMariniNode;
│ │ │ │ +
149
│ │ │ │ +
150template<typename GV, int k>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
152{
│ │ │ │ +
153 static const int dim = GV::dimension;
│ │ │ │ +
154 using FiniteElementMap = typename Impl::BDMLocalFiniteElementMap<GV, dim, double, k>;
│ │ │ │ +
155
│ │ │ │ +
156public:
│ │ │ │ +
157
│ │ │ │ +
159 using GridView = GV;
│ │ │ │ +
160 using size_type = std::size_t;
│ │ │ │ +
161
│ │ │ │ + │ │ │ │ +
163
│ │ │ │ +
164 static constexpr size_type maxMultiIndexSize = 1;
│ │ │ │ +
165 static constexpr size_type minMultiIndexSize = 1;
│ │ │ │ +
166 static constexpr size_type multiIndexBufferSize = 1;
│ │ │ │ +
167
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
170 gridView_(gv),
│ │ │ │ + │ │ │ │ +
172 {
│ │ │ │ +
173 // There is no inherent reason why the basis shouldn't work for grids with more than one
│ │ │ │ +
174 // element types. Somebody simply has to sit down and implement the missing bits.
│ │ │ │ +
175 if (gv.indexSet().types(0).size() > 1)
│ │ │ │ +
176 DUNE_THROW(Dune::NotImplemented, "Brezzi-Douglas-Marini basis is only implemented for grids with a single element type");
│ │ │ │ +
177 }
│ │ │ │ +
│ │ │ │ +
178
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
180 {
│ │ │ │ +
181 codimOffset_[0] = 0;
│ │ │ │ +
182 codimOffset_[1] = codimOffset_[0] + dofsPerCodim_[0] * gridView_.size(0);
│ │ │ │ +
183 //if (dim==3) codimOffset_[2] = codimOffset_[1] + dofsPerCodim[1] * gridView_.size(1);
│ │ │ │ +
184 }
│ │ │ │ +
│ │ │ │ +
185
│ │ │ │ +
│ │ │ │ +
188 const GridView& gridView() const
│ │ │ │ +
189 {
│ │ │ │ +
190 return gridView_;
│ │ │ │ +
191 }
│ │ │ │ +
│ │ │ │ +
192
│ │ │ │ +
193 /* \brief Update the stored grid view, to be called if the grid has changed */
│ │ │ │ +
│ │ │ │ +
194 void update (const GridView& gv)
│ │ │ │ +
195 {
│ │ │ │ +
196 gridView_ = gv;
│ │ │ │ +
197 }
│ │ │ │ +
│ │ │ │ +
198
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
203 {
│ │ │ │ +
204 return Node{&finiteElementMap_};
│ │ │ │ +
205 }
│ │ │ │ +
│ │ │ │ +
206
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
208 {
│ │ │ │ +
209 return dofsPerCodim_[0] * gridView_.size(0) + dofsPerCodim_[1] * gridView_.size(1); // only 2d
│ │ │ │ +
210 }
│ │ │ │ +
│ │ │ │ +
211
│ │ │ │ +
213 template<class SizePrefix>
│ │ │ │ +
│ │ │ │ +
214 size_type size(const SizePrefix prefix) const
│ │ │ │ +
215 {
│ │ │ │ +
216 assert(prefix.size() == 0 || prefix.size() == 1);
│ │ │ │ +
217 return (prefix.size() == 0) ? size() : 0;
│ │ │ │ +
218 }
│ │ │ │ +
│ │ │ │ +
219
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
222 {
│ │ │ │ +
223 return size();
│ │ │ │ +
224 }
│ │ │ │ +
│ │ │ │ +
225
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
227 {
│ │ │ │ +
228 // The implementation currently only supports grids with a single element type.
│ │ │ │ +
229 // We can therefore return the actual number of dofs here.
│ │ │ │ +
230 GeometryType elementType = *(gridView_.indexSet().types(0).begin());
│ │ │ │ +
231 size_t numFaces = ReferenceElements<double,dim>::general(elementType).size(1);
│ │ │ │ +
232 return dofsPerCodim_[0] + dofsPerCodim_[1] * numFaces;
│ │ │ │ +
233 }
│ │ │ │ +
│ │ │ │ +
234
│ │ │ │ +
240 template<typename It>
│ │ │ │ +
│ │ │ │ +
241 It indices(const Node& node, It it) const
│ │ │ │ +
242 {
│ │ │ │ +
243 const auto& gridIndexSet = gridView().indexSet();
│ │ │ │ +
244 const auto& element = node.element();
│ │ │ │ +
245
│ │ │ │ +
246 // throw if element is not of predefined type
│ │ │ │ +
247 if (not(element.type().isCube()) and not(element.type().isSimplex()))
│ │ │ │ +
248 DUNE_THROW(Dune::NotImplemented, "BrezziDouglasMariniBasis only implemented for cube and simplex elements.");
│ │ │ │ +
249
│ │ │ │ +
250 for(std::size_t i=0, end=node.size(); i<end; ++i, ++it)
│ │ │ │ +
251 {
│ │ │ │ +
252 Dune::LocalKey localKey = node.finiteElement().localCoefficients().localKey(i);
│ │ │ │ +
253
│ │ │ │ +
254 // The dimension of the entity that the current dof is related to
│ │ │ │ +
255 size_t subentity = localKey.subEntity();
│ │ │ │ +
256 size_t codim = localKey.codim();
│ │ │ │ +
257
│ │ │ │ +
258 *it = { codimOffset_[codim] +
│ │ │ │ +
259 dofsPerCodim_[codim] * gridIndexSet.subIndex(element, subentity, codim) + localKey.index() };
│ │ │ │ +
260 }
│ │ │ │ +
261
│ │ │ │ +
262 return it;
│ │ │ │ +
263 }
│ │ │ │ +
│ │ │ │ +
264
│ │ │ │ +
265protected:
│ │ │ │ + │ │ │ │ +
267 std::array<size_t,dim+1> codimOffset_;
│ │ │ │ +
268 FiniteElementMap finiteElementMap_;
│ │ │ │ +
269 // Number of dofs per entity type depending on the entity's codimension and type
│ │ │ │ +
270 std::array<int,2> dofsPerCodim_ {{dim*(k-1)*3, dim+(k-1)}};
│ │ │ │ +
271};
│ │ │ │ +
│ │ │ │ +
272
│ │ │ │ +
273
│ │ │ │ +
274
│ │ │ │ +
275template<typename GV, int k>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
277 public LeafBasisNode
│ │ │ │ +
278{
│ │ │ │ +
279 static const int dim = GV::dimension;
│ │ │ │ +
280
│ │ │ │ +
281public:
│ │ │ │ +
282
│ │ │ │ +
283 using size_type = std::size_t;
│ │ │ │ +
284 using Element = typename GV::template Codim<0>::Entity;
│ │ │ │ +
285 using FiniteElementMap = typename Impl::BDMLocalFiniteElementMap<GV, dim, double, k>;
│ │ │ │ +
286 using FiniteElement = Impl::GlobalValuedLocalFiniteElement<Impl::ContravariantPiolaTransformator,
│ │ │ │ +
287 typename FiniteElementMap::FiniteElement,
│ │ │ │ +
288 Element>;
│ │ │ │ +
289
│ │ │ │ +
│ │ │ │ +
290 BrezziDouglasMariniNode(const FiniteElementMap* finiteElementMap) :
│ │ │ │ +
291 element_(nullptr),
│ │ │ │ +
292 finiteElementMap_(finiteElementMap)
│ │ │ │ +
293 {}
│ │ │ │ +
│ │ │ │ +
294
│ │ │ │ +
│ │ │ │ +
296 const Element& element() const
│ │ │ │ +
297 {
│ │ │ │ +
298 return *element_;
│ │ │ │ +
299 }
│ │ │ │ +
│ │ │ │ +
300
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
306 {
│ │ │ │ +
307 return finiteElement_;
│ │ │ │ +
308 }
│ │ │ │ +
│ │ │ │ +
309
│ │ │ │ +
│ │ │ │ +
311 void bind(const Element& e)
│ │ │ │ +
312 {
│ │ │ │ +
313 element_ = &e;
│ │ │ │ +
314 finiteElement_.bind((finiteElementMap_->find(*element_)), e);
│ │ │ │ +
315 this->setSize(finiteElement_.size());
│ │ │ │ +
316 }
│ │ │ │ +
│ │ │ │ +
317
│ │ │ │ +
318protected:
│ │ │ │ +
319
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
323};
│ │ │ │ +
│ │ │ │ +
324
│ │ │ │ +
325
│ │ │ │ +
326
│ │ │ │ +
327namespace BasisFactory {
│ │ │ │ +
328
│ │ │ │ +
336template<std::size_t k>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
338{
│ │ │ │ +
339 return [](const auto& gridView) {
│ │ │ │ +
340 return BrezziDouglasMariniPreBasis<std::decay_t<decltype(gridView)>, k>(gridView);
│ │ │ │ +
341 };
│ │ │ │ +
342}
│ │ │ │ +
│ │ │ │ +
343
│ │ │ │ +
344} // end namespace BasisFactory
│ │ │ │ +
345
│ │ │ │ +
346
│ │ │ │ +
347
│ │ │ │ +
348// *****************************************************************************
│ │ │ │ +
349// This is the actual global basis implementation based on the reusable parts.
│ │ │ │ +
350// *****************************************************************************
│ │ │ │ +
351
│ │ │ │ +
359template<typename GV, int k>
│ │ │ │ + │ │ │ │ +
361
│ │ │ │ +
362} // end namespace Functions
│ │ │ │ +
363} // end namespace Dune
│ │ │ │ +
364
│ │ │ │ +
365
│ │ │ │ +
366#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:337
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
Dummy range class to be used if no proper type is available.
Definition defaultderivativetraits.hh:23
│ │ │ │ -
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:37
│ │ │ │ -
InvalidRange Range
Range of derivative for function with given signature.
Definition defaultderivativetraits.hh:39
│ │ │ │ -
double Range
Range of derivative for function with given signature.
Definition defaultderivativetraits.hh:54
│ │ │ │ -
FieldVector< K, n > Range
Range of derivative for function with given signature.
Definition defaultderivativetraits.hh:70
│ │ │ │ -
FieldMatrix< K, m, n > Range
Range of derivative for function with given signature.
Definition defaultderivativetraits.hh:86
│ │ │ │ -
FieldMatrix< K, m, n > Range
Range of derivative for function with given signature.
Definition defaultderivativetraits.hh:102
│ │ │ │ +
Definition brezzidouglasmarinibasis.hh:278
│ │ │ │ +
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition brezzidouglasmarinibasis.hh:305
│ │ │ │ +
typename GV::template Codim< 0 >::Entity Element
Definition brezzidouglasmarinibasis.hh:284
│ │ │ │ +
const FiniteElementMap * finiteElementMap_
Definition brezzidouglasmarinibasis.hh:322
│ │ │ │ +
std::size_t size_type
Definition brezzidouglasmarinibasis.hh:283
│ │ │ │ +
FiniteElement finiteElement_
Definition brezzidouglasmarinibasis.hh:320
│ │ │ │ +
typename Impl::BDMLocalFiniteElementMap< GV, dim, double, k > FiniteElementMap
Definition brezzidouglasmarinibasis.hh:285
│ │ │ │ +
const Element * element_
Definition brezzidouglasmarinibasis.hh:321
│ │ │ │ +
Impl::GlobalValuedLocalFiniteElement< Impl::ContravariantPiolaTransformator, typename FiniteElementMap::FiniteElement, Element > FiniteElement
Definition brezzidouglasmarinibasis.hh:288
│ │ │ │ +
void bind(const Element &e)
Bind to element.
Definition brezzidouglasmarinibasis.hh:311
│ │ │ │ +
BrezziDouglasMariniNode(const FiniteElementMap *finiteElementMap)
Definition brezzidouglasmarinibasis.hh:290
│ │ │ │ +
const Element & element() const
Return current element, throw if unbound.
Definition brezzidouglasmarinibasis.hh:296
│ │ │ │ +
Definition brezzidouglasmarinibasis.hh:152
│ │ │ │ +
std::size_t size_type
Definition brezzidouglasmarinibasis.hh:160
│ │ │ │ +
std::array< int, 2 > dofsPerCodim_
Definition brezzidouglasmarinibasis.hh:270
│ │ │ │ +
size_type dimension() const
Definition brezzidouglasmarinibasis.hh:221
│ │ │ │ +
static constexpr size_type minMultiIndexSize
Definition brezzidouglasmarinibasis.hh:165
│ │ │ │ +
static constexpr size_type maxMultiIndexSize
Definition brezzidouglasmarinibasis.hh:164
│ │ │ │ +
std::array< size_t, dim+1 > codimOffset_
Definition brezzidouglasmarinibasis.hh:267
│ │ │ │ +
size_type size(const SizePrefix prefix) const
Return number possible values for next position in multi index.
Definition brezzidouglasmarinibasis.hh:214
│ │ │ │ +
Node makeNode() const
Create tree node.
Definition brezzidouglasmarinibasis.hh:202
│ │ │ │ +
GV GridView
The grid view that the FE space is defined on.
Definition brezzidouglasmarinibasis.hh:159
│ │ │ │ +
BrezziDouglasMariniPreBasis(const GridView &gv)
Constructor for a given grid view object.
Definition brezzidouglasmarinibasis.hh:169
│ │ │ │ +
FiniteElementMap finiteElementMap_
Definition brezzidouglasmarinibasis.hh:268
│ │ │ │ +
void update(const GridView &gv)
Definition brezzidouglasmarinibasis.hh:194
│ │ │ │ +
void initializeIndices()
Definition brezzidouglasmarinibasis.hh:179
│ │ │ │ +
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition brezzidouglasmarinibasis.hh:188
│ │ │ │ +
size_type size() const
Definition brezzidouglasmarinibasis.hh:207
│ │ │ │ +
static constexpr size_type multiIndexBufferSize
Definition brezzidouglasmarinibasis.hh:166
│ │ │ │ +
size_type maxNodeSize() const
Definition brezzidouglasmarinibasis.hh:226
│ │ │ │ +
GridView gridView_
Definition brezzidouglasmarinibasis.hh:266
│ │ │ │ +
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 brezzidouglasmarinibasis.hh:241
│ │ │ │ +
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:46
│ │ │ │ +
size_type size() const
Definition nodes.hh:142
│ │ │ │ +
void setSize(const size_type size)
Definition nodes.hh:164
│ │ │ │ +
Definition nodes.hh:186
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,97 +1,509 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -defaultderivativetraits.hh │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +brezzidouglasmarinibasis.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#ifndef DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BREZZIDOUGLASMARINIBASIS_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BREZZIDOUGLASMARINIBASIS_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ -8 │ │ │ │ │ -9#include │ │ │ │ │ -10#include │ │ │ │ │ -11 │ │ │ │ │ -12namespace _D_u_n_e { │ │ │ │ │ -13namespace Functions { │ │ │ │ │ -14 │ │ │ │ │ -15 │ │ │ │ │ -16 │ │ │ │ │ -_2_2class _I_n_v_a_l_i_d_R_a_n_g_e │ │ │ │ │ -23{}; │ │ │ │ │ -24 │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ +8#include │ │ │ │ │ +9 │ │ │ │ │ +10#include │ │ │ │ │ +11#include │ │ │ │ │ +12 │ │ │ │ │ +13#include │ │ │ │ │ +14#include │ │ │ │ │ +15#include │ │ │ │ │ +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_/ │ │ │ │ │ +_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> │ │ │ │ │ +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_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ │ +22 │ │ │ │ │ +23namespace _D_u_n_e { │ │ │ │ │ +24namespace Functions { │ │ │ │ │ 25 │ │ │ │ │ -35template │ │ │ │ │ -_3_6struct _D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ │ -37{ │ │ │ │ │ -_3_9 typedef _I_n_v_a_l_i_d_R_a_n_g_e _R_a_n_g_e; │ │ │ │ │ -40}; │ │ │ │ │ -41 │ │ │ │ │ -42 │ │ │ │ │ -50template<> │ │ │ │ │ -_5_1struct _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) > │ │ │ │ │ -52{ │ │ │ │ │ -_5_4 typedef double _R_a_n_g_e; │ │ │ │ │ -55}; │ │ │ │ │ -56 │ │ │ │ │ -66template │ │ │ │ │ -_6_7struct _D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s)> │ │ │ │ │ -68{ │ │ │ │ │ -_7_0 typedef FieldVector _R_a_n_g_e; │ │ │ │ │ -71}; │ │ │ │ │ -72 │ │ │ │ │ -82template │ │ │ │ │ -_8_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)> │ │ │ │ │ -84{ │ │ │ │ │ -_8_6 typedef FieldMatrix _R_a_n_g_e; │ │ │ │ │ -87}; │ │ │ │ │ -88 │ │ │ │ │ -98template │ │ │ │ │ -_9_9struct _D_e_f_a_u_l_t_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s(FieldVector)> │ │ │ │ │ -100{ │ │ │ │ │ -_1_0_2 typedef FieldMatrix _R_a_n_g_e; │ │ │ │ │ -103}; │ │ │ │ │ -104 │ │ │ │ │ -105 │ │ │ │ │ -106}} // namespace Dune::Functions │ │ │ │ │ -107 │ │ │ │ │ -108 │ │ │ │ │ -109#endif // DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH │ │ │ │ │ +26namespace Impl { │ │ │ │ │ +27 │ │ │ │ │ +28 template │ │ │ │ │ +29 struct BDMSimplexLocalInfo │ │ │ │ │ +30 { │ │ │ │ │ +31 static_assert((AlwaysFalse::value),"The requested type of BDM element is │ │ │ │ │ +not implemented, sorry!"); │ │ │ │ │ +32 }; │ │ │ │ │ +33 │ │ │ │ │ +34 template │ │ │ │ │ +35 struct BDMSimplexLocalInfo<2,D,R,1> │ │ │ │ │ +36 { │ │ │ │ │ +37 using FiniteElement = BDM1Simplex2DLocalFiniteElement; │ │ │ │ │ +38 static const std::size_t Variants = 8; │ │ │ │ │ +39 }; │ │ │ │ │ +40 │ │ │ │ │ +41 template │ │ │ │ │ +42 struct BDMSimplexLocalInfo<2,D,R,2> │ │ │ │ │ +43 { │ │ │ │ │ +44 using FiniteElement = BDM2Simplex2DLocalFiniteElement; │ │ │ │ │ +45 static const std::size_t Variants = 8; │ │ │ │ │ +46 }; │ │ │ │ │ +47 │ │ │ │ │ +48 template │ │ │ │ │ +49 struct BDMCubeLocalInfo │ │ │ │ │ +50 { │ │ │ │ │ +51 static_assert((AlwaysFalse::value),"The requested type of BDM element is │ │ │ │ │ +not implemented, sorry!"); │ │ │ │ │ +52 }; │ │ │ │ │ +53 │ │ │ │ │ +54 template │ │ │ │ │ +55 struct BDMCubeLocalInfo<2,D,R,1> │ │ │ │ │ +56 { │ │ │ │ │ +57 using FiniteElement = BDM1Cube2DLocalFiniteElement; │ │ │ │ │ +58 static const std::size_t Variants = 16; │ │ │ │ │ +59 }; │ │ │ │ │ +60 │ │ │ │ │ +61 template │ │ │ │ │ +62 struct BDMCubeLocalInfo<2,D,R,2> │ │ │ │ │ +63 { │ │ │ │ │ +64 using FiniteElement = BDM2Cube2DLocalFiniteElement; │ │ │ │ │ +65 static const std::size_t Variants = 16; │ │ │ │ │ +66 }; │ │ │ │ │ +67 │ │ │ │ │ +68 template │ │ │ │ │ +69 struct BDMCubeLocalInfo<3,D,R,1> │ │ │ │ │ +70 { │ │ │ │ │ +71 using FiniteElement = BDM1Cube3DLocalFiniteElement; │ │ │ │ │ +72 static const std::size_t Variants = 64; │ │ │ │ │ +73 }; │ │ │ │ │ +74 │ │ │ │ │ +75 template │ │ │ │ │ +76 class BDMLocalFiniteElementMap │ │ │ │ │ +77 { │ │ │ │ │ +78 using D = typename GV::ctype; │ │ │ │ │ +79 using CubeFiniteElement = typename BDMCubeLocalInfo:: │ │ │ │ │ +FiniteElement; │ │ │ │ │ +80 using SimplexFiniteElement = typename BDMSimplexLocalInfo:: │ │ │ │ │ +FiniteElement; │ │ │ │ │ +81 │ │ │ │ │ +82 public: │ │ │ │ │ +83 │ │ │ │ │ +84 using T = LocalBasisTraits, R, dim, │ │ │ │ │ +FieldVector, FieldMatrix >; │ │ │ │ │ +85 using FiniteElement = LocalFiniteElementVirtualInterface; │ │ │ │ │ +86 │ │ │ │ │ +87 BDMLocalFiniteElementMap(const GV& gv) │ │ │ │ │ +88 : is_(&(gv.indexSet())), orient_(gv.size(0)) │ │ │ │ │ +89 { │ │ │ │ │ +90 cubeVariant_.resize(BDMCubeLocalInfo::Variants); │ │ │ │ │ +91 simplexVariant_.resize(BDMSimplexLocalInfo::Variants); │ │ │ │ │ +92 │ │ │ │ │ +93 // create all variants │ │ │ │ │ +94 for (size_t i = 0; i < cubeVariant_.size(); i++) │ │ │ │ │ +95 cubeVariant_[i] = std:: │ │ │ │ │ +make_unique >(CubeFiniteElement │ │ │ │ │ +(i)); │ │ │ │ │ +96 │ │ │ │ │ +97 for (size_t i = 0; i < simplexVariant_.size(); i++) │ │ │ │ │ +98 simplexVariant_[i] = std:: │ │ │ │ │ +make_unique > │ │ │ │ │ +(SimplexFiniteElement(i)); │ │ │ │ │ +99 │ │ │ │ │ +100 // compute orientation for all elements │ │ │ │ │ +101 // loop once over the grid │ │ │ │ │ +102 for(const auto& cell : elements(gv)) │ │ │ │ │ +103 { │ │ │ │ │ +104 unsigned int myId = is_->index(cell); │ │ │ │ │ +105 orient_[myId] = 0; │ │ │ │ │ +106 │ │ │ │ │ +107 for (const auto& intersection : intersections(gv,cell)) │ │ │ │ │ +108 { │ │ │ │ │ +109 if (intersection.neighbor() && (is_->index(intersection.outside()) > myId)) │ │ │ │ │ +110 orient_[myId] |= (1 << intersection.indexInInside()); │ │ │ │ │ +111 } │ │ │ │ │ +112 } │ │ │ │ │ +113 } │ │ │ │ │ +114 │ │ │ │ │ +116 template │ │ │ │ │ +117 const FiniteElement& find(const EntityType& e) const │ │ │ │ │ +118 { │ │ │ │ │ +119 if (e.type().isCube()) │ │ │ │ │ +120 return *cubeVariant_[orient_[is_->index(e)]]; │ │ │ │ │ +121 else │ │ │ │ │ +122 return *simplexVariant_[orient_[is_->index(e)]]; │ │ │ │ │ +123 } │ │ │ │ │ +124 │ │ │ │ │ +125 private: │ │ │ │ │ +126 std::vector │ │ │ │ │ +> > cubeVariant_; │ │ │ │ │ +127 std::vector > > │ │ │ │ │ +simplexVariant_; │ │ │ │ │ +128 const typename GV::IndexSet* is_; │ │ │ │ │ +129 std::vector orient_; │ │ │ │ │ +130 }; │ │ │ │ │ +131 │ │ │ │ │ +132 │ │ │ │ │ +133} // namespace Impl │ │ │ │ │ +134 │ │ │ │ │ +135 │ │ │ │ │ +136/ │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +137// This is the reusable part of the basis. It contains │ │ │ │ │ +138// │ │ │ │ │ +139// BrezziDouglasMariniPreBasis │ │ │ │ │ +140// BrezziDouglasMariniNode │ │ │ │ │ +141// │ │ │ │ │ +142// The pre-basis allows to create the others and is the owner of possible │ │ │ │ │ +shared │ │ │ │ │ +143// state. These components do _not_ depend on the global basis and local │ │ │ │ │ +view │ │ │ │ │ +144// and can be used without a global basis. │ │ │ │ │ +145/ │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +146 │ │ │ │ │ +147template │ │ │ │ │ +148class BrezziDouglasMariniNode; │ │ │ │ │ +149 │ │ │ │ │ +150template │ │ │ │ │ +_1_5_1class _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 │ │ │ │ │ +152{ │ │ │ │ │ +153 static const int dim = GV::dimension; │ │ │ │ │ +154 using FiniteElementMap = typename Impl::BDMLocalFiniteElementMap; │ │ │ │ │ +155 │ │ │ │ │ +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 = _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_>; │ │ │ │ │ +163 │ │ │ │ │ +_1_6_4 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 = 1; │ │ │ │ │ +_1_6_5 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 = 1; │ │ │ │ │ +_1_6_6 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 = 1; │ │ │ │ │ +167 │ │ │ │ │ +_1_6_9 _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) : │ │ │ │ │ +170 _g_r_i_d_V_i_e_w__(gv), │ │ │ │ │ +171 _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__(gv) │ │ │ │ │ +172 { │ │ │ │ │ +173 // There is no inherent reason why the basis shouldn't work for grids with │ │ │ │ │ +more than one │ │ │ │ │ +174 // element types. Somebody simply has to sit down and implement the missing │ │ │ │ │ +bits. │ │ │ │ │ +175 if (gv.indexSet().types(0).size() > 1) │ │ │ │ │ +176 DUNE_THROW(Dune::NotImplemented, "Brezzi-Douglas-Marini basis is only │ │ │ │ │ +implemented for grids with a single element type"); │ │ │ │ │ +177 } │ │ │ │ │ +178 │ │ │ │ │ +_1_7_9 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ │ +180 { │ │ │ │ │ +181 _c_o_d_i_m_O_f_f_s_e_t__[0] = 0; │ │ │ │ │ +182 _c_o_d_i_m_O_f_f_s_e_t__[1] = _c_o_d_i_m_O_f_f_s_e_t__[0] + _d_o_f_s_P_e_r_C_o_d_i_m__[0] * _g_r_i_d_V_i_e_w__.size(0); │ │ │ │ │ +183 //if (dim==3) codimOffset_[2] = codimOffset_[1] + dofsPerCodim[1] * │ │ │ │ │ +gridView_.size(1); │ │ │ │ │ +184 } │ │ │ │ │ +185 │ │ │ │ │ +_1_8_8 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ │ +189 { │ │ │ │ │ +190 return _g_r_i_d_V_i_e_w__; │ │ │ │ │ +191 } │ │ │ │ │ +192 │ │ │ │ │ +193 /* \brief Update the stored grid view, to be called if the grid has changed │ │ │ │ │ +*/ │ │ │ │ │ +_1_9_4 void _u_p_d_a_t_e (const _G_r_i_d_V_i_e_w& gv) │ │ │ │ │ +195 { │ │ │ │ │ +196 _g_r_i_d_V_i_e_w__ = gv; │ │ │ │ │ +197 } │ │ │ │ │ +198 │ │ │ │ │ +_2_0_2 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ │ +203 { │ │ │ │ │ +204 return _N_o_d_e{&_f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__}; │ │ │ │ │ +205 } │ │ │ │ │ +206 │ │ │ │ │ +_2_0_7 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ │ +208 { │ │ │ │ │ +209 return _d_o_f_s_P_e_r_C_o_d_i_m__[0] * _g_r_i_d_V_i_e_w__.size(0) + _d_o_f_s_P_e_r_C_o_d_i_m__[1] * │ │ │ │ │ +_g_r_i_d_V_i_e_w__.size(1); // only 2d │ │ │ │ │ +210 } │ │ │ │ │ +211 │ │ │ │ │ +213 template │ │ │ │ │ +_2_1_4 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix prefix) const │ │ │ │ │ +215 { │ │ │ │ │ +216 assert(prefix.size() == 0 || prefix.size() == 1); │ │ │ │ │ +217 return (prefix.size() == 0) ? _s_i_z_e() : 0; │ │ │ │ │ +218 } │ │ │ │ │ +219 │ │ │ │ │ +_2_2_1 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ │ +222 { │ │ │ │ │ +223 return _s_i_z_e(); │ │ │ │ │ +224 } │ │ │ │ │ +225 │ │ │ │ │ +_2_2_6 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ │ +227 { │ │ │ │ │ +228 // The implementation currently only supports grids with a single element │ │ │ │ │ +type. │ │ │ │ │ +229 // We can therefore return the actual number of dofs here. │ │ │ │ │ +230 GeometryType elementType = *(_g_r_i_d_V_i_e_w__.indexSet().types(0).begin()); │ │ │ │ │ +231 size_t numFaces = ReferenceElements::general(elementType).size │ │ │ │ │ +(1); │ │ │ │ │ +232 return _d_o_f_s_P_e_r_C_o_d_i_m__[0] + _d_o_f_s_P_e_r_C_o_d_i_m__[1] * numFaces; │ │ │ │ │ +233 } │ │ │ │ │ +234 │ │ │ │ │ +240 template │ │ │ │ │ +_2_4_1 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ │ +242 { │ │ │ │ │ +243 const auto& gridIndexSet = _g_r_i_d_V_i_e_w().indexSet(); │ │ │ │ │ +244 const auto& element = node._e_l_e_m_e_n_t(); │ │ │ │ │ +245 │ │ │ │ │ +246 // throw if element is not of predefined type │ │ │ │ │ +247 if (not(element.type().isCube()) and not(element.type().isSimplex())) │ │ │ │ │ +248 DUNE_THROW(Dune::NotImplemented, "BrezziDouglasMariniBasis only implemented │ │ │ │ │ +for cube and simplex elements."); │ │ │ │ │ +249 │ │ │ │ │ +250 for(std::size_t i=0, end=node._s_i_z_e(); i _c_o_d_i_m_O_f_f_s_e_t__; │ │ │ │ │ +_2_6_8 FiniteElementMap _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__; │ │ │ │ │ +269 // Number of dofs per entity type depending on the entity's codimension and │ │ │ │ │ +type │ │ │ │ │ +_2_7_0 std::array _d_o_f_s_P_e_r_C_o_d_i_m__ {{dim*(k-1)*3, dim+(k-1)}}; │ │ │ │ │ +271}; │ │ │ │ │ +272 │ │ │ │ │ +273 │ │ │ │ │ +274 │ │ │ │ │ +275template │ │ │ │ │ +_2_7_6class _B_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i_N_o_d_e : │ │ │ │ │ +277 public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ │ +278{ │ │ │ │ │ +279 static const int dim = GV::dimension; │ │ │ │ │ +280 │ │ │ │ │ +281public: │ │ │ │ │ +282 │ │ │ │ │ +_2_8_3 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ +_2_8_4 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ │ +_2_8_5 using _F_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p = typename Impl::BDMLocalFiniteElementMap; │ │ │ │ │ +_2_8_6 using _F_i_n_i_t_e_E_l_e_m_e_n_t = Impl::GlobalValuedLocalFiniteElement; │ │ │ │ │ +289 │ │ │ │ │ +_2_9_0 _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) : │ │ │ │ │ +291 _e_l_e_m_e_n_t__(nullptr), │ │ │ │ │ +292 _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__(finiteElementMap) │ │ │ │ │ +293 {} │ │ │ │ │ +294 │ │ │ │ │ +_2_9_6 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ │ +297 { │ │ │ │ │ +298 return *_e_l_e_m_e_n_t__; │ │ │ │ │ +299 } │ │ │ │ │ +300 │ │ │ │ │ +_3_0_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 │ │ │ │ │ +306 { │ │ │ │ │ +307 return _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ │ +308 } │ │ │ │ │ +309 │ │ │ │ │ +_3_1_1 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ │ +312 { │ │ │ │ │ +313 _e_l_e_m_e_n_t__ = &e; │ │ │ │ │ +314 _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); │ │ │ │ │ +315 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__.size()); │ │ │ │ │ +316 } │ │ │ │ │ +317 │ │ │ │ │ +318protected: │ │ │ │ │ +319 │ │ │ │ │ +_3_2_0 _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_2_1 const _E_l_e_m_e_n_t* _e_l_e_m_e_n_t__; │ │ │ │ │ +_3_2_2 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__; │ │ │ │ │ +323}; │ │ │ │ │ +324 │ │ │ │ │ +325 │ │ │ │ │ +326 │ │ │ │ │ +327namespace BasisFactory { │ │ │ │ │ +328 │ │ │ │ │ +336template │ │ │ │ │ +_3_3_7auto _b_r_e_z_z_i_D_o_u_g_l_a_s_M_a_r_i_n_i() │ │ │ │ │ +338{ │ │ │ │ │ +339 return [](const auto& gridView) { │ │ │ │ │ +340 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); │ │ │ │ │ +341 }; │ │ │ │ │ +342} │ │ │ │ │ +343 │ │ │ │ │ +344} // end namespace BasisFactory │ │ │ │ │ +345 │ │ │ │ │ +346 │ │ │ │ │ +347 │ │ │ │ │ +348/ │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +349// This is the actual global basis implementation based on the reusable │ │ │ │ │ +parts. │ │ │ │ │ +350/ │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +351 │ │ │ │ │ +359template │ │ │ │ │ +_3_6_0using _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_> >; │ │ │ │ │ +361 │ │ │ │ │ +362} // end namespace Functions │ │ │ │ │ +363} // end namespace Dune │ │ │ │ │ +364 │ │ │ │ │ +365 │ │ │ │ │ +366#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BREZZIDOUGLASMARINIBASIS_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 │ │ │ │ │ +_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:337 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:23 │ │ │ │ │ -_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:37 │ │ │ │ │ -_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:39 │ │ │ │ │ -_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:54 │ │ │ │ │ -_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:70 │ │ │ │ │ -_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:86 │ │ │ │ │ -_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:102 │ │ │ │ │ +_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:278 │ │ │ │ │ +_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:305 │ │ │ │ │ +_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:284 │ │ │ │ │ +_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:322 │ │ │ │ │ +_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:283 │ │ │ │ │ +_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:320 │ │ │ │ │ +_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, dim, double, k > FiniteElementMap │ │ │ │ │ +DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:285 │ │ │ │ │ +_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:321 │ │ │ │ │ +_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:288 │ │ │ │ │ +_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:311 │ │ │ │ │ +_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:290 │ │ │ │ │ +_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:296 │ │ │ │ │ +_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:152 │ │ │ │ │ +_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:160 │ │ │ │ │ +_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_:_:_d_o_f_s_P_e_r_C_o_d_i_m__ │ │ │ │ │ +std::array< int, 2 > dofsPerCodim_ │ │ │ │ │ +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_P_r_e_B_a_s_i_s_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ │ +size_type dimension() const │ │ │ │ │ +DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:221 │ │ │ │ │ +_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_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ +static constexpr size_type minMultiIndexSize │ │ │ │ │ +DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:165 │ │ │ │ │ +_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_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ +static constexpr size_type maxMultiIndexSize │ │ │ │ │ +DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:164 │ │ │ │ │ +_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_:_:_c_o_d_i_m_O_f_f_s_e_t__ │ │ │ │ │ +std::array< size_t, dim+1 > codimOffset_ │ │ │ │ │ +DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:267 │ │ │ │ │ +_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 │ │ │ │ │ +size_type size(const SizePrefix prefix) const │ │ │ │ │ +Return number possible values for next position in multi index. │ │ │ │ │ +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_:_:_m_a_k_e_N_o_d_e │ │ │ │ │ +Node makeNode() const │ │ │ │ │ +Create tree node. │ │ │ │ │ +DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:202 │ │ │ │ │ +_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:159 │ │ │ │ │ +_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:169 │ │ │ │ │ +_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: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_P_r_e_B_a_s_i_s_:_:_u_p_d_a_t_e │ │ │ │ │ +void update(const GridView &gv) │ │ │ │ │ +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_:_:_i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ │ +void initializeIndices() │ │ │ │ │ +DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:179 │ │ │ │ │ +_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 │ │ │ │ │ +const GridView & gridView() const │ │ │ │ │ +Obtain the grid view that the basis 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_:_:_s_i_z_e │ │ │ │ │ +size_type size() const │ │ │ │ │ +DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:207 │ │ │ │ │ +_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_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 brezzidouglasmarinibasis.hh:166 │ │ │ │ │ +_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_x_N_o_d_e_S_i_z_e │ │ │ │ │ +size_type maxNodeSize() const │ │ │ │ │ +DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:226 │ │ │ │ │ +_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__ │ │ │ │ │ +GridView gridView_ │ │ │ │ │ +DDeeffiinniittiioonn brezzidouglasmarinibasis.hh:266 │ │ │ │ │ +_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_:_:_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 brezzidouglasmarinibasis.hh:241 │ │ │ │ │ +_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:46 │ │ │ │ │ +_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 │ │ │ │ │ +DDeeffiinniittiioonn nodes.hh:142 │ │ │ │ │ +_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:164 │ │ │ │ │ +_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:186 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00134.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: differentiablefunctionfromcallables.hh File Reference │ │ │ │ +dune-functions: defaultlocalview.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,55 +65,47 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces | │ │ │ │ -Functions
│ │ │ │ -
differentiablefunctionfromcallables.hh File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
defaultlocalview.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <dune/common/typeutilities.hh>
│ │ │ │ +
#include <tuple>
│ │ │ │ +#include <optional>
│ │ │ │ +#include <dune/common/concept.hh>
│ │ │ │ #include <dune/common/hybridutilities.hh>
│ │ │ │ -#include <dune/functions/common/signature.hh>
│ │ │ │ -#include <dune/functions/common/differentiablefunction.hh>
│ │ │ │ -#include <dune/functions/common/functionconcepts.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::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::DefaultLocalView< GB >
 The restriction of a finite element basis to a single element. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ │ Namespaces

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

│ │ │ │ -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.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,46 +1,29 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -differentiablefunctionfromcallables.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ +defaultlocalview.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_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> │ │ │ │ │ +#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_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_:_:_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 │ │ │ │ │   │ │ │ │ │ -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. │ │ │ │ │ -  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00134_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: differentiablefunctionfromcallables.hh Source File │ │ │ │ +dune-functions: defaultlocalview.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,163 +70,220 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
differentiablefunctionfromcallables.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#ifndef DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH
│ │ │ │
5
│ │ │ │
6
│ │ │ │ -
7#include <dune/common/typeutilities.hh>
│ │ │ │ -
8#include <dune/common/hybridutilities.hh>
│ │ │ │ +
7#include <tuple>
│ │ │ │ +
8#include <optional>
│ │ │ │
9
│ │ │ │ - │ │ │ │ -
11
│ │ │ │ - │ │ │ │ - │ │ │ │ -
14
│ │ │ │ -
15
│ │ │ │ -
16
│ │ │ │ -
17namespace Dune {
│ │ │ │ -
18namespace Functions {
│ │ │ │ +
10#include <dune/common/concept.hh>
│ │ │ │ +
11#include <dune/common/hybridutilities.hh>
│ │ │ │ +
12#include <dune/common/reservedvector.hh>
│ │ │ │ +
13
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
17
│ │ │ │ +
18
│ │ │ │
19
│ │ │ │ -
20
│ │ │ │ -
21
│ │ │ │ -
22template<class Signature, template<class> class DerivativeTraits, class... Callables>
│ │ │ │ - │ │ │ │ +
20namespace Dune {
│ │ │ │ +
21namespace Functions {
│ │ │ │ +
22
│ │ │ │ +
23
│ │ │ │
24
│ │ │ │ -
25
│ │ │ │ -
26
│ │ │ │ -
43template<class Range, class Domain, template<class> class DerivativeTraits, class F>
│ │ │ │ -
│ │ │ │ -
44class DifferentiableFunctionFromCallables<Range(Domain), DerivativeTraits, F>
│ │ │ │ -
45{
│ │ │ │ -
46public:
│ │ │ │ +
26template<class GB>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
28{
│ │ │ │ +
29public:
│ │ │ │ +
30
│ │ │ │ +
32 using GlobalBasis = GB;
│ │ │ │ +
33
│ │ │ │ +
35 using GridView = typename GlobalBasis::GridView;
│ │ │ │ +
36
│ │ │ │ +
38 using Element = typename GridView::template Codim<0>::Entity;
│ │ │ │ +
39
│ │ │ │ +
41 using size_type = std::size_t;
│ │ │ │ +
42
│ │ │ │ +
44 using Tree = typename GlobalBasis::PreBasis::Node;
│ │ │ │ +
45
│ │ │ │ +
46protected:
│ │ │ │
47
│ │ │ │ -
49 using Signature = Range(Domain);
│ │ │ │ -
50
│ │ │ │ - │ │ │ │ -
52
│ │ │ │ -
54 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(Domain);
│ │ │ │ -
55
│ │ │ │ - │ │ │ │ -
58
│ │ │ │ -
60 template<class FF, disableCopyMove<DifferentiableFunctionFromCallables, FF> = 0>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
62 f_(std::forward<FF>(f))
│ │ │ │ -
63 {}
│ │ │ │ -
│ │ │ │ -
64
│ │ │ │ -
│ │ │ │ -
66 Range operator() (const Domain& x) const
│ │ │ │ -
67 {
│ │ │ │ -
68 return f_(x);
│ │ │ │ -
69 }
│ │ │ │ -
│ │ │ │ -
70
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
77 {
│ │ │ │ -
78 DUNE_THROW(Dune::NotImplemented, "Derivative not implemented");
│ │ │ │ -
79 }
│ │ │ │ -
│ │ │ │ -
80
│ │ │ │ -
81private:
│ │ │ │ -
82 F f_;
│ │ │ │ -
83};
│ │ │ │ -
│ │ │ │ -
84
│ │ │ │ -
85
│ │ │ │ -
86
│ │ │ │ -
103template<class Range, class Domain, template<class> class DerivativeTraits, class F, class DF, class... Derivatives>
│ │ │ │ -
│ │ │ │ -
104class DifferentiableFunctionFromCallables<Range(Domain), DerivativeTraits, F, DF, Derivatives...>
│ │ │ │ -
105{
│ │ │ │ -
106public:
│ │ │ │ -
107
│ │ │ │ -
108 using Signature = Range(Domain);
│ │ │ │ - │ │ │ │ -
110 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(Domain);
│ │ │ │ +
48 using PreBasis = typename GlobalBasis::PreBasis;
│ │ │ │ +
49
│ │ │ │ +
50 // Type used to store the multi indices of the basis vectors.
│ │ │ │ +
51 // In contrast to MultiIndex this always has dynamic size.
│ │ │ │ +
52 // It's guaranteed, that you can always cast it to MultiIndex
│ │ │ │ + │ │ │ │ +
54 std::conditional_t<(PreBasis::minMultiIndexSize == PreBasis::maxMultiIndexSize),
│ │ │ │ + │ │ │ │ +
56 Dune::ReservedVector<size_type, PreBasis::multiIndexBufferSize>>;
│ │ │ │ +
57
│ │ │ │ +
58public:
│ │ │ │ +
59
│ │ │ │ +
61 using MultiIndex =
│ │ │ │ +
62 std::conditional_t<(PreBasis::minMultiIndexSize == PreBasis::maxMultiIndexSize),
│ │ │ │ + │ │ │ │ +
64 Dune::ReservedVector<size_type, PreBasis::multiIndexBufferSize>>;
│ │ │ │ +
65
│ │ │ │ +
66
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ +
70 tree_(globalBasis_->preBasis().makeNode())
│ │ │ │ +
71 {
│ │ │ │ +
72 static_assert(models<Concept::BasisTree<GridView>, Tree>(), "Tree type passed to DefaultLocalView does not model the BasisNode concept.");
│ │ │ │ + │ │ │ │ +
74 }
│ │ │ │ +
│ │ │ │ +
75
│ │ │ │ +
│ │ │ │ +
81 void bind(const Element& e)
│ │ │ │ +
82 {
│ │ │ │ +
83 element_ = e;
│ │ │ │ + │ │ │ │ +
85 indices_.resize(size());
│ │ │ │ +
86 globalBasis_->preBasis().indices(tree_, indices_.begin());
│ │ │ │ +
87 }
│ │ │ │ +
│ │ │ │ +
88
│ │ │ │ +
91 [[deprecated("Use the bound() method instead")]]
│ │ │ │ +
│ │ │ │ +
92 bool isBound() const {
│ │ │ │ +
93 return static_cast<bool>(element_);
│ │ │ │ +
94 }
│ │ │ │ +
│ │ │ │ +
95
│ │ │ │ +
│ │ │ │ +
98 bool bound() const
│ │ │ │ +
99 {
│ │ │ │ +
100 return static_cast<bool>(element_);
│ │ │ │ +
101 }
│ │ │ │ +
│ │ │ │ +
102
│ │ │ │ +
│ │ │ │ +
107 const Element& element() const
│ │ │ │ +
108 {
│ │ │ │ +
109 return *element_;
│ │ │ │ +
110 }
│ │ │ │ +
│ │ │ │
111
│ │ │ │ -
112 using Derivative = DifferentiableFunctionFromCallables<DerivativeSignature, DerivativeTraits, DF, Derivatives...>;
│ │ │ │ -
113
│ │ │ │ -
120 template<class FF, class DFF, class... DDFF>
│ │ │ │ -
│ │ │ │ -
121 DifferentiableFunctionFromCallables(FF&& f, DFF&& df, DDFF&&... ddf) :
│ │ │ │ -
122 f_(std::forward<FF>(f)),
│ │ │ │ -
123 df_(std::forward<DFF>(df), std::forward<DDFF>(ddf)...)
│ │ │ │ -
124 {}
│ │ │ │ -
│ │ │ │ -
125
│ │ │ │ -
│ │ │ │ -
127 Range operator() (const Domain& x) const
│ │ │ │ -
128 {
│ │ │ │ -
129 return f_(x);
│ │ │ │ -
130 }
│ │ │ │ -
│ │ │ │ -
131
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
138 {
│ │ │ │ -
139 return t.df_;
│ │ │ │ -
140 }
│ │ │ │ -
│ │ │ │ -
141
│ │ │ │ -
142private:
│ │ │ │ -
143 F f_;
│ │ │ │ -
144 Derivative df_;
│ │ │ │ -
145};
│ │ │ │ +
│ │ │ │ +
116 void unbind()
│ │ │ │ +
117 {
│ │ │ │ +
118 element_.reset();
│ │ │ │ +
119 }
│ │ │ │ +
│ │ │ │ +
120
│ │ │ │ +
│ │ │ │ +
125 const Tree& tree() const
│ │ │ │ +
126 {
│ │ │ │ +
127 return tree_;
│ │ │ │ +
128 }
│ │ │ │ +
│ │ │ │ +
129
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
133 {
│ │ │ │ +
134 return tree_.size();
│ │ │ │ +
135 }
│ │ │ │ +
│ │ │ │ +
136
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
144 {
│ │ │ │ +
145 return globalBasis_->preBasis().maxNodeSize();
│ │ │ │ +
146 }
│ │ │ │
│ │ │ │ -
146
│ │ │ │
147
│ │ │ │ -
162template<class Signature, template<class> class DerivativeTraits, class... F>
│ │ │ │ -
163DifferentiableFunctionFromCallables<Signature, DerivativeTraits, F...>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
165{
│ │ │ │ -
166 return DifferentiableFunctionFromCallables<Signature, DerivativeTraits, F...>(f...);
│ │ │ │ -
167}
│ │ │ │ -
│ │ │ │ -
168
│ │ │ │ -
169
│ │ │ │ -
170
│ │ │ │ -
171} // namespace Functions
│ │ │ │ -
172} // namespace Dune
│ │ │ │ +
│ │ │ │ +
149 const MultiIndex& index(size_type i) const
│ │ │ │ +
150 {
│ │ │ │ +
151 return indices_[i];
│ │ │ │ +
152 }
│ │ │ │ +
│ │ │ │ +
153
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
157 {
│ │ │ │ +
158 return *globalBasis_;
│ │ │ │ +
159 }
│ │ │ │ +
│ │ │ │ +
160
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
162 {
│ │ │ │ +
163 return *this;
│ │ │ │ +
164 }
│ │ │ │ +
│ │ │ │ +
165
│ │ │ │ +
166protected:
│ │ │ │ + │ │ │ │ +
168 std::optional<Element> element_;
│ │ │ │ + │ │ │ │ +
170 std::vector<MultiIndexStorage> indices_;
│ │ │ │ +
171};
│ │ │ │ +
│ │ │ │ +
172
│ │ │ │
173
│ │ │ │ -
174#endif //DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
friend Derivative derivative(const DifferentiableFunctionFromCallables &t)
Get derivative of DifferentiableFunctionFromCallables.
Definition differentiablefunctionfromcallables.hh:76
│ │ │ │ -
DifferentiableFunctionFromCallables< Signature, DerivativeTraits, F... > makeDifferentiableFunctionFromCallables(const SignatureTag< Signature, DerivativeTraits > &signatureTag, F &&... f)
Create a DifferentiableFunction from callables.
Definition differentiablefunctionfromcallables.hh:164
│ │ │ │ +
174
│ │ │ │ +
175} // end namespace Functions
│ │ │ │ +
176} // end namespace Dune
│ │ │ │ +
177
│ │ │ │ +
178
│ │ │ │ +
179
│ │ │ │ +
180#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH
│ │ │ │ + │ │ │ │ + │ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
Definition differentiablefunction.hh:29
│ │ │ │ -
Definition differentiablefunctionfromcallables.hh:23
│ │ │ │ -
DifferentiableFunctionFromCallables(FF &&f)
Constructor copying the given function.
Definition differentiablefunctionfromcallables.hh:61
│ │ │ │ -
typename SignatureTraits< Signature >::RawSignature RawSignature
Definition differentiablefunctionfromcallables.hh:51
│ │ │ │ -
Range(Domain) Signature
Signature of function.
Definition differentiablefunctionfromcallables.hh:49
│ │ │ │ -
typename DerivativeTraits< RawSignature >::Range(Domain) DerivativeSignature
Signature of derivative.
Definition differentiablefunctionfromcallables.hh:54
│ │ │ │ -
typename DerivativeTraits< RawSignature >::Range(Domain) DerivativeSignature
Definition differentiablefunctionfromcallables.hh:110
│ │ │ │ - │ │ │ │ -
typename SignatureTraits< Signature >::RawSignature RawSignature
Definition differentiablefunctionfromcallables.hh:109
│ │ │ │ -
DifferentiableFunctionFromCallables(FF &&f, DFF &&df, DDFF &&... ddf)
Constructor copying the given functions.
Definition differentiablefunctionfromcallables.hh:121
│ │ │ │ -
Helper class to deduce the signature of a callable.
Definition signature.hh:56
│ │ │ │ -
Definition signature.hh:102
│ │ │ │ +
void bindTree(Tree &tree, const Entity &entity, std::size_t offset=0)
Definition nodes.hh:253
│ │ │ │ +
void initializeTree(Tree &tree, std::size_t treeIndexOffset=0)
Definition nodes.hh:260
│ │ │ │ +
A statically sized MultiIndex type.
Definition multiindex.hh:25
│ │ │ │ +
A dynamically sized array-like class with overflow.
Definition overflowarray.hh:45
│ │ │ │ +
The restriction of a finite element basis to a single element.
Definition defaultlocalview.hh:28
│ │ │ │ +
typename GlobalBasis::PreBasis PreBasis
Definition defaultlocalview.hh:48
│ │ │ │ +
void unbind()
Unbind from the current element.
Definition defaultlocalview.hh:116
│ │ │ │ +
bool bound() const
Return if the view is bound to a grid element.
Definition defaultlocalview.hh:98
│ │ │ │ +
typename GlobalBasis::GridView GridView
The grid view the global FE basis lives on.
Definition defaultlocalview.hh:35
│ │ │ │ +
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:149
│ │ │ │ +
std::optional< Element > element_
Definition defaultlocalview.hh:168
│ │ │ │ +
typename GridView::template Codim< 0 >::Entity Element
Type of the grid element we are bound to.
Definition defaultlocalview.hh:38
│ │ │ │ +
const Tree & tree() const
Return the local ansatz tree associated to the bound entity.
Definition defaultlocalview.hh:125
│ │ │ │ +
void bind(const Element &e)
Bind the view to a grid element.
Definition defaultlocalview.hh:81
│ │ │ │ +
const Element & element() const
Return the grid element that the view is bound to.
Definition defaultlocalview.hh:107
│ │ │ │ +
size_type size() const
Total number of degrees of freedom on this element.
Definition defaultlocalview.hh:132
│ │ │ │ +
GB GlobalBasis
The global FE basis that this is a view on.
Definition defaultlocalview.hh:32
│ │ │ │ +
Tree tree_
Definition defaultlocalview.hh:169
│ │ │ │ +
size_type maxSize() const
Maximum local size for any element on the GridView.
Definition defaultlocalview.hh:143
│ │ │ │ +
std::size_t size_type
The type used for sizes.
Definition defaultlocalview.hh:41
│ │ │ │ +
bool isBound() const
Return if the view is bound to a grid element.
Definition defaultlocalview.hh:92
│ │ │ │ +
const DefaultLocalView & rootLocalView() const
Definition defaultlocalview.hh:161
│ │ │ │ +
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:56
│ │ │ │ +
std::conditional_t<(PreBasis::minMultiIndexSize==PreBasis::maxMultiIndexSize), StaticMultiIndex< size_type, PreBasis::maxMultiIndexSize >, Dune::ReservedVector< size_type, PreBasis::multiIndexBufferSize > > MultiIndex
Type used for global numbering of the basis vectors.
Definition defaultlocalview.hh:64
│ │ │ │ +
std::vector< MultiIndexStorage > indices_
Definition defaultlocalview.hh:170
│ │ │ │ +
typename GlobalBasis::PreBasis::Node Tree
Tree of local finite elements / local shape function sets.
Definition defaultlocalview.hh:44
│ │ │ │ +
DefaultLocalView(const GlobalBasis &globalBasis)
Construct local view for a given global finite element basis.
Definition defaultlocalview.hh:68
│ │ │ │ +
const GlobalBasis * globalBasis_
Definition defaultlocalview.hh:167
│ │ │ │ +
const GlobalBasis & globalBasis() const
Return the global basis that we are a view on.
Definition defaultlocalview.hh:156
│ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,190 +1,270 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -differentiablefunctionfromcallables.hh │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH │ │ │ │ │ 5 │ │ │ │ │ 6 │ │ │ │ │ -7#include │ │ │ │ │ -8#include │ │ │ │ │ +7#include │ │ │ │ │ +8#include │ │ │ │ │ 9 │ │ │ │ │ -10#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> │ │ │ │ │ -11 │ │ │ │ │ -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_._h_h> │ │ │ │ │ -13#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 │ │ │ │ │ -15 │ │ │ │ │ -16 │ │ │ │ │ -17namespace _D_u_n_e { │ │ │ │ │ -18namespace Functions { │ │ │ │ │ +10#include │ │ │ │ │ +11#include │ │ │ │ │ +12#include │ │ │ │ │ +13 │ │ │ │ │ +14#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> │ │ │ │ │ +15#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> │ │ │ │ │ +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 │ │ │ │ │ +18 │ │ │ │ │ 19 │ │ │ │ │ -20 │ │ │ │ │ -21 │ │ │ │ │ -22template class DerivativeTraits, class... │ │ │ │ │ -Callables> │ │ │ │ │ -_2_3class _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; │ │ │ │ │ +20namespace _D_u_n_e { │ │ │ │ │ +21namespace Functions { │ │ │ │ │ +22 │ │ │ │ │ +23 │ │ │ │ │ 24 │ │ │ │ │ -25 │ │ │ │ │ -26 │ │ │ │ │ -43template class DerivativeTraits, │ │ │ │ │ -class F> │ │ │ │ │ -_4_4class _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 │ │ │ │ │ -45{ │ │ │ │ │ -46public: │ │ │ │ │ +26template │ │ │ │ │ +_2_7class _D_e_f_a_u_l_t_L_o_c_a_l_V_i_e_w │ │ │ │ │ +28{ │ │ │ │ │ +29public: │ │ │ │ │ +30 │ │ │ │ │ +_3_2 using _G_l_o_b_a_l_B_a_s_i_s = GB; │ │ │ │ │ +33 │ │ │ │ │ +_3_5 using _G_r_i_d_V_i_e_w = typename GlobalBasis::GridView; │ │ │ │ │ +36 │ │ │ │ │ +_3_8 using _E_l_e_m_e_n_t = typename GridView::template Codim<0>::Entity; │ │ │ │ │ +39 │ │ │ │ │ +_4_1 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ +42 │ │ │ │ │ +_4_4 using _T_r_e_e = typename GlobalBasis::PreBasis::Node; │ │ │ │ │ +45 │ │ │ │ │ +46protected: │ │ │ │ │ 47 │ │ │ │ │ -_4_9 using _S_i_g_n_a_t_u_r_e = Range(Domain); │ │ │ │ │ -50 │ │ │ │ │ -_5_1 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; │ │ │ │ │ -52 │ │ │ │ │ -_5_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); │ │ │ │ │ -55 │ │ │ │ │ -_5_7 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_>; │ │ │ │ │ -58 │ │ │ │ │ -60 template │ │ │ │ │ -= 0> │ │ │ │ │ -_6_1 _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) : │ │ │ │ │ -62 f_(std::forward(f)) │ │ │ │ │ -63 {} │ │ │ │ │ -64 │ │ │ │ │ -_6_6 Range operator() (const Domain& x) const │ │ │ │ │ -67 { │ │ │ │ │ -68 return f_(x); │ │ │ │ │ -69 } │ │ │ │ │ -70 │ │ │ │ │ -_7_6 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) │ │ │ │ │ -77 { │ │ │ │ │ -78 DUNE_THROW(Dune::NotImplemented, "Derivative not implemented"); │ │ │ │ │ -79 } │ │ │ │ │ -80 │ │ │ │ │ -81private: │ │ │ │ │ -82 F f_; │ │ │ │ │ -83}; │ │ │ │ │ -84 │ │ │ │ │ -85 │ │ │ │ │ -86 │ │ │ │ │ -103template class DerivativeTraits, │ │ │ │ │ -class F, class DF, class... Derivatives> │ │ │ │ │ -_1_0_4class _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 │ │ │ │ │ -105{ │ │ │ │ │ -106public: │ │ │ │ │ -107 │ │ │ │ │ -_1_0_8 using _S_i_g_n_a_t_u_r_e = Range(Domain); │ │ │ │ │ -_1_0_9 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_0 using _D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e = typename DerivativeTraits::Range │ │ │ │ │ -(Domain); │ │ │ │ │ +_4_8 using _P_r_e_B_a_s_i_s = typename GlobalBasis::PreBasis; │ │ │ │ │ +49 │ │ │ │ │ +50 // Type used to store the multi indices of the basis vectors. │ │ │ │ │ +51 // In contrast to MultiIndex this always has dynamic size. │ │ │ │ │ +52 // It's guaranteed, that you can always cast it to MultiIndex │ │ │ │ │ +_5_3 using _M_u_l_t_i_I_n_d_e_x_S_t_o_r_a_g_e = │ │ │ │ │ +54 std::conditional_t<(PreBasis::minMultiIndexSize == PreBasis:: │ │ │ │ │ +maxMultiIndexSize), │ │ │ │ │ +55 _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>, │ │ │ │ │ +56 Dune::ReservedVector>; │ │ │ │ │ +57 │ │ │ │ │ +58public: │ │ │ │ │ +59 │ │ │ │ │ +_6_1 using _M_u_l_t_i_I_n_d_e_x = │ │ │ │ │ +62 std::conditional_t<(PreBasis::minMultiIndexSize == PreBasis:: │ │ │ │ │ +maxMultiIndexSize), │ │ │ │ │ +63 _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_>, │ │ │ │ │ +64 Dune::ReservedVector>; │ │ │ │ │ +65 │ │ │ │ │ +66 │ │ │ │ │ +_6_8 _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) : │ │ │ │ │ +69 _g_l_o_b_a_l_B_a_s_i_s__(&_g_l_o_b_a_l_B_a_s_i_s), │ │ │ │ │ +70 _t_r_e_e__(_g_l_o_b_a_l_B_a_s_i_s__->preBasis().makeNode()) │ │ │ │ │ +71 { │ │ │ │ │ +72 static_assert(models, _T_r_e_e>(), "Tree type │ │ │ │ │ +passed to DefaultLocalView does not model the BasisNode concept."); │ │ │ │ │ +73 _i_n_i_t_i_a_l_i_z_e_T_r_e_e(_t_r_e_e__); │ │ │ │ │ +74 } │ │ │ │ │ +75 │ │ │ │ │ +_8_1 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ │ +82 { │ │ │ │ │ +83 _e_l_e_m_e_n_t__ = e; │ │ │ │ │ +84 _b_i_n_d_T_r_e_e(_t_r_e_e__, *_e_l_e_m_e_n_t__); │ │ │ │ │ +85 _i_n_d_i_c_e_s__.resize(_s_i_z_e()); │ │ │ │ │ +86 _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()); │ │ │ │ │ +87 } │ │ │ │ │ +88 │ │ │ │ │ +91 [[deprecated("Use the bound() method instead")]] │ │ │ │ │ +_9_2 bool _i_s_B_o_u_n_d() const { │ │ │ │ │ +93 return static_cast(_e_l_e_m_e_n_t__); │ │ │ │ │ +94 } │ │ │ │ │ +95 │ │ │ │ │ +_9_8 bool _b_o_u_n_d() const │ │ │ │ │ +99 { │ │ │ │ │ +100 return static_cast(_e_l_e_m_e_n_t__); │ │ │ │ │ +101 } │ │ │ │ │ +102 │ │ │ │ │ +_1_0_7 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ │ +108 { │ │ │ │ │ +109 return *_e_l_e_m_e_n_t__; │ │ │ │ │ +110 } │ │ │ │ │ 111 │ │ │ │ │ -_1_1_2 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...>; │ │ │ │ │ -113 │ │ │ │ │ -120 template │ │ │ │ │ -_1_2_1 _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) : │ │ │ │ │ -122 f_(std::forward(f)), │ │ │ │ │ -123 df_(std::forward(df), std::forward(ddf)...) │ │ │ │ │ -124 {} │ │ │ │ │ -125 │ │ │ │ │ -_1_2_7 Range operator() (const Domain& x) const │ │ │ │ │ -128 { │ │ │ │ │ -129 return f_(x); │ │ │ │ │ -130 } │ │ │ │ │ -131 │ │ │ │ │ -_1_3_7 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) │ │ │ │ │ -138 { │ │ │ │ │ -139 return t.df_; │ │ │ │ │ -140 } │ │ │ │ │ -141 │ │ │ │ │ -142private: │ │ │ │ │ -143 F f_; │ │ │ │ │ -144 Derivative df_; │ │ │ │ │ -145}; │ │ │ │ │ -146 │ │ │ │ │ +_1_1_6 void _u_n_b_i_n_d() │ │ │ │ │ +117 { │ │ │ │ │ +118 _e_l_e_m_e_n_t__.reset(); │ │ │ │ │ +119 } │ │ │ │ │ +120 │ │ │ │ │ +_1_2_5 const _T_r_e_e& _t_r_e_e() const │ │ │ │ │ +126 { │ │ │ │ │ +127 return _t_r_e_e__; │ │ │ │ │ +128 } │ │ │ │ │ +129 │ │ │ │ │ +_1_3_2 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ │ +133 { │ │ │ │ │ +134 return _t_r_e_e__.size(); │ │ │ │ │ +135 } │ │ │ │ │ +136 │ │ │ │ │ +_1_4_3 _s_i_z_e___t_y_p_e _m_a_x_S_i_z_e() const │ │ │ │ │ +144 { │ │ │ │ │ +145 return _g_l_o_b_a_l_B_a_s_i_s__->preBasis().maxNodeSize(); │ │ │ │ │ +146 } │ │ │ │ │ 147 │ │ │ │ │ -162template class DerivativeTraits, class... │ │ │ │ │ -F> │ │ │ │ │ -163DifferentiableFunctionFromCallables │ │ │ │ │ -_1_6_4 _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) │ │ │ │ │ -165{ │ │ │ │ │ -166 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...); │ │ │ │ │ -167} │ │ │ │ │ -168 │ │ │ │ │ -169 │ │ │ │ │ -170 │ │ │ │ │ -171} // namespace Functions │ │ │ │ │ -172} // namespace Dune │ │ │ │ │ +_1_4_9 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 │ │ │ │ │ +150 { │ │ │ │ │ +151 return _i_n_d_i_c_e_s__[i]; │ │ │ │ │ +152 } │ │ │ │ │ +153 │ │ │ │ │ +_1_5_6 const _G_l_o_b_a_l_B_a_s_i_s& _g_l_o_b_a_l_B_a_s_i_s() const │ │ │ │ │ +157 { │ │ │ │ │ +158 return *_g_l_o_b_a_l_B_a_s_i_s__; │ │ │ │ │ +159 } │ │ │ │ │ +160 │ │ │ │ │ +_1_6_1 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 │ │ │ │ │ +162 { │ │ │ │ │ +163 return *this; │ │ │ │ │ +164 } │ │ │ │ │ +165 │ │ │ │ │ +166protected: │ │ │ │ │ +_1_6_7 const _G_l_o_b_a_l_B_a_s_i_s* _g_l_o_b_a_l_B_a_s_i_s__; │ │ │ │ │ +_1_6_8 std::optional _e_l_e_m_e_n_t__; │ │ │ │ │ +_1_6_9 _T_r_e_e _t_r_e_e__; │ │ │ │ │ +_1_7_0 std::vector _i_n_d_i_c_e_s__; │ │ │ │ │ +171}; │ │ │ │ │ +172 │ │ │ │ │ 173 │ │ │ │ │ -174#endif //DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH │ │ │ │ │ -_s_i_g_n_a_t_u_r_e_._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_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:76 │ │ │ │ │ -_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:164 │ │ │ │ │ +174 │ │ │ │ │ +175} // end namespace Functions │ │ │ │ │ +176} // end namespace Dune │ │ │ │ │ +177 │ │ │ │ │ +178 │ │ │ │ │ +179 │ │ │ │ │ +180#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH │ │ │ │ │ +_m_u_l_t_i_i_n_d_e_x_._h_h │ │ │ │ │ +_o_v_e_r_f_l_o_w_a_r_r_a_y_._h_h │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:29 │ │ │ │ │ -_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:23 │ │ │ │ │ -_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: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_ _>_:_:_R_a_w_S_i_g_n_a_t_u_r_e │ │ │ │ │ -typename SignatureTraits< Signature >::RawSignature RawSignature │ │ │ │ │ -DDeeffiinniittiioonn differentiablefunctionfromcallables.hh:51 │ │ │ │ │ -_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:49 │ │ │ │ │ -_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:54 │ │ │ │ │ -_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: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_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:108 │ │ │ │ │ -_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:109 │ │ │ │ │ -_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:121 │ │ │ │ │ -_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:56 │ │ │ │ │ -_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:102 │ │ │ │ │ +_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:253 │ │ │ │ │ +_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:260 │ │ │ │ │ +_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:25 │ │ │ │ │ +_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: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 │ │ │ │ │ +The restriction of a finite element basis to a single element. │ │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:28 │ │ │ │ │ +_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_:_:_P_r_e_B_a_s_i_s │ │ │ │ │ +typename GlobalBasis::PreBasis PreBasis │ │ │ │ │ +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_:_:_u_n_b_i_n_d │ │ │ │ │ +void unbind() │ │ │ │ │ +Unbind from the current element. │ │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:116 │ │ │ │ │ +_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:98 │ │ │ │ │ +_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_r_i_d_V_i_e_w │ │ │ │ │ +typename GlobalBasis::GridView GridView │ │ │ │ │ +The grid view the global FE basis lives on. │ │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:35 │ │ │ │ │ +_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:149 │ │ │ │ │ +_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__ │ │ │ │ │ +std::optional< Element > element_ │ │ │ │ │ +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_:_:_E_l_e_m_e_n_t │ │ │ │ │ +typename GridView::template Codim< 0 >::Entity Element │ │ │ │ │ +Type of the grid element we are bound to. │ │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:38 │ │ │ │ │ +_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:125 │ │ │ │ │ +_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: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_:_:_e_l_e_m_e_n_t │ │ │ │ │ +const Element & element() const │ │ │ │ │ +Return the grid element that the view is bound to. │ │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:107 │ │ │ │ │ +_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: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_:_:_G_l_o_b_a_l_B_a_s_i_s │ │ │ │ │ +GB GlobalBasis │ │ │ │ │ +The global FE basis that this is a view on. │ │ │ │ │ +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_:_:_t_r_e_e__ │ │ │ │ │ +Tree tree_ │ │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:169 │ │ │ │ │ +_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:143 │ │ │ │ │ +_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___t_y_p_e │ │ │ │ │ +std::size_t size_type │ │ │ │ │ +The type used for sizes. │ │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:41 │ │ │ │ │ +_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_s_B_o_u_n_d │ │ │ │ │ +bool isBound() const │ │ │ │ │ +Return if the view is bound to a grid element. │ │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:92 │ │ │ │ │ +_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:161 │ │ │ │ │ +_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_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:56 │ │ │ │ │ +_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_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 │ │ │ │ │ +Type used for global numbering of the basis vectors. │ │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:64 │ │ │ │ │ +_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_i_c_e_s__ │ │ │ │ │ +std::vector< MultiIndexStorage > indices_ │ │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:170 │ │ │ │ │ +_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 │ │ │ │ │ +typename GlobalBasis::PreBasis::Node Tree │ │ │ │ │ +Tree of local finite elements / local shape function sets. │ │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:44 │ │ │ │ │ +_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:68 │ │ │ │ │ +_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_l_o_b_a_l_B_a_s_i_s__ │ │ │ │ │ +const GlobalBasis * globalBasis_ │ │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:167 │ │ │ │ │ +_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_l_o_b_a_l_B_a_s_i_s │ │ │ │ │ +const GlobalBasis & globalBasis() const │ │ │ │ │ +Return the global basis that we are a view on. │ │ │ │ │ +DDeeffiinniittiioonn defaultlocalview.hh:156 │ │ │ │ │ +_c_o_n_c_e_p_t_s_._h_h │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00137.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: localfunction.hh File Reference │ │ │ │ +dune-functions: interpolate.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,48 +65,62 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ -Namespaces
│ │ │ │ -
localfunction.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Functions
│ │ │ │ +
interpolate.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 <memory>
│ │ │ │ +#include <vector>
│ │ │ │ +#include <dune/common/exceptions.hh>
│ │ │ │ +#include <dune/common/bitsetvector.hh>
│ │ │ │ +#include <dune/typetree/childextraction.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/sizeinfo.hh>
│ │ │ │ +#include <dune/functions/functionspacebases/flatvectorview.hh>
│ │ │ │ +#include <dune/functions/functionspacebases/hierarchicnodetorangemap.hh>
│ │ │ │ +#include <dune/typetree/traversal.hh>
│ │ │ │ +#include <dune/typetree/visitor.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...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +

│ │ │ │ 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.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,32 +1,46 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -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> │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +_N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +interpolate.hh File Reference │ │ │ │ │ +#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_/_s_i_z_e_i_n_f_o_._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 │ │ │ │ │ _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_._._. │ │ │ │ │ -  │ │ │ │ │ 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. │ │ │ │ │ +  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00137_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: localfunction.hh Source File │ │ │ │ +dune-functions: interpolate.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,174 +70,296 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
localfunction.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#ifndef DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH
│ │ │ │
5
│ │ │ │ -
6#include <type_traits>
│ │ │ │ -
7
│ │ │ │ -
8#include <dune/common/typeutilities.hh>
│ │ │ │ -
9
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
15
│ │ │ │ +
6#include <memory>
│ │ │ │ +
7#include <vector>
│ │ │ │ +
8
│ │ │ │ +
9#include <dune/common/exceptions.hh>
│ │ │ │ +
10#include <dune/common/bitsetvector.hh>
│ │ │ │ +
11
│ │ │ │ +
12#include <dune/typetree/childextraction.hh>
│ │ │ │ +
13
│ │ │ │ + │ │ │ │ + │ │ │ │
16
│ │ │ │ -
17
│ │ │ │ -
18namespace Dune {
│ │ │ │ -
19namespace Functions {
│ │ │ │ -
20
│ │ │ │ -
21
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
22
│ │ │ │ -
23/*
│ │ │ │ -
24 * Default implementation is empty
│ │ │ │ -
25 * The actual implementation is only given if Signature is an type
│ │ │ │ -
26 * describing a function signature as Range(Domain).
│ │ │ │ -
27 */
│ │ │ │ -
28template<class Signature, class LocalContext, template<class> class DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
30{};
│ │ │ │ -
│ │ │ │ -
31
│ │ │ │ -
32
│ │ │ │ -
33
│ │ │ │ -
34namespace Imp
│ │ │ │ -
35{
│ │ │ │ -
36
│ │ │ │ -
38 template<class S, class L, template<class> class DerivativeTraits, size_t bufferSize>
│ │ │ │ -
39 struct LocalFunctionTraits :
│ │ │ │ -
40 DifferentiableFunctionTraits<S, DerivativeTraits, bufferSize>
│ │ │ │ -
41 {
│ │ │ │ -
42 protected:
│ │ │ │ -
43 using Base=DifferentiableFunctionTraits<S, DerivativeTraits, bufferSize>;
│ │ │ │ -
44
│ │ │ │ -
45 public:
│ │ │ │ -
47 using LocalContext = L;
│ │ │ │ +
23#include <dune/typetree/traversal.hh>
│ │ │ │ +
24#include <dune/typetree/visitor.hh>
│ │ │ │ +
25
│ │ │ │ +
26namespace Dune {
│ │ │ │ +
27namespace Functions {
│ │ │ │ +
28
│ │ │ │ +
29namespace Imp {
│ │ │ │ +
30
│ │ │ │ +
31struct AllTrueBitSetVector
│ │ │ │ +
32{
│ │ │ │ +
33 struct AllTrueBitSet
│ │ │ │ +
34 {
│ │ │ │ +
35 bool test(int) const { return true; }
│ │ │ │ +
36 } allTrue_;
│ │ │ │ +
37
│ │ │ │ +
38 operator bool() const
│ │ │ │ +
39 {
│ │ │ │ +
40 return true;
│ │ │ │ +
41 }
│ │ │ │ +
42
│ │ │ │ +
43 template<class I>
│ │ │ │ +
44 const AllTrueBitSetVector& operator[](const I&) const
│ │ │ │ +
45 {
│ │ │ │ +
46 return *this;
│ │ │ │ +
47 }
│ │ │ │
48
│ │ │ │ -
50 using DerivativeSignature = typename Base::DerivativeSignature;
│ │ │ │ -
51
│ │ │ │ - │ │ │ │ +
49 template<class SP>
│ │ │ │ +
50 void resize(const SP&) const
│ │ │ │ +
51 {}
│ │ │ │ +
52
│ │ │ │ +
53};
│ │ │ │
54
│ │ │ │ -
56 using Concept = LocalFunctionWrapperInterface<S, DerivativeInterface, L>;
│ │ │ │ -
57
│ │ │ │ -
59 template<class B>
│ │ │ │ -
60 using Model = LocalFunctionWrapperImplementation<S, DerivativeInterface, L, B>;
│ │ │ │ -
61 };
│ │ │ │ -
62}
│ │ │ │ -
63
│ │ │ │ +
55
│ │ │ │ +
56
│ │ │ │ +
57template <class B, class T, class NTRE, class HV, class LF, class HBV>
│ │ │ │ +
58class LocalInterpolateVisitor
│ │ │ │ +
59 : public TypeTree::TreeVisitor
│ │ │ │ +
60 , public TypeTree::DynamicTraversal
│ │ │ │ +
61{
│ │ │ │ +
62
│ │ │ │ +
63public:
│ │ │ │
64
│ │ │ │ -
65
│ │ │ │ -
86template<class Range, class Domain, class LocalContext, template<class> class DerivativeTraits, size_t bufferSize>
│ │ │ │ -
│ │ │ │ -
87class LocalFunction< Range(Domain), LocalContext, DerivativeTraits, bufferSize> :
│ │ │ │ -
88 public TypeErasureBase<
│ │ │ │ -
89 typename Imp::LocalFunctionTraits<Range(Domain), LocalContext, DerivativeTraits, bufferSize>::Concept,
│ │ │ │ -
90 Imp::LocalFunctionTraits<Range(Domain), LocalContext, DerivativeTraits, bufferSize>::template Model>
│ │ │ │ -
91{
│ │ │ │ -
92 using Traits = Imp::LocalFunctionTraits<Range(Domain), LocalContext, DerivativeTraits, bufferSize>;
│ │ │ │ -
93
│ │ │ │ - │ │ │ │ -
95
│ │ │ │ -
96 using DerivativeInterface = typename Traits::DerivativeInterface;
│ │ │ │ -
97
│ │ │ │ -
98public:
│ │ │ │ -
99
│ │ │ │ -
111 template<class F, disableCopyMove<LocalFunction, F> = 0 >
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
113 Base(std::forward<F>(f))
│ │ │ │ -
114 {
│ │ │ │ -
115 static_assert(Dune::Functions::Concept::isLocalFunction<F, Range(Domain), LocalContext>(), "Trying to construct a LocalFunction from type that does not model the LocalFunction concept");
│ │ │ │ -
116 }
│ │ │ │ -
│ │ │ │ -
117
│ │ │ │ -
118 LocalFunction() = default;
│ │ │ │ -
119
│ │ │ │ -
│ │ │ │ -
123 Range operator() (const Domain& x) const
│ │ │ │ -
124 {
│ │ │ │ -
125 return this->asInterface().operator()(x);
│ │ │ │ -
126 }
│ │ │ │ -
│ │ │ │ +
65 using Basis = B;
│ │ │ │ +
66 using LocalView = typename B::LocalView;
│ │ │ │ +
67 using MultiIndex = typename LocalView::MultiIndex;
│ │ │ │ +
68
│ │ │ │ +
69 using LocalFunction = LF;
│ │ │ │ +
70
│ │ │ │ +
71 using Tree = T;
│ │ │ │ +
72
│ │ │ │ +
73 using VectorBackend = HV;
│ │ │ │ +
74 using BitVectorBackend = HBV;
│ │ │ │ +
75
│ │ │ │ +
76 using NodeToRangeEntry = NTRE;
│ │ │ │ +
77
│ │ │ │ +
78 using GridView = typename Basis::GridView;
│ │ │ │ +
79 using Element = typename GridView::template Codim<0>::Entity;
│ │ │ │ +
80
│ │ │ │ +
81 using LocalDomain = typename Element::Geometry::LocalCoordinate;
│ │ │ │ +
82
│ │ │ │ +
83 using GlobalDomain = typename Element::Geometry::GlobalCoordinate;
│ │ │ │ +
84
│ │ │ │ +
85 LocalInterpolateVisitor(const B& /*basis*/, HV& coeff, const HBV& bitVector, const LF& localF, const LocalView& localView, const NodeToRangeEntry& nodeToRangeEntry) :
│ │ │ │ +
86 vector_(coeff),
│ │ │ │ +
87 localF_(localF),
│ │ │ │ +
88 bitVector_(bitVector),
│ │ │ │ +
89 localView_(localView),
│ │ │ │ +
90 nodeToRangeEntry_(nodeToRangeEntry)
│ │ │ │ +
91 {
│ │ │ │ +
92 static_assert(Dune::Functions::Concept::isCallable<LocalFunction, LocalDomain>(), "Function passed to LocalInterpolateVisitor does not model the Callable<LocalCoordinate> concept");
│ │ │ │ +
93 }
│ │ │ │ +
94
│ │ │ │ +
95 template<typename Node, typename TreePath>
│ │ │ │ +
96 void pre(Node&, TreePath)
│ │ │ │ +
97 {}
│ │ │ │ +
98
│ │ │ │ +
99 template<typename Node, typename TreePath>
│ │ │ │ +
100 void post(Node&, TreePath)
│ │ │ │ +
101 {}
│ │ │ │ +
102
│ │ │ │ +
103 template<typename Node, typename TreePath>
│ │ │ │ +
104 void leaf(Node& node, TreePath treePath)
│ │ │ │ +
105 {
│ │ │ │ +
106 using FiniteElement = typename Node::FiniteElement;
│ │ │ │ +
107 using FiniteElementRange = typename FiniteElement::Traits::LocalBasisType::Traits::RangeType;
│ │ │ │ +
108 using FiniteElementRangeField = typename FiniteElement::Traits::LocalBasisType::Traits::RangeFieldType;
│ │ │ │ +
109
│ │ │ │ +
110 auto interpolationCoefficients = std::vector<FiniteElementRangeField>();
│ │ │ │ +
111 auto&& fe = node.finiteElement();
│ │ │ │ +
112
│ │ │ │ +
113 // backward compatibility: for scalar basis functions and possibly vector valued coefficients
│ │ │ │ +
114 // (like used in dune-fufem for power bases) loop over the components
│ │ │ │ +
115 // of the coefficients
│ │ │ │ +
116 if constexpr ( FiniteElement::Traits::LocalBasisType::Traits::dimRange == 1 )
│ │ │ │ +
117 {
│ │ │ │ +
118 // Note that we capture j by reference. Hence we can switch
│ │ │ │ +
119 // the selected component later on by modifying j. Maybe we
│ │ │ │ +
120 // should avoid this naughty statefull lambda hack in favor
│ │ │ │ +
121 // of a separate helper class.
│ │ │ │ +
122 std::size_t j=0;
│ │ │ │ +
123 auto localFj = [&](const LocalDomain& x){
│ │ │ │ +
124 const auto& y = localF_(x);
│ │ │ │ +
125 return FiniteElementRange(flatVectorView(nodeToRangeEntry_(node, treePath, y))[j]);
│ │ │ │ +
126 };
│ │ │ │
127
│ │ │ │ -
│ │ │ │ -
135 friend DerivativeInterface derivative(const LocalFunction& t)
│ │ │ │ -
136 {
│ │ │ │ -
137 return t.asInterface().derivative();
│ │ │ │ -
138 }
│ │ │ │ -
│ │ │ │ -
139
│ │ │ │ -
│ │ │ │ -
146 void bind(const LocalContext& context)
│ │ │ │ -
147 {
│ │ │ │ -
148 this->asInterface().bind(context);
│ │ │ │ -
149 }
│ │ │ │ -
│ │ │ │ -
150
│ │ │ │ -
│ │ │ │ -
154 void unbind()
│ │ │ │ -
155 {
│ │ │ │ -
156 this->asInterface().unbind();
│ │ │ │ -
157 }
│ │ │ │ -
│ │ │ │ -
158
│ │ │ │ -
│ │ │ │ -
161 bool bound() const
│ │ │ │ -
162 {
│ │ │ │ -
163 return this->asInterface().bound();
│ │ │ │ -
164 }
│ │ │ │ -
│ │ │ │ -
165
│ │ │ │ -
│ │ │ │ -
169 const LocalContext& localContext() const
│ │ │ │ -
170 {
│ │ │ │ -
171 return this->asInterface().localContext();
│ │ │ │ -
172 }
│ │ │ │ -
│ │ │ │ -
173};
│ │ │ │ -
│ │ │ │ -
174
│ │ │ │ -
175
│ │ │ │ -
176
│ │ │ │ -
177}} // namespace Dune::Functions
│ │ │ │ +
128 // We loop over j defined above and thus over the components of the
│ │ │ │ +
129 // range type of localF_.
│ │ │ │ +
130
│ │ │ │ +
131 auto blockSize = flatVectorView(vector_[localView_.index(0)]).size();
│ │ │ │ +
132
│ │ │ │ +
133 for(j=0; j<blockSize; ++j)
│ │ │ │ +
134 {
│ │ │ │ +
135 fe.localInterpolation().interpolate(localFj, interpolationCoefficients);
│ │ │ │ +
136 for (size_t i=0; i<fe.localBasis().size(); ++i)
│ │ │ │ +
137 {
│ │ │ │ +
138 auto multiIndex = localView_.index(node.localIndex(i));
│ │ │ │ +
139 auto bitVectorBlock = flatVectorView(bitVector_[multiIndex]);
│ │ │ │ +
140 if (bitVectorBlock[j])
│ │ │ │ +
141 {
│ │ │ │ +
142 auto vectorBlock = flatVectorView(vector_[multiIndex]);
│ │ │ │ +
143 vectorBlock[j] = interpolationCoefficients[i];
│ │ │ │ +
144 }
│ │ │ │ +
145 }
│ │ │ │ +
146 }
│ │ │ │ +
147 }
│ │ │ │ +
148 else // ( FiniteElement::Traits::LocalBasisType::Traits::dimRange != 1 )
│ │ │ │ +
149 {
│ │ │ │ +
150 // for all other finite elements: use the FiniteElementRange directly for the interpolation
│ │ │ │ +
151 auto localF = [&](const LocalDomain& x){
│ │ │ │ +
152 const auto& y = localF_(x);
│ │ │ │ +
153 return FiniteElementRange(nodeToRangeEntry_(node, treePath, y));
│ │ │ │ +
154 };
│ │ │ │ +
155
│ │ │ │ +
156 fe.localInterpolation().interpolate(localF, interpolationCoefficients);
│ │ │ │ +
157 for (size_t i=0; i<fe.localBasis().size(); ++i)
│ │ │ │ +
158 {
│ │ │ │ +
159 auto multiIndex = localView_.index(node.localIndex(i));
│ │ │ │ +
160 if ( bitVector_[multiIndex] )
│ │ │ │ +
161 {
│ │ │ │ +
162 vector_[multiIndex] = interpolationCoefficients[i];
│ │ │ │ +
163 }
│ │ │ │ +
164 }
│ │ │ │ +
165 }
│ │ │ │ +
166 }
│ │ │ │ +
167
│ │ │ │ +
168
│ │ │ │ +
169protected:
│ │ │ │ +
170
│ │ │ │ +
171 VectorBackend& vector_;
│ │ │ │ +
172 const LocalFunction& localF_;
│ │ │ │ +
173 const BitVectorBackend& bitVector_;
│ │ │ │ +
174 const LocalView& localView_;
│ │ │ │ +
175 const NodeToRangeEntry& nodeToRangeEntry_;
│ │ │ │ +
176};
│ │ │ │ +
177
│ │ │ │
178
│ │ │ │ -
179
│ │ │ │ +
179} // namespace Imp
│ │ │ │
180
│ │ │ │ -
181#endif // DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
friend DerivativeInterface derivative(const LocalFunction &t)
Get derivative of wrapped function.
Definition localfunction.hh:135
│ │ │ │ +
181
│ │ │ │ +
182
│ │ │ │ +
183
│ │ │ │ +
201template <class B, class C, class F, class BV, class NTRE>
│ │ │ │ +
│ │ │ │ +
202void interpolate(const B& basis, C&& coeff, const F& f, const BV& bv, const NTRE& nodeToRangeEntry)
│ │ │ │ +
203{
│ │ │ │ +
204 using GridView = typename B::GridView;
│ │ │ │ +
205 using Element = typename GridView::template Codim<0>::Entity;
│ │ │ │ +
206
│ │ │ │ +
207 using Tree = typename B::LocalView::Tree;
│ │ │ │ +
208
│ │ │ │ +
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(sizeInfo(basis));
│ │ │ │ +
236
│ │ │ │ +
237
│ │ │ │ +
238
│ │ │ │ +
239 // Make a grid function supporting local evaluation out of f
│ │ │ │ +
240 auto gf = makeGridViewFunction(f, gridView);
│ │ │ │ +
241
│ │ │ │ +
242 // Obtain a local view of f
│ │ │ │ +
243 auto localF = localFunction(gf);
│ │ │ │ +
244
│ │ │ │ +
245 auto localView = basis.localView();
│ │ │ │ +
246
│ │ │ │ +
247 for (const auto& e : elements(gridView))
│ │ │ │ +
248 {
│ │ │ │ +
249 localView.bind(e);
│ │ │ │ +
250 localF.bind(e);
│ │ │ │ +
251
│ │ │ │ +
252 Imp::LocalInterpolateVisitor<B, Tree, NTRE, decltype(vector), decltype(localF), decltype(bitVector)> localInterpolateVisitor(basis, vector, bitVector, localF, localView, nodeToRangeEntry);
│ │ │ │ +
253 TypeTree::applyToTree(localView.tree(),localInterpolateVisitor);
│ │ │ │ +
254 }
│ │ │ │ +
255}
│ │ │ │ +
│ │ │ │ +
256
│ │ │ │ +
273template <class B, class C, class F, class BV>
│ │ │ │ +
│ │ │ │ +
274void interpolate(const B& basis, C&& coeff, const F& f, const BV& bitVector)
│ │ │ │ +
275{
│ │ │ │ +
276 interpolate(basis, coeff, f, bitVector, HierarchicNodeToRangeMap());
│ │ │ │ +
277}
│ │ │ │ +
│ │ │ │ +
278
│ │ │ │ +
293template <class B, class C, class F>
│ │ │ │ +
│ │ │ │ +
294void interpolate(const B& basis, C&& coeff, const F& f)
│ │ │ │ +
295{
│ │ │ │ +
296 interpolate (basis, coeff, f, Imp::AllTrueBitSetVector(), HierarchicNodeToRangeMap());
│ │ │ │ +
297}
│ │ │ │ +
│ │ │ │ +
298
│ │ │ │ +
299} // namespace Functions
│ │ │ │ +
300} // namespace Dune
│ │ │ │ +
301
│ │ │ │ +
302#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
auto istlVectorBackend(Vector &v)
Return a vector backend wrapping non-const ISTL like containers.
Definition istlvectorbackend.hh:346
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
Definition localfunction.hh:30
│ │ │ │ -
const LocalContext & localContext() const
Obtain local context this LocalFunction is bound to.
Definition localfunction.hh:169
│ │ │ │ -
LocalFunction(F &&f)
Construct from function.
Definition localfunction.hh:112
│ │ │ │ -
void unbind()
Unbind from local context.
Definition localfunction.hh:154
│ │ │ │ -
bool bound() const
Return if the local function is bound to a grid element.
Definition localfunction.hh:161
│ │ │ │ -
void bind(const LocalContext &context)
Bind function to a local context.
Definition localfunction.hh:146
│ │ │ │ - │ │ │ │ -
Base class for type-erased interface wrapper.
Definition typeerasure.hh:165
│ │ │ │ +
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:202
│ │ │ │ +
std::decay< F >::type makeGridViewFunction(F &&f, const GridView &gridView)
Construct a function modeling GridViewFunction from function and grid view.
Definition gridviewfunction.hh:68
│ │ │ │ +
SizeInfo< Basis > sizeInfo(const Basis &basis)
Definition sizeinfo.hh:69
│ │ │ │ +
auto flatVectorView(T &t)
Create flat vector view of passed mutable container.
Definition flatvectorview.hh:179
│ │ │ │ +
A simple node to range map using the nested tree indices.
Definition hierarchicnodetorangemap.hh:30
│ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,188 +1,314 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -localfunction.hh │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7 │ │ │ │ │ -8#include │ │ │ │ │ -9 │ │ │ │ │ -10#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> │ │ │ │ │ -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_._h_h> │ │ │ │ │ -12#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> │ │ │ │ │ -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_e_r_a_s_u_r_e_._h_h> │ │ │ │ │ -14#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> │ │ │ │ │ -15 │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ +8 │ │ │ │ │ +9#include │ │ │ │ │ +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_v_i_e_w_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_/_c_o_m_m_o_n_/_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ │ 16 │ │ │ │ │ -17 │ │ │ │ │ -18namespace _D_u_n_e { │ │ │ │ │ -19namespace Functions { │ │ │ │ │ -20 │ │ │ │ │ -21 │ │ │ │ │ +17#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> │ │ │ │ │ +18#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> │ │ │ │ │ +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_/_s_i_z_e_i_n_f_o_._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_/_f_l_a_t_v_e_c_t_o_r_v_i_e_w_._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_/_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 │ │ │ │ │ -23/* │ │ │ │ │ -24 * Default implementation is empty │ │ │ │ │ -25 * The actual implementation is only given if Signature is an type │ │ │ │ │ -26 * describing a function signature as Range(Domain). │ │ │ │ │ -27 */ │ │ │ │ │ -28template class │ │ │ │ │ -DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56> │ │ │ │ │ -_2_9class _L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ │ -30{}; │ │ │ │ │ -31 │ │ │ │ │ -32 │ │ │ │ │ -33 │ │ │ │ │ -34namespace Imp │ │ │ │ │ -35{ │ │ │ │ │ -36 │ │ │ │ │ -38 template class DerivativeTraits, size_t │ │ │ │ │ -bufferSize> │ │ │ │ │ -39 struct LocalFunctionTraits : │ │ │ │ │ -40 DifferentiableFunctionTraits │ │ │ │ │ -41 { │ │ │ │ │ -42 protected: │ │ │ │ │ -43 using Base=DifferentiableFunctionTraits; │ │ │ │ │ -44 │ │ │ │ │ -45 public: │ │ │ │ │ -47 using LocalContext = L; │ │ │ │ │ +23#include │ │ │ │ │ +24#include │ │ │ │ │ +25 │ │ │ │ │ +26namespace _D_u_n_e { │ │ │ │ │ +27namespace Functions { │ │ │ │ │ +28 │ │ │ │ │ +29namespace Imp { │ │ │ │ │ +30 │ │ │ │ │ +31struct AllTrueBitSetVector │ │ │ │ │ +32{ │ │ │ │ │ +33 struct AllTrueBitSet │ │ │ │ │ +34 { │ │ │ │ │ +35 bool test(int) const { return true; } │ │ │ │ │ +36 } allTrue_; │ │ │ │ │ +37 │ │ │ │ │ +38 operator bool() const │ │ │ │ │ +39 { │ │ │ │ │ +40 return true; │ │ │ │ │ +41 } │ │ │ │ │ +42 │ │ │ │ │ +43 template │ │ │ │ │ +44 const AllTrueBitSetVector& operator[](const I&) const │ │ │ │ │ +45 { │ │ │ │ │ +46 return *this; │ │ │ │ │ +47 } │ │ │ │ │ 48 │ │ │ │ │ -50 using DerivativeSignature = typename Base::DerivativeSignature; │ │ │ │ │ -51 │ │ │ │ │ -53 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_>; │ │ │ │ │ +49 template │ │ │ │ │ +50 void resize(const SP&) const │ │ │ │ │ +51 {} │ │ │ │ │ +52 │ │ │ │ │ +53}; │ │ │ │ │ 54 │ │ │ │ │ -56 using Concept = LocalFunctionWrapperInterface; │ │ │ │ │ -57 │ │ │ │ │ -59 template │ │ │ │ │ -60 using Model = LocalFunctionWrapperImplementation; │ │ │ │ │ -61 }; │ │ │ │ │ -62} │ │ │ │ │ -63 │ │ │ │ │ +55 │ │ │ │ │ +56 │ │ │ │ │ +57template │ │ │ │ │ +58class LocalInterpolateVisitor │ │ │ │ │ +59 : public TypeTree::TreeVisitor │ │ │ │ │ +60 , public TypeTree::DynamicTraversal │ │ │ │ │ +61{ │ │ │ │ │ +62 │ │ │ │ │ +63public: │ │ │ │ │ 64 │ │ │ │ │ -65 │ │ │ │ │ -86template class │ │ │ │ │ -DerivativeTraits, size_t bufferSize> │ │ │ │ │ -_8_7class _L_o_c_a_l_F_u_n_c_t_i_o_n< Range(Domain), LocalContext, DerivativeTraits, │ │ │ │ │ -bufferSize> : │ │ │ │ │ -88 public _T_y_p_e_E_r_a_s_u_r_e_B_a_s_e< │ │ │ │ │ -89 typename Imp::LocalFunctionTraits::Concept, │ │ │ │ │ -90 Imp::LocalFunctionTraits::template Model> │ │ │ │ │ -91{ │ │ │ │ │ -92 using Traits = Imp::LocalFunctionTraits; │ │ │ │ │ -93 │ │ │ │ │ -94 using _B_a_s_e = _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_>; │ │ │ │ │ -95 │ │ │ │ │ -96 using DerivativeInterface = typename _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; │ │ │ │ │ -97 │ │ │ │ │ -98public: │ │ │ │ │ -99 │ │ │ │ │ -111 template = 0 > │ │ │ │ │ -_1_1_2 _L_o_c_a_l_F_u_n_c_t_i_o_n(F&& f) : │ │ │ │ │ -113 _B_a_s_e(std::forward(f)) │ │ │ │ │ -114 { │ │ │ │ │ -115 static_assert(Dune::Functions::Concept::isLocalFunction(), "Trying to construct a LocalFunction from type that does not │ │ │ │ │ -model the LocalFunction concept"); │ │ │ │ │ -116 } │ │ │ │ │ -117 │ │ │ │ │ -_1_1_8 _L_o_c_a_l_F_u_n_c_t_i_o_n() = default; │ │ │ │ │ -119 │ │ │ │ │ -_1_2_3 Range operator() (const Domain& x) const │ │ │ │ │ -124 { │ │ │ │ │ -125 return this->asInterface().operator()(x); │ │ │ │ │ -126 } │ │ │ │ │ +65 using Basis = B; │ │ │ │ │ +66 using LocalView = typename B::LocalView; │ │ │ │ │ +67 using MultiIndex = typename LocalView::MultiIndex; │ │ │ │ │ +68 │ │ │ │ │ +69 using LocalFunction = LF; │ │ │ │ │ +70 │ │ │ │ │ +71 using Tree = T; │ │ │ │ │ +72 │ │ │ │ │ +73 using VectorBackend = HV; │ │ │ │ │ +74 using BitVectorBackend = HBV; │ │ │ │ │ +75 │ │ │ │ │ +76 using NodeToRangeEntry = NTRE; │ │ │ │ │ +77 │ │ │ │ │ +78 using GridView = typename Basis::GridView; │ │ │ │ │ +79 using Element = typename GridView::template Codim<0>::Entity; │ │ │ │ │ +80 │ │ │ │ │ +81 using LocalDomain = typename Element::Geometry::LocalCoordinate; │ │ │ │ │ +82 │ │ │ │ │ +83 using GlobalDomain = typename Element::Geometry::GlobalCoordinate; │ │ │ │ │ +84 │ │ │ │ │ +85 LocalInterpolateVisitor(const B& /*basis*/, HV& coeff, const HBV& bitVector, │ │ │ │ │ +const LF& localF, const LocalView& localView, const NodeToRangeEntry& │ │ │ │ │ +nodeToRangeEntry) : │ │ │ │ │ +86 vector_(coeff), │ │ │ │ │ +87 localF_(localF), │ │ │ │ │ +88 bitVector_(bitVector), │ │ │ │ │ +89 localView_(localView), │ │ │ │ │ +90 nodeToRangeEntry_(nodeToRangeEntry) │ │ │ │ │ +91 { │ │ │ │ │ +92 static_assert(Dune::Functions::Concept::isCallable(), "Function passed to LocalInterpolateVisitor does not model the │ │ │ │ │ +Callable concept"); │ │ │ │ │ +93 } │ │ │ │ │ +94 │ │ │ │ │ +95 template │ │ │ │ │ +96 void pre(Node&, TreePath) │ │ │ │ │ +97 {} │ │ │ │ │ +98 │ │ │ │ │ +99 template │ │ │ │ │ +100 void post(Node&, TreePath) │ │ │ │ │ +101 {} │ │ │ │ │ +102 │ │ │ │ │ +103 template │ │ │ │ │ +104 void leaf(Node& node, TreePath treePath) │ │ │ │ │ +105 { │ │ │ │ │ +106 using FiniteElement = typename Node::FiniteElement; │ │ │ │ │ +107 using FiniteElementRange = typename FiniteElement::Traits::LocalBasisType:: │ │ │ │ │ +Traits::RangeType; │ │ │ │ │ +108 using FiniteElementRangeField = typename FiniteElement::Traits:: │ │ │ │ │ +LocalBasisType::Traits::RangeFieldType; │ │ │ │ │ +109 │ │ │ │ │ +110 auto interpolationCoefficients = std::vector(); │ │ │ │ │ +111 auto&& fe = node.finiteElement(); │ │ │ │ │ +112 │ │ │ │ │ +113 // backward compatibility: for scalar basis functions and possibly vector │ │ │ │ │ +valued coefficients │ │ │ │ │ +114 // (like used in dune-fufem for power bases) loop over the components │ │ │ │ │ +115 // of the coefficients │ │ │ │ │ +116 if constexpr ( FiniteElement::Traits::LocalBasisType::Traits::dimRange == 1 │ │ │ │ │ +) │ │ │ │ │ +117 { │ │ │ │ │ +118 // Note that we capture j by reference. Hence we can switch │ │ │ │ │ +119 // the selected component later on by modifying j. Maybe we │ │ │ │ │ +120 // should avoid this naughty statefull lambda hack in favor │ │ │ │ │ +121 // of a separate helper class. │ │ │ │ │ +122 std::size_t j=0; │ │ │ │ │ +123 auto localFj = [&](const LocalDomain& x){ │ │ │ │ │ +124 const auto& y = localF_(x); │ │ │ │ │ +125 return FiniteElementRange(_f_l_a_t_V_e_c_t_o_r_V_i_e_w(nodeToRangeEntry_(node, treePath, │ │ │ │ │ +y))[j]); │ │ │ │ │ +126 }; │ │ │ │ │ 127 │ │ │ │ │ -_1_3_5 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) │ │ │ │ │ -136 { │ │ │ │ │ -137 return t.asInterface().derivative(); │ │ │ │ │ -138 } │ │ │ │ │ -139 │ │ │ │ │ -_1_4_6 void _b_i_n_d(const LocalContext& context) │ │ │ │ │ -147 { │ │ │ │ │ -148 this->asInterface().bind(context); │ │ │ │ │ -149 } │ │ │ │ │ -150 │ │ │ │ │ -_1_5_4 void _u_n_b_i_n_d() │ │ │ │ │ -155 { │ │ │ │ │ -156 this->asInterface().unbind(); │ │ │ │ │ -157 } │ │ │ │ │ -158 │ │ │ │ │ -_1_6_1 bool _b_o_u_n_d() const │ │ │ │ │ -162 { │ │ │ │ │ -163 return this->asInterface().bound(); │ │ │ │ │ +128 // We loop over j defined above and thus over the components of the │ │ │ │ │ +129 // range type of localF_. │ │ │ │ │ +130 │ │ │ │ │ +131 auto blockSize = _f_l_a_t_V_e_c_t_o_r_V_i_e_w(vector_[localView_.index(0)]).size(); │ │ │ │ │ +132 │ │ │ │ │ +133 for(j=0; jasInterface().localContext(); │ │ │ │ │ -172 } │ │ │ │ │ -173}; │ │ │ │ │ -174 │ │ │ │ │ -175 │ │ │ │ │ -176 │ │ │ │ │ -177}} // namespace Dune::Functions │ │ │ │ │ +165 } │ │ │ │ │ +166 } │ │ │ │ │ +167 │ │ │ │ │ +168 │ │ │ │ │ +169protected: │ │ │ │ │ +170 │ │ │ │ │ +171 VectorBackend& vector_; │ │ │ │ │ +172 const LocalFunction& localF_; │ │ │ │ │ +173 const BitVectorBackend& bitVector_; │ │ │ │ │ +174 const LocalView& localView_; │ │ │ │ │ +175 const NodeToRangeEntry& nodeToRangeEntry_; │ │ │ │ │ +176}; │ │ │ │ │ +177 │ │ │ │ │ 178 │ │ │ │ │ -179 │ │ │ │ │ +179} // namespace Imp │ │ │ │ │ 180 │ │ │ │ │ -181#endif // DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_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 │ │ │ │ │ +181 │ │ │ │ │ +182 │ │ │ │ │ +183 │ │ │ │ │ +201template │ │ │ │ │ +_2_0_2void _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) │ │ │ │ │ +203{ │ │ │ │ │ +204 using GridView = typename B::GridView; │ │ │ │ │ +205 using Element = typename GridView::template Codim<0>::Entity; │ │ │ │ │ +206 │ │ │ │ │ +207 using Tree = typename B::LocalView::Tree; │ │ │ │ │ +208 │ │ │ │ │ +209 using GlobalDomain = typename Element::Geometry::GlobalCoordinate; │ │ │ │ │ +210 │ │ │ │ │ +211 static_assert(Dune::Functions::Concept::isCallable(), │ │ │ │ │ +"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(_s_i_z_e_I_n_f_o(basis)); │ │ │ │ │ +236 │ │ │ │ │ +237 │ │ │ │ │ +238 │ │ │ │ │ +239 // Make a grid function supporting local evaluation out of f │ │ │ │ │ +240 auto gf = _m_a_k_e_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n(f, gridView); │ │ │ │ │ +241 │ │ │ │ │ +242 // Obtain a local view of f │ │ │ │ │ +243 auto localF = localFunction(gf); │ │ │ │ │ +244 │ │ │ │ │ +245 auto localView = basis.localView(); │ │ │ │ │ +246 │ │ │ │ │ +247 for (const auto& e : elements(gridView)) │ │ │ │ │ +248 { │ │ │ │ │ +249 localView.bind(e); │ │ │ │ │ +250 localF.bind(e); │ │ │ │ │ +251 │ │ │ │ │ +252 Imp::LocalInterpolateVisitor localInterpolateVisitor(basis, vector, │ │ │ │ │ +bitVector, localF, localView, nodeToRangeEntry); │ │ │ │ │ +253 TypeTree::applyToTree(localView.tree(),localInterpolateVisitor); │ │ │ │ │ +254 } │ │ │ │ │ +255} │ │ │ │ │ +256 │ │ │ │ │ +273template │ │ │ │ │ +_2_7_4void _i_n_t_e_r_p_o_l_a_t_e(const B& basis, C&& coeff, const F& f, const BV& bitVector) │ │ │ │ │ +275{ │ │ │ │ │ +276 _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()); │ │ │ │ │ +277} │ │ │ │ │ +278 │ │ │ │ │ +293template │ │ │ │ │ +_2_9_4void _i_n_t_e_r_p_o_l_a_t_e(const B& basis, C&& coeff, const F& f) │ │ │ │ │ +295{ │ │ │ │ │ +296 _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()); │ │ │ │ │ +297} │ │ │ │ │ +298 │ │ │ │ │ +299} // namespace Functions │ │ │ │ │ +300} // namespace Dune │ │ │ │ │ +301 │ │ │ │ │ +302#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH │ │ │ │ │ +_g_r_i_d_v_i_e_w_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 │ │ │ │ │ -_l_o_c_a_l_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_:_:_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:135 │ │ │ │ │ +_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 │ │ │ │ │ +_s_i_z_e_i_n_f_o_._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_:_:_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:346 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:30 │ │ │ │ │ -_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:169 │ │ │ │ │ -_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:112 │ │ │ │ │ -_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:154 │ │ │ │ │ -_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:161 │ │ │ │ │ -_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:146 │ │ │ │ │ -_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 │ │ │ │ │ -Base class for type-erased interface wrapper. │ │ │ │ │ -DDeeffiinniittiioonn typeerasure.hh:165 │ │ │ │ │ +_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:202 │ │ │ │ │ +_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< F >::type makeGridViewFunction(F &&f, const GridView &gridView) │ │ │ │ │ +Construct a function modeling GridViewFunction from function and grid view. │ │ │ │ │ +DDeeffiinniittiioonn gridviewfunction.hh:68 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_s_i_z_e_I_n_f_o │ │ │ │ │ +SizeInfo< Basis > sizeInfo(const Basis &basis) │ │ │ │ │ +DDeeffiinniittiioonn sizeinfo.hh:69 │ │ │ │ │ +_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:179 │ │ │ │ │ +_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:30 │ │ │ │ │ +_c_o_n_c_e_p_t_s_._h_h │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00140.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: signature.hh File Reference │ │ │ │ +dune-functions: flatmultiindex.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,57 +65,42 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ Namespaces | │ │ │ │ -Functions
│ │ │ │ -
signature.hh File Reference
│ │ │ │ +Typedefs
│ │ │ │ +
flatmultiindex.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <type_traits>
│ │ │ │ -#include <tuple>
│ │ │ │ -#include <dune/functions/common/defaultderivativetraits.hh>
│ │ │ │ +
#include <array>
│ │ │ │ +#include <dune/functions/common/multiindex.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...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

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

│ │ │ │ -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 size_type >
using Dune::Functions::FlatMultiIndex = StaticMultiIndex< size_type, 1 >
 A multi-index class with only one level.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,40 +1,24 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -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> │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +_N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s │ │ │ │ │ +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> │ │ │ │ │ _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_._._. │ │ │ │ │ -  │ │ │ │ │ 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. │ │ │ │ │ +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< size_type, 1 > │ │ │ │ │ +  A multi-index class with only one level. │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00140_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: signature.hh Source File │ │ │ │ +dune-functions: flatmultiindex.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,168 +70,48 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
signature.hh
│ │ │ │ +
flatmultiindex.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#ifndef DUNE_FUNCTIONS_COMMON_SIGNATURE_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_COMMON_SIGNATURE_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH
│ │ │ │
5
│ │ │ │ -
6#include <type_traits>
│ │ │ │ -
7#include <tuple>
│ │ │ │ -
8
│ │ │ │ - │ │ │ │ -
10
│ │ │ │ -
11namespace Dune {
│ │ │ │ -
12namespace Functions {
│ │ │ │ +
6#include <array>
│ │ │ │ +
7
│ │ │ │ + │ │ │ │ +
9
│ │ │ │ +
10namespace Dune {
│ │ │ │ +
11namespace Functions {
│ │ │ │ +
12
│ │ │ │
13
│ │ │ │ -
19template<typename F>
│ │ │ │ - │ │ │ │ -
21
│ │ │ │ -
22#ifndef DOXYGEN
│ │ │ │ -
23template<typename F>
│ │ │ │ -
24struct IsCallable
│ │ │ │ -
25{
│ │ │ │ -
26 struct yes { std::size_t dummy[2]; };
│ │ │ │ -
27 struct no { std::size_t dummy[1]; };
│ │ │ │ -
28
│ │ │ │ -
29 template<typename C>
│ │ │ │ -
30 static yes test(const decltype(&C::operator()) *);
│ │ │ │ -
31 template<typename C>
│ │ │ │ -
32 static no test(...);
│ │ │ │ +
14
│ │ │ │ +
30template<class size_type>
│ │ │ │ + │ │ │ │ +
32
│ │ │ │
33
│ │ │ │ -
34 enum { value = (sizeof(test<F>(0)) == sizeof(yes)) };
│ │ │ │ -
35};
│ │ │ │ -
36
│ │ │ │ -
37template<typename R, typename D>
│ │ │ │ -
38struct IsCallable<R(D)>
│ │ │ │ -
39{
│ │ │ │ -
40 enum { value = true };
│ │ │ │ -
41};
│ │ │ │ -
42
│ │ │ │ -
43template<typename R, typename D>
│ │ │ │ -
44struct IsCallable<R(*)(D)>
│ │ │ │ -
45{
│ │ │ │ -
46 enum { value = true };
│ │ │ │ -
47};
│ │ │ │ -
48#endif
│ │ │ │ -
49
│ │ │ │ -
55template<class Signature, bool isCallable = IsCallable<Signature>::value >
│ │ │ │ - │ │ │ │ -
57
│ │ │ │ -
58#ifndef DOXYGEN
│ │ │ │ -
60template<class T>
│ │ │ │ -
61struct SignatureTraits<T, true>
│ │ │ │ -
62 : public SignatureTraits<decltype(&T::operator()), true>
│ │ │ │ -
63{};
│ │ │ │ -
64
│ │ │ │ -
66template <typename C, typename R, typename D>
│ │ │ │ -
67struct SignatureTraits<R(C::*)(D) const, true>
│ │ │ │ -
68 : public SignatureTraits<R(D), true>
│ │ │ │ -
69{};
│ │ │ │ -
70
│ │ │ │ -
72template <typename C, typename R, typename D>
│ │ │ │ -
73struct SignatureTraits<R(C::*)(D), true>
│ │ │ │ -
74 : public SignatureTraits<R(D), true>
│ │ │ │ -
75{};
│ │ │ │ -
76
│ │ │ │ -
78template <typename R, typename D>
│ │ │ │ -
79struct SignatureTraits<R(*)(D), true>
│ │ │ │ -
80 : public SignatureTraits<R(D), true>
│ │ │ │ -
81{};
│ │ │ │ -
82
│ │ │ │ -
84template<class R, class D>
│ │ │ │ -
85struct SignatureTraits<R(D), true>
│ │ │ │ -
86{
│ │ │ │ -
87 using Range = R;
│ │ │ │ -
88 using Domain = D;
│ │ │ │ -
89
│ │ │ │ -
90 using RawRange = typename std::decay<Range>::type;
│ │ │ │ -
91 using RawDomain = typename std::decay<Domain>::type;
│ │ │ │ -
92
│ │ │ │ -
93 using RawSignature = RawRange(RawDomain);
│ │ │ │ -
94
│ │ │ │ -
95 template<template<class> class DerivativeTraits=DefaultDerivativeTraits>
│ │ │ │ -
96 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(Domain);
│ │ │ │ -
97};
│ │ │ │ -
98#endif
│ │ │ │ -
99
│ │ │ │ -
100
│ │ │ │ -
101template<class Signature, template<class> class DerivativeTraits=DefaultDerivativeTraits>
│ │ │ │ - │ │ │ │ -
103
│ │ │ │ -
113template<class Range, class Domain, template<class> class DerivativeTraitsT>
│ │ │ │ -
│ │ │ │ -
114struct SignatureTag<Range(Domain), DerivativeTraitsT>
│ │ │ │ -
115{
│ │ │ │ -
116 using Signature = Range(Domain);
│ │ │ │ -
117
│ │ │ │ -
118 template<class T>
│ │ │ │ -
119 using DerivativeTraits = DerivativeTraitsT<T>;
│ │ │ │ -
120};
│ │ │ │ -
│ │ │ │ -
121
│ │ │ │ -
122
│ │ │ │ -
123
│ │ │ │ -
132template<class Range, class Domain, template<class> class DerivativeTraits>
│ │ │ │ -
│ │ │ │ -
133auto derivativeSignatureTag(SignatureTag<Range(Domain), DerivativeTraits> tag)
│ │ │ │ -
134{
│ │ │ │ -
135 using DerivativeRange = typename DerivativeTraits<Range(Domain)>::Range;
│ │ │ │ - │ │ │ │ -
137}
│ │ │ │ -
│ │ │ │ -
138
│ │ │ │ -
139
│ │ │ │ -
140
│ │ │ │ -
154template<std::size_t maxOrder, class Signature, template<class> class DerivativeTraits>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
156{
│ │ │ │ -
157 if constexpr (maxOrder==0) {
│ │ │ │ -
158 // If maxOrder== 0 we just need the given SignatureTag
│ │ │ │ -
159 return std::make_tuple(tag);
│ │ │ │ -
160 } else {
│ │ │ │ -
161 // else we first construct the tail tuple with SignatureTags for derivatives
│ │ │ │ -
162 // of order 1 to maxOrder
│ │ │ │ -
163 auto tailTagsTuple = derivativeSignatureTags<std::size_t(maxOrder-1)>(derivativeSignatureTag(tag));
│ │ │ │ -
164 // and prepend this with the given SignatureTag.
│ │ │ │ -
165 // This is done by unpacking the tail tuple with apply().
│ │ │ │ -
166 return std::apply([&](auto&&... tailTags){
│ │ │ │ -
167 return std::make_tuple(tag, tailTags...);
│ │ │ │ -
168 }, tailTagsTuple);
│ │ │ │ -
169 }
│ │ │ │ -
170}
│ │ │ │ -
│ │ │ │ -
171
│ │ │ │ -
172
│ │ │ │ -
173
│ │ │ │ -
174} // namespace Functions
│ │ │ │ -
175} // namespace Dune
│ │ │ │ -
176
│ │ │ │ -
177#endif // DUNE_FUNCTIONS_COMMON_SIGNATURE_HH
│ │ │ │ - │ │ │ │ -
auto derivativeSignatureTag(SignatureTag< Range(Domain), DerivativeTraits > tag)
Construct SignatureTag for derivative.
Definition signature.hh:133
│ │ │ │ -
auto derivativeSignatureTags(Dune::Functions::SignatureTag< Signature, DerivativeTraits > tag)
Construct SignatureTags for derivatives.
Definition signature.hh:155
│ │ │ │ +
34
│ │ │ │ +
35} // end namespace Functions
│ │ │ │ +
36} // end namespace Dune
│ │ │ │ +
37
│ │ │ │ +
38#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH
│ │ │ │ + │ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
Helper class to check that F is callable.
Definition signature.hh:20
│ │ │ │ -
Helper class to deduce the signature of a callable.
Definition signature.hh:56
│ │ │ │ -
Definition signature.hh:102
│ │ │ │ -
DerivativeTraitsT< T > DerivativeTraits
Definition signature.hh:119
│ │ │ │ - │ │ │ │ +
A statically sized MultiIndex type.
Definition multiindex.hh:25
│ │ │ │ +
A statically sized MultiIndex type.
Definition multiindex.hh:49
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,178 +1,43 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -signature.hh │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +flatmultiindex.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#ifndef DUNE_FUNCTIONS_COMMON_SIGNATURE_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_COMMON_SIGNATURE_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ -8 │ │ │ │ │ -9#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> │ │ │ │ │ -10 │ │ │ │ │ -11namespace _D_u_n_e { │ │ │ │ │ -12namespace Functions { │ │ │ │ │ +6#include │ │ │ │ │ +7 │ │ │ │ │ +8#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> │ │ │ │ │ +9 │ │ │ │ │ +10namespace _D_u_n_e { │ │ │ │ │ +11namespace Functions { │ │ │ │ │ +12 │ │ │ │ │ 13 │ │ │ │ │ -19template │ │ │ │ │ -_2_0struct _I_s_C_a_l_l_a_b_l_e; │ │ │ │ │ -21 │ │ │ │ │ -22#ifndef DOXYGEN │ │ │ │ │ -23template │ │ │ │ │ -24struct _I_s_C_a_l_l_a_b_l_e │ │ │ │ │ -25{ │ │ │ │ │ -26 struct yes { std::size_t dummy[2]; }; │ │ │ │ │ -27 struct no { std::size_t dummy[1]; }; │ │ │ │ │ -28 │ │ │ │ │ -29 template │ │ │ │ │ -30 static yes test(const decltype(&C::operator()) *); │ │ │ │ │ -31 template │ │ │ │ │ -32 static no test(...); │ │ │ │ │ +14 │ │ │ │ │ +30template │ │ │ │ │ +_3_1using _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_>; │ │ │ │ │ +32 │ │ │ │ │ 33 │ │ │ │ │ -34 enum { value = (sizeof(test(0)) == sizeof(yes)) }; │ │ │ │ │ -35}; │ │ │ │ │ -36 │ │ │ │ │ -37template │ │ │ │ │ -38struct IsCallable │ │ │ │ │ -39{ │ │ │ │ │ -40 enum { value = true }; │ │ │ │ │ -41}; │ │ │ │ │ -42 │ │ │ │ │ -43template │ │ │ │ │ -44struct IsCallable │ │ │ │ │ -45{ │ │ │ │ │ -46 enum { value = true }; │ │ │ │ │ -47}; │ │ │ │ │ -48#endif │ │ │ │ │ -49 │ │ │ │ │ -55template::value > │ │ │ │ │ -_5_6struct _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s {}; │ │ │ │ │ -57 │ │ │ │ │ -58#ifndef DOXYGEN │ │ │ │ │ -60template │ │ │ │ │ -61struct _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s │ │ │ │ │ -62 : public _S_i_g_n_a_t_u_r_e_T_r_a_i_t_s │ │ │ │ │ -63{}; │ │ │ │ │ -64 │ │ │ │ │ -66template │ │ │ │ │ -67struct SignatureTraits │ │ │ │ │ -68 : public SignatureTraits │ │ │ │ │ -69{}; │ │ │ │ │ -70 │ │ │ │ │ -72template │ │ │ │ │ -73struct SignatureTraits │ │ │ │ │ -74 : public SignatureTraits │ │ │ │ │ -75{}; │ │ │ │ │ -76 │ │ │ │ │ -78template │ │ │ │ │ -79struct SignatureTraits │ │ │ │ │ -80 : public SignatureTraits │ │ │ │ │ -81{}; │ │ │ │ │ -82 │ │ │ │ │ -84template │ │ │ │ │ -85struct SignatureTraits │ │ │ │ │ -86{ │ │ │ │ │ -87 using Range = R; │ │ │ │ │ -88 using Domain = D; │ │ │ │ │ -89 │ │ │ │ │ -90 using RawRange = typename std::decay::type; │ │ │ │ │ -91 using RawDomain = typename std::decay::type; │ │ │ │ │ -92 │ │ │ │ │ -93 using RawSignature = RawRange(RawDomain); │ │ │ │ │ -94 │ │ │ │ │ -95 template class DerivativeTraits=DefaultDerivativeTraits> │ │ │ │ │ -96 using DerivativeSignature = typename DerivativeTraits::Range │ │ │ │ │ -(Domain); │ │ │ │ │ -97}; │ │ │ │ │ -98#endif │ │ │ │ │ -99 │ │ │ │ │ -100 │ │ │ │ │ -101template class │ │ │ │ │ -DerivativeTraits=DefaultDerivativeTraits> │ │ │ │ │ -_1_0_2struct _S_i_g_n_a_t_u_r_e_T_a_g; │ │ │ │ │ -103 │ │ │ │ │ -113template class DerivativeTraitsT> │ │ │ │ │ -_1_1_4struct _S_i_g_n_a_t_u_r_e_T_a_g │ │ │ │ │ -115{ │ │ │ │ │ -_1_1_6 using _S_i_g_n_a_t_u_r_e = Range(Domain); │ │ │ │ │ -117 │ │ │ │ │ -118 template │ │ │ │ │ -_1_1_9 using _D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s = DerivativeTraitsT; │ │ │ │ │ -120}; │ │ │ │ │ -121 │ │ │ │ │ -122 │ │ │ │ │ -123 │ │ │ │ │ -132template class DerivativeTraits> │ │ │ │ │ -_1_3_3auto _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) │ │ │ │ │ -134{ │ │ │ │ │ -135 using DerivativeRange = typename DerivativeTraits::Range; │ │ │ │ │ -136 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_>(); │ │ │ │ │ -137} │ │ │ │ │ -138 │ │ │ │ │ -139 │ │ │ │ │ -140 │ │ │ │ │ -154template class │ │ │ │ │ -DerivativeTraits> │ │ │ │ │ -_1_5_5auto _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) │ │ │ │ │ -156{ │ │ │ │ │ -157 if constexpr (maxOrder==0) { │ │ │ │ │ -158 // If maxOrder== 0 we just need the given SignatureTag │ │ │ │ │ -159 return std::make_tuple(tag); │ │ │ │ │ -160 } else { │ │ │ │ │ -161 // else we first construct the tail tuple with SignatureTags for │ │ │ │ │ -derivatives │ │ │ │ │ -162 // of order 1 to maxOrder │ │ │ │ │ -163 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)); │ │ │ │ │ -164 // and prepend this with the given SignatureTag. │ │ │ │ │ -165 // This is done by unpacking the tail tuple with apply(). │ │ │ │ │ -166 return std::apply([&](auto&&... tailTags){ │ │ │ │ │ -167 return std::make_tuple(tag, tailTags...); │ │ │ │ │ -168 }, tailTagsTuple); │ │ │ │ │ -169 } │ │ │ │ │ -170} │ │ │ │ │ -171 │ │ │ │ │ -172 │ │ │ │ │ -173 │ │ │ │ │ -174} // namespace Functions │ │ │ │ │ -175} // namespace Dune │ │ │ │ │ -176 │ │ │ │ │ -177#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:133 │ │ │ │ │ -_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:155 │ │ │ │ │ +34 │ │ │ │ │ +35} // end namespace Functions │ │ │ │ │ +36} // end namespace Dune │ │ │ │ │ +37 │ │ │ │ │ +38#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH │ │ │ │ │ +_m_u_l_t_i_i_n_d_e_x_._h_h │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:20 │ │ │ │ │ -_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:56 │ │ │ │ │ -_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:102 │ │ │ │ │ -_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:119 │ │ │ │ │ -_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:116 │ │ │ │ │ +_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:25 │ │ │ │ │ +_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. │ │ │ │ │ +DDeeffiinniittiioonn multiindex.hh:49 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00143.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: functionconcepts.hh File Reference │ │ │ │ +dune-functions: raviartthomasbasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,129 +65,75 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces | │ │ │ │ +Typedefs | │ │ │ │ Functions
│ │ │ │ -
functionconcepts.hh File Reference
│ │ │ │ +
raviartthomasbasis.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>
│ │ │ │ +
#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>
│ │ │ │
│ │ │ │

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...
class  Dune::Functions::RaviartThomasPreBasis< GV, k >
 
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...
class  Dune::Functions::RaviartThomasNode< GV, k >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::Functions
 
namespace  Dune::Functions::Concept
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<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<std::size_t k>
auto Dune::Functions::BasisFactory::raviartThomas ()
 Create a pre-basis factory that can create a Raviart-Thomas pre-basis.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,136 +1,52 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -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> │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +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> │ │ │ │ │ _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_._._. │ │ │ │ │ +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_ _> │ │ │ │ │   │ │ │ │ │ -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 Concept::GridFunction _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_._._. │ │ │ │ │ +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_:_:_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_:_:_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< GV, k > > │ │ │ │ │ +  Basis of a k-th-order Raviart Thomas finite element space. │ │ │ │ │   │ │ │ │ │ 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_:_:_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. │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00143_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: functionconcepts.hh Source File │ │ │ │ +dune-functions: raviartthomasbasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,370 +70,482 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
functionconcepts.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#ifndef DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH
│ │ │ │
5
│ │ │ │ -
6#include <dune/common/typelist.hh>
│ │ │ │ -
7#include <dune/common/concept.hh>
│ │ │ │ +
6#include <array>
│ │ │ │ +
7#include <dune/common/exceptions.hh>
│ │ │ │
8
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
12
│ │ │ │ -
13namespace Dune {
│ │ │ │ -
14namespace Functions {
│ │ │ │ -
15namespace Concept {
│ │ │ │ -
16
│ │ │ │ -
17using namespace Dune::Concept;
│ │ │ │ -
18
│ │ │ │ -
19
│ │ │ │ -
20
│ │ │ │ -
21// Callable concept ############################################################
│ │ │ │ +
9#include <dune/grid/common/capabilities.hh>
│ │ │ │ +
10#include <dune/grid/common/mcmgmapper.hh>
│ │ │ │ +
11
│ │ │ │ +
12#include <dune/localfunctions/common/localfiniteelementvariant.hh>
│ │ │ │ +
13#include <dune/localfunctions/raviartthomas.hh>
│ │ │ │ +
14#include <dune/localfunctions/raviartthomas/raviartthomas0cube2d.hh>
│ │ │ │ +
15#include <dune/localfunctions/raviartthomas/raviartthomas0cube3d.hh>
│ │ │ │ +
16#include <dune/localfunctions/raviartthomas/raviartthomas02d.hh>
│ │ │ │ +
17#include <dune/localfunctions/raviartthomas/raviartthomas03d.hh>
│ │ │ │ +
18#include <dune/localfunctions/raviartthomas/raviartthomas1cube2d.hh>
│ │ │ │ +
19#include <dune/localfunctions/raviartthomas/raviartthomas1cube3d.hh>
│ │ │ │ +
20#include <dune/localfunctions/raviartthomas/raviartthomas12d.hh>
│ │ │ │ +
21#include <dune/localfunctions/raviartthomas/raviartthomas2cube2d.hh>
│ │ │ │
22
│ │ │ │ -
23
│ │ │ │ -
31template<class... Args>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
33{
│ │ │ │ -
34 template<class F>
│ │ │ │ -
35 auto require(F&& f) -> decltype(
│ │ │ │ -
36 f(std::declval<Args>()...)
│ │ │ │ -
37 );
│ │ │ │ -
38};
│ │ │ │ -
│ │ │ │ -
39
│ │ │ │ -
46template<class F, class... Args>
│ │ │ │ -
│ │ │ │ -
47static constexpr auto isCallable()
│ │ │ │ -
48{ return models<Concept::Callable<Args...>, F>(); }
│ │ │ │ -
│ │ │ │ -
49
│ │ │ │ -
56template<class F, class... Args>
│ │ │ │ -
│ │ │ │ -
57static constexpr auto isCallable(F&&, Args&&...)
│ │ │ │ -
58{
│ │ │ │ -
59 return models<Concept::Callable<Args&&...>, F>();
│ │ │ │ -
60}
│ │ │ │ -
│ │ │ │ -
61
│ │ │ │ -
62
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
26
│ │ │ │ +
27namespace Dune {
│ │ │ │ +
28namespace Functions {
│ │ │ │ +
29
│ │ │ │ +
30namespace Impl {
│ │ │ │ +
31
│ │ │ │ +
32 template<int dim, typename D, typename R, std::size_t k>
│ │ │ │ +
33 struct RaviartThomasSimplexLocalInfo
│ │ │ │ +
34 {
│ │ │ │ +
35 // Dummy type, must be something that we can have a std::unique_ptr to
│ │ │ │ +
36 using FiniteElement = void*;
│ │ │ │ +
37 };
│ │ │ │ +
38
│ │ │ │ +
39 template<typename D, typename R>
│ │ │ │ +
40 struct RaviartThomasSimplexLocalInfo<2,D,R,0>
│ │ │ │ +
41 {
│ │ │ │ +
42 using FiniteElement = RT02DLocalFiniteElement<D,R>;
│ │ │ │ +
43 };
│ │ │ │ +
44
│ │ │ │ +
45 template<typename D, typename R>
│ │ │ │ +
46 struct RaviartThomasSimplexLocalInfo<2,D,R,1>
│ │ │ │ +
47 {
│ │ │ │ +
48 using FiniteElement = RT12DLocalFiniteElement<D,R>;
│ │ │ │ +
49 };
│ │ │ │ +
50
│ │ │ │ +
51 template<typename D, typename R>
│ │ │ │ +
52 struct RaviartThomasSimplexLocalInfo<3,D,R,0>
│ │ │ │ +
53 {
│ │ │ │ +
54 using FiniteElement = RT03DLocalFiniteElement<D,R>;
│ │ │ │ +
55 };
│ │ │ │ +
56
│ │ │ │ +
57 template<int dim, typename D, typename R, std::size_t k>
│ │ │ │ +
58 struct RaviartThomasCubeLocalInfo
│ │ │ │ +
59 {
│ │ │ │ +
60 // Dummy type, must be something that we can have a std::unique_ptr to
│ │ │ │ +
61 using FiniteElement = void*;
│ │ │ │ +
62 };
│ │ │ │
63
│ │ │ │ -
64// Function concept ############################################################
│ │ │ │ -
65template<class Signature>
│ │ │ │ -
66struct Function;
│ │ │ │ -
67
│ │ │ │ -
76template<class Range, class Domain>
│ │ │ │ -
│ │ │ │ -
77struct Function<Range(Domain)> : Refines<Callable<Domain> >
│ │ │ │ -
78{
│ │ │ │ -
79 template<class F>
│ │ │ │ -
80 auto require(F&& f) -> decltype(
│ │ │ │ -
81 // F models Function<Range(Domain)> if the result of F(Domain) is implicitly convertible to Range
│ │ │ │ -
82 requireConvertible<Range>(f(std::declval<Domain>()))
│ │ │ │ -
83 );
│ │ │ │ -
84};
│ │ │ │ -
│ │ │ │ -
85
│ │ │ │ -
87template<class F, class Signature>
│ │ │ │ -
│ │ │ │ -
88static constexpr bool isFunction()
│ │ │ │ -
89{ return models<Concept::Function<Signature>, F>(); }
│ │ │ │ -
│ │ │ │ -
90
│ │ │ │ -
92template<class F, class Signature, template<class> class DerivativeTraits>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
94{ return models<Concept::Function<Signature>, F>(); }
│ │ │ │ -
│ │ │ │ -
95
│ │ │ │ -
96
│ │ │ │ -
97
│ │ │ │ -
98// DifferentiableFunction concept ##############################################
│ │ │ │ -
99template<class Signature, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ │ - │ │ │ │ -
101
│ │ │ │ -
113template<class Range, class Domain, template<class> class DerivativeTraits>
│ │ │ │ -
│ │ │ │ -
114struct DifferentiableFunction<Range(Domain), DerivativeTraits> : Refines<Dune::Functions::Concept::Function<Range(Domain)> >
│ │ │ │ -
115{
│ │ │ │ - │ │ │ │ -
117
│ │ │ │ -
118 template<class F>
│ │ │ │ -
119 auto require(F&& f) -> decltype(
│ │ │ │ -
120 derivative(f),
│ │ │ │ -
121 requireConcept<Function<DerivativeSignature>>(derivative(f))
│ │ │ │ -
122 );
│ │ │ │ -
123};
│ │ │ │ -
│ │ │ │ -
124
│ │ │ │ -
126template<class F, class Signature, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ │ -
│ │ │ │ -
127static constexpr bool isDifferentiableFunction()
│ │ │ │ -
128{ return models<Concept::DifferentiableFunction<Signature, DerivativeTraits>, F>(); }
│ │ │ │ -
│ │ │ │ -
129
│ │ │ │ -
131template<class F, class Signature, template<class> class DerivativeTraits>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
133{ return models<Concept::DifferentiableFunction<Signature, DerivativeTraits>, F>(); }
│ │ │ │ -
│ │ │ │ -
134
│ │ │ │ -
135
│ │ │ │ -
136
│ │ │ │ -
137// LocalFunction concept ##############################################
│ │ │ │ -
138template<class Signature, class LocalContext>
│ │ │ │ - │ │ │ │ -
140
│ │ │ │ -
150template<class Range, class Domain, class LocalContext>
│ │ │ │ -
│ │ │ │ -
151struct LocalFunction<Range(Domain), LocalContext> :
│ │ │ │ -
152 Refines<Dune::Functions::Concept::Function<Range(Domain)> >
│ │ │ │ -
153{
│ │ │ │ -
154 template<class F>
│ │ │ │ -
155 auto require(F&& f) -> decltype(
│ │ │ │ -
156 f.bind(std::declval<LocalContext>()),
│ │ │ │ -
157 f.unbind(),
│ │ │ │ -
158 requireConvertible<bool>(f.bound()),
│ │ │ │ -
159 f.localContext(),
│ │ │ │ -
160 requireConvertible<LocalContext>(f.localContext())
│ │ │ │ -
161 );
│ │ │ │ -
162};
│ │ │ │ -
│ │ │ │ -
163
│ │ │ │ -
165template<class F, class Signature, class LocalContext>
│ │ │ │ -
│ │ │ │ -
166static constexpr bool isLocalFunction()
│ │ │ │ -
167{ return models<Concept::LocalFunction<Signature, LocalContext>, F>(); }
│ │ │ │ -
│ │ │ │ -
168
│ │ │ │ -
169
│ │ │ │ -
170// DifferentiableLocalFunction concept ##############################################
│ │ │ │ -
171template<class Signature, class LocalContext, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ │ - │ │ │ │ -
173
│ │ │ │ -
186template<class Range, class Domain, class LocalContext, template<class> class DerivativeTraits>
│ │ │ │ -
│ │ │ │ -
187struct DifferentiableLocalFunction<Range(Domain), LocalContext, DerivativeTraits> :
│ │ │ │ -
188 Refines<
│ │ │ │ -
189 Dune::Functions::Concept::DifferentiableFunction<Range(Domain), DerivativeTraits>,
│ │ │ │ -
190 Dune::Functions::Concept::LocalFunction<Range(Domain),LocalContext>
│ │ │ │ -
191 >
│ │ │ │ +
64 template<typename D, typename R>
│ │ │ │ +
65 struct RaviartThomasCubeLocalInfo<2,D,R,0>
│ │ │ │ +
66 {
│ │ │ │ +
67 using FiniteElement = RT0Cube2DLocalFiniteElement<D,R>;
│ │ │ │ +
68 };
│ │ │ │ +
69
│ │ │ │ +
70 template<typename D, typename R>
│ │ │ │ +
71 struct RaviartThomasCubeLocalInfo<2,D,R,1>
│ │ │ │ +
72 {
│ │ │ │ +
73 using FiniteElement = RT1Cube2DLocalFiniteElement<D,R>;
│ │ │ │ +
74 };
│ │ │ │ +
75
│ │ │ │ +
76 template<typename D, typename R>
│ │ │ │ +
77 struct RaviartThomasCubeLocalInfo<2,D,R,2>
│ │ │ │ +
78 {
│ │ │ │ +
79 using FiniteElement = RT2Cube2DLocalFiniteElement<D,R>;
│ │ │ │ +
80 };
│ │ │ │ +
81
│ │ │ │ +
82 template<typename D, typename R>
│ │ │ │ +
83 struct RaviartThomasCubeLocalInfo<3,D,R,0>
│ │ │ │ +
84 {
│ │ │ │ +
85 using FiniteElement = RT0Cube3DLocalFiniteElement<D,R>;
│ │ │ │ +
86 };
│ │ │ │ +
87
│ │ │ │ +
88 template<typename D, typename R>
│ │ │ │ +
89 struct RaviartThomasCubeLocalInfo<3,D,R,1>
│ │ │ │ +
90 {
│ │ │ │ +
91 using FiniteElement = RT1Cube3DLocalFiniteElement<D,R>;
│ │ │ │ +
92 };
│ │ │ │ +
93
│ │ │ │ +
94 template<typename GV, int dim, typename R, std::size_t k>
│ │ │ │ +
95 class RaviartThomasLocalFiniteElementMap
│ │ │ │ +
96 {
│ │ │ │ +
97 using D = typename GV::ctype;
│ │ │ │ +
98 constexpr static bool hasFixedElementType = Capabilities::hasSingleGeometryType<typename GV::Grid>::v;
│ │ │ │ +
99
│ │ │ │ +
100 using CubeFiniteElement = typename RaviartThomasCubeLocalInfo<dim, D, R, k>::FiniteElement;
│ │ │ │ +
101 using SimplexFiniteElement = typename RaviartThomasSimplexLocalInfo<dim, D, R, k>::FiniteElement;
│ │ │ │ +
102
│ │ │ │ +
103 public:
│ │ │ │ +
104
│ │ │ │ +
105 using T = LocalBasisTraits<D, dim, FieldVector<D,dim>, R, dim, FieldVector<R,dim>, FieldMatrix<D,dim,dim> >;
│ │ │ │ +
106
│ │ │ │ +
107 constexpr static unsigned int topologyId = Capabilities::hasSingleGeometryType<typename GV::Grid>::topologyId; // meaningless if hasFixedElementType is false
│ │ │ │ +
108 constexpr static GeometryType type = GeometryType(topologyId, GV::dimension);
│ │ │ │ +
109
│ │ │ │ +
110 using FiniteElement = std::conditional_t<hasFixedElementType,
│ │ │ │ +
111 std::conditional_t<type.isCube(),CubeFiniteElement,SimplexFiniteElement>,
│ │ │ │ +
112 LocalFiniteElementVariant<CubeFiniteElement, SimplexFiniteElement> >;
│ │ │ │ +
113
│ │ │ │ +
114 // Each element facet can have its orientation reversed, hence there are
│ │ │ │ +
115 // 2^#facets different variants.
│ │ │ │ +
116 static std::size_t numVariants(GeometryType type)
│ │ │ │ +
117 {
│ │ │ │ +
118 auto numFacets = referenceElement<D,dim>(type).size(1);
│ │ │ │ +
119 return power(2,numFacets);
│ │ │ │ +
120 }
│ │ │ │ +
121
│ │ │ │ +
122 RaviartThomasLocalFiniteElementMap(const GV& gv)
│ │ │ │ +
123 : elementMapper_(gv, mcmgElementLayout()),
│ │ │ │ +
124 orient_(gv.size(0))
│ │ │ │ +
125 {
│ │ │ │ +
126 if constexpr (hasFixedElementType)
│ │ │ │ +
127 {
│ │ │ │ +
128 variants_.resize(numVariants(type));
│ │ │ │ +
129 for (size_t i = 0; i < numVariants(type); i++)
│ │ │ │ +
130 variants_[i] = FiniteElement(i);
│ │ │ │ +
131 }
│ │ │ │ +
132 else
│ │ │ │ +
133 {
│ │ │ │ +
134 // for mixed grids add offset for cubes
│ │ │ │ +
135 variants_.resize(numVariants(GeometryTypes::simplex(dim)) + numVariants(GeometryTypes::cube(dim)));
│ │ │ │ +
136 for (size_t i = 0; i < numVariants(GeometryTypes::simplex(dim)); i++)
│ │ │ │ +
137 variants_[i] = SimplexFiniteElement(i);
│ │ │ │ +
138 for (size_t i = 0; i < numVariants(GeometryTypes::cube(dim)); i++)
│ │ │ │ +
139 variants_[i + numVariants(GeometryTypes::simplex(dim))] = CubeFiniteElement(i);
│ │ │ │ +
140 }
│ │ │ │ +
141
│ │ │ │ +
142 for(const auto& cell : elements(gv))
│ │ │ │ +
143 {
│ │ │ │ +
144 unsigned int myId = elementMapper_.index(cell);
│ │ │ │ +
145 orient_[myId] = 0;
│ │ │ │ +
146
│ │ │ │ +
147 for (const auto& intersection : intersections(gv,cell))
│ │ │ │ +
148 {
│ │ │ │ +
149 if (intersection.neighbor() && (elementMapper_.index(intersection.outside()) > myId))
│ │ │ │ +
150 orient_[myId] |= (1 << intersection.indexInInside());
│ │ │ │ +
151 }
│ │ │ │ +
152
│ │ │ │ +
153 // for mixed grids add offset for cubes
│ │ │ │ +
154 if constexpr (!hasFixedElementType)
│ │ │ │ +
155 if (cell.type().isCube())
│ │ │ │ +
156 orient_[myId] += numVariants(GeometryTypes::simplex(dim));
│ │ │ │ +
157 }
│ │ │ │ +
158 }
│ │ │ │ +
159
│ │ │ │ +
160 template<class EntityType>
│ │ │ │ +
161 const FiniteElement& find(const EntityType& e) const
│ │ │ │ +
162 {
│ │ │ │ +
163 return variants_[orient_[elementMapper_.index(e)]];
│ │ │ │ +
164 }
│ │ │ │ +
165
│ │ │ │ +
166 private:
│ │ │ │ +
167 std::vector<FiniteElement> variants_;
│ │ │ │ +
168 const Dune::MultipleCodimMultipleGeomTypeMapper<GV> elementMapper_;
│ │ │ │ +
169 std::vector<unsigned char> orient_;
│ │ │ │ +
170 };
│ │ │ │ +
171
│ │ │ │ +
172
│ │ │ │ +
173} // namespace Impl
│ │ │ │ +
174
│ │ │ │ +
175
│ │ │ │ +
176// *****************************************************************************
│ │ │ │ +
177// This is the reusable part of the basis. It contains
│ │ │ │ +
178//
│ │ │ │ +
179// RaviartThomasPreBasis
│ │ │ │ +
180// RaviartThomasNode
│ │ │ │ +
181//
│ │ │ │ +
182// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ │ +
183// state. These components do _not_ depend on the global basis and local view
│ │ │ │ +
184// and can be used without a global basis.
│ │ │ │ +
185// *****************************************************************************
│ │ │ │ +
186
│ │ │ │ +
187template<typename GV, int k>
│ │ │ │ +
188class RaviartThomasNode;
│ │ │ │ +
189
│ │ │ │ +
190template<typename GV, int k>
│ │ │ │ +
│ │ │ │ + │ │ │ │
192{
│ │ │ │ -
193 template<class F>
│ │ │ │ -
194 auto require(F&& f) -> decltype(
│ │ │ │ -
195 f.bind(std::declval<LocalContext>()),
│ │ │ │ -
196 f.unbind(),
│ │ │ │ -
197 f.localContext(),
│ │ │ │ -
198 requireConvertible<LocalContext>(f.localContext())
│ │ │ │ -
199 );
│ │ │ │ -
200};
│ │ │ │ -
│ │ │ │ +
193 static const int dim = GV::dimension;
│ │ │ │ +
194 using FiniteElementMap = typename Impl::RaviartThomasLocalFiniteElementMap<GV, dim, double, k>;
│ │ │ │ +
195
│ │ │ │ +
196public:
│ │ │ │ +
197
│ │ │ │ +
199 using GridView = GV;
│ │ │ │ +
200 using size_type = std::size_t;
│ │ │ │
201
│ │ │ │ -
203template<class F, class Signature, class LocalContext, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ │ -
│ │ │ │ -
204static constexpr bool isDifferentiableLocalFunction()
│ │ │ │ -
205{ return models<Concept::DifferentiableLocalFunction<Signature, LocalContext, DerivativeTraits>, F>(); }
│ │ │ │ -
│ │ │ │ -
206
│ │ │ │ + │ │ │ │ +
203
│ │ │ │ +
204 static constexpr size_type maxMultiIndexSize = 1;
│ │ │ │ +
205 static constexpr size_type minMultiIndexSize = 1;
│ │ │ │ +
206 static constexpr size_type multiIndexBufferSize = 1;
│ │ │ │
207
│ │ │ │ -
208// EntitySet concept ##############################################
│ │ │ │ -
209
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
220{
│ │ │ │ -
221 template<class E>
│ │ │ │ -
222 auto require(E&& f) -> decltype(
│ │ │ │ -
223 requireType<typename E::Element>(),
│ │ │ │ -
224 requireType<typename E::LocalCoordinate>(),
│ │ │ │ -
225 requireType<typename E::GlobalCoordinate>()
│ │ │ │ -
226 );
│ │ │ │ -
227};
│ │ │ │ -
│ │ │ │ -
228
│ │ │ │ -
230template<class E>
│ │ │ │ -
│ │ │ │ -
231static constexpr bool isEntitySet()
│ │ │ │ -
232{ return models<Concept::EntitySet, E>(); }
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
210 gridView_(gv),
│ │ │ │ + │ │ │ │ +
212 {
│ │ │ │ +
213 // Currently there are some unresolved bugs with hybrid grids and higher order Raviart-Thomas elements
│ │ │ │ +
214 if (gv.indexSet().types(0).size() > 1 and k>0)
│ │ │ │ +
215 DUNE_THROW(Dune::NotImplemented, "Raviart-Thomas basis with index k>0 is only implemented for grids with a single element type");
│ │ │ │ +
216
│ │ │ │ +
217 for(auto type : gv.indexSet().types(0))
│ │ │ │ +
218 if (!type.isSimplex() && !type.isCube())
│ │ │ │ +
219 DUNE_THROW(Dune::NotImplemented, "Raviart-Thomas elements are only implemented for grids with simplex or cube elements.");
│ │ │ │ +
220
│ │ │ │ +
221 GeometryType type = gv.template begin<0>()->type();
│ │ │ │ +
222 const static int dofsPerElement = type.isCube() ? ((dim == 2) ? k*(k+1)*dim : k*(k+1)*(k+1)*dim) : k*dim;
│ │ │ │ +
223 const static int dofsPerFace = type.isCube() ? (dim-2)*2*k+k+1 : (dim-1)*k+1 ;
│ │ │ │ +
224
│ │ │ │ +
225 dofsPerCodim_ = {{dofsPerElement, dofsPerFace}};
│ │ │ │ +
226 }
│ │ │ │ +
│ │ │ │ +
227
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
229 {
│ │ │ │ +
230 codimOffset_[0] = 0;
│ │ │ │ +
231 codimOffset_[1] = codimOffset_[0] + dofsPerCodim_[0] * gridView_.size(0);
│ │ │ │ +
232 }
│ │ │ │
│ │ │ │
233
│ │ │ │ -
234
│ │ │ │ -
235
│ │ │ │ -
236// GridFunction concept ##############################################
│ │ │ │ -
237template<class Signature, class EntitySet>
│ │ │ │ - │ │ │ │ -
239
│ │ │ │ -
249template<class Range, class Domain, class EntitySet>
│ │ │ │ -
│ │ │ │ -
250struct GridFunction<Range(Domain), EntitySet> :
│ │ │ │ -
251 Refines<Dune::Functions::Concept::Function<Range(Domain)> >
│ │ │ │ -
252{
│ │ │ │ -
253 using LocalSignature = Range(typename EntitySet::LocalCoordinate);
│ │ │ │ -
254 using LocalContext = typename EntitySet::Element;
│ │ │ │ -
255
│ │ │ │ -
256 template<class F>
│ │ │ │ -
257 auto require(F&& f) -> decltype(
│ │ │ │ -
258 localFunction(f),
│ │ │ │ -
259 f.entitySet(),
│ │ │ │ -
260 requireConcept<LocalFunction<LocalSignature, LocalContext>>(localFunction(f)),
│ │ │ │ -
261 requireConcept<Concept::EntitySet, EntitySet>(),
│ │ │ │ -
262 requireConvertible<EntitySet>(f.entitySet()),
│ │ │ │ -
263 requireConvertible<typename EntitySet::GlobalCoordinate, Domain>()
│ │ │ │ -
264 );
│ │ │ │ -
265};
│ │ │ │ +
│ │ │ │ +
236 const GridView& gridView() const
│ │ │ │ +
237 {
│ │ │ │ +
238 return gridView_;
│ │ │ │ +
239 }
│ │ │ │ +
│ │ │ │ +
240
│ │ │ │ +
241 /* \brief Update the stored grid view, to be called if the grid has changed */
│ │ │ │ +
│ │ │ │ +
242 void update (const GridView& gv)
│ │ │ │ +
243 {
│ │ │ │ +
244 gridView_ = gv;
│ │ │ │ +
245 }
│ │ │ │ +
│ │ │ │ +
246
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
251 {
│ │ │ │ +
252 return Node{&finiteElementMap_};
│ │ │ │ +
253 }
│ │ │ │ +
│ │ │ │ +
254
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
256 {
│ │ │ │ +
257 return dofsPerCodim_[0] * gridView_.size(0) + dofsPerCodim_[1] * gridView_.size(1);
│ │ │ │ +
258 }
│ │ │ │ +
│ │ │ │ +
259
│ │ │ │ +
261 template<class SizePrefix>
│ │ │ │ +
│ │ │ │ +
262 size_type size(const SizePrefix& prefix) const
│ │ │ │ +
263 {
│ │ │ │ +
264 assert(prefix.size() == 0 || prefix.size() == 1);
│ │ │ │ +
265 return (prefix.size() == 0) ? size() : 0;
│ │ │ │ +
266 }
│ │ │ │
│ │ │ │ -
266
│ │ │ │ -
268template<class F, class Signature, class EntitySet>
│ │ │ │ +
267
│ │ │ │
│ │ │ │ -
269static constexpr bool isGridFunction()
│ │ │ │ -
270{ return models<Concept::GridFunction<Signature, EntitySet>, F>(); }
│ │ │ │ -
│ │ │ │ -
271
│ │ │ │ -
272
│ │ │ │ -
273// DifferentiableGridFunction concept ##############################################
│ │ │ │ -
274template<class Signature, class EntitySet, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ │ - │ │ │ │ -
276
│ │ │ │ -
289template<class Range, class Domain, class EntitySet, template<class> class DerivativeTraits>
│ │ │ │ -
│ │ │ │ -
290struct DifferentiableGridFunction<Range(Domain), EntitySet, DerivativeTraits> :
│ │ │ │ -
291 Refines<
│ │ │ │ -
292 Dune::Functions::Concept::DifferentiableFunction<Range(Domain), DerivativeTraits>,
│ │ │ │ -
293 Dune::Functions::Concept::GridFunction<Range(Domain),EntitySet>
│ │ │ │ -
294 >
│ │ │ │ -
295{
│ │ │ │ -
296 using LocalSignature = Range(typename EntitySet::LocalCoordinate);
│ │ │ │ -
297 using LocalContext = typename EntitySet::Element;
│ │ │ │ + │ │ │ │ +
270 {
│ │ │ │ +
271 return size();
│ │ │ │ +
272 }
│ │ │ │ +
│ │ │ │ +
273
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
275 {
│ │ │ │ +
276 size_type result = 0;
│ │ │ │ +
277 for (auto&& type : gridView_.indexSet().types(0))
│ │ │ │ +
278 {
│ │ │ │ +
279 size_t numFaces = ReferenceElements<double,dim>::general(type).size(1);
│ │ │ │ +
280 const static int dofsPerElement = type.isCube() ? ((dim == 2) ? k*(k+1)*dim : k*(k+1)*(k+1)*dim) : k*dim;
│ │ │ │ +
281 const static int dofsPerFace = type.isCube() ? (dim-2)*2*k+k+1 : (dim-1)*k+1 ;
│ │ │ │ +
282 result = std::max(result, dofsPerElement + dofsPerFace * numFaces);
│ │ │ │ +
283 }
│ │ │ │ +
284
│ │ │ │ +
285 return result;
│ │ │ │ +
286 }
│ │ │ │ +
│ │ │ │ +
287
│ │ │ │ +
293 template<typename It>
│ │ │ │ +
│ │ │ │ +
294 It indices(const Node& node, It it) const
│ │ │ │ +
295 {
│ │ │ │ +
296 const auto& gridIndexSet = gridView().indexSet();
│ │ │ │ +
297 const auto& element = node.element();
│ │ │ │
298
│ │ │ │ -
299 template<class R>
│ │ │ │ - │ │ │ │ -
301
│ │ │ │ -
302 template<class F>
│ │ │ │ -
303 auto require(F&& f) -> decltype(
│ │ │ │ -
304 requireConcept<DifferentiableLocalFunction<LocalSignature, LocalContext, LocalDerivativeTraits>>(localFunction(f))
│ │ │ │ -
305 );
│ │ │ │ -
306};
│ │ │ │ -
│ │ │ │ -
307
│ │ │ │ -
309template<class F, class Signature, class EntitySet, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ │ -
│ │ │ │ -
310static constexpr bool isDifferentiableGridFunction()
│ │ │ │ -
311{ return models<Concept::DifferentiableGridFunction<Signature, EntitySet, DerivativeTraits>, F>(); }
│ │ │ │ -
│ │ │ │ -
312
│ │ │ │ +
299 // throw if Element is not of predefined type
│ │ │ │ +
300 if (not(element.type().isCube()) and not(element.type().isSimplex()))
│ │ │ │ +
301 DUNE_THROW(Dune::NotImplemented, "RaviartThomasBasis only implemented for cube and simplex elements.");
│ │ │ │ +
302
│ │ │ │ +
303 for(std::size_t i=0, end=node.size(); i<end; ++i, ++it)
│ │ │ │ +
304 {
│ │ │ │ +
305 Dune::LocalKey localKey = node.finiteElement().localCoefficients().localKey(i);
│ │ │ │ +
306
│ │ │ │ +
307 // The dimension of the entity that the current dof is related to
│ │ │ │ +
308 size_t subentity = localKey.subEntity();
│ │ │ │ +
309 size_t codim = localKey.codim();
│ │ │ │ +
310
│ │ │ │ +
311 if (not(codim==0 or codim==1))
│ │ │ │ +
312 DUNE_THROW(Dune::NotImplemented, "Grid contains elements not supported for the RaviartThomasBasis");
│ │ │ │
313
│ │ │ │ -
314
│ │ │ │ -
315// GridViewFunction concept ##############################################
│ │ │ │ -
316template<class Signature, class GridView>
│ │ │ │ - │ │ │ │ -
318
│ │ │ │ -
331template<class Range, class Domain, class GridView>
│ │ │ │ +
314 *it = { codimOffset_[codim] +
│ │ │ │ +
315 dofsPerCodim_[codim] * gridIndexSet.subIndex(element, subentity, codim) + localKey.index() };
│ │ │ │ +
316 }
│ │ │ │ +
317
│ │ │ │ +
318 return it;
│ │ │ │ +
319 }
│ │ │ │ +
│ │ │ │ +
320
│ │ │ │ +
321protected:
│ │ │ │ + │ │ │ │ +
323 std::array<size_t,dim+1> codimOffset_;
│ │ │ │ +
324 FiniteElementMap finiteElementMap_;
│ │ │ │ +
325 // Number of dofs per entity type depending on the entity's codimension and type
│ │ │ │ +
326 std::array<int,dim+1> dofsPerCodim_;
│ │ │ │ +
327};
│ │ │ │ +
│ │ │ │ +
328
│ │ │ │ +
329
│ │ │ │ +
330
│ │ │ │ +
331template<typename GV, int k>
│ │ │ │
│ │ │ │ -
332struct GridViewFunction<Range(Domain), GridView> :
│ │ │ │ -
333 Refines<Dune::Functions::Concept::GridFunction<Range(Domain), GridViewEntitySet<GridView,0>>>
│ │ │ │ + │ │ │ │ +
333 public LeafBasisNode
│ │ │ │
334{
│ │ │ │ -
335 template<class F>
│ │ │ │ -
336 auto require(F&& f) -> decltype(
│ │ │ │ -
337 0 // We don't need to check any further expressions, because a GridViewFunction is just a GridFunction with a special EntitySet
│ │ │ │ -
338 );
│ │ │ │ -
339};
│ │ │ │ -
│ │ │ │ -
340
│ │ │ │ -
342template<class F, class Signature, class GridView>
│ │ │ │ -
│ │ │ │ -
343static constexpr bool isGridViewFunction()
│ │ │ │ -
344{ return models<Concept::GridViewFunction<Signature, GridView>, F>(); }
│ │ │ │ -
│ │ │ │ +
335 static const int dim = GV::dimension;
│ │ │ │ +
336
│ │ │ │ +
337public:
│ │ │ │ +
338
│ │ │ │ +
339 using size_type = std::size_t;
│ │ │ │ +
340 using Element = typename GV::template Codim<0>::Entity;
│ │ │ │ +
341 using FiniteElementMap = typename Impl::RaviartThomasLocalFiniteElementMap<GV, dim, double, k>;
│ │ │ │ +
342 using FiniteElement = Impl::GlobalValuedLocalFiniteElement<Impl::ContravariantPiolaTransformator,
│ │ │ │ +
343 typename FiniteElementMap::FiniteElement,
│ │ │ │ +
344 Element>;
│ │ │ │
345
│ │ │ │ -
346
│ │ │ │ -
347// DifferentiableGridViewFunction concept ##############################################
│ │ │ │ -
348template<class Signature, class GridView, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ │ - │ │ │ │ +
│ │ │ │ +
346 RaviartThomasNode(const FiniteElementMap* finiteElementMap) :
│ │ │ │ +
347 element_(nullptr),
│ │ │ │ +
348 finiteElementMap_(finiteElementMap)
│ │ │ │ +
349 { }
│ │ │ │ +
│ │ │ │
350
│ │ │ │ -
364template<class Range, class Domain, class GridView, template<class> class DerivativeTraits>
│ │ │ │ -
│ │ │ │ -
365struct DifferentiableGridViewFunction<Range(Domain), GridView, DerivativeTraits> :
│ │ │ │ -
366 Refines<Dune::Functions::Concept::DifferentiableGridFunction<Range(Domain), GridViewEntitySet<GridView,0>, DerivativeTraits>>
│ │ │ │ -
367{
│ │ │ │ -
368 template<class F>
│ │ │ │ -
369 auto require(F&& f) -> decltype(
│ │ │ │ -
370 0 // We don't need to check any further expressions, because a GridViewFunction is just a GridFunction with a special EntitySet
│ │ │ │ -
371 );
│ │ │ │ -
372};
│ │ │ │ +
│ │ │ │ +
352 const Element& element() const
│ │ │ │ +
353 {
│ │ │ │ +
354 return *element_;
│ │ │ │ +
355 }
│ │ │ │ +
│ │ │ │ +
356
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
362 {
│ │ │ │ +
363 return finiteElement_;
│ │ │ │ +
364 }
│ │ │ │ +
│ │ │ │ +
365
│ │ │ │ +
│ │ │ │ +
367 void bind(const Element& e)
│ │ │ │ +
368 {
│ │ │ │ +
369 element_ = &e;
│ │ │ │ +
370 finiteElement_.bind((finiteElementMap_->find(*element_)), e);
│ │ │ │ +
371 this->setSize(finiteElement_.size());
│ │ │ │ +
372 }
│ │ │ │
│ │ │ │
373
│ │ │ │ -
375template<class F, class Signature, class GridView, template<class> class DerivativeTraits = DefaultDerivativeTraits>
│ │ │ │ -
│ │ │ │ -
376static constexpr bool isDifferentiableGridViewFunction()
│ │ │ │ -
377{ return models<Concept::DifferentiableGridViewFunction<Signature, GridView, DerivativeTraits>, F>(); }
│ │ │ │ +
374protected:
│ │ │ │ +
375
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
379};
│ │ │ │
│ │ │ │ -
378
│ │ │ │ -
379
│ │ │ │
380
│ │ │ │ -
381}}} // namespace Dune::Functions::Concept
│ │ │ │ +
381namespace BasisFactory {
│ │ │ │
382
│ │ │ │ -
383#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:269
│ │ │ │ -
static constexpr bool isDifferentiableLocalFunction()
Check if F models the DifferentiableLocalFunction concept with given signature and local context.
Definition functionconcepts.hh:204
│ │ │ │ -
static constexpr bool isFunction()
Check if F models the Function concept with given signature.
Definition functionconcepts.hh:88
│ │ │ │ -
static constexpr bool isDifferentiableGridViewFunction()
Check if F models the DifferentiableGridViewFunction concept with given signature.
Definition functionconcepts.hh:376
│ │ │ │ -
static constexpr bool isDifferentiableFunction()
Check if F models the DifferentiableFunction concept with given signature.
Definition functionconcepts.hh:127
│ │ │ │ -
static constexpr bool isGridViewFunction()
Check if F models the GridViewFunction concept with given signature.
Definition functionconcepts.hh:343
│ │ │ │ -
static constexpr bool isEntitySet()
Check if F models the GridFunction concept with given signature and entity set.
Definition functionconcepts.hh:231
│ │ │ │ -
static constexpr bool isDifferentiableGridFunction()
Check if F models the DifferentiableGridFunction concept with given signature and entity set.
Definition functionconcepts.hh:310
│ │ │ │ -
static constexpr bool isLocalFunction()
Check if F models the LocalFunction concept with given signature and local context.
Definition functionconcepts.hh:166
│ │ │ │ -
TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
Obtain derivative of TrigonometricFunction function.
Definition trigonometricfunction.hh:39
│ │ │ │ -
static constexpr auto isCallable()
Check if f is callable with given argument list.
Definition functionconcepts.hh:47
│ │ │ │ +
390template<std::size_t k>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
392{
│ │ │ │ +
393 return [](const auto& gridView) {
│ │ │ │ +
394 return RaviartThomasPreBasis<std::decay_t<decltype(gridView)>, k>(gridView);
│ │ │ │ +
395 };
│ │ │ │ +
396}
│ │ │ │ +
│ │ │ │ +
397
│ │ │ │ +
398} // end namespace BasisFactory
│ │ │ │ +
399
│ │ │ │ +
400
│ │ │ │ +
401
│ │ │ │ +
402// *****************************************************************************
│ │ │ │ +
403// This is the actual global basis implementation based on the reusable parts.
│ │ │ │ +
404// *****************************************************************************
│ │ │ │ +
405
│ │ │ │ +
413template<typename GV, int k>
│ │ │ │ + │ │ │ │ +
415
│ │ │ │ +
416} // end namespace Functions
│ │ │ │ +
417} // end namespace Dune
│ │ │ │ +
418
│ │ │ │ +
419
│ │ │ │ +
420#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
auto raviartThomas()
Create a pre-basis factory that can create a Raviart-Thomas pre-basis.
Definition raviartthomasbasis.hh:391
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:37
│ │ │ │ -
Concept objects that can be called with given argument list.
Definition functionconcepts.hh:33
│ │ │ │ -
auto require(F &&f) -> decltype(f(std::declval< Args >()...))
│ │ │ │ -
Definition functionconcepts.hh:66
│ │ │ │ -
auto require(F &&f) -> decltype(requireConvertible< Range >(f(std::declval< Domain >())))
│ │ │ │ -
Definition functionconcepts.hh:100
│ │ │ │ -
typename SignatureTraits< Range(Domain)>::template DerivativeSignature< DerivativeTraits > DerivativeSignature
Definition functionconcepts.hh:116
│ │ │ │ -
auto require(F &&f) -> decltype(derivative(f), requireConcept< Function< DerivativeSignature > >(derivative(f)))
│ │ │ │ -
Definition functionconcepts.hh:139
│ │ │ │ -
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:220
│ │ │ │ -
auto require(E &&f) -> decltype(requireType< typename E::Element >(), requireType< typename E::LocalCoordinate >(), requireType< typename E::GlobalCoordinate >())
│ │ │ │ -
Definition functionconcepts.hh:238
│ │ │ │ -
typename EntitySet::Element LocalContext
Definition functionconcepts.hh:254
│ │ │ │ -
Range(typename EntitySet::LocalCoordinate) LocalSignature
Definition functionconcepts.hh:253
│ │ │ │ -
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:300
│ │ │ │ -
auto require(F &&f) -> decltype(requireConcept< DifferentiableLocalFunction< LocalSignature, LocalContext, LocalDerivativeTraits > >(localFunction(f)))
│ │ │ │ -
Range(typename EntitySet::LocalCoordinate) LocalSignature
Definition functionconcepts.hh:296
│ │ │ │ - │ │ │ │ -
Definition functionconcepts.hh:317
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
Helper class to deduce the signature of a callable.
Definition signature.hh:56
│ │ │ │ -
Definition signature.hh:102
│ │ │ │ -
Derivative traits for local functions.
Definition localderivativetraits.hh:28
│ │ │ │ +
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:46
│ │ │ │ +
size_type size() const
Definition nodes.hh:142
│ │ │ │ +
void setSize(const size_type size)
Definition nodes.hh:164
│ │ │ │ +
Definition nodes.hh:186
│ │ │ │ +
Definition raviartthomasbasis.hh:334
│ │ │ │ +
typename Impl::RaviartThomasLocalFiniteElementMap< GV, dim, double, k > FiniteElementMap
Definition raviartthomasbasis.hh:341
│ │ │ │ +
void bind(const Element &e)
Bind to element.
Definition raviartthomasbasis.hh:367
│ │ │ │ +
Impl::GlobalValuedLocalFiniteElement< Impl::ContravariantPiolaTransformator, typename FiniteElementMap::FiniteElement, Element > FiniteElement
Definition raviartthomasbasis.hh:344
│ │ │ │ +
typename GV::template Codim< 0 >::Entity Element
Definition raviartthomasbasis.hh:340
│ │ │ │ +
const Element * element_
Definition raviartthomasbasis.hh:377
│ │ │ │ +
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition raviartthomasbasis.hh:361
│ │ │ │ +
std::size_t size_type
Definition raviartthomasbasis.hh:339
│ │ │ │ +
RaviartThomasNode(const FiniteElementMap *finiteElementMap)
Definition raviartthomasbasis.hh:346
│ │ │ │ +
const Element & element() const
Return current element, throw if unbound.
Definition raviartthomasbasis.hh:352
│ │ │ │ +
FiniteElement finiteElement_
Definition raviartthomasbasis.hh:376
│ │ │ │ +
const FiniteElementMap * finiteElementMap_
Definition raviartthomasbasis.hh:378
│ │ │ │ +
Definition raviartthomasbasis.hh:192
│ │ │ │ +
static constexpr size_type minMultiIndexSize
Definition raviartthomasbasis.hh:205
│ │ │ │ +
static constexpr size_type maxMultiIndexSize
Definition raviartthomasbasis.hh:204
│ │ │ │ +
Node makeNode() const
Create tree node.
Definition raviartthomasbasis.hh:250
│ │ │ │ +
std::array< int, dim+1 > dofsPerCodim_
Definition raviartthomasbasis.hh:326
│ │ │ │ +
void update(const GridView &gv)
Definition raviartthomasbasis.hh:242
│ │ │ │ +
RaviartThomasPreBasis(const GridView &gv)
Constructor for a given grid view object.
Definition raviartthomasbasis.hh:209
│ │ │ │ +
std::size_t size_type
Definition raviartthomasbasis.hh:200
│ │ │ │ +
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition raviartthomasbasis.hh:236
│ │ │ │ +
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 raviartthomasbasis.hh:294
│ │ │ │ +
static constexpr size_type multiIndexBufferSize
Definition raviartthomasbasis.hh:206
│ │ │ │ +
FiniteElementMap finiteElementMap_
Definition raviartthomasbasis.hh:324
│ │ │ │ +
size_type size() const
Definition raviartthomasbasis.hh:255
│ │ │ │ +
size_type dimension() const
Definition raviartthomasbasis.hh:269
│ │ │ │ +
GV GridView
The grid view that the FE space is defined on.
Definition raviartthomasbasis.hh:199
│ │ │ │ +
size_type maxNodeSize() const
Definition raviartthomasbasis.hh:274
│ │ │ │ +
GridView gridView_
Definition raviartthomasbasis.hh:322
│ │ │ │ +
size_type size(const SizePrefix &prefix) const
Return number possible values for next position in multi index.
Definition raviartthomasbasis.hh:262
│ │ │ │ +
void initializeIndices()
Definition raviartthomasbasis.hh:228
│ │ │ │ +
std::array< size_t, dim+1 > codimOffset_
Definition raviartthomasbasis.hh:323
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,459 +1,560 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -functionconcepts.hh │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ 8 │ │ │ │ │ -9#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> │ │ │ │ │ -10#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> │ │ │ │ │ -11#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> │ │ │ │ │ -12 │ │ │ │ │ -13namespace _D_u_n_e { │ │ │ │ │ -14namespace Functions { │ │ │ │ │ -15namespace Concept { │ │ │ │ │ -16 │ │ │ │ │ -17using namespace Dune::Concept; │ │ │ │ │ -18 │ │ │ │ │ -19 │ │ │ │ │ -20 │ │ │ │ │ -21// Callable concept │ │ │ │ │ -############################################################ │ │ │ │ │ +9#include │ │ │ │ │ +10#include │ │ │ │ │ +11 │ │ │ │ │ +12#include │ │ │ │ │ +13#include │ │ │ │ │ +14#include │ │ │ │ │ +15#include │ │ │ │ │ +16#include │ │ │ │ │ +17#include │ │ │ │ │ +18#include │ │ │ │ │ +19#include │ │ │ │ │ +20#include │ │ │ │ │ +21#include │ │ │ │ │ 22 │ │ │ │ │ -23 │ │ │ │ │ -31template │ │ │ │ │ -_3_2struct _C_a_l_l_a_b_l_e │ │ │ │ │ -33{ │ │ │ │ │ -34 template │ │ │ │ │ -_3_5 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ │ -36 f(std::declval()...) │ │ │ │ │ -37 ); │ │ │ │ │ -38}; │ │ │ │ │ -39 │ │ │ │ │ -46template │ │ │ │ │ -_4_7static constexpr auto _i_s_C_a_l_l_a_b_l_e() │ │ │ │ │ -48{ return models<_C_o_n_c_e_p_t_:_:_C_a_l_l_a_b_l_e, F>(); } │ │ │ │ │ -49 │ │ │ │ │ -56template │ │ │ │ │ -_5_7static constexpr auto _i_s_C_a_l_l_a_b_l_e(F&&, Args&&...) │ │ │ │ │ -58{ │ │ │ │ │ -59 return models<_C_o_n_c_e_p_t_:_:_C_a_l_l_a_b_l_e, F>(); │ │ │ │ │ -60} │ │ │ │ │ -61 │ │ │ │ │ -62 │ │ │ │ │ +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 │ │ │ │ │ +27namespace _D_u_n_e { │ │ │ │ │ +28namespace Functions { │ │ │ │ │ +29 │ │ │ │ │ +30namespace Impl { │ │ │ │ │ +31 │ │ │ │ │ +32 template │ │ │ │ │ +33 struct RaviartThomasSimplexLocalInfo │ │ │ │ │ +34 { │ │ │ │ │ +35 // Dummy type, must be something that we can have a std::unique_ptr to │ │ │ │ │ +36 using FiniteElement = void*; │ │ │ │ │ +37 }; │ │ │ │ │ +38 │ │ │ │ │ +39 template │ │ │ │ │ +40 struct RaviartThomasSimplexLocalInfo<2,D,R,0> │ │ │ │ │ +41 { │ │ │ │ │ +42 using FiniteElement = RT02DLocalFiniteElement; │ │ │ │ │ +43 }; │ │ │ │ │ +44 │ │ │ │ │ +45 template │ │ │ │ │ +46 struct RaviartThomasSimplexLocalInfo<2,D,R,1> │ │ │ │ │ +47 { │ │ │ │ │ +48 using FiniteElement = RT12DLocalFiniteElement; │ │ │ │ │ +49 }; │ │ │ │ │ +50 │ │ │ │ │ +51 template │ │ │ │ │ +52 struct RaviartThomasSimplexLocalInfo<3,D,R,0> │ │ │ │ │ +53 { │ │ │ │ │ +54 using FiniteElement = RT03DLocalFiniteElement; │ │ │ │ │ +55 }; │ │ │ │ │ +56 │ │ │ │ │ +57 template │ │ │ │ │ +58 struct RaviartThomasCubeLocalInfo │ │ │ │ │ +59 { │ │ │ │ │ +60 // Dummy type, must be something that we can have a std::unique_ptr to │ │ │ │ │ +61 using FiniteElement = void*; │ │ │ │ │ +62 }; │ │ │ │ │ 63 │ │ │ │ │ -64// Function concept │ │ │ │ │ -############################################################ │ │ │ │ │ -65template │ │ │ │ │ -_6_6struct _F_u_n_c_t_i_o_n; │ │ │ │ │ -67 │ │ │ │ │ -76template │ │ │ │ │ -_7_7struct _F_u_n_c_t_i_o_n : Refines > │ │ │ │ │ -78{ │ │ │ │ │ -79 template │ │ │ │ │ -_8_0 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ │ -81 // F models Function if the result of F(Domain) is implicitly │ │ │ │ │ -convertible to Range │ │ │ │ │ -82 requireConvertible(f(std::declval())) │ │ │ │ │ -83 ); │ │ │ │ │ -84}; │ │ │ │ │ -85 │ │ │ │ │ -87template │ │ │ │ │ -_8_8static constexpr bool _i_s_F_u_n_c_t_i_o_n() │ │ │ │ │ -89{ return models, F>(); } │ │ │ │ │ -90 │ │ │ │ │ -92template class DerivativeTraits> │ │ │ │ │ -_9_3static 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_>) │ │ │ │ │ -94{ return models, F>(); } │ │ │ │ │ -95 │ │ │ │ │ -96 │ │ │ │ │ -97 │ │ │ │ │ -98// DifferentiableFunction concept │ │ │ │ │ -############################################## │ │ │ │ │ -99template 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_0struct _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n; │ │ │ │ │ -101 │ │ │ │ │ -113template class DerivativeTraits> │ │ │ │ │ -_1_1_4struct _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n : │ │ │ │ │ -Refines > │ │ │ │ │ -115{ │ │ │ │ │ -_1_1_6 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_>; │ │ │ │ │ -117 │ │ │ │ │ -118 template │ │ │ │ │ -_1_1_9 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ │ -120 _d_e_r_i_v_a_t_i_v_e(f), │ │ │ │ │ -121 requireConcept>(_d_e_r_i_v_a_t_i_v_e(f)) │ │ │ │ │ -122 ); │ │ │ │ │ -123}; │ │ │ │ │ -124 │ │ │ │ │ -126template 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_2_7static 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() │ │ │ │ │ -128{ return models, F>(); } │ │ │ │ │ -129 │ │ │ │ │ -131template class DerivativeTraits> │ │ │ │ │ -_1_3_2static 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_>) │ │ │ │ │ -133{ return models, F>(); } │ │ │ │ │ -134 │ │ │ │ │ -135 │ │ │ │ │ -136 │ │ │ │ │ -137// LocalFunction concept ############################################## │ │ │ │ │ -138template │ │ │ │ │ -_1_3_9struct _L_o_c_a_l_F_u_n_c_t_i_o_n; │ │ │ │ │ -140 │ │ │ │ │ -150template │ │ │ │ │ -_1_5_1struct _L_o_c_a_l_F_u_n_c_t_i_o_n : │ │ │ │ │ -152 Refines > │ │ │ │ │ -153{ │ │ │ │ │ -154 template │ │ │ │ │ -_1_5_5 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ │ -156 f.bind(std::declval()), │ │ │ │ │ -157 f.unbind(), │ │ │ │ │ -158 requireConvertible(f.bound()), │ │ │ │ │ -159 f.localContext(), │ │ │ │ │ -160 requireConvertible(f.localContext()) │ │ │ │ │ -161 ); │ │ │ │ │ -162}; │ │ │ │ │ -163 │ │ │ │ │ -165template │ │ │ │ │ -_1_6_6static constexpr bool _i_s_L_o_c_a_l_F_u_n_c_t_i_o_n() │ │ │ │ │ -167{ return models, F>(); } │ │ │ │ │ -168 │ │ │ │ │ -169 │ │ │ │ │ -170// DifferentiableLocalFunction concept │ │ │ │ │ -############################################## │ │ │ │ │ -171template 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_2struct _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; │ │ │ │ │ -173 │ │ │ │ │ -186template │ │ │ │ │ -class DerivativeTraits> │ │ │ │ │ -_1_8_7struct _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 : │ │ │ │ │ -188 Refines< │ │ │ │ │ -189 Dune::Functions::Concept::DifferentiableFunction, │ │ │ │ │ -190 Dune::Functions::Concept::LocalFunction │ │ │ │ │ -191 > │ │ │ │ │ +64 template │ │ │ │ │ +65 struct RaviartThomasCubeLocalInfo<2,D,R,0> │ │ │ │ │ +66 { │ │ │ │ │ +67 using FiniteElement = RT0Cube2DLocalFiniteElement; │ │ │ │ │ +68 }; │ │ │ │ │ +69 │ │ │ │ │ +70 template │ │ │ │ │ +71 struct RaviartThomasCubeLocalInfo<2,D,R,1> │ │ │ │ │ +72 { │ │ │ │ │ +73 using FiniteElement = RT1Cube2DLocalFiniteElement; │ │ │ │ │ +74 }; │ │ │ │ │ +75 │ │ │ │ │ +76 template │ │ │ │ │ +77 struct RaviartThomasCubeLocalInfo<2,D,R,2> │ │ │ │ │ +78 { │ │ │ │ │ +79 using FiniteElement = RT2Cube2DLocalFiniteElement; │ │ │ │ │ +80 }; │ │ │ │ │ +81 │ │ │ │ │ +82 template │ │ │ │ │ +83 struct RaviartThomasCubeLocalInfo<3,D,R,0> │ │ │ │ │ +84 { │ │ │ │ │ +85 using FiniteElement = RT0Cube3DLocalFiniteElement; │ │ │ │ │ +86 }; │ │ │ │ │ +87 │ │ │ │ │ +88 template │ │ │ │ │ +89 struct RaviartThomasCubeLocalInfo<3,D,R,1> │ │ │ │ │ +90 { │ │ │ │ │ +91 using FiniteElement = RT1Cube3DLocalFiniteElement; │ │ │ │ │ +92 }; │ │ │ │ │ +93 │ │ │ │ │ +94 template │ │ │ │ │ +95 class RaviartThomasLocalFiniteElementMap │ │ │ │ │ +96 { │ │ │ │ │ +97 using D = typename GV::ctype; │ │ │ │ │ +98 constexpr static bool hasFixedElementType = Capabilities:: │ │ │ │ │ +hasSingleGeometryType::v; │ │ │ │ │ +99 │ │ │ │ │ +100 using CubeFiniteElement = typename RaviartThomasCubeLocalInfo::FiniteElement; │ │ │ │ │ +101 using SimplexFiniteElement = typename RaviartThomasSimplexLocalInfo::FiniteElement; │ │ │ │ │ +102 │ │ │ │ │ +103 public: │ │ │ │ │ +104 │ │ │ │ │ +105 using T = LocalBasisTraits, R, dim, │ │ │ │ │ +FieldVector, FieldMatrix >; │ │ │ │ │ +106 │ │ │ │ │ +107 constexpr static unsigned int topologyId = Capabilities:: │ │ │ │ │ +hasSingleGeometryType::topologyId; // meaningless if │ │ │ │ │ +hasFixedElementType is false │ │ │ │ │ +108 constexpr static GeometryType type = GeometryType(topologyId, GV:: │ │ │ │ │ +dimension); │ │ │ │ │ +109 │ │ │ │ │ +110 using FiniteElement = std::conditional_t, │ │ │ │ │ +112 LocalFiniteElementVariant >; │ │ │ │ │ +113 │ │ │ │ │ +114 // Each element facet can have its orientation reversed, hence there are │ │ │ │ │ +115 // 2^#facets different variants. │ │ │ │ │ +116 static std::size_t numVariants(GeometryType type) │ │ │ │ │ +117 { │ │ │ │ │ +118 auto numFacets = referenceElement(type).size(1); │ │ │ │ │ +119 return power(2,numFacets); │ │ │ │ │ +120 } │ │ │ │ │ +121 │ │ │ │ │ +122 RaviartThomasLocalFiniteElementMap(const GV& gv) │ │ │ │ │ +123 : elementMapper_(gv, mcmgElementLayout()), │ │ │ │ │ +124 orient_(gv.size(0)) │ │ │ │ │ +125 { │ │ │ │ │ +126 if constexpr (hasFixedElementType) │ │ │ │ │ +127 { │ │ │ │ │ +128 variants_.resize(numVariants(type)); │ │ │ │ │ +129 for (size_t i = 0; i < numVariants(type); i++) │ │ │ │ │ +130 variants_[i] = FiniteElement(i); │ │ │ │ │ +131 } │ │ │ │ │ +132 else │ │ │ │ │ +133 { │ │ │ │ │ +134 // for mixed grids add offset for cubes │ │ │ │ │ +135 variants_.resize(numVariants(GeometryTypes::simplex(dim)) + numVariants │ │ │ │ │ +(GeometryTypes::cube(dim))); │ │ │ │ │ +136 for (size_t i = 0; i < numVariants(GeometryTypes::simplex(dim)); i++) │ │ │ │ │ +137 variants_[i] = SimplexFiniteElement(i); │ │ │ │ │ +138 for (size_t i = 0; i < numVariants(GeometryTypes::cube(dim)); i++) │ │ │ │ │ +139 variants_[i + numVariants(GeometryTypes::simplex(dim))] = CubeFiniteElement │ │ │ │ │ +(i); │ │ │ │ │ +140 } │ │ │ │ │ +141 │ │ │ │ │ +142 for(const auto& cell : elements(gv)) │ │ │ │ │ +143 { │ │ │ │ │ +144 unsigned int myId = elementMapper_.index(cell); │ │ │ │ │ +145 orient_[myId] = 0; │ │ │ │ │ +146 │ │ │ │ │ +147 for (const auto& intersection : intersections(gv,cell)) │ │ │ │ │ +148 { │ │ │ │ │ +149 if (intersection.neighbor() && (elementMapper_.index(intersection.outside │ │ │ │ │ +()) > myId)) │ │ │ │ │ +150 orient_[myId] |= (1 << intersection.indexInInside()); │ │ │ │ │ +151 } │ │ │ │ │ +152 │ │ │ │ │ +153 // for mixed grids add offset for cubes │ │ │ │ │ +154 if constexpr (!hasFixedElementType) │ │ │ │ │ +155 if (cell.type().isCube()) │ │ │ │ │ +156 orient_[myId] += numVariants(GeometryTypes::simplex(dim)); │ │ │ │ │ +157 } │ │ │ │ │ +158 } │ │ │ │ │ +159 │ │ │ │ │ +160 template │ │ │ │ │ +161 const FiniteElement& find(const EntityType& e) const │ │ │ │ │ +162 { │ │ │ │ │ +163 return variants_[orient_[elementMapper_.index(e)]]; │ │ │ │ │ +164 } │ │ │ │ │ +165 │ │ │ │ │ +166 private: │ │ │ │ │ +167 std::vector variants_; │ │ │ │ │ +168 const Dune::MultipleCodimMultipleGeomTypeMapper elementMapper_; │ │ │ │ │ +169 std::vector orient_; │ │ │ │ │ +170 }; │ │ │ │ │ +171 │ │ │ │ │ +172 │ │ │ │ │ +173} // namespace Impl │ │ │ │ │ +174 │ │ │ │ │ +175 │ │ │ │ │ +176/ │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +177// This is the reusable part of the basis. It contains │ │ │ │ │ +178// │ │ │ │ │ +179// RaviartThomasPreBasis │ │ │ │ │ +180// RaviartThomasNode │ │ │ │ │ +181// │ │ │ │ │ +182// The pre-basis allows to create the others and is the owner of possible │ │ │ │ │ +shared │ │ │ │ │ +183// state. These components do _not_ depend on the global basis and local │ │ │ │ │ +view │ │ │ │ │ +184// and can be used without a global basis. │ │ │ │ │ +185/ │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +186 │ │ │ │ │ +187template │ │ │ │ │ +188class RaviartThomasNode; │ │ │ │ │ +189 │ │ │ │ │ +190template │ │ │ │ │ +_1_9_1class _R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s │ │ │ │ │ 192{ │ │ │ │ │ -193 template │ │ │ │ │ -_1_9_4 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ │ -195 f.bind(std::declval()), │ │ │ │ │ -196 f.unbind(), │ │ │ │ │ -197 f.localContext(), │ │ │ │ │ -198 requireConvertible(f.localContext()) │ │ │ │ │ -199 ); │ │ │ │ │ -200}; │ │ │ │ │ +193 static const int dim = GV::dimension; │ │ │ │ │ +194 using FiniteElementMap = typename Impl:: │ │ │ │ │ +RaviartThomasLocalFiniteElementMap; │ │ │ │ │ +195 │ │ │ │ │ +196public: │ │ │ │ │ +197 │ │ │ │ │ +_1_9_9 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ │ +_2_0_0 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ 201 │ │ │ │ │ -203template 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_4static 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() │ │ │ │ │ -205{ return models, F>(); } │ │ │ │ │ -206 │ │ │ │ │ +_2_0_2 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_>; │ │ │ │ │ +203 │ │ │ │ │ +_2_0_4 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 = 1; │ │ │ │ │ +_2_0_5 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 = 1; │ │ │ │ │ +_2_0_6 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 = 1; │ │ │ │ │ 207 │ │ │ │ │ -208// EntitySet concept ############################################## │ │ │ │ │ -209 │ │ │ │ │ -_2_1_9struct _E_n_t_i_t_y_S_e_t │ │ │ │ │ -220{ │ │ │ │ │ -221 template │ │ │ │ │ -_2_2_2 auto _r_e_q_u_i_r_e(E&& f) -> decltype( │ │ │ │ │ -223 requireType(), │ │ │ │ │ -224 requireType(), │ │ │ │ │ -225 requireType() │ │ │ │ │ -226 ); │ │ │ │ │ -227}; │ │ │ │ │ -228 │ │ │ │ │ -230template │ │ │ │ │ -_2_3_1static constexpr bool _i_s_E_n_t_i_t_y_S_e_t() │ │ │ │ │ -232{ return models(); } │ │ │ │ │ +_2_0_9 _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) : │ │ │ │ │ +210 _g_r_i_d_V_i_e_w__(gv), │ │ │ │ │ +211 _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__(gv) │ │ │ │ │ +212 { │ │ │ │ │ +213 // Currently there are some unresolved bugs with hybrid grids and higher │ │ │ │ │ +order Raviart-Thomas elements │ │ │ │ │ +214 if (gv.indexSet().types(0).size() > 1 and k>0) │ │ │ │ │ +215 DUNE_THROW(Dune::NotImplemented, "Raviart-Thomas basis with index k>0 is │ │ │ │ │ +only implemented for grids with a single element type"); │ │ │ │ │ +216 │ │ │ │ │ +217 for(auto type : gv.indexSet().types(0)) │ │ │ │ │ +218 if (!type.isSimplex() && !type.isCube()) │ │ │ │ │ +219 DUNE_THROW(Dune::NotImplemented, "Raviart-Thomas elements are only │ │ │ │ │ +implemented for grids with simplex or cube elements."); │ │ │ │ │ +220 │ │ │ │ │ +221 GeometryType type = gv.template begin<0>()->type(); │ │ │ │ │ +222 const static int dofsPerElement = type.isCube() ? ((dim == 2) ? k*(k+1)*dim │ │ │ │ │ +: k*(k+1)*(k+1)*dim) : k*dim; │ │ │ │ │ +223 const static int dofsPerFace = type.isCube() ? (dim-2)*2*k+k+1 : (dim- │ │ │ │ │ +1)*k+1 ; │ │ │ │ │ +224 │ │ │ │ │ +225 _d_o_f_s_P_e_r_C_o_d_i_m__ = {{dofsPerElement, dofsPerFace}}; │ │ │ │ │ +226 } │ │ │ │ │ +227 │ │ │ │ │ +_2_2_8 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ │ +229 { │ │ │ │ │ +230 _c_o_d_i_m_O_f_f_s_e_t__[0] = 0; │ │ │ │ │ +231 _c_o_d_i_m_O_f_f_s_e_t__[1] = _c_o_d_i_m_O_f_f_s_e_t__[0] + _d_o_f_s_P_e_r_C_o_d_i_m__[0] * _g_r_i_d_V_i_e_w__.size(0); │ │ │ │ │ +232 } │ │ │ │ │ 233 │ │ │ │ │ -234 │ │ │ │ │ -235 │ │ │ │ │ -236// GridFunction concept ############################################## │ │ │ │ │ -237template │ │ │ │ │ -_2_3_8struct _G_r_i_d_F_u_n_c_t_i_o_n; │ │ │ │ │ -239 │ │ │ │ │ -249template │ │ │ │ │ -_2_5_0struct _G_r_i_d_F_u_n_c_t_i_o_n : │ │ │ │ │ -251 Refines > │ │ │ │ │ -252{ │ │ │ │ │ -_2_5_3 using _L_o_c_a_l_S_i_g_n_a_t_u_r_e = Range(typename EntitySet::LocalCoordinate); │ │ │ │ │ -_2_5_4 using _L_o_c_a_l_C_o_n_t_e_x_t = typename EntitySet::Element; │ │ │ │ │ -255 │ │ │ │ │ -256 template │ │ │ │ │ -_2_5_7 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ │ -258 localFunction(f), │ │ │ │ │ -259 f.entitySet(), │ │ │ │ │ -260 requireConcept>(localFunction │ │ │ │ │ -(f)), │ │ │ │ │ -261 requireConcept(), │ │ │ │ │ -262 requireConvertible(f.entitySet()), │ │ │ │ │ -263 requireConvertible() │ │ │ │ │ -264 ); │ │ │ │ │ -265}; │ │ │ │ │ -266 │ │ │ │ │ -268template │ │ │ │ │ -_2_6_9static constexpr bool _i_s_G_r_i_d_F_u_n_c_t_i_o_n() │ │ │ │ │ -270{ return models, F>(); } │ │ │ │ │ -271 │ │ │ │ │ -272 │ │ │ │ │ -273// DifferentiableGridFunction concept │ │ │ │ │ -############################################## │ │ │ │ │ -274template 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_5struct _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; │ │ │ │ │ -276 │ │ │ │ │ -289template class │ │ │ │ │ -DerivativeTraits> │ │ │ │ │ -_2_9_0struct _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 : │ │ │ │ │ -291 Refines< │ │ │ │ │ -292 Dune::Functions::Concept::DifferentiableFunction, │ │ │ │ │ -293 Dune::Functions::Concept::GridFunction │ │ │ │ │ -294 > │ │ │ │ │ -295{ │ │ │ │ │ -_2_9_6 using _L_o_c_a_l_S_i_g_n_a_t_u_r_e = Range(typename EntitySet::LocalCoordinate); │ │ │ │ │ -_2_9_7 using _L_o_c_a_l_C_o_n_t_e_x_t = typename EntitySet::Element; │ │ │ │ │ +_2_3_6 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ │ +237 { │ │ │ │ │ +238 return _g_r_i_d_V_i_e_w__; │ │ │ │ │ +239 } │ │ │ │ │ +240 │ │ │ │ │ +241 /* \brief Update the stored grid view, to be called if the grid has changed │ │ │ │ │ +*/ │ │ │ │ │ +_2_4_2 void _u_p_d_a_t_e (const _G_r_i_d_V_i_e_w& gv) │ │ │ │ │ +243 { │ │ │ │ │ +244 _g_r_i_d_V_i_e_w__ = gv; │ │ │ │ │ +245 } │ │ │ │ │ +246 │ │ │ │ │ +_2_5_0 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ │ +251 { │ │ │ │ │ +252 return _N_o_d_e{&_f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__}; │ │ │ │ │ +253 } │ │ │ │ │ +254 │ │ │ │ │ +_2_5_5 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ │ +256 { │ │ │ │ │ +257 return _d_o_f_s_P_e_r_C_o_d_i_m__[0] * _g_r_i_d_V_i_e_w__.size(0) + _d_o_f_s_P_e_r_C_o_d_i_m__[1] * │ │ │ │ │ +_g_r_i_d_V_i_e_w__.size(1); │ │ │ │ │ +258 } │ │ │ │ │ +259 │ │ │ │ │ +261 template │ │ │ │ │ +_2_6_2 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix) const │ │ │ │ │ +263 { │ │ │ │ │ +264 assert(prefix.size() == 0 || prefix.size() == 1); │ │ │ │ │ +265 return (prefix.size() == 0) ? _s_i_z_e() : 0; │ │ │ │ │ +266 } │ │ │ │ │ +267 │ │ │ │ │ +_2_6_9 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ │ +270 { │ │ │ │ │ +271 return _s_i_z_e(); │ │ │ │ │ +272 } │ │ │ │ │ +273 │ │ │ │ │ +_2_7_4 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ │ +275 { │ │ │ │ │ +276 _s_i_z_e___t_y_p_e result = 0; │ │ │ │ │ +277 for (auto&& type : _g_r_i_d_V_i_e_w__.indexSet().types(0)) │ │ │ │ │ +278 { │ │ │ │ │ +279 size_t numFaces = ReferenceElements::general(type).size(1); │ │ │ │ │ +280 const static int dofsPerElement = type.isCube() ? ((dim == 2) ? k*(k+1)*dim │ │ │ │ │ +: k*(k+1)*(k+1)*dim) : k*dim; │ │ │ │ │ +281 const static int dofsPerFace = type.isCube() ? (dim-2)*2*k+k+1 : (dim- │ │ │ │ │ +1)*k+1 ; │ │ │ │ │ +282 result = std::max(result, dofsPerElement + dofsPerFace * numFaces); │ │ │ │ │ +283 } │ │ │ │ │ +284 │ │ │ │ │ +285 return result; │ │ │ │ │ +286 } │ │ │ │ │ +287 │ │ │ │ │ +293 template │ │ │ │ │ +_2_9_4 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ │ +295 { │ │ │ │ │ +296 const auto& gridIndexSet = _g_r_i_d_V_i_e_w().indexSet(); │ │ │ │ │ +297 const auto& element = node._e_l_e_m_e_n_t(); │ │ │ │ │ 298 │ │ │ │ │ -299 template │ │ │ │ │ -_3_0_0 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; │ │ │ │ │ -301 │ │ │ │ │ -302 template │ │ │ │ │ -_3_0_3 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ │ -304 requireConcept>(localFunction(f)) │ │ │ │ │ -305 ); │ │ │ │ │ -306}; │ │ │ │ │ -307 │ │ │ │ │ -309template 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_0static 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() │ │ │ │ │ -311{ return models, F>(); } │ │ │ │ │ -312 │ │ │ │ │ +299 // throw if Element is not of predefined type │ │ │ │ │ +300 if (not(element.type().isCube()) and not(element.type().isSimplex())) │ │ │ │ │ +301 DUNE_THROW(Dune::NotImplemented, "RaviartThomasBasis only implemented for │ │ │ │ │ +cube and simplex elements."); │ │ │ │ │ +302 │ │ │ │ │ +303 for(std::size_t i=0, end=node._s_i_z_e(); i │ │ │ │ │ -_3_1_7struct _G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n; │ │ │ │ │ -318 │ │ │ │ │ -331template │ │ │ │ │ -_3_3_2struct _G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n : │ │ │ │ │ -333 Refines>> │ │ │ │ │ +314 *it = { _c_o_d_i_m_O_f_f_s_e_t__[codim] + │ │ │ │ │ +315 _d_o_f_s_P_e_r_C_o_d_i_m__[codim] * gridIndexSet.subIndex(element, subentity, codim) + │ │ │ │ │ +localKey.index() }; │ │ │ │ │ +316 } │ │ │ │ │ +317 │ │ │ │ │ +318 return it; │ │ │ │ │ +319 } │ │ │ │ │ +320 │ │ │ │ │ +321protected: │ │ │ │ │ +_3_2_2 _G_r_i_d_V_i_e_w _g_r_i_d_V_i_e_w__; │ │ │ │ │ +_3_2_3 std::array _c_o_d_i_m_O_f_f_s_e_t__; │ │ │ │ │ +_3_2_4 FiniteElementMap _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__; │ │ │ │ │ +325 // Number of dofs per entity type depending on the entity's codimension and │ │ │ │ │ +type │ │ │ │ │ +_3_2_6 std::array _d_o_f_s_P_e_r_C_o_d_i_m__; │ │ │ │ │ +327}; │ │ │ │ │ +328 │ │ │ │ │ +329 │ │ │ │ │ +330 │ │ │ │ │ +331template │ │ │ │ │ +_3_3_2class _R_a_v_i_a_r_t_T_h_o_m_a_s_N_o_d_e : │ │ │ │ │ +333 public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ │ 334{ │ │ │ │ │ -335 template │ │ │ │ │ -_3_3_6 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ │ -337 0 // We don't need to check any further expressions, because a │ │ │ │ │ -GridViewFunction is just a GridFunction with a special EntitySet │ │ │ │ │ -338 ); │ │ │ │ │ -339}; │ │ │ │ │ -340 │ │ │ │ │ -342template │ │ │ │ │ -_3_4_3static constexpr bool _i_s_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n() │ │ │ │ │ -344{ return models, F>(); } │ │ │ │ │ +335 static const int dim = GV::dimension; │ │ │ │ │ +336 │ │ │ │ │ +337public: │ │ │ │ │ +338 │ │ │ │ │ +_3_3_9 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ +_3_4_0 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ │ +_3_4_1 using _F_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p = typename Impl:: │ │ │ │ │ +RaviartThomasLocalFiniteElementMap; │ │ │ │ │ +_3_4_2 using _F_i_n_i_t_e_E_l_e_m_e_n_t = Impl::GlobalValuedLocalFiniteElement; │ │ │ │ │ 345 │ │ │ │ │ -346 │ │ │ │ │ -347// DifferentiableGridViewFunction concept │ │ │ │ │ -############################################## │ │ │ │ │ -348template 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_4_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; │ │ │ │ │ +_3_4_6 _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) : │ │ │ │ │ +347 _e_l_e_m_e_n_t__(nullptr), │ │ │ │ │ +348 _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__(finiteElementMap) │ │ │ │ │ +349 { } │ │ │ │ │ 350 │ │ │ │ │ -364template class │ │ │ │ │ -DerivativeTraits> │ │ │ │ │ -_3_6_5struct _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 : │ │ │ │ │ -366 Refines, DerivativeTraits>> │ │ │ │ │ -367{ │ │ │ │ │ -368 template │ │ │ │ │ -_3_6_9 auto _r_e_q_u_i_r_e(F&& f) -> decltype( │ │ │ │ │ -370 0 // We don't need to check any further expressions, because a │ │ │ │ │ -GridViewFunction is just a GridFunction with a special EntitySet │ │ │ │ │ -371 ); │ │ │ │ │ -372}; │ │ │ │ │ +_3_5_2 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ │ +353 { │ │ │ │ │ +354 return *_e_l_e_m_e_n_t__; │ │ │ │ │ +355 } │ │ │ │ │ +356 │ │ │ │ │ +_3_6_1 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 │ │ │ │ │ +362 { │ │ │ │ │ +363 return _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ │ +364 } │ │ │ │ │ +365 │ │ │ │ │ +_3_6_7 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ │ +368 { │ │ │ │ │ +369 _e_l_e_m_e_n_t__ = &e; │ │ │ │ │ +370 _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); │ │ │ │ │ +371 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__.size()); │ │ │ │ │ +372 } │ │ │ │ │ 373 │ │ │ │ │ -375template 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_7_6static 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() │ │ │ │ │ -377{ return models, F>(); } │ │ │ │ │ -378 │ │ │ │ │ -379 │ │ │ │ │ +374protected: │ │ │ │ │ +375 │ │ │ │ │ +_3_7_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__; │ │ │ │ │ +_3_7_7 const _E_l_e_m_e_n_t* _e_l_e_m_e_n_t__; │ │ │ │ │ +_3_7_8 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__; │ │ │ │ │ +379}; │ │ │ │ │ 380 │ │ │ │ │ -381}}} // namespace Dune::Functions::Concept │ │ │ │ │ +381namespace BasisFactory { │ │ │ │ │ 382 │ │ │ │ │ -383#endif // DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH │ │ │ │ │ -_s_i_g_n_a_t_u_r_e_._h_h │ │ │ │ │ -_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._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 │ │ │ │ │ -_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:269 │ │ │ │ │ -_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:204 │ │ │ │ │ -_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:88 │ │ │ │ │ -_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:376 │ │ │ │ │ -_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:127 │ │ │ │ │ -_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:343 │ │ │ │ │ -_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:231 │ │ │ │ │ -_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:310 │ │ │ │ │ -_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:166 │ │ │ │ │ -_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:39 │ │ │ │ │ -_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:47 │ │ │ │ │ +390template │ │ │ │ │ +_3_9_1auto _r_a_v_i_a_r_t_T_h_o_m_a_s() │ │ │ │ │ +392{ │ │ │ │ │ +393 return [](const auto& gridView) { │ │ │ │ │ +394 return _R_a_v_i_a_r_t_T_h_o_m_a_s_P_r_e_B_a_s_i_s, k> │ │ │ │ │ +(gridView); │ │ │ │ │ +395 }; │ │ │ │ │ +396} │ │ │ │ │ +397 │ │ │ │ │ +398} // end namespace BasisFactory │ │ │ │ │ +399 │ │ │ │ │ +400 │ │ │ │ │ +401 │ │ │ │ │ +402/ │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +403// This is the actual global basis implementation based on the reusable │ │ │ │ │ +parts. │ │ │ │ │ +404/ │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +405 │ │ │ │ │ +413template │ │ │ │ │ +_4_1_4using _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_> │ │ │ │ │ +>; │ │ │ │ │ +415 │ │ │ │ │ +416} // end namespace Functions │ │ │ │ │ +417} // end namespace Dune │ │ │ │ │ +418 │ │ │ │ │ +419 │ │ │ │ │ +420#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 │ │ │ │ │ +_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:391 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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: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 │ │ │ │ │ -Concept objects that can be called with given argument list. │ │ │ │ │ -DDeeffiinniittiioonn functionconcepts.hh:33 │ │ │ │ │ -_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:66 │ │ │ │ │ -_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:100 │ │ │ │ │ -_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:116 │ │ │ │ │ -_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:139 │ │ │ │ │ -_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:172 │ │ │ │ │ -_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:220 │ │ │ │ │ -_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:238 │ │ │ │ │ -_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:254 │ │ │ │ │ -_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:253 │ │ │ │ │ -_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:275 │ │ │ │ │ -_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: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_ _>_:_:_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:296 │ │ │ │ │ -_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:297 │ │ │ │ │ -_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:317 │ │ │ │ │ -_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:349 │ │ │ │ │ -_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:56 │ │ │ │ │ -_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:102 │ │ │ │ │ -_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:28 │ │ │ │ │ +_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:46 │ │ │ │ │ +_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 │ │ │ │ │ +DDeeffiinniittiioonn nodes.hh:142 │ │ │ │ │ +_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:164 │ │ │ │ │ +_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:186 │ │ │ │ │ +_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: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_M_a_p │ │ │ │ │ +typename Impl::RaviartThomasLocalFiniteElementMap< GV, dim, double, k > │ │ │ │ │ +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_:_:_b_i_n_d │ │ │ │ │ +void bind(const Element &e) │ │ │ │ │ +Bind to element. │ │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:367 │ │ │ │ │ +_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:344 │ │ │ │ │ +_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:340 │ │ │ │ │ +_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:377 │ │ │ │ │ +_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:361 │ │ │ │ │ +_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:339 │ │ │ │ │ +_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:346 │ │ │ │ │ +_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:352 │ │ │ │ │ +_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:376 │ │ │ │ │ +_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:378 │ │ │ │ │ +_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:192 │ │ │ │ │ +_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_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ +static constexpr size_type minMultiIndexSize │ │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:205 │ │ │ │ │ +_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_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ +static constexpr size_type maxMultiIndexSize │ │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:204 │ │ │ │ │ +_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:250 │ │ │ │ │ +_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_:_:_d_o_f_s_P_e_r_C_o_d_i_m__ │ │ │ │ │ +std::array< int, dim+1 > dofsPerCodim_ │ │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:326 │ │ │ │ │ +_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) │ │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:242 │ │ │ │ │ +_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:209 │ │ │ │ │ +_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:200 │ │ │ │ │ +_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 │ │ │ │ │ +const GridView & gridView() const │ │ │ │ │ +Obtain the grid view that the basis is defined on. │ │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:236 │ │ │ │ │ +_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_:_:_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 raviartthomasbasis.hh:294 │ │ │ │ │ +_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_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 raviartthomasbasis.hh:206 │ │ │ │ │ +_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:324 │ │ │ │ │ +_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 │ │ │ │ │ +size_type size() const │ │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:255 │ │ │ │ │ +_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_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ │ +size_type dimension() const │ │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:269 │ │ │ │ │ +_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:199 │ │ │ │ │ +_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_x_N_o_d_e_S_i_z_e │ │ │ │ │ +size_type maxNodeSize() const │ │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:274 │ │ │ │ │ +_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__ │ │ │ │ │ +GridView gridView_ │ │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:322 │ │ │ │ │ +_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 │ │ │ │ │ +size_type size(const SizePrefix &prefix) const │ │ │ │ │ +Return number possible values for next position in multi index. │ │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:262 │ │ │ │ │ +_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_:_:_i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ │ +void initializeIndices() │ │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:228 │ │ │ │ │ +_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_:_:_c_o_d_i_m_O_f_f_s_e_t__ │ │ │ │ │ +std::array< size_t, dim+1 > codimOffset_ │ │ │ │ │ +DDeeffiinniittiioonn raviartthomasbasis.hh:323 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00146.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: differentiablefunction.hh File Reference │ │ │ │ +dune-functions: transformedindexbasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,49 +65,78 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces
│ │ │ │ -
differentiablefunction.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Functions
│ │ │ │ +
transformedindexbasis.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <type_traits>
│ │ │ │ +
#include <tuple>
│ │ │ │ +#include <utility>
│ │ │ │ +#include <dune/common/std/apply.hh>
│ │ │ │ +#include <dune/common/hybridutilities.hh>
│ │ │ │ +#include <dune/common/reservedvector.hh>
│ │ │ │ #include <dune/common/typeutilities.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>
│ │ │ │ +#include <dune/typetree/compositenode.hh>
│ │ │ │ +#include <dune/typetree/utility.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::DifferentiableFunction< Signature, DerivativeTraits, bufferSize >
class  Dune::Functions::Experimental::TransformedIndexPreBasis< RPB, T >
 A pre-basis transforming multi-indices. More...
 
class  Dune::Functions::DifferentiableFunction< Range(Domain), DerivativeTraits, bufferSize >
 Class storing differentiable functions using type erasure. More...
class  Dune::Functions::BasisFactory::Experimental::GenericIndexingTransformation< IndexTransformation, SizeImplementation, 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 , std::size_t minIndexSize, std::size_t maxIndexSize>
auto Dune::Functions::BasisFactory::Experimental::indexTransformation (IndexTransformation &&indexTransformation, SizeImplementation &&sizeImplementation, Dune::index_constant< minIndexSize >, Dune::index_constant< maxIndexSize >)
 A generic implementation of a transformation.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,33 +1,65 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -differentiablefunction.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +transformedindexbasis.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_/_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_/_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> │ │ │ │ │ +#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_:_:_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_:_:_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_:_:_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_._._. │ │ │ │ │ +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_, │ │ │ │ │ + _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 &&) - │ │ │ │ │ + > _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::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, Dune::index_constant< minIndexSize >, Dune:: │ │ │ │ │ + index_constant< maxIndexSize >) │ │ │ │ │ +  A generic implementation of a transformation. │ │ │ │ │ +  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00146_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: differentiablefunction.hh Source File │ │ │ │ +dune-functions: transformedindexbasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,142 +70,322 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
differentiablefunction.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#ifndef DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH
│ │ │ │
5
│ │ │ │ -
6#include <type_traits>
│ │ │ │ -
7
│ │ │ │ -
8#include <dune/common/typeutilities.hh>
│ │ │ │ -
9
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
16
│ │ │ │ -
17namespace Dune {
│ │ │ │ -
18namespace Functions {
│ │ │ │ -
19
│ │ │ │ -
20
│ │ │ │ -
21
│ │ │ │ -
22/*
│ │ │ │ -
23 * Default implementation is empty
│ │ │ │ -
24 * The actual implementation is only given if Signature is an type
│ │ │ │ -
25 * describing a function signature as Range(Domain).
│ │ │ │ -
26 */
│ │ │ │ -
27template<class Signature, template<class> class DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
29{};
│ │ │ │ -
│ │ │ │ +
6#include <tuple>
│ │ │ │ +
7#include <utility>
│ │ │ │ +
8
│ │ │ │ +
9#include <dune/common/std/apply.hh>
│ │ │ │ +
10#include <dune/common/hybridutilities.hh>
│ │ │ │ +
11#include <dune/common/reservedvector.hh>
│ │ │ │ +
12#include <dune/common/typeutilities.hh>
│ │ │ │ +
13#include <dune/common/hybridutilities.hh>
│ │ │ │ +
14
│ │ │ │ +
15#include <dune/typetree/compositenode.hh>
│ │ │ │ +
16#include <dune/typetree/utility.hh>
│ │ │ │ +
17
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
25
│ │ │ │ +
26
│ │ │ │ +
27namespace Dune {
│ │ │ │ +
28namespace Functions {
│ │ │ │ +
│ │ │ │ +
29namespace Experimental {
│ │ │ │
30
│ │ │ │ -
31
│ │ │ │ -
32
│ │ │ │ -
33namespace Imp
│ │ │ │ -
34{
│ │ │ │ -
35
│ │ │ │ -
37 template<class S, template<class> class DerivativeTraits, size_t bufferSize>
│ │ │ │ -
38 struct DifferentiableFunctionTraits
│ │ │ │ -
39 {
│ │ │ │ -
41 using Signature = S;
│ │ │ │ -
42
│ │ │ │ -
44 using Range = typename SignatureTraits<Signature>::Range;
│ │ │ │ -
45
│ │ │ │ -
47 using Domain = typename SignatureTraits<Signature>::Domain;
│ │ │ │ -
48
│ │ │ │ -
50 using DerivativeSignature = typename SignatureTraits<Signature>::template DerivativeSignature<DerivativeTraits>;
│ │ │ │ -
51
│ │ │ │ - │ │ │ │ +
31// *****************************************************************************
│ │ │ │ +
32// *****************************************************************************
│ │ │ │ +
33
│ │ │ │ +
50template<class RPB, class T>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
52{
│ │ │ │ +
53 using Transformation = T;
│ │ │ │
54
│ │ │ │ -
56 using Concept = DifferentiableFunctionWrapperInterface<Signature, DerivativeInterface>;
│ │ │ │ -
57
│ │ │ │ -
59 template<class B>
│ │ │ │ -
60 using Model = DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>;
│ │ │ │ -
61 };
│ │ │ │ -
62}
│ │ │ │ + │ │ │ │ +
56
│ │ │ │ +
57public:
│ │ │ │ +
58
│ │ │ │ +
59 using RawPreBasis = RPB;
│ │ │ │ +
60
│ │ │ │ +
62 using GridView = typename RawPreBasis::GridView;
│ │ │ │
63
│ │ │ │ -
64
│ │ │ │ -
65
│ │ │ │ -
80template<class Range, class Domain, template<class> class DerivativeTraits, size_t bufferSize>
│ │ │ │ -
│ │ │ │ -
81class DifferentiableFunction< Range(Domain), DerivativeTraits, bufferSize> :
│ │ │ │ -
82 public TypeErasureBase<
│ │ │ │ -
83 typename Imp::DifferentiableFunctionTraits<Range(Domain), DerivativeTraits, bufferSize>::Concept,
│ │ │ │ -
84 Imp::DifferentiableFunctionTraits<Range(Domain), DerivativeTraits, bufferSize>::template Model>
│ │ │ │ -
85{
│ │ │ │ -
86 using Traits = Imp::DifferentiableFunctionTraits<Range(Domain), DerivativeTraits, bufferSize>;
│ │ │ │ -
87
│ │ │ │ - │ │ │ │ -
89
│ │ │ │ -
90 using DerivativeInterface = typename Traits::DerivativeInterface;
│ │ │ │ -
91
│ │ │ │ -
92public:
│ │ │ │ -
93
│ │ │ │ -
105 template<class F, disableCopyMove<DifferentiableFunction, F> = 0 >
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
107 Base(std::forward<F>(f))
│ │ │ │ -
108 {
│ │ │ │ -
109 static_assert(Dune::Functions::Concept::isFunction<F, Range(Domain)>(), "Trying to construct a DifferentiableFunction from type that does not model the Function concept");
│ │ │ │ -
110 }
│ │ │ │ -
│ │ │ │ -
111
│ │ │ │ - │ │ │ │ -
114
│ │ │ │ -
│ │ │ │ -
118 Range operator() (const Domain& x) const
│ │ │ │ -
119 {
│ │ │ │ -
120 return this->asInterface().operator()(x);
│ │ │ │ -
121 }
│ │ │ │ -
│ │ │ │ -
122
│ │ │ │ -
│ │ │ │ -
130 friend DerivativeInterface derivative(const DifferentiableFunction& t)
│ │ │ │ -
131 {
│ │ │ │ -
132 return t.asInterface().derivative();
│ │ │ │ -
133 }
│ │ │ │ -
│ │ │ │ -
134};
│ │ │ │ +
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
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
114 {
│ │ │ │ +
115 return rawPreBasis_.makeNode();
│ │ │ │ +
116 }
│ │ │ │ +
│ │ │ │ +
117
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
120 {
│ │ │ │ +
121 return size(Dune::ReservedVector<size_type, multiIndexBufferSize>{});
│ │ │ │ +
122 }
│ │ │ │ +
│ │ │ │ +
123
│ │ │ │ +
125 template<class SizePrefix>
│ │ │ │ +
│ │ │ │ +
126 size_type size(const SizePrefix& prefix) const
│ │ │ │ +
127 {
│ │ │ │ +
128 return transformation_.size(prefix, rawPreBasis_);
│ │ │ │ +
129 }
│ │ │ │ +
│ │ │ │ +
130
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
133 {
│ │ │ │ +
134 return transformation_.dimension(rawPreBasis_);
│ │ │ │ +
135 }
│ │ │ │
│ │ │ │ -
135
│ │ │ │
136
│ │ │ │ -
137
│ │ │ │ -
138}} // namespace Dune::Functions
│ │ │ │ -
139
│ │ │ │ -
140
│ │ │ │ -
141
│ │ │ │ -
142#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
friend DerivativeInterface derivative(const DifferentiableFunction &t)
Get derivative of wrapped function.
Definition differentiablefunction.hh:130
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
139 {
│ │ │ │ +
140 return rawPreBasis_.maxNodeSize();
│ │ │ │ +
141 }
│ │ │ │ +
│ │ │ │ +
142
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
144 {
│ │ │ │ +
145 return rawPreBasis_;
│ │ │ │ +
146 }
│ │ │ │ +
│ │ │ │ +
147
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
149 {
│ │ │ │ +
150 return rawPreBasis_;
│ │ │ │ +
151 }
│ │ │ │ +
│ │ │ │ +
152
│ │ │ │ +
153 template<class MultiIndex>
│ │ │ │ +
│ │ │ │ +
154 void transformIndex(MultiIndex& multiIndex) const
│ │ │ │ +
155 {
│ │ │ │ +
156 transformation_.transformIndex(multiIndex, rawPreBasis_);
│ │ │ │ +
157 }
│ │ │ │ +
│ │ │ │ +
158
│ │ │ │ +
159 template<typename It>
│ │ │ │ +
│ │ │ │ +
160 It indices(const Node& node, It it) const
│ │ │ │ +
161 {
│ │ │ │ +
162 rawPreBasis().indices(node, it);
│ │ │ │ +
163 for(std::size_t i=0; i<node.size(); ++i)
│ │ │ │ +
164 {
│ │ │ │ +
165 transformIndex(*it);
│ │ │ │ +
166 ++it;
│ │ │ │ +
167 }
│ │ │ │ +
168 return it;
│ │ │ │ +
169 }
│ │ │ │ +
│ │ │ │ +
170
│ │ │ │ +
171protected:
│ │ │ │ + │ │ │ │ +
173 Transformation transformation_;
│ │ │ │ +
174};
│ │ │ │ +
│ │ │ │ +
175
│ │ │ │ +
176template<class RPB, class T>
│ │ │ │ + │ │ │ │ +
178
│ │ │ │ +
179
│ │ │ │ +
180} // end namespace Experimental
│ │ │ │ +
│ │ │ │ +
181
│ │ │ │ +
182
│ │ │ │ +
183namespace BasisFactory {
│ │ │ │ +
184namespace Experimental {
│ │ │ │ +
185
│ │ │ │ +
197template<class RawPreBasisFactory, class Transformation>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
199 RawPreBasisFactory&& preBasisFactory,
│ │ │ │ +
200 Transformation&& transformation)
│ │ │ │ +
201{
│ │ │ │ +
202 return [
│ │ │ │ +
203 preBasisFactory=std::forward<RawPreBasisFactory>(preBasisFactory),
│ │ │ │ +
204 transformation =std::forward<Transformation>(transformation)
│ │ │ │ +
205 ](const auto& gridView) {
│ │ │ │ +
206 return Dune::Functions::Experimental::TransformedIndexPreBasis(preBasisFactory(gridView), std::move(transformation));
│ │ │ │ +
207 };
│ │ │ │ +
208}
│ │ │ │ +
│ │ │ │ +
209
│ │ │ │ +
210
│ │ │ │ +
211
│ │ │ │ +
230template<class IndexTransformation, class SizeImplementation, std::size_t minIS, std::size_t maxIS>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
232{
│ │ │ │ +
233public:
│ │ │ │ +
234
│ │ │ │ +
235 static constexpr std::size_t minIndexSize = minIS;
│ │ │ │ +
236 static constexpr std::size_t maxIndexSize = maxIS;
│ │ │ │ +
237
│ │ │ │ +
238 template<class IT_R, class SI_R>
│ │ │ │ +
│ │ │ │ +
239 GenericIndexingTransformation(IT_R&& indexTransformation, SI_R&& sizeImplementation) :
│ │ │ │ +
240 indexTransformation_(std::forward<IT_R>(indexTransformation)),
│ │ │ │ +
241 sizeImplementation_(std::forward<SI_R>(sizeImplementation))
│ │ │ │ +
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
│ │ │ │ +
262private:
│ │ │ │ +
263 IndexTransformation indexTransformation_;
│ │ │ │ +
264 SizeImplementation sizeImplementation_;
│ │ │ │ +
265};
│ │ │ │ +
│ │ │ │ +
266
│ │ │ │ +
267
│ │ │ │ +
268
│ │ │ │ +
287template<class IndexTransformation, class SizeImplementation, std::size_t minIndexSize, std::size_t maxIndexSize>
│ │ │ │ +
│ │ │ │ +
288auto indexTransformation(IndexTransformation&& indexTransformation, SizeImplementation&& sizeImplementation, Dune::index_constant<minIndexSize>, Dune::index_constant<maxIndexSize>)
│ │ │ │ +
289{
│ │ │ │ + │ │ │ │ +
291 std::decay_t<IndexTransformation>,
│ │ │ │ +
292 std::decay_t<SizeImplementation>,
│ │ │ │ +
293 minIndexSize, maxIndexSize>(
│ │ │ │ +
294 std::forward<IndexTransformation>(indexTransformation),
│ │ │ │ +
295 std::forward<SizeImplementation>(sizeImplementation));
│ │ │ │ +
296}
│ │ │ │ +
│ │ │ │ +
297
│ │ │ │ +
298
│ │ │ │ +
299} // end namespace Experimental
│ │ │ │ +
300} // end namespace BasisFactory
│ │ │ │ +
301} // end namespace Functions
│ │ │ │ +
302} // end namespace Dune
│ │ │ │ +
303
│ │ │ │ +
304
│ │ │ │ +
305#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
Definition differentiablefunction.hh:29
│ │ │ │ -
DifferentiableFunction(F &&f)
Construct from function.
Definition differentiablefunction.hh:106
│ │ │ │ - │ │ │ │ -
Helper class to deduce the signature of a callable.
Definition signature.hh:56
│ │ │ │ -
Base class for type-erased interface wrapper.
Definition typeerasure.hh:165
│ │ │ │ +
auto transformIndices(RawPreBasisFactory &&preBasisFactory, Transformation &&transformation)
Create a TransformedIndexPreBasisFactory.
Definition transformedindexbasis.hh:198
│ │ │ │ +
auto indexTransformation(IndexTransformation &&indexTransformation, SizeImplementation &&sizeImplementation, Dune::index_constant< minIndexSize >, Dune::index_constant< maxIndexSize >)
A generic implementation of a transformation.
Definition transformedindexbasis.hh:288
│ │ │ │ +
A pre-basis transforming multi-indices.
Definition transformedindexbasis.hh:52
│ │ │ │ +
It indices(const Node &node, It it) const
Definition transformedindexbasis.hh:160
│ │ │ │ +
Transformation transformation_
Definition transformedindexbasis.hh:173
│ │ │ │ +
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:154
│ │ │ │ +
RawPreBasis rawPreBasis_
Definition transformedindexbasis.hh:172
│ │ │ │ +
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:148
│ │ │ │ +
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 with given root tree path.
Definition transformedindexbasis.hh:113
│ │ │ │ +
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:126
│ │ │ │ +
RPB RawPreBasis
Definition transformedindexbasis.hh:59
│ │ │ │ +
size_type size() const
Same as size(prefix) with empty prefix.
Definition transformedindexbasis.hh:119
│ │ │ │ +
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition transformedindexbasis.hh:138
│ │ │ │ +
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:132
│ │ │ │ +
const RawPreBasis & rawPreBasis() const
Definition transformedindexbasis.hh:143
│ │ │ │ +
static constexpr size_type minMultiIndexSize
Definition transformedindexbasis.hh:71
│ │ │ │ +
A generic implementation of a transformation.
Definition transformedindexbasis.hh:232
│ │ │ │ +
auto dimension(const PreBasis &preBasis) const
Definition transformedindexbasis.hh:257
│ │ │ │ +
GenericIndexingTransformation(IT_R &&indexTransformation, SI_R &&sizeImplementation)
Definition transformedindexbasis.hh:239
│ │ │ │ +
void transformIndex(MultiIndex &multiIndex, const PreBasis &preBasis) const
Definition transformedindexbasis.hh:245
│ │ │ │ +
static constexpr std::size_t maxIndexSize
Definition transformedindexbasis.hh:236
│ │ │ │ +
static constexpr std::size_t minIndexSize
Definition transformedindexbasis.hh:235
│ │ │ │ +
auto size(const Prefix &prefix, const PreBasis &preBasis) const
Definition transformedindexbasis.hh:251
│ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,151 +1,368 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -differentiablefunction.hh │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7 │ │ │ │ │ -8#include │ │ │ │ │ -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_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#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#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_/_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_/_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ │ -16 │ │ │ │ │ -17namespace _D_u_n_e { │ │ │ │ │ -18namespace Functions { │ │ │ │ │ -19 │ │ │ │ │ -20 │ │ │ │ │ -21 │ │ │ │ │ -22/* │ │ │ │ │ -23 * Default implementation is empty │ │ │ │ │ -24 * The actual implementation is only given if Signature is an type │ │ │ │ │ -25 * describing a function signature as Range(Domain). │ │ │ │ │ -26 */ │ │ │ │ │ -27template class │ │ │ │ │ -DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56> │ │ │ │ │ -_2_8class _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n │ │ │ │ │ -29{}; │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ +8 │ │ │ │ │ +9#include │ │ │ │ │ +10#include │ │ │ │ │ +11#include │ │ │ │ │ +12#include │ │ │ │ │ +13#include │ │ │ │ │ +14 │ │ │ │ │ +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_/_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 Functions { │ │ │ │ │ +_2_9namespace Experimental { │ │ │ │ │ 30 │ │ │ │ │ -31 │ │ │ │ │ -32 │ │ │ │ │ -33namespace Imp │ │ │ │ │ -34{ │ │ │ │ │ -35 │ │ │ │ │ -37 template class DerivativeTraits, size_t bufferSize> │ │ │ │ │ -38 struct DifferentiableFunctionTraits │ │ │ │ │ -39 { │ │ │ │ │ -41 using Signature = S; │ │ │ │ │ -42 │ │ │ │ │ -44 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; │ │ │ │ │ -45 │ │ │ │ │ -47 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; │ │ │ │ │ -48 │ │ │ │ │ -50 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; │ │ │ │ │ -51 │ │ │ │ │ -53 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_>; │ │ │ │ │ +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 │ │ │ │ │ -56 using Concept = DifferentiableFunctionWrapperInterface; │ │ │ │ │ -57 │ │ │ │ │ -59 template │ │ │ │ │ -60 using Model = DifferentiableFunctionWrapperImplementation; │ │ │ │ │ -61 }; │ │ │ │ │ -62} │ │ │ │ │ +55 using _T_h_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_<_R_P_B_,_ _T_>; │ │ │ │ │ +56 │ │ │ │ │ +57public: │ │ │ │ │ +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 │ │ │ │ │ -64 │ │ │ │ │ -65 │ │ │ │ │ -80template class DerivativeTraits, │ │ │ │ │ -size_t bufferSize> │ │ │ │ │ -_8_1class _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> : │ │ │ │ │ -82 public _T_y_p_e_E_r_a_s_u_r_e_B_a_s_e< │ │ │ │ │ -83 typename Imp::DifferentiableFunctionTraits::Concept, │ │ │ │ │ -84 Imp::DifferentiableFunctionTraits::template Model> │ │ │ │ │ -85{ │ │ │ │ │ -86 using Traits = Imp::DifferentiableFunctionTraits; │ │ │ │ │ -87 │ │ │ │ │ -88 using _B_a_s_e = _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_>; │ │ │ │ │ -89 │ │ │ │ │ -90 using DerivativeInterface = typename _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; │ │ │ │ │ -91 │ │ │ │ │ -92public: │ │ │ │ │ -93 │ │ │ │ │ -105 template = 0 > │ │ │ │ │ -_1_0_6 _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n(F&& f) : │ │ │ │ │ -107 _B_a_s_e(std::forward(f)) │ │ │ │ │ -108 { │ │ │ │ │ -109 static_assert(Dune::Functions::Concept::isFunction(), │ │ │ │ │ -"Trying to construct a DifferentiableFunction from type that does not model the │ │ │ │ │ -Function concept"); │ │ │ │ │ -110 } │ │ │ │ │ -111 │ │ │ │ │ -_1_1_3 _D_i_f_f_e_r_e_n_t_i_a_b_l_e_F_u_n_c_t_i_o_n() = default; │ │ │ │ │ -114 │ │ │ │ │ -_1_1_8 Range operator() (const Domain& x) const │ │ │ │ │ -119 { │ │ │ │ │ -120 return this->asInterface().operator()(x); │ │ │ │ │ -121 } │ │ │ │ │ -122 │ │ │ │ │ -_1_3_0 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) │ │ │ │ │ -131 { │ │ │ │ │ -132 return t.asInterface().derivative(); │ │ │ │ │ -133 } │ │ │ │ │ -134}; │ │ │ │ │ -135 │ │ │ │ │ +_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_1_3 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ │ +114 { │ │ │ │ │ +115 return _r_a_w_P_r_e_B_a_s_i_s__.makeNode(); │ │ │ │ │ +116 } │ │ │ │ │ +117 │ │ │ │ │ +_1_1_9 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ │ +120 { │ │ │ │ │ +121 return _s_i_z_e(Dune::ReservedVector{}); │ │ │ │ │ +122 } │ │ │ │ │ +123 │ │ │ │ │ +125 template │ │ │ │ │ +_1_2_6 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix) const │ │ │ │ │ +127 { │ │ │ │ │ +128 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__); │ │ │ │ │ +129 } │ │ │ │ │ +130 │ │ │ │ │ +_1_3_2 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ │ +133 { │ │ │ │ │ +134 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__); │ │ │ │ │ +135 } │ │ │ │ │ 136 │ │ │ │ │ -137 │ │ │ │ │ -138}} // namespace Dune::Functions │ │ │ │ │ -139 │ │ │ │ │ -140 │ │ │ │ │ -141 │ │ │ │ │ -142#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH │ │ │ │ │ +_1_3_8 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ │ +139 { │ │ │ │ │ +140 return _r_a_w_P_r_e_B_a_s_i_s__.maxNodeSize(); │ │ │ │ │ +141 } │ │ │ │ │ +142 │ │ │ │ │ +_1_4_3 const _R_a_w_P_r_e_B_a_s_i_s& _r_a_w_P_r_e_B_a_s_i_s() const │ │ │ │ │ +144 { │ │ │ │ │ +145 return _r_a_w_P_r_e_B_a_s_i_s__; │ │ │ │ │ +146 } │ │ │ │ │ +147 │ │ │ │ │ +_1_4_8 _R_a_w_P_r_e_B_a_s_i_s& _r_a_w_P_r_e_B_a_s_i_s() │ │ │ │ │ +149 { │ │ │ │ │ +150 return _r_a_w_P_r_e_B_a_s_i_s__; │ │ │ │ │ +151 } │ │ │ │ │ +152 │ │ │ │ │ +153 template │ │ │ │ │ +_1_5_4 void _t_r_a_n_s_f_o_r_m_I_n_d_e_x(MultiIndex& multiIndex) const │ │ │ │ │ +155 { │ │ │ │ │ +156 _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__); │ │ │ │ │ +157 } │ │ │ │ │ +158 │ │ │ │ │ +159 template │ │ │ │ │ +_1_6_0 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ │ +161 { │ │ │ │ │ +162 _r_a_w_P_r_e_B_a_s_i_s().indices(node, it); │ │ │ │ │ +163 for(std::size_t i=0; i │ │ │ │ │ +_1_7_7_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>; │ │ │ │ │ +178 │ │ │ │ │ +179 │ │ │ │ │ +180} // end namespace Experimental │ │ │ │ │ +181 │ │ │ │ │ +182 │ │ │ │ │ +183namespace BasisFactory { │ │ │ │ │ +184namespace Experimental { │ │ │ │ │ +185 │ │ │ │ │ +197template │ │ │ │ │ +_1_9_8auto _t_r_a_n_s_f_o_r_m_I_n_d_i_c_e_s( │ │ │ │ │ +199 RawPreBasisFactory&& preBasisFactory, │ │ │ │ │ +200 Transformation&& transformation) │ │ │ │ │ +201{ │ │ │ │ │ +202 return [ │ │ │ │ │ +203 preBasisFactory=std::forward(preBasisFactory), │ │ │ │ │ +204 transformation =std::forward(transformation) │ │ │ │ │ +205 ](const auto& gridView) { │ │ │ │ │ +206 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)); │ │ │ │ │ +207 }; │ │ │ │ │ +208} │ │ │ │ │ +209 │ │ │ │ │ +210 │ │ │ │ │ +211 │ │ │ │ │ +230template │ │ │ │ │ +_2_3_1class _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 │ │ │ │ │ +232{ │ │ │ │ │ +233public: │ │ │ │ │ +234 │ │ │ │ │ +_2_3_5 static constexpr std::size_t _m_i_n_I_n_d_e_x_S_i_z_e = minIS; │ │ │ │ │ +_2_3_6 static constexpr std::size_t _m_a_x_I_n_d_e_x_S_i_z_e = maxIS; │ │ │ │ │ +237 │ │ │ │ │ +238 template │ │ │ │ │ +_2_3_9 _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) : │ │ │ │ │ +240 indexTransformation_(std::forward(_i_n_d_e_x_T_r_a_n_s_f_o_r_m_a_t_i_o_n)), │ │ │ │ │ +241 sizeImplementation_(std::forward(sizeImplementation)) │ │ │ │ │ +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 │ │ │ │ │ +262private: │ │ │ │ │ +263 IndexTransformation indexTransformation_; │ │ │ │ │ +264 SizeImplementation sizeImplementation_; │ │ │ │ │ +265}; │ │ │ │ │ +266 │ │ │ │ │ +267 │ │ │ │ │ +268 │ │ │ │ │ +287template │ │ │ │ │ +_2_8_8auto _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, │ │ │ │ │ +SizeImplementation&& sizeImplementation, Dune::index_constant, │ │ │ │ │ +Dune::index_constant) │ │ │ │ │ +289{ │ │ │ │ │ +290 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< │ │ │ │ │ +291 std::decay_t, │ │ │ │ │ +292 std::decay_t, │ │ │ │ │ +293 minIndexSize, maxIndexSize>( │ │ │ │ │ +294 std::forward(_i_n_d_e_x_T_r_a_n_s_f_o_r_m_a_t_i_o_n), │ │ │ │ │ +295 std::forward(sizeImplementation)); │ │ │ │ │ +296} │ │ │ │ │ +297 │ │ │ │ │ +298 │ │ │ │ │ +299} // end namespace Experimental │ │ │ │ │ +300} // end namespace BasisFactory │ │ │ │ │ +301} // end namespace Functions │ │ │ │ │ +302} // end namespace Dune │ │ │ │ │ +303 │ │ │ │ │ +304 │ │ │ │ │ +305#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH │ │ │ │ │ +_s_t_a_t_i_c_f_o_r_l_o_o_p_._h_h │ │ │ │ │ +_u_t_i_l_i_t_y_._h_h │ │ │ │ │ _t_y_p_e___t_r_a_i_t_s_._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 │ │ │ │ │ -_s_i_g_n_a_t_u_r_e_._h_h │ │ │ │ │ -_f_u_n_c_t_i_o_n_c_o_n_c_e_p_t_s_._h_h │ │ │ │ │ -_t_y_p_e_e_r_a_s_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_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:130 │ │ │ │ │ +_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 polynomial.hh:10 │ │ │ │ │ -_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:29 │ │ │ │ │ -_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:106 │ │ │ │ │ -_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:56 │ │ │ │ │ -_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 │ │ │ │ │ -Base class for type-erased interface wrapper. │ │ │ │ │ -DDeeffiinniittiioonn typeerasure.hh:165 │ │ │ │ │ +_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:198 │ │ │ │ │ +_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, Dune::index_constant< minIndexSize >, │ │ │ │ │ +Dune::index_constant< maxIndexSize >) │ │ │ │ │ +A generic implementation of a transformation. │ │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:288 │ │ │ │ │ +_D_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: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_:_:_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: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_:_:_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: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_:_:_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: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_:_:_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: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_:_:_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 with given root tree path. │ │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:113 │ │ │ │ │ +_D_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:126 │ │ │ │ │ +_D_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: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_:_:_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:138 │ │ │ │ │ +_D_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:132 │ │ │ │ │ +_D_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: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_:_:_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_:_:_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:232 │ │ │ │ │ +_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_:_: │ │ │ │ │ +_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) │ │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:239 │ │ │ │ │ +_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 │ │ │ │ │ +_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:236 │ │ │ │ │ +_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: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_:_: │ │ │ │ │ +_s_i_z_e │ │ │ │ │ +auto size(const Prefix &prefix, const PreBasis &preBasis) const │ │ │ │ │ +DDeeffiinniittiioonn transformedindexbasis.hh:251 │ │ │ │ │ +_c_o_n_c_e_p_t_s_._h_h │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00149.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: functionfromcallable.hh File Reference │ │ │ │ +dune-functions: bsplinebasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,42 +65,86 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces
│ │ │ │ -
functionfromcallable.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Typedefs | │ │ │ │ +Functions
│ │ │ │ +
bsplinebasis.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <dune/common/function.hh>
│ │ │ │ -#include <dune/functions/common/signature.hh>
│ │ │ │ + │ │ │ │ +

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>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::Functions::FunctionFromCallable< Range(Domain), F, FunctionInterface >
 Wrap a callable object as Dune::Function or Dune::VirtualFunction. 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<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

│ │ │ │ +

The B-spline global function space basis.

│ │ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,25 +1,64 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -functionfromcallable.hh File Reference │ │ │ │ │ -#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> │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +bsplinebasis.hh File Reference │ │ │ │ │ +The B-spline global function space basis. _M_o_r_e_._._. │ │ │ │ │ +#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> │ │ │ │ │ _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_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _F_, │ │ │ │ │ - _F_u_n_c_t_i_o_n_I_n_t_e_r_f_a_c_e_ _> │ │ │ │ │ -  Wrap a callable object as Dune::Function or Dune::VirtualFunction. │ │ │ │ │ - _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_:_:_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< GV │ │ │ │ │ + > > │ │ │ │ │ +  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. │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00149_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: functionfromcallable.hh Source File │ │ │ │ +dune-functions: bsplinebasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,85 +70,1311 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
functionfromcallable.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#ifndef DUNE_FUNCTIONS_COMMON_FUNCTION_FROM_CALLABLE_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_COMMON_FUNCTION_FROM_CALLABLE_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BSPLINEBASIS_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BSPLINEBASIS_HH
│ │ │ │
5
│ │ │ │ -
6#include <dune/common/function.hh>
│ │ │ │ -
7
│ │ │ │ - │ │ │ │ -
9
│ │ │ │ -
10
│ │ │ │ -
11namespace Dune {
│ │ │ │ -
12namespace Functions {
│ │ │ │ -
13
│ │ │ │ -
14
│ │ │ │ +
10#include <array>
│ │ │ │ +
11#include <numeric>
│ │ │ │ +
12
│ │ │ │ +
14#include <dune/common/dynmatrix.hh>
│ │ │ │
15
│ │ │ │ -
16template<class Signature, class F,
│ │ │ │ -
17 class FunctionInterface = typename Dune::VirtualFunction<
│ │ │ │ -
18 typename SignatureTraits<Signature>::RawDomain,
│ │ │ │ -
19 typename SignatureTraits<Signature>::RawRange> >
│ │ │ │ - │ │ │ │ -
21
│ │ │ │ -
37template<class Range, class Domain, class F, class FunctionInterface>
│ │ │ │ -
│ │ │ │ -
38class FunctionFromCallable<Range(Domain), F, FunctionInterface> :
│ │ │ │ -
39 public FunctionInterface
│ │ │ │ -
40{
│ │ │ │ -
41public:
│ │ │ │ -
42
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
53 f_(f)
│ │ │ │ -
54 {}
│ │ │ │ -
│ │ │ │ -
55
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
65 f_(f)
│ │ │ │ -
66 {}
│ │ │ │ -
│ │ │ │ -
67
│ │ │ │ -
│ │ │ │ -
73 void evaluate(const Domain& x, Range&y) const
│ │ │ │ -
74 {
│ │ │ │ -
75 y = f_(x);
│ │ │ │ -
76 }
│ │ │ │ -
│ │ │ │ -
77
│ │ │ │ -
78private:
│ │ │ │ -
79 F f_;
│ │ │ │ -
80};
│ │ │ │ -
│ │ │ │ -
81
│ │ │ │ -
82
│ │ │ │ -
83
│ │ │ │ -
84} // namespace Functions
│ │ │ │ -
85} // namespace Dune
│ │ │ │ -
86
│ │ │ │ -
87#endif //DUNE_FUNCTIONS_COMMON_FUNCTION_FROM_CALLABLE_HH
│ │ │ │ - │ │ │ │ +
16#include <dune/localfunctions/common/localbasis.hh>
│ │ │ │ +
17#include <dune/common/diagonalmatrix.hh>
│ │ │ │ +
18#include <dune/localfunctions/common/localkey.hh>
│ │ │ │ +
19#include <dune/localfunctions/common/localfiniteelementtraits.hh>
│ │ │ │ +
20#include <dune/geometry/type.hh>
│ │ │ │ + │ │ │ │ + │ │ │ │ +
23
│ │ │ │ +
24namespace Dune
│ │ │ │ +
25{
│ │ │ │ +
26namespace Functions {
│ │ │ │ +
27
│ │ │ │ +
28// A maze of dependencies between the different parts of this. We need a few forward declarations
│ │ │ │ +
29template<typename GV, typename R>
│ │ │ │ + │ │ │ │ +
31
│ │ │ │ +
32template<typename GV>
│ │ │ │ +
33class BSplinePreBasis;
│ │ │ │ +
34
│ │ │ │ +
35
│ │ │ │ +
44template<class GV, class R>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
46{
│ │ │ │ +
47 friend class BSplineLocalFiniteElement<GV,R>;
│ │ │ │ +
48
│ │ │ │ +
49 typedef typename GV::ctype D;
│ │ │ │ +
50 enum {dim = GV::dimension};
│ │ │ │ +
51public:
│ │ │ │ +
52
│ │ │ │ +
54 typedef LocalBasisTraits<D,dim,FieldVector<D,dim>,R,1,FieldVector<R,1>,
│ │ │ │ +
55 FieldMatrix<R,1,dim> > Traits;
│ │ │ │ +
56
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ +
63 : preBasis_(preBasis),
│ │ │ │ +
64 lFE_(lFE)
│ │ │ │ +
65 {}
│ │ │ │ +
│ │ │ │ +
66
│ │ │ │ +
│ │ │ │ +
70 void evaluateFunction (const FieldVector<D,dim>& in,
│ │ │ │ +
71 std::vector<FieldVector<R,1> >& out) const
│ │ │ │ +
72 {
│ │ │ │ +
73 FieldVector<D,dim> globalIn = offset_;
│ │ │ │ +
74 scaling_.umv(in,globalIn);
│ │ │ │ +
75
│ │ │ │ +
76 preBasis_.evaluateFunction(globalIn, out, lFE_.currentKnotSpan_);
│ │ │ │ +
77 }
│ │ │ │ +
│ │ │ │ +
78
│ │ │ │ +
│ │ │ │ +
82 void evaluateJacobian (const FieldVector<D,dim>& in,
│ │ │ │ +
83 std::vector<FieldMatrix<D,1,dim> >& out) const
│ │ │ │ +
84 {
│ │ │ │ +
85 FieldVector<D,dim> globalIn = offset_;
│ │ │ │ +
86 scaling_.umv(in,globalIn);
│ │ │ │ +
87
│ │ │ │ +
88 preBasis_.evaluateJacobian(globalIn, out, lFE_.currentKnotSpan_);
│ │ │ │ +
89
│ │ │ │ +
90 for (size_t i=0; i<out.size(); i++)
│ │ │ │ +
91 for (int j=0; j<dim; j++)
│ │ │ │ +
92 out[i][0][j] *= scaling_[j][j];
│ │ │ │ +
93 }
│ │ │ │ +
│ │ │ │ +
94
│ │ │ │ +
96 template<size_t k>
│ │ │ │ +
│ │ │ │ +
97 inline void evaluate (const typename std::array<int,k>& directions,
│ │ │ │ +
98 const typename Traits::DomainType& in,
│ │ │ │ +
99 std::vector<typename Traits::RangeType>& out) const
│ │ │ │ +
100 {
│ │ │ │ +
101 switch(k)
│ │ │ │ +
102 {
│ │ │ │ +
103 case 0:
│ │ │ │ +
104 evaluateFunction(in, out);
│ │ │ │ +
105 break;
│ │ │ │ +
106 case 1:
│ │ │ │ +
107 {
│ │ │ │ +
108 FieldVector<D,dim> globalIn = offset_;
│ │ │ │ +
109 scaling_.umv(in,globalIn);
│ │ │ │ +
110
│ │ │ │ +
111 preBasis_.evaluate(directions, globalIn, out, lFE_.currentKnotSpan_);
│ │ │ │ +
112
│ │ │ │ +
113 for (size_t i=0; i<out.size(); i++)
│ │ │ │ +
114 out[i][0] *= scaling_[directions[0]][directions[0]];
│ │ │ │ +
115 break;
│ │ │ │ +
116 }
│ │ │ │ +
117 case 2:
│ │ │ │ +
118 {
│ │ │ │ +
119 FieldVector<D,dim> globalIn = offset_;
│ │ │ │ +
120 scaling_.umv(in,globalIn);
│ │ │ │ +
121
│ │ │ │ +
122 preBasis_.evaluate(directions, globalIn, out, lFE_.currentKnotSpan_);
│ │ │ │ +
123
│ │ │ │ +
124 for (size_t i=0; i<out.size(); i++)
│ │ │ │ +
125 out[i][0] *= scaling_[directions[0]][directions[0]]*scaling_[directions[1]][directions[1]];
│ │ │ │ +
126 break;
│ │ │ │ +
127 }
│ │ │ │ +
128 default:
│ │ │ │ +
129 DUNE_THROW(NotImplemented, "B-Spline derivatives of order " << k << " not implemented yet!");
│ │ │ │ +
130 }
│ │ │ │ +
131 }
│ │ │ │ +
│ │ │ │ +
132
│ │ │ │ +
│ │ │ │ +
140 unsigned int order () const
│ │ │ │ +
141 {
│ │ │ │ +
142 return *std::max_element(preBasis_.order_.begin(), preBasis_.order_.end());
│ │ │ │ +
143 }
│ │ │ │ +
│ │ │ │ +
144
│ │ │ │ +
│ │ │ │ +
147 std::size_t size() const
│ │ │ │ +
148 {
│ │ │ │ +
149 return lFE_.size();
│ │ │ │ +
150 }
│ │ │ │ +
│ │ │ │ +
151
│ │ │ │ +
152private:
│ │ │ │ +
153 const BSplinePreBasis<GV>& preBasis_;
│ │ │ │ +
154
│ │ │ │ + │ │ │ │ +
156
│ │ │ │ +
157 // Coordinates in a single knot span differ from coordinates on the B-spline patch
│ │ │ │ +
158 // by an affine transformation. This transformation is stored in offset_ and scaling_.
│ │ │ │ +
159 FieldVector<D,dim> offset_;
│ │ │ │ +
160 DiagonalMatrix<D,dim> scaling_;
│ │ │ │ +
161};
│ │ │ │ +
│ │ │ │ +
162
│ │ │ │ +
176template<int dim>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
178{
│ │ │ │ +
179 // Return i as a d-digit number in the (k+1)-nary system
│ │ │ │ +
180 std::array<unsigned int,dim> multiindex (unsigned int i) const
│ │ │ │ +
181 {
│ │ │ │ +
182 std::array<unsigned int,dim> alpha;
│ │ │ │ +
183 for (int j=0; j<dim; j++)
│ │ │ │ +
184 {
│ │ │ │ +
185 alpha[j] = i % sizes_[j];
│ │ │ │ +
186 i = i/sizes_[j];
│ │ │ │ +
187 }
│ │ │ │ +
188 return alpha;
│ │ │ │ +
189 }
│ │ │ │ +
190
│ │ │ │ +
192 void setup1d(std::vector<unsigned int>& subEntity)
│ │ │ │ +
193 {
│ │ │ │ +
194 if (sizes_[0]==1)
│ │ │ │ +
195 {
│ │ │ │ +
196 subEntity[0] = 0;
│ │ │ │ +
197 return;
│ │ │ │ +
198 }
│ │ │ │ +
199
│ │ │ │ +
200 /* edge and vertex numbering
│ │ │ │ +
201 0----0----1
│ │ │ │ +
202 */
│ │ │ │ +
203 unsigned lastIndex=0;
│ │ │ │ +
204 subEntity[lastIndex++] = 0; // corner 0
│ │ │ │ +
205 for (unsigned i = 0; i < sizes_[0] - 2; ++i)
│ │ │ │ +
206 subEntity[lastIndex++] = 0; // inner dofs of element (0)
│ │ │ │ +
207
│ │ │ │ +
208 subEntity[lastIndex++] = 1; // corner 1
│ │ │ │ +
209
│ │ │ │ +
210 assert(size()==lastIndex);
│ │ │ │ +
211 }
│ │ │ │ +
212
│ │ │ │ +
213 void setup2d(std::vector<unsigned int>& subEntity)
│ │ │ │ +
214 {
│ │ │ │ +
215 unsigned lastIndex=0;
│ │ │ │ +
216
│ │ │ │ +
217 // LocalKey: entity number , entity codim, dof indices within each entity
│ │ │ │ +
218 /* edge and vertex numbering
│ │ │ │ +
219 2----3----3
│ │ │ │ +
220 | |
│ │ │ │ +
221 | |
│ │ │ │ +
222 0 1
│ │ │ │ +
223 | |
│ │ │ │ +
224 | |
│ │ │ │ +
225 0----2----1
│ │ │ │ +
226 */
│ │ │ │ +
227
│ │ │ │ +
228 // lower edge (2)
│ │ │ │ +
229 subEntity[lastIndex++] = 0; // corner 0
│ │ │ │ +
230 for (unsigned i = 0; i < sizes_[0]-2; ++i)
│ │ │ │ +
231 subEntity[lastIndex++] = 2; // inner dofs of lower edge (2)
│ │ │ │ +
232
│ │ │ │ +
233 subEntity[lastIndex++] = 1; // corner 1
│ │ │ │ +
234
│ │ │ │ +
235 // iterate from bottom to top over inner edge dofs
│ │ │ │ +
236 for (unsigned e = 0; e < sizes_[1]-2; ++e)
│ │ │ │ +
237 {
│ │ │ │ +
238 subEntity[lastIndex++] = 0; // left edge (0)
│ │ │ │ +
239 for (unsigned i = 0; i < sizes_[0]-2; ++i)
│ │ │ │ +
240 subEntity[lastIndex++] = 0; // face dofs
│ │ │ │ +
241 subEntity[lastIndex++] = 1; // right edge (1)
│ │ │ │ +
242 }
│ │ │ │ +
243
│ │ │ │ +
244 // upper edge (3)
│ │ │ │ +
245 subEntity[lastIndex++] = 2; // corner 2
│ │ │ │ +
246 for (unsigned i = 0; i < sizes_[0]-2; ++i)
│ │ │ │ +
247 subEntity[lastIndex++] = 3; // inner dofs of upper edge (3)
│ │ │ │ +
248
│ │ │ │ +
249 subEntity[lastIndex++] = 3; // corner 3
│ │ │ │ +
250
│ │ │ │ +
251 assert(size()==lastIndex);
│ │ │ │ +
252 }
│ │ │ │ +
253
│ │ │ │ +
254
│ │ │ │ +
255public:
│ │ │ │ +
│ │ │ │ +
256 void init(const std::array<unsigned,dim>& sizes)
│ │ │ │ +
257 {
│ │ │ │ +
258 sizes_ = sizes;
│ │ │ │ +
259
│ │ │ │ +
260 li_.resize(size());
│ │ │ │ +
261
│ │ │ │ +
262 // Set up array of codimension-per-dof-number
│ │ │ │ +
263 std::vector<unsigned int> codim(li_.size());
│ │ │ │ +
264
│ │ │ │ +
265 for (std::size_t i=0; i<codim.size(); i++)
│ │ │ │ +
266 {
│ │ │ │ +
267 codim[i] = 0;
│ │ │ │ +
268 // Codimension gets increased by 1 for each coordinate direction
│ │ │ │ +
269 // where dof is on boundary
│ │ │ │ +
270 std::array<unsigned int,dim> mIdx = multiindex(i);
│ │ │ │ +
271 for (int j=0; j<dim; j++)
│ │ │ │ +
272 if (mIdx[j]==0 or mIdx[j]==sizes[j]-1)
│ │ │ │ +
273 codim[i]++;
│ │ │ │ +
274 }
│ │ │ │ +
275
│ │ │ │ +
276 // Set up index vector (the index of the dof in the set of dofs of a given subentity)
│ │ │ │ +
277 // Algorithm: the 'index' has the same ordering as the dof number 'i'.
│ │ │ │ +
278 // To make it consecutive we interpret 'i' in the (k+1)-adic system, omit all digits
│ │ │ │ +
279 // that correspond to axes where the dof is on the element boundary, and transform the
│ │ │ │ +
280 // rest to the (k-1)-adic system.
│ │ │ │ +
281 std::vector<unsigned int> index(size());
│ │ │ │ +
282
│ │ │ │ +
283 for (std::size_t i=0; i<index.size(); i++)
│ │ │ │ +
284 {
│ │ │ │ +
285 index[i] = 0;
│ │ │ │ +
286
│ │ │ │ +
287 std::array<unsigned int,dim> mIdx = multiindex(i);
│ │ │ │ +
288
│ │ │ │ +
289 for (int j=dim-1; j>=0; j--)
│ │ │ │ +
290 if (mIdx[j]>0 and mIdx[j]<sizes[j]-1)
│ │ │ │ +
291 index[i] = (sizes[j]-1)*index[i] + (mIdx[j]-1);
│ │ │ │ +
292 }
│ │ │ │ +
293
│ │ │ │ +
294 // Set up entity and dof numbers for each (supported) dimension separately
│ │ │ │ +
295 std::vector<unsigned int> subEntity(li_.size());
│ │ │ │ +
296
│ │ │ │ +
297 if (subEntity.size() > 0)
│ │ │ │ +
298 {
│ │ │ │ +
299 if (dim==1) {
│ │ │ │ +
300
│ │ │ │ +
301 setup1d(subEntity);
│ │ │ │ +
302
│ │ │ │ +
303 } else if (dim==2 and sizes_[0]>1 and sizes_[1]>1) {
│ │ │ │ +
304
│ │ │ │ +
305 setup2d(subEntity);
│ │ │ │ +
306
│ │ │ │ +
307 }
│ │ │ │ +
308 }
│ │ │ │ +
309
│ │ │ │ +
310 for (size_t i=0; i<li_.size(); i++)
│ │ │ │ +
311 li_[i] = LocalKey(subEntity[i], codim[i], index[i]);
│ │ │ │ +
312 }
│ │ │ │ +
│ │ │ │ +
313
│ │ │ │ +
│ │ │ │ +
315 std::size_t size () const
│ │ │ │ +
316 {
│ │ │ │ +
317 return std::accumulate(sizes_.begin(), sizes_.end(), 1, std::multiplies<unsigned int>());
│ │ │ │ +
318 }
│ │ │ │ +
│ │ │ │ +
319
│ │ │ │ +
│ │ │ │ +
321 const LocalKey& localKey (std::size_t i) const
│ │ │ │ +
322 {
│ │ │ │ +
323 return li_[i];
│ │ │ │ +
324 }
│ │ │ │ +
│ │ │ │ +
325
│ │ │ │ +
326private:
│ │ │ │ +
327
│ │ │ │ +
328 // Number of shape functions on this element per coordinate direction
│ │ │ │ +
329 std::array<unsigned, dim> sizes_;
│ │ │ │ +
330
│ │ │ │ +
331 std::vector<LocalKey> li_;
│ │ │ │ +
332};
│ │ │ │ +
│ │ │ │ +
333
│ │ │ │ +
338template<int dim, class LB>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
340{
│ │ │ │ +
341public:
│ │ │ │ +
343 template<typename F, typename C>
│ │ │ │ +
│ │ │ │ +
344 void interpolate (const F& f, std::vector<C>& out) const
│ │ │ │ +
345 {
│ │ │ │ +
346 DUNE_THROW(NotImplemented, "BSplineLocalInterpolation::interpolate");
│ │ │ │ +
347 }
│ │ │ │ +
│ │ │ │ +
348
│ │ │ │ +
349};
│ │ │ │ +
│ │ │ │ +
350
│ │ │ │ +
360template<class GV, class R>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
362{
│ │ │ │ +
363 typedef typename GV::ctype D;
│ │ │ │ +
364 enum {dim = GV::dimension};
│ │ │ │ +
365 friend class BSplineLocalBasis<GV,R>;
│ │ │ │ +
366public:
│ │ │ │ +
367
│ │ │ │ +
370 typedef LocalFiniteElementTraits<BSplineLocalBasis<GV,R>,
│ │ │ │ + │ │ │ │ + │ │ │ │ +
373
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
377 : preBasis_(preBasis),
│ │ │ │ +
378 localBasis_(preBasis,*this)
│ │ │ │ +
379 {}
│ │ │ │ +
│ │ │ │ +
380
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
384 : preBasis_(other.preBasis_),
│ │ │ │ + │ │ │ │ +
386 {}
│ │ │ │ +
│ │ │ │ +
387
│ │ │ │ +
│ │ │ │ +
394 void bind(const std::array<unsigned,dim>& elementIdx)
│ │ │ │ +
395 {
│ │ │ │ +
396 /* \todo In the long run we need to precompute a table for this */
│ │ │ │ +
397 for (size_t i=0; i<elementIdx.size(); i++)
│ │ │ │ +
398 {
│ │ │ │ +
399 currentKnotSpan_[i] = 0;
│ │ │ │ +
400
│ │ │ │ +
401 // Skip over degenerate knot spans
│ │ │ │ +
402 while (preBasis_.knotVectors_[i][currentKnotSpan_[i]+1] < preBasis_.knotVectors_[i][currentKnotSpan_[i]]+1e-8)
│ │ │ │ +
403 currentKnotSpan_[i]++;
│ │ │ │ +
404
│ │ │ │ +
405 for (size_t j=0; j<elementIdx[i]; j++)
│ │ │ │ +
406 {
│ │ │ │ +
407 currentKnotSpan_[i]++;
│ │ │ │ +
408
│ │ │ │ +
409 // Skip over degenerate knot spans
│ │ │ │ +
410 while (preBasis_.knotVectors_[i][currentKnotSpan_[i]+1] < preBasis_.knotVectors_[i][currentKnotSpan_[i]]+1e-8)
│ │ │ │ +
411 currentKnotSpan_[i]++;
│ │ │ │ +
412 }
│ │ │ │ +
413
│ │ │ │ +
414 // Compute the geometric transformation from knotspan-local to global coordinates
│ │ │ │ +
415 localBasis_.offset_[i] = preBasis_.knotVectors_[i][currentKnotSpan_[i]];
│ │ │ │ +
416 localBasis_.scaling_[i][i] = preBasis_.knotVectors_[i][currentKnotSpan_[i]+1] - preBasis_.knotVectors_[i][currentKnotSpan_[i]];
│ │ │ │ +
417 }
│ │ │ │ +
418
│ │ │ │ +
419 // Set up the LocalCoefficients object
│ │ │ │ +
420 std::array<unsigned int, dim> sizes;
│ │ │ │ +
421 for (size_t i=0; i<dim; i++)
│ │ │ │ +
422 sizes[i] = size(i);
│ │ │ │ +
423 localCoefficients_.init(sizes);
│ │ │ │ +
424 }
│ │ │ │ +
│ │ │ │ +
425
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
428 {
│ │ │ │ +
429 return localBasis_;
│ │ │ │ +
430 }
│ │ │ │ +
│ │ │ │ +
431
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
434 {
│ │ │ │ +
435 return localCoefficients_;
│ │ │ │ +
436 }
│ │ │ │ +
│ │ │ │ +
437
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
440 {
│ │ │ │ +
441 return localInterpolation_;
│ │ │ │ +
442 }
│ │ │ │ +
│ │ │ │ +
443
│ │ │ │ +
│ │ │ │ +
445 unsigned size () const
│ │ │ │ +
446 {
│ │ │ │ +
447 std::size_t r = 1;
│ │ │ │ +
448 for (int i=0; i<dim; i++)
│ │ │ │ +
449 r *= size(i);
│ │ │ │ +
450 return r;
│ │ │ │ +
451 }
│ │ │ │ +
│ │ │ │ +
452
│ │ │ │ +
│ │ │ │ +
455 GeometryType type () const
│ │ │ │ +
456 {
│ │ │ │ +
457 return GeometryTypes::cube(dim);
│ │ │ │ +
458 }
│ │ │ │ +
│ │ │ │ +
459
│ │ │ │ +
460//private:
│ │ │ │ +
461
│ │ │ │ +
│ │ │ │ +
463 unsigned int size(int i) const
│ │ │ │ +
464 {
│ │ │ │ +
465 const auto& order = preBasis_.order_;
│ │ │ │ +
466 unsigned int r = order[i]+1; // The 'normal' value
│ │ │ │ +
467 if (currentKnotSpan_[i]<order[i]) // Less near the left end of the knot vector
│ │ │ │ +
468 r -= (order[i] - currentKnotSpan_[i]);
│ │ │ │ +
469 if ( order[i] > (preBasis_.knotVectors_[i].size() - currentKnotSpan_[i] - 2) )
│ │ │ │ +
470 r -= order[i] - (preBasis_.knotVectors_[i].size() - currentKnotSpan_[i] - 2);
│ │ │ │ +
471 return r;
│ │ │ │ +
472 }
│ │ │ │ +
│ │ │ │ +
473
│ │ │ │ + │ │ │ │ +
475
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
479
│ │ │ │ +
480 // The knot span we are bound to
│ │ │ │ +
481 std::array<unsigned,dim> currentKnotSpan_;
│ │ │ │ +
482};
│ │ │ │ +
│ │ │ │ +
483
│ │ │ │ +
484
│ │ │ │ +
485template<typename GV>
│ │ │ │ +
486class BSplineNode;
│ │ │ │ +
487
│ │ │ │ +
497template<typename GV>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
499{
│ │ │ │ +
500 static const int dim = GV::dimension;
│ │ │ │ +
501
│ │ │ │ +
503 class MultiDigitCounter
│ │ │ │ +
504 {
│ │ │ │ +
505 public:
│ │ │ │ +
506
│ │ │ │ +
510 MultiDigitCounter(const std::array<unsigned int,dim>& limits)
│ │ │ │ +
511 : limits_(limits)
│ │ │ │ +
512 {
│ │ │ │ +
513 std::fill(counter_.begin(), counter_.end(), 0);
│ │ │ │ +
514 }
│ │ │ │ +
515
│ │ │ │ +
517 MultiDigitCounter& operator++()
│ │ │ │ +
518 {
│ │ │ │ +
519 for (int i=0; i<dim; i++)
│ │ │ │ +
520 {
│ │ │ │ +
521 ++counter_[i];
│ │ │ │ +
522
│ │ │ │ +
523 // no overflow?
│ │ │ │ +
524 if (counter_[i] < limits_[i])
│ │ │ │ +
525 break;
│ │ │ │ +
526
│ │ │ │ +
527 counter_[i] = 0;
│ │ │ │ +
528 }
│ │ │ │ +
529 return *this;
│ │ │ │ +
530 }
│ │ │ │ +
531
│ │ │ │ +
533 const unsigned int& operator[](int i) const
│ │ │ │ +
534 {
│ │ │ │ +
535 return counter_[i];
│ │ │ │ +
536 }
│ │ │ │ +
537
│ │ │ │ +
539 unsigned int cycle() const
│ │ │ │ +
540 {
│ │ │ │ +
541 unsigned int r = 1;
│ │ │ │ +
542 for (int i=0; i<dim; i++)
│ │ │ │ +
543 r *= limits_[i];
│ │ │ │ +
544 return r;
│ │ │ │ +
545 }
│ │ │ │ +
546
│ │ │ │ +
547 private:
│ │ │ │ +
548
│ │ │ │ +
550 const std::array<unsigned int,dim> limits_;
│ │ │ │ +
551
│ │ │ │ +
553 std::array<unsigned int,dim> counter_;
│ │ │ │ +
554
│ │ │ │ +
555 };
│ │ │ │ +
556
│ │ │ │ +
557public:
│ │ │ │ +
558
│ │ │ │ +
560 using GridView = GV;
│ │ │ │ +
561 using size_type = std::size_t;
│ │ │ │ +
562
│ │ │ │ + │ │ │ │ +
564
│ │ │ │ +
565 static constexpr size_type maxMultiIndexSize = 1;
│ │ │ │ +
566 static constexpr size_type minMultiIndexSize = 1;
│ │ │ │ +
567 static constexpr size_type multiIndexBufferSize = 1;
│ │ │ │ +
568
│ │ │ │ +
569 // Type used for function values
│ │ │ │ +
570 using R = double;
│ │ │ │ +
571
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
591 const std::vector<double>& knotVector,
│ │ │ │ +
592 unsigned int order,
│ │ │ │ +
593 bool makeOpen = true)
│ │ │ │ + │ │ │ │ +
595 {
│ │ │ │ +
596 // \todo Detection of duplicate knots
│ │ │ │ +
597 std::fill(elements_.begin(), elements_.end(), knotVector.size()-1);
│ │ │ │ +
598
│ │ │ │ +
599 // Mediocre sanity check: we don't know the number of grid elements in each direction.
│ │ │ │ +
600 // but at least we know the total number of elements.
│ │ │ │ +
601 assert( std::accumulate(elements_.begin(), elements_.end(), 1, std::multiplies<unsigned>()) == gridView_.size(0) );
│ │ │ │ +
602
│ │ │ │ +
603 for (int i=0; i<dim; i++)
│ │ │ │ +
604 {
│ │ │ │ +
605 // Prepend the correct number of additional knots to open the knot vector
│ │ │ │ +
607 if (makeOpen)
│ │ │ │ +
608 for (unsigned int j=0; j<order; j++)
│ │ │ │ +
609 knotVectors_[i].push_back(knotVector[0]);
│ │ │ │ +
610
│ │ │ │ +
611 knotVectors_[i].insert(knotVectors_[i].end(), knotVector.begin(), knotVector.end());
│ │ │ │ +
612
│ │ │ │ +
613 if (makeOpen)
│ │ │ │ +
614 for (unsigned int j=0; j<order; j++)
│ │ │ │ +
615 knotVectors_[i].push_back(knotVector.back());
│ │ │ │ +
616 }
│ │ │ │ +
617
│ │ │ │ +
618 std::fill(order_.begin(), order_.end(), order);
│ │ │ │ +
619 }
│ │ │ │ +
│ │ │ │ +
620
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
643 const FieldVector<double,dim>& lowerLeft,
│ │ │ │ +
644 const FieldVector<double,dim>& upperRight,
│ │ │ │ +
645 const std::array<unsigned int,dim>& elements,
│ │ │ │ +
646 unsigned int order,
│ │ │ │ +
647 bool makeOpen = true)
│ │ │ │ +
648 : elements_(elements),
│ │ │ │ + │ │ │ │ +
650 {
│ │ │ │ +
651 // Mediocre sanity check: we don't know the number of grid elements in each direction.
│ │ │ │ +
652 // but at least we know the total number of elements.
│ │ │ │ +
653 assert( std::accumulate(elements_.begin(), elements_.end(), 1, std::multiplies<unsigned>()) == gridView_.size(0) );
│ │ │ │ +
654
│ │ │ │ +
655 for (int i=0; i<dim; i++)
│ │ │ │ +
656 {
│ │ │ │ +
657 // Prepend the correct number of additional knots to open the knot vector
│ │ │ │ +
659 if (makeOpen)
│ │ │ │ +
660 for (unsigned int j=0; j<order; j++)
│ │ │ │ +
661 knotVectors_[i].push_back(lowerLeft[i]);
│ │ │ │ +
662
│ │ │ │ +
663 // Construct the actual knot vector
│ │ │ │ +
664 for (size_t j=0; j<elements[i]+1; j++)
│ │ │ │ +
665 knotVectors_[i].push_back(lowerLeft[i] + j*(upperRight[i]-lowerLeft[i]) / elements[i]);
│ │ │ │ +
666
│ │ │ │ +
667 if (makeOpen)
│ │ │ │ +
668 for (unsigned int j=0; j<order; j++)
│ │ │ │ +
669 knotVectors_[i].push_back(upperRight[i]);
│ │ │ │ +
670 }
│ │ │ │ +
671
│ │ │ │ +
672 std::fill(order_.begin(), order_.end(), order);
│ │ │ │ +
673 }
│ │ │ │ +
│ │ │ │ +
674
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
677 {}
│ │ │ │ +
│ │ │ │ +
678
│ │ │ │ +
│ │ │ │ +
680 const GridView& gridView() const
│ │ │ │ +
681 {
│ │ │ │ +
682 return gridView_;
│ │ │ │ +
683 }
│ │ │ │ +
│ │ │ │ +
684
│ │ │ │ +
│ │ │ │ +
686 void update(const GridView& gv)
│ │ │ │ +
687 {
│ │ │ │ +
688 gridView_ = gv;
│ │ │ │ +
689 }
│ │ │ │ +
│ │ │ │ +
690
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
695 {
│ │ │ │ +
696 return Node{this};
│ │ │ │ +
697 }
│ │ │ │ +
│ │ │ │ +
698
│ │ │ │ +
699 // Ideally this method should be implemented as
│ │ │ │ +
700 //
│ │ │ │ +
701 // template<class SizePrefix>
│ │ │ │ +
702 // size_type size(const SizePrefix& prefix) const
│ │ │ │ +
703 //
│ │ │ │ +
704 // But leads to ambiguity with the other size method:
│ │ │ │ +
705 //
│ │ │ │ +
706 // unsigned int size (size_t d) const
│ │ │ │ +
707 //
│ │ │ │ +
708 // Once the latter is removed, this implementation should be changed.
│ │ │ │ +
709
│ │ │ │ +
711 template<class ST, int i>
│ │ │ │ +
│ │ │ │ +
712 size_type size(const Dune::ReservedVector<ST, i>& prefix) const
│ │ │ │ +
713 {
│ │ │ │ +
714 assert(prefix.size() == 0 || prefix.size() == 1);
│ │ │ │ +
715 return (prefix.size() == 0) ? size() : 0;
│ │ │ │ +
716 }
│ │ │ │ +
│ │ │ │ +
717
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
720 {
│ │ │ │ +
721 return size();
│ │ │ │ +
722 }
│ │ │ │ +
│ │ │ │ +
723
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
726 {
│ │ │ │ +
727 size_type result = 1;
│ │ │ │ +
728 for (int i=0; i<dim; i++)
│ │ │ │ +
729 result *= order_[i]+1;
│ │ │ │ +
730 return result;
│ │ │ │ +
731 }
│ │ │ │ +
│ │ │ │ +
732
│ │ │ │ +
734 template<typename It>
│ │ │ │ +
│ │ │ │ +
735 It indices(const Node& node, It it) const
│ │ │ │ +
736 {
│ │ │ │ +
737 // Local degrees of freedom are arranged in a lattice.
│ │ │ │ +
738 // We need the lattice dimensions to be able to compute lattice coordinates from a local index
│ │ │ │ +
739 std::array<unsigned int, dim> localSizes;
│ │ │ │ +
740 for (int i=0; i<dim; i++)
│ │ │ │ +
741 localSizes[i] = node.finiteElement().size(i);
│ │ │ │ +
742 for (size_type i = 0, end = node.size() ; i < end ; ++i, ++it)
│ │ │ │ +
743 {
│ │ │ │ +
744 std::array<unsigned int,dim> localIJK = getIJK(i, localSizes);
│ │ │ │ +
745
│ │ │ │ +
746 const auto currentKnotSpan = node.finiteElement().currentKnotSpan_;
│ │ │ │ +
747 const auto order = order_;
│ │ │ │ +
748
│ │ │ │ +
749 std::array<unsigned int,dim> globalIJK;
│ │ │ │ +
750 for (int i=0; i<dim; i++)
│ │ │ │ +
751 globalIJK[i] = std::max((int)currentKnotSpan[i] - (int)order[i], 0) + localIJK[i]; // needs to be a signed type!
│ │ │ │ +
752
│ │ │ │ +
753 // Make one global flat index from the globalIJK tuple
│ │ │ │ +
754 size_type globalIdx = globalIJK[dim-1];
│ │ │ │ +
755
│ │ │ │ +
756 for (int i=dim-2; i>=0; i--)
│ │ │ │ +
757 globalIdx = globalIdx * size(i) + globalIJK[i];
│ │ │ │ +
758
│ │ │ │ +
759 *it = {{globalIdx}};
│ │ │ │ +
760 }
│ │ │ │ +
761 return it;
│ │ │ │ +
762 }
│ │ │ │ +
│ │ │ │ +
763
│ │ │ │ +
│ │ │ │ +
765 unsigned int size () const
│ │ │ │ +
766 {
│ │ │ │ +
767 unsigned int result = 1;
│ │ │ │ +
768 for (size_t i=0; i<dim; i++)
│ │ │ │ +
769 result *= size(i);
│ │ │ │ +
770 return result;
│ │ │ │ +
771 }
│ │ │ │ +
│ │ │ │ +
772
│ │ │ │ +
│ │ │ │ +
774 unsigned int size (size_t d) const
│ │ │ │ +
775 {
│ │ │ │ +
776 return knotVectors_[d].size() - order_[d] - 1;
│ │ │ │ +
777 }
│ │ │ │ +
│ │ │ │ +
778
│ │ │ │ +
│ │ │ │ +
781 void evaluateFunction (const FieldVector<typename GV::ctype,dim>& in,
│ │ │ │ +
782 std::vector<FieldVector<R,1> >& out,
│ │ │ │ +
783 const std::array<unsigned,dim>& currentKnotSpan) const
│ │ │ │ +
784 {
│ │ │ │ +
785 // Evaluate
│ │ │ │ +
786 std::array<std::vector<R>, dim> oneDValues;
│ │ │ │ +
787
│ │ │ │ +
788 for (size_t i=0; i<dim; i++)
│ │ │ │ +
789 evaluateFunction(in[i], oneDValues[i], knotVectors_[i], order_[i], currentKnotSpan[i]);
│ │ │ │ +
790
│ │ │ │ +
791 std::array<unsigned int, dim> limits;
│ │ │ │ +
792 for (int i=0; i<dim; i++)
│ │ │ │ +
793 limits[i] = oneDValues[i].size();
│ │ │ │ +
794
│ │ │ │ +
795 MultiDigitCounter ijkCounter(limits);
│ │ │ │ +
796
│ │ │ │ +
797 out.resize(ijkCounter.cycle());
│ │ │ │ +
798
│ │ │ │ +
799 for (size_t i=0; i<out.size(); i++, ++ijkCounter)
│ │ │ │ +
800 {
│ │ │ │ +
801 out[i] = R(1.0);
│ │ │ │ +
802 for (size_t j=0; j<dim; j++)
│ │ │ │ +
803 out[i] *= oneDValues[j][ijkCounter[j]];
│ │ │ │ +
804 }
│ │ │ │ +
805 }
│ │ │ │ +
│ │ │ │ +
806
│ │ │ │ +
│ │ │ │ +
812 void evaluateJacobian (const FieldVector<typename GV::ctype,dim>& in,
│ │ │ │ +
813 std::vector<FieldMatrix<R,1,dim> >& out,
│ │ │ │ +
814 const std::array<unsigned,dim>& currentKnotSpan) const
│ │ │ │ +
815 {
│ │ │ │ +
816 // How many shape functions to we have in each coordinate direction?
│ │ │ │ +
817 std::array<unsigned int, dim> limits;
│ │ │ │ +
818 for (int i=0; i<dim; i++)
│ │ │ │ +
819 {
│ │ │ │ +
820 limits[i] = order_[i]+1; // The 'standard' value away from the boundaries of the knot vector
│ │ │ │ +
821 if (currentKnotSpan[i]<order_[i])
│ │ │ │ +
822 limits[i] -= (order_[i] - currentKnotSpan[i]);
│ │ │ │ +
823 if ( order_[i] > (knotVectors_[i].size() - currentKnotSpan[i] - 2) )
│ │ │ │ +
824 limits[i] -= order_[i] - (knotVectors_[i].size() - currentKnotSpan[i] - 2);
│ │ │ │ +
825 }
│ │ │ │ +
826
│ │ │ │ +
827 // The lowest knot spans that we need values from
│ │ │ │ +
828 std::array<unsigned int, dim> offset;
│ │ │ │ +
829 for (int i=0; i<dim; i++)
│ │ │ │ +
830 offset[i] = std::max((int)(currentKnotSpan[i] - order_[i]),0);
│ │ │ │ +
831
│ │ │ │ +
832 // Evaluate 1d function values (needed for the product rule)
│ │ │ │ +
833 std::array<std::vector<R>, dim> oneDValues;
│ │ │ │ +
834
│ │ │ │ +
835 // Evaluate 1d function values of one order lower (needed for the derivative formula)
│ │ │ │ +
836 std::array<std::vector<R>, dim> lowOrderOneDValues;
│ │ │ │ +
837
│ │ │ │ +
838 std::array<DynamicMatrix<R>, dim> values;
│ │ │ │ +
839
│ │ │ │ +
840 for (size_t i=0; i<dim; i++)
│ │ │ │ +
841 {
│ │ │ │ +
842 evaluateFunctionFull(in[i], values[i], knotVectors_[i], order_[i], currentKnotSpan[i]);
│ │ │ │ +
843 oneDValues[i].resize(knotVectors_[i].size()-order_[i]-1);
│ │ │ │ +
844 for (size_t j=0; j<oneDValues[i].size(); j++)
│ │ │ │ +
845 oneDValues[i][j] = values[i][order_[i]][j];
│ │ │ │ +
846
│ │ │ │ +
847 if (order_[i]!=0)
│ │ │ │ +
848 {
│ │ │ │ +
849 lowOrderOneDValues[i].resize(knotVectors_[i].size()-(order_[i]-1)-1);
│ │ │ │ +
850 for (size_t j=0; j<lowOrderOneDValues[i].size(); j++)
│ │ │ │ +
851 lowOrderOneDValues[i][j] = values[i][order_[i]-1][j];
│ │ │ │ +
852 }
│ │ │ │ +
853 }
│ │ │ │ +
854
│ │ │ │ +
855
│ │ │ │ +
856 // Evaluate 1d function derivatives
│ │ │ │ +
857 std::array<std::vector<R>, dim> oneDDerivatives;
│ │ │ │ +
858 for (size_t i=0; i<dim; i++)
│ │ │ │ +
859 {
│ │ │ │ +
860 oneDDerivatives[i].resize(limits[i]);
│ │ │ │ +
861
│ │ │ │ +
862 if (order_[i]==0) // order-zero functions are piecewise constant, hence all derivatives are zero
│ │ │ │ +
863 std::fill(oneDDerivatives[i].begin(), oneDDerivatives[i].end(), R(0.0));
│ │ │ │ +
864 else
│ │ │ │ +
865 {
│ │ │ │ +
866 for (size_t j=offset[i]; j<offset[i]+limits[i]; j++)
│ │ │ │ +
867 {
│ │ │ │ +
868 R derivativeAddend1 = lowOrderOneDValues[i][j] / (knotVectors_[i][j+order_[i]]-knotVectors_[i][j]);
│ │ │ │ +
869 R derivativeAddend2 = lowOrderOneDValues[i][j+1] / (knotVectors_[i][j+order_[i]+1]-knotVectors_[i][j+1]);
│ │ │ │ +
870 // The two previous terms may evaluate as 0/0. This is to be interpreted as 0.
│ │ │ │ +
871 if (std::isnan(derivativeAddend1))
│ │ │ │ +
872 derivativeAddend1 = 0;
│ │ │ │ +
873 if (std::isnan(derivativeAddend2))
│ │ │ │ +
874 derivativeAddend2 = 0;
│ │ │ │ +
875 oneDDerivatives[i][j-offset[i]] = order_[i] * ( derivativeAddend1 - derivativeAddend2 );
│ │ │ │ +
876 }
│ │ │ │ +
877 }
│ │ │ │ +
878 }
│ │ │ │ +
879
│ │ │ │ +
880 // Working towards computing only the parts that we really need:
│ │ │ │ +
881 // Let's copy them out into a separate array
│ │ │ │ +
882 std::array<std::vector<R>, dim> oneDValuesShort;
│ │ │ │ +
883
│ │ │ │ +
884 for (int i=0; i<dim; i++)
│ │ │ │ +
885 {
│ │ │ │ +
886 oneDValuesShort[i].resize(limits[i]);
│ │ │ │ +
887
│ │ │ │ +
888 for (size_t j=0; j<limits[i]; j++)
│ │ │ │ +
889 oneDValuesShort[i][j] = oneDValues[i][offset[i] + j];
│ │ │ │ +
890 }
│ │ │ │ +
891
│ │ │ │ +
892
│ │ │ │ +
893
│ │ │ │ +
894 // Set up a multi-index to go from consecutive indices to integer coordinates
│ │ │ │ +
895 MultiDigitCounter ijkCounter(limits);
│ │ │ │ +
896
│ │ │ │ +
897 out.resize(ijkCounter.cycle());
│ │ │ │ +
898
│ │ │ │ +
899 // Complete Jacobian is given by the product rule
│ │ │ │ +
900 for (size_t i=0; i<out.size(); i++, ++ijkCounter)
│ │ │ │ +
901 for (int j=0; j<dim; j++)
│ │ │ │ +
902 {
│ │ │ │ +
903 out[i][0][j] = 1.0;
│ │ │ │ +
904 for (int k=0; k<dim; k++)
│ │ │ │ +
905 out[i][0][j] *= (j==k) ? oneDDerivatives[k][ijkCounter[k]]
│ │ │ │ +
906 : oneDValuesShort[k][ijkCounter[k]];
│ │ │ │ +
907 }
│ │ │ │ +
908
│ │ │ │ +
909 }
│ │ │ │ +
│ │ │ │ +
910
│ │ │ │ +
912 template <size_type k>
│ │ │ │ +
│ │ │ │ +
913 void evaluate(const typename std::array<int,k>& directions,
│ │ │ │ +
914 const FieldVector<typename GV::ctype,dim>& in,
│ │ │ │ +
915 std::vector<FieldVector<R,1> >& out,
│ │ │ │ +
916 const std::array<unsigned,dim>& currentKnotSpan) const
│ │ │ │ +
917 {
│ │ │ │ +
918 if (k != 1 && k != 2)
│ │ │ │ +
919 DUNE_THROW(RangeError, "Differentiation order greater than 2 is not supported!");
│ │ │ │ +
920
│ │ │ │ +
921 // Evaluate 1d function values (needed for the product rule)
│ │ │ │ +
922 std::array<std::vector<R>, dim> oneDValues;
│ │ │ │ +
923 std::array<std::vector<R>, dim> oneDDerivatives;
│ │ │ │ +
924 std::array<std::vector<R>, dim> oneDSecondDerivatives;
│ │ │ │ +
925
│ │ │ │ +
926 // Evaluate 1d function derivatives
│ │ │ │ +
927 if (k==1)
│ │ │ │ +
928 for (size_t i=0; i<dim; i++)
│ │ │ │ +
929 evaluateAll(in[i], oneDValues[i], true, oneDDerivatives[i], false, oneDSecondDerivatives[i], knotVectors_[i], order_[i], currentKnotSpan[i]);
│ │ │ │ +
930 else
│ │ │ │ +
931 for (size_t i=0; i<dim; i++)
│ │ │ │ +
932 evaluateAll(in[i], oneDValues[i], true, oneDDerivatives[i], true, oneDSecondDerivatives[i], knotVectors_[i], order_[i], currentKnotSpan[i]);
│ │ │ │ +
933
│ │ │ │ +
934 // The lowest knot spans that we need values from
│ │ │ │ +
935 std::array<unsigned int, dim> offset;
│ │ │ │ +
936 for (int i=0; i<dim; i++)
│ │ │ │ +
937 offset[i] = std::max((int)(currentKnotSpan[i] - order_[i]),0);
│ │ │ │ +
938
│ │ │ │ +
939 // Set up a multi-index to go from consecutive indices to integer coordinates
│ │ │ │ +
940 std::array<unsigned int, dim> limits;
│ │ │ │ +
941 for (int i=0; i<dim; i++)
│ │ │ │ +
942 {
│ │ │ │ +
943 // In a proper implementation, the following line would do
│ │ │ │ +
944 //limits[i] = oneDValues[i].size();
│ │ │ │ +
945 limits[i] = order_[i]+1; // The 'standard' value away from the boundaries of the knot vector
│ │ │ │ +
946 if (currentKnotSpan[i]<order_[i])
│ │ │ │ +
947 limits[i] -= (order_[i] - currentKnotSpan[i]);
│ │ │ │ +
948 if ( order_[i] > (knotVectors_[i].size() - currentKnotSpan[i] - 2) )
│ │ │ │ +
949 limits[i] -= order_[i] - (knotVectors_[i].size() - currentKnotSpan[i] - 2);
│ │ │ │ +
950 }
│ │ │ │ +
951
│ │ │ │ +
952 // Working towards computing only the parts that we really need:
│ │ │ │ +
953 // Let's copy them out into a separate array
│ │ │ │ +
954 std::array<std::vector<R>, dim> oneDValuesShort;
│ │ │ │ +
955
│ │ │ │ +
956 for (int i=0; i<dim; i++)
│ │ │ │ +
957 {
│ │ │ │ +
958 oneDValuesShort[i].resize(limits[i]);
│ │ │ │ +
959
│ │ │ │ +
960 for (size_t j=0; j<limits[i]; j++)
│ │ │ │ +
961 oneDValuesShort[i][j] = oneDValues[i][offset[i] + j];
│ │ │ │ +
962 }
│ │ │ │ +
963
│ │ │ │ +
964
│ │ │ │ +
965 MultiDigitCounter ijkCounter(limits);
│ │ │ │ +
966
│ │ │ │ +
967 out.resize(ijkCounter.cycle());
│ │ │ │ +
968
│ │ │ │ +
969 if (k == 1)
│ │ │ │ +
970 {
│ │ │ │ +
971 // Complete Jacobian is given by the product rule
│ │ │ │ +
972 for (size_t i=0; i<out.size(); i++, ++ijkCounter)
│ │ │ │ +
973 {
│ │ │ │ +
974 out[i][0] = 1.0;
│ │ │ │ +
975 for (int l=0; l<dim; l++)
│ │ │ │ +
976 out[i][0] *= (directions[0]==l) ? oneDDerivatives[l][ijkCounter[l]]
│ │ │ │ +
977 : oneDValuesShort[l][ijkCounter[l]];
│ │ │ │ +
978 }
│ │ │ │ +
979 }
│ │ │ │ +
980
│ │ │ │ +
981 if (k == 2)
│ │ │ │ +
982 {
│ │ │ │ +
983 // Complete derivation by deriving the tensor product
│ │ │ │ +
984 for (size_t i=0; i<out.size(); i++, ++ijkCounter)
│ │ │ │ +
985 {
│ │ │ │ +
986 out[i][0] = 1.0;
│ │ │ │ +
987 for (int j=0; j<dim; j++)
│ │ │ │ +
988 {
│ │ │ │ +
989 if (directions[0] != directions[1]) //derivation in two different variables
│ │ │ │ +
990 if (directions[0] == j || directions[1] == j) //the spline has to be derived (once) in this direction
│ │ │ │ +
991 out[i][0] *= oneDDerivatives[j][ijkCounter[j]];
│ │ │ │ +
992 else //no derivation in this direction
│ │ │ │ +
993 out[i][0] *= oneDValuesShort[j][ijkCounter[j]];
│ │ │ │ +
994 else //spline is derived two times in the same direction
│ │ │ │ +
995 if (directions[0] == j) //the spline is derived two times in this direction
│ │ │ │ +
996 out[i][0] *= oneDSecondDerivatives[j][ijkCounter[j]];
│ │ │ │ +
997 else //no derivation in this direction
│ │ │ │ +
998 out[i][0] *= oneDValuesShort[j][ijkCounter[j]];
│ │ │ │ +
999 }
│ │ │ │ +
1000 }
│ │ │ │ +
1001 }
│ │ │ │ +
1002 }
│ │ │ │ +
│ │ │ │ +
1003
│ │ │ │ +
1004
│ │ │ │ +
│ │ │ │ +
1009 static std::array<unsigned int,dim> getIJK(typename GridView::IndexSet::IndexType idx, std::array<unsigned int,dim> elements)
│ │ │ │ +
1010 {
│ │ │ │ +
1011 std::array<unsigned,dim> result;
│ │ │ │ +
1012 for (int i=0; i<dim; i++)
│ │ │ │ +
1013 {
│ │ │ │ +
1014 result[i] = idx%elements[i];
│ │ │ │ +
1015 idx /= elements[i];
│ │ │ │ +
1016 }
│ │ │ │ +
1017 return result;
│ │ │ │ +
1018 }
│ │ │ │ +
│ │ │ │ +
1019
│ │ │ │ +
│ │ │ │ +
1028 static void evaluateFunction (const typename GV::ctype& in, std::vector<R>& out,
│ │ │ │ +
1029 const std::vector<R>& knotVector,
│ │ │ │ +
1030 unsigned int order,
│ │ │ │ +
1031 unsigned int currentKnotSpan)
│ │ │ │ +
1032 {
│ │ │ │ +
1033 std::size_t outSize = order+1; // The 'standard' value away from the boundaries of the knot vector
│ │ │ │ +
1034 if (currentKnotSpan<order) // Less near the left end of the knot vector
│ │ │ │ +
1035 outSize -= (order - currentKnotSpan);
│ │ │ │ +
1036 if ( order > (knotVector.size() - currentKnotSpan - 2) )
│ │ │ │ +
1037 outSize -= order - (knotVector.size() - currentKnotSpan - 2);
│ │ │ │ +
1038 out.resize(outSize);
│ │ │ │ +
1039
│ │ │ │ +
1040 // It's not really a matrix that is needed here, a plain 2d array would do
│ │ │ │ +
1041 DynamicMatrix<R> N(order+1, knotVector.size()-1);
│ │ │ │ +
1042
│ │ │ │ +
1043 // The text books on splines use the following geometric condition here to fill the array N
│ │ │ │ +
1044 // (see for example Cottrell, Hughes, Bazilevs, Formula (2.1). However, this condition
│ │ │ │ +
1045 // only works if splines are never evaluated exactly on the knots.
│ │ │ │ +
1046 //
│ │ │ │ +
1047 // for (size_t i=0; i<knotVector.size()-1; i++)
│ │ │ │ +
1048 // N[0][i] = (knotVector[i] <= in) and (in < knotVector[i+1]);
│ │ │ │ +
1049 for (size_t i=0; i<knotVector.size()-1; i++)
│ │ │ │ +
1050 N[0][i] = (i == currentKnotSpan);
│ │ │ │ +
1051
│ │ │ │ +
1052 for (size_t r=1; r<=order; r++)
│ │ │ │ +
1053 for (size_t i=0; i<knotVector.size()-r-1; i++)
│ │ │ │ +
1054 {
│ │ │ │ +
1055 R factor1 = ((knotVector[i+r] - knotVector[i]) > 1e-10)
│ │ │ │ +
1056 ? (in - knotVector[i]) / (knotVector[i+r] - knotVector[i])
│ │ │ │ +
1057 : 0;
│ │ │ │ +
1058 R factor2 = ((knotVector[i+r+1] - knotVector[i+1]) > 1e-10)
│ │ │ │ +
1059 ? (knotVector[i+r+1] - in) / (knotVector[i+r+1] - knotVector[i+1])
│ │ │ │ +
1060 : 0;
│ │ │ │ +
1061 N[r][i] = factor1 * N[r-1][i] + factor2 * N[r-1][i+1];
│ │ │ │ +
1062 }
│ │ │ │ +
1063
│ │ │ │ +
1068 for (size_t i=0; i<out.size(); i++) {
│ │ │ │ +
1069 out[i] = N[order][std::max((int)(currentKnotSpan - order),0) + i];
│ │ │ │ +
1070 }
│ │ │ │ +
1071 }
│ │ │ │ +
│ │ │ │ +
1072
│ │ │ │ +
│ │ │ │ +
1085 static void evaluateFunctionFull(const typename GV::ctype& in,
│ │ │ │ +
1086 DynamicMatrix<R>& out,
│ │ │ │ +
1087 const std::vector<R>& knotVector,
│ │ │ │ +
1088 unsigned int order,
│ │ │ │ +
1089 unsigned int currentKnotSpan)
│ │ │ │ +
1090 {
│ │ │ │ +
1091 // It's not really a matrix that is needed here, a plain 2d array would do
│ │ │ │ +
1092 DynamicMatrix<R>& N = out;
│ │ │ │ +
1093
│ │ │ │ +
1094 N.resize(order+1, knotVector.size()-1);
│ │ │ │ +
1095
│ │ │ │ +
1096 // The text books on splines use the following geometric condition here to fill the array N
│ │ │ │ +
1097 // (see for example Cottrell, Hughes, Bazilevs, Formula (2.1). However, this condition
│ │ │ │ +
1098 // only works if splines are never evaluated exactly on the knots.
│ │ │ │ +
1099 //
│ │ │ │ +
1100 // for (size_t i=0; i<knotVector.size()-1; i++)
│ │ │ │ +
1101 // N[0][i] = (knotVector[i] <= in) and (in < knotVector[i+1]);
│ │ │ │ +
1102 for (size_t i=0; i<knotVector.size()-1; i++)
│ │ │ │ +
1103 N[0][i] = (i == currentKnotSpan);
│ │ │ │ +
1104
│ │ │ │ +
1105 for (size_t r=1; r<=order; r++)
│ │ │ │ +
1106 for (size_t i=0; i<knotVector.size()-r-1; i++)
│ │ │ │ +
1107 {
│ │ │ │ +
1108 R factor1 = ((knotVector[i+r] - knotVector[i]) > 1e-10)
│ │ │ │ +
1109 ? (in - knotVector[i]) / (knotVector[i+r] - knotVector[i])
│ │ │ │ +
1110 : 0;
│ │ │ │ +
1111 R factor2 = ((knotVector[i+r+1] - knotVector[i+1]) > 1e-10)
│ │ │ │ +
1112 ? (knotVector[i+r+1] - in) / (knotVector[i+r+1] - knotVector[i+1])
│ │ │ │ +
1113 : 0;
│ │ │ │ +
1114 N[r][i] = factor1 * N[r-1][i] + factor2 * N[r-1][i+1];
│ │ │ │ +
1115 }
│ │ │ │ +
1116 }
│ │ │ │ +
│ │ │ │ +
1117
│ │ │ │ +
1118
│ │ │ │ +
│ │ │ │ +
1128 static void evaluateAll(const typename GV::ctype& in,
│ │ │ │ +
1129 std::vector<R>& out,
│ │ │ │ +
1130 bool evaluateJacobian, std::vector<R>& outJac,
│ │ │ │ +
1131 bool evaluateHessian, std::vector<R>& outHess,
│ │ │ │ +
1132 const std::vector<R>& knotVector,
│ │ │ │ +
1133 unsigned int order,
│ │ │ │ +
1134 unsigned int currentKnotSpan)
│ │ │ │ +
1135 {
│ │ │ │ +
1136 // How many shape functions to we have in each coordinate direction?
│ │ │ │ +
1137 unsigned int limit;
│ │ │ │ +
1138 limit = order+1; // The 'standard' value away from the boundaries of the knot vector
│ │ │ │ +
1139 if (currentKnotSpan<order)
│ │ │ │ +
1140 limit -= (order - currentKnotSpan);
│ │ │ │ +
1141 if ( order > (knotVector.size() - currentKnotSpan - 2) )
│ │ │ │ +
1142 limit -= order - (knotVector.size() - currentKnotSpan - 2);
│ │ │ │ +
1143
│ │ │ │ +
1144 // The lowest knot spans that we need values from
│ │ │ │ +
1145 unsigned int offset;
│ │ │ │ +
1146 offset = std::max((int)(currentKnotSpan - order),0);
│ │ │ │ +
1147
│ │ │ │ +
1148 // Evaluate 1d function values (needed for the product rule)
│ │ │ │ +
1149 DynamicMatrix<R> values;
│ │ │ │ +
1150
│ │ │ │ +
1151 evaluateFunctionFull(in, values, knotVector, order, currentKnotSpan);
│ │ │ │ +
1152
│ │ │ │ +
1153 out.resize(knotVector.size()-order-1);
│ │ │ │ +
1154 for (size_t j=0; j<out.size(); j++)
│ │ │ │ +
1155 out[j] = values[order][j];
│ │ │ │ +
1156
│ │ │ │ +
1157 // Evaluate 1d function values of one order lower (needed for the derivative formula)
│ │ │ │ +
1158 std::vector<R> lowOrderOneDValues;
│ │ │ │ +
1159
│ │ │ │ +
1160 if (order!=0)
│ │ │ │ +
1161 {
│ │ │ │ +
1162 lowOrderOneDValues.resize(knotVector.size()-(order-1)-1);
│ │ │ │ +
1163 for (size_t j=0; j<lowOrderOneDValues.size(); j++)
│ │ │ │ +
1164 lowOrderOneDValues[j] = values[order-1][j];
│ │ │ │ +
1165 }
│ │ │ │ +
1166
│ │ │ │ +
1167 // Evaluate 1d function values of two order lower (needed for the (second) derivative formula)
│ │ │ │ +
1168 std::vector<R> lowOrderTwoDValues;
│ │ │ │ +
1169
│ │ │ │ +
1170 if (order>1 && evaluateHessian)
│ │ │ │ +
1171 {
│ │ │ │ +
1172 lowOrderTwoDValues.resize(knotVector.size()-(order-2)-1);
│ │ │ │ +
1173 for (size_t j=0; j<lowOrderTwoDValues.size(); j++)
│ │ │ │ +
1174 lowOrderTwoDValues[j] = values[order-2][j];
│ │ │ │ +
1175 }
│ │ │ │ +
1176
│ │ │ │ +
1177 // Evaluate 1d function derivatives
│ │ │ │ +
1178 if (evaluateJacobian)
│ │ │ │ +
1179 {
│ │ │ │ +
1180 outJac.resize(limit);
│ │ │ │ +
1181
│ │ │ │ +
1182 if (order==0) // order-zero functions are piecewise constant, hence all derivatives are zero
│ │ │ │ +
1183 std::fill(outJac.begin(), outJac.end(), R(0.0));
│ │ │ │ +
1184 else
│ │ │ │ +
1185 {
│ │ │ │ +
1186 for (size_t j=offset; j<offset+limit; j++)
│ │ │ │ +
1187 {
│ │ │ │ +
1188 R derivativeAddend1 = lowOrderOneDValues[j] / (knotVector[j+order]-knotVector[j]);
│ │ │ │ +
1189 R derivativeAddend2 = lowOrderOneDValues[j+1] / (knotVector[j+order+1]-knotVector[j+1]);
│ │ │ │ +
1190 // The two previous terms may evaluate as 0/0. This is to be interpreted as 0.
│ │ │ │ +
1191 if (std::isnan(derivativeAddend1))
│ │ │ │ +
1192 derivativeAddend1 = 0;
│ │ │ │ +
1193 if (std::isnan(derivativeAddend2))
│ │ │ │ +
1194 derivativeAddend2 = 0;
│ │ │ │ +
1195 outJac[j-offset] = order * ( derivativeAddend1 - derivativeAddend2 );
│ │ │ │ +
1196 }
│ │ │ │ +
1197 }
│ │ │ │ +
1198 }
│ │ │ │ +
1199
│ │ │ │ +
1200 // Evaluate 1d function second derivatives
│ │ │ │ +
1201 if (evaluateHessian)
│ │ │ │ +
1202 {
│ │ │ │ +
1203 outHess.resize(limit);
│ │ │ │ +
1204
│ │ │ │ +
1205 if (order<2) // order-zero functions are piecewise constant, hence all derivatives are zero
│ │ │ │ +
1206 std::fill(outHess.begin(), outHess.end(), R(0.0));
│ │ │ │ +
1207 else
│ │ │ │ +
1208 {
│ │ │ │ +
1209 for (size_t j=offset; j<offset+limit; j++)
│ │ │ │ +
1210 {
│ │ │ │ +
1211 assert(j+2 < lowOrderTwoDValues.size());
│ │ │ │ +
1212 R derivativeAddend1 = lowOrderTwoDValues[j] / (knotVector[j+order]-knotVector[j]) / (knotVector[j+order-1]-knotVector[j]);
│ │ │ │ +
1213 R derivativeAddend2 = lowOrderTwoDValues[j+1] / (knotVector[j+order]-knotVector[j]) / (knotVector[j+order]-knotVector[j+1]);
│ │ │ │ +
1214 R derivativeAddend3 = lowOrderTwoDValues[j+1] / (knotVector[j+order+1]-knotVector[j+1]) / (knotVector[j+order]-knotVector[j+1]);
│ │ │ │ +
1215 R derivativeAddend4 = lowOrderTwoDValues[j+2] / (knotVector[j+order+1]-knotVector[j+1]) / (knotVector[j+1+order]-knotVector[j+2]);
│ │ │ │ +
1216 // The two previous terms may evaluate as 0/0. This is to be interpreted as 0.
│ │ │ │ +
1217
│ │ │ │ +
1218 if (std::isnan(derivativeAddend1))
│ │ │ │ +
1219 derivativeAddend1 = 0;
│ │ │ │ +
1220 if (std::isnan(derivativeAddend2))
│ │ │ │ +
1221 derivativeAddend2 = 0;
│ │ │ │ +
1222 if (std::isnan(derivativeAddend3))
│ │ │ │ +
1223 derivativeAddend3 = 0;
│ │ │ │ +
1224 if (std::isnan(derivativeAddend4))
│ │ │ │ +
1225 derivativeAddend4 = 0;
│ │ │ │ +
1226 outHess[j-offset] = order * (order-1) * ( derivativeAddend1 - derivativeAddend2 -derivativeAddend3 + derivativeAddend4 );
│ │ │ │ +
1227 }
│ │ │ │ +
1228 }
│ │ │ │ +
1229 }
│ │ │ │ +
1230 }
│ │ │ │ +
│ │ │ │ +
1231
│ │ │ │ +
1232
│ │ │ │ +
1234 std::array<unsigned int, dim> order_;
│ │ │ │ +
1235
│ │ │ │ +
1237 std::array<std::vector<double>, dim> knotVectors_;
│ │ │ │ +
1238
│ │ │ │ +
1240 std::array<unsigned,dim> elements_;
│ │ │ │ +
1241
│ │ │ │ + │ │ │ │ +
1243};
│ │ │ │ +
│ │ │ │ +
1244
│ │ │ │ +
1245
│ │ │ │ +
1246
│ │ │ │ +
1247template<typename GV>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
1249 public LeafBasisNode
│ │ │ │ +
1250{
│ │ │ │ +
1251 static const int dim = GV::dimension;
│ │ │ │ +
1252
│ │ │ │ +
1253public:
│ │ │ │ +
1254
│ │ │ │ +
1255 using size_type = std::size_t;
│ │ │ │ +
1256 using Element = typename GV::template Codim<0>::Entity;
│ │ │ │ + │ │ │ │ +
1258
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
1260 preBasis_(preBasis),
│ │ │ │ +
1261 finiteElement_(*preBasis)
│ │ │ │ +
1262 {}
│ │ │ │ +
│ │ │ │ +
1263
│ │ │ │ +
│ │ │ │ +
1265 const Element& element() const
│ │ │ │ +
1266 {
│ │ │ │ +
1267 return element_;
│ │ │ │ +
1268 }
│ │ │ │ +
│ │ │ │ +
1269
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
1275 {
│ │ │ │ +
1276 return finiteElement_;
│ │ │ │ +
1277 }
│ │ │ │ +
│ │ │ │ +
1278
│ │ │ │ +
│ │ │ │ +
1280 void bind(const Element& e)
│ │ │ │ +
1281 {
│ │ │ │ +
1282 element_ = e;
│ │ │ │ +
1283 auto elementIndex = preBasis_->gridView().indexSet().index(e);
│ │ │ │ +
1284 finiteElement_.bind(preBasis_->getIJK(elementIndex,preBasis_->elements_));
│ │ │ │ +
1285 this->setSize(finiteElement_.size());
│ │ │ │ +
1286 }
│ │ │ │ +
│ │ │ │ +
1287
│ │ │ │ +
1288protected:
│ │ │ │ +
1289
│ │ │ │ + │ │ │ │ +
1291
│ │ │ │ + │ │ │ │ + │ │ │ │ +
1294};
│ │ │ │ +
│ │ │ │ +
1295
│ │ │ │ +
1296
│ │ │ │ +
1297
│ │ │ │ +
1298namespace BasisFactory {
│ │ │ │ +
1299
│ │ │ │ +
│ │ │ │ +
1306inline auto bSpline(const std::vector<double>& knotVector,
│ │ │ │ +
1307 unsigned int order,
│ │ │ │ +
1308 bool makeOpen = true)
│ │ │ │ +
1309{
│ │ │ │ +
1310 return [&knotVector, order, makeOpen](const auto& gridView) {
│ │ │ │ +
1311 return BSplinePreBasis<std::decay_t<decltype(gridView)>>(gridView, knotVector, order, makeOpen);
│ │ │ │ +
1312 };
│ │ │ │ +
1313}
│ │ │ │ +
│ │ │ │ +
1314
│ │ │ │ +
1315} // end namespace BasisFactory
│ │ │ │ +
1316
│ │ │ │ +
1317// *****************************************************************************
│ │ │ │ +
1318// This is the actual global basis implementation based on the reusable parts.
│ │ │ │ +
1319// *****************************************************************************
│ │ │ │ +
1320
│ │ │ │ +
1327template<typename GV>
│ │ │ │ + │ │ │ │ +
1329
│ │ │ │ +
1330
│ │ │ │ +
1331} // namespace Functions
│ │ │ │ +
1332
│ │ │ │ +
1333} // namespace Dune
│ │ │ │ +
1334
│ │ │ │ +
1335#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:1306
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
Definition functionfromcallable.hh:20
│ │ │ │ -
FunctionFromCallable(F &&f)
Create VirtualFunction from callable object.
Definition functionfromcallable.hh:52
│ │ │ │ -
void evaluate(const Domain &x, Range &y) const
Evaluate function.
Definition functionfromcallable.hh:73
│ │ │ │ -
FunctionFromCallable(const F &f)
Create VirtualFunction from callable object.
Definition functionfromcallable.hh:64
│ │ │ │ +
LocalFiniteElement in the sense of dune-localfunctions, for the B-spline basis on tensor-product grid...
Definition bsplinebasis.hh:362
│ │ │ │ +
BSplineLocalFiniteElement(const BSplineLocalFiniteElement &other)
Copy constructor.
Definition bsplinebasis.hh:383
│ │ │ │ +
const BSplinePreBasis< GV > & preBasis_
Definition bsplinebasis.hh:474
│ │ │ │ +
const BSplineLocalInterpolation< dim, BSplineLocalBasis< GV, R > > & localInterpolation() const
Hand out a LocalInterpolation object.
Definition bsplinebasis.hh:439
│ │ │ │ +
LocalFiniteElementTraits< BSplineLocalBasis< GV, R >, BSplineLocalCoefficients< dim >, BSplineLocalInterpolation< dim, BSplineLocalBasis< GV, R > > > Traits
Export various types related to this LocalFiniteElement.
Definition bsplinebasis.hh:372
│ │ │ │ +
std::array< unsigned, dim > currentKnotSpan_
Definition bsplinebasis.hh:481
│ │ │ │ +
BSplineLocalFiniteElement(const BSplinePreBasis< GV > &preBasis)
Constructor with a given B-spline basis.
Definition bsplinebasis.hh:376
│ │ │ │ +
const BSplineLocalCoefficients< dim > & localCoefficients() const
Hand out a LocalCoefficients object.
Definition bsplinebasis.hh:433
│ │ │ │ +
void bind(const std::array< unsigned, dim > &elementIdx)
Bind LocalFiniteElement to a specific knot span of the spline patch.
Definition bsplinebasis.hh:394
│ │ │ │ +
BSplineLocalInterpolation< dim, BSplineLocalBasis< GV, R > > localInterpolation_
Definition bsplinebasis.hh:478
│ │ │ │ +
GeometryType type() const
Return the reference element that the local finite element is defined on (here, a hypercube)
Definition bsplinebasis.hh:455
│ │ │ │ +
unsigned size() const
Number of shape functions in this finite element.
Definition bsplinebasis.hh:445
│ │ │ │ +
BSplineLocalCoefficients< dim > localCoefficients_
Definition bsplinebasis.hh:477
│ │ │ │ +
unsigned int size(int i) const
Number of degrees of freedom for one coordinate direction.
Definition bsplinebasis.hh:463
│ │ │ │ +
BSplineLocalBasis< GV, R > localBasis_
Definition bsplinebasis.hh:476
│ │ │ │ +
const BSplineLocalBasis< GV, R > & localBasis() const
Hand out a LocalBasis object.
Definition bsplinebasis.hh:427
│ │ │ │ +
Pre-basis for B-spline basis.
Definition bsplinebasis.hh:499
│ │ │ │ +
static constexpr size_type multiIndexBufferSize
Definition bsplinebasis.hh:567
│ │ │ │ +
std::array< unsigned, dim > elements_
Number of grid elements in the different coordinate directions.
Definition bsplinebasis.hh:1240
│ │ │ │ +
GridView gridView_
Definition bsplinebasis.hh:1242
│ │ │ │ +
double R
Definition bsplinebasis.hh:570
│ │ │ │ +
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:1085
│ │ │ │ +
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:781
│ │ │ │ +
std::array< unsigned int, dim > order_
Order of the B-spline for each space dimension.
Definition bsplinebasis.hh:1234
│ │ │ │ +
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition bsplinebasis.hh:719
│ │ │ │ +
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:1128
│ │ │ │ +
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:1028
│ │ │ │ +
unsigned int size(size_t d) const
Number of shape functions in one direction.
Definition bsplinebasis.hh:774
│ │ │ │ +
GV GridView
The grid view that the FE space is defined on.
Definition bsplinebasis.hh:560
│ │ │ │ +
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:735
│ │ │ │ +
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:913
│ │ │ │ +
std::size_t size_type
Definition bsplinebasis.hh:561
│ │ │ │ +
static constexpr size_type maxMultiIndexSize
Definition bsplinebasis.hh:565
│ │ │ │ +
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition bsplinebasis.hh:686
│ │ │ │ +
void initializeIndices()
Initialize the global indices.
Definition bsplinebasis.hh:676
│ │ │ │ +
size_type size(const Dune::ReservedVector< ST, i > &prefix) const
Return number of possible values for next position in multi index.
Definition bsplinebasis.hh:712
│ │ │ │ +
unsigned int size() const
Total number of B-spline basis functions.
Definition bsplinebasis.hh:765
│ │ │ │ +
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition bsplinebasis.hh:680
│ │ │ │ +
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:1009
│ │ │ │ +
Node makeNode() const
Create tree node.
Definition bsplinebasis.hh:694
│ │ │ │ +
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:590
│ │ │ │ +
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:812
│ │ │ │ +
static constexpr size_type minMultiIndexSize
Definition bsplinebasis.hh:566
│ │ │ │ +
std::array< std::vector< double >, dim > knotVectors_
The knot vectors, one for each space dimension.
Definition bsplinebasis.hh:1237
│ │ │ │ +
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition bsplinebasis.hh:725
│ │ │ │ +
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:642
│ │ │ │ +
LocalBasis class in the sense of dune-localfunctions, presenting the restriction of a B-spline patch ...
Definition bsplinebasis.hh:46
│ │ │ │ +
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:55
│ │ │ │ +
unsigned int order() const
Polynomial order of the shape functions.
Definition bsplinebasis.hh:140
│ │ │ │ +
std::size_t size() const
Return the number of basis functions on the current knot span.
Definition bsplinebasis.hh:147
│ │ │ │ +
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:97
│ │ │ │ +
void evaluateFunction(const FieldVector< D, dim > &in, std::vector< FieldVector< R, 1 > > &out) const
Evaluate all shape functions.
Definition bsplinebasis.hh:70
│ │ │ │ +
void evaluateJacobian(const FieldVector< D, dim > &in, std::vector< FieldMatrix< D, 1, dim > > &out) const
Evaluate Jacobian of all shape functions.
Definition bsplinebasis.hh:82
│ │ │ │ +
BSplineLocalBasis(const BSplinePreBasis< GV > &preBasis, const BSplineLocalFiniteElement< GV, R > &lFE)
Constructor with a given B-spline patch.
Definition bsplinebasis.hh:61
│ │ │ │ +
Attaches a shape function to an entity.
Definition bsplinebasis.hh:178
│ │ │ │ +
const LocalKey & localKey(std::size_t i) const
get i'th index
Definition bsplinebasis.hh:321
│ │ │ │ +
void init(const std::array< unsigned, dim > &sizes)
Definition bsplinebasis.hh:256
│ │ │ │ +
std::size_t size() const
number of coefficients
Definition bsplinebasis.hh:315
│ │ │ │ +
Local interpolation in the sense of dune-localfunctions, for the B-spline basis on tensor-product gri...
Definition bsplinebasis.hh:340
│ │ │ │ +
void interpolate(const F &f, std::vector< C > &out) const
Local interpolation of a function.
Definition bsplinebasis.hh:344
│ │ │ │ +
Definition bsplinebasis.hh:1250
│ │ │ │ +
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition bsplinebasis.hh:1274
│ │ │ │ +
typename GV::template Codim< 0 >::Entity Element
Definition bsplinebasis.hh:1256
│ │ │ │ +
const BSplinePreBasis< GV > * preBasis_
Definition bsplinebasis.hh:1290
│ │ │ │ +
Element element_
Definition bsplinebasis.hh:1293
│ │ │ │ +
void bind(const Element &e)
Bind to element.
Definition bsplinebasis.hh:1280
│ │ │ │ +
BSplineNode(const BSplinePreBasis< GV > *preBasis)
Definition bsplinebasis.hh:1259
│ │ │ │ +
const Element & element() const
Return current element, throw if unbound.
Definition bsplinebasis.hh:1265
│ │ │ │ +
FiniteElement finiteElement_
Definition bsplinebasis.hh:1292
│ │ │ │ +
std::size_t size_type
Definition bsplinebasis.hh:1255
│ │ │ │ +
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:46
│ │ │ │ +
size_type size() const
Definition nodes.hh:142
│ │ │ │ +
void setSize(const size_type size)
Definition nodes.hh:164
│ │ │ │ +
Definition nodes.hh:186
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,81 +1,1500 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -functionfromcallable.hh │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_COMMON_FUNCTION_FROM_CALLABLE_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_COMMON_FUNCTION_FROM_CALLABLE_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BSPLINEBASIS_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BSPLINEBASIS_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7 │ │ │ │ │ -8#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> │ │ │ │ │ -9 │ │ │ │ │ -10 │ │ │ │ │ -11namespace _D_u_n_e { │ │ │ │ │ -12namespace Functions { │ │ │ │ │ -13 │ │ │ │ │ -14 │ │ │ │ │ +10#include │ │ │ │ │ +11#include │ │ │ │ │ +12 │ │ │ │ │ +14#include │ │ │ │ │ 15 │ │ │ │ │ -16template::RawDomain, │ │ │ │ │ -19 typename SignatureTraits::RawRange> > │ │ │ │ │ -_2_0class _F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e; │ │ │ │ │ -21 │ │ │ │ │ -37template │ │ │ │ │ -_3_8class _F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e : │ │ │ │ │ -39 public FunctionInterface │ │ │ │ │ -40{ │ │ │ │ │ -41public: │ │ │ │ │ -42 │ │ │ │ │ -_5_2 _F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e(F&& f) : │ │ │ │ │ -53 f_(f) │ │ │ │ │ -54 {} │ │ │ │ │ -55 │ │ │ │ │ -_6_4 _F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e(const F& f) : │ │ │ │ │ -65 f_(f) │ │ │ │ │ -66 {} │ │ │ │ │ -67 │ │ │ │ │ -_7_3 void _e_v_a_l_u_a_t_e(const Domain& x, Range&y) const │ │ │ │ │ -74 { │ │ │ │ │ -75 y = f_(x); │ │ │ │ │ -76 } │ │ │ │ │ -77 │ │ │ │ │ -78private: │ │ │ │ │ -79 F f_; │ │ │ │ │ -80}; │ │ │ │ │ -81 │ │ │ │ │ -82 │ │ │ │ │ -83 │ │ │ │ │ -84} // namespace Functions │ │ │ │ │ -85} // namespace Dune │ │ │ │ │ -86 │ │ │ │ │ -87#endif //DUNE_FUNCTIONS_COMMON_FUNCTION_FROM_CALLABLE_HH │ │ │ │ │ -_s_i_g_n_a_t_u_r_e_._h_h │ │ │ │ │ +16#include │ │ │ │ │ +17#include │ │ │ │ │ +18#include │ │ │ │ │ +19#include │ │ │ │ │ +20#include │ │ │ │ │ +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_/_n_o_d_e_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_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ │ +23 │ │ │ │ │ +24namespace _D_u_n_e │ │ │ │ │ +25{ │ │ │ │ │ +26namespace Functions { │ │ │ │ │ +27 │ │ │ │ │ +28// A maze of dependencies between the different parts of this. We need a few │ │ │ │ │ +forward declarations │ │ │ │ │ +29template │ │ │ │ │ +30class _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; │ │ │ │ │ +31 │ │ │ │ │ +32template │ │ │ │ │ +33class _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s; │ │ │ │ │ +34 │ │ │ │ │ +35 │ │ │ │ │ +44template │ │ │ │ │ +_4_5class _B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s │ │ │ │ │ +46{ │ │ │ │ │ +47 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; │ │ │ │ │ +48 │ │ │ │ │ +49 typedef typename GV::ctype D; │ │ │ │ │ +50 enum {dim = GV::dimension}; │ │ │ │ │ +51public: │ │ │ │ │ +52 │ │ │ │ │ +54 typedef LocalBasisTraits,R,1,FieldVector, │ │ │ │ │ +_5_5 FieldMatrix > _T_r_a_i_t_s; │ │ │ │ │ +56 │ │ │ │ │ +_6_1 _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, │ │ │ │ │ +62 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) │ │ │ │ │ +63 : preBasis_(preBasis), │ │ │ │ │ +64 lFE_(lFE) │ │ │ │ │ +65 {} │ │ │ │ │ +66 │ │ │ │ │ +_7_0 void _e_v_a_l_u_a_t_e_F_u_n_c_t_i_o_n (const FieldVector& in, │ │ │ │ │ +71 std::vector >& out) const │ │ │ │ │ +72 { │ │ │ │ │ +73 FieldVector globalIn = offset_; │ │ │ │ │ +74 scaling_.umv(in,globalIn); │ │ │ │ │ +75 │ │ │ │ │ +76 preBasis_.evaluateFunction(globalIn, out, lFE_.currentKnotSpan_); │ │ │ │ │ +77 } │ │ │ │ │ +78 │ │ │ │ │ +_8_2 void _e_v_a_l_u_a_t_e_J_a_c_o_b_i_a_n (const FieldVector& in, │ │ │ │ │ +83 std::vector >& out) const │ │ │ │ │ +84 { │ │ │ │ │ +85 FieldVector globalIn = offset_; │ │ │ │ │ +86 scaling_.umv(in,globalIn); │ │ │ │ │ +87 │ │ │ │ │ +88 preBasis_.evaluateJacobian(globalIn, out, lFE_.currentKnotSpan_); │ │ │ │ │ +89 │ │ │ │ │ +90 for (size_t i=0; i │ │ │ │ │ +_9_7 inline void _e_v_a_l_u_a_t_e (const typename std::array& directions, │ │ │ │ │ +98 const typename Traits::DomainType& in, │ │ │ │ │ +99 std::vector& out) const │ │ │ │ │ +100 { │ │ │ │ │ +101 switch(k) │ │ │ │ │ +102 { │ │ │ │ │ +103 case 0: │ │ │ │ │ +104 _e_v_a_l_u_a_t_e_F_u_n_c_t_i_o_n(in, out); │ │ │ │ │ +105 break; │ │ │ │ │ +106 case 1: │ │ │ │ │ +107 { │ │ │ │ │ +108 FieldVector globalIn = offset_; │ │ │ │ │ +109 scaling_.umv(in,globalIn); │ │ │ │ │ +110 │ │ │ │ │ +111 preBasis_.evaluate(directions, globalIn, out, lFE_.currentKnotSpan_); │ │ │ │ │ +112 │ │ │ │ │ +113 for (size_t i=0; i globalIn = offset_; │ │ │ │ │ +120 scaling_.umv(in,globalIn); │ │ │ │ │ +121 │ │ │ │ │ +122 preBasis_.evaluate(directions, globalIn, out, lFE_.currentKnotSpan_); │ │ │ │ │ +123 │ │ │ │ │ +124 for (size_t i=0; i& preBasis_; │ │ │ │ │ +154 │ │ │ │ │ +155 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_; │ │ │ │ │ +156 │ │ │ │ │ +157 // Coordinates in a single knot span differ from coordinates on the B- │ │ │ │ │ +spline patch │ │ │ │ │ +158 // by an affine transformation. This transformation is stored in offset_ │ │ │ │ │ +and scaling_. │ │ │ │ │ +159 FieldVector offset_; │ │ │ │ │ +160 DiagonalMatrix scaling_; │ │ │ │ │ +161}; │ │ │ │ │ +162 │ │ │ │ │ +176template │ │ │ │ │ +_1_7_7class _B_S_p_l_i_n_e_L_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s │ │ │ │ │ +178{ │ │ │ │ │ +179 // Return i as a d-digit number in the (k+1)-nary system │ │ │ │ │ +180 std::array multiindex (unsigned int i) const │ │ │ │ │ +181 { │ │ │ │ │ +182 std::array alpha; │ │ │ │ │ +183 for (int j=0; j& subEntity) │ │ │ │ │ +193 { │ │ │ │ │ +194 if (sizes_[0]==1) │ │ │ │ │ +195 { │ │ │ │ │ +196 subEntity[0] = 0; │ │ │ │ │ +197 return; │ │ │ │ │ +198 } │ │ │ │ │ +199 │ │ │ │ │ +200 /* edge and vertex numbering │ │ │ │ │ +201 0----0----1 │ │ │ │ │ +202 */ │ │ │ │ │ +203 unsigned lastIndex=0; │ │ │ │ │ +204 subEntity[lastIndex++] = 0; // corner 0 │ │ │ │ │ +205 for (unsigned i = 0; i < sizes_[0] - 2; ++i) │ │ │ │ │ +206 subEntity[lastIndex++] = 0; // inner dofs of element (0) │ │ │ │ │ +207 │ │ │ │ │ +208 subEntity[lastIndex++] = 1; // corner 1 │ │ │ │ │ +209 │ │ │ │ │ +210 assert(_s_i_z_e()==lastIndex); │ │ │ │ │ +211 } │ │ │ │ │ +212 │ │ │ │ │ +213 void setup2d(std::vector& subEntity) │ │ │ │ │ +214 { │ │ │ │ │ +215 unsigned lastIndex=0; │ │ │ │ │ +216 │ │ │ │ │ +217 // LocalKey: entity number , entity codim, dof indices within each entity │ │ │ │ │ +218 /* edge and vertex numbering │ │ │ │ │ +219 2----3----3 │ │ │ │ │ +220 | | │ │ │ │ │ +221 | | │ │ │ │ │ +222 0 1 │ │ │ │ │ +223 | | │ │ │ │ │ +224 | | │ │ │ │ │ +225 0----2----1 │ │ │ │ │ +226 */ │ │ │ │ │ +227 │ │ │ │ │ +228 // lower edge (2) │ │ │ │ │ +229 subEntity[lastIndex++] = 0; // corner 0 │ │ │ │ │ +230 for (unsigned i = 0; i < sizes_[0]-2; ++i) │ │ │ │ │ +231 subEntity[lastIndex++] = 2; // inner dofs of lower edge (2) │ │ │ │ │ +232 │ │ │ │ │ +233 subEntity[lastIndex++] = 1; // corner 1 │ │ │ │ │ +234 │ │ │ │ │ +235 // iterate from bottom to top over inner edge dofs │ │ │ │ │ +236 for (unsigned e = 0; e < sizes_[1]-2; ++e) │ │ │ │ │ +237 { │ │ │ │ │ +238 subEntity[lastIndex++] = 0; // left edge (0) │ │ │ │ │ +239 for (unsigned i = 0; i < sizes_[0]-2; ++i) │ │ │ │ │ +240 subEntity[lastIndex++] = 0; // face dofs │ │ │ │ │ +241 subEntity[lastIndex++] = 1; // right edge (1) │ │ │ │ │ +242 } │ │ │ │ │ +243 │ │ │ │ │ +244 // upper edge (3) │ │ │ │ │ +245 subEntity[lastIndex++] = 2; // corner 2 │ │ │ │ │ +246 for (unsigned i = 0; i < sizes_[0]-2; ++i) │ │ │ │ │ +247 subEntity[lastIndex++] = 3; // inner dofs of upper edge (3) │ │ │ │ │ +248 │ │ │ │ │ +249 subEntity[lastIndex++] = 3; // corner 3 │ │ │ │ │ +250 │ │ │ │ │ +251 assert(_s_i_z_e()==lastIndex); │ │ │ │ │ +252 } │ │ │ │ │ +253 │ │ │ │ │ +254 │ │ │ │ │ +255public: │ │ │ │ │ +_2_5_6 void _i_n_i_t(const std::array& sizes) │ │ │ │ │ +257 { │ │ │ │ │ +258 sizes_ = sizes; │ │ │ │ │ +259 │ │ │ │ │ +260 li_.resize(_s_i_z_e()); │ │ │ │ │ +261 │ │ │ │ │ +262 // Set up array of codimension-per-dof-number │ │ │ │ │ +263 std::vector codim(li_.size()); │ │ │ │ │ +264 │ │ │ │ │ +265 for (std::size_t i=0; i mIdx = multiindex(i); │ │ │ │ │ +271 for (int j=0; j index(_s_i_z_e()); │ │ │ │ │ +282 │ │ │ │ │ +283 for (std::size_t i=0; i mIdx = multiindex(i); │ │ │ │ │ +288 │ │ │ │ │ +289 for (int j=dim-1; j>=0; j--) │ │ │ │ │ +290 if (mIdx[j]>0 and mIdx[j] subEntity(li_.size()); │ │ │ │ │ +296 │ │ │ │ │ +297 if (subEntity.size() > 0) │ │ │ │ │ +298 { │ │ │ │ │ +299 if (dim==1) { │ │ │ │ │ +300 │ │ │ │ │ +301 setup1d(subEntity); │ │ │ │ │ +302 │ │ │ │ │ +303 } else if (dim==2 and sizes_[0]>1 and sizes_[1]>1) { │ │ │ │ │ +304 │ │ │ │ │ +305 setup2d(subEntity); │ │ │ │ │ +306 │ │ │ │ │ +307 } │ │ │ │ │ +308 } │ │ │ │ │ +309 │ │ │ │ │ +310 for (size_t i=0; i()); │ │ │ │ │ +318 } │ │ │ │ │ +319 │ │ │ │ │ +_3_2_1 const LocalKey& _l_o_c_a_l_K_e_y (std::size_t i) const │ │ │ │ │ +322 { │ │ │ │ │ +323 return li_[i]; │ │ │ │ │ +324 } │ │ │ │ │ +325 │ │ │ │ │ +326private: │ │ │ │ │ +327 │ │ │ │ │ +328 // Number of shape functions on this element per coordinate direction │ │ │ │ │ +329 std::array sizes_; │ │ │ │ │ +330 │ │ │ │ │ +331 std::vector li_; │ │ │ │ │ +332}; │ │ │ │ │ +333 │ │ │ │ │ +338template │ │ │ │ │ +_3_3_9class _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 │ │ │ │ │ +340{ │ │ │ │ │ +341public: │ │ │ │ │ +343 template │ │ │ │ │ +_3_4_4 void _i_n_t_e_r_p_o_l_a_t_e (const F& f, std::vector& out) const │ │ │ │ │ +345 { │ │ │ │ │ +346 DUNE_THROW(NotImplemented, "BSplineLocalInterpolation::interpolate"); │ │ │ │ │ +347 } │ │ │ │ │ +348 │ │ │ │ │ +349}; │ │ │ │ │ +350 │ │ │ │ │ +360template │ │ │ │ │ +_3_6_1class _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 │ │ │ │ │ +362{ │ │ │ │ │ +_3_6_3 typedef typename GV::ctype D; │ │ │ │ │ +364 enum {dim = GV::dimension}; │ │ │ │ │ +365 friend class _B_S_p_l_i_n_e_L_o_c_a_l_B_a_s_i_s; │ │ │ │ │ +366public: │ │ │ │ │ +367 │ │ │ │ │ +370 typedef LocalFiniteElementTraits, │ │ │ │ │ +371 _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_2 _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; │ │ │ │ │ +373 │ │ │ │ │ +_3_7_6 _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) │ │ │ │ │ +377 : _p_r_e_B_a_s_i_s__(preBasis), │ │ │ │ │ +378 _l_o_c_a_l_B_a_s_i_s__(preBasis,*this) │ │ │ │ │ +379 {} │ │ │ │ │ +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_L_o_c_a_l_F_i_n_i_t_e_E_l_e_m_e_n_t& other) │ │ │ │ │ +384 : _p_r_e_B_a_s_i_s__(other._p_r_e_B_a_s_i_s__), │ │ │ │ │ +385 _l_o_c_a_l_B_a_s_i_s__(_p_r_e_B_a_s_i_s__,*this) │ │ │ │ │ +386 {} │ │ │ │ │ +387 │ │ │ │ │ +_3_9_4 void _b_i_n_d(const std::array& elementIdx) │ │ │ │ │ +395 { │ │ │ │ │ +396 /* \todo In the long run we need to precompute a table for this */ │ │ │ │ │ +397 for (size_t i=0; i sizes; │ │ │ │ │ +421 for (size_t i=0; i& _l_o_c_a_l_B_a_s_i_s() const │ │ │ │ │ +428 { │ │ │ │ │ +429 return _l_o_c_a_l_B_a_s_i_s__; │ │ │ │ │ +430 } │ │ │ │ │ +431 │ │ │ │ │ +_4_3_3 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 │ │ │ │ │ +434 { │ │ │ │ │ +435 return _l_o_c_a_l_C_o_e_f_f_i_c_i_e_n_t_s__; │ │ │ │ │ +436 } │ │ │ │ │ +437 │ │ │ │ │ +_4_3_9 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 │ │ │ │ │ +440 { │ │ │ │ │ +441 return _l_o_c_a_l_I_n_t_e_r_p_o_l_a_t_i_o_n__; │ │ │ │ │ +442 } │ │ │ │ │ +443 │ │ │ │ │ +_4_4_5 unsigned _s_i_z_e () const │ │ │ │ │ +446 { │ │ │ │ │ +447 std::size_t r = 1; │ │ │ │ │ +448 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) ) │ │ │ │ │ +470 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); │ │ │ │ │ +471 return r; │ │ │ │ │ +472 } │ │ │ │ │ +473 │ │ │ │ │ +_4_7_4 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__; │ │ │ │ │ +475 │ │ │ │ │ +_4_7_6 _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_7_7 _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_7_8 _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__; │ │ │ │ │ +479 │ │ │ │ │ +480 // The knot span we are bound to │ │ │ │ │ +_4_8_1 std::array _c_u_r_r_e_n_t_K_n_o_t_S_p_a_n__; │ │ │ │ │ +482}; │ │ │ │ │ +483 │ │ │ │ │ +484 │ │ │ │ │ +485template │ │ │ │ │ +486class _B_S_p_l_i_n_e_N_o_d_e; │ │ │ │ │ +487 │ │ │ │ │ +497template │ │ │ │ │ +_4_9_8class _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s │ │ │ │ │ +499{ │ │ │ │ │ +500 static const int dim = GV::dimension; │ │ │ │ │ +501 │ │ │ │ │ +503 class MultiDigitCounter │ │ │ │ │ +504 { │ │ │ │ │ +505 public: │ │ │ │ │ +506 │ │ │ │ │ +510 MultiDigitCounter(const std::array& limits) │ │ │ │ │ +511 : limits_(limits) │ │ │ │ │ +512 { │ │ │ │ │ +513 std::fill(counter_.begin(), counter_.end(), 0); │ │ │ │ │ +514 } │ │ │ │ │ +515 │ │ │ │ │ +517 MultiDigitCounter& operator++() │ │ │ │ │ +518 { │ │ │ │ │ +519 for (int i=0; i limits_; │ │ │ │ │ +551 │ │ │ │ │ +553 std::array counter_; │ │ │ │ │ +554 │ │ │ │ │ +555 }; │ │ │ │ │ +556 │ │ │ │ │ +557public: │ │ │ │ │ +558 │ │ │ │ │ +_5_6_0 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ │ +_5_6_1 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ +562 │ │ │ │ │ +_5_6_3 using _N_o_d_e = _B_S_p_l_i_n_e_N_o_d_e_<_G_V_>; │ │ │ │ │ +564 │ │ │ │ │ +_5_6_5 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 = 1; │ │ │ │ │ +_5_6_6 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 = 1; │ │ │ │ │ +_5_6_7 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 = 1; │ │ │ │ │ +568 │ │ │ │ │ +569 // Type used for function values │ │ │ │ │ +_5_7_0 using _R = double; │ │ │ │ │ +571 │ │ │ │ │ +_5_9_0 _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, │ │ │ │ │ +591 const std::vector& knotVector, │ │ │ │ │ +592 unsigned int order, │ │ │ │ │ +593 bool makeOpen = true) │ │ │ │ │ +594 : _g_r_i_d_V_i_e_w__(_g_r_i_d_V_i_e_w) │ │ │ │ │ +595 { │ │ │ │ │ +596 // \todo Detection of duplicate knots │ │ │ │ │ +597 std::fill(_e_l_e_m_e_n_t_s__.begin(), _e_l_e_m_e_n_t_s__.end(), knotVector.size()-1); │ │ │ │ │ +598 │ │ │ │ │ +599 // Mediocre sanity check: we don't know the number of grid elements in each │ │ │ │ │ +direction. │ │ │ │ │ +600 // but at least we know the total number of elements. │ │ │ │ │ +601 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) ); │ │ │ │ │ +602 │ │ │ │ │ +603 for (int i=0; i& lowerLeft, │ │ │ │ │ +644 const FieldVector& upperRight, │ │ │ │ │ +645 const std::array& elements, │ │ │ │ │ +646 unsigned int order, │ │ │ │ │ +647 bool makeOpen = true) │ │ │ │ │ +648 : _e_l_e_m_e_n_t_s__(elements), │ │ │ │ │ +649 _g_r_i_d_V_i_e_w__(_g_r_i_d_V_i_e_w) │ │ │ │ │ +650 { │ │ │ │ │ +651 // Mediocre sanity check: we don't know the number of grid elements in each │ │ │ │ │ +direction. │ │ │ │ │ +652 // but at least we know the total number of elements. │ │ │ │ │ +653 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) ); │ │ │ │ │ +654 │ │ │ │ │ +655 for (int i=0; i │ │ │ │ │ +702 // size_type size(const SizePrefix& prefix) const │ │ │ │ │ +703 // │ │ │ │ │ +704 // But leads to ambiguity with the other size method: │ │ │ │ │ +705 // │ │ │ │ │ +706 // unsigned int size (size_t d) const │ │ │ │ │ +707 // │ │ │ │ │ +708 // Once the latter is removed, this implementation should be changed. │ │ │ │ │ +709 │ │ │ │ │ +711 template │ │ │ │ │ +_7_1_2 _s_i_z_e___t_y_p_e _s_i_z_e(const Dune::ReservedVector& prefix) const │ │ │ │ │ +713 { │ │ │ │ │ +714 assert(prefix.size() == 0 || prefix.size() == 1); │ │ │ │ │ +715 return (prefix.size() == 0) ? _s_i_z_e() : 0; │ │ │ │ │ +716 } │ │ │ │ │ +717 │ │ │ │ │ +_7_1_9 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ │ +720 { │ │ │ │ │ +721 return _s_i_z_e(); │ │ │ │ │ +722 } │ │ │ │ │ +723 │ │ │ │ │ +_7_2_5 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ │ +726 { │ │ │ │ │ +727 _s_i_z_e___t_y_p_e result = 1; │ │ │ │ │ +728 for (int i=0; i │ │ │ │ │ +_7_3_5 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ │ +736 { │ │ │ │ │ +737 // Local degrees of freedom are arranged in a lattice. │ │ │ │ │ +738 // We need the lattice dimensions to be able to compute lattice coordinates │ │ │ │ │ +from a local index │ │ │ │ │ +739 std::array localSizes; │ │ │ │ │ +740 for (int i=0; i localIJK = _g_e_t_I_J_K(i, localSizes); │ │ │ │ │ +745 │ │ │ │ │ +746 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__; │ │ │ │ │ +747 const auto order = _o_r_d_e_r__; │ │ │ │ │ +748 │ │ │ │ │ +749 std::array globalIJK; │ │ │ │ │ +750 for (int i=0; i=0; i--) │ │ │ │ │ +757 globalIdx = globalIdx * _s_i_z_e(i) + globalIJK[i]; │ │ │ │ │ +758 │ │ │ │ │ +759 *it = {{globalIdx}}; │ │ │ │ │ +760 } │ │ │ │ │ +761 return it; │ │ │ │ │ +762 } │ │ │ │ │ +763 │ │ │ │ │ +_7_6_5 unsigned int _s_i_z_e () const │ │ │ │ │ +766 { │ │ │ │ │ +767 unsigned int result = 1; │ │ │ │ │ +768 for (size_t i=0; i& in, │ │ │ │ │ +782 std::vector >& out, │ │ │ │ │ +783 const std::array& currentKnotSpan) const │ │ │ │ │ +784 { │ │ │ │ │ +785 // Evaluate │ │ │ │ │ +786 std::array, dim> oneDValues; │ │ │ │ │ +787 │ │ │ │ │ +788 for (size_t i=0; i limits; │ │ │ │ │ +792 for (int i=0; i& in, │ │ │ │ │ +813 std::vector >& out, │ │ │ │ │ +814 const std::array& currentKnotSpan) const │ │ │ │ │ +815 { │ │ │ │ │ +816 // How many shape functions to we have in each coordinate direction? │ │ │ │ │ +817 std::array limits; │ │ │ │ │ +818 for (int i=0; i (_k_n_o_t_V_e_c_t_o_r_s__[i]._s_i_z_e() - currentKnotSpan[i] - 2) ) │ │ │ │ │ +824 limits[i] -= _o_r_d_e_r__[i] - (_k_n_o_t_V_e_c_t_o_r_s__[i]._s_i_z_e() - currentKnotSpan[i] - 2); │ │ │ │ │ +825 } │ │ │ │ │ +826 │ │ │ │ │ +827 // The lowest knot spans that we need values from │ │ │ │ │ +828 std::array offset; │ │ │ │ │ +829 for (int i=0; i, dim> oneDValues; │ │ │ │ │ +834 │ │ │ │ │ +835 // Evaluate 1d function values of one order lower (needed for the │ │ │ │ │ +derivative formula) │ │ │ │ │ +836 std::array, dim> lowOrderOneDValues; │ │ │ │ │ +837 │ │ │ │ │ +838 std::array, dim> values; │ │ │ │ │ +839 │ │ │ │ │ +840 for (size_t i=0; i, dim> oneDDerivatives; │ │ │ │ │ +858 for (size_t i=0; i, dim> oneDValuesShort; │ │ │ │ │ +883 │ │ │ │ │ +884 for (int i=0; i │ │ │ │ │ +_9_1_3 void _e_v_a_l_u_a_t_e(const typename std::array& directions, │ │ │ │ │ +914 const FieldVector& in, │ │ │ │ │ +915 std::vector >& out, │ │ │ │ │ +916 const std::array& currentKnotSpan) const │ │ │ │ │ +917 { │ │ │ │ │ +918 if (k != 1 && k != 2) │ │ │ │ │ +919 DUNE_THROW(RangeError, "Differentiation order greater than 2 is not │ │ │ │ │ +supported!"); │ │ │ │ │ +920 │ │ │ │ │ +921 // Evaluate 1d function values (needed for the product rule) │ │ │ │ │ +922 std::array, dim> oneDValues; │ │ │ │ │ +923 std::array, dim> oneDDerivatives; │ │ │ │ │ +924 std::array, dim> oneDSecondDerivatives; │ │ │ │ │ +925 │ │ │ │ │ +926 // Evaluate 1d function derivatives │ │ │ │ │ +927 if (k==1) │ │ │ │ │ +928 for (size_t i=0; i offset; │ │ │ │ │ +936 for (int i=0; i limits; │ │ │ │ │ +941 for (int i=0; i (_k_n_o_t_V_e_c_t_o_r_s__[i]._s_i_z_e() - currentKnotSpan[i] - 2) ) │ │ │ │ │ +949 limits[i] -= _o_r_d_e_r__[i] - (_k_n_o_t_V_e_c_t_o_r_s__[i]._s_i_z_e() - currentKnotSpan[i] - 2); │ │ │ │ │ +950 } │ │ │ │ │ +951 │ │ │ │ │ +952 // Working towards computing only the parts that we really need: │ │ │ │ │ +953 // Let's copy them out into a separate array │ │ │ │ │ +954 std::array, dim> oneDValuesShort; │ │ │ │ │ +955 │ │ │ │ │ +956 for (int i=0; i _g_e_t_I_J_K(typename GridView::IndexSet:: │ │ │ │ │ +IndexType idx, std::array elements) │ │ │ │ │ +1010 { │ │ │ │ │ +1011 std::array result; │ │ │ │ │ +1012 for (int i=0; i& out, │ │ │ │ │ +1029 const std::vector& knotVector, │ │ │ │ │ +1030 unsigned int order, │ │ │ │ │ +1031 unsigned int currentKnotSpan) │ │ │ │ │ +1032 { │ │ │ │ │ +1033 std::size_t outSize = order+1; // The 'standard' value away from the │ │ │ │ │ +boundaries of the knot vector │ │ │ │ │ +1034 if (currentKnotSpan (knotVector.size() - currentKnotSpan - 2) ) │ │ │ │ │ +1037 outSize -= order - (knotVector.size() - currentKnotSpan - 2); │ │ │ │ │ +1038 out.resize(outSize); │ │ │ │ │ +1039 │ │ │ │ │ +1040 // It's not really a matrix that is needed here, a plain 2d array would do │ │ │ │ │ +1041 DynamicMatrix N(order+1, knotVector.size()-1); │ │ │ │ │ +1042 │ │ │ │ │ +1043 // The text books on splines use the following geometric condition here to │ │ │ │ │ +fill the array N │ │ │ │ │ +1044 // (see for example Cottrell, Hughes, Bazilevs, Formula (2.1). However, │ │ │ │ │ +this condition │ │ │ │ │ +1045 // only works if splines are never evaluated exactly on the knots. │ │ │ │ │ +1046 // │ │ │ │ │ +1047 // for (size_t i=0; i 1e-10) │ │ │ │ │ +1056 ? (in - knotVector[i]) / (knotVector[i+r] - knotVector[i]) │ │ │ │ │ +1057 : 0; │ │ │ │ │ +1058 _R factor2 = ((knotVector[i+r+1] - knotVector[i+1]) > 1e-10) │ │ │ │ │ +1059 ? (knotVector[i+r+1] - in) / (knotVector[i+r+1] - knotVector[i+1]) │ │ │ │ │ +1060 : 0; │ │ │ │ │ +1061 N[r][i] = factor1 * N[r-1][i] + factor2 * N[r-1][i+1]; │ │ │ │ │ +1062 } │ │ │ │ │ +1063 │ │ │ │ │ +1068 for (size_t i=0; i& out, │ │ │ │ │ +1087 const std::vector& knotVector, │ │ │ │ │ +1088 unsigned int order, │ │ │ │ │ +1089 unsigned int currentKnotSpan) │ │ │ │ │ +1090 { │ │ │ │ │ +1091 // It's not really a matrix that is needed here, a plain 2d array would do │ │ │ │ │ +1092 DynamicMatrix& N = out; │ │ │ │ │ +1093 │ │ │ │ │ +1094 N.resize(order+1, knotVector.size()-1); │ │ │ │ │ +1095 │ │ │ │ │ +1096 // The text books on splines use the following geometric condition here to │ │ │ │ │ +fill the array N │ │ │ │ │ +1097 // (see for example Cottrell, Hughes, Bazilevs, Formula (2.1). However, │ │ │ │ │ +this condition │ │ │ │ │ +1098 // only works if splines are never evaluated exactly on the knots. │ │ │ │ │ +1099 // │ │ │ │ │ +1100 // for (size_t i=0; i 1e-10) │ │ │ │ │ +1109 ? (in - knotVector[i]) / (knotVector[i+r] - knotVector[i]) │ │ │ │ │ +1110 : 0; │ │ │ │ │ +1111 _R factor2 = ((knotVector[i+r+1] - knotVector[i+1]) > 1e-10) │ │ │ │ │ +1112 ? (knotVector[i+r+1] - in) / (knotVector[i+r+1] - knotVector[i+1]) │ │ │ │ │ +1113 : 0; │ │ │ │ │ +1114 N[r][i] = factor1 * N[r-1][i] + factor2 * N[r-1][i+1]; │ │ │ │ │ +1115 } │ │ │ │ │ +1116 } │ │ │ │ │ +1117 │ │ │ │ │ +1118 │ │ │ │ │ +_1_1_2_8 static void _e_v_a_l_u_a_t_e_A_l_l(const typename GV::ctype& in, │ │ │ │ │ +1129 std::vector& out, │ │ │ │ │ +1130 bool _e_v_a_l_u_a_t_e_J_a_c_o_b_i_a_n, std::vector& outJac, │ │ │ │ │ +1131 bool evaluateHessian, std::vector& outHess, │ │ │ │ │ +1132 const std::vector& knotVector, │ │ │ │ │ +1133 unsigned int order, │ │ │ │ │ +1134 unsigned int currentKnotSpan) │ │ │ │ │ +1135 { │ │ │ │ │ +1136 // How many shape functions to we have in each coordinate direction? │ │ │ │ │ +1137 unsigned int limit; │ │ │ │ │ +1138 limit = order+1; // The 'standard' value away from the boundaries of the │ │ │ │ │ +knot vector │ │ │ │ │ +1139 if (currentKnotSpan (knotVector.size() - currentKnotSpan - 2) ) │ │ │ │ │ +1142 limit -= order - (knotVector.size() - currentKnotSpan - 2); │ │ │ │ │ +1143 │ │ │ │ │ +1144 // The lowest knot spans that we need values from │ │ │ │ │ +1145 unsigned int offset; │ │ │ │ │ +1146 offset = std::max((int)(currentKnotSpan - order),0); │ │ │ │ │ +1147 │ │ │ │ │ +1148 // Evaluate 1d function values (needed for the product rule) │ │ │ │ │ +1149 DynamicMatrix values; │ │ │ │ │ +1150 │ │ │ │ │ +1151 _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); │ │ │ │ │ +1152 │ │ │ │ │ +1153 out.resize(knotVector.size()-order-1); │ │ │ │ │ +1154 for (size_t j=0; j lowOrderOneDValues; │ │ │ │ │ +1159 │ │ │ │ │ +1160 if (order!=0) │ │ │ │ │ +1161 { │ │ │ │ │ +1162 lowOrderOneDValues.resize(knotVector.size()-(order-1)-1); │ │ │ │ │ +1163 for (size_t j=0; j lowOrderTwoDValues; │ │ │ │ │ +1169 │ │ │ │ │ +1170 if (order>1 && evaluateHessian) │ │ │ │ │ +1171 { │ │ │ │ │ +1172 lowOrderTwoDValues.resize(knotVector.size()-(order-2)-1); │ │ │ │ │ +1173 for (size_t j=0; j _o_r_d_e_r__; │ │ │ │ │ +1235 │ │ │ │ │ +_1_2_3_7 std::array, dim> _k_n_o_t_V_e_c_t_o_r_s__; │ │ │ │ │ +1238 │ │ │ │ │ +_1_2_4_0 std::array _e_l_e_m_e_n_t_s__; │ │ │ │ │ +1241 │ │ │ │ │ +_1_2_4_2 _G_r_i_d_V_i_e_w _g_r_i_d_V_i_e_w__; │ │ │ │ │ +1243}; │ │ │ │ │ +1244 │ │ │ │ │ +1245 │ │ │ │ │ +1246 │ │ │ │ │ +1247template │ │ │ │ │ +_1_2_4_8class _B_S_p_l_i_n_e_N_o_d_e : │ │ │ │ │ +1249 public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ │ +1250{ │ │ │ │ │ +1251 static const int dim = GV::dimension; │ │ │ │ │ +1252 │ │ │ │ │ +1253public: │ │ │ │ │ +1254 │ │ │ │ │ +_1_2_5_5 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ +_1_2_5_6 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ │ +_1_2_5_7 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_>; │ │ │ │ │ +1258 │ │ │ │ │ +_1_2_5_9 _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) : │ │ │ │ │ +1260 _p_r_e_B_a_s_i_s__(preBasis), │ │ │ │ │ +1261 _f_i_n_i_t_e_E_l_e_m_e_n_t__(*preBasis) │ │ │ │ │ +1262 {} │ │ │ │ │ +1263 │ │ │ │ │ +_1_2_6_5 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ │ +1266 { │ │ │ │ │ +1267 return _e_l_e_m_e_n_t__; │ │ │ │ │ +1268 } │ │ │ │ │ +1269 │ │ │ │ │ +_1_2_7_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 │ │ │ │ │ +1275 { │ │ │ │ │ +1276 return _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ │ +1277 } │ │ │ │ │ +1278 │ │ │ │ │ +_1_2_8_0 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ │ +1281 { │ │ │ │ │ +1282 _e_l_e_m_e_n_t__ = e; │ │ │ │ │ +1283 auto elementIndex = _p_r_e_B_a_s_i_s__->gridView().indexSet().index(e); │ │ │ │ │ +1284 _f_i_n_i_t_e_E_l_e_m_e_n_t__._b_i_n_d(_p_r_e_B_a_s_i_s__->getIJK(elementIndex,_p_r_e_B_a_s_i_s__->elements_)); │ │ │ │ │ +1285 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__._s_i_z_e()); │ │ │ │ │ +1286 } │ │ │ │ │ +1287 │ │ │ │ │ +1288protected: │ │ │ │ │ +1289 │ │ │ │ │ +_1_2_9_0 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__; │ │ │ │ │ +1291 │ │ │ │ │ +_1_2_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_2_9_3 _E_l_e_m_e_n_t _e_l_e_m_e_n_t__; │ │ │ │ │ +1294}; │ │ │ │ │ +1295 │ │ │ │ │ +1296 │ │ │ │ │ +1297 │ │ │ │ │ +1298namespace BasisFactory { │ │ │ │ │ +1299 │ │ │ │ │ +_1_3_0_6inline auto _b_S_p_l_i_n_e(const std::vector& knotVector, │ │ │ │ │ +1307 unsigned int order, │ │ │ │ │ +1308 bool makeOpen = true) │ │ │ │ │ +1309{ │ │ │ │ │ +1310 return [&knotVector, order, makeOpen](const auto& gridView) { │ │ │ │ │ +1311 return _B_S_p_l_i_n_e_P_r_e_B_a_s_i_s>(gridView, │ │ │ │ │ +knotVector, order, makeOpen); │ │ │ │ │ +1312 }; │ │ │ │ │ +1313} │ │ │ │ │ +1314 │ │ │ │ │ +1315} // end namespace BasisFactory │ │ │ │ │ +1316 │ │ │ │ │ +1317/ │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +1318// This is the actual global basis implementation based on the reusable │ │ │ │ │ +parts. │ │ │ │ │ +1319/ │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +1320 │ │ │ │ │ +1327template │ │ │ │ │ +_1_3_2_8using _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_> >; │ │ │ │ │ +1329 │ │ │ │ │ +1330 │ │ │ │ │ +1331} // namespace Functions │ │ │ │ │ +1332 │ │ │ │ │ +1333} // namespace Dune │ │ │ │ │ +1334 │ │ │ │ │ +1335#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BSPLINEBASIS_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 │ │ │ │ │ +_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:1306 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e │ │ │ │ │ -DDeeffiinniittiioonn functionfromcallable.hh:20 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _F_,_ _F_u_n_c_t_i_o_n_I_n_t_e_r_f_a_c_e_ _>_:_: │ │ │ │ │ -_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e │ │ │ │ │ -FunctionFromCallable(F &&f) │ │ │ │ │ -Create VirtualFunction from callable object. │ │ │ │ │ -DDeeffiinniittiioonn functionfromcallable.hh:52 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _F_,_ _F_u_n_c_t_i_o_n_I_n_t_e_r_f_a_c_e_ _>_:_: │ │ │ │ │ -_e_v_a_l_u_a_t_e │ │ │ │ │ -void evaluate(const Domain &x, Range &y) const │ │ │ │ │ -Evaluate function. │ │ │ │ │ -DDeeffiinniittiioonn functionfromcallable.hh:73 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e_<_ _R_a_n_g_e_(_D_o_m_a_i_n_)_,_ _F_,_ _F_u_n_c_t_i_o_n_I_n_t_e_r_f_a_c_e_ _>_:_: │ │ │ │ │ -_F_u_n_c_t_i_o_n_F_r_o_m_C_a_l_l_a_b_l_e │ │ │ │ │ -FunctionFromCallable(const F &f) │ │ │ │ │ -Create VirtualFunction from callable object. │ │ │ │ │ -DDeeffiinniittiioonn functionfromcallable.hh:64 │ │ │ │ │ +_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:362 │ │ │ │ │ +_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: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_:_:_p_r_e_B_a_s_i_s__ │ │ │ │ │ +const BSplinePreBasis< GV > & preBasis_ │ │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:474 │ │ │ │ │ +_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:439 │ │ │ │ │ +_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:372 │ │ │ │ │ +_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_:_:_c_u_r_r_e_n_t_K_n_o_t_S_p_a_n__ │ │ │ │ │ +std::array< unsigned, dim > currentKnotSpan_ │ │ │ │ │ +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_:_:_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:376 │ │ │ │ │ +_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:433 │ │ │ │ │ +_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:394 │ │ │ │ │ +_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__ │ │ │ │ │ +BSplineLocalInterpolation< dim, BSplineLocalBasis< GV, R > > │ │ │ │ │ +localInterpolation_ │ │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:478 │ │ │ │ │ +_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:455 │ │ │ │ │ +_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:445 │ │ │ │ │ +_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__ │ │ │ │ │ +BSplineLocalCoefficients< dim > localCoefficients_ │ │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:477 │ │ │ │ │ +_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:463 │ │ │ │ │ +_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__ │ │ │ │ │ +BSplineLocalBasis< GV, R > localBasis_ │ │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:476 │ │ │ │ │ +_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:427 │ │ │ │ │ +_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:499 │ │ │ │ │ +_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_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 bsplinebasis.hh:567 │ │ │ │ │ +_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:1240 │ │ │ │ │ +_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:1242 │ │ │ │ │ +_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: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_:_:_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:1085 │ │ │ │ │ +_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:781 │ │ │ │ │ +_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:1234 │ │ │ │ │ +_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 │ │ │ │ │ +size_type dimension() const │ │ │ │ │ +Get the total dimension of the space spanned by this basis. │ │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:719 │ │ │ │ │ +_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:1128 │ │ │ │ │ +_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:1028 │ │ │ │ │ +_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:774 │ │ │ │ │ +_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:560 │ │ │ │ │ +_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:735 │ │ │ │ │ +_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:913 │ │ │ │ │ +_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:561 │ │ │ │ │ +_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_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ +static constexpr size_type maxMultiIndexSize │ │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:565 │ │ │ │ │ +_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:686 │ │ │ │ │ +_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:676 │ │ │ │ │ +_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 Dune::ReservedVector< ST, i > &prefix) const │ │ │ │ │ +Return number of possible values for next position in multi index. │ │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:712 │ │ │ │ │ +_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() const │ │ │ │ │ +Total number of B-spline basis functions. │ │ │ │ │ +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_:_:_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:680 │ │ │ │ │ +_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:1009 │ │ │ │ │ +_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:694 │ │ │ │ │ +_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:590 │ │ │ │ │ +_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:812 │ │ │ │ │ +_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_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ +static constexpr size_type minMultiIndexSize │ │ │ │ │ +DDeeffiinniittiioonn bsplinebasis.hh:566 │ │ │ │ │ +_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:1237 │ │ │ │ │ +_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:725 │ │ │ │ │ +_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:642 │ │ │ │ │ +_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:46 │ │ │ │ │ +_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:55 │ │ │ │ │ +_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:140 │ │ │ │ │ +_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: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_:_:_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:97 │ │ │ │ │ +_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:70 │ │ │ │ │ +_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:82 │ │ │ │ │ +_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:61 │ │ │ │ │ +_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:178 │ │ │ │ │ +_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:321 │ │ │ │ │ +_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:256 │ │ │ │ │ +_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:315 │ │ │ │ │ +_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:340 │ │ │ │ │ +_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:344 │ │ │ │ │ +_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:1250 │ │ │ │ │ +_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:1274 │ │ │ │ │ +_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:1256 │ │ │ │ │ +_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:1290 │ │ │ │ │ +_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:1293 │ │ │ │ │ +_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:1280 │ │ │ │ │ +_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:1259 │ │ │ │ │ +_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:1265 │ │ │ │ │ +_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:1292 │ │ │ │ │ +_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:1255 │ │ │ │ │ +_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:46 │ │ │ │ │ +_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 │ │ │ │ │ +DDeeffiinniittiioonn nodes.hh:142 │ │ │ │ │ +_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:164 │ │ │ │ │ +_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:186 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00152.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: typeerasure.hh File Reference │ │ │ │ +dune-functions: subentitydofs.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,44 +65,58 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces
│ │ │ │ -
typeerasure.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Functions
│ │ │ │ +
subentitydofs.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 <vector>
│ │ │ │ +#include <dune/geometry/referenceelements.hh>
│ │ │ │ +#include <dune/typetree/traversal.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::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.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,27 +1,39 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -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> │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +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_:_:_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_:_:_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. │ │ │ │ │ +  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00152_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: typeerasure.hh Source File │ │ │ │ +dune-functions: subentitydofs.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,173 +70,174 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
typeerasure.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#ifndef DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH
│ │ │ │
5
│ │ │ │ -
6#include <typeinfo>
│ │ │ │ +
6#include <vector>
│ │ │ │
7
│ │ │ │ -
8#include <dune/common/typeutilities.hh>
│ │ │ │ -
9
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
13
│ │ │ │ -
14namespace Dune {
│ │ │ │ -
15namespace Functions {
│ │ │ │ -
16namespace Imp {
│ │ │ │ +
8#include <dune/geometry/referenceelements.hh>
│ │ │ │ +
9#include <dune/typetree/traversal.hh>
│ │ │ │ +
10
│ │ │ │ +
11
│ │ │ │ +
12
│ │ │ │ +
13namespace Dune {
│ │ │ │ +
14namespace Functions {
│ │ │ │ +
15
│ │ │ │ +
16
│ │ │ │
17
│ │ │ │ -
18
│ │ │ │ -
19
│ │ │ │ -
33template<class Interface>
│ │ │ │ -
34class TypeErasureWrapperInterface :
│ │ │ │ -
35 public Interface,
│ │ │ │ -
36 public PolymorphicType<TypeErasureWrapperInterface<Interface>>
│ │ │ │ -
37{
│ │ │ │ -
38public:
│ │ │ │ -
39 virtual const std::type_info& target_type() const = 0;
│ │ │ │ -
40};
│ │ │ │ -
41
│ │ │ │ -
42
│ │ │ │ -
43
│ │ │ │ -
60template<class Interface, class T>
│ │ │ │ -
61class TypeErasureWrapperBase :
│ │ │ │ -
62 public TypeErasureWrapperInterface<Interface>
│ │ │ │ -
63{
│ │ │ │ -
64public:
│ │ │ │ -
65 template<class TT, disableCopyMove<TypeErasureWrapperBase, TT> = 0>
│ │ │ │ -
66 TypeErasureWrapperBase(TT&& t) :
│ │ │ │ -
67 wrapped_(std::forward<TT>(t))
│ │ │ │ -
68 {}
│ │ │ │ +
40template<class GridView>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
42{
│ │ │ │ +
43 static const int dim = GridView::dimension;
│ │ │ │ +
44
│ │ │ │ +
45public:
│ │ │ │ +
46
│ │ │ │ +
63 template<class LocalView>
│ │ │ │ +
│ │ │ │ +
64 SubEntityDOFs& bind(const LocalView& localView, std::size_t subEntityIndex, std::size_t subEntityCodim)
│ │ │ │ +
65 {
│ │ │ │ +
66 // fill vector with local indices of all DOFs contained in subentity
│ │ │ │ +
67 containedDOFs_.clear();
│ │ │ │ +
68 dofIsContained_.assign(localView.size(), false);
│ │ │ │
69
│ │ │ │ -
71 T& get()
│ │ │ │ -
72 {
│ │ │ │ -
73 return wrapped_;
│ │ │ │ -
74 }
│ │ │ │ -
75
│ │ │ │ -
77 const T& get() const
│ │ │ │ -
78 {
│ │ │ │ -
79 return wrapped_;
│ │ │ │ -
80 }
│ │ │ │ -
81
│ │ │ │ -
82protected:
│ │ │ │ -
83 using Wrapped = T;
│ │ │ │ -
84 Wrapped wrapped_;
│ │ │ │ -
85};
│ │ │ │ -
86
│ │ │ │ +
70 auto re = Dune::referenceElement<double,dim>(localView.element().type());
│ │ │ │ +
71
│ │ │ │ +
72 Dune::TypeTree::forEachLeafNode(localView.tree(), [&](auto&& node, auto&& /*treePath*/) {
│ │ │ │ +
73 const auto& localCoefficients = node.finiteElement().localCoefficients();
│ │ │ │ +
74 std::size_t localSize = localCoefficients.size();
│ │ │ │ +
75 for(std::size_t i=0; i<localSize; ++i)
│ │ │ │ +
76 {
│ │ │ │ +
77 auto localKey = localCoefficients.localKey(i);
│ │ │ │ +
78 if (re.subEntities(subEntityIndex, subEntityCodim, localKey.codim()).contains(localKey.subEntity()))
│ │ │ │ +
79 {
│ │ │ │ +
80 containedDOFs_.push_back(node.localIndex(i));
│ │ │ │ +
81 dofIsContained_[node.localIndex(i)] = true;
│ │ │ │ +
82 }
│ │ │ │ +
83 }
│ │ │ │ +
84 });
│ │ │ │ +
85 return *this;
│ │ │ │ +
86 }
│ │ │ │ +
│ │ │ │
87
│ │ │ │ -
88
│ │ │ │ -
112template<class Interface, template<class> class Implementation, class T>
│ │ │ │ -
113class TypeErasureWrapperImplementation :
│ │ │ │ -
114 public Implementation<TypeErasureWrapperBase<Interface, T> >
│ │ │ │ -
115{
│ │ │ │ -
116public:
│ │ │ │ -
117
│ │ │ │ -
119 template<class TT, disableCopyMove<TypeErasureWrapperImplementation, T> = 0>
│ │ │ │ -
120 TypeErasureWrapperImplementation(TT&& t) :
│ │ │ │ -
121 Implementation<TypeErasureWrapperBase<Interface, T> >(std::forward<TT>(t))
│ │ │ │ -
122 {}
│ │ │ │ -
123
│ │ │ │ -
125 virtual TypeErasureWrapperImplementation* clone() const
│ │ │ │ -
126 {
│ │ │ │ -
127 return new TypeErasureWrapperImplementation(*this);
│ │ │ │ -
128 }
│ │ │ │ -
129
│ │ │ │ -
131 virtual TypeErasureWrapperImplementation* clone(void* buffer) const
│ │ │ │ -
132 {
│ │ │ │ -
133 return new (buffer) TypeErasureWrapperImplementation(*this);
│ │ │ │ -
134 }
│ │ │ │ -
135
│ │ │ │ -
137 virtual TypeErasureWrapperImplementation* move(void* buffer)
│ │ │ │ -
138 {
│ │ │ │ -
139 return new (buffer) TypeErasureWrapperImplementation(std::move(*this));
│ │ │ │ -
140 }
│ │ │ │ -
141
│ │ │ │ -
143 virtual const std::type_info& target_type() const
│ │ │ │ -
144 {
│ │ │ │ -
145 return typeid(T);
│ │ │ │ -
146 }
│ │ │ │ -
147};
│ │ │ │ -
148
│ │ │ │ -
149} // namespace Dune::Functions::Imp
│ │ │ │ -
150
│ │ │ │ -
151
│ │ │ │ -
152
│ │ │ │ -
163template<class Interface, template<class> class Implementation, size_t bufferSize = 56>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
165{
│ │ │ │ -
166public:
│ │ │ │ -
167
│ │ │ │ -
169 template<class T, disableCopyMove<TypeErasureBase, T> = 0 >
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
171 wrapped_(Imp::TypeErasureWrapperImplementation<Interface, Implementation, typename std::decay<T>::type>(std::forward<T>(t)))
│ │ │ │ -
172 {}
│ │ │ │ -
│ │ │ │ -
173
│ │ │ │ -
175 TypeErasureBase() = default;
│ │ │ │ -
176
│ │ │ │ -
│ │ │ │ -
178 Interface& asInterface()
│ │ │ │ -
179 {
│ │ │ │ -
180 return wrapped_.get();
│ │ │ │ -
181 }
│ │ │ │ -
│ │ │ │ -
182
│ │ │ │ -
│ │ │ │ -
184 const Interface& asInterface() const
│ │ │ │ -
185 {
│ │ │ │ -
186 return wrapped_.get();
│ │ │ │ -
187 }
│ │ │ │ -
│ │ │ │ -
188
│ │ │ │ -
│ │ │ │ -
190 const std::type_info& target_type() const
│ │ │ │ -
191 {
│ │ │ │ -
192 return wrapped_.get().target_type();
│ │ │ │ -
193 }
│ │ │ │ +
103 template<class LocalView, class Intersection>
│ │ │ │ +
│ │ │ │ +
104 SubEntityDOFs& bind(const LocalView& localView, const Intersection& intersection)
│ │ │ │ +
105 {
│ │ │ │ +
106 return bind(localView, intersection.indexInInside(), 1);
│ │ │ │ +
107 }
│ │ │ │ +
│ │ │ │ +
108
│ │ │ │ +
│ │ │ │ +
110 auto begin() const
│ │ │ │ +
111 {
│ │ │ │ +
112 return containedDOFs_.cbegin();
│ │ │ │ +
113 }
│ │ │ │ +
│ │ │ │ +
114
│ │ │ │ +
│ │ │ │ +
116 auto end() const
│ │ │ │ +
117 {
│ │ │ │ +
118 return containedDOFs_.cend();
│ │ │ │ +
119 }
│ │ │ │ +
│ │ │ │ +
120
│ │ │ │ +
│ │ │ │ +
122 auto size() const
│ │ │ │ +
123 {
│ │ │ │ +
124 return containedDOFs_.size();
│ │ │ │ +
125 }
│ │ │ │ +
│ │ │ │ +
126
│ │ │ │ +
│ │ │ │ +
128 decltype(auto) operator[](std::size_t i) const
│ │ │ │ +
129 {
│ │ │ │ +
130 return containedDOFs_[i];
│ │ │ │ +
131 }
│ │ │ │ +
│ │ │ │ +
132
│ │ │ │ +
│ │ │ │ +
134 bool contains(std::size_t localIndex) const
│ │ │ │ +
135 {
│ │ │ │ +
136 return dofIsContained_[localIndex];
│ │ │ │ +
137 }
│ │ │ │ +
│ │ │ │ +
138
│ │ │ │ +
139private:
│ │ │ │ +
140
│ │ │ │ +
141 std::vector<std::size_t> containedDOFs_;
│ │ │ │ +
142 std::vector<bool> dofIsContained_;
│ │ │ │ +
143};
│ │ │ │ +
│ │ │ │ +
144
│ │ │ │ +
145
│ │ │ │ +
146
│ │ │ │ +
159template<class T>
│ │ │ │ +
│ │ │ │ +
160auto subEntityDOFs(const T&)
│ │ │ │ +
161{
│ │ │ │ + │ │ │ │ +
163}
│ │ │ │ +
│ │ │ │ +
164
│ │ │ │ +
165
│ │ │ │ +
166
│ │ │ │ +
186template<class LocalView>
│ │ │ │ +
│ │ │ │ +
187auto subEntityDOFs(const LocalView& localView, std::size_t subEntityIndex, std::size_t subEntityCodim)
│ │ │ │ +
188{
│ │ │ │ +
189 using GridView = typename LocalView::GridView;
│ │ │ │ + │ │ │ │ +
191 subEntityDOFs.bind(localView, subEntityIndex, subEntityCodim);
│ │ │ │ +
192 return subEntityDOFs;
│ │ │ │ +
193}
│ │ │ │
│ │ │ │
194
│ │ │ │ -
195protected:
│ │ │ │ - │ │ │ │ -
197};
│ │ │ │ -
│ │ │ │ -
198
│ │ │ │ -
199
│ │ │ │ -
200}} // namespace Dune::Functions
│ │ │ │ -
201
│ │ │ │ -
202
│ │ │ │ -
203
│ │ │ │ -
204#endif // DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ +
195
│ │ │ │ +
196
│ │ │ │ +
215template<class LocalView, class Intersection>
│ │ │ │ +
│ │ │ │ +
216auto subEntityDOFs(const LocalView& localView, const Intersection& intersection)
│ │ │ │ +
217{
│ │ │ │ +
218 using GridView = typename LocalView::GridView;
│ │ │ │ + │ │ │ │ +
220 subEntityDOFs.bind(localView, intersection);
│ │ │ │ +
221 return subEntityDOFs;
│ │ │ │ +
222}
│ │ │ │ +
│ │ │ │ +
223
│ │ │ │ +
224
│ │ │ │ +
225
│ │ │ │ +
226} // namespace Functions
│ │ │ │ +
227} // namespace Dune
│ │ │ │ +
228
│ │ │ │ +
229#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH
│ │ │ │ +
auto subEntityDOFs(const T &)
Create SubEntityDOFs object.
Definition subentitydofs.hh:160
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
A wrapper providing small object optimization with polymorphic types.
Definition polymorphicsmallobject.hh:45
│ │ │ │ -
Base class for type-erased interface wrapper.
Definition typeerasure.hh:165
│ │ │ │ -
const std::type_info & target_type() const
Get type of stored object.
Definition typeerasure.hh:190
│ │ │ │ -
TypeErasureBase(T &&t)
Construct wrapper from object.
Definition typeerasure.hh:170
│ │ │ │ -
PolymorphicSmallObject< Imp::TypeErasureWrapperInterface< Interface >, bufferSize > wrapped_
Definition typeerasure.hh:196
│ │ │ │ -
TypeErasureBase()=default
Default constructor.
│ │ │ │ -
Interface & asInterface()
Get mutable reference to wrapped object.
Definition typeerasure.hh:178
│ │ │ │ -
const Interface & asInterface() const
Get reference to wrapped object.
Definition typeerasure.hh:184
│ │ │ │ +
Range of DOFs associated to sub-entity.
Definition subentitydofs.hh:42
│ │ │ │ +
auto begin() const
Create begin iterator for access to range of contained local indices.
Definition subentitydofs.hh:110
│ │ │ │ +
auto size() const
Return number of contained DOFs.
Definition subentitydofs.hh:122
│ │ │ │ +
SubEntityDOFs & bind(const LocalView &localView, const Intersection &intersection)
Bind SubEntityDOFs object to LocalView and sub-entity.
Definition subentitydofs.hh:104
│ │ │ │ +
bool contains(std::size_t localIndex) const
Check if given local index is contained in this range of DOFs.
Definition subentitydofs.hh:134
│ │ │ │ +
auto end() const
Create end iterator for access to range of contained local indices.
Definition subentitydofs.hh:116
│ │ │ │ +
SubEntityDOFs & bind(const LocalView &localView, std::size_t subEntityIndex, std::size_t subEntityCodim)
Bind SubEntityDOFs object to LocalView and sub-entity.
Definition subentitydofs.hh:64
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,179 +1,174 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -typeerasure.hh │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ +6#include │ │ │ │ │ 7 │ │ │ │ │ -8#include │ │ │ │ │ -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_/_p_o_l_y_m_o_r_p_h_i_c_s_m_a_l_l_o_b_j_e_c_t_._h_h> │ │ │ │ │ -13 │ │ │ │ │ -14namespace _D_u_n_e { │ │ │ │ │ -15namespace Functions { │ │ │ │ │ -16namespace Imp { │ │ │ │ │ +8#include │ │ │ │ │ +9#include │ │ │ │ │ +10 │ │ │ │ │ +11 │ │ │ │ │ +12 │ │ │ │ │ +13namespace _D_u_n_e { │ │ │ │ │ +14namespace Functions { │ │ │ │ │ +15 │ │ │ │ │ +16 │ │ │ │ │ 17 │ │ │ │ │ -18 │ │ │ │ │ -19 │ │ │ │ │ -33template │ │ │ │ │ -34class TypeErasureWrapperInterface : │ │ │ │ │ -35 public Interface, │ │ │ │ │ -36 public PolymorphicType> │ │ │ │ │ -37{ │ │ │ │ │ -38public: │ │ │ │ │ -39 virtual const std::type_info& target_type() const = 0; │ │ │ │ │ -40}; │ │ │ │ │ -41 │ │ │ │ │ -42 │ │ │ │ │ -43 │ │ │ │ │ -60template │ │ │ │ │ -61class TypeErasureWrapperBase : │ │ │ │ │ -62 public TypeErasureWrapperInterface │ │ │ │ │ -63{ │ │ │ │ │ -64public: │ │ │ │ │ -65 template = 0> │ │ │ │ │ -66 TypeErasureWrapperBase(TT&& t) : │ │ │ │ │ -67 wrapped_(std::forward(t)) │ │ │ │ │ -68 {} │ │ │ │ │ +40template │ │ │ │ │ +_4_1class _S_u_b_E_n_t_i_t_y_D_O_F_s │ │ │ │ │ +42{ │ │ │ │ │ +43 static const int dim = GridView::dimension; │ │ │ │ │ +44 │ │ │ │ │ +45public: │ │ │ │ │ +46 │ │ │ │ │ +63 template │ │ │ │ │ +_6_4 _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) │ │ │ │ │ +65 { │ │ │ │ │ +66 // fill vector with local indices of all DOFs contained in subentity │ │ │ │ │ +67 containedDOFs_.clear(); │ │ │ │ │ +68 dofIsContained_.assign(localView.size(), false); │ │ │ │ │ 69 │ │ │ │ │ -71 T& get() │ │ │ │ │ -72 { │ │ │ │ │ -73 return wrapped_; │ │ │ │ │ -74 } │ │ │ │ │ -75 │ │ │ │ │ -77 const T& get() const │ │ │ │ │ -78 { │ │ │ │ │ -79 return wrapped_; │ │ │ │ │ -80 } │ │ │ │ │ -81 │ │ │ │ │ -82protected: │ │ │ │ │ -83 using Wrapped = T; │ │ │ │ │ -84 Wrapped wrapped_; │ │ │ │ │ -85}; │ │ │ │ │ -86 │ │ │ │ │ +70 auto re = Dune::referenceElement(localView.element().type()); │ │ │ │ │ +71 │ │ │ │ │ +72 Dune::TypeTree::forEachLeafNode(localView.tree(), [&](auto&& node, auto&& / │ │ │ │ │ +*treePath*/) { │ │ │ │ │ +73 const auto& localCoefficients = node.finiteElement().localCoefficients(); │ │ │ │ │ +74 std::size_t localSize = localCoefficients.size(); │ │ │ │ │ +75 for(std::size_t i=0; i class Implementation, class T> │ │ │ │ │ -113class TypeErasureWrapperImplementation : │ │ │ │ │ -114 public Implementation > │ │ │ │ │ -115{ │ │ │ │ │ -116public: │ │ │ │ │ -117 │ │ │ │ │ -119 template = │ │ │ │ │ -0> │ │ │ │ │ -120 TypeErasureWrapperImplementation(TT&& t) : │ │ │ │ │ -121 Implementation >(std::forward(t)) │ │ │ │ │ -122 {} │ │ │ │ │ -123 │ │ │ │ │ -125 virtual TypeErasureWrapperImplementation* clone() const │ │ │ │ │ -126 { │ │ │ │ │ -127 return new TypeErasureWrapperImplementation(*this); │ │ │ │ │ -128 } │ │ │ │ │ -129 │ │ │ │ │ -131 virtual TypeErasureWrapperImplementation* clone(void* buffer) const │ │ │ │ │ -132 { │ │ │ │ │ -133 return new (buffer) TypeErasureWrapperImplementation(*this); │ │ │ │ │ -134 } │ │ │ │ │ -135 │ │ │ │ │ -137 virtual TypeErasureWrapperImplementation* move(void* buffer) │ │ │ │ │ -138 { │ │ │ │ │ -139 return new (buffer) TypeErasureWrapperImplementation(std::move(*this)); │ │ │ │ │ -140 } │ │ │ │ │ -141 │ │ │ │ │ -143 virtual const std::type_info& target_type() const │ │ │ │ │ -144 { │ │ │ │ │ -145 return typeid(T); │ │ │ │ │ -146 } │ │ │ │ │ -147}; │ │ │ │ │ -148 │ │ │ │ │ -149} // namespace Dune::Functions::Imp │ │ │ │ │ -150 │ │ │ │ │ -151 │ │ │ │ │ -152 │ │ │ │ │ -163template class Implementation, size_t │ │ │ │ │ -bufferSize = 56> │ │ │ │ │ -_1_6_4class _T_y_p_e_E_r_a_s_u_r_e_B_a_s_e │ │ │ │ │ -165{ │ │ │ │ │ -166public: │ │ │ │ │ -167 │ │ │ │ │ -169 template = 0 > │ │ │ │ │ -_1_7_0 _T_y_p_e_E_r_a_s_u_r_e_B_a_s_e(T&& t) : │ │ │ │ │ -171 _w_r_a_p_p_e_d__(Imp::TypeErasureWrapperImplementation::type>(std::forward(t))) │ │ │ │ │ -172 {} │ │ │ │ │ -173 │ │ │ │ │ -_1_7_5 _T_y_p_e_E_r_a_s_u_r_e_B_a_s_e() = default; │ │ │ │ │ -176 │ │ │ │ │ -_1_7_8 Interface& _a_s_I_n_t_e_r_f_a_c_e() │ │ │ │ │ -179 { │ │ │ │ │ -180 return _w_r_a_p_p_e_d__.get(); │ │ │ │ │ -181 } │ │ │ │ │ -182 │ │ │ │ │ -_1_8_4 const Interface& _a_s_I_n_t_e_r_f_a_c_e() const │ │ │ │ │ -185 { │ │ │ │ │ -186 return _w_r_a_p_p_e_d__.get(); │ │ │ │ │ -187 } │ │ │ │ │ -188 │ │ │ │ │ -_1_9_0 const std::type_info& _t_a_r_g_e_t___t_y_p_e() const │ │ │ │ │ -191 { │ │ │ │ │ -192 return _w_r_a_p_p_e_d__.get().target_type(); │ │ │ │ │ -193 } │ │ │ │ │ +103 template │ │ │ │ │ +_1_0_4 _S_u_b_E_n_t_i_t_y_D_O_F_s& _b_i_n_d(const LocalView& localView, const Intersection& │ │ │ │ │ +intersection) │ │ │ │ │ +105 { │ │ │ │ │ +106 return bind(localView, intersection.indexInInside(), 1); │ │ │ │ │ +107 } │ │ │ │ │ +108 │ │ │ │ │ +_1_1_0 auto _b_e_g_i_n() const │ │ │ │ │ +111 { │ │ │ │ │ +112 return containedDOFs_.cbegin(); │ │ │ │ │ +113 } │ │ │ │ │ +114 │ │ │ │ │ +_1_1_6 auto _e_n_d() const │ │ │ │ │ +117 { │ │ │ │ │ +118 return containedDOFs_.cend(); │ │ │ │ │ +119 } │ │ │ │ │ +120 │ │ │ │ │ +_1_2_2 auto _s_i_z_e() const │ │ │ │ │ +123 { │ │ │ │ │ +124 return containedDOFs_.size(); │ │ │ │ │ +125 } │ │ │ │ │ +126 │ │ │ │ │ +_1_2_8 decltype(auto) operator[](std::size_t i) const │ │ │ │ │ +129 { │ │ │ │ │ +130 return containedDOFs_[i]; │ │ │ │ │ +131 } │ │ │ │ │ +132 │ │ │ │ │ +_1_3_4 bool _c_o_n_t_a_i_n_s(std::size_t localIndex) const │ │ │ │ │ +135 { │ │ │ │ │ +136 return dofIsContained_[localIndex]; │ │ │ │ │ +137 } │ │ │ │ │ +138 │ │ │ │ │ +139private: │ │ │ │ │ +140 │ │ │ │ │ +141 std::vector containedDOFs_; │ │ │ │ │ +142 std::vector dofIsContained_; │ │ │ │ │ +143}; │ │ │ │ │ +144 │ │ │ │ │ +145 │ │ │ │ │ +146 │ │ │ │ │ +159template │ │ │ │ │ +_1_6_0auto _s_u_b_E_n_t_i_t_y_D_O_F_s(const T&) │ │ │ │ │ +161{ │ │ │ │ │ +162 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_>{}; │ │ │ │ │ +163} │ │ │ │ │ +164 │ │ │ │ │ +165 │ │ │ │ │ +166 │ │ │ │ │ +186template │ │ │ │ │ +_1_8_7auto _s_u_b_E_n_t_i_t_y_D_O_F_s(const LocalView& localView, std::size_t subEntityIndex, │ │ │ │ │ +std::size_t subEntityCodim) │ │ │ │ │ +188{ │ │ │ │ │ +189 using GridView = typename LocalView::GridView; │ │ │ │ │ +190 _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; │ │ │ │ │ +191 _s_u_b_E_n_t_i_t_y_D_O_F_s.bind(localView, subEntityIndex, subEntityCodim); │ │ │ │ │ +192 return _s_u_b_E_n_t_i_t_y_D_O_F_s; │ │ │ │ │ +193} │ │ │ │ │ 194 │ │ │ │ │ -195protected: │ │ │ │ │ -_1_9_6 _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__; │ │ │ │ │ -197}; │ │ │ │ │ -198 │ │ │ │ │ -199 │ │ │ │ │ -200}} // namespace Dune::Functions │ │ │ │ │ -201 │ │ │ │ │ -202 │ │ │ │ │ -203 │ │ │ │ │ -204#endif // DUNE_FUNCTIONS_COMMON_TYPEERASURE_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 │ │ │ │ │ -_p_o_l_y_m_o_r_p_h_i_c_s_m_a_l_l_o_b_j_e_c_t_._h_h │ │ │ │ │ +195 │ │ │ │ │ +196 │ │ │ │ │ +215template │ │ │ │ │ +_2_1_6auto _s_u_b_E_n_t_i_t_y_D_O_F_s(const LocalView& localView, const Intersection& │ │ │ │ │ +intersection) │ │ │ │ │ +217{ │ │ │ │ │ +218 using GridView = typename LocalView::GridView; │ │ │ │ │ +219 _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; │ │ │ │ │ +220 _s_u_b_E_n_t_i_t_y_D_O_F_s.bind(localView, intersection); │ │ │ │ │ +221 return _s_u_b_E_n_t_i_t_y_D_O_F_s; │ │ │ │ │ +222} │ │ │ │ │ +223 │ │ │ │ │ +224 │ │ │ │ │ +225 │ │ │ │ │ +226} // namespace Functions │ │ │ │ │ +227} // namespace Dune │ │ │ │ │ +228 │ │ │ │ │ +229#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:160 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:45 │ │ │ │ │ -_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 │ │ │ │ │ -Base class for type-erased interface wrapper. │ │ │ │ │ -DDeeffiinniittiioonn typeerasure.hh:165 │ │ │ │ │ -_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:190 │ │ │ │ │ -_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:170 │ │ │ │ │ -_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_:_:_w_r_a_p_p_e_d__ │ │ │ │ │ -PolymorphicSmallObject< Imp::TypeErasureWrapperInterface< Interface >, │ │ │ │ │ -bufferSize > wrapped_ │ │ │ │ │ -DDeeffiinniittiioonn typeerasure.hh:196 │ │ │ │ │ -_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:178 │ │ │ │ │ -_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:184 │ │ │ │ │ +_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:42 │ │ │ │ │ +_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:110 │ │ │ │ │ +_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:122 │ │ │ │ │ +_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:104 │ │ │ │ │ +_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:134 │ │ │ │ │ +_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:116 │ │ │ │ │ +_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:64 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00155.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: polymorphicsmallobject.hh File Reference │ │ │ │ +dune-functions: hierarchicvectorwrapper.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,41 +65,59 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces
│ │ │ │ -
polymorphicsmallobject.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Functions
│ │ │ │ +
hierarchicvectorwrapper.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <utility>
│ │ │ │ -#include <type_traits>
│ │ │ │ +
#include <dune/common/concept.hh>
│ │ │ │ +#include <dune/common/hybridutilities.hh>
│ │ │ │ +#include <dune/common/indices.hh>
│ │ │ │ +#include <dune/functions/common/indexaccess.hh>
│ │ │ │ +#include <dune/functions/common/utility.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::PolymorphicSmallObject< Base, bufferSize >
 A wrapper providing small object optimization with polymorphic types. More...
class  Dune::Functions::HierarchicVectorWrapper< V, CO >
 A wrapper providing multiindex access to vector entries. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +

│ │ │ │ Namespaces

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

│ │ │ │ +Functions

template<class V >
HierarchicVectorWrapper< V > Dune::Functions::hierarchicVector (V &v)
 
template<class MultiIndex , class V , typename std::enable_if< models< Concept::HasIndexAccess, V, MultiIndex >(), int >::type = 0>
V & Dune::Functions::makeHierarchicVectorForMultiIndex (V &v)
 
template<class MultiIndex , class V , typename std::enable_if< not models< Concept::HasIndexAccess, V, MultiIndex >(), int >::type = 0>
HierarchicVectorWrapper< V > Dune::Functions::makeHierarchicVectorForMultiIndex (V &v)
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,24 +1,42 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -polymorphicsmallobject.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +hierarchicvectorwrapper.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_/_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_/_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_/_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_:_:_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_:_:_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_<_ _V_,_ _C_O_ _> │ │ │ │ │ +  A wrapper providing multiindex access to vector entries. _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 │ │ │ │ │ +_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r< V >  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_h_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r (V &v) │ │ │ │ │ +  │ │ │ │ │ +template(), int >::type = 0> │ │ │ │ │ + V &  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_: │ │ │ │ │ + _m_a_k_e_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_F_o_r_M_u_l_t_i_I_n_d_e_x (V &v) │ │ │ │ │ +  │ │ │ │ │ +template(), int >::type = 0> │ │ │ │ │ +_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r< V >  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_: │ │ │ │ │ + _m_a_k_e_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_F_o_r_M_u_l_t_i_I_n_d_e_x (V &v) │ │ │ │ │ +  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00155_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: polymorphicsmallobject.hh Source File │ │ │ │ +dune-functions: hierarchicvectorwrapper.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,192 +70,304 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
polymorphicsmallobject.hh
│ │ │ │ +
hierarchicvectorwrapper.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#ifndef DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICVECTORWRAPPER_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICVECTORWRAPPER_HH
│ │ │ │
5
│ │ │ │ -
6#include <utility>
│ │ │ │ -
7#include <type_traits>
│ │ │ │ -
8
│ │ │ │ -
9namespace Dune {
│ │ │ │ -
10namespace Functions {
│ │ │ │ -
11
│ │ │ │ -
12
│ │ │ │ -
43template<class Base, size_t bufferSize>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
45{
│ │ │ │ -
46public:
│ │ │ │ -
47
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
50 p_(nullptr)
│ │ │ │ -
51 {}
│ │ │ │ -
│ │ │ │ -
52
│ │ │ │ -
59 template<class Derived,
│ │ │ │ -
60 typename std::enable_if<std::is_base_of<Base, std::remove_cv_t<
│ │ │ │ -
61 std::remove_reference_t<Derived>>>::value, int>::type = 0>
│ │ │ │ -
│ │ │ │ -
62 PolymorphicSmallObject(Derived&& derived)
│ │ │ │ -
63 {
│ │ │ │ -
64 constexpr bool useBuffer = sizeof(Derived) <= bufferSize;
│ │ │ │ -
65 if constexpr (useBuffer) {
│ │ │ │ -
66 p_ = new (&buffer_) Derived(std::forward<Derived>(derived));
│ │ │ │ -
67 } else {
│ │ │ │ -
68 p_ = new Derived(std::forward<Derived>(derived));
│ │ │ │ -
69 }
│ │ │ │ -
70 }
│ │ │ │ -
│ │ │ │ -
71
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
74 {
│ │ │ │ -
75 moveToWrappedObject(std::move(other));
│ │ │ │ -
76 }
│ │ │ │ -
│ │ │ │ -
77
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
80 {
│ │ │ │ -
81 copyToWrappedObject(other);
│ │ │ │ -
82 }
│ │ │ │ -
│ │ │ │ -
83
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
86 {
│ │ │ │ -
87 destroyWrappedObject();
│ │ │ │ -
88 }
│ │ │ │ -
│ │ │ │ -
89
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
92 {
│ │ │ │ -
93 if (&other!=this)
│ │ │ │ -
94 {
│ │ │ │ -
95 destroyWrappedObject();
│ │ │ │ -
96 copyToWrappedObject(other);
│ │ │ │ -
97 }
│ │ │ │ -
98 return *this;
│ │ │ │ -
99 }
│ │ │ │ -
│ │ │ │ -
100
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
103 {
│ │ │ │ -
104 destroyWrappedObject();
│ │ │ │ -
105 moveToWrappedObject(std::move(other));
│ │ │ │ -
106 return *this;
│ │ │ │ -
107 }
│ │ │ │ -
│ │ │ │ -
108
│ │ │ │ -
│ │ │ │ -
110 explicit operator bool() const
│ │ │ │ -
111 {
│ │ │ │ -
112 return p_;
│ │ │ │ -
113 }
│ │ │ │ -
│ │ │ │ -
114
│ │ │ │ -
│ │ │ │ -
116 bool bufferUsed() const
│ │ │ │ -
117 {
│ │ │ │ -
118 return ((void*) (p_) == (void*)(&buffer_));
│ │ │ │ -
119 }
│ │ │ │ -
│ │ │ │ -
120
│ │ │ │ -
│ │ │ │ -
122 const Base& get() const
│ │ │ │ -
123 {
│ │ │ │ -
124 return *p_;
│ │ │ │ -
125 }
│ │ │ │ -
│ │ │ │ -
126
│ │ │ │ -
│ │ │ │ -
128 Base& get()
│ │ │ │ -
129 {
│ │ │ │ -
130 return *p_;
│ │ │ │ -
131 }
│ │ │ │ -
│ │ │ │ -
132
│ │ │ │ -
133private:
│ │ │ │ -
134
│ │ │ │ -
135 void destroyWrappedObject() noexcept
│ │ │ │ -
136 {
│ │ │ │ -
137 if (operator bool())
│ │ │ │ -
138 {
│ │ │ │ -
139 if (bufferUsed())
│ │ │ │ -
140 p_->~Base();
│ │ │ │ -
141 else
│ │ │ │ -
142 delete p_;
│ │ │ │ -
143 }
│ │ │ │ -
144 }
│ │ │ │ -
145
│ │ │ │ -
146 void moveToWrappedObject(PolymorphicSmallObject&& other) noexcept
│ │ │ │ -
147 {
│ │ │ │ -
148 if (other.bufferUsed())
│ │ │ │ -
149 p_ = other.p_->move(&buffer_);
│ │ │ │ -
150 else
│ │ │ │ -
151 {
│ │ │ │ -
152 // We don't need to check for &other_!=this, because you can't
│ │ │ │ -
153 // have an rvalue to *this and call it's assignment/constructor
│ │ │ │ -
154 // at the same time. (Despite trying to shoot yourself in the foot
│ │ │ │ -
155 // with std::move explicitly.)
│ │ │ │ -
156
│ │ │ │ -
157 // Take ownership of allocated object
│ │ │ │ -
158 p_ = other.p_;
│ │ │ │ -
159
│ │ │ │ -
160 // Leave pointer in a clean state to avoid double freeing it.
│ │ │ │ -
161 other.p_ = 0;
│ │ │ │ -
162 }
│ │ │ │ -
163 }
│ │ │ │ +
6#include <dune/common/concept.hh>
│ │ │ │ +
7#include <dune/common/hybridutilities.hh>
│ │ │ │ +
8#include <dune/common/indices.hh>
│ │ │ │ +
9
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
14
│ │ │ │ +
15
│ │ │ │ +
16namespace Dune {
│ │ │ │ +
17namespace Functions {
│ │ │ │ +
18
│ │ │ │ +
19
│ │ │ │ +
20
│ │ │ │ +
21namespace Imp {
│ │ │ │ +
22
│ │ │ │ +
23 // Construct default coefficient type from vector and multiindex type
│ │ │ │ +
24 // This requires that MultiIndex has a static size. Otherwise the
│ │ │ │ +
25 // vector type itself is returned.
│ │ │ │ +
26 template<class V, class MultiIndex>
│ │ │ │ +
27 struct CoefficientType
│ │ │ │ +
28 {
│ │ │ │ +
29 template<class E, std::size_t size>
│ │ │ │ +
30 struct DefaultCoefficientTypeHelper
│ │ │ │ +
31 {
│ │ │ │ +
32 using E0 = decltype(std::declval<E>()[Dune::Indices::_0]);
│ │ │ │ +
33 using type = typename DefaultCoefficientTypeHelper<E0, size-1>::type;
│ │ │ │ +
34 };
│ │ │ │ +
35
│ │ │ │ +
36 template<class E>
│ │ │ │ +
37 struct DefaultCoefficientTypeHelper<E, 0>
│ │ │ │ +
38 {
│ │ │ │ +
39 using type = E;
│ │ │ │ +
40 };
│ │ │ │ +
41
│ │ │ │ +
42 template<class MI,
│ │ │ │ +
43 typename std::enable_if<HasStaticSize<MI>::value, int>::type = 0>
│ │ │ │ +
44 static constexpr std::size_t getStaticSizeOrZero()
│ │ │ │ +
45 {
│ │ │ │ +
46 return StaticSize<MI>::value;
│ │ │ │ +
47 }
│ │ │ │ +
48
│ │ │ │ +
49 template<class MI,
│ │ │ │ +
50 typename std::enable_if<not HasStaticSize<MI>::value, int>::type = 0>
│ │ │ │ +
51 static constexpr std::size_t getStaticSizeOrZero()
│ │ │ │ +
52 {
│ │ │ │ +
53 return 0;
│ │ │ │ +
54 }
│ │ │ │ +
55
│ │ │ │ +
56 using type = typename DefaultCoefficientTypeHelper<V, getStaticSizeOrZero<MultiIndex>()>::type;
│ │ │ │ +
57 };
│ │ │ │ +
58
│ │ │ │ +
59
│ │ │ │ +
60
│ │ │ │ +
61 // This tag class is used as Coefficient template parameter
│ │ │ │ +
62 // for HierarchicVectorWrapper if the coefficient type should
│ │ │ │ +
63 // be deduced.
│ │ │ │ +
64 struct DeducedCoefficientTag {};
│ │ │ │ +
65
│ │ │ │ +
66} // namespace Imp
│ │ │ │ +
67
│ │ │ │ +
68
│ │ │ │ +
69
│ │ │ │ +
90template<class V, class CO=Imp::DeducedCoefficientTag>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
92{
│ │ │ │ +
93 template<class MultiIndex>
│ │ │ │ +
94 using Coefficient = typename std::conditional< std::is_same<Imp::DeducedCoefficientTag,CO>::value and HasStaticSize<MultiIndex>::value,
│ │ │ │ +
95 typename Imp::CoefficientType<V, MultiIndex>::type,
│ │ │ │ +
96 CO
│ │ │ │ +
97 >::type;
│ │ │ │ +
98
│ │ │ │ +
99
│ │ │ │ +
100 using size_type = std::size_t;
│ │ │ │ +
101
│ │ │ │ +
102 template<class C, class SizeProvider,
│ │ │ │ +
103 typename std::enable_if< not models<Concept::HasResize, C>(), int>::type = 0,
│ │ │ │ +
104 typename std::enable_if< not models<Concept::HasSizeMethod, C>(), int>::type = 0>
│ │ │ │ +
105 static void resizeHelper(C& c, const SizeProvider& sizeProvider, typename SizeProvider::SizePrefix prefix)
│ │ │ │ +
106 {
│ │ │ │ +
107 auto size = sizeProvider.size(prefix);
│ │ │ │ +
108 if (size != 0)
│ │ │ │ +
109 DUNE_THROW(RangeError, "Can't resize scalar vector entry v[" << prefix << "] to size(" << prefix << ")=" << size);
│ │ │ │ +
110 }
│ │ │ │ +
111
│ │ │ │ +
112 struct StaticResizeHelper
│ │ │ │ +
113 {
│ │ │ │ +
114 template<class I, class C, class SizeProvider>
│ │ │ │ +
115 static void apply(I&& i, C& c, const SizeProvider& sizeProvider, typename SizeProvider::SizePrefix prefix)
│ │ │ │ +
116 {
│ │ │ │ +
117 prefix.back() = i;
│ │ │ │ +
118 resizeHelper(c[i], sizeProvider, prefix);
│ │ │ │ +
119 }
│ │ │ │ +
120 };
│ │ │ │ +
121
│ │ │ │ +
122 template<class C, class SizeProvider,
│ │ │ │ +
123 typename std::enable_if< not models<Concept::HasResize, C>(), int>::type = 0,
│ │ │ │ +
124 typename std::enable_if< models<Concept::HasSizeMethod, C>(), int>::type = 0>
│ │ │ │ +
125 static void resizeHelper(C& c, const SizeProvider& sizeProvider, typename SizeProvider::SizePrefix prefix)
│ │ │ │ +
126 {
│ │ │ │ +
127 auto size = sizeProvider.size(prefix);
│ │ │ │ +
128 if (size == 0)
│ │ │ │ +
129 return;
│ │ │ │ +
130
│ │ │ │ +
131 if (c.size() != size)
│ │ │ │ +
132 DUNE_THROW(RangeError, "Can't resize statically sized vector entry v[" << prefix << "] of size " << c.size() << " to size(" << prefix << ")=" << size);
│ │ │ │ +
133
│ │ │ │ +
134 using namespace Dune::Hybrid;
│ │ │ │ +
135 prefix.push_back(0);
│ │ │ │ +
136 forEach(integralRange(Hybrid::size(c)), [&](auto&& i) {
│ │ │ │ +
137 StaticResizeHelper::apply(i, c, sizeProvider, prefix);
│ │ │ │ +
138 });
│ │ │ │ +
139 }
│ │ │ │ +
140
│ │ │ │ +
141 template<class C, class SizeProvider,
│ │ │ │ +
142 typename std::enable_if< models<Concept::HasResize, C>(), int>::type = 0>
│ │ │ │ +
143 static void resizeHelper(C& c, const SizeProvider& sizeProvider, typename SizeProvider::SizePrefix prefix)
│ │ │ │ +
144 {
│ │ │ │ +
145 auto size = sizeProvider.size(prefix);
│ │ │ │ +
146 if (size==0)
│ │ │ │ +
147 {
│ │ │ │ +
148 if (c.size()==0)
│ │ │ │ +
149 DUNE_THROW(RangeError, "Can't resize dynamically sized vector entry v[" << prefix << "]. Its size is 0 but the target size is unknown due to size(" << prefix << ")=0.");
│ │ │ │ +
150 else
│ │ │ │ +
151 return;
│ │ │ │ +
152 }
│ │ │ │ +
153
│ │ │ │ +
154 c.resize(size);
│ │ │ │ +
155 prefix.push_back(0);
│ │ │ │ +
156 for(std::size_t i=0; i<size; ++i)
│ │ │ │ +
157 {
│ │ │ │ +
158 prefix.back() = i;
│ │ │ │ +
159 resizeHelper(c[i], sizeProvider, prefix);
│ │ │ │ +
160 }
│ │ │ │ +
161 }
│ │ │ │ +
162
│ │ │ │ +
163
│ │ │ │
164
│ │ │ │ -
165 void copyToWrappedObject(const PolymorphicSmallObject& other)
│ │ │ │ -
166 {
│ │ │ │ -
167 if (other.bufferUsed())
│ │ │ │ -
168 p_ = other.p_->clone(&buffer_);
│ │ │ │ -
169 else
│ │ │ │ -
170 p_ = other.p_->clone();
│ │ │ │ -
171 }
│ │ │ │ -
172
│ │ │ │ -
173 std::aligned_storage_t<bufferSize> buffer_;
│ │ │ │ -
174 Base* p_;
│ │ │ │ -
175};
│ │ │ │ -
│ │ │ │ -
176
│ │ │ │ -
177
│ │ │ │ -
178} // namespace Functions
│ │ │ │ -
179} // namespace Dune
│ │ │ │ -
180
│ │ │ │ -
181#endif // DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH
│ │ │ │ +
165public:
│ │ │ │ +
166
│ │ │ │ +
167 using Vector = V;
│ │ │ │ +
168
│ │ │ │ +
169 template<class MultiIndex>
│ │ │ │ +
170 using Entry = Coefficient<MultiIndex>;
│ │ │ │ +
171
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
173 vector_(&vector)
│ │ │ │ +
174 {}
│ │ │ │ +
│ │ │ │ +
175
│ │ │ │ +
176 template<class SizeProvider>
│ │ │ │ +
│ │ │ │ +
177 void resize(const SizeProvider& sizeProvider)
│ │ │ │ +
178 {
│ │ │ │ +
179 typename SizeProvider::SizePrefix prefix;
│ │ │ │ +
180 prefix.resize(0);
│ │ │ │ +
181 resizeHelper(*vector_, sizeProvider, prefix);
│ │ │ │ +
182 }
│ │ │ │ +
│ │ │ │ +
183
│ │ │ │ +
184 template<class MultiIndex>
│ │ │ │ +
│ │ │ │ +
185 const Entry<MultiIndex>& operator[](const MultiIndex& index) const
│ │ │ │ +
186 {
│ │ │ │ +
187 static_assert(not std::is_same<Imp::DeducedCoefficientTag,Entry<MultiIndex>>::value, "Coefficient type for HierarchicVectorWrapper and given multi-index type cannot be determined automatically!");
│ │ │ │ +
188 return hybridMultiIndexAccess<const Entry<MultiIndex>&>(*vector_, index);
│ │ │ │ +
189 }
│ │ │ │ +
│ │ │ │ +
190
│ │ │ │ +
191 template<class MultiIndex>
│ │ │ │ +
│ │ │ │ +
192 Entry<MultiIndex>& operator[](const MultiIndex& index)
│ │ │ │ +
193 {
│ │ │ │ +
194 static_assert(not std::is_same<Imp::DeducedCoefficientTag,Entry<MultiIndex>>::value, "Coefficient type for HierarchicVectorWrapper and given multi-index type cannot be determined automatically!");
│ │ │ │ +
195 return hybridMultiIndexAccess<Entry<MultiIndex>&>(*vector_, index);
│ │ │ │ +
196 }
│ │ │ │ +
│ │ │ │ +
197
│ │ │ │ +
198 template<class MultiIndex>
│ │ │ │ +
│ │ │ │ +
199 const Entry<MultiIndex>& operator()(const MultiIndex& index) const
│ │ │ │ +
200 {
│ │ │ │ +
201 static_assert(not std::is_same<Imp::DeducedCoefficientTag,Entry<MultiIndex>>::value, "Coefficient type for HierarchicVectorWrapper and given multi-index type cannot be determined automatically!");
│ │ │ │ +
202 return (*this)[index];
│ │ │ │ +
203 }
│ │ │ │ +
│ │ │ │ +
204
│ │ │ │ +
205 template<class MultiIndex>
│ │ │ │ +
│ │ │ │ +
206 Entry<MultiIndex>& operator()(const MultiIndex& index)
│ │ │ │ +
207 {
│ │ │ │ +
208 static_assert(not std::is_same<Imp::DeducedCoefficientTag,Entry<MultiIndex>>::value, "Coefficient type for HierarchicVectorWrapper and given multi-index type cannot be determined automatically!");
│ │ │ │ +
209 return (*this)[index];
│ │ │ │ +
210 }
│ │ │ │ +
│ │ │ │ +
211
│ │ │ │ +
│ │ │ │ +
212 const Vector& vector() const
│ │ │ │ +
213 {
│ │ │ │ +
214 return *vector_;
│ │ │ │ +
215 }
│ │ │ │ +
│ │ │ │ +
216
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
218 {
│ │ │ │ +
219 return *vector_;
│ │ │ │ +
220 }
│ │ │ │ +
│ │ │ │ +
221
│ │ │ │ +
222private:
│ │ │ │ +
223
│ │ │ │ +
224 Vector* vector_;
│ │ │ │ +
225};
│ │ │ │ +
│ │ │ │ +
226
│ │ │ │ +
227
│ │ │ │ +
228
│ │ │ │ +
229
│ │ │ │ +
230template<class V>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
232{
│ │ │ │ + │ │ │ │ +
234}
│ │ │ │ +
│ │ │ │ +
235
│ │ │ │ +
236
│ │ │ │ +
237
│ │ │ │ +
238template<class MultiIndex, class V,
│ │ │ │ +
239 typename std::enable_if< models<Concept::HasIndexAccess, V, MultiIndex>(), int>::type = 0>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
241{
│ │ │ │ +
242 return v;
│ │ │ │ +
243}
│ │ │ │ +
│ │ │ │ +
244
│ │ │ │ +
245
│ │ │ │ +
246
│ │ │ │ +
247template<class MultiIndex, class V,
│ │ │ │ +
248 typename std::enable_if< not models<Concept::HasIndexAccess, V, MultiIndex>(), int>::type = 0>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
250{
│ │ │ │ + │ │ │ │ +
252}
│ │ │ │ +
│ │ │ │ +
253
│ │ │ │ +
254
│ │ │ │ +
255
│ │ │ │ +
256} // namespace Dune::Functions
│ │ │ │ +
257} // namespace Dune
│ │ │ │ +
258
│ │ │ │ +
259
│ │ │ │ +
260#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICVECTORWRAPPER_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
A wrapper providing small object optimization with polymorphic types.
Definition polymorphicsmallobject.hh:45
│ │ │ │ -
const Base & get() const
Obtain reference to stored object.
Definition polymorphicsmallobject.hh:122
│ │ │ │ -
bool bufferUsed() const
Check if object is stored in internal stack buffer.
Definition polymorphicsmallobject.hh:116
│ │ │ │ -
PolymorphicSmallObject(Derived &&derived)
Construct from object.
Definition polymorphicsmallobject.hh:62
│ │ │ │ -
PolymorphicSmallObject(PolymorphicSmallObject &&other) noexcept
Move constructor from other PolymorphicSmallObject.
Definition polymorphicsmallobject.hh:73
│ │ │ │ -
PolymorphicSmallObject & operator=(const PolymorphicSmallObject &other)
Copy assignment from other PolymorphicSmallObject.
Definition polymorphicsmallobject.hh:91
│ │ │ │ -
PolymorphicSmallObject & operator=(PolymorphicSmallObject &&other) noexcept
Move assignment from other PolymorphicSmallObject.
Definition polymorphicsmallobject.hh:102
│ │ │ │ -
PolymorphicSmallObject(const PolymorphicSmallObject &other)
Copy constructor from other PolymorphicSmallObject.
Definition polymorphicsmallobject.hh:79
│ │ │ │ -
~PolymorphicSmallObject()
Destructor.
Definition polymorphicsmallobject.hh:85
│ │ │ │ -
PolymorphicSmallObject()
Default constructor.
Definition polymorphicsmallobject.hh:49
│ │ │ │ -
Base & get()
Obtain mutable reference to stored object.
Definition polymorphicsmallobject.hh:128
│ │ │ │ +
V & makeHierarchicVectorForMultiIndex(V &v)
Definition hierarchicvectorwrapper.hh:240
│ │ │ │ +
HierarchicVectorWrapper< V > hierarchicVector(V &v)
Definition hierarchicvectorwrapper.hh:231
│ │ │ │ +
Check if type is a statically sized container.
Definition type_traits.hh:83
│ │ │ │ +
A wrapper providing multiindex access to vector entries.
Definition hierarchicvectorwrapper.hh:92
│ │ │ │ +
Entry< MultiIndex > & operator()(const MultiIndex &index)
Definition hierarchicvectorwrapper.hh:206
│ │ │ │ +
Entry< MultiIndex > & operator[](const MultiIndex &index)
Definition hierarchicvectorwrapper.hh:192
│ │ │ │ +
const Entry< MultiIndex > & operator[](const MultiIndex &index) const
Definition hierarchicvectorwrapper.hh:185
│ │ │ │ +
Vector & vector()
Definition hierarchicvectorwrapper.hh:217
│ │ │ │ +
V Vector
Definition hierarchicvectorwrapper.hh:167
│ │ │ │ +
Coefficient< MultiIndex > Entry
Definition hierarchicvectorwrapper.hh:170
│ │ │ │ +
const Vector & vector() const
Definition hierarchicvectorwrapper.hh:212
│ │ │ │ +
HierarchicVectorWrapper(Vector &vector)
Definition hierarchicvectorwrapper.hh:172
│ │ │ │ +
const Entry< MultiIndex > & operator()(const MultiIndex &index) const
Definition hierarchicvectorwrapper.hh:199
│ │ │ │ +
void resize(const SizeProvider &sizeProvider)
Definition hierarchicvectorwrapper.hh:177
│ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,191 +1,327 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -polymorphicsmallobject.hh │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +hierarchicvectorwrapper.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#ifndef DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICVECTORWRAPPER_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICVECTORWRAPPER_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ -8 │ │ │ │ │ -9namespace _D_u_n_e { │ │ │ │ │ -10namespace Functions { │ │ │ │ │ -11 │ │ │ │ │ -12 │ │ │ │ │ -43template │ │ │ │ │ -_4_4class _P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t │ │ │ │ │ -45{ │ │ │ │ │ -46public: │ │ │ │ │ -47 │ │ │ │ │ -_4_9 _P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t() : │ │ │ │ │ -50 p_(nullptr) │ │ │ │ │ -51 {} │ │ │ │ │ -52 │ │ │ │ │ -59 template>>::value, int>::type = 0> │ │ │ │ │ -_6_2 _P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t(Derived&& derived) │ │ │ │ │ -63 { │ │ │ │ │ -64 constexpr bool useBuffer = sizeof(Derived) <= bufferSize; │ │ │ │ │ -65 if constexpr (useBuffer) { │ │ │ │ │ -66 p_ = new (&buffer_) Derived(std::forward(derived)); │ │ │ │ │ -67 } else { │ │ │ │ │ -68 p_ = new Derived(std::forward(derived)); │ │ │ │ │ -69 } │ │ │ │ │ -70 } │ │ │ │ │ -71 │ │ │ │ │ -_7_3 _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 │ │ │ │ │ -74 { │ │ │ │ │ -75 moveToWrappedObject(std::move(other)); │ │ │ │ │ -76 } │ │ │ │ │ -77 │ │ │ │ │ -_7_9 _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) │ │ │ │ │ -80 { │ │ │ │ │ -81 copyToWrappedObject(other); │ │ │ │ │ -82 } │ │ │ │ │ -83 │ │ │ │ │ -_8_5 _~_P_o_l_y_m_o_r_p_h_i_c_S_m_a_l_l_O_b_j_e_c_t() │ │ │ │ │ -86 { │ │ │ │ │ -87 destroyWrappedObject(); │ │ │ │ │ -88 } │ │ │ │ │ -89 │ │ │ │ │ -_9_1 _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) │ │ │ │ │ -92 { │ │ │ │ │ -93 if (&other!=this) │ │ │ │ │ -94 { │ │ │ │ │ -95 destroyWrappedObject(); │ │ │ │ │ -96 copyToWrappedObject(other); │ │ │ │ │ -97 } │ │ │ │ │ -98 return *this; │ │ │ │ │ -99 } │ │ │ │ │ -100 │ │ │ │ │ -_1_0_2 _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 │ │ │ │ │ -103 { │ │ │ │ │ -104 destroyWrappedObject(); │ │ │ │ │ -105 moveToWrappedObject(std::move(other)); │ │ │ │ │ -106 return *this; │ │ │ │ │ -107 } │ │ │ │ │ -108 │ │ │ │ │ -_1_1_0 explicit operator bool() const │ │ │ │ │ -111 { │ │ │ │ │ -112 return p_; │ │ │ │ │ -113 } │ │ │ │ │ -114 │ │ │ │ │ -_1_1_6 bool _b_u_f_f_e_r_U_s_e_d() const │ │ │ │ │ -117 { │ │ │ │ │ -118 return ((void*) (p_) == (void*)(&buffer_)); │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ +8#include │ │ │ │ │ +9 │ │ │ │ │ +10#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> │ │ │ │ │ +11#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> │ │ │ │ │ +12#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> │ │ │ │ │ +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_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ │ +14 │ │ │ │ │ +15 │ │ │ │ │ +16namespace _D_u_n_e { │ │ │ │ │ +17namespace Functions { │ │ │ │ │ +18 │ │ │ │ │ +19 │ │ │ │ │ +20 │ │ │ │ │ +21namespace Imp { │ │ │ │ │ +22 │ │ │ │ │ +23 // Construct default coefficient type from vector and multiindex type │ │ │ │ │ +24 // This requires that MultiIndex has a static size. Otherwise the │ │ │ │ │ +25 // vector type itself is returned. │ │ │ │ │ +26 template │ │ │ │ │ +27 struct CoefficientType │ │ │ │ │ +28 { │ │ │ │ │ +29 template │ │ │ │ │ +30 struct DefaultCoefficientTypeHelper │ │ │ │ │ +31 { │ │ │ │ │ +32 using E0 = decltype(std::declval()[Dune::Indices::_0]); │ │ │ │ │ +33 using type = typename DefaultCoefficientTypeHelper::type; │ │ │ │ │ +34 }; │ │ │ │ │ +35 │ │ │ │ │ +36 template │ │ │ │ │ +37 struct DefaultCoefficientTypeHelper │ │ │ │ │ +38 { │ │ │ │ │ +39 using type = E; │ │ │ │ │ +40 }; │ │ │ │ │ +41 │ │ │ │ │ +42 template::value, int>::type = 0> │ │ │ │ │ +44 static constexpr std::size_t getStaticSizeOrZero() │ │ │ │ │ +45 { │ │ │ │ │ +46 return StaticSize::value; │ │ │ │ │ +47 } │ │ │ │ │ +48 │ │ │ │ │ +49 template::value, int>::type = 0> │ │ │ │ │ +51 static constexpr std::size_t getStaticSizeOrZero() │ │ │ │ │ +52 { │ │ │ │ │ +53 return 0; │ │ │ │ │ +54 } │ │ │ │ │ +55 │ │ │ │ │ +56 using type = typename DefaultCoefficientTypeHelper()>::type; │ │ │ │ │ +57 }; │ │ │ │ │ +58 │ │ │ │ │ +59 │ │ │ │ │ +60 │ │ │ │ │ +61 // This tag class is used as Coefficient template parameter │ │ │ │ │ +62 // for HierarchicVectorWrapper if the coefficient type should │ │ │ │ │ +63 // be deduced. │ │ │ │ │ +64 struct DeducedCoefficientTag {}; │ │ │ │ │ +65 │ │ │ │ │ +66} // namespace Imp │ │ │ │ │ +67 │ │ │ │ │ +68 │ │ │ │ │ +69 │ │ │ │ │ +90template │ │ │ │ │ +_9_1class _H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r │ │ │ │ │ +92{ │ │ │ │ │ +93 template │ │ │ │ │ +94 using Coefficient = typename std::conditional< std::is_same::value and _H_a_s_S_t_a_t_i_c_S_i_z_e_<_M_u_l_t_i_I_n_d_e_x_>_:_:_v_a_l_u_e, │ │ │ │ │ +95 typename Imp::CoefficientType::type, │ │ │ │ │ +96 CO │ │ │ │ │ +97 >::type; │ │ │ │ │ +98 │ │ │ │ │ +99 │ │ │ │ │ +100 using size_type = std::size_t; │ │ │ │ │ +101 │ │ │ │ │ +102 template(), int>::type = │ │ │ │ │ +0, │ │ │ │ │ +104 typename std::enable_if< not models(), int>:: │ │ │ │ │ +type = 0> │ │ │ │ │ +105 static void resizeHelper(C& c, const SizeProvider& sizeProvider, typename │ │ │ │ │ +SizeProvider::SizePrefix prefix) │ │ │ │ │ +106 { │ │ │ │ │ +107 auto size = sizeProvider.size(prefix); │ │ │ │ │ +108 if (size != 0) │ │ │ │ │ +109 DUNE_THROW(RangeError, "Can't resize scalar vector entry v[" << prefix << │ │ │ │ │ +"] to size(" << prefix << ")=" << size); │ │ │ │ │ +110 } │ │ │ │ │ +111 │ │ │ │ │ +112 struct StaticResizeHelper │ │ │ │ │ +113 { │ │ │ │ │ +114 template │ │ │ │ │ +115 static void apply(I&& i, C& c, const SizeProvider& sizeProvider, typename │ │ │ │ │ +SizeProvider::SizePrefix prefix) │ │ │ │ │ +116 { │ │ │ │ │ +117 prefix.back() = i; │ │ │ │ │ +118 resizeHelper(c[i], sizeProvider, prefix); │ │ │ │ │ 119 } │ │ │ │ │ -120 │ │ │ │ │ -_1_2_2 const Base& _g_e_t() const │ │ │ │ │ -123 { │ │ │ │ │ -124 return *p_; │ │ │ │ │ -125 } │ │ │ │ │ -126 │ │ │ │ │ -_1_2_8 Base& _g_e_t() │ │ │ │ │ -129 { │ │ │ │ │ -130 return *p_; │ │ │ │ │ -131 } │ │ │ │ │ -132 │ │ │ │ │ -133private: │ │ │ │ │ -134 │ │ │ │ │ -135 void destroyWrappedObject() noexcept │ │ │ │ │ -136 { │ │ │ │ │ -137 if (operator bool()) │ │ │ │ │ -138 { │ │ │ │ │ -139 if (_b_u_f_f_e_r_U_s_e_d()) │ │ │ │ │ -140 p_->~Base(); │ │ │ │ │ -141 else │ │ │ │ │ -142 delete p_; │ │ │ │ │ -143 } │ │ │ │ │ -144 } │ │ │ │ │ -145 │ │ │ │ │ -146 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 │ │ │ │ │ +120 }; │ │ │ │ │ +121 │ │ │ │ │ +122 template(), int>::type = │ │ │ │ │ +0, │ │ │ │ │ +124 typename std::enable_if< models(), int>::type = │ │ │ │ │ +0> │ │ │ │ │ +125 static void resizeHelper(C& c, const SizeProvider& sizeProvider, typename │ │ │ │ │ +SizeProvider::SizePrefix prefix) │ │ │ │ │ +126 { │ │ │ │ │ +127 auto size = sizeProvider.size(prefix); │ │ │ │ │ +128 if (size == 0) │ │ │ │ │ +129 return; │ │ │ │ │ +130 │ │ │ │ │ +131 if (c.size() != size) │ │ │ │ │ +132 DUNE_THROW(RangeError, "Can't resize statically sized vector entry v[" << │ │ │ │ │ +prefix << "] of size " << c.size() << " to size(" << prefix << ")=" << size); │ │ │ │ │ +133 │ │ │ │ │ +134 using namespace Dune::Hybrid; │ │ │ │ │ +135 prefix.push_back(0); │ │ │ │ │ +136 forEach(integralRange(Hybrid::size(c)), [&](auto&& i) { │ │ │ │ │ +137 StaticResizeHelper::apply(i, c, sizeProvider, prefix); │ │ │ │ │ +138 }); │ │ │ │ │ +139 } │ │ │ │ │ +140 │ │ │ │ │ +141 template(), int>::type = 0> │ │ │ │ │ +143 static void resizeHelper(C& c, const SizeProvider& sizeProvider, typename │ │ │ │ │ +SizeProvider::SizePrefix prefix) │ │ │ │ │ +144 { │ │ │ │ │ +145 auto size = sizeProvider.size(prefix); │ │ │ │ │ +146 if (size==0) │ │ │ │ │ 147 { │ │ │ │ │ -148 if (other.bufferUsed()) │ │ │ │ │ -149 p_ = other.p_->move(&buffer_); │ │ │ │ │ +148 if (c.size()==0) │ │ │ │ │ +149 DUNE_THROW(RangeError, "Can't resize dynamically sized vector entry v[" << │ │ │ │ │ +prefix << "]. Its size is 0 but the target size is unknown due to size(" << │ │ │ │ │ +prefix << ")=0."); │ │ │ │ │ 150 else │ │ │ │ │ -151 { │ │ │ │ │ -152 // We don't need to check for &other_!=this, because you can't │ │ │ │ │ -153 // have an rvalue to *this and call it's assignment/constructor │ │ │ │ │ -154 // at the same time. (Despite trying to shoot yourself in the foot │ │ │ │ │ -155 // with std::move explicitly.) │ │ │ │ │ -156 │ │ │ │ │ -157 // Take ownership of allocated object │ │ │ │ │ -158 p_ = other.p_; │ │ │ │ │ -159 │ │ │ │ │ -160 // Leave pointer in a clean state to avoid double freeing it. │ │ │ │ │ -161 other.p_ = 0; │ │ │ │ │ -162 } │ │ │ │ │ -163 } │ │ │ │ │ +151 return; │ │ │ │ │ +152 } │ │ │ │ │ +153 │ │ │ │ │ +154 c.resize(size); │ │ │ │ │ +155 prefix.push_back(0); │ │ │ │ │ +156 for(std::size_t i=0; iclone(&buffer_); │ │ │ │ │ -169 else │ │ │ │ │ -170 p_ = other.p_->clone(); │ │ │ │ │ -171 } │ │ │ │ │ -172 │ │ │ │ │ -173 std::aligned_storage_t buffer_; │ │ │ │ │ -174 Base* p_; │ │ │ │ │ -175}; │ │ │ │ │ -176 │ │ │ │ │ -177 │ │ │ │ │ -178} // namespace Functions │ │ │ │ │ -179} // namespace Dune │ │ │ │ │ -180 │ │ │ │ │ -181#endif // DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH │ │ │ │ │ +165public: │ │ │ │ │ +166 │ │ │ │ │ +_1_6_7 using _V_e_c_t_o_r = V; │ │ │ │ │ +168 │ │ │ │ │ +169 template │ │ │ │ │ +_1_7_0 using _E_n_t_r_y = Coefficient; │ │ │ │ │ +171 │ │ │ │ │ +_1_7_2 _H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r(_V_e_c_t_o_r& _v_e_c_t_o_r) : │ │ │ │ │ +173 vector_(&_v_e_c_t_o_r) │ │ │ │ │ +174 {} │ │ │ │ │ +175 │ │ │ │ │ +176 template │ │ │ │ │ +_1_7_7 void _r_e_s_i_z_e(const SizeProvider& sizeProvider) │ │ │ │ │ +178 { │ │ │ │ │ +179 typename SizeProvider::SizePrefix prefix; │ │ │ │ │ +180 prefix.resize(0); │ │ │ │ │ +181 resizeHelper(*vector_, sizeProvider, prefix); │ │ │ │ │ +182 } │ │ │ │ │ +183 │ │ │ │ │ +184 template │ │ │ │ │ +_1_8_5 const _E_n_t_r_y_<_M_u_l_t_i_I_n_d_e_x_>& _o_p_e_r_a_t_o_r_[_](const MultiIndex& index) const │ │ │ │ │ +186 { │ │ │ │ │ +187 static_assert(not std::is_same>::value, "Coefficient type for │ │ │ │ │ +HierarchicVectorWrapper and given multi-index type cannot be determined │ │ │ │ │ +automatically!"); │ │ │ │ │ +188 return hybridMultiIndexAccess&>(*vector_, index); │ │ │ │ │ +189 } │ │ │ │ │ +190 │ │ │ │ │ +191 template │ │ │ │ │ +_1_9_2 _E_n_t_r_y_<_M_u_l_t_i_I_n_d_e_x_>& _o_p_e_r_a_t_o_r_[_](const MultiIndex& index) │ │ │ │ │ +193 { │ │ │ │ │ +194 static_assert(not std::is_same>::value, "Coefficient type for │ │ │ │ │ +HierarchicVectorWrapper and given multi-index type cannot be determined │ │ │ │ │ +automatically!"); │ │ │ │ │ +195 return hybridMultiIndexAccess&>(*vector_, index); │ │ │ │ │ +196 } │ │ │ │ │ +197 │ │ │ │ │ +198 template │ │ │ │ │ +_1_9_9 const _E_n_t_r_y_<_M_u_l_t_i_I_n_d_e_x_>& _o_p_e_r_a_t_o_r_(_)(const MultiIndex& index) const │ │ │ │ │ +200 { │ │ │ │ │ +201 static_assert(not std::is_same>::value, "Coefficient type for │ │ │ │ │ +HierarchicVectorWrapper and given multi-index type cannot be determined │ │ │ │ │ +automatically!"); │ │ │ │ │ +202 return (*this)[index]; │ │ │ │ │ +203 } │ │ │ │ │ +204 │ │ │ │ │ +205 template │ │ │ │ │ +_2_0_6 _E_n_t_r_y_<_M_u_l_t_i_I_n_d_e_x_>& _o_p_e_r_a_t_o_r_(_)(const MultiIndex& index) │ │ │ │ │ +207 { │ │ │ │ │ +208 static_assert(not std::is_same>::value, "Coefficient type for │ │ │ │ │ +HierarchicVectorWrapper and given multi-index type cannot be determined │ │ │ │ │ +automatically!"); │ │ │ │ │ +209 return (*this)[index]; │ │ │ │ │ +210 } │ │ │ │ │ +211 │ │ │ │ │ +_2_1_2 const _V_e_c_t_o_r& _v_e_c_t_o_r() const │ │ │ │ │ +213 { │ │ │ │ │ +214 return *vector_; │ │ │ │ │ +215 } │ │ │ │ │ +216 │ │ │ │ │ +_2_1_7 _V_e_c_t_o_r& _v_e_c_t_o_r() │ │ │ │ │ +218 { │ │ │ │ │ +219 return *vector_; │ │ │ │ │ +220 } │ │ │ │ │ +221 │ │ │ │ │ +222private: │ │ │ │ │ +223 │ │ │ │ │ +224 _V_e_c_t_o_r* vector_; │ │ │ │ │ +225}; │ │ │ │ │ +226 │ │ │ │ │ +227 │ │ │ │ │ +228 │ │ │ │ │ +229 │ │ │ │ │ +230template │ │ │ │ │ +_2_3_1_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_<_ _V_ _> _h_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r(V& v) │ │ │ │ │ +232{ │ │ │ │ │ +233 return _H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_<_V_>(v); │ │ │ │ │ +234} │ │ │ │ │ +235 │ │ │ │ │ +236 │ │ │ │ │ +237 │ │ │ │ │ +238template(), │ │ │ │ │ +int>::type = 0> │ │ │ │ │ +_2_4_0V& _m_a_k_e_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_F_o_r_M_u_l_t_i_I_n_d_e_x(V& v) │ │ │ │ │ +241{ │ │ │ │ │ +242 return v; │ │ │ │ │ +243} │ │ │ │ │ +244 │ │ │ │ │ +245 │ │ │ │ │ +246 │ │ │ │ │ +247template │ │ │ │ │ +(), int>::type = 0> │ │ │ │ │ +_2_4_9_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_<_ _V_ _> _m_a_k_e_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_F_o_r_M_u_l_t_i_I_n_d_e_x(V& v) │ │ │ │ │ +250{ │ │ │ │ │ +251 return _H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_<_V_>(v); │ │ │ │ │ +252} │ │ │ │ │ +253 │ │ │ │ │ +254 │ │ │ │ │ +255 │ │ │ │ │ +256} // namespace Dune::Functions │ │ │ │ │ +257} // namespace Dune │ │ │ │ │ +258 │ │ │ │ │ +259 │ │ │ │ │ +260#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICVECTORWRAPPER_HH │ │ │ │ │ +_u_t_i_l_i_t_y_._h_h │ │ │ │ │ +_t_y_p_e___t_r_a_i_t_s_._h_h │ │ │ │ │ +_i_n_d_e_x_a_c_c_e_s_s_._h_h │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:45 │ │ │ │ │ -_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:122 │ │ │ │ │ -_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:116 │ │ │ │ │ -_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: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_:_:_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:73 │ │ │ │ │ -_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:91 │ │ │ │ │ -_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:102 │ │ │ │ │ -_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:79 │ │ │ │ │ -_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:85 │ │ │ │ │ -_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:49 │ │ │ │ │ -_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:128 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_F_o_r_M_u_l_t_i_I_n_d_e_x │ │ │ │ │ +V & makeHierarchicVectorForMultiIndex(V &v) │ │ │ │ │ +DDeeffiinniittiioonn hierarchicvectorwrapper.hh:240 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_h_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r │ │ │ │ │ +HierarchicVectorWrapper< V > hierarchicVector(V &v) │ │ │ │ │ +DDeeffiinniittiioonn hierarchicvectorwrapper.hh:231 │ │ │ │ │ +_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:83 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r │ │ │ │ │ +A wrapper providing multiindex access to vector entries. │ │ │ │ │ +DDeeffiinniittiioonn hierarchicvectorwrapper.hh:92 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ │ +Entry< MultiIndex > & operator()(const MultiIndex &index) │ │ │ │ │ +DDeeffiinniittiioonn hierarchicvectorwrapper.hh:206 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_:_:_o_p_e_r_a_t_o_r_[_] │ │ │ │ │ +Entry< MultiIndex > & operator[](const MultiIndex &index) │ │ │ │ │ +DDeeffiinniittiioonn hierarchicvectorwrapper.hh:192 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_:_:_o_p_e_r_a_t_o_r_[_] │ │ │ │ │ +const Entry< MultiIndex > & operator[](const MultiIndex &index) const │ │ │ │ │ +DDeeffiinniittiioonn hierarchicvectorwrapper.hh:185 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_:_:_v_e_c_t_o_r │ │ │ │ │ +Vector & vector() │ │ │ │ │ +DDeeffiinniittiioonn hierarchicvectorwrapper.hh:217 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_:_:_V_e_c_t_o_r │ │ │ │ │ +V Vector │ │ │ │ │ +DDeeffiinniittiioonn hierarchicvectorwrapper.hh:167 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_:_:_E_n_t_r_y │ │ │ │ │ +Coefficient< MultiIndex > Entry │ │ │ │ │ +DDeeffiinniittiioonn hierarchicvectorwrapper.hh:170 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_:_:_v_e_c_t_o_r │ │ │ │ │ +const Vector & vector() const │ │ │ │ │ +DDeeffiinniittiioonn hierarchicvectorwrapper.hh:212 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_:_:_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r │ │ │ │ │ +HierarchicVectorWrapper(Vector &vector) │ │ │ │ │ +DDeeffiinniittiioonn hierarchicvectorwrapper.hh:172 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ │ +const Entry< MultiIndex > & operator()(const MultiIndex &index) const │ │ │ │ │ +DDeeffiinniittiioonn hierarchicvectorwrapper.hh:199 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_H_i_e_r_a_r_c_h_i_c_V_e_c_t_o_r_W_r_a_p_p_e_r_:_:_r_e_s_i_z_e │ │ │ │ │ +void resize(const SizeProvider &sizeProvider) │ │ │ │ │ +DDeeffiinniittiioonn hierarchicvectorwrapper.hh:177 │ │ │ │ │ +_c_o_n_c_e_p_t_s_._h_h │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00158.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: localfunction_imp.hh File Reference │ │ │ │ +dune-functions: defaultnodetorangemap.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,34 +65,55 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Namespaces
│ │ │ │ -
localfunction_imp.hh File Reference
│ │ │ │ +Classes | │ │ │ │ +Namespaces | │ │ │ │ +Functions
│ │ │ │ +
defaultnodetorangemap.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <dune/functions/common/type_traits.hh>
│ │ │ │ -#include <dune/functions/common/differentiablefunction_imp.hh>
│ │ │ │ +
#include <dune/common/concept.hh>
│ │ │ │ +#include <dune/functions/functionspacebases/concepts.hh>
│ │ │ │ +#include <dune/typetree/traversal.hh>
│ │ │ │ +#include <dune/typetree/visitor.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ +Classes

struct  Dune::Functions::DefaultNodeToRangeMap< Tree >
 A simple node to range map using lexicographic ordering. More...
 
struct  Dune::Functions::DefaultNodeToRangeMap< Tree >::Visitor
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +

│ │ │ │ Namespaces

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

│ │ │ │ +Functions

template<class Tree >
DefaultNodeToRangeMap< Tree > Dune::Functions::makeDefaultNodeToRangeMap (const Tree &tree)
 
template<class Basis , class TreePath >
auto Dune::Functions::makeDefaultNodeToRangeMap (const Basis &basis, TreePath &&treePath) -> decltype(makeDefaultNodeToRangeMap(TypeTree::child(basis.localView().tree(), treePath)))
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,19 +1,38 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -_N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -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> │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +defaultnodetorangemap.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_/_c_o_n_c_e_p_t_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 │ │ │ │ │ +struct   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p_<_ _T_r_e_e_ _> │ │ │ │ │ +  A simple node to range map using lexicographic ordering. _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_N_o_d_e_T_o_R_a_n_g_e_M_a_p_<_ _T_r_e_e_ _>_:_:_V_i_s_i_t_o_r │ │ │ │ │ +  │ │ │ │ │ NNaammeessppaacceess │ │ │ │ │ namespace   _D_u_n_e │ │ │ │ │   │ │ │ │ │ namespace   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ │   │ │ │ │ │ +FFuunnccttiioonnss │ │ │ │ │ +template │ │ │ │ │ +_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p< Tree >  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p │ │ │ │ │ + (const Tree &tree) │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + auto  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p │ │ │ │ │ + (const Basis &basis, TreePath &&treePath) - │ │ │ │ │ + > decltype(makeDefaultNodeToRangeMap(TypeTree:: │ │ │ │ │ + child(basis.localView().tree(), treePath))) │ │ │ │ │ +  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00158_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: localfunction_imp.hh Source File │ │ │ │ +dune-functions: defaultnodetorangemap.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,92 +70,149 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
localfunction_imp.hh
│ │ │ │ +
defaultnodetorangemap.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#ifndef DUNE_FUNCTIONS_COMMON_LOCALFUNCTION_FUNCTION_IMP_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_COMMON_LOCALFUNCTION_FUNCTION_IMP_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTNODETORANGEMAP_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTNODETORANGEMAP_HH
│ │ │ │
5
│ │ │ │ - │ │ │ │ - │ │ │ │ +
6
│ │ │ │ +
7#include <dune/common/concept.hh>
│ │ │ │
8
│ │ │ │ -
9
│ │ │ │ + │ │ │ │
10
│ │ │ │ -
11namespace Dune {
│ │ │ │ -
12namespace Functions {
│ │ │ │ -
13namespace Imp {
│ │ │ │ +
11#include <dune/typetree/traversal.hh>
│ │ │ │ +
12#include <dune/typetree/visitor.hh>
│ │ │ │ +
13
│ │ │ │
14
│ │ │ │ -
15// Interface of type erasure wrapper
│ │ │ │ -
16//
│ │ │ │ -
17// Notice that the basic interface of polymorphic classes (destructor, clone, ...)
│ │ │ │ -
18// will be added by the type erasure foundation classes.
│ │ │ │ -
19template<class Signature, class DerivativeInterface, class LocalContext>
│ │ │ │ -
20class LocalFunctionWrapperInterface :
│ │ │ │ -
21 public DifferentiableFunctionWrapperInterface<Signature, DerivativeInterface>
│ │ │ │ -
22{
│ │ │ │ -
23public:
│ │ │ │ -
24 virtual void bind(const LocalContext&) = 0;
│ │ │ │ -
25
│ │ │ │ -
26 virtual void unbind() = 0;
│ │ │ │ -
27
│ │ │ │ -
28 virtual bool bound() const = 0;
│ │ │ │ -
29
│ │ │ │ -
30 virtual const LocalContext& localContext() const = 0;
│ │ │ │ -
31};
│ │ │ │ -
32
│ │ │ │ -
33
│ │ │ │ -
34// Implementation of type erasure wrapper
│ │ │ │ -
35template<class Signature, class DerivativeInterface, class LocalContext, class B>
│ │ │ │ -
36class LocalFunctionWrapperImplementation :
│ │ │ │ -
37 public DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>
│ │ │ │ -
38{
│ │ │ │ -
39 using Base = DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>;
│ │ │ │ -
40public:
│ │ │ │ -
41 using Base::Base;
│ │ │ │ -
42
│ │ │ │ -
43 virtual void bind(const LocalContext& context)
│ │ │ │ -
44 {
│ │ │ │ -
45 this->get().bind(context);
│ │ │ │ -
46 }
│ │ │ │ -
47
│ │ │ │ -
48 virtual void unbind()
│ │ │ │ +
15namespace Dune {
│ │ │ │ +
16namespace Functions {
│ │ │ │ +
17
│ │ │ │ +
18
│ │ │ │ +
19
│ │ │ │ +
37template<class Tree>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
39{
│ │ │ │ +
40
│ │ │ │ +
41 // A simple visitor for computing lexicographic
│ │ │ │ +
42 // subtree indices. To identify a leaf node
│ │ │ │ +
43 // we use its treeIndex() which is unique
│ │ │ │ +
44 // wrt the whole tree and store the computed
│ │ │ │ +
45 // index in a vector indexed by the tree indices.
│ │ │ │ +
│ │ │ │ +
46 struct Visitor
│ │ │ │ +
47 : public TypeTree::TreeVisitor
│ │ │ │ +
48 , public TypeTree::DynamicTraversal
│ │ │ │
49 {
│ │ │ │ -
50 this->get().unbind();
│ │ │ │ -
51 }
│ │ │ │ -
52
│ │ │ │ -
53 virtual bool bound() const
│ │ │ │ -
54 {
│ │ │ │ -
55 return this->get().bound();
│ │ │ │ -
56 }
│ │ │ │ -
57
│ │ │ │ -
58 virtual const LocalContext& localContext() const
│ │ │ │ -
59 {
│ │ │ │ -
60 return this->get().localContext();
│ │ │ │ -
61 }
│ │ │ │ -
62};
│ │ │ │ +
│ │ │ │ +
50 Visitor(std::vector<std::size_t>& indices) :
│ │ │ │ +
51 indices_(indices),
│ │ │ │ +
52 counter_(0)
│ │ │ │ +
53 {}
│ │ │ │ +
│ │ │ │ +
54
│ │ │ │ +
55 template<typename Node, typename TreePath>
│ │ │ │ +
│ │ │ │ +
56 void leaf(Node& node, TreePath treePath)
│ │ │ │ +
57 {
│ │ │ │ +
58 if (indices_.size() < node.treeIndex()+1)
│ │ │ │ +
59 indices_.resize(node.treeIndex()+1);
│ │ │ │ +
60 indices_[node.treeIndex()] = counter_;
│ │ │ │ +
61 ++counter_;
│ │ │ │ +
62 }
│ │ │ │ +
│ │ │ │
63
│ │ │ │ -
64}}} // namespace Dune::Functions::Imp
│ │ │ │ -
65
│ │ │ │ -
66
│ │ │ │ +
64 std::vector<std::size_t>& indices_;
│ │ │ │ +
65 std::size_t counter_;
│ │ │ │ +
66 };
│ │ │ │ +
│ │ │ │
67
│ │ │ │ -
68#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ +
│ │ │ │ +
78 DefaultNodeToRangeMap(const Tree& tree)
│ │ │ │ +
79 {
│ │ │ │ +
80 TypeTree::applyToTree(tree, Visitor(indices_));
│ │ │ │ +
81 }
│ │ │ │ +
│ │ │ │ +
82
│ │ │ │ +
83 template<class Node, class TreePath, class Range,
│ │ │ │ +
84 std::enable_if_t<models<Concept::HasIndexAccess, Range, decltype(std::declval<Node>().treeIndex())>() and not Tree::isLeaf, int> = 0>
│ │ │ │ +
│ │ │ │ +
85 decltype(auto) operator()(const Node& node, const TreePath& treePath, Range&& y) const
│ │ │ │ +
86 {
│ │ │ │ +
87 return y[indices_[node.treeIndex()]];
│ │ │ │ +
88 }
│ │ │ │ +
│ │ │ │ +
89
│ │ │ │ +
90 template<class Node, class TreePath, class Range,
│ │ │ │ +
91 std::enable_if_t< not models<Concept::HasIndexAccess, Range, decltype(std::declval<Node>().treeIndex())>() or Tree::isLeaf, int> = 0>
│ │ │ │ +
│ │ │ │ +
92 decltype(auto) operator()(const Node& node, const TreePath& treePath, Range&& y) const
│ │ │ │ +
93 {
│ │ │ │ +
94 return std::forward<Range>(y);
│ │ │ │ +
95 }
│ │ │ │ +
│ │ │ │ +
96
│ │ │ │ +
97 std::vector<std::size_t> indices_;
│ │ │ │ +
98};
│ │ │ │ +
│ │ │ │ +
99
│ │ │ │ +
100
│ │ │ │ +
101
│ │ │ │ +
102template<class Tree>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
104{
│ │ │ │ +
105 return DefaultNodeToRangeMap<Tree>(tree);
│ │ │ │ +
106}
│ │ │ │ +
│ │ │ │ +
107
│ │ │ │ +
108
│ │ │ │ +
109
│ │ │ │ +
110template<class Basis, class TreePath>
│ │ │ │ +
│ │ │ │ +
111auto makeDefaultNodeToRangeMap(const Basis& basis, TreePath&& treePath)
│ │ │ │ +
112 -> decltype(makeDefaultNodeToRangeMap(TypeTree::child(basis.localView().tree(),treePath)))
│ │ │ │ +
113{
│ │ │ │ +
114 auto&& localView = basis.localView();
│ │ │ │ +
115 localView.bind(*basis.gridView().template begin<0>());
│ │ │ │ +
116 auto&& tree = TypeTree::child(localView.tree(),treePath);
│ │ │ │ +
117 return makeDefaultNodeToRangeMap(tree);
│ │ │ │ +
118}
│ │ │ │ +
│ │ │ │ +
119
│ │ │ │ +
120
│ │ │ │ +
121
│ │ │ │ +
122} // namespace Dune::Functions
│ │ │ │ +
123} // namespace Dune
│ │ │ │ +
124
│ │ │ │ +
125
│ │ │ │ +
126#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTNODETORANGEMAP_HH
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ +
DefaultNodeToRangeMap< Tree > makeDefaultNodeToRangeMap(const Tree &tree)
Definition defaultnodetorangemap.hh:103
│ │ │ │ +
A simple node to range map using lexicographic ordering.
Definition defaultnodetorangemap.hh:39
│ │ │ │ +
std::vector< std::size_t > indices_
Definition defaultnodetorangemap.hh:97
│ │ │ │ +
DefaultNodeToRangeMap(const Tree &tree)
Construct DefaultNodeToRangeMap.
Definition defaultnodetorangemap.hh:78
│ │ │ │ +
Definition defaultnodetorangemap.hh:49
│ │ │ │ +
Visitor(std::vector< std::size_t > &indices)
Definition defaultnodetorangemap.hh:50
│ │ │ │ +
void leaf(Node &node, TreePath treePath)
Definition defaultnodetorangemap.hh:56
│ │ │ │ +
std::size_t counter_
Definition defaultnodetorangemap.hh:65
│ │ │ │ +
std::vector< std::size_t > & indices_
Definition defaultnodetorangemap.hh:64
│ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,88 +1,145 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -localfunction_imp.hh │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +defaultnodetorangemap.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#ifndef DUNE_FUNCTIONS_COMMON_LOCALFUNCTION_FUNCTION_IMP_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_COMMON_LOCALFUNCTION_FUNCTION_IMP_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTNODETORANGEMAP_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTNODETORANGEMAP_HH │ │ │ │ │ 5 │ │ │ │ │ -6#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> │ │ │ │ │ -7#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> │ │ │ │ │ +6 │ │ │ │ │ +7#include │ │ │ │ │ 8 │ │ │ │ │ -9 │ │ │ │ │ +9#include <_d_u_n_e_/_f_u_n_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> │ │ │ │ │ 10 │ │ │ │ │ -11namespace _D_u_n_e { │ │ │ │ │ -12namespace Functions { │ │ │ │ │ -13namespace Imp { │ │ │ │ │ +11#include │ │ │ │ │ +12#include │ │ │ │ │ +13 │ │ │ │ │ 14 │ │ │ │ │ -15// Interface of type erasure wrapper │ │ │ │ │ -16// │ │ │ │ │ -17// Notice that the basic interface of polymorphic classes (destructor, clone, │ │ │ │ │ -...) │ │ │ │ │ -18// will be added by the type erasure foundation classes. │ │ │ │ │ -19template │ │ │ │ │ -20class LocalFunctionWrapperInterface : │ │ │ │ │ -21 public DifferentiableFunctionWrapperInterface │ │ │ │ │ -22{ │ │ │ │ │ -23public: │ │ │ │ │ -24 virtual void bind(const LocalContext&) = 0; │ │ │ │ │ -25 │ │ │ │ │ -26 virtual void unbind() = 0; │ │ │ │ │ -27 │ │ │ │ │ -28 virtual bool bound() const = 0; │ │ │ │ │ -29 │ │ │ │ │ -30 virtual const LocalContext& localContext() const = 0; │ │ │ │ │ -31}; │ │ │ │ │ -32 │ │ │ │ │ -33 │ │ │ │ │ -34// Implementation of type erasure wrapper │ │ │ │ │ -35template │ │ │ │ │ -36class LocalFunctionWrapperImplementation : │ │ │ │ │ -37 public DifferentiableFunctionWrapperImplementation │ │ │ │ │ -38{ │ │ │ │ │ -39 using Base = DifferentiableFunctionWrapperImplementation; │ │ │ │ │ -40public: │ │ │ │ │ -41 using Base::Base; │ │ │ │ │ -42 │ │ │ │ │ -43 virtual void bind(const LocalContext& context) │ │ │ │ │ -44 { │ │ │ │ │ -45 this->get().bind(context); │ │ │ │ │ -46 } │ │ │ │ │ -47 │ │ │ │ │ -48 virtual void unbind() │ │ │ │ │ +15namespace _D_u_n_e { │ │ │ │ │ +16namespace Functions { │ │ │ │ │ +17 │ │ │ │ │ +18 │ │ │ │ │ +19 │ │ │ │ │ +37template │ │ │ │ │ +_3_8struct _D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p │ │ │ │ │ +39{ │ │ │ │ │ +40 │ │ │ │ │ +41 // A simple visitor for computing lexicographic │ │ │ │ │ +42 // subtree indices. To identify a leaf node │ │ │ │ │ +43 // we use its treeIndex() which is unique │ │ │ │ │ +44 // wrt the whole tree and store the computed │ │ │ │ │ +45 // index in a vector indexed by the tree indices. │ │ │ │ │ +_4_6 struct _V_i_s_i_t_o_r │ │ │ │ │ +47 : public TypeTree::TreeVisitor │ │ │ │ │ +48 , public TypeTree::DynamicTraversal │ │ │ │ │ 49 { │ │ │ │ │ -50 this->get().unbind(); │ │ │ │ │ -51 } │ │ │ │ │ -52 │ │ │ │ │ -53 virtual bool bound() const │ │ │ │ │ -54 { │ │ │ │ │ -55 return this->get().bound(); │ │ │ │ │ -56 } │ │ │ │ │ -57 │ │ │ │ │ -58 virtual const LocalContext& localContext() const │ │ │ │ │ -59 { │ │ │ │ │ -60 return this->get().localContext(); │ │ │ │ │ -61 } │ │ │ │ │ -62}; │ │ │ │ │ +_5_0 _V_i_s_i_t_o_r(std::vector& indices) : │ │ │ │ │ +51 _i_n_d_i_c_e_s__(indices), │ │ │ │ │ +52 _c_o_u_n_t_e_r__(0) │ │ │ │ │ +53 {} │ │ │ │ │ +54 │ │ │ │ │ +55 template │ │ │ │ │ +_5_6 void _l_e_a_f(Node& node, TreePath treePath) │ │ │ │ │ +57 { │ │ │ │ │ +58 if (_i_n_d_i_c_e_s__.size() < node.treeIndex()+1) │ │ │ │ │ +59 _i_n_d_i_c_e_s__.resize(node.treeIndex()+1); │ │ │ │ │ +60 _i_n_d_i_c_e_s__[node.treeIndex()] = _c_o_u_n_t_e_r__; │ │ │ │ │ +61 ++_c_o_u_n_t_e_r__; │ │ │ │ │ +62 } │ │ │ │ │ 63 │ │ │ │ │ -64}}} // namespace Dune::Functions::Imp │ │ │ │ │ -65 │ │ │ │ │ -66 │ │ │ │ │ +_6_4 std::vector& _i_n_d_i_c_e_s__; │ │ │ │ │ +_6_5 std::size_t _c_o_u_n_t_e_r__; │ │ │ │ │ +66 }; │ │ │ │ │ 67 │ │ │ │ │ -68#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 │ │ │ │ │ +_7_8 _D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p(const Tree& tree) │ │ │ │ │ +79 { │ │ │ │ │ +80 TypeTree::applyToTree(tree, _V_i_s_i_t_o_r(_i_n_d_i_c_e_s__)); │ │ │ │ │ +81 } │ │ │ │ │ +82 │ │ │ │ │ +83 template().treeIndex())>() and not Tree::isLeaf, int> = 0> │ │ │ │ │ +_8_5 decltype(auto) operator()(const Node& node, const TreePath& treePath, │ │ │ │ │ +Range&& y) const │ │ │ │ │ +86 { │ │ │ │ │ +87 return y[_i_n_d_i_c_e_s__[node.treeIndex()]]; │ │ │ │ │ +88 } │ │ │ │ │ +89 │ │ │ │ │ +90 template().treeIndex())>() or Tree::isLeaf, int> = 0> │ │ │ │ │ +_9_2 decltype(auto) operator()(const Node& node, const TreePath& treePath, │ │ │ │ │ +Range&& y) const │ │ │ │ │ +93 { │ │ │ │ │ +94 return std::forward(y); │ │ │ │ │ +95 } │ │ │ │ │ +96 │ │ │ │ │ +_9_7 std::vector _i_n_d_i_c_e_s__; │ │ │ │ │ +98}; │ │ │ │ │ +99 │ │ │ │ │ +100 │ │ │ │ │ +101 │ │ │ │ │ +102template │ │ │ │ │ +_1_0_3_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p_<_T_r_e_e_> _m_a_k_e_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p(const Tree& tree) │ │ │ │ │ +104{ │ │ │ │ │ +105 return _D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p_<_T_r_e_e_>(tree); │ │ │ │ │ +106} │ │ │ │ │ +107 │ │ │ │ │ +108 │ │ │ │ │ +109 │ │ │ │ │ +110template │ │ │ │ │ +_1_1_1auto _m_a_k_e_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p(const Basis& basis, TreePath&& treePath) │ │ │ │ │ +112 -> decltype(_m_a_k_e_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p(TypeTree::child(basis.localView │ │ │ │ │ +().tree(),treePath))) │ │ │ │ │ +113{ │ │ │ │ │ +114 auto&& localView = basis.localView(); │ │ │ │ │ +115 localView.bind(*basis.gridView().template begin<0>()); │ │ │ │ │ +116 auto&& tree = TypeTree::child(localView.tree(),treePath); │ │ │ │ │ +117 return _m_a_k_e_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p(tree); │ │ │ │ │ +118} │ │ │ │ │ +119 │ │ │ │ │ +120 │ │ │ │ │ +121 │ │ │ │ │ +122} // namespace Dune::Functions │ │ │ │ │ +123} // namespace Dune │ │ │ │ │ +124 │ │ │ │ │ +125 │ │ │ │ │ +126#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTNODETORANGEMAP_HH │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_m_a_k_e_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p │ │ │ │ │ +DefaultNodeToRangeMap< Tree > makeDefaultNodeToRangeMap(const Tree &tree) │ │ │ │ │ +DDeeffiinniittiioonn defaultnodetorangemap.hh:103 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p │ │ │ │ │ +A simple node to range map using lexicographic ordering. │ │ │ │ │ +DDeeffiinniittiioonn defaultnodetorangemap.hh:39 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p_:_:_i_n_d_i_c_e_s__ │ │ │ │ │ +std::vector< std::size_t > indices_ │ │ │ │ │ +DDeeffiinniittiioonn defaultnodetorangemap.hh:97 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p_:_:_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p │ │ │ │ │ +DefaultNodeToRangeMap(const Tree &tree) │ │ │ │ │ +Construct DefaultNodeToRangeMap. │ │ │ │ │ +DDeeffiinniittiioonn defaultnodetorangemap.hh:78 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p_:_:_V_i_s_i_t_o_r │ │ │ │ │ +DDeeffiinniittiioonn defaultnodetorangemap.hh:49 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p_:_:_V_i_s_i_t_o_r_:_:_V_i_s_i_t_o_r │ │ │ │ │ +Visitor(std::vector< std::size_t > &indices) │ │ │ │ │ +DDeeffiinniittiioonn defaultnodetorangemap.hh:50 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p_:_:_V_i_s_i_t_o_r_:_:_l_e_a_f │ │ │ │ │ +void leaf(Node &node, TreePath treePath) │ │ │ │ │ +DDeeffiinniittiioonn defaultnodetorangemap.hh:56 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p_:_:_V_i_s_i_t_o_r_:_:_c_o_u_n_t_e_r__ │ │ │ │ │ +std::size_t counter_ │ │ │ │ │ +DDeeffiinniittiioonn defaultnodetorangemap.hh:65 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_D_e_f_a_u_l_t_N_o_d_e_T_o_R_a_n_g_e_M_a_p_:_:_V_i_s_i_t_o_r_:_:_i_n_d_i_c_e_s__ │ │ │ │ │ +std::vector< std::size_t > & indices_ │ │ │ │ │ +DDeeffiinniittiioonn defaultnodetorangemap.hh:64 │ │ │ │ │ +_c_o_n_c_e_p_t_s_._h_h │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00164.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: istlvectorbackend.hh File Reference │ │ │ │ +dune-functions: hierarchicnodetorangemap.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,61 +65,44 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Namespaces | │ │ │ │ -Functions
│ │ │ │ -
istlvectorbackend.hh File Reference
│ │ │ │ +Classes | │ │ │ │ +Namespaces
│ │ │ │ +
hierarchicnodetorangemap.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <cstddef>
│ │ │ │ -#include <utility>
│ │ │ │ +
#include <utility>
│ │ │ │ #include <type_traits>
│ │ │ │ -#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>
│ │ │ │ +#include <dune/functions/common/indexaccess.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...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ │ Namespaces

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

│ │ │ │ -Functions

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,44 +1,26 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _b_a_c_k_e_n_d_s │ │ │ │ │ -_N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -istlvectorbackend.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ +hierarchicnodetorangemap.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_/_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> │ │ │ │ │ +#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_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 │ │ │ │ │   │ │ │ │ │ -FFuunnccttiioonnss │ │ │ │ │ -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. │ │ │ │ │ -  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00164_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: istlvectorbackend.hh Source File │ │ │ │ +dune-functions: hierarchicnodetorangemap.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,346 +70,76 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
istlvectorbackend.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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_ISTLVECTORBACKEND_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_ISTLVECTORBACKEND_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH
│ │ │ │
5
│ │ │ │ -
6#include <cstddef>
│ │ │ │ +
6
│ │ │ │
7#include <utility>
│ │ │ │
8#include <type_traits>
│ │ │ │
9
│ │ │ │ -
10#include <dune/common/std/type_traits.hh>
│ │ │ │ -
11#include <dune/common/indices.hh>
│ │ │ │ -
12#include <dune/common/hybridutilities.hh>
│ │ │ │ -
13#include <dune/common/concept.hh>
│ │ │ │ +
10#include <dune/common/concept.hh>
│ │ │ │ +
11
│ │ │ │ + │ │ │ │ + │ │ │ │
14
│ │ │ │ - │ │ │ │ - │ │ │ │ +
15namespace Dune {
│ │ │ │ +
16namespace Functions {
│ │ │ │
17
│ │ │ │
18
│ │ │ │ -
19namespace Dune {
│ │ │ │ -
20namespace Functions {
│ │ │ │ -
21
│ │ │ │ -
22namespace Impl {
│ │ │ │ -
23
│ │ │ │ -
24template<class V,
│ │ │ │ -
25 std::enable_if_t<not Dune::models<Imp::Concept::HasStaticIndexAccess, V>() , int> = 0>
│ │ │ │ -
26auto fieldTypes(V&& /*v*/)
│ │ │ │ -
27{
│ │ │ │ -
28 return TypeList<V>{};
│ │ │ │ -
29}
│ │ │ │ -
30
│ │ │ │ -
31template<class V,
│ │ │ │ -
32 std::enable_if_t<Dune::models<Imp::Concept::HasStaticIndexAccess, V>(), int> = 0>
│ │ │ │ -
33auto fieldTypes(V&& v)
│ │ │ │ -
34{
│ │ │ │ -
35 if constexpr (Dune::models<Imp::Concept::HasDynamicIndexAccess<std::size_t>, V>())
│ │ │ │ -
36 return fieldTypes(v[std::size_t{0}]);
│ │ │ │ -
37 else
│ │ │ │ -
38 {
│ │ │ │ -
39 auto indexRange = typename decltype(range(Hybrid::size(v)))::integer_sequence();
│ │ │ │ -
40 return unpackIntegerSequence([&](auto... i) {
│ │ │ │ -
41 return uniqueTypeList(std::tuple_cat(fieldTypes(v[i])...));
│ │ │ │ -
42 }, indexRange);
│ │ │ │ +
19
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
30{
│ │ │ │ +
31 template<class Node, class TreePath, class Range,
│ │ │ │ +
32 std::enable_if_t< models<Concept::HasIndexAccess, Range, Dune::index_constant<0>>(), int> = 0>
│ │ │ │ +
│ │ │ │ +
33 decltype(auto) operator()(const Node&, const TreePath& treePath, Range&& y) const
│ │ │ │ +
34 {
│ │ │ │ +
35 return resolveStaticMultiIndex(y, treePath);
│ │ │ │ +
36 }
│ │ │ │ +
│ │ │ │ +
37
│ │ │ │ +
38 template<class Node, class TreePath, class Range,
│ │ │ │ +
39 std::enable_if_t<not models<Concept::HasIndexAccess, Range, Dune::index_constant<0>>(), int> = 0>
│ │ │ │ +
│ │ │ │ +
40 decltype(auto) operator()(const Node&, const TreePath&, Range&& y) const
│ │ │ │ +
41 {
│ │ │ │ +
42 return std::forward<Range>(y);
│ │ │ │
43 }
│ │ │ │ -
44}
│ │ │ │ -
45
│ │ │ │ -
46} // namespace Impl
│ │ │ │ -
47
│ │ │ │ -
48
│ │ │ │ -
49
│ │ │ │ -
62template<class V>
│ │ │ │ -
│ │ │ │ -
63constexpr auto fieldTypes()
│ │ │ │ -
64{
│ │ │ │ -
65 return decltype(Impl::fieldTypes(std::declval<V>())){};
│ │ │ │ -
66}
│ │ │ │ -
│ │ │ │ -
67
│ │ │ │ -
73template<class V>
│ │ │ │ -
│ │ │ │ -
74constexpr bool hasUniqueFieldType()
│ │ │ │ -
75{
│ │ │ │ -
76 return std::tuple_size<std::decay_t<decltype(fieldTypes<V>())>>::value==1;
│ │ │ │ -
77}
│ │ │ │
│ │ │ │ -
78
│ │ │ │ -
79
│ │ │ │ -
80
│ │ │ │ -
81namespace Impl {
│ │ │ │ -
82
│ │ │ │ -
83/*
│ │ │ │ -
84 * \brief A wrapper providing multi-index access to vector entries
│ │ │ │ -
85 *
│ │ │ │ -
86 * The wrapped vector type should be an istl like random
│ │ │ │ -
87 * access container providing operator[] and size() methods.
│ │ │ │ -
88 * For classical containers this should support indices
│ │ │ │ -
89 * of type std::size_t. For multi-type containers indices
│ │ │ │ -
90 * of the form Dune::index_constant<i> should be supported
│ │ │ │ -
91 * while size() should be a static constexpr method.
│ │ │ │ -
92 *
│ │ │ │ -
93 * When resolving multi-indices the backend appends indices
│ │ │ │ -
94 * using operator[] as long as the result is not a scalar.
│ │ │ │ -
95 * If this exhausts the digits of the multi-index, additional
│ │ │ │ -
96 * zero`s are appended.
│ │ │ │ -
97 *
│ │ │ │ -
98 * \tparam V Type of the raw wrapper vector
│ │ │ │ -
99 */
│ │ │ │ -
100template<class V>
│ │ │ │ -
101class ISTLVectorBackend
│ │ │ │ -
102{
│ │ │ │ -
103
│ │ │ │ -
104 // Template aliases for using detection idiom.
│ │ │ │ -
105 template<class C>
│ │ │ │ -
106 using dynamicIndexAccess_t = decltype(std::declval<C>()[0]);
│ │ │ │ -
107
│ │ │ │ -
108 template<class C>
│ │ │ │ -
109 using staticIndexAccess_t = decltype(std::declval<C>()[Dune::Indices::_0]);
│ │ │ │ -
110
│ │ │ │ -
111 template<class C>
│ │ │ │ -
112 using resizeMethod_t = decltype(std::declval<C>().resize(0));
│ │ │ │ -
113
│ │ │ │ -
114
│ │ │ │ -
115
│ │ │ │ -
116 // Short cuts for feature detection
│ │ │ │ -
117 template<class C>
│ │ │ │ -
118 using hasDynamicIndexAccess = Dune::Std::is_detected<dynamicIndexAccess_t, std::remove_reference_t<C>>;
│ │ │ │ -
119
│ │ │ │ -
120 template<class C>
│ │ │ │ -
121 using hasStaticIndexAccess = Dune::Std::is_detected<staticIndexAccess_t, std::remove_reference_t<C>>;
│ │ │ │ -
122
│ │ │ │ -
123 template<class C>
│ │ │ │ -
124 using hasResizeMethod = Dune::Std::is_detected<resizeMethod_t, std::remove_reference_t<C>>;
│ │ │ │ -
125
│ │ │ │ -
126 template<class C>
│ │ │ │ -
127 using isDynamicVector = Dune::Std::is_detected<dynamicIndexAccess_t, std::remove_reference_t<C>>;
│ │ │ │ -
128
│ │ │ │ -
129 template<class C>
│ │ │ │ -
130 using isStaticVector = Dune::Std::bool_constant<
│ │ │ │ -
131 Dune::Std::is_detected_v<staticIndexAccess_t, std::remove_reference_t<C>>
│ │ │ │ -
132 and not Dune::Std::is_detected_v<dynamicIndexAccess_t, std::remove_reference_t<C>>>;
│ │ │ │ -
133
│ │ │ │ -
134 template<class C>
│ │ │ │ -
135 using isScalar = Dune::Std::bool_constant<not Dune::Std::is_detected_v<staticIndexAccess_t, std::remove_reference_t<C>>>;
│ │ │ │ -
136
│ │ │ │ -
137 template<class C>
│ │ │ │ -
138 using isVector = Dune::Std::bool_constant<Dune::Std::is_detected_v<staticIndexAccess_t, std::remove_reference_t<C>>>;
│ │ │ │ -
139
│ │ │ │ -
140
│ │ │ │ -
141
│ │ │ │ -
142 template<class... Args>
│ │ │ │ -
143 static void forwardToResize(Args&&... args)
│ │ │ │ -
144 {
│ │ │ │ -
145 resize(std::forward<Args>(args)...);
│ │ │ │ -
146 }
│ │ │ │ -
147
│ │ │ │ -
148
│ │ │ │ -
149 template<class C, class SizeProvider,
│ │ │ │ -
150 std::enable_if_t<hasResizeMethod<C>::value, int> = 0>
│ │ │ │ -
151 static void resize(C&& c, const SizeProvider& sizeProvider, typename SizeProvider::SizePrefix prefix)
│ │ │ │ -
152 {
│ │ │ │ -
153 auto size = sizeProvider.size(prefix);
│ │ │ │ -
154 if (size==0)
│ │ │ │ -
155 {
│ │ │ │ -
156 // If size==0 this prefix refers to a single coefficient c.
│ │ │ │ -
157 // But being in this overload means that c is not a scalar
│ │ │ │ -
158 // because is has a resize() method. Since operator[] deliberately
│ │ │ │ -
159 // supports implicit padding of multi-indices by as many
│ │ │ │ -
160 // [0]'s as needed to resolve a scalar entry, we should also
│ │ │ │ -
161 // except a non-scalar c here. However, this requires that
│ │ │ │ -
162 // we silently believe that whatever size c already has is
│ │ │ │ -
163 // intended by the user. The only exception is c.size()==0
│ │ │ │ -
164 // which is not acceptable but we also cannot know the desired size.
│ │ │ │ -
165 if (c.size()==0)
│ │ │ │ -
166 DUNE_THROW(RangeError, "The vector entry v[" << prefix << "] should refer to a "
│ │ │ │ -
167 << "scalar coefficient, but is a dynamically sized vector of size==0");
│ │ │ │ -
168 else
│ │ │ │ -
169 // Accept non-zero sized coefficients to avoid that resize(basis)
│ │ │ │ -
170 // fails for a vector that works with operator[] and already
│ │ │ │ -
171 // has the appropriate size.
│ │ │ │ -
172 return;
│ │ │ │ -
173 }
│ │ │ │ -
174 c.resize(size);
│ │ │ │ -
175 prefix.push_back(0);
│ │ │ │ -
176 for(std::size_t i=0; i<size; ++i)
│ │ │ │ -
177 {
│ │ │ │ -
178 prefix.back() = i;
│ │ │ │ -
179 resize(c[i], sizeProvider, prefix);
│ │ │ │ -
180 }
│ │ │ │ -
181 }
│ │ │ │ -
182
│ │ │ │ -
183 template<class C, class SizeProvider,
│ │ │ │ -
184 std::enable_if_t<not hasResizeMethod<C>::value, int> = 0,
│ │ │ │ -
185 std::enable_if_t<isVector<C>::value, int> = 0>
│ │ │ │ -
186 static void resize(C&& c, const SizeProvider& sizeProvider, typename SizeProvider::SizePrefix prefix)
│ │ │ │ -
187 {
│ │ │ │ -
188 auto size = sizeProvider.size(prefix);
│ │ │ │ -
189 // If size == 0 there's nothing to do:
│ │ │ │ -
190 // We can't resize c and it's already
│ │ │ │ -
191 // large enough anyway.
│ │ │ │ -
192 if (size == 0)
│ │ │ │ -
193 return;
│ │ │ │ -
194
│ │ │ │ -
195 // If size>0 but c does not have the appropriate
│ │ │ │ -
196 // size we throw an exception.
│ │ │ │ -
197 //
│ │ │ │ -
198 // We could perhaps also allow c.size()>size.
│ │ │ │ -
199 // But then looping the loop below gets complicated:
│ │ │ │ -
200 // We're not allowed to loop until c.size(). But
│ │ │ │ -
201 // we also cannot use size for termination,
│ │ │ │ -
202 // because this fails if c is a static vector.
│ │ │ │ -
203 if (c.size() != size)
│ │ │ │ -
204 DUNE_THROW(RangeError, "Can't resize non-resizable entry v[" << prefix << "] of size " << c.size() << " to size(" << prefix << ")=" << size);
│ │ │ │ -
205
│ │ │ │ -
206 // Recursively resize all entries of c now.
│ │ │ │ -
207 using namespace Dune::Hybrid;
│ │ │ │ -
208 prefix.push_back(0);
│ │ │ │ -
209 forEach(integralRange(Hybrid::size(c)), [&](auto&& i) {
│ │ │ │ -
210 prefix.back() = i;
│ │ │ │ -
211 // Here we'd simply like to call resize(c[i], sizeProvider, prefix);
│ │ │ │ -
212 // but even gcc-7 does not except this bus reports
│ │ │ │ -
213 // "error: ‘this’ was not captured for this lambda function"
│ │ │ │ -
214 // although there's no 'this' because we're in a static method.
│ │ │ │ -
215 // Bypassing this by and additional method that does perfect
│ │ │ │ -
216 // forwarding allows to workaround this.
│ │ │ │ -
217 ISTLVectorBackend<V>::forwardToResize(c[i], sizeProvider, prefix);
│ │ │ │ -
218 });
│ │ │ │ -
219 }
│ │ │ │ -
220
│ │ │ │ -
221 template<class C, class SizeProvider,
│ │ │ │ -
222 std::enable_if_t<not hasResizeMethod<C>::value, int> = 0,
│ │ │ │ -
223 std::enable_if_t<isScalar<C>::value, int> = 0>
│ │ │ │ -
224 static void resize(C&&, const SizeProvider& sizeProvider, typename SizeProvider::SizePrefix prefix)
│ │ │ │ -
225 {
│ │ │ │ -
226 auto size = sizeProvider.size(prefix);
│ │ │ │ -
227 if (size != 0)
│ │ │ │ -
228 DUNE_THROW(RangeError, "Can't resize scalar vector entry v[" << prefix << "] to size(" << prefix << ")=" << size);
│ │ │ │ -
229 }
│ │ │ │ -
230
│ │ │ │ -
231 template<class C, class T,
│ │ │ │ -
232 std::enable_if_t<std::is_assignable<C&,T>::value, int> = 0>
│ │ │ │ -
233 void recursiveAssign(C& c, const T& t)
│ │ │ │ -
234 {
│ │ │ │ -
235 c = t;
│ │ │ │ -
236 }
│ │ │ │ -
237
│ │ │ │ -
238 template<class C, class T,
│ │ │ │ -
239 std::enable_if_t<not std::is_assignable<C&,T>::value, int> = 0>
│ │ │ │ -
240 void recursiveAssign(C& c, const T& t)
│ │ │ │ -
241 {
│ │ │ │ -
242 Dune::Hybrid::forEach(c, [&](auto&& ci) {
│ │ │ │ -
243 recursiveAssign(ci, t);
│ │ │ │ -
244 });
│ │ │ │ -
245 }
│ │ │ │ -
246
│ │ │ │ -
247public:
│ │ │ │ -
248
│ │ │ │ -
249 using Vector = V;
│ │ │ │ -
250
│ │ │ │ -
251 ISTLVectorBackend(Vector& vector) :
│ │ │ │ -
252 vector_(&vector)
│ │ │ │ -
253 {}
│ │ │ │ -
254
│ │ │ │ -
255 template<class SizeProvider>
│ │ │ │ -
256 void resize(const SizeProvider& sizeProvider)
│ │ │ │ -
257 {
│ │ │ │ -
258 auto prefix = typename SizeProvider::SizePrefix();
│ │ │ │ -
259 prefix.resize(0);
│ │ │ │ -
260 resize(*vector_, sizeProvider, prefix);
│ │ │ │ -
261 }
│ │ │ │ -
262
│ │ │ │ -
263 template<class MultiIndex>
│ │ │ │ -
264 decltype(auto) operator[](const MultiIndex& index) const
│ │ │ │ -
265 {
│ │ │ │ -
266 return resolveDynamicMultiIndex(*vector_, index);
│ │ │ │ -
267 }
│ │ │ │ -
268
│ │ │ │ -
269 template<class MultiIndex>
│ │ │ │ -
270 decltype(auto) operator[](const MultiIndex& index)
│ │ │ │ -
271 {
│ │ │ │ -
272 return resolveDynamicMultiIndex(*vector_, index);
│ │ │ │ -
273 }
│ │ │ │ -
274
│ │ │ │ -
283 template<typename T>
│ │ │ │ -
284 void operator= (const T& other)
│ │ │ │ -
285 {
│ │ │ │ -
286 recursiveAssign(vector(), other);
│ │ │ │ -
287 }
│ │ │ │ -
288
│ │ │ │ -
289 template<typename T>
│ │ │ │ -
290 void operator= (const ISTLVectorBackend<T>& other)
│ │ │ │ -
291 {
│ │ │ │ -
292 vector() = other.vector();
│ │ │ │ -
293 }
│ │ │ │ -
294
│ │ │ │ -
295 const Vector& vector() const
│ │ │ │ -
296 {
│ │ │ │ -
297 return *vector_;
│ │ │ │ -
298 }
│ │ │ │ -
299
│ │ │ │ -
300 Vector& vector()
│ │ │ │ -
301 {
│ │ │ │ -
302 return *vector_;
│ │ │ │ -
303 }
│ │ │ │ -
304
│ │ │ │ -
305private:
│ │ │ │ -
306
│ │ │ │ -
307 Vector* vector_;
│ │ │ │ -
308};
│ │ │ │ -
309
│ │ │ │ -
310} // end namespace Impl
│ │ │ │ -
311
│ │ │ │ -
312
│ │ │ │ -
313
│ │ │ │ -
345template<class Vector>
│ │ │ │ -
│ │ │ │ -
346auto istlVectorBackend(Vector& v)
│ │ │ │ -
347{
│ │ │ │ -
348 static_assert(hasUniqueFieldType<Vector&>(), "Vector type passed to istlVectorBackend() does not have a unique field type.");
│ │ │ │ -
349 return Impl::ISTLVectorBackend<Vector>(v);
│ │ │ │ -
350}
│ │ │ │ +
44};
│ │ │ │
│ │ │ │ -
351
│ │ │ │ -
352
│ │ │ │ -
353
│ │ │ │ -
383template<class Vector>
│ │ │ │ -
│ │ │ │ -
384auto istlVectorBackend(const Vector& v)
│ │ │ │ -
385{
│ │ │ │ -
386 static_assert(hasUniqueFieldType<const Vector&>(), "Vector type passed to istlVectorBackend() does not have a unique field type.");
│ │ │ │ -
387 return Impl::ISTLVectorBackend<const Vector>(v);
│ │ │ │ -
388}
│ │ │ │ -
│ │ │ │ -
389
│ │ │ │ -
390
│ │ │ │ -
391
│ │ │ │ -
392} // namespace Functions
│ │ │ │ -
393} // namespace Dune
│ │ │ │ -
394
│ │ │ │ -
395
│ │ │ │ -
396#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_ISTLVECTORBACKEND_HH
│ │ │ │ - │ │ │ │ -
auto istlVectorBackend(Vector &v)
Return a vector backend wrapping non-const ISTL like containers.
Definition istlvectorbackend.hh:346
│ │ │ │ -
constexpr decltype(auto) resolveDynamicMultiIndex(C &&c, const MultiIndex &multiIndex, const IsFinal &isFinal)
Provide multi-index access by chaining operator[].
Definition indexaccess.hh:354
│ │ │ │ +
45
│ │ │ │ +
46
│ │ │ │ +
47
│ │ │ │ +
48} // namespace Dune::Functions
│ │ │ │ +
49} // namespace Dune
│ │ │ │ +
50
│ │ │ │ +
51
│ │ │ │ +
52#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:398
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
constexpr auto fieldTypes()
Generate list of field types in container.
Definition istlvectorbackend.hh:63
│ │ │ │ -
constexpr bool hasUniqueFieldType()
Check if container has a unique field type.
Definition istlvectorbackend.hh:74
│ │ │ │ +
A simple node to range map using the nested tree indices.
Definition hierarchicnodetorangemap.hh:30
│ │ │ │ +
decltype(auto) operator()(const Node &, const TreePath &treePath, Range &&y) const
Definition hierarchicnodetorangemap.hh:33
│ │ │ │ +
decltype(auto) operator()(const Node &, const TreePath &, Range &&y) const
Definition hierarchicnodetorangemap.hh:40
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── encoding │ │ │ │ │ @@ -1 +1 @@ │ │ │ │ │ -utf-8 │ │ │ │ │ +us-ascii │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,362 +1,76 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _b_a_c_k_e_n_d_s │ │ │ │ │ -istlvectorbackend.hh │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_ISTLVECTORBACKEND_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_ISTLVECTORBACKEND_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ +6 │ │ │ │ │ 7#include │ │ │ │ │ 8#include │ │ │ │ │ 9 │ │ │ │ │ -10#include │ │ │ │ │ -11#include │ │ │ │ │ -12#include │ │ │ │ │ -13#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_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ │ +13#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> │ │ │ │ │ 14 │ │ │ │ │ -15#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> │ │ │ │ │ -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> │ │ │ │ │ +15namespace _D_u_n_e { │ │ │ │ │ +16namespace Functions { │ │ │ │ │ 17 │ │ │ │ │ 18 │ │ │ │ │ -19namespace _D_u_n_e { │ │ │ │ │ -20namespace Functions { │ │ │ │ │ -21 │ │ │ │ │ -22namespace Impl { │ │ │ │ │ -23 │ │ │ │ │ -24template() , │ │ │ │ │ -int> = 0> │ │ │ │ │ -26auto _f_i_e_l_d_T_y_p_e_s(V&& /*v*/) │ │ │ │ │ -27{ │ │ │ │ │ -28 return TypeList{}; │ │ │ │ │ -29} │ │ │ │ │ -30 │ │ │ │ │ -31template(), int> │ │ │ │ │ -= 0> │ │ │ │ │ -33auto _f_i_e_l_d_T_y_p_e_s(V&& v) │ │ │ │ │ -34{ │ │ │ │ │ -35 if constexpr (Dune::models, │ │ │ │ │ -V>()) │ │ │ │ │ -36 return _f_i_e_l_d_T_y_p_e_s(v[std::size_t{0}]); │ │ │ │ │ -37 else │ │ │ │ │ -38 { │ │ │ │ │ -39 auto indexRange = typename decltype(range(Hybrid::size(v))):: │ │ │ │ │ -integer_sequence(); │ │ │ │ │ -40 return unpackIntegerSequence([&](auto... i) { │ │ │ │ │ -41 return uniqueTypeList(std::tuple_cat(_f_i_e_l_d_T_y_p_e_s(v[i])...)); │ │ │ │ │ -42 }, indexRange); │ │ │ │ │ +19 │ │ │ │ │ +_2_9struct _H_i_e_r_a_r_c_h_i_c_N_o_d_e_T_o_R_a_n_g_e_M_a_p │ │ │ │ │ +30{ │ │ │ │ │ +31 template>(), int> = 0> │ │ │ │ │ +_3_3 decltype(auto) _o_p_e_r_a_t_o_r_(_)(const Node&, const TreePath& treePath, Range&& y) │ │ │ │ │ +const │ │ │ │ │ +34 { │ │ │ │ │ +35 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); │ │ │ │ │ +36 } │ │ │ │ │ +37 │ │ │ │ │ +38 template>(), int> = 0> │ │ │ │ │ +_4_0 decltype(auto) _o_p_e_r_a_t_o_r_(_)(const Node&, const TreePath&, Range&& y) const │ │ │ │ │ +41 { │ │ │ │ │ +42 return std::forward(y); │ │ │ │ │ 43 } │ │ │ │ │ -44} │ │ │ │ │ +44}; │ │ │ │ │ 45 │ │ │ │ │ -46} // namespace Impl │ │ │ │ │ +46 │ │ │ │ │ 47 │ │ │ │ │ -48 │ │ │ │ │ -49 │ │ │ │ │ -62template │ │ │ │ │ -_6_3constexpr auto _f_i_e_l_d_T_y_p_e_s() │ │ │ │ │ -64{ │ │ │ │ │ -65 return decltype(Impl::fieldTypes(std::declval())){}; │ │ │ │ │ -66} │ │ │ │ │ -67 │ │ │ │ │ -73template │ │ │ │ │ -_7_4constexpr bool _h_a_s_U_n_i_q_u_e_F_i_e_l_d_T_y_p_e() │ │ │ │ │ -75{ │ │ │ │ │ -76 return std::tuple_size())>>::value==1; │ │ │ │ │ -77} │ │ │ │ │ -78 │ │ │ │ │ -79 │ │ │ │ │ -80 │ │ │ │ │ -81namespace Impl { │ │ │ │ │ -82 │ │ │ │ │ -83/* │ │ │ │ │ -84 * \brief A wrapper providing multi-index access to vector entries │ │ │ │ │ -85 * │ │ │ │ │ -86 * The wrapped vector type should be an istl like random │ │ │ │ │ -87 * access container providing operator[] and size() methods. │ │ │ │ │ -88 * For classical containers this should support indices │ │ │ │ │ -89 * of type std::size_t. For multi-type containers indices │ │ │ │ │ -90 * of the form Dune::index_constant should be supported │ │ │ │ │ -91 * while size() should be a static constexpr method. │ │ │ │ │ -92 * │ │ │ │ │ -93 * When resolving multi-indices the backend appends indices │ │ │ │ │ -94 * using operator[] as long as the result is not a scalar. │ │ │ │ │ -95 * If this exhausts the digits of the multi-index, additional │ │ │ │ │ -96 * zero`s are appended. │ │ │ │ │ -97 * │ │ │ │ │ -98 * \tparam V Type of the raw wrapper vector │ │ │ │ │ -99 */ │ │ │ │ │ -100template │ │ │ │ │ -101class ISTLVectorBackend │ │ │ │ │ -102{ │ │ │ │ │ -103 │ │ │ │ │ -104 // Template aliases for using detection idiom. │ │ │ │ │ -105 template │ │ │ │ │ -106 using dynamicIndexAccess_t = decltype(std::declval()[0]); │ │ │ │ │ -107 │ │ │ │ │ -108 template │ │ │ │ │ -109 using staticIndexAccess_t = decltype(std::declval()[Dune::Indices::_0]); │ │ │ │ │ -110 │ │ │ │ │ -111 template │ │ │ │ │ -112 using resizeMethod_t = decltype(std::declval().resize(0)); │ │ │ │ │ -113 │ │ │ │ │ -114 │ │ │ │ │ -115 │ │ │ │ │ -116 // Short cuts for feature detection │ │ │ │ │ -117 template │ │ │ │ │ -118 using hasDynamicIndexAccess = Dune::Std::is_detected>; │ │ │ │ │ -119 │ │ │ │ │ -120 template │ │ │ │ │ -121 using hasStaticIndexAccess = Dune::Std::is_detected>; │ │ │ │ │ -122 │ │ │ │ │ -123 template │ │ │ │ │ -124 using hasResizeMethod = Dune::Std::is_detected>; │ │ │ │ │ -125 │ │ │ │ │ -126 template │ │ │ │ │ -127 using isDynamicVector = Dune::Std::is_detected>; │ │ │ │ │ -128 │ │ │ │ │ -129 template │ │ │ │ │ -130 using isStaticVector = Dune::Std::bool_constant< │ │ │ │ │ -131 Dune::Std::is_detected_v> │ │ │ │ │ -132 and not Dune::Std::is_detected_v>>; │ │ │ │ │ -133 │ │ │ │ │ -134 template │ │ │ │ │ -135 using isScalar = Dune::Std::bool_constant>>; │ │ │ │ │ -136 │ │ │ │ │ -137 template │ │ │ │ │ -138 using isVector = Dune::Std::bool_constant>>; │ │ │ │ │ -139 │ │ │ │ │ -140 │ │ │ │ │ -141 │ │ │ │ │ -142 template │ │ │ │ │ -143 static void forwardToResize(Args&&... args) │ │ │ │ │ -144 { │ │ │ │ │ -145 resize(std::forward(args)...); │ │ │ │ │ -146 } │ │ │ │ │ -147 │ │ │ │ │ -148 │ │ │ │ │ -149 template::value, int> = 0> │ │ │ │ │ -151 static void resize(C&& c, const SizeProvider& sizeProvider, typename │ │ │ │ │ -SizeProvider::SizePrefix prefix) │ │ │ │ │ -152 { │ │ │ │ │ -153 auto size = sizeProvider.size(prefix); │ │ │ │ │ -154 if (size==0) │ │ │ │ │ -155 { │ │ │ │ │ -156 // If size==0 this prefix refers to a single coefficient c. │ │ │ │ │ -157 // But being in this overload means that c is not a scalar │ │ │ │ │ -158 // because is has a resize() method. Since operator[] deliberately │ │ │ │ │ -159 // supports implicit padding of multi-indices by as many │ │ │ │ │ -160 // [0]'s as needed to resolve a scalar entry, we should also │ │ │ │ │ -161 // except a non-scalar c here. However, this requires that │ │ │ │ │ -162 // we silently believe that whatever size c already has is │ │ │ │ │ -163 // intended by the user. The only exception is c.size()==0 │ │ │ │ │ -164 // which is not acceptable but we also cannot know the desired size. │ │ │ │ │ -165 if (c.size()==0) │ │ │ │ │ -166 DUNE_THROW(RangeError, "The vector entry v[" << prefix << "] should refer │ │ │ │ │ -to a " │ │ │ │ │ -167 << "scalar coefficient, but is a dynamically sized vector of size==0"); │ │ │ │ │ -168 else │ │ │ │ │ -169 // Accept non-zero sized coefficients to avoid that resize(basis) │ │ │ │ │ -170 // fails for a vector that works with operator[] and already │ │ │ │ │ -171 // has the appropriate size. │ │ │ │ │ -172 return; │ │ │ │ │ -173 } │ │ │ │ │ -174 c.resize(size); │ │ │ │ │ -175 prefix.push_back(0); │ │ │ │ │ -176 for(std::size_t i=0; i::value, int> = 0, │ │ │ │ │ -185 std::enable_if_t::value, int> = 0> │ │ │ │ │ -186 static void resize(C&& c, const SizeProvider& sizeProvider, typename │ │ │ │ │ -SizeProvider::SizePrefix prefix) │ │ │ │ │ -187 { │ │ │ │ │ -188 auto size = sizeProvider.size(prefix); │ │ │ │ │ -189 // If size == 0 there's nothing to do: │ │ │ │ │ -190 // We can't resize c and it's already │ │ │ │ │ -191 // large enough anyway. │ │ │ │ │ -192 if (size == 0) │ │ │ │ │ -193 return; │ │ │ │ │ -194 │ │ │ │ │ -195 // If size>0 but c does not have the appropriate │ │ │ │ │ -196 // size we throw an exception. │ │ │ │ │ -197 // │ │ │ │ │ -198 // We could perhaps also allow c.size()>size. │ │ │ │ │ -199 // But then looping the loop below gets complicated: │ │ │ │ │ -200 // We're not allowed to loop until c.size(). But │ │ │ │ │ -201 // we also cannot use size for termination, │ │ │ │ │ -202 // because this fails if c is a static vector. │ │ │ │ │ -203 if (c.size() != size) │ │ │ │ │ -204 DUNE_THROW(RangeError, "Can't resize non-resizable entry v[" << prefix << │ │ │ │ │ -"] of size " << c.size() << " to size(" << prefix << ")=" << size); │ │ │ │ │ -205 │ │ │ │ │ -206 // Recursively resize all entries of c now. │ │ │ │ │ -207 using namespace Dune::Hybrid; │ │ │ │ │ -208 prefix.push_back(0); │ │ │ │ │ -209 forEach(integralRange(Hybrid::size(c)), [&](auto&& i) { │ │ │ │ │ -210 prefix.back() = i; │ │ │ │ │ -211 // Here we'd simply like to call resize(c[i], sizeProvider, prefix); │ │ │ │ │ -212 // but even gcc-7 does not except this bus reports │ │ │ │ │ -213 // "error: ‘this’ was not captured for this lambda function" │ │ │ │ │ -214 // although there's no 'this' because we're in a static method. │ │ │ │ │ -215 // Bypassing this by and additional method that does perfect │ │ │ │ │ -216 // forwarding allows to workaround this. │ │ │ │ │ -217 ISTLVectorBackend::forwardToResize(c[i], sizeProvider, prefix); │ │ │ │ │ -218 }); │ │ │ │ │ -219 } │ │ │ │ │ -220 │ │ │ │ │ -221 template::value, int> = 0, │ │ │ │ │ -223 std::enable_if_t::value, int> = 0> │ │ │ │ │ -224 static void resize(C&&, const SizeProvider& sizeProvider, typename │ │ │ │ │ -SizeProvider::SizePrefix prefix) │ │ │ │ │ -225 { │ │ │ │ │ -226 auto size = sizeProvider.size(prefix); │ │ │ │ │ -227 if (size != 0) │ │ │ │ │ -228 DUNE_THROW(RangeError, "Can't resize scalar vector entry v[" << prefix << │ │ │ │ │ -"] to size(" << prefix << ")=" << size); │ │ │ │ │ -229 } │ │ │ │ │ -230 │ │ │ │ │ -231 template::value, int> = 0> │ │ │ │ │ -233 void recursiveAssign(C& c, const T& t) │ │ │ │ │ -234 { │ │ │ │ │ -235 c = t; │ │ │ │ │ -236 } │ │ │ │ │ -237 │ │ │ │ │ -238 template::value, int> = 0> │ │ │ │ │ -240 void recursiveAssign(C& c, const T& t) │ │ │ │ │ -241 { │ │ │ │ │ -242 Dune::Hybrid::forEach(c, [&](auto&& ci) { │ │ │ │ │ -243 recursiveAssign(ci, t); │ │ │ │ │ -244 }); │ │ │ │ │ -245 } │ │ │ │ │ -246 │ │ │ │ │ -247public: │ │ │ │ │ -248 │ │ │ │ │ -249 using Vector = V; │ │ │ │ │ -250 │ │ │ │ │ -251 ISTLVectorBackend(Vector& vector) : │ │ │ │ │ -252 vector_(&vector) │ │ │ │ │ -253 {} │ │ │ │ │ -254 │ │ │ │ │ -255 template │ │ │ │ │ -256 void resize(const SizeProvider& sizeProvider) │ │ │ │ │ -257 { │ │ │ │ │ -258 auto prefix = typename SizeProvider::SizePrefix(); │ │ │ │ │ -259 prefix.resize(0); │ │ │ │ │ -260 resize(*vector_, sizeProvider, prefix); │ │ │ │ │ -261 } │ │ │ │ │ -262 │ │ │ │ │ -263 template │ │ │ │ │ -264 decltype(auto) operator[](const MultiIndex& index) const │ │ │ │ │ -265 { │ │ │ │ │ -266 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); │ │ │ │ │ -267 } │ │ │ │ │ -268 │ │ │ │ │ -269 template │ │ │ │ │ -270 decltype(auto) operator[](const MultiIndex& index) │ │ │ │ │ -271 { │ │ │ │ │ -272 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); │ │ │ │ │ -273 } │ │ │ │ │ -274 │ │ │ │ │ -283 template │ │ │ │ │ -284 void operator= (const T& other) │ │ │ │ │ -285 { │ │ │ │ │ -286 recursiveAssign(vector(), other); │ │ │ │ │ -287 } │ │ │ │ │ -288 │ │ │ │ │ -289 template │ │ │ │ │ -290 void operator= (const ISTLVectorBackend& other) │ │ │ │ │ -291 { │ │ │ │ │ -292 vector() = other.vector(); │ │ │ │ │ -293 } │ │ │ │ │ -294 │ │ │ │ │ -295 const Vector& vector() const │ │ │ │ │ -296 { │ │ │ │ │ -297 return *vector_; │ │ │ │ │ -298 } │ │ │ │ │ -299 │ │ │ │ │ -300 Vector& vector() │ │ │ │ │ -301 { │ │ │ │ │ -302 return *vector_; │ │ │ │ │ -303 } │ │ │ │ │ -304 │ │ │ │ │ -305private: │ │ │ │ │ -306 │ │ │ │ │ -307 Vector* vector_; │ │ │ │ │ -308}; │ │ │ │ │ -309 │ │ │ │ │ -310} // end namespace Impl │ │ │ │ │ -311 │ │ │ │ │ -312 │ │ │ │ │ -313 │ │ │ │ │ -345template │ │ │ │ │ -_3_4_6auto _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(Vector& v) │ │ │ │ │ -347{ │ │ │ │ │ -348 static_assert(hasUniqueFieldType(), "Vector type passed to │ │ │ │ │ -istlVectorBackend() does not have a unique field type."); │ │ │ │ │ -349 return Impl::ISTLVectorBackend(v); │ │ │ │ │ -350} │ │ │ │ │ -351 │ │ │ │ │ -352 │ │ │ │ │ -353 │ │ │ │ │ -383template │ │ │ │ │ -_3_8_4auto _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(const Vector& v) │ │ │ │ │ -385{ │ │ │ │ │ -386 static_assert(hasUniqueFieldType(), "Vector type passed to │ │ │ │ │ -istlVectorBackend() does not have a unique field type."); │ │ │ │ │ -387 return Impl::ISTLVectorBackend(v); │ │ │ │ │ -388} │ │ │ │ │ -389 │ │ │ │ │ -390 │ │ │ │ │ -391 │ │ │ │ │ -392} // namespace Functions │ │ │ │ │ -393} // namespace Dune │ │ │ │ │ -394 │ │ │ │ │ -395 │ │ │ │ │ -396#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_ISTLVECTORBACKEND_HH │ │ │ │ │ +48} // namespace Dune::Functions │ │ │ │ │ +49} // namespace Dune │ │ │ │ │ +50 │ │ │ │ │ +51 │ │ │ │ │ +52#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_:_:_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:346 │ │ │ │ │ -_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) │ │ │ │ │ +_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:354 │ │ │ │ │ +DDeeffiinniittiioonn indexaccess.hh:398 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:63 │ │ │ │ │ -_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:74 │ │ │ │ │ +_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:30 │ │ │ │ │ +_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:33 │ │ │ │ │ +_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:40 │ │ │ │ │ _c_o_n_c_e_p_t_s_._h_h │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00167.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: gridviewfunction.hh File Reference │ │ │ │ +dune-functions: nedelecbasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,58 +65,67 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces | │ │ │ │ +Typedefs | │ │ │ │ Functions
│ │ │ │ -
gridviewfunction.hh File Reference
│ │ │ │ +
nedelecbasis.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 <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/nodes.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

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

│ │ │ │ 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<class F , class GridView , typename std::enable_if< models< Imp::HasFreeLocalFunction, F >(), int >::type = 0>
std::decay< F >::type Dune::Functions::makeGridViewFunction (F &&f, const GridView &gridView)
 Construct a function modeling GridViewFunction from function and grid view.
 
template<class F , class GridView , typename std::enable_if< not(models< Imp::HasFreeLocalFunction, F >()), int >::type = 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.
 
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,47 +1,45 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _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_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -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> │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +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_/_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_:_:_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_:_:_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_:_:_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 GridView. _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_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_:_:_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< GV, │ │ │ │ │ + Range, kind, order > > │ │ │ │ │ +  Basis of a k-th-order Nédélec finite element space. │ │ │ │ │ +  │ │ │ │ │ FFuunnccttiioonnss │ │ │ │ │ -template(), int >::type = 0> │ │ │ │ │ -std::decay< F >::type  _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 >::type = 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. │ │ │ │ │ +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. │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00167_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: gridviewfunction.hh Source File │ │ │ │ +dune-functions: nedelecbasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,103 +70,418 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
gridviewfunction.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#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH
│ │ │ │
5
│ │ │ │ -
6#include <memory>
│ │ │ │ -
7
│ │ │ │ -
8#include <dune/common/concept.hh>
│ │ │ │ -
9
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
13
│ │ │ │ +
6#include <array>
│ │ │ │ +
7#include <dune/common/exceptions.hh>
│ │ │ │ +
8
│ │ │ │ +
9#include <dune/grid/common/capabilities.hh>
│ │ │ │ +
10#include <dune/grid/common/mcmgmapper.hh>
│ │ │ │ +
11
│ │ │ │ +
12#include <dune/localfunctions/common/localfiniteelementvariant.hh>
│ │ │ │ +
13#include <dune/localfunctions/nedelec.hh>
│ │ │ │
14
│ │ │ │ -
15namespace Dune {
│ │ │ │ -
16namespace Functions {
│ │ │ │ -
17
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
18
│ │ │ │ -
19
│ │ │ │ -
20template<class Signature, class GridView, template<class> class DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
22{};
│ │ │ │ -
│ │ │ │ -
23
│ │ │ │ -
24
│ │ │ │ -
25
│ │ │ │ -
40template<class Range, class Domain, class GV, template<class> class DerivativeTraits, size_t bufferSize>
│ │ │ │ -
│ │ │ │ -
41class GridViewFunction<Range(Domain), GV, DerivativeTraits, bufferSize> :
│ │ │ │ -
42 public GridFunction<Range(Domain), GridViewEntitySet<GV, 0>, DerivativeTraits, bufferSize>
│ │ │ │ -
43{
│ │ │ │ -
44 using Base = GridFunction<Range(Domain), GridViewEntitySet<GV, 0>, DerivativeTraits, bufferSize>;
│ │ │ │ -
45public:
│ │ │ │ -
46 using GridView = GV;
│ │ │ │ -
47
│ │ │ │ -
48 using Base::Base;
│ │ │ │ -
49};
│ │ │ │ -
│ │ │ │ -
50
│ │ │ │ -
51
│ │ │ │ +
19namespace Dune::Functions
│ │ │ │ +
20{
│ │ │ │ +
21
│ │ │ │ +
22namespace Impl
│ │ │ │ +
23{
│ │ │ │ +
24 template<typename GV, int dim, typename R, std::size_t order>
│ │ │ │ +
25 class Nedelec1stKindLocalFiniteElementMap
│ │ │ │ +
26 {
│ │ │ │ +
27 using D = typename GV::ctype;
│ │ │ │ +
28 constexpr static bool hasFixedElementType = Capabilities::hasSingleGeometryType<typename GV::Grid>::v;
│ │ │ │ +
29
│ │ │ │ +
30 using CubeFiniteElement = Nedelec1stKindCubeLocalFiniteElement<D,R,dim,order>;
│ │ │ │ +
31 using SimplexFiniteElement = Nedelec1stKindSimplexLocalFiniteElement<D,R,dim,order>;
│ │ │ │ +
32
│ │ │ │ +
33 public:
│ │ │ │ +
34
│ │ │ │ +
35 using T = LocalBasisTraits<D, dim, FieldVector<D,dim>, R, dim, FieldVector<R,dim>, FieldMatrix<D,dim,dim> >;
│ │ │ │ +
36
│ │ │ │ +
37 constexpr static unsigned int topologyId = Capabilities::hasSingleGeometryType<typename GV::Grid>::topologyId; // meaningless if hasFixedElementType is false
│ │ │ │ +
38 constexpr static GeometryType type = GeometryType(topologyId, GV::dimension);
│ │ │ │ +
39
│ │ │ │ +
40 using FiniteElement = std::conditional_t<hasFixedElementType,
│ │ │ │ +
41 std::conditional_t<type.isCube(),CubeFiniteElement,SimplexFiniteElement>,
│ │ │ │ +
42 LocalFiniteElementVariant<CubeFiniteElement, SimplexFiniteElement> >;
│ │ │ │ +
43
│ │ │ │ +
44 static std::size_t numVariants(GeometryType type)
│ │ │ │ +
45 {
│ │ │ │ +
46 if (order!=1) // I am not sure whether the formula below is correct for all orders.
│ │ │ │ +
47 DUNE_THROW(NotImplemented, "Only Nedelec elements of order 1 are implemented!");
│ │ │ │ +
48
│ │ │ │ +
49 auto numEdges = referenceElement<D,dim>(type).size(dim-1);
│ │ │ │ +
50 return power(2,numEdges);
│ │ │ │ +
51 }
│ │ │ │
52
│ │ │ │ -
64template<class F, class GridView,
│ │ │ │ -
65 typename std::enable_if<
│ │ │ │ -
66 models< Imp::HasFreeLocalFunction, F>() , int>::type = 0>
│ │ │ │ -
67typename std::decay<F>::type
│ │ │ │ -
│ │ │ │ -
68 makeGridViewFunction(F&& f, const GridView& gridView)
│ │ │ │ -
69{
│ │ │ │ -
70 return std::forward<F>(f);
│ │ │ │ -
71}
│ │ │ │ -
│ │ │ │ -
72
│ │ │ │ +
53 Nedelec1stKindLocalFiniteElementMap(const GV& gv)
│ │ │ │ +
54 : elementMapper_(gv, mcmgElementLayout()),
│ │ │ │ +
55 orientation_(gv.size(0))
│ │ │ │ +
56 {
│ │ │ │ +
57 // create all variants
│ │ │ │ +
58 if constexpr (hasFixedElementType)
│ │ │ │ +
59 {
│ │ │ │ +
60 variants_.resize(numVariants(type));
│ │ │ │ +
61 for (size_t i = 0; i < numVariants(type); i++)
│ │ │ │ +
62 variants_[i] = FiniteElement(i);
│ │ │ │ +
63 }
│ │ │ │ +
64 else
│ │ │ │ +
65 {
│ │ │ │ +
66 // for mixed grids add offset for cubes
│ │ │ │ +
67 variants_.resize(numVariants(GeometryTypes::simplex(dim)) + numVariants(GeometryTypes::cube(dim)));
│ │ │ │ +
68 for (size_t i = 0; i < numVariants(GeometryTypes::simplex(dim)); i++)
│ │ │ │ +
69 variants_[i] = SimplexFiniteElement(i);
│ │ │ │ +
70 for (size_t i = 0; i < numVariants(GeometryTypes::cube(dim)); i++)
│ │ │ │ +
71 variants_[i + numVariants(GeometryTypes::simplex(dim))] = CubeFiniteElement(i);
│ │ │ │ +
72 }
│ │ │ │
73
│ │ │ │
74
│ │ │ │ -
90template<class F, class GridView,
│ │ │ │ -
91 typename std::enable_if<
│ │ │ │ -
92 not(models< Imp::HasFreeLocalFunction, F>()) , int>::type = 0>
│ │ │ │ -
│ │ │ │ -
93auto makeGridViewFunction(F&& f, const GridView& gridView)
│ │ │ │ -
94 -> decltype(makeAnalyticGridViewFunction(std::forward<F>(f), gridView))
│ │ │ │ -
95{
│ │ │ │ -
96 return makeAnalyticGridViewFunction(std::forward<F>(f), gridView);
│ │ │ │ -
97}
│ │ │ │ -
│ │ │ │ -
98
│ │ │ │ -
99
│ │ │ │ -
100
│ │ │ │ -
101} // end of namespace Dune::Functions
│ │ │ │ -
102} // end of namespace Dune
│ │ │ │ +
75 // compute orientation for all elements
│ │ │ │ +
76 const auto& indexSet = gv.indexSet();
│ │ │ │ +
77
│ │ │ │ +
78 for(const auto& element : elements(gv))
│ │ │ │ +
79 {
│ │ │ │ +
80 const auto& refElement = referenceElement(element);
│ │ │ │ +
81 auto elementIndex = elementMapper_.index(element);
│ │ │ │ +
82 orientation_[elementIndex] = 0;
│ │ │ │ +
83
│ │ │ │ +
84 for (std::size_t i=0; i<element.subEntities(dim-1); i++)
│ │ │ │ +
85 {
│ │ │ │ +
86 // Local vertex indices within the element
│ │ │ │ +
87 auto localV0 = refElement.subEntity(i,dim-1, 0,dim);
│ │ │ │ +
88 auto localV1 = refElement.subEntity(i,dim-1, 1,dim);
│ │ │ │ +
89
│ │ │ │ +
90 // Global vertex indices within the grid
│ │ │ │ +
91 auto globalV0 = indexSet.subIndex(element,localV0,dim);
│ │ │ │ +
92 auto globalV1 = indexSet.subIndex(element,localV1,dim);
│ │ │ │ +
93
│ │ │ │ +
94 if ( (localV0<localV1 && globalV0>globalV1) || (localV0>localV1 && globalV0<globalV1) )
│ │ │ │ +
95 orientation_[elementIndex] |= (1 << i);
│ │ │ │ +
96 }
│ │ │ │ +
97 // for mixed grids add offset for cubes
│ │ │ │ +
98 if constexpr (!hasFixedElementType)
│ │ │ │ +
99 if (element.type().isCube())
│ │ │ │ +
100 orientation_[elementIndex] += numVariants(GeometryTypes::simplex(dim));
│ │ │ │ +
101 }
│ │ │ │ +
102 }
│ │ │ │
103
│ │ │ │ -
104#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
AnalyticGridViewFunction< typename std::invoke_result< F, typename GridView::template Codim< 0 >::Geometry::GlobalCoordinate >::type(typename GridView::template Codim< 0 >::Geometry::GlobalCoordinate), GridView, typename std::decay< F >::type > makeAnalyticGridViewFunction(F &&f, const GridView &gridView)
Create an AnalyticGridViewFunction from a function and a grid view.
Definition analyticgridviewfunction.hh:230
│ │ │ │ -
Definition polynomial.hh:10
│ │ │ │ -
std::decay< F >::type makeGridViewFunction(F &&f, const GridView &gridView)
Construct a function modeling GridViewFunction from function and grid view.
Definition gridviewfunction.hh:68
│ │ │ │ -
Definition gridfunction.hh:32
│ │ │ │ -
An entity set for all entities of given codim in a grid view.
Definition gridviewentityset.hh:23
│ │ │ │ -
Definition gridviewfunction.hh:22
│ │ │ │ - │ │ │ │ +
104 template<class Element>
│ │ │ │ +
105 const auto& find(const Element& element) const
│ │ │ │ +
106 {
│ │ │ │ +
107 return variants_[orientation_[elementMapper_.index(element)]];
│ │ │ │ +
108 }
│ │ │ │ +
109
│ │ │ │ +
110 private:
│ │ │ │ +
111 std::vector<FiniteElement> variants_;
│ │ │ │ +
112 const Dune::MultipleCodimMultipleGeomTypeMapper<GV> elementMapper_;
│ │ │ │ +
113 std::vector<unsigned short> orientation_;
│ │ │ │ +
114 };
│ │ │ │ +
115
│ │ │ │ +
116
│ │ │ │ +
117} // namespace Impl
│ │ │ │ +
118
│ │ │ │ +
119
│ │ │ │ +
120// *****************************************************************************
│ │ │ │ +
121// This is the reusable part of the basis. It contains
│ │ │ │ +
122//
│ │ │ │ +
123// NedelecPreBasis
│ │ │ │ +
124// NedelecNode
│ │ │ │ +
125//
│ │ │ │ +
126// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ │ +
127// state. These components do _not_ depend on the global basis and local view
│ │ │ │ +
128// and can be used without a global basis.
│ │ │ │ +
129// *****************************************************************************
│ │ │ │ +
130
│ │ │ │ +
131template<typename GV, typename Range, std::size_t kind, int order>
│ │ │ │ +
132class NedelecNode;
│ │ │ │ +
133
│ │ │ │ +
134template<typename GV, typename Range, std::size_t kind, int order>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
136{
│ │ │ │ +
137 static const int dim = GV::dimension;
│ │ │ │ +
138 static_assert(kind==1, "Only the Nedelec basis of the first kind is currently implemented!");
│ │ │ │ +
139 using FiniteElementMap = typename Impl::Nedelec1stKindLocalFiniteElementMap<GV, dim, Range, order>;
│ │ │ │ +
140
│ │ │ │ +
141 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper<GV>;
│ │ │ │ +
142public:
│ │ │ │ +
143
│ │ │ │ +
145 using GridView = GV;
│ │ │ │ +
146 using size_type = std::size_t;
│ │ │ │ +
147
│ │ │ │ + │ │ │ │ +
149
│ │ │ │ +
150 static constexpr size_type maxMultiIndexSize = 1;
│ │ │ │ +
151 static constexpr size_type minMultiIndexSize = 1;
│ │ │ │ +
152 static constexpr size_type multiIndexBufferSize = 1;
│ │ │ │ +
153
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
156 gridView_(gv),
│ │ │ │ + │ │ │ │ +
158 mapper_(gridView_, mcmgLayout(Dim<1>{}))
│ │ │ │ +
159 {
│ │ │ │ +
160 if (kind!=1)
│ │ │ │ +
161 DUNE_THROW(NotImplemented, "Only Nedelec elements of the first kind are implemented!");
│ │ │ │ +
162
│ │ │ │ +
163 // There is no inherent reason why the basis shouldn't work for grids with more than two
│ │ │ │ +
164 // element types. Somebody simply has to sit down and implement the missing bits.
│ │ │ │ +
165 if (gv.indexSet().types(0).size() > 2)
│ │ │ │ +
166 DUNE_THROW(NotImplemented, "Nédélec basis is only implemented for grids with simplex and cube elements");
│ │ │ │ +
167
│ │ │ │ +
168 for(auto type : gv.indexSet().types(0))
│ │ │ │ +
169 if (!type.isSimplex() && !type.isCube())
│ │ │ │ +
170 DUNE_THROW(NotImplemented, "Nédélec basis is only implemented for grids with simplex or cube elements.");
│ │ │ │ +
171
│ │ │ │ +
172 if (order>1)
│ │ │ │ +
173 DUNE_THROW(NotImplemented, "Only first-order elements are implemented");
│ │ │ │ +
174
│ │ │ │ +
175 if (dim!=2 && dim!=3)
│ │ │ │ +
176 DUNE_THROW(NotImplemented, "Only 2d and 3d Nédélec elements are implemented");
│ │ │ │ +
177 }
│ │ │ │ +
│ │ │ │ +
178
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
180 {}
│ │ │ │ +
│ │ │ │ +
181
│ │ │ │ +
│ │ │ │ +
184 const GridView& gridView() const
│ │ │ │ +
185 {
│ │ │ │ +
186 return gridView_;
│ │ │ │ +
187 }
│ │ │ │ +
│ │ │ │ +
188
│ │ │ │ +
189 /* \brief Update the stored grid view, to be called if the grid has changed */
│ │ │ │ +
│ │ │ │ +
190 void update (const GridView& gv)
│ │ │ │ +
191 {
│ │ │ │ +
192 gridView_ = gv;
│ │ │ │ +
193 mapper_.update(gridView_);
│ │ │ │ +
194 }
│ │ │ │ +
│ │ │ │ +
195
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
200 {
│ │ │ │ +
201 return Node{&finiteElementMap_};
│ │ │ │ +
202 }
│ │ │ │ +
│ │ │ │ +
203
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
205 {
│ │ │ │ +
206 return mapper_.size();
│ │ │ │ +
207 }
│ │ │ │ +
│ │ │ │ +
208
│ │ │ │ +
210 template<class SizePrefix>
│ │ │ │ +
│ │ │ │ +
211 size_type size(const SizePrefix& prefix) const
│ │ │ │ +
212 {
│ │ │ │ +
213 assert(prefix.size() == 0 || prefix.size() == 1);
│ │ │ │ +
214 return (prefix.size() == 0) ? size() : 0;
│ │ │ │ +
215 }
│ │ │ │ +
│ │ │ │ +
216
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
218 {
│ │ │ │ +
219 return size();
│ │ │ │ +
220 }
│ │ │ │ +
│ │ │ │ +
221
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
223 {
│ │ │ │ +
224 size_type result = 0;
│ │ │ │ +
225 for (auto&& type : gridView_.indexSet().types(0))
│ │ │ │ +
226 {
│ │ │ │ +
227 size_type numEdges = referenceElement<typename GV::ctype,dim>(type).size(dim-1);
│ │ │ │ +
228 result = std::max(result, numEdges);
│ │ │ │ +
229 }
│ │ │ │ +
230
│ │ │ │ +
231 return result;
│ │ │ │ +
232 }
│ │ │ │ +
│ │ │ │ +
233
│ │ │ │ +
237 template<typename It>
│ │ │ │ +
│ │ │ │ +
238 It indices(const Node& node, It it) const
│ │ │ │ +
239 {
│ │ │ │ +
240 const auto& element = node.element();
│ │ │ │ +
241
│ │ │ │ +
242 // throw if Element is not of predefined type
│ │ │ │ +
243 if (not(element.type().isCube()) and not(element.type().isSimplex()))
│ │ │ │ +
244 DUNE_THROW(NotImplemented, "NedelecBasis only implemented for cube and simplex elements.");
│ │ │ │ +
245
│ │ │ │ +
246 for(std::size_t i=0, end=node.size(); i<end; ++i, ++it)
│ │ │ │ +
247 {
│ │ │ │ +
248 Dune::LocalKey localKey = node.finiteElement().localCoefficients().localKey(i);
│ │ │ │ +
249 *it = { mapper_.subIndex(element, localKey.subEntity(), localKey.codim()) + localKey.index() };
│ │ │ │ +
250 }
│ │ │ │ +
251
│ │ │ │ +
252 return it;
│ │ │ │ +
253 }
│ │ │ │ +
│ │ │ │ +
254
│ │ │ │ +
255protected:
│ │ │ │ + │ │ │ │ +
257 FiniteElementMap finiteElementMap_;
│ │ │ │ +
258 Mapper mapper_;
│ │ │ │ +
259};
│ │ │ │ +
│ │ │ │ +
260
│ │ │ │ +
261
│ │ │ │ +
262
│ │ │ │ +
263template<typename GV, typename Range, size_t kind, int order>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
265 public LeafBasisNode
│ │ │ │ +
266{
│ │ │ │ +
267 static const int dim = GV::dimension;
│ │ │ │ +
268
│ │ │ │ +
269public:
│ │ │ │ +
270
│ │ │ │ +
271 using size_type = std::size_t;
│ │ │ │ +
272 using Element = typename GV::template Codim<0>::Entity;
│ │ │ │ +
273 static_assert(kind==1, "Only Nedelec elements of the first kind are implemented!");
│ │ │ │ +
274 using FiniteElementMap = typename Impl::Nedelec1stKindLocalFiniteElementMap<GV, dim, Range, order>;
│ │ │ │ +
275 using FiniteElement = Impl::GlobalValuedLocalFiniteElement<Impl::CovariantPiolaTransformator,
│ │ │ │ +
276 typename FiniteElementMap::FiniteElement,
│ │ │ │ +
277 Element>;
│ │ │ │ +
278
│ │ │ │ +
│ │ │ │ +
279 NedelecNode(const FiniteElementMap* finiteElementMap) :
│ │ │ │ +
280 element_(nullptr),
│ │ │ │ +
281 finiteElementMap_(finiteElementMap)
│ │ │ │ +
282 { }
│ │ │ │ +
│ │ │ │ +
283
│ │ │ │ +
│ │ │ │ +
285 const Element& element() const
│ │ │ │ +
286 {
│ │ │ │ +
287 return *element_;
│ │ │ │ +
288 }
│ │ │ │ +
│ │ │ │ +
289
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
295 {
│ │ │ │ +
296 return finiteElement_;
│ │ │ │ +
297 }
│ │ │ │ +
│ │ │ │ +
298
│ │ │ │ +
│ │ │ │ +
300 void bind(const Element& e)
│ │ │ │ +
301 {
│ │ │ │ +
302 element_ = &e;
│ │ │ │ +
303 finiteElement_.bind((finiteElementMap_->find(*element_)), e);
│ │ │ │ +
304 this->setSize(finiteElement_.size());
│ │ │ │ +
305 }
│ │ │ │ +
│ │ │ │ +
306
│ │ │ │ +
307protected:
│ │ │ │ +
308
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
312};
│ │ │ │ +
│ │ │ │ +
313
│ │ │ │ +
314
│ │ │ │ +
315
│ │ │ │ +
316namespace BasisFactory {
│ │ │ │ +
317
│ │ │ │ +
327template<std::size_t kind, std::size_t order, typename Range=double>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
329{
│ │ │ │ +
330 return [](const auto& gridView) {
│ │ │ │ +
331 return NedelecPreBasis<std::decay_t<decltype(gridView)>, Range, kind, order>(gridView);
│ │ │ │ +
332 };
│ │ │ │ +
333}
│ │ │ │ +
│ │ │ │ +
334
│ │ │ │ +
335} // end namespace BasisFactory
│ │ │ │ +
336
│ │ │ │ +
337
│ │ │ │ +
338
│ │ │ │ +
339// *****************************************************************************
│ │ │ │ +
340// This is the actual global basis implementation based on the reusable parts.
│ │ │ │ +
341// *****************************************************************************
│ │ │ │ +
342
│ │ │ │ +
350template<typename GV, std::size_t kind, std::size_t order, typename Range=double>
│ │ │ │ + │ │ │ │ +
352
│ │ │ │ +
353} // end namespace Dune::Functions
│ │ │ │ +
354
│ │ │ │ +
355
│ │ │ │ +
356#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
auto nedelec()
Create a pre-basis factory that can create a Nédélec pre-basis.
Definition nedelecbasis.hh:328
│ │ │ │ +
Definition polynomial.hh:11
│ │ │ │ +
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:46
│ │ │ │ +
Definition nedelecbasis.hh:266
│ │ │ │ +
const FiniteElementMap * finiteElementMap_
Definition nedelecbasis.hh:311
│ │ │ │ +
FiniteElement finiteElement_
Definition nedelecbasis.hh:309
│ │ │ │ +
Impl::GlobalValuedLocalFiniteElement< Impl::CovariantPiolaTransformator, typename FiniteElementMap::FiniteElement, Element > FiniteElement
Definition nedelecbasis.hh:277
│ │ │ │ +
void bind(const Element &e)
Bind to element.
Definition nedelecbasis.hh:300
│ │ │ │ +
const Element & element() const
Return current element, throw if unbound.
Definition nedelecbasis.hh:285
│ │ │ │ +
typename GV::template Codim< 0 >::Entity Element
Definition nedelecbasis.hh:272
│ │ │ │ +
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition nedelecbasis.hh:294
│ │ │ │ +
NedelecNode(const FiniteElementMap *finiteElementMap)
Definition nedelecbasis.hh:279
│ │ │ │ +
typename Impl::Nedelec1stKindLocalFiniteElementMap< GV, dim, Range, order > FiniteElementMap
Definition nedelecbasis.hh:274
│ │ │ │ +
const Element * element_
Definition nedelecbasis.hh:310
│ │ │ │ +
std::size_t size_type
Definition nedelecbasis.hh:271
│ │ │ │ +
Definition nedelecbasis.hh:136
│ │ │ │ +
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 nedelecbasis.hh:238
│ │ │ │ +
size_type size(const SizePrefix &prefix) const
Return number possible values for next position in multi index.
Definition nedelecbasis.hh:211
│ │ │ │ +
std::size_t size_type
Definition nedelecbasis.hh:146
│ │ │ │ +
NedelecPreBasis(const GridView &gv)
Constructor for a given grid view object.
Definition nedelecbasis.hh:155
│ │ │ │ +
GV GridView
The grid view that the FE space is defined on.
Definition nedelecbasis.hh:145
│ │ │ │ +
size_type dimension() const
Definition nedelecbasis.hh:217
│ │ │ │ +
static constexpr size_type maxMultiIndexSize
Definition nedelecbasis.hh:150
│ │ │ │ +
static constexpr size_type multiIndexBufferSize
Definition nedelecbasis.hh:152
│ │ │ │ +
GridView gridView_
Definition nedelecbasis.hh:256
│ │ │ │ +
FiniteElementMap finiteElementMap_
Definition nedelecbasis.hh:257
│ │ │ │ +
static constexpr size_type minMultiIndexSize
Definition nedelecbasis.hh:151
│ │ │ │ +
void initializeIndices()
Definition nedelecbasis.hh:179
│ │ │ │ +
void update(const GridView &gv)
Definition nedelecbasis.hh:190
│ │ │ │ +
size_type maxNodeSize() const
Definition nedelecbasis.hh:222
│ │ │ │ +
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition nedelecbasis.hh:184
│ │ │ │ +
Node makeNode() const
Create tree node.
Definition nedelecbasis.hh:199
│ │ │ │ +
size_type size() const
Definition nedelecbasis.hh:204
│ │ │ │ +
Mapper mapper_
Definition nedelecbasis.hh:258
│ │ │ │ +
size_type size() const
Definition nodes.hh:142
│ │ │ │ +
void setSize(const size_type size)
Definition nodes.hh:164
│ │ │ │ +
Definition nodes.hh:186
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── encoding │ │ │ │ │ @@ -1 +1 @@ │ │ │ │ │ -us-ascii │ │ │ │ │ +utf-8 │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,107 +1,496 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _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 │ │ │ │ │ -gridviewfunction.hh │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7 │ │ │ │ │ -8#include │ │ │ │ │ -9 │ │ │ │ │ -10#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> │ │ │ │ │ -11#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> │ │ │ │ │ -12#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> │ │ │ │ │ -13 │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ +8 │ │ │ │ │ +9#include │ │ │ │ │ +10#include │ │ │ │ │ +11 │ │ │ │ │ +12#include │ │ │ │ │ +13#include │ │ │ │ │ 14 │ │ │ │ │ -15namespace _D_u_n_e { │ │ │ │ │ -16namespace Functions { │ │ │ │ │ -17 │ │ │ │ │ +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_/_d_e_f_a_u_l_t_g_l_o_b_a_l_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_/ │ │ │ │ │ +_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> │ │ │ │ │ +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_/_n_o_d_e_s_._h_h> │ │ │ │ │ 18 │ │ │ │ │ -19 │ │ │ │ │ -20template class │ │ │ │ │ -DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56> │ │ │ │ │ -_2_1class _G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ │ -22{}; │ │ │ │ │ -23 │ │ │ │ │ -24 │ │ │ │ │ -25 │ │ │ │ │ -40template class │ │ │ │ │ -DerivativeTraits, size_t bufferSize> │ │ │ │ │ -_4_1class _G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n : │ │ │ │ │ -42 public _G_r_i_d_F_u_n_c_t_i_o_n, │ │ │ │ │ -DerivativeTraits, bufferSize> │ │ │ │ │ -43{ │ │ │ │ │ -44 using _B_a_s_e = _G_r_i_d_F_u_n_c_t_i_o_n, │ │ │ │ │ -DerivativeTraits, bufferSize>; │ │ │ │ │ -45public: │ │ │ │ │ -_4_6 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ │ -47 │ │ │ │ │ -48 using Base::Base; │ │ │ │ │ -49}; │ │ │ │ │ -50 │ │ │ │ │ -51 │ │ │ │ │ +19namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ │ +20{ │ │ │ │ │ +21 │ │ │ │ │ +22namespace Impl │ │ │ │ │ +23{ │ │ │ │ │ +24 template │ │ │ │ │ +25 class Nedelec1stKindLocalFiniteElementMap │ │ │ │ │ +26 { │ │ │ │ │ +27 using D = typename GV::ctype; │ │ │ │ │ +28 constexpr static bool hasFixedElementType = Capabilities:: │ │ │ │ │ +hasSingleGeometryType::v; │ │ │ │ │ +29 │ │ │ │ │ +30 using CubeFiniteElement = │ │ │ │ │ +Nedelec1stKindCubeLocalFiniteElement; │ │ │ │ │ +31 using SimplexFiniteElement = │ │ │ │ │ +Nedelec1stKindSimplexLocalFiniteElement; │ │ │ │ │ +32 │ │ │ │ │ +33 public: │ │ │ │ │ +34 │ │ │ │ │ +35 using T = LocalBasisTraits, R, dim, │ │ │ │ │ +FieldVector, FieldMatrix >; │ │ │ │ │ +36 │ │ │ │ │ +37 constexpr static unsigned int topologyId = Capabilities:: │ │ │ │ │ +hasSingleGeometryType::topologyId; // meaningless if │ │ │ │ │ +hasFixedElementType is false │ │ │ │ │ +38 constexpr static GeometryType type = GeometryType(topologyId, GV:: │ │ │ │ │ +dimension); │ │ │ │ │ +39 │ │ │ │ │ +40 using FiniteElement = std::conditional_t, │ │ │ │ │ +42 LocalFiniteElementVariant >; │ │ │ │ │ +43 │ │ │ │ │ +44 static std::size_t numVariants(GeometryType type) │ │ │ │ │ +45 { │ │ │ │ │ +46 if (order!=1) // I am not sure whether the formula below is correct for all │ │ │ │ │ +orders. │ │ │ │ │ +47 DUNE_THROW(NotImplemented, "Only Nedelec elements of order 1 are │ │ │ │ │ +implemented!"); │ │ │ │ │ +48 │ │ │ │ │ +49 auto numEdges = referenceElement(type).size(dim-1); │ │ │ │ │ +50 return power(2,numEdges); │ │ │ │ │ +51 } │ │ │ │ │ 52 │ │ │ │ │ -64template() , int>::type = 0> │ │ │ │ │ -67typename std::decay::type │ │ │ │ │ -_6_8 _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) │ │ │ │ │ -69{ │ │ │ │ │ -70 return std::forward(f); │ │ │ │ │ -71} │ │ │ │ │ -72 │ │ │ │ │ +53 Nedelec1stKindLocalFiniteElementMap(const GV& gv) │ │ │ │ │ +54 : elementMapper_(gv, mcmgElementLayout()), │ │ │ │ │ +55 orientation_(gv.size(0)) │ │ │ │ │ +56 { │ │ │ │ │ +57 // create all variants │ │ │ │ │ +58 if constexpr (hasFixedElementType) │ │ │ │ │ +59 { │ │ │ │ │ +60 variants_.resize(numVariants(type)); │ │ │ │ │ +61 for (size_t i = 0; i < numVariants(type); i++) │ │ │ │ │ +62 variants_[i] = FiniteElement(i); │ │ │ │ │ +63 } │ │ │ │ │ +64 else │ │ │ │ │ +65 { │ │ │ │ │ +66 // for mixed grids add offset for cubes │ │ │ │ │ +67 variants_.resize(numVariants(GeometryTypes::simplex(dim)) + numVariants │ │ │ │ │ +(GeometryTypes::cube(dim))); │ │ │ │ │ +68 for (size_t i = 0; i < numVariants(GeometryTypes::simplex(dim)); i++) │ │ │ │ │ +69 variants_[i] = SimplexFiniteElement(i); │ │ │ │ │ +70 for (size_t i = 0; i < numVariants(GeometryTypes::cube(dim)); i++) │ │ │ │ │ +71 variants_[i + numVariants(GeometryTypes::simplex(dim))] = CubeFiniteElement │ │ │ │ │ +(i); │ │ │ │ │ +72 } │ │ │ │ │ 73 │ │ │ │ │ 74 │ │ │ │ │ -90template()) , int>::type = 0> │ │ │ │ │ -_9_3auto _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) │ │ │ │ │ -94 -> 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)) │ │ │ │ │ -95{ │ │ │ │ │ -96 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); │ │ │ │ │ -97} │ │ │ │ │ -98 │ │ │ │ │ -99 │ │ │ │ │ -100 │ │ │ │ │ -101} // end of namespace Dune::Functions │ │ │ │ │ -102} // end of namespace Dune │ │ │ │ │ +75 // compute orientation for all elements │ │ │ │ │ +76 const auto& indexSet = gv.indexSet(); │ │ │ │ │ +77 │ │ │ │ │ +78 for(const auto& element : elements(gv)) │ │ │ │ │ +79 { │ │ │ │ │ +80 const auto& refElement = referenceElement(element); │ │ │ │ │ +81 auto elementIndex = elementMapper_.index(element); │ │ │ │ │ +82 orientation_[elementIndex] = 0; │ │ │ │ │ +83 │ │ │ │ │ +84 for (std::size_t i=0; iglobalV1) || (localV0>localV1 && │ │ │ │ │ +globalV0::Geometry::GlobalCoordinate >::type(typename GridView:: │ │ │ │ │ -template Codim< 0 >::Geometry::GlobalCoordinate), GridView, typename std:: │ │ │ │ │ -decay< F >::type > makeAnalyticGridViewFunction(F &&f, const GridView │ │ │ │ │ -&gridView) │ │ │ │ │ -Create an AnalyticGridViewFunction from a function and a grid view. │ │ │ │ │ -DDeeffiinniittiioonn analyticgridviewfunction.hh:230 │ │ │ │ │ -_D_u_n_e │ │ │ │ │ -DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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< F >::type makeGridViewFunction(F &&f, const GridView &gridView) │ │ │ │ │ -Construct a function modeling GridViewFunction from function and grid view. │ │ │ │ │ -DDeeffiinniittiioonn gridviewfunction.hh:68 │ │ │ │ │ -_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: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 │ │ │ │ │ -An entity set for all entities of given codim in a grid view. │ │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:23 │ │ │ │ │ -_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:22 │ │ │ │ │ -_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 │ │ │ │ │ +104 template │ │ │ │ │ +105 const auto& find(const Element& element) const │ │ │ │ │ +106 { │ │ │ │ │ +107 return variants_[orientation_[elementMapper_.index(element)]]; │ │ │ │ │ +108 } │ │ │ │ │ +109 │ │ │ │ │ +110 private: │ │ │ │ │ +111 std::vector variants_; │ │ │ │ │ +112 const Dune::MultipleCodimMultipleGeomTypeMapper elementMapper_; │ │ │ │ │ +113 std::vector orientation_; │ │ │ │ │ +114 }; │ │ │ │ │ +115 │ │ │ │ │ +116 │ │ │ │ │ +117} // namespace Impl │ │ │ │ │ +118 │ │ │ │ │ +119 │ │ │ │ │ +120/ │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +121// This is the reusable part of the basis. It contains │ │ │ │ │ +122// │ │ │ │ │ +123// NedelecPreBasis │ │ │ │ │ +124// NedelecNode │ │ │ │ │ +125// │ │ │ │ │ +126// The pre-basis allows to create the others and is the owner of possible │ │ │ │ │ +shared │ │ │ │ │ +127// state. These components do _not_ depend on the global basis and local │ │ │ │ │ +view │ │ │ │ │ +128// and can be used without a global basis. │ │ │ │ │ +129/ │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +130 │ │ │ │ │ +131template │ │ │ │ │ +132class NedelecNode; │ │ │ │ │ +133 │ │ │ │ │ +134template │ │ │ │ │ +_1_3_5class _N_e_d_e_l_e_c_P_r_e_B_a_s_i_s │ │ │ │ │ +136{ │ │ │ │ │ +137 static const int dim = GV::dimension; │ │ │ │ │ +138 static_assert(kind==1, "Only the Nedelec basis of the first kind is │ │ │ │ │ +currently implemented!"); │ │ │ │ │ +139 using FiniteElementMap = typename Impl:: │ │ │ │ │ +Nedelec1stKindLocalFiniteElementMap; │ │ │ │ │ +140 │ │ │ │ │ +141 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper; │ │ │ │ │ +142public: │ │ │ │ │ +143 │ │ │ │ │ +_1_4_5 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ │ +_1_4_6 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ +147 │ │ │ │ │ +_1_4_8 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_>; │ │ │ │ │ +149 │ │ │ │ │ +_1_5_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 = 1; │ │ │ │ │ +_1_5_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 = 1; │ │ │ │ │ +_1_5_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 = 1; │ │ │ │ │ +153 │ │ │ │ │ +_1_5_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) : │ │ │ │ │ +156 _g_r_i_d_V_i_e_w__(gv), │ │ │ │ │ +157 _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__(gv), │ │ │ │ │ +158 _m_a_p_p_e_r__(_g_r_i_d_V_i_e_w__, mcmgLayout(Dim<1>{})) │ │ │ │ │ +159 { │ │ │ │ │ +160 if (kind!=1) │ │ │ │ │ +161 DUNE_THROW(NotImplemented, "Only Nedelec elements of the first kind are │ │ │ │ │ +implemented!"); │ │ │ │ │ +162 │ │ │ │ │ +163 // There is no inherent reason why the basis shouldn't work for grids with │ │ │ │ │ +more than two │ │ │ │ │ +164 // element types. Somebody simply has to sit down and implement the missing │ │ │ │ │ +bits. │ │ │ │ │ +165 if (gv.indexSet().types(0).size() > 2) │ │ │ │ │ +166 DUNE_THROW(NotImplemented, "Nédélec basis is only implemented for grids │ │ │ │ │ +with simplex and cube elements"); │ │ │ │ │ +167 │ │ │ │ │ +168 for(auto type : gv.indexSet().types(0)) │ │ │ │ │ +169 if (!type.isSimplex() && !type.isCube()) │ │ │ │ │ +170 DUNE_THROW(NotImplemented, "Nédélec basis is only implemented for grids │ │ │ │ │ +with simplex or cube elements."); │ │ │ │ │ +171 │ │ │ │ │ +172 if (order>1) │ │ │ │ │ +173 DUNE_THROW(NotImplemented, "Only first-order elements are implemented"); │ │ │ │ │ +174 │ │ │ │ │ +175 if (dim!=2 && dim!=3) │ │ │ │ │ +176 DUNE_THROW(NotImplemented, "Only 2d and 3d Nédélec elements are │ │ │ │ │ +implemented"); │ │ │ │ │ +177 } │ │ │ │ │ +178 │ │ │ │ │ +_1_7_9 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ │ +180 {} │ │ │ │ │ +181 │ │ │ │ │ +_1_8_4 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ │ +185 { │ │ │ │ │ +186 return _g_r_i_d_V_i_e_w__; │ │ │ │ │ +187 } │ │ │ │ │ +188 │ │ │ │ │ +189 /* \brief Update the stored grid view, to be called if the grid has changed │ │ │ │ │ +*/ │ │ │ │ │ +_1_9_0 void _u_p_d_a_t_e (const _G_r_i_d_V_i_e_w& gv) │ │ │ │ │ +191 { │ │ │ │ │ +192 _g_r_i_d_V_i_e_w__ = gv; │ │ │ │ │ +193 _m_a_p_p_e_r__.update(_g_r_i_d_V_i_e_w__); │ │ │ │ │ +194 } │ │ │ │ │ +195 │ │ │ │ │ +_1_9_9 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ │ +200 { │ │ │ │ │ +201 return _N_o_d_e{&_f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__}; │ │ │ │ │ +202 } │ │ │ │ │ +203 │ │ │ │ │ +_2_0_4 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ │ +205 { │ │ │ │ │ +206 return _m_a_p_p_e_r__.size(); │ │ │ │ │ +207 } │ │ │ │ │ +208 │ │ │ │ │ +210 template │ │ │ │ │ +_2_1_1 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix) const │ │ │ │ │ +212 { │ │ │ │ │ +213 assert(prefix.size() == 0 || prefix.size() == 1); │ │ │ │ │ +214 return (prefix.size() == 0) ? _s_i_z_e() : 0; │ │ │ │ │ +215 } │ │ │ │ │ +216 │ │ │ │ │ +_2_1_7 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ │ +218 { │ │ │ │ │ +219 return _s_i_z_e(); │ │ │ │ │ +220 } │ │ │ │ │ +221 │ │ │ │ │ +_2_2_2 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ │ +223 { │ │ │ │ │ +224 _s_i_z_e___t_y_p_e result = 0; │ │ │ │ │ +225 for (auto&& type : _g_r_i_d_V_i_e_w__.indexSet().types(0)) │ │ │ │ │ +226 { │ │ │ │ │ +227 _s_i_z_e___t_y_p_e numEdges = referenceElement(type).size │ │ │ │ │ +(dim-1); │ │ │ │ │ +228 result = std::max(result, numEdges); │ │ │ │ │ +229 } │ │ │ │ │ +230 │ │ │ │ │ +231 return result; │ │ │ │ │ +232 } │ │ │ │ │ +233 │ │ │ │ │ +237 template │ │ │ │ │ +_2_3_8 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ │ +239 { │ │ │ │ │ +240 const auto& element = node._e_l_e_m_e_n_t(); │ │ │ │ │ +241 │ │ │ │ │ +242 // throw if Element is not of predefined type │ │ │ │ │ +243 if (not(element.type().isCube()) and not(element.type().isSimplex())) │ │ │ │ │ +244 DUNE_THROW(NotImplemented, "NedelecBasis only implemented for cube and │ │ │ │ │ +simplex elements."); │ │ │ │ │ +245 │ │ │ │ │ +246 for(std::size_t i=0, end=node._s_i_z_e(); i │ │ │ │ │ +_2_6_4class _N_e_d_e_l_e_c_N_o_d_e : │ │ │ │ │ +265 public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ │ +266{ │ │ │ │ │ +267 static const int dim = GV::dimension; │ │ │ │ │ +268 │ │ │ │ │ +269public: │ │ │ │ │ +270 │ │ │ │ │ +_2_7_1 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ +_2_7_2 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ │ +273 static_assert(kind==1, "Only Nedelec elements of the first kind are │ │ │ │ │ +implemented!"); │ │ │ │ │ +_2_7_4 using _F_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p = typename Impl:: │ │ │ │ │ +Nedelec1stKindLocalFiniteElementMap; │ │ │ │ │ +_2_7_5 using _F_i_n_i_t_e_E_l_e_m_e_n_t = Impl::GlobalValuedLocalFiniteElement; │ │ │ │ │ +278 │ │ │ │ │ +_2_7_9 _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) : │ │ │ │ │ +280 _e_l_e_m_e_n_t__(nullptr), │ │ │ │ │ +281 _f_i_n_i_t_e_E_l_e_m_e_n_t_M_a_p__(finiteElementMap) │ │ │ │ │ +282 { } │ │ │ │ │ +283 │ │ │ │ │ +_2_8_5 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ │ +286 { │ │ │ │ │ +287 return *_e_l_e_m_e_n_t__; │ │ │ │ │ +288 } │ │ │ │ │ +289 │ │ │ │ │ +_2_9_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 │ │ │ │ │ +295 { │ │ │ │ │ +296 return _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ │ +297 } │ │ │ │ │ +298 │ │ │ │ │ +_3_0_0 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ │ +301 { │ │ │ │ │ +302 _e_l_e_m_e_n_t__ = &e; │ │ │ │ │ +303 _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); │ │ │ │ │ +304 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__.size()); │ │ │ │ │ +305 } │ │ │ │ │ +306 │ │ │ │ │ +307protected: │ │ │ │ │ +308 │ │ │ │ │ +_3_0_9 _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_1_0 const _E_l_e_m_e_n_t* _e_l_e_m_e_n_t__; │ │ │ │ │ +_3_1_1 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__; │ │ │ │ │ +312}; │ │ │ │ │ +313 │ │ │ │ │ +314 │ │ │ │ │ +315 │ │ │ │ │ +316namespace BasisFactory { │ │ │ │ │ +317 │ │ │ │ │ +327template │ │ │ │ │ +_3_2_8auto _n_e_d_e_l_e_c() │ │ │ │ │ +329{ │ │ │ │ │ +330 return [](const auto& gridView) { │ │ │ │ │ +331 return _N_e_d_e_l_e_c_P_r_e_B_a_s_i_s, Range, kind, │ │ │ │ │ +order>(gridView); │ │ │ │ │ +332 }; │ │ │ │ │ +333} │ │ │ │ │ +334 │ │ │ │ │ +335} // end namespace BasisFactory │ │ │ │ │ +336 │ │ │ │ │ +337 │ │ │ │ │ +338 │ │ │ │ │ +339/ │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +340// This is the actual global basis implementation based on the reusable │ │ │ │ │ +parts. │ │ │ │ │ +341/ │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +342 │ │ │ │ │ +350template │ │ │ │ │ +_3_5_1using _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_ _> >; │ │ │ │ │ +352 │ │ │ │ │ +353} // end namespace Dune::Functions │ │ │ │ │ +354 │ │ │ │ │ +355 │ │ │ │ │ +356#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 │ │ │ │ │ +_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:328 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ │ +DDeeffiinniittiioonn polynomial.hh:11 │ │ │ │ │ +_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:46 │ │ │ │ │ +_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:266 │ │ │ │ │ +_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:311 │ │ │ │ │ +_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:309 │ │ │ │ │ +_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:277 │ │ │ │ │ +_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:300 │ │ │ │ │ +_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:285 │ │ │ │ │ +_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:272 │ │ │ │ │ +_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:294 │ │ │ │ │ +_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:279 │ │ │ │ │ +_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:274 │ │ │ │ │ +_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:310 │ │ │ │ │ +_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:271 │ │ │ │ │ +_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:136 │ │ │ │ │ +_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_:_:_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 nedelecbasis.hh:238 │ │ │ │ │ +_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 │ │ │ │ │ +size_type size(const SizePrefix &prefix) const │ │ │ │ │ +Return number possible values for next position in multi index. │ │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:211 │ │ │ │ │ +_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:146 │ │ │ │ │ +_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:155 │ │ │ │ │ +_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 │ │ │ │ │ -DDeeffiinniittiioonn gridviewfunction.hh:46 │ │ │ │ │ +The grid view that the FE space is defined on. │ │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:145 │ │ │ │ │ +_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_:_:_d_i_m_e_n_s_i_o_n │ │ │ │ │ +size_type dimension() const │ │ │ │ │ +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_:_:_m_a_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ +static constexpr size_type maxMultiIndexSize │ │ │ │ │ +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_:_:_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 nedelecbasis.hh:152 │ │ │ │ │ +_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__ │ │ │ │ │ +GridView gridView_ │ │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:256 │ │ │ │ │ +_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:257 │ │ │ │ │ +_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_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ +static constexpr size_type minMultiIndexSize │ │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:151 │ │ │ │ │ +_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_:_:_i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ │ +void initializeIndices() │ │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:179 │ │ │ │ │ +_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) │ │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:190 │ │ │ │ │ +_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_x_N_o_d_e_S_i_z_e │ │ │ │ │ +size_type maxNodeSize() const │ │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:222 │ │ │ │ │ +_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 │ │ │ │ │ +const GridView & gridView() const │ │ │ │ │ +Obtain the grid view that the basis is defined on. │ │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:184 │ │ │ │ │ +_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:199 │ │ │ │ │ +_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 │ │ │ │ │ +size_type size() const │ │ │ │ │ +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_:_:_m_a_p_p_e_r__ │ │ │ │ │ +Mapper mapper_ │ │ │ │ │ +DDeeffiinniittiioonn nedelecbasis.hh:258 │ │ │ │ │ +_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 │ │ │ │ │ +DDeeffiinniittiioonn nodes.hh:142 │ │ │ │ │ +_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:164 │ │ │ │ │ +_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:186 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00170.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: analyticgridviewfunction.hh File Reference │ │ │ │ +dune-functions: rannacherturekbasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,56 +65,66 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces | │ │ │ │ +Typedefs | │ │ │ │ Functions
│ │ │ │ -
analyticgridviewfunction.hh File Reference
│ │ │ │ +
rannacherturekbasis.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <type_traits>
│ │ │ │ -#include <optional>
│ │ │ │ -#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/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>
│ │ │ │
│ │ │ │

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::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 F , class GridView >
AnalyticGridViewFunction< typename std::invoke_result< F, typename GridView::template Codim< 0 >::Geometry::GlobalCoordinate >::type(typename GridView::template Codim< 0 >::Geometry::GlobalCoordinate), GridView, typename std::decay< F >::type > Dune::Functions::makeAnalyticGridViewFunction (F &&f, const GridView &gridView)
 Create an AnalyticGridViewFunction from a function and a grid view.
 
template<class Dummy = void>
auto Dune::Functions::BasisFactory::rannacherTurek ()
 Create a pre-basis factory that can create a Rannacher-Turek pre-basis.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,44 +1,43 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _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_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -analyticgridviewfunction.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_/_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> │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +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> │ │ │ │ │ _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_:_:_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< GV > > │ │ │ │ │ +  Rannacher-Turek basis. │ │ │ │ │ +  │ │ │ │ │ FFuunnccttiioonnss │ │ │ │ │ -template │ │ │ │ │ - _A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n< typename │ │ │ │ │ - std::invoke_result< F, typename │ │ │ │ │ - GridView::template Codim< 0 >:: │ │ │ │ │ - Geometry::GlobalCoordinate >::type │ │ │ │ │ -(typename GridView::template Codim< 0 │ │ │ │ │ - >::Geometry::GlobalCoordinate), _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_: │ │ │ │ │ - GridView, typename std::decay< F >:: _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, │ │ │ │ │ - type >  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. │ │ │ │ │ +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. │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00170_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: analyticgridviewfunction.hh Source File │ │ │ │ +dune-functions: rannacherturekbasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,253 +70,289 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
analyticgridviewfunction.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#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH
│ │ │ │
5
│ │ │ │ -
6#include <type_traits>
│ │ │ │ -
7#include <optional>
│ │ │ │ -
8
│ │ │ │ -
9#include <dune/common/typeutilities.hh>
│ │ │ │ -
10
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ +
6#include <dune/common/exceptions.hh>
│ │ │ │ +
7
│ │ │ │ +
8#include <dune/grid/common/capabilities.hh>
│ │ │ │ +
9
│ │ │ │ +
10#include <dune/localfunctions/common/localfiniteelementvariant.hh>
│ │ │ │ +
11#include <dune/localfunctions/rannacherturek.hh>
│ │ │ │ +
12#include <dune/localfunctions/crouzeixraviart.hh>
│ │ │ │ +
13
│ │ │ │ + │ │ │ │ + │ │ │ │ +
16
│ │ │ │
17
│ │ │ │ -
18
│ │ │ │ -
19namespace Dune {
│ │ │ │ -
20namespace Functions {
│ │ │ │ -
21
│ │ │ │ -
22namespace Imp {
│ │ │ │ -
23
│ │ │ │ -
24template<class Signature, class GV, class FLocal, template<class> class DerivativeTraits=DefaultDerivativeTraits>
│ │ │ │ -
25class LocalAnalyticGridViewFunction;
│ │ │ │ -
26
│ │ │ │ -
27template<class Range, class LocalDomain, class GV, class F, template<class> class DerivativeTraits>
│ │ │ │ -
28class LocalAnalyticGridViewFunction<Range(LocalDomain), GV, F, DerivativeTraits>
│ │ │ │ -
29{
│ │ │ │ -
30public:
│ │ │ │ -
31 using Signature = Range(LocalDomain);
│ │ │ │ -
32 using RawSignature = typename SignatureTraits<Signature>::RawSignature;
│ │ │ │ -
33 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(LocalDomain);
│ │ │ │ +
18namespace Dune {
│ │ │ │ +
19namespace Functions {
│ │ │ │ +
20
│ │ │ │ +
21// *****************************************************************************
│ │ │ │ +
22// This is the reusable part of the basis. It contains
│ │ │ │ +
23//
│ │ │ │ +
24// RannacherTurekPreBasis
│ │ │ │ +
25// RannacherTurekNode
│ │ │ │ +
26//
│ │ │ │ +
27// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ │ +
28// state. These components do _not_ depend on the global basis and local view
│ │ │ │ +
29// and can be used without a global basis.
│ │ │ │ +
30// *****************************************************************************
│ │ │ │ +
31
│ │ │ │ +
32template<typename GV>
│ │ │ │ +
33class RannacherTurekNode;
│ │ │ │
34
│ │ │ │ -
35 using GridView = GV;
│ │ │ │ -
36 using EntitySet = GridViewEntitySet<GridView, 0>;
│ │ │ │ -
37 using Element = typename EntitySet::Element;
│ │ │ │ -
38// using Geometry = typename Element::Geometry;
│ │ │ │ -
39 using Geometry = typename std::decay<typename Element::Geometry>::type;
│ │ │ │ -
40
│ │ │ │ -
41 // Use the indirection via derivativeIfImplemented to also support
│ │ │ │ -
42 // function types F that do not implement derivative. In this case
│ │ │ │ -
43 // the interface type DifferentiableFunction is using a dummy for
│ │ │ │ -
44 // the derivative type
│ │ │ │ -
45 using DerivativeDummy = DifferentiableFunction<DerivativeSignature>;
│ │ │ │ -
46 using GlobalRawDerivative = decltype(Imp::derivativeIfImplemented<DerivativeDummy, F>(std::declval<F>()));
│ │ │ │ -
47 using LocalDerivative = LocalAnalyticGridViewFunction<DerivativeSignature, GridView, GlobalRawDerivative, DerivativeTraits>;
│ │ │ │ -
48
│ │ │ │ -
50 template<class FT, disableCopyMove<LocalAnalyticGridViewFunction, FT> = 0>
│ │ │ │ -
51 LocalAnalyticGridViewFunction(FT&& f) :
│ │ │ │ -
52 f_(std::forward<FT>(f))
│ │ │ │ -
53 {}
│ │ │ │ +
35template<typename GV>
│ │ │ │ +
36class RannacherTurekPreBasis;
│ │ │ │ +
37
│ │ │ │ +
50template<typename GV>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
52{
│ │ │ │ +
53 static const int dim = GV::dimension;
│ │ │ │
54
│ │ │ │ -
56 template<class FT>
│ │ │ │ -
57 LocalAnalyticGridViewFunction(FT&& f, const Element& element, const std::optional<Geometry>& geometry) :
│ │ │ │ -
58 f_(std::forward<FT>(f)),
│ │ │ │ -
59 element_(element),
│ │ │ │ -
60 geometry_(geometry)
│ │ │ │ -
61 {}
│ │ │ │ +
55public:
│ │ │ │ +
56
│ │ │ │ +
58 using GridView = GV;
│ │ │ │ +
59
│ │ │ │ +
61 using size_type = std::size_t;
│ │ │ │
62
│ │ │ │ -
63
│ │ │ │ -
72 void bind(const Element& element)
│ │ │ │ + │ │ │ │ +
65
│ │ │ │ +
66 static constexpr size_type maxMultiIndexSize = 1;
│ │ │ │ +
67 static constexpr size_type minMultiIndexSize = 1;
│ │ │ │ +
68 static constexpr size_type multiIndexBufferSize = 1;
│ │ │ │ +
69
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
72 gridView_(gv)
│ │ │ │
73 {
│ │ │ │ -
74 element_ = element;
│ │ │ │ -
75 geometry_.emplace(element_.geometry());
│ │ │ │ -
76 }
│ │ │ │ -
77
│ │ │ │ -
79 void unbind()
│ │ │ │ -
80 {
│ │ │ │ -
81 geometry_.reset();
│ │ │ │ -
82 }
│ │ │ │ -
83
│ │ │ │ -
86 bool bound() const
│ │ │ │ -
87 {
│ │ │ │ -
88 return static_cast<bool>(geometry_);
│ │ │ │ -
89 }
│ │ │ │ -
90
│ │ │ │ -
100 Range operator()(const LocalDomain& x) const
│ │ │ │ -
101 {
│ │ │ │ -
102 assert(!!geometry_);
│ │ │ │ -
103 return f_(geometry_->global(x));
│ │ │ │ -
104 }
│ │ │ │ -
105
│ │ │ │ -
107 const Element& localContext() const
│ │ │ │ -
108 {
│ │ │ │ -
109 assert(!!geometry_);
│ │ │ │ -
110 return element_;
│ │ │ │ -
111 }
│ │ │ │ -
112
│ │ │ │ -
121 friend LocalDerivative derivative(const LocalAnalyticGridViewFunction& t)
│ │ │ │ -
122 {
│ │ │ │ -
123 return LocalDerivative(Imp::derivativeIfImplemented<DerivativeDummy, F>(t.f_), t.element_, t.geometry_);
│ │ │ │ -
124 }
│ │ │ │ -
125
│ │ │ │ -
126private:
│ │ │ │ -
127 F f_;
│ │ │ │ -
128 Element element_;
│ │ │ │ -
129 std::optional<Geometry> geometry_ = std::nullopt;
│ │ │ │ -
130};
│ │ │ │ -
131
│ │ │ │ -
132} // end namespace Imp
│ │ │ │ -
133
│ │ │ │ -
134
│ │ │ │ -
135
│ │ │ │ -
136
│ │ │ │ -
137template<class Signature, class GV, class F, template<class> class DerivativeTraits=DefaultDerivativeTraits>
│ │ │ │ - │ │ │ │ -
139
│ │ │ │ -
140
│ │ │ │ -
146template<class Range, class Domain, class GV, class F, template<class> class DerivativeTraits>
│ │ │ │ -
│ │ │ │ -
147class AnalyticGridViewFunction<Range(Domain), GV, F, DerivativeTraits>
│ │ │ │ -
148{
│ │ │ │ -
149public:
│ │ │ │ -
150 using Signature = Range(Domain);
│ │ │ │ - │ │ │ │ -
152 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(Domain);
│ │ │ │ -
153
│ │ │ │ -
154 using GridView = GV;
│ │ │ │ - │ │ │ │ -
156 using Element = typename EntitySet::Element;
│ │ │ │ -
157 using Geometry = typename Element::Geometry;
│ │ │ │ -
158
│ │ │ │ -
159 // Use the indirection via derivativeIfImplemented to also support
│ │ │ │ -
160 // function types F that do not implement derivative. In this case
│ │ │ │ -
161 // the interface type DifferentiableFunction is used a dummy for
│ │ │ │ -
162 // the derivative type
│ │ │ │ - │ │ │ │ -
164 using GlobalRawDerivative = decltype(Imp::derivativeIfImplemented<DerivativeDummy, F>(std::declval<F>()));
│ │ │ │ - │ │ │ │ -
166
│ │ │ │ - │ │ │ │ -
168 using LocalFunction = typename Imp::LocalAnalyticGridViewFunction<Range(LocalDomain), GridView, F, LocalDerivativeTraits<EntitySet, DerivativeTraits>::template Traits>;
│ │ │ │ -
169
│ │ │ │ -
171 template<class FT>
│ │ │ │ +
74 for(auto type : gv.indexSet().types(0))
│ │ │ │ +
75 if (!type.isSimplex() && !type.isCube())
│ │ │ │ +
76 DUNE_THROW(Dune::NotImplemented, "Rannacher-Turek or Crouzeix-Raviart elements are only implemented for grids with simplex or cube elements.");
│ │ │ │ +
77 }
│ │ │ │ +
│ │ │ │ +
78
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
81 {}
│ │ │ │ +
│ │ │ │ +
82
│ │ │ │ +
│ │ │ │ +
84 const GridView& gridView() const
│ │ │ │ +
85 {
│ │ │ │ +
86 return gridView_;
│ │ │ │ +
87 }
│ │ │ │ +
│ │ │ │ +
88
│ │ │ │ +
│ │ │ │ +
90 void update (const GridView& gv)
│ │ │ │ +
91 {
│ │ │ │ +
92 gridView_ = gv;
│ │ │ │ +
93 }
│ │ │ │ +
│ │ │ │ +
94
│ │ │ │ +
│ │ │ │ +
98 Node makeNode() const
│ │ │ │ +
99 {
│ │ │ │ +
100 return Node{};
│ │ │ │ +
101 }
│ │ │ │ +
│ │ │ │ +
102
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
105 {
│ │ │ │ +
106 return (size_type)(gridView_.size(1));
│ │ │ │ +
107 }
│ │ │ │ +
│ │ │ │ +
108
│ │ │ │ +
110 template<class SizePrefix>
│ │ │ │ +
│ │ │ │ +
111 size_type size(const SizePrefix prefix) const
│ │ │ │ +
112 {
│ │ │ │ +
113 assert(prefix.size() == 0 || prefix.size() == 1);
│ │ │ │ +
114 return (prefix.size() == 0) ? size() : 0;
│ │ │ │ +
115 }
│ │ │ │ +
│ │ │ │ +
116
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
119 {
│ │ │ │ +
120 return size();
│ │ │ │ +
121 }
│ │ │ │ +
│ │ │ │ +
122
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
125 {
│ │ │ │ +
126 return 2*GV::dimension;
│ │ │ │ +
127 }
│ │ │ │ +
│ │ │ │ +
128
│ │ │ │ +
129 template<typename It>
│ │ │ │ +
│ │ │ │ +
130 It indices(const Node& node, It it) const
│ │ │ │ +
131 {
│ │ │ │ +
132 for (size_type i = 0, end = node.size() ; i < end ; ++i, ++it)
│ │ │ │ +
133 {
│ │ │ │ +
134 Dune::LocalKey localKey = node.finiteElement().localCoefficients().localKey(i);
│ │ │ │ +
135 const auto& gridIndexSet = gridView().indexSet();
│ │ │ │ +
136 const auto& element = node.element();
│ │ │ │ +
137
│ │ │ │ +
138 *it = {{ (size_type)(gridIndexSet.subIndex(element,localKey.subEntity(),1)) }};
│ │ │ │ +
139 }
│ │ │ │ +
140 return it;
│ │ │ │ +
141 }
│ │ │ │ +
│ │ │ │ +
142
│ │ │ │ +
143protected:
│ │ │ │ + │ │ │ │ +
145};
│ │ │ │ +
│ │ │ │ +
146
│ │ │ │ +
147
│ │ │ │ +
148
│ │ │ │ +
149template<typename GV>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
151 public LeafBasisNode
│ │ │ │ +
152{
│ │ │ │ +
153 static const int dim = GV::dimension;
│ │ │ │ +
154 static const int maxSize = 2*dim;
│ │ │ │ +
155
│ │ │ │ +
156 constexpr static bool hasFixedElementType = Capabilities::hasSingleGeometryType<typename GV::Grid>::v;
│ │ │ │ +
157
│ │ │ │ +
158 using CubeFiniteElement = RannacherTurekLocalFiniteElement<typename GV::ctype,double,dim>;
│ │ │ │ +
159 using SimplexFiniteElement = CrouzeixRaviartLocalFiniteElement<typename GV::ctype,double,dim>;
│ │ │ │ +
160
│ │ │ │ +
161 constexpr static unsigned int topologyId = Capabilities::hasSingleGeometryType<typename GV::Grid>::topologyId; // meaningless if hasFixedElementType is false
│ │ │ │ +
162 constexpr static GeometryType type = GeometryType(topologyId, GV::dimension);
│ │ │ │ +
163
│ │ │ │ +
164public:
│ │ │ │ +
165
│ │ │ │ +
166 using size_type = std::size_t;
│ │ │ │ +
167 using Element = typename GV::template Codim<0>::Entity;
│ │ │ │ +
168 using FiniteElement = std::conditional_t<hasFixedElementType,
│ │ │ │ +
169 std::conditional_t<type.isCube(),CubeFiniteElement,SimplexFiniteElement>,
│ │ │ │ +
170 LocalFiniteElementVariant<CubeFiniteElement, SimplexFiniteElement> >;
│ │ │ │ +
171
│ │ │ │
│ │ │ │ -
172 AnalyticGridViewFunction(FT&& f, const GridView& gridView) :
│ │ │ │ -
173 f_(std::forward<FT>(f)),
│ │ │ │ -
174 entitySet_(gridView)
│ │ │ │ + │ │ │ │ + │ │ │ │ +
174 element_(nullptr)
│ │ │ │
175 {}
│ │ │ │
│ │ │ │
176
│ │ │ │
│ │ │ │ -
178 Range operator()(const Domain& x) const
│ │ │ │ +
178 const Element& element() const
│ │ │ │
179 {
│ │ │ │ -
180 return f_(x);
│ │ │ │ +
180 return *element_;
│ │ │ │
181 }
│ │ │ │
│ │ │ │
182
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
185 {
│ │ │ │ -
186 return Derivative(Imp::derivativeIfImplemented<DerivativeDummy, F>(t.f_), t.entitySet_.gridView());
│ │ │ │ -
187 }
│ │ │ │ -
│ │ │ │ -
188
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
191 {
│ │ │ │ -
192 return LocalFunction(t.f_);
│ │ │ │ -
193 }
│ │ │ │ -
│ │ │ │ -
194
│ │ │ │ -
│ │ │ │ -
196 const EntitySet& entitySet() const
│ │ │ │ -
197 {
│ │ │ │ -
198 return entitySet_;
│ │ │ │ -
199 }
│ │ │ │ -
│ │ │ │ -
200
│ │ │ │ -
201private:
│ │ │ │ -
202 F f_;
│ │ │ │ -
203 EntitySet entitySet_;
│ │ │ │ -
204};
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
188 {
│ │ │ │ +
189 return finiteElement_;
│ │ │ │ +
190 }
│ │ │ │ +
│ │ │ │ +
191
│ │ │ │ +
│ │ │ │ +
193 void bind(const Element& e)
│ │ │ │ +
194 {
│ │ │ │ +
195 element_ = &e;
│ │ │ │ +
196 if constexpr (!hasFixedElementType)
│ │ │ │ +
197 finiteElement_ = e.type().isCube() ? static_cast<FiniteElement>(CubeFiniteElement())
│ │ │ │ +
198 : static_cast<FiniteElement>(SimplexFiniteElement()) ;
│ │ │ │ +
199 this->setSize(finiteElement_.size());
│ │ │ │ +
200 }
│ │ │ │ +
│ │ │ │ +
201
│ │ │ │ +
202protected:
│ │ │ │ +
203
│ │ │ │ + │ │ │ │ + │ │ │ │ +
206};
│ │ │ │
│ │ │ │ -
205
│ │ │ │ -
206
│ │ │ │
207
│ │ │ │ -
224template<class F, class GridView>
│ │ │ │ -
225AnalyticGridViewFunction<
│ │ │ │ -
226 typename std::invoke_result<F, typename GridView::template Codim<0>::Geometry::GlobalCoordinate>::type // Range
│ │ │ │ -
227 (typename GridView::template Codim<0>::Geometry::GlobalCoordinate), // Domain
│ │ │ │ -
228 GridView,
│ │ │ │ -
229 typename std::decay<F>::type > // Raw type of F (without & or &&)
│ │ │ │ -
│ │ │ │ -
230 makeAnalyticGridViewFunction(F&& f, const GridView& gridView)
│ │ │ │ -
231{
│ │ │ │ -
232 using Domain = typename GridView::template Codim<0>::Geometry::GlobalCoordinate;
│ │ │ │ -
233 using Range = typename std::invoke_result<F, Domain>::type;
│ │ │ │ -
234 using FRaw = typename std::decay<F>::type;
│ │ │ │ -
235
│ │ │ │ -
236 return AnalyticGridViewFunction<Range(Domain), GridView, FRaw>(std::forward<F>(f), gridView);
│ │ │ │ -
237}
│ │ │ │ -
│ │ │ │ -
238
│ │ │ │ -
239
│ │ │ │ -
240
│ │ │ │ -
241}} // namespace Dune::Functions
│ │ │ │ -
242
│ │ │ │ +
208
│ │ │ │ +
209
│ │ │ │ +
210namespace BasisFactory {
│ │ │ │ +
211
│ │ │ │ +
217template<class Dummy=void>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
219{
│ │ │ │ +
220 return [](const auto& gridView) {
│ │ │ │ +
221 return RannacherTurekPreBasis<std::decay_t<decltype(gridView)>>(gridView);
│ │ │ │ +
222 };
│ │ │ │ +
223}
│ │ │ │ +
│ │ │ │ +
224
│ │ │ │ +
225} // end namespace BasisFactory
│ │ │ │ +
226
│ │ │ │ +
227
│ │ │ │ +
228
│ │ │ │ +
229
│ │ │ │ +
241template<typename GV>
│ │ │ │ + │ │ │ │
243
│ │ │ │ -
244
│ │ │ │ -
245#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:39
│ │ │ │ -
AnalyticGridViewFunction< typename std::invoke_result< F, typename GridView::template Codim< 0 >::Geometry::GlobalCoordinate >::type(typename GridView::template Codim< 0 >::Geometry::GlobalCoordinate), GridView, typename std::decay< F >::type > makeAnalyticGridViewFunction(F &&f, const GridView &gridView)
Create an AnalyticGridViewFunction from a function and a grid view.
Definition analyticgridviewfunction.hh:230
│ │ │ │ +
244} // end namespace Functions
│ │ │ │ +
245} // end namespace Dune
│ │ │ │ +
246
│ │ │ │ +
247#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ +
auto rannacherTurek()
Create a pre-basis factory that can create a Rannacher-Turek pre-basis.
Definition rannacherturekbasis.hh:218
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
Definition differentiablefunction.hh:29
│ │ │ │ -
Helper class to deduce the signature of a callable.
Definition signature.hh:56
│ │ │ │ -
Definition analyticgridviewfunction.hh:138
│ │ │ │ -
Range operator()(const Domain &x) const
Evaluate the wrapped function f directly in global coordinates x.
Definition analyticgridviewfunction.hh:178
│ │ │ │ -
typename EntitySet::LocalCoordinate LocalDomain
Definition analyticgridviewfunction.hh:167
│ │ │ │ -
friend Derivative derivative(const AnalyticGridViewFunction &t)
Create a derivative grid-function by wrapping the derivative of f.
Definition analyticgridviewfunction.hh:184
│ │ │ │ -
typename Element::Geometry Geometry
Definition analyticgridviewfunction.hh:157
│ │ │ │ -
typename EntitySet::Element Element
Definition analyticgridviewfunction.hh:156
│ │ │ │ - │ │ │ │ -
decltype(Imp::derivativeIfImplemented< DerivativeDummy, F >(std::declval< F >())) GlobalRawDerivative
Definition analyticgridviewfunction.hh:164
│ │ │ │ -
Range(Domain) Signature
Definition analyticgridviewfunction.hh:150
│ │ │ │ -
AnalyticGridViewFunction(FT &&f, const GridView &gridView)
Create the grid-function by wrapping a function f and create a GridViewEntitySet.
Definition analyticgridviewfunction.hh:172
│ │ │ │ -
friend LocalFunction localFunction(const AnalyticGridViewFunction &t)
Construct the associated local-function.
Definition analyticgridviewfunction.hh:190
│ │ │ │ -
typename Imp::LocalAnalyticGridViewFunction< Range(LocalDomain), GridView, F, LocalDerivativeTraits< EntitySet, DerivativeTraits >::template Traits > LocalFunction
Definition analyticgridviewfunction.hh:168
│ │ │ │ -
typename SignatureTraits< Signature >::RawSignature RawSignature
Definition analyticgridviewfunction.hh:151
│ │ │ │ -
const EntitySet & entitySet() const
Return the set of entities this local-function can be bound to.
Definition analyticgridviewfunction.hh:196
│ │ │ │ -
typename DerivativeTraits< RawSignature >::Range(Domain) DerivativeSignature
Definition analyticgridviewfunction.hh:152
│ │ │ │ - │ │ │ │ -
GridView::template Codim< codim >::Entity Element
Type of Elements contained in this EntitySet.
Definition gridviewentityset.hh:32
│ │ │ │ -
Element::Geometry::LocalCoordinate LocalCoordinate
Type of local coordinates with respect to the Element.
Definition gridviewentityset.hh:35
│ │ │ │ -
Derivative traits for local functions.
Definition localderivativetraits.hh:28
│ │ │ │ +
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:46
│ │ │ │ +
size_type size() const
Definition nodes.hh:142
│ │ │ │ +
void setSize(const size_type size)
Definition nodes.hh:164
│ │ │ │ +
Definition nodes.hh:186
│ │ │ │ +
Definition rannacherturekbasis.hh:152
│ │ │ │ +
std::conditional_t< hasFixedElementType, std::conditional_t< type.isCube(), CubeFiniteElement, SimplexFiniteElement >, LocalFiniteElementVariant< CubeFiniteElement, SimplexFiniteElement > > FiniteElement
Definition rannacherturekbasis.hh:170
│ │ │ │ +
void bind(const Element &e)
Bind to element.
Definition rannacherturekbasis.hh:193
│ │ │ │ +
FiniteElement finiteElement_
Definition rannacherturekbasis.hh:204
│ │ │ │ +
std::size_t size_type
Definition rannacherturekbasis.hh:166
│ │ │ │ +
typename GV::template Codim< 0 >::Entity Element
Definition rannacherturekbasis.hh:167
│ │ │ │ +
RannacherTurekNode()
Definition rannacherturekbasis.hh:172
│ │ │ │ +
const Element * element_
Definition rannacherturekbasis.hh:205
│ │ │ │ +
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition rannacherturekbasis.hh:187
│ │ │ │ +
const Element & element() const
Return current element, throw if unbound.
Definition rannacherturekbasis.hh:178
│ │ │ │ +
Pre-basis for a Rannacher-Turek basis.
Definition rannacherturekbasis.hh:52
│ │ │ │ +
static constexpr size_type multiIndexBufferSize
Definition rannacherturekbasis.hh:68
│ │ │ │ +
void initializeIndices()
Initialize the global indices.
Definition rannacherturekbasis.hh:80
│ │ │ │ +
static constexpr size_type maxMultiIndexSize
Definition rannacherturekbasis.hh:66
│ │ │ │ +
static constexpr size_type minMultiIndexSize
Definition rannacherturekbasis.hh:67
│ │ │ │ +
size_type size(const SizePrefix prefix) const
Return number of possible values for next position in multi index.
Definition rannacherturekbasis.hh:111
│ │ │ │ +
std::size_t size_type
Type used for indices and size information.
Definition rannacherturekbasis.hh:61
│ │ │ │ +
Node makeNode() const
Create tree node.
Definition rannacherturekbasis.hh:98
│ │ │ │ +
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition rannacherturekbasis.hh:90
│ │ │ │ +
It indices(const Node &node, It it) const
Definition rannacherturekbasis.hh:130
│ │ │ │ +
GV GridView
The grid view that the FE basis is defined on.
Definition rannacherturekbasis.hh:58
│ │ │ │ +
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition rannacherturekbasis.hh:118
│ │ │ │ +
RannacherTurekPreBasis(const GridView &gv)
Constructor for a given grid view object.
Definition rannacherturekbasis.hh:71
│ │ │ │ +
size_type size() const
Same as size(prefix) with empty prefix.
Definition rannacherturekbasis.hh:104
│ │ │ │ +
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition rannacherturekbasis.hh:84
│ │ │ │ +
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition rannacherturekbasis.hh:124
│ │ │ │ +
GridView gridView_
Definition rannacherturekbasis.hh:144
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,324 +1,338 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _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 │ │ │ │ │ -analyticgridviewfunction.hh │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ -8 │ │ │ │ │ -9#include │ │ │ │ │ -10 │ │ │ │ │ -11#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> │ │ │ │ │ -12#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> │ │ │ │ │ -13#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> │ │ │ │ │ -14#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> │ │ │ │ │ -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_/_l_o_c_a_l_d_e_r_i_v_a_t_i_v_e_t_r_a_i_t_s_._h_h> │ │ │ │ │ +6#include │ │ │ │ │ +7 │ │ │ │ │ +8#include │ │ │ │ │ +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_/_d_e_f_a_u_l_t_g_l_o_b_a_l_b_a_s_i_s_._h_h> │ │ │ │ │ +16 │ │ │ │ │ 17 │ │ │ │ │ -18 │ │ │ │ │ -19namespace _D_u_n_e { │ │ │ │ │ -20namespace Functions { │ │ │ │ │ -21 │ │ │ │ │ -22namespace Imp { │ │ │ │ │ -23 │ │ │ │ │ -24template class │ │ │ │ │ -DerivativeTraits=DefaultDerivativeTraits> │ │ │ │ │ -25class LocalAnalyticGridViewFunction; │ │ │ │ │ -26 │ │ │ │ │ -27template │ │ │ │ │ -class DerivativeTraits> │ │ │ │ │ -28class LocalAnalyticGridViewFunction │ │ │ │ │ -29{ │ │ │ │ │ -30public: │ │ │ │ │ -31 using Signature = Range(LocalDomain); │ │ │ │ │ -32 using RawSignature = typename SignatureTraits::RawSignature; │ │ │ │ │ -33 using DerivativeSignature = typename DerivativeTraits::Range │ │ │ │ │ -(LocalDomain); │ │ │ │ │ +18namespace _D_u_n_e { │ │ │ │ │ +19namespace Functions { │ │ │ │ │ +20 │ │ │ │ │ +21/ │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +22// This is the reusable part of the basis. It contains │ │ │ │ │ +23// │ │ │ │ │ +24// RannacherTurekPreBasis │ │ │ │ │ +25// RannacherTurekNode │ │ │ │ │ +26// │ │ │ │ │ +27// The pre-basis allows to create the others and is the owner of possible │ │ │ │ │ +shared │ │ │ │ │ +28// state. These components do _not_ depend on the global basis and local view │ │ │ │ │ +29// and can be used without a global basis. │ │ │ │ │ +30/ │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +31 │ │ │ │ │ +32template │ │ │ │ │ +33class RannacherTurekNode; │ │ │ │ │ 34 │ │ │ │ │ -35 using GridView = GV; │ │ │ │ │ -36 using EntitySet = GridViewEntitySet; │ │ │ │ │ -37 using Element = typename EntitySet::Element; │ │ │ │ │ -38// using Geometry = typename Element::Geometry; │ │ │ │ │ -39 using Geometry = typename std::decay::type; │ │ │ │ │ -40 │ │ │ │ │ -41 // Use the indirection via derivativeIfImplemented to also support │ │ │ │ │ -42 // function types F that do not implement derivative. In this case │ │ │ │ │ -43 // the interface type DifferentiableFunction is using a dummy for │ │ │ │ │ -44 // the derivative type │ │ │ │ │ -45 using DerivativeDummy = DifferentiableFunction; │ │ │ │ │ -46 using GlobalRawDerivative = decltype(Imp:: │ │ │ │ │ -derivativeIfImplemented(std::declval())); │ │ │ │ │ -47 using LocalDerivative = LocalAnalyticGridViewFunction; │ │ │ │ │ -48 │ │ │ │ │ -50 template = 0> │ │ │ │ │ -51 LocalAnalyticGridViewFunction(FT&& f) : │ │ │ │ │ -52 f_(std::forward(f)) │ │ │ │ │ -53 {} │ │ │ │ │ +35template │ │ │ │ │ +36class RannacherTurekPreBasis; │ │ │ │ │ +37 │ │ │ │ │ +50template │ │ │ │ │ +_5_1class _R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s │ │ │ │ │ +52{ │ │ │ │ │ +53 static const int dim = GV::dimension; │ │ │ │ │ 54 │ │ │ │ │ -56 template │ │ │ │ │ -57 LocalAnalyticGridViewFunction(FT&& f, const Element& element, const std:: │ │ │ │ │ -optional& geometry) : │ │ │ │ │ -58 f_(std::forward(f)), │ │ │ │ │ -59 element_(element), │ │ │ │ │ -60 geometry_(geometry) │ │ │ │ │ -61 {} │ │ │ │ │ +55public: │ │ │ │ │ +56 │ │ │ │ │ +_5_8 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ │ +59 │ │ │ │ │ +_6_1 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ 62 │ │ │ │ │ -63 │ │ │ │ │ -72 void bind(const Element& element) │ │ │ │ │ +_6_4 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_>; │ │ │ │ │ +65 │ │ │ │ │ +_6_6 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 = 1; │ │ │ │ │ +_6_7 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 = 1; │ │ │ │ │ +_6_8 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 = 1; │ │ │ │ │ +69 │ │ │ │ │ +_7_1 _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) : │ │ │ │ │ +72 _g_r_i_d_V_i_e_w__(gv) │ │ │ │ │ 73 { │ │ │ │ │ -74 element_ = element; │ │ │ │ │ -75 geometry_.emplace(element_.geometry()); │ │ │ │ │ -76 } │ │ │ │ │ -77 │ │ │ │ │ -79 void unbind() │ │ │ │ │ -80 { │ │ │ │ │ -81 geometry_.reset(); │ │ │ │ │ -82 } │ │ │ │ │ -83 │ │ │ │ │ -86 bool bound() const │ │ │ │ │ -87 { │ │ │ │ │ -88 return static_cast(geometry_); │ │ │ │ │ -89 } │ │ │ │ │ -90 │ │ │ │ │ -100 Range operator()(const LocalDomain& x) const │ │ │ │ │ -101 { │ │ │ │ │ -102 assert(!!geometry_); │ │ │ │ │ -103 return f_(geometry_->global(x)); │ │ │ │ │ -104 } │ │ │ │ │ -105 │ │ │ │ │ -107 const Element& localContext() const │ │ │ │ │ -108 { │ │ │ │ │ -109 assert(!!geometry_); │ │ │ │ │ -110 return element_; │ │ │ │ │ -111 } │ │ │ │ │ -112 │ │ │ │ │ -121 friend LocalDerivative _d_e_r_i_v_a_t_i_v_e(const LocalAnalyticGridViewFunction& t) │ │ │ │ │ -122 { │ │ │ │ │ -123 return LocalDerivative(Imp::derivativeIfImplemented │ │ │ │ │ -(t.f_), t.element_, t.geometry_); │ │ │ │ │ -124 } │ │ │ │ │ -125 │ │ │ │ │ -126private: │ │ │ │ │ -127 F f_; │ │ │ │ │ -128 Element element_; │ │ │ │ │ -129 std::optional geometry_ = std::nullopt; │ │ │ │ │ -130}; │ │ │ │ │ -131 │ │ │ │ │ -132} // end namespace Imp │ │ │ │ │ -133 │ │ │ │ │ -134 │ │ │ │ │ -135 │ │ │ │ │ -136 │ │ │ │ │ -137template class │ │ │ │ │ -DerivativeTraits=DefaultDerivativeTraits> │ │ │ │ │ -_1_3_8class _A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n; │ │ │ │ │ -139 │ │ │ │ │ -140 │ │ │ │ │ -146template class │ │ │ │ │ -DerivativeTraits> │ │ │ │ │ -_1_4_7class _A_n_a_l_y_t_i_c_G_r_i_d_V_i_e_w_F_u_n_c_t_i_o_n │ │ │ │ │ -148{ │ │ │ │ │ -149public: │ │ │ │ │ -_1_5_0 using _S_i_g_n_a_t_u_r_e = Range(Domain); │ │ │ │ │ -_1_5_1 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_2 using _D_e_r_i_v_a_t_i_v_e_S_i_g_n_a_t_u_r_e = typename DerivativeTraits::Range │ │ │ │ │ -(Domain); │ │ │ │ │ -153 │ │ │ │ │ -_1_5_4 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ │ -_1_5_5 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_5_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; │ │ │ │ │ -_1_5_7 using _G_e_o_m_e_t_r_y = typename Element::Geometry; │ │ │ │ │ -158 │ │ │ │ │ -159 // Use the indirection via derivativeIfImplemented to also support │ │ │ │ │ -160 // function types F that do not implement derivative. In this case │ │ │ │ │ -161 // the interface type DifferentiableFunction is used a dummy for │ │ │ │ │ -162 // the derivative type │ │ │ │ │ -_1_6_3 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_6_4 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_6_5 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_>; │ │ │ │ │ -166 │ │ │ │ │ -_1_6_7 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_6_8 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>; │ │ │ │ │ -169 │ │ │ │ │ -171 template │ │ │ │ │ -_1_7_2 _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) : │ │ │ │ │ -173 f_(std::forward(f)), │ │ │ │ │ -174 entitySet_(gridView) │ │ │ │ │ +74 for(auto type : gv.indexSet().types(0)) │ │ │ │ │ +75 if (!type.isSimplex() && !type.isCube()) │ │ │ │ │ +76 DUNE_THROW(Dune::NotImplemented, "Rannacher-Turek or Crouzeix-Raviart │ │ │ │ │ +elements are only implemented for grids with simplex or cube elements."); │ │ │ │ │ +77 } │ │ │ │ │ +78 │ │ │ │ │ +_8_0 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ │ +81 {} │ │ │ │ │ +82 │ │ │ │ │ +_8_4 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ │ +85 { │ │ │ │ │ +86 return _g_r_i_d_V_i_e_w__; │ │ │ │ │ +87 } │ │ │ │ │ +88 │ │ │ │ │ +_9_0 void _u_p_d_a_t_e (const _G_r_i_d_V_i_e_w& gv) │ │ │ │ │ +91 { │ │ │ │ │ +92 _g_r_i_d_V_i_e_w__ = gv; │ │ │ │ │ +93 } │ │ │ │ │ +94 │ │ │ │ │ +_9_8 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ │ +99 { │ │ │ │ │ +100 return _N_o_d_e{}; │ │ │ │ │ +101 } │ │ │ │ │ +102 │ │ │ │ │ +_1_0_4 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ │ +105 { │ │ │ │ │ +106 return (_s_i_z_e___t_y_p_e)(_g_r_i_d_V_i_e_w__.size(1)); │ │ │ │ │ +107 } │ │ │ │ │ +108 │ │ │ │ │ +110 template │ │ │ │ │ +_1_1_1 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix prefix) const │ │ │ │ │ +112 { │ │ │ │ │ +113 assert(prefix.size() == 0 || prefix.size() == 1); │ │ │ │ │ +114 return (prefix.size() == 0) ? _s_i_z_e() : 0; │ │ │ │ │ +115 } │ │ │ │ │ +116 │ │ │ │ │ +_1_1_8 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ │ +119 { │ │ │ │ │ +120 return _s_i_z_e(); │ │ │ │ │ +121 } │ │ │ │ │ +122 │ │ │ │ │ +_1_2_4 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ │ +125 { │ │ │ │ │ +126 return 2*GV::dimension; │ │ │ │ │ +127 } │ │ │ │ │ +128 │ │ │ │ │ +129 template │ │ │ │ │ +_1_3_0 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ │ +131 { │ │ │ │ │ +132 for (_s_i_z_e___t_y_p_e i = 0, end = node._s_i_z_e() ; i < end ; ++i, ++it) │ │ │ │ │ +133 { │ │ │ │ │ +134 Dune::LocalKey localKey = node._f_i_n_i_t_e_E_l_e_m_e_n_t().localCoefficients().localKey │ │ │ │ │ +(i); │ │ │ │ │ +135 const auto& gridIndexSet = _g_r_i_d_V_i_e_w().indexSet(); │ │ │ │ │ +136 const auto& element = node._e_l_e_m_e_n_t(); │ │ │ │ │ +137 │ │ │ │ │ +138 *it = {{ (_s_i_z_e___t_y_p_e)(gridIndexSet.subIndex(element,localKey.subEntity(),1)) │ │ │ │ │ +}}; │ │ │ │ │ +139 } │ │ │ │ │ +140 return it; │ │ │ │ │ +141 } │ │ │ │ │ +142 │ │ │ │ │ +143protected: │ │ │ │ │ +_1_4_4 _G_r_i_d_V_i_e_w _g_r_i_d_V_i_e_w__; │ │ │ │ │ +145}; │ │ │ │ │ +146 │ │ │ │ │ +147 │ │ │ │ │ +148 │ │ │ │ │ +149template │ │ │ │ │ +_1_5_0class _R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e : │ │ │ │ │ +151 public _L_e_a_f_B_a_s_i_s_N_o_d_e │ │ │ │ │ +152{ │ │ │ │ │ +153 static const int dim = GV::dimension; │ │ │ │ │ +154 static const int maxSize = 2*dim; │ │ │ │ │ +155 │ │ │ │ │ +156 constexpr static bool hasFixedElementType = Capabilities:: │ │ │ │ │ +hasSingleGeometryType::v; │ │ │ │ │ +157 │ │ │ │ │ +158 using CubeFiniteElement = RannacherTurekLocalFiniteElement; │ │ │ │ │ +159 using SimplexFiniteElement = CrouzeixRaviartLocalFiniteElement; │ │ │ │ │ +160 │ │ │ │ │ +161 constexpr static unsigned int topologyId = Capabilities:: │ │ │ │ │ +hasSingleGeometryType::topologyId; // meaningless if │ │ │ │ │ +hasFixedElementType is false │ │ │ │ │ +162 constexpr static GeometryType type = GeometryType(topologyId, GV:: │ │ │ │ │ +dimension); │ │ │ │ │ +163 │ │ │ │ │ +164public: │ │ │ │ │ +165 │ │ │ │ │ +_1_6_6 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ +_1_6_7 using _E_l_e_m_e_n_t = typename GV::template Codim<0>::Entity; │ │ │ │ │ +_1_6_8 using _F_i_n_i_t_e_E_l_e_m_e_n_t = std::conditional_t, │ │ │ │ │ +170 LocalFiniteElementVariant >; │ │ │ │ │ +171 │ │ │ │ │ +_1_7_2 _R_a_n_n_a_c_h_e_r_T_u_r_e_k_N_o_d_e() : │ │ │ │ │ +173 _f_i_n_i_t_e_E_l_e_m_e_n_t__(), │ │ │ │ │ +174 _e_l_e_m_e_n_t__(nullptr) │ │ │ │ │ 175 {} │ │ │ │ │ 176 │ │ │ │ │ -_1_7_8 Range _o_p_e_r_a_t_o_r_(_)(const Domain& x) const │ │ │ │ │ +_1_7_8 const _E_l_e_m_e_n_t& _e_l_e_m_e_n_t() const │ │ │ │ │ 179 { │ │ │ │ │ -180 return f_(x); │ │ │ │ │ +180 return *_e_l_e_m_e_n_t__; │ │ │ │ │ 181 } │ │ │ │ │ 182 │ │ │ │ │ -_1_8_4 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) │ │ │ │ │ -185 { │ │ │ │ │ -186 return _D_e_r_i_v_a_t_i_v_e(Imp::derivativeIfImplemented(t.f_), │ │ │ │ │ -t.entitySet_.gridView()); │ │ │ │ │ -187 } │ │ │ │ │ -188 │ │ │ │ │ -_1_9_0 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) │ │ │ │ │ -191 { │ │ │ │ │ -192 return _L_o_c_a_l_F_u_n_c_t_i_o_n(t.f_); │ │ │ │ │ -193 } │ │ │ │ │ -194 │ │ │ │ │ -_1_9_6 const _E_n_t_i_t_y_S_e_t& _e_n_t_i_t_y_S_e_t() const │ │ │ │ │ -197 { │ │ │ │ │ -198 return entitySet_; │ │ │ │ │ -199 } │ │ │ │ │ -200 │ │ │ │ │ -201private: │ │ │ │ │ -202 F f_; │ │ │ │ │ -203 EntitySet entitySet_; │ │ │ │ │ -204}; │ │ │ │ │ -205 │ │ │ │ │ -206 │ │ │ │ │ +_1_8_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 │ │ │ │ │ +188 { │ │ │ │ │ +189 return _f_i_n_i_t_e_E_l_e_m_e_n_t__; │ │ │ │ │ +190 } │ │ │ │ │ +191 │ │ │ │ │ +_1_9_3 void _b_i_n_d(const _E_l_e_m_e_n_t& e) │ │ │ │ │ +194 { │ │ │ │ │ +195 _e_l_e_m_e_n_t__ = &e; │ │ │ │ │ +196 if constexpr (!hasFixedElementType) │ │ │ │ │ +197 _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()) │ │ │ │ │ +198 : static_cast<_F_i_n_i_t_e_E_l_e_m_e_n_t>(SimplexFiniteElement()) ; │ │ │ │ │ +199 this->_s_e_t_S_i_z_e(_f_i_n_i_t_e_E_l_e_m_e_n_t__.size()); │ │ │ │ │ +200 } │ │ │ │ │ +201 │ │ │ │ │ +202protected: │ │ │ │ │ +203 │ │ │ │ │ +_2_0_4 _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_0_5 const _E_l_e_m_e_n_t* _e_l_e_m_e_n_t__; │ │ │ │ │ +206}; │ │ │ │ │ 207 │ │ │ │ │ -224template │ │ │ │ │ -225AnalyticGridViewFunction< │ │ │ │ │ -226 typename std::invoke_result:: │ │ │ │ │ -Geometry::GlobalCoordinate>::type // Range │ │ │ │ │ -227 (typename GridView::template Codim<0>::Geometry::GlobalCoordinate), / │ │ │ │ │ -/ Domain │ │ │ │ │ -228 GridView, │ │ │ │ │ -229 typename std::decay::type > // Raw type of F (without & or &&) │ │ │ │ │ -_2_3_0 _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) │ │ │ │ │ -231{ │ │ │ │ │ -232 using Domain = typename GridView::template Codim<0>::Geometry:: │ │ │ │ │ -GlobalCoordinate; │ │ │ │ │ -233 using Range = typename std::invoke_result::type; │ │ │ │ │ -234 using FRaw = typename std::decay::type; │ │ │ │ │ -235 │ │ │ │ │ -236 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); │ │ │ │ │ -237} │ │ │ │ │ -238 │ │ │ │ │ -239 │ │ │ │ │ -240 │ │ │ │ │ -241}} // namespace Dune::Functions │ │ │ │ │ -242 │ │ │ │ │ +208 │ │ │ │ │ +209 │ │ │ │ │ +210namespace BasisFactory { │ │ │ │ │ +211 │ │ │ │ │ +217template │ │ │ │ │ +_2_1_8auto _r_a_n_n_a_c_h_e_r_T_u_r_e_k() │ │ │ │ │ +219{ │ │ │ │ │ +220 return [](const auto& gridView) { │ │ │ │ │ +221 return _R_a_n_n_a_c_h_e_r_T_u_r_e_k_P_r_e_B_a_s_i_s>(gridView); │ │ │ │ │ +222 }; │ │ │ │ │ +223} │ │ │ │ │ +224 │ │ │ │ │ +225} // end namespace BasisFactory │ │ │ │ │ +226 │ │ │ │ │ +227 │ │ │ │ │ +228 │ │ │ │ │ +229 │ │ │ │ │ +241template │ │ │ │ │ +_2_4_2using _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_> >; │ │ │ │ │ 243 │ │ │ │ │ -244 │ │ │ │ │ -245#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_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 │ │ │ │ │ -_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_._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 │ │ │ │ │ -_g_r_i_d_v_i_e_w_e_n_t_i_t_y_s_e_t_._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 │ │ │ │ │ -_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:39 │ │ │ │ │ -_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 │ │ │ │ │ -AnalyticGridViewFunction< typename std::invoke_result< F, typename GridView:: │ │ │ │ │ -template Codim< 0 >::Geometry::GlobalCoordinate >::type(typename GridView:: │ │ │ │ │ -template Codim< 0 >::Geometry::GlobalCoordinate), GridView, typename std:: │ │ │ │ │ -decay< F >::type > makeAnalyticGridViewFunction(F &&f, const GridView │ │ │ │ │ -&gridView) │ │ │ │ │ -Create an AnalyticGridViewFunction from a function and a grid view. │ │ │ │ │ -DDeeffiinniittiioonn analyticgridviewfunction.hh:230 │ │ │ │ │ +244} // end namespace Functions │ │ │ │ │ +245} // end namespace Dune │ │ │ │ │ +246 │ │ │ │ │ +247#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 │ │ │ │ │ +_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:218 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:29 │ │ │ │ │ -_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:56 │ │ │ │ │ -_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:138 │ │ │ │ │ -_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: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_D_o_m_a_i_n │ │ │ │ │ -typename EntitySet::LocalCoordinate LocalDomain │ │ │ │ │ -DDeeffiinniittiioonn analyticgridviewfunction.hh:167 │ │ │ │ │ -_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: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_ _>_:_:_G_e_o_m_e_t_r_y │ │ │ │ │ -typename Element::Geometry Geometry │ │ │ │ │ -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_l_e_m_e_n_t │ │ │ │ │ -typename EntitySet::Element Element │ │ │ │ │ -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_ _>_:_:_G_r_i_d_V_i_e_w │ │ │ │ │ +_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:46 │ │ │ │ │ +_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 │ │ │ │ │ +DDeeffiinniittiioonn nodes.hh:142 │ │ │ │ │ +_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:164 │ │ │ │ │ +_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:186 │ │ │ │ │ +_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:152 │ │ │ │ │ +_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:170 │ │ │ │ │ +_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: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__ │ │ │ │ │ +FiniteElement finiteElement_ │ │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:204 │ │ │ │ │ +_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: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_N_o_d_e_:_:_E_l_e_m_e_n_t │ │ │ │ │ +typename GV::template Codim< 0 >::Entity Element │ │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:167 │ │ │ │ │ +_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:172 │ │ │ │ │ +_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:205 │ │ │ │ │ +_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:187 │ │ │ │ │ +_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:178 │ │ │ │ │ +_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:52 │ │ │ │ │ +_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_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 rannacherturekbasis.hh:68 │ │ │ │ │ +_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:80 │ │ │ │ │ +_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_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ +static constexpr size_type maxMultiIndexSize │ │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:66 │ │ │ │ │ +_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_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ +static constexpr size_type minMultiIndexSize │ │ │ │ │ +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_:_:_s_i_z_e │ │ │ │ │ +size_type size(const SizePrefix prefix) const │ │ │ │ │ +Return number of possible values for next position in multi index. │ │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:111 │ │ │ │ │ +_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:61 │ │ │ │ │ +_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:98 │ │ │ │ │ +_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:90 │ │ │ │ │ +_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:130 │ │ │ │ │ +_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 │ │ │ │ │ -DDeeffiinniittiioonn analyticgridviewfunction.hh:154 │ │ │ │ │ -_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:164 │ │ │ │ │ -_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:150 │ │ │ │ │ -_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:172 │ │ │ │ │ -_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: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_ _>_:_:_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:168 │ │ │ │ │ -_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:151 │ │ │ │ │ -_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: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_ _>_:_:_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:152 │ │ │ │ │ -_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_ _> │ │ │ │ │ -_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 │ │ │ │ │ -Type of Elements contained in this EntitySet. │ │ │ │ │ -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_ _>_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ │ -Element::Geometry::LocalCoordinate LocalCoordinate │ │ │ │ │ -Type of local coordinates with respect to the Element. │ │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:35 │ │ │ │ │ -_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:28 │ │ │ │ │ +The grid view that the FE basis is defined on. │ │ │ │ │ +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_:_:_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 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_:_:_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:71 │ │ │ │ │ +_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 │ │ │ │ │ +size_type size() const │ │ │ │ │ +Same as size(prefix) with empty prefix. │ │ │ │ │ +DDeeffiinniittiioonn rannacherturekbasis.hh:104 │ │ │ │ │ +_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:84 │ │ │ │ │ +_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:124 │ │ │ │ │ +_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:144 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00173.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: gridviewentityset.hh File Reference │ │ │ │ +dune-functions: sizeinfo.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,40 +65,47 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces
│ │ │ │ -
gridviewentityset.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Functions
│ │ │ │ +
sizeinfo.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <memory>
│ │ │ │ +
#include <array>
│ │ │ │
│ │ │ │

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...
class  Dune::Functions::SizeInfo< B >
 A class encapsulating size information. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +

│ │ │ │ Namespaces

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

│ │ │ │ +Functions

template<class Basis >
SizeInfo< Basis > Dune::Functions::sizeInfo (const Basis &basis)
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,22 +1,26 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _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_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -gridviewentityset.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +sizeinfo.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_:_:_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_._._. │ │ │ │ │ +class   _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_z_e_I_n_f_o_<_ _B_ _> │ │ │ │ │ +  A class encapsulating size 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 │ │ │ │ │   │ │ │ │ │ +FFuunnccttiioonnss │ │ │ │ │ +template │ │ │ │ │ +_S_i_z_e_I_n_f_o< Basis >  _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_s_i_z_e_I_n_f_o (const Basis &basis) │ │ │ │ │ +  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00173_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: gridviewentityset.hh Source File │ │ │ │ +dune-functions: sizeinfo.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,123 +70,100 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
gridviewentityset.hh
│ │ │ │ +
sizeinfo.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#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SIZEINFO_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SIZEINFO_HH
│ │ │ │
5
│ │ │ │ -
6#include <memory>
│ │ │ │ +
6#include <array>
│ │ │ │
7
│ │ │ │ -
8
│ │ │ │ -
9namespace Dune {
│ │ │ │ +
8namespace Dune {
│ │ │ │ +
9namespace Functions {
│ │ │ │
10
│ │ │ │ -
11namespace Functions {
│ │ │ │ +
11
│ │ │ │
12
│ │ │ │ -
13
│ │ │ │ -
21template<class GV, int cd>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
23{
│ │ │ │ -
24public:
│ │ │ │ -
25
│ │ │ │ -
26 typedef GV GridView;
│ │ │ │ -
27 enum {
│ │ │ │ -
28 codim = cd
│ │ │ │ -
29 };
│ │ │ │ +
23template<class B>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
25{
│ │ │ │ +
26public:
│ │ │ │ +
27 using Basis = B;
│ │ │ │ +
28 using size_type = typename Basis::size_type;
│ │ │ │ +
29 using SizePrefix = typename Basis::SizePrefix;
│ │ │ │
30
│ │ │ │ -
32 typedef typename GridView::template Codim<codim>::Entity Element;
│ │ │ │ -
33
│ │ │ │ -
35 typedef typename Element::Geometry::LocalCoordinate LocalCoordinate;
│ │ │ │ -
36 typedef typename Element::Geometry::GlobalCoordinate GlobalCoordinate;
│ │ │ │ +
│ │ │ │ +
34 SizeInfo(const Basis& basis) :
│ │ │ │ +
35 basis_(&basis)
│ │ │ │ +
36 {}
│ │ │ │ +
│ │ │ │
37
│ │ │ │ - │ │ │ │ -
39
│ │ │ │ -
41 typedef typename GridView::template Codim<codim>::Iterator const_iterator;
│ │ │ │ -
42
│ │ │ │ - │ │ │ │ -
45
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
48 gv_(gv)
│ │ │ │ -
49 {}
│ │ │ │ +
│ │ │ │ +
41 size_type operator()(const SizePrefix& prefix) const
│ │ │ │ +
42 {
│ │ │ │ +
43 return basis_->size(prefix);
│ │ │ │ +
44 }
│ │ │ │
│ │ │ │ -
50
│ │ │ │ +
45
│ │ │ │
│ │ │ │ -
52 bool contains(const Element& e) const
│ │ │ │ -
53 {
│ │ │ │ -
54 return gv_.contains(e);
│ │ │ │ -
55 }
│ │ │ │ +
52 size_type size(const SizePrefix& prefix) const
│ │ │ │ +
53 {
│ │ │ │ +
54 return basis_->size(prefix);
│ │ │ │ +
55 }
│ │ │ │
│ │ │ │
56
│ │ │ │ -
│ │ │ │ -
58 size_t size() const
│ │ │ │ -
59 {
│ │ │ │ -
60 return gv_.size(codim);
│ │ │ │ -
61 }
│ │ │ │ -
│ │ │ │ -
62
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
65 {
│ │ │ │ -
66 return gv_.template begin<codim>();
│ │ │ │ -
67 }
│ │ │ │ -
│ │ │ │ -
68
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
71 {
│ │ │ │ -
72 return gv_.template end<codim>();
│ │ │ │ -
73 }
│ │ │ │ +
│ │ │ │ +
57 operator size_type () const
│ │ │ │ +
58 {
│ │ │ │ +
59 return basis_->dimension();
│ │ │ │ +
60 }
│ │ │ │ +
│ │ │ │ +
61
│ │ │ │ +
62protected:
│ │ │ │ +
63
│ │ │ │ +
64 const Basis* basis_;
│ │ │ │ +
65};
│ │ │ │ +
│ │ │ │ +
66
│ │ │ │ +
67
│ │ │ │ +
68template<class Basis>
│ │ │ │ +
│ │ │ │ +
69SizeInfo<Basis> sizeInfo(const Basis& basis)
│ │ │ │ +
70{
│ │ │ │ +
71 return SizeInfo<Basis>(basis);
│ │ │ │ +
72}
│ │ │ │
│ │ │ │ +
73
│ │ │ │
74
│ │ │ │ -
│ │ │ │ -
76 const GridView& gridView() const
│ │ │ │ -
77 {
│ │ │ │ -
78 return gv_;
│ │ │ │ -
79 }
│ │ │ │ -
│ │ │ │ -
80
│ │ │ │ -
81private:
│ │ │ │ -
82 GridView gv_;
│ │ │ │ -
83};
│ │ │ │ -
│ │ │ │ -
84
│ │ │ │ -
85
│ │ │ │ -
86} // end of namespace Dune::Functions
│ │ │ │ -
87} // end of namespace Dune
│ │ │ │ -
88
│ │ │ │ -
89#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH
│ │ │ │ +
75
│ │ │ │ +
76} // end namespace Functions
│ │ │ │ +
77} // end namespace Dune
│ │ │ │ +
78
│ │ │ │ +
79#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SIZEINFO_HH
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
An entity set for all entities of given codim in a grid view.
Definition gridviewentityset.hh:23
│ │ │ │ -
GridViewEntitySet(const GridView &gv)
Construct GridViewEntitySet for a GridView.
Definition gridviewentityset.hh:47
│ │ │ │ -
GV GridView
Definition gridviewentityset.hh:26
│ │ │ │ -
GridView::template Codim< codim >::Entity Element
Type of Elements contained in this EntitySet.
Definition gridviewentityset.hh:32
│ │ │ │ -
const_iterator end() const
Create an end iterator.
Definition gridviewentityset.hh:70
│ │ │ │ -
const GridView & gridView() const
Return the associated GridView.
Definition gridviewentityset.hh:76
│ │ │ │ -
Element value_type
Definition gridviewentityset.hh:38
│ │ │ │ -
const_iterator begin() const
Create a begin iterator.
Definition gridviewentityset.hh:64
│ │ │ │ -
GridView::template Codim< codim >::Iterator const_iterator
A forward iterator.
Definition gridviewentityset.hh:41
│ │ │ │ -
Element::Geometry::LocalCoordinate LocalCoordinate
Type of local coordinates with respect to the Element.
Definition gridviewentityset.hh:35
│ │ │ │ -
size_t size() const
Return number of Elements visited by an iterator.
Definition gridviewentityset.hh:58
│ │ │ │ -
Element::Geometry::GlobalCoordinate GlobalCoordinate
Definition gridviewentityset.hh:36
│ │ │ │ -
@ codim
Definition gridviewentityset.hh:28
│ │ │ │ -
bool contains(const Element &e) const
Return true if e is contained in the EntitySet.
Definition gridviewentityset.hh:52
│ │ │ │ -
const_iterator iterator
Same as const_iterator.
Definition gridviewentityset.hh:44
│ │ │ │ +
SizeInfo< Basis > sizeInfo(const Basis &basis)
Definition sizeinfo.hh:69
│ │ │ │ +
A class encapsulating size information.
Definition sizeinfo.hh:25
│ │ │ │ +
typename Basis::SizePrefix SizePrefix
Definition sizeinfo.hh:29
│ │ │ │ +
size_type size(const SizePrefix &prefix) const
Return number possible values for next position in multi index.
Definition sizeinfo.hh:52
│ │ │ │ +
size_type operator()(const SizePrefix &prefix) const
Return number possible values for next position in multi index.
Definition sizeinfo.hh:41
│ │ │ │ +
typename Basis::size_type size_type
Definition sizeinfo.hh:28
│ │ │ │ +
B Basis
Definition sizeinfo.hh:27
│ │ │ │ +
SizeInfo(const Basis &basis)
Construct from basis.
Definition sizeinfo.hh:34
│ │ │ │ +
const Basis * basis_
Definition sizeinfo.hh:64
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,140 +1,100 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _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 │ │ │ │ │ -gridviewentityset.hh │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +sizeinfo.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#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SIZEINFO_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SIZEINFO_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ +6#include │ │ │ │ │ 7 │ │ │ │ │ -8 │ │ │ │ │ -9namespace _D_u_n_e { │ │ │ │ │ +8namespace _D_u_n_e { │ │ │ │ │ +9namespace Functions { │ │ │ │ │ 10 │ │ │ │ │ -11namespace Functions { │ │ │ │ │ +11 │ │ │ │ │ 12 │ │ │ │ │ -13 │ │ │ │ │ -21template │ │ │ │ │ -_2_2class _G_r_i_d_V_i_e_w_E_n_t_i_t_y_S_e_t │ │ │ │ │ -23{ │ │ │ │ │ -24public: │ │ │ │ │ -25 │ │ │ │ │ -_2_6 typedef GV _G_r_i_d_V_i_e_w; │ │ │ │ │ -27 enum { │ │ │ │ │ -28 _c_o_d_i_m = cd │ │ │ │ │ -_2_9 }; │ │ │ │ │ +23template │ │ │ │ │ +_2_4class _S_i_z_e_I_n_f_o │ │ │ │ │ +25{ │ │ │ │ │ +26public: │ │ │ │ │ +_2_7 using _B_a_s_i_s = B; │ │ │ │ │ +_2_8 using _s_i_z_e___t_y_p_e = typename Basis::size_type; │ │ │ │ │ +_2_9 using _S_i_z_e_P_r_e_f_i_x = typename Basis::SizePrefix; │ │ │ │ │ 30 │ │ │ │ │ -_3_2 typedef typename GridView::template Codim::Entity _E_l_e_m_e_n_t; │ │ │ │ │ -33 │ │ │ │ │ -_3_5 typedef typename Element::Geometry::LocalCoordinate _L_o_c_a_l_C_o_o_r_d_i_n_a_t_e; │ │ │ │ │ -_3_6 typedef typename Element::Geometry::GlobalCoordinate _G_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e; │ │ │ │ │ +_3_4 _S_i_z_e_I_n_f_o(const _B_a_s_i_s& basis) : │ │ │ │ │ +35 _b_a_s_i_s__(&basis) │ │ │ │ │ +36 {} │ │ │ │ │ 37 │ │ │ │ │ -_3_8 typedef _E_l_e_m_e_n_t _v_a_l_u_e___t_y_p_e; │ │ │ │ │ -39 │ │ │ │ │ -_4_1 typedef typename GridView::template Codim::Iterator _c_o_n_s_t___i_t_e_r_a_t_o_r; │ │ │ │ │ -42 │ │ │ │ │ -_4_4 typedef _c_o_n_s_t___i_t_e_r_a_t_o_r _i_t_e_r_a_t_o_r; │ │ │ │ │ +_4_1 _s_i_z_e___t_y_p_e _o_p_e_r_a_t_o_r_(_)(const _S_i_z_e_P_r_e_f_i_x& prefix) const │ │ │ │ │ +42 { │ │ │ │ │ +43 return _b_a_s_i_s__->size(prefix); │ │ │ │ │ +44 } │ │ │ │ │ 45 │ │ │ │ │ -_4_7 _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) : │ │ │ │ │ -48 gv_(gv) │ │ │ │ │ -49 {} │ │ │ │ │ -50 │ │ │ │ │ -_5_2 bool _c_o_n_t_a_i_n_s(const _E_l_e_m_e_n_t& e) const │ │ │ │ │ +_5_2 _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 │ │ │ │ │ 53 { │ │ │ │ │ -54 return gv_.contains(e); │ │ │ │ │ +54 return _b_a_s_i_s__->size(prefix); │ │ │ │ │ 55 } │ │ │ │ │ 56 │ │ │ │ │ -_5_8 size_t _s_i_z_e() const │ │ │ │ │ -59 { │ │ │ │ │ -60 return gv_.size(_c_o_d_i_m); │ │ │ │ │ -61 } │ │ │ │ │ -62 │ │ │ │ │ -_6_4 _c_o_n_s_t___i_t_e_r_a_t_o_r _b_e_g_i_n() const │ │ │ │ │ -65 { │ │ │ │ │ -66 return gv_.template begin(); │ │ │ │ │ -67 } │ │ │ │ │ -68 │ │ │ │ │ -_7_0 _c_o_n_s_t___i_t_e_r_a_t_o_r _e_n_d() const │ │ │ │ │ -71 { │ │ │ │ │ -72 return gv_.template end(); │ │ │ │ │ -73 } │ │ │ │ │ +_5_7 operator _s_i_z_e___t_y_p_e () const │ │ │ │ │ +58 { │ │ │ │ │ +59 return _b_a_s_i_s__->dimension(); │ │ │ │ │ +60 } │ │ │ │ │ +61 │ │ │ │ │ +62protected: │ │ │ │ │ +63 │ │ │ │ │ +_6_4 const _B_a_s_i_s* _b_a_s_i_s__; │ │ │ │ │ +65}; │ │ │ │ │ +66 │ │ │ │ │ +67 │ │ │ │ │ +68template │ │ │ │ │ +_6_9_S_i_z_e_I_n_f_o_<_B_a_s_i_s_> _s_i_z_e_I_n_f_o(const Basis& basis) │ │ │ │ │ +70{ │ │ │ │ │ +71 return _S_i_z_e_I_n_f_o_<_B_a_s_i_s_>(basis); │ │ │ │ │ +72} │ │ │ │ │ +73 │ │ │ │ │ 74 │ │ │ │ │ -_7_6 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ │ -77 { │ │ │ │ │ -78 return gv_; │ │ │ │ │ -79 } │ │ │ │ │ -80 │ │ │ │ │ -81private: │ │ │ │ │ -82 _G_r_i_d_V_i_e_w gv_; │ │ │ │ │ -83}; │ │ │ │ │ -84 │ │ │ │ │ -85 │ │ │ │ │ -86} // end of namespace Dune::Functions │ │ │ │ │ -87} // end of namespace Dune │ │ │ │ │ -88 │ │ │ │ │ -89#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH │ │ │ │ │ +75 │ │ │ │ │ +76} // end namespace Functions │ │ │ │ │ +77} // end namespace Dune │ │ │ │ │ +78 │ │ │ │ │ +79#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SIZEINFO_HH │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:23 │ │ │ │ │ -_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:47 │ │ │ │ │ -_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 │ │ │ │ │ -GV GridView │ │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:26 │ │ │ │ │ -_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_l_e_m_e_n_t │ │ │ │ │ -GridView::template Codim< codim >::Entity Element │ │ │ │ │ -Type of Elements contained in this EntitySet. │ │ │ │ │ -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_:_:_e_n_d │ │ │ │ │ -const_iterator end() const │ │ │ │ │ -Create an end iterator. │ │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:70 │ │ │ │ │ -_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:76 │ │ │ │ │ -_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_:_:_v_a_l_u_e___t_y_p_e │ │ │ │ │ -Element value_type │ │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:38 │ │ │ │ │ -_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:64 │ │ │ │ │ -_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_s_t___i_t_e_r_a_t_o_r │ │ │ │ │ -GridView::template Codim< codim >::Iterator const_iterator │ │ │ │ │ -A forward iterator. │ │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:41 │ │ │ │ │ -_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_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ │ -Element::Geometry::LocalCoordinate LocalCoordinate │ │ │ │ │ -Type of local coordinates with respect to the Element. │ │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:35 │ │ │ │ │ -_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:58 │ │ │ │ │ -_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_l_o_b_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ │ -Element::Geometry::GlobalCoordinate GlobalCoordinate │ │ │ │ │ -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_:_:_c_o_d_i_m │ │ │ │ │ -@ codim │ │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:28 │ │ │ │ │ -_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:52 │ │ │ │ │ -_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_:_:_i_t_e_r_a_t_o_r │ │ │ │ │ -const_iterator iterator │ │ │ │ │ -Same as const_iterator. │ │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:44 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_s_i_z_e_I_n_f_o │ │ │ │ │ +SizeInfo< Basis > sizeInfo(const Basis &basis) │ │ │ │ │ +DDeeffiinniittiioonn sizeinfo.hh:69 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_z_e_I_n_f_o │ │ │ │ │ +A class encapsulating size information. │ │ │ │ │ +DDeeffiinniittiioonn sizeinfo.hh:25 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_z_e_I_n_f_o_:_:_S_i_z_e_P_r_e_f_i_x │ │ │ │ │ +typename Basis::SizePrefix SizePrefix │ │ │ │ │ +DDeeffiinniittiioonn sizeinfo.hh:29 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_z_e_I_n_f_o_:_:_s_i_z_e │ │ │ │ │ +size_type size(const SizePrefix &prefix) const │ │ │ │ │ +Return number possible values for next position in multi index. │ │ │ │ │ +DDeeffiinniittiioonn sizeinfo.hh:52 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_z_e_I_n_f_o_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ │ +size_type operator()(const SizePrefix &prefix) const │ │ │ │ │ +Return number possible values for next position in multi index. │ │ │ │ │ +DDeeffiinniittiioonn sizeinfo.hh:41 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_z_e_I_n_f_o_:_:_s_i_z_e___t_y_p_e │ │ │ │ │ +typename Basis::size_type size_type │ │ │ │ │ +DDeeffiinniittiioonn sizeinfo.hh:28 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_z_e_I_n_f_o_:_:_B_a_s_i_s │ │ │ │ │ +B Basis │ │ │ │ │ +DDeeffiinniittiioonn sizeinfo.hh:27 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_z_e_I_n_f_o_:_:_S_i_z_e_I_n_f_o │ │ │ │ │ +SizeInfo(const Basis &basis) │ │ │ │ │ +Construct from basis. │ │ │ │ │ +DDeeffiinniittiioonn sizeinfo.hh:34 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_S_i_z_e_I_n_f_o_:_:_b_a_s_i_s__ │ │ │ │ │ +const Basis * basis_ │ │ │ │ │ +DDeeffiinniittiioonn sizeinfo.hh:64 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00176.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: discreteglobalbasisfunction.hh File Reference │ │ │ │ +dune-functions: periodicbasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,73 +65,58 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces | │ │ │ │ Functions
│ │ │ │ -
discreteglobalbasisfunction.hh File Reference
│ │ │ │ +
periodicbasis.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <memory>
│ │ │ │ -#include <optional>
│ │ │ │ -#include <dune/common/typetraits.hh>
│ │ │ │ -#include <dune/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 <utility>
│ │ │ │ +#include <type_traits>
│ │ │ │ +#include <limits>
│ │ │ │ +#include <set>
│ │ │ │ +#include <vector>
│ │ │ │ +#include <dune/functions/functionspacebases/concepts.hh>
│ │ │ │ +#include <dune/functions/functionspacebases/transformedindexbasis.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...
class  Dune::Functions::BasisFactory::Experimental::PeriodicIndexSet
 Container storing identified indices for a periodic basis. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

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

│ │ │ │ Functions

template<typename R , typename B , typename V >
auto Dune::Functions::makeDiscreteGlobalBasisFunction (B &&basis, V &&vector)
 Generate a DiscreteGlobalBasisFunction.
 
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,59 +1,38 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _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_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ _C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -discreteglobalbasisfunction.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_/_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> │ │ │ │ │ +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_/_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_:_:_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_._._. │ │ │ │ │ +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_:_:_I_m_p_l_D_o_c │ │ │ │ │ +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_:_:_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. │ │ │ │ │ +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. │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00176_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: discreteglobalbasisfunction.hh Source File │ │ │ │ +dune-functions: periodicbasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,681 +70,218 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
discreteglobalbasisfunction.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#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_PERIODICBASIS_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_PERIODICBASIS_HH
│ │ │ │
5
│ │ │ │ -
6#include <memory>
│ │ │ │ -
7#include <optional>
│ │ │ │ -
8
│ │ │ │ -
9#include <dune/common/typetraits.hh>
│ │ │ │ -
10
│ │ │ │ -
11#include <dune/typetree/treecontainer.hh>
│ │ │ │ -
12
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ +
6#include <utility>
│ │ │ │ +
7#include <type_traits>
│ │ │ │ +
8#include <limits>
│ │ │ │ +
9#include <set>
│ │ │ │ +
10#include <vector>
│ │ │ │ +
11
│ │ │ │ + │ │ │ │ + │ │ │ │ +
14
│ │ │ │ +
15
│ │ │ │ +
16namespace Dune::Functions {
│ │ │ │ +
17
│ │ │ │ +
18namespace BasisFactory {
│ │ │ │
19
│ │ │ │ -
20namespace Dune {
│ │ │ │ -
21namespace Functions {
│ │ │ │ -
22
│ │ │ │ +
20// The PeriodicBasis class is in the Experimental namespace because we are
│ │ │ │ +
21// not completely sure yet whether we like it. We reserve the right to
│ │ │ │ +
22// modify it without advance warning. Use at your own risk!
│ │ │ │
23
│ │ │ │
│ │ │ │ -
24namespace ImplDoc {
│ │ │ │ +
24namespace Experimental {
│ │ │ │
25
│ │ │ │ -
26template<typename B, typename V, typename NTRE>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
28{
│ │ │ │ -
29public:
│ │ │ │ -
30 using Basis = B;
│ │ │ │ -
31 using Vector = V;
│ │ │ │ -
32
│ │ │ │ -
33 // In order to make the cache work for proxy-references
│ │ │ │ -
34 // we have to use AutonomousValue<T> instead of std::decay_t<T>
│ │ │ │ -
35 using Coefficient = Dune::AutonomousValue<decltype(std::declval<Vector>()[std::declval<typename Basis::MultiIndex>()])>;
│ │ │ │ -
36
│ │ │ │ -
37 using GridView = typename Basis::GridView;
│ │ │ │ - │ │ │ │ -
39 using Tree = typename Basis::LocalView::Tree;
│ │ │ │ -
40 using NodeToRangeEntry = NTRE;
│ │ │ │ -
41
│ │ │ │ - │ │ │ │ -
43
│ │ │ │ - │ │ │ │ -
45 using Element = typename EntitySet::Element;
│ │ │ │ -
46
│ │ │ │ -
47protected:
│ │ │ │ -
48
│ │ │ │ -
49 // This collects all data that is shared by all related
│ │ │ │ -
50 // global and local functions. This way we don't need to
│ │ │ │ -
51 // keep track of it individually.
│ │ │ │ -
│ │ │ │ -
52 struct Data
│ │ │ │ -
53 {
│ │ │ │ - │ │ │ │ -
55 std::shared_ptr<const Basis> basis;
│ │ │ │ -
56 std::shared_ptr<const Vector> coefficients;
│ │ │ │ -
57 std::shared_ptr<const NodeToRangeEntry> nodeToRangeEntry;
│ │ │ │ -
58 };
│ │ │ │ -
│ │ │ │ -
59
│ │ │ │ -
60public:
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
62 {
│ │ │ │ -
63 using LocalView = typename Basis::LocalView;
│ │ │ │ -
64 using size_type = typename Tree::size_type;
│ │ │ │ -
65
│ │ │ │ -
66 public:
│ │ │ │ - │ │ │ │ -
68 using Element = typename EntitySet::Element;
│ │ │ │ -
69
│ │ │ │ -
70 protected:
│ │ │ │ -
│ │ │ │ -
71 LocalFunctionBase(const std::shared_ptr<const Data>& data)
│ │ │ │ -
72 : data_(data)
│ │ │ │ -
73 , localView_(data_->basis->localView())
│ │ │ │ -
74 {
│ │ │ │ -
75 localDoFs_.reserve(localView_.maxSize());
│ │ │ │ -
76 }
│ │ │ │ -
│ │ │ │ -
77
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
85 : data_(other.data_)
│ │ │ │ -
86 , localView_(other.localView_)
│ │ │ │ -
87 {
│ │ │ │ -
88 localDoFs_.reserve(localView_.maxSize());
│ │ │ │ -
89 if (bound())
│ │ │ │ -
90 localDoFs_ = other.localDoFs_;
│ │ │ │ -
91 }
│ │ │ │ -
│ │ │ │ -
92
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
101 {
│ │ │ │ -
102 data_ = other.data_;
│ │ │ │ -
103 localView_ = other.localView_;
│ │ │ │ -
104 if (bound())
│ │ │ │ -
105 localDoFs_ = other.localDoFs_;
│ │ │ │ -
106 return *this;
│ │ │ │ -
107 }
│ │ │ │ -
│ │ │ │ -
108
│ │ │ │ -
109 public:
│ │ │ │ -
│ │ │ │ -
116 void bind(const Element& element)
│ │ │ │ -
117 {
│ │ │ │ -
118 localView_.bind(element);
│ │ │ │ -
119 // Use cache of full local view size. For a subspace basis,
│ │ │ │ -
120 // this may be larger than the number of local DOFs in the
│ │ │ │ -
121 // tree. In this case only cache entries associated to local
│ │ │ │ -
122 // DOFs in the subspace are filled. Cache entries associated
│ │ │ │ -
123 // to local DOFs which are not contained in the subspace will
│ │ │ │ -
124 // not be touched.
│ │ │ │ -
125 //
│ │ │ │ -
126 // Alternatively one could use a cache that exactly fits
│ │ │ │ -
127 // the size of the tree. However, this would require to
│ │ │ │ -
128 // subtract an offset from localIndex(i) on each cache
│ │ │ │ -
129 // access in operator().
│ │ │ │ -
130 localDoFs_.resize(localView_.size());
│ │ │ │ -
131 const auto& dofs = *data_->coefficients;
│ │ │ │ -
132 for (size_type i = 0; i < localView_.tree().size(); ++i)
│ │ │ │ -
133 {
│ │ │ │ -
134 // For a subspace basis the index-within-tree i
│ │ │ │ -
135 // is not the same as the localIndex within the
│ │ │ │ -
136 // full local view.
│ │ │ │ -
137 size_t localIndex = localView_.tree().localIndex(i);
│ │ │ │ -
138 localDoFs_[localIndex] = dofs[localView_.index(localIndex)];
│ │ │ │ -
139 }
│ │ │ │ -
140 }
│ │ │ │ -
│ │ │ │ -
141
│ │ │ │ -
│ │ │ │ -
143 void unbind()
│ │ │ │ -
144 {
│ │ │ │ -
145 localView_.unbind();
│ │ │ │ -
146 }
│ │ │ │ +
26
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
36{
│ │ │ │ +
37 using IndexPairSet = std::set<std::pair<std::size_t,std::size_t>>;
│ │ │ │ +
38public:
│ │ │ │ +
39
│ │ │ │ +
│ │ │ │ +
47 void unifyIndexPair(std::size_t a, std::size_t b)
│ │ │ │ +
48 {
│ │ │ │ +
49 if (a>b)
│ │ │ │ +
50 std::swap(a,b);
│ │ │ │ +
51 if (a==b)
│ │ │ │ +
52 return;
│ │ │ │ +
53 indexPairSet_.insert(std::make_pair(a,b));
│ │ │ │ +
54 }
│ │ │ │ +
│ │ │ │ +
55
│ │ │ │ +
│ │ │ │ +
56 const auto& indexPairSet() const
│ │ │ │ +
57 {
│ │ │ │ +
58 return indexPairSet_;
│ │ │ │ +
59 }
│ │ │ │ +
│ │ │ │ +
60
│ │ │ │ +
61private:
│ │ │ │ +
62 IndexPairSet indexPairSet_;
│ │ │ │ +
63};
│ │ │ │
│ │ │ │ +
64
│ │ │ │ +
65
│ │ │ │ +
66
│ │ │ │ +
67namespace Impl {
│ │ │ │ +
68
│ │ │ │ +
69// An index transformation for a TransformedIndexPreBasis
│ │ │ │ +
70// implementing periodic functions by merging indices.
│ │ │ │ +
71// Currently only flat indices are supported.
│ │ │ │ +
72class PeriodicIndexingTransformation
│ │ │ │ +
73{
│ │ │ │ +
74public:
│ │ │ │ +
75
│ │ │ │ +
76 static constexpr std::size_t minIndexSize = 1;
│ │ │ │ +
77 static constexpr std::size_t maxIndexSize = 1;
│ │ │ │ +
78
│ │ │ │ +
79 template<class RawPreBasis, class IndexPairSet>
│ │ │ │ +
80 PeriodicIndexingTransformation(const RawPreBasis& rawPreBasis, const IndexPairSet& indexPairSet)
│ │ │ │ +
81 {
│ │ │ │ +
82 static_assert(RawPreBasis::maxMultiIndexSize==1, "PeriodicIndexingTransformation is only implemented for flat multi-indices");
│ │ │ │ +
83 std::size_t invalid = {std::numeric_limits<std::size_t>::max()};
│ │ │ │ +
84 mappedIdx_.resize(rawPreBasis.size(), invalid);
│ │ │ │ +
85 numIndices_ = 0;
│ │ │ │ +
86 std::size_t i = 0;
│ │ │ │ +
87 for(const auto& [a, b] : indexPairSet)
│ │ │ │ +
88 {
│ │ │ │ +
89 for(; i<=a; ++i)
│ │ │ │ +
90 if (mappedIdx_[i] == invalid)
│ │ │ │ +
91 mappedIdx_[i] = numIndices_++;
│ │ │ │ +
92 mappedIdx_[b] = mappedIdx_[a];
│ │ │ │ +
93 }
│ │ │ │ +
94 for(; i<rawPreBasis.size(); ++i)
│ │ │ │ +
95 if (mappedIdx_[i] == invalid)
│ │ │ │ +
96 mappedIdx_[i] = numIndices_++;
│ │ │ │ +
97 }
│ │ │ │ +
98
│ │ │ │ +
99 template<class MultiIndex, class PreBasis>
│ │ │ │ +
100 void transformIndex(MultiIndex& multiIndex, const PreBasis& preBasis) const
│ │ │ │ +
101 {
│ │ │ │ +
102 multiIndex = {{ mappedIdx_[multiIndex[0]] }};
│ │ │ │ +
103 }
│ │ │ │ +
104
│ │ │ │ +
105 template<class Prefix, class PreBasis>
│ │ │ │ +
106 std::size_t size(const Prefix& prefix, const PreBasis& preBasis) const
│ │ │ │ +
107 {
│ │ │ │ +
108 if (prefix.size() == 1)
│ │ │ │ +
109 return 0;
│ │ │ │ +
110 return numIndices_;
│ │ │ │ +
111 }
│ │ │ │ +
112
│ │ │ │ +
113 template<class PreBasis>
│ │ │ │ +
114 auto dimension(const PreBasis& preBasis) const
│ │ │ │ +
115 {
│ │ │ │ +
116 return numIndices_;
│ │ │ │ +
117 }
│ │ │ │ +
118
│ │ │ │ +
119private:
│ │ │ │ +
120 std::vector<std::size_t> mappedIdx_;
│ │ │ │ +
121 std::size_t numIndices_;
│ │ │ │ +
122};
│ │ │ │ +
123
│ │ │ │ +
124
│ │ │ │ +
125
│ │ │ │ +
126template<class RawPreBasisIndicator>
│ │ │ │ +
127class PeriodicPreBasisFactory
│ │ │ │ +
128{
│ │ │ │ +
129public:
│ │ │ │ +
130 PeriodicPreBasisFactory()
│ │ │ │ +
131 {}
│ │ │ │ +
132
│ │ │ │ +
133 template<class RPBI, class PIS>
│ │ │ │ +
134 PeriodicPreBasisFactory(RPBI&& rawPreBasisIndicator, PIS&& periodicIndexSet) :
│ │ │ │ +
135 rawPreBasisIndicator_(std::forward<RPBI>(rawPreBasisIndicator)),
│ │ │ │ +
136 periodicIndexSet_(std::forward<PIS>(periodicIndexSet))
│ │ │ │ +
137 {}
│ │ │ │ +
138
│ │ │ │ +
139 template<class GridView,
│ │ │ │ +
140 std::enable_if_t<models<Concept::GlobalBasis<GridView>,RawPreBasisIndicator>(), int> = 0>
│ │ │ │ +
141 auto operator()(const GridView& gridView) const
│ │ │ │ +
142 {
│ │ │ │ +
143 const auto& rawPreBasis = rawPreBasisIndicator_.preBasis();
│ │ │ │ +
144 auto transformation = PeriodicIndexingTransformation(rawPreBasis, periodicIndexSet_.indexPairSet());
│ │ │ │ +
145 return Dune::Functions::Experimental::TransformedIndexPreBasis(std::move(rawPreBasis), std::move(transformation));
│ │ │ │ +
146 }
│ │ │ │
147
│ │ │ │ -
│ │ │ │ -
149 bool bound() const
│ │ │ │ -
150 {
│ │ │ │ -
151 return localView_.bound();
│ │ │ │ -
152 }
│ │ │ │ -
│ │ │ │ -
153
│ │ │ │ -
│ │ │ │ -
155 const Element& localContext() const
│ │ │ │ -
156 {
│ │ │ │ -
157 return localView_.element();
│ │ │ │ -
158 }
│ │ │ │ -
│ │ │ │ -
159
│ │ │ │ -
160 protected:
│ │ │ │ -
161
│ │ │ │ -
162 template<class To, class From>
│ │ │ │ -
│ │ │ │ -
163 void assignWith(To& to, const From& from) const
│ │ │ │ -
164 {
│ │ │ │ -
165 auto from_flat = flatVectorView(from);
│ │ │ │ -
166 auto to_flat = flatVectorView(to);
│ │ │ │ -
167 assert(from_flat.size() == to_flat.size());
│ │ │ │ -
168 for (size_type i = 0; i < to_flat.size(); ++i)
│ │ │ │ -
169 to_flat[i] = from_flat[i];
│ │ │ │ -
170 }
│ │ │ │ -
│ │ │ │ -
171
│ │ │ │ -
172 template<class Node, class TreePath, class Range>
│ │ │ │ -
│ │ │ │ -
173 decltype(auto) nodeToRangeEntry(const Node& node, const TreePath& treePath, Range& y) const
│ │ │ │ -
174 {
│ │ │ │ -
175 return (*data_->nodeToRangeEntry)(node, treePath, y);
│ │ │ │ -
176 }
│ │ │ │ -
│ │ │ │ -
177
│ │ │ │ -
178 std::shared_ptr<const Data> data_;
│ │ │ │ -
179 LocalView localView_;
│ │ │ │ -
180 std::vector<Coefficient> localDoFs_;
│ │ │ │ -
181 };
│ │ │ │ -
│ │ │ │ -
182
│ │ │ │ -
183protected:
│ │ │ │ -
│ │ │ │ -
184 DiscreteGlobalBasisFunctionBase(const std::shared_ptr<const Data>& data)
│ │ │ │ -
185 : data_(data)
│ │ │ │ -
186 {
│ │ │ │ -
187 /* Nothing. */
│ │ │ │ -
188 }
│ │ │ │ -
│ │ │ │ -
189
│ │ │ │ -
190public:
│ │ │ │ -
191
│ │ │ │ -
│ │ │ │ -
193 const Basis& basis() const
│ │ │ │ -
194 {
│ │ │ │ -
195 return *data_->basis;
│ │ │ │ -
196 }
│ │ │ │ -
│ │ │ │ -
197
│ │ │ │ -
│ │ │ │ -
199 const Vector& dofs() const
│ │ │ │ -
200 {
│ │ │ │ -
201 return *data_->coefficients;
│ │ │ │ -
202 }
│ │ │ │ -
│ │ │ │ -
203
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
206 {
│ │ │ │ -
207 return *data_->nodeToRangeEntry;
│ │ │ │ -
208 }
│ │ │ │ -
│ │ │ │ -
209
│ │ │ │ -
│ │ │ │ -
211 const EntitySet& entitySet() const
│ │ │ │ -
212 {
│ │ │ │ -
213 return data_->entitySet;
│ │ │ │ -
214 }
│ │ │ │ -
│ │ │ │ -
215
│ │ │ │ -
216protected:
│ │ │ │ -
217 std::shared_ptr<const Data> data_;
│ │ │ │ -
218};
│ │ │ │ -
│ │ │ │ -
219
│ │ │ │ -
220} // namespace ImplDoc
│ │ │ │ -
│ │ │ │ -
221
│ │ │ │ -
222
│ │ │ │ -
223
│ │ │ │ -
224template<typename DGBF>
│ │ │ │ - │ │ │ │ -
226
│ │ │ │ -
264template<typename B, typename V,
│ │ │ │ -
265 typename NTRE = HierarchicNodeToRangeMap,
│ │ │ │ -
266 typename R = typename V::value_type>
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ -
269{
│ │ │ │ - │ │ │ │ -
271 using Data = typename Base::Data;
│ │ │ │ -
272
│ │ │ │ -
273public:
│ │ │ │ -
274 using Basis = typename Base::Basis;
│ │ │ │ -
275 using Vector = typename Base::Vector;
│ │ │ │ -
276
│ │ │ │ -
277 using Domain = typename Base::Domain;
│ │ │ │ -
278 using Range = R;
│ │ │ │ -
279
│ │ │ │ -
280 using Traits = Imp::GridFunctionTraits<Range(Domain), typename Base::EntitySet, DefaultDerivativeTraits, 16>;
│ │ │ │ -
281
│ │ │ │ -
282private:
│ │ │ │ -
283
│ │ │ │ -
284 template<class Node>
│ │ │ │ -
285 using LocalBasisRange = typename Node::FiniteElement::Traits::LocalBasisType::Traits::RangeType;
│ │ │ │ -
286 template<class Node>
│ │ │ │ -
287 using NodeData = typename std::vector<LocalBasisRange<Node>>;
│ │ │ │ -
288 using PerNodeEvaluationBuffer = typename TypeTree::TreeContainer<NodeData, typename Base::Tree>;
│ │ │ │ -
289
│ │ │ │ -
290public:
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ -
293 {
│ │ │ │ -
294 using LocalBase = typename Base::LocalFunctionBase;
│ │ │ │ -
295 using size_type = typename Base::Tree::size_type;
│ │ │ │ -
296 using LocalBase::nodeToRangeEntry;
│ │ │ │ -
297
│ │ │ │ -
298 public:
│ │ │ │ -
299
│ │ │ │ - │ │ │ │ -
301 using Domain = typename LocalBase::Domain;
│ │ │ │ - │ │ │ │ -
303 using Element = typename LocalBase::Element;
│ │ │ │ -
304
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
307 : LocalBase(globalFunction.data_)
│ │ │ │ -
308 , evaluationBuffer_(this->localView_.tree())
│ │ │ │ -
309 {
│ │ │ │ -
310 /* Nothing. */
│ │ │ │ -
311 }
│ │ │ │ -
│ │ │ │ -
312
│ │ │ │ -
│ │ │ │ -
322 Range operator()(const Domain& x) const
│ │ │ │ -
323 {
│ │ │ │ -
324 Range y;
│ │ │ │ -
325 istlVectorBackend(y) = 0;
│ │ │ │ -
326
│ │ │ │ -
327 TypeTree::forEachLeafNode(this->localView_.tree(), [&](auto&& node, auto&& treePath) {
│ │ │ │ -
328 const auto& fe = node.finiteElement();
│ │ │ │ -
329 const auto& localBasis = fe.localBasis();
│ │ │ │ -
330 auto& shapeFunctionValues = evaluationBuffer_[treePath];
│ │ │ │ -
331
│ │ │ │ -
332 localBasis.evaluateFunction(x, shapeFunctionValues);
│ │ │ │ -
333
│ │ │ │ -
334 // Compute linear combinations of basis function jacobian.
│ │ │ │ -
335 // Non-scalar coefficients of dimension coeffDim are handled by
│ │ │ │ -
336 // processing the coeffDim linear combinations independently
│ │ │ │ -
337 // and storing them as entries of an array.
│ │ │ │ -
338 using Value = LocalBasisRange< std::decay_t<decltype(node)> >;
│ │ │ │ -
339 static constexpr auto coeffDim = decltype(flatVectorView(this->localDoFs_[node.localIndex(0)]).size())::value;
│ │ │ │ -
340 auto values = std::array<Value, coeffDim>{};
│ │ │ │ -
341 istlVectorBackend(values) = 0;
│ │ │ │ -
342 for (size_type i = 0; i < localBasis.size(); ++i)
│ │ │ │ -
343 {
│ │ │ │ -
344 auto c = flatVectorView(this->localDoFs_[node.localIndex(i)]);
│ │ │ │ -
345 for (std::size_t j = 0; j < coeffDim; ++j)
│ │ │ │ -
346 values[j].axpy(c[j], shapeFunctionValues[i]);
│ │ │ │ -
347 }
│ │ │ │ -
348
│ │ │ │ -
349 // Assign computed values to node entry of range.
│ │ │ │ -
350 // Types are matched using the lexicographic ordering provided by flatVectorView.
│ │ │ │ -
351 LocalBase::assignWith(nodeToRangeEntry(node, treePath, y), values);
│ │ │ │ -
352 });
│ │ │ │ -
353
│ │ │ │ -
354 return y;
│ │ │ │ -
355 }
│ │ │ │ -
│ │ │ │ -
356
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
359 {
│ │ │ │ - │ │ │ │ -
361 if (lf.bound())
│ │ │ │ -
362 dlf.bind(lf.localContext());
│ │ │ │ -
363 return dlf;
│ │ │ │ -
364 }
│ │ │ │ -
│ │ │ │ -
365
│ │ │ │ -
366 private:
│ │ │ │ -
367 mutable PerNodeEvaluationBuffer evaluationBuffer_;
│ │ │ │ -
368 };
│ │ │ │ -
│ │ │ │ -
369
│ │ │ │ -
371 template<class B_T, class V_T, class NTRE_T>
│ │ │ │ -
│ │ │ │ -
372 DiscreteGlobalBasisFunction(B_T && basis, V_T && coefficients, NTRE_T&& nodeToRangeEntry)
│ │ │ │ -
373 : 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))}))
│ │ │ │ -
374 {}
│ │ │ │ -
│ │ │ │ -
375
│ │ │ │ -
│ │ │ │ -
377 DiscreteGlobalBasisFunction(std::shared_ptr<const Basis> basis, std::shared_ptr<const V> coefficients, std::shared_ptr<const typename Base::NodeToRangeEntry> nodeToRangeEntry)
│ │ │ │ -
378 : Base(std::make_shared<Data>(Data{{basis->gridView()}, basis, coefficients, nodeToRangeEntry}))
│ │ │ │ -
379 {}
│ │ │ │ -
│ │ │ │ -
380
│ │ │ │ -
│ │ │ │ -
382 Range operator() (const Domain& x) const
│ │ │ │ -
383 {
│ │ │ │ -
384 // TODO: Implement this using hierarchic search
│ │ │ │ -
385 DUNE_THROW(NotImplemented,"not implemented");
│ │ │ │ -
386 }
│ │ │ │ -
│ │ │ │ -
387
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
390 {
│ │ │ │ - │ │ │ │ -
392 }
│ │ │ │ -
│ │ │ │ -
393
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
403 {
│ │ │ │ -
404 return LocalFunction(t);
│ │ │ │ -
405 }
│ │ │ │ -
│ │ │ │ -
406};
│ │ │ │ -
│ │ │ │ -
407
│ │ │ │ -
408
│ │ │ │ -
431template<typename R, typename B, typename V>
│ │ │ │ -
│ │ │ │ -
432auto makeDiscreteGlobalBasisFunction(B&& basis, V&& vector)
│ │ │ │ -
433{
│ │ │ │ -
434 using Basis = std::decay_t<B>;
│ │ │ │ -
435 using NTREM = HierarchicNodeToRangeMap;
│ │ │ │ -
436
│ │ │ │ -
437 // Small helper functions to wrap vectors using istlVectorBackend
│ │ │ │ -
438 // if they do not already satisfy the VectorBackend interface.
│ │ │ │ -
439 auto toConstVectorBackend = [&](auto&& v) -> decltype(auto) {
│ │ │ │ -
440 if constexpr (models<Concept::ConstVectorBackend<Basis>, decltype(v)>()) {
│ │ │ │ -
441 return std::forward<decltype(v)>(v);
│ │ │ │ -
442 } else {
│ │ │ │ -
443 return istlVectorBackend(v);
│ │ │ │ -
444 }
│ │ │ │ -
445 };
│ │ │ │ -
446
│ │ │ │ -
447 using Vector = std::decay_t<decltype(toConstVectorBackend(std::forward<V>(vector)))>;
│ │ │ │ - │ │ │ │ -
449 std::forward<B>(basis),
│ │ │ │ -
450 toConstVectorBackend(std::forward<V>(vector)),
│ │ │ │ - │ │ │ │ -
452}
│ │ │ │ -
│ │ │ │ -
453
│ │ │ │ -
454
│ │ │ │ -
469template<typename DGBF>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
471 : public ImplDoc::DiscreteGlobalBasisFunctionBase<typename DGBF::Basis, typename DGBF::Vector, typename DGBF::NodeToRangeEntry>
│ │ │ │ -
472{
│ │ │ │ - │ │ │ │ -
474 using Data = typename Base::Data;
│ │ │ │ -
475
│ │ │ │ -
476public:
│ │ │ │ - │ │ │ │ -
478
│ │ │ │ -
479 using Basis = typename Base::Basis;
│ │ │ │ -
480 using Vector = typename Base::Vector;
│ │ │ │ -
481
│ │ │ │ -
482 using Domain = typename Base::Domain;
│ │ │ │ - │ │ │ │ -
484
│ │ │ │ -
485 using Traits = Imp::GridFunctionTraits<Range(Domain), typename Base::EntitySet, DefaultDerivativeTraits, 16>;
│ │ │ │ -
486
│ │ │ │ -
487private:
│ │ │ │ -
488
│ │ │ │ -
489 template<class Node>
│ │ │ │ -
490 using LocalBasisRange = typename Node::FiniteElement::Traits::LocalBasisType::Traits::JacobianType;
│ │ │ │ -
491 template<class Node>
│ │ │ │ -
492 using NodeData = typename std::vector< LocalBasisRange<Node> >;
│ │ │ │ -
493 using PerNodeEvaluationBuffer = typename TypeTree::TreeContainer<NodeData, typename Base::Tree>;
│ │ │ │ -
494
│ │ │ │ -
495public:
│ │ │ │ -
496
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ -
506 {
│ │ │ │ -
507 using LocalBase = typename Base::LocalFunctionBase;
│ │ │ │ -
508 using size_type = typename Base::Tree::size_type;
│ │ │ │ -
509 using LocalBase::nodeToRangeEntry;
│ │ │ │ -
510
│ │ │ │ -
511 public:
│ │ │ │ - │ │ │ │ -
513 using Domain = typename LocalBase::Domain;
│ │ │ │ - │ │ │ │ -
515 using Element = typename LocalBase::Element;
│ │ │ │ -
516
│ │ │ │ -
│ │ │ │ -
518 LocalFunction(const GlobalFunction& globalFunction)
│ │ │ │ -
519 : LocalBase(globalFunction.data_)
│ │ │ │ -
520 , evaluationBuffer_(this->localView_.tree())
│ │ │ │ -
521 {
│ │ │ │ -
522 /* Nothing. */
│ │ │ │ -
523 }
│ │ │ │ -
│ │ │ │ -
524
│ │ │ │ -
│ │ │ │ -
531 void bind(const Element& element)
│ │ │ │ -
532 {
│ │ │ │ -
533 LocalBase::bind(element);
│ │ │ │ -
534 geometry_.emplace(element.geometry());
│ │ │ │ -
535 }
│ │ │ │ -
│ │ │ │ -
536
│ │ │ │ -
│ │ │ │ -
538 void unbind()
│ │ │ │ -
539 {
│ │ │ │ -
540 geometry_.reset();
│ │ │ │ -
541 LocalBase::unbind();
│ │ │ │ -
542 }
│ │ │ │ -
│ │ │ │ -
543
│ │ │ │ -
│ │ │ │ -
557 Range operator()(const Domain& x) const
│ │ │ │ -
558 {
│ │ │ │ -
559 Range y;
│ │ │ │ -
560 istlVectorBackend(y) = 0;
│ │ │ │ -
561
│ │ │ │ -
562 const auto& jacobianInverse = geometry_->jacobianInverse(x);
│ │ │ │ -
563
│ │ │ │ -
564 TypeTree::forEachLeafNode(this->localView_.tree(), [&](auto&& node, auto&& treePath) {
│ │ │ │ -
565 const auto& fe = node.finiteElement();
│ │ │ │ -
566 const auto& localBasis = fe.localBasis();
│ │ │ │ -
567 auto& shapeFunctionJacobians = evaluationBuffer_[treePath];
│ │ │ │ -
568
│ │ │ │ -
569 localBasis.evaluateJacobian(x, shapeFunctionJacobians);
│ │ │ │ -
570
│ │ │ │ -
571 // Compute linear combinations of basis function jacobian.
│ │ │ │ -
572 // Non-scalar coefficients of dimension coeffDim are handled by
│ │ │ │ -
573 // processing the coeffDim linear combinations independently
│ │ │ │ -
574 // and storing them as entries of an array.
│ │ │ │ -
575 using RefJacobian = LocalBasisRange< std::decay_t<decltype(node)> >;
│ │ │ │ -
576 static constexpr auto coeffDim = decltype(flatVectorView(this->localDoFs_[node.localIndex(0)]).size())::value;
│ │ │ │ -
577 auto refJacobians = std::array<RefJacobian, coeffDim>{};
│ │ │ │ -
578 istlVectorBackend(refJacobians) = 0;
│ │ │ │ -
579 for (size_type i = 0; i < localBasis.size(); ++i)
│ │ │ │ -
580 {
│ │ │ │ -
581 auto c = flatVectorView(this->localDoFs_[node.localIndex(i)]);
│ │ │ │ -
582 for (std::size_t j = 0; j < coeffDim; ++j)
│ │ │ │ -
583 refJacobians[j].axpy(c[j], shapeFunctionJacobians[i]);
│ │ │ │ -
584 }
│ │ │ │ -
585
│ │ │ │ -
586 // Transform Jacobians form local to global coordinates.
│ │ │ │ -
587 using Jacobian = decltype(refJacobians[0] * jacobianInverse);
│ │ │ │ -
588 auto jacobians = std::array<Jacobian, coeffDim>{};
│ │ │ │ -
589 std::transform(
│ │ │ │ -
590 refJacobians.begin(), refJacobians.end(), jacobians.begin(),
│ │ │ │ -
591 [&](const auto& refJacobian) { return refJacobian * jacobianInverse; });
│ │ │ │ -
592
│ │ │ │ -
593 // Assign computed Jacobians to node entry of range.
│ │ │ │ -
594 // Types are matched using the lexicographic ordering provided by flatVectorView.
│ │ │ │ -
595 LocalBase::assignWith(nodeToRangeEntry(node, treePath, y), jacobians);
│ │ │ │ -
596 });
│ │ │ │ -
597
│ │ │ │ -
598 return y;
│ │ │ │ -
599 }
│ │ │ │ -
│ │ │ │ -
600
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
603 {
│ │ │ │ -
604 DUNE_THROW(NotImplemented, "derivative of derivative is not implemented");
│ │ │ │ -
605 }
│ │ │ │ -
│ │ │ │ -
606
│ │ │ │ -
607 private:
│ │ │ │ -
608 mutable PerNodeEvaluationBuffer evaluationBuffer_;
│ │ │ │ -
609 std::optional<typename Element::Geometry> geometry_;
│ │ │ │ -
610 };
│ │ │ │ -
│ │ │ │ -
611
│ │ │ │ -
│ │ │ │ -
618 DiscreteGlobalBasisFunctionDerivative(const std::shared_ptr<const Data>& data)
│ │ │ │ -
619 : Base(data)
│ │ │ │ -
620 {
│ │ │ │ -
621 /* Nothing. */
│ │ │ │ -
622 }
│ │ │ │ -
│ │ │ │ -
623
│ │ │ │ -
│ │ │ │ -
625 Range operator()(const Domain& x) const
│ │ │ │ -
626 {
│ │ │ │ -
627 // TODO: Implement this using hierarchic search
│ │ │ │ -
628 DUNE_THROW(NotImplemented,"not implemented");
│ │ │ │ -
629 }
│ │ │ │ -
│ │ │ │ -
630
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
632 {
│ │ │ │ -
633 DUNE_THROW(NotImplemented, "derivative of derivative is not implemented");
│ │ │ │ -
634 }
│ │ │ │ -
│ │ │ │ -
635
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
638 {
│ │ │ │ -
639 return LocalFunction(f);
│ │ │ │ -
640 }
│ │ │ │ -
│ │ │ │ -
641};
│ │ │ │ -
│ │ │ │ -
642
│ │ │ │ -
643
│ │ │ │ -
644} // namespace Functions
│ │ │ │ -
645} // namespace Dune
│ │ │ │ -
646
│ │ │ │ -
647#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
auto makeDiscreteGlobalBasisFunction(B &&basis, V &&vector)
Generate a DiscreteGlobalBasisFunction.
Definition discreteglobalbasisfunction.hh:432
│ │ │ │ -
auto istlVectorBackend(Vector &v)
Return a vector backend wrapping non-const ISTL like containers.
Definition istlvectorbackend.hh:346
│ │ │ │ -
Definition polynomial.hh:10
│ │ │ │ -
auto flatVectorView(T &t)
Create flat vector view of passed mutable container.
Definition flatvectorview.hh:179
│ │ │ │ -
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:37
│ │ │ │ -
Helper class to deduce the signature of a callable.
Definition signature.hh:56
│ │ │ │ -
A simple node to range map using the nested tree indices.
Definition hierarchicnodetorangemap.hh:30
│ │ │ │ -
Definition discreteglobalbasisfunction.hh:28
│ │ │ │ -
std::shared_ptr< const Data > data_
Definition discreteglobalbasisfunction.hh:217
│ │ │ │ -
const Vector & dofs() const
Return the coefficients of this discrete function by reference.
Definition discreteglobalbasisfunction.hh:199
│ │ │ │ -
B Basis
Definition discreteglobalbasisfunction.hh:30
│ │ │ │ -
typename Basis::LocalView::Tree Tree
Definition discreteglobalbasisfunction.hh:39
│ │ │ │ -
V Vector
Definition discreteglobalbasisfunction.hh:31
│ │ │ │ -
typename EntitySet::Element Element
Definition discreteglobalbasisfunction.hh:45
│ │ │ │ -
typename EntitySet::LocalCoordinate LocalDomain
Definition discreteglobalbasisfunction.hh:44
│ │ │ │ -
const NodeToRangeEntry & nodeToRangeEntry() const
Return the stored node-to-range map.
Definition discreteglobalbasisfunction.hh:205
│ │ │ │ -
NTRE NodeToRangeEntry
Definition discreteglobalbasisfunction.hh:40
│ │ │ │ -
DiscreteGlobalBasisFunctionBase(const std::shared_ptr< const Data > &data)
Definition discreteglobalbasisfunction.hh:184
│ │ │ │ -
typename Basis::GridView GridView
Definition discreteglobalbasisfunction.hh:37
│ │ │ │ -
const Basis & basis() const
Return a const reference to the stored basis.
Definition discreteglobalbasisfunction.hh:193
│ │ │ │ -
GridViewEntitySet< GridView, 0 > EntitySet
Definition discreteglobalbasisfunction.hh:38
│ │ │ │ -
const EntitySet & entitySet() const
Get associated set of entities the local-function can be bound to.
Definition discreteglobalbasisfunction.hh:211
│ │ │ │ -
typename EntitySet::GlobalCoordinate Domain
Definition discreteglobalbasisfunction.hh:42
│ │ │ │ -
Dune::AutonomousValue< decltype(std::declval< Vector >()[std::declval< typename Basis::MultiIndex >()])> Coefficient
Definition discreteglobalbasisfunction.hh:35
│ │ │ │ -
Definition discreteglobalbasisfunction.hh:53
│ │ │ │ -
EntitySet entitySet
Definition discreteglobalbasisfunction.hh:54
│ │ │ │ -
std::shared_ptr< const NodeToRangeEntry > nodeToRangeEntry
Definition discreteglobalbasisfunction.hh:57
│ │ │ │ -
std::shared_ptr< const Basis > basis
Definition discreteglobalbasisfunction.hh:55
│ │ │ │ -
std::shared_ptr< const Vector > coefficients
Definition discreteglobalbasisfunction.hh:56
│ │ │ │ - │ │ │ │ -
LocalFunctionBase & operator=(const LocalFunctionBase &other)
Copy-assignment of the local-function.
Definition discreteglobalbasisfunction.hh:100
│ │ │ │ -
bool bound() const
Check if LocalFunction is already bound to an element.
Definition discreteglobalbasisfunction.hh:149
│ │ │ │ -
void bind(const Element &element)
Bind LocalFunction to grid element.
Definition discreteglobalbasisfunction.hh:116
│ │ │ │ -
typename EntitySet::Element Element
Definition discreteglobalbasisfunction.hh:68
│ │ │ │ -
const Element & localContext() const
Return the element the local-function is bound to.
Definition discreteglobalbasisfunction.hh:155
│ │ │ │ -
LocalFunctionBase(const LocalFunctionBase &other)
Copy-construct the local-function.
Definition discreteglobalbasisfunction.hh:84
│ │ │ │ -
std::vector< Coefficient > localDoFs_
Definition discreteglobalbasisfunction.hh:180
│ │ │ │ -
void assignWith(To &to, const From &from) const
Definition discreteglobalbasisfunction.hh:163
│ │ │ │ -
std::shared_ptr< const Data > data_
Definition discreteglobalbasisfunction.hh:178
│ │ │ │ -
decltype(auto) nodeToRangeEntry(const Node &node, const TreePath &treePath, Range &y) const
Definition discreteglobalbasisfunction.hh:173
│ │ │ │ -
LocalView localView_
Definition discreteglobalbasisfunction.hh:179
│ │ │ │ -
void unbind()
Unbind the local-function.
Definition discreteglobalbasisfunction.hh:143
│ │ │ │ -
LocalDomain Domain
Definition discreteglobalbasisfunction.hh:67
│ │ │ │ -
LocalFunctionBase(const std::shared_ptr< const Data > &data)
Definition discreteglobalbasisfunction.hh:71
│ │ │ │ -
Derivative of a DiscreteGlobalBasisFunction
Definition discreteglobalbasisfunction.hh:472
│ │ │ │ -
typename Base::Basis Basis
Definition discreteglobalbasisfunction.hh:479
│ │ │ │ -
friend Traits::DerivativeInterface derivative(const DiscreteGlobalBasisFunctionDerivative &f)
Definition discreteglobalbasisfunction.hh:631
│ │ │ │ -
Range operator()(const Domain &x) const
Not implemented.
Definition discreteglobalbasisfunction.hh:625
│ │ │ │ -
typename SignatureTraits< typename DiscreteGlobalBasisFunction::Traits::DerivativeInterface >::Range Range
Definition discreteglobalbasisfunction.hh:483
│ │ │ │ -
friend LocalFunction localFunction(const DiscreteGlobalBasisFunctionDerivative &f)
Construct local function from a DiscreteGlobalBasisFunctionDerivative
Definition discreteglobalbasisfunction.hh:637
│ │ │ │ -
DiscreteGlobalBasisFunctionDerivative(const std::shared_ptr< const Data > &data)
create object from DiscreateGlobalBasisFunction data
Definition discreteglobalbasisfunction.hh:618
│ │ │ │ -
DGBF DiscreteGlobalBasisFunction
Definition discreteglobalbasisfunction.hh:477
│ │ │ │ -
typename Base::Vector Vector
Definition discreteglobalbasisfunction.hh:480
│ │ │ │ -
Imp::GridFunctionTraits< Range(Domain), typename Base::EntitySet, DefaultDerivativeTraits, 16 > Traits
Definition discreteglobalbasisfunction.hh:485
│ │ │ │ -
typename Base::Domain Domain
Definition discreteglobalbasisfunction.hh:482
│ │ │ │ -
A grid function induced by a global basis and a coefficient vector.
Definition discreteglobalbasisfunction.hh:269
│ │ │ │ -
friend DiscreteGlobalBasisFunctionDerivative< DiscreteGlobalBasisFunction > derivative(const DiscreteGlobalBasisFunction &f)
Derivative of the DiscreteGlobalBasisFunction
Definition discreteglobalbasisfunction.hh:389
│ │ │ │ -
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:372
│ │ │ │ -
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:377
│ │ │ │ -
friend LocalFunction localFunction(const DiscreteGlobalBasisFunction &t)
Construct local function from a DiscreteGlobalBasisFunction.
Definition discreteglobalbasisfunction.hh:402
│ │ │ │ -
typename Base::Basis Basis
Definition discreteglobalbasisfunction.hh:274
│ │ │ │ -
Imp::GridFunctionTraits< Range(Domain), typename Base::EntitySet, DefaultDerivativeTraits, 16 > Traits
Definition discreteglobalbasisfunction.hh:280
│ │ │ │ -
R Range
Definition discreteglobalbasisfunction.hh:278
│ │ │ │ -
typename Base::Vector Vector
Definition discreteglobalbasisfunction.hh:275
│ │ │ │ -
typename Base::Domain Domain
Definition discreteglobalbasisfunction.hh:277
│ │ │ │ -
Definition discreteglobalbasisfunction.hh:293
│ │ │ │ -
GlobalFunction::Range Range
Definition discreteglobalbasisfunction.hh:302
│ │ │ │ -
typename LocalBase::Domain Domain
Definition discreteglobalbasisfunction.hh:301
│ │ │ │ -
LocalFunction(const DiscreteGlobalBasisFunction &globalFunction)
Create a local-function from the associated grid-function.
Definition discreteglobalbasisfunction.hh:306
│ │ │ │ -
friend DiscreteGlobalBasisFunctionDerivative< DiscreteGlobalBasisFunction >::LocalFunction derivative(const LocalFunction &lf)
Local function of the derivative.
Definition discreteglobalbasisfunction.hh:358
│ │ │ │ -
Range operator()(const Domain &x) const
Evaluate this local-function in coordinates x in the bound element.
Definition discreteglobalbasisfunction.hh:322
│ │ │ │ -
typename LocalBase::Element Element
Definition discreteglobalbasisfunction.hh:303
│ │ │ │ -
local function evaluating the derivative in reference coordinates
Definition discreteglobalbasisfunction.hh:506
│ │ │ │ -
Range operator()(const Domain &x) const
Evaluate this local-function in coordinates x in the bound element.
Definition discreteglobalbasisfunction.hh:557
│ │ │ │ -
typename LocalBase::Domain Domain
Definition discreteglobalbasisfunction.hh:513
│ │ │ │ -
typename LocalBase::Element Element
Definition discreteglobalbasisfunction.hh:515
│ │ │ │ -
friend Traits::LocalFunctionTraits::DerivativeInterface derivative(const LocalFunction &)
Not implemented.
Definition discreteglobalbasisfunction.hh:602
│ │ │ │ -
GlobalFunction::Range Range
Definition discreteglobalbasisfunction.hh:514
│ │ │ │ -
void unbind()
Unbind the local-function.
Definition discreteglobalbasisfunction.hh:538
│ │ │ │ -
LocalFunction(const GlobalFunction &globalFunction)
Create a local function from the associated grid function.
Definition discreteglobalbasisfunction.hh:518
│ │ │ │ -
void bind(const Element &element)
Bind LocalFunction to grid element.
Definition discreteglobalbasisfunction.hh:531
│ │ │ │ -
Definition gridfunction.hh:32
│ │ │ │ - │ │ │ │ -
GridView::template Codim< codim >::Entity Element
Type of Elements contained in this EntitySet.
Definition gridviewentityset.hh:32
│ │ │ │ -
Element::Geometry::LocalCoordinate LocalCoordinate
Type of local coordinates with respect to the Element.
Definition gridviewentityset.hh:35
│ │ │ │ -
Element::Geometry::GlobalCoordinate GlobalCoordinate
Definition gridviewentityset.hh:36
│ │ │ │ - │ │ │ │ +
148 template<class GridView,
│ │ │ │ +
149 std::enable_if_t<models<Concept::PreBasis<GridView>,RawPreBasisIndicator>(), int> = 0>
│ │ │ │ +
150 auto operator()(const GridView& gridView) const
│ │ │ │ +
151 {
│ │ │ │ +
152 const auto& rawPreBasis = rawPreBasisIndicator_;
│ │ │ │ +
153 auto transformation = PeriodicIndexingTransformation(rawPreBasis, periodicIndexSet_.indexPairSet());
│ │ │ │ +
154 return Dune::Functions::Experimental::TransformedIndexPreBasis(std::move(rawPreBasis), std::move(transformation));
│ │ │ │ +
155 }
│ │ │ │ +
156
│ │ │ │ +
157 template<class GridView,
│ │ │ │ +
158 std::enable_if_t<not models<Concept::GlobalBasis<GridView>,RawPreBasisIndicator>(), int> = 0,
│ │ │ │ +
159 std::enable_if_t<not models<Concept::PreBasis<GridView>,RawPreBasisIndicator>(), int> = 0>
│ │ │ │ +
160 auto operator()(const GridView& gridView) const
│ │ │ │ +
161 {
│ │ │ │ +
162 auto rawPreBasis = rawPreBasisIndicator_(gridView);
│ │ │ │ +
163 rawPreBasis.initializeIndices();
│ │ │ │ +
164 auto transformation = PeriodicIndexingTransformation(rawPreBasis, periodicIndexSet_.indexPairSet());
│ │ │ │ +
165 return Dune::Functions::Experimental::TransformedIndexPreBasis(std::move(rawPreBasis), std::move(transformation));
│ │ │ │ +
166 }
│ │ │ │ +
167
│ │ │ │ +
168private:
│ │ │ │ +
169 RawPreBasisIndicator rawPreBasisIndicator_;
│ │ │ │ +
170 PeriodicIndexSet periodicIndexSet_;
│ │ │ │ +
171};
│ │ │ │ +
172
│ │ │ │ +
173} // end namespace BasisFactory::Impl
│ │ │ │ +
174
│ │ │ │ +
175
│ │ │ │ +
176
│ │ │ │ +
190template<class RawPreBasisIndicator, class PIS>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
192 RawPreBasisIndicator&& rawPreBasisIndicator,
│ │ │ │ +
193 PIS&& periodicIndexSet
│ │ │ │ +
194 )
│ │ │ │ +
195{
│ │ │ │ +
196 return Impl::PeriodicPreBasisFactory<std::decay_t<RawPreBasisIndicator>>(
│ │ │ │ +
197 std::forward<RawPreBasisIndicator>(rawPreBasisIndicator),
│ │ │ │ +
198 std::forward<PIS>(periodicIndexSet));
│ │ │ │ +
199}
│ │ │ │ +
│ │ │ │ +
200
│ │ │ │ +
201} // end namespace Experimental
│ │ │ │ +
│ │ │ │ +
202
│ │ │ │ +
203} // end namespace BasisFactory
│ │ │ │ +
204
│ │ │ │ +
205} // end namespace Dune::Functions
│ │ │ │ +
206
│ │ │ │ +
207#endif // DUNE_FUFEM_PERIODICBASIS_HH
│ │ │ │ + │ │ │ │ +
auto periodic(RawPreBasisIndicator &&rawPreBasisIndicator, PIS &&periodicIndexSet)
Create a pre-basis factory that can create a periodic pre-basis.
Definition periodicbasis.hh:191
│ │ │ │ +
Definition polynomial.hh:11
│ │ │ │ +
Container storing identified indices for a periodic basis.
Definition periodicbasis.hh:36
│ │ │ │ +
void unifyIndexPair(std::size_t a, std::size_t b)
Insert a pair of indices.
Definition periodicbasis.hh:47
│ │ │ │ +
const auto & indexPairSet() const
Definition periodicbasis.hh:56
│ │ │ │ +
A pre-basis transforming multi-indices.
Definition transformedindexbasis.hh:52
│ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,853 +1,225 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _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 │ │ │ │ │ -discreteglobalbasisfunction.hh │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_PERIODICBASIS_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_PERIODICBASIS_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ -8 │ │ │ │ │ -9#include │ │ │ │ │ -10 │ │ │ │ │ -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_/_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> │ │ │ │ │ -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_/_f_l_a_t_v_e_c_t_o_r_v_i_e_w_._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_/_g_r_i_d_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_/_b_a_c_k_e_n_d_s_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ │ -18#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> │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ +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_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ │ +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_/_t_r_a_n_s_f_o_r_m_e_d_i_n_d_e_x_b_a_s_i_s_._h_h> │ │ │ │ │ +14 │ │ │ │ │ +15 │ │ │ │ │ +16namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ │ +17 │ │ │ │ │ +18namespace BasisFactory { │ │ │ │ │ 19 │ │ │ │ │ -20namespace _D_u_n_e { │ │ │ │ │ -21namespace Functions { │ │ │ │ │ -22 │ │ │ │ │ +20// The PeriodicBasis class is in the Experimental namespace because we are │ │ │ │ │ +21// not completely sure yet whether we like it. We reserve the right to │ │ │ │ │ +22// modify it without advance warning. Use at your own risk! │ │ │ │ │ 23 │ │ │ │ │ -_2_4namespace ImplDoc { │ │ │ │ │ +_2_4namespace Experimental { │ │ │ │ │ 25 │ │ │ │ │ -26template │ │ │ │ │ -_2_7class _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 │ │ │ │ │ -28{ │ │ │ │ │ -29public: │ │ │ │ │ -_3_0 using _B_a_s_i_s = B; │ │ │ │ │ -_3_1 using _V_e_c_t_o_r = V; │ │ │ │ │ -32 │ │ │ │ │ -33 // In order to make the cache work for proxy-references │ │ │ │ │ -34 // we have to use AutonomousValue instead of std::decay_t │ │ │ │ │ -_3_5 using _C_o_e_f_f_i_c_i_e_n_t = Dune::AutonomousValue() │ │ │ │ │ -[std::declval()])>; │ │ │ │ │ -36 │ │ │ │ │ -_3_7 using _G_r_i_d_V_i_e_w = typename Basis::GridView; │ │ │ │ │ -_3_8 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_>; │ │ │ │ │ -_3_9 using _T_r_e_e = typename Basis::LocalView::Tree; │ │ │ │ │ -_4_0 using _N_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y = NTRE; │ │ │ │ │ -41 │ │ │ │ │ -_4_2 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; │ │ │ │ │ -43 │ │ │ │ │ -_4_4 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; │ │ │ │ │ -_4_5 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; │ │ │ │ │ -46 │ │ │ │ │ -47protected: │ │ │ │ │ -48 │ │ │ │ │ -49 // This collects all data that is shared by all related │ │ │ │ │ -50 // global and local functions. This way we don't need to │ │ │ │ │ -51 // keep track of it individually. │ │ │ │ │ -_5_2 struct _D_a_t_a │ │ │ │ │ -53 { │ │ │ │ │ -_5_4 _E_n_t_i_t_y_S_e_t _e_n_t_i_t_y_S_e_t; │ │ │ │ │ -_5_5 std::shared_ptr _b_a_s_i_s; │ │ │ │ │ -_5_6 std::shared_ptr _c_o_e_f_f_i_c_i_e_n_t_s; │ │ │ │ │ -_5_7 std::shared_ptr _n_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y; │ │ │ │ │ -58 }; │ │ │ │ │ -59 │ │ │ │ │ -60public: │ │ │ │ │ -_6_1 class _L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e │ │ │ │ │ -62 { │ │ │ │ │ -63 using LocalView = typename Basis::LocalView; │ │ │ │ │ -64 using size_type = typename Tree::size_type; │ │ │ │ │ +26 │ │ │ │ │ +_3_5class _P_e_r_i_o_d_i_c_I_n_d_e_x_S_e_t │ │ │ │ │ +36{ │ │ │ │ │ +37 using IndexPairSet = std::set>; │ │ │ │ │ +38public: │ │ │ │ │ +39 │ │ │ │ │ +_4_7 void _u_n_i_f_y_I_n_d_e_x_P_a_i_r(std::size_t a, std::size_t b) │ │ │ │ │ +48 { │ │ │ │ │ +49 if (a>b) │ │ │ │ │ +50 std::swap(a,b); │ │ │ │ │ +51 if (a==b) │ │ │ │ │ +52 return; │ │ │ │ │ +53 indexPairSet_.insert(std::make_pair(a,b)); │ │ │ │ │ +54 } │ │ │ │ │ +55 │ │ │ │ │ +_5_6 const auto& _i_n_d_e_x_P_a_i_r_S_e_t() const │ │ │ │ │ +57 { │ │ │ │ │ +58 return indexPairSet_; │ │ │ │ │ +59 } │ │ │ │ │ +60 │ │ │ │ │ +61private: │ │ │ │ │ +62 IndexPairSet indexPairSet_; │ │ │ │ │ +63}; │ │ │ │ │ +64 │ │ │ │ │ 65 │ │ │ │ │ -66 public: │ │ │ │ │ -_6_7 using _D_o_m_a_i_n = _L_o_c_a_l_D_o_m_a_i_n; │ │ │ │ │ -_6_8 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; │ │ │ │ │ -69 │ │ │ │ │ -70 protected: │ │ │ │ │ -_7_1 _L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e(const std::shared_ptr& data) │ │ │ │ │ -72 : _d_a_t_a__(data) │ │ │ │ │ -73 , _l_o_c_a_l_V_i_e_w__(_d_a_t_a__->_b_a_s_i_s->localView()) │ │ │ │ │ -74 { │ │ │ │ │ -75 _l_o_c_a_l_D_o_F_s__.reserve(_l_o_c_a_l_V_i_e_w__.maxSize()); │ │ │ │ │ -76 } │ │ │ │ │ -77 │ │ │ │ │ -_8_4 _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) │ │ │ │ │ -85 : _d_a_t_a__(other._d_a_t_a__) │ │ │ │ │ -86 , _l_o_c_a_l_V_i_e_w__(other._l_o_c_a_l_V_i_e_w__) │ │ │ │ │ -87 { │ │ │ │ │ -88 _l_o_c_a_l_D_o_F_s__.reserve(_l_o_c_a_l_V_i_e_w__.maxSize()); │ │ │ │ │ -89 if (_b_o_u_n_d()) │ │ │ │ │ -90 _l_o_c_a_l_D_o_F_s__ = other._l_o_c_a_l_D_o_F_s__; │ │ │ │ │ -91 } │ │ │ │ │ -92 │ │ │ │ │ -_1_0_0 _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) │ │ │ │ │ +66 │ │ │ │ │ +67namespace Impl { │ │ │ │ │ +68 │ │ │ │ │ +69// An index transformation for a TransformedIndexPreBasis │ │ │ │ │ +70// implementing periodic functions by merging indices. │ │ │ │ │ +71// Currently only flat indices are supported. │ │ │ │ │ +72class PeriodicIndexingTransformation │ │ │ │ │ +73{ │ │ │ │ │ +74public: │ │ │ │ │ +75 │ │ │ │ │ +76 static constexpr std::size_t minIndexSize = 1; │ │ │ │ │ +77 static constexpr std::size_t maxIndexSize = 1; │ │ │ │ │ +78 │ │ │ │ │ +79 template │ │ │ │ │ +80 PeriodicIndexingTransformation(const RawPreBasis& rawPreBasis, const │ │ │ │ │ +IndexPairSet& indexPairSet) │ │ │ │ │ +81 { │ │ │ │ │ +82 static_assert(RawPreBasis::maxMultiIndexSize==1, │ │ │ │ │ +"PeriodicIndexingTransformation is only implemented for flat multi-indices"); │ │ │ │ │ +83 std::size_t invalid = {std::numeric_limits::max()}; │ │ │ │ │ +84 mappedIdx_.resize(rawPreBasis.size(), invalid); │ │ │ │ │ +85 numIndices_ = 0; │ │ │ │ │ +86 std::size_t i = 0; │ │ │ │ │ +87 for(const auto& [a, b] : indexPairSet) │ │ │ │ │ +88 { │ │ │ │ │ +89 for(; i<=a; ++i) │ │ │ │ │ +90 if (mappedIdx_[i] == invalid) │ │ │ │ │ +91 mappedIdx_[i] = numIndices_++; │ │ │ │ │ +92 mappedIdx_[b] = mappedIdx_[a]; │ │ │ │ │ +93 } │ │ │ │ │ +94 for(; i │ │ │ │ │ +100 void transformIndex(MultiIndex& multiIndex, const PreBasis& preBasis) const │ │ │ │ │ 101 { │ │ │ │ │ -102 _d_a_t_a__ = other._d_a_t_a__; │ │ │ │ │ -103 _l_o_c_a_l_V_i_e_w__ = other._l_o_c_a_l_V_i_e_w__; │ │ │ │ │ -104 if (_b_o_u_n_d()) │ │ │ │ │ -105 _l_o_c_a_l_D_o_F_s__ = other._l_o_c_a_l_D_o_F_s__; │ │ │ │ │ -106 return *this; │ │ │ │ │ -107 } │ │ │ │ │ -108 │ │ │ │ │ -109 public: │ │ │ │ │ -_1_1_6 void _b_i_n_d(const _E_l_e_m_e_n_t& element) │ │ │ │ │ -117 { │ │ │ │ │ -118 _l_o_c_a_l_V_i_e_w__.bind(element); │ │ │ │ │ -119 // Use cache of full local view size. For a subspace basis, │ │ │ │ │ -120 // this may be larger than the number of local DOFs in the │ │ │ │ │ -121 // tree. In this case only cache entries associated to local │ │ │ │ │ -122 // DOFs in the subspace are filled. Cache entries associated │ │ │ │ │ -123 // to local DOFs which are not contained in the subspace will │ │ │ │ │ -124 // not be touched. │ │ │ │ │ -125 // │ │ │ │ │ -126 // Alternatively one could use a cache that exactly fits │ │ │ │ │ -127 // the size of the tree. However, this would require to │ │ │ │ │ -128 // subtract an offset from localIndex(i) on each cache │ │ │ │ │ -129 // access in operator(). │ │ │ │ │ -130 _l_o_c_a_l_D_o_F_s__.resize(_l_o_c_a_l_V_i_e_w__.size()); │ │ │ │ │ -131 const auto& _d_o_f_s = *_d_a_t_a__->coefficients; │ │ │ │ │ -132 for (size_type i = 0; i < _l_o_c_a_l_V_i_e_w__.tree().size(); ++i) │ │ │ │ │ -133 { │ │ │ │ │ -134 // For a subspace basis the index-within-tree i │ │ │ │ │ -135 // is not the same as the localIndex within the │ │ │ │ │ -136 // full local view. │ │ │ │ │ -137 size_t localIndex = _l_o_c_a_l_V_i_e_w__.tree().localIndex(i); │ │ │ │ │ -138 _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)]; │ │ │ │ │ -139 } │ │ │ │ │ -140 } │ │ │ │ │ -141 │ │ │ │ │ -_1_4_3 void _u_n_b_i_n_d() │ │ │ │ │ -144 { │ │ │ │ │ -145 _l_o_c_a_l_V_i_e_w__.unbind(); │ │ │ │ │ +102 multiIndex = {{ mappedIdx_[multiIndex[0]] }}; │ │ │ │ │ +103 } │ │ │ │ │ +104 │ │ │ │ │ +105 template │ │ │ │ │ +106 std::size_t size(const Prefix& prefix, const PreBasis& preBasis) const │ │ │ │ │ +107 { │ │ │ │ │ +108 if (prefix.size() == 1) │ │ │ │ │ +109 return 0; │ │ │ │ │ +110 return numIndices_; │ │ │ │ │ +111 } │ │ │ │ │ +112 │ │ │ │ │ +113 template │ │ │ │ │ +114 auto dimension(const PreBasis& preBasis) const │ │ │ │ │ +115 { │ │ │ │ │ +116 return numIndices_; │ │ │ │ │ +117 } │ │ │ │ │ +118 │ │ │ │ │ +119private: │ │ │ │ │ +120 std::vector mappedIdx_; │ │ │ │ │ +121 std::size_t numIndices_; │ │ │ │ │ +122}; │ │ │ │ │ +123 │ │ │ │ │ +124 │ │ │ │ │ +125 │ │ │ │ │ +126template │ │ │ │ │ +127class PeriodicPreBasisFactory │ │ │ │ │ +128{ │ │ │ │ │ +129public: │ │ │ │ │ +130 PeriodicPreBasisFactory() │ │ │ │ │ +131 {} │ │ │ │ │ +132 │ │ │ │ │ +133 template │ │ │ │ │ +134 PeriodicPreBasisFactory(RPBI&& rawPreBasisIndicator, PIS&& │ │ │ │ │ +periodicIndexSet) : │ │ │ │ │ +135 rawPreBasisIndicator_(std::forward(rawPreBasisIndicator)), │ │ │ │ │ +136 periodicIndexSet_(std::forward(periodicIndexSet)) │ │ │ │ │ +137 {} │ │ │ │ │ +138 │ │ │ │ │ +139 template,RawPreBasisIndicator>(), int> = 0> │ │ │ │ │ +141 auto operator()(const GridView& gridView) const │ │ │ │ │ +142 { │ │ │ │ │ +143 const auto& rawPreBasis = rawPreBasisIndicator_.preBasis(); │ │ │ │ │ +144 auto transformation = PeriodicIndexingTransformation(rawPreBasis, │ │ │ │ │ +periodicIndexSet_.indexPairSet()); │ │ │ │ │ +145 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)); │ │ │ │ │ 146 } │ │ │ │ │ 147 │ │ │ │ │ -_1_4_9 bool _b_o_u_n_d() const │ │ │ │ │ -150 { │ │ │ │ │ -151 return _l_o_c_a_l_V_i_e_w__.bound(); │ │ │ │ │ -152 } │ │ │ │ │ -153 │ │ │ │ │ -_1_5_5 const _E_l_e_m_e_n_t& _l_o_c_a_l_C_o_n_t_e_x_t() const │ │ │ │ │ -156 { │ │ │ │ │ -157 return _l_o_c_a_l_V_i_e_w__.element(); │ │ │ │ │ -158 } │ │ │ │ │ -159 │ │ │ │ │ -160 protected: │ │ │ │ │ -161 │ │ │ │ │ -162 template │ │ │ │ │ -_1_6_3 void _a_s_s_i_g_n_W_i_t_h(To& to, const From& from) const │ │ │ │ │ -164 { │ │ │ │ │ -165 auto from_flat = _f_l_a_t_V_e_c_t_o_r_V_i_e_w(from); │ │ │ │ │ -166 auto to_flat = _f_l_a_t_V_e_c_t_o_r_V_i_e_w(to); │ │ │ │ │ -167 assert(from_flat.size() == to_flat.size()); │ │ │ │ │ -168 for (size_type i = 0; i < to_flat.size(); ++i) │ │ │ │ │ -169 to_flat[i] = from_flat[i]; │ │ │ │ │ -170 } │ │ │ │ │ -171 │ │ │ │ │ -172 template │ │ │ │ │ -_1_7_3 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 │ │ │ │ │ -174 { │ │ │ │ │ -175 return (*_d_a_t_a__->nodeToRangeEntry)(node, treePath, y); │ │ │ │ │ -176 } │ │ │ │ │ -177 │ │ │ │ │ -_1_7_8 std::shared_ptr _d_a_t_a__; │ │ │ │ │ -_1_7_9 LocalView _l_o_c_a_l_V_i_e_w__; │ │ │ │ │ -_1_8_0 std::vector _l_o_c_a_l_D_o_F_s__; │ │ │ │ │ -181 }; │ │ │ │ │ -182 │ │ │ │ │ -183protected: │ │ │ │ │ -_1_8_4 _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) │ │ │ │ │ -185 : _d_a_t_a__(data) │ │ │ │ │ -186 { │ │ │ │ │ -187 /* Nothing. */ │ │ │ │ │ -188 } │ │ │ │ │ -189 │ │ │ │ │ -190public: │ │ │ │ │ -191 │ │ │ │ │ -_1_9_3 const _B_a_s_i_s& _b_a_s_i_s() const │ │ │ │ │ -194 { │ │ │ │ │ -195 return *_d_a_t_a__->basis; │ │ │ │ │ -196 } │ │ │ │ │ -197 │ │ │ │ │ -_1_9_9 const _V_e_c_t_o_r& _d_o_f_s() const │ │ │ │ │ -200 { │ │ │ │ │ -201 return *_d_a_t_a__->coefficients; │ │ │ │ │ -202 } │ │ │ │ │ -203 │ │ │ │ │ -_2_0_5 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 │ │ │ │ │ -206 { │ │ │ │ │ -207 return *_d_a_t_a__->nodeToRangeEntry; │ │ │ │ │ -208 } │ │ │ │ │ -209 │ │ │ │ │ -_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 _d_a_t_a__->entitySet; │ │ │ │ │ -214 } │ │ │ │ │ -215 │ │ │ │ │ -216protected: │ │ │ │ │ -_2_1_7 std::shared_ptr _d_a_t_a__; │ │ │ │ │ -218}; │ │ │ │ │ -219 │ │ │ │ │ -220} // namespace ImplDoc │ │ │ │ │ -221 │ │ │ │ │ -222 │ │ │ │ │ -223 │ │ │ │ │ -224template │ │ │ │ │ -225class _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; │ │ │ │ │ -226 │ │ │ │ │ -264template │ │ │ │ │ -_2_6_7class _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 │ │ │ │ │ -268 : 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 │ │ │ │ │ -269{ │ │ │ │ │ -270 using _B_a_s_e = _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_>; │ │ │ │ │ -271 using Data = typename _B_a_s_e_:_:_D_a_t_a; │ │ │ │ │ -272 │ │ │ │ │ -273public: │ │ │ │ │ -_2_7_4 using _B_a_s_i_s = typename _B_a_s_e_:_:_B_a_s_i_s; │ │ │ │ │ -_2_7_5 using _V_e_c_t_o_r = typename _B_a_s_e_:_:_V_e_c_t_o_r; │ │ │ │ │ -276 │ │ │ │ │ -_2_7_7 using _D_o_m_a_i_n = typename _B_a_s_e_:_:_D_o_m_a_i_n; │ │ │ │ │ -_2_7_8 using _R_a_n_g_e = R; │ │ │ │ │ -279 │ │ │ │ │ -_2_8_0 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>; │ │ │ │ │ -281 │ │ │ │ │ -282private: │ │ │ │ │ -283 │ │ │ │ │ -284 template │ │ │ │ │ -285 using LocalBasisRange = typename Node::FiniteElement::Traits:: │ │ │ │ │ -LocalBasisType::Traits::RangeType; │ │ │ │ │ -286 template │ │ │ │ │ -287 using NodeData = typename std::vector>; │ │ │ │ │ -288 using PerNodeEvaluationBuffer = typename TypeTree::TreeContainer; │ │ │ │ │ -289 │ │ │ │ │ -290public: │ │ │ │ │ -_2_9_1 class _L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ │ -292 : public _B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e │ │ │ │ │ -293 { │ │ │ │ │ -294 using LocalBase = typename _B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e; │ │ │ │ │ -295 using size_type = typename Base::Tree::size_type; │ │ │ │ │ -296 using LocalBase::nodeToRangeEntry; │ │ │ │ │ -297 │ │ │ │ │ -298 public: │ │ │ │ │ -299 │ │ │ │ │ -_3_0_0 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_0_1 using _D_o_m_a_i_n = typename LocalBase::Domain; │ │ │ │ │ -_3_0_2 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_0_3 using _E_l_e_m_e_n_t = typename LocalBase::Element; │ │ │ │ │ -304 │ │ │ │ │ -_3_0_6 _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) │ │ │ │ │ -307 : LocalBase(globalFunction._d_a_t_a__) │ │ │ │ │ -308 , evaluationBuffer_(this->_l_o_c_a_l_V_i_e_w__.tree()) │ │ │ │ │ -309 { │ │ │ │ │ -310 /* Nothing. */ │ │ │ │ │ -311 } │ │ │ │ │ -312 │ │ │ │ │ -_3_2_2 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(const _D_o_m_a_i_n& x) const │ │ │ │ │ -323 { │ │ │ │ │ -324 _R_a_n_g_e y; │ │ │ │ │ -325 _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(y) = 0; │ │ │ │ │ -326 │ │ │ │ │ -327 TypeTree::forEachLeafNode(this->_l_o_c_a_l_V_i_e_w__.tree(), [&](auto&& node, auto&& │ │ │ │ │ -treePath) { │ │ │ │ │ -328 const auto& fe = node.finiteElement(); │ │ │ │ │ -329 const auto& localBasis = fe.localBasis(); │ │ │ │ │ -330 auto& shapeFunctionValues = evaluationBuffer_[treePath]; │ │ │ │ │ -331 │ │ │ │ │ -332 localBasis.evaluateFunction(x, shapeFunctionValues); │ │ │ │ │ -333 │ │ │ │ │ -334 // Compute linear combinations of basis function jacobian. │ │ │ │ │ -335 // Non-scalar coefficients of dimension coeffDim are handled by │ │ │ │ │ -336 // processing the coeffDim linear combinations independently │ │ │ │ │ -337 // and storing them as entries of an array. │ │ │ │ │ -338 using Value = LocalBasisRange< std::decay_t >; │ │ │ │ │ -339 static constexpr auto coeffDim = decltype(flatVectorView(this->localDoFs_ │ │ │ │ │ -[node.localIndex(0)]).size())::value; │ │ │ │ │ -340 auto values = std::array{}; │ │ │ │ │ -341 _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(values) = 0; │ │ │ │ │ -342 for (size_type i = 0; i < localBasis.size(); ++i) │ │ │ │ │ -343 { │ │ │ │ │ -344 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)]); │ │ │ │ │ -345 for (std::size_t j = 0; j < coeffDim; ++j) │ │ │ │ │ -346 values[j].axpy(c[j], shapeFunctionValues[i]); │ │ │ │ │ -347 } │ │ │ │ │ -348 │ │ │ │ │ -349 // Assign computed values to node entry of range. │ │ │ │ │ -350 // Types are matched using the lexicographic ordering provided by │ │ │ │ │ -flatVectorView. │ │ │ │ │ -351 LocalBase::assignWith(_n_o_d_e_T_o_R_a_n_g_e_E_n_t_r_y(node, treePath, y), values); │ │ │ │ │ -352 }); │ │ │ │ │ -353 │ │ │ │ │ -354 return y; │ │ │ │ │ -355 } │ │ │ │ │ -356 │ │ │ │ │ -_3_5_8 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) │ │ │ │ │ -359 { │ │ │ │ │ -360 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__)); │ │ │ │ │ -361 if (lf._b_o_u_n_d()) │ │ │ │ │ -362 dlf.bind(lf._l_o_c_a_l_C_o_n_t_e_x_t()); │ │ │ │ │ -363 return dlf; │ │ │ │ │ -364 } │ │ │ │ │ -365 │ │ │ │ │ -366 private: │ │ │ │ │ -367 mutable PerNodeEvaluationBuffer evaluationBuffer_; │ │ │ │ │ -368 }; │ │ │ │ │ -369 │ │ │ │ │ -371 template │ │ │ │ │ -_3_7_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_T && basis, V_T && coefficients, NTRE_T&& │ │ │ │ │ -nodeToRangeEntry) │ │ │ │ │ -373 : _B_a_s_e(std::make_shared(Data{{basis.gridView()}, wrap_or_move(std:: │ │ │ │ │ -forward(basis)), wrap_or_move(std::forward(coefficients)), │ │ │ │ │ -wrap_or_move(std::forward(nodeToRangeEntry))})) │ │ │ │ │ -374 {} │ │ │ │ │ -375 │ │ │ │ │ -_3_7_7 _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 basis, std:: │ │ │ │ │ -shared_ptr coefficients, std::shared_ptr nodeToRangeEntry) │ │ │ │ │ -378 : _B_a_s_e(std::make_shared(Data{{basis->gridView()}, basis, │ │ │ │ │ -coefficients, nodeToRangeEntry})) │ │ │ │ │ -379 {} │ │ │ │ │ -380 │ │ │ │ │ -_3_8_2 _R_a_n_g_e operator() (const _D_o_m_a_i_n& x) const │ │ │ │ │ -383 { │ │ │ │ │ -384 // TODO: Implement this using hierarchic search │ │ │ │ │ -385 DUNE_THROW(NotImplemented,"not implemented"); │ │ │ │ │ -386 } │ │ │ │ │ -387 │ │ │ │ │ -_3_8_9 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) │ │ │ │ │ -390 { │ │ │ │ │ -391 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__); │ │ │ │ │ -392 } │ │ │ │ │ -393 │ │ │ │ │ -_4_0_2 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) │ │ │ │ │ -403 { │ │ │ │ │ -404 return _L_o_c_a_l_F_u_n_c_t_i_o_n(t); │ │ │ │ │ -405 } │ │ │ │ │ -406}; │ │ │ │ │ -407 │ │ │ │ │ -408 │ │ │ │ │ -431template │ │ │ │ │ -_4_3_2auto _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) │ │ │ │ │ -433{ │ │ │ │ │ -434 using _B_a_s_i_s = std::decay_t; │ │ │ │ │ -435 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; │ │ │ │ │ -436 │ │ │ │ │ -437 // Small helper functions to wrap vectors using istlVectorBackend │ │ │ │ │ -438 // if they do not already satisfy the VectorBackend interface. │ │ │ │ │ -439 auto toConstVectorBackend = [&](auto&& v) -> decltype(auto) { │ │ │ │ │ -440 if constexpr (models, decltype(v)>()) { │ │ │ │ │ -441 return std::forward(v); │ │ │ │ │ -442 } else { │ │ │ │ │ -443 return _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(v); │ │ │ │ │ -444 } │ │ │ │ │ -445 }; │ │ │ │ │ -446 │ │ │ │ │ -447 using _V_e_c_t_o_r = std::decay_t │ │ │ │ │ -(vector)))>; │ │ │ │ │ -448 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_>( │ │ │ │ │ -449 std::forward(basis), │ │ │ │ │ -450 toConstVectorBackend(std::forward(vector)), │ │ │ │ │ -451 _H_i_e_r_a_r_c_h_i_c_N_o_d_e_T_o_R_a_n_g_e_M_a_p()); │ │ │ │ │ -452} │ │ │ │ │ -453 │ │ │ │ │ -454 │ │ │ │ │ -469template │ │ │ │ │ -_4_7_0class _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 │ │ │ │ │ -471 : 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 │ │ │ │ │ -472{ │ │ │ │ │ -473 using _B_a_s_e = _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_>; │ │ │ │ │ -474 using Data = typename _B_a_s_e_:_:_D_a_t_a; │ │ │ │ │ -475 │ │ │ │ │ -476public: │ │ │ │ │ -_4_7_7 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; │ │ │ │ │ -478 │ │ │ │ │ -_4_7_9 using _B_a_s_i_s = typename _B_a_s_e_:_:_B_a_s_i_s; │ │ │ │ │ -_4_8_0 using _V_e_c_t_o_r = typename _B_a_s_e_:_:_V_e_c_t_o_r; │ │ │ │ │ -481 │ │ │ │ │ -_4_8_2 using _D_o_m_a_i_n = typename _B_a_s_e_:_:_D_o_m_a_i_n; │ │ │ │ │ -_4_8_3 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; │ │ │ │ │ -484 │ │ │ │ │ -_4_8_5 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>; │ │ │ │ │ -486 │ │ │ │ │ -487private: │ │ │ │ │ -488 │ │ │ │ │ -489 template │ │ │ │ │ -490 using LocalBasisRange = typename Node::FiniteElement::Traits:: │ │ │ │ │ -LocalBasisType::Traits::JacobianType; │ │ │ │ │ -491 template │ │ │ │ │ -492 using NodeData = typename std::vector< LocalBasisRange >; │ │ │ │ │ -493 using PerNodeEvaluationBuffer = typename TypeTree::TreeContainer; │ │ │ │ │ -494 │ │ │ │ │ -495public: │ │ │ │ │ -496 │ │ │ │ │ -_5_0_4 class _L_o_c_a_l_F_u_n_c_t_i_o_n │ │ │ │ │ -505 : public _B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e │ │ │ │ │ -506 { │ │ │ │ │ -507 using LocalBase = typename _B_a_s_e_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_B_a_s_e; │ │ │ │ │ -508 using size_type = typename Base::Tree::size_type; │ │ │ │ │ -509 using LocalBase::nodeToRangeEntry; │ │ │ │ │ -510 │ │ │ │ │ -511 public: │ │ │ │ │ -_5_1_2 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_1_3 using _D_o_m_a_i_n = typename LocalBase::Domain; │ │ │ │ │ -_5_1_4 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_1_5 using _E_l_e_m_e_n_t = typename LocalBase::Element; │ │ │ │ │ -516 │ │ │ │ │ -_5_1_8 _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) │ │ │ │ │ -519 : LocalBase(globalFunction.data_) │ │ │ │ │ -520 , evaluationBuffer_(this->localView_.tree()) │ │ │ │ │ -521 { │ │ │ │ │ -522 /* Nothing. */ │ │ │ │ │ -523 } │ │ │ │ │ -524 │ │ │ │ │ -_5_3_1 void _b_i_n_d(const _E_l_e_m_e_n_t& element) │ │ │ │ │ -532 { │ │ │ │ │ -533 LocalBase::bind(element); │ │ │ │ │ -534 geometry_.emplace(element.geometry()); │ │ │ │ │ -535 } │ │ │ │ │ -536 │ │ │ │ │ -_5_3_8 void _u_n_b_i_n_d() │ │ │ │ │ -539 { │ │ │ │ │ -540 geometry_.reset(); │ │ │ │ │ -541 LocalBase::unbind(); │ │ │ │ │ -542 } │ │ │ │ │ -543 │ │ │ │ │ -_5_5_7 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(const _D_o_m_a_i_n& x) const │ │ │ │ │ -558 { │ │ │ │ │ -559 _R_a_n_g_e y; │ │ │ │ │ -560 _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(y) = 0; │ │ │ │ │ -561 │ │ │ │ │ -562 const auto& jacobianInverse = geometry_->jacobianInverse(x); │ │ │ │ │ -563 │ │ │ │ │ -564 TypeTree::forEachLeafNode(this->localView_.tree(), [&](auto&& node, auto&& │ │ │ │ │ -treePath) { │ │ │ │ │ -565 const auto& fe = node.finiteElement(); │ │ │ │ │ -566 const auto& localBasis = fe.localBasis(); │ │ │ │ │ -567 auto& shapeFunctionJacobians = evaluationBuffer_[treePath]; │ │ │ │ │ -568 │ │ │ │ │ -569 localBasis.evaluateJacobian(x, shapeFunctionJacobians); │ │ │ │ │ -570 │ │ │ │ │ -571 // Compute linear combinations of basis function jacobian. │ │ │ │ │ -572 // Non-scalar coefficients of dimension coeffDim are handled by │ │ │ │ │ -573 // processing the coeffDim linear combinations independently │ │ │ │ │ -574 // and storing them as entries of an array. │ │ │ │ │ -575 using RefJacobian = LocalBasisRange< std::decay_t >; │ │ │ │ │ -576 static constexpr auto coeffDim = decltype(flatVectorView(this->localDoFs_ │ │ │ │ │ -[node.localIndex(0)]).size())::value; │ │ │ │ │ -577 auto refJacobians = std::array{}; │ │ │ │ │ -578 _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(refJacobians) = 0; │ │ │ │ │ -579 for (size_type i = 0; i < localBasis.size(); ++i) │ │ │ │ │ -580 { │ │ │ │ │ -581 auto c = _f_l_a_t_V_e_c_t_o_r_V_i_e_w(this->localDoFs_[node.localIndex(i)]); │ │ │ │ │ -582 for (std::size_t j = 0; j < coeffDim; ++j) │ │ │ │ │ -583 refJacobians[j].axpy(c[j], shapeFunctionJacobians[i]); │ │ │ │ │ -584 } │ │ │ │ │ -585 │ │ │ │ │ -586 // Transform Jacobians form local to global coordinates. │ │ │ │ │ -587 using Jacobian = decltype(refJacobians[0] * jacobianInverse); │ │ │ │ │ -588 auto jacobians = std::array{}; │ │ │ │ │ -589 std::transform( │ │ │ │ │ -590 refJacobians.begin(), refJacobians.end(), jacobians.begin(), │ │ │ │ │ -591 [&](const auto& refJacobian) { return refJacobian * jacobianInverse; }); │ │ │ │ │ -592 │ │ │ │ │ -593 // Assign computed Jacobians to node entry of range. │ │ │ │ │ -594 // Types are matched using the lexicographic ordering provided by │ │ │ │ │ -flatVectorView. │ │ │ │ │ -595 LocalBase::assignWith(nodeToRangeEntry(node, treePath, y), jacobians); │ │ │ │ │ -596 }); │ │ │ │ │ -597 │ │ │ │ │ -598 return y; │ │ │ │ │ -599 } │ │ │ │ │ -600 │ │ │ │ │ -_6_0_2 friend typename _T_r_a_i_t_s_:_:_L_o_c_a_l_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 _d_e_r_i_v_a_t_i_v_e │ │ │ │ │ -(const _L_o_c_a_l_F_u_n_c_t_i_o_n&) │ │ │ │ │ -603 { │ │ │ │ │ -604 DUNE_THROW(NotImplemented, "derivative of derivative is not implemented"); │ │ │ │ │ -605 } │ │ │ │ │ -606 │ │ │ │ │ -607 private: │ │ │ │ │ -608 mutable PerNodeEvaluationBuffer evaluationBuffer_; │ │ │ │ │ -609 std::optional geometry_; │ │ │ │ │ -610 }; │ │ │ │ │ -611 │ │ │ │ │ -_6_1_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_D_e_r_i_v_a_t_i_v_e(const std::shared_ptr& │ │ │ │ │ -data) │ │ │ │ │ -619 : _B_a_s_e(data) │ │ │ │ │ -620 { │ │ │ │ │ -621 /* Nothing. */ │ │ │ │ │ -622 } │ │ │ │ │ -623 │ │ │ │ │ -_6_2_5 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(const _D_o_m_a_i_n& x) const │ │ │ │ │ -626 { │ │ │ │ │ -627 // TODO: Implement this using hierarchic search │ │ │ │ │ -628 DUNE_THROW(NotImplemented,"not implemented"); │ │ │ │ │ -629 } │ │ │ │ │ -630 │ │ │ │ │ -_6_3_1 friend typename _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 _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) │ │ │ │ │ -632 { │ │ │ │ │ -633 DUNE_THROW(NotImplemented, "derivative of derivative is not implemented"); │ │ │ │ │ -634 } │ │ │ │ │ -635 │ │ │ │ │ -_6_3_7 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) │ │ │ │ │ -638 { │ │ │ │ │ -639 return _L_o_c_a_l_F_u_n_c_t_i_o_n(f); │ │ │ │ │ -640 } │ │ │ │ │ -641}; │ │ │ │ │ -642 │ │ │ │ │ -643 │ │ │ │ │ -644} // namespace Functions │ │ │ │ │ -645} // namespace Dune │ │ │ │ │ -646 │ │ │ │ │ -647#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH │ │ │ │ │ -_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 │ │ │ │ │ -_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_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:432 │ │ │ │ │ -_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:346 │ │ │ │ │ -_D_u_n_e │ │ │ │ │ -DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:179 │ │ │ │ │ -_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:37 │ │ │ │ │ -_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:56 │ │ │ │ │ -_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:30 │ │ │ │ │ -_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:28 │ │ │ │ │ -_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__ │ │ │ │ │ -std::shared_ptr< const Data > data_ │ │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:217 │ │ │ │ │ -_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:199 │ │ │ │ │ -_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:30 │ │ │ │ │ -_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: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_:_:_V_e_c_t_o_r │ │ │ │ │ -V Vector │ │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:31 │ │ │ │ │ -_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: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_:_:_L_o_c_a_l_D_o_m_a_i_n │ │ │ │ │ -typename EntitySet::LocalCoordinate LocalDomain │ │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:44 │ │ │ │ │ -_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:205 │ │ │ │ │ -_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:40 │ │ │ │ │ -_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:184 │ │ │ │ │ -_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:37 │ │ │ │ │ -_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:193 │ │ │ │ │ -_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: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_:_:_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:211 │ │ │ │ │ -_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:42 │ │ │ │ │ -_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:35 │ │ │ │ │ -_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: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_:_:_D_a_t_a_:_:_e_n_t_i_t_y_S_e_t │ │ │ │ │ -EntitySet entitySet │ │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:54 │ │ │ │ │ -_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:57 │ │ │ │ │ -_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:55 │ │ │ │ │ -_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:56 │ │ │ │ │ -_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: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_:_:_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:100 │ │ │ │ │ -_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:149 │ │ │ │ │ -_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:116 │ │ │ │ │ -_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:68 │ │ │ │ │ -_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:155 │ │ │ │ │ -_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:84 │ │ │ │ │ -_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:180 │ │ │ │ │ -_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: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_:_: │ │ │ │ │ -_d_a_t_a__ │ │ │ │ │ -std::shared_ptr< const Data > data_ │ │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:178 │ │ │ │ │ -_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:173 │ │ │ │ │ -_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:179 │ │ │ │ │ -_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:143 │ │ │ │ │ -_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:67 │ │ │ │ │ -_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:71 │ │ │ │ │ -_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:472 │ │ │ │ │ -_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:479 │ │ │ │ │ -_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:631 │ │ │ │ │ -_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 │ │ │ │ │ -Not implemented. │ │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:625 │ │ │ │ │ -_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:483 │ │ │ │ │ -_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:637 │ │ │ │ │ -_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:618 │ │ │ │ │ -_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:477 │ │ │ │ │ -_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:480 │ │ │ │ │ -_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:485 │ │ │ │ │ -_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:482 │ │ │ │ │ -_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 │ │ │ │ │ -A grid function induced by a global basis and a coefficient vector. │ │ │ │ │ -DDeeffiinniittiioonn discreteglobalbasisfunction.hh:269 │ │ │ │ │ -_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:389 │ │ │ │ │ -_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:372 │ │ │ │ │ -_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:377 │ │ │ │ │ -_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:402 │ │ │ │ │ -_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:274 │ │ │ │ │ -_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:280 │ │ │ │ │ -_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:278 │ │ │ │ │ -_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:275 │ │ │ │ │ -_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:277 │ │ │ │ │ -_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:293 │ │ │ │ │ -_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:302 │ │ │ │ │ -_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:301 │ │ │ │ │ -_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:306 │ │ │ │ │ -_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:358 │ │ │ │ │ -_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:322 │ │ │ │ │ -_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:303 │ │ │ │ │ -_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: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_:_:_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:557 │ │ │ │ │ -_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:513 │ │ │ │ │ -_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:515 │ │ │ │ │ -_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:602 │ │ │ │ │ -_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:514 │ │ │ │ │ -_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: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_:_: │ │ │ │ │ -_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:518 │ │ │ │ │ -_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:531 │ │ │ │ │ -_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: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_ _> │ │ │ │ │ -_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 │ │ │ │ │ -Type of Elements contained in this EntitySet. │ │ │ │ │ -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_ _>_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ │ -Element::Geometry::LocalCoordinate LocalCoordinate │ │ │ │ │ -Type of local coordinates with respect to the Element. │ │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:35 │ │ │ │ │ -_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:36 │ │ │ │ │ +148 template,RawPreBasisIndicator> │ │ │ │ │ +(), int> = 0> │ │ │ │ │ +150 auto operator()(const GridView& gridView) const │ │ │ │ │ +151 { │ │ │ │ │ +152 const auto& rawPreBasis = rawPreBasisIndicator_; │ │ │ │ │ +153 auto transformation = PeriodicIndexingTransformation(rawPreBasis, │ │ │ │ │ +periodicIndexSet_.indexPairSet()); │ │ │ │ │ +154 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)); │ │ │ │ │ +155 } │ │ │ │ │ +156 │ │ │ │ │ +157 template,RawPreBasisIndicator>(), int> = 0, │ │ │ │ │ +159 std::enable_if_t,RawPreBasisIndicator>(), int> = 0> │ │ │ │ │ +160 auto operator()(const GridView& gridView) const │ │ │ │ │ +161 { │ │ │ │ │ +162 auto rawPreBasis = rawPreBasisIndicator_(gridView); │ │ │ │ │ +163 rawPreBasis.initializeIndices(); │ │ │ │ │ +164 auto transformation = PeriodicIndexingTransformation(rawPreBasis, │ │ │ │ │ +periodicIndexSet_.indexPairSet()); │ │ │ │ │ +165 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)); │ │ │ │ │ +166 } │ │ │ │ │ +167 │ │ │ │ │ +168private: │ │ │ │ │ +169 RawPreBasisIndicator rawPreBasisIndicator_; │ │ │ │ │ +170 PeriodicIndexSet periodicIndexSet_; │ │ │ │ │ +171}; │ │ │ │ │ +172 │ │ │ │ │ +173} // end namespace BasisFactory::Impl │ │ │ │ │ +174 │ │ │ │ │ +175 │ │ │ │ │ +176 │ │ │ │ │ +190template │ │ │ │ │ +_1_9_1auto _p_e_r_i_o_d_i_c( │ │ │ │ │ +192 RawPreBasisIndicator&& rawPreBasisIndicator, │ │ │ │ │ +193 PIS&& periodicIndexSet │ │ │ │ │ +194 ) │ │ │ │ │ +195{ │ │ │ │ │ +196 return Impl::PeriodicPreBasisFactory>( │ │ │ │ │ +197 std::forward(rawPreBasisIndicator), │ │ │ │ │ +198 std::forward(periodicIndexSet)); │ │ │ │ │ +199} │ │ │ │ │ +200 │ │ │ │ │ +201} // end namespace Experimental │ │ │ │ │ +202 │ │ │ │ │ +203} // end namespace BasisFactory │ │ │ │ │ +204 │ │ │ │ │ +205} // end namespace Dune::Functions │ │ │ │ │ +206 │ │ │ │ │ +207#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 │ │ │ │ │ +_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:191 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ │ +DDeeffiinniittiioonn polynomial.hh:11 │ │ │ │ │ +_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:36 │ │ │ │ │ +_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:47 │ │ │ │ │ +_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:56 │ │ │ │ │ +_D_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 │ │ │ │ │ _c_o_n_c_e_p_t_s_._h_h │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00179.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: localderivativetraits.hh File Reference │ │ │ │ +dune-functions: lagrangedgbasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,44 +65,65 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces
│ │ │ │ -
localderivativetraits.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Typedefs | │ │ │ │ +Functions
│ │ │ │ +
lagrangedgbasis.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <dune/functions/common/defaultderivativetraits.hh>
│ │ │ │ +
#include <array>
│ │ │ │ +#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>
│ │ │ │
│ │ │ │

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::LagrangeDGPreBasis< GV, k >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ Namespaces

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

│ │ │ │ +Typedefs

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

│ │ │ │ +Functions

template<std::size_t k>
auto Dune::Functions::BasisFactory::lagrangeDG ()
 Create a pre-basis factory that can create a LagrangeDG pre-basis.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,28 +1,42 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _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_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -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> │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +lagrangedgbasis.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> │ │ │ │ │ _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_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s_<_ _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_:_:_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< GV, k > │ │ │ │ │ +  │ │ │ │ │ +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< GV, k > > │ │ │ │ │ +  Basis of a scalar k-th-order Lagrangean-DG 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_D_G () │ │ │ │ │ +  Create a pre-basis factory that can create a LagrangeDG pre-basis. │ │ │ │ │ +  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00179_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: localderivativetraits.hh Source File │ │ │ │ +dune-functions: lagrangedgbasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,72 +70,312 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
localderivativetraits.hh
│ │ │ │ +
lagrangedgbasis.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#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH
│ │ │ │
5
│ │ │ │ -
6
│ │ │ │ - │ │ │ │ -
8
│ │ │ │ +
6#include <array>
│ │ │ │ +
7#include <dune/common/exceptions.hh>
│ │ │ │ +
8#include <dune/common/math.hh>
│ │ │ │
9
│ │ │ │ -
10namespace Dune {
│ │ │ │ -
11namespace Functions {
│ │ │ │ -
12
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
13
│ │ │ │ -
26template<class EntitySet, template<class> class DerivativeTraits=DefaultDerivativeTraits>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
28{
│ │ │ │ -
29 using LocalDomain = typename EntitySet::LocalCoordinate;
│ │ │ │ -
30 using Domain = typename EntitySet::GlobalCoordinate;
│ │ │ │ -
31
│ │ │ │ -
32 template<class Signature>
│ │ │ │ -
│ │ │ │ -
33 struct Traits
│ │ │ │ -
34 {
│ │ │ │ - │ │ │ │ -
36 };
│ │ │ │ -
│ │ │ │ -
37
│ │ │ │ -
38 template<class R>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
40 {
│ │ │ │ -
41 using Range = typename DerivativeTraits<R(Domain)>::Range;
│ │ │ │ -
42 };
│ │ │ │ -
│ │ │ │ -
43};
│ │ │ │ -
│ │ │ │ -
44
│ │ │ │ -
45
│ │ │ │ -
46}} // namespace Dune::Functions
│ │ │ │ +
14
│ │ │ │ +
15
│ │ │ │ +
16
│ │ │ │ +
17namespace Dune {
│ │ │ │ +
18namespace Functions {
│ │ │ │ +
19
│ │ │ │ +
20
│ │ │ │ +
21
│ │ │ │ +
22// *****************************************************************************
│ │ │ │ +
23// This is the reusable part of the basis. It contains
│ │ │ │ +
24//
│ │ │ │ +
25// LagrangeDGPreBasis
│ │ │ │ +
26// LagrangeDGNode
│ │ │ │ +
27//
│ │ │ │ +
28// The pre-basis allows to create the others and is the owner of possible shared
│ │ │ │ +
29// state. These components do _not_ depend on the global basis and local view
│ │ │ │ +
30// and can be used without a global basis.
│ │ │ │ +
31// *****************************************************************************
│ │ │ │ +
32
│ │ │ │ +
33template<typename GV, int k>
│ │ │ │ + │ │ │ │ +
35
│ │ │ │ +
36template<typename GV, int k>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
38{
│ │ │ │ +
39 static const int dim = GV::dimension;
│ │ │ │ +
40
│ │ │ │ +
41public:
│ │ │ │ +
42
│ │ │ │ +
44 using GridView = GV;
│ │ │ │ +
45 using size_type = std::size_t;
│ │ │ │ +
46
│ │ │ │
47
│ │ │ │ -
48#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH
│ │ │ │ - │ │ │ │ +
48 // Precompute the number of dofs per entity type
│ │ │ │ +
49 const static int dofsPerEdge = k+1;
│ │ │ │ +
50 const static int dofsPerTriangle = (k+1)*(k+2)/2;
│ │ │ │ +
51 const static int dofsPerQuad = (k+1)*(k+1);
│ │ │ │ +
52 const static int dofsPerTetrahedron = (k+1)*(k+2)*(k+3)/6;
│ │ │ │ +
53 const static int dofsPerPrism = (k+1)*(k+1)*(k+2)/2;
│ │ │ │ +
54 const static int dofsPerHexahedron = (k+1)*(k+1)*(k+1);
│ │ │ │ +
55 const static int dofsPerPyramid = (k+1)*(k+2)*(2*k+3)/6;
│ │ │ │ +
56
│ │ │ │ +
57
│ │ │ │ + │ │ │ │ +
59
│ │ │ │ +
60 static constexpr size_type maxMultiIndexSize = 1;
│ │ │ │ +
61 static constexpr size_type minMultiIndexSize = 1;
│ │ │ │ +
62 static constexpr size_type multiIndexBufferSize = 1;
│ │ │ │ +
63
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
66 gridView_(gv)
│ │ │ │ +
67 {}
│ │ │ │ +
│ │ │ │ +
68
│ │ │ │ +
69
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
71 {
│ │ │ │ +
72 switch (dim)
│ │ │ │ +
73 {
│ │ │ │ +
74 case 1:
│ │ │ │ +
75 {
│ │ │ │ +
76 break;
│ │ │ │ +
77 }
│ │ │ │ +
78 case 2:
│ │ │ │ +
79 {
│ │ │ │ +
80 quadrilateralOffset_ = dofsPerTriangle * gridView_.size(Dune::GeometryTypes::triangle);
│ │ │ │ +
81 break;
│ │ │ │ +
82 }
│ │ │ │ +
83 case 3:
│ │ │ │ +
84 {
│ │ │ │ +
85 prismOffset_ = dofsPerTetrahedron * gridView_.size(Dune::GeometryTypes::tetrahedron);
│ │ │ │ +
86
│ │ │ │ +
87 hexahedronOffset_ = prismOffset_ + dofsPerPrism * gridView_.size(Dune::GeometryTypes::prism);
│ │ │ │ +
88
│ │ │ │ +
89 pyramidOffset_ = hexahedronOffset_ + dofsPerHexahedron * gridView_.size(Dune::GeometryTypes::hexahedron);
│ │ │ │ +
90 break;
│ │ │ │ +
91 }
│ │ │ │ +
92 }
│ │ │ │ +
93 }
│ │ │ │ +
│ │ │ │ +
94
│ │ │ │ +
│ │ │ │ +
97 const GridView& gridView() const
│ │ │ │ +
98 {
│ │ │ │ +
99 return gridView_;
│ │ │ │ +
100 }
│ │ │ │ +
│ │ │ │ +
101
│ │ │ │ +
│ │ │ │ +
102 void update(const GridView& gv)
│ │ │ │ +
103 {
│ │ │ │ +
104 gridView_ = gv;
│ │ │ │ +
105 }
│ │ │ │ +
│ │ │ │ +
106
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
111 {
│ │ │ │ +
112 return Node{};
│ │ │ │ +
113 }
│ │ │ │ +
│ │ │ │ +
114
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
116 {
│ │ │ │ +
117 switch (dim)
│ │ │ │ +
118 {
│ │ │ │ +
119 case 1:
│ │ │ │ +
120 return dofsPerEdge*gridView_.size(0);
│ │ │ │ +
121 case 2:
│ │ │ │ +
122 {
│ │ │ │ +
123 return dofsPerTriangle*gridView_.size(Dune::GeometryTypes::triangle) + dofsPerQuad*gridView_.size(Dune::GeometryTypes::quadrilateral);
│ │ │ │ +
124 }
│ │ │ │ +
125 case 3:
│ │ │ │ +
126 {
│ │ │ │ +
127 return dofsPerTetrahedron*gridView_.size(Dune::GeometryTypes::tetrahedron)
│ │ │ │ +
128 + dofsPerPyramid*gridView_.size(Dune::GeometryTypes::pyramid)
│ │ │ │ +
129 + dofsPerPrism*gridView_.size(Dune::GeometryTypes::prism)
│ │ │ │ +
130 + dofsPerHexahedron*gridView_.size(Dune::GeometryTypes::hexahedron);
│ │ │ │ +
131 }
│ │ │ │ +
132 }
│ │ │ │ +
133 DUNE_THROW(Dune::NotImplemented, "No size method for " << dim << "d grids available yet!");
│ │ │ │ +
134 }
│ │ │ │ +
│ │ │ │ +
135
│ │ │ │ +
137 template<class SizePrefix>
│ │ │ │ +
│ │ │ │ +
138 size_type size(const SizePrefix& prefix) const
│ │ │ │ +
139 {
│ │ │ │ +
140 assert(prefix.size() == 0 || prefix.size() == 1);
│ │ │ │ +
141 return (prefix.size() == 0) ? size() : 0;
│ │ │ │ +
142 }
│ │ │ │ +
│ │ │ │ +
143
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
146 {
│ │ │ │ +
147 return size();
│ │ │ │ +
148 }
│ │ │ │ +
│ │ │ │ +
149
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
151 {
│ │ │ │ +
152 return Dune::power(k+1, int(GV::dimension));
│ │ │ │ +
153 }
│ │ │ │ +
│ │ │ │ +
154
│ │ │ │ +
155 template<typename It>
│ │ │ │ +
│ │ │ │ +
156 It indices(const Node& node, It it) const
│ │ │ │ +
157 {
│ │ │ │ +
158 const auto& gridIndexSet = gridView().indexSet();
│ │ │ │ +
159 const auto& element = node.element();
│ │ │ │ +
160
│ │ │ │ +
161 size_type offset = 0;
│ │ │ │ +
162 if constexpr (dim==1)
│ │ │ │ +
163 offset = dofsPerEdge*gridIndexSet.subIndex(element,0,0);
│ │ │ │ +
164 else if constexpr (dim==2)
│ │ │ │ +
165 {
│ │ │ │ +
166 if (element.type().isTriangle())
│ │ │ │ +
167 offset = dofsPerTriangle*gridIndexSet.subIndex(element,0,0);
│ │ │ │ +
168 else if (element.type().isQuadrilateral())
│ │ │ │ +
169 offset = quadrilateralOffset_ + dofsPerQuad*gridIndexSet.subIndex(element,0,0);
│ │ │ │ +
170 else
│ │ │ │ +
171 DUNE_THROW(Dune::NotImplemented, "2d elements have to be triangles or quadrilaterals");
│ │ │ │ +
172 }
│ │ │ │ +
173 else if constexpr (dim==3)
│ │ │ │ +
174 {
│ │ │ │ +
175 if (element.type().isTetrahedron())
│ │ │ │ +
176 offset = dofsPerTetrahedron*gridIndexSet.subIndex(element,0,0);
│ │ │ │ +
177 else if (element.type().isPrism())
│ │ │ │ +
178 offset = prismOffset_ + dofsPerPrism*gridIndexSet.subIndex(element,0,0);
│ │ │ │ +
179 else if (element.type().isHexahedron())
│ │ │ │ +
180 offset = hexahedronOffset_ + dofsPerHexahedron*gridIndexSet.subIndex(element,0,0);
│ │ │ │ +
181 else if (element.type().isPyramid())
│ │ │ │ +
182 offset = pyramidOffset_ + dofsPerPyramid*gridIndexSet.subIndex(element,0,0);
│ │ │ │ +
183 else
│ │ │ │ +
184 DUNE_THROW(Dune::NotImplemented, "3d elements have to be tetrahedrons, prisms, hexahedrons or pyramids");
│ │ │ │ +
185 }
│ │ │ │ +
186 else
│ │ │ │ +
187 DUNE_THROW(Dune::NotImplemented, "No index method for " << dim << "d grids available yet!");
│ │ │ │ +
188 for (size_type i = 0, end = node.size() ; i < end ; ++i, ++it)
│ │ │ │ +
189 *it = {offset + i};
│ │ │ │ +
190 return it;
│ │ │ │ +
191 }
│ │ │ │ +
│ │ │ │ +
192
│ │ │ │ +
│ │ │ │ +
194 unsigned int order() const
│ │ │ │ +
195 {
│ │ │ │ +
196 return k;
│ │ │ │ +
197 }
│ │ │ │ +
│ │ │ │ +
198
│ │ │ │ +
199protected:
│ │ │ │ + │ │ │ │ +
201
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
206};
│ │ │ │ +
│ │ │ │ +
207
│ │ │ │ +
208
│ │ │ │ +
209
│ │ │ │ +
210namespace BasisFactory {
│ │ │ │ +
211
│ │ │ │ +
219template<std::size_t k>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
221{
│ │ │ │ +
222 return [](const auto& gridView) {
│ │ │ │ +
223 return LagrangeDGPreBasis<std::decay_t<decltype(gridView)>, k>(gridView);
│ │ │ │ +
224 };
│ │ │ │ +
225}
│ │ │ │ +
│ │ │ │ +
226
│ │ │ │ +
227} // end namespace BasisFactory
│ │ │ │ +
228
│ │ │ │ +
229
│ │ │ │ +
230
│ │ │ │ +
231// *****************************************************************************
│ │ │ │ +
232// This is the actual global basis implementation based on the reusable parts.
│ │ │ │ +
233// *****************************************************************************
│ │ │ │ +
234
│ │ │ │ +
242template<typename GV, int k>
│ │ │ │ + │ │ │ │ +
244
│ │ │ │ +
245
│ │ │ │ +
246
│ │ │ │ +
247} // end namespace Functions
│ │ │ │ +
248} // end namespace Dune
│ │ │ │ +
249
│ │ │ │ +
250
│ │ │ │ +
251#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
auto lagrangeDG()
Create a pre-basis factory that can create a LagrangeDG pre-basis.
Definition lagrangedgbasis.hh:220
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
Dummy range class to be used if no proper type is available.
Definition defaultderivativetraits.hh:23
│ │ │ │ -
Derivative traits for local functions.
Definition localderivativetraits.hh:28
│ │ │ │ -
typename EntitySet::GlobalCoordinate Domain
Definition localderivativetraits.hh:30
│ │ │ │ -
typename EntitySet::LocalCoordinate LocalDomain
Definition localderivativetraits.hh:29
│ │ │ │ -
Definition localderivativetraits.hh:34
│ │ │ │ -
InvalidRange Range
Definition localderivativetraits.hh:35
│ │ │ │ -
typename DerivativeTraits< R(Domain)>::Range Range
Definition localderivativetraits.hh:41
│ │ │ │ +
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:46
│ │ │ │ +
Definition lagrangebasis.hh:387
│ │ │ │ +
const Element & element() const
Return current element, throw if unbound.
Definition lagrangebasis.hh:439
│ │ │ │ +
Definition lagrangedgbasis.hh:38
│ │ │ │ +
size_type size() const
Definition lagrangedgbasis.hh:115
│ │ │ │ +
It indices(const Node &node, It it) const
Definition lagrangedgbasis.hh:156
│ │ │ │ +
size_type maxNodeSize() const
Definition lagrangedgbasis.hh:150
│ │ │ │ +
static constexpr size_type multiIndexBufferSize
Definition lagrangedgbasis.hh:62
│ │ │ │ +
unsigned int order() const
Polynomial order used in the local Lagrange finite-elements.
Definition lagrangedgbasis.hh:194
│ │ │ │ +
void update(const GridView &gv)
Definition lagrangedgbasis.hh:102
│ │ │ │ +
size_t hexahedronOffset_
Definition lagrangedgbasis.hh:205
│ │ │ │ +
Node makeNode() const
Create tree node.
Definition lagrangedgbasis.hh:110
│ │ │ │ +
static constexpr size_type maxMultiIndexSize
Definition lagrangedgbasis.hh:60
│ │ │ │ +
static const int dofsPerHexahedron
Definition lagrangedgbasis.hh:54
│ │ │ │ +
LagrangeDGPreBasis(const GridView &gv)
Constructor for a given grid view object.
Definition lagrangedgbasis.hh:65
│ │ │ │ +
size_t pyramidOffset_
Definition lagrangedgbasis.hh:203
│ │ │ │ +
static const int dofsPerTetrahedron
Definition lagrangedgbasis.hh:52
│ │ │ │ +
size_type size(const SizePrefix &prefix) const
Return number possible values for next position in multi index.
Definition lagrangedgbasis.hh:138
│ │ │ │ +
GV GridView
The grid view that the FE space is defined on.
Definition lagrangedgbasis.hh:44
│ │ │ │ +
void initializeIndices()
Definition lagrangedgbasis.hh:70
│ │ │ │ +
size_t quadrilateralOffset_
Definition lagrangedgbasis.hh:202
│ │ │ │ +
static const int dofsPerEdge
Definition lagrangedgbasis.hh:49
│ │ │ │ +
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition lagrangedgbasis.hh:97
│ │ │ │ +
static const int dofsPerQuad
Definition lagrangedgbasis.hh:51
│ │ │ │ +
static const int dofsPerTriangle
Definition lagrangedgbasis.hh:50
│ │ │ │ +
static const int dofsPerPyramid
Definition lagrangedgbasis.hh:55
│ │ │ │ +
GridView gridView_
Definition lagrangedgbasis.hh:200
│ │ │ │ +
static constexpr size_type minMultiIndexSize
Definition lagrangedgbasis.hh:61
│ │ │ │ +
std::size_t size_type
Definition lagrangedgbasis.hh:45
│ │ │ │ +
size_type dimension() const
Definition lagrangedgbasis.hh:145
│ │ │ │ +
size_t prismOffset_
Definition lagrangedgbasis.hh:204
│ │ │ │ +
static const int dofsPerPrism
Definition lagrangedgbasis.hh:53
│ │ │ │ +
size_type size() const
Definition nodes.hh:142
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,71 +1,369 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _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 │ │ │ │ │ -localderivativetraits.hh │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +lagrangedgbasis.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#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH │ │ │ │ │ 5 │ │ │ │ │ -6 │ │ │ │ │ -7#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> │ │ │ │ │ -8 │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ +8#include │ │ │ │ │ 9 │ │ │ │ │ -10namespace _D_u_n_e { │ │ │ │ │ -11namespace Functions { │ │ │ │ │ -12 │ │ │ │ │ +10#include <_d_u_n_e_/_f_u_n_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 <_d_u_n_e_/_f_u_n_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> │ │ │ │ │ +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_a_g_r_a_n_g_e_b_a_s_i_s_._h_h> │ │ │ │ │ 13 │ │ │ │ │ -26template class │ │ │ │ │ -DerivativeTraits=DefaultDerivativeTraits> │ │ │ │ │ -_2_7struct _L_o_c_a_l_D_e_r_i_v_a_t_i_v_e_T_r_a_i_t_s │ │ │ │ │ -28{ │ │ │ │ │ -_2_9 using _L_o_c_a_l_D_o_m_a_i_n = typename EntitySet::LocalCoordinate; │ │ │ │ │ -_3_0 using _D_o_m_a_i_n = typename EntitySet::GlobalCoordinate; │ │ │ │ │ -31 │ │ │ │ │ -32 template │ │ │ │ │ -_3_3 struct _T_r_a_i_t_s │ │ │ │ │ -34 { │ │ │ │ │ -_3_5 typedef _I_n_v_a_l_i_d_R_a_n_g_e _R_a_n_g_e; │ │ │ │ │ -36 }; │ │ │ │ │ -37 │ │ │ │ │ -38 template │ │ │ │ │ -_3_9 struct _T_r_a_i_t_s │ │ │ │ │ -40 { │ │ │ │ │ -_4_1 using _R_a_n_g_e = typename DerivativeTraits_:_:_R_a_n_g_e; │ │ │ │ │ -42 }; │ │ │ │ │ -43}; │ │ │ │ │ -44 │ │ │ │ │ -45 │ │ │ │ │ -46}} // namespace Dune::Functions │ │ │ │ │ +14 │ │ │ │ │ +15 │ │ │ │ │ +16 │ │ │ │ │ +17namespace _D_u_n_e { │ │ │ │ │ +18namespace Functions { │ │ │ │ │ +19 │ │ │ │ │ +20 │ │ │ │ │ +21 │ │ │ │ │ +22/ │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +23// This is the reusable part of the basis. It contains │ │ │ │ │ +24// │ │ │ │ │ +25// LagrangeDGPreBasis │ │ │ │ │ +26// LagrangeDGNode │ │ │ │ │ +27// │ │ │ │ │ +28// The pre-basis allows to create the others and is the owner of possible │ │ │ │ │ +shared │ │ │ │ │ +29// state. These components do _not_ depend on the global basis and local view │ │ │ │ │ +30// and can be used without a global basis. │ │ │ │ │ +31/ │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +32 │ │ │ │ │ +33template │ │ │ │ │ +_3_4using _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_>; │ │ │ │ │ +35 │ │ │ │ │ +36template │ │ │ │ │ +_3_7class _L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s │ │ │ │ │ +38{ │ │ │ │ │ +39 static const int dim = GV::dimension; │ │ │ │ │ +40 │ │ │ │ │ +41public: │ │ │ │ │ +42 │ │ │ │ │ +_4_4 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ │ +_4_5 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ +46 │ │ │ │ │ 47 │ │ │ │ │ -48#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 │ │ │ │ │ +48 // Precompute the number of dofs per entity type │ │ │ │ │ +_4_9 const static int _d_o_f_s_P_e_r_E_d_g_e = k+1; │ │ │ │ │ +_5_0 const static int _d_o_f_s_P_e_r_T_r_i_a_n_g_l_e = (k+1)*(k+2)/2; │ │ │ │ │ +_5_1 const static int _d_o_f_s_P_e_r_Q_u_a_d = (k+1)*(k+1); │ │ │ │ │ +_5_2 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; │ │ │ │ │ +_5_3 const static int _d_o_f_s_P_e_r_P_r_i_s_m = (k+1)*(k+1)*(k+2)/2; │ │ │ │ │ +_5_4 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); │ │ │ │ │ +_5_5 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; │ │ │ │ │ +56 │ │ │ │ │ +57 │ │ │ │ │ +_5_8 using _N_o_d_e = _L_a_g_r_a_n_g_e_D_G_N_o_d_e_<_G_V_,_ _k_>; │ │ │ │ │ +59 │ │ │ │ │ +_6_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 = 1; │ │ │ │ │ +_6_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 = 1; │ │ │ │ │ +_6_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 = 1; │ │ │ │ │ +63 │ │ │ │ │ +_6_5 _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) : │ │ │ │ │ +66 _g_r_i_d_V_i_e_w__(gv) │ │ │ │ │ +67 {} │ │ │ │ │ +68 │ │ │ │ │ +69 │ │ │ │ │ +_7_0 void _i_n_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s() │ │ │ │ │ +71 { │ │ │ │ │ +72 switch (dim) │ │ │ │ │ +73 { │ │ │ │ │ +74 case 1: │ │ │ │ │ +75 { │ │ │ │ │ +76 break; │ │ │ │ │ +77 } │ │ │ │ │ +78 case 2: │ │ │ │ │ +79 { │ │ │ │ │ +80 _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_T_r_i_a_n_g_l_e * _g_r_i_d_V_i_e_w__.size(Dune:: │ │ │ │ │ +GeometryTypes::triangle); │ │ │ │ │ +81 break; │ │ │ │ │ +82 } │ │ │ │ │ +83 case 3: │ │ │ │ │ +84 { │ │ │ │ │ +85 _p_r_i_s_m_O_f_f_s_e_t__ = _d_o_f_s_P_e_r_T_e_t_r_a_h_e_d_r_o_n * _g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes:: │ │ │ │ │ +tetrahedron); │ │ │ │ │ +86 │ │ │ │ │ +87 _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 * _g_r_i_d_V_i_e_w__.size(Dune:: │ │ │ │ │ +GeometryTypes::prism); │ │ │ │ │ +88 │ │ │ │ │ +89 _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_H_e_x_a_h_e_d_r_o_n * _g_r_i_d_V_i_e_w__.size │ │ │ │ │ +(Dune::GeometryTypes::hexahedron); │ │ │ │ │ +90 break; │ │ │ │ │ +91 } │ │ │ │ │ +92 } │ │ │ │ │ +93 } │ │ │ │ │ +94 │ │ │ │ │ +_9_7 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ │ +98 { │ │ │ │ │ +99 return _g_r_i_d_V_i_e_w__; │ │ │ │ │ +100 } │ │ │ │ │ +101 │ │ │ │ │ +_1_0_2 void _u_p_d_a_t_e(const _G_r_i_d_V_i_e_w& gv) │ │ │ │ │ +103 { │ │ │ │ │ +104 _g_r_i_d_V_i_e_w__ = gv; │ │ │ │ │ +105 } │ │ │ │ │ +106 │ │ │ │ │ +_1_1_0 _N_o_d_e _m_a_k_e_N_o_d_e() const │ │ │ │ │ +111 { │ │ │ │ │ +112 return _N_o_d_e{}; │ │ │ │ │ +113 } │ │ │ │ │ +114 │ │ │ │ │ +_1_1_5 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ │ +116 { │ │ │ │ │ +117 switch (dim) │ │ │ │ │ +118 { │ │ │ │ │ +119 case 1: │ │ │ │ │ +120 return _d_o_f_s_P_e_r_E_d_g_e*_g_r_i_d_V_i_e_w__.size(0); │ │ │ │ │ +121 case 2: │ │ │ │ │ +122 { │ │ │ │ │ +123 return _d_o_f_s_P_e_r_T_r_i_a_n_g_l_e*_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes::triangle) + │ │ │ │ │ +_d_o_f_s_P_e_r_Q_u_a_d*_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes::quadrilateral); │ │ │ │ │ +124 } │ │ │ │ │ +125 case 3: │ │ │ │ │ +126 { │ │ │ │ │ +127 return _d_o_f_s_P_e_r_T_e_t_r_a_h_e_d_r_o_n*_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes::tetrahedron) │ │ │ │ │ +128 + _d_o_f_s_P_e_r_P_y_r_a_m_i_d*_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes::pyramid) │ │ │ │ │ +129 + _d_o_f_s_P_e_r_P_r_i_s_m*_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes::prism) │ │ │ │ │ +130 + _d_o_f_s_P_e_r_H_e_x_a_h_e_d_r_o_n*_g_r_i_d_V_i_e_w__.size(Dune::GeometryTypes::hexahedron); │ │ │ │ │ +131 } │ │ │ │ │ +132 } │ │ │ │ │ +133 DUNE_THROW(Dune::NotImplemented, "No size method for " << dim << "d grids │ │ │ │ │ +available yet!"); │ │ │ │ │ +134 } │ │ │ │ │ +135 │ │ │ │ │ +137 template │ │ │ │ │ +_1_3_8 _s_i_z_e___t_y_p_e _s_i_z_e(const SizePrefix& prefix) const │ │ │ │ │ +139 { │ │ │ │ │ +140 assert(prefix.size() == 0 || prefix.size() == 1); │ │ │ │ │ +141 return (prefix.size() == 0) ? _s_i_z_e() : 0; │ │ │ │ │ +142 } │ │ │ │ │ +143 │ │ │ │ │ +_1_4_5 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ │ +146 { │ │ │ │ │ +147 return _s_i_z_e(); │ │ │ │ │ +148 } │ │ │ │ │ +149 │ │ │ │ │ +_1_5_0 _s_i_z_e___t_y_p_e _m_a_x_N_o_d_e_S_i_z_e() const │ │ │ │ │ +151 { │ │ │ │ │ +152 return Dune::power(k+1, int(GV::dimension)); │ │ │ │ │ +153 } │ │ │ │ │ +154 │ │ │ │ │ +155 template │ │ │ │ │ +_1_5_6 It _i_n_d_i_c_e_s(const _N_o_d_e& node, It it) const │ │ │ │ │ +157 { │ │ │ │ │ +158 const auto& gridIndexSet = _g_r_i_d_V_i_e_w().indexSet(); │ │ │ │ │ +159 const auto& element = node._e_l_e_m_e_n_t(); │ │ │ │ │ +160 │ │ │ │ │ +161 _s_i_z_e___t_y_p_e offset = 0; │ │ │ │ │ +162 if constexpr (dim==1) │ │ │ │ │ +163 offset = _d_o_f_s_P_e_r_E_d_g_e*gridIndexSet.subIndex(element,0,0); │ │ │ │ │ +164 else if constexpr (dim==2) │ │ │ │ │ +165 { │ │ │ │ │ +166 if (element.type().isTriangle()) │ │ │ │ │ +167 offset = _d_o_f_s_P_e_r_T_r_i_a_n_g_l_e*gridIndexSet.subIndex(element,0,0); │ │ │ │ │ +168 else if (element.type().isQuadrilateral()) │ │ │ │ │ +169 offset = _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_Q_u_a_d*gridIndexSet.subIndex │ │ │ │ │ +(element,0,0); │ │ │ │ │ +170 else │ │ │ │ │ +171 DUNE_THROW(Dune::NotImplemented, "2d elements have to be triangles or │ │ │ │ │ +quadrilaterals"); │ │ │ │ │ +172 } │ │ │ │ │ +173 else if constexpr (dim==3) │ │ │ │ │ +174 { │ │ │ │ │ +175 if (element.type().isTetrahedron()) │ │ │ │ │ +176 offset = _d_o_f_s_P_e_r_T_e_t_r_a_h_e_d_r_o_n*gridIndexSet.subIndex(element,0,0); │ │ │ │ │ +177 else if (element.type().isPrism()) │ │ │ │ │ +178 offset = _p_r_i_s_m_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_P_r_i_s_m*gridIndexSet.subIndex(element,0,0); │ │ │ │ │ +179 else if (element.type().isHexahedron()) │ │ │ │ │ +180 offset = _h_e_x_a_h_e_d_r_o_n_O_f_f_s_e_t__ + _d_o_f_s_P_e_r_H_e_x_a_h_e_d_r_o_n*gridIndexSet.subIndex │ │ │ │ │ +(element,0,0); │ │ │ │ │ +181 else if (element.type().isPyramid()) │ │ │ │ │ +182 offset = _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*gridIndexSet.subIndex │ │ │ │ │ +(element,0,0); │ │ │ │ │ +183 else │ │ │ │ │ +184 DUNE_THROW(Dune::NotImplemented, "3d elements have to be tetrahedrons, │ │ │ │ │ +prisms, hexahedrons or pyramids"); │ │ │ │ │ +185 } │ │ │ │ │ +186 else │ │ │ │ │ +187 DUNE_THROW(Dune::NotImplemented, "No index method for " << dim << "d grids │ │ │ │ │ +available yet!"); │ │ │ │ │ +188 for (_s_i_z_e___t_y_p_e i = 0, end = node._s_i_z_e() ; i < end ; ++i, ++it) │ │ │ │ │ +189 *it = {offset + i}; │ │ │ │ │ +190 return it; │ │ │ │ │ +191 } │ │ │ │ │ +192 │ │ │ │ │ +_1_9_4 unsigned int _o_r_d_e_r() const │ │ │ │ │ +195 { │ │ │ │ │ +196 return k; │ │ │ │ │ +197 } │ │ │ │ │ +198 │ │ │ │ │ +199protected: │ │ │ │ │ +_2_0_0 _G_r_i_d_V_i_e_w _g_r_i_d_V_i_e_w__; │ │ │ │ │ +201 │ │ │ │ │ +_2_0_2 size_t _q_u_a_d_r_i_l_a_t_e_r_a_l_O_f_f_s_e_t__; │ │ │ │ │ +_2_0_3 size_t _p_y_r_a_m_i_d_O_f_f_s_e_t__; │ │ │ │ │ +_2_0_4 size_t _p_r_i_s_m_O_f_f_s_e_t__; │ │ │ │ │ +_2_0_5 size_t _h_e_x_a_h_e_d_r_o_n_O_f_f_s_e_t__; │ │ │ │ │ +206}; │ │ │ │ │ +207 │ │ │ │ │ +208 │ │ │ │ │ +209 │ │ │ │ │ +210namespace BasisFactory { │ │ │ │ │ +211 │ │ │ │ │ +219template │ │ │ │ │ +_2_2_0auto _l_a_g_r_a_n_g_e_D_G() │ │ │ │ │ +221{ │ │ │ │ │ +222 return [](const auto& gridView) { │ │ │ │ │ +223 return _L_a_g_r_a_n_g_e_D_G_P_r_e_B_a_s_i_s, k>(gridView); │ │ │ │ │ +224 }; │ │ │ │ │ +225} │ │ │ │ │ +226 │ │ │ │ │ +227} // end namespace BasisFactory │ │ │ │ │ +228 │ │ │ │ │ +229 │ │ │ │ │ +230 │ │ │ │ │ +231/ │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +232// This is the actual global basis implementation based on the reusable │ │ │ │ │ +parts. │ │ │ │ │ +233/ │ │ │ │ │ +/ ***************************************************************************** │ │ │ │ │ +234 │ │ │ │ │ +242template │ │ │ │ │ +_2_4_3using _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_> >; │ │ │ │ │ +244 │ │ │ │ │ +245 │ │ │ │ │ +246 │ │ │ │ │ +247} // end namespace Functions │ │ │ │ │ +248} // end namespace Dune │ │ │ │ │ +249 │ │ │ │ │ +250 │ │ │ │ │ +251#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH │ │ │ │ │ +_l_a_g_r_a_n_g_e_b_a_s_i_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 │ │ │ │ │ +_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:220 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:23 │ │ │ │ │ -_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:28 │ │ │ │ │ -_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:30 │ │ │ │ │ -_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:29 │ │ │ │ │ -_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: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_:_:_T_r_a_i_t_s_:_:_R_a_n_g_e │ │ │ │ │ -InvalidRange Range │ │ │ │ │ -DDeeffiinniittiioonn localderivativetraits.hh:35 │ │ │ │ │ -_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:41 │ │ │ │ │ +_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:46 │ │ │ │ │ +_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:387 │ │ │ │ │ +_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:439 │ │ │ │ │ +_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 │ │ │ │ │ +DDeeffiinniittiioonn lagrangedgbasis.hh:38 │ │ │ │ │ +_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 │ │ │ │ │ +size_type size() const │ │ │ │ │ +DDeeffiinniittiioonn lagrangedgbasis.hh:115 │ │ │ │ │ +_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:156 │ │ │ │ │ +_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_x_N_o_d_e_S_i_z_e │ │ │ │ │ +size_type maxNodeSize() const │ │ │ │ │ +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_:_:_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 lagrangedgbasis.hh:62 │ │ │ │ │ +_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:194 │ │ │ │ │ +_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_:_:_u_p_d_a_t_e │ │ │ │ │ +void update(const GridView &gv) │ │ │ │ │ +DDeeffiinniittiioonn lagrangedgbasis.hh:102 │ │ │ │ │ +_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_:_:_h_e_x_a_h_e_d_r_o_n_O_f_f_s_e_t__ │ │ │ │ │ +size_t hexahedronOffset_ │ │ │ │ │ +DDeeffiinniittiioonn lagrangedgbasis.hh:205 │ │ │ │ │ +_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:110 │ │ │ │ │ +_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_x_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ +static constexpr size_type maxMultiIndexSize │ │ │ │ │ +DDeeffiinniittiioonn lagrangedgbasis.hh:60 │ │ │ │ │ +_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:54 │ │ │ │ │ +_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:65 │ │ │ │ │ +_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_:_:_p_y_r_a_m_i_d_O_f_f_s_e_t__ │ │ │ │ │ +size_t pyramidOffset_ │ │ │ │ │ +DDeeffiinniittiioonn lagrangedgbasis.hh:203 │ │ │ │ │ +_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:52 │ │ │ │ │ +_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 │ │ │ │ │ +size_type size(const SizePrefix &prefix) const │ │ │ │ │ +Return number possible values for next position in multi index. │ │ │ │ │ +DDeeffiinniittiioonn lagrangedgbasis.hh:138 │ │ │ │ │ +_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:44 │ │ │ │ │ +_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_i_t_i_a_l_i_z_e_I_n_d_i_c_e_s │ │ │ │ │ +void initializeIndices() │ │ │ │ │ +DDeeffiinniittiioonn lagrangedgbasis.hh:70 │ │ │ │ │ +_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_:_:_q_u_a_d_r_i_l_a_t_e_r_a_l_O_f_f_s_e_t__ │ │ │ │ │ +size_t quadrilateralOffset_ │ │ │ │ │ +DDeeffiinniittiioonn lagrangedgbasis.hh:202 │ │ │ │ │ +_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:49 │ │ │ │ │ +_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 │ │ │ │ │ +const GridView & gridView() const │ │ │ │ │ +Obtain the grid view that the basis is defined on. │ │ │ │ │ +DDeeffiinniittiioonn lagrangedgbasis.hh:97 │ │ │ │ │ +_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: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_:_:_d_o_f_s_P_e_r_T_r_i_a_n_g_l_e │ │ │ │ │ +static const int dofsPerTriangle │ │ │ │ │ +DDeeffiinniittiioonn lagrangedgbasis.hh:50 │ │ │ │ │ +_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:55 │ │ │ │ │ +_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__ │ │ │ │ │ +GridView gridView_ │ │ │ │ │ +DDeeffiinniittiioonn lagrangedgbasis.hh:200 │ │ │ │ │ +_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_i_n_M_u_l_t_i_I_n_d_e_x_S_i_z_e │ │ │ │ │ +static constexpr size_type minMultiIndexSize │ │ │ │ │ +DDeeffiinniittiioonn lagrangedgbasis.hh:61 │ │ │ │ │ +_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 │ │ │ │ │ +std::size_t size_type │ │ │ │ │ +DDeeffiinniittiioonn lagrangedgbasis.hh:45 │ │ │ │ │ +_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_i_m_e_n_s_i_o_n │ │ │ │ │ +size_type dimension() const │ │ │ │ │ +DDeeffiinniittiioonn lagrangedgbasis.hh:145 │ │ │ │ │ +_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_:_:_p_r_i_s_m_O_f_f_s_e_t__ │ │ │ │ │ +size_t prismOffset_ │ │ │ │ │ +DDeeffiinniittiioonn lagrangedgbasis.hh:204 │ │ │ │ │ +_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:53 │ │ │ │ │ +_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 │ │ │ │ │ +DDeeffiinniittiioonn nodes.hh:142 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00182.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: gridfunction.hh File Reference │ │ │ │ +dune-functions: subspacebasis.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,50 +65,61 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces
│ │ │ │ -
gridfunction.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Functions
│ │ │ │ +
subspacebasis.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <type_traits>
│ │ │ │ +
#include <dune/common/reservedvector.hh>
│ │ │ │ #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 <dune/common/concept.hh>
│ │ │ │ +#include <dune/functions/common/type_traits.hh>
│ │ │ │ +#include <dune/functions/functionspacebases/subspacelocalview.hh>
│ │ │ │ +#include <dune/functions/functionspacebases/concepts.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::SubspaceBasis< RB, TP >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +

│ │ │ │ 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())>, Impl::JoinTreePath_t< InnerTP, OuterTP > >
 
template<class RootBasis , class... PrefixTreeIndices>
auto Dune::Functions::subspaceBasis (const RootBasis &rootBasis, const TypeTree::HybridTreePath< 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)
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,34 +1,46 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _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_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -gridfunction.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +subspacebasis.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> │ │ │ │ │ +#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> │ │ │ │ │ _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_:_:_S_u_b_s_p_a_c_e_B_a_s_i_s_<_ _R_B_,_ _T_P_ _> │ │ │ │ │   │ │ │ │ │ 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) -> _S_u_b_s_p_a_c_e_B_a_s_i_s< │ │ │ │ │ + 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 _S_u_b_s_p_a_c_e_B_a_s_i_s< RootRootBasis, │ │ │ │ │ + InnerTP > &rootBasis, const OuterTP &prefixPath) -> _S_u_b_s_p_a_c_e_B_a_s_i_s< std:: │ │ │ │ │ + decay_t< decltype(rootBasis.rootBasis())>, Impl::JoinTreePath_t< InnerTP, │ │ │ │ │ + OuterTP > > │ │ │ │ │ +  │ │ │ │ │ +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::HybridTreePath< 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) │ │ │ │ │ +  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00182_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: gridfunction.hh Source File │ │ │ │ +dune-functions: subspacebasis.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,179 +70,211 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
gridfunction.hh
│ │ │ │ +
subspacebasis.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#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACEBASIS_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACEBASIS_HH
│ │ │ │
5
│ │ │ │ -
6#include <type_traits>
│ │ │ │ -
7
│ │ │ │ -
8#include <dune/common/typeutilities.hh>
│ │ │ │ +
6#include <dune/common/reservedvector.hh>
│ │ │ │ +
7#include <dune/common/typeutilities.hh>
│ │ │ │ +
8#include <dune/common/concept.hh>
│ │ │ │
9
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
17
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
13
│ │ │ │ +
14
│ │ │ │ +
15
│ │ │ │ +
16namespace Dune {
│ │ │ │ +
17namespace Functions {
│ │ │ │
18
│ │ │ │
19
│ │ │ │ -
20namespace Dune {
│ │ │ │ -
21namespace Functions {
│ │ │ │ +
20
│ │ │ │ +
21namespace Impl {
│ │ │ │
22
│ │ │ │ -
23
│ │ │ │ -
24
│ │ │ │ -
25/*
│ │ │ │ -
26 * Default implementation is empty
│ │ │ │ -
27 * The actual implementation is only given if Signature is an type
│ │ │ │ -
28 * describing a function signature as Range(Domain).
│ │ │ │ -
29 */
│ │ │ │ -
30template<class Signature, class EntitySet, template<class> class DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
32{};
│ │ │ │ -
│ │ │ │ +
23 template<class... Inner, class... Outer>
│ │ │ │ +
24 auto joinTreePaths(const TypeTree::HybridTreePath<Inner...>& inner, const TypeTree::HybridTreePath<Outer...> outer)
│ │ │ │ +
25 {
│ │ │ │ +
26 return TypeTree::HybridTreePath<Inner..., Outer...>(std::tuple_cat(inner._data, outer._data));
│ │ │ │ +
27 }
│ │ │ │ +
28
│ │ │ │ +
29 template<class InnerTP, class OuterTP>
│ │ │ │ +
30 using JoinTreePath_t = std::decay_t<decltype(joinTreePaths(std::declval<InnerTP>(), std::declval<OuterTP>()))>;
│ │ │ │ +
31
│ │ │ │ +
32}
│ │ │ │
33
│ │ │ │
34
│ │ │ │
35
│ │ │ │ -
36namespace Imp
│ │ │ │ -
37{
│ │ │ │ -
38
│ │ │ │ -
40 template<class S, class ES, template<class> class DerivativeTraits, size_t bufferSize>
│ │ │ │ -
41 struct GridFunctionTraits :
│ │ │ │ -
42 DifferentiableFunctionTraits<S, DerivativeTraits, bufferSize>
│ │ │ │ -
43 {
│ │ │ │ -
44 protected:
│ │ │ │ -
45 using Base=DifferentiableFunctionTraits<S, DerivativeTraits, bufferSize>;
│ │ │ │ +
36template<class RB, class TP>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
38{
│ │ │ │ +
39public:
│ │ │ │ +
40
│ │ │ │ +
41 using RootBasis = RB;
│ │ │ │ +
42
│ │ │ │ +
43 using RootLocalView = typename RootBasis::LocalView;
│ │ │ │ +
44
│ │ │ │ +
45 using PrefixPath = TP;
│ │ │ │
46
│ │ │ │ -
47 public:
│ │ │ │ -
49 using EntitySet = ES;
│ │ │ │ -
50
│ │ │ │ -
52 using Element = typename EntitySet::Element;
│ │ │ │ -
53
│ │ │ │ -
55 using DerivativeSignature = typename Base::DerivativeSignature;
│ │ │ │ -
56
│ │ │ │ - │ │ │ │ +
48 using GridView = typename RootBasis::GridView;
│ │ │ │ +
49
│ │ │ │ +
51 using MultiIndex = typename RootBasis::MultiIndex;
│ │ │ │ +
52
│ │ │ │ +
53 using size_type = std::size_t;
│ │ │ │ +
54
│ │ │ │ + │ │ │ │ +
57
│ │ │ │ +
58 using SizePrefix = typename RootBasis::SizePrefix;
│ │ │ │
59
│ │ │ │ -
61 using LocalSignature = typename Base::Range(typename EntitySet::LocalCoordinate);
│ │ │ │ -
62
│ │ │ │ -
64 template<class R>
│ │ │ │ - │ │ │ │ +
60
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
65 {}
│ │ │ │ +
│ │ │ │
66
│ │ │ │ -
68 using LocalFunctionTraits = typename Dune::Functions::Imp::LocalFunctionTraits<LocalSignature, Element, LocalDerivativeTraits, bufferSize>;
│ │ │ │ -
69
│ │ │ │ - │ │ │ │ -
72
│ │ │ │ -
74 using Concept = GridFunctionWrapperInterface<S, DerivativeInterface, LocalFunctionInterface, ES>;
│ │ │ │ -
75
│ │ │ │ -
77 template<class B>
│ │ │ │ -
78 using Model = GridFunctionWrapperImplementation<S, DerivativeInterface, LocalFunctionInterface, ES, B>;
│ │ │ │ -
79 };
│ │ │ │ -
80}
│ │ │ │ -
81
│ │ │ │ -
82
│ │ │ │ -
83
│ │ │ │ -
95template<class Range, class Domain, class ES, template<class> class DerivativeTraits, size_t bufferSize>
│ │ │ │ -
│ │ │ │ -
96class GridFunction<Range(Domain), ES, DerivativeTraits, bufferSize> :
│ │ │ │ -
97 public TypeErasureBase<
│ │ │ │ -
98 typename Imp::GridFunctionTraits<Range(Domain), ES, DerivativeTraits, bufferSize>::Concept,
│ │ │ │ -
99 Imp::GridFunctionTraits<Range(Domain), ES, DerivativeTraits, bufferSize>::template Model>
│ │ │ │ -
100{
│ │ │ │ -
101 using Traits = Imp::GridFunctionTraits<Range(Domain), ES, DerivativeTraits, bufferSize>;
│ │ │ │ -
102
│ │ │ │ - │ │ │ │ +
72 template<class RootRootBasis, class InnerTP, class OuterTP>
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ +
75 {}
│ │ │ │ +
│ │ │ │ +
76
│ │ │ │ +
77
│ │ │ │ +
│ │ │ │ +
80 const GridView& gridView() const
│ │ │ │ +
81 {
│ │ │ │ +
82 return rootBasis_->gridView();
│ │ │ │ +
83 }
│ │ │ │ +
│ │ │ │ +
84
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
89 {
│ │ │ │ +
90 return rootBasis_->dimension();
│ │ │ │ +
91 }
│ │ │ │ +
│ │ │ │ +
92
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
95 {
│ │ │ │ +
96 return rootBasis_->size();
│ │ │ │ +
97 }
│ │ │ │ +
│ │ │ │ +
98
│ │ │ │ +
│ │ │ │ +
100 size_type size(const SizePrefix& prefix) const
│ │ │ │ +
101 {
│ │ │ │ +
102 return rootBasis_->size(prefix);
│ │ │ │ +
103 }
│ │ │ │ +
│ │ │ │
104
│ │ │ │ -
105 using DerivativeInterface = typename Traits::DerivativeInterface;
│ │ │ │ -
106
│ │ │ │ -
107 using LocalFunctionInterface = typename Traits::LocalFunctionInterface;
│ │ │ │ -
108
│ │ │ │ -
109 using EntitySet = typename Traits::EntitySet;
│ │ │ │ -
110
│ │ │ │ -
111public:
│ │ │ │ -
112
│ │ │ │ -
124 template<class F, disableCopyMove<GridFunction, F> = 0 >
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
126 Base(std::forward<F>(f))
│ │ │ │ -
127 {
│ │ │ │ -
128 static_assert(Dune::Functions::Concept::isGridFunction<F, Range(Domain), EntitySet>(), "Trying to construct a GridFunction from type that does not model the GridFunction concept");
│ │ │ │ -
129 }
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
109 {
│ │ │ │ +
110 return LocalView(*this, prefixPath_);
│ │ │ │ +
111 }
│ │ │ │
│ │ │ │ -
130
│ │ │ │ -
131 GridFunction() = default;
│ │ │ │ +
112
│ │ │ │ +
│ │ │ │ +
113 const RootBasis& rootBasis() const
│ │ │ │ +
114 {
│ │ │ │ +
115 return *rootBasis_;
│ │ │ │ +
116 }
│ │ │ │ +
│ │ │ │ +
117
│ │ │ │ +
│ │ │ │ +
118 const PrefixPath& prefixPath() const
│ │ │ │ +
119 {
│ │ │ │ +
120 return prefixPath_;
│ │ │ │ +
121 }
│ │ │ │ +
│ │ │ │ +
122
│ │ │ │ +
123protected:
│ │ │ │ + │ │ │ │ + │ │ │ │ +
126};
│ │ │ │ +
│ │ │ │ +
127
│ │ │ │ +
128
│ │ │ │ +
129// CTAD guide for a non-SubspaceBasis root basis
│ │ │ │ +
130template<class RB, class TP>
│ │ │ │ +
131SubspaceBasis(const RB&, const TP) -> SubspaceBasis<RB, TP>;
│ │ │ │
132
│ │ │ │ -
│ │ │ │ -
138 Range operator() (const Domain& x) const
│ │ │ │ -
139 {
│ │ │ │ -
140 return this->asInterface().operator()(x);
│ │ │ │ -
141 }
│ │ │ │ -
│ │ │ │ -
142
│ │ │ │ -
│ │ │ │ -
151 friend DerivativeInterface derivative(const GridFunction& t)
│ │ │ │ -
152 {
│ │ │ │ -
153 return t.asInterface().derivative();
│ │ │ │ -
154 }
│ │ │ │ +
133// CTAD guide for a SubspaceBasis root basis
│ │ │ │ +
134template<class RootRootBasis, class InnerTP, class OuterTP>
│ │ │ │ +
135SubspaceBasis(const SubspaceBasis<RootRootBasis, InnerTP>& rootBasis, const OuterTP& prefixPath)
│ │ │ │ +
136 -> SubspaceBasis<std::decay_t<decltype(rootBasis.rootBasis())>, Impl::JoinTreePath_t<InnerTP, OuterTP>>;
│ │ │ │ +
137
│ │ │ │ +
138
│ │ │ │ +
139
│ │ │ │ +
150template<class RootBasis, class... PrefixTreeIndices>
│ │ │ │ +
│ │ │ │ +
151auto subspaceBasis(const RootBasis& rootBasis, const TypeTree::HybridTreePath<PrefixTreeIndices...>& prefixPath)
│ │ │ │ +
152{
│ │ │ │ +
153 return SubspaceBasis(rootBasis, prefixPath);
│ │ │ │ +
154}
│ │ │ │
│ │ │ │
155
│ │ │ │ -
│ │ │ │ -
165 friend LocalFunctionInterface localFunction(const GridFunction& t)
│ │ │ │ -
166 {
│ │ │ │ -
167 return t.asInterface().wrappedLocalFunction();
│ │ │ │ -
168 }
│ │ │ │ -
│ │ │ │ -
169
│ │ │ │ -
│ │ │ │ -
176 const EntitySet& entitySet() const
│ │ │ │ -
177 {
│ │ │ │ -
178 return this->asInterface().wrappedEntitySet();
│ │ │ │ -
179 }
│ │ │ │ -
│ │ │ │ -
180};
│ │ │ │ -
│ │ │ │ -
181
│ │ │ │ -
182
│ │ │ │ -
183
│ │ │ │ -
184}} // namespace Dune::Functions
│ │ │ │ -
185
│ │ │ │ -
186
│ │ │ │ -
187
│ │ │ │ -
188#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ +
156template<class RootBasis, class... PrefixTreeIndices>
│ │ │ │ +
│ │ │ │ +
157auto subspaceBasis(const RootBasis& rootBasis, const PrefixTreeIndices&... prefixTreeIndices)
│ │ │ │ +
158{
│ │ │ │ +
159 return subspaceBasis(rootBasis, TypeTree::hybridTreePath(prefixTreeIndices...));
│ │ │ │ +
160}
│ │ │ │ +
│ │ │ │ +
161
│ │ │ │ +
162
│ │ │ │ +
163
│ │ │ │ +
164} // end namespace Functions
│ │ │ │ +
165} // end namespace Dune
│ │ │ │ +
166
│ │ │ │ +
167
│ │ │ │ +
168
│ │ │ │ +
169#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH
│ │ │ │ + │ │ │ │ + │ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
Definition localfunction.hh:30
│ │ │ │ -
Base class for type-erased interface wrapper.
Definition typeerasure.hh:165
│ │ │ │ -
Definition gridfunction.hh:32
│ │ │ │ -
friend DerivativeInterface derivative(const GridFunction &t)
Get derivative of wrapped function.
Definition gridfunction.hh:151
│ │ │ │ - │ │ │ │ -
const EntitySet & entitySet() const
Get associated EntitySet.
Definition gridfunction.hh:176
│ │ │ │ -
GridFunction(F &&f)
Construct from function.
Definition gridfunction.hh:125
│ │ │ │ -
friend LocalFunctionInterface localFunction(const GridFunction &t)
Get local function of wrapped function.
Definition gridfunction.hh:165
│ │ │ │ -
Derivative traits for local functions.
Definition localderivativetraits.hh:28
│ │ │ │ +
auto subspaceBasis(const RootBasis &rootBasis, const TypeTree::HybridTreePath< PrefixTreeIndices... > &prefixPath)
Create SubspaceBasis from a root basis and a prefixPath.
Definition subspacebasis.hh:151
│ │ │ │ +
Definition subspacebasis.hh:38
│ │ │ │ +
typename RootBasis::LocalView RootLocalView
Definition subspacebasis.hh:43
│ │ │ │ +
LocalView localView() const
Return local view for basis.
Definition subspacebasis.hh:108
│ │ │ │ +
const RootBasis * rootBasis_
Definition subspacebasis.hh:124
│ │ │ │ +
typename RootBasis::SizePrefix SizePrefix
Definition subspacebasis.hh:58
│ │ │ │ +
TP PrefixPath
Definition subspacebasis.hh:45
│ │ │ │ +
SubspaceLocalView< RootLocalView, PrefixPath > LocalView
Type of the local view on the restriction of the basis to a single element.
Definition subspacebasis.hh:56
│ │ │ │ +
size_type size(const SizePrefix &prefix) const
Return number possible values for next position in multi index.
Definition subspacebasis.hh:100
│ │ │ │ +
typename RootBasis::GridView GridView
The grid view that the FE space is defined on.
Definition subspacebasis.hh:48
│ │ │ │ +
const PrefixPath & prefixPath() const
Definition subspacebasis.hh:118
│ │ │ │ +
SubspaceBasis(const SubspaceBasis< RootRootBasis, InnerTP > &rootBasis, const OuterTP &prefixPath)
Constructor from another SubspaceBasis.
Definition subspacebasis.hh:73
│ │ │ │ +
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition subspacebasis.hh:80
│ │ │ │ +
RB RootBasis
Definition subspacebasis.hh:41
│ │ │ │ +
PrefixPath prefixPath_
Definition subspacebasis.hh:125
│ │ │ │ +
size_type size() const
Return number of possible values for next position in empty multi index.
Definition subspacebasis.hh:94
│ │ │ │ +
const RootBasis & rootBasis() const
Definition subspacebasis.hh:113
│ │ │ │ +
typename RootBasis::MultiIndex MultiIndex
Type used for global numbering of the basis vectors.
Definition subspacebasis.hh:51
│ │ │ │ +
size_type dimension() const
Definition subspacebasis.hh:88
│ │ │ │ +
std::size_t size_type
Definition subspacebasis.hh:53
│ │ │ │ +
SubspaceBasis(const RootBasis &rootBasis, const PrefixPath &prefixPath)
Constructor for a given grid view object.
Definition subspacebasis.hh:62
│ │ │ │ +
The restriction of a finite element basis to a single element.
Definition subspacelocalview.hh:30
│ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,197 +1,243 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _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 │ │ │ │ │ -gridfunction.hh │ │ │ │ │ + * _f_u_n_c_t_i_o_n_s_p_a_c_e_b_a_s_e_s │ │ │ │ │ +subspacebasis.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#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACEBASIS_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACEBASIS_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7 │ │ │ │ │ -8#include │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ +8#include │ │ │ │ │ 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_e_r_a_s_u_r_e_._h_h> │ │ │ │ │ -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#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> │ │ │ │ │ -13#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> │ │ │ │ │ -14#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> │ │ │ │ │ -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_/_l_o_c_a_l_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_/_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> │ │ │ │ │ -17 │ │ │ │ │ +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_/_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> │ │ │ │ │ +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_/_c_o_n_c_e_p_t_s_._h_h> │ │ │ │ │ +13 │ │ │ │ │ +14 │ │ │ │ │ +15 │ │ │ │ │ +16namespace _D_u_n_e { │ │ │ │ │ +17namespace Functions { │ │ │ │ │ 18 │ │ │ │ │ 19 │ │ │ │ │ -20namespace _D_u_n_e { │ │ │ │ │ -21namespace Functions { │ │ │ │ │ +20 │ │ │ │ │ +21namespace Impl { │ │ │ │ │ 22 │ │ │ │ │ -23 │ │ │ │ │ -24 │ │ │ │ │ -25/* │ │ │ │ │ -26 * Default implementation is empty │ │ │ │ │ -27 * The actual implementation is only given if Signature is an type │ │ │ │ │ -28 * describing a function signature as Range(Domain). │ │ │ │ │ -29 */ │ │ │ │ │ -30template class │ │ │ │ │ -DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56> │ │ │ │ │ -_3_1class _G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ │ -32{}; │ │ │ │ │ +23 template │ │ │ │ │ +24 auto joinTreePaths(const TypeTree::HybridTreePath& inner, const │ │ │ │ │ +TypeTree::HybridTreePath outer) │ │ │ │ │ +25 { │ │ │ │ │ +26 return TypeTree::HybridTreePath(std::tuple_cat │ │ │ │ │ +(inner._data, outer._data)); │ │ │ │ │ +27 } │ │ │ │ │ +28 │ │ │ │ │ +29 template │ │ │ │ │ +30 using JoinTreePath_t = std::decay_t(), std::declval()))>; │ │ │ │ │ +31 │ │ │ │ │ +32} │ │ │ │ │ 33 │ │ │ │ │ 34 │ │ │ │ │ 35 │ │ │ │ │ -36namespace Imp │ │ │ │ │ -37{ │ │ │ │ │ -38 │ │ │ │ │ -40 template class DerivativeTraits, size_t │ │ │ │ │ -bufferSize> │ │ │ │ │ -41 struct GridFunctionTraits : │ │ │ │ │ -42 DifferentiableFunctionTraits │ │ │ │ │ -43 { │ │ │ │ │ -44 protected: │ │ │ │ │ -45 using Base=DifferentiableFunctionTraits; │ │ │ │ │ +36template │ │ │ │ │ +_3_7class _S_u_b_s_p_a_c_e_B_a_s_i_s │ │ │ │ │ +38{ │ │ │ │ │ +39public: │ │ │ │ │ +40 │ │ │ │ │ +_4_1 using _R_o_o_t_B_a_s_i_s = RB; │ │ │ │ │ +42 │ │ │ │ │ +_4_3 using _R_o_o_t_L_o_c_a_l_V_i_e_w = typename RootBasis::LocalView; │ │ │ │ │ +44 │ │ │ │ │ +_4_5 using _P_r_e_f_i_x_P_a_t_h = TP; │ │ │ │ │ 46 │ │ │ │ │ -47 public: │ │ │ │ │ -49 using EntitySet = ES; │ │ │ │ │ -50 │ │ │ │ │ -52 using Element = typename EntitySet::Element; │ │ │ │ │ -53 │ │ │ │ │ -55 using DerivativeSignature = typename Base::DerivativeSignature; │ │ │ │ │ -56 │ │ │ │ │ -58 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_>; │ │ │ │ │ +_4_8 using _G_r_i_d_V_i_e_w = typename RootBasis::GridView; │ │ │ │ │ +49 │ │ │ │ │ +_5_1 using _M_u_l_t_i_I_n_d_e_x = typename RootBasis::MultiIndex; │ │ │ │ │ +52 │ │ │ │ │ +_5_3 using _s_i_z_e___t_y_p_e = std::size_t; │ │ │ │ │ +54 │ │ │ │ │ +_5_6 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_>; │ │ │ │ │ +57 │ │ │ │ │ +_5_8 using _S_i_z_e_P_r_e_f_i_x = typename RootBasis::SizePrefix; │ │ │ │ │ 59 │ │ │ │ │ -61 using LocalSignature = typename Base::Range(typename EntitySet:: │ │ │ │ │ -LocalCoordinate); │ │ │ │ │ -62 │ │ │ │ │ -64 template │ │ │ │ │ -65 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; │ │ │ │ │ +60 │ │ │ │ │ +_6_2 _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) : │ │ │ │ │ +63 _r_o_o_t_B_a_s_i_s__(&_r_o_o_t_B_a_s_i_s), │ │ │ │ │ +64 _p_r_e_f_i_x_P_a_t_h__(_p_r_e_f_i_x_P_a_t_h) │ │ │ │ │ +65 {} │ │ │ │ │ 66 │ │ │ │ │ -68 using LocalFunctionTraits = typename Dune::Functions::Imp:: │ │ │ │ │ -LocalFunctionTraits; │ │ │ │ │ -69 │ │ │ │ │ -71 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_>; │ │ │ │ │ -72 │ │ │ │ │ -74 using Concept = GridFunctionWrapperInterface; │ │ │ │ │ -75 │ │ │ │ │ -77 template │ │ │ │ │ -78 using Model = GridFunctionWrapperImplementation; │ │ │ │ │ -79 }; │ │ │ │ │ -80} │ │ │ │ │ -81 │ │ │ │ │ -82 │ │ │ │ │ -83 │ │ │ │ │ -95template class │ │ │ │ │ -DerivativeTraits, size_t bufferSize> │ │ │ │ │ -_9_6class _G_r_i_d_F_u_n_c_t_i_o_n : │ │ │ │ │ -97 public _T_y_p_e_E_r_a_s_u_r_e_B_a_s_e< │ │ │ │ │ -98 typename Imp::GridFunctionTraits::Concept, │ │ │ │ │ -99 Imp::GridFunctionTraits:: │ │ │ │ │ -template Model> │ │ │ │ │ -100{ │ │ │ │ │ -101 using Traits = Imp::GridFunctionTraits; │ │ │ │ │ -102 │ │ │ │ │ -103 using _B_a_s_e = _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_>; │ │ │ │ │ +72 template │ │ │ │ │ +_7_3 _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) : │ │ │ │ │ +74 _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(), Impl::joinTreePaths │ │ │ │ │ +(_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)) │ │ │ │ │ +75 {} │ │ │ │ │ +76 │ │ │ │ │ +77 │ │ │ │ │ +_8_0 const _G_r_i_d_V_i_e_w& _g_r_i_d_V_i_e_w() const │ │ │ │ │ +81 { │ │ │ │ │ +82 return _r_o_o_t_B_a_s_i_s__->gridView(); │ │ │ │ │ +83 } │ │ │ │ │ +84 │ │ │ │ │ +_8_8 _s_i_z_e___t_y_p_e _d_i_m_e_n_s_i_o_n() const │ │ │ │ │ +89 { │ │ │ │ │ +90 return _r_o_o_t_B_a_s_i_s__->dimension(); │ │ │ │ │ +91 } │ │ │ │ │ +92 │ │ │ │ │ +_9_4 _s_i_z_e___t_y_p_e _s_i_z_e() const │ │ │ │ │ +95 { │ │ │ │ │ +96 return _r_o_o_t_B_a_s_i_s__->size(); │ │ │ │ │ +97 } │ │ │ │ │ +98 │ │ │ │ │ +_1_0_0 _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 │ │ │ │ │ +101 { │ │ │ │ │ +102 return _r_o_o_t_B_a_s_i_s__->size(prefix); │ │ │ │ │ +103 } │ │ │ │ │ 104 │ │ │ │ │ -105 using DerivativeInterface = typename _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; │ │ │ │ │ -106 │ │ │ │ │ -107 using LocalFunctionInterface = typename _T_r_a_i_t_s_:_:_L_o_c_a_l_F_u_n_c_t_i_o_n_I_n_t_e_r_f_a_c_e; │ │ │ │ │ -108 │ │ │ │ │ -109 using EntitySet = typename Traits::EntitySet; │ │ │ │ │ -110 │ │ │ │ │ -111public: │ │ │ │ │ +_1_0_8 _L_o_c_a_l_V_i_e_w _l_o_c_a_l_V_i_e_w() const │ │ │ │ │ +109 { │ │ │ │ │ +110 return _L_o_c_a_l_V_i_e_w(*this, _p_r_e_f_i_x_P_a_t_h__); │ │ │ │ │ +111 } │ │ │ │ │ 112 │ │ │ │ │ -124 template = 0 > │ │ │ │ │ -_1_2_5 _G_r_i_d_F_u_n_c_t_i_o_n(F&& f) : │ │ │ │ │ -126 _B_a_s_e(std::forward(f)) │ │ │ │ │ -127 { │ │ │ │ │ -128 static_assert(Dune::Functions::Concept::isGridFunction(), "Trying to construct a GridFunction from type that does not model │ │ │ │ │ -the GridFunction concept"); │ │ │ │ │ -129 } │ │ │ │ │ -130 │ │ │ │ │ -_1_3_1 _G_r_i_d_F_u_n_c_t_i_o_n() = default; │ │ │ │ │ +_1_1_3 const _R_o_o_t_B_a_s_i_s& _r_o_o_t_B_a_s_i_s() const │ │ │ │ │ +114 { │ │ │ │ │ +115 return *_r_o_o_t_B_a_s_i_s__; │ │ │ │ │ +116 } │ │ │ │ │ +117 │ │ │ │ │ +_1_1_8 const _P_r_e_f_i_x_P_a_t_h& _p_r_e_f_i_x_P_a_t_h() const │ │ │ │ │ +119 { │ │ │ │ │ +120 return _p_r_e_f_i_x_P_a_t_h__; │ │ │ │ │ +121 } │ │ │ │ │ +122 │ │ │ │ │ +123protected: │ │ │ │ │ +_1_2_4 const _R_o_o_t_B_a_s_i_s* _r_o_o_t_B_a_s_i_s__; │ │ │ │ │ +_1_2_5 _P_r_e_f_i_x_P_a_t_h _p_r_e_f_i_x_P_a_t_h__; │ │ │ │ │ +126}; │ │ │ │ │ +127 │ │ │ │ │ +128 │ │ │ │ │ +129// CTAD guide for a non-SubspaceBasis root basis │ │ │ │ │ +130template │ │ │ │ │ +_1_3_1_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_>; │ │ │ │ │ 132 │ │ │ │ │ -_1_3_8 Range operator() (const Domain& x) const │ │ │ │ │ -139 { │ │ │ │ │ -140 return this->asInterface().operator()(x); │ │ │ │ │ -141 } │ │ │ │ │ -142 │ │ │ │ │ -_1_5_1 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) │ │ │ │ │ -152 { │ │ │ │ │ -153 return t.asInterface().derivative(); │ │ │ │ │ -154 } │ │ │ │ │ +133// CTAD guide for a SubspaceBasis root basis │ │ │ │ │ +134template │ │ │ │ │ +_1_3_5_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) │ │ │ │ │ +136 -> _S_u_b_s_p_a_c_e_B_a_s_i_s, Impl:: │ │ │ │ │ +JoinTreePath_t>; │ │ │ │ │ +137 │ │ │ │ │ +138 │ │ │ │ │ +139 │ │ │ │ │ +150template │ │ │ │ │ +_1_5_1auto _s_u_b_s_p_a_c_e_B_a_s_i_s(const RootBasis& rootBasis, const TypeTree:: │ │ │ │ │ +HybridTreePath& prefixPath) │ │ │ │ │ +152{ │ │ │ │ │ +153 return _S_u_b_s_p_a_c_e_B_a_s_i_s(rootBasis, prefixPath); │ │ │ │ │ +154} │ │ │ │ │ 155 │ │ │ │ │ -_1_6_5 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) │ │ │ │ │ -166 { │ │ │ │ │ -167 return t.asInterface().wrappedLocalFunction(); │ │ │ │ │ -168 } │ │ │ │ │ -169 │ │ │ │ │ -_1_7_6 const EntitySet& _e_n_t_i_t_y_S_e_t() const │ │ │ │ │ -177 { │ │ │ │ │ -178 return this->asInterface().wrappedEntitySet(); │ │ │ │ │ -179 } │ │ │ │ │ -180}; │ │ │ │ │ -181 │ │ │ │ │ -182 │ │ │ │ │ -183 │ │ │ │ │ -184}} // namespace Dune::Functions │ │ │ │ │ -185 │ │ │ │ │ -186 │ │ │ │ │ -187 │ │ │ │ │ -188#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_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 │ │ │ │ │ -_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 │ │ │ │ │ -_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 │ │ │ │ │ +156template │ │ │ │ │ +_1_5_7auto _s_u_b_s_p_a_c_e_B_a_s_i_s(const RootBasis& rootBasis, const PrefixTreeIndices&... │ │ │ │ │ +prefixTreeIndices) │ │ │ │ │ +158{ │ │ │ │ │ +159 return _s_u_b_s_p_a_c_e_B_a_s_i_s(rootBasis, TypeTree::hybridTreePath │ │ │ │ │ +(prefixTreeIndices...)); │ │ │ │ │ +160} │ │ │ │ │ +161 │ │ │ │ │ +162 │ │ │ │ │ +163 │ │ │ │ │ +164} // end namespace Functions │ │ │ │ │ +165} // end namespace Dune │ │ │ │ │ +166 │ │ │ │ │ +167 │ │ │ │ │ +168 │ │ │ │ │ +169#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH │ │ │ │ │ +_t_y_p_e___t_r_a_i_t_s_._h_h │ │ │ │ │ +_s_u_b_s_p_a_c_e_l_o_c_a_l_v_i_e_w_._h_h │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_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:30 │ │ │ │ │ -_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 │ │ │ │ │ -Base class for type-erased interface wrapper. │ │ │ │ │ -DDeeffiinniittiioonn typeerasure.hh:165 │ │ │ │ │ -_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: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_<_ _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:151 │ │ │ │ │ -_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:176 │ │ │ │ │ -_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:125 │ │ │ │ │ -_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:165 │ │ │ │ │ -_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:28 │ │ │ │ │ +_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::HybridTreePath< │ │ │ │ │ +PrefixTreeIndices... > &prefixPath) │ │ │ │ │ +Create SubspaceBasis from a root basis and a prefixPath. │ │ │ │ │ +DDeeffiinniittiioonn subspacebasis.hh:151 │ │ │ │ │ +_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:38 │ │ │ │ │ +_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:43 │ │ │ │ │ +_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:108 │ │ │ │ │ +_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__ │ │ │ │ │ +const RootBasis * rootBasis_ │ │ │ │ │ +DDeeffiinniittiioonn subspacebasis.hh:124 │ │ │ │ │ +_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:58 │ │ │ │ │ +_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:45 │ │ │ │ │ +_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:56 │ │ │ │ │ +_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:100 │ │ │ │ │ +_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:48 │ │ │ │ │ +_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 │ │ │ │ │ +const PrefixPath & prefixPath() const │ │ │ │ │ +DDeeffiinniittiioonn subspacebasis.hh:118 │ │ │ │ │ +_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:73 │ │ │ │ │ +_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:80 │ │ │ │ │ +_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:41 │ │ │ │ │ +_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__ │ │ │ │ │ +PrefixPath prefixPath_ │ │ │ │ │ +DDeeffiinniittiioonn subspacebasis.hh:125 │ │ │ │ │ +_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:94 │ │ │ │ │ +_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 │ │ │ │ │ +const RootBasis & rootBasis() const │ │ │ │ │ +DDeeffiinniittiioonn subspacebasis.hh:113 │ │ │ │ │ +_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:51 │ │ │ │ │ +_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:88 │ │ │ │ │ +_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:53 │ │ │ │ │ +_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:62 │ │ │ │ │ +_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:30 │ │ │ │ │ +_c_o_n_c_e_p_t_s_._h_h │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00185.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: composedgridfunction.hh File Reference │ │ │ │ +dune-functions: istlvectorbackend.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,54 +65,61 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ Namespaces | │ │ │ │ Functions
│ │ │ │ -
composedgridfunction.hh File Reference
│ │ │ │ +
istlvectorbackend.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 <cstddef>
│ │ │ │ +#include <utility>
│ │ │ │ +#include <type_traits>
│ │ │ │ +#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::ComposedGridFunction< OF, IF >
 Composition of grid functions with another function. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

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

│ │ │ │ Functions

template<class OF , class... IF>
auto Dune::Functions::makeComposedGridFunction (OF &&outerFunction, IF &&... innerFunction)
 Create a ComposedGridFunction that composes grid-functions with another function.
 
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,35 +1,44 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _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_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -composedgridfunction.hh File Reference │ │ │ │ │ + * _b_a_c_k_e_n_d_s │ │ │ │ │ +_N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +istlvectorbackend.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_/_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 │ │ │ │ │ +#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_:_:_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 │ │ │ │ │ -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. │ │ │ │ │ +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. │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00185_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: composedgridfunction.hh Source File │ │ │ │ +dune-functions: istlvectorbackend.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,216 +70,347 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
composedgridfunction.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#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_ISTLVECTORBACKEND_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_ISTLVECTORBACKEND_HH
│ │ │ │
5
│ │ │ │ -
6#include <type_traits>
│ │ │ │ -
7#include <tuple>
│ │ │ │ -
8
│ │ │ │ -
9#include <dune/common/referencehelper.hh>
│ │ │ │ -
10#include <dune/common/typeutilities.hh>
│ │ │ │ -
11
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
15
│ │ │ │ -
16
│ │ │ │ -
17namespace Dune {
│ │ │ │ -
18namespace Functions {
│ │ │ │ -
19
│ │ │ │ -
20
│ │ │ │ +
6#include <cstddef>
│ │ │ │ +
7#include <utility>
│ │ │ │ +
8#include <type_traits>
│ │ │ │ +
9
│ │ │ │ +
10#include <dune/common/std/type_traits.hh>
│ │ │ │ +
11#include <dune/common/indices.hh>
│ │ │ │ +
12#include <dune/common/hybridutilities.hh>
│ │ │ │ +
13#include <dune/common/concept.hh>
│ │ │ │ +
14
│ │ │ │ + │ │ │ │ + │ │ │ │ +
17
│ │ │ │ +
18
│ │ │ │ +
19namespace Dune {
│ │ │ │ +
20namespace Functions {
│ │ │ │
21
│ │ │ │ -
40template<class OF, class... IF>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
42{
│ │ │ │ -
43 using InnerFunctions = std::tuple<IF...>;
│ │ │ │ -
44 using InnerLocalFunctions = std::tuple<decltype(localFunction(resolveRef(std::declval<const IF&>())))...>;
│ │ │ │ +
22namespace Impl {
│ │ │ │ +
23
│ │ │ │ +
24template<class V,
│ │ │ │ +
25 std::enable_if_t<not Dune::models<Imp::Concept::HasStaticIndexAccess, V>() , int> = 0>
│ │ │ │ +
26auto fieldTypes(V&& /*v*/)
│ │ │ │ +
27{
│ │ │ │ +
28 return TypeList<V>{};
│ │ │ │ +
29}
│ │ │ │ +
30
│ │ │ │ +
31template<class V,
│ │ │ │ +
32 std::enable_if_t<Dune::models<Imp::Concept::HasStaticIndexAccess, V>(), int> = 0>
│ │ │ │ +
33auto fieldTypes(V&& v)
│ │ │ │ +
34{
│ │ │ │ +
35 if constexpr (Dune::models<Imp::Concept::HasDynamicIndexAccess<std::size_t>, V>())
│ │ │ │ +
36 return fieldTypes(v[std::size_t{0}]);
│ │ │ │ +
37 else
│ │ │ │ +
38 {
│ │ │ │ +
39 auto indexRange = typename decltype(range(Hybrid::size(v)))::integer_sequence();
│ │ │ │ +
40 return unpackIntegerSequence([&](auto... i) {
│ │ │ │ +
41 return uniqueTypeList(std::tuple_cat(fieldTypes(v[i])...));
│ │ │ │ +
42 }, indexRange);
│ │ │ │ +
43 }
│ │ │ │ +
44}
│ │ │ │
45
│ │ │ │ -
46 template<std::size_t i>
│ │ │ │ -
47 using InnerFunction = std::decay_t<ResolveRef_t<std::tuple_element_t<i, InnerFunctions>>>;
│ │ │ │ +
46} // namespace Impl
│ │ │ │ +
47
│ │ │ │
48
│ │ │ │ -
49 using OuterFunction = OF;
│ │ │ │ -
50
│ │ │ │ -
51public:
│ │ │ │ -
52
│ │ │ │ -
53 using EntitySet = typename InnerFunction<0>::EntitySet;
│ │ │ │ -
54 using Element = typename EntitySet::Element;
│ │ │ │ -
55
│ │ │ │ -
56 using Domain = typename EntitySet::GlobalCoordinate;
│ │ │ │ -
57 using LocalDomain = typename EntitySet::LocalCoordinate;
│ │ │ │ -
58
│ │ │ │ -
59 using Range = decltype(std::declval<OF>()(std::declval<IF>()(std::declval<Domain>())...));
│ │ │ │ -
60
│ │ │ │ -
61private:
│ │ │ │ -
62
│ │ │ │ -
63 using Traits = Imp::GridFunctionTraits<Range(Domain), EntitySet, DefaultDerivativeTraits, 16>;
│ │ │ │ -
64
│ │ │ │ -
65 class LocalFunction
│ │ │ │ -
66 {
│ │ │ │ -
67 public:
│ │ │ │ -
74 LocalFunction(const ComposedGridFunction& globalFunction) :
│ │ │ │ -
75 globalFunction_(globalFunction),
│ │ │ │ -
76 innerLocalFunctions_(globalFunction.innerLocalFunctions())
│ │ │ │ -
77 {}
│ │ │ │ +
49
│ │ │ │ +
62template<class V>
│ │ │ │ +
│ │ │ │ +
63constexpr auto fieldTypes()
│ │ │ │ +
64{
│ │ │ │ +
65 return decltype(Impl::fieldTypes(std::declval<V>())){};
│ │ │ │ +
66}
│ │ │ │ +
│ │ │ │ +
67
│ │ │ │ +
73template<class V>
│ │ │ │ +
│ │ │ │ +
74constexpr bool hasUniqueFieldType()
│ │ │ │ +
75{
│ │ │ │ +
76 return std::tuple_size<std::decay_t<decltype(fieldTypes<V>())>>::value==1;
│ │ │ │ +
77}
│ │ │ │ +
│ │ │ │
78
│ │ │ │ -
88 void bind(const Element& element)
│ │ │ │ -
89 {
│ │ │ │ -
90 std::apply([&](auto&... innerFunction) {
│ │ │ │ -
91 (innerFunction.bind(element),...);
│ │ │ │ -
92 }, innerLocalFunctions_);
│ │ │ │ -
93 }
│ │ │ │ -
94
│ │ │ │ -
96 void unbind()
│ │ │ │ -
97 {
│ │ │ │ -
98 std::apply([&](auto&... innerFunction) {
│ │ │ │ -
99 (innerFunction.unbind(),...);
│ │ │ │ -
100 }, innerLocalFunctions_);
│ │ │ │ -
101 }
│ │ │ │ -
102
│ │ │ │ -
105 bool bound() const
│ │ │ │ -
106 {
│ │ │ │ -
107 return std::apply([](const auto&... innerFunction) {
│ │ │ │ -
108 return (innerFunction.bound() && ...);
│ │ │ │ -
109 }, innerLocalFunctions_);
│ │ │ │ -
110 }
│ │ │ │ -
111
│ │ │ │ -
121 Range operator()(const LocalDomain& x) const
│ │ │ │ -
122 {
│ │ │ │ -
123 return std::apply([&](const auto&... innerFunction) {
│ │ │ │ -
124 return globalFunction_.outerFunction_(innerFunction(x)...);
│ │ │ │ -
125 }, innerLocalFunctions_);
│ │ │ │ -
126 }
│ │ │ │ -
127
│ │ │ │ -
137 const Element& localContext() const
│ │ │ │ -
138 {
│ │ │ │ -
139 return std::get<0>(innerLocalFunctions_).localContext();
│ │ │ │ -
140 }
│ │ │ │ +
79
│ │ │ │ +
80
│ │ │ │ +
81namespace Impl {
│ │ │ │ +
82
│ │ │ │ +
83/*
│ │ │ │ +
84 * \brief A wrapper providing multi-index access to vector entries
│ │ │ │ +
85 *
│ │ │ │ +
86 * The wrapped vector type should be an istl like random
│ │ │ │ +
87 * access container providing operator[] and size() methods.
│ │ │ │ +
88 * For classical containers this should support indices
│ │ │ │ +
89 * of type std::size_t. For multi-type containers indices
│ │ │ │ +
90 * of the form Dune::index_constant<i> should be supported
│ │ │ │ +
91 * while size() should be a static constexpr method.
│ │ │ │ +
92 *
│ │ │ │ +
93 * When resolving multi-indices the backend appends indices
│ │ │ │ +
94 * using operator[] as long as the result is not a scalar.
│ │ │ │ +
95 * If this exhausts the digits of the multi-index, additional
│ │ │ │ +
96 * zero`s are appended.
│ │ │ │ +
97 *
│ │ │ │ +
98 * \tparam V Type of the raw wrapper vector
│ │ │ │ +
99 */
│ │ │ │ +
100template<class V>
│ │ │ │ +
101class ISTLVectorBackend
│ │ │ │ +
102{
│ │ │ │ +
103
│ │ │ │ +
104 // Template aliases for using detection idiom.
│ │ │ │ +
105 template<class C>
│ │ │ │ +
106 using dynamicIndexAccess_t = decltype(std::declval<C>()[0]);
│ │ │ │ +
107
│ │ │ │ +
108 template<class C>
│ │ │ │ +
109 using staticIndexAccess_t = decltype(std::declval<C>()[Dune::Indices::_0]);
│ │ │ │ +
110
│ │ │ │ +
111 template<class C>
│ │ │ │ +
112 using resizeMethod_t = decltype(std::declval<C>().resize(0));
│ │ │ │ +
113
│ │ │ │ +
114
│ │ │ │ +
115
│ │ │ │ +
116 // Short cuts for feature detection
│ │ │ │ +
117 template<class C>
│ │ │ │ +
118 using hasDynamicIndexAccess = Dune::Std::is_detected<dynamicIndexAccess_t, std::remove_reference_t<C>>;
│ │ │ │ +
119
│ │ │ │ +
120 template<class C>
│ │ │ │ +
121 using hasStaticIndexAccess = Dune::Std::is_detected<staticIndexAccess_t, std::remove_reference_t<C>>;
│ │ │ │ +
122
│ │ │ │ +
123 template<class C>
│ │ │ │ +
124 using hasResizeMethod = Dune::Std::is_detected<resizeMethod_t, std::remove_reference_t<C>>;
│ │ │ │ +
125
│ │ │ │ +
126 template<class C>
│ │ │ │ +
127 using isDynamicVector = Dune::Std::is_detected<dynamicIndexAccess_t, std::remove_reference_t<C>>;
│ │ │ │ +
128
│ │ │ │ +
129 template<class C>
│ │ │ │ +
130 using isStaticVector = Dune::Std::bool_constant<
│ │ │ │ +
131 Dune::Std::is_detected_v<staticIndexAccess_t, std::remove_reference_t<C>>
│ │ │ │ +
132 and not Dune::Std::is_detected_v<dynamicIndexAccess_t, std::remove_reference_t<C>>>;
│ │ │ │ +
133
│ │ │ │ +
134 template<class C>
│ │ │ │ +
135 using isScalar = Dune::Std::bool_constant<not Dune::Std::is_detected_v<staticIndexAccess_t, std::remove_reference_t<C>>>;
│ │ │ │ +
136
│ │ │ │ +
137 template<class C>
│ │ │ │ +
138 using isVector = Dune::Std::bool_constant<Dune::Std::is_detected_v<staticIndexAccess_t, std::remove_reference_t<C>>>;
│ │ │ │ +
139
│ │ │ │ +
140
│ │ │ │
141
│ │ │ │ -
143 friend typename Traits::LocalFunctionTraits::DerivativeInterface derivative(const LocalFunction& t)
│ │ │ │ -
144 {
│ │ │ │ -
145 DUNE_THROW(NotImplemented,"not implemented");
│ │ │ │ -
146 }
│ │ │ │ +
142 template<class... Args>
│ │ │ │ +
143 static void forwardToResize(Args&&... args)
│ │ │ │ +
144 {
│ │ │ │ +
145 resize(std::forward<Args>(args)...);
│ │ │ │ +
146 }
│ │ │ │
147
│ │ │ │ -
148 private:
│ │ │ │ -
149 const ComposedGridFunction& globalFunction_;
│ │ │ │ -
150 InnerLocalFunctions innerLocalFunctions_;
│ │ │ │ -
151 };
│ │ │ │ -
152
│ │ │ │ -
153public:
│ │ │ │ -
154
│ │ │ │ -
164 template<class OFT, class... IFT,
│ │ │ │ -
165 disableCopyMove<ComposedGridFunction, OFT> = 0,
│ │ │ │ -
166 std::enable_if_t<(sizeof...(IFT) > 0), int> = 0>
│ │ │ │ -
│ │ │ │ -
167 ComposedGridFunction(OFT&& outerFunction, IFT&&... innerFunctions) :
│ │ │ │ -
168 outerFunction_(std::forward<OFT>(outerFunction)),
│ │ │ │ -
169 innerFunctions_(std::forward<IFT>(innerFunctions)...)
│ │ │ │ -
170 {}
│ │ │ │ -
│ │ │ │ -
171
│ │ │ │ -
│ │ │ │ -
173 Range operator()(const Domain& x) const
│ │ │ │ -
174 {
│ │ │ │ -
175 DUNE_THROW(NotImplemented,"not implemented");
│ │ │ │ -
176 }
│ │ │ │ -
│ │ │ │ -
177
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
180 {
│ │ │ │ -
181 DUNE_THROW(NotImplemented,"not implemented");
│ │ │ │ -
182 }
│ │ │ │ -
│ │ │ │ -
183
│ │ │ │ -
│ │ │ │ -
190 friend LocalFunction localFunction(const ComposedGridFunction& cgf)
│ │ │ │ -
191 {
│ │ │ │ -
192 return LocalFunction(cgf);
│ │ │ │ -
193 }
│ │ │ │ -
│ │ │ │ +
148
│ │ │ │ +
149 template<class C, class SizeProvider,
│ │ │ │ +
150 std::enable_if_t<hasResizeMethod<C>::value, int> = 0>
│ │ │ │ +
151 static void resize(C&& c, const SizeProvider& sizeProvider, typename SizeProvider::SizePrefix prefix)
│ │ │ │ +
152 {
│ │ │ │ +
153 auto size = sizeProvider.size(prefix);
│ │ │ │ +
154 if (size==0)
│ │ │ │ +
155 {
│ │ │ │ +
156 // If size==0 this prefix refers to a single coefficient c.
│ │ │ │ +
157 // But being in this overload means that c is not a scalar
│ │ │ │ +
158 // because is has a resize() method. Since operator[] deliberately
│ │ │ │ +
159 // supports implicit padding of multi-indices by as many
│ │ │ │ +
160 // [0]'s as needed to resolve a scalar entry, we should also
│ │ │ │ +
161 // except a non-scalar c here. However, this requires that
│ │ │ │ +
162 // we silently believe that whatever size c already has is
│ │ │ │ +
163 // intended by the user. The only exception is c.size()==0
│ │ │ │ +
164 // which is not acceptable but we also cannot know the desired size.
│ │ │ │ +
165 if (c.size()==0)
│ │ │ │ +
166 DUNE_THROW(RangeError, "The vector entry v[" << prefix << "] should refer to a "
│ │ │ │ +
167 << "scalar coefficient, but is a dynamically sized vector of size==0");
│ │ │ │ +
168 else
│ │ │ │ +
169 // Accept non-zero sized coefficients to avoid that resize(basis)
│ │ │ │ +
170 // fails for a vector that works with operator[] and already
│ │ │ │ +
171 // has the appropriate size.
│ │ │ │ +
172 return;
│ │ │ │ +
173 }
│ │ │ │ +
174 c.resize(size);
│ │ │ │ +
175 prefix.push_back(0);
│ │ │ │ +
176 for(std::size_t i=0; i<size; ++i)
│ │ │ │ +
177 {
│ │ │ │ +
178 prefix.back() = i;
│ │ │ │ +
179 resize(c[i], sizeProvider, prefix);
│ │ │ │ +
180 }
│ │ │ │ +
181 }
│ │ │ │ +
182
│ │ │ │ +
183 template<class C, class SizeProvider,
│ │ │ │ +
184 std::enable_if_t<not hasResizeMethod<C>::value, int> = 0,
│ │ │ │ +
185 std::enable_if_t<isVector<C>::value, int> = 0>
│ │ │ │ +
186 static void resize(C&& c, const SizeProvider& sizeProvider, typename SizeProvider::SizePrefix prefix)
│ │ │ │ +
187 {
│ │ │ │ +
188 auto size = sizeProvider.size(prefix);
│ │ │ │ +
189 // If size == 0 there's nothing to do:
│ │ │ │ +
190 // We can't resize c and it's already
│ │ │ │ +
191 // large enough anyway.
│ │ │ │ +
192 if (size == 0)
│ │ │ │ +
193 return;
│ │ │ │
194
│ │ │ │ -
│ │ │ │ -
205 const EntitySet& entitySet() const
│ │ │ │ -
206 {
│ │ │ │ -
207 return resolveRef(std::get<0>(innerFunctions_)).entitySet();
│ │ │ │ -
208 }
│ │ │ │ -
│ │ │ │ -
209
│ │ │ │ -
210protected:
│ │ │ │ -
211
│ │ │ │ -
│ │ │ │ -
212 InnerLocalFunctions innerLocalFunctions() const
│ │ │ │ -
213 {
│ │ │ │ -
214 return std::apply([&](const auto&... innerFunction) {
│ │ │ │ -
215 return std::make_tuple(localFunction(resolveRef(innerFunction))...);
│ │ │ │ -
216 }, innerFunctions_);
│ │ │ │ -
217 }
│ │ │ │ -
│ │ │ │ -
218
│ │ │ │ -
219 OuterFunction outerFunction_;
│ │ │ │ -
220 InnerFunctions innerFunctions_;
│ │ │ │ -
221};
│ │ │ │ -
│ │ │ │ -
222
│ │ │ │ -
223
│ │ │ │ -
224
│ │ │ │ -
247template<class OF, class... IF>
│ │ │ │ -
│ │ │ │ -
248auto makeComposedGridFunction(OF&& outerFunction, IF&&... innerFunction)
│ │ │ │ -
249{
│ │ │ │ -
250 using ComposedGridFunctionType = ComposedGridFunction<std::decay_t<OF>, std::decay_t<IF>...>;
│ │ │ │ -
251 return ComposedGridFunctionType(std::forward<OF>(outerFunction), std::forward<IF>(innerFunction)...);
│ │ │ │ -
252}
│ │ │ │ -
│ │ │ │ -
253
│ │ │ │ +
195 // If size>0 but c does not have the appropriate
│ │ │ │ +
196 // size we throw an exception.
│ │ │ │ +
197 //
│ │ │ │ +
198 // We could perhaps also allow c.size()>size.
│ │ │ │ +
199 // But then looping the loop below gets complicated:
│ │ │ │ +
200 // We're not allowed to loop until c.size(). But
│ │ │ │ +
201 // we also cannot use size for termination,
│ │ │ │ +
202 // because this fails if c is a static vector.
│ │ │ │ +
203 if (c.size() != size)
│ │ │ │ +
204 DUNE_THROW(RangeError, "Can't resize non-resizable entry v[" << prefix << "] of size " << c.size() << " to size(" << prefix << ")=" << size);
│ │ │ │ +
205
│ │ │ │ +
206 // Recursively resize all entries of c now.
│ │ │ │ +
207 using namespace Dune::Hybrid;
│ │ │ │ +
208 prefix.push_back(0);
│ │ │ │ +
209 forEach(integralRange(Hybrid::size(c)), [&](auto&& i) {
│ │ │ │ +
210 prefix.back() = i;
│ │ │ │ +
211 // Here we'd simply like to call resize(c[i], sizeProvider, prefix);
│ │ │ │ +
212 // but even gcc-7 does not except this bus reports
│ │ │ │ +
213 // "error: ‘this’ was not captured for this lambda function"
│ │ │ │ +
214 // although there's no 'this' because we're in a static method.
│ │ │ │ +
215 // Bypassing this by and additional method that does perfect
│ │ │ │ +
216 // forwarding allows to workaround this.
│ │ │ │ +
217 ISTLVectorBackend<V>::forwardToResize(c[i], sizeProvider, prefix);
│ │ │ │ +
218 });
│ │ │ │ +
219 }
│ │ │ │ +
220
│ │ │ │ +
221 template<class C, class SizeProvider,
│ │ │ │ +
222 std::enable_if_t<not hasResizeMethod<C>::value, int> = 0,
│ │ │ │ +
223 std::enable_if_t<isScalar<C>::value, int> = 0>
│ │ │ │ +
224 static void resize(C&&, const SizeProvider& sizeProvider, typename SizeProvider::SizePrefix prefix)
│ │ │ │ +
225 {
│ │ │ │ +
226 auto size = sizeProvider.size(prefix);
│ │ │ │ +
227 if (size != 0)
│ │ │ │ +
228 DUNE_THROW(RangeError, "Can't resize scalar vector entry v[" << prefix << "] to size(" << prefix << ")=" << size);
│ │ │ │ +
229 }
│ │ │ │ +
230
│ │ │ │ +
231 template<class C, class T,
│ │ │ │ +
232 std::enable_if_t<std::is_assignable<C&,T>::value, int> = 0>
│ │ │ │ +
233 void recursiveAssign(C& c, const T& t)
│ │ │ │ +
234 {
│ │ │ │ +
235 c = t;
│ │ │ │ +
236 }
│ │ │ │ +
237
│ │ │ │ +
238 template<class C, class T,
│ │ │ │ +
239 std::enable_if_t<not std::is_assignable<C&,T>::value, int> = 0>
│ │ │ │ +
240 void recursiveAssign(C& c, const T& t)
│ │ │ │ +
241 {
│ │ │ │ +
242 Dune::Hybrid::forEach(c, [&](auto&& ci) {
│ │ │ │ +
243 recursiveAssign(ci, t);
│ │ │ │ +
244 });
│ │ │ │ +
245 }
│ │ │ │ +
246
│ │ │ │ +
247public:
│ │ │ │ +
248
│ │ │ │ +
249 using Vector = V;
│ │ │ │ +
250
│ │ │ │ +
251 ISTLVectorBackend(Vector& vector) :
│ │ │ │ +
252 vector_(&vector)
│ │ │ │ +
253 {}
│ │ │ │
254
│ │ │ │ -
255
│ │ │ │ -
256}} // namespace Dune::Functions
│ │ │ │ -
257
│ │ │ │ -
258
│ │ │ │ -
259
│ │ │ │ -
260#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
Obtain derivative of TrigonometricFunction function.
Definition trigonometricfunction.hh:39
│ │ │ │ -
auto makeComposedGridFunction(OF &&outerFunction, IF &&... innerFunction)
Create a ComposedGridFunction that composes grid-functions with another function.
Definition composedgridfunction.hh:248
│ │ │ │ +
255 template<class SizeProvider>
│ │ │ │ +
256 void resize(const SizeProvider& sizeProvider)
│ │ │ │ +
257 {
│ │ │ │ +
258 auto prefix = typename SizeProvider::SizePrefix();
│ │ │ │ +
259 prefix.resize(0);
│ │ │ │ +
260 resize(*vector_, sizeProvider, prefix);
│ │ │ │ +
261 }
│ │ │ │ +
262
│ │ │ │ +
263 template<class MultiIndex>
│ │ │ │ +
264 decltype(auto) operator[](const MultiIndex& index) const
│ │ │ │ +
265 {
│ │ │ │ +
266 return resolveDynamicMultiIndex(*vector_, index);
│ │ │ │ +
267 }
│ │ │ │ +
268
│ │ │ │ +
269 template<class MultiIndex>
│ │ │ │ +
270 decltype(auto) operator[](const MultiIndex& index)
│ │ │ │ +
271 {
│ │ │ │ +
272 return resolveDynamicMultiIndex(*vector_, index);
│ │ │ │ +
273 }
│ │ │ │ +
274
│ │ │ │ +
283 template<typename T>
│ │ │ │ +
284 void operator= (const T& other)
│ │ │ │ +
285 {
│ │ │ │ +
286 recursiveAssign(vector(), other);
│ │ │ │ +
287 }
│ │ │ │ +
288
│ │ │ │ +
289 template<typename T>
│ │ │ │ +
290 void operator= (const ISTLVectorBackend<T>& other)
│ │ │ │ +
291 {
│ │ │ │ +
292 vector() = other.vector();
│ │ │ │ +
293 }
│ │ │ │ +
294
│ │ │ │ +
295 const Vector& vector() const
│ │ │ │ +
296 {
│ │ │ │ +
297 return *vector_;
│ │ │ │ +
298 }
│ │ │ │ +
299
│ │ │ │ +
300 Vector& vector()
│ │ │ │ +
301 {
│ │ │ │ +
302 return *vector_;
│ │ │ │ +
303 }
│ │ │ │ +
304
│ │ │ │ +
305private:
│ │ │ │ +
306
│ │ │ │ +
307 Vector* vector_;
│ │ │ │ +
308};
│ │ │ │ +
309
│ │ │ │ +
310} // end namespace Impl
│ │ │ │ +
311
│ │ │ │ +
312
│ │ │ │ +
313
│ │ │ │ +
345template<class Vector>
│ │ │ │ +
│ │ │ │ +
346auto istlVectorBackend(Vector& v)
│ │ │ │ +
347{
│ │ │ │ +
348 static_assert(hasUniqueFieldType<Vector&>(), "Vector type passed to istlVectorBackend() does not have a unique field type.");
│ │ │ │ +
349 return Impl::ISTLVectorBackend<Vector>(v);
│ │ │ │ +
350}
│ │ │ │ +
│ │ │ │ +
351
│ │ │ │ +
352
│ │ │ │ +
353
│ │ │ │ +
383template<class Vector>
│ │ │ │ +
│ │ │ │ +
384auto istlVectorBackend(const Vector& v)
│ │ │ │ +
385{
│ │ │ │ +
386 static_assert(hasUniqueFieldType<const Vector&>(), "Vector type passed to istlVectorBackend() does not have a unique field type.");
│ │ │ │ +
387 return Impl::ISTLVectorBackend<const Vector>(v);
│ │ │ │ +
388}
│ │ │ │ +
│ │ │ │ +
389
│ │ │ │ +
390
│ │ │ │ +
391
│ │ │ │ +
392} // namespace Functions
│ │ │ │ +
393} // namespace Dune
│ │ │ │ +
394
│ │ │ │ +
395
│ │ │ │ +
396#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_ISTLVECTORBACKEND_HH
│ │ │ │ + │ │ │ │ +
auto istlVectorBackend(Vector &v)
Return a vector backend wrapping non-const ISTL like containers.
Definition istlvectorbackend.hh:346
│ │ │ │ +
constexpr decltype(auto) resolveDynamicMultiIndex(C &&c, const MultiIndex &multiIndex, const IsFinal &isFinal)
Provide multi-index access by chaining operator[].
Definition indexaccess.hh:354
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
decltype(auto) resolveRef(T &&t)
This is an alias for Dune::resolveRef.
Definition referencehelper.hh:37
│ │ │ │ -
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:37
│ │ │ │ -
Composition of grid functions with another function.
Definition composedgridfunction.hh:42
│ │ │ │ -
OuterFunction outerFunction_
Definition composedgridfunction.hh:219
│ │ │ │ -
InnerFunctions innerFunctions_
Definition composedgridfunction.hh:220
│ │ │ │ -
ComposedGridFunction(OFT &&outerFunction, IFT &&... innerFunctions)
Create ComposedGridFunction.
Definition composedgridfunction.hh:167
│ │ │ │ -
const EntitySet & entitySet() const
Return the EntitySet associated to this composed grid-function.
Definition composedgridfunction.hh:205
│ │ │ │ -
typename InnerFunction< 0 >::EntitySet EntitySet
Definition composedgridfunction.hh:53
│ │ │ │ -
typename EntitySet::LocalCoordinate LocalDomain
Definition composedgridfunction.hh:57
│ │ │ │ -
typename EntitySet::Element Element
Definition composedgridfunction.hh:54
│ │ │ │ -
InnerLocalFunctions innerLocalFunctions() const
Definition composedgridfunction.hh:212
│ │ │ │ -
friend LocalFunction localFunction(const ComposedGridFunction &cgf)
Create a local-function of this composed grid-function.
Definition composedgridfunction.hh:190
│ │ │ │ -
decltype(std::declval< OF >()(std::declval< IF >()(std::declval< Domain >())...)) Range
Definition composedgridfunction.hh:59
│ │ │ │ -
typename EntitySet::GlobalCoordinate Domain
Definition composedgridfunction.hh:56
│ │ │ │ -
Range operator()(const Domain &x) const
Evaluation of the composed grid function in coordinates x
Definition composedgridfunction.hh:173
│ │ │ │ -
friend Traits::DerivativeInterface derivative(const ComposedGridFunction &t)
Not implemented.
Definition composedgridfunction.hh:179
│ │ │ │ -
Definition gridfunction.hh:32
│ │ │ │ +
constexpr auto fieldTypes()
Generate list of field types in container.
Definition istlvectorbackend.hh:63
│ │ │ │ +
constexpr bool hasUniqueFieldType()
Check if container has a unique field type.
Definition istlvectorbackend.hh:74
│ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── encoding │ │ │ │ │ @@ -1 +1 @@ │ │ │ │ │ -us-ascii │ │ │ │ │ +utf-8 │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,247 +1,362 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _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 │ │ │ │ │ -composedgridfunction.hh │ │ │ │ │ + * _b_a_c_k_e_n_d_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_ISTLVECTORBACKEND_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_ISTLVECTORBACKEND_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ -8 │ │ │ │ │ -9#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_/_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> │ │ │ │ │ -13#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> │ │ │ │ │ -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 │ │ │ │ │ -16 │ │ │ │ │ -17namespace _D_u_n_e { │ │ │ │ │ -18namespace Functions { │ │ │ │ │ -19 │ │ │ │ │ -20 │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ +8#include │ │ │ │ │ +9 │ │ │ │ │ +10#include │ │ │ │ │ +11#include │ │ │ │ │ +12#include │ │ │ │ │ +13#include │ │ │ │ │ +14 │ │ │ │ │ +15#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> │ │ │ │ │ +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 │ │ │ │ │ +18 │ │ │ │ │ +19namespace _D_u_n_e { │ │ │ │ │ +20namespace Functions { │ │ │ │ │ 21 │ │ │ │ │ -40template │ │ │ │ │ -_4_1class _C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ │ -42{ │ │ │ │ │ -43 using InnerFunctions = std::tuple; │ │ │ │ │ -44 using InnerLocalFunctions = std::tuple())))...>; │ │ │ │ │ +22namespace Impl { │ │ │ │ │ +23 │ │ │ │ │ +24template() , │ │ │ │ │ +int> = 0> │ │ │ │ │ +26auto _f_i_e_l_d_T_y_p_e_s(V&& /*v*/) │ │ │ │ │ +27{ │ │ │ │ │ +28 return TypeList{}; │ │ │ │ │ +29} │ │ │ │ │ +30 │ │ │ │ │ +31template(), int> │ │ │ │ │ += 0> │ │ │ │ │ +33auto _f_i_e_l_d_T_y_p_e_s(V&& v) │ │ │ │ │ +34{ │ │ │ │ │ +35 if constexpr (Dune::models, │ │ │ │ │ +V>()) │ │ │ │ │ +36 return _f_i_e_l_d_T_y_p_e_s(v[std::size_t{0}]); │ │ │ │ │ +37 else │ │ │ │ │ +38 { │ │ │ │ │ +39 auto indexRange = typename decltype(range(Hybrid::size(v))):: │ │ │ │ │ +integer_sequence(); │ │ │ │ │ +40 return unpackIntegerSequence([&](auto... i) { │ │ │ │ │ +41 return uniqueTypeList(std::tuple_cat(_f_i_e_l_d_T_y_p_e_s(v[i])...)); │ │ │ │ │ +42 }, indexRange); │ │ │ │ │ +43 } │ │ │ │ │ +44} │ │ │ │ │ 45 │ │ │ │ │ -46 template │ │ │ │ │ -47 using InnerFunction = std::decay_t>>; │ │ │ │ │ +46} // namespace Impl │ │ │ │ │ +47 │ │ │ │ │ 48 │ │ │ │ │ -49 using OuterFunction = OF; │ │ │ │ │ -50 │ │ │ │ │ -51public: │ │ │ │ │ -52 │ │ │ │ │ -_5_3 using _E_n_t_i_t_y_S_e_t = typename InnerFunction<0>::EntitySet; │ │ │ │ │ -_5_4 using _E_l_e_m_e_n_t = typename EntitySet::Element; │ │ │ │ │ -55 │ │ │ │ │ -_5_6 using _D_o_m_a_i_n = typename EntitySet::GlobalCoordinate; │ │ │ │ │ -_5_7 using _L_o_c_a_l_D_o_m_a_i_n = typename EntitySet::LocalCoordinate; │ │ │ │ │ -58 │ │ │ │ │ -_5_9 using _R_a_n_g_e = decltype(std::declval()(std::declval()(std:: │ │ │ │ │ -declval())...)); │ │ │ │ │ -60 │ │ │ │ │ -61private: │ │ │ │ │ -62 │ │ │ │ │ -63 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>; │ │ │ │ │ -64 │ │ │ │ │ -65 class LocalFunction │ │ │ │ │ -66 { │ │ │ │ │ -67 public: │ │ │ │ │ -74 LocalFunction(const _C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n& globalFunction) : │ │ │ │ │ -75 globalFunction_(globalFunction), │ │ │ │ │ -76 innerLocalFunctions_(globalFunction._i_n_n_e_r_L_o_c_a_l_F_u_n_c_t_i_o_n_s()) │ │ │ │ │ -77 {} │ │ │ │ │ +49 │ │ │ │ │ +62template │ │ │ │ │ +_6_3constexpr auto _f_i_e_l_d_T_y_p_e_s() │ │ │ │ │ +64{ │ │ │ │ │ +65 return decltype(Impl::fieldTypes(std::declval())){}; │ │ │ │ │ +66} │ │ │ │ │ +67 │ │ │ │ │ +73template │ │ │ │ │ +_7_4constexpr bool _h_a_s_U_n_i_q_u_e_F_i_e_l_d_T_y_p_e() │ │ │ │ │ +75{ │ │ │ │ │ +76 return std::tuple_size())>>::value==1; │ │ │ │ │ +77} │ │ │ │ │ 78 │ │ │ │ │ -88 void bind(const _E_l_e_m_e_n_t& element) │ │ │ │ │ -89 { │ │ │ │ │ -90 std::apply([&](auto&... innerFunction) { │ │ │ │ │ -91 (innerFunction.bind(element),...); │ │ │ │ │ -92 }, innerLocalFunctions_); │ │ │ │ │ -93 } │ │ │ │ │ -94 │ │ │ │ │ -96 void unbind() │ │ │ │ │ -97 { │ │ │ │ │ -98 std::apply([&](auto&... innerFunction) { │ │ │ │ │ -99 (innerFunction.unbind(),...); │ │ │ │ │ -100 }, innerLocalFunctions_); │ │ │ │ │ -101 } │ │ │ │ │ -102 │ │ │ │ │ -105 bool bound() const │ │ │ │ │ -106 { │ │ │ │ │ -107 return std::apply([](const auto&... innerFunction) { │ │ │ │ │ -108 return (innerFunction.bound() && ...); │ │ │ │ │ -109 }, innerLocalFunctions_); │ │ │ │ │ -110 } │ │ │ │ │ -111 │ │ │ │ │ -121 _R_a_n_g_e operator()(const _L_o_c_a_l_D_o_m_a_i_n& x) const │ │ │ │ │ -122 { │ │ │ │ │ -123 return std::apply([&](const auto&... innerFunction) { │ │ │ │ │ -124 return globalFunction_.outerFunction_(innerFunction(x)...); │ │ │ │ │ -125 }, innerLocalFunctions_); │ │ │ │ │ -126 } │ │ │ │ │ -127 │ │ │ │ │ -137 const _E_l_e_m_e_n_t& localContext() const │ │ │ │ │ -138 { │ │ │ │ │ -139 return std::get<0>(innerLocalFunctions_).localContext(); │ │ │ │ │ -140 } │ │ │ │ │ +79 │ │ │ │ │ +80 │ │ │ │ │ +81namespace Impl { │ │ │ │ │ +82 │ │ │ │ │ +83/* │ │ │ │ │ +84 * \brief A wrapper providing multi-index access to vector entries │ │ │ │ │ +85 * │ │ │ │ │ +86 * The wrapped vector type should be an istl like random │ │ │ │ │ +87 * access container providing operator[] and size() methods. │ │ │ │ │ +88 * For classical containers this should support indices │ │ │ │ │ +89 * of type std::size_t. For multi-type containers indices │ │ │ │ │ +90 * of the form Dune::index_constant should be supported │ │ │ │ │ +91 * while size() should be a static constexpr method. │ │ │ │ │ +92 * │ │ │ │ │ +93 * When resolving multi-indices the backend appends indices │ │ │ │ │ +94 * using operator[] as long as the result is not a scalar. │ │ │ │ │ +95 * If this exhausts the digits of the multi-index, additional │ │ │ │ │ +96 * zero`s are appended. │ │ │ │ │ +97 * │ │ │ │ │ +98 * \tparam V Type of the raw wrapper vector │ │ │ │ │ +99 */ │ │ │ │ │ +100template │ │ │ │ │ +101class ISTLVectorBackend │ │ │ │ │ +102{ │ │ │ │ │ +103 │ │ │ │ │ +104 // Template aliases for using detection idiom. │ │ │ │ │ +105 template │ │ │ │ │ +106 using dynamicIndexAccess_t = decltype(std::declval()[0]); │ │ │ │ │ +107 │ │ │ │ │ +108 template │ │ │ │ │ +109 using staticIndexAccess_t = decltype(std::declval()[Dune::Indices::_0]); │ │ │ │ │ +110 │ │ │ │ │ +111 template │ │ │ │ │ +112 using resizeMethod_t = decltype(std::declval().resize(0)); │ │ │ │ │ +113 │ │ │ │ │ +114 │ │ │ │ │ +115 │ │ │ │ │ +116 // Short cuts for feature detection │ │ │ │ │ +117 template │ │ │ │ │ +118 using hasDynamicIndexAccess = Dune::Std::is_detected>; │ │ │ │ │ +119 │ │ │ │ │ +120 template │ │ │ │ │ +121 using hasStaticIndexAccess = Dune::Std::is_detected>; │ │ │ │ │ +122 │ │ │ │ │ +123 template │ │ │ │ │ +124 using hasResizeMethod = Dune::Std::is_detected>; │ │ │ │ │ +125 │ │ │ │ │ +126 template │ │ │ │ │ +127 using isDynamicVector = Dune::Std::is_detected>; │ │ │ │ │ +128 │ │ │ │ │ +129 template │ │ │ │ │ +130 using isStaticVector = Dune::Std::bool_constant< │ │ │ │ │ +131 Dune::Std::is_detected_v> │ │ │ │ │ +132 and not Dune::Std::is_detected_v>>; │ │ │ │ │ +133 │ │ │ │ │ +134 template │ │ │ │ │ +135 using isScalar = Dune::Std::bool_constant>>; │ │ │ │ │ +136 │ │ │ │ │ +137 template │ │ │ │ │ +138 using isVector = Dune::Std::bool_constant>>; │ │ │ │ │ +139 │ │ │ │ │ +140 │ │ │ │ │ 141 │ │ │ │ │ -143 friend typename _T_r_a_i_t_s_:_:_L_o_c_a_l_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 _d_e_r_i_v_a_t_i_v_e │ │ │ │ │ -(const LocalFunction& t) │ │ │ │ │ +142 template │ │ │ │ │ +143 static void forwardToResize(Args&&... args) │ │ │ │ │ 144 { │ │ │ │ │ -145 DUNE_THROW(NotImplemented,"not implemented"); │ │ │ │ │ +145 resize(std::forward(args)...); │ │ │ │ │ 146 } │ │ │ │ │ 147 │ │ │ │ │ -148 private: │ │ │ │ │ -149 const _C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n& globalFunction_; │ │ │ │ │ -150 InnerLocalFunctions innerLocalFunctions_; │ │ │ │ │ -151 }; │ │ │ │ │ -152 │ │ │ │ │ -153public: │ │ │ │ │ -154 │ │ │ │ │ -164 template = 0, │ │ │ │ │ -166 std::enable_if_t<(sizeof...(IFT) > 0), int> = 0> │ │ │ │ │ -_1_6_7 _C_o_m_p_o_s_e_d_G_r_i_d_F_u_n_c_t_i_o_n(OFT&& outerFunction, IFT&&... innerFunctions) : │ │ │ │ │ -168 _o_u_t_e_r_F_u_n_c_t_i_o_n__(std::forward(outerFunction)), │ │ │ │ │ -169 _i_n_n_e_r_F_u_n_c_t_i_o_n_s__(std::forward(innerFunctions)...) │ │ │ │ │ -170 {} │ │ │ │ │ -171 │ │ │ │ │ -_1_7_3 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(const _D_o_m_a_i_n& x) const │ │ │ │ │ -174 { │ │ │ │ │ -175 DUNE_THROW(NotImplemented,"not implemented"); │ │ │ │ │ -176 } │ │ │ │ │ -177 │ │ │ │ │ -_1_7_9 friend typename _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 _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) │ │ │ │ │ -180 { │ │ │ │ │ -181 DUNE_THROW(NotImplemented,"not implemented"); │ │ │ │ │ -182 } │ │ │ │ │ -183 │ │ │ │ │ -_1_9_0 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) │ │ │ │ │ -191 { │ │ │ │ │ -192 return LocalFunction(cgf); │ │ │ │ │ -193 } │ │ │ │ │ +148 │ │ │ │ │ +149 template::value, int> = 0> │ │ │ │ │ +151 static void resize(C&& c, const SizeProvider& sizeProvider, typename │ │ │ │ │ +SizeProvider::SizePrefix prefix) │ │ │ │ │ +152 { │ │ │ │ │ +153 auto size = sizeProvider.size(prefix); │ │ │ │ │ +154 if (size==0) │ │ │ │ │ +155 { │ │ │ │ │ +156 // If size==0 this prefix refers to a single coefficient c. │ │ │ │ │ +157 // But being in this overload means that c is not a scalar │ │ │ │ │ +158 // because is has a resize() method. Since operator[] deliberately │ │ │ │ │ +159 // supports implicit padding of multi-indices by as many │ │ │ │ │ +160 // [0]'s as needed to resolve a scalar entry, we should also │ │ │ │ │ +161 // except a non-scalar c here. However, this requires that │ │ │ │ │ +162 // we silently believe that whatever size c already has is │ │ │ │ │ +163 // intended by the user. The only exception is c.size()==0 │ │ │ │ │ +164 // which is not acceptable but we also cannot know the desired size. │ │ │ │ │ +165 if (c.size()==0) │ │ │ │ │ +166 DUNE_THROW(RangeError, "The vector entry v[" << prefix << "] should refer │ │ │ │ │ +to a " │ │ │ │ │ +167 << "scalar coefficient, but is a dynamically sized vector of size==0"); │ │ │ │ │ +168 else │ │ │ │ │ +169 // Accept non-zero sized coefficients to avoid that resize(basis) │ │ │ │ │ +170 // fails for a vector that works with operator[] and already │ │ │ │ │ +171 // has the appropriate size. │ │ │ │ │ +172 return; │ │ │ │ │ +173 } │ │ │ │ │ +174 c.resize(size); │ │ │ │ │ +175 prefix.push_back(0); │ │ │ │ │ +176 for(std::size_t i=0; i::value, int> = 0, │ │ │ │ │ +185 std::enable_if_t::value, int> = 0> │ │ │ │ │ +186 static void resize(C&& c, const SizeProvider& sizeProvider, typename │ │ │ │ │ +SizeProvider::SizePrefix prefix) │ │ │ │ │ +187 { │ │ │ │ │ +188 auto size = sizeProvider.size(prefix); │ │ │ │ │ +189 // If size == 0 there's nothing to do: │ │ │ │ │ +190 // We can't resize c and it's already │ │ │ │ │ +191 // large enough anyway. │ │ │ │ │ +192 if (size == 0) │ │ │ │ │ +193 return; │ │ │ │ │ 194 │ │ │ │ │ -_2_0_5 const _E_n_t_i_t_y_S_e_t& _e_n_t_i_t_y_S_e_t() const │ │ │ │ │ -206 { │ │ │ │ │ -207 return _r_e_s_o_l_v_e_R_e_f(std::get<0>(_i_n_n_e_r_F_u_n_c_t_i_o_n_s__)).entitySet(); │ │ │ │ │ -208 } │ │ │ │ │ -209 │ │ │ │ │ -210protected: │ │ │ │ │ -211 │ │ │ │ │ -_2_1_2 InnerLocalFunctions _i_n_n_e_r_L_o_c_a_l_F_u_n_c_t_i_o_n_s() const │ │ │ │ │ -213 { │ │ │ │ │ -214 return std::apply([&](const auto&... innerFunction) { │ │ │ │ │ -215 return std::make_tuple(_l_o_c_a_l_F_u_n_c_t_i_o_n(_r_e_s_o_l_v_e_R_e_f(innerFunction))...); │ │ │ │ │ -216 }, _i_n_n_e_r_F_u_n_c_t_i_o_n_s__); │ │ │ │ │ -217 } │ │ │ │ │ -218 │ │ │ │ │ -_2_1_9 OuterFunction _o_u_t_e_r_F_u_n_c_t_i_o_n__; │ │ │ │ │ -_2_2_0 InnerFunctions _i_n_n_e_r_F_u_n_c_t_i_o_n_s__; │ │ │ │ │ -221}; │ │ │ │ │ -222 │ │ │ │ │ -223 │ │ │ │ │ -224 │ │ │ │ │ -247template │ │ │ │ │ -_2_4_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) │ │ │ │ │ -249{ │ │ │ │ │ -250 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...>; │ │ │ │ │ -251 return ComposedGridFunctionType(std::forward(outerFunction), std:: │ │ │ │ │ -forward(innerFunction)...); │ │ │ │ │ -252} │ │ │ │ │ -253 │ │ │ │ │ +195 // If size>0 but c does not have the appropriate │ │ │ │ │ +196 // size we throw an exception. │ │ │ │ │ +197 // │ │ │ │ │ +198 // We could perhaps also allow c.size()>size. │ │ │ │ │ +199 // But then looping the loop below gets complicated: │ │ │ │ │ +200 // We're not allowed to loop until c.size(). But │ │ │ │ │ +201 // we also cannot use size for termination, │ │ │ │ │ +202 // because this fails if c is a static vector. │ │ │ │ │ +203 if (c.size() != size) │ │ │ │ │ +204 DUNE_THROW(RangeError, "Can't resize non-resizable entry v[" << prefix << │ │ │ │ │ +"] of size " << c.size() << " to size(" << prefix << ")=" << size); │ │ │ │ │ +205 │ │ │ │ │ +206 // Recursively resize all entries of c now. │ │ │ │ │ +207 using namespace Dune::Hybrid; │ │ │ │ │ +208 prefix.push_back(0); │ │ │ │ │ +209 forEach(integralRange(Hybrid::size(c)), [&](auto&& i) { │ │ │ │ │ +210 prefix.back() = i; │ │ │ │ │ +211 // Here we'd simply like to call resize(c[i], sizeProvider, prefix); │ │ │ │ │ +212 // but even gcc-7 does not except this bus reports │ │ │ │ │ +213 // "error: ‘this’ was not captured for this lambda function" │ │ │ │ │ +214 // although there's no 'this' because we're in a static method. │ │ │ │ │ +215 // Bypassing this by and additional method that does perfect │ │ │ │ │ +216 // forwarding allows to workaround this. │ │ │ │ │ +217 ISTLVectorBackend::forwardToResize(c[i], sizeProvider, prefix); │ │ │ │ │ +218 }); │ │ │ │ │ +219 } │ │ │ │ │ +220 │ │ │ │ │ +221 template::value, int> = 0, │ │ │ │ │ +223 std::enable_if_t::value, int> = 0> │ │ │ │ │ +224 static void resize(C&&, const SizeProvider& sizeProvider, typename │ │ │ │ │ +SizeProvider::SizePrefix prefix) │ │ │ │ │ +225 { │ │ │ │ │ +226 auto size = sizeProvider.size(prefix); │ │ │ │ │ +227 if (size != 0) │ │ │ │ │ +228 DUNE_THROW(RangeError, "Can't resize scalar vector entry v[" << prefix << │ │ │ │ │ +"] to size(" << prefix << ")=" << size); │ │ │ │ │ +229 } │ │ │ │ │ +230 │ │ │ │ │ +231 template::value, int> = 0> │ │ │ │ │ +233 void recursiveAssign(C& c, const T& t) │ │ │ │ │ +234 { │ │ │ │ │ +235 c = t; │ │ │ │ │ +236 } │ │ │ │ │ +237 │ │ │ │ │ +238 template::value, int> = 0> │ │ │ │ │ +240 void recursiveAssign(C& c, const T& t) │ │ │ │ │ +241 { │ │ │ │ │ +242 Dune::Hybrid::forEach(c, [&](auto&& ci) { │ │ │ │ │ +243 recursiveAssign(ci, t); │ │ │ │ │ +244 }); │ │ │ │ │ +245 } │ │ │ │ │ +246 │ │ │ │ │ +247public: │ │ │ │ │ +248 │ │ │ │ │ +249 using Vector = V; │ │ │ │ │ +250 │ │ │ │ │ +251 ISTLVectorBackend(Vector& vector) : │ │ │ │ │ +252 vector_(&vector) │ │ │ │ │ +253 {} │ │ │ │ │ 254 │ │ │ │ │ -255 │ │ │ │ │ -256}} // namespace Dune::Functions │ │ │ │ │ -257 │ │ │ │ │ -258 │ │ │ │ │ -259 │ │ │ │ │ -260#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_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_i_f_f_e_r_e_n_t_i_a_b_l_e_f_u_n_c_t_i_o_n_._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_:_:_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:39 │ │ │ │ │ -_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:248 │ │ │ │ │ +255 template │ │ │ │ │ +256 void resize(const SizeProvider& sizeProvider) │ │ │ │ │ +257 { │ │ │ │ │ +258 auto prefix = typename SizeProvider::SizePrefix(); │ │ │ │ │ +259 prefix.resize(0); │ │ │ │ │ +260 resize(*vector_, sizeProvider, prefix); │ │ │ │ │ +261 } │ │ │ │ │ +262 │ │ │ │ │ +263 template │ │ │ │ │ +264 decltype(auto) operator[](const MultiIndex& index) const │ │ │ │ │ +265 { │ │ │ │ │ +266 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); │ │ │ │ │ +267 } │ │ │ │ │ +268 │ │ │ │ │ +269 template │ │ │ │ │ +270 decltype(auto) operator[](const MultiIndex& index) │ │ │ │ │ +271 { │ │ │ │ │ +272 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); │ │ │ │ │ +273 } │ │ │ │ │ +274 │ │ │ │ │ +283 template │ │ │ │ │ +284 void operator= (const T& other) │ │ │ │ │ +285 { │ │ │ │ │ +286 recursiveAssign(vector(), other); │ │ │ │ │ +287 } │ │ │ │ │ +288 │ │ │ │ │ +289 template │ │ │ │ │ +290 void operator= (const ISTLVectorBackend& other) │ │ │ │ │ +291 { │ │ │ │ │ +292 vector() = other.vector(); │ │ │ │ │ +293 } │ │ │ │ │ +294 │ │ │ │ │ +295 const Vector& vector() const │ │ │ │ │ +296 { │ │ │ │ │ +297 return *vector_; │ │ │ │ │ +298 } │ │ │ │ │ +299 │ │ │ │ │ +300 Vector& vector() │ │ │ │ │ +301 { │ │ │ │ │ +302 return *vector_; │ │ │ │ │ +303 } │ │ │ │ │ +304 │ │ │ │ │ +305private: │ │ │ │ │ +306 │ │ │ │ │ +307 Vector* vector_; │ │ │ │ │ +308}; │ │ │ │ │ +309 │ │ │ │ │ +310} // end namespace Impl │ │ │ │ │ +311 │ │ │ │ │ +312 │ │ │ │ │ +313 │ │ │ │ │ +345template │ │ │ │ │ +_3_4_6auto _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(Vector& v) │ │ │ │ │ +347{ │ │ │ │ │ +348 static_assert(hasUniqueFieldType(), "Vector type passed to │ │ │ │ │ +istlVectorBackend() does not have a unique field type."); │ │ │ │ │ +349 return Impl::ISTLVectorBackend(v); │ │ │ │ │ +350} │ │ │ │ │ +351 │ │ │ │ │ +352 │ │ │ │ │ +353 │ │ │ │ │ +383template │ │ │ │ │ +_3_8_4auto _i_s_t_l_V_e_c_t_o_r_B_a_c_k_e_n_d(const Vector& v) │ │ │ │ │ +385{ │ │ │ │ │ +386 static_assert(hasUniqueFieldType(), "Vector type passed to │ │ │ │ │ +istlVectorBackend() does not have a unique field type."); │ │ │ │ │ +387 return Impl::ISTLVectorBackend(v); │ │ │ │ │ +388} │ │ │ │ │ +389 │ │ │ │ │ +390 │ │ │ │ │ +391 │ │ │ │ │ +392} // namespace Functions │ │ │ │ │ +393} // namespace Dune │ │ │ │ │ +394 │ │ │ │ │ +395 │ │ │ │ │ +396#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:346 │ │ │ │ │ +_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:354 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_r_e_s_o_l_v_e_R_e_f │ │ │ │ │ -decltype(auto) resolveRef(T &&t) │ │ │ │ │ -This is an alias for Dune::resolveRef. │ │ │ │ │ -DDeeffiinniittiioonn referencehelper.hh:37 │ │ │ │ │ -_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:37 │ │ │ │ │ -_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:42 │ │ │ │ │ -_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:219 │ │ │ │ │ -_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:220 │ │ │ │ │ -_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:167 │ │ │ │ │ -_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:205 │ │ │ │ │ -_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:53 │ │ │ │ │ -_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: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_:_:_E_l_e_m_e_n_t │ │ │ │ │ -typename EntitySet::Element Element │ │ │ │ │ -DDeeffiinniittiioonn composedgridfunction.hh:54 │ │ │ │ │ -_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:212 │ │ │ │ │ -_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:190 │ │ │ │ │ -_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 >()(std::declval< IF >()(std::declval< Domain > │ │ │ │ │ -())...)) Range │ │ │ │ │ -DDeeffiinniittiioonn composedgridfunction.hh:59 │ │ │ │ │ -_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:56 │ │ │ │ │ -_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:173 │ │ │ │ │ -_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:179 │ │ │ │ │ -_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:32 │ │ │ │ │ +_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:63 │ │ │ │ │ +_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:74 │ │ │ │ │ +_c_o_n_c_e_p_t_s_._h_h │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00188.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: facenormalgridfunction.hh File Reference │ │ │ │ +dune-functions: polynomial.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,39 +65,34 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
facenormalgridfunction.hh File Reference
│ │ │ │ +
polynomial.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 <cmath>
│ │ │ │ +#include <initializer_list>
│ │ │ │ +#include <vector>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::Functions::FaceNormalGridFunction< GV >
 Grid function implementing the piecewise element face normal. More...
class  Dune::Functions::Polynomial< K >
 A scalar polynomial implementation. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,28 +1,23 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _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_f_u_n_c_t_i_o_n_s │ │ │ │ │ _C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -facenormalgridfunction.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_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> │ │ │ │ │ +polynomial.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_:_:_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_._._. │ │ │ │ │ +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_ _> │ │ │ │ │ +  A scalar 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 │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00188_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: facenormalgridfunction.hh Source File │ │ │ │ +dune-functions: polynomial.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,209 +70,124 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
facenormalgridfunction.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#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_ANALYTICFUNCTIONS_POLYNOMIAL_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_ANALYTICFUNCTIONS_POLYNOMIAL_HH
│ │ │ │
5
│ │ │ │ -
6#include <type_traits>
│ │ │ │ -
7#include <optional>
│ │ │ │ -
8
│ │ │ │ -
9#include <dune/common/exceptions.hh>
│ │ │ │ -
10#include <dune/common/typeutilities.hh>
│ │ │ │ -
11#include <dune/common/rangeutilities.hh>
│ │ │ │ -
12#include <dune/geometry/referenceelements.hh>
│ │ │ │ +
6#include <cmath>
│ │ │ │ +
7#include <initializer_list>
│ │ │ │ +
8#include <vector>
│ │ │ │ +
9
│ │ │ │ +
│ │ │ │ +
10namespace Dune {
│ │ │ │ +
│ │ │ │ +
11namespace Functions {
│ │ │ │ +
12
│ │ │ │
13
│ │ │ │ - │ │ │ │ - │ │ │ │ -
16
│ │ │ │ -
17
│ │ │ │ -
18namespace Dune::Functions {
│ │ │ │ -
19
│ │ │ │ -
20namespace Impl {
│ │ │ │ -
21
│ │ │ │ -
22// Compute closest face to point
│ │ │ │ -
23template<class ReferenceElement, class Coordinate>
│ │ │ │ -
24auto closestFaceIndex(const ReferenceElement& re, const Coordinate& x)
│ │ │ │ -
25{
│ │ │ │ -
26 auto closestFaceIndex = decltype(re.subEntity(0,1,0,1)){};
│ │ │ │ -
27 double closestFaceDistance = std::numeric_limits<double>::max();
│ │ │ │ -
28 for(auto&& faceIndex : Dune::range(re.size(1)))
│ │ │ │ -
29 {
│ │ │ │ -
30 // For a face unit outer normal consider the orthogonal projection
│ │ │ │ -
31 // Px = x + <c-x,n>*n into the face. Then the distance to the face
│ │ │ │ -
32 // is given by |x-Px| = |<c-x,n>||n| = <c-x,n>.
│ │ │ │ -
33 auto normal = re.integrationOuterNormal(faceIndex);
│ │ │ │ -
34 normal /= normal.two_norm();
│ │ │ │ -
35 auto c = re.position(faceIndex,1);
│ │ │ │ -
36 c -= x;
│ │ │ │ -
37 auto faceDistance = (c*normal);
│ │ │ │ -
38 if (faceDistance<closestFaceDistance)
│ │ │ │ -
39 {
│ │ │ │ -
40 closestFaceDistance = faceDistance;
│ │ │ │ -
41 closestFaceIndex = faceIndex;
│ │ │ │ -
42 }
│ │ │ │ -
43 }
│ │ │ │ -
44 return closestFaceIndex;
│ │ │ │ -
45}
│ │ │ │ -
46
│ │ │ │ -
47} // end namespace Impl
│ │ │ │ -
48
│ │ │ │ -
49
│ │ │ │ -
50
│ │ │ │ -
51
│ │ │ │ -
64template<class GV>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
66{
│ │ │ │ -
67public:
│ │ │ │ -
68 using GridView = GV;
│ │ │ │ - │ │ │ │ -
70 using Element = typename EntitySet::Element;
│ │ │ │ -
71
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ +
24template<class K>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
26{
│ │ │ │ +
27public:
│ │ │ │ +
28
│ │ │ │ +
30 Polynomial() = default;
│ │ │ │ +
31
│ │ │ │ +
33 Polynomial(const Polynomial& other) = default;
│ │ │ │ +
34
│ │ │ │ +
36 Polynomial(Polynomial&& other) = default;
│ │ │ │ +
37
│ │ │ │ +
39 Polynomial& operator=(const Polynomial& other) = default;
│ │ │ │ +
40
│ │ │ │ +
42 Polynomial& operator=(Polynomial&& other) = default;
│ │ │ │ +
43
│ │ │ │ +
│ │ │ │ +
50 Polynomial(std::initializer_list<K> coefficients) :
│ │ │ │ +
51 coefficients_(coefficients)
│ │ │ │ +
52 {}
│ │ │ │ +
│ │ │ │ +
53
│ │ │ │ +
│ │ │ │ +
61 Polynomial(std::vector<K>&& coefficients) :
│ │ │ │ +
62 coefficients_(std::move(coefficients))
│ │ │ │ +
63 {}
│ │ │ │ +
│ │ │ │ +
64
│ │ │ │ +
│ │ │ │ +
72 Polynomial(const std::vector<K>& coefficients) :
│ │ │ │ +
73 coefficients_(coefficients)
│ │ │ │ +
74 {}
│ │ │ │ +
│ │ │ │
75
│ │ │ │ -
76private:
│ │ │ │ -
77
│ │ │ │ -
78 using Traits = Imp::GridFunctionTraits<Range(Domain), EntitySet, DefaultDerivativeTraits, 16>;
│ │ │ │ -
79
│ │ │ │ -
80 class LocalFunction
│ │ │ │ -
81 {
│ │ │ │ -
82 using Geometry = typename Element::Geometry;
│ │ │ │ -
83 static const int dimension = GV::dimension;
│ │ │ │ -
84 public:
│ │ │ │ -
85
│ │ │ │ -
97 void bind(const Element& element)
│ │ │ │ -
98 {
│ │ │ │ -
99 element_ = element;
│ │ │ │ -
100 geometry_.emplace(element_.geometry());
│ │ │ │ -
101 }
│ │ │ │ -
102
│ │ │ │ -
103 void unbind()
│ │ │ │ -
104 {
│ │ │ │ -
105 geometry_.reset();
│ │ │ │ -
106 }
│ │ │ │ +
│ │ │ │ +
77 K operator() (const K& x) const
│ │ │ │ +
78 {
│ │ │ │ +
79 auto y = K(0);
│ │ │ │ +
80 for (size_t i=0; i<coefficients_.size(); ++i)
│ │ │ │ +
81 y += coefficients_[i] * std::pow(x, i);
│ │ │ │ +
82 return y;
│ │ │ │ +
83 }
│ │ │ │ +
│ │ │ │ +
84
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
95 {
│ │ │ │ +
96 std::vector<K> dpCoefficients(p.coefficients().size()-1);
│ │ │ │ +
97 for (size_t i=1; i<p.coefficients_.size(); ++i)
│ │ │ │ +
98 dpCoefficients[i-1] = p.coefficients()[i]*i;
│ │ │ │ +
99 return Polynomial(std::move(dpCoefficients));
│ │ │ │ +
100 }
│ │ │ │ +
│ │ │ │ +
101
│ │ │ │ +
│ │ │ │ +
103 const std::vector<K>& coefficients() const
│ │ │ │ +
104 {
│ │ │ │ +
105 return coefficients_;
│ │ │ │ +
106 }
│ │ │ │ +
│ │ │ │
107
│ │ │ │ -
110 bool bound() const
│ │ │ │ -
111 {
│ │ │ │ -
112 return static_cast<bool>(geometry_);
│ │ │ │ -
113 }
│ │ │ │ -
114
│ │ │ │ -
124 Range operator()(const LocalDomain& x) const
│ │ │ │ -
125 {
│ │ │ │ -
126 auto&& re = Dune::referenceElement(*geometry_);
│ │ │ │ -
127 // Compute reference normal of closest face to given point
│ │ │ │ -
128 auto face = Impl::closestFaceIndex(re, x);
│ │ │ │ -
129 auto localNormal = re.integrationOuterNormal(face);
│ │ │ │ -
130
│ │ │ │ -
131 // Transform reference normal into global unit outer normal using
│ │ │ │ -
132 // covariant Piola transformation
│ │ │ │ -
133 auto normal = Range{};
│ │ │ │ -
134 geometry_->jacobianInverseTransposed(x).mv(localNormal, normal);
│ │ │ │ -
135 normal /= normal.two_norm();
│ │ │ │ -
136 return normal;
│ │ │ │ -
137 }
│ │ │ │ -
138
│ │ │ │ -
140 const Element& localContext() const
│ │ │ │ -
141 {
│ │ │ │ -
142 return element_;
│ │ │ │ -
143 }
│ │ │ │ -
144
│ │ │ │ -
146 friend typename Traits::LocalFunctionTraits::DerivativeInterface derivative(const LocalFunction& t)
│ │ │ │ -
147 {
│ │ │ │ -
148 DUNE_THROW(NotImplemented,"not implemented");
│ │ │ │ -
149 }
│ │ │ │ -
150
│ │ │ │ -
151 private:
│ │ │ │ -
152 std::optional<Geometry> geometry_;
│ │ │ │ -
153 Element element_;
│ │ │ │ -
154 };
│ │ │ │ -
155
│ │ │ │ -
156public:
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
159 entitySet_(gridView)
│ │ │ │ -
160 {}
│ │ │ │ -
│ │ │ │ -
161
│ │ │ │ -
│ │ │ │ -
163 Range operator()(const Domain& x) const
│ │ │ │ -
164 {
│ │ │ │ -
165 DUNE_THROW(NotImplemented,"not implemented");
│ │ │ │ -
166 }
│ │ │ │ -
│ │ │ │ -
167
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
170 {
│ │ │ │ -
171 DUNE_THROW(NotImplemented,"not implemented");
│ │ │ │ -
172 }
│ │ │ │ -
│ │ │ │ -
173
│ │ │ │ -
│ │ │ │ -
175 friend LocalFunction localFunction(const FaceNormalGridFunction& t)
│ │ │ │ -
176 {
│ │ │ │ -
177 return LocalFunction{};
│ │ │ │ -
178 }
│ │ │ │ -
│ │ │ │ -
179
│ │ │ │ -
│ │ │ │ -
181 const EntitySet& entitySet() const
│ │ │ │ -
182 {
│ │ │ │ -
183 return entitySet_;
│ │ │ │ -
184 }
│ │ │ │ -
│ │ │ │ -
185
│ │ │ │ -
186private:
│ │ │ │ -
187 EntitySet entitySet_;
│ │ │ │ -
188};
│ │ │ │ -
│ │ │ │ -
189
│ │ │ │ -
190
│ │ │ │ -
191
│ │ │ │ -
192} // namespace Dune::Functions
│ │ │ │ -
193
│ │ │ │ -
194#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ -
TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
Obtain derivative of TrigonometricFunction function.
Definition trigonometricfunction.hh:39
│ │ │ │ +
108private:
│ │ │ │ +
109 std::vector<K> coefficients_;
│ │ │ │ +
110};
│ │ │ │ +
│ │ │ │ +
111
│ │ │ │ +
112
│ │ │ │ +
113
│ │ │ │ +
114}} // namespace Dune::Functions
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
115
│ │ │ │ +
116
│ │ │ │ +
117
│ │ │ │ +
118#endif // DUNE_FUNCTIONS_ANALYTICFUNCTIONS_POLYNOMIAL_HH
│ │ │ │ +
friend Polynomial derivative(const Polynomial &p)
Obtain derivative of Polynomial function.
Definition polynomial.hh:94
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ -
Definition polynomial.hh:11
│ │ │ │ -
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:37
│ │ │ │ -
Grid function implementing the piecewise element face normal.
Definition facenormalgridfunction.hh:66
│ │ │ │ -
GridViewEntitySet< GridView, 0 > EntitySet
Definition facenormalgridfunction.hh:69
│ │ │ │ -
typename EntitySet::LocalCoordinate LocalDomain
Definition facenormalgridfunction.hh:72
│ │ │ │ -
typename EntitySet::GlobalCoordinate Domain
Definition facenormalgridfunction.hh:73
│ │ │ │ -
typename EntitySet::GlobalCoordinate Range
Definition facenormalgridfunction.hh:74
│ │ │ │ -
const EntitySet & entitySet() const
Return the stored GridViewEntitySet.
Definition facenormalgridfunction.hh:181
│ │ │ │ -
friend Traits::DerivativeInterface derivative(const FaceNormalGridFunction &t)
Not implemented.
Definition facenormalgridfunction.hh:169
│ │ │ │ -
GV GridView
Definition facenormalgridfunction.hh:68
│ │ │ │ -
friend LocalFunction localFunction(const FaceNormalGridFunction &t)
Return a local-function associated to FaceNormalGridFunction.
Definition facenormalgridfunction.hh:175
│ │ │ │ -
FaceNormalGridFunction(const GridView &gridView)
Construct the FaceNormalGridFunction.
Definition facenormalgridfunction.hh:158
│ │ │ │ -
typename EntitySet::Element Element
Definition facenormalgridfunction.hh:70
│ │ │ │ -
Range operator()(const Domain &x) const
Not implemented.
Definition facenormalgridfunction.hh:163
│ │ │ │ -
Definition gridfunction.hh:32
│ │ │ │ - │ │ │ │ -
GridView::template Codim< codim >::Entity Element
Type of Elements contained in this EntitySet.
Definition gridviewentityset.hh:32
│ │ │ │ -
Element::Geometry::LocalCoordinate LocalCoordinate
Type of local coordinates with respect to the Element.
Definition gridviewentityset.hh:35
│ │ │ │ -
Element::Geometry::GlobalCoordinate GlobalCoordinate
Definition gridviewentityset.hh:36
│ │ │ │ +
A scalar polynomial implementation.
Definition polynomial.hh:26
│ │ │ │ +
Polynomial()=default
Default constructor.
│ │ │ │ +
const std::vector< K > & coefficients() const
Obtain reference to coefficient vector.
Definition polynomial.hh:103
│ │ │ │ +
Polynomial & operator=(const Polynomial &other)=default
Copy-assignment operator.
│ │ │ │ +
Polynomial & operator=(Polynomial &&other)=default
Move-assignment operator.
│ │ │ │ +
Polynomial(std::initializer_list< K > coefficients)
Create from list of coefficients.
Definition polynomial.hh:50
│ │ │ │ +
K operator()(const K &x) const
Evaluate polynomial.
Definition polynomial.hh:77
│ │ │ │ +
Polynomial(const Polynomial &other)=default
Copy constructor.
│ │ │ │ +
Polynomial(Polynomial &&other)=default
Move constructor.
│ │ │ │ +
Polynomial(const std::vector< K > &coefficients)
Create from list of coefficients.
Definition polynomial.hh:72
│ │ │ │ +
Polynomial(std::vector< K > &&coefficients)
Create from list of coefficients.
Definition polynomial.hh:61
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,236 +1,127 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _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 │ │ │ │ │ -facenormalgridfunction.hh │ │ │ │ │ + * _a_n_a_l_y_t_i_c_f_u_n_c_t_i_o_n_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_ANALYTICFUNCTIONS_POLYNOMIAL_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_ANALYTICFUNCTIONS_POLYNOMIAL_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ -8 │ │ │ │ │ -9#include │ │ │ │ │ -10#include │ │ │ │ │ -11#include │ │ │ │ │ -12#include │ │ │ │ │ +6#include │ │ │ │ │ +7#include │ │ │ │ │ +8#include │ │ │ │ │ +9 │ │ │ │ │ +_1_0namespace _D_u_n_e { │ │ │ │ │ +_1_1namespace Functions { │ │ │ │ │ +12 │ │ │ │ │ 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 │ │ │ │ │ -17 │ │ │ │ │ -18namespace _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s { │ │ │ │ │ -19 │ │ │ │ │ -20namespace Impl { │ │ │ │ │ -21 │ │ │ │ │ -22// Compute closest face to point │ │ │ │ │ -23template │ │ │ │ │ -24auto closestFaceIndex(const ReferenceElement& re, const Coordinate& x) │ │ │ │ │ -25{ │ │ │ │ │ -26 auto closestFaceIndex = decltype(re.subEntity(0,1,0,1)){}; │ │ │ │ │ -27 double closestFaceDistance = std::numeric_limits::max(); │ │ │ │ │ -28 for(auto&& faceIndex : _D_u_n_e::range(re.size(1))) │ │ │ │ │ -29 { │ │ │ │ │ -30 // For a face unit outer normal consider the orthogonal projection │ │ │ │ │ -31 // Px = x + *n into the face. Then the distance to the face │ │ │ │ │ -32 // is given by |x-Px| = |||n| = . │ │ │ │ │ -33 auto normal = re.integrationOuterNormal(faceIndex); │ │ │ │ │ -34 normal /= normal.two_norm(); │ │ │ │ │ -35 auto c = re.position(faceIndex,1); │ │ │ │ │ -36 c -= x; │ │ │ │ │ -37 auto faceDistance = (c*normal); │ │ │ │ │ -38 if (faceDistance │ │ │ │ │ -_6_5class _F_a_c_e_N_o_r_m_a_l_G_r_i_d_F_u_n_c_t_i_o_n │ │ │ │ │ -66{ │ │ │ │ │ -67public: │ │ │ │ │ -_6_8 using _G_r_i_d_V_i_e_w = GV; │ │ │ │ │ -_6_9 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_0 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; │ │ │ │ │ -71 │ │ │ │ │ -_7_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; │ │ │ │ │ -_7_3 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_4 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; │ │ │ │ │ +24template │ │ │ │ │ +_2_5class _P_o_l_y_n_o_m_i_a_l │ │ │ │ │ +26{ │ │ │ │ │ +27public: │ │ │ │ │ +28 │ │ │ │ │ +_3_0 _P_o_l_y_n_o_m_i_a_l() = default; │ │ │ │ │ +31 │ │ │ │ │ +_3_3 _P_o_l_y_n_o_m_i_a_l(const _P_o_l_y_n_o_m_i_a_l& other) = default; │ │ │ │ │ +34 │ │ │ │ │ +_3_6 _P_o_l_y_n_o_m_i_a_l(_P_o_l_y_n_o_m_i_a_l&& other) = default; │ │ │ │ │ +37 │ │ │ │ │ +_3_9 _P_o_l_y_n_o_m_i_a_l& _o_p_e_r_a_t_o_r_=(const _P_o_l_y_n_o_m_i_a_l& other) = default; │ │ │ │ │ +40 │ │ │ │ │ +_4_2 _P_o_l_y_n_o_m_i_a_l& _o_p_e_r_a_t_o_r_=(_P_o_l_y_n_o_m_i_a_l&& other) = default; │ │ │ │ │ +43 │ │ │ │ │ +_5_0 _P_o_l_y_n_o_m_i_a_l(std::initializer_list _c_o_e_f_f_i_c_i_e_n_t_s) : │ │ │ │ │ +51 coefficients_(_c_o_e_f_f_i_c_i_e_n_t_s) │ │ │ │ │ +52 {} │ │ │ │ │ +53 │ │ │ │ │ +_6_1 _P_o_l_y_n_o_m_i_a_l(std::vector&& _c_o_e_f_f_i_c_i_e_n_t_s) : │ │ │ │ │ +62 coefficients_(std::move(_c_o_e_f_f_i_c_i_e_n_t_s)) │ │ │ │ │ +63 {} │ │ │ │ │ +64 │ │ │ │ │ +_7_2 _P_o_l_y_n_o_m_i_a_l(const std::vector& _c_o_e_f_f_i_c_i_e_n_t_s) : │ │ │ │ │ +73 coefficients_(_c_o_e_f_f_i_c_i_e_n_t_s) │ │ │ │ │ +74 {} │ │ │ │ │ 75 │ │ │ │ │ -76private: │ │ │ │ │ -77 │ │ │ │ │ -78 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>; │ │ │ │ │ -79 │ │ │ │ │ -80 class LocalFunction │ │ │ │ │ -81 { │ │ │ │ │ -82 using Geometry = typename Element::Geometry; │ │ │ │ │ -83 static const int dimension = GV::dimension; │ │ │ │ │ -84 public: │ │ │ │ │ -85 │ │ │ │ │ -97 void bind(const _E_l_e_m_e_n_t& element) │ │ │ │ │ -98 { │ │ │ │ │ -99 element_ = element; │ │ │ │ │ -100 geometry_.emplace(element_.geometry()); │ │ │ │ │ -101 } │ │ │ │ │ -102 │ │ │ │ │ -103 void unbind() │ │ │ │ │ +_7_7 K _o_p_e_r_a_t_o_r_(_)_ (const K& x) const │ │ │ │ │ +78 { │ │ │ │ │ +79 auto y = K(0); │ │ │ │ │ +80 for (size_t i=0; i dpCoefficients(p._c_o_e_f_f_i_c_i_e_n_t_s().size()-1); │ │ │ │ │ +97 for (size_t i=1; i& _c_o_e_f_f_i_c_i_e_n_t_s() const │ │ │ │ │ 104 { │ │ │ │ │ -105 geometry_.reset(); │ │ │ │ │ +105 return coefficients_; │ │ │ │ │ 106 } │ │ │ │ │ 107 │ │ │ │ │ -110 bool bound() const │ │ │ │ │ -111 { │ │ │ │ │ -112 return static_cast(geometry_); │ │ │ │ │ -113 } │ │ │ │ │ -114 │ │ │ │ │ -124 _R_a_n_g_e operator()(const _L_o_c_a_l_D_o_m_a_i_n& x) const │ │ │ │ │ -125 { │ │ │ │ │ -126 auto&& re = Dune::referenceElement(*geometry_); │ │ │ │ │ -127 // Compute reference normal of closest face to given point │ │ │ │ │ -128 auto face = Impl::closestFaceIndex(re, x); │ │ │ │ │ -129 auto localNormal = re.integrationOuterNormal(face); │ │ │ │ │ -130 │ │ │ │ │ -131 // Transform reference normal into global unit outer normal using │ │ │ │ │ -132 // covariant Piola transformation │ │ │ │ │ -133 auto normal = _R_a_n_g_e{}; │ │ │ │ │ -134 geometry_->jacobianInverseTransposed(x).mv(localNormal, normal); │ │ │ │ │ -135 normal /= normal.two_norm(); │ │ │ │ │ -136 return normal; │ │ │ │ │ -137 } │ │ │ │ │ -138 │ │ │ │ │ -140 const _E_l_e_m_e_n_t& localContext() const │ │ │ │ │ -141 { │ │ │ │ │ -142 return element_; │ │ │ │ │ -143 } │ │ │ │ │ -144 │ │ │ │ │ -146 friend typename _T_r_a_i_t_s_:_:_L_o_c_a_l_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 _d_e_r_i_v_a_t_i_v_e │ │ │ │ │ -(const LocalFunction& t) │ │ │ │ │ -147 { │ │ │ │ │ -148 DUNE_THROW(NotImplemented,"not implemented"); │ │ │ │ │ -149 } │ │ │ │ │ -150 │ │ │ │ │ -151 private: │ │ │ │ │ -152 std::optional geometry_; │ │ │ │ │ -153 _E_l_e_m_e_n_t element_; │ │ │ │ │ -154 }; │ │ │ │ │ -155 │ │ │ │ │ -156public: │ │ │ │ │ -_1_5_8 _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) : │ │ │ │ │ -159 entitySet_(gridView) │ │ │ │ │ -160 {} │ │ │ │ │ -161 │ │ │ │ │ -_1_6_3 _R_a_n_g_e _o_p_e_r_a_t_o_r_(_)(const _D_o_m_a_i_n& x) const │ │ │ │ │ -164 { │ │ │ │ │ -165 DUNE_THROW(NotImplemented,"not implemented"); │ │ │ │ │ -166 } │ │ │ │ │ -167 │ │ │ │ │ -_1_6_9 friend typename _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 _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) │ │ │ │ │ -170 { │ │ │ │ │ -171 DUNE_THROW(NotImplemented,"not implemented"); │ │ │ │ │ -172 } │ │ │ │ │ -173 │ │ │ │ │ -_1_7_5 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) │ │ │ │ │ -176 { │ │ │ │ │ -177 return LocalFunction{}; │ │ │ │ │ -178 } │ │ │ │ │ -179 │ │ │ │ │ -_1_8_1 const _E_n_t_i_t_y_S_e_t& _e_n_t_i_t_y_S_e_t() const │ │ │ │ │ -182 { │ │ │ │ │ -183 return entitySet_; │ │ │ │ │ -184 } │ │ │ │ │ -185 │ │ │ │ │ -186private: │ │ │ │ │ -187 _E_n_t_i_t_y_S_e_t entitySet_; │ │ │ │ │ -188}; │ │ │ │ │ -189 │ │ │ │ │ -190 │ │ │ │ │ -191 │ │ │ │ │ -192} // namespace Dune::Functions │ │ │ │ │ -193 │ │ │ │ │ -194#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 │ │ │ │ │ -_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:39 │ │ │ │ │ +108private: │ │ │ │ │ +109 std::vector coefficients_; │ │ │ │ │ +110}; │ │ │ │ │ +111 │ │ │ │ │ +112 │ │ │ │ │ +113 │ │ │ │ │ +114}} // namespace Dune::Functions │ │ │ │ │ +115 │ │ │ │ │ +116 │ │ │ │ │ +117 │ │ │ │ │ +118#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 Polynomial derivative(const Polynomial &p) │ │ │ │ │ +Obtain derivative of Polynomial function. │ │ │ │ │ +DDeeffiinniittiioonn polynomial.hh:94 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ -_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s │ │ │ │ │ -DDeeffiinniittiioonn polynomial.hh:11 │ │ │ │ │ -_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:37 │ │ │ │ │ -_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 │ │ │ │ │ -Grid function implementing the piecewise element face normal. │ │ │ │ │ -DDeeffiinniittiioonn facenormalgridfunction.hh:66 │ │ │ │ │ -_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:69 │ │ │ │ │ -_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: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_:_:_D_o_m_a_i_n │ │ │ │ │ -typename EntitySet::GlobalCoordinate Domain │ │ │ │ │ -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_:_:_R_a_n_g_e │ │ │ │ │ -typename EntitySet::GlobalCoordinate Range │ │ │ │ │ -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_:_:_e_n_t_i_t_y_S_e_t │ │ │ │ │ -const EntitySet & entitySet() const │ │ │ │ │ -Return the stored GridViewEntitySet. │ │ │ │ │ -DDeeffiinniittiioonn facenormalgridfunction.hh:181 │ │ │ │ │ -_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:169 │ │ │ │ │ -_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:68 │ │ │ │ │ -_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:175 │ │ │ │ │ -_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:158 │ │ │ │ │ -_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:70 │ │ │ │ │ -_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:163 │ │ │ │ │ -_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: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_ _> │ │ │ │ │ -_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 │ │ │ │ │ -Type of Elements contained in this EntitySet. │ │ │ │ │ -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_ _>_:_:_L_o_c_a_l_C_o_o_r_d_i_n_a_t_e │ │ │ │ │ -Element::Geometry::LocalCoordinate LocalCoordinate │ │ │ │ │ -Type of local coordinates with respect to the Element. │ │ │ │ │ -DDeeffiinniittiioonn gridviewentityset.hh:35 │ │ │ │ │ -_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:36 │ │ │ │ │ +_D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_P_o_l_y_n_o_m_i_a_l │ │ │ │ │ +A scalar polynomial implementation. │ │ │ │ │ +DDeeffiinniittiioonn polynomial.hh:26 │ │ │ │ │ +_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_:_:_c_o_e_f_f_i_c_i_e_n_t_s │ │ │ │ │ +const std::vector< K > & coefficients() const │ │ │ │ │ +Obtain reference to coefficient vector. │ │ │ │ │ +DDeeffiinniittiioonn polynomial.hh:103 │ │ │ │ │ +_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_= │ │ │ │ │ +Polynomial & operator=(const Polynomial &other)=default │ │ │ │ │ +Copy-assignment operator. │ │ │ │ │ +_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_= │ │ │ │ │ +Polynomial & operator=(Polynomial &&other)=default │ │ │ │ │ +Move-assignment operator. │ │ │ │ │ +_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(std::initializer_list< K > coefficients) │ │ │ │ │ +Create from list of coefficients. │ │ │ │ │ +DDeeffiinniittiioonn polynomial.hh:50 │ │ │ │ │ +_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. │ │ │ │ │ +DDeeffiinniittiioonn polynomial.hh:77 │ │ │ │ │ +_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(const Polynomial &other)=default │ │ │ │ │ +Copy constructor. │ │ │ │ │ +_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(Polynomial &&other)=default │ │ │ │ │ +Move constructor. │ │ │ │ │ +_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(const std::vector< K > &coefficients) │ │ │ │ │ +Create from list of coefficients. │ │ │ │ │ +DDeeffiinniittiioonn polynomial.hh:72 │ │ │ │ │ +_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(std::vector< K > &&coefficients) │ │ │ │ │ +Create from list of coefficients. │ │ │ │ │ +DDeeffiinniittiioonn polynomial.hh:61 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00191.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: gridfunction_imp.hh File Reference │ │ │ │ +dune-functions: trigonometricfunction.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,35 +65,48 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Namespaces
│ │ │ │ -
gridfunction_imp.hh File Reference
│ │ │ │ +Classes | │ │ │ │ +Namespaces | │ │ │ │ +Functions
│ │ │ │ +
trigonometricfunction.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <dune/functions/common/type_traits.hh>
│ │ │ │ -#include <dune/functions/common/interfaces.hh>
│ │ │ │ -#include <dune/functions/common/differentiablefunction_imp.hh>
│ │ │ │ +
#include <cmath>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │

│ │ │ │ Namespaces

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

│ │ │ │ +Classes

class  Dune::Functions::TrigonometricFunction< K, sinFactor, cosFactor >
 A linear combination of trigonomic functions. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +

│ │ │ │ Namespaces

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

│ │ │ │ +Functions

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.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,20 +1,30 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _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 │ │ │ │ │ -_N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -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> │ │ │ │ │ + * _a_n_a_l_y_t_i_c_f_u_n_c_t_i_o_n_s │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +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_:_:_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 │ │ │ │ │   │ │ │ │ │ +FFuunnccttiioonnss │ │ │ │ │ +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. │ │ │ │ │ +  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a00191_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: gridfunction_imp.hh Source File │ │ │ │ +dune-functions: trigonometricfunction.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,92 +70,67 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
gridfunction_imp.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#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
│ │ │ │
5
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
9
│ │ │ │ +
6#include <cmath>
│ │ │ │ +
7
│ │ │ │ +
8namespace Dune {
│ │ │ │ +
9namespace Functions {
│ │ │ │
10
│ │ │ │
11
│ │ │ │ -
12namespace Dune {
│ │ │ │ -
13namespace Functions {
│ │ │ │ -
14namespace Imp {
│ │ │ │ -
15
│ │ │ │ -
19struct HasFreeLocalFunction
│ │ │ │ -
20{
│ │ │ │ -
21 template<class F>
│ │ │ │ -
22 auto require(F&& f) -> decltype(
│ │ │ │ -
23 localFunction(f)
│ │ │ │ -
24 );
│ │ │ │ -
25};
│ │ │ │ -
26
│ │ │ │ -
27
│ │ │ │ -
28
│ │ │ │ -
29// Interface of type erasure wrapper
│ │ │ │ -
30//
│ │ │ │ -
31// Notice that the basic interface of polymorphic classes (destructor, clone, ...)
│ │ │ │ -
32// will be added by the type erasure foundation classes.
│ │ │ │ -
33template<class Signature, class DerivativeInterface, class LocalFunctionInterface, class EntitySet>
│ │ │ │ -
34class GridFunctionWrapperInterface :
│ │ │ │ -
35 public DifferentiableFunctionWrapperInterface<Signature, DerivativeInterface>
│ │ │ │ -
36{
│ │ │ │ -
37public:
│ │ │ │ -
38 virtual LocalFunctionInterface wrappedLocalFunction() const = 0;
│ │ │ │ -
39
│ │ │ │ -
40 virtual const EntitySet& wrappedEntitySet() const = 0;
│ │ │ │ -
41};
│ │ │ │ -
42
│ │ │ │ +
12
│ │ │ │ +
25template<class K, int sinFactor, int cosFactor>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
27{
│ │ │ │ +
28public:
│ │ │ │ +
│ │ │ │ +
30 K operator () (const K& x) const
│ │ │ │ +
31 {
│ │ │ │ +
32 return sinFactor * std::sin(x) + cosFactor * std::cos(x);
│ │ │ │ +
33 }
│ │ │ │ +
│ │ │ │ +
34};
│ │ │ │ +
│ │ │ │ +
35
│ │ │ │ +
36
│ │ │ │ +
38template<class K, int sinFactor, int cosFactor>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
40{
│ │ │ │ +
41 return TrigonometricFunction<K, -cosFactor, sinFactor>();
│ │ │ │ +
42}
│ │ │ │ +
│ │ │ │
43
│ │ │ │ -
44// Implementation of type erasure wrapper
│ │ │ │ -
45template<class Signature, class DerivativeInterface, class LocalFunctionInterface, class EntitySet, class B>
│ │ │ │ -
46class GridFunctionWrapperImplementation :
│ │ │ │ -
47 public DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>
│ │ │ │ -
48{
│ │ │ │ -
49 using Base = DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>;
│ │ │ │ -
50public:
│ │ │ │ -
51 using Base::Base;
│ │ │ │ -
52
│ │ │ │ -
53 virtual LocalFunctionInterface wrappedLocalFunction() const
│ │ │ │ -
54 {
│ │ │ │ -
55 return localFunction(this->get());
│ │ │ │ -
56 }
│ │ │ │ -
57
│ │ │ │ -
58 virtual const EntitySet& wrappedEntitySet() const
│ │ │ │ -
59 {
│ │ │ │ -
60 return this->get().entitySet();
│ │ │ │ -
61 }
│ │ │ │ -
62};
│ │ │ │ -
63
│ │ │ │ -
64
│ │ │ │ -
65
│ │ │ │ -
66}}} // namespace Dune::Functions::Imp
│ │ │ │ -
67
│ │ │ │ -
68
│ │ │ │ -
69
│ │ │ │ -
70#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ +
44
│ │ │ │ +
45
│ │ │ │ +
46}} // namespace Dune::Functions
│ │ │ │ +
47
│ │ │ │ +
48
│ │ │ │ +
49
│ │ │ │ +
50#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:39
│ │ │ │
Definition polynomial.hh:10
│ │ │ │ +
A linear combination of trigonomic functions.
Definition trigonometricfunction.hh:27
│ │ │ │ +
K operator()(const K &x) const
Evaluate function.
Definition trigonometricfunction.hh:30
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,89 +1,62 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _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 │ │ │ │ │ -gridfunction_imp.hh │ │ │ │ │ + * _a_n_a_l_y_t_i_c_f_u_n_c_t_i_o_n_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH │ │ │ │ │ 5 │ │ │ │ │ -6#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> │ │ │ │ │ -7#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> │ │ │ │ │ -8#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> │ │ │ │ │ -9 │ │ │ │ │ +6#include │ │ │ │ │ +7 │ │ │ │ │ +8namespace _D_u_n_e { │ │ │ │ │ +9namespace Functions { │ │ │ │ │ 10 │ │ │ │ │ 11 │ │ │ │ │ -12namespace _D_u_n_e { │ │ │ │ │ -13namespace Functions { │ │ │ │ │ -14namespace Imp { │ │ │ │ │ -15 │ │ │ │ │ -19struct HasFreeLocalFunction │ │ │ │ │ -20{ │ │ │ │ │ -21 template │ │ │ │ │ -22 auto require(F&& f) -> decltype( │ │ │ │ │ -23 localFunction(f) │ │ │ │ │ -24 ); │ │ │ │ │ -25}; │ │ │ │ │ -26 │ │ │ │ │ -27 │ │ │ │ │ -28 │ │ │ │ │ -29// Interface of type erasure wrapper │ │ │ │ │ -30// │ │ │ │ │ -31// Notice that the basic interface of polymorphic classes (destructor, clone, │ │ │ │ │ -...) │ │ │ │ │ -32// will be added by the type erasure foundation classes. │ │ │ │ │ -33template │ │ │ │ │ -34class GridFunctionWrapperInterface : │ │ │ │ │ -35 public DifferentiableFunctionWrapperInterface │ │ │ │ │ -36{ │ │ │ │ │ -37public: │ │ │ │ │ -38 virtual LocalFunctionInterface wrappedLocalFunction() const = 0; │ │ │ │ │ -39 │ │ │ │ │ -40 virtual const EntitySet& wrappedEntitySet() const = 0; │ │ │ │ │ -41}; │ │ │ │ │ -42 │ │ │ │ │ +12 │ │ │ │ │ +25template │ │ │ │ │ +_2_6class _T_r_i_g_o_n_o_m_e_t_r_i_c_F_u_n_c_t_i_o_n │ │ │ │ │ +27{ │ │ │ │ │ +28public: │ │ │ │ │ +_3_0 K _o_p_e_r_a_t_o_r_ _(_)_ (const K& x) const │ │ │ │ │ +31 { │ │ │ │ │ +32 return sinFactor * std::sin(x) + cosFactor * std::cos(x); │ │ │ │ │ +33 } │ │ │ │ │ +34}; │ │ │ │ │ +35 │ │ │ │ │ +36 │ │ │ │ │ +38template │ │ │ │ │ +_3_9_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) │ │ │ │ │ +40{ │ │ │ │ │ +41 return _T_r_i_g_o_n_o_m_e_t_r_i_c_F_u_n_c_t_i_o_n(); │ │ │ │ │ +42} │ │ │ │ │ 43 │ │ │ │ │ -44// Implementation of type erasure wrapper │ │ │ │ │ -45template │ │ │ │ │ -46class GridFunctionWrapperImplementation : │ │ │ │ │ -47 public DifferentiableFunctionWrapperImplementation │ │ │ │ │ -48{ │ │ │ │ │ -49 using Base = DifferentiableFunctionWrapperImplementation; │ │ │ │ │ -50public: │ │ │ │ │ -51 using Base::Base; │ │ │ │ │ -52 │ │ │ │ │ -53 virtual LocalFunctionInterface wrappedLocalFunction() const │ │ │ │ │ -54 { │ │ │ │ │ -55 return localFunction(this->get()); │ │ │ │ │ -56 } │ │ │ │ │ -57 │ │ │ │ │ -58 virtual const EntitySet& wrappedEntitySet() const │ │ │ │ │ -59 { │ │ │ │ │ -60 return this->get().entitySet(); │ │ │ │ │ -61 } │ │ │ │ │ -62}; │ │ │ │ │ -63 │ │ │ │ │ -64 │ │ │ │ │ -65 │ │ │ │ │ -66}}} // namespace Dune::Functions::Imp │ │ │ │ │ -67 │ │ │ │ │ -68 │ │ │ │ │ -69 │ │ │ │ │ -70#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 │ │ │ │ │ +44 │ │ │ │ │ +45 │ │ │ │ │ +46}} // namespace Dune::Functions │ │ │ │ │ +47 │ │ │ │ │ +48 │ │ │ │ │ +49 │ │ │ │ │ +50#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:39 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ +_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:27 │ │ │ │ │ +_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:30 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01047.html │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
Dune::Functions::Polynomial< K > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

A scalar polynomial implementation. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/analyticfunctions/polynomial.hh>

│ │ │ │ +

#include <dune/functions/analyticfunctions/polynomial.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -435,15 +435,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Move-assignment operator.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01051.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
Dune::Functions::TrigonometricFunction< K, sinFactor, cosFactor > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

A linear combination of trigonomic functions. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/analyticfunctions/trigonometricfunction.hh>

│ │ │ │ +

#include <dune/functions/analyticfunctions/trigonometricfunction.hh>

│ │ │ │

│ │ │ │ Public Member Functions

 Polynomial ()=default
 Default constructor.
 
 Polynomial (const Polynomial &other)=default
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

operator() (const K &x) const
 Evaluate function.
 
│ │ │ │ @@ -131,15 +131,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Evaluate function.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01067.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
Dune::Functions::CallableFunctionWrapper< F > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Wrap a Dune::VirtualFunction into a callable object. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/callable.hh>

│ │ │ │ +

#include <dune/functions/common/callable.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -201,15 +201,15 @@ │ │ │ │ │ │ │ │

Forward operator() to F::evaluate()

│ │ │ │

This uses the default constructor of F::RangeType

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01071.html │ │ │ │ @@ -76,19 +76,19 @@ │ │ │ │
Dune::Functions::InvalidRange Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Dummy range class to be used if no proper type is available. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/defaultderivativetraits.hh>

│ │ │ │ +

#include <dune/functions/common/defaultderivativetraits.hh>

│ │ │ │

Detailed Description

│ │ │ │

Dummy range class to be used if no proper type is available.

│ │ │ │

The documentation for this class was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01075.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
Dune::Functions::DefaultDerivativeTraits< Signature > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Default implementation for derivative traits. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/defaultderivativetraits.hh>

│ │ │ │ +

#include <dune/functions/common/defaultderivativetraits.hh>

│ │ │ │

│ │ │ │ Public Member Functions

 CallableFunctionWrapper (const F &f)
 Instantiate from reference to f.
 
 CallableFunctionWrapper (const std::shared_ptr< const F > &f)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

typedef InvalidRange Range
 Range of derivative for function with given signature.
 
│ │ │ │ @@ -111,15 +111,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Range of derivative for function with given signature.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01079.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
Dune::Functions::DefaultDerivativeTraits< double(double) > Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Default implementation for derivative traits. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/defaultderivativetraits.hh>

│ │ │ │ +

#include <dune/functions/common/defaultderivativetraits.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

typedef double Range
 Range of derivative for function with given signature.
 
│ │ │ │ @@ -108,15 +108,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Range of derivative for function with given signature.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01083.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
Dune::Functions::DefaultDerivativeTraits< K(FieldVector< K, n >)> Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Default implementation for derivative traits. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/defaultderivativetraits.hh>

│ │ │ │ +

#include <dune/functions/common/defaultderivativetraits.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

typedef FieldVector< K, n > Range
 Range of derivative for function with given signature.
 
│ │ │ │ @@ -117,15 +117,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Range of derivative for function with given signature.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01087.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
Dune::Functions::DefaultDerivativeTraits< FieldVector< K, m >(FieldVector< K, n >)> Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Default implementation for derivative traits. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/defaultderivativetraits.hh>

│ │ │ │ +

#include <dune/functions/common/defaultderivativetraits.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

typedef FieldMatrix< K, m, n > Range
 Range of derivative for function with given signature.
 
│ │ │ │ @@ -117,15 +117,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Range of derivative for function with given signature.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01091.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
Dune::Functions::DefaultDerivativeTraits< FieldMatrix< K, 1, m >(FieldVector< K, n >)> Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Default implementation for derivative traits. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/defaultderivativetraits.hh>

│ │ │ │ +

#include <dune/functions/common/defaultderivativetraits.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

typedef FieldMatrix< K, m, n > Range
 Range of derivative for function with given signature.
 
│ │ │ │ @@ -117,15 +117,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Range of derivative for function with given signature.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01095.html │ │ │ │ @@ -73,17 +73,17 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
Dune::Functions::DifferentiableFunction< Signature, DerivativeTraits, bufferSize > Class Template Reference
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/common/differentiablefunction.hh>

│ │ │ │ +

#include <dune/functions/common/differentiablefunction.hh>

│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01103.html │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
Dune::Functions::DifferentiableFunction< Range(Domain), DerivativeTraits, bufferSize > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Class storing differentiable functions using type erasure. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/differentiablefunction.hh>

│ │ │ │ +

#include <dune/functions/common/differentiablefunction.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::DifferentiableFunction< Range(Domain), DerivativeTraits, bufferSize >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -233,15 +233,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Evaluation of wrapped function.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01127.html │ │ │ │ @@ -83,15 +83,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01131.html │ │ │ │ @@ -81,15 +81,15 @@ │ │ │ │
Dune::Functions::DifferentiableFunctionFromCallables< Range(Domain), DerivativeTraits, F > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Wrap a list of callable objects as derivative sequence modelling Concept::DifferentiableFunction<Range(Domain), DerivativeTraits> │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/differentiablefunctionfromcallables.hh>

│ │ │ │ +

#include <dune/functions/common/differentiablefunctionfromcallables.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -262,15 +262,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Evaluate function.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01135.html │ │ │ │ @@ -81,15 +81,15 @@ │ │ │ │
Dune::Functions::DifferentiableFunctionFromCallables< Range(Domain), DerivativeTraits, F, DF, Derivatives... > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Wrap a list of callable objects as derivative sequence modelling Concept::DifferentiableFunction<Range(Domain), DerivativeTraits> │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/differentiablefunctionfromcallables.hh>

│ │ │ │ +

#include <dune/functions/common/differentiablefunctionfromcallables.hh>

│ │ │ │

│ │ │ │ Public Types

using Signature = Range(Domain)
 Signature of function.
 
using RawSignature = typename SignatureTraits< Signature >::RawSignature
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -270,15 +270,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Evaluate function.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01139.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
Dune::Functions::Concept::Callable< Args > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Concept objects that can be called with given argument list. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/functionconcepts.hh>

│ │ │ │ +

#include <dune/functions/common/functionconcepts.hh>

│ │ │ │

│ │ │ │ Public Types

using Signature = Range(Domain)
 
using RawSignature = typename SignatureTraits< Signature >::RawSignature
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

template<class F >
auto require (F &&f) -> decltype(f(std::declval< Args >()...))
 
│ │ │ │ @@ -120,15 +120,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01143.html │ │ │ │ @@ -73,15 +73,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
Dune::Functions::Concept::Function< Signature > Struct Template Reference
│ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01147.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
Dune::Functions::Concept::Function< Range(Domain)> Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Concept for a function mapping Domain to Range. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/functionconcepts.hh>

│ │ │ │ +

#include <dune/functions/common/functionconcepts.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::Concept::Function< Range(Domain)>:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -131,15 +131,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01151.html │ │ │ │ @@ -73,15 +73,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
Dune::Functions::Concept::DifferentiableFunction< Signature, DerivativeTraits > Struct Template Reference
│ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01155.html │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
Dune::Functions::Concept::DifferentiableFunction< Range(Domain), DerivativeTraits > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Concept for a differentiable function mapping Domain to Range. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/functionconcepts.hh>

│ │ │ │ +

#include <dune/functions/common/functionconcepts.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::Concept::DifferentiableFunction< Range(Domain), DerivativeTraits >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -156,15 +156,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01159.html │ │ │ │ @@ -73,15 +73,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
Dune::Functions::Concept::LocalFunction< Signature, LocalContext > Struct Template Reference
│ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01163.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
Dune::Functions::Concept::LocalFunction< Range(Domain), LocalContext > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Concept for a local function mapping Domain to Range. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/functionconcepts.hh>

│ │ │ │ +

#include <dune/functions/common/functionconcepts.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::Concept::LocalFunction< Range(Domain), LocalContext >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -132,15 +132,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01167.html │ │ │ │ @@ -73,15 +73,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
Dune::Functions::Concept::DifferentiableLocalFunction< Signature, LocalContext, DerivativeTraits > Struct Template Reference
│ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01171.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
Dune::Functions::Concept::DifferentiableLocalFunction< Range(Domain), LocalContext, DerivativeTraits > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Concept for a differentiable local function mapping Domain to Range. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/functionconcepts.hh>

│ │ │ │ +

#include <dune/functions/common/functionconcepts.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::Concept::DifferentiableLocalFunction< Range(Domain), LocalContext, DerivativeTraits >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -134,15 +134,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01175.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
Dune::Functions::Concept::EntitySet Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Concept for an entity set for a Concept::GridFunction<Range(Domain), EntitySet, DerivativeTraits> │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/functionconcepts.hh>

│ │ │ │ +

#include <dune/functions/common/functionconcepts.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

template<class E >
auto require (E &&f) -> decltype(requireType< typename E::Element >(), requireType< typename E::LocalCoordinate >(), requireType< typename E::GlobalCoordinate >())
 
│ │ │ │ @@ -112,15 +112,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01179.html │ │ │ │ @@ -73,15 +73,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
Dune::Functions::Concept::GridFunction< Signature, EntitySet > Struct Template Reference
│ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01183.html │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
Dune::Functions::Concept::GridFunction< Range(Domain), EntitySet > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Concept for a grid function mapping Domain to Range. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/functionconcepts.hh>

│ │ │ │ +

#include <dune/functions/common/functionconcepts.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::Concept::GridFunction< Range(Domain), EntitySet >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -173,15 +173,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01187.html │ │ │ │ @@ -73,15 +73,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
Dune::Functions::Concept::DifferentiableGridFunction< Signature, EntitySet, DerivativeTraits > Struct Template Reference
│ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01191.html │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
Dune::Functions::Concept::DifferentiableGridFunction< Range(Domain), EntitySet, DerivativeTraits > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Concept for a differentiable grid function mapping Domain to Range. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/functionconcepts.hh>

│ │ │ │ +

#include <dune/functions/common/functionconcepts.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::Concept::DifferentiableGridFunction< Range(Domain), EntitySet, DerivativeTraits >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -196,15 +196,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01195.html │ │ │ │ @@ -73,15 +73,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
Dune::Functions::Concept::GridViewFunction< Signature, GridView > Struct Template Reference
│ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01199.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
Dune::Functions::Concept::GridViewFunction< Range(Domain), GridView > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Concept for a grid view function mapping Domain to Range. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/functionconcepts.hh>

│ │ │ │ +

#include <dune/functions/common/functionconcepts.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::Concept::GridViewFunction< Range(Domain), GridView >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -133,15 +133,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01203.html │ │ │ │ @@ -73,15 +73,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
Dune::Functions::Concept::DifferentiableGridViewFunction< Signature, GridView, DerivativeTraits > Struct Template Reference
│ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01207.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
Dune::Functions::Concept::DifferentiableGridViewFunction< Range(Domain), GridView, DerivativeTraits > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Concept for a differentiable grid view function mapping Domain to Range. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/functionconcepts.hh>

│ │ │ │ +

#include <dune/functions/common/functionconcepts.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::Concept::DifferentiableGridViewFunction< Range(Domain), GridView, DerivativeTraits >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -134,15 +134,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01211.html │ │ │ │ @@ -73,15 +73,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
Dune::Functions::FunctionFromCallable< Signature, F, FunctionInterface > Class Template Reference
│ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01215.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
Dune::Functions::FunctionFromCallable< Range(Domain), F, FunctionInterface > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Wrap a callable object as Dune::Function or Dune::VirtualFunction. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/functionfromcallable.hh>

│ │ │ │ +

#include <dune/functions/common/functionfromcallable.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::FunctionFromCallable< Range(Domain), F, FunctionInterface >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -234,15 +234,15 @@ │ │ │ │ │ │ │ │

Evaluate function.

│ │ │ │

This call is passed to the function

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01239.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
Dune::Functions::PolymorphicType< Interface > Class Template Referenceabstract
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Base class with polymorphic type boiler plate code. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/interfaces.hh>

│ │ │ │ +

#include <dune/functions/common/interfaces.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::PolymorphicType< Interface >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -253,15 +253,15 @@ │ │ │ │ │ │ │ │

Move object into buffer.

│ │ │ │

move(buffer) needs to be redefined by an implementation class, with the return type covariantly adapted. This will return a copy of this created in the given buffer using placement-new with move construction. You must not delete the returned pointer since it points to the given buffer (however with the proper type instead of void).

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01243.html │ │ │ │ @@ -73,17 +73,17 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
Dune::Functions::LocalFunction< Signature, LocalContext, DerivativeTraits, bufferSize > Class Template Reference
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/common/localfunction.hh>

│ │ │ │ +

#include <dune/functions/common/localfunction.hh>

│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01251.html │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
Dune::Functions::LocalFunction< Range(Domain), LocalContext, DerivativeTraits, bufferSize > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Class storing local functions using type erasure. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/localfunction.hh>

│ │ │ │ +

#include <dune/functions/common/localfunction.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::LocalFunction< Range(Domain), LocalContext, DerivativeTraits, bufferSize >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -361,15 +361,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Unbind from local context.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01263.html │ │ │ │ @@ -81,15 +81,15 @@ │ │ │ │
Dune::Functions::StaticMultiIndex< size_type, n > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

A statically sized MultiIndex type. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/multiindex.hh>

│ │ │ │ +

#include <dune/functions/common/multiindex.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::StaticMultiIndex< size_type, n >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -196,15 +196,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

STL member.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01267.html │ │ │ │ @@ -82,15 +82,15 @@ │ │ │ │
Dune::Functions::StaticMultiIndex< size_type, 1 > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

A statically sized MultiIndex type. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/multiindex.hh>

│ │ │ │ +

#include <dune/functions/common/multiindex.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::StaticMultiIndex< size_type, 1 >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -259,15 +259,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

STL member.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01271.html │ │ │ │ @@ -73,27 +73,27 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
std::tuple_size< Dune::Functions::StaticMultiIndex< size_type, n > > Struct Template Reference
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/common/multiindex.hh>

│ │ │ │ +

#include <dune/functions/common/multiindex.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for std::tuple_size< Dune::Functions::StaticMultiIndex< size_type, n > >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01275.html │ │ │ │ @@ -82,15 +82,15 @@ │ │ │ │
Dune::Functions::OverflowArray< BA, maxSize > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

A dynamically sized array-like class with overflow. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/overflowarray.hh>

│ │ │ │ +

#include <dune/functions/common/overflowarray.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::OverflowArray< BA, maxSize >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -1067,15 +1067,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Write container to an output stream.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01279.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
Dune::Functions::PolymorphicSmallObject< Base, bufferSize > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

A wrapper providing small object optimization with polymorphic types. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/polymorphicsmallobject.hh>

│ │ │ │ +

#include <dune/functions/common/polymorphicsmallobject.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::PolymorphicSmallObject< Base, bufferSize >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -490,15 +490,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Move assignment from other PolymorphicSmallObject.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01283.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
Dune::Functions::ReservedDeque< T, n > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

A double-ended queue (deque) class with statically reserved memory. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/reserveddeque.hh>

│ │ │ │ +

#include <dune/functions/common/reserveddeque.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -1029,15 +1029,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Send ReservedDeque to an output stream.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01287.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │ │ │ │ │

Helper class to check that F is callable. │ │ │ │ More...

│ │ │ │

Detailed Description

│ │ │ │
template<typename F>
│ │ │ │ struct Dune::Functions::IsCallable< F >

Helper class to check that F is callable.

│ │ │ │

The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01291.html │ │ │ │ @@ -76,20 +76,20 @@ │ │ │ │
Dune::Functions::SignatureTraits< Signature, isCallable > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Helper class to deduce the signature of a callable. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/signature.hh>

│ │ │ │ +

#include <dune/functions/common/signature.hh>

│ │ │ │

Detailed Description

│ │ │ │
template<class Signature, bool isCallable = IsCallable<Signature>::value>
│ │ │ │ struct Dune::Functions::SignatureTraits< Signature, isCallable >

Helper class to deduce the signature of a callable.

│ │ │ │

The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01295.html │ │ │ │ @@ -73,15 +73,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
Dune::Functions::SignatureTag< Signature, DerivativeTraits > Struct Template Reference
│ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01299.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
Dune::Functions::SignatureTag< Range(Domain), DerivativeTraitsT > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Tag-class to encapsulate signature information. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/signature.hh>

│ │ │ │ +

#include <dune/functions/common/signature.hh>

│ │ │ │

│ │ │ │ Public Types

typedef T value_type
 The type of object, T, stored in the vector.
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -136,15 +136,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

using Signature = Range(Domain)
 
template<class T >
using DerivativeTraits = DerivativeTraitsT< T >
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01311.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
Dune::Functions::UniformNodeVisitor< SimpleNodeVisitorImp, leafOnly > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Mixin for visitors that should apply the same action on all nodes. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/treedata.hh>

│ │ │ │ +

#include <dune/functions/common/treedata.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::UniformNodeVisitor< SimpleNodeVisitorImp, leafOnly >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -251,15 +251,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01315.html │ │ │ │ @@ -84,15 +84,15 @@ │ │ │ │
Dune::Functions::TreeData< T, ND, LO > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Container allowing to attach data to each node of a tree. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/treedata.hh>

│ │ │ │ +

#include <dune/functions/common/treedata.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -571,15 +571,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Classes

struct  CopyVisitor
 
struct  DestroyVisitor
 
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01319.html │ │ │ │ @@ -77,15 +77,15 @@ │ │ │ │ Public Member Functions | │ │ │ │ Public Attributes | │ │ │ │ List of all members │ │ │ │
Dune::Functions::TreeData< T, ND, LO >::InitVisitor Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/common/treedata.hh>

│ │ │ │ +

#include <dune/functions/common/treedata.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::TreeData< T, ND, LO >::InitVisitor:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -312,15 +312,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01323.html │ │ │ │ @@ -77,15 +77,15 @@ │ │ │ │ Public Member Functions | │ │ │ │ Public Attributes | │ │ │ │ List of all members │ │ │ │
Dune::Functions::TreeData< T, ND, LO >::DestroyVisitor Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/common/treedata.hh>

│ │ │ │ +

#include <dune/functions/common/treedata.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::TreeData< T, ND, LO >::DestroyVisitor:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -312,15 +312,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01327.html │ │ │ │ @@ -77,15 +77,15 @@ │ │ │ │ Public Member Functions | │ │ │ │ Public Attributes | │ │ │ │ List of all members │ │ │ │
Dune::Functions::TreeData< T, ND, LO >::CopyVisitor Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/common/treedata.hh>

│ │ │ │ +

#include <dune/functions/common/treedata.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::TreeData< T, ND, LO >::CopyVisitor:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -340,15 +340,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01331.html │ │ │ │ @@ -76,15 +76,15 @@ │ │ │ │
Dune::Functions::HasStaticSize< T > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Check if type is a statically sized container. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/type_traits.hh>

│ │ │ │ +

#include <dune/functions/common/type_traits.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::HasStaticSize< T >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -94,15 +94,15 @@ │ │ │ │ │ │ │ │
│ │ │ │

Detailed Description

│ │ │ │
template<class T>
│ │ │ │ struct Dune::Functions::HasStaticSize< T >

Check if type is a statically sized container.

│ │ │ │

Derives from std::true_type or std::false_type

│ │ │ │

The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01335.html │ │ │ │ @@ -76,15 +76,15 @@ │ │ │ │
Dune::Functions::StaticSize< T > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Obtain size of statically sized container. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/type_traits.hh>

│ │ │ │ +

#include <dune/functions/common/type_traits.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::StaticSize< T >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -94,15 +94,15 @@ │ │ │ │ │ │ │ │
│ │ │ │

Detailed Description

│ │ │ │
template<class T>
│ │ │ │ struct Dune::Functions::StaticSize< T >

Obtain size of statically sized container.

│ │ │ │

Derives from std::integral_constant<std::size_t, size>

│ │ │ │

The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01351.html │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
Dune::Functions::TypeErasureBase< Interface, Implementation, bufferSize > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Base class for type-erased interface wrapper. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/typeerasure.hh>

│ │ │ │ +

#include <dune/functions/common/typeerasure.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::TypeErasureBase< Interface, Implementation, bufferSize >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -306,15 +306,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01383.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
Dune::Functions::LastType< T > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Get last entry of type list. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/utility.hh>

│ │ │ │ +

#include <dune/functions/common/utility.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

using type = typename std::tuple_element< sizeof...(T) -1, std::tuple< T... > >::type
 
│ │ │ │

Detailed Description

│ │ │ │ @@ -107,15 +107,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01395.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
Dune::Functions::RotateTuple< T > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Rotate type list by one, such that last entry is moved to first position. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/common/utility.hh>

│ │ │ │ +

#include <dune/functions/common/utility.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

using type = typename Imp::RotateHelper< std::tuple< T... >, std::make_index_sequence< sizeof...(T) -1 > >::type
 
│ │ │ │

Detailed Description

│ │ │ │ @@ -108,15 +108,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01411.html │ │ │ │ @@ -76,15 +76,15 @@ │ │ │ │
│ │ │ │ Public Member Functions | │ │ │ │ List of all members
│ │ │ │
Dune::Functions::Concept::IndexMergingStrategy Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/basistags.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/basistags.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

template<typename T >
auto require (T &&t) -> decltype(registerIndexMergingStrategy(t))
 
│ │ │ │ @@ -106,15 +106,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01415.html │ │ │ │ @@ -76,15 +76,15 @@ │ │ │ │
Dune::Functions::BasisFactory::IndexMergingStrategy Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Base class for index merging strategies to simplify detection. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/basistags.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/basistags.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::BasisFactory::IndexMergingStrategy:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -96,15 +96,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │

Detailed Description

│ │ │ │

Base class for index merging strategies to simplify detection.

│ │ │ │

The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01419.html │ │ │ │ @@ -76,15 +76,15 @@ │ │ │ │
Dune::Functions::BasisFactory::FlatLexicographic Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Lexicographic merging of direct children without blocking. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/basistags.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/basistags.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::BasisFactory::FlatLexicographic:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -128,15 +128,15 @@ │ │ │ │ g_0 (2,k0) │ │ │ │ │ │ │ │ g_1 (3,k1) │ │ │ │ │ │ │ │ g_2 (4,k2) │ │ │ │ │ │ │ │

The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01423.html │ │ │ │ @@ -76,15 +76,15 @@ │ │ │ │
Dune::Functions::BasisFactory::FlatInterleaved Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Interleaved merging of direct children without blocking. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/basistags.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/basistags.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::BasisFactory::FlatInterleaved:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -128,15 +128,15 @@ │ │ │ │ g_1 (3,i1) │ │ │ │ │ │ │ │ f_2 (4,i2) │ │ │ │ │ │ │ │ g_2 (5,i2) │ │ │ │ │ │ │ │

The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01427.html │ │ │ │ @@ -76,15 +76,15 @@ │ │ │ │
Dune::Functions::BasisFactory::BlockedLexicographic Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Lexicographic merging of direct children with blocking (i.e. creating one block per direct child). │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/basistags.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/basistags.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::BasisFactory::BlockedLexicographic:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -128,15 +128,15 @@ │ │ │ │ g_0 (1,k0) │ │ │ │ │ │ │ │ g_1 (1,k1) │ │ │ │ │ │ │ │ g_2 (1,k2) │ │ │ │ │ │ │ │

The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01431.html │ │ │ │ @@ -76,15 +76,15 @@ │ │ │ │
Dune::Functions::BasisFactory::BlockedInterleaved Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Interleaved merging of direct children with blocking (i.e. creating blocks at the leaves containing one leaf per child each). │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/basistags.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/basistags.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::BasisFactory::BlockedInterleaved:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -128,15 +128,15 @@ │ │ │ │ g_1 (i1,1) │ │ │ │ │ │ │ │ f_2 (i2,0) │ │ │ │ │ │ │ │ g_2 (i2,1) │ │ │ │ │ │ │ │

The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01467.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │ Protected Member Functions | │ │ │ │ Protected Attributes | │ │ │ │ List of all members │ │ │ │
Dune::Functions::BrezziDouglasMariniNode< GV, k > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/brezzidouglasmarinibasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/brezzidouglasmarinibasis.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::BrezziDouglasMariniNode< GV, k >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -583,15 +583,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01471.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │ Static Public Attributes | │ │ │ │ Protected Attributes | │ │ │ │ List of all members │ │ │ │
Dune::Functions::BrezziDouglasMariniPreBasis< GV, k > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/brezzidouglasmarinibasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/brezzidouglasmarinibasis.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -664,15 +664,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

using GridView = GV
 The grid view that the FE space is defined on.
 
using size_type = std::size_t
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01475.html │ │ │ │ @@ -82,15 +82,15 @@ │ │ │ │
Dune::Functions::BSplineLocalFiniteElement< GV, R > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

LocalFiniteElement in the sense of dune-localfunctions, for the B-spline basis on tensor-product grids. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/bsplinebasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/bsplinebasis.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::BSplineLocalFiniteElement< GV, R >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -559,15 +559,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01479.html │ │ │ │ @@ -84,15 +84,15 @@ │ │ │ │
Dune::Functions::BSplinePreBasis< GV > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Pre-basis for B-spline basis. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/bsplinebasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/bsplinebasis.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -1283,15 +1283,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Order of the B-spline for each space dimension.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01483.html │ │ │ │ @@ -81,15 +81,15 @@ │ │ │ │
Dune::Functions::BSplineLocalBasis< GV, R > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

LocalBasis class in the sense of dune-localfunctions, presenting the restriction of a B-spline patch to a knot span. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/bsplinebasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/bsplinebasis.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::BSplineLocalBasis< GV, R >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -423,15 +423,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

using GridView = GV
 The grid view that the FE space is defined on.
 
using size_type = std::size_t
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01487.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
Dune::Functions::BSplineLocalCoefficients< dim > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Attaches a shape function to an entity. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/bsplinebasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/bsplinebasis.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -192,15 +192,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

number of coefficients

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01491.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
Dune::Functions::BSplineLocalInterpolation< dim, LB > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Local interpolation in the sense of dune-localfunctions, for the B-spline basis on tensor-product grids. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/bsplinebasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/bsplinebasis.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::BSplineLocalInterpolation< dim, LB >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -147,15 +147,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Local interpolation of a function.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01495.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │ Protected Member Functions | │ │ │ │ Protected Attributes | │ │ │ │ List of all members │ │ │ │
Dune::Functions::BSplineNode< GV > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/bsplinebasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/bsplinebasis.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::BSplineNode< GV >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -565,15 +565,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

void init (const std::array< unsigned, dim > &sizes)
 
std::size_t size () const
 number of coefficients
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01503.html │ │ │ │ @@ -83,15 +83,15 @@ │ │ │ │
Dune::Functions::CompositePreBasis< IMS, SPB > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

A pre-basis for composite bases. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/compositebasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/compositebasis.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -828,15 +828,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

using SubPreBases = std::tuple< SPB... >
 Tuple of child pre-bases.
 
template<std::size_t i>
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01555.html │ │ │ │ @@ -81,15 +81,15 @@ │ │ │ │
Dune::Functions::DefaultGlobalBasis< PB > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Global basis for given pre-basis. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/defaultglobalbasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/defaultglobalbasis.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -732,15 +732,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

using PreBasis = PB
 Pre-basis providing the implementation details.
 
using PrefixPath = TypeTree::HybridTreePath<>
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01559.html │ │ │ │ @@ -82,15 +82,15 @@ │ │ │ │
Dune::Functions::DefaultLocalView< GB > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

The restriction of a finite element basis to a single element. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/defaultlocalview.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/defaultlocalview.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -780,15 +780,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

using GlobalBasis = GB
 The global FE basis that this is a view on.
 
using GridView = typename GlobalBasis::GridView
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01563.html │ │ │ │ @@ -81,15 +81,15 @@ │ │ │ │
Dune::Functions::DefaultNodeToRangeMap< Tree > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

A simple node to range map using lexicographic ordering. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/defaultnodetorangemap.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/defaultnodetorangemap.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Classes

struct  Visitor
 
│ │ │ │ │ │ │ │

│ │ │ │ @@ -260,15 +260,15 @@ │ │ │ │

│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01567.html │ │ │ │ @@ -77,15 +77,15 @@ │ │ │ │ Public Member Functions | │ │ │ │ Public Attributes | │ │ │ │ List of all members │ │ │ │
Dune::Functions::DefaultNodeToRangeMap< Tree >::Visitor Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/defaultnodetorangemap.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/defaultnodetorangemap.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::DefaultNodeToRangeMap< Tree >::Visitor:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -210,15 +210,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01619.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │ Protected Member Functions | │ │ │ │ Protected Attributes | │ │ │ │ List of all members │ │ │ │
Dune::Functions::HierarchicalLagrangeNode< GV, k, R > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/hierarchicallagrangebasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/hierarchicallagrangebasis.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::HierarchicalLagrangeNode< GV, k, R >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -567,15 +567,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01623.html │ │ │ │ @@ -83,15 +83,15 @@ │ │ │ │
Dune::Functions::HierarchicalLagrangePreBasis< GV, k, R > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

A pre-basis for a hierarchical basis. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/hierarchicallagrangebasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/hierarchicallagrangebasis.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -677,15 +677,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

using GridView = GV
 The grid view that the FE basis is defined on.
 
using size_type = std::size_t
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01627.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
Dune::Functions::HierarchicNodeToRangeMap Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

A simple node to range map using the nested tree indices. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/hierarchicnodetorangemap.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/hierarchicnodetorangemap.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -184,15 +184,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

template<class Node , class TreePath , class Range , std::enable_if_t< models< Concept::HasIndexAccess, Range, Dune::index_constant< 0 > >(), int > = 0>
decltype(auto) operator() (const Node &, const TreePath &treePath, Range &&y) const
 
template<class Node , class TreePath , class Range , std::enable_if_t< not models< Concept::HasIndexAccess, Range, Dune::index_constant< 0 > >(), int > = 0>
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01647.html │ │ │ │ @@ -81,15 +81,15 @@ │ │ │ │
Dune::Functions::HierarchicVectorWrapper< V, CO > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

A wrapper providing multiindex access to vector entries. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/hierarchicvectorwrapper.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/hierarchicvectorwrapper.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -397,15 +397,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

using Vector = V
 
template<class MultiIndex >
using Entry = Coefficient< MultiIndex >
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01667.html │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │ Protected Member Functions | │ │ │ │ Protected Attributes | │ │ │ │ List of all members │ │ │ │
Dune::Functions::LagrangeNode< GV, k, R > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/lagrangebasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/lagrangebasis.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::LagrangeNode< GV, k, R >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -656,15 +656,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01671.html │ │ │ │ @@ -83,15 +83,15 @@ │ │ │ │
Dune::Functions::LagrangePreBasis< GV, k, R > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

A pre-basis for a PQ-lagrange bases with given order. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/lagrangebasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/lagrangebasis.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::LagrangePreBasis< GV, k, R >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -1299,15 +1299,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01679.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │ Static Public Attributes | │ │ │ │ Protected Attributes | │ │ │ │ List of all members │ │ │ │
Dune::Functions::LagrangeDGPreBasis< GV, k > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/lagrangedgbasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/lagrangedgbasis.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -900,15 +900,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

using GridView = GV
 The grid view that the FE space is defined on.
 
using size_type = std::size_t
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01687.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │ Protected Member Functions | │ │ │ │ Protected Attributes | │ │ │ │ List of all members │ │ │ │
Dune::Functions::NedelecNode< GV, Range, kind, order > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/nedelecbasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/nedelecbasis.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::NedelecNode< GV, Range, kind, order >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -583,15 +583,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01691.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │ Static Public Attributes | │ │ │ │ Protected Attributes | │ │ │ │ List of all members │ │ │ │
Dune::Functions::NedelecPreBasis< GV, Range, kind, order > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/nedelecbasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/nedelecbasis.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -636,15 +636,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

using GridView = GV
 The grid view that the FE space is defined on.
 
using size_type = std::size_t
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01707.html │ │ │ │ @@ -78,15 +78,15 @@ │ │ │ │ Public Member Functions | │ │ │ │ Protected Member Functions | │ │ │ │ List of all members │ │ │ │
Dune::Functions::BasisNodeMixin Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/nodes.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/nodes.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::BasisNodeMixin:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -367,15 +367,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01711.html │ │ │ │ @@ -78,15 +78,15 @@ │ │ │ │ Public Member Functions | │ │ │ │ Protected Member Functions | │ │ │ │ List of all members │ │ │ │
Dune::Functions::LeafBasisNode Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/nodes.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/nodes.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::LeafBasisNode:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -335,15 +335,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01715.html │ │ │ │ @@ -78,15 +78,15 @@ │ │ │ │ Public Member Functions | │ │ │ │ Protected Member Functions | │ │ │ │ List of all members │ │ │ │
Dune::Functions::PowerBasisNode< T, n > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/nodes.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/nodes.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::PowerBasisNode< T, n >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -432,15 +432,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01719.html │ │ │ │ @@ -78,15 +78,15 @@ │ │ │ │ Public Member Functions | │ │ │ │ Protected Member Functions | │ │ │ │ List of all members │ │ │ │
Dune::Functions::CompositeBasisNode< T > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/nodes.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/nodes.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::CompositeBasisNode< T >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -465,15 +465,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01723.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
Dune::Functions::BasisFactory::Experimental::PeriodicIndexSet Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Container storing identified indices for a periodic basis. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/periodicbasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/periodicbasis.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -158,15 +158,15 @@ │ │ │ │ │ │ │ │

Insert a pair of indices.

│ │ │ │

The two bases functions associated to the provided indices will be combined into a single basis function by associating them to a shared global index.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01735.html │ │ │ │ @@ -81,15 +81,15 @@ │ │ │ │
Dune::Functions::PowerPreBasis< IMS, SPB, C > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

A pre-basis for power bases. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/powerbasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/powerbasis.hh>

│ │ │ │

│ │ │ │ Public Member Functions

void unifyIndexPair (std::size_t a, std::size_t b)
 Insert a pair of indices.
 
const auto & indexPairSet () const
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -718,15 +718,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

using SubPreBasis = SPB
 The child pre-basis.
 
using GridView = typename SPB::GridView
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01739.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │ Protected Member Functions | │ │ │ │ Protected Attributes | │ │ │ │ List of all members │ │ │ │
Dune::Functions::RannacherTurekNode< GV > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/rannacherturekbasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/rannacherturekbasis.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::RannacherTurekNode< GV >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -538,15 +538,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01743.html │ │ │ │ @@ -82,15 +82,15 @@ │ │ │ │
Dune::Functions::RannacherTurekPreBasis< GV > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Pre-basis for a Rannacher-Turek basis. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/rannacherturekbasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/rannacherturekbasis.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -615,15 +615,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

using GridView = GV
 The grid view that the FE basis is defined on.
 
using size_type = std::size_t
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01791.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │ Protected Member Functions | │ │ │ │ Protected Attributes | │ │ │ │ List of all members │ │ │ │
Dune::Functions::RaviartThomasNode< GV, k > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/raviartthomasbasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/raviartthomasbasis.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::RaviartThomasNode< GV, k >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -583,15 +583,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01795.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │ Static Public Attributes | │ │ │ │ Protected Attributes | │ │ │ │ List of all members │ │ │ │
Dune::Functions::RaviartThomasPreBasis< GV, k > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/raviartthomasbasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/raviartthomasbasis.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -664,15 +664,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

using GridView = GV
 The grid view that the FE space is defined on.
 
using size_type = std::size_t
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01799.html │ │ │ │ @@ -81,15 +81,15 @@ │ │ │ │
Dune::Functions::SizeInfo< B > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

A class encapsulating size information. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/sizeinfo.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/sizeinfo.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -311,15 +311,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

using Basis = B
 
using size_type = typename Basis::size_type
 
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01803.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
Dune::Functions::SubEntityDOFs< GridView > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Range of DOFs associated to sub-entity. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/subentitydofs.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/subentitydofs.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -377,15 +377,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Return number of contained DOFs.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01807.html │ │ │ │ @@ -78,15 +78,15 @@ │ │ │ │ Public Member Functions | │ │ │ │ Protected Attributes | │ │ │ │ List of all members │ │ │ │
Dune::Functions::SubspaceBasis< RB, TP > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/subspacebasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/subspacebasis.hh>

│ │ │ │

│ │ │ │ Public Member Functions

template<class LocalView >
SubEntityDOFsbind (const LocalView &localView, std::size_t subEntityIndex, std::size_t subEntityCodim)
 Bind SubEntityDOFs object to LocalView and sub-entity.
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -606,15 +606,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

using RootBasis = RB
 
using RootLocalView = typename RootBasis::LocalView
 
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01811.html │ │ │ │ @@ -81,15 +81,15 @@ │ │ │ │
Dune::Functions::SubspaceLocalView< RLV, PP > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

The restriction of a finite element basis to a single element. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/subspacelocalview.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/subspacelocalview.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -689,15 +689,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

using RootLocalView = RLV
 
using GlobalBasis = SubspaceBasis< typename RootLocalView::GlobalBasis, PrefixPath >
 The global FE basis that this is a view on.
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01815.html │ │ │ │ @@ -78,15 +78,15 @@ │ │ │ │ Public Member Functions | │ │ │ │ Protected Member Functions | │ │ │ │ List of all members │ │ │ │
Dune::Functions::TaylorHoodVelocityTree< GV > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/taylorhoodbasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/taylorhoodbasis.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::TaylorHoodVelocityTree< GV >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -409,15 +409,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01819.html │ │ │ │ @@ -78,15 +78,15 @@ │ │ │ │ Public Member Functions | │ │ │ │ Protected Member Functions | │ │ │ │ List of all members │ │ │ │
Dune::Functions::TaylorHoodBasisTree< GV > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/taylorhoodbasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/taylorhoodbasis.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::TaylorHoodBasisTree< GV >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -408,15 +408,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01823.html │ │ │ │ @@ -84,15 +84,15 @@ │ │ │ │
Dune::Functions::TaylorHoodPreBasis< GV, HI > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Pre-basis for lowest order Taylor-Hood basis. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/taylorhoodbasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/taylorhoodbasis.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -812,15 +812,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

using GridView = GV
 The grid view that the FE basis is defined on.
 
using size_type = std::size_t
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01827.html │ │ │ │ @@ -82,15 +82,15 @@ │ │ │ │
Dune::Functions::Experimental::TransformedIndexPreBasis< RPB, T > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

A pre-basis transforming multi-indices. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/transformedindexbasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/transformedindexbasis.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -779,15 +779,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

using RawPreBasis = RPB
 
using GridView = typename RawPreBasis::GridView
 The grid view that the FE basis is defined on.
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01831.html │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
Dune::Functions::BasisFactory::Experimental::GenericIndexingTransformation< IndexTransformation, SizeImplementation, minIS, maxIS > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

A generic implementation of a transformation. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/functionspacebases/transformedindexbasis.hh>

│ │ │ │ +

#include <dune/functions/functionspacebases/transformedindexbasis.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -320,15 +320,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

template<class IT_R , class SI_R >
 GenericIndexingTransformation (IT_R &&indexTransformation, SI_R &&sizeImplementation)
 
template<class MultiIndex , class PreBasis >
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01843.html │ │ │ │ @@ -86,15 +86,15 @@ │ │ │ │ │ │ │ │ template<class F , class GridView > │ │ │ │ AnalyticGridViewFunction< typename std::invoke_result< F, typename GridView::template Codim< 0 >::Geometry::GlobalCoordinate >::type(typename GridView::template Codim< 0 >::Geometry::GlobalCoordinate), GridView, typename std::decay< F >::type > makeAnalyticGridViewFunction (F &&f, const GridView &gridView) │ │ │ │  Create an AnalyticGridViewFunction from a function and a grid view.
│ │ │ │   │ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01847.html │ │ │ │ @@ -81,15 +81,15 @@ │ │ │ │
Dune::Functions::AnalyticGridViewFunction< Range(Domain), GV, F, DerivativeTraits > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Class wrapping any differentiable function as grid function. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/gridfunctions/analyticgridviewfunction.hh>

│ │ │ │ +

#include <dune/functions/gridfunctions/analyticgridviewfunction.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -493,15 +493,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Construct the associated local-function.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01851.html │ │ │ │ @@ -85,15 +85,15 @@ │ │ │ │
Dune::Functions::ComposedGridFunction< OF, IF > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Composition of grid functions with another function. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/gridfunctions/composedgridfunction.hh>

│ │ │ │ +

#include <dune/functions/gridfunctions/composedgridfunction.hh>

│ │ │ │

│ │ │ │ Public Types

using Signature = Range(Domain)
 
using RawSignature = typename SignatureTraits< Signature >::RawSignature
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -490,15 +490,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

using EntitySet = typename InnerFunction< 0 >::EntitySet
 
using Element = typename EntitySet::Element
 
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01859.html │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │ Protected Member Functions | │ │ │ │ Protected Attributes | │ │ │ │ List of all members │ │ │ │
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/gridfunctions/discreteglobalbasisfunction.hh>

│ │ │ │ +

#include <dune/functions/gridfunctions/discreteglobalbasisfunction.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -486,15 +486,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01863.html │ │ │ │ @@ -76,15 +76,15 @@ │ │ │ │
│ │ │ │ Public Attributes | │ │ │ │ List of all members
│ │ │ │
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >::Data Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/gridfunctions/discreteglobalbasisfunction.hh>

│ │ │ │ +

#include <dune/functions/gridfunctions/discreteglobalbasisfunction.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -155,15 +155,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Attributes

EntitySet entitySet
 
std::shared_ptr< const Basisbasis
 
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01867.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │ Protected Member Functions | │ │ │ │ Protected Attributes | │ │ │ │ List of all members │ │ │ │
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >::LocalFunctionBase Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/gridfunctions/discreteglobalbasisfunction.hh>

│ │ │ │ +

#include <dune/functions/gridfunctions/discreteglobalbasisfunction.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >::LocalFunctionBase:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -544,15 +544,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01871.html │ │ │ │ @@ -83,15 +83,15 @@ │ │ │ │
Dune::Functions::DiscreteGlobalBasisFunctionDerivative< DGBF > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Derivative of a DiscreteGlobalBasisFunction │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/gridfunctions/discreteglobalbasisfunction.hh>

│ │ │ │ +

#include <dune/functions/gridfunctions/discreteglobalbasisfunction.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::DiscreteGlobalBasisFunctionDerivative< DGBF >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -682,15 +682,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01875.html │ │ │ │ @@ -84,15 +84,15 @@ │ │ │ │
Dune::Functions::DiscreteGlobalBasisFunction< B, V, NTRE, R > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

A grid function induced by a global basis and a coefficient vector. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/gridfunctions/discreteglobalbasisfunction.hh>

│ │ │ │ +

#include <dune/functions/gridfunctions/discreteglobalbasisfunction.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::DiscreteGlobalBasisFunction< B, V, NTRE, R >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -773,15 +773,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01879.html │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │ Protected Attributes | │ │ │ │ Friends | │ │ │ │ List of all members │ │ │ │
Dune::Functions::DiscreteGlobalBasisFunction< B, V, NTRE, R >::LocalFunction Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/gridfunctions/discreteglobalbasisfunction.hh>

│ │ │ │ +

#include <dune/functions/gridfunctions/discreteglobalbasisfunction.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::DiscreteGlobalBasisFunction< B, V, NTRE, R >::LocalFunction:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -585,15 +585,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01883.html │ │ │ │ @@ -83,15 +83,15 @@ │ │ │ │
Dune::Functions::DiscreteGlobalBasisFunctionDerivative< DGBF >::LocalFunction Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

local function evaluating the derivative in reference coordinates │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/gridfunctions/discreteglobalbasisfunction.hh>

│ │ │ │ +

#include <dune/functions/gridfunctions/discreteglobalbasisfunction.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::DiscreteGlobalBasisFunctionDerivative< DGBF >::LocalFunction:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -627,15 +627,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01887.html │ │ │ │ @@ -82,15 +82,15 @@ │ │ │ │
Dune::Functions::FaceNormalGridFunction< GV > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Grid function implementing the piecewise element face normal. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/gridfunctions/facenormalgridfunction.hh>

│ │ │ │ +

#include <dune/functions/gridfunctions/facenormalgridfunction.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -380,15 +380,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Return a local-function associated to FaceNormalGridFunction.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01895.html │ │ │ │ @@ -73,29 +73,29 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
Dune::Functions::GridFunction< Signature, EntitySet, DerivativeTraits, bufferSize > Class Template Reference
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/gridfunctions/gridfunction.hh>

│ │ │ │ +

#include <dune/functions/gridfunctions/gridfunction.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::GridFunction< Signature, EntitySet, DerivativeTraits, bufferSize >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01903.html │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
Dune::Functions::GridFunction< Range(Domain), ES, DerivativeTraits, bufferSize > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Wrapper class for functions defined on a Grid. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/gridfunctions/gridfunction.hh>

│ │ │ │ +

#include <dune/functions/gridfunctions/gridfunction.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::GridFunction< Range(Domain), ES, DerivativeTraits, bufferSize >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -326,15 +326,15 @@ │ │ │ │

Get local function of wrapped function.

│ │ │ │

This is a free function, to be found by ADL.

│ │ │ │

Notice that the returned LocalFunction can only be used after it has been bound to a proper local context.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01919.html │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
Dune::Functions::GridViewEntitySet< GV, cd > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

An entity set for all entities of given codim in a grid view. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/gridfunctions/gridviewentityset.hh>

│ │ │ │ +

#include <dune/functions/gridfunctions/gridviewentityset.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::GridViewEntitySet< GV, cd >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -461,15 +461,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Return number of Elements visited by an iterator.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01923.html │ │ │ │ @@ -73,17 +73,17 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
Dune::Functions::GridViewFunction< Signature, GridView, DerivativeTraits, bufferSize > Class Template Reference
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/gridfunctions/gridviewfunction.hh>

│ │ │ │ +

#include <dune/functions/gridfunctions/gridviewfunction.hh>

│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01927.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
Dune::Functions::GridViewFunction< Range(Domain), GV, DerivativeTraits, bufferSize > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Wrapper class for functions defined on a GridView. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/gridfunctions/gridviewfunction.hh>

│ │ │ │ +

#include <dune/functions/gridfunctions/gridviewfunction.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::Functions::GridViewFunction< Range(Domain), GV, DerivativeTraits, bufferSize >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -129,15 +129,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

using GridView = GV
 
using EntitySet = GridViewEntitySet< GridView, 0 >
 
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01931.html │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
Dune::Functions::LocalDerivativeTraits< EntitySet, DerivativeTraits > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Derivative traits for local functions. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/functions/gridfunctions/localderivativetraits.hh>

│ │ │ │ +

#include <dune/functions/gridfunctions/localderivativetraits.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -135,15 +135,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Classes

struct  Traits
 
struct  Traits< R(LocalDomain)>
 
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01935.html │ │ │ │ @@ -76,15 +76,15 @@ │ │ │ │
│ │ │ │ Public Types | │ │ │ │ List of all members
│ │ │ │
Dune::Functions::LocalDerivativeTraits< EntitySet, DerivativeTraits >::Traits< Signature > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/gridfunctions/localderivativetraits.hh>

│ │ │ │ +

#include <dune/functions/gridfunctions/localderivativetraits.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

typedef InvalidRange Range
 
│ │ │ │

Member Typedef Documentation

│ │ │ │ @@ -103,15 +103,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a01939.html │ │ │ │ @@ -76,15 +76,15 @@ │ │ │ │
│ │ │ │ Public Types | │ │ │ │ List of all members
│ │ │ │
Dune::Functions::LocalDerivativeTraits< EntitySet, DerivativeTraits >::Traits< R(LocalDomain)> Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/functions/gridfunctions/localderivativetraits.hh>

│ │ │ │ +

#include <dune/functions/gridfunctions/localderivativetraits.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

using Range = typename DerivativeTraits< R(Domain)>::Range
 
│ │ │ │

Member Typedef Documentation

│ │ │ │ @@ -103,15 +103,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a02876.html │ │ │ │ @@ -77,16 +77,16 @@ │ │ │ │ Classes | │ │ │ │ Namespaces │ │ │ │
concepts.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │
#include <dune/common/concept.hh>
│ │ │ │ #include <dune/common/reservedvector.hh>
│ │ │ │ -#include <dune/functions/common/utility.hh>
│ │ │ │ -#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ │ +#include <dune/functions/common/utility.hh>
│ │ │ │ +#include <dune/functions/functionspacebases/nodes.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/a02876_source.html │ │ │ │ @@ -86,17 +86,17 @@ │ │ │ │
3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CONCEPTS_HH
│ │ │ │
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CONCEPTS_HH
│ │ │ │
5
│ │ │ │
6
│ │ │ │
7#include <dune/common/concept.hh>
│ │ │ │
8#include <dune/common/reservedvector.hh>
│ │ │ │
9
│ │ │ │ - │ │ │ │ + │ │ │ │
11
│ │ │ │ - │ │ │ │ + │ │ │ │
13
│ │ │ │
14
│ │ │ │
15namespace Dune {
│ │ │ │
16namespace Functions {
│ │ │ │
17namespace Concept {
│ │ │ │
18
│ │ │ │
19using namespace Dune::Concept;
│ │ │ │ @@ -319,16 +319,16 @@ │ │ │ │
214
│ │ │ │
215} // namespace Dune::Functions::Concept
│ │ │ │
216} // namespace Dune::Functions
│ │ │ │
217} // namespace Dune
│ │ │ │
218
│ │ │ │
219
│ │ │ │
220#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CONCEPTS_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │
Definition polynomial.hh:10
│ │ │ │
Definition functionspacebases/concepts.hh:23
│ │ │ │
auto require(C &&c) -> decltype(c.resize(0))
│ │ │ │
Definition functionspacebases/concepts.hh:33
│ │ │ │
auto require(C &&c) -> decltype(c.size())
│ │ │ │
Definition functionspacebases/concepts.hh:43
│ │ │ │
auto require(C &&c, I &&i) -> decltype(c[i])
│ │ │ │ ├── html2text {} │ │ │ │ │ @@ -241,16 +241,16 @@ │ │ │ │ │ 214 │ │ │ │ │ 215} // namespace Dune::Functions::Concept │ │ │ │ │ 216} // namespace Dune::Functions │ │ │ │ │ 217} // namespace Dune │ │ │ │ │ 218 │ │ │ │ │ 219 │ │ │ │ │ 220#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CONCEPTS_HH │ │ │ │ │ -_n_o_d_e_s_._h_h │ │ │ │ │ _u_t_i_l_i_t_y_._h_h │ │ │ │ │ +_n_o_d_e_s_._h_h │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_H_a_s_R_e_s_i_z_e │ │ │ │ │ DDeeffiinniittiioonn functionspacebases/concepts.hh:23 │ │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_H_a_s_R_e_s_i_z_e_:_:_r_e_q_u_i_r_e │ │ │ │ │ auto require(C &&c) -> decltype(c.resize(0)) │ │ │ │ │ _D_u_n_e_:_:_F_u_n_c_t_i_o_n_s_:_:_C_o_n_c_e_p_t_:_:_H_a_s_S_i_z_e_M_e_t_h_o_d │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/dir_000001_000002.html │ │ │ │ @@ -69,14 +69,14 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -

backends → common Relation

│ │ │ │ Classes

struct  Dune::Functions::Concept::HasResize
 
File in dune/functions/backendsIncludes file in dune/functions/common
istlvectorbackend.hhindexaccess.hh
│ │ │ │ +

backends → common Relation

File in dune/functions/backendsIncludes file in dune/functions/common
istlvectorbackend.hhindexaccess.hh
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/dir_000001_000007.html │ │ │ │ @@ -69,14 +69,14 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -

backends → functionspacebases Relation

File in dune/functions/backendsIncludes file in dune/functions/functionspacebases
istlvectorbackend.hhfunctionspacebases/concepts.hh
│ │ │ │ +

backends → functionspacebases Relation

File in dune/functions/backendsIncludes file in dune/functions/functionspacebases
istlvectorbackend.hhfunctionspacebases/concepts.hh
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/dir_000002_000007.html │ │ │ │ @@ -69,14 +69,14 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -

common → functionspacebases Relation

File in dune/functions/commonIncludes file in dune/functions/functionspacebases
staticforloop.hhfunctionspacebases/concepts.hh
│ │ │ │ +

common → functionspacebases Relation

File in dune/functions/commonIncludes file in dune/functions/functionspacebases
staticforloop.hhfunctionspacebases/concepts.hh
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/dir_000002_000008.html │ │ │ │ @@ -69,14 +69,14 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -

common → gridfunctions Relation

File in dune/functions/commonIncludes file in dune/functions/gridfunctions
functionconcepts.hhgridviewentityset.hh
functionconcepts.hhlocalderivativetraits.hh
treedata.hhgridfunction.hh
treedata.hhgridviewentityset.hh
│ │ │ │ +

common → gridfunctions Relation

File in dune/functions/commonIncludes file in dune/functions/gridfunctions
functionconcepts.hhgridviewentityset.hh
functionconcepts.hhlocalderivativetraits.hh
treedata.hhgridfunction.hh
treedata.hhgridviewentityset.hh
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/dir_000007_000001.html │ │ │ │ @@ -69,14 +69,14 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -

functionspacebases → backends Relation

File in dune/functions/functionspacebasesIncludes file in dune/functions/backends
interpolate.hhbackends/concepts.hh
interpolate.hhistlvectorbackend.hh
│ │ │ │ +

functionspacebases → backends Relation

File in dune/functions/functionspacebasesIncludes file in dune/functions/backends
interpolate.hhbackends/concepts.hh
interpolate.hhistlvectorbackend.hh
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/dir_000007_000002.html │ │ │ │ @@ -69,14 +69,14 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +

functionspacebases → common Relation

File in dune/functions/functionspacebasesIncludes file in dune/functions/common
compositebasis.hhstaticforloop.hh
compositebasis.hhtype_traits.hh
compositebasis.hhutility.hh
defaultglobalbasis.hhtype_traits.hh
defaultlocalview.hhmultiindex.hh
defaultlocalview.hhoverflowarray.hh
flatmultiindex.hhmultiindex.hh
functionspacebases/concepts.hhutility.hh
hierarchicnodetorangemap.hhindexaccess.hh
hierarchicvectorwrapper.hhindexaccess.hh
hierarchicvectorwrapper.hhtype_traits.hh
hierarchicvectorwrapper.hhutility.hh
interpolate.hhfunctionconcepts.hh
powerbasis.hhtype_traits.hh
powerbasis.hhutility.hh
subspacebasis.hhtype_traits.hh
transformedindexbasis.hhstaticforloop.hh
transformedindexbasis.hhtype_traits.hh
transformedindexbasis.hhutility.hh
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/dir_000007_000008.html │ │ │ │ @@ -69,14 +69,14 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -

functionspacebases → gridfunctions Relation

File in dune/functions/functionspacebasesIncludes file in dune/functions/gridfunctions
interpolate.hhgridviewfunction.hh
│ │ │ │ +

functionspacebases → gridfunctions Relation

File in dune/functions/functionspacebasesIncludes file in dune/functions/gridfunctions
interpolate.hhgridviewfunction.hh
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/dir_000008_000001.html │ │ │ │ @@ -69,14 +69,14 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -

gridfunctions → backends Relation

File in dune/functions/gridfunctionsIncludes file in dune/functions/backends
discreteglobalbasisfunction.hhbackends/concepts.hh
discreteglobalbasisfunction.hhistlvectorbackend.hh
│ │ │ │ +

gridfunctions → backends Relation

File in dune/functions/gridfunctionsIncludes file in dune/functions/backends
discreteglobalbasisfunction.hhbackends/concepts.hh
discreteglobalbasisfunction.hhistlvectorbackend.hh
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/dir_000008_000002.html │ │ │ │ @@ -69,14 +69,14 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +

gridfunctions → common Relation

File in dune/functions/gridfunctionsIncludes file in dune/functions/common
analyticgridviewfunction.hhdefaultderivativetraits.hh
analyticgridviewfunction.hhdifferentiablefunction.hh
analyticgridviewfunction.hhdifferentiablefunction_imp.hh
analyticgridviewfunction.hhsignature.hh
composedgridfunction.hhdefaultderivativetraits.hh
composedgridfunction.hhdifferentiablefunction.hh
gridfunction.hhdefaultderivativetraits.hh
gridfunction.hhdifferentiablefunction.hh
gridfunction.hhfunctionconcepts.hh
gridfunction.hhlocalfunction.hh
gridfunction.hhtypeerasure.hh
gridfunction_imp.hhdifferentiablefunction_imp.hh
gridfunction_imp.hhinterfaces.hh
gridfunction_imp.hhtype_traits.hh
localderivativetraits.hhdefaultderivativetraits.hh
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/dir_000008_000007.html │ │ │ │ @@ -69,14 +69,14 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -

gridfunctions → functionspacebases Relation

File in dune/functions/gridfunctionsIncludes file in dune/functions/functionspacebases
discreteglobalbasisfunction.hhflatvectorview.hh
discreteglobalbasisfunction.hhhierarchicnodetorangemap.hh
│ │ │ │ +

gridfunctions → functionspacebases Relation

File in dune/functions/gridfunctionsIncludes file in dune/functions/functionspacebases
discreteglobalbasisfunction.hhflatvectorview.hh
discreteglobalbasisfunction.hhhierarchicnodetorangemap.hh
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/dir_14cf9ce796563c596e9b8f0f574fe0cc.html │ │ │ │ @@ -90,58 +90,58 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Files

 callable.hh
 callable.hh
 
 defaultderivativetraits.hh
 defaultderivativetraits.hh
 
 differentiablefunction.hh
 differentiablefunction.hh
 
 differentiablefunction_imp.hh
 differentiablefunction_imp.hh
 
 differentiablefunctionfromcallables.hh
 differentiablefunctionfromcallables.hh
 
 functionconcepts.hh
 functionconcepts.hh
 
 functionfromcallable.hh
 functionfromcallable.hh
 
 indexaccess.hh
 indexaccess.hh
 
 interfaces.hh
 interfaces.hh
 
 localfunction.hh
 localfunction.hh
 
 localfunction_imp.hh
 localfunction_imp.hh
 
 multiindex.hh
 multiindex.hh
 
 overflowarray.hh
 overflowarray.hh
 
 polymorphicsmallobject.hh
 polymorphicsmallobject.hh
 
 referencehelper.hh
 referencehelper.hh
 
 reserveddeque.hh
 An stl-compliant double-ended queue which stores everything on the stack.
 reserveddeque.hh
 An stl-compliant double-ended queue which stores everything on the stack.
 
 signature.hh
 signature.hh
 
 staticforloop.hh
 staticforloop.hh
 
 treedata.hh
 treedata.hh
 
 type_traits.hh
 type_traits.hh
 
 typeerasure.hh
 typeerasure.hh
 
 utility.hh
 utility.hh
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/dir_55b300d561fb400353f8dbad76da65d6.html │ │ │ │ @@ -93,31 +93,31 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Files

 analyticgridviewfunction.hh
 analyticgridviewfunction.hh
 
 composedgridfunction.hh
 composedgridfunction.hh
 
 discreteglobalbasisfunction.hh
 discreteglobalbasisfunction.hh
 
 facenormalgridfunction.hh
 facenormalgridfunction.hh
 
 gridfunction.hh
 gridfunction.hh
 
 gridfunction_imp.hh
 gridfunction_imp.hh
 
 gridviewentityset.hh
 gridviewentityset.hh
 
 gridviewfunction.hh
 gridviewfunction.hh
 
 localderivativetraits.hh
 localderivativetraits.hh
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/dir_8457ebf380090bd61e5d3eab5b7eb9a1.html │ │ │ │ @@ -92,15 +92,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Files

 concepts.hh
 
 istlvectorbackend.hh
 istlvectorbackend.hh
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/dir_a2250aba7ee066a4c694d7c3cf43d078.html │ │ │ │ @@ -93,74 +93,74 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Files

 basistags.hh
 basistags.hh
 
 boundarydofs.hh
 boundarydofs.hh
 
 brezzidouglasmarinibasis.hh
 brezzidouglasmarinibasis.hh
 
 bsplinebasis.hh
 The B-spline global function space basis.
 bsplinebasis.hh
 The B-spline global function space basis.
 
 compositebasis.hh
 compositebasis.hh
 
 concepts.hh
 
 defaultglobalbasis.hh
 defaultglobalbasis.hh
 
 defaultlocalview.hh
 defaultlocalview.hh
 
 defaultnodetorangemap.hh
 defaultnodetorangemap.hh
 
 flatmultiindex.hh
 flatmultiindex.hh
 
 flatvectorview.hh
 flatvectorview.hh
 
 globalvaluedlocalfiniteelement.hh
 globalvaluedlocalfiniteelement.hh
 
 hierarchicallagrangebasis.hh
 hierarchicallagrangebasis.hh
 
 hierarchicnodetorangemap.hh
 hierarchicnodetorangemap.hh
 
 hierarchicvectorwrapper.hh
 hierarchicvectorwrapper.hh
 
 interpolate.hh
 interpolate.hh
 
 lagrangebasis.hh
 lagrangebasis.hh
 
 lagrangedgbasis.hh
 lagrangedgbasis.hh
 
 nedelecbasis.hh
 nedelecbasis.hh
 
 nodes.hh
 nodes.hh
 
 periodicbasis.hh
 periodicbasis.hh
 
 powerbasis.hh
 powerbasis.hh
 
 rannacherturekbasis.hh
 rannacherturekbasis.hh
 
 raviartthomasbasis.hh
 raviartthomasbasis.hh
 
 sizeinfo.hh
 sizeinfo.hh
 
 subentitydofs.hh
 subentitydofs.hh
 
 subspacebasis.hh
 subspacebasis.hh
 
 subspacelocalview.hh
 subspacelocalview.hh
 
 taylorhoodbasis.hh
 taylorhoodbasis.hh
 
 transformedindexbasis.hh
 transformedindexbasis.hh
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/dir_e22f2c69b2799e923164d7b2e4fa3f8c.html │ │ │ │ @@ -84,17 +84,17 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Files

 polynomial.hh
 polynomial.hh
 
 trigonometricfunction.hh
 trigonometricfunction.hh
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/dune-functions.tag.gz │ │ │ │ ├── dune-functions.tag │ │ │ │ │ ├── dune-functions.tag │ │ │ │ │ │ @@ -4,99 +4,99 @@ │ │ │ │ │ │ mainpage.md │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/doc/doxygen/ │ │ │ │ │ │ a00197.html │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ polynomial.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/analyticfunctions/ │ │ │ │ │ │ - a00005.html │ │ │ │ │ │ + a00188.html │ │ │ │ │ │ Dune::Functions::Polynomial │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ trigonometricfunction.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/analyticfunctions/ │ │ │ │ │ │ - a00002.html │ │ │ │ │ │ + a00191.html │ │ │ │ │ │ Dune::Functions::TrigonometricFunction │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ istlvectorbackend.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/backends/ │ │ │ │ │ │ - a00164.html │ │ │ │ │ │ - dune/functions/common/indexaccess.hh │ │ │ │ │ │ + a00185.html │ │ │ │ │ │ + dune/functions/common/indexaccess.hh │ │ │ │ │ │ dune/functions/functionspacebases/concepts.hh │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ callable.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/ │ │ │ │ │ │ - a00122.html │ │ │ │ │ │ + a00053.html │ │ │ │ │ │ Dune::Functions::CallableFunctionWrapper │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ defaultderivativetraits.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/ │ │ │ │ │ │ - a00131.html │ │ │ │ │ │ + a00056.html │ │ │ │ │ │ Dune::Functions::InvalidRange │ │ │ │ │ │ Dune::Functions::DefaultDerivativeTraits │ │ │ │ │ │ Dune::Functions::DefaultDerivativeTraits< double(double) > │ │ │ │ │ │ Dune::Functions::DefaultDerivativeTraits< K(FieldVector< K, n >)> │ │ │ │ │ │ Dune::Functions::DefaultDerivativeTraits< FieldVector< K, m >(FieldVector< K, n >)> │ │ │ │ │ │ Dune::Functions::DefaultDerivativeTraits< FieldMatrix< K, 1, m >(FieldVector< K, n >)> │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ differentiablefunction.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/ │ │ │ │ │ │ - a00146.html │ │ │ │ │ │ - dune/functions/common/type_traits.hh │ │ │ │ │ │ - dune/functions/common/defaultderivativetraits.hh │ │ │ │ │ │ - dune/functions/common/differentiablefunction_imp.hh │ │ │ │ │ │ - dune/functions/common/signature.hh │ │ │ │ │ │ - dune/functions/common/typeerasure.hh │ │ │ │ │ │ - dune/functions/common/functionconcepts.hh │ │ │ │ │ │ + a00029.html │ │ │ │ │ │ + dune/functions/common/type_traits.hh │ │ │ │ │ │ + dune/functions/common/defaultderivativetraits.hh │ │ │ │ │ │ + dune/functions/common/differentiablefunction_imp.hh │ │ │ │ │ │ + dune/functions/common/signature.hh │ │ │ │ │ │ + dune/functions/common/typeerasure.hh │ │ │ │ │ │ + dune/functions/common/functionconcepts.hh │ │ │ │ │ │ Dune::Functions::DifferentiableFunction │ │ │ │ │ │ Dune::Functions::DifferentiableFunction< Range(Domain), DerivativeTraits, bufferSize > │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ differentiablefunction_imp.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/ │ │ │ │ │ │ - a00161.html │ │ │ │ │ │ - dune/functions/common/type_traits.hh │ │ │ │ │ │ + a00065.html │ │ │ │ │ │ + dune/functions/common/type_traits.hh │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ differentiablefunctionfromcallables.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/ │ │ │ │ │ │ - a00134.html │ │ │ │ │ │ - dune/functions/common/signature.hh │ │ │ │ │ │ - dune/functions/common/differentiablefunction.hh │ │ │ │ │ │ - dune/functions/common/functionconcepts.hh │ │ │ │ │ │ + a00047.html │ │ │ │ │ │ + dune/functions/common/signature.hh │ │ │ │ │ │ + dune/functions/common/differentiablefunction.hh │ │ │ │ │ │ + dune/functions/common/functionconcepts.hh │ │ │ │ │ │ Dune::Functions::DifferentiableFunctionFromCallables< Range(Domain), DerivativeTraits, F > │ │ │ │ │ │ Dune::Functions::DifferentiableFunctionFromCallables< Range(Domain), DerivativeTraits, F, DF, Derivatives... > │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ functionconcepts.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/ │ │ │ │ │ │ - a00143.html │ │ │ │ │ │ - dune/functions/common/signature.hh │ │ │ │ │ │ - dune/functions/gridfunctions/localderivativetraits.hh │ │ │ │ │ │ - dune/functions/gridfunctions/gridviewentityset.hh │ │ │ │ │ │ + a00092.html │ │ │ │ │ │ + dune/functions/common/signature.hh │ │ │ │ │ │ + dune/functions/gridfunctions/localderivativetraits.hh │ │ │ │ │ │ + dune/functions/gridfunctions/gridviewentityset.hh │ │ │ │ │ │ Dune::Functions::Concept::Callable │ │ │ │ │ │ Dune::Functions::Concept::Function< Range(Domain)> │ │ │ │ │ │ Dune::Functions::Concept::DifferentiableFunction< Range(Domain), DerivativeTraits > │ │ │ │ │ │ Dune::Functions::Concept::LocalFunction< Range(Domain), LocalContext > │ │ │ │ │ │ Dune::Functions::Concept::DifferentiableLocalFunction< Range(Domain), LocalContext, DerivativeTraits > │ │ │ │ │ │ Dune::Functions::Concept::EntitySet │ │ │ │ │ │ Dune::Functions::Concept::GridFunction< Range(Domain), EntitySet > │ │ │ │ │ │ @@ -106,174 +106,174 @@ │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ Dune::Functions::Concept │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ functionfromcallable.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/ │ │ │ │ │ │ - a00149.html │ │ │ │ │ │ - dune/functions/common/signature.hh │ │ │ │ │ │ + a00086.html │ │ │ │ │ │ + dune/functions/common/signature.hh │ │ │ │ │ │ Dune::Functions::FunctionFromCallable< Range(Domain), F, FunctionInterface > │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ indexaccess.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/ │ │ │ │ │ │ - a00119.html │ │ │ │ │ │ - dune/functions/common/utility.hh │ │ │ │ │ │ + a00089.html │ │ │ │ │ │ + dune/functions/common/utility.hh │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ interfaces.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/ │ │ │ │ │ │ - a00110.html │ │ │ │ │ │ + a00071.html │ │ │ │ │ │ Dune::Functions::PolymorphicType │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ localfunction.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/ │ │ │ │ │ │ - a00137.html │ │ │ │ │ │ - dune/functions/common/defaultderivativetraits.hh │ │ │ │ │ │ - dune/functions/common/differentiablefunction.hh │ │ │ │ │ │ - dune/functions/common/localfunction_imp.hh │ │ │ │ │ │ - dune/functions/common/typeerasure.hh │ │ │ │ │ │ - dune/functions/common/functionconcepts.hh │ │ │ │ │ │ + a00077.html │ │ │ │ │ │ + dune/functions/common/defaultderivativetraits.hh │ │ │ │ │ │ + dune/functions/common/differentiablefunction.hh │ │ │ │ │ │ + dune/functions/common/localfunction_imp.hh │ │ │ │ │ │ + dune/functions/common/typeerasure.hh │ │ │ │ │ │ + dune/functions/common/functionconcepts.hh │ │ │ │ │ │ Dune::Functions::LocalFunction │ │ │ │ │ │ Dune::Functions::LocalFunction< Range(Domain), LocalContext, DerivativeTraits, bufferSize > │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ localfunction_imp.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/ │ │ │ │ │ │ - a00158.html │ │ │ │ │ │ - dune/functions/common/type_traits.hh │ │ │ │ │ │ - dune/functions/common/differentiablefunction_imp.hh │ │ │ │ │ │ + a00050.html │ │ │ │ │ │ + dune/functions/common/type_traits.hh │ │ │ │ │ │ + dune/functions/common/differentiablefunction_imp.hh │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ multiindex.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/ │ │ │ │ │ │ - a00113.html │ │ │ │ │ │ + a00080.html │ │ │ │ │ │ Dune::Functions::StaticMultiIndex │ │ │ │ │ │ Dune::Functions::StaticMultiIndex< size_type, 1 > │ │ │ │ │ │ std::tuple_size< Dune::Functions::StaticMultiIndex< size_type, n > > │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ overflowarray.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/ │ │ │ │ │ │ - a00128.html │ │ │ │ │ │ + a00083.html │ │ │ │ │ │ Dune::Functions::OverflowArray │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ polymorphicsmallobject.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/ │ │ │ │ │ │ - a00155.html │ │ │ │ │ │ + a00062.html │ │ │ │ │ │ Dune::Functions::PolymorphicSmallObject │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ referencehelper.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/ │ │ │ │ │ │ - a00107.html │ │ │ │ │ │ + a00032.html │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ reserveddeque.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/ │ │ │ │ │ │ - a00104.html │ │ │ │ │ │ + a00068.html │ │ │ │ │ │ Dune::Functions::ReservedDeque │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ #define │ │ │ │ │ │ CHECKSIZE │ │ │ │ │ │ - a00104.html │ │ │ │ │ │ + a00068.html │ │ │ │ │ │ a65543e75bc949ecdb95a25b1f4e11675 │ │ │ │ │ │ (X) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ signature.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/ │ │ │ │ │ │ - a00140.html │ │ │ │ │ │ - dune/functions/common/defaultderivativetraits.hh │ │ │ │ │ │ + a00041.html │ │ │ │ │ │ + dune/functions/common/defaultderivativetraits.hh │ │ │ │ │ │ Dune::Functions::SignatureTraits │ │ │ │ │ │ Dune::Functions::SignatureTag< Range(Domain), DerivativeTraitsT > │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ staticforloop.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/ │ │ │ │ │ │ - a00101.html │ │ │ │ │ │ - dune/functions/common/type_traits.hh │ │ │ │ │ │ + a00035.html │ │ │ │ │ │ + dune/functions/common/type_traits.hh │ │ │ │ │ │ dune/functions/functionspacebases/concepts.hh │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ treedata.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/ │ │ │ │ │ │ - a00125.html │ │ │ │ │ │ - dune/functions/gridfunctions/gridviewentityset.hh │ │ │ │ │ │ - dune/functions/gridfunctions/gridfunction.hh │ │ │ │ │ │ + a00074.html │ │ │ │ │ │ + dune/functions/gridfunctions/gridviewentityset.hh │ │ │ │ │ │ + dune/functions/gridfunctions/gridfunction.hh │ │ │ │ │ │ Dune::Functions::UniformNodeVisitor │ │ │ │ │ │ Dune::Functions::TreeData │ │ │ │ │ │ Dune::Functions::TreeData::InitVisitor │ │ │ │ │ │ Dune::Functions::TreeData::DestroyVisitor │ │ │ │ │ │ Dune::Functions::TreeData::CopyVisitor │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ type_traits.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/ │ │ │ │ │ │ - a00098.html │ │ │ │ │ │ + a00044.html │ │ │ │ │ │ Dune::Functions::HasStaticSize │ │ │ │ │ │ Dune::Functions::StaticSize │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ typeerasure.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/ │ │ │ │ │ │ - a00152.html │ │ │ │ │ │ - dune/functions/common/type_traits.hh │ │ │ │ │ │ - dune/functions/common/interfaces.hh │ │ │ │ │ │ - dune/functions/common/polymorphicsmallobject.hh │ │ │ │ │ │ + a00059.html │ │ │ │ │ │ + dune/functions/common/type_traits.hh │ │ │ │ │ │ + dune/functions/common/interfaces.hh │ │ │ │ │ │ + dune/functions/common/polymorphicsmallobject.hh │ │ │ │ │ │ Dune::Functions::TypeErasureBase │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ utility.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/ │ │ │ │ │ │ - a00116.html │ │ │ │ │ │ - dune/functions/common/functionconcepts.hh │ │ │ │ │ │ + a00038.html │ │ │ │ │ │ + dune/functions/common/functionconcepts.hh │ │ │ │ │ │ Dune::Functions::LastType │ │ │ │ │ │ Dune::Functions::RotateTuple │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ basistags.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00074.html │ │ │ │ │ │ + a00128.html │ │ │ │ │ │ Dune::Functions::Concept::IndexMergingStrategy │ │ │ │ │ │ Dune::Functions::BasisFactory::IndexMergingStrategy │ │ │ │ │ │ Dune::Functions::BasisFactory::FlatLexicographic │ │ │ │ │ │ Dune::Functions::BasisFactory::FlatInterleaved │ │ │ │ │ │ Dune::Functions::BasisFactory::BlockedLexicographic │ │ │ │ │ │ Dune::Functions::BasisFactory::BlockedInterleaved │ │ │ │ │ │ Dune │ │ │ │ │ │ @@ -281,59 +281,59 @@ │ │ │ │ │ │ Dune::Functions::Concept │ │ │ │ │ │ Dune::Functions::BasisFactory │ │ │ │ │ │ Dune::Functions::BasisBuilder │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ boundarydofs.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00035.html │ │ │ │ │ │ - dune/functions/functionspacebases/subentitydofs.hh │ │ │ │ │ │ + a00110.html │ │ │ │ │ │ + dune/functions/functionspacebases/subentitydofs.hh │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ brezzidouglasmarinibasis.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00020.html │ │ │ │ │ │ - dune/functions/functionspacebases/globalvaluedlocalfiniteelement.hh │ │ │ │ │ │ - dune/functions/functionspacebases/nodes.hh │ │ │ │ │ │ - dune/functions/functionspacebases/defaultglobalbasis.hh │ │ │ │ │ │ + a00131.html │ │ │ │ │ │ + dune/functions/functionspacebases/globalvaluedlocalfiniteelement.hh │ │ │ │ │ │ + dune/functions/functionspacebases/nodes.hh │ │ │ │ │ │ + dune/functions/functionspacebases/defaultglobalbasis.hh │ │ │ │ │ │ Dune::Functions::BrezziDouglasMariniPreBasis │ │ │ │ │ │ Dune::Functions::BrezziDouglasMariniNode │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ Dune::Functions::BasisFactory │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ bsplinebasis.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00026.html │ │ │ │ │ │ - dune/functions/functionspacebases/nodes.hh │ │ │ │ │ │ - dune/functions/functionspacebases/defaultglobalbasis.hh │ │ │ │ │ │ + a00149.html │ │ │ │ │ │ + dune/functions/functionspacebases/nodes.hh │ │ │ │ │ │ + dune/functions/functionspacebases/defaultglobalbasis.hh │ │ │ │ │ │ Dune::Functions::BSplineLocalBasis │ │ │ │ │ │ Dune::Functions::BSplineLocalCoefficients │ │ │ │ │ │ Dune::Functions::BSplineLocalInterpolation │ │ │ │ │ │ Dune::Functions::BSplineLocalFiniteElement │ │ │ │ │ │ Dune::Functions::BSplinePreBasis │ │ │ │ │ │ Dune::Functions::BSplineNode │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ Dune::Functions::BasisFactory │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ compositebasis.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00065.html │ │ │ │ │ │ - dune/functions/common/staticforloop.hh │ │ │ │ │ │ - dune/functions/common/type_traits.hh │ │ │ │ │ │ - dune/functions/common/utility.hh │ │ │ │ │ │ - dune/functions/functionspacebases/basistags.hh │ │ │ │ │ │ - dune/functions/functionspacebases/nodes.hh │ │ │ │ │ │ + a00098.html │ │ │ │ │ │ + dune/functions/common/staticforloop.hh │ │ │ │ │ │ + dune/functions/common/type_traits.hh │ │ │ │ │ │ + dune/functions/common/utility.hh │ │ │ │ │ │ + dune/functions/functionspacebases/basistags.hh │ │ │ │ │ │ + dune/functions/functionspacebases/nodes.hh │ │ │ │ │ │ dune/functions/functionspacebases/concepts.hh │ │ │ │ │ │ - dune/functions/functionspacebases/defaultglobalbasis.hh │ │ │ │ │ │ + dune/functions/functionspacebases/defaultglobalbasis.hh │ │ │ │ │ │ Dune::Functions::CompositePreBasis │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ Dune::Functions::BasisFactory │ │ │ │ │ │ Dune::Functions::BasisBuilder │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -346,16 +346,16 @@ │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ Dune::Functions::Concept │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ functionspacebases/concepts.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ a02876.html │ │ │ │ │ │ - dune/functions/common/utility.hh │ │ │ │ │ │ - dune/functions/functionspacebases/nodes.hh │ │ │ │ │ │ + dune/functions/common/utility.hh │ │ │ │ │ │ + dune/functions/functionspacebases/nodes.hh │ │ │ │ │ │ Dune::Functions::Concept::HasResize │ │ │ │ │ │ Dune::Functions::Concept::HasSizeMethod │ │ │ │ │ │ Dune::Functions::Concept::HasIndexAccess │ │ │ │ │ │ Dune::Functions::Concept::BasisNode │ │ │ │ │ │ Dune::Functions::Concept::LeafBasisNode │ │ │ │ │ │ Dune::Functions::Concept::PowerBasisNode │ │ │ │ │ │ Dune::Functions::Concept::CompositeBasisNode │ │ │ │ │ │ @@ -366,393 +366,393 @@ │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ Dune::Functions::Concept │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ defaultglobalbasis.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00089.html │ │ │ │ │ │ - dune/functions/common/type_traits.hh │ │ │ │ │ │ - dune/functions/functionspacebases/defaultlocalview.hh │ │ │ │ │ │ + a00125.html │ │ │ │ │ │ + dune/functions/common/type_traits.hh │ │ │ │ │ │ + dune/functions/functionspacebases/defaultlocalview.hh │ │ │ │ │ │ dune/functions/functionspacebases/concepts.hh │ │ │ │ │ │ Dune::Functions::DefaultGlobalBasis │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ Dune::Functions::BasisFactory │ │ │ │ │ │ Dune::Functions::BasisBuilder │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ defaultlocalview.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00086.html │ │ │ │ │ │ - dune/functions/common/overflowarray.hh │ │ │ │ │ │ - dune/functions/common/multiindex.hh │ │ │ │ │ │ + a00134.html │ │ │ │ │ │ + dune/functions/common/overflowarray.hh │ │ │ │ │ │ + dune/functions/common/multiindex.hh │ │ │ │ │ │ dune/functions/functionspacebases/concepts.hh │ │ │ │ │ │ Dune::Functions::DefaultLocalView │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ defaultnodetorangemap.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00032.html │ │ │ │ │ │ + a00158.html │ │ │ │ │ │ dune/functions/functionspacebases/concepts.hh │ │ │ │ │ │ Dune::Functions::DefaultNodeToRangeMap │ │ │ │ │ │ Dune::Functions::DefaultNodeToRangeMap::Visitor │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ flatmultiindex.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00068.html │ │ │ │ │ │ - dune/functions/common/multiindex.hh │ │ │ │ │ │ + a00140.html │ │ │ │ │ │ + dune/functions/common/multiindex.hh │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ flatvectorview.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00071.html │ │ │ │ │ │ + a00113.html │ │ │ │ │ │ dune/functions/functionspacebases/concepts.hh │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ globalvaluedlocalfiniteelement.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00038.html │ │ │ │ │ │ + a00116.html │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ hierarchicallagrangebasis.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00059.html │ │ │ │ │ │ - dune/functions/functionspacebases/nodes.hh │ │ │ │ │ │ - dune/functions/functionspacebases/defaultglobalbasis.hh │ │ │ │ │ │ + a00122.html │ │ │ │ │ │ + dune/functions/functionspacebases/nodes.hh │ │ │ │ │ │ + dune/functions/functionspacebases/defaultglobalbasis.hh │ │ │ │ │ │ Dune::Functions::HierarchicalLagrangePreBasis │ │ │ │ │ │ Dune::Functions::HierarchicalLagrangeNode │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ Dune::Functions::BasisFactory │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ hierarchicnodetorangemap.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00029.html │ │ │ │ │ │ + a00164.html │ │ │ │ │ │ dune/functions/functionspacebases/concepts.hh │ │ │ │ │ │ - dune/functions/common/indexaccess.hh │ │ │ │ │ │ + dune/functions/common/indexaccess.hh │ │ │ │ │ │ Dune::Functions::HierarchicNodeToRangeMap │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ hierarchicvectorwrapper.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00050.html │ │ │ │ │ │ - dune/functions/common/indexaccess.hh │ │ │ │ │ │ - dune/functions/common/utility.hh │ │ │ │ │ │ - dune/functions/common/type_traits.hh │ │ │ │ │ │ + a00155.html │ │ │ │ │ │ + dune/functions/common/indexaccess.hh │ │ │ │ │ │ + dune/functions/common/utility.hh │ │ │ │ │ │ + dune/functions/common/type_traits.hh │ │ │ │ │ │ dune/functions/functionspacebases/concepts.hh │ │ │ │ │ │ Dune::Functions::HierarchicVectorWrapper │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ interpolate.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00083.html │ │ │ │ │ │ - dune/functions/gridfunctions/gridviewfunction.hh │ │ │ │ │ │ - dune/functions/common/functionconcepts.hh │ │ │ │ │ │ + a00137.html │ │ │ │ │ │ + dune/functions/gridfunctions/gridviewfunction.hh │ │ │ │ │ │ + dune/functions/common/functionconcepts.hh │ │ │ │ │ │ dune/functions/backends/concepts.hh │ │ │ │ │ │ - dune/functions/backends/istlvectorbackend.hh │ │ │ │ │ │ - dune/functions/functionspacebases/sizeinfo.hh │ │ │ │ │ │ - dune/functions/functionspacebases/flatvectorview.hh │ │ │ │ │ │ - dune/functions/functionspacebases/hierarchicnodetorangemap.hh │ │ │ │ │ │ + dune/functions/backends/istlvectorbackend.hh │ │ │ │ │ │ + dune/functions/functionspacebases/sizeinfo.hh │ │ │ │ │ │ + dune/functions/functionspacebases/flatvectorview.hh │ │ │ │ │ │ + dune/functions/functionspacebases/hierarchicnodetorangemap.hh │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ lagrangebasis.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00062.html │ │ │ │ │ │ - dune/functions/functionspacebases/nodes.hh │ │ │ │ │ │ - dune/functions/functionspacebases/defaultglobalbasis.hh │ │ │ │ │ │ + a00104.html │ │ │ │ │ │ + dune/functions/functionspacebases/nodes.hh │ │ │ │ │ │ + dune/functions/functionspacebases/defaultglobalbasis.hh │ │ │ │ │ │ Dune::Functions::LagrangePreBasis │ │ │ │ │ │ Dune::Functions::LagrangeNode │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ Dune::Functions::BasisFactory │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ lagrangedgbasis.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00056.html │ │ │ │ │ │ - dune/functions/functionspacebases/nodes.hh │ │ │ │ │ │ - dune/functions/functionspacebases/defaultglobalbasis.hh │ │ │ │ │ │ - dune/functions/functionspacebases/lagrangebasis.hh │ │ │ │ │ │ + a00179.html │ │ │ │ │ │ + dune/functions/functionspacebases/nodes.hh │ │ │ │ │ │ + dune/functions/functionspacebases/defaultglobalbasis.hh │ │ │ │ │ │ + dune/functions/functionspacebases/lagrangebasis.hh │ │ │ │ │ │ Dune::Functions::LagrangeDGPreBasis │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ Dune::Functions::BasisFactory │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ nedelecbasis.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00041.html │ │ │ │ │ │ - dune/functions/functionspacebases/defaultglobalbasis.hh │ │ │ │ │ │ - dune/functions/functionspacebases/globalvaluedlocalfiniteelement.hh │ │ │ │ │ │ - dune/functions/functionspacebases/nodes.hh │ │ │ │ │ │ + a00167.html │ │ │ │ │ │ + dune/functions/functionspacebases/defaultglobalbasis.hh │ │ │ │ │ │ + dune/functions/functionspacebases/globalvaluedlocalfiniteelement.hh │ │ │ │ │ │ + dune/functions/functionspacebases/nodes.hh │ │ │ │ │ │ Dune::Functions::NedelecPreBasis │ │ │ │ │ │ Dune::Functions::NedelecNode │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ Dune::Functions::BasisFactory │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ nodes.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00095.html │ │ │ │ │ │ + a00119.html │ │ │ │ │ │ Dune::Functions::BasisNodeMixin │ │ │ │ │ │ Dune::Functions::LeafBasisNode │ │ │ │ │ │ Dune::Functions::PowerBasisNode │ │ │ │ │ │ Dune::Functions::CompositeBasisNode │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ periodicbasis.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00080.html │ │ │ │ │ │ + a00176.html │ │ │ │ │ │ dune/functions/functionspacebases/concepts.hh │ │ │ │ │ │ - dune/functions/functionspacebases/transformedindexbasis.hh │ │ │ │ │ │ + dune/functions/functionspacebases/transformedindexbasis.hh │ │ │ │ │ │ Dune::Functions::BasisFactory::Experimental::PeriodicIndexSet │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ Dune::Functions::BasisFactory │ │ │ │ │ │ Dune::Functions::BasisFactory::Experimental │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ powerbasis.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00023.html │ │ │ │ │ │ - dune/functions/common/utility.hh │ │ │ │ │ │ - dune/functions/common/type_traits.hh │ │ │ │ │ │ - dune/functions/functionspacebases/basistags.hh │ │ │ │ │ │ - dune/functions/functionspacebases/nodes.hh │ │ │ │ │ │ + a00095.html │ │ │ │ │ │ + dune/functions/common/utility.hh │ │ │ │ │ │ + dune/functions/common/type_traits.hh │ │ │ │ │ │ + dune/functions/functionspacebases/basistags.hh │ │ │ │ │ │ + dune/functions/functionspacebases/nodes.hh │ │ │ │ │ │ dune/functions/functionspacebases/concepts.hh │ │ │ │ │ │ - dune/functions/functionspacebases/defaultglobalbasis.hh │ │ │ │ │ │ + dune/functions/functionspacebases/defaultglobalbasis.hh │ │ │ │ │ │ Dune::Functions::PowerPreBasis │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ Dune::Functions::BasisFactory │ │ │ │ │ │ Dune::Functions::BasisBuilder │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ rannacherturekbasis.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00014.html │ │ │ │ │ │ - dune/functions/functionspacebases/nodes.hh │ │ │ │ │ │ - dune/functions/functionspacebases/defaultglobalbasis.hh │ │ │ │ │ │ + a00170.html │ │ │ │ │ │ + dune/functions/functionspacebases/nodes.hh │ │ │ │ │ │ + dune/functions/functionspacebases/defaultglobalbasis.hh │ │ │ │ │ │ Dune::Functions::RannacherTurekPreBasis │ │ │ │ │ │ Dune::Functions::RannacherTurekNode │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ Dune::Functions::BasisFactory │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ raviartthomasbasis.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00053.html │ │ │ │ │ │ - dune/functions/functionspacebases/globalvaluedlocalfiniteelement.hh │ │ │ │ │ │ - dune/functions/functionspacebases/nodes.hh │ │ │ │ │ │ - dune/functions/functionspacebases/defaultglobalbasis.hh │ │ │ │ │ │ + a00143.html │ │ │ │ │ │ + dune/functions/functionspacebases/globalvaluedlocalfiniteelement.hh │ │ │ │ │ │ + dune/functions/functionspacebases/nodes.hh │ │ │ │ │ │ + dune/functions/functionspacebases/defaultglobalbasis.hh │ │ │ │ │ │ Dune::Functions::RaviartThomasPreBasis │ │ │ │ │ │ Dune::Functions::RaviartThomasNode │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ Dune::Functions::BasisFactory │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ sizeinfo.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00047.html │ │ │ │ │ │ + a00173.html │ │ │ │ │ │ Dune::Functions::SizeInfo │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ subentitydofs.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00077.html │ │ │ │ │ │ + a00152.html │ │ │ │ │ │ Dune::Functions::SubEntityDOFs │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ subspacebasis.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00044.html │ │ │ │ │ │ - dune/functions/common/type_traits.hh │ │ │ │ │ │ - dune/functions/functionspacebases/subspacelocalview.hh │ │ │ │ │ │ + a00182.html │ │ │ │ │ │ + dune/functions/common/type_traits.hh │ │ │ │ │ │ + dune/functions/functionspacebases/subspacelocalview.hh │ │ │ │ │ │ dune/functions/functionspacebases/concepts.hh │ │ │ │ │ │ Dune::Functions::SubspaceBasis │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ subspacelocalview.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00092.html │ │ │ │ │ │ + a00107.html │ │ │ │ │ │ dune/functions/functionspacebases/concepts.hh │ │ │ │ │ │ Dune::Functions::SubspaceLocalView │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ taylorhoodbasis.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00017.html │ │ │ │ │ │ - dune/functions/functionspacebases/nodes.hh │ │ │ │ │ │ - dune/functions/functionspacebases/lagrangebasis.hh │ │ │ │ │ │ - dune/functions/functionspacebases/defaultglobalbasis.hh │ │ │ │ │ │ + a00101.html │ │ │ │ │ │ + dune/functions/functionspacebases/nodes.hh │ │ │ │ │ │ + dune/functions/functionspacebases/lagrangebasis.hh │ │ │ │ │ │ + dune/functions/functionspacebases/defaultglobalbasis.hh │ │ │ │ │ │ Dune::Functions::TaylorHoodPreBasis │ │ │ │ │ │ Dune::Functions::TaylorHoodVelocityTree │ │ │ │ │ │ Dune::Functions::TaylorHoodBasisTree │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ Dune::Functions::BasisFactory │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ transformedindexbasis.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/ │ │ │ │ │ │ - a00008.html │ │ │ │ │ │ - dune/functions/common/staticforloop.hh │ │ │ │ │ │ - dune/functions/common/type_traits.hh │ │ │ │ │ │ - dune/functions/common/utility.hh │ │ │ │ │ │ - dune/functions/functionspacebases/basistags.hh │ │ │ │ │ │ - dune/functions/functionspacebases/nodes.hh │ │ │ │ │ │ + a00146.html │ │ │ │ │ │ + dune/functions/common/staticforloop.hh │ │ │ │ │ │ + dune/functions/common/type_traits.hh │ │ │ │ │ │ + dune/functions/common/utility.hh │ │ │ │ │ │ + dune/functions/functionspacebases/basistags.hh │ │ │ │ │ │ + dune/functions/functionspacebases/nodes.hh │ │ │ │ │ │ dune/functions/functionspacebases/concepts.hh │ │ │ │ │ │ - dune/functions/functionspacebases/defaultglobalbasis.hh │ │ │ │ │ │ + dune/functions/functionspacebases/defaultglobalbasis.hh │ │ │ │ │ │ Dune::Functions::Experimental::TransformedIndexPreBasis │ │ │ │ │ │ Dune::Functions::BasisFactory::Experimental::GenericIndexingTransformation │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ Dune::Functions::Experimental │ │ │ │ │ │ Dune::Functions::BasisFactory │ │ │ │ │ │ Dune::Functions::BasisFactory::Experimental │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ analyticgridviewfunction.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/gridfunctions/ │ │ │ │ │ │ - a00170.html │ │ │ │ │ │ - dune/functions/common/signature.hh │ │ │ │ │ │ - dune/functions/common/defaultderivativetraits.hh │ │ │ │ │ │ - dune/functions/common/differentiablefunction_imp.hh │ │ │ │ │ │ - dune/functions/common/differentiablefunction.hh │ │ │ │ │ │ - dune/functions/gridfunctions/gridviewentityset.hh │ │ │ │ │ │ - dune/functions/gridfunctions/localderivativetraits.hh │ │ │ │ │ │ + a00017.html │ │ │ │ │ │ + dune/functions/common/signature.hh │ │ │ │ │ │ + dune/functions/common/defaultderivativetraits.hh │ │ │ │ │ │ + dune/functions/common/differentiablefunction_imp.hh │ │ │ │ │ │ + dune/functions/common/differentiablefunction.hh │ │ │ │ │ │ + dune/functions/gridfunctions/gridviewentityset.hh │ │ │ │ │ │ + dune/functions/gridfunctions/localderivativetraits.hh │ │ │ │ │ │ Dune::Functions::AnalyticGridViewFunction< Range(Domain), GV, F, DerivativeTraits > │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ composedgridfunction.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/gridfunctions/ │ │ │ │ │ │ - a00185.html │ │ │ │ │ │ - dune/functions/common/defaultderivativetraits.hh │ │ │ │ │ │ - dune/functions/common/differentiablefunction.hh │ │ │ │ │ │ - dune/functions/gridfunctions/gridfunction.hh │ │ │ │ │ │ + a00005.html │ │ │ │ │ │ + dune/functions/common/defaultderivativetraits.hh │ │ │ │ │ │ + dune/functions/common/differentiablefunction.hh │ │ │ │ │ │ + dune/functions/gridfunctions/gridfunction.hh │ │ │ │ │ │ Dune::Functions::ComposedGridFunction │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ discreteglobalbasisfunction.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/gridfunctions/ │ │ │ │ │ │ - a00176.html │ │ │ │ │ │ - dune/functions/functionspacebases/hierarchicnodetorangemap.hh │ │ │ │ │ │ - dune/functions/functionspacebases/flatvectorview.hh │ │ │ │ │ │ - dune/functions/gridfunctions/gridviewentityset.hh │ │ │ │ │ │ - dune/functions/gridfunctions/gridfunction.hh │ │ │ │ │ │ + a00020.html │ │ │ │ │ │ + dune/functions/functionspacebases/hierarchicnodetorangemap.hh │ │ │ │ │ │ + dune/functions/functionspacebases/flatvectorview.hh │ │ │ │ │ │ + dune/functions/gridfunctions/gridviewentityset.hh │ │ │ │ │ │ + dune/functions/gridfunctions/gridfunction.hh │ │ │ │ │ │ dune/functions/backends/concepts.hh │ │ │ │ │ │ - dune/functions/backends/istlvectorbackend.hh │ │ │ │ │ │ + dune/functions/backends/istlvectorbackend.hh │ │ │ │ │ │ Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase │ │ │ │ │ │ Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::Data │ │ │ │ │ │ Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase │ │ │ │ │ │ Dune::Functions::DiscreteGlobalBasisFunction │ │ │ │ │ │ Dune::Functions::DiscreteGlobalBasisFunction::LocalFunction │ │ │ │ │ │ Dune::Functions::DiscreteGlobalBasisFunctionDerivative │ │ │ │ │ │ Dune::Functions::DiscreteGlobalBasisFunctionDerivative::LocalFunction │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ Dune::Functions::ImplDoc │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ facenormalgridfunction.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/gridfunctions/ │ │ │ │ │ │ - a00188.html │ │ │ │ │ │ - dune/functions/gridfunctions/gridfunction.hh │ │ │ │ │ │ - dune/functions/gridfunctions/gridviewentityset.hh │ │ │ │ │ │ + a00002.html │ │ │ │ │ │ + dune/functions/gridfunctions/gridfunction.hh │ │ │ │ │ │ + dune/functions/gridfunctions/gridviewentityset.hh │ │ │ │ │ │ Dune::Functions::FaceNormalGridFunction │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ gridfunction.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/gridfunctions/ │ │ │ │ │ │ - a00182.html │ │ │ │ │ │ - dune/functions/common/typeerasure.hh │ │ │ │ │ │ - dune/functions/common/defaultderivativetraits.hh │ │ │ │ │ │ - dune/functions/common/differentiablefunction.hh │ │ │ │ │ │ - dune/functions/common/localfunction.hh │ │ │ │ │ │ - dune/functions/common/functionconcepts.hh │ │ │ │ │ │ - dune/functions/gridfunctions/localderivativetraits.hh │ │ │ │ │ │ - dune/functions/gridfunctions/gridfunction_imp.hh │ │ │ │ │ │ + a00008.html │ │ │ │ │ │ + dune/functions/common/typeerasure.hh │ │ │ │ │ │ + dune/functions/common/defaultderivativetraits.hh │ │ │ │ │ │ + dune/functions/common/differentiablefunction.hh │ │ │ │ │ │ + dune/functions/common/localfunction.hh │ │ │ │ │ │ + dune/functions/common/functionconcepts.hh │ │ │ │ │ │ + dune/functions/gridfunctions/localderivativetraits.hh │ │ │ │ │ │ + dune/functions/gridfunctions/gridfunction_imp.hh │ │ │ │ │ │ Dune::Functions::GridFunction │ │ │ │ │ │ Dune::Functions::GridFunction< Range(Domain), ES, DerivativeTraits, bufferSize > │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ gridfunction_imp.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/gridfunctions/ │ │ │ │ │ │ - a00191.html │ │ │ │ │ │ - dune/functions/common/type_traits.hh │ │ │ │ │ │ - dune/functions/common/interfaces.hh │ │ │ │ │ │ - dune/functions/common/differentiablefunction_imp.hh │ │ │ │ │ │ + a00011.html │ │ │ │ │ │ + dune/functions/common/type_traits.hh │ │ │ │ │ │ + dune/functions/common/interfaces.hh │ │ │ │ │ │ + dune/functions/common/differentiablefunction_imp.hh │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ gridviewentityset.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/gridfunctions/ │ │ │ │ │ │ - a00173.html │ │ │ │ │ │ + a00026.html │ │ │ │ │ │ Dune::Functions::GridViewEntitySet │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ gridviewfunction.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/gridfunctions/ │ │ │ │ │ │ - a00167.html │ │ │ │ │ │ - dune/functions/gridfunctions/gridfunction.hh │ │ │ │ │ │ - dune/functions/gridfunctions/gridviewentityset.hh │ │ │ │ │ │ - dune/functions/gridfunctions/analyticgridviewfunction.hh │ │ │ │ │ │ + a00023.html │ │ │ │ │ │ + dune/functions/gridfunctions/gridfunction.hh │ │ │ │ │ │ + dune/functions/gridfunctions/gridviewentityset.hh │ │ │ │ │ │ + dune/functions/gridfunctions/analyticgridviewfunction.hh │ │ │ │ │ │ Dune::Functions::GridViewFunction │ │ │ │ │ │ Dune::Functions::GridViewFunction< Range(Domain), GV, DerivativeTraits, bufferSize > │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ localderivativetraits.hh │ │ │ │ │ │ /build/reproducible-path/dune-functions-2.9.0/dune/functions/gridfunctions/ │ │ │ │ │ │ - a00179.html │ │ │ │ │ │ - dune/functions/common/defaultderivativetraits.hh │ │ │ │ │ │ + a00014.html │ │ │ │ │ │ + dune/functions/common/defaultderivativetraits.hh │ │ │ │ │ │ Dune::Functions::LocalDerivativeTraits │ │ │ │ │ │ Dune::Functions::LocalDerivativeTraits::Traits │ │ │ │ │ │ Dune::Functions::LocalDerivativeTraits::Traits< R(LocalDomain)> │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/files.html │ │ │ │ @@ -75,83 +75,83 @@ │ │ │ │
Here is a list of all files with brief descriptions:
│ │ │ │
[detail level 1234]
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
  doc
 doxygen
  dune
  functions
  analyticfunctions
 polynomial.hh
 trigonometricfunction.hh
 polynomial.hh
 trigonometricfunction.hh
  backends
 concepts.hh
 istlvectorbackend.hh
 istlvectorbackend.hh
  common
 callable.hh
 defaultderivativetraits.hh
 differentiablefunction.hh
 differentiablefunction_imp.hh
 differentiablefunctionfromcallables.hh
 functionconcepts.hh
 functionfromcallable.hh
 indexaccess.hh
 interfaces.hh
 localfunction.hh
 localfunction_imp.hh
 multiindex.hh
 overflowarray.hh
 polymorphicsmallobject.hh
 referencehelper.hh
 reserveddeque.hhAn stl-compliant double-ended queue which stores everything on the stack
 signature.hh
 staticforloop.hh
 treedata.hh
 type_traits.hh
 typeerasure.hh
 utility.hh
 callable.hh
 defaultderivativetraits.hh
 differentiablefunction.hh
 differentiablefunction_imp.hh
 differentiablefunctionfromcallables.hh
 functionconcepts.hh
 functionfromcallable.hh
 indexaccess.hh
 interfaces.hh
 localfunction.hh
 localfunction_imp.hh
 multiindex.hh
 overflowarray.hh
 polymorphicsmallobject.hh
 referencehelper.hh
 reserveddeque.hhAn stl-compliant double-ended queue which stores everything on the stack
 signature.hh
 staticforloop.hh
 treedata.hh
 type_traits.hh
 typeerasure.hh
 utility.hh
  functionspacebases
 basistags.hh
 boundarydofs.hh
 brezzidouglasmarinibasis.hh
 bsplinebasis.hhThe B-spline global function space basis
 compositebasis.hh
 basistags.hh
 boundarydofs.hh
 brezzidouglasmarinibasis.hh
 bsplinebasis.hhThe B-spline global function space basis
 compositebasis.hh
 concepts.hh
 defaultglobalbasis.hh
 defaultlocalview.hh
 defaultnodetorangemap.hh
 flatmultiindex.hh
 flatvectorview.hh
 globalvaluedlocalfiniteelement.hh
 hierarchicallagrangebasis.hh
 hierarchicnodetorangemap.hh
 hierarchicvectorwrapper.hh
 interpolate.hh
 lagrangebasis.hh
 lagrangedgbasis.hh
 nedelecbasis.hh
 nodes.hh
 periodicbasis.hh
 powerbasis.hh
 rannacherturekbasis.hh
 raviartthomasbasis.hh
 sizeinfo.hh
 subentitydofs.hh
 subspacebasis.hh
 subspacelocalview.hh
 taylorhoodbasis.hh
 transformedindexbasis.hh
 defaultglobalbasis.hh
 defaultlocalview.hh
 defaultnodetorangemap.hh
 flatmultiindex.hh
 flatvectorview.hh
 globalvaluedlocalfiniteelement.hh
 hierarchicallagrangebasis.hh
 hierarchicnodetorangemap.hh
 hierarchicvectorwrapper.hh
 interpolate.hh
 lagrangebasis.hh
 lagrangedgbasis.hh
 nedelecbasis.hh
 nodes.hh
 periodicbasis.hh
 powerbasis.hh
 rannacherturekbasis.hh
 raviartthomasbasis.hh
 sizeinfo.hh
 subentitydofs.hh
 subspacebasis.hh
 subspacelocalview.hh
 taylorhoodbasis.hh
 transformedindexbasis.hh
  gridfunctions
 analyticgridviewfunction.hh
 composedgridfunction.hh
 discreteglobalbasisfunction.hh
 facenormalgridfunction.hh
 gridfunction.hh
 gridfunction_imp.hh
 gridviewentityset.hh
 gridviewfunction.hh
 localderivativetraits.hh
 analyticgridviewfunction.hh
 composedgridfunction.hh
 discreteglobalbasisfunction.hh
 facenormalgridfunction.hh
 gridfunction.hh
 gridfunction_imp.hh
 gridviewentityset.hh
 gridviewfunction.hh
 localderivativetraits.hh
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/globals.html │ │ │ │ @@ -66,15 +66,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
Here is a list of all file members with links to the files they belong to:
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-functions-doc/doxygen/globals_defs.html │ │ │ │ @@ -66,15 +66,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
Here is a list of all macros with links to the files they belong to:
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ --- ./usr/share/doc/libdune-functions-doc/doxygen/a00161.html │ │ │ ├── +++ ./usr/share/doc/libdune-functions-doc/doxygen/a00011.html │ │ │ │┄ Files 7% similar despite different names │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: differentiablefunction_imp.hh File Reference │ │ │ │ +dune-functions: gridfunction_imp.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,28 +65,28 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Namespaces
│ │ │ │ -
differentiablefunction_imp.hh File Reference
│ │ │ │ +
gridfunction_imp.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <dune/common/exceptions.hh>
│ │ │ │ -#include <dune/common/concept.hh>
│ │ │ │ -#include <dune/functions/common/type_traits.hh>
│ │ │ │ +
#include <dune/functions/common/type_traits.hh>
│ │ │ │ +#include <dune/functions/common/interfaces.hh>
│ │ │ │ +#include <dune/functions/common/differentiablefunction_imp.hh>
│ │ │ │
│ │ │ │ -

Go to the source code of this file.

│ │ │ │ +

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,19 +1,19 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ │ _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -differentiablefunction_imp.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +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> │ │ │ │ │ _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 │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ │ --- ./usr/share/doc/libdune-functions-doc/doxygen/a00161_source.html │ │ │ ├── +++ ./usr/share/doc/libdune-functions-doc/doxygen/a00011_source.html │ │ │ │┄ Files 24% similar despite different names │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-functions: differentiablefunction_imp.hh Source File │ │ │ │ +dune-functions: gridfunction_imp.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,119 +70,91 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
differentiablefunction_imp.hh
│ │ │ │ +
gridfunction_imp.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#ifndef DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH
│ │ │ │ -
4#define DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH
│ │ │ │ +
3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH
│ │ │ │ +
4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH
│ │ │ │
5
│ │ │ │ -
6#include <dune/common/exceptions.hh>
│ │ │ │ -
7#include <dune/common/concept.hh>
│ │ │ │ -
8
│ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
9
│ │ │ │
10
│ │ │ │
11
│ │ │ │
12namespace Dune {
│ │ │ │
13namespace Functions {
│ │ │ │
14namespace Imp {
│ │ │ │
15
│ │ │ │ -
19struct HasFreeDerivative
│ │ │ │ +
19struct HasFreeLocalFunction
│ │ │ │
20{
│ │ │ │
21 template<class F>
│ │ │ │
22 auto require(F&& f) -> decltype(
│ │ │ │ -
23 derivative(f)
│ │ │ │ +
23 localFunction(f)
│ │ │ │
24 );
│ │ │ │
25};
│ │ │ │
26
│ │ │ │
27
│ │ │ │
28
│ │ │ │ -
29template<class Dummy, class F,
│ │ │ │ -
30 typename std::enable_if<
│ │ │ │ -
31 models< HasFreeDerivative, F>() , int>::type = 0>
│ │ │ │ -
32auto derivativeIfImplemented(const F& f) -> decltype(derivative(f))
│ │ │ │ -
33{
│ │ │ │ -
34 return derivative(f);
│ │ │ │ -
35}
│ │ │ │ -
36
│ │ │ │ -
37
│ │ │ │ -
38
│ │ │ │ -
39template<class Dummy, class F,
│ │ │ │ -
40 typename std::enable_if<
│ │ │ │ -
41 not(models< HasFreeDerivative, F>()) , int>::type = 0>
│ │ │ │ -
42Dummy derivativeIfImplemented(const F& f)
│ │ │ │ -
43{
│ │ │ │ -
44 DUNE_THROW(Dune::NotImplemented, "Derivative not implemented");
│ │ │ │ -
45}
│ │ │ │ -
46
│ │ │ │ -
47
│ │ │ │ -
48
│ │ │ │ -
49template<class Signature, class DerivativeInterface>
│ │ │ │ -
50class DifferentiableFunctionWrapperInterface
│ │ │ │ -
51{};
│ │ │ │ +
29// Interface of type erasure wrapper
│ │ │ │ +
30//
│ │ │ │ +
31// Notice that the basic interface of polymorphic classes (destructor, clone, ...)
│ │ │ │ +
32// will be added by the type erasure foundation classes.
│ │ │ │ +
33template<class Signature, class DerivativeInterface, class LocalFunctionInterface, class EntitySet>
│ │ │ │ +
34class GridFunctionWrapperInterface :
│ │ │ │ +
35 public DifferentiableFunctionWrapperInterface<Signature, DerivativeInterface>
│ │ │ │ +
36{
│ │ │ │ +
37public:
│ │ │ │ +
38 virtual LocalFunctionInterface wrappedLocalFunction() const = 0;
│ │ │ │ +
39
│ │ │ │ +
40 virtual const EntitySet& wrappedEntitySet() const = 0;
│ │ │ │ +
41};
│ │ │ │ +
42
│ │ │ │ +
43
│ │ │ │ +
44// Implementation of type erasure wrapper
│ │ │ │ +
45template<class Signature, class DerivativeInterface, class LocalFunctionInterface, class EntitySet, class B>
│ │ │ │ +
46class GridFunctionWrapperImplementation :
│ │ │ │ +
47 public DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>
│ │ │ │ +
48{
│ │ │ │ +
49 using Base = DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>;
│ │ │ │ +
50public:
│ │ │ │ +
51 using Base::Base;
│ │ │ │
52
│ │ │ │ -
53// Interface of type erasure wrapper
│ │ │ │ -
54//
│ │ │ │ -
55// Notice that the basic interface of polymorphic classes (destructor, clone, ...)
│ │ │ │ -
56// will be added by the type erasure foundation classes.
│ │ │ │ -
57template<class Range, class Domain, class DerivativeInterface>
│ │ │ │ -
58class DifferentiableFunctionWrapperInterface<Range(Domain), DerivativeInterface>
│ │ │ │ -
59{
│ │ │ │ -
60public:
│ │ │ │ -
61 virtual Range operator() (const Domain& x) const = 0;
│ │ │ │ -
62
│ │ │ │ -
63 virtual DerivativeInterface derivative() const = 0;
│ │ │ │ -
64};
│ │ │ │ +
53 virtual LocalFunctionInterface wrappedLocalFunction() const
│ │ │ │ +
54 {
│ │ │ │ +
55 return localFunction(this->get());
│ │ │ │ +
56 }
│ │ │ │ +
57
│ │ │ │ +
58 virtual const EntitySet& wrappedEntitySet() const
│ │ │ │ +
59 {
│ │ │ │ +
60 return this->get().entitySet();
│ │ │ │ +
61 }
│ │ │ │ +
62};
│ │ │ │ +
63
│ │ │ │ +
64
│ │ │ │
65
│ │ │ │ -
66
│ │ │ │ +
66}}} // namespace Dune::Functions::Imp
│ │ │ │
67
│ │ │ │ -
68template<class Signature, class DerivativeInterface, class B>
│ │ │ │ -
69class DifferentiableFunctionWrapperImplementation
│ │ │ │ -
70{};
│ │ │ │ -
71
│ │ │ │ -
72// Implementation of type erasure wrapper
│ │ │ │ -
73template<class Range, class Domain, class DerivativeInterface, class B>
│ │ │ │ -
74class DifferentiableFunctionWrapperImplementation< Range(Domain), DerivativeInterface, B> :
│ │ │ │ -
75 public B
│ │ │ │ -
76{
│ │ │ │ -
77public:
│ │ │ │ -
78
│ │ │ │ -
79 using B::B;
│ │ │ │ -
80 using Wrapped = typename B::Wrapped;
│ │ │ │ -
81
│ │ │ │ -
82 virtual Range operator() (const Domain& x) const
│ │ │ │ -
83 {
│ │ │ │ -
84 return this->get()(x);
│ │ │ │ -
85 }
│ │ │ │ -
86
│ │ │ │ -
87 virtual DerivativeInterface derivative() const
│ │ │ │ -
88 {
│ │ │ │ -
89 return derivativeIfImplemented<DerivativeInterface, Wrapped>(this->get());
│ │ │ │ -
90 }
│ │ │ │ -
91};
│ │ │ │ -
92
│ │ │ │ -
93
│ │ │ │ -
94
│ │ │ │ -
95}}} // namespace Dune::Functions::Imp
│ │ │ │ -
96
│ │ │ │ -
97
│ │ │ │ -
98
│ │ │ │ -
99#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:39
│ │ │ │ +
68
│ │ │ │ +
69
│ │ │ │ +
70#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
Definition polynomial.hh:10
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,118 +1,89 @@ │ │ │ │ │ dune-functions 2.9.0 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _f_u_n_c_t_i_o_n_s │ │ │ │ │ - * _c_o_m_m_o_n │ │ │ │ │ -differentiablefunction_imp.hh │ │ │ │ │ + * _g_r_i_d_f_u_n_c_t_i_o_n_s │ │ │ │ │ +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#ifndef DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH │ │ │ │ │ -4#define DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH │ │ │ │ │ +3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH │ │ │ │ │ +4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH │ │ │ │ │ 5 │ │ │ │ │ -6#include │ │ │ │ │ -7#include │ │ │ │ │ -8 │ │ │ │ │ -9#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> │ │ │ │ │ +6#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> │ │ │ │ │ +7#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> │ │ │ │ │ +8#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> │ │ │ │ │ +9 │ │ │ │ │ 10 │ │ │ │ │ 11 │ │ │ │ │ 12namespace _D_u_n_e { │ │ │ │ │ 13namespace Functions { │ │ │ │ │ 14namespace Imp { │ │ │ │ │ 15 │ │ │ │ │ -19struct HasFreeDerivative │ │ │ │ │ +19struct HasFreeLocalFunction │ │ │ │ │ 20{ │ │ │ │ │ 21 template │ │ │ │ │ 22 auto require(F&& f) -> decltype( │ │ │ │ │ -23 _d_e_r_i_v_a_t_i_v_e(f) │ │ │ │ │ +23 localFunction(f) │ │ │ │ │ 24 ); │ │ │ │ │ 25}; │ │ │ │ │ 26 │ │ │ │ │ 27 │ │ │ │ │ 28 │ │ │ │ │ -29template() , int>::type = 0> │ │ │ │ │ -32auto derivativeIfImplemented(const F& f) -> decltype(_d_e_r_i_v_a_t_i_v_e(f)) │ │ │ │ │ -33{ │ │ │ │ │ -34 return _d_e_r_i_v_a_t_i_v_e(f); │ │ │ │ │ -35} │ │ │ │ │ -36 │ │ │ │ │ -37 │ │ │ │ │ -38 │ │ │ │ │ -39template()) , int>::type = 0> │ │ │ │ │ -42Dummy derivativeIfImplemented(const F& f) │ │ │ │ │ -43{ │ │ │ │ │ -44 DUNE_THROW(Dune::NotImplemented, "Derivative not implemented"); │ │ │ │ │ -45} │ │ │ │ │ -46 │ │ │ │ │ -47 │ │ │ │ │ -48 │ │ │ │ │ -49template │ │ │ │ │ -50class DifferentiableFunctionWrapperInterface │ │ │ │ │ -51{}; │ │ │ │ │ -52 │ │ │ │ │ -53// Interface of type erasure wrapper │ │ │ │ │ -54// │ │ │ │ │ -55// Notice that the basic interface of polymorphic classes (destructor, clone, │ │ │ │ │ +29// Interface of type erasure wrapper │ │ │ │ │ +30// │ │ │ │ │ +31// Notice that the basic interface of polymorphic classes (destructor, clone, │ │ │ │ │ ...) │ │ │ │ │ -56// will be added by the type erasure foundation classes. │ │ │ │ │ -57template │ │ │ │ │ -58class DifferentiableFunctionWrapperInterface │ │ │ │ │ +34class GridFunctionWrapperInterface : │ │ │ │ │ +35 public DifferentiableFunctionWrapperInterface │ │ │ │ │ -59{ │ │ │ │ │ -60public: │ │ │ │ │ -61 virtual Range operator() (const Domain& x) const = 0; │ │ │ │ │ -62 │ │ │ │ │ -63 virtual DerivativeInterface _d_e_r_i_v_a_t_i_v_e() const = 0; │ │ │ │ │ -64}; │ │ │ │ │ +36{ │ │ │ │ │ +37public: │ │ │ │ │ +38 virtual LocalFunctionInterface wrappedLocalFunction() const = 0; │ │ │ │ │ +39 │ │ │ │ │ +40 virtual const EntitySet& wrappedEntitySet() const = 0; │ │ │ │ │ +41}; │ │ │ │ │ +42 │ │ │ │ │ +43 │ │ │ │ │ +44// Implementation of type erasure wrapper │ │ │ │ │ +45template │ │ │ │ │ +46class GridFunctionWrapperImplementation : │ │ │ │ │ +47 public DifferentiableFunctionWrapperImplementation │ │ │ │ │ +48{ │ │ │ │ │ +49 using Base = DifferentiableFunctionWrapperImplementation; │ │ │ │ │ +50public: │ │ │ │ │ +51 using Base::Base; │ │ │ │ │ +52 │ │ │ │ │ +53 virtual LocalFunctionInterface wrappedLocalFunction() const │ │ │ │ │ +54 { │ │ │ │ │ +55 return localFunction(this->get()); │ │ │ │ │ +56 } │ │ │ │ │ +57 │ │ │ │ │ +58 virtual const EntitySet& wrappedEntitySet() const │ │ │ │ │ +59 { │ │ │ │ │ +60 return this->get().entitySet(); │ │ │ │ │ +61 } │ │ │ │ │ +62}; │ │ │ │ │ +63 │ │ │ │ │ +64 │ │ │ │ │ 65 │ │ │ │ │ -66 │ │ │ │ │ +66}}} // namespace Dune::Functions::Imp │ │ │ │ │ 67 │ │ │ │ │ -68template │ │ │ │ │ -69class DifferentiableFunctionWrapperImplementation │ │ │ │ │ -70{}; │ │ │ │ │ -71 │ │ │ │ │ -72// Implementation of type erasure wrapper │ │ │ │ │ -73template │ │ │ │ │ -74class DifferentiableFunctionWrapperImplementation< Range(Domain), │ │ │ │ │ -DerivativeInterface, B> : │ │ │ │ │ -75 public B │ │ │ │ │ -76{ │ │ │ │ │ -77public: │ │ │ │ │ -78 │ │ │ │ │ -79 using B::B; │ │ │ │ │ -80 using Wrapped = typename B::Wrapped; │ │ │ │ │ -81 │ │ │ │ │ -82 virtual Range operator() (const Domain& x) const │ │ │ │ │ -83 { │ │ │ │ │ -84 return this->get()(x); │ │ │ │ │ -85 } │ │ │ │ │ -86 │ │ │ │ │ -87 virtual DerivativeInterface _d_e_r_i_v_a_t_i_v_e() const │ │ │ │ │ -88 { │ │ │ │ │ -89 return derivativeIfImplemented(this->get()); │ │ │ │ │ -90 } │ │ │ │ │ -91}; │ │ │ │ │ -92 │ │ │ │ │ -93 │ │ │ │ │ -94 │ │ │ │ │ -95}}} // namespace Dune::Functions::Imp │ │ │ │ │ -96 │ │ │ │ │ -97 │ │ │ │ │ -98 │ │ │ │ │ -99#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH │ │ │ │ │ +68 │ │ │ │ │ +69 │ │ │ │ │ +70#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_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:39 │ │ │ │ │ +_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 │ │ │ │ │ +_i_n_t_e_r_f_a_c_e_s_._h_h │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn polynomial.hh:10 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::Functions